cognova 0.2.26 → 0.2.28
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{CxNJcty6.js → -XfM4jpu.js} +1 -1
- package/.output/public/_nuxt/0L-9iIbm.js +1 -0
- package/.output/public/_nuxt/{RIAd5Wd1.js → 0mcDe5Hg.js} +1 -1
- package/.output/public/_nuxt/{DLfV22bF.js → 4Nlt-3Ix.js} +1 -1
- package/.output/public/_nuxt/{C_hl3kCw.js → 5FVMuLeh.js} +1 -1
- package/.output/public/_nuxt/{C4Ii8cYC.js → 5qkiDtwf.js} +1 -1
- package/.output/public/_nuxt/{n_Arasow.js → 6_fEEpaq.js} +1 -1
- package/.output/public/_nuxt/{BZjMzGZM.js → 944smzho.js} +1 -1
- package/.output/public/_nuxt/{C-tfM08H.js → B03oRqJe.js} +1 -1
- package/.output/public/_nuxt/{CGgHmnnS.js → B06CcGVK.js} +3 -3
- package/.output/public/_nuxt/{FmfogFAR.js → B0UpgYEt.js} +1 -1
- package/.output/public/_nuxt/{CcJ0pNID.js → B0YLhHra.js} +1 -1
- package/.output/public/_nuxt/B0v0agy0.js +1 -0
- package/.output/public/_nuxt/{DmGbOc_e.js → B1A26hhf.js} +1 -1
- package/.output/public/_nuxt/{B38X0n2w.js → B592hx40.js} +1 -1
- package/.output/public/_nuxt/B5l6QVGz.js +1 -0
- package/.output/public/_nuxt/{BD07a6OS.js → B6BF2w8r.js} +3 -3
- package/.output/public/_nuxt/{rY0W1r76.js → B6m5ExpJ.js} +2 -2
- package/.output/public/_nuxt/{iTZxBLAr.js → B91qlTSF.js} +3 -3
- package/.output/public/_nuxt/B9sXHKws.js +1 -0
- package/.output/public/_nuxt/{eB60bVen.js → BAh-k-y8.js} +1 -1
- package/.output/public/_nuxt/{wSCSxjgr.js → BDQ6hxO7.js} +1 -1
- package/.output/public/_nuxt/{DEmzTuCa.js → BGytjslk.js} +1 -1
- package/.output/public/_nuxt/{CZQeFnOf.js → BIoHE1oQ.js} +1 -1
- package/.output/public/_nuxt/{BHcVB9Fo.js → BNXyokAF.js} +1 -1
- package/.output/public/_nuxt/{Irw5CrIe.js → BNxg8OvE.js} +1 -1
- package/.output/public/_nuxt/{C1wI_STa.js → BPBLcBHM.js} +2 -2
- package/.output/public/_nuxt/{BGV4_re9.js → BQeDYnyj.js} +1 -1
- package/.output/public/_nuxt/{pJF5jz72.js → BUfJTKJk.js} +1 -1
- package/.output/public/_nuxt/{B27NM422.js → BVJkcOi4.js} +1 -1
- package/.output/public/_nuxt/{B8fLdQfp.js → BVNZYpXH.js} +1 -1
- package/.output/public/_nuxt/{Dc_VwXJs.js → BZ3u3Znq.js} +1 -1
- package/.output/public/_nuxt/{CjkXqgrT.js → B_V_KZmg.js} +1 -1
- package/.output/public/_nuxt/{DB0uzc_1.js → BaTcZylh.js} +1 -1
- package/.output/public/_nuxt/{zvDhkxQS.js → BbdFZa4U.js} +1 -1
- package/.output/public/_nuxt/{DmHn_Ae8.js → BeAxkmtt.js} +1 -1
- package/.output/public/_nuxt/{CruI_TS3.js → BfiU8B4M.js} +1 -1
- package/.output/public/_nuxt/{DuH9QzIG.js → BhOf69HZ.js} +1 -1
- package/.output/public/_nuxt/{lfg-J79K.js → BlKgmZLh.js} +1 -1
- package/.output/public/_nuxt/{Cfce_cVw.js → BlplwzgB.js} +1 -1
- package/.output/public/_nuxt/{D5IKvGig.js → BnmZcuhY.js} +1 -1
- package/.output/public/_nuxt/{DfAWgXhg.js → BpExBTyC.js} +1 -1
- package/.output/public/_nuxt/{DIMnGgEU.js → BuURpKT4.js} +1 -1
- package/.output/public/_nuxt/{B5oEzB-M.js → Bvqgc_wA.js} +1 -1
- package/.output/public/_nuxt/{Dfi2mj_-.js → C0FuVjdX.js} +1 -1
- package/.output/public/_nuxt/{QNqSZCYh.js → C1RFLzd_.js} +1 -1
- package/.output/public/_nuxt/{DMCE1Up6.js → C4MrxKnP.js} +1 -1
- package/.output/public/_nuxt/{D5AjrkGO.js → C4ui9LWq.js} +1 -1
- package/.output/public/_nuxt/{iVfmia7K.js → C7RIYfkH.js} +1 -1
- package/.output/public/_nuxt/{D4wS6gzr.js → C7hn68Tp.js} +1 -1
- package/.output/public/_nuxt/{BHAaeL5L.js → C8gC5cUj.js} +1 -1
- package/.output/public/_nuxt/{CBJQYyqD.js → CAJH0xMY.js} +1 -1
- package/.output/public/_nuxt/{Bk_mzzQ3.js → CBpuaar1.js} +1 -1
- package/.output/public/_nuxt/{m9zGH_2s.js → CDP4J5em.js} +1 -1
- package/.output/public/_nuxt/{NNQizITf.js → CGTQGJ_c.js} +1 -1
- package/.output/public/_nuxt/{Ehiy7Wkv.js → CHd8mdNy.js} +1 -1
- package/.output/public/_nuxt/{BtVAOj3K.js → CHn6tbtE.js} +1 -1
- package/.output/public/_nuxt/{B1ea1Zc2.js → CKfAI3Hb.js} +1 -1
- package/.output/public/_nuxt/{CbLvLXmb.js → CLm_rHHY.js} +1 -1
- package/.output/public/_nuxt/{DFPu4h4a.js → CLzxl_Kg.js} +1 -1
- package/.output/public/_nuxt/{C3dJrgZH.js → CNVj60PG.js} +1 -1
- package/.output/public/_nuxt/{VRRYjCaC.js → CNi_mvQS.js} +1 -1
- package/.output/public/_nuxt/{46eRQaVv.js → COMJZX17.js} +1 -1
- package/.output/public/_nuxt/{Brmj91Ns.js → CQcJNYmv.js} +1 -1
- package/.output/public/_nuxt/{BMTKvzsm.js → CT8T1FW9.js} +1 -1
- package/.output/public/_nuxt/{B02JOKtW.js → CTJDAjdO.js} +1 -1
- package/.output/public/_nuxt/{w3RSHXA6.js → CTXxmwx3.js} +1 -1
- package/.output/public/_nuxt/{CIMG8oEU.js → CV92g0qz.js} +1 -1
- package/.output/public/_nuxt/{DEBOaUgW.js → CVwzer_Y.js} +1 -1
- package/.output/public/_nuxt/{6k0gxaWW.js → CXRkSVkD.js} +1 -1
- package/.output/public/_nuxt/{C7Wu2u5C.js → CamCmKfq.js} +1 -1
- package/.output/public/_nuxt/{DM9s28TO.js → CaohnGAD.js} +1 -1
- package/.output/public/_nuxt/{BqyI8nU4.js → Cg8k3_b4.js} +1 -1
- package/.output/public/_nuxt/{rVZcJ6Pz.js → CiQJYbKL.js} +1 -1
- package/.output/public/_nuxt/{Co86ycpI.js → Cjj-eCEV.js} +1 -1
- package/.output/public/_nuxt/{B3TXSB_R.js → CkfP4uja.js} +1 -1
- package/.output/public/_nuxt/{81-iumfM.js → CoUQ3qpL.js} +1 -1
- package/.output/public/_nuxt/{CPb6IrVT.js → CopZwjN8.js} +1 -1
- package/.output/public/_nuxt/{FGRiZ9J1.js → Cpyrc9BG.js} +1 -1
- package/.output/public/_nuxt/{6DKJrPTD.js → CtLfbSRS.js} +1 -1
- package/.output/public/_nuxt/{CVTUqEcr.js → CtyKXJ-J.js} +1 -1
- package/.output/public/_nuxt/{By5L5Smf.js → CvaD7s2l.js} +1 -1
- package/.output/public/_nuxt/{QmdcFt0E.js → Cw2TcJMF.js} +1 -1
- package/.output/public/_nuxt/{ByXbV9Xa.js → Cwel2ykQ.js} +1 -1
- package/.output/public/_nuxt/{CLmiWiqr.js → CyZlzytZ.js} +1 -1
- package/.output/public/_nuxt/{DXAD_aZW.js → Cygjd4rF.js} +1 -1
- package/.output/public/_nuxt/{DoSrePUc.js → CzxGRepV.js} +1 -1
- package/.output/public/_nuxt/{Dkpxacka.js → D0fJg-Y2.js} +1 -1
- package/.output/public/_nuxt/{BW-7wimi.js → D12yGpMq.js} +1 -1
- package/.output/public/_nuxt/{uCsI7fpg.js → D7Bxfxio.js} +1 -1
- package/.output/public/_nuxt/{D_1GDAlv.js → DEl5RR7R.js} +1 -1
- package/.output/public/_nuxt/{3hFj0Mf_.js → DFVXHy0C.js} +1 -1
- package/.output/public/_nuxt/{7msxmF5v.js → DFW8HOVB.js} +1 -1
- package/.output/public/_nuxt/{CD6r4z4e.js → DH2yWNbZ.js} +1 -1
- package/.output/public/_nuxt/{AMPsjNHJ.js → DIDjR8Ry.js} +1 -1
- package/.output/public/_nuxt/{B8na0pik.js → DKHJBr2m.js} +1 -1
- package/.output/public/_nuxt/{CDKJK4wW.js → DKd2_wBj.js} +1 -1
- package/.output/public/_nuxt/{CD_jDSWh.js → DKrd1pCW.js} +1 -1
- package/.output/public/_nuxt/{gTGPvkTX.js → DOcEwtqN.js} +1 -1
- package/.output/public/_nuxt/{B0_Iu2zi.js → DSQ9bpNJ.js} +1 -1
- package/.output/public/_nuxt/{BigIAhcT.js → DWG9jKCo.js} +1 -1
- package/.output/public/_nuxt/{Cj3gDP-y.js → DY78sr_b.js} +1 -1
- package/.output/public/_nuxt/{Cwdn7ZtG.js → DZQxxfue.js} +1 -1
- package/.output/public/_nuxt/{DN5cHXGS.js → DZpgj5sA.js} +1 -1
- package/.output/public/_nuxt/{CZ5B974o.js → Dc8vLBQN.js} +1 -1
- package/.output/public/_nuxt/{9vdFTPZC.js → DcT64MxD.js} +1 -1
- package/.output/public/_nuxt/{BwLYFg9w.js → DdmLHNRP.js} +1 -1
- package/.output/public/_nuxt/{Bn175bDC.js → Dg19_qAK.js} +1 -1
- package/.output/public/_nuxt/{BTImkTzA.js → DhIZvLeI.js} +1 -1
- package/.output/public/_nuxt/{DOTIy97K.js → DjaEQQhf.js} +1 -1
- package/.output/public/_nuxt/{CJLlvuDm.js → DkUMlRf8.js} +1 -1
- package/.output/public/_nuxt/{BTs0cu3F.js → DkjKiJOq.js} +1 -1
- package/.output/public/_nuxt/{CIDjuJ7I.js → DlR5hUi3.js} +1 -1
- package/.output/public/_nuxt/{P3qGksT8.js → DnfG5RzJ.js} +1 -1
- package/.output/public/_nuxt/{DOs_ozN6.js → DohhIeRk.js} +1 -1
- package/.output/public/_nuxt/{lA6pb86B.js → Dom1vIen.js} +1 -1
- package/.output/public/_nuxt/{BGa5KqPj.js → Ds97nj0P.js} +1 -1
- package/.output/public/_nuxt/{v-LIF5tR.js → DxT3YmAC.js} +1 -1
- package/.output/public/_nuxt/{UQIfAAmf.js → DxcN7Uv7.js} +1 -1
- package/.output/public/_nuxt/{qI8JV5dU.js → DxcbYcrE.js} +1 -1
- package/.output/public/_nuxt/{DfP6jcEM.js → DyVUuE07.js} +1 -1
- package/.output/public/_nuxt/{DoGLYOlq.js → Dz-vwDzE.js} +1 -1
- package/.output/public/_nuxt/{CrHLmWKE.js → EeCE4NvG.js} +1 -1
- package/.output/public/_nuxt/{BVkPh7-9.js → EnGykH_X.js} +1 -1
- package/.output/public/_nuxt/{By6urPVf.js → GJMyZaby.js} +1 -1
- package/.output/public/_nuxt/{mLs_Q7_U.js → I7OHJVxg.js} +1 -1
- package/.output/public/_nuxt/{bHsFNLQP.js → K0RZW9fp.js} +1 -1
- package/.output/public/_nuxt/{CSyssKl8.js → K1o4brLx.js} +1 -1
- package/.output/public/_nuxt/{CZvTOsiz.js → OKVQJ7yj.js} +1 -1
- package/.output/public/_nuxt/{3AgfIirx.js → Q3QJAuZ2.js} +1 -1
- package/.output/public/_nuxt/{D57E8FC4.js → Tirj2rC0.js} +1 -1
- package/.output/public/_nuxt/{BVcLiEDk.js → VcsszHDj.js} +1 -1
- package/.output/public/_nuxt/WG3LXN-9.js +1 -0
- package/.output/public/_nuxt/{CCmSsj4q.js → aUYaYlYl.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7de5e0df-2e0a-435c-a2e3-fc2312beb6ad.json +1 -0
- package/.output/public/_nuxt/{swgNRlWy.js → cGEbEAGz.js} +1 -1
- package/.output/public/_nuxt/{BaHB7JKe.js → ds0WOZHj.js} +1 -1
- package/.output/public/_nuxt/{IIvTjJqa.js → e4zQkzJm.js} +1 -1
- package/.output/public/_nuxt/{D45gWhSU.js → eFu2sWbl.js} +1 -1
- package/.output/public/_nuxt/entry.B0qcqYYu.css +1 -0
- package/.output/public/_nuxt/{ChIzYvpz.js → ggWK6BEa.js} +1 -1
- package/.output/public/_nuxt/{pFPRVtL-.js → hkCaWCzP.js} +1 -1
- package/.output/public/_nuxt/{BW0bq0Nu.js → jF9FNyOl.js} +1 -1
- package/.output/public/_nuxt/{CjVBL0o-.js → jenjyHml.js} +1 -1
- package/.output/public/_nuxt/{CtNN2F57.js → kMwuhvCf.js} +1 -1
- package/.output/public/_nuxt/{1_nO5SO6.js → oWO88tvt.js} +1 -1
- package/.output/public/_nuxt/{d85YwuyC.js → olSL1K5t.js} +1 -1
- package/.output/public/_nuxt/{DwEfItxe.js → ptAR8AWT.js} +1 -1
- package/.output/public/_nuxt/{Dbv2gAYq.js → rTscsMvH.js} +1 -1
- package/.output/public/_nuxt/{Bxs6RCfp.js → xooRr3tW.js} +1 -1
- package/.output/public/_nuxt/{n5X4vNX9.js → zApTn6EM.js} +2 -2
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{memories-BqA719O1.mjs → memories-DLa6uEfV.mjs} +2 -31
- package/.output/server/chunks/build/memories-DLa6uEfV.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +944 -922
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/{terminal.mjs → _ws/terminal.mjs} +39 -28
- package/.output/server/chunks/routes/_ws/terminal.mjs.map +1 -0
- package/.output/server/chunks/routes/api/memory/context.get.mjs +13 -9
- package/.output/server/chunks/routes/api/memory/context.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/extract.post.mjs +4 -7
- package/.output/server/chunks/routes/api/memory/extract.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/search.get.mjs +22 -25
- package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/store.post.mjs +1 -3
- package/.output/server/chunks/routes/api/memory/store.post.mjs.map +1 -1
- package/.output/server/chunks/routes/notifications.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/Claude/skills/memory/memory.py +1 -7
- package/app/composables/useTerminal.ts +1 -1
- package/app/pages/memories.vue +0 -15
- package/dist/cli/index.js +1 -0
- package/package.json +1 -1
- package/server/api/memory/context.get.ts +19 -15
- package/server/api/memory/extract.post.ts +1 -2
- package/server/api/memory/search.get.ts +29 -34
- package/server/api/memory/store.post.ts +1 -2
- package/server/bridge/responder.ts +10 -5
- package/server/db/schema.ts +1 -2
- package/server/drizzle/migrations/0017_unusual_landau.sql +1 -0
- package/server/drizzle/migrations/meta/0017_snapshot.json +1965 -0
- package/server/drizzle/migrations/meta/_journal.json +7 -0
- package/server/routes/_ws/terminal.ts +111 -0
- package/server/services/memory-extractor.ts +3 -6
- package/server/utils/document-sync.ts +27 -20
- package/server/utils/pty-manager.ts +12 -3
- package/shared/types/index.ts +1 -4
- package/.output/public/_nuxt/BhtKu4xV.js +0 -1
- package/.output/public/_nuxt/CNB4wNeh.js +0 -1
- package/.output/public/_nuxt/CnB-ybCZ.js +0 -1
- package/.output/public/_nuxt/DAjV9Cip.js +0 -1
- package/.output/public/_nuxt/Suor9Vto.js +0 -1
- package/.output/public/_nuxt/builds/meta/d37c41da-8cec-4479-a3ac-3097aa4fb2e0.json +0 -1
- package/.output/public/_nuxt/entry.ZJxWCrU6.css +0 -1
- package/.output/server/chunks/build/memories-BqA719O1.mjs.map +0 -1
- package/.output/server/chunks/routes/terminal.mjs.map +0 -1
- package/server/routes/terminal.ts +0 -98
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as Hi,e as Fi,C as Vi,b7 as hs,L as ji,B as Pa,W as La,ar as Jd,h as he,X as za,Y as $a,aZ as We,ap as xr,b8 as Kn,c as st,o as ve,w as jt,Z as ur,a as ze,P as ii,$ as kn,M as dr,al as hr,am as Jo,ac as Gd,aa as Ba,r as _a,m as nt,a0 as Jn,bS as Xd,ba as Yd,s as Qd,F as Zd,c2 as eh,b5 as th,g as nh,c3 as rh,f as sh,R as ih}from"./CGgHmnnS.js";import{S as oh}from"./BtVAOj3K.js";import{f as Ha,s as Fa,o as Va,d as ja,e as qa,g as Ua,h as Wa,i as Ka,j as Ja}from"./DIMnGgEU.js";import{_ as lh}from"./BGa5KqPj.js";import{_ as Go}from"./D_1GDAlv.js";import{k as ah,b as ch}from"./Vcq4gwWv.js";function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function Ga(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ga(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Xa(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Xa(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class w{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new w(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new w(r,s)}cutByIndex(e,t){return e==t?w.empty:e==0&&t==this.content.length?this:new w(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new w(s,i)}addToStart(e){return new w([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new w(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ga(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xa(this,e,t,r)}findIndex(e){if(e==0)return Gn(0,e);if(e==this.size)return Gn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Gn(t+1,i):Gn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return w.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new w(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return w.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new w(t||e,r)}static from(e){if(!e)return w.empty;if(e instanceof w)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new w([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}w.empty=new w([],0);const Is={index:0,offset:0};function Gn(n,e){return Is.index=n,Is.offset=e,Is}function wr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _=class oi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return oi.none;if(e instanceof oi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};_.none=[];class vr extends Error{}class M{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Qa(this.content,e+this.openStart,t);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,t){return new M(Ya(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return M.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new M(e,r,s)}}M.empty=new M(w.empty,0,0);function Ya(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ya(i.content,e-s-1,t-s-1)))}function Qa(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Qa(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function uh(n,e,t){if(t.openStart>n.depth)throw new vr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vr("Inconsistent open depths");return Za(n,e,t,0)}function Za(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Za(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Mt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dh(t,n);return Mt(i,tc(n,o,l,e,r))}else return Mt(i,Sr(n,e,r))}function ec(n,e){if(!e.type.compatibleContent(n.type))throw new vr("Cannot join "+e.type.name+" onto "+n.type.name)}function li(n,e,t){let r=n.node(t);return ec(r,e.node(t)),r}function Tt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Tt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Tt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Tt(e.nodeBefore,r)}function Mt(n,e){return n.type.checkContent(e),n.copy(e)}function tc(n,e,t,r,s){let i=n.depth>s&&li(n,e,s+1),o=r.depth>s&&li(t,r,s+1),l=[];return bn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(ec(i,o),Tt(Mt(i,tc(n,e,t,r,s+1)),l)):(i&&Tt(Mt(i,Sr(n,e,s+1)),l),bn(e,t,s,l),o&&Tt(Mt(o,Sr(t,r,s+1)),l)),bn(r,null,s,l),new w(l)}function Sr(n,e,t){let r=[];if(bn(null,n,t,r),n.depth>t){let s=li(n,e,t+1);Tt(Mt(s,Sr(n,e,t+1)),r)}return bn(e,null,t,r),new w(r)}function dh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class Nn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Cr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new Nn(t,r,i)}static resolveCached(e,t){let r=Xo.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Xo.set(e,r=new hh);let s=r.elts[r.i]=Nn.resolve(e,t);return r.i=(r.i+1)%fh,s}}class hh{constructor(){this.elts=[],this.i=0}}const fh=12,Xo=new WeakMap;class Cr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ph=Object.create(null);class Me{constructor(e,t,r,s=_.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wr(this.attrs,t||e.defaultAttrs||ph)&&_.sameSet(this.marks,r||_.none)}copy(e=null){return e==this.content?this:new Me(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Me(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return M.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new M(c,s.depth-o,i.depth-o)}replace(e,t,r){return uh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return Nn.resolveCached(this,e)}resolveNoCache(e){return Nn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Me.prototype.text=void 0;class Tr extends Me{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Tr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Tr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function nc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Nt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mh(e,t);if(r.next==null)return Nt.empty;let s=rc(r);r.next&&r.err("Unexpected trailing text");let i=vh(wh(s));return Sh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return w.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
1
|
+
import{d as Hi,e as Fi,C as Vi,b7 as hs,L as ji,B as Pa,W as La,ar as Jd,h as he,X as za,Y as $a,aZ as We,ap as xr,b8 as Kn,c as st,o as ve,w as jt,Z as ur,a as ze,P as ii,$ as kn,M as dr,al as hr,am as Jo,ac as Gd,aa as Ba,r as _a,m as nt,a0 as Jn,bS as Xd,ba as Yd,s as Qd,F as Zd,c2 as eh,b4 as th,g as nh,c3 as rh,f as sh,R as ih}from"./B06CcGVK.js";import{S as oh}from"./CHn6tbtE.js";import{f as Ha,s as Fa,o as Va,d as ja,e as qa,g as Ua,h as Wa,i as Ka,j as Ja}from"./BuURpKT4.js";import{_ as lh}from"./Ds97nj0P.js";import{_ as Go}from"./DEl5RR7R.js";import{k as ah,b as ch}from"./Vcq4gwWv.js";function ie(n){this.content=n}ie.prototype={constructor:ie,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,s=r.find(n),i=r.content.slice();return s==-1?i.push(t||n,e):(i[s+1]=e,t&&(i[s]=t)),new ie(i)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new ie(t)},addToStart:function(n,e){return new ie([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new ie(t)},addBefore:function(n,e,t){var r=this.remove(e),s=r.content.slice(),i=r.find(n);return s.splice(i==-1?s.length:i,0,e,t),new ie(s)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=ie.from(n),n.size?new ie(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=ie.from(n),n.size?new ie(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=ie.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};ie.from=function(n){if(n instanceof ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ie(e)};function Ga(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Ga(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function Xa(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;c<u&&o.text[o.text.length-c-1]==l.text[l.text.length-c-1];)c++,t--,r--;return{a:t,b:r}}if(o.content.size||l.content.size){let c=Xa(o.content,l.content,t-1,r-1);if(c)return c}t-=a,r-=a}}class w{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,s=0,i){for(let o=0,l=0;l<t;o++){let a=this.content[o],c=l+a.nodeSize;if(c>e&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);i<e.content.length;i++)s.push(e.content[i]);return new w(s,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],s=0;if(t>e)for(let i=0,o=0;o<t;i++){let l=this.content[i],a=o+l.nodeSize;a>e&&((o<e||a>t)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new w(r,s)}cutByIndex(e,t){return e==t?w.empty:e==0&&t==this.content.length?this:new w(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new w(s,i)}addToStart(e){return new w([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new w(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let s=this.content[t];e(s,r,t),r+=s.nodeSize}}findDiffStart(e,t=0){return Ga(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Xa(this,e,t,r)}findIndex(e){if(e==0)return Gn(0,e);if(e==this.size)return Gn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Gn(t+1,i):Gn(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return w.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new w(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return w.empty;let t,r=0;for(let s=0;s<e.length;s++){let i=e[s];r+=i.nodeSize,s&&i.isText&&e[s-1].sameMarkup(i)?(t||(t=e.slice(0,s)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new w(t||e,r)}static from(e){if(!e)return w.empty;if(e instanceof w)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new w([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}w.empty=new w([],0);const Is={index:0,offset:0};function Gn(n,e){return Is.index=n,Is.offset=e,Is}function wr(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!wr(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!wr(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let _=class oi{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let s=0;s<e.length;s++){let i=e[s];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,s));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let s=r.create(t.attrs);return r.checkAttrs(s.attrs),s}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return oi.none;if(e instanceof oi)return[e];let t=e.slice();return t.sort((r,s)=>r.type.rank-s.type.rank),t}};_.none=[];class vr extends Error{}class M{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Qa(this.content,e+this.openStart,t);return r&&new M(r,this.openStart,this.openEnd)}removeBetween(e,t){return new M(Ya(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return M.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new M(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new M(e,r,s)}}M.empty=new M(w.empty,0,0);function Ya(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Ya(i.content,e-s-1,t-s-1)))}function Qa(n,e,t,r){let{index:s,offset:i}=n.findIndex(e),o=n.maybeChild(s);if(i==e||o.isText)return r&&!r.canReplace(s,s,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=Qa(o.content,e-i-1,t,o);return l&&n.replaceChild(s,o.copy(l))}function uh(n,e,t){if(t.openStart>n.depth)throw new vr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new vr("Inconsistent open depths");return Za(n,e,t,0)}function Za(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r<n.depth-t.openStart){let o=Za(n,e,t,r+1);return i.copy(i.content.replaceChild(s,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,l=o.content;return Mt(o,l.cut(0,n.parentOffset).append(t.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=dh(t,n);return Mt(i,tc(n,o,l,e,r))}else return Mt(i,Sr(n,e,r))}function ec(n,e){if(!e.type.compatibleContent(n.type))throw new vr("Cannot join "+e.type.name+" onto "+n.type.name)}function li(n,e,t){let r=n.node(t);return ec(r,e.node(t)),r}function Tt(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Tt(n.nodeAfter,r),i++));for(let l=i;l<o;l++)Tt(s.child(l),r);e&&e.depth==t&&e.textOffset&&Tt(e.nodeBefore,r)}function Mt(n,e){return n.type.checkContent(e),n.copy(e)}function tc(n,e,t,r,s){let i=n.depth>s&&li(n,e,s+1),o=r.depth>s&&li(t,r,s+1),l=[];return bn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(ec(i,o),Tt(Mt(i,tc(n,e,t,r,s+1)),l)):(i&&Tt(Mt(i,Sr(n,e,s+1)),l),bn(e,t,s,l),o&&Tt(Mt(o,Sr(t,r,s+1)),l)),bn(r,null,s,l),new w(l)}function Sr(n,e,t){let r=[];if(bn(null,n,t,r),n.depth>t){let s=li(n,e,t+1);Tt(Mt(s,Sr(n,e,t+1)),r)}return bn(e,null,t,r),new w(r)}function dh(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class Nn{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i<e;i++)s+=r.child(i).nodeSize;return s}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return _.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),s=e.maybeChild(t);if(!r){let l=r;r=s,s=l}let i=r.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!s||!i[o].isInSet(s.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,s=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!s||!r[i].isInSet(s.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Cr(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new Nn(t,r,i)}static resolveCached(e,t){let r=Xo.get(e);if(r)for(let i=0;i<r.elts.length;i++){let o=r.elts[i];if(o.pos==t)return o}else Xo.set(e,r=new hh);let s=r.elts[r.i]=Nn.resolve(e,t);return r.i=(r.i+1)%fh,s}}class hh{constructor(){this.elts=[],this.i=0}}const fh=12,Xo=new WeakMap;class Cr{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const ph=Object.create(null);class Me{constructor(e,t,r,s=_.none){this.type=e,this.attrs=t,this.marks=s,this.content=r||w.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,s=0){this.content.nodesBetween(e,t,r,s,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,s){return this.content.textBetween(e,t,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&wr(this.attrs,t||e.defaultAttrs||ph)&&_.sameSet(this.marks,r||_.none)}copy(e=null){return e==this.content?this:new Me(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Me(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return M.empty;let s=this.resolve(e),i=this.resolve(t),o=r?0:s.sharedDepth(t),l=s.start(o),c=s.node(o).content.cut(s.pos-l,i.pos-l);return new M(c,s.depth-o,i.depth-o)}replace(e,t,r){return uh(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:s}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(s==e||t.isText)return t;e-=s+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let s=this.content.child(t-1);return{node:s,index:t-1,offset:r-s.nodeSize}}resolve(e){return Nn.resolveCached(this,e)}resolveNoCache(e){return Nn.resolve(this,e)}rangeHasMark(e,t,r){let s=!1;return t>e&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;a<i;a++)if(!this.type.allowsMarks(r.child(a).marks))return!1;return!0}canReplaceWith(e,t,r,s){if(s&&!this.type.allowsMarks(s))return!1;let i=this.contentMatchAt(e).matchType(r),o=i&&i.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=_.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!_.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}}Me.prototype.text=void 0;class Tr extends Me{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Tr(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Tr(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function nc(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Nt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new mh(e,t);if(r.next==null)return Nt.empty;let s=rc(r);r.next&&r.err("Unexpected trailing text");let i=vh(wh(s));return Sh(i,r),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let s=this;for(let i=t;s&&i<r;i++)s=s.matchType(e.child(i).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let s=[this];function i(o,l){let a=o.matchFragment(e,r);if(a&&(!t||a.validEnd))return w.from(l.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&s.indexOf(d)==-1){s.push(d);let h=i(d,l.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),i=s.match;if(i.matchType(e)){let o=[];for(let l=s;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:a}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in t)&&(!s.type||a.validEnd)&&(r.push({match:l.contentMatch,type:l,via:s}),t[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s<r.next.length;s++)e.indexOf(r.next[s].next)==-1&&t(r.next[s].next)}return t(this),e.map((r,s)=>{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)i+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return i}).join(`
|
|
2
2
|
`)}}Nt.empty=new Nt(!0);class mh{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rc(n){let e=[];do e.push(gh(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function gh(n){let e=[];do e.push(yh(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function yh(n){let e=xh(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=kh(n,e);else break;return e}function Yo(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function kh(n,e){let t=Yo(n),r=t;return n.eat(",")&&(n.next!="}"?r=Yo(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function bh(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function xh(n){if(n.eat("(")){let e=rc(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=bh(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wh(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c<o.min;c++){let u=t();s(i(o.expr,a),u),a=u}if(o.max==-1)s(i(o.expr,a),a);else for(let c=o.min;c<o.max;c++){let u=t();r(a,u),s(i(o.expr,a),u),a=u}return[r(a)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function sc(n,e){return e-n}function Qo(n,e){let t=[];return r(e),t.sort(sc);function r(s){let i=n[s];if(i.length==1&&!i[0].term)return r(i[0].to);t.push(s);for(let o=0;o<i.length;o++){let{term:l,to:a}=i[o];!l&&t.indexOf(a)==-1&&r(a)}}}function vh(n){let e=Object.create(null);return t(Qo(n,0));function t(r){let s=[];r.forEach(o=>{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u<s.length;u++)s[u][0]==l&&(c=s[u][1]);Qo(n,a).forEach(u=>{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Nt(r.indexOf(n.length-1)>-1);for(let o=0;o<s.length;o++){let l=s[o][1].sort(sc);i.next.push({type:s[o][0],next:e[l.join(",")]||t(l)})}return i}}function Sh(n,e){for(let t=0,r=[n];t<r.length;t++){let s=r[t],i=!s.validEnd,o=[];for(let l=0;l<s.next.length;l++){let{type:a,next:c}=s.next[l];o.push(a.name),i&&!(a.isText||a.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ic(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function oc(n,e){let t=Object.create(null);for(let r in n){let s=e&&e[r];if(s===void 0){let i=n[r];if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=s}return t}function lc(n,e,t,r){for(let s in e)if(!(s in n))throw new RangeError(`Unsupported attribute ${s} for ${t} of type ${s}`);for(let s in n){let i=n[s];i.validate&&i.validate(e[s])}}function ac(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Th(n,r,e[r]);return t}let Zo=class cc{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=ac(e,r.attrs),this.defaultAttrs=ic(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Nt.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:oc(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Me(this,this.computeAttrs(e),w.from(t),_.setFrom(r))}createChecked(e=null,t,r){return t=w.from(t),this.checkContent(t),new Me(this,this.computeAttrs(e),t,_.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=w.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(w.empty,!0);return i?new Me(this,e,t.append(i),_.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){lc(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:_.none:e}static compile(e,t){let r=Object.create(null);e.forEach((i,o)=>r[i]=new cc(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ch(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class Th{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ch(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class fs{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=ac(e,s.attrs),this.excluded=null;let i=ic(this.attrs);this.instance=i?new _(this,i):null}create(e=null){return!e&&this.instance?this.instance:new _(this,oc(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new fs(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){lc(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class uc{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=ie.from(e.nodes),t.marks=ie.from(e.marks||{}),this.nodes=Zo.compile(this.spec.nodes,this),this.marks=fs.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Nt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?el(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:el(this,o.split(" "))}this.nodeFromJSON=s=>Me.fromJSON(this,s),this.markFromJSON=s=>_.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Zo){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new Tr(r,r.defaultAttrs,e,_.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function el(n,e){let t=[];for(let r=0;r<e.length;r++){let s=e[r],i=n.marks[s],o=i;if(i)t.push(i);else for(let l in n.marks){let a=n.marks[l];(s=="_"||a.spec.group&&a.spec.group.split(" ").indexOf(s)>-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Mh(n){return n.tag!=null}function Eh(n){return n.style!=null}class Qe{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(Mh(s))this.tags.push(s);else if(Eh(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new nl(this,t,!1);return r.addAll(e,_.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new nl(this,t,!0);return r.addAll(e,_.none,t.from,t.to),M.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let i=this.tags[s];if(Nh(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||t.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,t,r,s){for(let i=s?this.styles.indexOf(s)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o<t.length;o++){let l=t[o];if((l.priority==null?50:l.priority)<i)break}t.splice(o,0,s)}for(let s in e.marks){let i=e.marks[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rl(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=rl(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Qe(e,Qe.schemaRules(e)))}}const dc={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ah={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},hc={ol:!0,ul:!0},Rn=1,ai=2,xn=4;function tl(n,e,t){return e!=null?(e?Rn:0)|(e==="full"?ai:0):n&&n.whitespace=="pre"?Rn|ai:t&~xn}class Xn{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=_.none,this.match=i||(o&xn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Rn)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!dc.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class nl{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=tl(null,t.preserveWhitespace,0)|(r?xn:0);s?i=new Xn(s.type,s.attrs,_.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Xn(null,null,_.none,!0,null,o):i=new Xn(e.schema.topNodeType,null,_.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&ai?"full":this.localPreserveWS||(s.options&Rn)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,`
|
|
3
3
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a<l.length;a++)a&&this.insertNode(o.linebreakReplacement.create(),t,!0),l[a]&&this.insertNode(o.text(l[a]),t,!/\S/.test(l[a]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=s.content[s.content.length-1],a=e.previousSibling;(!l||a&&a.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let s=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;hc.hasOwnProperty(o)&&this.parser.normalizeLists&&Oh(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:Ah.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(dc.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=a&&a.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=s}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
4
4
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let i=this.parser.matchedStyles[s],o=r.getPropertyValue(i);if(o)for(let l=void 0;;){let a=this.parser.matchStyle(i,o,this,l);if(!a)break;if(a.ignore)return null;if(a.clearMark?t=t.filter(c=>!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o<s.length;o++)t=this.enterInner(s[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let s=this.findPlace(e,t,r);if(s){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=_.none;for(let l of s.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):sl(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,t,r,s){let i=this.findPlace(e.create(t),r,!1);return i&&(i=this.enterInner(e,t,r,!0,s)),i}enterInner(e,t,r,s=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=tl(e,i,o.options);o.options&xn&&o.content.length==0&&(l|=xn);let a=_.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):sl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Xn(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Rn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&t.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function Oh(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&hc.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Nh(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function rl(n){let e={};for(let t in n)e[t]=n[t];return e}function sl(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a<l.edgeCount;a++){let{type:c,next:u}=l.edge(a);if(c==e||i.indexOf(u)<0&&o(u))return!0}};if(o(s.contentMatch))return!0}}class zt{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ds(t).createDocumentFragment());let s=r,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,a=0;for(;l<i.length&&a<o.marks.length;){let c=o.marks[a];if(!this.marks[c.type.name]){a++;continue}if(!c.eq(i[l][0])||c.type.spec.spanning===!1)break;l++,a++}for(;l<i.length;)s=i.pop()[1];for(;a<o.marks.length;){let c=o.marks[a++],u=this.serializeMark(c,o.isInline,t);u&&(i.push([c,s]),s.appendChild(u.dom),s=u.contentDOM||u.dom)}}s.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:s}=fr(Ds(t),this.nodes[e.type.name](e),null,e.attrs);if(s){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,s)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let s=e.marks.length-1;s>=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&fr(Ds(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return fr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new zt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=il(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return il(e.marks)}}function il(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ds(n){return n.document||window.document}const ol=new WeakMap;function Rh(n){let e=ol.get(n);return e===void 0&&ol.set(n,e=Ih(n)),e}function Ih(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s<r.length;s++)t(r[s]);else for(let s in r)t(r[s])}return t(n),e}function fr(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let s=e[0],i;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=Rh(r))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:f,contentDOM:p}=fr(n,h,t,r);if(a.appendChild(f),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const fc=65535,pc=Math.pow(2,16);function Dh(n,e){return n+e*pc}function ll(n){return n&fc}function Ph(n){return(n-(n&fc))/pc}const mc=1,gc=2,pr=4,yc=8;class ci{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&yc)>0}get deletedBefore(){return(this.delInfo&(mc|pr))>0}get deletedAfter(){return(this.delInfo&(gc|pr))>0}get deletedAcross(){return(this.delInfo&pr)>0}}class be{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&be.empty)return be.empty}recover(e){let t=0,r=ll(e);if(!this.inverted)for(let s=0;s<r;s++)t+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+t+Ph(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let s=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?s:0);if(a>e)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:Dh(l/3,e-a),g=e==a?gc:e==d?mc:pr;return(t<0?e!=a:e!=d)&&(g|=yc),new ci(f,g,p)}s+=u-c}return r?e+s:new ci(e+s,0,null)}touches(e,t){let r=0,s=ll(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let a=this.ranges[l]-(this.inverted?r:0);if(a>e)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s<this.ranges.length;s+=3){let o=this.ranges[s],l=o-(this.inverted?i:0),a=o+(this.inverted?0:i),c=this.ranges[s+t],u=this.ranges[s+r];e(l,l+c,a,a+u),i+=u-c}}invert(){return new be(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?be.empty:new be(e<0?[0,-e,0]:[0,0,e])}}be.empty=new be([]);class In{constructor(e,t,r=0,s=e?e.length:0){this.mirror=t,this.from=r,this.to=s,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new In(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,r=this._maps.length;t<e._maps.length;t++){let s=e.getMirror(t);this.appendMap(e._maps[t],s!=null&&s<t?r+s:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new In;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let s=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,t);if(l.recover!=null){let a=this.getMirror(i);if(a!=null&&a>i&&a<this.to){i=a,e=this._maps[a].recover(l.recover);continue}}s|=l.delInfo,e=l.pos}return r?e:new ci(e,s,null)}}const Ps=Object.create(null);class ue{getMap(){return be.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Ps[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ps)throw new RangeError("Duplicate use of step JSON ID "+e);return Ps[e]=t,t.prototype.jsonID=e,t}}class X{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new X(e,null)}static fail(e){return new X(null,e)}static fromReplace(e,t,r,s){try{return X.ok(e.replace(t,r,s))}catch(i){if(i instanceof vr)return X.fail(i.message);throw i}}}function qi(n,e,t){let r=[];for(let s=0;s<n.childCount;s++){let i=n.child(s);i.content.size&&(i=i.copy(qi(i.content,e,i))),i.isInline&&(i=e(i,t,s)),r.push(i)}return w.fromArray(r)}class dt extends ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),s=r.node(r.sharedDepth(this.to)),i=new M(qi(t.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,i)}invert(){return new Re(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new dt(t.pos,r.pos,this.mark)}merge(e){return e instanceof dt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new dt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new dt(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("addMark",dt);class Re extends ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new M(qi(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return X.fromReplace(e,this.from,this.to,r)}invert(){return new dt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Re(t.pos,r.pos,this.mark)}merge(e){return e instanceof Re&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Re(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Re(t.from,t.to,e.markFromJSON(t.mark))}}ue.jsonID("removeMark",Re);class ht extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new M(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;s<t.marks.length;s++)if(!t.marks[s].isInSet(r))return new ht(this.pos,t.marks[s]);return new ht(this.pos,this.mark)}}return new Rt(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ht(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ht(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("addNodeMark",ht);class Rt extends ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return X.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return X.fromReplace(e,this.pos,this.pos+1,new M(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ht(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rt(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Rt(t.pos,e.markFromJSON(t.mark))}}ue.jsonID("removeNodeMark",Rt);class te extends ue{constructor(e,t,r,s=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=s}apply(e){return this.structure&&ui(e,this.from,this.to)?X.fail("Structure replace would overwrite content"):X.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new be([this.from,this.to-this.from,this.slice.size])}invert(e){return new te(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new te(t.pos,Math.max(t.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof te)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?M.empty:new M(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new te(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?M.empty:new M(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new te(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new te(t.from,t.to,M.fromJSON(e,t.slice),!!t.structure)}}ue.jsonID("replace",te);class re extends ue{constructor(e,t,r,s,i,o,l=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=s,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(ui(e,this.from,this.gapFrom)||ui(e,this.gapTo,this.to)))return X.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return X.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?X.fromReplace(e,this.from,this.to,r):X.fail("Content does not fit in gap")}getMap(){return new be([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new re(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),s=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||s<t.pos||i>r.pos?null:new re(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new re(t.from,t.to,t.gapFrom,t.gapTo,M.fromJSON(e,t.slice),t.insert,!!t.structure)}}ue.jsonID("replaceAround",re);function ui(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function Lh(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==h&&o.mark.eq(d[g])?o.to=f:s.push(o=new Re(h,f,d[g])));l&&l.to==h?l.to=f:i.push(l=new dt(h,f,r))}}),s.forEach(a=>n.step(a)),i.forEach(a=>n.step(a))}function zh(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof fs){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;u<a.length;u++){let d=a[u],h;for(let f=0;f<s.length;f++){let p=s[f];p.step==i-1&&d.eq(s[f].style)&&(h=p)}h?(h.to=c,h.step=i):s.push({style:d,from:Math.max(l,e),to:c,step:i})}}}),s.forEach(o=>n.step(new Re(o.from,o.to,o.style)))}function Ui(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a<i.childCount;a++){let c=i.child(a),u=l+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new te(l,u,M.empty));else{r=d;for(let h=0;h<c.marks.length;h++)t.allowsMarkType(c.marks[h].type)||n.step(new Re(l,u,c.marks[h]));if(s&&c.isText&&t.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new M(w.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new te(l+h.index,l+h.index+h[0].length,p))}}l=u}if(!r.validEnd){let a=r.fillBefore(w.empty,!0);n.replace(l,l,new M(a,0,0))}for(let a=o.length-1;a>=0;a--)n.step(o[a])}function $h(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function sn(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(r<n.depth&&o.canReplace(l,a,t))return r;if(r==0||o.type.spec.isolating||!$h(o,l,a))break;l&&(s=1),a<o.childCount&&(i=1)}return null}function Bh(n,e,t){let{$from:r,$to:s,depth:i}=e,o=r.before(i+1),l=s.after(i+1),a=o,c=l,u=w.empty,d=0;for(let p=i,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=w.from(r.node(p).copy(u)),d++):a--;let h=w.empty,f=0;for(let p=i,g=!1;p>t;p--)g||s.after(p+1)<s.end(p)?(g=!0,h=w.from(s.node(p).copy(h)),f++):c++;n.step(new re(a,c,o,l,new M(u.append(h),d,f),u.size-d,!0))}function Wi(n,e,t=null,r=n){let s=_h(n,e),i=s&&Hh(r,e);return i?s.map(al).concat({type:e,attrs:t}).concat(i.map(al)):null}function al(n){return{type:n,attrs:null}}function _h(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.contentMatchAt(r).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return t.canReplaceWith(r,s,o)?i:null}function Hh(n,e){let{parent:t,startIndex:r,endIndex:s}=n,i=t.child(r),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let a=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;a&&c<s;c++)a=a.matchType(t.child(c).type);return!a||!a.validEnd?null:o}function Fh(n,e,t){let r=w.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=w.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new re(s,i,s,i,new M(r,0,0),t.length,!0))}function Vh(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&jh(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&bc(n,o,l,i),Ui(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),h=u.map(l+o.nodeSize,1);return n.step(new re(d,h,d+1,h-1,new M(w.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&kc(n,o,l,i),!1}})}function kc(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function bc(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as i,h as c,ap as r,c as l,o as n,w as d,r as u,$ as p,aw as f}from"./
|
|
1
|
+
import{W as i,h as c,ap as r,c as l,o as n,w as d,r as u,$ as p,aw as f}from"./B06CcGVK.js";const m={base:["text-primary border-b border-transparent hover:border-primary font-medium focus-visible:outline-primary focus-visible:has-[>code]:outline-0 [&>code]:border-dashed hover:[&>code]:border-primary hover:[&>code]:text-primary focus-visible:[&>code]:border-primary focus-visible:[&>code]:text-primary","transition-colors [&>code]:transition-colors"]},y={__name:"ProseA",props:{href:{type:String,required:!1},target:{type:null,required:!1},class:{type:null,required:!1}},setup(e){const s=i(),a=c(()=>r({extend:r(m),...s.ui?.prose?.a||{}})),o=e;return(t,h)=>(n(),l(f,{href:e.href,target:e.target,class:p(a.value({class:o.class})),raw:""},{default:d(()=>[u(t.$slots,"default")]),_:3},8,["href","target","class"]))}};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as L,a as t,d as V,u as oe,c as _,o as c,w as h,Z as F,P as W,m as T,r as I,a7 as ct,aQ as Ie,aR as je,a4 as De,aT as Fe,e as H,aS as Le,f as Ge,bn as Ke,aa as N,B as pe,a3 as tt,bm as qe,ao as Ae,b$ as ft,C as fe,a5 as Re,c0 as vt,bo as mt,aq as at,bA as gt,al as ie,K as ht,T as bt,M as G,am as Pe,aY as lt,a$ as yt,g as _t,ak as it,X as xt,bF as Ct,aG as _e,aA as ot,bg as qt,ab as ye,af as de,aH as Ee,b6 as It,aU as We,aV as St,U as wt,W as kt,aB as zt,aC as Lt,aD as he,aZ as Ve,aN as Et,ax as Ft,ay as At,ap as Ye,b8 as Bt,a1 as be,c1 as Tt,aO as Vt,$ as z,ac as ze,_ as Oe,az as Xe,bW as Ot,bX as Ze,J as Kt,aP as Pt}from"./CGgHmnnS.js";import{a as $t,u as Dt,F as Rt}from"./B02JOKtW.js";import{c as Nt,a as Mt,b as Ht,P as Gt}from"./DIMnGgEU.js";import{u as rt}from"./Cj3gDP-y.js";import{f as $e}from"./B1ea1Zc2.js";import{u as jt}from"./CNB4wNeh.js";import{u as Ut,g as Wt}from"./6k0gxaWW.js";import{g as Yt,M as Xt}from"./d85YwuyC.js";import{V as Zt}from"./P3qGksT8.js";import{u as Se}from"./Suor9Vto.js";import{u as Jt}from"./iVfmia7K.js";import{c as Je}from"./pFPRVtL-.js";import{g as Qt}from"./By5L5Smf.js";import{_ as ea}from"./Ehiy7Wkv.js";function st(s){const r=L(()=>t(s)),a=L(()=>new Intl.Collator("en",{usage:"search",...r.value}));return{startsWith:(u,p)=>p.length===0?!0:(u=u.normalize("NFC"),p=p.normalize("NFC"),a.value.compare(u.slice(0,p.length),p)===0),endsWith:(u,p)=>p.length===0?!0:(u=u.normalize("NFC"),p=p.normalize("NFC"),a.value.compare(u.slice(-p.length),p)===0),contains:(u,p)=>{if(p.length===0)return!0;u=u.normalize("NFC"),p=p.normalize("NFC");let v=0;const k=p.length;for(;v+k<=u.length;v++){const C=u.slice(v,v+k);if(a.value.compare(p,C)===0)return!0}return!1}}}function ta(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}var aa=V({__name:"ComboboxAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const{forwardRef:r}=oe();return(a,e)=>(c(),_(t(Nt),{"as-child":"",reference:a.reference},{default:h(()=>[F(t(W),T({ref:t(r),"as-child":a.asChild,as:a.as},a.$attrs),{default:h(()=>[I(a.$slots,"default")]),_:3},16,["as-child","as"])]),_:3},8,["reference"]))}}),la=aa;function Qe(s){return s?.querySelector("[data-state=checked]")}function ia(s,r,a){return s===void 0?!1:Array.isArray(s)?s.some(e=>ce(e,r,a)):ce(s,r,a)}function ce(s,r,a){return s===void 0||r===void 0?!1:typeof s=="string"?s===r:typeof a=="function"?a(s,r):typeof a=="string"?s?.[a]===r?.[a]:ct(s,r)}const[Be,oa]=Ie("ListboxRoot");var ra=V({__name:"ListboxRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"vertical"},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:"toggle"},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","entryFocus","leave"],setup(s,{expose:r,emit:a}){const e=s,l=a,{multiple:i,highlightOnHover:u,orientation:p,disabled:v,selectionBehavior:k,dir:C}=je(e),{getItems:S}=De({isProvider:!0}),{handleTypeaheadSearch:f}=Ut(),{primitiveElement:m,currentElement:n}=Fe(),q=ta(),D=rt(C),P=jt(n),M=H(),Y=H(!1),j=H(!0),w=Le(e,"modelValue",l,{defaultValue:e.defaultValue??(i.value?[]:void 0),passive:e.modelValue===void 0,deep:!0});function xe(d){if(Y.value=!0,e.multiple){const y=Array.isArray(w.value)?[...w.value]:[],x=y.findIndex(E=>ce(E,d,e.by));e.selectionBehavior==="toggle"?(x===-1?y.push(d):y.splice(x,1),w.value=y):(w.value=[d],M.value=d)}else e.selectionBehavior==="toggle"&&ce(w.value,d,e.by)?w.value=void 0:w.value=d;setTimeout(()=>{Y.value=!1},1)}const O=H(null),se=H(null),X=H(!1),ee=H(!1),ne=Ke(),ve=Ke(),Z=Ke();function te(){return S().map(d=>d.ref).filter(d=>d.dataset.disabled!=="")}function R(d,y=!0){if(!d)return;O.value=d,j.value&&O.value.focus(),y&&O.value.scrollIntoView({block:"nearest"});const x=S().find(E=>E.ref===d);l("highlight",x)}function A(d){if(X.value)Z.trigger(d);else{const y=S().find(x=>ce(x.value,d,e.by));y&&(O.value=y.ref,R(y.ref))}}function J(d){O.value&&O.value.isConnected&&(d.preventDefault(),d.stopPropagation(),ee.value||O.value.click())}function Q(d){if(j.value){if(Y.value=!0,X.value)ve.trigger(d);else{const y=d.altKey||d.ctrlKey||d.metaKey;if(y&&d.key==="a"&&i.value){const x=S(),E=x.map(ue=>ue.value);w.value=[...E],d.preventDefault(),R(x[x.length-1].ref)}else if(!y){const x=f(d.key,S());x&&R(x)}}setTimeout(()=>{Y.value=!1},1)}}function ae(){ee.value=!0}function me(){pe(()=>{ee.value=!1})}function le(){pe(()=>{const d=new KeyboardEvent("keydown",{key:"PageUp"});Ce(d)})}function g(d){const y=O.value;y?.isConnected&&(se.value=y),O.value=null,l("leave",d)}function Ne(d){const y=new CustomEvent("listbox.entryFocus",{bubbles:!1,cancelable:!0});if(d.currentTarget?.dispatchEvent(y),l("entryFocus",y),!y.defaultPrevented)if(se.value)R(se.value);else{const x=te()?.[0];R(x)}}function Ce(d){const y=Yt(d,p.value,D.value);if(!y)return;let x=te();if(O.value){if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const E=x.indexOf(O.value);x=x.slice(E+1)}we(d,x[0])}if(x.length){const E=!O.value&&y==="prev"?x.length-1:0;R(x[E])}if(X.value)return ve.trigger(d)}function we(d,y){if(!(X.value||e.selectionBehavior!=="replace"||!i.value||!Array.isArray(w.value)||(d.altKey||d.ctrlKey||d.metaKey)&&!d.shiftKey)&&d.shiftKey){const E=S().filter(ge=>ge.ref.dataset.disabled!=="");let ue=E.find(ge=>ge.ref===y)?.value;if(d.key===q.END?ue=E[E.length-1].value:d.key===q.HOME&&(ue=E[0].value),!ue||!M.value)return;const Me=$e(E.map(ge=>ge.value),M.value,ue);w.value=Me}}async function ke(d){if(await pe(),X.value)ne.trigger(d);else{const y=te(),x=y.find(E=>E.dataset.state==="checked");x?R(x):y.length&&R(y[0])}}return Ge(w,()=>{Y.value||pe(()=>{ke()})},{immediate:!0,deep:!0}),r({highlightedElement:O,highlightItem:A,highlightFirstItem:le,highlightSelected:ke,getItems:S}),oa({modelValue:w,onValueChange:xe,multiple:i,orientation:p,dir:D,disabled:v,highlightOnHover:u,highlightedElement:O,isVirtual:X,virtualFocusHook:ne,virtualKeydownHook:ve,virtualHighlightHook:Z,by:e.by,firstValue:M,selectionBehavior:k,focusable:j,onLeave:g,onEnter:Ne,changeHighlight:R,onKeydownEnter:J,onKeydownNavigation:Ce,onKeydownTypeAhead:Q,onCompositionStart:ae,onCompositionEnd:me,highlightFirstItem:le}),(d,y)=>(c(),_(t(W),{ref_key:"primitiveElement",ref:m,as:d.as,"as-child":d.asChild,dir:t(D),"data-disabled":t(v)?"":void 0,onPointerleave:g,onFocusout:y[0]||(y[0]=async x=>{const E=x.relatedTarget||x.target;await pe(),O.value&&t(n)&&!t(n).contains(E)&&g(x)})},{default:h(()=>[I(d.$slots,"default",{modelValue:t(w)}),t(P)&&d.name?(c(),_(t(Zt),{key:0,name:d.name,value:t(w),disabled:t(v),required:d.required},null,8,["name","value","disabled","required"])):N("v-if",!0)]),_:3},8,["as","as-child","dir","data-disabled"]))}}),sa=ra,na=V({__name:"ListboxContent",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const{CollectionSlot:r}=De(),a=Be(),e=tt(!1,10);return(l,i)=>(c(),_(t(r),null,{default:h(()=>[F(t(W),{role:"listbox",as:l.as,"as-child":l.asChild,tabindex:t(a).focusable.value?t(a).highlightedElement.value?"-1":"0":"-1","aria-orientation":t(a).orientation.value,"aria-multiselectable":!!t(a).multiple.value,"data-orientation":t(a).orientation.value,onMousedown:i[0]||(i[0]=Ae(u=>e.value=!0,["left"])),onFocus:i[1]||(i[1]=u=>{t(e)||t(a).onEnter(u)}),onKeydown:[i[2]||(i[2]=qe(u=>{t(a).orientation.value==="vertical"&&(u.key==="ArrowLeft"||u.key==="ArrowRight")||t(a).orientation.value==="horizontal"&&(u.key==="ArrowUp"||u.key==="ArrowDown")||(u.preventDefault(),t(a).focusable.value&&t(a).onKeydownNavigation(u))},["down","up","left","right","home","end"])),qe(t(a).onKeydownEnter,["enter"]),t(a).onKeydownTypeAhead]},{default:h(()=>[I(l.$slots,"default")]),_:3},8,["as","as-child","tabindex","aria-orientation","aria-multiselectable","data-orientation","onKeydown"])]),_:3}))}}),ua=na,da=V({__name:"ListboxFilter",props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(s,{emit:r}){const a=s,l=Le(a,"modelValue",r,{defaultValue:"",passive:a.modelValue===void 0}),i=Be(),{primitiveElement:u,currentElement:p}=Fe(),v=L(()=>a.disabled||i.disabled.value||!1),k=H();return ft(()=>k.value=i.highlightedElement.value?.id),fe(()=>{i.focusable.value=!1,setTimeout(()=>{a.autoFocus&&p.value?.focus()},1)}),Re(()=>{i.focusable.value=!0}),(C,S)=>(c(),_(t(W),{ref_key:"primitiveElement",ref:u,as:C.as,"as-child":C.asChild,value:t(l),disabled:v.value?"":void 0,"data-disabled":v.value?"":void 0,"aria-disabled":v.value??void 0,"aria-activedescendant":k.value,type:"text",onKeydown:[qe(Ae(t(i).onKeydownNavigation,["prevent"]),["down","up","home","end"]),qe(t(i).onKeydownEnter,["enter"])],onInput:S[0]||(S[0]=f=>{l.value=f.target.value,t(i).highlightFirstItem()}),onCompositionstart:t(i).onCompositionStart,onCompositionend:t(i).onCompositionEnd},{default:h(()=>[I(C.$slots,"default",{modelValue:t(l)})]),_:3},8,["as","as-child","value","disabled","data-disabled","aria-disabled","aria-activedescendant","onKeydown","onCompositionstart","onCompositionend"]))}}),pa=da;const[ml,ca]=Ie("ListboxGroup");var fa=V({__name:"ListboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=Se(void 0,"reka-listbox-group");return ca({id:a}),(e,l)=>(c(),_(t(W),T({role:"group"},r,{"aria-labelledby":t(a)}),{default:h(()=>[I(e.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),va=fa;const ma="listbox.select",[ga,ha]=Ie("ListboxItem");var ba=V({__name:"ListboxItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["select"],setup(s,{emit:r}){const a=s,e=r,l=Se(void 0,"reka-listbox-item"),{CollectionItem:i}=De(),{forwardRef:u,currentElement:p}=oe(),v=Be(),k=L(()=>p.value===v.highlightedElement.value),C=L(()=>ia(v.modelValue.value,a.value,v.by)),S=L(()=>v.disabled.value||a.disabled);async function f(n){e("select",n),!n?.defaultPrevented&&!S.value&&n&&(v.onValueChange(a.value),v.changeHighlight(p.value))}function m(n){const q={originalEvent:n,value:a.value};mt(ma,f,q)}return ha({isSelected:C}),(n,q)=>(c(),_(t(i),{value:n.value},{default:h(()=>[vt([k.value,C.value],()=>F(t(W),T({id:t(l)},n.$attrs,{ref:t(u),role:"option",tabindex:t(v).focusable.value?k.value?"0":"-1":-1,"aria-selected":C.value,as:n.as,"as-child":n.asChild,disabled:S.value?"":void 0,"data-disabled":S.value?"":void 0,"data-highlighted":k.value?"":void 0,"data-state":C.value?"checked":"unchecked",onClick:m,onKeydown:qe(Ae(m,["prevent"]),["space"]),onPointermove:q[0]||(q[0]=()=>{t(v).highlightedElement.value!==t(p)&&t(v).highlightOnHover.value&&!t(v).focusable.value&&t(v).changeHighlight(t(p),!1)})}),{default:h(()=>[I(n.$slots,"default")]),_:3},16,["id","tabindex","aria-selected","as","as-child","disabled","data-disabled","data-highlighted","data-state","onKeydown"]),q,1)]),_:3},8,["value"]))}}),ya=ba,_a=V({__name:"ListboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const r=s;oe();const a=ga();return(e,l)=>t(a).isSelected.value?(c(),_(t(W),T({key:0,"aria-hidden":"true"},r),{default:h(()=>[I(e.$slots,"default")]),_:3},16)):N("v-if",!0)}}),xa=_a,Ca=V({__name:"ListboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:Number,required:!1},textContent:{type:Function,required:!1}},setup(s){const r=s,a=at(),e=Be(),l=gt(),{getItems:i}=De();e.isVirtual.value=!0;const u=L(()=>{const f=l.value;if(f){const m=window.getComputedStyle(f);return{start:Number.parseFloat(m.paddingBlockStart||m.paddingTop),end:Number.parseFloat(m.paddingBlockEnd||m.paddingBottom)}}else return{start:0,end:0}}),p=Jt({get scrollPaddingStart(){return u.value.start},get scrollPaddingEnd(){return u.value.end},get count(){return r.options.length},get horizontal(){return e.orientation.value==="horizontal"},estimateSize(){return r.estimateSize??28},getScrollElement(){return l.value},overscan:r.overscan??12}),v=L(()=>p.value.getVirtualItems().map(f=>{const m=a.default({option:r.options[f.index],virtualizer:p.value,virtualItem:f})[0],n=m.type===ie&&Array.isArray(m.children)?m.children[0]:m;return{item:f,is:ht(n,{key:`${f.key}`,"data-index":f.index,"aria-setsize":r.options.length,"aria-posinset":f.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${f.start}px)`,overflowAnchor:"none"}})}}));e.virtualFocusHook.on(f=>{const m=r.options.findIndex(n=>Array.isArray(e.modelValue.value)?ce(n,e.modelValue.value[0],e.by):ce(n,e.modelValue.value,e.by));m!==-1?(f?.preventDefault(),p.value.scrollToIndex(m,{align:"start"}),requestAnimationFrame(()=>{const n=Qe(l.value);n&&(e.changeHighlight(n),f&&n?.focus())})):e.highlightFirstItem()}),e.virtualHighlightHook.on(f=>{const m=r.options.findIndex(n=>ce(n,f,e.by));p.value.scrollToIndex(m,{align:"start"}),requestAnimationFrame(()=>{const n=Qe(l.value);n&&e.changeHighlight(n)})});const k=tt("",1e3),C=L(()=>{const f=m=>r.textContent?r.textContent(m):m?.toString().toLowerCase();return r.options.map((m,n)=>({index:n,textContent:f(m)}))});function S(f,m){if(!e.firstValue?.value||!e.multiple.value||!Array.isArray(e.modelValue.value))return;const q=i().filter(P=>P.ref.dataset.disabled!=="").find(P=>P.ref===e.highlightedElement.value)?.value;if(!q)return;let D=null;switch(m){case"prev":case"next":{D=$e(r.options,e.firstValue.value,q);break}case"first":{D=$e(r.options,e.firstValue.value,r.options?.[0]);break}case"last":{D=$e(r.options,e.firstValue.value,r.options?.[r.options.length-1]);break}}e.modelValue.value=D}return e.virtualKeydownHook.on(f=>{const m=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!m)return;let q=Xt[f.key];if(m&&f.key==="a"&&e.multiple.value?(f.preventDefault(),e.modelValue.value=[...r.options],q="last"):f.shiftKey&&q&&S(f,q),["first","last"].includes(q)){f.preventDefault();const D=q==="first"?0:r.options.length-1;p.value.scrollToIndex(D),requestAnimationFrame(()=>{const P=i(),M=q==="first"?P[0]:P[P.length-1];M&&e.changeHighlight(M.ref)})}else if(!q&&!m){k.value+=f.key;const D=Number(bt()?.getAttribute("data-index")),P=C.value[D].textContent,M=C.value.map(w=>w.textContent??""),Y=Wt(M,k.value,P),j=C.value.find(w=>w.textContent===Y);j&&(p.value.scrollToIndex(j.index,{align:"start"}),requestAnimationFrame(()=>{const w=l.value.querySelector(`[data-index="${j.index}"]`);w instanceof HTMLElement&&e.changeHighlight(w)}))}}),(f,m)=>(c(),G("div",{"data-reka-virtualizer":"",style:yt({position:"relative",width:"100%",height:`${t(p).getTotalSize()}px`})},[(c(!0),G(ie,null,Pe(v.value,({is:n,item:q})=>(c(),_(lt(n),{key:q.index}))),128))],4))}}),qa=Ca;const[re,Ia]=Ie("ComboboxRoot");var Sa=V({__name:"ComboboxRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},openOnFocus:{type:Boolean,required:!1,default:!1},openOnClick:{type:Boolean,required:!1,default:!1},ignoreFilter:{type:Boolean,required:!1},resetModelValueOnClear:{type:Boolean,required:!1,default:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","update:open"],setup(s,{expose:r,emit:a}){const e=s,l=a,{primitiveElement:i,currentElement:u}=Fe(),{multiple:p,disabled:v,ignoreFilter:k,resetSearchTermOnSelect:C,openOnFocus:S,openOnClick:f,dir:m,resetModelValueOnClear:n,highlightOnHover:q}=je(e),D=rt(m),P=Le(e,"modelValue",l,{defaultValue:e.defaultValue??(p.value?[]:void 0),passive:e.modelValue===void 0,deep:!0}),M=Le(e,"open",l,{defaultValue:e.defaultOpen,passive:e.open===void 0});async function Y(A){M.value=A,Z.value="",A?(await pe(),i.value?.highlightSelected(),w.value=!0,O.value?.focus()):(w.value=!1,setTimeout(()=>{!A&&e.resetSearchTermOnBlur&&j.trigger()},1))}const j=Ke(),w=H(!1),xe=H(!1),O=H(),se=H(),X=L(()=>i.value?.highlightedElement??void 0),ee=H(new Map),ne=H(new Map),{contains:ve}=st({sensitivity:"base"}),Z=H(""),te=L(A=>{if(!Z.value||e.ignoreFilter||xe.value)return{count:ee.value.size,items:A?.items??new Map,groups:A?.groups??new Set(ne.value.keys())};let J=0;const Q=new Map,ae=new Set;for(const[me,le]of ee.value){const g=ve(le,Z.value);Q.set(me,g?1:0),g&&J++}for(const[me,le]of ne.value)for(const g of le)if(Q.get(g)>0){ae.add(me);break}return{count:J,items:Q,groups:ae}}),R=_t();return fe(()=>{R?.exposed&&(R.exposed.highlightItem=i.value?.highlightItem,R.exposed.highlightFirstItem=i.value?.highlightFirstItem,R.exposed.highlightSelected=i.value?.highlightSelected)}),r({filtered:te,highlightedElement:X,highlightItem:i.value?.highlightItem,highlightFirstItem:i.value?.highlightFirstItem,highlightSelected:i.value?.highlightSelected}),Ia({modelValue:P,multiple:p,disabled:v,open:M,onOpenChange:Y,contentId:"",isUserInputted:w,isVirtual:xe,inputElement:O,highlightedElement:X,onInputElementChange:A=>O.value=A,triggerElement:se,onTriggerElementChange:A=>se.value=A,parentElement:u,resetSearchTermOnSelect:C,onResetSearchTerm:j.on,allItems:ee,allGroups:ne,filterSearch:Z,filterState:te,ignoreFilter:k,openOnFocus:S,openOnClick:f,resetModelValueOnClear:n}),(A,J)=>(c(),_(t(Mt),null,{default:h(()=>[F(t(sa),T({ref_key:"primitiveElement",ref:i},A.$attrs,{modelValue:t(P),"onUpdate:modelValue":J[0]||(J[0]=Q=>it(P)?P.value=Q:null),style:{pointerEvents:t(M)?"auto":void 0},as:A.as,"as-child":A.asChild,dir:t(D),multiple:t(p),name:A.name,required:A.required,disabled:t(v),"highlight-on-hover":t(q),by:e.by,onHighlight:J[1]||(J[1]=Q=>l("highlight",Q))}),{default:h(()=>[I(A.$slots,"default",{open:t(M),modelValue:t(P)})]),_:3},16,["modelValue","style","as","as-child","dir","multiple","name","required","disabled","highlight-on-hover","by"])]),_:3}))}}),wa=Sa;const[ka,za]=Ie("ComboboxContent");var La=V({__name:"ComboboxContentImpl",props:{position:{type:String,required:!1,default:"inline"},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(s,{emit:r}){const a=s,e=r,{position:l}=je(a),i=re(),{forwardRef:u,currentElement:p}=oe();$t(a.bodyLock),Dt(i.parentElement);const v=L(()=>a.position==="popper"?a:{}),k=xt(v.value),C={boxSizing:"border-box","--reka-combobox-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-combobox-content-available-width":"var(--reka-popper-available-width)","--reka-combobox-content-available-height":"var(--reka-popper-available-height)","--reka-combobox-trigger-width":"var(--reka-popper-anchor-width)","--reka-combobox-trigger-height":"var(--reka-popper-anchor-height)"};za({position:l});const S=H(!1);return fe(()=>{i.inputElement.value&&(S.value=p.value.contains(i.inputElement.value),S.value&&i.inputElement.value.focus())}),Re(()=>{S.value&&i.triggerElement.value?.focus()}),(f,m)=>(c(),_(t(ua),{"as-child":""},{default:h(()=>[F(t(Ct),{"as-child":"","disable-outside-pointer-events":f.disableOutsidePointerEvents,onDismiss:m[0]||(m[0]=n=>t(i).onOpenChange(!1)),onFocusOutside:m[1]||(m[1]=n=>{t(i).parentElement.value?.contains(n.target)&&n.preventDefault(),e("focusOutside",n)}),onInteractOutside:m[2]||(m[2]=n=>e("interactOutside",n)),onEscapeKeyDown:m[3]||(m[3]=n=>e("escapeKeyDown",n)),onPointerDownOutside:m[4]||(m[4]=n=>{t(i).parentElement.value?.contains(n.target)&&n.preventDefault(),e("pointerDownOutside",n)})},{default:h(()=>[(c(),_(lt(t(l)==="popper"?t(Ht):t(W)),T({...f.$attrs,...t(k)},{id:t(i).contentId,ref:t(u),"data-state":t(i).open.value?"open":"closed",style:{display:"flex",flexDirection:"column",outline:"none",...t(l)==="popper"?C:{}}}),{default:h(()=>[I(f.$slots,"default")]),_:3},16,["id","data-state","style"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3}))}}),Ea=La,Fa=V({__name:"ComboboxArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(s){const r=s,a=re(),e=ka();return oe(),(l,i)=>t(a).open.value&&t(e).position.value==="popper"?(c(),_(t(Gt),_e(T({key:0},r)),{default:h(()=>[I(l.$slots,"default")]),_:3},16)):N("v-if",!0)}}),Aa=Fa,Ba=V({__name:"ComboboxContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(s,{emit:r}){const l=ot(s,r),{forwardRef:i}=oe(),u=re();return u.contentId||=Se(void 0,"reka-combobox-content"),(p,v)=>(c(),_(t(qt),{present:p.forceMount||t(u).open.value},{default:h(()=>[F(Ea,T({...t(l),...p.$attrs},{ref:t(i)}),{default:h(()=>[I(p.$slots,"default")]),_:3},16)]),_:3},8,["present"]))}}),Ta=Ba,Va=V({__name:"ComboboxEmpty",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=re(),e=L(()=>a.ignoreFilter.value?a.allItems.value.size===0:a.filterState.value.count===0);return(l,i)=>e.value?(c(),_(t(W),_e(T({key:0},r)),{default:h(()=>[I(l.$slots,"default",{},()=>[i[0]||(i[0]=ye("No options"))])]),_:3},16)):N("v-if",!0)}}),Oa=Va;const[nt,Ka]=Ie("ComboboxGroup");var Pa=V({__name:"ComboboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=Se(void 0,"reka-combobox-group"),e=re(),l=L(()=>e.ignoreFilter.value?!0:e.filterSearch.value?e.filterState.value.groups.has(a):!0),i=Ka({id:a,labelId:""});return fe(()=>{e.allGroups.value.has(a)||e.allGroups.value.set(a,new Set)}),Re(()=>{e.allGroups.value.delete(a)}),(u,p)=>(c(),_(t(va),T({id:t(a),"aria-labelledby":t(i).labelId},r,{hidden:l.value?void 0:!0}),{default:h(()=>[I(u.$slots,"default")]),_:3},16,["id","aria-labelledby","hidden"]))}}),He=Pa,$a=V({__name:"ComboboxInput",props:{displayValue:{type:Function,required:!1},modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(s,{emit:r}){const a=s,e=r,l=re(),i=Be(),{primitiveElement:u,currentElement:p}=Fe(),v=Le(a,"modelValue",e,{passive:a.modelValue===void 0});fe(()=>{p.value&&l.onInputElementChange(p.value)});function k(n){l.open.value||l.onOpenChange(!0)}function C(n){const q=n.target;l.open.value?l.filterSearch.value=q.value:(l.onOpenChange(!0),pe(()=>{q.value&&(l.filterSearch.value=q.value,i.highlightFirstItem())}))}function S(){l.openOnFocus.value&&!l.open.value&&l.onOpenChange(!0)}function f(){l.openOnClick.value&&!l.open.value&&l.onOpenChange(!0)}function m(){const n=l.modelValue.value;a.displayValue?v.value=a.displayValue(n):!l.multiple.value&&n&&!Array.isArray(n)&&typeof n!="object"?v.value=n.toString():v.value="",pe(()=>{v.value=v.value})}return l.onResetSearchTerm(()=>{m()}),Ge(l.modelValue,async()=>{!l.isUserInputted.value&&l.resetSearchTermOnSelect.value&&m()},{immediate:!0,deep:!0}),Ge(l.filterState,(n,q)=>{!l.isVirtual.value&&q.count===0&&i.highlightFirstItem()}),(n,q)=>(c(),_(t(pa),{ref_key:"primitiveElement",ref:u,modelValue:t(v),"onUpdate:modelValue":q[0]||(q[0]=D=>it(v)?v.value=D:null),as:n.as,"as-child":n.asChild,"auto-focus":n.autoFocus,disabled:n.disabled,"aria-expanded":t(l).open.value,"aria-controls":t(l).contentId,"aria-autocomplete":"list",role:"combobox",autocomplete:"off",onClick:f,onInput:C,onKeydown:qe(Ae(k,["prevent"]),["down","up"]),onFocus:S},{default:h(()=>[I(n.$slots,"default")]),_:3},8,["modelValue","as","as-child","auto-focus","disabled","aria-expanded","aria-controls","onKeydown"]))}}),Da=$a,Ra=V({__name:"ComboboxItem",props:{textValue:{type:String,required:!1},value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(s,{emit:r}){const a=s,e=r,l=Se(void 0,"reka-combobox-item"),i=re(),u=nt(null),{primitiveElement:p,currentElement:v}=Fe();if(a.value==="")throw new Error("A <ComboboxItem /> must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.");const k=L(()=>{if(i.isVirtual.value||i.ignoreFilter.value||!i.filterSearch.value)return!0;{const C=i.filterState.value.items.get(l);return C===void 0?!0:C>0}});return fe(()=>{i.allItems.value.set(l,a.textValue||v.value.textContent||v.value.innerText);const C=u?.id;C&&(i.allGroups.value.has(C)?i.allGroups.value.get(C)?.add(l):i.allGroups.value.set(C,new Set([l])))}),Re(()=>{i.allItems.value.delete(l)}),(C,S)=>k.value?(c(),_(t(ya),T({key:0},a,{id:t(l),ref_key:"primitiveElement",ref:p,disabled:t(i).disabled.value||C.disabled,onSelect:S[0]||(S[0]=f=>{e("select",f),!f.defaultPrevented&&!t(i).multiple.value&&!C.disabled&&!t(i).disabled.value&&(f.preventDefault(),t(i).onOpenChange(!1),t(i).modelValue.value=a.value)})}),{default:h(()=>[I(C.$slots,"default",{},()=>[ye(de(C.value),1)])]),_:3},16,["id","disabled"])):N("v-if",!0)}}),et=Ra,Na=V({__name:"ComboboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const r=s;return(a,e)=>(c(),_(t(xa),_e(Ee(r)),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ma=Na,Ha=V({__name:"ComboboxLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(s){const r=s;oe();const a=nt({id:"",labelId:""});return a.labelId||=Se(void 0,"reka-combobox-group-label"),(e,l)=>(c(),_(t(W),T(r,{id:t(a).labelId}),{default:h(()=>[I(e.$slots,"default")]),_:3},16,["id"]))}}),Ga=Ha,ja=V({__name:"ComboboxPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(s){const r=s;return(a,e)=>(c(),_(t(It),_e(Ee(r)),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ua=ja,Wa=V({__name:"ComboboxSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s;return oe(),(a,e)=>(c(),_(t(W),T(r,{"aria-hidden":"true"}),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ya=Wa,Xa=V({__name:"ComboboxTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(s){const r=s,{forwardRef:a,currentElement:e}=oe(),l=re(),i=L(()=>r.disabled||l.disabled.value||!1);return fe(()=>{e.value&&l.onTriggerElementChange(e.value)}),(u,p)=>(c(),_(t(W),T(r,{ref:t(a),type:u.as==="button"?"button":void 0,tabindex:"-1","aria-label":"Show popup","aria-haspopup":"listbox","aria-expanded":t(l).open.value,"aria-controls":t(l).contentId,"data-state":t(l).open.value?"open":"closed",disabled:i.value,"data-disabled":i.value?"":void 0,"aria-disabled":i.value??void 0,onClick:p[0]||(p[0]=v=>t(l).onOpenChange(!t(l).open.value))}),{default:h(()=>[I(u.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","disabled","data-disabled","aria-disabled"]))}}),Za=Xa,Ja=V({__name:"ComboboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:Number,required:!1},textContent:{type:Function,required:!1}},setup(s){const r=s,a=re();return a.isVirtual.value=!0,(e,l)=>(c(),_(qa,_e(Ee(r)),{default:h(i=>[I(e.$slots,"default",_e(Ee(i)))]),_:3},16))}}),Qa=Ja;const el={slots:{base:["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed",value:"truncate pointer-events-none",placeholder:"truncate text-dimmed",arrow:"fill-default",content:["max-h-60 w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col","origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)"],viewport:"relative scroll-py-1 overflow-y-auto flex-1",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:["group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"],itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemWrapper:"flex-1 flex flex-col min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted",input:"border-b border-default",focusScope:"flex flex-col min-h-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1 text-xs"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1.5 text-xs"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-1.5 text-sm"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-2 text-sm"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailingIcon:"size-6",empty:"p-2 text-base"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},gl=Object.assign({inheritAttrs:!1},{__name:"USelectMenu",props:We({id:{type:String,required:!1},placeholder:{type:String,required:!1},searchInput:{type:[Boolean,Object],required:!1,default:!0},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:Object,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:We(["update:open","change","blur","focus","create","highlight","update:modelValue"],["update:searchTerm"]),setup(s,{expose:r,emit:a}){const e=s,l=a,i=at(),u=St(s,"searchTerm",{type:String,default:""}),{t:p}=wt(),v=kt(),{contains:k}=st({sensitivity:"base"}),C=ot(zt(e,"modelValue","defaultValue","open","defaultOpen","required","multiple","resetSearchTermOnBlur","resetSearchTermOnSelect","highlightOnHover"),l),S=Lt(he(()=>e.portal)),f=he(()=>Ve(e.content,{side:"bottom",sideOffset:8,collisionPadding:8,position:"popper"})),m=he(()=>e.arrow),n=he(()=>e.virtualize?Ve(typeof e.virtualize=="boolean"?{}:e.virtualize,{estimateSize:Qt(we.value,e.size||"md",e.descriptionKey)}):!1),q=he(()=>Ve(e.searchInput,{placeholder:p("selectMenu.search"),variant:"none"})),{emitFormBlur:D,emitFormFocus:P,emitFormInput:M,emitFormChange:Y,size:j,color:w,id:xe,name:O,highlight:se,disabled:X,ariaAttrs:ee}=Et(e),{orientation:ne,size:ve}=Ft(e),{isLeading:Z,isTrailing:te,leadingIconName:R,trailingIconName:A}=At(he(()=>Ve(e,{trailingIcon:v.ui.icons.chevronDown}))),J=L(()=>ve.value||j.value),[Q,ae]=Je(),[me,le]=Je({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),g=L(()=>Ye({extend:Ye(el),...v.ui?.selectMenu||{}})({color:w.value,variant:e.variant,size:J?.value,loading:e.loading,highlight:se.value,leading:Z.value||!!e.avatar||!!i.leading,trailing:te.value||!!i.trailing,fieldGroup:ne.value,virtualize:!!e.virtualize}));function Ne(b){if(e.multiple&&Array.isArray(b)){const B=b.map(o=>Ze(we.value,o,{labelKey:e.labelKey,valueKey:e.valueKey})).filter(o=>o!=null&&o!=="");return B.length>0?B.join(", "):void 0}return Ze(we.value,b,{labelKey:e.labelKey,valueKey:e.valueKey})}const Ce=L(()=>e.items?.length?Bt(e.items)?e.items:[e.items]:[]),we=L(()=>Ce.value.flatMap(b=>b)),ke=L(()=>{if(e.ignoreFilter||!u.value)return Ce.value;const b=Array.isArray(e.filterFields)?e.filterFields:[e.labelKey];return Ce.value.map(B=>B.filter(o=>o==null?!1:typeof o!="object"?k(String(o),u.value):o.type&&["label","separator"].includes(o.type)?!0:b.some(U=>{const K=be(o,U);return K!=null&&k(String(K),u.value)}))).filter(B=>B.filter(o=>!$(o)||!o.type||!["label","separator"].includes(o.type)).length>0)}),d=L(()=>ke.value.flatMap(b=>b)),y=L(()=>{if(!e.createItem||!u.value)return!1;const b=e.valueKey?{[e.valueKey]:u.value}:u.value;return typeof e.createItem=="object"&&e.createItem.when==="always"||e.createItem==="always"?!d.value.find(B=>Tt(B,b,e.valueKey)):!d.value.length}),x=L(()=>typeof e.createItem=="object"?e.createItem.position:"bottom"),E=Vt("triggerRef");function ue(){e.autofocus&&E.value?.$el?.focus({focusVisible:!0})}fe(()=>{setTimeout(()=>{ue()},e.autofocusDelay)});function Me(b){if(Kt(e.modelValue)===b)return;e.modelModifiers?.trim&&(b=b?.trim()??null),e.modelModifiers?.number&&(b=Pt(b)),e.modelModifiers?.nullable&&(b??=null),e.modelModifiers?.optional&&(b??=void 0);const B=new Event("change",{target:{value:b}});l("change",B),Y(),M(),e.resetSearchTermOnSelect&&(u.value="")}function ge(b){let B;if(b){const o=new FocusEvent("focus");l("focus",o),P(),clearTimeout(B)}else{const o=new FocusEvent("blur");l("blur",o),D(),e.resetSearchTermOnBlur&&(B=setTimeout(()=>{u.value=""},100))}}function ut(b){b.preventDefault(),b.stopPropagation(),l("create",u.value)}function dt(b,B){if($(B)){if(B.disabled){b.preventDefault();return}B.onSelect?.(b)}}function $(b){return typeof b=="object"&&b!==null}return r({triggerRef:he(()=>E.value?.$el)}),(b,B)=>(c(),G(ie,null,[F(t(Q),null,{default:h(()=>[F(t(et),{"data-slot":"item",class:z(g.value.item({class:e.ui?.item})),value:u.value,onSelect:ut},{default:h(()=>[ze("span",{"data-slot":"itemLabel",class:z(g.value.itemLabel({class:e.ui?.itemLabel}))},[I(b.$slots,"create-item-label",{item:u.value},()=>[ye(de(t(p)("selectMenu.create",{label:u.value})),1)])],2)]),_:3},8,["class","value"])]),_:3}),F(t(me),null,{default:h(({item:o,index:U})=>[$(o)&&o.type==="label"?(c(),_(t(Ga),{key:0,"data-slot":"label",class:z(g.value.label({class:[e.ui?.label,o.ui?.label,o.class]}))},{default:h(()=>[ye(de(t(be)(o,e.labelKey)),1)]),_:2},1032,["class"])):$(o)&&o.type==="separator"?(c(),_(t(Ya),{key:1,"data-slot":"separator",class:z(g.value.separator({class:[e.ui?.separator,o.ui?.separator,o.class]}))},null,8,["class"])):(c(),_(t(et),{key:2,"data-slot":"item",class:z(g.value.item({class:[e.ui?.item,$(o)&&o.ui?.item,$(o)&&o.class]})),disabled:$(o)&&o.disabled,value:e.valueKey&&$(o)?t(be)(o,e.valueKey):o,onSelect:K=>dt(K,o)},{default:h(()=>[I(b.$slots,"item",{item:o,index:U,ui:g.value},()=>[I(b.$slots,"item-leading",{item:o,index:U,ui:g.value},()=>[$(o)&&o.icon?(c(),_(Oe,{key:0,name:o.icon,"data-slot":"itemLeadingIcon",class:z(g.value.itemLeadingIcon({class:[e.ui?.itemLeadingIcon,o.ui?.itemLeadingIcon]}))},null,8,["name","class"])):$(o)&&o.avatar?(c(),_(Xe,T({key:1,size:o.ui?.itemLeadingAvatarSize||e.ui?.itemLeadingAvatarSize||g.value.itemLeadingAvatarSize()},o.avatar,{"data-slot":"itemLeadingAvatar",class:g.value.itemLeadingAvatar({class:[e.ui?.itemLeadingAvatar,o.ui?.itemLeadingAvatar]})}),null,16,["size","class"])):$(o)&&o.chip?(c(),_(Ot,T({key:2,size:e.ui?.itemLeadingChipSize||g.value.itemLeadingChipSize(),inset:"",standalone:""},o.chip,{"data-slot":"itemLeadingChip",class:g.value.itemLeadingChip({class:[e.ui?.itemLeadingChip,o.ui?.itemLeadingChip]})}),null,16,["size","class"])):N("",!0)]),ze("span",{"data-slot":"itemWrapper",class:z(g.value.itemWrapper({class:[e.ui?.itemWrapper,$(o)&&o.ui?.itemWrapper]}))},[ze("span",{"data-slot":"itemLabel",class:z(g.value.itemLabel({class:[e.ui?.itemLabel,$(o)&&o.ui?.itemLabel]}))},[I(b.$slots,"item-label",{item:o,index:U},()=>[ye(de($(o)?t(be)(o,e.labelKey):o),1)])],2),$(o)&&(t(be)(o,e.descriptionKey)||i["item-description"])?(c(),G("span",{key:0,"data-slot":"itemDescription",class:z(g.value.itemDescription({class:[e.ui?.itemDescription,$(o)&&o.ui?.itemDescription]}))},[I(b.$slots,"item-description",{item:o,index:U},()=>[ye(de(t(be)(o,e.descriptionKey)),1)])],2)):N("",!0)],2),ze("span",{"data-slot":"itemTrailing",class:z(g.value.itemTrailing({class:[e.ui?.itemTrailing,$(o)&&o.ui?.itemTrailing]}))},[I(b.$slots,"item-trailing",{item:o,index:U,ui:g.value}),F(t(Ma),{"as-child":""},{default:h(()=>[F(Oe,{name:s.selectedIcon||t(v).ui.icons.check,"data-slot":"itemTrailingIcon",class:z(g.value.itemTrailingIcon({class:[e.ui?.itemTrailingIcon,$(o)&&o.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:2},1032,["class","disabled","value","onSelect"]))]),_:3}),F(t(wa),T({id:t(xe)},{...t(C),...b.$attrs,...t(ee)},{"ignore-filter":"","as-child":"",name:t(O),disabled:t(X),"onUpdate:modelValue":Me,"onUpdate:open":ge}),{default:h(({modelValue:o,open:U})=>[F(t(la),{"as-child":""},{default:h(()=>[F(t(Za),{ref_key:"triggerRef",ref:E,"data-slot":"base",class:z(g.value.base({class:[e.ui?.base,e.class]})),tabindex:"0"},{default:h(()=>[t(Z)||s.avatar||i.leading?(c(),G("span",{key:0,"data-slot":"leading",class:z(g.value.leading({class:e.ui?.leading}))},[I(b.$slots,"leading",{modelValue:o,open:U,ui:g.value},()=>[t(Z)&&t(R)?(c(),_(Oe,{key:0,name:t(R),"data-slot":"leadingIcon",class:z(g.value.leadingIcon({class:e.ui?.leadingIcon}))},null,8,["name","class"])):s.avatar?(c(),_(Xe,T({key:1,size:e.ui?.itemLeadingAvatarSize||g.value.itemLeadingAvatarSize()},s.avatar,{"data-slot":"itemLeadingAvatar",class:g.value.itemLeadingAvatar({class:e.ui?.itemLeadingAvatar})}),null,16,["size","class"])):N("",!0)])],2)):N("",!0),I(b.$slots,"default",{modelValue:o,open:U,ui:g.value},()=>[(c(!0),G(ie,null,Pe([Ne(o)],K=>(c(),G(ie,{key:K},[K!=null?(c(),G("span",{key:0,"data-slot":"value",class:z(g.value.value({class:e.ui?.value}))},de(K),3)):(c(),G("span",{key:1,"data-slot":"placeholder",class:z(g.value.placeholder({class:e.ui?.placeholder}))},de(s.placeholder??" "),3))],64))),128))]),t(te)||i.trailing?(c(),G("span",{key:1,"data-slot":"trailing",class:z(g.value.trailing({class:e.ui?.trailing}))},[I(b.$slots,"trailing",{modelValue:o,open:U,ui:g.value},()=>[t(A)?(c(),_(Oe,{key:0,name:t(A),"data-slot":"trailingIcon",class:z(g.value.trailingIcon({class:e.ui?.trailingIcon}))},null,8,["name","class"])):N("",!0)])],2)):N("",!0)]),_:2},1032,["class"])]),_:2},1024),F(t(Ua),_e(Ee(t(S))),{default:h(()=>[F(t(Ta),T({"data-slot":"content",class:g.value.content({class:e.ui?.content})},f.value),{default:h(()=>[F(t(Rt),{trapped:"","data-slot":"focusScope",class:z(g.value.focusScope({class:e.ui?.focusScope}))},{default:h(()=>[I(b.$slots,"content-top"),s.searchInput?(c(),_(t(Da),{key:0,modelValue:u.value,"onUpdate:modelValue":B[1]||(B[1]=K=>u.value=K),"display-value":()=>u.value,"as-child":""},{default:h(()=>[F(ea,T({autofocus:"",autocomplete:"off",size:s.size},q.value,{"data-slot":"input",class:g.value.input({class:e.ui?.input}),onChange:B[0]||(B[0]=Ae(()=>{},["stop"]))}),null,16,["size","class"])]),_:1},8,["modelValue","display-value"])):N("",!0),F(t(Oa),{"data-slot":"empty",class:z(g.value.empty({class:e.ui?.empty}))},{default:h(()=>[I(b.$slots,"empty",{searchTerm:u.value},()=>[ye(de(u.value?t(p)("selectMenu.noMatch",{searchTerm:u.value}):t(p)("selectMenu.noData")),1)])]),_:3},8,["class"]),ze("div",{role:"presentation","data-slot":"viewport",class:z(g.value.viewport({class:e.ui?.viewport}))},[s.virtualize?(c(),G(ie,{key:0},[y.value&&x.value==="top"?(c(),_(t(ae),{key:0})):N("",!0),F(t(Qa),T({options:d.value,"text-content":K=>$(K)?t(be)(K,e.labelKey):String(K)},n.value),{default:h(({option:K,virtualItem:Te})=>[F(t(le),{item:K,index:Te.index},null,8,["item","index"])]),_:1},16,["options","text-content"]),y.value&&x.value==="bottom"?(c(),_(t(ae),{key:1})):N("",!0)],64)):(c(),G(ie,{key:1},[y.value&&x.value==="top"?(c(),_(t(He),{key:0,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[F(t(ae))]),_:1},8,["class"])):N("",!0),(c(!0),G(ie,null,Pe(ke.value,(K,Te)=>(c(),_(t(He),{key:`group-${Te}`,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[(c(!0),G(ie,null,Pe(K,(pt,Ue)=>(c(),_(t(le),{key:`group-${Te}-${Ue}`,item:pt,index:Ue},null,8,["item","index"]))),128))]),_:2},1032,["class"]))),128)),y.value&&x.value==="bottom"?(c(),_(t(He),{key:1,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[F(t(ae))]),_:1},8,["class"])):N("",!0)],64))],2),I(b.$slots,"content-bottom")]),_:3},8,["class"]),s.arrow?(c(),_(t(Aa),T({key:0},m.value,{"data-slot":"arrow",class:g.value.arrow({class:e.ui?.arrow})}),null,16,["class"])):N("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["id","name","disabled"])],64))}});export{ya as L,gl as _,xa as a,pa as b,ua as c,qa as d,va as e,sa as f,ml as i};
|
|
1
|
+
import{h as L,a as t,d as V,u as oe,c as _,o as c,w as h,Z as F,P as W,m as T,r as I,a7 as ct,aQ as Ie,aR as je,a4 as De,aT as Fe,e as H,aS as Le,f as Ge,bn as Ke,aa as N,B as pe,a3 as tt,bm as qe,ao as Ae,b$ as ft,C as fe,a5 as Re,c0 as vt,bo as mt,aq as at,bA as gt,al as ie,K as ht,T as bt,M as G,am as Pe,aY as lt,b6 as yt,g as _t,ak as it,X as xt,bF as Ct,aG as _e,aA as ot,bg as qt,ab as ye,af as de,aH as Ee,b5 as It,aU as We,aV as St,U as wt,W as kt,aB as zt,aC as Lt,aD as he,aZ as Ve,aN as Et,ax as Ft,ay as At,ap as Ye,b8 as Bt,a1 as be,c1 as Tt,aO as Vt,$ as z,ac as ze,_ as Oe,az as Xe,bW as Ot,bX as Ze,J as Kt,aP as Pt}from"./B06CcGVK.js";import{a as $t,u as Dt,F as Rt}from"./CTJDAjdO.js";import{c as Nt,a as Mt,b as Ht,P as Gt}from"./BuURpKT4.js";import{u as rt}from"./DY78sr_b.js";import{f as $e}from"./CKfAI3Hb.js";import{u as jt}from"./0L-9iIbm.js";import{u as Ut,g as Wt}from"./CXRkSVkD.js";import{g as Yt,M as Xt}from"./olSL1K5t.js";import{V as Zt}from"./DnfG5RzJ.js";import{u as Se}from"./B0v0agy0.js";import{u as Jt}from"./C7RIYfkH.js";import{c as Je}from"./hkCaWCzP.js";import{g as Qt}from"./CvaD7s2l.js";import{_ as ea}from"./CHd8mdNy.js";function st(s){const r=L(()=>t(s)),a=L(()=>new Intl.Collator("en",{usage:"search",...r.value}));return{startsWith:(u,p)=>p.length===0?!0:(u=u.normalize("NFC"),p=p.normalize("NFC"),a.value.compare(u.slice(0,p.length),p)===0),endsWith:(u,p)=>p.length===0?!0:(u=u.normalize("NFC"),p=p.normalize("NFC"),a.value.compare(u.slice(-p.length),p)===0),contains:(u,p)=>{if(p.length===0)return!0;u=u.normalize("NFC"),p=p.normalize("NFC");let v=0;const k=p.length;for(;v+k<=u.length;v++){const C=u.slice(v,v+k);if(a.value.compare(p,C)===0)return!0}return!1}}}function ta(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}var aa=V({__name:"ComboboxAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const{forwardRef:r}=oe();return(a,e)=>(c(),_(t(Nt),{"as-child":"",reference:a.reference},{default:h(()=>[F(t(W),T({ref:t(r),"as-child":a.asChild,as:a.as},a.$attrs),{default:h(()=>[I(a.$slots,"default")]),_:3},16,["as-child","as"])]),_:3},8,["reference"]))}}),la=aa;function Qe(s){return s?.querySelector("[data-state=checked]")}function ia(s,r,a){return s===void 0?!1:Array.isArray(s)?s.some(e=>ce(e,r,a)):ce(s,r,a)}function ce(s,r,a){return s===void 0||r===void 0?!1:typeof s=="string"?s===r:typeof a=="function"?a(s,r):typeof a=="string"?s?.[a]===r?.[a]:ct(s,r)}const[Be,oa]=Ie("ListboxRoot");var ra=V({__name:"ListboxRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},orientation:{type:String,required:!1,default:"vertical"},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},selectionBehavior:{type:String,required:!1,default:"toggle"},highlightOnHover:{type:Boolean,required:!1},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","entryFocus","leave"],setup(s,{expose:r,emit:a}){const e=s,l=a,{multiple:i,highlightOnHover:u,orientation:p,disabled:v,selectionBehavior:k,dir:C}=je(e),{getItems:S}=De({isProvider:!0}),{handleTypeaheadSearch:f}=Ut(),{primitiveElement:m,currentElement:n}=Fe(),q=ta(),D=rt(C),P=jt(n),M=H(),Y=H(!1),j=H(!0),w=Le(e,"modelValue",l,{defaultValue:e.defaultValue??(i.value?[]:void 0),passive:e.modelValue===void 0,deep:!0});function xe(d){if(Y.value=!0,e.multiple){const y=Array.isArray(w.value)?[...w.value]:[],x=y.findIndex(E=>ce(E,d,e.by));e.selectionBehavior==="toggle"?(x===-1?y.push(d):y.splice(x,1),w.value=y):(w.value=[d],M.value=d)}else e.selectionBehavior==="toggle"&&ce(w.value,d,e.by)?w.value=void 0:w.value=d;setTimeout(()=>{Y.value=!1},1)}const O=H(null),se=H(null),X=H(!1),ee=H(!1),ne=Ke(),ve=Ke(),Z=Ke();function te(){return S().map(d=>d.ref).filter(d=>d.dataset.disabled!=="")}function R(d,y=!0){if(!d)return;O.value=d,j.value&&O.value.focus(),y&&O.value.scrollIntoView({block:"nearest"});const x=S().find(E=>E.ref===d);l("highlight",x)}function A(d){if(X.value)Z.trigger(d);else{const y=S().find(x=>ce(x.value,d,e.by));y&&(O.value=y.ref,R(y.ref))}}function J(d){O.value&&O.value.isConnected&&(d.preventDefault(),d.stopPropagation(),ee.value||O.value.click())}function Q(d){if(j.value){if(Y.value=!0,X.value)ve.trigger(d);else{const y=d.altKey||d.ctrlKey||d.metaKey;if(y&&d.key==="a"&&i.value){const x=S(),E=x.map(ue=>ue.value);w.value=[...E],d.preventDefault(),R(x[x.length-1].ref)}else if(!y){const x=f(d.key,S());x&&R(x)}}setTimeout(()=>{Y.value=!1},1)}}function ae(){ee.value=!0}function me(){pe(()=>{ee.value=!1})}function le(){pe(()=>{const d=new KeyboardEvent("keydown",{key:"PageUp"});Ce(d)})}function g(d){const y=O.value;y?.isConnected&&(se.value=y),O.value=null,l("leave",d)}function Ne(d){const y=new CustomEvent("listbox.entryFocus",{bubbles:!1,cancelable:!0});if(d.currentTarget?.dispatchEvent(y),l("entryFocus",y),!y.defaultPrevented)if(se.value)R(se.value);else{const x=te()?.[0];R(x)}}function Ce(d){const y=Yt(d,p.value,D.value);if(!y)return;let x=te();if(O.value){if(y==="last")x.reverse();else if(y==="prev"||y==="next"){y==="prev"&&x.reverse();const E=x.indexOf(O.value);x=x.slice(E+1)}we(d,x[0])}if(x.length){const E=!O.value&&y==="prev"?x.length-1:0;R(x[E])}if(X.value)return ve.trigger(d)}function we(d,y){if(!(X.value||e.selectionBehavior!=="replace"||!i.value||!Array.isArray(w.value)||(d.altKey||d.ctrlKey||d.metaKey)&&!d.shiftKey)&&d.shiftKey){const E=S().filter(ge=>ge.ref.dataset.disabled!=="");let ue=E.find(ge=>ge.ref===y)?.value;if(d.key===q.END?ue=E[E.length-1].value:d.key===q.HOME&&(ue=E[0].value),!ue||!M.value)return;const Me=$e(E.map(ge=>ge.value),M.value,ue);w.value=Me}}async function ke(d){if(await pe(),X.value)ne.trigger(d);else{const y=te(),x=y.find(E=>E.dataset.state==="checked");x?R(x):y.length&&R(y[0])}}return Ge(w,()=>{Y.value||pe(()=>{ke()})},{immediate:!0,deep:!0}),r({highlightedElement:O,highlightItem:A,highlightFirstItem:le,highlightSelected:ke,getItems:S}),oa({modelValue:w,onValueChange:xe,multiple:i,orientation:p,dir:D,disabled:v,highlightOnHover:u,highlightedElement:O,isVirtual:X,virtualFocusHook:ne,virtualKeydownHook:ve,virtualHighlightHook:Z,by:e.by,firstValue:M,selectionBehavior:k,focusable:j,onLeave:g,onEnter:Ne,changeHighlight:R,onKeydownEnter:J,onKeydownNavigation:Ce,onKeydownTypeAhead:Q,onCompositionStart:ae,onCompositionEnd:me,highlightFirstItem:le}),(d,y)=>(c(),_(t(W),{ref_key:"primitiveElement",ref:m,as:d.as,"as-child":d.asChild,dir:t(D),"data-disabled":t(v)?"":void 0,onPointerleave:g,onFocusout:y[0]||(y[0]=async x=>{const E=x.relatedTarget||x.target;await pe(),O.value&&t(n)&&!t(n).contains(E)&&g(x)})},{default:h(()=>[I(d.$slots,"default",{modelValue:t(w)}),t(P)&&d.name?(c(),_(t(Zt),{key:0,name:d.name,value:t(w),disabled:t(v),required:d.required},null,8,["name","value","disabled","required"])):N("v-if",!0)]),_:3},8,["as","as-child","dir","data-disabled"]))}}),sa=ra,na=V({__name:"ListboxContent",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const{CollectionSlot:r}=De(),a=Be(),e=tt(!1,10);return(l,i)=>(c(),_(t(r),null,{default:h(()=>[F(t(W),{role:"listbox",as:l.as,"as-child":l.asChild,tabindex:t(a).focusable.value?t(a).highlightedElement.value?"-1":"0":"-1","aria-orientation":t(a).orientation.value,"aria-multiselectable":!!t(a).multiple.value,"data-orientation":t(a).orientation.value,onMousedown:i[0]||(i[0]=Ae(u=>e.value=!0,["left"])),onFocus:i[1]||(i[1]=u=>{t(e)||t(a).onEnter(u)}),onKeydown:[i[2]||(i[2]=qe(u=>{t(a).orientation.value==="vertical"&&(u.key==="ArrowLeft"||u.key==="ArrowRight")||t(a).orientation.value==="horizontal"&&(u.key==="ArrowUp"||u.key==="ArrowDown")||(u.preventDefault(),t(a).focusable.value&&t(a).onKeydownNavigation(u))},["down","up","left","right","home","end"])),qe(t(a).onKeydownEnter,["enter"]),t(a).onKeydownTypeAhead]},{default:h(()=>[I(l.$slots,"default")]),_:3},8,["as","as-child","tabindex","aria-orientation","aria-multiselectable","data-orientation","onKeydown"])]),_:3}))}}),ua=na,da=V({__name:"ListboxFilter",props:{modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(s,{emit:r}){const a=s,l=Le(a,"modelValue",r,{defaultValue:"",passive:a.modelValue===void 0}),i=Be(),{primitiveElement:u,currentElement:p}=Fe(),v=L(()=>a.disabled||i.disabled.value||!1),k=H();return ft(()=>k.value=i.highlightedElement.value?.id),fe(()=>{i.focusable.value=!1,setTimeout(()=>{a.autoFocus&&p.value?.focus()},1)}),Re(()=>{i.focusable.value=!0}),(C,S)=>(c(),_(t(W),{ref_key:"primitiveElement",ref:u,as:C.as,"as-child":C.asChild,value:t(l),disabled:v.value?"":void 0,"data-disabled":v.value?"":void 0,"aria-disabled":v.value??void 0,"aria-activedescendant":k.value,type:"text",onKeydown:[qe(Ae(t(i).onKeydownNavigation,["prevent"]),["down","up","home","end"]),qe(t(i).onKeydownEnter,["enter"])],onInput:S[0]||(S[0]=f=>{l.value=f.target.value,t(i).highlightFirstItem()}),onCompositionstart:t(i).onCompositionStart,onCompositionend:t(i).onCompositionEnd},{default:h(()=>[I(C.$slots,"default",{modelValue:t(l)})]),_:3},8,["as","as-child","value","disabled","data-disabled","aria-disabled","aria-activedescendant","onKeydown","onCompositionstart","onCompositionend"]))}}),pa=da;const[ml,ca]=Ie("ListboxGroup");var fa=V({__name:"ListboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=Se(void 0,"reka-listbox-group");return ca({id:a}),(e,l)=>(c(),_(t(W),T({role:"group"},r,{"aria-labelledby":t(a)}),{default:h(()=>[I(e.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),va=fa;const ma="listbox.select",[ga,ha]=Ie("ListboxItem");var ba=V({__name:"ListboxItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["select"],setup(s,{emit:r}){const a=s,e=r,l=Se(void 0,"reka-listbox-item"),{CollectionItem:i}=De(),{forwardRef:u,currentElement:p}=oe(),v=Be(),k=L(()=>p.value===v.highlightedElement.value),C=L(()=>ia(v.modelValue.value,a.value,v.by)),S=L(()=>v.disabled.value||a.disabled);async function f(n){e("select",n),!n?.defaultPrevented&&!S.value&&n&&(v.onValueChange(a.value),v.changeHighlight(p.value))}function m(n){const q={originalEvent:n,value:a.value};mt(ma,f,q)}return ha({isSelected:C}),(n,q)=>(c(),_(t(i),{value:n.value},{default:h(()=>[vt([k.value,C.value],()=>F(t(W),T({id:t(l)},n.$attrs,{ref:t(u),role:"option",tabindex:t(v).focusable.value?k.value?"0":"-1":-1,"aria-selected":C.value,as:n.as,"as-child":n.asChild,disabled:S.value?"":void 0,"data-disabled":S.value?"":void 0,"data-highlighted":k.value?"":void 0,"data-state":C.value?"checked":"unchecked",onClick:m,onKeydown:qe(Ae(m,["prevent"]),["space"]),onPointermove:q[0]||(q[0]=()=>{t(v).highlightedElement.value!==t(p)&&t(v).highlightOnHover.value&&!t(v).focusable.value&&t(v).changeHighlight(t(p),!1)})}),{default:h(()=>[I(n.$slots,"default")]),_:3},16,["id","tabindex","aria-selected","as","as-child","disabled","data-disabled","data-highlighted","data-state","onKeydown"]),q,1)]),_:3},8,["value"]))}}),ya=ba,_a=V({__name:"ListboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const r=s;oe();const a=ga();return(e,l)=>t(a).isSelected.value?(c(),_(t(W),T({key:0,"aria-hidden":"true"},r),{default:h(()=>[I(e.$slots,"default")]),_:3},16)):N("v-if",!0)}}),xa=_a,Ca=V({__name:"ListboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:Number,required:!1},textContent:{type:Function,required:!1}},setup(s){const r=s,a=at(),e=Be(),l=gt(),{getItems:i}=De();e.isVirtual.value=!0;const u=L(()=>{const f=l.value;if(f){const m=window.getComputedStyle(f);return{start:Number.parseFloat(m.paddingBlockStart||m.paddingTop),end:Number.parseFloat(m.paddingBlockEnd||m.paddingBottom)}}else return{start:0,end:0}}),p=Jt({get scrollPaddingStart(){return u.value.start},get scrollPaddingEnd(){return u.value.end},get count(){return r.options.length},get horizontal(){return e.orientation.value==="horizontal"},estimateSize(){return r.estimateSize??28},getScrollElement(){return l.value},overscan:r.overscan??12}),v=L(()=>p.value.getVirtualItems().map(f=>{const m=a.default({option:r.options[f.index],virtualizer:p.value,virtualItem:f})[0],n=m.type===ie&&Array.isArray(m.children)?m.children[0]:m;return{item:f,is:ht(n,{key:`${f.key}`,"data-index":f.index,"aria-setsize":r.options.length,"aria-posinset":f.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${f.start}px)`,overflowAnchor:"none"}})}}));e.virtualFocusHook.on(f=>{const m=r.options.findIndex(n=>Array.isArray(e.modelValue.value)?ce(n,e.modelValue.value[0],e.by):ce(n,e.modelValue.value,e.by));m!==-1?(f?.preventDefault(),p.value.scrollToIndex(m,{align:"start"}),requestAnimationFrame(()=>{const n=Qe(l.value);n&&(e.changeHighlight(n),f&&n?.focus())})):e.highlightFirstItem()}),e.virtualHighlightHook.on(f=>{const m=r.options.findIndex(n=>ce(n,f,e.by));p.value.scrollToIndex(m,{align:"start"}),requestAnimationFrame(()=>{const n=Qe(l.value);n&&e.changeHighlight(n)})});const k=tt("",1e3),C=L(()=>{const f=m=>r.textContent?r.textContent(m):m?.toString().toLowerCase();return r.options.map((m,n)=>({index:n,textContent:f(m)}))});function S(f,m){if(!e.firstValue?.value||!e.multiple.value||!Array.isArray(e.modelValue.value))return;const q=i().filter(P=>P.ref.dataset.disabled!=="").find(P=>P.ref===e.highlightedElement.value)?.value;if(!q)return;let D=null;switch(m){case"prev":case"next":{D=$e(r.options,e.firstValue.value,q);break}case"first":{D=$e(r.options,e.firstValue.value,r.options?.[0]);break}case"last":{D=$e(r.options,e.firstValue.value,r.options?.[r.options.length-1]);break}}e.modelValue.value=D}return e.virtualKeydownHook.on(f=>{const m=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!m)return;let q=Xt[f.key];if(m&&f.key==="a"&&e.multiple.value?(f.preventDefault(),e.modelValue.value=[...r.options],q="last"):f.shiftKey&&q&&S(f,q),["first","last"].includes(q)){f.preventDefault();const D=q==="first"?0:r.options.length-1;p.value.scrollToIndex(D),requestAnimationFrame(()=>{const P=i(),M=q==="first"?P[0]:P[P.length-1];M&&e.changeHighlight(M.ref)})}else if(!q&&!m){k.value+=f.key;const D=Number(bt()?.getAttribute("data-index")),P=C.value[D].textContent,M=C.value.map(w=>w.textContent??""),Y=Wt(M,k.value,P),j=C.value.find(w=>w.textContent===Y);j&&(p.value.scrollToIndex(j.index,{align:"start"}),requestAnimationFrame(()=>{const w=l.value.querySelector(`[data-index="${j.index}"]`);w instanceof HTMLElement&&e.changeHighlight(w)}))}}),(f,m)=>(c(),G("div",{"data-reka-virtualizer":"",style:yt({position:"relative",width:"100%",height:`${t(p).getTotalSize()}px`})},[(c(!0),G(ie,null,Pe(v.value,({is:n,item:q})=>(c(),_(lt(n),{key:q.index}))),128))],4))}}),qa=Ca;const[re,Ia]=Ie("ComboboxRoot");var Sa=V({__name:"ComboboxRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},openOnFocus:{type:Boolean,required:!1,default:!1},openOnClick:{type:Boolean,required:!1,default:!1},ignoreFilter:{type:Boolean,required:!1},resetModelValueOnClear:{type:Boolean,required:!1,default:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},multiple:{type:Boolean,required:!1},dir:{type:String,required:!1},disabled:{type:Boolean,required:!1},highlightOnHover:{type:Boolean,required:!1,default:!0},by:{type:[String,Function],required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","highlight","update:open"],setup(s,{expose:r,emit:a}){const e=s,l=a,{primitiveElement:i,currentElement:u}=Fe(),{multiple:p,disabled:v,ignoreFilter:k,resetSearchTermOnSelect:C,openOnFocus:S,openOnClick:f,dir:m,resetModelValueOnClear:n,highlightOnHover:q}=je(e),D=rt(m),P=Le(e,"modelValue",l,{defaultValue:e.defaultValue??(p.value?[]:void 0),passive:e.modelValue===void 0,deep:!0}),M=Le(e,"open",l,{defaultValue:e.defaultOpen,passive:e.open===void 0});async function Y(A){M.value=A,Z.value="",A?(await pe(),i.value?.highlightSelected(),w.value=!0,O.value?.focus()):(w.value=!1,setTimeout(()=>{!A&&e.resetSearchTermOnBlur&&j.trigger()},1))}const j=Ke(),w=H(!1),xe=H(!1),O=H(),se=H(),X=L(()=>i.value?.highlightedElement??void 0),ee=H(new Map),ne=H(new Map),{contains:ve}=st({sensitivity:"base"}),Z=H(""),te=L(A=>{if(!Z.value||e.ignoreFilter||xe.value)return{count:ee.value.size,items:A?.items??new Map,groups:A?.groups??new Set(ne.value.keys())};let J=0;const Q=new Map,ae=new Set;for(const[me,le]of ee.value){const g=ve(le,Z.value);Q.set(me,g?1:0),g&&J++}for(const[me,le]of ne.value)for(const g of le)if(Q.get(g)>0){ae.add(me);break}return{count:J,items:Q,groups:ae}}),R=_t();return fe(()=>{R?.exposed&&(R.exposed.highlightItem=i.value?.highlightItem,R.exposed.highlightFirstItem=i.value?.highlightFirstItem,R.exposed.highlightSelected=i.value?.highlightSelected)}),r({filtered:te,highlightedElement:X,highlightItem:i.value?.highlightItem,highlightFirstItem:i.value?.highlightFirstItem,highlightSelected:i.value?.highlightSelected}),Ia({modelValue:P,multiple:p,disabled:v,open:M,onOpenChange:Y,contentId:"",isUserInputted:w,isVirtual:xe,inputElement:O,highlightedElement:X,onInputElementChange:A=>O.value=A,triggerElement:se,onTriggerElementChange:A=>se.value=A,parentElement:u,resetSearchTermOnSelect:C,onResetSearchTerm:j.on,allItems:ee,allGroups:ne,filterSearch:Z,filterState:te,ignoreFilter:k,openOnFocus:S,openOnClick:f,resetModelValueOnClear:n}),(A,J)=>(c(),_(t(Mt),null,{default:h(()=>[F(t(sa),T({ref_key:"primitiveElement",ref:i},A.$attrs,{modelValue:t(P),"onUpdate:modelValue":J[0]||(J[0]=Q=>it(P)?P.value=Q:null),style:{pointerEvents:t(M)?"auto":void 0},as:A.as,"as-child":A.asChild,dir:t(D),multiple:t(p),name:A.name,required:A.required,disabled:t(v),"highlight-on-hover":t(q),by:e.by,onHighlight:J[1]||(J[1]=Q=>l("highlight",Q))}),{default:h(()=>[I(A.$slots,"default",{open:t(M),modelValue:t(P)})]),_:3},16,["modelValue","style","as","as-child","dir","multiple","name","required","disabled","highlight-on-hover","by"])]),_:3}))}}),wa=Sa;const[ka,za]=Ie("ComboboxContent");var La=V({__name:"ComboboxContentImpl",props:{position:{type:String,required:!1,default:"inline"},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(s,{emit:r}){const a=s,e=r,{position:l}=je(a),i=re(),{forwardRef:u,currentElement:p}=oe();$t(a.bodyLock),Dt(i.parentElement);const v=L(()=>a.position==="popper"?a:{}),k=xt(v.value),C={boxSizing:"border-box","--reka-combobox-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-combobox-content-available-width":"var(--reka-popper-available-width)","--reka-combobox-content-available-height":"var(--reka-popper-available-height)","--reka-combobox-trigger-width":"var(--reka-popper-anchor-width)","--reka-combobox-trigger-height":"var(--reka-popper-anchor-height)"};za({position:l});const S=H(!1);return fe(()=>{i.inputElement.value&&(S.value=p.value.contains(i.inputElement.value),S.value&&i.inputElement.value.focus())}),Re(()=>{S.value&&i.triggerElement.value?.focus()}),(f,m)=>(c(),_(t(ua),{"as-child":""},{default:h(()=>[F(t(Ct),{"as-child":"","disable-outside-pointer-events":f.disableOutsidePointerEvents,onDismiss:m[0]||(m[0]=n=>t(i).onOpenChange(!1)),onFocusOutside:m[1]||(m[1]=n=>{t(i).parentElement.value?.contains(n.target)&&n.preventDefault(),e("focusOutside",n)}),onInteractOutside:m[2]||(m[2]=n=>e("interactOutside",n)),onEscapeKeyDown:m[3]||(m[3]=n=>e("escapeKeyDown",n)),onPointerDownOutside:m[4]||(m[4]=n=>{t(i).parentElement.value?.contains(n.target)&&n.preventDefault(),e("pointerDownOutside",n)})},{default:h(()=>[(c(),_(lt(t(l)==="popper"?t(Ht):t(W)),T({...f.$attrs,...t(k)},{id:t(i).contentId,ref:t(u),"data-state":t(i).open.value?"open":"closed",style:{display:"flex",flexDirection:"column",outline:"none",...t(l)==="popper"?C:{}}}),{default:h(()=>[I(f.$slots,"default")]),_:3},16,["id","data-state","style"]))]),_:3},8,["disable-outside-pointer-events"])]),_:3}))}}),Ea=La,Fa=V({__name:"ComboboxArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(s){const r=s,a=re(),e=ka();return oe(),(l,i)=>t(a).open.value&&t(e).position.value==="popper"?(c(),_(t(Gt),_e(T({key:0},r)),{default:h(()=>[I(l.$slots,"default")]),_:3},16)):N("v-if",!0)}}),Aa=Fa,Ba=V({__name:"ComboboxContent",props:{forceMount:{type:Boolean,required:!1},position:{type:String,required:!1},bodyLock:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside"],setup(s,{emit:r}){const l=ot(s,r),{forwardRef:i}=oe(),u=re();return u.contentId||=Se(void 0,"reka-combobox-content"),(p,v)=>(c(),_(t(qt),{present:p.forceMount||t(u).open.value},{default:h(()=>[F(Ea,T({...t(l),...p.$attrs},{ref:t(i)}),{default:h(()=>[I(p.$slots,"default")]),_:3},16)]),_:3},8,["present"]))}}),Ta=Ba,Va=V({__name:"ComboboxEmpty",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=re(),e=L(()=>a.ignoreFilter.value?a.allItems.value.size===0:a.filterState.value.count===0);return(l,i)=>e.value?(c(),_(t(W),_e(T({key:0},r)),{default:h(()=>[I(l.$slots,"default",{},()=>[i[0]||(i[0]=ye("No options"))])]),_:3},16)):N("v-if",!0)}}),Oa=Va;const[nt,Ka]=Ie("ComboboxGroup");var Pa=V({__name:"ComboboxGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s,a=Se(void 0,"reka-combobox-group"),e=re(),l=L(()=>e.ignoreFilter.value?!0:e.filterSearch.value?e.filterState.value.groups.has(a):!0),i=Ka({id:a,labelId:""});return fe(()=>{e.allGroups.value.has(a)||e.allGroups.value.set(a,new Set)}),Re(()=>{e.allGroups.value.delete(a)}),(u,p)=>(c(),_(t(va),T({id:t(a),"aria-labelledby":t(i).labelId},r,{hidden:l.value?void 0:!0}),{default:h(()=>[I(u.$slots,"default")]),_:3},16,["id","aria-labelledby","hidden"]))}}),He=Pa,$a=V({__name:"ComboboxInput",props:{displayValue:{type:Function,required:!1},modelValue:{type:String,required:!1},autoFocus:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"input"}},emits:["update:modelValue"],setup(s,{emit:r}){const a=s,e=r,l=re(),i=Be(),{primitiveElement:u,currentElement:p}=Fe(),v=Le(a,"modelValue",e,{passive:a.modelValue===void 0});fe(()=>{p.value&&l.onInputElementChange(p.value)});function k(n){l.open.value||l.onOpenChange(!0)}function C(n){const q=n.target;l.open.value?l.filterSearch.value=q.value:(l.onOpenChange(!0),pe(()=>{q.value&&(l.filterSearch.value=q.value,i.highlightFirstItem())}))}function S(){l.openOnFocus.value&&!l.open.value&&l.onOpenChange(!0)}function f(){l.openOnClick.value&&!l.open.value&&l.onOpenChange(!0)}function m(){const n=l.modelValue.value;a.displayValue?v.value=a.displayValue(n):!l.multiple.value&&n&&!Array.isArray(n)&&typeof n!="object"?v.value=n.toString():v.value="",pe(()=>{v.value=v.value})}return l.onResetSearchTerm(()=>{m()}),Ge(l.modelValue,async()=>{!l.isUserInputted.value&&l.resetSearchTermOnSelect.value&&m()},{immediate:!0,deep:!0}),Ge(l.filterState,(n,q)=>{!l.isVirtual.value&&q.count===0&&i.highlightFirstItem()}),(n,q)=>(c(),_(t(pa),{ref_key:"primitiveElement",ref:u,modelValue:t(v),"onUpdate:modelValue":q[0]||(q[0]=D=>it(v)?v.value=D:null),as:n.as,"as-child":n.asChild,"auto-focus":n.autoFocus,disabled:n.disabled,"aria-expanded":t(l).open.value,"aria-controls":t(l).contentId,"aria-autocomplete":"list",role:"combobox",autocomplete:"off",onClick:f,onInput:C,onKeydown:qe(Ae(k,["prevent"]),["down","up"]),onFocus:S},{default:h(()=>[I(n.$slots,"default")]),_:3},8,["modelValue","as","as-child","auto-focus","disabled","aria-expanded","aria-controls","onKeydown"]))}}),Da=$a,Ra=V({__name:"ComboboxItem",props:{textValue:{type:String,required:!1},value:{type:null,required:!0},disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(s,{emit:r}){const a=s,e=r,l=Se(void 0,"reka-combobox-item"),i=re(),u=nt(null),{primitiveElement:p,currentElement:v}=Fe();if(a.value==="")throw new Error("A <ComboboxItem /> must have a value prop that is not an empty string. This is because the Combobox value can be set to an empty string to clear the selection and show the placeholder.");const k=L(()=>{if(i.isVirtual.value||i.ignoreFilter.value||!i.filterSearch.value)return!0;{const C=i.filterState.value.items.get(l);return C===void 0?!0:C>0}});return fe(()=>{i.allItems.value.set(l,a.textValue||v.value.textContent||v.value.innerText);const C=u?.id;C&&(i.allGroups.value.has(C)?i.allGroups.value.get(C)?.add(l):i.allGroups.value.set(C,new Set([l])))}),Re(()=>{i.allItems.value.delete(l)}),(C,S)=>k.value?(c(),_(t(ya),T({key:0},a,{id:t(l),ref_key:"primitiveElement",ref:p,disabled:t(i).disabled.value||C.disabled,onSelect:S[0]||(S[0]=f=>{e("select",f),!f.defaultPrevented&&!t(i).multiple.value&&!C.disabled&&!t(i).disabled.value&&(f.preventDefault(),t(i).onOpenChange(!1),t(i).modelValue.value=a.value)})}),{default:h(()=>[I(C.$slots,"default",{},()=>[ye(de(C.value),1)])]),_:3},16,["id","disabled"])):N("v-if",!0)}}),et=Ra,Na=V({__name:"ComboboxItemIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(s){const r=s;return(a,e)=>(c(),_(t(xa),_e(Ee(r)),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ma=Na,Ha=V({__name:"ComboboxLabel",props:{for:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(s){const r=s;oe();const a=nt({id:"",labelId:""});return a.labelId||=Se(void 0,"reka-combobox-group-label"),(e,l)=>(c(),_(t(W),T(r,{id:t(a).labelId}),{default:h(()=>[I(e.$slots,"default")]),_:3},16,["id"]))}}),Ga=Ha,ja=V({__name:"ComboboxPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(s){const r=s;return(a,e)=>(c(),_(t(It),_e(Ee(r)),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ua=ja,Wa=V({__name:"ComboboxSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(s){const r=s;return oe(),(a,e)=>(c(),_(t(W),T(r,{"aria-hidden":"true"}),{default:h(()=>[I(a.$slots,"default")]),_:3},16))}}),Ya=Wa,Xa=V({__name:"ComboboxTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(s){const r=s,{forwardRef:a,currentElement:e}=oe(),l=re(),i=L(()=>r.disabled||l.disabled.value||!1);return fe(()=>{e.value&&l.onTriggerElementChange(e.value)}),(u,p)=>(c(),_(t(W),T(r,{ref:t(a),type:u.as==="button"?"button":void 0,tabindex:"-1","aria-label":"Show popup","aria-haspopup":"listbox","aria-expanded":t(l).open.value,"aria-controls":t(l).contentId,"data-state":t(l).open.value?"open":"closed",disabled:i.value,"data-disabled":i.value?"":void 0,"aria-disabled":i.value??void 0,onClick:p[0]||(p[0]=v=>t(l).onOpenChange(!t(l).open.value))}),{default:h(()=>[I(u.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","disabled","data-disabled","aria-disabled"]))}}),Za=Xa,Ja=V({__name:"ComboboxVirtualizer",props:{options:{type:Array,required:!0},overscan:{type:Number,required:!1},estimateSize:{type:Number,required:!1},textContent:{type:Function,required:!1}},setup(s){const r=s,a=re();return a.isVirtual.value=!0,(e,l)=>(c(),_(qa,_e(Ee(r)),{default:h(i=>[I(e.$slots,"default",_e(Ee(i)))]),_:3},16))}}),Qa=Ja;const el={slots:{base:["relative group rounded-md inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed",value:"truncate pointer-events-none",placeholder:"truncate text-dimmed",arrow:"fill-default",content:["max-h-60 w-(--reka-select-trigger-width) bg-default shadow-lg rounded-md ring ring-default overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-select-content-transform-origin) pointer-events-auto flex flex-col","origin-(--reka-combobox-content-transform-origin) w-(--reka-combobox-trigger-width)"],viewport:"relative scroll-py-1 overflow-y-auto flex-1",group:"p-1 isolate",empty:"text-center text-muted",label:"font-semibold text-highlighted",separator:"-mx-1 my-1 h-px bg-border",item:["group relative w-full flex items-start select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-md data-disabled:cursor-not-allowed data-disabled:opacity-75 text-default data-highlighted:not-data-disabled:text-highlighted data-highlighted:not-data-disabled:before:bg-elevated/50","transition-colors before:transition-colors"],itemLeadingIcon:["shrink-0 text-dimmed group-data-highlighted:not-group-data-disabled:text-default","transition-colors"],itemLeadingAvatar:"shrink-0",itemLeadingAvatarSize:"",itemLeadingChip:"shrink-0",itemLeadingChipSize:"",itemTrailing:"ms-auto inline-flex gap-1.5 items-center",itemTrailingIcon:"shrink-0",itemWrapper:"flex-1 flex flex-col min-w-0",itemLabel:"truncate",itemDescription:"truncate text-muted",input:"border-b border-default",focusScope:"flex flex-col min-h-0"},variants:{fieldGroup:{horizontal:"not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none focus-visible:z-[1]",vertical:"not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none focus-visible:z-[1]"},size:{xs:{base:"px-2 py-1 text-xs gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1 text-[10px]/3 gap-1",item:"p-1 text-xs gap-1",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1 text-xs"},sm:{base:"px-2.5 py-1.5 text-xs gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4",label:"p-1.5 text-[10px]/3 gap-1.5",item:"p-1.5 text-xs gap-1.5",itemLeadingIcon:"size-4",itemLeadingAvatarSize:"3xs",itemLeadingChip:"size-4",itemLeadingChipSize:"sm",itemTrailingIcon:"size-4",empty:"p-1.5 text-xs"},md:{base:"px-2.5 py-1.5 text-sm gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-1.5 text-xs gap-1.5",item:"p-1.5 text-sm gap-1.5",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-1.5 text-sm"},lg:{base:"px-3 py-2 text-sm gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5",label:"p-2 text-xs gap-2",item:"p-2 text-sm gap-2",itemLeadingIcon:"size-5",itemLeadingAvatarSize:"2xs",itemLeadingChip:"size-5",itemLeadingChipSize:"md",itemTrailingIcon:"size-5",empty:"p-2 text-sm"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6",label:"p-2 text-sm gap-2",item:"p-2 text-base gap-2",itemLeadingIcon:"size-6",itemLeadingAvatarSize:"xs",itemLeadingChip:"size-6",itemLeadingChipSize:"lg",itemTrailingIcon:"size-6",empty:"p-2 text-base"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},virtualize:{true:{viewport:"p-1 isolate"},false:{viewport:"divide-y divide-default"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},gl=Object.assign({inheritAttrs:!1},{__name:"USelectMenu",props:We({id:{type:String,required:!1},placeholder:{type:String,required:!1},searchInput:{type:[Boolean,Object],required:!1,default:!0},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},selectedIcon:{type:null,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},virtualize:{type:[Boolean,Object],required:!1,default:!1},valueKey:{type:null,required:!1},labelKey:{type:null,required:!1,default:"label"},descriptionKey:{type:null,required:!1,default:"description"},items:{type:null,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:Object,required:!1},multiple:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},createItem:{type:[Boolean,String,Object],required:!1},filterFields:{type:Array,required:!1},ignoreFilter:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},class:{type:null,required:!1},ui:{type:null,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},name:{type:String,required:!1},resetSearchTermOnBlur:{type:Boolean,required:!1,default:!0},resetSearchTermOnSelect:{type:Boolean,required:!1,default:!0},highlightOnHover:{type:Boolean,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},{searchTerm:{type:String,default:""},searchTermModifiers:{}}),emits:We(["update:open","change","blur","focus","create","highlight","update:modelValue"],["update:searchTerm"]),setup(s,{expose:r,emit:a}){const e=s,l=a,i=at(),u=St(s,"searchTerm",{type:String,default:""}),{t:p}=wt(),v=kt(),{contains:k}=st({sensitivity:"base"}),C=ot(zt(e,"modelValue","defaultValue","open","defaultOpen","required","multiple","resetSearchTermOnBlur","resetSearchTermOnSelect","highlightOnHover"),l),S=Lt(he(()=>e.portal)),f=he(()=>Ve(e.content,{side:"bottom",sideOffset:8,collisionPadding:8,position:"popper"})),m=he(()=>e.arrow),n=he(()=>e.virtualize?Ve(typeof e.virtualize=="boolean"?{}:e.virtualize,{estimateSize:Qt(we.value,e.size||"md",e.descriptionKey)}):!1),q=he(()=>Ve(e.searchInput,{placeholder:p("selectMenu.search"),variant:"none"})),{emitFormBlur:D,emitFormFocus:P,emitFormInput:M,emitFormChange:Y,size:j,color:w,id:xe,name:O,highlight:se,disabled:X,ariaAttrs:ee}=Et(e),{orientation:ne,size:ve}=Ft(e),{isLeading:Z,isTrailing:te,leadingIconName:R,trailingIconName:A}=At(he(()=>Ve(e,{trailingIcon:v.ui.icons.chevronDown}))),J=L(()=>ve.value||j.value),[Q,ae]=Je(),[me,le]=Je({props:{item:{type:[Object,String,Number,Boolean],required:!0},index:{type:Number,required:!1}}}),g=L(()=>Ye({extend:Ye(el),...v.ui?.selectMenu||{}})({color:w.value,variant:e.variant,size:J?.value,loading:e.loading,highlight:se.value,leading:Z.value||!!e.avatar||!!i.leading,trailing:te.value||!!i.trailing,fieldGroup:ne.value,virtualize:!!e.virtualize}));function Ne(b){if(e.multiple&&Array.isArray(b)){const B=b.map(o=>Ze(we.value,o,{labelKey:e.labelKey,valueKey:e.valueKey})).filter(o=>o!=null&&o!=="");return B.length>0?B.join(", "):void 0}return Ze(we.value,b,{labelKey:e.labelKey,valueKey:e.valueKey})}const Ce=L(()=>e.items?.length?Bt(e.items)?e.items:[e.items]:[]),we=L(()=>Ce.value.flatMap(b=>b)),ke=L(()=>{if(e.ignoreFilter||!u.value)return Ce.value;const b=Array.isArray(e.filterFields)?e.filterFields:[e.labelKey];return Ce.value.map(B=>B.filter(o=>o==null?!1:typeof o!="object"?k(String(o),u.value):o.type&&["label","separator"].includes(o.type)?!0:b.some(U=>{const K=be(o,U);return K!=null&&k(String(K),u.value)}))).filter(B=>B.filter(o=>!$(o)||!o.type||!["label","separator"].includes(o.type)).length>0)}),d=L(()=>ke.value.flatMap(b=>b)),y=L(()=>{if(!e.createItem||!u.value)return!1;const b=e.valueKey?{[e.valueKey]:u.value}:u.value;return typeof e.createItem=="object"&&e.createItem.when==="always"||e.createItem==="always"?!d.value.find(B=>Tt(B,b,e.valueKey)):!d.value.length}),x=L(()=>typeof e.createItem=="object"?e.createItem.position:"bottom"),E=Vt("triggerRef");function ue(){e.autofocus&&E.value?.$el?.focus({focusVisible:!0})}fe(()=>{setTimeout(()=>{ue()},e.autofocusDelay)});function Me(b){if(Kt(e.modelValue)===b)return;e.modelModifiers?.trim&&(b=b?.trim()??null),e.modelModifiers?.number&&(b=Pt(b)),e.modelModifiers?.nullable&&(b??=null),e.modelModifiers?.optional&&(b??=void 0);const B=new Event("change",{target:{value:b}});l("change",B),Y(),M(),e.resetSearchTermOnSelect&&(u.value="")}function ge(b){let B;if(b){const o=new FocusEvent("focus");l("focus",o),P(),clearTimeout(B)}else{const o=new FocusEvent("blur");l("blur",o),D(),e.resetSearchTermOnBlur&&(B=setTimeout(()=>{u.value=""},100))}}function ut(b){b.preventDefault(),b.stopPropagation(),l("create",u.value)}function dt(b,B){if($(B)){if(B.disabled){b.preventDefault();return}B.onSelect?.(b)}}function $(b){return typeof b=="object"&&b!==null}return r({triggerRef:he(()=>E.value?.$el)}),(b,B)=>(c(),G(ie,null,[F(t(Q),null,{default:h(()=>[F(t(et),{"data-slot":"item",class:z(g.value.item({class:e.ui?.item})),value:u.value,onSelect:ut},{default:h(()=>[ze("span",{"data-slot":"itemLabel",class:z(g.value.itemLabel({class:e.ui?.itemLabel}))},[I(b.$slots,"create-item-label",{item:u.value},()=>[ye(de(t(p)("selectMenu.create",{label:u.value})),1)])],2)]),_:3},8,["class","value"])]),_:3}),F(t(me),null,{default:h(({item:o,index:U})=>[$(o)&&o.type==="label"?(c(),_(t(Ga),{key:0,"data-slot":"label",class:z(g.value.label({class:[e.ui?.label,o.ui?.label,o.class]}))},{default:h(()=>[ye(de(t(be)(o,e.labelKey)),1)]),_:2},1032,["class"])):$(o)&&o.type==="separator"?(c(),_(t(Ya),{key:1,"data-slot":"separator",class:z(g.value.separator({class:[e.ui?.separator,o.ui?.separator,o.class]}))},null,8,["class"])):(c(),_(t(et),{key:2,"data-slot":"item",class:z(g.value.item({class:[e.ui?.item,$(o)&&o.ui?.item,$(o)&&o.class]})),disabled:$(o)&&o.disabled,value:e.valueKey&&$(o)?t(be)(o,e.valueKey):o,onSelect:K=>dt(K,o)},{default:h(()=>[I(b.$slots,"item",{item:o,index:U,ui:g.value},()=>[I(b.$slots,"item-leading",{item:o,index:U,ui:g.value},()=>[$(o)&&o.icon?(c(),_(Oe,{key:0,name:o.icon,"data-slot":"itemLeadingIcon",class:z(g.value.itemLeadingIcon({class:[e.ui?.itemLeadingIcon,o.ui?.itemLeadingIcon]}))},null,8,["name","class"])):$(o)&&o.avatar?(c(),_(Xe,T({key:1,size:o.ui?.itemLeadingAvatarSize||e.ui?.itemLeadingAvatarSize||g.value.itemLeadingAvatarSize()},o.avatar,{"data-slot":"itemLeadingAvatar",class:g.value.itemLeadingAvatar({class:[e.ui?.itemLeadingAvatar,o.ui?.itemLeadingAvatar]})}),null,16,["size","class"])):$(o)&&o.chip?(c(),_(Ot,T({key:2,size:e.ui?.itemLeadingChipSize||g.value.itemLeadingChipSize(),inset:"",standalone:""},o.chip,{"data-slot":"itemLeadingChip",class:g.value.itemLeadingChip({class:[e.ui?.itemLeadingChip,o.ui?.itemLeadingChip]})}),null,16,["size","class"])):N("",!0)]),ze("span",{"data-slot":"itemWrapper",class:z(g.value.itemWrapper({class:[e.ui?.itemWrapper,$(o)&&o.ui?.itemWrapper]}))},[ze("span",{"data-slot":"itemLabel",class:z(g.value.itemLabel({class:[e.ui?.itemLabel,$(o)&&o.ui?.itemLabel]}))},[I(b.$slots,"item-label",{item:o,index:U},()=>[ye(de($(o)?t(be)(o,e.labelKey):o),1)])],2),$(o)&&(t(be)(o,e.descriptionKey)||i["item-description"])?(c(),G("span",{key:0,"data-slot":"itemDescription",class:z(g.value.itemDescription({class:[e.ui?.itemDescription,$(o)&&o.ui?.itemDescription]}))},[I(b.$slots,"item-description",{item:o,index:U},()=>[ye(de(t(be)(o,e.descriptionKey)),1)])],2)):N("",!0)],2),ze("span",{"data-slot":"itemTrailing",class:z(g.value.itemTrailing({class:[e.ui?.itemTrailing,$(o)&&o.ui?.itemTrailing]}))},[I(b.$slots,"item-trailing",{item:o,index:U,ui:g.value}),F(t(Ma),{"as-child":""},{default:h(()=>[F(Oe,{name:s.selectedIcon||t(v).ui.icons.check,"data-slot":"itemTrailingIcon",class:z(g.value.itemTrailingIcon({class:[e.ui?.itemTrailingIcon,$(o)&&o.ui?.itemTrailingIcon]}))},null,8,["name","class"])]),_:2},1024)],2)])]),_:2},1032,["class","disabled","value","onSelect"]))]),_:3}),F(t(wa),T({id:t(xe)},{...t(C),...b.$attrs,...t(ee)},{"ignore-filter":"","as-child":"",name:t(O),disabled:t(X),"onUpdate:modelValue":Me,"onUpdate:open":ge}),{default:h(({modelValue:o,open:U})=>[F(t(la),{"as-child":""},{default:h(()=>[F(t(Za),{ref_key:"triggerRef",ref:E,"data-slot":"base",class:z(g.value.base({class:[e.ui?.base,e.class]})),tabindex:"0"},{default:h(()=>[t(Z)||s.avatar||i.leading?(c(),G("span",{key:0,"data-slot":"leading",class:z(g.value.leading({class:e.ui?.leading}))},[I(b.$slots,"leading",{modelValue:o,open:U,ui:g.value},()=>[t(Z)&&t(R)?(c(),_(Oe,{key:0,name:t(R),"data-slot":"leadingIcon",class:z(g.value.leadingIcon({class:e.ui?.leadingIcon}))},null,8,["name","class"])):s.avatar?(c(),_(Xe,T({key:1,size:e.ui?.itemLeadingAvatarSize||g.value.itemLeadingAvatarSize()},s.avatar,{"data-slot":"itemLeadingAvatar",class:g.value.itemLeadingAvatar({class:e.ui?.itemLeadingAvatar})}),null,16,["size","class"])):N("",!0)])],2)):N("",!0),I(b.$slots,"default",{modelValue:o,open:U,ui:g.value},()=>[(c(!0),G(ie,null,Pe([Ne(o)],K=>(c(),G(ie,{key:K},[K!=null?(c(),G("span",{key:0,"data-slot":"value",class:z(g.value.value({class:e.ui?.value}))},de(K),3)):(c(),G("span",{key:1,"data-slot":"placeholder",class:z(g.value.placeholder({class:e.ui?.placeholder}))},de(s.placeholder??" "),3))],64))),128))]),t(te)||i.trailing?(c(),G("span",{key:1,"data-slot":"trailing",class:z(g.value.trailing({class:e.ui?.trailing}))},[I(b.$slots,"trailing",{modelValue:o,open:U,ui:g.value},()=>[t(A)?(c(),_(Oe,{key:0,name:t(A),"data-slot":"trailingIcon",class:z(g.value.trailingIcon({class:e.ui?.trailingIcon}))},null,8,["name","class"])):N("",!0)])],2)):N("",!0)]),_:2},1032,["class"])]),_:2},1024),F(t(Ua),_e(Ee(t(S))),{default:h(()=>[F(t(Ta),T({"data-slot":"content",class:g.value.content({class:e.ui?.content})},f.value),{default:h(()=>[F(t(Rt),{trapped:"","data-slot":"focusScope",class:z(g.value.focusScope({class:e.ui?.focusScope}))},{default:h(()=>[I(b.$slots,"content-top"),s.searchInput?(c(),_(t(Da),{key:0,modelValue:u.value,"onUpdate:modelValue":B[1]||(B[1]=K=>u.value=K),"display-value":()=>u.value,"as-child":""},{default:h(()=>[F(ea,T({autofocus:"",autocomplete:"off",size:s.size},q.value,{"data-slot":"input",class:g.value.input({class:e.ui?.input}),onChange:B[0]||(B[0]=Ae(()=>{},["stop"]))}),null,16,["size","class"])]),_:1},8,["modelValue","display-value"])):N("",!0),F(t(Oa),{"data-slot":"empty",class:z(g.value.empty({class:e.ui?.empty}))},{default:h(()=>[I(b.$slots,"empty",{searchTerm:u.value},()=>[ye(de(u.value?t(p)("selectMenu.noMatch",{searchTerm:u.value}):t(p)("selectMenu.noData")),1)])]),_:3},8,["class"]),ze("div",{role:"presentation","data-slot":"viewport",class:z(g.value.viewport({class:e.ui?.viewport}))},[s.virtualize?(c(),G(ie,{key:0},[y.value&&x.value==="top"?(c(),_(t(ae),{key:0})):N("",!0),F(t(Qa),T({options:d.value,"text-content":K=>$(K)?t(be)(K,e.labelKey):String(K)},n.value),{default:h(({option:K,virtualItem:Te})=>[F(t(le),{item:K,index:Te.index},null,8,["item","index"])]),_:1},16,["options","text-content"]),y.value&&x.value==="bottom"?(c(),_(t(ae),{key:1})):N("",!0)],64)):(c(),G(ie,{key:1},[y.value&&x.value==="top"?(c(),_(t(He),{key:0,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[F(t(ae))]),_:1},8,["class"])):N("",!0),(c(!0),G(ie,null,Pe(ke.value,(K,Te)=>(c(),_(t(He),{key:`group-${Te}`,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[(c(!0),G(ie,null,Pe(K,(pt,Ue)=>(c(),_(t(le),{key:`group-${Te}-${Ue}`,item:pt,index:Ue},null,8,["item","index"]))),128))]),_:2},1032,["class"]))),128)),y.value&&x.value==="bottom"?(c(),_(t(He),{key:1,"data-slot":"group",class:z(g.value.group({class:e.ui?.group}))},{default:h(()=>[F(t(ae))]),_:1},8,["class"])):N("",!0)],64))],2),I(b.$slots,"content-bottom")]),_:3},8,["class"]),s.arrow?(c(),_(t(Aa),T({key:0},m.value,{"data-slot":"arrow",class:g.value.arrow({class:e.ui?.arrow})}),null,16,["class"])):N("",!0)]),_:3},16,["class"])]),_:3},16)]),_:3},16,["id","name","disabled"])],64))}});export{ya as L,gl as _,xa as a,pa as b,ua as c,qa as d,va as e,sa as f,ml as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as l,h as c,c as r,o as n,$ as u,ap as s}from"./
|
|
1
|
+
import{W as l,h as c,c as r,o as n,$ as u,ap as s}from"./B06CcGVK.js";import{_ as p}from"./Cwel2ykQ.js";const i={base:"align-text-top"},v={__name:"ProseKbd",props:{value:{type:String,required:!0},class:{type:null,required:!1}},setup(e){const a=e,t=l(),o=c(()=>s({extend:s(i),...t.ui?.prose?.kbd||{}}));return(m,f)=>(n(),r(p,{value:e.value,class:u(o.value({class:a.class}))},null,8,["value","class"]))}};export{v as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as p,ad as m,h as n,M as r,o as c,r as d,$ as o,ac as g,Z as f,a as v,_ as x,ap as u}from"./
|
|
1
|
+
import{W as p,ad as m,h as n,M as r,o as c,r as d,$ as o,ac as g,Z as f,a as v,_ as x,ap as u}from"./B06CcGVK.js";const y={slots:{base:["relative text-2xl text-highlighted font-bold mt-12 mb-6 scroll-mt-[calc(48px+45px+var(--ui-header-height))] lg:scroll-mt-[calc(48px+var(--ui-header-height))] [&>a]:focus-visible:outline-primary [&>a>code]:border-dashed hover:[&>a>code]:border-primary hover:[&>a>code]:text-primary [&>a>code]:text-xl/7 [&>a>code]:font-bold","[&>a>code]:transition-colors"],leading:["absolute -ms-8 top-1 opacity-0 group-hover:opacity-100 group-focus:opacity-100 p-1 bg-elevated hover:text-primary rounded-md hidden lg:flex text-muted","transition"],leadingIcon:"size-4 shrink-0",link:"group lg:ps-2 lg:-ms-2"}},b=["id"],k=["href"],C={__name:"ProseH2",props:{id:{type:String,required:!1},class:{type:null,required:!1},ui:{type:null,required:!1}},setup(a){const e=a,t=p(),{headings:l}=m().public?.mdc||{},s=n(()=>u({extend:u(y),...t.ui?.prose?.h2||{}})()),h=n(()=>e.id&&typeof l?.anchorLinks=="object"&&l.anchorLinks.h2);return(i,_)=>(c(),r("h2",{id:a.id,class:o(s.value.base({class:e.class}))},[a.id&&h.value?(c(),r("a",{key:0,href:`#${a.id}`,class:o(s.value.link({class:e.ui?.link}))},[g("span",{class:o(s.value.leading({class:e.ui?.leading}))},[f(x,{name:v(t).ui.icons.hash,class:o(s.value.leadingIcon({class:e.ui?.leadingIcon}))},null,8,["name","class"])],2),d(i.$slots,"default")],10,k)):d(i.$slots,"default",{key:1})],10,b))}};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as y,aT as h,h as o,f as g,c as p,o as l,m as d,aF as E,M as f,aa as B,al as c,am as V}from"./
|
|
1
|
+
import{d as y,aT as h,h as o,f as g,c as p,o as l,m as d,aF as E,M as f,aa as B,al as c,am as V}from"./B06CcGVK.js";var k=y({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,{primitiveElement:s,currentElement:n}=h(),t=o(()=>e.checked??e.value);return g(t,(a,r)=>{if(!n.value)return;const u=n.value,_=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(_,"value").set;if(v&&a!==r){const b=new Event("input",{bubbles:!0}),q=new Event("change",{bubbles:!0});v.call(u,a),u.dispatchEvent(b),u.dispatchEvent(q)}}),(a,r)=>(l(),p(E,d({ref_key:"primitiveElement",ref:s},{...e,...a.$attrs},{as:"input"}),null,16))}}),m=k,A=y({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(i){const e=i,s=o(()=>typeof e.value=="object"&&Array.isArray(e.value)&&e.value.length===0&&e.required),n=o(()=>typeof e.value=="string"||typeof e.value=="number"||typeof e.value=="boolean"||e.value===null||e.value===void 0?[{name:e.name,value:e.value}]:typeof e.value=="object"&&Array.isArray(e.value)?e.value.flatMap((t,a)=>typeof t=="object"?Object.entries(t).map(([r,u])=>({name:`${e.name}[${a}][${r}]`,value:u})):{name:`${e.name}[${a}]`,value:t}):e.value!==null&&typeof e.value=="object"&&!Array.isArray(e.value)?Object.entries(e.value).map(([t,a])=>({name:`${e.name}[${t}]`,value:a})):[]);return(t,a)=>(l(),f(c,null,[B(" We render single input if it's required "),s.value?(l(),p(m,d({key:t.name},{...e,...t.$attrs},{name:t.name,value:t.value}),null,16,["name","value"])):(l(!0),f(c,{key:1},V(n.value,r=>(l(),p(m,d({key:r.name},{ref_for:!0},{...e,...t.$attrs},{name:r.name,value:r.value}),null,16,["name","value"]))),128))],2112))}}),I=A;export{I as V};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as d,h as t,c as f,aa as y,o as v,_ as a,aZ as r}from"./
|
|
1
|
+
import{W as d,h as t,c as f,aa as y,o as v,_ as a,aZ as r}from"./B06CcGVK.js";const u={"package.json":"i-vscode-icons-file-type-node","tsconfig.json":"i-vscode-icons-file-type-tsconfig",".npmrc":"i-vscode-icons-file-type-npm",".editorconfig":"i-vscode-icons-file-type-editorconfig",".eslintrc":"i-vscode-icons-file-type-eslint",".eslintrc.cjs":"i-vscode-icons-file-type-eslint",".eslintignore":"i-vscode-icons-file-type-eslint","eslint.config.js":"i-vscode-icons-file-type-eslint","eslint.config.mjs":"i-vscode-icons-file-type-eslint","eslint.config.cjs":"i-vscode-icons-file-type-eslint",".gitignore":"i-vscode-icons-file-type-git","yarn.lock":"i-vscode-icons-file-type-yarn",".env":"i-vscode-icons-file-type-dotenv",".env.example":"i-vscode-icons-file-type-dotenv",".vscode/settings.json":"i-vscode-icons-file-type-vscode",nuxt:"i-vscode-icons-file-type-nuxt",".nuxtrc":"i-vscode-icons-file-type-nuxt",".nuxtignore":"i-vscode-icons-file-type-nuxt","nuxt.config.js":"i-vscode-icons-file-type-nuxt","nuxt.config.ts":"i-vscode-icons-file-type-nuxt","nuxt.schema.ts":"i-vscode-icons-file-type-nuxt","tailwind.config.js":"i-vscode-icons-file-type-tailwind","tailwind.config.ts":"i-vscode-icons-file-type-tailwind",vue:"i-vscode-icons-file-type-vue",ts:"i-vscode-icons-file-type-typescript",tsx:"i-vscode-icons-file-type-typescript",mjs:"i-vscode-icons-file-type-js",cjs:"i-vscode-icons-file-type-js",js:"i-vscode-icons-file-type-js",jsx:"i-vscode-icons-file-type-js",md:"i-vscode-icons-file-type-markdown",py:"i-vscode-icons-file-type-python",cs:"i-vscode-icons-file-type-csharp",asm:"i-vscode-icons-file-type-assembly",f:"i-vscode-icons-file-type-fortran",hs:"i-vscode-icons-file-type-haskell",fs:"i-vscode-icons-file-type-fsharp",kt:"i-vscode-icons-file-type-kotlin",rs:"i-vscode-icons-file-type-rust",rb:"i-vscode-icons-file-type-ruby",lsp:"i-vscode-icons-file-type-lisp",ps1:"i-vscode-icons-file-type-powershell",psd1:"i-vscode-icons-file-type-powershell",psm1:"i-vscode-icons-file-type-powershell",go:"i-vscode-icons-file-type-go",gleam:"i-vscode-icons-file-type-gleam",bicep:"i-vscode-icons-file-type-bicep",bicepparam:"i-vscode-icons-file-type-bicep",exs:"i-vscode-icons-file-type-elixir",erl:"i-vscode-icons-file-type-erlang",sbt:"i-vscode-icons-file-type-scala",h:"i-vscode-icons-file-type-cppheader",ino:"i-vscode-icons-file-type-arduino",pl:"i-vscode-icons-file-type-perl",jl:"i-vscode-icons-file-type-julia",dart:"i-vscode-icons-file-type-dartlang",ico:"i-vscode-icons-file-type-favicon",npm:"i-vscode-icons-file-type-npm",pnpm:"i-vscode-icons-file-type-pnpm",npx:"i-vscode-icons-file-type-npm",yarn:"i-vscode-icons-file-type-yarn",bun:"i-vscode-icons-file-type-bun",deno:"i-vscode-icons-file-type-deno",yml:"i-vscode-icons-file-type-yaml",terminal:"i-lucide-terminal"},g={__name:"ProseCodeIcon",props:{icon:{type:null,required:!1},filename:{type:String,required:!1}},setup(l){const e=l,p=d(),o=t(()=>r(p.ui?.prose?.codeIcon||{},u)),c=t(()=>{if(e.icon)return e.icon;if(!e.filename)return;const i=e.filename.replace(/\s*\(.*\)\s*$/,""),s=i.includes(".")&&i.split(".").pop(),n=i.split("/").pop();return(n&&o.value[n.toLowerCase()])??(s&&(o.value[s]??`i-vscode-icons-file-type-${s}`))});return(i,s)=>c.value?(v(),f(a,{key:0,name:c.value},null,8,["name"])):y("",!0)}};export{g as default};
|