graview 0.1.55 → 0.1.57
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/dist/preview/{chunk.XSMXSNDR.js → chunk.2PWVDUOU.js} +1 -1
- package/dist/preview/{chunk.AFK5HHLL.js → chunk.33PZEW5A.js} +1 -1
- package/dist/preview/{chunk.SUGOENC4.js → chunk.3DPTDMJ7.js} +1 -1
- package/dist/preview/chunk.47T3KUAA.js +1 -0
- package/dist/preview/{chunk.XUHY4XO2.js → chunk.4BRM5SGO.js} +1 -1
- package/dist/preview/{chunk.4TLWZVVG.js → chunk.4HFCOMR3.js} +1 -1
- package/dist/preview/{chunk.5MCXTY2P.js → chunk.4HPP35XQ.js} +1 -1
- package/dist/preview/chunk.4JDHBNEA.js +104 -0
- package/dist/preview/{chunk.QWICAV2C.js → chunk.4K6VAC2S.js} +2 -2
- package/dist/preview/{chunk.ZXOD5GM3.js → chunk.4L4F47QP.js} +1 -1
- package/dist/preview/{chunk.SIABGHF2.js → chunk.4NPXMYA5.js} +1 -1
- package/dist/preview/{chunk.354A4QCG.js → chunk.4OP4IEEY.js} +1 -1
- package/dist/preview/chunk.4SBYXHCQ.js +1 -0
- package/dist/preview/{chunk.LYVRXRIH.js → chunk.4UQBMFJZ.js} +1 -1
- package/dist/preview/{chunk.7WEQHJ3N.js → chunk.4W5GCPAP.js} +1 -1
- package/dist/preview/{chunk.TT6GKRBE.js → chunk.4XKRCAJZ.js} +1 -1
- package/dist/preview/{chunk.HXHFWZ2U.js → chunk.534TBZJ3.js} +2 -2
- package/dist/preview/{chunk.JRRVLGEK.js → chunk.53U6E5LD.js} +1 -1
- package/dist/preview/{chunk.HXR7EEXR.js → chunk.547FQPYG.js} +1 -1
- package/dist/preview/{chunk.O752PM42.js → chunk.57BKS5KD.js} +1 -1
- package/dist/preview/chunk.57KRCHQT.js +1 -0
- package/dist/preview/{chunk.KVQZ5FR6.js → chunk.5BPRGXIW.js} +1 -1
- package/dist/preview/{chunk.TAQB64FZ.js → chunk.5GTOF5D5.js} +1 -1
- package/dist/preview/{chunk.KY7QD22S.js → chunk.5IEFTFKQ.js} +1 -1
- package/dist/preview/chunk.5NZDFT6R.js +1 -0
- package/dist/preview/{chunk.AFEEXRN3.js → chunk.66LWZIY5.js} +1 -1
- package/dist/preview/{chunk.USJ4J3GL.js → chunk.6AH26OL7.js} +2 -2
- package/dist/preview/{chunk.PIQ52FCI.js → chunk.6SD7YZ4U.js} +2 -2
- package/dist/preview/{chunk.AVVNQKA7.js → chunk.72IHABM5.js} +1 -1
- package/dist/preview/chunk.7INWDFNG.js +1 -0
- package/dist/preview/{chunk.FUZWXKTN.js → chunk.7IXTNST2.js} +1 -1
- package/dist/preview/{chunk.6UAUME5U.js → chunk.7ML2BWSP.js} +1 -1
- package/dist/preview/chunk.7UBABS2T.js +1 -0
- package/dist/preview/{chunk.CM2ETM2A.js → chunk.7VIFAN3O.js} +1 -1
- package/dist/preview/chunk.7VZA34T4.js +1 -0
- package/dist/preview/{chunk.EJXUOL2C.js → chunk.AD3EC5DU.js} +1 -1
- package/dist/preview/{chunk.BRCKXL7B.js → chunk.BCE6LIDR.js} +1 -1
- package/dist/preview/chunk.BPEUHOKH.js +1 -0
- package/dist/preview/{chunk.KHJ2MCMS.js → chunk.BUSFJM6P.js} +1 -1
- package/dist/preview/{chunk.2HANQ737.js → chunk.BZEJM2PY.js} +1 -1
- package/dist/preview/{chunk.YGZGMRDC.js → chunk.C5EFUODO.js} +1 -1
- package/dist/preview/{chunk.ATXSLBE3.js → chunk.C7EJPV2N.js} +1 -1
- package/dist/preview/chunk.CMLNBJZG.js +3 -0
- package/dist/preview/{chunk.NXM73RZA.js → chunk.CUKRUQQ2.js} +1 -1
- package/dist/preview/chunk.CXB4BSI4.js +1 -0
- package/dist/preview/{chunk.5EOSEVZB.js → chunk.D3LQJXVP.js} +1 -1
- package/dist/preview/{chunk.YOBRVKJT.js → chunk.D4EP7FEC.js} +1 -1
- package/dist/preview/{chunk.WSMYFEGU.js → chunk.DBMZ3AQB.js} +1 -1
- package/dist/preview/chunk.DIFR37EZ.js +5 -0
- package/dist/preview/chunk.DJ4A76SX.js +1 -0
- package/dist/preview/{chunk.O7RMVGAB.js → chunk.DM5X3JBH.js} +1 -1
- package/dist/preview/chunk.DQUISKTC.js +1 -0
- package/dist/preview/chunk.DSLGMCB6.js +1 -0
- package/dist/preview/chunk.DSWMXM57.js +1 -0
- package/dist/preview/{chunk.DB3HOKZD.js → chunk.DWLKJGVT.js} +1 -1
- package/dist/preview/{chunk.2KH2LWZL.js → chunk.EQAAKYLA.js} +1 -1
- package/dist/preview/{chunk.4OMSQFIY.js → chunk.EXZLG3HK.js} +1 -1
- package/dist/preview/{chunk.QJ42D5GM.js → chunk.EZ4NUZWX.js} +1 -1
- package/dist/preview/{chunk.WUFCRE7O.js → chunk.EZ4TZUMM.js} +1 -1
- package/dist/preview/chunk.FJTWAU7N.js +1 -0
- package/dist/preview/{chunk.WVKXELAF.js → chunk.FLMNWVSY.js} +2 -2
- package/dist/preview/{chunk.K5WPS4RR.js → chunk.FLVE6IBM.js} +1 -1
- package/dist/preview/chunk.FPGU43SC.js +1 -0
- package/dist/preview/{chunk.5DPFAVCZ.js → chunk.FRERJWZJ.js} +1 -1
- package/dist/preview/{chunk.OT6EWYK2.js → chunk.G3BDQ6EA.js} +1 -1
- package/dist/preview/chunk.GBAUQXXD.js +1 -0
- package/dist/preview/{chunk.5SANELJT.js → chunk.H5CRRBNU.js} +1 -1
- package/dist/preview/{chunk.7Y6NK5CT.js → chunk.HFSG3F5Z.js} +1 -1
- package/dist/preview/chunk.I2NI7CT7.js +1 -0
- package/dist/preview/{chunk.ZAHVKXYQ.js → chunk.I5PSHASU.js} +1 -1
- package/dist/preview/{chunk.TDV7JGIQ.js → chunk.I636CZE4.js} +1 -1
- package/dist/preview/chunk.I6H3HRWT.js +1 -0
- package/dist/preview/{chunk.62LPYPP3.js → chunk.IRQOJATD.js} +1 -1
- package/dist/preview/chunk.IV7AUO53.js +1 -0
- package/dist/preview/{chunk.RZQKCLTW.js → chunk.IX63LTRQ.js} +1 -1
- package/dist/preview/{chunk.IXHLP2CL.js → chunk.JBSW7ZNH.js} +1 -1
- package/dist/preview/chunk.JD5HSAMC.js +18 -0
- package/dist/preview/{chunk.ZOW7AC7U.js → chunk.JETT6ELP.js} +1 -1
- package/dist/preview/{chunk.LQCH2NFE.js → chunk.JNNBHD4Z.js} +1 -1
- package/dist/preview/{chunk.LMXNHBGH.js → chunk.JQFIZRAZ.js} +2 -2
- package/dist/preview/chunk.KNYLY7MH.js +1 -0
- package/dist/preview/chunk.KO7IOFNY.js +1 -0
- package/dist/preview/{chunk.EGSE6NNE.js → chunk.KPIDJYIU.js} +1 -1
- package/dist/preview/{chunk.YRFN4VDD.js → chunk.KTV24HY7.js} +1 -1
- package/dist/preview/{chunk.6JYNNPAI.js → chunk.KYOI7BG3.js} +1 -1
- package/dist/preview/{chunk.PHLMQO7V.js → chunk.LE2KAR25.js} +1 -1
- package/dist/preview/{chunk.UE5GAP67.js → chunk.LHIT3EZD.js} +2 -2
- package/dist/preview/{chunk.DBCVZGCC.js → chunk.LKJ6FD6Y.js} +1 -1
- package/dist/preview/chunk.LUIRQ5UF.js +2 -0
- package/dist/preview/chunk.LWRXCO2Z.js +1 -0
- package/dist/preview/{chunk.YYWANGIC.js → chunk.M72JKVHP.js} +4 -4
- package/dist/preview/{chunk.6NQQUIBX.js → chunk.MAZFQIL5.js} +1 -1
- package/dist/preview/{chunk.CPNE6HPQ.js → chunk.MBLFZF5R.js} +1 -1
- package/dist/preview/{chunk.PSLCI3GO.js → chunk.MRHPOUA4.js} +1 -1
- package/dist/preview/{chunk.PIHCXN5U.js → chunk.MWWOI5PW.js} +1 -1
- package/dist/preview/{chunk.35O5H5L7.js → chunk.N2DM42SG.js} +2 -2
- package/dist/preview/chunk.N33WUCAN.js +3 -0
- package/dist/preview/{chunk.PCKX2FHR.js → chunk.N5MQARN6.js} +1 -1
- package/dist/preview/{chunk.G5XTASMO.js → chunk.NF72Z2HG.js} +1 -1
- package/dist/preview/{chunk.RNYLNBIB.js → chunk.NGK6IRV3.js} +1 -1
- package/dist/preview/chunk.NL3AJZ3N.js +1 -0
- package/dist/preview/chunk.NUS5K56R.js +21 -0
- package/dist/preview/{chunk.XTP5DGPJ.js → chunk.NX7CR4AE.js} +1 -1
- package/dist/preview/chunk.NZDWXX6H.js +1 -0
- package/dist/preview/{chunk.5L4J2XAI.js → chunk.O47MN7E5.js} +1 -1
- package/dist/preview/chunk.OYUDK3LK.js +1 -0
- package/dist/preview/chunk.PF5P5YVD.js +1 -0
- package/dist/preview/{chunk.V6X3U3JF.js → chunk.PHC2MI4C.js} +1 -1
- package/dist/preview/{chunk.U5AX4DD5.js → chunk.PQMMISCQ.js} +1 -1
- package/dist/preview/{chunk.TUBAFVV4.js → chunk.Q6OZLBNL.js} +1 -1
- package/dist/preview/{chunk.ZPXAKRKG.js → chunk.QMYHXMRV.js} +1 -1
- package/dist/preview/chunk.QPL3OXW3.js +1 -0
- package/dist/preview/{chunk.V5PAFSWP.js → chunk.QS6YW7UY.js} +1 -1
- package/dist/preview/chunk.QUJS63OJ.js +13 -0
- package/dist/preview/{chunk.EKP3HQAX.js → chunk.RALAID6N.js} +1 -1
- package/dist/preview/chunk.RQX4CQJN.js +1 -0
- package/dist/preview/{chunk.PM64C5PX.js → chunk.RVR6FWAF.js} +1 -1
- package/dist/preview/{chunk.MFCBAQS3.js → chunk.S5ECRIG5.js} +1 -1
- package/dist/preview/{chunk.DNJM6WQO.js → chunk.SAJLIA5M.js} +1 -1
- package/dist/preview/{chunk.RPVJ5IXD.js → chunk.TBRXNU6T.js} +1 -1
- package/dist/preview/{chunk.Y3BEKXYB.js → chunk.TVURUMU4.js} +1 -1
- package/dist/preview/chunk.UBNZDSS7.js +1 -0
- package/dist/preview/chunk.UDCDK7XJ.js +4 -0
- package/dist/preview/{chunk.6ZJE5M2A.js → chunk.UGOKORIF.js} +1 -1
- package/dist/preview/{chunk.NDLQXQV2.js → chunk.UV3U4FRT.js} +1 -1
- package/dist/preview/{chunk.QBMIET7P.js → chunk.UWQ3I5OW.js} +1 -1
- package/dist/preview/chunk.V6FUYRZI.js +1 -0
- package/dist/preview/{chunk.2SWQI4HF.js → chunk.VDS3IOTK.js} +1 -1
- package/dist/preview/chunk.VHPGGC2P.js +1 -0
- package/dist/preview/chunk.VSGTNYM2.js +1 -0
- package/dist/preview/{chunk.FUS2FJS3.js → chunk.VW4JAQCH.js} +1 -1
- package/dist/preview/{chunk.OS5EALHY.js → chunk.WASWMHND.js} +1 -1
- package/dist/preview/chunk.WYPL2QUA.js +1 -0
- package/dist/preview/{chunk.MFOSEOF4.js → chunk.XTBS64IT.js} +1 -1
- package/dist/preview/chunk.XVN3CQKH.js +2 -0
- package/dist/preview/{chunk.27ZSRO3O.js → chunk.Y3EOGXRS.js} +1 -1
- package/dist/preview/chunk.Y4KNR76Z.js +1 -0
- package/dist/preview/chunk.YDTXCVBU.js +1 -0
- package/dist/preview/{chunk.DH4AC7TC.js → chunk.YPP7FSEZ.js} +1 -1
- package/dist/preview/{chunk.FTW3K3G6.js → chunk.YQXA4WAM.js} +2 -2
- package/dist/preview/{chunk.4BFJWNVM.js → chunk.YR75TWDV.js} +1 -1
- package/dist/preview/{chunk.QIAH7HHO.js → chunk.YS5U3DUX.js} +1 -1
- package/dist/preview/chunk.Z5UVYOGC.js +1 -0
- package/dist/preview/{chunk.P4ZZSFOQ.js → chunk.ZNXRHOUI.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2ORJGMRT.js +0 -104
- package/dist/preview/chunk.3IZOXNJH.js +0 -1
- package/dist/preview/chunk.5D6SIBOK.js +0 -1
- package/dist/preview/chunk.5EZDXWOE.js +0 -1
- package/dist/preview/chunk.5MSNKSTE.js +0 -1
- package/dist/preview/chunk.5XUVCM7X.js +0 -1
- package/dist/preview/chunk.6NGSR2ZQ.js +0 -1
- package/dist/preview/chunk.7KERB5CH.js +0 -1
- package/dist/preview/chunk.AVNOLMCV.js +0 -1
- package/dist/preview/chunk.AZ6Q3WT2.js +0 -1
- package/dist/preview/chunk.DKJK2MMV.js +0 -2
- package/dist/preview/chunk.DU75P3Y7.js +0 -1
- package/dist/preview/chunk.DVG47BK3.js +0 -1
- package/dist/preview/chunk.DXJFAAOI.js +0 -1
- package/dist/preview/chunk.F5RN6YXG.js +0 -4
- package/dist/preview/chunk.FVOFTM5J.js +0 -1
- package/dist/preview/chunk.G2XDQPE4.js +0 -1
- package/dist/preview/chunk.H536YUAZ.js +0 -3
- package/dist/preview/chunk.HNJFBI7J.js +0 -1
- package/dist/preview/chunk.HUABTCQE.js +0 -1
- package/dist/preview/chunk.INBHY3SA.js +0 -1
- package/dist/preview/chunk.KIMIPHAI.js +0 -1
- package/dist/preview/chunk.KXNWZ33P.js +0 -1
- package/dist/preview/chunk.LEPKPNPA.js +0 -1
- package/dist/preview/chunk.LLXEWLIP.js +0 -1
- package/dist/preview/chunk.LWLI5PI4.js +0 -1
- package/dist/preview/chunk.MIQMPOWF.js +0 -2
- package/dist/preview/chunk.MNSKBGRM.js +0 -1
- package/dist/preview/chunk.MSM6E6JK.js +0 -1
- package/dist/preview/chunk.NS6KWKF5.js +0 -1
- package/dist/preview/chunk.OIMYSR2J.js +0 -1
- package/dist/preview/chunk.OL2N5NUV.js +0 -1
- package/dist/preview/chunk.QQ3YWKWU.js +0 -1
- package/dist/preview/chunk.R3ZS4QO6.js +0 -18
- package/dist/preview/chunk.SG67ID6C.js +0 -1
- package/dist/preview/chunk.SYX7AEHU.js +0 -1
- package/dist/preview/chunk.T66UK7PQ.js +0 -3
- package/dist/preview/chunk.TEE23CVQ.js +0 -1
- package/dist/preview/chunk.TZTRGNAA.js +0 -1
- package/dist/preview/chunk.UADL2LHO.js +0 -1
- package/dist/preview/chunk.URDCHVH3.js +0 -21
- package/dist/preview/chunk.WR63RQGU.js +0 -5
- package/dist/preview/chunk.XE72DFBV.js +0 -13
- package/dist/preview/chunk.XEHLSKHP.js +0 -1
- package/dist/preview/chunk.YG2WZO53.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as qe,c as Be}from"./chunk.RPVJ5IXD.js";import{b as Ve}from"./chunk.5SANELJT.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.WVKXELAF.js";import"./chunk.ZOW7AC7U.js";import{k as Me,l as Le}from"./chunk.PIQ52FCI.js";import"./chunk.INBHY3SA.js";import"./chunk.TDV7JGIQ.js";import"./chunk.RZQKCLTW.js";import{e as Ee}from"./chunk.Y3BEKXYB.js";import{m as Pe}from"./chunk.NDLQXQV2.js";import{a as Te,b as Oe}from"./chunk.WUFCRE7O.js";import{h as $e}from"./chunk.XEHLSKHP.js";import{e as Se,f as Ne}from"./chunk.MSM6E6JK.js";import"./chunk.HJCQ6I3S.js";import"./chunk.FUZWXKTN.js";import{e as ne}from"./chunk.YOBRVKJT.js";import"./chunk.DKJK2MMV.js";import{a as xe}from"./chunk.DU75P3Y7.js";import"./chunk.2SWQI4HF.js";import"./chunk.QIAH7HHO.js";import"./chunk.DNJM6WQO.js";import"./chunk.LEPKPNPA.js";import"./chunk.5D6SIBOK.js";import"./chunk.UE5GAP67.js";import{a as Ae,b as Ce,j as Re}from"./chunk.7WEQHJ3N.js";import"./chunk.G4JJXA63.js";import"./chunk.ATXSLBE3.js";import"./chunk.6UAUME5U.js";import"./chunk.BRCKXL7B.js";import"./chunk.CPNE6HPQ.js";import"./chunk.EKP3HQAX.js";import"./chunk.XOZU4OFA.js";import"./chunk.QQ3YWKWU.js";import"./chunk.MFOSEOF4.js";import"./chunk.WVUJXDXZ.js";import"./chunk.HUABTCQE.js";import{a as ye}from"./chunk.DXJFAAOI.js";import"./chunk.5MSNKSTE.js";import"./chunk.KVQZ5FR6.js";import"./chunk.2HANQ737.js";import"./chunk.H536YUAZ.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.OL2N5NUV.js";import"./chunk.OJGHDWI6.js";import"./chunk.5DPFAVCZ.js";import"./chunk.5EZDXWOE.js";import{d as te,l as be}from"./chunk.MIQMPOWF.js";import{c as me}from"./chunk.T66UK7PQ.js";import{o as J,z as De}from"./chunk.LMXNHBGH.js";import"./chunk.DBCVZGCC.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.WSMYFEGU.js";import"./chunk.SDO3U72B.js";import{I as se,O as de,U as D,Wa as Z,da as G,ga as le,ia as pe,ka as ce}from"./chunk.WR63RQGU.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Ne(l,Se(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Re(JSON.parse(H),{app:B,sight:Ce(B,c)});return Ae($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(De(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
|
|
1
|
+
import{a as qe,c as Be}from"./chunk.TBRXNU6T.js";import{b as Ve}from"./chunk.H5CRRBNU.js";import{a as Ie,b as Ke,c as Fe,d as j}from"./chunk.FLMNWVSY.js";import"./chunk.JETT6ELP.js";import{k as Me,l as Le}from"./chunk.6SD7YZ4U.js";import"./chunk.DSLGMCB6.js";import"./chunk.IX63LTRQ.js";import"./chunk.I636CZE4.js";import{e as Ee}from"./chunk.TVURUMU4.js";import{m as Pe}from"./chunk.UV3U4FRT.js";import{a as Te,b as Oe}from"./chunk.EZ4TZUMM.js";import{h as $e}from"./chunk.47T3KUAA.js";import{e as Se,f as Ne}from"./chunk.NZDWXX6H.js";import"./chunk.HJCQ6I3S.js";import"./chunk.7IXTNST2.js";import{e as ne}from"./chunk.D4EP7FEC.js";import"./chunk.XVN3CQKH.js";import{a as xe}from"./chunk.DJ4A76SX.js";import"./chunk.VDS3IOTK.js";import"./chunk.YS5U3DUX.js";import"./chunk.SAJLIA5M.js";import"./chunk.LWRXCO2Z.js";import"./chunk.I2NI7CT7.js";import"./chunk.LHIT3EZD.js";import{a as Ae,b as Ce,j as Re}from"./chunk.4W5GCPAP.js";import"./chunk.G4JJXA63.js";import"./chunk.C7EJPV2N.js";import"./chunk.7ML2BWSP.js";import"./chunk.BCE6LIDR.js";import"./chunk.MBLFZF5R.js";import"./chunk.RALAID6N.js";import"./chunk.XOZU4OFA.js";import"./chunk.5NZDFT6R.js";import"./chunk.XTBS64IT.js";import"./chunk.WVUJXDXZ.js";import"./chunk.7INWDFNG.js";import{a as ye}from"./chunk.FPGU43SC.js";import"./chunk.V6FUYRZI.js";import"./chunk.5BPRGXIW.js";import"./chunk.BZEJM2PY.js";import"./chunk.CMLNBJZG.js";import"./chunk.GZHZLJBF.js";import{r as ke}from"./chunk.QPL3OXW3.js";import"./chunk.OJGHDWI6.js";import"./chunk.FRERJWZJ.js";import"./chunk.RQX4CQJN.js";import{d as te,l as be}from"./chunk.LUIRQ5UF.js";import{c as me}from"./chunk.N33WUCAN.js";import{o as J,z as De}from"./chunk.JQFIZRAZ.js";import"./chunk.LKJ6FD6Y.js";import{G as tt,Na as ee,Oa as Y,T as we,W as ve,ba as V,da as X,j as ge,l as ue,m as fe,ma as he,r as U}from"./chunk.DBMZ3AQB.js";import"./chunk.SDO3U72B.js";import{K as se,Q as de,W as D,Ya as Z,ga as G,ia as le,ka as pe,ma as ce}from"./chunk.DIFR37EZ.js";import"./chunk.FQLNBIQ5.js";import{b as Q}from"./chunk.AJZBJBMO.js";var f=Q(tt(),1);var nt=300,it=14,z=50,at=3,ot=2;function _e(e,n,o){let p=e.tryDefinition(n)?.fields?.shape;return(p?.[o]===void 0?void 0:ye(p[o]))?.type}var rt=(e,n)=>Object.keys(e.tryDefinition(n)?.fields?.shape??{}),st=e=>e==="date"||e==="datetime",Ge=/^(due|dueOn|dueAt|dueDate|deadline|by)$/i,dt=/^(date|on|day|when|at|start|starts|startsOn|startsAt|begins|from|sown|scheduled|scheduledFor|planned|plannedFor)$/i,lt=/^(done|finished|complete|completed|closed)$/i;function ae(e,n){let o=e.tryDefinition(n),p=rt(e,n),a=p.filter(u=>st(_e(e,n,u)));if(a.length===0)return;let i=o?.fieldRoles??{},s=u=>i[u]!==void 0&&a.includes(i[u])?i[u]:void 0,c=s("start")??s("when")??a.find(u=>Ge.test(u))??a.find(u=>dt.test(u));if(!c)return;let S=s("end")??a.find(u=>u!==c&&/^(end|ends|until|to|finish|finished|harvested|through)$/i.test(u)),g=p.find(u=>lt.test(u)&&_e(e,n,u)==="boolean");return{field:c,due:Ge.test(c),...S?{end:S}:{},...g?{done:g}:{}}}function ie(e,n){return Math.round((Date.parse(`${n.slice(0,10)}T00:00:00Z`)-Date.parse(`${e.slice(0,10)}T00:00:00Z`))/864e5)}var q=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}/.test(e)?e.slice(0,10):void 0;function je(e,n,o,p){let a=ne(e,n);if(a&&o.length>0&&o.length<=nt)return{shape:"board",field:a.field};let i=ae(e,n);if(i&&!i.due){let s=r=>{let y=q(r[i.field]),h=q(Z(r,i.field,p));return y&&h?ie(y,h):0},c=o.map(r=>({from:q(Z(r,i.field,p)),to:i.end&&q(r[i.end])?L(q(r[i.end]),s(r)):void 0})).filter(r=>r.from!==void 0).map(r=>({from:r.from,to:r.to&&r.to>r.from?r.to:r.from})),S=`${p.slice(0,7)}-01`,g=L(`${L(S,31).slice(0,7)}-01`,-1),u=c.filter(r=>r.from<=g&&r.to>=S),w=c.map(r=>ie(r.from,r.to)).sort((r,y)=>r-y),l=w[Math.floor(w.length/2)]??0;if(u.length>0&&l<=it){let r=L(p,-((new Date(`${p}T00:00:00Z`).getUTCDay()+6)%7)),y=L(r,6),h=u.every(m=>m.from>=r&&m.to<=y);return{shape:"calendar",start:i.field,...i.end?{end:i.end}:{},...i.done?{done:i.done}:{},range:h?"week":"month"}}}return{shape:"table"}}function ze(e,n){let o=ae(e,n);return o?{by:o.field,direction:o.due?"asc":"desc"}:void 0}function He(e,n,o={}){switch(n.shape){case"board":return{lens:"columns",kind:e,column:n.field};case"calendar":return{lens:"calendar",kind:e,start:n.start,...n.end?{end:n.end}:{},...n.done?{done:n.done}:{},range:n.range};case"table":return{lens:"blocks",kind:e,as:"row",...o.group?.by?{group:o.group.by}:{},...o.sort?{sort:{by:o.sort.by,...o.sort.direction==="desc"?{direction:"desc"}:{}}}:{}}}}var pt=60;function We(e,n,o,p){let a=e.tryDefinition(n),i=o.slice(0,pt),s=new Map;i.forEach(w=>{let l=G(a,w);te(w,a,{glance:!0,said:[l]}).forEach((r,y)=>{if(r.long||r.files||r.app)return;let h=s.get(r.key);h?h.count++:s.set(r.key,{label:r.label,count:1,at:y})})});let c=Math.max(1,Math.ceil(i.length/3)),S=[...s.entries()].filter(([,w])=>w.count>=c).sort((w,l)=>w[1].at-l[1].at).slice(0,at).map(([w,l])=>({about:"field",key:w,label:l.label})),g=new Map;for(let w of i){let l=new Set;for(let[r,y]of[["out",p.outEdges(w.id)],["in",p.inEdges(w.id)]])for(let h of y){let m=p.getNode(r==="out"?h.to:h.from);if(!m||m.id===w.id)continue;let b=`${h.kind}|${r}`;if(l.has(b))continue;l.add(b);let A=g.get(b);A?A.count++:g.set(b,{edge:h.kind,direction:r,far:m.kind,count:1})}}let u=[...g.entries()].sort((w,l)=>l[1].count-w[1].count).slice(0,ot).map(([w,l])=>{let r=me(e,l.direction==="out"?n:l.far,l.edge,l.direction);return{about:"edge",key:w,label:r.charAt(0).toUpperCase()+r.slice(1),edge:l.edge,direction:l.direction}});return[...S,...u]}function Ze(e,n,o,p){if(o.about==="field"){let s=e.tryDefinition(n.kind);return{text:te(n,s,{excerpt:!0}).find(S=>S.key===o.key)?.value??""}}let i=(o.direction==="out"?p.outEdges(n.id):p.inEdges(n.id)).filter(s=>s.kind===o.edge).map(s=>p.getNode(o.direction==="out"?s.to:s.from)).filter(s=>s!==void 0).map(s=>G(e.tryDefinition(s.kind),s));return i.length===0?{text:""}:i.length===1?{text:i[0]}:{text:`${i[0]} +${i.length-1}`,title:i.join(", ")}}function Ue(e,n,o=()=>{}){let p=new Map;for(let a of e){let i=a.nodeIds.filter(c=>n.has(c));if(i.length===0&&!(a.subjectId!==void 0&&n.has(a.subjectId)))continue;let s=p.get(a.invariant)??{invariant:a.invariant,label:o(a.invariant)||a.label||a.message,violations:[],records:new Set};s.violations.push(a);for(let c of i)s.records.add(c);a.subjectId!==void 0&&n.has(a.subjectId)&&s.records.add(a.subjectId),p.set(a.invariant,s)}return[...p.values()].sort((a,i)=>i.violations.length-a.violations.length).map(a=>({invariant:a.invariant,label:a.label,violations:a.violations,records:[...a.records]}))}var Ye=6;function Je(e,n,o,p){let a=ae(e,n);if(!a)return;let i=ne(e,n),s=g=>{if(a.done!==void 0&&g[a.done]===!0)return!0;if(!i)return!1;let u=i.values.indexOf(String(g[i.field]));return u>=0&&i.tiers[u]==="done"},c=0,S=0;for(let g of o){let u=q(Z(g,a.field,p));if(!u||s(g))continue;let w=ie(p,u);a.due&&w<0?c++:w>=0&&w<=Ye&&S++}if(!(c===0&&S===0))return{field:a.field,due:a.due,overdue:c,soon:S}}function L(e,n){return new Date(Date.parse(`${e.slice(0,10)}T00:00:00Z`)+n*864e5).toISOString().slice(0,10)}function oe(e,n,o){return n==="overdue"?[{key:e.field,value:`before:${o}`}]:[{key:e.field,value:`after:${L(o,-1)}`},{key:e.field,value:`before:${L(o,Ye+1)}`}]}function Qe(e,n,o,p){let a=new Set,i=new Set;for(let s of e)if(!(s.at<=o))for(let c of s.primitives)c.op==="add-node"&&c.node?.kind===n?a.add(c.node.id):(c.op==="patch-node"||c.op==="splice-text")&&c.id!==void 0&&p(c.id)===n&&i.add(c.id);for(let s of a)i.delete(s);return{added:[...a].filter(s=>p(s)===n).length,changed:[...i].filter(s=>p(s)===n).length}}var t=Q(we(),1),Xe="as",ct=(e,n)=>`graview:kind-seen:${e}:${n}`;function gt(e){try{return localStorage.getItem(e)}catch{return null}}function ut(e,n){try{localStorage.setItem(e,n)}catch{}}var ft=(e,n)=>({...ge(fe(e,!1),n),relation:null});function Yt({kind:e,members:n,flagged:o=[],label:p,retired:a=0}){let{store:i,brand:s,principal:c,views:S,view:g}=V(),{go:u}=Y(),w=X(),l=i.schema,r=l.tryDefinition(e),y=p??pe(l,e),h=i.today()??se(),m=n,b=(0,f.useId)(),A=(0,f.useMemo)(()=>je(l,e,m,h),[l,e,m,h]),x=g.within?.[Xe]==="table"?{shape:"table"}:A,k=Te(g),C=x.shape==="table"&&!k.sort?ze(l,e):void 0,v=C?{...k,sort:C}:k,R=(0,f.useMemo)(()=>new Set(o),[o]),T=(0,f.useMemo)(()=>$e(m,v,{schema:l,graph:i.graph,flagged:R,today:h}),[m,v,l,i,R,h,w]),I=(0,f.useMemo)(()=>Ne(l,Se(l,e)),[l,e]),M=S.arrangement?.()?.lists?.[e]?.filters,K=$=>u(Oe(g,$)),B=(0,f.useMemo)(()=>({name:s?.name??"app",schema:l,...i.policy?{policy:i.policy}:{}}),[s,l,i]),H=JSON.stringify(He(e,x,v)),P=(0,f.useMemo)(()=>{let $=Re(JSON.parse(H),{app:B,sight:Ce(B,c)});return Ae($)?void 0:$},[H,B,c]),W=x.shape!=="table"&&P!==void 0;return(0,t.jsxs)("section",{"aria-labelledby":b,className:"graview-kind-stop","data-testid":"kind-stop","data-graview-kind-stop":e,"data-graview-shape":x.shape,children:[(0,t.jsx)("style",{children:St}),(0,t.jsx)(wt,{kind:e,plural:y,count:m.length,headingId:b,description:r?.description}),(0,t.jsx)(ht,{kind:e,plural:y,members:m,today:h,arrangement:v,onArrange:K}),(m.length>1||a>0)&&!W?(0,t.jsx)(Pe,{schema:l,graph:i.graph,kind:e,arrangement:v,onChange:K,offers:I,...M?{filters:M}:{},kept:{shown:T.nodes.length,of:m.length},testId:"kind-arrange",chips:{nodes:m,flagged:R,today:h},...a>0?{past:{count:a,widen:()=>u(Ee(g,!0))}}:{}}):null,m.length>0?(0,t.jsx)(yt,{derived:A,shape:x,draft:P}):null,(0,t.jsx)("div",{className:"graview-kind-stop-body","data-testid":"kind-stop-body",children:m.length===0?(0,t.jsx)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-empty",children:"Nothing here yet."}):W?(0,t.jsx)(kt,{draft:P,nodes:m}):T.nodes.length===0?(0,t.jsxs)("p",{className:"graview-kind-stop-empty","data-testid":"kind-stop-none-kept",children:["None of the ",D(m.length)," ",y.toLowerCase()," ",v.query?`says \u201C${v.query}\u201D`:"is kept by these filters","."," ",(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link",onClick:()=>K({}),children:"Show them all"})]}):(0,t.jsx)(xt,{kind:e,nodes:T.nodes,groups:T.grouped?T.groups.map($=>({key:$.key,label:$.label,nodes:$.nodes})):void 0,flagged:R,plural:y,arrangement:v})})]})}function wt({kind:e,plural:n,count:o,headingId:p,description:a}){let{store:i,setSelection:s,setMenuAt:c}=V(),S=(0,f.useMemo)(()=>({about:[U(e)]}),[e]),{affordances:g}=Me(S),{apply:u,preview:w}=Le(),l=(0,f.useMemo)(()=>{let x=k=>i.allMutations().find(C=>C.name===k.mutation)?.creates?.includes(e)??!1;return g.find(k=>!k.destructive&&!k.setsAside&&x(k))},[g,i,e]),[r,y]=(0,f.useState)(!1),[h,m]=(0,f.useState)(null),b=(0,f.useRef)(null),A=(0,f.useRef)(null);(0,f.useEffect)(()=>{let x=A.current;!x||x.closest('[data-testid="kind-stop"]')?.contains(document.activeElement)||x.focus({preventScroll:!0})},[e]);let O=(x,k)=>{try{w(x,k),u(x,k),m(null),y(!1),requestAnimationFrame(()=>b.current?.focus())}catch(C){return m(be(i.schema,i.allMutations(),C)),[]}};return(0,t.jsxs)("header",{className:"graview-kind-stop-head",children:[(0,t.jsxs)("div",{className:"graview-kind-stop-title",children:[(0,t.jsx)("h2",{id:p,ref:A,tabIndex:-1,"data-testid":"kind-stop-title",children:n}),(0,t.jsxs)("p",{"data-testid":"kind-stop-count",children:[le(i.schema,e,o),a?` \xB7 ${a}`:""]})]}),(0,t.jsxs)("div",{className:"graview-kind-stop-acts",children:[l?(0,t.jsx)("button",{ref:b,type:"button",className:"graview-kind-stop-primary","data-testid":"kind-stop-primary","data-affordance":l.id,"aria-expanded":l.open.length>0?r:void 0,onClick:()=>{m(null),l.open.length===0?O(l):y(x=>!x)},children:l.label}):null,(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-quiet","data-testid":"kind-stop-acts","aria-haspopup":"menu","aria-label":`What can be done with the ${n.toLowerCase()}`,onClick:x=>{let k=x.currentTarget.getBoundingClientRect();s([U(e)]),c({x:Math.round(k.left),y:Math.round(k.bottom+4),on:U(e)})},children:"Acts\u2026"})]}),r&&l?(0,t.jsx)("div",{className:"graview-kind-stop-ask","data-testid":"kind-stop-ask","aria-label":l.label,role:"group",children:(0,t.jsx)(xe,{affordance:l,onApply:x=>O(l,x),onCancel:()=>{y(!1),b.current?.focus()}})}):null,h?(0,t.jsx)("p",{role:"alert",className:"graview-kind-stop-failed","data-testid":"kind-stop-failed",children:h}):null]})}var vt=J.part((e,n)=>(0,t.jsx)(e.ProblemRows,{...n}),{what:"The problems",as:"li"});function ht({kind:e,plural:n,members:o,today:p,arrangement:a,onArrange:i}){let{store:s,brand:c,setSelection:S}=V(),g=s.schema,u=ee(),w=(0,f.useMemo)(()=>new Set(o.map(v=>v.id)),[o]),l=(0,f.useMemo)(()=>Ue(u,w,v=>s.allInvariants().find(R=>R.name===v)?.label),[u,w,s]),r=(0,f.useMemo)(()=>Je(g,e,o,p),[g,e,o,p]),y=ct(De(c,g),e),[h]=(0,f.useState)(()=>gt(y));(0,f.useEffect)(()=>()=>ut(y,new Date().toISOString()),[y]);let m=X(),b=(0,f.useMemo)(()=>h?Qe(s.log.all(),e,h,v=>s.graph.getNode(v)?.kind):null,[h,s,e,m]),[A,O]=(0,f.useState)(null),x=v=>i({...a,filter:[...(a.filter??[]).filter(R=>!v?.some(T=>T.key===R.key)),...v??[]]}),k=l.reduce((v,R)=>v+R.violations.length,0),C=[];if(r&&(r.overdue>0||r.soon>0)){let v=r.field;C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-dates",children:[r.overdue>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact","data-tone":"warn",onClick:()=>x(oe(r,"overdue",p)),"aria-label":`${D(r.overdue)} overdue \u2014 show only these`,children:[D(r.overdue)," overdue"]}):null,r.soon>0?(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-fact",onClick:()=>x(oe(r,"soon",p)),"aria-label":`${D(r.soon)} in the next 7 days \u2014 show only these`,children:[D(r.soon)," ",r.due?"due":""," in the next 7 days"]}):null,(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" by ",ce(g.tryDefinition(e),v).toLowerCase()]})]},"dates"))}if(l.length>0&&C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-problems","data-graview-problems":k,children:[(0,t.jsxs)("span",{className:"graview-kind-stop-warn",children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0 "}),k===1?"1 problem":`${D(k)} problems`]}),(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:[" in ",n.toLowerCase(),":"]}),(0,t.jsx)("ul",{className:"graview-kind-stop-rules",children:l.map(v=>(0,t.jsx)(mt,{group:v,open:A===v.invariant,onToggle:()=>O(R=>R===v.invariant?null:v.invariant),onPick:R=>S([R])},v.invariant))}),(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-only-problems",onClick:()=>x([{key:"is",value:"flagged"}]),children:["Show only the ",n.toLowerCase()," with a problem"]})]},"problems")),b&&(b.added>0||b.changed>0)){let v=[b.added>0?`${D(b.added)} added`:"",b.changed>0?`${D(b.changed)} changed`:""].filter(Boolean);C.push((0,t.jsxs)("li",{"data-testid":"kind-stop-since",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["Since you last looked (",de(h.slice(0,10)),"):"]})," ",v.join(", ")]},"since"))}return C.length===0?null:(0,t.jsx)("ul",{className:"graview-kind-stop-going-on","aria-label":`What is going on in the ${n.toLowerCase()}`,"data-testid":"kind-stop-going-on",children:C})}function mt({group:e,open:n,onToggle:o,onPick:p}){let a=(0,f.useId)();return(0,t.jsxs)("li",{"data-graview-rule":e.invariant,children:[(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-rule","aria-expanded":n,"aria-controls":a,onClick:o,onPointerEnter:J.prefetch,onFocus:J.prefetch,children:[(0,t.jsx)("span",{"aria-hidden":"true",className:"graview-kind-stop-chevron","data-open":n||void 0,children:"\u203A"}),e.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(e.violations.length)]})]}),n?(0,t.jsx)("ol",{id:a,className:"graview-kind-stop-problem-rows","data-testid":"kind-stop-problem-rows",children:(0,t.jsx)(f.Suspense,{fallback:null,children:(0,t.jsx)(vt,{violations:e.violations,pick:i=>{let s=i.subjectId??e.records[0]??i.nodeIds[0];s!==void 0&&p(s)}})})}):null]})}var bt={board:"Board",calendar:"Calendar",table:"Table"};function yt({derived:e,shape:n,draft:o}){let{view:p}=V(),{go:a}=Y(),{keep:i}=qe(Be()),[s,c]=(0,f.useState)(!1),S=e.shape==="table"?[]:[e.shape,"table"];return(0,t.jsxs)("div",{className:"graview-kind-stop-shape","data-testid":"kind-stop-shape",children:[S.length>0?(0,t.jsx)("span",{role:"group","aria-label":"Show as",className:"graview-kind-stop-switch",children:S.map(g=>(0,t.jsx)("button",{type:"button","aria-pressed":n.shape===g,"data-testid":`kind-stop-as-${g}`,onClick:()=>a(ue(p,Xe,g===e.shape?null:g)),children:bt[g]},g))}):null,(0,t.jsx)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-derived",children:o?`${o.said.replace(/\.$/,"")}, derived from the declaration`:"Derived from the declaration"}),o?(0,t.jsx)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-keep",disabled:s,title:`Keep \u201C${o.title}\u201D as a lens: a place of its own`,onClick:()=>{c(!0),i(o).finally(()=>c(!1))},children:"Keep as a lens"}):null]})}function kt({draft:e,nodes:n}){let o=Ve(e.drawn);return(0,t.jsx)("div",{className:"graview-kind-stop-lens","data-graview-draft":e.lens.name,children:(0,t.jsx)(ve,{mode:"scene",children:(0,t.jsx)(ke,{kind:e.kind,view:e.title,children:(0,t.jsx)(o,{nodes:n,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})}function xt({kind:e,nodes:n,groups:o,flagged:p,plural:a,arrangement:i}){let{store:s,views:c,view:S,selection:g,setSelection:u,setMenuAt:w,principal:l}=V(),{go:r}=Y(),y=s.schema,h=s.graph,m=(0,f.useMemo)(()=>(o?o.flatMap(d=>d.nodes):n).map(d=>d.id),[n,o]),b=Ie(m),A=(0,f.useMemo)(()=>s.permittedMutations(l).some(d=>{let N=d.subject?.kinds;return N!==void 0&&(N==="*"||N.includes(e))}),[s,l,e]),O=(0,f.useRef)(null),x=d=>{b.choose(d),requestAnimationFrame(()=>{let N=b.list.current;((d[0]===void 0?null:N?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??N)?.focus({preventScroll:!0})})},k=b.chosen.length,C=c.lookup(e,{cardinality:"one",fidelity:"glyph"}),v=C!==void 0&&!he(C)?C:void 0,R=d=>g.includes(d),T=ee(),I=(0,f.useMemo)(()=>We(y,e,n,h),[y,e,n,h]),[M,K]=(0,f.useState)(z);(0,f.useEffect)(()=>K(z),[i.query,i.filter?.length,i.sort?.by,i.group?.by]);let B=y.tryDefinition(e),H=d=>T.filter(N=>N.nodeIds.includes(d)||N.subjectId===d).map(N=>N.message),P=i.sort?.by,W=`${a}${i.sort?`, in order of ${I.find(d=>d.key===P)?.label.toLowerCase()??P}`:""}`,$=M,et=d=>{let N=G(B,d),F=p.has(d.id)?H(d.id):[];return(0,t.jsxs)("tr",{"data-graview-pick":d.id,tabIndex:-1,"data-graview-record":d.id,"data-flagged":F.length>0||void 0,...A?{"data-graview-choose":d.id}:{},children:[A?(0,t.jsx)("td",{className:"graview-choose-at",children:(0,t.jsx)("input",{...b.boxProps(d.id,N),onPointerEnter:j,onFocus:j})}):null,(0,t.jsxs)("th",{scope:"row",className:"graview-kind-stop-name",children:[v?(0,t.jsx)("div",{"data-graview-pick":d.id,className:"graview-kind-stop-own-row",children:(0,t.jsx)(v,{node:d,cardinality:"one",fidelity:"glyph",mode:"scene",selected:R(d.id),...F.length>0?{flagged:[d.id]}:{}})}):(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-go",title:`Go to ${N}`,onClick:()=>r(ft(S,d.id)),children:N}),F.length>0?(0,t.jsxs)("span",{className:"graview-kind-stop-flag",title:F.join(" \xB7 "),children:[(0,t.jsx)("span",{"aria-hidden":"true",children:"\u26A0"}),(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:`Problem: ${F.join(". ")}`})]}):null]}),I.map(_=>{let E=Ze(y,d,_,h);return(0,t.jsx)("td",{"data-label":_.label,"data-short":E.text.length>0&&E.text.length<=14||void 0,"data-empty":E.text?void 0:"",...E.title?{title:E.title}:{},children:E.text?(0,t.jsx)("span",{children:E.text}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("b",{"aria-hidden":"true",children:"\u2014"}),(0,t.jsx)("i",{className:"graview-kind-stop-hidden",children:"none"})]})},_.key)}),(0,t.jsx)("td",{className:"graview-kind-stop-row-acts",children:(0,t.jsx)("button",{type:"button","data-testid":"kind-stop-row-acts","aria-haspopup":"menu","aria-label":`What can be done with ${N}`,onClick:_=>{let E=_.currentTarget.getBoundingClientRect();u([d.id]),w({x:Math.round(E.left),y:Math.round(E.bottom+4),on:d.id})},children:(0,t.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})})})]},d.id)},re=d=>{let N=d.slice(0,Math.max(0,$));return $-=N.length,N.map(et)};return(0,t.jsxs)("div",{className:"graview-kind-stop-table-at",...A?{...b.listProps,ref:d=>{O.current=d,b.list.current=d},tabIndex:-1,role:"group","aria-label":k>0?`${a}, ${k} chosen`:a,"data-graview-choosable":""}:{},children:[A?(0,t.jsx)("style",{children:Ke}):null,(0,t.jsxs)("table",{className:"graview-kind-stop-table","data-testid":"kind-stop-table",children:[(0,t.jsx)("caption",{className:"graview-kind-stop-hidden",children:W}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[A?(0,t.jsx)("td",{className:"graview-choose-at graview-choose-all",children:(0,t.jsx)("input",{type:"checkbox",className:"graview-choose-box","data-testid":"kind-stop-choose-all","aria-label":`Choose all ${D(n.length)} ${a.toLowerCase()}`,checked:k>0&&k===n.length,ref:d=>{d&&(d.indeterminate=k>0&&k<n.length)},onPointerEnter:j,onFocus:j,onChange:()=>k===n.length?b.clear():b.choose(m)})}):null,(0,t.jsx)("th",{scope:"col","aria-sort":P==="label"?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:"Name"}),I.map(d=>(0,t.jsx)("th",{scope:"col","aria-sort":d.about==="field"&&d.key===P?i.sort?.direction==="desc"?"descending":"ascending":void 0,children:d.label},d.key)),(0,t.jsx)("th",{scope:"col",children:(0,t.jsx)("span",{className:"graview-kind-stop-hidden",children:"Acts"})})]})}),o?o.map(d=>$<=0?null:(0,t.jsxs)("tbody",{"data-graview-group":d.key,children:[(0,t.jsx)("tr",{className:"graview-kind-stop-group",children:(0,t.jsxs)("th",{scope:"rowgroup",colSpan:I.length+(A?3:2),children:[d.label," ",(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text",children:["\xB7 ",D(d.nodes.length)]})]})}),re(d.nodes)]},d.key||"-")):(0,t.jsx)("tbody",{children:re(n)})]}),A?(0,t.jsx)(Fe,{store:s,chosen:b.chosen,principal:l,anchor:()=>O.current?.closest('[data-testid="kind-stop"]')??null,of:m.length,onChooseAll:()=>b.choose(m),onClear:b.clear,onActed:x}):null,n.length>M?(0,t.jsxs)("p",{className:"graview-kind-stop-more",children:[(0,t.jsxs)("span",{className:"graview-kind-stop-quiet-text","data-testid":"kind-stop-shown",children:[D(M)," of ",D(n.length)," shown"]})," ",(0,t.jsxs)("button",{type:"button",className:"graview-kind-stop-link","data-testid":"kind-stop-more",onClick:()=>K(d=>d+z),children:["Show ",D(Math.min(z,n.length-M))," more"]})]}):null]})}var St=`
|
|
2
2
|
.graview-kind-stop{container-type:inline-size;box-sizing:border-box;height:100%;min-height:0;display:flex;flex-direction:column;gap:10px;padding:16px 18px 12px;border:1px solid var(--graview-edge);border-radius:var(--graview-radius,12px);background:var(--graview-panel);color:var(--graview-ink);box-shadow:var(--graview-lift-low);overflow:auto;overscroll-behavior:contain}
|
|
3
3
|
[data-graview-map-panel] .graview-kind-stop{height:auto;padding:4px 6px 12px;border:0;box-shadow:none;background:none;overflow:visible}
|
|
4
4
|
.graview-kind-stop :focus-visible{outline:2px solid var(--graview-accent);outline-offset:2px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Ce,d as $e,i as ae}from"./chunk.LUIRQ5UF.js";import{e as Te}from"./chunk.N33WUCAN.js";import{$c as ve,Bd as We,Cd as Me,K as ke,Wd as je,Xc as oe,Ya as Se,aa as M,ab as G,ad as Oe,ca as xe,da as W,fa as _,ga as z,ha as Ae,ja as we,ka as Ne,qc as ie,wd as Re,zd as De}from"./chunk.DIFR37EZ.js";function se(n,e){return n.display?.labels?.[e]??W(e)}function de(n){let e=ae(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,i=n.tryDefinition(e);for(let[r,a]of Object.entries(i?.edges??{}))t.set(r,{key:r,label:a.description?M(a.description):W(r),about:"edge",far:a.to==="*"?[...n.kinds]:[...a.to]});for(let r of n.definitions)if(r.kind!==e)for(let[a,s]of Object.entries(r.edges??{}))t.has(a)||s.to!=="*"&&!s.to.includes(e)||t.set(a,{key:a,label:s.inverse?M(s.inverse):W(a),about:"edge",far:[r.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let i=t.retired.map(String);return e.some(r=>r.key===t.field&&i.includes(r.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let i=new Set(t.display?.hide??[]),r=t.fields.shape??{},a=[{key:"label",label:"Name",about:"label",type:"text"}],s=[],f=[];for(let[y,x]of Object.entries(r)){if(y==="id"||y==="kind"||y==="label"||i.has(y))continue;let p=de(x);if(!p)continue;let O=se(t,y),w=p==="choice"?Le(x):p==="boolean"?["true","false"]:void 0,N={key:y,label:O,about:"field",type:p,...w?{options:w}:{}};a.push(N),s.push(N),(p==="boolean"||p==="choice")&&f.push(N),p==="date"&&f.push({...N,buckets:["day","week","month","year","decade"]})}for(let y of Je(n,e))a.push(y),s.push(y),f.push(y);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};s.push(l);let u=t.fieldRoles?.order,g=u&&(u in r||u==="label")?{by:u,direction:"asc"}:void 0;return{kind:e,sorts:a,filters:s,groups:f,...g?{natural:g}:{}}}function vn(n,e){let t=[];for(let r of e.filters){let a=r.about==="edge"&&r.far?.length===1?n.tryDefinition(r.far[0]):void 0;if(!(!a||a.kind===e.kind))for(let[s,f]of Object.entries(a.fields.shape??{}))de(f)!=="choice"||a.display?.hide?.includes(s)||t.push({key:`${r.key}.${s}`,label:`${r.label} \xB7 ${se(a,s)}`,about:"via",type:"choice",options:Le(f),far:[a.kind]})}if(t.length===0)return e;let i=e.filters.filter(r=>r.about!=="is");return{...e,filters:[...i,...t,...e.filters.filter(r=>r.about==="is")]}}function On(n,e){let t=n.tryDefinition(e.kind),i=Object.entries(t?.computed??{});if(!t||i.length===0)return e;let r=i.filter(([a])=>!e.sorts.some(s=>s.key===a)).map(([a,s])=>({key:a,label:(typeof s=="object"?s.label:void 0)??se(t,a),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...r]}}function Le(n){let e=ae(n);return e.type==="choice"?e.options:[]}var Ie=n=>n,Pe=n=>n;function en(n,e,t){let i=new Map;for(let r of[...n.out(e,t),...n.in(e,t)])i.set(r.id,r);return[...i.values()]}function le(n,e,t){let i=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return _(i,Pe(e),n.today);case"past":return!_(i,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let r=i?.fields.shape??{};if(t.key in r){let l=Se(Ie(e),t.key,n.today??ke()),u=de(r[t.key]);if(u==="date"){let[g,y]=t.value.split(":");if(typeof l!="string"||!y)return!1;let x=l.slice(0,10);return g==="before"?x<y:g==="after"?x>y:x===y}if(u==="boolean")return String(l)===t.value;if(u==="number"){let g=t.value.lastIndexOf(":"),y=g>0?t.value.slice(0,g):"",x=Number(t.value.slice(g+1));if(y==="at-most"||y==="at-least")return typeof l!="number"||!Number.isFinite(x)?!1:y==="at-most"?l<=x:l>=x}return String(l)===t.value}let[a,s]=t.key.split("."),f=en(n.graph,e.id,a);return s?f.some(l=>String(Ie(l)[s])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var nn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var U=new Map,tn=5e4;function $(n){let e=U.get(n);if(e===void 0){U.size>=tn&&U.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},U.set(n,e)}return e}var T=n=>[...$(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:i}=$(n),r=e.join("");if(t.length===0)return;if(t===r)return"exact";if(e.every(s=>i.some(f=>f.startsWith(s))))return t.startsWith(r)?"prefix":e.every(s=>i.includes(s))?"word":"part"}function q(n,e,t=48){let i=n.replace(/\s+/g," ").trim();if(i.length<=t)return i;let r=e[0],a=i.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),s=r?a.search(new RegExp(`(^|[^\\p{L}\\p{N}])${rn(r)}`,"u")):-1,f=s<0?0:s+(a[s]&&/[\p{L}\p{N}]/u.test(a[s])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let g=i.lastIndexOf(" ",l);l=g<0?0:g+1}let u=Math.min(i.length,l+t);if(u<i.length){let g=i.indexOf(" ",u);u=g<0||g-u>16?u:g}return`${l>0?"\u2026":""}${i.slice(l,u).trim()}${u<i.length?"\u2026":""}`}var rn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),on=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function an(n){let e=[],t=[];for(let i of n.trim().split(/\s+/).filter(Boolean)){let r=on.exec(i);r?t.push({key:r[1],value:r[2]}):e.push(i)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function Q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let i=sn(n,e);return Ee.set(e,{definition:n,texts:i}),i}function sn(n,e){let t=z(n,e),i=[{field:"label",reading:"Name",text:t}];for(let r of $e(e,n,{limit:Number.POSITIVE_INFINITY}))r.key==="label"||r.value===t||typeof e[r.key]!="boolean"&&i.push({field:r.key,reading:r.label,text:r.markdown?Te(r.value):r.value});return i}var I={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let i=[],r=Array.from({length:e.length+1},(a,s)=>s);for(let a=1;a<=n.length;a++){let s=[a],f=a;for(let l=1;l<=e.length;l++){let u=Math.min(r[l]+1,s[l-1]+1,r[l-1]+(n[a-1]===e[l-1]?0:1));a>1&&l>1&&n[a-1]===e[l-2]&&n[a-2]===e[l-1]&&(u=Math.min(u,i[l-2]+1)),s[l]=u,u<f&&(f=u)}if(f>t)return t+1;i=r,r=s}return r[e.length]}var V=new Map;function dn(n,e){let t=V.get(n);t||(V.size>=64&&V.clear(),V.set(n,t=new Map));let i=t.get(e);return i===void 0&&(i=ln(n,e)??null,t.set(e,i)),i??void 0}function ln(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let i=n.length<4?0:n.length<=7?1:2;if(i!==0){if(He(n,e,i)<=i)return"spelling";if(n.length>=5){for(let r=n.length-i;r<=n.length+i;r++)if(r<e.length&&He(n,e.slice(0,r),i)<=i)return"spelling"}}}function cn(n,e){let t=e.length>1?e.filter(r=>!Ge.has(r)):e;if(t.length===0)return;let i;for(let r of t){let a;for(let s of n){for(let f of $(s.text).tokens){if(f.startsWith(r)){a={text:s,matched:f};break}let l=a?void 0:dn(r,f);l&&(a={text:s,matched:f,by:l})}if(a&&!a.by)break}if(!a)return;a.by&&!i&&(i={text:a.text,asked:r,matched:a.matched,by:a.by})}if(i)return{field:i.text.field,reading:i.text.reading,fragment:q(i.text.text,[i.matched]),strength:"near",asked:i.asked,matched:i.matched,by:i.by}}var fn=80;function gn(n,e,t){let i=T(e).filter(s=>!Ge.has(s)).join(" ")||e,r=t===void 0?[]:T(t),a=r.length>0&&n.find(s=>r.every(f=>$(s.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:a.field,reading:a.reading,fragment:q(a.text,r),strength:"near",asked:i,matched:(t??a.text).slice(0,fn),by:"meaning"}}function _e(n,e,t,i){let r=T(t);if(r.length===0)return;if(i){let p=Q(n,e),O=i.includes("label")||i.some(v=>typeof e[v]=="string"&&e[v]===p[0].text),w=p.filter((v,D)=>D===0?O:i.includes(v.field)),N=v=>D=>$(D.text).tokens.some(P=>P.startsWith(v));if(!r.every(v=>w.some(N(v))))return;let S=w.find(N(r[0]));return{field:S.field,reading:S.reading,fragment:q(S.text,r),strength:S.field==="label"?j(S.text,r)??"field":"field"}}let a=Q(n,e),[s,...f]=a,l=j(s.text,r);if(l)return{field:"label",reading:s.reading,fragment:q(s.text,r),strength:l};let u=p=>O=>$(O.text).tokens.some(w=>w.startsWith(p));if(!r.every(p=>a.some(u(p))))return;let g=T(s.text),y=r.find(p=>!g.some(O=>O.startsWith(p)))??r[0],x=f.find(u(y));return{field:x.field,reading:x.reading,fragment:q(x.text,[y]),strength:"field"}}var un=512,yn=64;function hn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-un),i=n[n.length-1].seq;for(let r of t){let a=Math.pow(.5,(i-r.seq)/yn);for(let s of r.writes)e.set(s,(e.get(s)??0)+a)}return e}var ge=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function pn(n,e,t){let i=n.tryDefinition(e),r=[{field:"plural",text:ge(i,e)},{field:"kind",text:W(e)},...i?.noun?[{field:"noun",text:i.noun}]:[],...(i?.aliases??[]).map(s=>({field:"alias",text:s}))],a;for(let s of r){let f=j(s.text,t);f&&(!a||I[f]<I[a.strength])&&(a={strength:f,...s})}return a}var mn,bn=(n,e)=>(mn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||bn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function Ln(n,e,t={}){let i=n.schema,r=an(e),a=T(r.words),s=t.principal??{kind:"human"},f=n.kindsKeptFrom(s),l=n.modules.disabledKinds,u=r.conditions.filter(o=>o.key==="kind").map(o=>o.value),g=r.conditions.filter(o=>o.key==="is").map(o=>o.value),y=g.includes("any")||g.includes("past"),x=g.includes("past")&&!g.includes("any")&&!g.includes("current"),p=g.includes("archived")?!0:t.archived??"all",O=(o,d)=>{let c=ce(d),h=i.tryDefinition(o);return ce(o)===c||ce(ge(h,o))===c},w=i.kinds.filter(o=>!f.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(u.length===0||u.some(d=>O(o,d)))),S=r.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:w.filter(d=>Be(i,d).filters.some(c=>c.key===o.key))})),v=S.filter(o=>o.key!=="is"),D=g.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),P={kinds:w,past:y},Qe={hits:[],words:r.words,conditions:S,searched:P,byKind:{},total:0,matched:[]};if(a.length===0&&v.length===0&&D.length===0)return Qe;let X=t.today,F=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??hn(n.log.all()),Y=new Set;for(let o of t.from??[]){Y.add(o);for(let d of n.graph.neighbors(o))Y.add(d.id)}let ue=ve(n,s)?Oe(n,s):void 0,J=oe.keptFrom?.(n,s)&&n.seenBy(s).graph,Z=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:i,graph:n.graph,flagged:F,...X?{today:X}:{}},R=[],B={},L=[],E=[],K=(o,d,c,h,m,b)=>{let A=z(c,o);B[d]=(B[d]??0)+1,R.push({hit:{about:"node",id:o.id,kind:d,label:A,why:m,current:h,flagged:F.has(o.id),address:Z(`${fe(c,d)}/${encodeURIComponent(o.id)}`),...b===void 0?{}:{near:!0},...G(o)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:I[m.strength],inKind:d===t.inKind?0:1,near:Y.has(o.id)?0:1,past:h?0:1,archived:G(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:F.has(o.id)?0:1,name:A,id:o.id})};for(let o of w){let d=i.tryDefinition(o),c=S.filter(m=>m.key!=="is"&&m.admittedBy.includes(o));if(a.length===0&&c.length===0&&D.length===0)continue;let h=Fe(d,c);for(let m of n.graph.nodesOfKind(o,{archived:p})){if(ue&&!ue(m.id))continue;let b=J?J.getNode(m.id):m;if(!b)continue;let A=_(d,b,X);if(!y&&!h&&!A){if(a.length>0&&g.length===0&&c.every(k=>le(ye,b,k))){let k=_e(d,b,r.words);k&&E.push({node:b,kind:o,definition:d,why:k})}continue}if(x&&A||!c.every(k=>le(ye,b,k))||g.includes("flagged")&&!F.has(b.id)||g.includes("clear")&&F.has(b.id))continue;let C=a.length>0?_e(d,b,r.words):c[0]?{field:c[0].key,reading:W(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${D[0]}`,strength:"field"};C?K(b,o,d,A,C):a.length>0&&L.push({node:b,kind:o,definition:d,current:A})}}let ee=o=>o.strength!=="field",ne=!1;if(E.length>0&&R.length===0){ne=!0;for(let o of E)K(o.node,o.kind,o.definition,!1,o.why)}else if(E.some(o=>ee(o.why))&&!R.some(o=>ee(o.hit.why))){ne=!0;for(let o of E)ee(o.why)&&K(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&a.length>0&&R.length<nn&&L.length>0,te=new Set;if(he)for(let o of L){let d=cn(Q(o.definition,o.node),a);d&&(te.add(o.node.id),K(o.node,o.kind,o.definition,o.current,d,d.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:I[o],re=(o,d,c,h)=>({hit:o,tier:Ve(d),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(a.length>0){for(let d of w){let c=pn(i,d,a);if(!c)continue;let h=Ne(i,d),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};R.push(re({about:"kind",kind:d,label:h,why:m,count:B[d]??0,address:Z(fe(i.tryDefinition(d),d))},c.strength,h,`kind:${d}`))}let o=t.places??[];for(let d of Re(o.filter(c=>w.includes(c.kind)))){if(d.across&&f.has(d.across))continue;let c=j(d.title,a);if(!c)continue;let h={field:"title",reading:"Title",fragment:d.title,strength:c},m=Me(d,o)?fe(i.tryDefinition(d.kind),d.kind).slice(1):void 0,b=Z(We(d.as,m));R.push(re({about:"place",kind:d.kind,title:d.title,as:d.as,why:h,address:b},c,d.title,`place:${d.kind}:${d.as}`))}for(let d of n.allInvariants()){let c=d.scope==="graph"?void 0:d.scope.kind;if(c&&!w.includes(c))continue;let h=d.label??W(d.name),m=j(h,a),b=m?void 0:j(W(d.name),a),A=m??b;if(!A)continue;let C={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:d.name,strength:A};R.push(re({about:"rule",name:d.name,label:h,...c?{kind:c}:{},why:C},A,h,`rule:${d.name}`))}}let pe=()=>{R.sort(qe);let o=t.limit??50,d=R.slice(0,o).map(k=>k.hit),c=d.flatMap(k=>k.about==="node"?[(J||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Ce(c,k=>i.tryDefinition(k)),m=d.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(B).reduce((k,Ye)=>k+Ye,0),A=R.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),C=t.subject&&w.includes(String(n.graph.getNode(t.subject)?.kind))?kn(n,t.subject,r.words,{principal:s}):[];return{hits:[...m,...C],words:r.words,conditions:S,searched:ne?{...P,past:!0}:P,byKind:{...B},total:b,matched:A}},H=pe(),me=t.rank;if(!he||!me)return H;let be=L.filter(o=>!te.has(o.node.id)).map(({node:o,kind:d,definition:c})=>({id:o.id,kind:d,label:z(c,o),texts:Q(c,o)}));if(be.length===0)return H;let Xe=(async()=>{let o;try{o=await me(r.words,be)}catch{return H}let d=new Map(L.filter(h=>!te.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(o)?o:[]){let A=d.get(h);!A||!(m>0)||(d.delete(h),c=!0,K(A.node,A.kind,A.definition,A.current,gn(Q(A.definition,A.node),r.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?pe():H})();return{...H,later:Xe}}function kn(n,e,t,i={}){let r=i.principal??{kind:"human"},a=(oe.keptFrom?.(n,r)?n.seenBy(r):n).graph.getNode(e);if(!a)return[];if(n.kindsKeptFrom(r).has(a.kind))return[];let s=T(t),f=z(n.schema.tryDefinition(a.kind),a),l=[];for(let g of n.allMutations()){let y=g.subject;if(!y||y.kinds!=="*"&&!y.kinds.includes(a.kind))continue;let x=g.derived?.act;if((x==="archive"||x==="merge")&&G(a)||x==="unarchive"&&!G(a)||x==="leave-alone"&&ie(a)||x==="allow-tidying"&&!ie(a)||!n.permits({name:g.name,args:{[y.arg]:a.id}},r).ok)continue;let p=Ae(g),O=T(p),w=s.filter(v=>O.some(D=>D.startsWith(v))),N=w.length>0?j(p,w):void 0,S=N?{field:"title",reading:"Act",fragment:p,strength:N}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:g.name,title:p,subject:a.id,why:S,destructive:g.destructive===!0},tier:N?I[N]:I.field+1,inKind:0,near:0,past:g.destructive?1:0,touched:0,flagged:g.pinned?0:1,name:p,id:`act:${g.name}`})}l.sort(qe);let u=l.map(g=>g.hit);return i.limit===void 0?u:u.slice(0,i.limit)}function En(n,e){let t=e.kinds.map((a,s)=>{let f=ge(n.tryDefinition(a),a);return s===0?f:f.toLowerCase()}),i=xe(t)||"Nothing";return e.kinds.some(a=>n.tryDefinition(a)?.lifecycle)?e.past?`${M(i)}, past ones included.`:`${M(i)}, current ones; add is:any for past ones.`:`${M(i)}.`}export{se as a,de as b,Je as c,Fe as d,Be as e,vn as f,On as g,Le as h,Ie as i,Pe as j,en as k,le as l,ce as m,an as n,_e as o,hn as p,Ln as q,kn as r,En as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.
|
|
1
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.JNNBHD4Z.js";import"./chunk.PXQVXBNG.js";import"./chunk.B3WVCSW5.js";import"./chunk.DIFR37EZ.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as a,l as o}from"./chunk.DSLGMCB6.js";import"./chunk.IX63LTRQ.js";import"./chunk.I636CZE4.js";import"./chunk.TVURUMU4.js";import"./chunk.EZ4TZUMM.js";import"./chunk.47T3KUAA.js";import"./chunk.NZDWXX6H.js";import"./chunk.YS5U3DUX.js";import"./chunk.SAJLIA5M.js";import"./chunk.LWRXCO2Z.js";import"./chunk.I2NI7CT7.js";import"./chunk.LHIT3EZD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.7INWDFNG.js";import"./chunk.FPGU43SC.js";import"./chunk.V6FUYRZI.js";import"./chunk.5BPRGXIW.js";import"./chunk.BZEJM2PY.js";import"./chunk.CMLNBJZG.js";import"./chunk.GZHZLJBF.js";import"./chunk.QPL3OXW3.js";import"./chunk.OJGHDWI6.js";import"./chunk.FRERJWZJ.js";import"./chunk.RQX4CQJN.js";import"./chunk.LUIRQ5UF.js";import"./chunk.N33WUCAN.js";import"./chunk.JQFIZRAZ.js";import"./chunk.LKJ6FD6Y.js";import{ta as n}from"./chunk.DBMZ3AQB.js";import"./chunk.SDO3U72B.js";import"./chunk.DIFR37EZ.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function p(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{p as frameworkViews};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk.BPEUHOKH.js";import"./chunk.UGOKORIF.js";import"./chunk.4BRM5SGO.js";import"./chunk.DJ4A76SX.js";import"./chunk.VDS3IOTK.js";import"./chunk.SAJLIA5M.js";import"./chunk.I2NI7CT7.js";import"./chunk.MBLFZF5R.js";import{b as n}from"./chunk.MAZFQIL5.js";import"./chunk.JBSW7ZNH.js";import"./chunk.GZHZLJBF.js";import"./chunk.QPL3OXW3.js";import"./chunk.OJGHDWI6.js";import"./chunk.FRERJWZJ.js";import"./chunk.RQX4CQJN.js";import"./chunk.LUIRQ5UF.js";import"./chunk.N33WUCAN.js";import"./chunk.JQFIZRAZ.js";import"./chunk.LKJ6FD6Y.js";import{T as i}from"./chunk.DBMZ3AQB.js";import"./chunk.SDO3U72B.js";import"./chunk.DIFR37EZ.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Ae=globalThis,no=Ae.addEventListener,ro=Ae.removeEventListener,oo=Ae.postMessage,io=globalThis.queueMicrotask,mn=globalThis.performance,so=mn?mn.now.bind(mn):Date.now,_e={listen:t=>no.call(Ae,"message",t),unlisten:t=>ro.call(Ae,"message",t),post:t=>oo.call(Ae,t),microtask:t=>io.call(globalThis,t),now:()=>so()};var v=Symbol("name"),me=Symbol("prefix"),fe=Symbol("value"),S=Symbol("ns"),q=Symbol("owner"),I=Symbol("owner_document"),re=Symbol("attributes"),M=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),fn=Symbol("isTrusted"),ke=Symbol("path"),Pe=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),se=Symbol("content"),D=Symbol("hooks"),ft=Symbol("extensions"),we=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ie=Symbol("create_element"),$n=0,X=1,Me=2,De=3,Le=8,xe=9,Kn=10,he=11,A="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Zn="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Jn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,er=/[\\0\\t\\n\\f\\r />=]/u,ao=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function tr(t){Jn.test(t)||hn(t)}function pn(t){(t===""||er.test(t))&&hn(t)}function ht(t,e,n){let r=ae(t),o=String(e),i=o.indexOf(":"),s=i<0?null:o.slice(0,i),a=i<0?o:o.slice(i+1);if((s!=null&&(s===""||ao.test(s))||(n==="element"?!Jn.test(a):a===""||er.test(a)))&&hn(o),s!=null&&r==null)throw P(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(s==="xml"&&r!==Zn)throw P("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||s==="xmlns")&&r!==$e)throw P("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&s!=="xmlns")throw P("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:s,localName:a}}function hn(t){throw P(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,nr=2,gn=3,lo=typeof performance>"u"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=nr;static BUBBLING_PHASE=gn;timeStamp=lo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[ke]=[];[Pe]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,fn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[fn]}composedPath(){return[...this[ke]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Pe]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let i of[...o]){if(!o.has(i)||i.signal?.aborted)continue;t.eventPhase=t.target===e?nr:n,t.currentTarget=e;let s=i.normalizedListener;try{typeof s=="object"?s.handleEvent(t):s.call(e,t)}catch(a){setTimeout(co,0,a)}if(t[Pe])break}}function co(t){throw t}var Ke=[],bt=new WeakMap;function Et(t,e){let n=bt.get(t);n?n.push(e):bt.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{rr(e)}catch{}throw r}return Ke.pop(),rr(e),n}function rr(t){let e,n=!1;for(let r of t){let o=bt.get(r);if(o){for(;o.length>0;){let i=o.shift();try{i()}catch(s){n||(e=s,n=!0)}}bt.delete(r)}}if(n)throw e}var Nt=[],Ze=[],bn=!1;function ve(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!bn){bn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,i]=Nt[r];i&&Ze.splice(Ze.indexOf(i),1);try{o()}catch(s){n||(e=s,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,bn=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Je]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,i=typeof r=="object"&&r.once===!0,s=typeof r=="object"?r.signal:void 0;if(s?.aborted)return;let a=En(o),c=this[Je];c||(c=new Map,this[Je]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[a];if(m||(m=new Map,u[a]=m),m.has(n))return;let h=this,g={type:e,listener:n,capture:o,once:i,normalizedListener:n,signal:s};(i||s)&&(g.normalizedListener=function(...C){if(g.signal?.aborted){Tt(h,g);return}return g.once&&Tt(h,g),typeof g.listener=="object"?g.listener.handleEvent(...C):g.listener.call(this,...C)});let y=this[Te];y||(y=new Map,this[Te]=y);let O=y.get(e);O||(O={},y.set(e,O));let E=O[a];if(E||(E=new Set,O[a]=E),m.set(n,g),E.add(g),s){let N=()=>{Tt(h,g)};g.abortListener=N,s.addEventListener("abort",N,{once:!0})}this[I]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return uo.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw P("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[ke]=n;for(let i=n.length;i--;)if(yn(e,n[i],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let i=0;i<o.length;i++)if(yn(e,o[i],gn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Pe]=!1,e.eventPhase=gt,e.currentTarget=null,e[ke]=[]}}};function uo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=En(!!r),i=this[Je]?.get(t)?.[o]?.get(e);i&&Tt(this,i)}function En(t){return t?"capture":"bubble"}function Tt(t,e){let n=En(e.capture),r=t[Je],o=r?.get(e.type);if(!o)return;let i=o[n];if(!i||i.get(e.listener)!==e)return;i.delete(e.listener),i.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let s=t[Te],a=s?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&s?.delete(e.type),t[I]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,or=1,wn=2,xn=3,nt=4,ir=0,sr=1,vt=2,St=3,ar=4,Tn=5,lr=6,cr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function mo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){i==="\\\\"?o++:i===r&&(r=null);continue}if(i===\'"\'||i==="\'")r=i;else if(i==="(")n++;else if(i===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw P(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function Ot(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>(r=i,!1)),r}function Rt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>{r.push(i)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,matchers:[]},o=[r],i=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,s=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");s===""&&W(t);let a=0,c;for(;c=i.exec(s);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=or:c[1]==="+"?r.combinator=xn:c[1]==="~"?r.combinator=wn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let h,g=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let y=c[5],O=y?.[0];if(c[3]==null&&(O===\'"\'||O==="\'")){let E=c[0].lastIndexOf(y);g=s.slice(c.index+E+1),i.lastIndex=s.length}else y!=null&&!wt.test(y)&&W(t);h=ar}else c[6]?(wt.test(u)||W(t),h=c[6]==="#"?vt:St):c[8]?h=c[9]==null?Tn:lr:c[7]==="*"?h=ir:c[7]&&wt.test(c[7])?h=sr:W(t);c[9]?([g,i.lastIndex]=mo(s,i.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),rt(g,e||u==="has",u==="has")):h===Tn&&W(t),r.matchers.push({type:h,name:u,value:g}),a=i.lastIndex}return(a!==s.length||r.matchers.length===0)&&W(t),o}function fo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function po(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,i={type:cr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(i)):n.unshift({combinator:tt,matchers:[i]}),n.some(({matchers:c})=>c.length===0))return!1;let s=o===xn||o===wn?t[p]:t[R];if(!s)return!1;let a=!1;return vn(s,n,()=>(a=!0,!1),t),a}function vn(t,e,n,r){let o=[],i=t;for(;i;){if(j(i)){if(et(i,e,r)&&n(i)===!1)return!1;let s=i[R];if(s){let a=i[p];a&&o.push(a),i=s;continue}}i=i[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!xt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let i=r===or||r===tt?Y:M,s=t[i];if(!s)return!1;if(r===tt||r===wn){for(;s;){if(j(s)&&xt(s,o,n)){let a=e.slice(0,-1);if(a.length===0||et(s,a,n))return!0}s=s[i]}return!1}else{if(r===xn&&!j(s)){for(;s&&!j(s);)s=s[i];if(!s)return!1}if(!j(s)||!xt(s,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(s,a,n)}}function Nn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function xt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let s of e)if(xt(t,s,n)===!1)return!1;return!0}let{type:r,name:o,value:i}=e;switch(r){case ir:return o==="*";case sr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case vt:return Nn(t,"id")===o;case St:let s=Nn(t,"class");return s?pt(s).includes(o):!1;case ar:let a=Nn(t,o);return i==null?a!=null:a===i;case cr:return t===n;case Tn:W(`:${o}`);case lr:switch(o){case"has":return po(t,i||"");case"not":return!fo(t,i||"");default:W(`:${o}(${i})`)}}return!1}function ho(t){return t.nodeType===Me}function ot(t){return K in t}function On(t){return t.nodeType===De}function go(t){return t.nodeType===Le}function j(t){return t.nodeType===X}function Sn(t){return t.nodeType===he}function fr(t){return"appendChild"in t}function At(t){let e=[],n=[t],r=new Set(n),o=new Set,i;for(;n.length>0;){let s=n.pop();if(r.delete(s),o.has(s))continue;let a=[];for(let c of st(s)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!j(c)))continue;let u=c[re];if(u)for(let h of u)o.has(h)||(o.add(h),e.push(h));let m=c[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}i??=a}return{nodes:e,treeNodes:i}}function it(t,e){for(let n of t)n[I]=e}function ur(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function dr(t,e){if(On(t))return e.createTextNode(t.data);if(go(t))return e.createComment(t.data);if(ho(t))return ur(t,e);if(j(t)){let n=e[Ie](t[v],t.namespaceURI,t[me],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(ur(o,e))}return n}else{if(Sn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===xe)throw P("Cannot clone a document node","NotSupportedError");let r=dr(t,n);if(!e||!j(t)&&!Sn(t))return r;let o=new Set([t]),i=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;i.length>0;){let s=i[i.length-1],a,c;if(s.cloningContent)if(s.contentSource&&s.contentDestination)a=s.contentSource.childNodes[s.childIndex++],c=s.contentDestination;else{i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}else if(a=s.source.childNodes[s.childIndex++],c=s.destination,!a){if(s.cloningContent=!0,s.childIndex=0,j(s.source)&&s.source.namespaceURI===A&&s.source.localName==="template"){let m=s.source[se];m&&(o.has(m)&&mr(),o.add(m),s.contentSource=m,s.contentDestination=s.destination.content)}continue}if(!a){i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}o.has(a)&&mr(),o.add(a);let u=dr(a,n);j(a)||Sn(a)?i.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function mr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function kt(t,e){let n=String(e);return n===""?null:Ot(t,[{type:vt,name:n}])}function Pt(t,e){let n=[...new Set(pt(String(e)))];return Rt(t,n.map(r=>({type:St,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let i of It(t))j(i)&&(n==="*"||(i.namespaceURI===A?i[v]===r:i[v]===n))&&o.push(i);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],i=r[p];o?(i&&n.push(i),r=o):r=i??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=$n;[v]="";[Y]=null;[pe]=null;[R]=null;[M]=null;[p]=null;[U]=!1;get[D](){return this[I].defaultView[we]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return yo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e="";for(let n of It(this))On(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(fr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function yo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case xe:e=e.documentElement;break;case Kn:case he:return null;case Me:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),_n=Symbol("preflightInsertions"),Mt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);this.parentNode===r?r[Mt](s,this,o):r[ee](s,i,o)})}before(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[M];for(;i&&n.includes(i);)i=i[M];let s=An(r,n,o);r[ee](s,i?i[p]:r.firstChild,o)})}after(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);r[ee](s,i,o)})}};function Rn(t){return V(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Se(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw P("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[pe]}}}function An(t,e,n){let r=[];for(let i of e)r.push(at(t,i));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[_n](r);for(let i of r)o[ee](i,null,n);return o}var Dt,kn=0,pr=0,hr=0,gr=0,Ge=!1,Cn=!1,lt=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=bo(n),o=Dt??=new WeakMap,i=o.get(e);i==null&&(i=new Map,o.set(e,i));let s=i.get(this);s==null?kn++:Pn(s,-1),i.set(this,r),Pn(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),kn--,Pn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,kn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[i,s]of o){if(r!==t.target&&!s.subtree)continue;let a=!1;if(t.type==="attributes"){if(!s.attributes||s.attributeFilter&&!s.attributeFilter.has(t.attributeName??""))continue;a=s.attributeOldValue}else if(t.type==="characterData"){if(!s.characterData)continue;a=s.characterDataOldValue}else if(!s.childList)continue;n.set(i,n.get(i)===!0||a)}r=r.parentNode}for(let[o,i]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:i?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function bo(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Pn(t,e){t.attributes&&(pr+=e),t.characterData&&(hr+=e),t.childList&&(gr+=e),Ge=pr>0,Cn=hr>0,lt=gr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=Se(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P("The node is not a child of this node","NotFoundError");let n=this[U]?st(e):void 0,r=e[M],o=e[p],i=Ht(this,e);if(n)for(let s of n)s[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),ve(this.collectRemovalHookEffects(e,i))}replaceChild(e,n){return V(()=>this[Mt](e,n))}[Mt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError");let o=n[M],i=n[p],s=this.prepareInsertion(e),a=this[U]?st(n):void 0,c=new Set(s.map(({node:g})=>g)),u=i;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(a){for(let y of a)y[U]=!1;let g=new Set(a);for(let y of s)g.has(y.node)&&(y.shouldDisconnect=!1)}this.commitInsertion(s,u);let h=this[U];return this.queueRemovalMutationRecord(this,n,o,i),this.queueInsertionMutationRecords(s),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(s,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(s)],r),n}querySelectorAll(e){return Rt(this,e)}querySelector(e){return Ot(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[_n](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let i=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,i),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let s=e[R];for(;s;)n.push(s),s=s[p]}else n.push(e);let r=this[U],o=this[I],i=[];for(let s of n){let a=s[U],c=a||r,u,m;if(s[I]===o)c&&(u=st(s));else{let h=At(s);m=h.nodes,c&&(u=h.treeNodes)}i.push({node:s,nodes:u,adoption:m,shouldDisconnect:a})}return i}commitInsertion(e,n){for(let i of e){let s=i.node[Y];if(s){let a=i.node[M],c=i.node[p];i.source={parent:s,index:Ht(s,i.node),previousSibling:a,nextSibling:c}}}for(let i of e){let s=this.attachChild(i.node,n);i.insertIndex=s.index,i.previousSibling=s.previousSibling,i.nextSibling=s.nextSibling}let r=this[I];for(let{adoption:i}of e)i&&it(i,r);let o=this[U];for(let{nodes:i}of e)if(i)for(let s of i)s[U]=o}attachChild(e,n){if(n){let i=n[M];e[p]=n,e[M]=i,i?i[p]=e:this[R]=e,n[M]=e}else{e[p]=null;let i=this[R];if(i){let s;for(;s=i[p];)i=s;i[p]=e,e[M]=i}else this[R]=e,e[M]=null}let r=j(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let i=n;for(;i&&!j(i);)i=i[p];i?this.children.splice(this.children.indexOf(i),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Qe(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:i}=r;i?.parent.nodeType===X&&!Qe(i.parent)&&n.push([()=>i.parent[D].removeChild?.(i.parent,o,i.index)]),this.nodeType===X&&!Qe(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){br(e,n)}};function yr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,i=e[M],s=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;it(n.nodes,r),lt&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:i,nextSibling:s}),o&&br(o,"disconnectedCallback");let c=[];t.nodeType===X&&!Qe(t)&&c.push([()=>t[D].removeChild?.(t,e,a)]),ve(c)}function Ht(t,e){let n=e[M],r=e[p];n?n[p]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[p]=null,e[M]=null,o}function br(t,e){for(let n of t){let r=n[e];typeof r=="function"&&Et(n,()=>r.call(n))}}function ct(t,e,n,r,o){let{observedAttributes:i}=t.constructor,{attributeChangedCallback:s}=t;s==null||i==null||!i.includes(e)||Et(t,()=>s.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),i=this[R];for(;i;){if(i.localName===o&&i[S]===r)return i;i=i[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(i=>i.localName===o&&i[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let i=r.value;return r[p]=null,r[q]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:i}),n[D].removeAttribute?.(n,r.name,r[S]),ct(n,r.localName,i,null,r[S]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw P("The attribute is already in use by another element.","InUseAttributeError");let o=null,i=this[R],s=null;for(;i;){if(i.localName===e.localName&&i[S]===e[S]){if(i===e)return i;s?s[p]=e:this[R]=e,e[p]=i[p],i[p]=null,o=i;break}s=i,i=i[p]}o==null&&(s?s[p]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),c&&n[D].removeAttribute?.(n,o.name,o[S]),(a||c)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&&ct(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var Oe=class extends J{nodeType=Me;[S]=null;[p]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[fe]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(":");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(":");return e<0?null:this[v].slice(0,e)}get value(){return this[fe]}set value(e){let n=String(e),r=this[q];if(!r){this[fe]=n;return}V(()=>{let o=this[fe];this[fe]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),ct(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var Eo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},No=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Tr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,wo="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",xo=/^(?:color|face|size)$/i;function Er(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return Eo[n];let i=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(i)}catch{return e}})}function wr(t){return t.namespaceURI===A&&No.has(t.localName)}function Nr(t){let e=t.localName;return t[S]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function vo(t,e){if(wo.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Tr))if(xo.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],i=r;for(let s of t.matchAll(To)){let a=s[1];if(a){let c=s[2],u=G(a),m=o[o.length-1]?.element??e,h=m[S]===Z?Z:A;if(u==="svg")h=Z;else if(h===Z){if(Nr(m))h=A;else if(vo(u,c)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==Z||Nr(O.element))break;o.pop(),i=O.target}h=A}}let g=h===A?u:a,y=n[Ie](g,h,null,g);for(let O of c.matchAll(Tr))y.setAttribute(O[1],Er(O[3]||O[4]||""));if(i.append(y),wr(y)||h!==A&&s[4])continue;o.push({element:y,target:i}),i=h===A&&u==="template"?y.content:y}else if(s[5]){let c=G(s[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],h=G(m.element[v]);if(h===c){i=m.target,o.length=u;break}if(m.element[S]===A&&h==="template")break}}else s[6]?i.append(n.createComment(s[6])):i.append(Er(s[7]))}return r}function Vt(t){return vr([{type:"content",child:t[R]}])}function xr(t){return vr([{type:"opening",node:t}])}function vr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let i=o[re]?.[R];for(;i;){e.push(` ${i[v]}`);let a=i[fe];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),i=i[p]}if(e.push(">"),wr(o))break;let s=o.namespaceURI===A&&o.localName==="template"?o[se]:o;t.push({type:"closing",name:o[v]}),t.push({type:"content",child:s?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends oe{nodeType=X;[S]=A;[me]=null;get namespaceURI(){return this[S]}get prefix(){return this[me]}get localName(){let e=this[me];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Qn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new Oe("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);pn(r);let i=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,i);s?s.value=o:this.attributes.setNamedItem(new Oe(i,o))}setAttributeNS(e,n,r){let o=ae(e),i=String(n),s=String(r),a=ht(o,i,"attribute"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=s:this.attributes.setNamedItemNS(new Oe(a.qualifiedName,s,a.namespace))}toggleAttribute(e,n){let r=String(e);pn(r);let o=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,o),s=n===void 0?void 0:!!n;return i==null?s===!1?!1:(this.attributes.setNamedItem(new Oe(o,"")),!0):s===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[S]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var be=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=Cn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends be{nodeType=De;[v]="#text"};var Be=class extends be{nodeType=Le;[v]="#comment"};var Ve=class extends oe{nodeType=he;[v]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return kt(this,e)}};var ze=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):""}};var zt=class extends H{};var jt=class extends H{};var Ft=class extends H{};var ut=class extends oe{nodeType=xe;[v]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new Ft,this,"html"),this.body=Yt(new zt,this,"body"),this.head=Yt(new jt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return tr(n),In(this,G(n))}createElementNS(e,n){let r=ht(e,n,"element");return In(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return In(this,e,n,r,o)}createTextNode(e){let n=qt(new Ue(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return qt(new Be(e),this)}createDocumentFragment(){return qt(new Ve,this)}createEvent(){return new B("")}getElementById(e){return kt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===xe)throw P("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=At(e);return V(()=>{let r=e.parentNode;return r?yr(r,e,n,this):it(n.nodes,this),e})}};function qt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function In(t,e,n=A,r=null,o=e){let i;if(n===Z)i=new He;else if(n===A&&o==="template")i=new ze;else if(n===A){let s=t.defaultView.customElements.get(o);i=s?new s:new H}else i=new H;return Yt(i,t,e,n,r)}function Yt(t,e,n,r=A,o=null){return qt(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[me]:{value:o}}),e[D].createElement?.(t,r),t}var Wt=class extends B{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Xt=class extends B{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var $t=class extends B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var So=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Oo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Sr(t){return So.test(t)&&!Oo.has(t)}function Or(t){return P(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Sr(e))throw Or(e);if(this.registry.has(e))throw P(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw P("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let i of o)i(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Sr(e))return Promise.reject(Or(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Ro=["onerror","onunhandledrejection"],Ar=Symbol.for("@remote-dom/polyfill/global-property");function _r(t){return Object.getOwnPropertyDescriptors(t)}function kr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Mn(r.value.bind(t)),e[n]=r);return e}function Pr(t){let e={};for(let n of Ro)e[n]={configurable:!0,enumerable:!0,get:Mn(()=>t[n]),set:Mn(r=>{t[n]=r})};return e}function Ao(t){return Object.assign(_r(t),kr(t),Pr(t))}function Mn(t){return Object.defineProperty(t,Ar,{value:!0}),t}function Rr(t,e){for(let n of Reflect.ownKeys(e)){let r=_o(t,n);(r==null||ko(r))&&Object.defineProperty(t,n,e[n])}}function _o(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function ko(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Ar]===!0)}var Re=class extends ge{[D]={};[ft]=[];[we]=Co(this);name="";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=Xt;PromiseRejectionEvent=$t;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=be;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=ze;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Po(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=_r(e),i=Object.assign(kr(e),Pr(e));delete o.self,Object.defineProperties(globalThis,o),Rr(globalThis,i),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Rr(n,i))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ao(e))}};function Po(t,e){t[ft].push(e(t)??{})}function Co(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let i of t[ft])i[e]?.apply(i,n);let r=t[D];r[e]?.apply(r,n)}var tn=new Re;var Dn="~";var Ee=new WeakMap;function je(t){return Ee.get(t)}var Un=new WeakMap,Mo=0;function $(t){let e=Un.get(t);return e==null&&(e=String(Mo++),nn(t,e)),e}function nn(t,e){Un.set(t,e)}var Gn=new WeakMap;function Do(t){return Gn.get(t)}var Hn=new WeakMap;function Lo(t){let e=Hn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Go=new WeakMap;function Ho(t){return Go.get(t)}function Bn(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;r[e]=n;let o=Ee.get(t);o?.mutate([[3,$(t),e,n,1]])}function Ne(t,e,n){let r=Hn.get(t);if(r==null&&(r={},Hn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ee.get(t);o?.mutate([[3,$(t),e,n,2]])}function Fe(t,e){if(Ee.get(t)!==e&&(Ee.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)Fe(t.childNodes[r],e)}function rn(t){if(Ee.get(t)!=null&&(Ee.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function qe(t){let{nodeType:e}=t;switch(e){case 1:return{id:$(t),type:e,element:t.localName,properties:Ln(Do(t)),attributes:Ln(Lo(t)),eventListeners:Ln(Ho(t)),children:Array.from(t.childNodes).map(qe)};case 3:case 8:return{id:$(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Ln(t){return t?{...t}:void 0}function Vn(t,e,...n){let r=Un.get(t),o=Ee.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ye=tn[D];Ye.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(Fe(e,r),r.mutate([[0,$(t),qe(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,$(t),n]]))};Ye.setText=(t,e)=>{let n=je(t);n?.mutate([[2,$(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Re.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},i={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...i}:typeof n=="string"?{type:"navigate",to:n,...i}:void 0}var Ir=["wheel","drag","pinch"];function Mr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function Lr(t,e={}){let n,r="",o,i=0,s=new Set,a=new Map,c=[],u=E=>{n?n.postMessage({...E,nonce:r}):c.push(E)},m=E=>{let N=E.data;if(!(!N||typeof N!="object")){if(N.type==="props"){o=N.props;for(let C of s)C(N.props)}else N.type==="answer"?(a.get(N.id)?.(N),a.delete(N.id)):N.type==="event"&&typeof N.listener=="number"?e.onEvent?.(N):N.type==="heartbeat"&&typeof N.beat=="number"&&u({type:"heartbeat",beat:N.beat});e.onMessage?.(N)}},h=()=>{},g=E=>{if(n||!t.fromHost(E)||!Mr(E.data)||E.data.protocol!==1)return;let N=E.ports[0];if(N){n=N,r=E.data.nonce,n.onmessage=m,n.start?.(),h();for(let C of c.splice(0))u(C)}};h=t.listen(g),t.ready({graview:"guest-ready",protocol:1});let y,O={get props(){return o},subscribe(E){return s.add(E),()=>s.delete(E)},act(E,N={}){let C=i+=1;return new Promise(L=>{a.set(C,L),u({type:"act",id:C,name:E,args:N})})},navigate(E){let N=on(E);N&&u(N)},size(E){u({type:"size",height:E})},autoSize(E){let N=E??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!N||!C||typeof N.getBoundingClientRect!="function")return()=>{};y?.disconnect();let L=new C(()=>O.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),y=L,()=>L.disconnect()},close(){y?.disconnect(),h(),n?.close(),s.clear()}};return{guest:O,send:u}}var Hr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],Ur=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Br=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Vr=["TEMPORARY","PERSISTENT"],gl=Object.freeze([...Hr,...Ur,...Br,...Vr]),yl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Gr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function zr(t=globalThis,e=[],n={}){let r=[],o=[],i=new Set([...Hr,...Ur,...Br,...e,"constructor",Symbol.toStringTag]),s=(x,k)=>{let F=Reflect.getOwnPropertyDescriptor(x,k);return F===void 0||!("value"in F)||F.writable||F.configurable?!1:n.primitivesStay&&typeof k=="symbol"&&(typeof F.value!="object"||F.value===null)&&typeof F.value!="function"?!0:Vr.includes(k)&&typeof F.value=="number"},a=t,c=a.setTimeout,u=a.setInterval,m=a.crypto,h=(x,k)=>function(F,We,...mt){if(typeof F!="function")throw new TypeError(`${k} takes a function: a guest view cannot run code from text`);return x.call(t,F,We,...mt)},g=m?Object.freeze({getRandomValues:x=>m.getRandomValues(x)}):void 0,y=a.document?.defaultView;if(y&&y!==a)for(let x of Reflect.ownKeys(y))typeof x=="symbol"||i.has(x)||Reflect.deleteProperty(y,x)||o.push(`window.${x}`);let O=[];for(let x=t;x&&x!==Object.prototype;x=Object.getPrototypeOf(x))O.push(x);for(let x of O)for(let k of Reflect.ownKeys(x))i.has(k)||(Reflect.deleteProperty(x,k)?r.push(Gr(k)):s(x,k)||o.push(Gr(k)));let E=()=>function(){throw new EvalError("A guest view cannot make code from text.")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let x of N){let k=E();Object.defineProperty(k,"prototype",{value:x,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(x,"constructor",{value:k,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),x===Function.prototype&&Reflect.defineProperty(t,"Function",{value:k,writable:!0,enumerable:!1,configurable:!0})}let C=(x,k)=>{Reflect.defineProperty(t,x,{value:k,writable:!0,enumerable:!0,configurable:!0})||o.push(x)};C("setTimeout",h(c,"setTimeout")),C("setInterval",h(u,"setInterval")),g&&C("crypto",g);for(let x of O.slice(1))Object.freeze(x);for(let x of Reflect.ownKeys(t)){let k=Reflect.getOwnPropertyDescriptor(t,x);Reflect.defineProperty(t,x,"value"in k?{...k,writable:!1,configurable:!1}:{...k,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var dt=class extends HTMLElement{constructor(){super(),nn(this,Dn)}connect(e){if(je(this)===e||(Fe(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Dn,qe(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Bn(this,e,n)}callRemoteMethod(e,...n){return Vn(this,e,...n)}};var d={},sn={empty:!0},Uo={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},zn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:sn,br:sn,wbr:sn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:d,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:d,output:d,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":sn},Bo=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Vo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Bo.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},an={viewBox:"geometry",preserveAspectRatio:"geometry"},jr={oneOf:["userSpaceOnUse","objectBoundingBox"]},Fr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Yr={svg:{attributes:{...ue,...an}},g:d,defs:d,symbol:{attributes:{...ue,...an,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...an,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...an,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:d,filter:{attributes:{...ue,filterUnits:jr,primitiveUnits:jr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:Fr,yChannelSelector:Fr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Wr={section:["aria-label","aria-labelledby","title"]};function zo(t){return/^aria-[a-z]+$/.test(t)}function jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Fo=new Map(Object.keys(Yr).map(t=>[t.toLowerCase(),t]));function Xr(t){return Fo.get(t.toLowerCase())}function $r(t,e,n){let r=n.toLowerCase(),o=t==="html"?[zn[e]?.attributes,Uo]:[Yr[e]?.attributes,Vo],i=t==="svg"&&r==="xlink:href"?"href":r;for(let s of o)if(s){for(let[a,c]of Object.entries(s))if(a.toLowerCase()===i)return{name:a,kind:c}}if(zo(r)||jo(r))return{name:r,kind:"text"}}var Kr="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ie=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>ie(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ie(r,e+1)]))};function Zr(){let t=new Map,e=new Map,n=new Map([[Kr,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},i=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},s=u=>{let m=n.get(u);if(m){n.delete(u);for(let h of m.listeners.values())i(h);for(let h of m.children)s(h)}},a=(u,m,h=0)=>{if(!ln(u)||h>64)return ie(u);let g=typeof u.id=="string"?u.id:void 0,y=m&&g!==void 0&&g!==Kr;y&&s(g);let O={children:[],listeners:new Map};y&&n.set(g,O);let E={};for(let[N,C]of Object.entries(u))N==="children"&&Array.isArray(C)?E[N]=C.map(L=>{let x=a(L,y,h+1);return y&&ln(L)&&typeof L.id=="string"&&O.children.push(L.id),x}):N==="eventListeners"&&ln(C)?E[N]=Object.fromEntries(Object.entries(C).map(([L,x])=>{if(typeof x!="function"||!y)return[L,void 0];let k=o(x);return O.listeners.set(L,k),[L,{listener:k}]})):E[N]=ie(C,h+1);return E},c=u=>{if(!Array.isArray(u))return ie(u);let[m,h]=u,g=typeof h=="string"?n.get(h):void 0;if(m===0){let y=a(u[2],g!==void 0),O=ln(u[2])?u[2].id:void 0;if(g&&typeof O=="string"&&n.has(O)){let E=Number(u[3]);g.children.splice(Number.isInteger(E)&&E>=0&&E<=g.children.length?E:g.children.length,0,O)}return[m,ie(h),y,ie(u[3])]}if(m===1){let y=Number(u[2]);return g&&Number.isInteger(y)&&y>=0&&y<g.children.length&&s(g.children.splice(y,1)[0]),ie(u)}if(m===3&&u[4]===3){let y=String(u[2]),O=u[3],E=g&&typeof O=="function"?o(O):void 0,N=g?.listeners.get(y);return N!==void 0&&i(N),E===void 0?g?.listeners.delete(y):g.listeners.set(y,E),[m,ie(h),y,E===void 0?void 0:{listener:E},3]}return ie(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",qo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Yo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Wo=t=>Object.freeze({html:t,toString:()=>t}),Qr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Jr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Jr).join(""):Qr(t)?t.html:Yo(String(t));function eo(t){customElements.get(cn)||customElements.define(cn,dt);let e=Event,n=Zr(),r=new Set,o=new Set,i,s=[],a=new Set;for(let l of["closest","matches","dataset"]){let f=()=>{throw new TypeError(`A view\'s element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l==="dataset"?{get:f}:{value:f})}let c=document.createElement(cn),u=l=>{let f=b=>{for(let w of Array.from(b.childNodes)){if(w.nodeType!==1)continue;if($(w)===l)return w;let T=f(w);if(T)return T}};return f(c)},m=l=>{let f=u(l.target);if(!f)return;let b=new e(l.event,{bubbles:!0}),w={};for(let T of qo)l[T]!==void 0&&(w[T]=l[T]);for(let T of Object.keys(w))Object.defineProperty(b,T,{value:w[T],enumerable:!0});f.dispatchEvent(b);for(let T of o){if(T.type!==l.event)continue;let _;try{_=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let z=f;z&&z!==c;z=z.parentNode)if(_.has(z)){T.listener(Object.freeze({type:l.event,target:f,element:z,...w}));break}}},h=l=>{if(l.type==="dom-event"&&typeof l.target=="string")return m(l);if(l.type==="notice")return t.warn(l.text);if(l.type!=="props")return;i=l.props;let f=t.now();for(let T of r)try{T(l.props)}catch(_){t.threw(_)}let b=t.now()-f,w=l.push;typeof w=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:w,ms:b})))},g;c.connect({mutate(l){g||(g=[],t.microtask(()=>{let f=g??[];g=void 0,t.send({type:"render",records:n.encode(f)})})),g.push(...l)},call:()=>{}});let y=l=>l.nodeType===1?l.getAttribute("data-key")??l.getAttribute("id"):null,O=(l,f)=>l.nodeType===f.nodeType&&(l.nodeType!==1||l.localName===f.localName&&l.namespaceURI===f.namespaceURI&&y(l)===y(f));function E(l,f){let b=Array.from(f.childNodes),w=0;for(let T of b){let _=l.childNodes[w]??null;if(_&&O(_,T)){N(_,T),w+=1;continue}if(y(T)!==null){let de=Array.from(l.childNodes).slice(w+1).find(Xe=>O(Xe,T));if(de){l.insertBefore(de,_),N(de,T),w+=1;continue}}l.insertBefore(T,_),w+=1}for(;l.childNodes.length>w;)l.removeChild(l.lastChild)}function N(l,f){if(l.nodeType!==1){l.data!==f.data&&(l.data=f.data);return}let b=l,w=f,T=C(b);for(let _ of b.getAttributeNames())w.hasAttribute(_)||(b.removeAttribute(_),T&&Ne(b,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);b.getAttribute(_)!==z&&b.setAttribute(_,z),T&&Ne(b,_,z)}E(b,w)}let C=l=>l.localName.includes("-");function L(l){for(let f of Array.from(l.childNodes)){if(f.nodeType!==1)continue;let b=f;if(C(b))for(let w of b.getAttributeNames())Ne(b,w,b.getAttribute(w)??void 0);L(b)}}function x(l,f,b){for(let w of Array.from(l.childNodes)){if(w.nodeType!==1)continue;let T=w,_=T.localName,z=f||_.toLowerCase()==="svg",de=z?Xr(_):Object.prototype.hasOwnProperty.call(zn,_.toLowerCase())?_.toLowerCase():void 0;if(!de){b.add(`<${_}>`);continue}for(let Xe of T.getAttributeNames())(!$r(z?"svg":"html",de,Xe)||!z&&Wr[de]?.includes(Xe.toLowerCase()))&&b.add(`${de} ${Xe}`);x(T,z,b)}}function k(l){let f=document.createElement("div"),b=Array.isArray(l)?l:[l];for(let T of b)if(T!=null)if(typeof T=="string"||Qr(T)){let _=document.createElement("div");_.innerHTML=typeof T=="string"?T:T.html,f.append(...Array.from(_.childNodes))}else f.append(T);let w=new Set;x(f,!1,w),s=[...w],s.length>0&&t.warn(`The host will not draw: ${s.join(", ")}`),L(f),E(c,f)}let F=[],We=new Set(Ir),mt="[]",un=!1,Yn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Map([...o].filter(b=>We.has(b.type)).map(b=>[`${b.type} ${b.selector}`,{event:b.type,selector:b.selector}])).entries()].sort(([b],[w])=>b<w?-1:b>w?1:0).map(([,b])=>b),f=JSON.stringify(l);f!==mt&&(mt=f,t.send({type:"gestures",bound:l}))}))},Wn="[]",dn=!1,Xn=()=>{dn||(dn=!0,t.microtask(()=>{dn=!1;let l=[...new Set([...o].filter(b=>b.type==="click"&&typeof b.selector=="string").map(b=>b.selector))].sort().slice(0,200),f=JSON.stringify(l);f!==Wn&&(Wn=f,t.send({type:"clicks",selectors:l}))}))};return{view:Object.freeze({get props(){return i},onProps(l){return r.add(l),i&&l(i),()=>void r.delete(l)},render:k,style(l){typeof l!="string"||F.includes(l)||(F.push(l),t.send({type:"style",sheets:[...F]}))},on(l,f,b){let w={type:l,selector:f,listener:b};return o.add(w),typeof l=="string"&&!a.has(l)&&(a.add(l),t.send({type:"hears",events:[l]})),We.has(l)&&Yn(),l==="click"&&Xn(),()=>{o.delete(w),We.has(l)&&Yn(),l==="click"&&Xn()}},act:(l,f={})=>t.act(l,f),navigate(l){if(typeof l=="string")return t.navigate(l);let f=on(l);f&&t.send(f)},html(l,...f){return Wo(l.reduce((b,w,T)=>b+w+(T<f.length?Jr(f[T]):""),""))},get refused(){return s},get hardening(){return t.hardening()}}),hear:h,find:l=>{try{let f=c.querySelectorAll(l)[0];return f?$(f):void 0}catch{return}},listened:l=>{let f=new Set;for(let b of o)if(b.type===l)try{for(let w of Array.from(c.querySelectorAll(b.selector))){let T=$(w);T&&f.add(T)}}catch{}return[...f]}}}var qn={removed:[],stuck:[],sealed:!1,worker:!1},jn=Lr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>to.hear(t)}),to=eo({send:t=>jn.send(t),act:(t,e)=>jn.guest.act(t,e),navigate:t=>jn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>qn}),Xo=to.view;Object.defineProperty(globalThis,"graview",{value:Xo,enumerable:!0,configurable:!0,writable:!1});var Fn="WorkerGlobalScope"in globalThis?zr(globalThis,["graview"]):qn;qn=Fn;if(Fn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${Fn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
1
|
+
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest\'s worker runtime \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Ae=globalThis,no=Ae.addEventListener,ro=Ae.removeEventListener,oo=Ae.postMessage,io=globalThis.queueMicrotask,mn=globalThis.performance,so=mn?mn.now.bind(mn):Date.now,_e={listen:t=>no.call(Ae,"message",t),unlisten:t=>ro.call(Ae,"message",t),post:t=>oo.call(Ae,t),microtask:t=>io.call(globalThis,t),now:()=>so()};var v=Symbol("name"),me=Symbol("prefix"),fe=Symbol("value"),S=Symbol("ns"),q=Symbol("owner"),I=Symbol("owner_document"),re=Symbol("attributes"),M=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),fn=Symbol("isTrusted"),ke=Symbol("path"),Pe=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),se=Symbol("content"),D=Symbol("hooks"),ft=Symbol("extensions"),we=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ie=Symbol("create_element"),$n=0,X=1,Me=2,De=3,Le=8,xe=9,Kn=10,he=11,A="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Zn="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Jn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,er=/[\\0\\t\\n\\f\\r />=]/u,ao=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function tr(t){Jn.test(t)||hn(t)}function pn(t){(t===""||er.test(t))&&hn(t)}function ht(t,e,n){let r=ae(t),o=String(e),i=o.indexOf(":"),s=i<0?null:o.slice(0,i),a=i<0?o:o.slice(i+1);if((s!=null&&(s===""||ao.test(s))||(n==="element"?!Jn.test(a):a===""||er.test(a)))&&hn(o),s!=null&&r==null)throw P(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(s==="xml"&&r!==Zn)throw P("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||s==="xmlns")&&r!==$e)throw P("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&s!=="xmlns")throw P("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:s,localName:a}}function hn(t){throw P(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,nr=2,gn=3,lo=typeof performance>"u"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=nr;static BUBBLING_PHASE=gn;timeStamp=lo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[ke]=[];[Pe]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,fn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[fn]}composedPath(){return[...this[ke]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Pe]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let i of[...o]){if(!o.has(i)||i.signal?.aborted)continue;t.eventPhase=t.target===e?nr:n,t.currentTarget=e;let s=i.normalizedListener;try{typeof s=="object"?s.handleEvent(t):s.call(e,t)}catch(a){setTimeout(co,0,a)}if(t[Pe])break}}function co(t){throw t}var Ke=[],bt=new WeakMap;function Et(t,e){let n=bt.get(t);n?n.push(e):bt.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{rr(e)}catch{}throw r}return Ke.pop(),rr(e),n}function rr(t){let e,n=!1;for(let r of t){let o=bt.get(r);if(o){for(;o.length>0;){let i=o.shift();try{i()}catch(s){n||(e=s,n=!0)}}bt.delete(r)}}if(n)throw e}var Nt=[],Ze=[],bn=!1;function ve(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!bn){bn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,i]=Nt[r];i&&Ze.splice(Ze.indexOf(i),1);try{o()}catch(s){n||(e=s,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,bn=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Je]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,i=typeof r=="object"&&r.once===!0,s=typeof r=="object"?r.signal:void 0;if(s?.aborted)return;let a=En(o),c=this[Je];c||(c=new Map,this[Je]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[a];if(m||(m=new Map,u[a]=m),m.has(n))return;let h=this,g={type:e,listener:n,capture:o,once:i,normalizedListener:n,signal:s};(i||s)&&(g.normalizedListener=function(...C){if(g.signal?.aborted){Tt(h,g);return}return g.once&&Tt(h,g),typeof g.listener=="object"?g.listener.handleEvent(...C):g.listener.call(this,...C)});let y=this[Te];y||(y=new Map,this[Te]=y);let O=y.get(e);O||(O={},y.set(e,O));let E=O[a];if(E||(E=new Set,O[a]=E),m.set(n,g),E.add(g),s){let N=()=>{Tt(h,g)};g.abortListener=N,s.addEventListener("abort",N,{once:!0})}this[I]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return uo.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw P("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[ke]=n;for(let i=n.length;i--;)if(yn(e,n[i],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let i=0;i<o.length;i++)if(yn(e,o[i],gn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Pe]=!1,e.eventPhase=gt,e.currentTarget=null,e[ke]=[]}}};function uo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=En(!!r),i=this[Je]?.get(t)?.[o]?.get(e);i&&Tt(this,i)}function En(t){return t?"capture":"bubble"}function Tt(t,e){let n=En(e.capture),r=t[Je],o=r?.get(e.type);if(!o)return;let i=o[n];if(!i||i.get(e.listener)!==e)return;i.delete(e.listener),i.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let s=t[Te],a=s?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&s?.delete(e.type),t[I]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,or=1,wn=2,xn=3,nt=4,ir=0,sr=1,vt=2,St=3,ar=4,Tn=5,lr=6,cr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function mo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){i==="\\\\"?o++:i===r&&(r=null);continue}if(i===\'"\'||i==="\'")r=i;else if(i==="(")n++;else if(i===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw P(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function Ot(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>(r=i,!1)),r}function Rt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>{r.push(i)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,matchers:[]},o=[r],i=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,s=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");s===""&&W(t);let a=0,c;for(;c=i.exec(s);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=or:c[1]==="+"?r.combinator=xn:c[1]==="~"?r.combinator=wn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let h,g=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let y=c[5],O=y?.[0];if(c[3]==null&&(O===\'"\'||O==="\'")){let E=c[0].lastIndexOf(y);g=s.slice(c.index+E+1),i.lastIndex=s.length}else y!=null&&!wt.test(y)&&W(t);h=ar}else c[6]?(wt.test(u)||W(t),h=c[6]==="#"?vt:St):c[8]?h=c[9]==null?Tn:lr:c[7]==="*"?h=ir:c[7]&&wt.test(c[7])?h=sr:W(t);c[9]?([g,i.lastIndex]=mo(s,i.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),rt(g,e||u==="has",u==="has")):h===Tn&&W(t),r.matchers.push({type:h,name:u,value:g}),a=i.lastIndex}return(a!==s.length||r.matchers.length===0)&&W(t),o}function fo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function po(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,i={type:cr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(i)):n.unshift({combinator:tt,matchers:[i]}),n.some(({matchers:c})=>c.length===0))return!1;let s=o===xn||o===wn?t[p]:t[R];if(!s)return!1;let a=!1;return vn(s,n,()=>(a=!0,!1),t),a}function vn(t,e,n,r){let o=[],i=t;for(;i;){if(F(i)){if(et(i,e,r)&&n(i)===!1)return!1;let s=i[R];if(s){let a=i[p];a&&o.push(a),i=s;continue}}i=i[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!xt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let i=r===or||r===tt?Y:M,s=t[i];if(!s)return!1;if(r===tt||r===wn){for(;s;){if(F(s)&&xt(s,o,n)){let a=e.slice(0,-1);if(a.length===0||et(s,a,n))return!0}s=s[i]}return!1}else{if(r===xn&&!F(s)){for(;s&&!F(s);)s=s[i];if(!s)return!1}if(!F(s)||!xt(s,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(s,a,n)}}function Nn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function xt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let s of e)if(xt(t,s,n)===!1)return!1;return!0}let{type:r,name:o,value:i}=e;switch(r){case ir:return o==="*";case sr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case vt:return Nn(t,"id")===o;case St:let s=Nn(t,"class");return s?pt(s).includes(o):!1;case ar:let a=Nn(t,o);return i==null?a!=null:a===i;case cr:return t===n;case Tn:W(`:${o}`);case lr:switch(o){case"has":return po(t,i||"");case"not":return!fo(t,i||"");default:W(`:${o}(${i})`)}}return!1}function ho(t){return t.nodeType===Me}function ot(t){return K in t}function On(t){return t.nodeType===De}function go(t){return t.nodeType===Le}function F(t){return t.nodeType===X}function Sn(t){return t.nodeType===he}function fr(t){return"appendChild"in t}function At(t){let e=[],n=[t],r=new Set(n),o=new Set,i;for(;n.length>0;){let s=n.pop();if(r.delete(s),o.has(s))continue;let a=[];for(let c of st(s)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!F(c)))continue;let u=c[re];if(u)for(let h of u)o.has(h)||(o.add(h),e.push(h));let m=c[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}i??=a}return{nodes:e,treeNodes:i}}function it(t,e){for(let n of t)n[I]=e}function ur(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function dr(t,e){if(On(t))return e.createTextNode(t.data);if(go(t))return e.createComment(t.data);if(ho(t))return ur(t,e);if(F(t)){let n=e[Ie](t[v],t.namespaceURI,t[me],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(ur(o,e))}return n}else{if(Sn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===xe)throw P("Cannot clone a document node","NotSupportedError");let r=dr(t,n);if(!e||!F(t)&&!Sn(t))return r;let o=new Set([t]),i=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;i.length>0;){let s=i[i.length-1],a,c;if(s.cloningContent)if(s.contentSource&&s.contentDestination)a=s.contentSource.childNodes[s.childIndex++],c=s.contentDestination;else{i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}else if(a=s.source.childNodes[s.childIndex++],c=s.destination,!a){if(s.cloningContent=!0,s.childIndex=0,F(s.source)&&s.source.namespaceURI===A&&s.source.localName==="template"){let m=s.source[se];m&&(o.has(m)&&mr(),o.add(m),s.contentSource=m,s.contentDestination=s.destination.content)}continue}if(!a){i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}o.has(a)&&mr(),o.add(a);let u=dr(a,n);F(a)||Sn(a)?i.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function mr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function kt(t,e){let n=String(e);return n===""?null:Ot(t,[{type:vt,name:n}])}function Pt(t,e){let n=[...new Set(pt(String(e)))];return Rt(t,n.map(r=>({type:St,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let i of It(t))F(i)&&(n==="*"||(i.namespaceURI===A?i[v]===r:i[v]===n))&&o.push(i);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],i=r[p];o?(i&&n.push(i),r=o):r=i??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=$n;[v]="";[Y]=null;[pe]=null;[R]=null;[M]=null;[p]=null;[U]=!1;get[D](){return this[I].defaultView[we]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return yo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e="";for(let n of It(this))On(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(fr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function yo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case xe:e=e.documentElement;break;case Kn:case he:return null;case Me:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),_n=Symbol("preflightInsertions"),Mt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);this.parentNode===r?r[Mt](s,this,o):r[ee](s,i,o)})}before(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[M];for(;i&&n.includes(i);)i=i[M];let s=An(r,n,o);r[ee](s,i?i[p]:r.firstChild,o)})}after(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);r[ee](s,i,o)})}};function Rn(t){return V(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Se(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw P("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[pe]}}}function An(t,e,n){let r=[];for(let i of e)r.push(at(t,i));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[_n](r);for(let i of r)o[ee](i,null,n);return o}var Dt,kn=0,pr=0,hr=0,gr=0,Ge=!1,Cn=!1,lt=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=bo(n),o=Dt??=new WeakMap,i=o.get(e);i==null&&(i=new Map,o.set(e,i));let s=i.get(this);s==null?kn++:Pn(s,-1),i.set(this,r),Pn(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),kn--,Pn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,kn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[i,s]of o){if(r!==t.target&&!s.subtree)continue;let a=!1;if(t.type==="attributes"){if(!s.attributes||s.attributeFilter&&!s.attributeFilter.has(t.attributeName??""))continue;a=s.attributeOldValue}else if(t.type==="characterData"){if(!s.characterData)continue;a=s.characterDataOldValue}else if(!s.childList)continue;n.set(i,n.get(i)===!0||a)}r=r.parentNode}for(let[o,i]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:i?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function bo(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function Pn(t,e){t.attributes&&(pr+=e),t.characterData&&(hr+=e),t.childList&&(gr+=e),Ge=pr>0,Cn=hr>0,lt=gr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=Se(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P("The node is not a child of this node","NotFoundError");let n=this[U]?st(e):void 0,r=e[M],o=e[p],i=Ht(this,e);if(n)for(let s of n)s[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),ve(this.collectRemovalHookEffects(e,i))}replaceChild(e,n){return V(()=>this[Mt](e,n))}[Mt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError");let o=n[M],i=n[p],s=this.prepareInsertion(e),a=this[U]?st(n):void 0,c=new Set(s.map(({node:g})=>g)),u=i;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(a){for(let y of a)y[U]=!1;let g=new Set(a);for(let y of s)g.has(y.node)&&(y.shouldDisconnect=!1)}this.commitInsertion(s,u);let h=this[U];return this.queueRemovalMutationRecord(this,n,o,i),this.queueInsertionMutationRecords(s),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(s,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(s)],r),n}querySelectorAll(e){return Rt(this,e)}querySelector(e){return Ot(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[_n](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let i=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,i),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let s=e[R];for(;s;)n.push(s),s=s[p]}else n.push(e);let r=this[U],o=this[I],i=[];for(let s of n){let a=s[U],c=a||r,u,m;if(s[I]===o)c&&(u=st(s));else{let h=At(s);m=h.nodes,c&&(u=h.treeNodes)}i.push({node:s,nodes:u,adoption:m,shouldDisconnect:a})}return i}commitInsertion(e,n){for(let i of e){let s=i.node[Y];if(s){let a=i.node[M],c=i.node[p];i.source={parent:s,index:Ht(s,i.node),previousSibling:a,nextSibling:c}}}for(let i of e){let s=this.attachChild(i.node,n);i.insertIndex=s.index,i.previousSibling=s.previousSibling,i.nextSibling=s.nextSibling}let r=this[I];for(let{adoption:i}of e)i&&it(i,r);let o=this[U];for(let{nodes:i}of e)if(i)for(let s of i)s[U]=o}attachChild(e,n){if(n){let i=n[M];e[p]=n,e[M]=i,i?i[p]=e:this[R]=e,n[M]=e}else{e[p]=null;let i=this[R];if(i){let s;for(;s=i[p];)i=s;i[p]=e,e[M]=i}else this[R]=e,e[M]=null}let r=F(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let i=n;for(;i&&!F(i);)i=i[p];i?this.children.splice(this.children.indexOf(i),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Qe(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:i}=r;i?.parent.nodeType===X&&!Qe(i.parent)&&n.push([()=>i.parent[D].removeChild?.(i.parent,o,i.index)]),this.nodeType===X&&!Qe(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){br(e,n)}};function yr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,i=e[M],s=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;it(n.nodes,r),lt&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:i,nextSibling:s}),o&&br(o,"disconnectedCallback");let c=[];t.nodeType===X&&!Qe(t)&&c.push([()=>t[D].removeChild?.(t,e,a)]),ve(c)}function Ht(t,e){let n=e[M],r=e[p];n?n[p]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),F(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[p]=null,e[M]=null,o}function br(t,e){for(let n of t){let r=n[e];typeof r=="function"&&Et(n,()=>r.call(n))}}function ct(t,e,n,r,o){let{observedAttributes:i}=t.constructor,{attributeChangedCallback:s}=t;s==null||i==null||!i.includes(e)||Et(t,()=>s.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),i=this[R];for(;i;){if(i.localName===o&&i[S]===r)return i;i=i[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(i=>i.localName===o&&i[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let i=r.value;return r[p]=null,r[q]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:i}),n[D].removeAttribute?.(n,r.name,r[S]),ct(n,r.localName,i,null,r[S]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw P("The attribute is already in use by another element.","InUseAttributeError");let o=null,i=this[R],s=null;for(;i;){if(i.localName===e.localName&&i[S]===e[S]){if(i===e)return i;s?s[p]=e:this[R]=e,e[p]=i[p],i[p]=null,o=i;break}s=i,i=i[p]}o==null&&(s?s[p]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),c&&n[D].removeAttribute?.(n,o.name,o[S]),(a||c)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&&ct(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var Oe=class extends J{nodeType=Me;[S]=null;[p]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[fe]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(":");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(":");return e<0?null:this[v].slice(0,e)}get value(){return this[fe]}set value(e){let n=String(e),r=this[q];if(!r){this[fe]=n;return}V(()=>{let o=this[fe];this[fe]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),ct(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var Eo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},No=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Tr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,wo="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",xo=/^(?:color|face|size)$/i;function Er(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return Eo[n];let i=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(i)}catch{return e}})}function wr(t){return t.namespaceURI===A&&No.has(t.localName)}function Nr(t){let e=t.localName;return t[S]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function vo(t,e){if(wo.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Tr))if(xo.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],i=r;for(let s of t.matchAll(To)){let a=s[1];if(a){let c=s[2],u=G(a),m=o[o.length-1]?.element??e,h=m[S]===Z?Z:A;if(u==="svg")h=Z;else if(h===Z){if(Nr(m))h=A;else if(vo(u,c)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==Z||Nr(O.element))break;o.pop(),i=O.target}h=A}}let g=h===A?u:a,y=n[Ie](g,h,null,g);for(let O of c.matchAll(Tr))y.setAttribute(O[1],Er(O[3]||O[4]||""));if(i.append(y),wr(y)||h!==A&&s[4])continue;o.push({element:y,target:i}),i=h===A&&u==="template"?y.content:y}else if(s[5]){let c=G(s[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],h=G(m.element[v]);if(h===c){i=m.target,o.length=u;break}if(m.element[S]===A&&h==="template")break}}else s[6]?i.append(n.createComment(s[6])):i.append(Er(s[7]))}return r}function Vt(t){return vr([{type:"content",child:t[R]}])}function xr(t){return vr([{type:"opening",node:t}])}function vr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let i=o[re]?.[R];for(;i;){e.push(` ${i[v]}`);let a=i[fe];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),i=i[p]}if(e.push(">"),wr(o))break;let s=o.namespaceURI===A&&o.localName==="template"?o[se]:o;t.push({type:"closing",name:o[v]}),t.push({type:"content",child:s?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends oe{nodeType=X;[S]=A;[me]=null;get namespaceURI(){return this[S]}get prefix(){return this[me]}get localName(){let e=this[me];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Qn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new Oe("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);pn(r);let i=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,i);s?s.value=o:this.attributes.setNamedItem(new Oe(i,o))}setAttributeNS(e,n,r){let o=ae(e),i=String(n),s=String(r),a=ht(o,i,"attribute"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=s:this.attributes.setNamedItemNS(new Oe(a.qualifiedName,s,a.namespace))}toggleAttribute(e,n){let r=String(e);pn(r);let o=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,o),s=n===void 0?void 0:!!n;return i==null?s===!1?!1:(this.attributes.setNamedItem(new Oe(o,"")),!0):s===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[S]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var be=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=Cn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends be{nodeType=De;[v]="#text"};var Be=class extends be{nodeType=Le;[v]="#comment"};var Ve=class extends oe{nodeType=he;[v]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return kt(this,e)}};var ze=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):""}};var zt=class extends H{};var Ft=class extends H{};var jt=class extends H{};var ut=class extends oe{nodeType=xe;[v]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new jt,this,"html"),this.body=Yt(new zt,this,"body"),this.head=Yt(new Ft,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return tr(n),In(this,G(n))}createElementNS(e,n){let r=ht(e,n,"element");return In(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return In(this,e,n,r,o)}createTextNode(e){let n=qt(new Ue(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return qt(new Be(e),this)}createDocumentFragment(){return qt(new Ve,this)}createEvent(){return new B("")}getElementById(e){return kt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===xe)throw P("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=At(e);return V(()=>{let r=e.parentNode;return r?yr(r,e,n,this):it(n.nodes,this),e})}};function qt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function In(t,e,n=A,r=null,o=e){let i;if(n===Z)i=new He;else if(n===A&&o==="template")i=new ze;else if(n===A){let s=t.defaultView.customElements.get(o);i=s?new s:new H}else i=new H;return Yt(i,t,e,n,r)}function Yt(t,e,n,r=A,o=null){return qt(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[me]:{value:o}}),e[D].createElement?.(t,r),t}var Wt=class extends B{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Xt=class extends B{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var $t=class extends B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var So=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Oo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Sr(t){return So.test(t)&&!Oo.has(t)}function Or(t){return P(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Sr(e))throw Or(e);if(this.registry.has(e))throw P(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw P("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let i of o)i(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Sr(e))return Promise.reject(Or(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Ro=["onerror","onunhandledrejection"],Ar=Symbol.for("@remote-dom/polyfill/global-property");function _r(t){return Object.getOwnPropertyDescriptors(t)}function kr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Mn(r.value.bind(t)),e[n]=r);return e}function Pr(t){let e={};for(let n of Ro)e[n]={configurable:!0,enumerable:!0,get:Mn(()=>t[n]),set:Mn(r=>{t[n]=r})};return e}function Ao(t){return Object.assign(_r(t),kr(t),Pr(t))}function Mn(t){return Object.defineProperty(t,Ar,{value:!0}),t}function Rr(t,e){for(let n of Reflect.ownKeys(e)){let r=_o(t,n);(r==null||ko(r))&&Object.defineProperty(t,n,e[n])}}function _o(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function ko(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Ar]===!0)}var Re=class extends ge{[D]={};[ft]=[];[we]=Co(this);name="";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=Xt;PromiseRejectionEvent=$t;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=be;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=ze;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Po(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=_r(e),i=Object.assign(kr(e),Pr(e));delete o.self,Object.defineProperties(globalThis,o),Rr(globalThis,i),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Rr(n,i))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ao(e))}};function Po(t,e){t[ft].push(e(t)??{})}function Co(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let i of t[ft])i[e]?.apply(i,n);let r=t[D];r[e]?.apply(r,n)}var tn=new Re;var Dn="~";var Ee=new WeakMap;function Fe(t){return Ee.get(t)}var Un=new WeakMap,Mo=0;function $(t){let e=Un.get(t);return e==null&&(e=String(Mo++),nn(t,e)),e}function nn(t,e){Un.set(t,e)}var Gn=new WeakMap;function Do(t){return Gn.get(t)}var Hn=new WeakMap;function Lo(t){let e=Hn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Go=new WeakMap;function Ho(t){return Go.get(t)}function Bn(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;r[e]=n;let o=Ee.get(t);o?.mutate([[3,$(t),e,n,1]])}function Ne(t,e,n){let r=Hn.get(t);if(r==null&&(r={},Hn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ee.get(t);o?.mutate([[3,$(t),e,n,2]])}function je(t,e){if(Ee.get(t)!==e&&(Ee.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)je(t.childNodes[r],e)}function rn(t){if(Ee.get(t)!=null&&(Ee.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function qe(t){let{nodeType:e}=t;switch(e){case 1:return{id:$(t),type:e,element:t.localName,properties:Ln(Do(t)),attributes:Ln(Lo(t)),eventListeners:Ln(Ho(t)),children:Array.from(t.childNodes).map(qe)};case 3:case 8:return{id:$(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Ln(t){return t?{...t}:void 0}function Vn(t,e,...n){let r=Un.get(t),o=Ee.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ye=tn[D];Ye.insertChild=(t,e,n)=>{let r=Fe(t);r!=null&&(je(e,r),r.mutate([[0,$(t),qe(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=Fe(t);r!=null&&(rn(e),r.mutate([[1,$(t),n]]))};Ye.setText=(t,e)=>{let n=Fe(t);n?.mutate([[2,$(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Re.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},i={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...i}:typeof n=="string"?{type:"navigate",to:n,...i}:void 0}var Ir=["wheel","drag","pinch"];function Mr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function Lr(t,e={}){let n,r="",o,i=0,s=new Set,a=new Map,c=[],u=E=>{n?n.postMessage({...E,nonce:r}):c.push(E)},m=E=>{let N=E.data;if(!(!N||typeof N!="object")){if(N.type==="props"){o=N.props;for(let C of s)C(N.props)}else N.type==="answer"?(a.get(N.id)?.(N),a.delete(N.id)):N.type==="event"&&typeof N.listener=="number"?e.onEvent?.(N):N.type==="heartbeat"&&typeof N.beat=="number"&&u({type:"heartbeat",beat:N.beat});e.onMessage?.(N)}},h=()=>{},g=E=>{if(n||!t.fromHost(E)||!Mr(E.data)||E.data.protocol!==1)return;let N=E.ports[0];if(N){n=N,r=E.data.nonce,n.onmessage=m,n.start?.(),h();for(let C of c.splice(0))u(C)}};h=t.listen(g),t.ready({graview:"guest-ready",protocol:1});let y,O={get props(){return o},subscribe(E){return s.add(E),()=>s.delete(E)},act(E,N={}){let C=i+=1;return new Promise(L=>{a.set(C,L),u({type:"act",id:C,name:E,args:N})})},navigate(E){let N=on(E);N&&u(N)},size(E){u({type:"size",height:E})},autoSize(E){let N=E??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!N||!C||typeof N.getBoundingClientRect!="function")return()=>{};y?.disconnect();let L=new C(()=>O.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),y=L,()=>L.disconnect()},close(){y?.disconnect(),h(),n?.close(),s.clear()}};return{guest:O,send:u}}var Hr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],Ur=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Br=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Vr=["TEMPORARY","PERSISTENT"],gl=Object.freeze([...Hr,...Ur,...Br,...Vr]),yl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Gr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function zr(t=globalThis,e=[],n={}){let r=[],o=[],i=new Set([...Hr,...Ur,...Br,...e,"constructor",Symbol.toStringTag]),s=(x,k)=>{let j=Reflect.getOwnPropertyDescriptor(x,k);return j===void 0||!("value"in j)||j.writable||j.configurable?!1:n.primitivesStay&&typeof k=="symbol"&&(typeof j.value!="object"||j.value===null)&&typeof j.value!="function"?!0:Vr.includes(k)&&typeof j.value=="number"},a=t,c=a.setTimeout,u=a.setInterval,m=a.crypto,h=(x,k)=>function(j,We,...mt){if(typeof j!="function")throw new TypeError(`${k} takes a function: a guest view cannot run code from text`);return x.call(t,j,We,...mt)},g=m?Object.freeze({getRandomValues:x=>m.getRandomValues(x)}):void 0,y=a.document?.defaultView;if(y&&y!==a)for(let x of Reflect.ownKeys(y))typeof x=="symbol"||i.has(x)||Reflect.deleteProperty(y,x)||o.push(`window.${x}`);let O=[];for(let x=t;x&&x!==Object.prototype;x=Object.getPrototypeOf(x))O.push(x);for(let x of O)for(let k of Reflect.ownKeys(x))i.has(k)||(Reflect.deleteProperty(x,k)?r.push(Gr(k)):s(x,k)||o.push(Gr(k)));let E=()=>function(){throw new EvalError("A guest view cannot make code from text.")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let x of N){let k=E();Object.defineProperty(k,"prototype",{value:x,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(x,"constructor",{value:k,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),x===Function.prototype&&Reflect.defineProperty(t,"Function",{value:k,writable:!0,enumerable:!1,configurable:!0})}let C=(x,k)=>{Reflect.defineProperty(t,x,{value:k,writable:!0,enumerable:!0,configurable:!0})||o.push(x)};C("setTimeout",h(c,"setTimeout")),C("setInterval",h(u,"setInterval")),g&&C("crypto",g);for(let x of O.slice(1))Object.freeze(x);for(let x of Reflect.ownKeys(t)){let k=Reflect.getOwnPropertyDescriptor(t,x);Reflect.defineProperty(t,x,"value"in k?{...k,writable:!1,configurable:!1}:{...k,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var dt=class extends HTMLElement{constructor(){super(),nn(this,Dn)}connect(e){if(Fe(this)===e||(je(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Dn,qe(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Bn(this,e,n)}callRemoteMethod(e,...n){return Vn(this,e,...n)}};var d={},sn={empty:!0},Uo={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},zn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:sn,br:sn,wbr:sn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:d,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:d,output:d,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":sn},Bo=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Vo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Bo.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},an={viewBox:"geometry",preserveAspectRatio:"geometry"},Fr={oneOf:["userSpaceOnUse","objectBoundingBox"]},jr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Yr={svg:{attributes:{...ue,...an}},g:d,defs:d,symbol:{attributes:{...ue,...an,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...an,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...an,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:d,filter:{attributes:{...ue,filterUnits:Fr,primitiveUnits:Fr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:jr,yChannelSelector:jr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Wr={section:["aria-label","title"]};function zo(t){return/^aria-[a-z]+$/.test(t)}function Fo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var jo=new Map(Object.keys(Yr).map(t=>[t.toLowerCase(),t]));function Xr(t){return jo.get(t.toLowerCase())}function $r(t,e,n){let r=n.toLowerCase(),o=t==="html"?[zn[e]?.attributes,Uo]:[Yr[e]?.attributes,Vo],i=t==="svg"&&r==="xlink:href"?"href":r;for(let s of o)if(s){for(let[a,c]of Object.entries(s))if(a.toLowerCase()===i)return{name:a,kind:c}}if(zo(r)||Fo(r))return{name:r,kind:"text"}}var Kr="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ie=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>ie(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ie(r,e+1)]))};function Zr(){let t=new Map,e=new Map,n=new Map([[Kr,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},i=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},s=u=>{let m=n.get(u);if(m){n.delete(u);for(let h of m.listeners.values())i(h);for(let h of m.children)s(h)}},a=(u,m,h=0)=>{if(!ln(u)||h>64)return ie(u);let g=typeof u.id=="string"?u.id:void 0,y=m&&g!==void 0&&g!==Kr;y&&s(g);let O={children:[],listeners:new Map};y&&n.set(g,O);let E={};for(let[N,C]of Object.entries(u))N==="children"&&Array.isArray(C)?E[N]=C.map(L=>{let x=a(L,y,h+1);return y&&ln(L)&&typeof L.id=="string"&&O.children.push(L.id),x}):N==="eventListeners"&&ln(C)?E[N]=Object.fromEntries(Object.entries(C).map(([L,x])=>{if(typeof x!="function"||!y)return[L,void 0];let k=o(x);return O.listeners.set(L,k),[L,{listener:k}]})):E[N]=ie(C,h+1);return E},c=u=>{if(!Array.isArray(u))return ie(u);let[m,h]=u,g=typeof h=="string"?n.get(h):void 0;if(m===0){let y=a(u[2],g!==void 0),O=ln(u[2])?u[2].id:void 0;if(g&&typeof O=="string"&&n.has(O)){let E=Number(u[3]);g.children.splice(Number.isInteger(E)&&E>=0&&E<=g.children.length?E:g.children.length,0,O)}return[m,ie(h),y,ie(u[3])]}if(m===1){let y=Number(u[2]);return g&&Number.isInteger(y)&&y>=0&&y<g.children.length&&s(g.children.splice(y,1)[0]),ie(u)}if(m===3&&u[4]===3){let y=String(u[2]),O=u[3],E=g&&typeof O=="function"?o(O):void 0,N=g?.listeners.get(y);return N!==void 0&&i(N),E===void 0?g?.listeners.delete(y):g.listeners.set(y,E),[m,ie(h),y,E===void 0?void 0:{listener:E},3]}return ie(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",qo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Yo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Wo=t=>Object.freeze({html:t,toString:()=>t}),Qr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Jr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Jr).join(""):Qr(t)?t.html:Yo(String(t));function eo(t){customElements.get(cn)||customElements.define(cn,dt);let e=Event,n=Zr(),r=new Set,o=new Set,i,s=[],a=new Set;for(let l of["closest","matches","dataset"]){let f=()=>{throw new TypeError(`A view\'s element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l==="dataset"?{get:f}:{value:f})}let c=document.createElement(cn),u=l=>{let f=b=>{for(let w of Array.from(b.childNodes)){if(w.nodeType!==1)continue;if($(w)===l)return w;let T=f(w);if(T)return T}};return f(c)},m=l=>{let f=u(l.target);if(!f)return;let b=new e(l.event,{bubbles:!0}),w={};for(let T of qo)l[T]!==void 0&&(w[T]=l[T]);for(let T of Object.keys(w))Object.defineProperty(b,T,{value:w[T],enumerable:!0});f.dispatchEvent(b);for(let T of o){if(T.type!==l.event)continue;let _;try{_=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let z=f;z&&z!==c;z=z.parentNode)if(_.has(z)){T.listener(Object.freeze({type:l.event,target:f,element:z,...w}));break}}},h=l=>{if(l.type==="dom-event"&&typeof l.target=="string")return m(l);if(l.type==="notice")return t.warn(l.text);if(l.type!=="props")return;i=l.props;let f=t.now();for(let T of r)try{T(l.props)}catch(_){t.threw(_)}let b=t.now()-f,w=l.push;typeof w=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:w,ms:b})))},g;c.connect({mutate(l){g||(g=[],t.microtask(()=>{let f=g??[];g=void 0,t.send({type:"render",records:n.encode(f)})})),g.push(...l)},call:()=>{}});let y=l=>l.nodeType===1?l.getAttribute("data-key")??l.getAttribute("id"):null,O=(l,f)=>l.nodeType===f.nodeType&&(l.nodeType!==1||l.localName===f.localName&&l.namespaceURI===f.namespaceURI&&y(l)===y(f));function E(l,f){let b=Array.from(f.childNodes),w=0;for(let T of b){let _=l.childNodes[w]??null;if(_&&O(_,T)){N(_,T),w+=1;continue}if(y(T)!==null){let de=Array.from(l.childNodes).slice(w+1).find(Xe=>O(Xe,T));if(de){l.insertBefore(de,_),N(de,T),w+=1;continue}}l.insertBefore(T,_),w+=1}for(;l.childNodes.length>w;)l.removeChild(l.lastChild)}function N(l,f){if(l.nodeType!==1){l.data!==f.data&&(l.data=f.data);return}let b=l,w=f,T=C(b);for(let _ of b.getAttributeNames())w.hasAttribute(_)||(b.removeAttribute(_),T&&Ne(b,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);b.getAttribute(_)!==z&&b.setAttribute(_,z),T&&Ne(b,_,z)}E(b,w)}let C=l=>l.localName.includes("-");function L(l){for(let f of Array.from(l.childNodes)){if(f.nodeType!==1)continue;let b=f;if(C(b))for(let w of b.getAttributeNames())Ne(b,w,b.getAttribute(w)??void 0);L(b)}}function x(l,f,b){for(let w of Array.from(l.childNodes)){if(w.nodeType!==1)continue;let T=w,_=T.localName,z=f||_.toLowerCase()==="svg",de=z?Xr(_):Object.prototype.hasOwnProperty.call(zn,_.toLowerCase())?_.toLowerCase():void 0;if(!de){b.add(`<${_}>`);continue}for(let Xe of T.getAttributeNames())(!$r(z?"svg":"html",de,Xe)||!z&&Wr[de]?.includes(Xe.toLowerCase()))&&b.add(`${de} ${Xe}`);x(T,z,b)}}function k(l){let f=document.createElement("div"),b=Array.isArray(l)?l:[l];for(let T of b)if(T!=null)if(typeof T=="string"||Qr(T)){let _=document.createElement("div");_.innerHTML=typeof T=="string"?T:T.html,f.append(...Array.from(_.childNodes))}else f.append(T);let w=new Set;x(f,!1,w),s=[...w],s.length>0&&t.warn(`The host will not draw: ${s.join(", ")}`),L(f),E(c,f)}let j=[],We=new Set(Ir),mt="[]",un=!1,Yn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Map([...o].filter(b=>We.has(b.type)).map(b=>[`${b.type} ${b.selector}`,{event:b.type,selector:b.selector}])).entries()].sort(([b],[w])=>b<w?-1:b>w?1:0).map(([,b])=>b),f=JSON.stringify(l);f!==mt&&(mt=f,t.send({type:"gestures",bound:l}))}))},Wn="[]",dn=!1,Xn=()=>{dn||(dn=!0,t.microtask(()=>{dn=!1;let l=[...new Set([...o].filter(b=>b.type==="click"&&typeof b.selector=="string").map(b=>b.selector))].sort().slice(0,200),f=JSON.stringify(l);f!==Wn&&(Wn=f,t.send({type:"clicks",selectors:l}))}))};return{view:Object.freeze({get props(){return i},onProps(l){return r.add(l),i&&l(i),()=>void r.delete(l)},render:k,style(l){typeof l!="string"||j.includes(l)||(j.push(l),t.send({type:"style",sheets:[...j]}))},on(l,f,b){let w={type:l,selector:f,listener:b};return o.add(w),typeof l=="string"&&!a.has(l)&&(a.add(l),t.send({type:"hears",events:[l]})),We.has(l)&&Yn(),l==="click"&&Xn(),()=>{o.delete(w),We.has(l)&&Yn(),l==="click"&&Xn()}},act:(l,f={})=>t.act(l,f),navigate(l){if(typeof l=="string")return t.navigate(l);let f=on(l);f&&t.send(f)},html(l,...f){return Wo(l.reduce((b,w,T)=>b+w+(T<f.length?Jr(f[T]):""),""))},get refused(){return s},get hardening(){return t.hardening()}}),hear:h,find:l=>{try{let f=c.querySelectorAll(l)[0];return f?$(f):void 0}catch{return}},listened:l=>{let f=new Set;for(let b of o)if(b.type===l)try{for(let w of Array.from(c.querySelectorAll(b.selector))){let T=$(w);T&&f.add(T)}}catch{}return[...f]}}}var qn={removed:[],stuck:[],sealed:!1,worker:!1},Fn=Lr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>to.hear(t)}),to=eo({send:t=>Fn.send(t),act:(t,e)=>Fn.guest.act(t,e),navigate:t=>Fn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>qn}),Xo=to.view;Object.defineProperty(globalThis,"graview",{value:Xo,enumerable:!0,configurable:!0,writable:!1});var jn="WorkerGlobalScope"in globalThis?zr(globalThis,["graview"]):qn;qn=jn;if(jn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${jn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ga as l,ma as p,rb as a}from"./chunk.DIFR37EZ.js";import{c}from"./chunk.FQLNBIQ5.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
|