graview 0.1.70 → 0.1.72
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.2IOJNFCR.js +1 -0
- package/dist/preview/{chunk.I7CSRZC2.js → chunk.2Q4ZXP7P.js} +1 -1
- package/dist/preview/{chunk.O2XPLDMM.js → chunk.2TTKQAWQ.js} +1 -1
- package/dist/preview/chunk.2YSE3SQN.js +23 -0
- package/dist/preview/{chunk.NZFO6BM3.js → chunk.2ZPR6FRI.js} +1 -1
- package/dist/preview/chunk.3BE4SHZD.js +1 -0
- package/dist/preview/{chunk.QODVFVWE.js → chunk.43HWCHBN.js} +1 -1
- package/dist/preview/{chunk.QILGAV7H.js → chunk.45OLF6BK.js} +1 -1
- package/dist/preview/{chunk.NTAC5NNE.js → chunk.47QWCVZD.js} +1 -1
- package/dist/preview/{chunk.7HNMG6LG.js → chunk.4A7BRBEA.js} +1 -1
- package/dist/preview/chunk.4EPCI6VY.js +1 -0
- package/dist/preview/{chunk.OXXZGPJZ.js → chunk.4PB5UFUJ.js} +1 -1
- package/dist/preview/{chunk.SWY6DIE4.js → chunk.4TDYDIIM.js} +3 -3
- package/dist/preview/{chunk.6VG2LCES.js → chunk.4VX7GPFS.js} +1 -1
- package/dist/preview/{chunk.TUVPQLFL.js → chunk.523X2YEQ.js} +1 -1
- package/dist/preview/{chunk.CHG522KL.js → chunk.53GQQETN.js} +1 -1
- package/dist/preview/{chunk.NBB5ALVJ.js → chunk.5MKZTHU2.js} +1 -1
- package/dist/preview/chunk.5OS4SYHE.js +1 -0
- package/dist/preview/{chunk.ZTHZHBVN.js → chunk.5ZT4R227.js} +1 -1
- package/dist/preview/{chunk.RIP2SAQ5.js → chunk.65SI77M7.js} +1 -1
- package/dist/preview/chunk.6ESAFTWB.js +1 -0
- package/dist/preview/chunk.6GUIFP2A.js +1 -0
- package/dist/preview/{chunk.M3HLZX6Q.js → chunk.6GZYKHEN.js} +1 -1
- package/dist/preview/{chunk.UVMHC6VM.js → chunk.6YKKZI4H.js} +1 -1
- package/dist/preview/{chunk.BBLA4PSP.js → chunk.73RMM4W7.js} +1 -1
- package/dist/preview/chunk.7DCBIMOI.js +1 -0
- package/dist/preview/chunk.7JE3J7H4.js +1 -0
- package/dist/preview/{chunk.YTRUZ56A.js → chunk.7QGDWAHH.js} +1 -1
- package/dist/preview/{chunk.JEQ6CA5M.js → chunk.7VCYVCYM.js} +2 -2
- package/dist/preview/{chunk.X7HMTN3Z.js → chunk.A4TBVXHQ.js} +1 -1
- package/dist/preview/{chunk.J4NY2K2A.js → chunk.A6LJPXJ3.js} +1 -1
- package/dist/preview/chunk.AAPXF6NP.js +1 -0
- package/dist/preview/chunk.APUICV5Z.js +1 -0
- package/dist/preview/chunk.ASNVH2G4.js +25 -0
- package/dist/preview/{chunk.CM7EDQ4E.js → chunk.CJHCUHVN.js} +1 -1
- package/dist/preview/chunk.CUEPNS3Z.js +1 -0
- package/dist/preview/{chunk.U3CV227I.js → chunk.CUJRWBPX.js} +1 -1
- package/dist/preview/{chunk.7TZXDPPO.js → chunk.D5PW6YWF.js} +3 -3
- package/dist/preview/chunk.DCIYOZYP.js +1 -0
- package/dist/preview/chunk.DEBW4FH6.js +1 -0
- package/dist/preview/{chunk.MR776WQ2.js → chunk.DYPSFTRP.js} +1 -1
- package/dist/preview/{chunk.BBMX3IIO.js → chunk.E6QZUT4L.js} +1 -1
- package/dist/preview/chunk.E7QZZRAQ.js +17 -0
- package/dist/preview/chunk.EHCMBAZO.js +3 -0
- package/dist/preview/chunk.EXTD5JWD.js +1 -0
- package/dist/preview/{chunk.KOVTQCHX.js → chunk.EZF2T3XQ.js} +1 -1
- package/dist/preview/chunk.EZSST3IU.js +1 -0
- package/dist/preview/{chunk.DIVANC3G.js → chunk.F2BZ4SC4.js} +1 -1
- package/dist/preview/chunk.F2I7ERGM.js +1 -0
- package/dist/preview/{chunk.UWEFODVV.js → chunk.FCV3NX6L.js} +1 -1
- package/dist/preview/{chunk.NZ5TJKPT.js → chunk.FFTBUXKX.js} +2 -2
- package/dist/preview/chunk.FILBI7XA.js +1 -0
- package/dist/preview/{chunk.MGG5DH2S.js → chunk.FKSI5522.js} +1 -1
- package/dist/preview/{chunk.I3ADXJQW.js → chunk.FQ2QUDZS.js} +1 -1
- package/dist/preview/{chunk.A5ENJJZN.js → chunk.G2ZDDO3C.js} +1 -1
- package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
- package/dist/preview/chunk.GH6QX7JR.js +87 -0
- package/dist/preview/chunk.GMHBAS45.js +1 -0
- package/dist/preview/{chunk.YCMMATFK.js → chunk.GOVRX2YX.js} +1 -1
- package/dist/preview/chunk.GXK5PI7I.js +1 -0
- package/dist/preview/{chunk.RECTEAG4.js → chunk.GYP3EF6Z.js} +1 -1
- package/dist/preview/chunk.H2RVMT4Y.js +111 -0
- package/dist/preview/chunk.HCHGKI64.js +1 -0
- package/dist/preview/chunk.HE7SAJKZ.js +1 -0
- package/dist/preview/{chunk.WAIIXXVI.js → chunk.HIIYDKFC.js} +2 -2
- package/dist/preview/chunk.HPDUGKEF.js +32 -0
- package/dist/preview/{chunk.DGDOZHYK.js → chunk.HQRPOGTS.js} +1 -1
- package/dist/preview/chunk.HUJLELZ3.js +1 -0
- package/dist/preview/chunk.HVRUHRXR.js +1 -0
- package/dist/preview/{chunk.6KYTCEIH.js → chunk.I46VNAMS.js} +1 -1
- package/dist/preview/{chunk.QAERSZVB.js → chunk.ID4GOKT6.js} +1 -1
- package/dist/preview/{chunk.RJ7UV3XI.js → chunk.IZKCTF2R.js} +1 -1
- package/dist/preview/chunk.IZUAZ6EV.js +1 -0
- package/dist/preview/{chunk.ZIGW5VOT.js → chunk.J3CUBMUZ.js} +1 -1
- package/dist/preview/{chunk.3HFBHLXC.js → chunk.J4D4BIB4.js} +1 -1
- package/dist/preview/{chunk.IRPMGHZN.js → chunk.J7GH2CGV.js} +1 -1
- package/dist/preview/{chunk.SSHEFQ4R.js → chunk.JE4RBRKH.js} +1 -1
- package/dist/preview/{chunk.4BSEYZMS.js → chunk.JJSZLCNU.js} +1 -1
- package/dist/preview/{chunk.KV3N6VRG.js → chunk.JKX4J3KG.js} +1 -1
- package/dist/preview/{chunk.FUTSLXWN.js → chunk.JMXBMLKH.js} +1 -1
- package/dist/preview/chunk.JOB3EKS6.js +1 -0
- package/dist/preview/{chunk.5IM2X3VT.js → chunk.JP33TNCH.js} +1 -1
- package/dist/preview/{chunk.BZXJKWNI.js → chunk.K6EN2YR4.js} +1 -1
- package/dist/preview/chunk.K6YKXTKC.js +1 -0
- package/dist/preview/{chunk.A7JORJJL.js → chunk.KAIZDIRK.js} +1 -1
- package/dist/preview/{chunk.7LAXSQQY.js → chunk.KAQGSLC6.js} +3 -3
- package/dist/preview/{chunk.QG3LV4RH.js → chunk.KFYSKZC4.js} +1 -1
- package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
- package/dist/preview/chunk.KHVW6Q3T.js +1 -0
- package/dist/preview/chunk.KMFH26SS.js +1 -0
- package/dist/preview/{chunk.2T24FYAO.js → chunk.L3ST2YKI.js} +1 -1
- package/dist/preview/{chunk.HIJ72QX6.js → chunk.L6BLZJ6K.js} +1 -1
- package/dist/preview/{chunk.NCBUECIW.js → chunk.LG2BQ5LB.js} +1 -1
- package/dist/preview/{chunk.LZ3HO3HM.js → chunk.LLYHHG67.js} +1 -1
- package/dist/preview/{chunk.VKQONZKR.js → chunk.LPWANRBL.js} +1 -1
- package/dist/preview/{chunk.3MPLUSVY.js → chunk.LSS64NAA.js} +1 -1
- package/dist/preview/{chunk.SUYYDJGZ.js → chunk.MFNWHXGL.js} +1 -1
- package/dist/preview/{chunk.UJF6YTEO.js → chunk.MNH3WUAB.js} +1 -1
- package/dist/preview/chunk.MQ7AB5N4.js +1 -0
- package/dist/preview/{chunk.CZUUFO6A.js → chunk.MU5JK5TK.js} +1 -1
- package/dist/preview/{chunk.RXUL6P7Y.js → chunk.N5CACZ5F.js} +1 -1
- package/dist/preview/{chunk.S6IKR6RD.js → chunk.NFC2TYA6.js} +1 -1
- package/dist/preview/{chunk.TD2V74XU.js → chunk.NKRDVOLJ.js} +1 -1
- package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
- package/dist/preview/{chunk.J65CZJIC.js → chunk.NVPKYWMF.js} +1 -1
- package/dist/preview/{chunk.DWMFLLJO.js → chunk.NWJ7ELHN.js} +1 -1
- package/dist/preview/{chunk.NKUNCQB3.js → chunk.O5P6LXHF.js} +1 -1
- package/dist/preview/{chunk.2MWEYNVH.js → chunk.OFK6673S.js} +1 -1
- package/dist/preview/{chunk.C4LC2UEU.js → chunk.OG6FEP3K.js} +1 -1
- package/dist/preview/{chunk.CZI6J5CE.js → chunk.OHGAZ3D5.js} +1 -1
- package/dist/preview/{chunk.XJ4JYROM.js → chunk.ONVYKLRX.js} +1 -1
- package/dist/preview/chunk.OQ3FKUP2.js +1 -0
- package/dist/preview/chunk.OUJV4CYS.js +1 -0
- package/dist/preview/{chunk.T552MHMU.js → chunk.OWHH7JDV.js} +1 -1
- package/dist/preview/{chunk.SCN6IYDG.js → chunk.OXDCGGZV.js} +1 -1
- package/dist/preview/{chunk.YIDNZTON.js → chunk.P3Z4ZCL3.js} +1 -1
- package/dist/preview/chunk.PF7XQ5R5.js +1 -0
- package/dist/preview/{chunk.FSZQTX3K.js → chunk.PGT4ZQDG.js} +4 -4
- package/dist/preview/chunk.PH547SON.js +1 -0
- package/dist/preview/chunk.PS765ODQ.js +3 -0
- package/dist/preview/{chunk.MZSWWMX6.js → chunk.PVAYYFT2.js} +1 -1
- package/dist/preview/{chunk.F5STM4DX.js → chunk.Q6WOIE5I.js} +1 -1
- package/dist/preview/{chunk.55C7WO4X.js → chunk.QE257AXE.js} +1 -1
- package/dist/preview/chunk.QKNC5OUC.js +1 -0
- package/dist/preview/chunk.QMGBAKX6.js +2 -0
- package/dist/preview/{chunk.4QBW46XV.js → chunk.QNFX5VHW.js} +1 -1
- package/dist/preview/chunk.QPCDAQTW.js +1 -0
- package/dist/preview/{chunk.TS5APXWC.js → chunk.QPTQIGLX.js} +1 -1
- package/dist/preview/{chunk.LZNHTROY.js → chunk.R5YGW5ZX.js} +1 -1
- package/dist/preview/{chunk.4VTUC5TF.js → chunk.RJ6KEVZC.js} +1 -1
- package/dist/preview/{chunk.6QMRDSTD.js → chunk.RKVMRP7B.js} +1 -1
- package/dist/preview/{chunk.YBQUP3KE.js → chunk.S7U2CHHG.js} +1 -1
- package/dist/preview/{chunk.CLJKQLK2.js → chunk.SD2UYSV6.js} +2 -2
- package/dist/preview/chunk.SI5GGFQR.js +1 -0
- package/dist/preview/{chunk.7QWGIGHM.js → chunk.SMF5S4DQ.js} +1 -1
- package/dist/preview/{chunk.LEZGBHPZ.js → chunk.SNDFIJVX.js} +1 -1
- package/dist/preview/{chunk.F5756PXX.js → chunk.STHWM422.js} +2 -2
- package/dist/preview/{chunk.JIEBGUCA.js → chunk.SV75TRCH.js} +1 -1
- package/dist/preview/{chunk.U2DZE7A5.js → chunk.SXGPRFA4.js} +1 -1
- package/dist/preview/{chunk.ZGJUCVT5.js → chunk.T3RFZ66S.js} +1 -1
- package/dist/preview/{chunk.I6HIVTXU.js → chunk.T6ISUVUP.js} +1 -1
- package/dist/preview/{chunk.R65YX332.js → chunk.TBLOBXZ2.js} +1 -1
- package/dist/preview/{chunk.CVVNHQPO.js → chunk.TDWJU6GW.js} +1 -1
- package/dist/preview/{chunk.2QALBEWP.js → chunk.THLT6NVO.js} +1 -1
- package/dist/preview/{chunk.7FTATAH2.js → chunk.TQCVEKPH.js} +1 -1
- package/dist/preview/{chunk.PAIBRJVZ.js → chunk.TQF5XCUS.js} +1 -1
- package/dist/preview/{chunk.F5XWYO5W.js → chunk.TRP66PHK.js} +1 -1
- package/dist/preview/chunk.TWXYI5AP.js +2 -0
- package/dist/preview/{chunk.IQCMV5WD.js → chunk.UOUQZYVD.js} +1 -1
- package/dist/preview/{chunk.FJXKQZZS.js → chunk.UPL3D3ZO.js} +1 -1
- package/dist/preview/{chunk.U5Q7EVZQ.js → chunk.UXW43HNW.js} +1 -1
- package/dist/preview/{chunk.ZOSTOVXR.js → chunk.V4GSVXSV.js} +1 -1
- package/dist/preview/chunk.VCEDSOAK.js +1 -0
- package/dist/preview/{chunk.4O3STSC4.js → chunk.VE4AQFLW.js} +1 -1
- package/dist/preview/{chunk.HMV4ILAC.js → chunk.VGQDPEB5.js} +1 -1
- package/dist/preview/{chunk.5A5DI36V.js → chunk.VMYXBFPE.js} +1 -1
- package/dist/preview/{chunk.BQWMHHAZ.js → chunk.VNI6HZEF.js} +2 -2
- package/dist/preview/chunk.VQRY2NQ6.js +1 -0
- package/dist/preview/{chunk.K6EKSURO.js → chunk.VUE6ILQV.js} +1 -1
- package/dist/preview/{chunk.3KF5RYPW.js → chunk.W2VSEEKX.js} +1 -1
- package/dist/preview/{chunk.KP7HUXH5.js → chunk.WAPY4RCS.js} +1 -1
- package/dist/preview/chunk.WFRSGGU5.js +1 -0
- package/dist/preview/{chunk.XAN7QXMQ.js → chunk.WIVNFOQR.js} +1 -1
- package/dist/preview/chunk.WRIBFLVG.js +1 -0
- package/dist/preview/{chunk.TVNY7F64.js → chunk.WWD2TS47.js} +1 -1
- package/dist/preview/{chunk.5W7EGQCQ.js → chunk.WWFOQDPR.js} +2 -2
- package/dist/preview/{chunk.FBDCHJS2.js → chunk.X45EITTK.js} +1 -1
- package/dist/preview/{chunk.5FQHZVE3.js → chunk.X5MCAUFX.js} +1 -1
- package/dist/preview/{chunk.IJVR7ZL7.js → chunk.XBWFQ54R.js} +1 -1
- package/dist/preview/{chunk.JPJHM62B.js → chunk.XMBGT6UT.js} +1 -1
- package/dist/preview/chunk.XP4IVKKR.js +1 -0
- package/dist/preview/chunk.XYBWBMNU.js +1 -0
- package/dist/preview/{chunk.MYR36HW4.js → chunk.YC2IDHQX.js} +1 -1
- package/dist/preview/{chunk.ZQSV5XVB.js → chunk.YCYJHPWS.js} +1 -1
- package/dist/preview/{chunk.BJ3G7J2Z.js → chunk.YF5GCOSZ.js} +3 -2
- package/dist/preview/{chunk.3I2SGKKF.js → chunk.YGGBGHZU.js} +1 -1
- package/dist/preview/chunk.YRC6PKXP.js +1 -0
- package/dist/preview/{chunk.6NYSB6OZ.js → chunk.YRN67Z5K.js} +1 -1
- package/dist/preview/chunk.ZDUKVXBI.js +5 -0
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2QOB62XU.js +0 -1
- package/dist/preview/chunk.36FKQJFM.js +0 -2
- package/dist/preview/chunk.3A3DCALP.js +0 -1
- package/dist/preview/chunk.3GPYKWAD.js +0 -1
- package/dist/preview/chunk.3QPMFUMV.js +0 -1
- package/dist/preview/chunk.3ZP6IDUC.js +0 -1
- package/dist/preview/chunk.53HW224Y.js +0 -1
- package/dist/preview/chunk.AW74DZ5V.js +0 -17
- package/dist/preview/chunk.C67TMA4U.js +0 -111
- package/dist/preview/chunk.CCCSZRKU.js +0 -1
- package/dist/preview/chunk.CUA7F3YJ.js +0 -25
- package/dist/preview/chunk.DBSSCJQM.js +0 -1
- package/dist/preview/chunk.DW6KXAUM.js +0 -1
- package/dist/preview/chunk.DWPM7AWA.js +0 -1
- package/dist/preview/chunk.FXCKKVT5.js +0 -1
- package/dist/preview/chunk.HHQUCFN4.js +0 -1
- package/dist/preview/chunk.HPWMCS3H.js +0 -23
- package/dist/preview/chunk.HRLCDBMO.js +0 -1
- package/dist/preview/chunk.I7ODVOO5.js +0 -1
- package/dist/preview/chunk.IANOWT3Z.js +0 -1
- package/dist/preview/chunk.IFPJPJ4M.js +0 -1
- package/dist/preview/chunk.IUVRJDL3.js +0 -5
- package/dist/preview/chunk.J4CSY2D5.js +0 -2
- package/dist/preview/chunk.JJIKTTXB.js +0 -1
- package/dist/preview/chunk.KDOJC4FX.js +0 -1
- package/dist/preview/chunk.KJAOJTZZ.js +0 -1
- package/dist/preview/chunk.KLZPUTMU.js +0 -1
- package/dist/preview/chunk.LQ2PDW2M.js +0 -32
- package/dist/preview/chunk.M7DJJRFH.js +0 -1
- package/dist/preview/chunk.MNWP3TPN.js +0 -1
- package/dist/preview/chunk.MSWOETXN.js +0 -1
- package/dist/preview/chunk.NILR2BWR.js +0 -1
- package/dist/preview/chunk.NNYKLENL.js +0 -1
- package/dist/preview/chunk.PYGNO2AV.js +0 -87
- package/dist/preview/chunk.PZHCWMKT.js +0 -1
- package/dist/preview/chunk.QQUZ5RTQ.js +0 -1
- package/dist/preview/chunk.QVID5WHS.js +0 -1
- package/dist/preview/chunk.RHV73CBA.js +0 -3
- package/dist/preview/chunk.RP6C2IUM.js +0 -1
- package/dist/preview/chunk.RPHZY7N4.js +0 -1
- package/dist/preview/chunk.RSMCTI2N.js +0 -1
- package/dist/preview/chunk.S4QSZRKH.js +0 -1
- package/dist/preview/chunk.T4QRIJE4.js +0 -1
- package/dist/preview/chunk.UJM5EZDM.js +0 -3
- package/dist/preview/chunk.UJPX3BUV.js +0 -1
- package/dist/preview/chunk.UYBSVE2W.js +0 -1
- package/dist/preview/chunk.WMZ2BINI.js +0 -1
- package/dist/preview/chunk.X2RHBTJI.js +0 -1
- package/dist/preview/chunk.X3FPVFFB.js +0 -1
- package/dist/preview/chunk.X4PFLIXB.js +0 -1
- package/dist/preview/chunk.YR7DKU5T.js +0 -1
- package/dist/preview/chunk.ZBK3FCVE.js +0 -1
- package/dist/preview/chunk.ZH5L746C.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as K,c as R,d as S}from"./chunk.AAPXF6NP.js";import{a as N}from"./chunk.QDVGHI7R.js";import{L as M,P as O,S as V,gb as W,hb as G,jb as I}from"./chunk.ZDUKVXBI.js";function E(e,t,n){let s=e.schema.tryDefinition(t)?.fields?.shape?.[n];return s===void 0?void 0:N(s)}function Z(e,t){if(e===void 0)return[];if(!Array.isArray(e))return[`The view's accepts is a list of { "kind": <a kind>, "field": <its image, video or file field> }.`];let n=[],i=new Set(t.schema.kinds);for(let s of e){let{kind:d,field:o}=s??{};typeof d!="string"||typeof o!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):i.has(d)?E(t,d,o)?t.allMutations().some(a=>(a.creates??[]).includes(d)&&Object.hasOwn(a.input?.shape??{},o))||n.push(`No act of this app makes a "${d}" with its "${o}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${d}'s "${o}", which holds no picture, video or file.`):n.push(`The view accepts files for "${d}", which is no kind of this app.`)}return n}function _(e,t,n){if(e===void 0||e===!0)return[];let i=`The view's pictures is true; the kinds whose pictures it draws, ["circuit"]; or { "width": <the widest it draws a picture, in pixels> } with the fields it draws them from, by kind, { "circuit": "photo" }.`;if(typeof e!="object"||e===null)return[i];let s=new Set([...n.attach==="home"?[]:[n.attach],...n.reads?.kinds??[]]),d=new Set(t.schema.kinds),o=[],a=c=>{if(!d.has(c))return void o.push(`The view's pictures chooses "${c}", which is no kind of this app.`);s.has(c)||o.push(`The view's pictures chooses "${c}", whose records it is not handed: add "${c}" to its reads.kinds.`)};if(Array.isArray(e)){if(e.length===0||!e.every(c=>typeof c=="string"))return[i];for(let c of e)a(c);return o}for(let[c,l]of Object.entries(e)){if(c==="records"&&typeof l!="string"&&!Array.isArray(l)){let{subject:u,ids:p,...k}=typeof l=="object"&&l!==null?l:{rest:!0},g=p===void 0||Array.isArray(p)&&p.length>0&&p.length<=200&&p.every(m=>typeof m=="string"&&m.length>0&&m.length<=200);Object.keys(k).length>0||u!==void 0&&u!==!0||!g||u===void 0&&p===void 0?o.push(`The view's pictures records is { "subject": true } \u2014 the record it is drawn over and the records linked to it by an edge it reads \u2014 and/or { "ids": [<1 to 200 record ids>] } (view-pictures-records).`):u===!0&&(n.attach==="home"||n.cardinality!=="one")&&o.push(`The view's pictures records { "subject": true } is the record a view of one is drawn over and the records linked to it: a view of many, or the home, is drawn over no one record, so list the records by "ids", or cap its pictures with "most" (view-pictures-records).`);continue}if(c==="most"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=1&&l<=500||o.push("The view's pictures most is a whole number from 1 to 500: the most pictures it is handed, in the order its records are handed (view-pictures-most).");continue}if(c==="width"&&typeof l!="string"&&!Array.isArray(l)){Number.isInteger(l)&&l>=16&&l<=4096||o.push("The view's pictures width is a whole number of pixels from 16 to 4096.");continue}let w=typeof l=="string"?[l]:Array.isArray(l)&&l.length>0&&l.every(u=>typeof u=="string")?l:void 0;if(!w){o.push(`The view's pictures says "${c}": beside "width", it names a kind and the field it draws pictures from, "circuit": "photo", or its fields, "circuit": ["photo", "map"].`);continue}let y=o.length;if(a(c),!(o.length>y))for(let u of w){let p=E(t,c,u);p?p.as==="video"&&o.push(`The view's pictures chooses ${c}'s "${u}", which holds videos: the host plays a video where the view places it, and hands no picture of it.`):o.push(`The view's pictures chooses ${c}'s "${u}", which holds no picture.`)}}return o}function B(e){if(e===void 0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's scene is { "maxHeight": <the tallest its preview on the Scene is drawn, in pixels> }.`];let{maxHeight:t,...n}=e,i=[];return Object.keys(n).length>0&&i.push(`The view's scene says ${Object.keys(n).map(s=>`"${s}"`).join(", ")}: only "maxHeight" is read.`),t!==void 0&&!(Number.isInteger(t)&&t>=80&&t<=4e3)&&i.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),i}function F(e){return(e.acts??[]).map(t=>typeof t=="string"?{act:t}:t)}function ee(e,t){let n=[],i=new Set(t.schema.kinds),s=new Set(t.schema.edgeKinds),d=new Set(t.allMutations().map(a=>a.name));(typeof e.name!="string"||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(e.name))&&n.push(`The view's name "${String(e.name)}" is not lower-case letters, digits and hyphens.`),e.title!==void 0&&(typeof e.title!="string"||e.title.trim()===""||e.title.length>80)&&n.push("The view's title is empty or longer than 80 characters."),e.attach!=="home"&&!i.has(e.attach)&&n.push(`The view attaches to "${e.attach}", which is no kind of this app.`),e.cardinality!=="one"&&e.cardinality!=="many"&&n.push(`The view's cardinality is "${String(e.cardinality)}", not one or many.`),e.attach==="home"&&e.cardinality!=="many"&&n.push("A view of the home draws many records: its cardinality is many."),e.replaces!==void 0&&e.replaces!=="page"?n.push(`The view's replaces is "${String(e.replaces)}": the one thing a view replaces is "page", or leave it out to draw the view above the record's own fields.`):e.replaces==="page"&&e.attach==="home"&&n.push(`The home's view is the home already: replaces "page" is for a view of a kind, of one record (its page) or of many (its list).`),e.gestures!==void 0&&typeof e.gestures!="boolean"&&n.push(`The view's gestures is "${String(e.gestures)}": it is true, or left out.`),e.bleed!==void 0&&typeof e.bleed!="boolean"&&e.bleed!=="full"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, "full", or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||(e.cardinality==="many"?e.title===void 0:e.replaces!=="page"))&&n.push(`The view's heading is "${String(e.heading)}": it is "own" on a view that is a place (a title, cardinality many) or on a view of one record that replaces its page (replaces "page"), or left out.`),e.flows!==void 0&&typeof e.flows!="boolean"?n.push(`The view's flows is "${String(e.flows)}": it is false for a view that keeps its place's frame, or left out.`):e.flows===!1&&(e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push("Only a view that is a place keeps a frame: flows false needs a title and cardinality many on a kind."),n.push(...B(e.scene)),e.scene!==void 0&&(e.attach==="home"||e.cardinality!=="many")&&n.push("Only a view of a kind's members is drawn on the Scene as a card: scene needs cardinality many on a kind."),n.push(..._(e.pictures,t,e)),n.push(...Z(e.accepts,t));for(let a of e.reads?.kinds??[])i.has(a)||n.push(`The view reads "${a}", which is no kind of this app.`);for(let a of e.reads?.edges??[])s.has(a)||n.push(`The view reads the edge "${a}", which no kind of this app declares.`);let o=new Set;for(let a of F(e)){d.has(a.act)||n.push(`The view asks for the act "${a.act}", which this app does not declare.`);let c=a.as??a.act;o.has(c)&&n.push(`Two of the view's acts are called "${c}".`),o.add(c)}return n}function q(e,t,n){let i=[...new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]])];if(i.length<2)return[];let s=new Set(t.reads?.edges??[]),d=o=>new RegExp(`(["'\`])${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1`).test(n);return e.schema.edgeKinds.filter(o=>{let a=e.schema.edge(o);return!s.has(o)&&a!==void 0&&a.from.some(c=>i.includes(c))&&(a.to==="*"||a.to.some(c=>i.includes(c)))&&d(o)})}function ne(e,t,n){let i=q(e,t,n);if(i.length===0)return;let s=(d,o)=>d.length<2?d[0]??"":`${d.slice(0,-1).join(", ")} ${o} ${d[d.length-1]}`;return`"${t.name}" names ${s(i,"and")} but does not read ${i.length>1?"them":"it"}, so the view is handed no such links: add ${s(i.map(d=>`"${d}"`),"and")} to its manifest's reads.edges.`}function J(e,t){let n=t.attach;return n==="home"||t.cardinality!=="one"||(t.reads?.kinds??[]).includes(n)?[]:(t.reads?.edges??[]).filter(i=>{let s=e.schema.edge(i);return s!==void 0&&s.from.includes(n)&&s.to!=="*"&&s.to.includes(n)})}function L(e,t){let n=new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]]),i=[];for(let s of t.reads?.edges??[]){let d=e.schema.edge(s);if(!d)continue;let o=d.from.some(l=>n.has(l))?[]:d.from,a=d.to==="*"||d.to.some(l=>n.has(l))?[]:d.to,c=[...new Set([...o,...a])];c.length>0?i.push({edge:s,kinds:c}):d.to==="*"&&t.attach!=="home"&&t.cardinality==="one"&&(t.reads?.kinds??[]).length===0&&i.push({edge:s,kinds:[]})}return i}function te(e,t){return L(e,t).map(({edge:n,kinds:i})=>{let s=e.schema.edge(n),d=`${s.from.join(" or ")} to ${s.to==="*"?"any kind":s.to.join(" or ")}`;return i.length===0?`"${t.name}" reads the relation "${n}", from ${d}, and is handed no other kind, so no link of it reaches the view: name the kinds it links to in its manifest's reads.kinds.`:`"${t.name}" reads the relation "${n}", from ${d}, and is handed no ${i.join(" or ")}, so no link of it reaches the view: add ${i.map(o=>`"${o}"`).join(" or ")} to its manifest's reads.kinds.`})}function ie(e,t){return[...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]].some(i=>Object.keys(e.schema.tryDefinition(i)?.computed??{}).length>0)}function se(e,t,n){let{manifest:i}=n,s=n.input??{},o=e.seenBy(t).graph,a=i.attach==="home"?void 0:i.attach,c=a&&i.cardinality==="one"&&s.node?o.getNode(s.node.id):void 0,l=c&&c.kind===a?[c]:[],w=a&&i.cardinality==="many"?s.nodes?s.nodes.flatMap(r=>{let h=o.getNode(r.id);return h&&h.kind===a?[h]:[]}):o.nodesOfKind(a):[],y=l[0],u=y?J(e,i).flatMap(r=>[...o.outEdges(y.id,r).map(h=>h.to),...o.inEdges(y.id,r).map(h=>h.from)].flatMap(h=>{let f=h===y.id?void 0:o.getNode(h);return f&&f.kind===a?[f]:[]})):[],p=new Set([...l,...w,...u].map(r=>r.id)),k=K(o,p,{kinds:(i.reads?.kinds??[]).filter(r=>r!==a||i.cardinality==="one"),edges:i.reads?.edges??[]}),g=new Map;for(let r of[...w,...u,...k.nodes])l.some(h=>h.id===r.id)||g.set(r.id,r);let m=new Set([...l.map(r=>r.id),...g.keys()]),H=[...k.edges],C=new Set(F(i).map(r=>r.act)),D=e.permittedMutations(t).filter(r=>C.has(r.name)).map(r=>({name:r.name,title:r.title??r.name,...r.description!==void 0?{description:r.description}:{},...r.subject?{subject:{kinds:r.subject.kinds,arg:r.subject.arg}}:{}})),x=r=>r?.filter(h=>m.has(h)),A=n.computed,T=r=>A?{...S(e,r),...A(o,r)}:S(e,r),j=W(t),v=G(t),$=!I(t)&&v!==void 0?o.getNode(v):void 0,b=$&&e.schema.tryDefinition($.kind)?.people?$:void 0,P=j?{...e.schema.definitions.some(r=>r.people)?{id:v}:{},name:j.name}:b?{id:b.id,name:S(e,b).label??b.id}:void 0;return{view:i.name,...l[0]?{node:T(l[0])}:{},nodes:[...g.values()].map(T),edges:H,...i.title!==void 0?{label:i.title}:s.label!==void 0?{label:s.label}:{},cardinality:i.cardinality,...s.fidelity!==void 0?{fidelity:s.fidelity}:{},...s.mode!==void 0?{mode:s.mode}:{},...s.selected!==void 0?{selected:s.selected}:{},...s.implicated?{implicated:x(s.implicated)}:{},...s.flagged?{flagged:x(s.flagged)}:{},acts:D,...P?{me:P}:{},...n.theme?{theme:n.theme}:{},locale:O(),timeZone:V(),today:e.today()??M(),...R(e.schema,[...l,...g.values()]),...n.places?{places:n.places.filter((r,h,f)=>f.findIndex(z=>z.as===r.as)===h).map(({as:r,title:h,kind:f})=>({as:r,title:h,kind:f}))}:{}}}export{E as a,F as b,ee as c,q as d,ne as e,J as f,L as g,te as h,ie as i,se as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.
|
|
1
|
+
import{a as v,b as w,c as x}from"./chunk.MB7LKKUD.js";import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as R,_ as y,_a as g,ab as h}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{wb as b,zd as m}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as p}from"./chunk.AJZBJBMO.js";var c=p(R(),1);var r=p(y(),1);function W({notices:e,anchor:n,board:a,report:i}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="banner"),at:"top",anchor:n,board:a,report:i}),(0,r.jsx)(k,{notices:e.filter(s=>s.kind==="toast"),at:"foot",anchor:n,board:a,report:i})]})}var E={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"},C={info:"i",good:"\u2713",warn:"!",bad:"!"};function k({notices:e,at:n,anchor:a,board:i,report:s}){let l=(0,c.useRef)(null),t=e.length>0;return(0,c.useLayoutEffect)(()=>{let o=l.current;if(!t||!o)return;if(typeof o.showPopover=="function"&&!g(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?x:w)(o,a());d(),n==="foot"&&i.hold?.(()=>o.matches(":hover")||o.contains(document.activeElement));let N=h(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(v,d);let u=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return u?.observe(o),()=>{if(N(),u?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(v,d),o.isConnected&&g(o))try{o.hidePopover()}catch{}}},[t,n,a,i]),t?(0,r.jsx)("div",{ref:l,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:m("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:e.map(o=>(0,r.jsx)(O,{notice:o,board:i,report:s},o.id))}):null}var T=e=>e.split(/\s+/).filter(Boolean).map(n=>n.replace(/^Meta\+/,"\u2318").replace(/^Control\+/,"Ctrl+").replace(/^Alt\+/,"Alt+")).join(" or "),H=e=>/^.*?[.!?](?=\s|$)/.exec(e.trim())?.[0]??e.trim(),L=e=>e.from==="framework"&&(e.tone==="bad"||e.tone==="warn");function O({notice:e,board:n,report:a}){let i=e.tone??"info",s=[...e.action?[e.action]:[],...e.actions??[]],l=()=>n.dismiss(e.id);return(0,r.jsxs)("div",{"data-testid":"notice","data-kind":e.kind,"data-tone":i,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:e.kind==="banner"?"8px 10px 8px 12px":"10px 12px 10px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,r.jsx)("span",{"aria-hidden":"true","data-testid":"notice-chip",style:{width:20,height:20,borderRadius:"var(--graview-radius-sm, 6px)",flex:"0 0 auto",display:"inline-grid",placeItems:"center",fontSize:"0.75rem",fontWeight:700,lineHeight:1,color:"var(--graview-ink)",background:`color-mix(in srgb, ${E[i]} 22%, transparent)`},children:C[i]}),(0,r.jsx)("span",{"data-testid":"notice-sentence",style:{flex:"1 1 16rem",minWidth:0},children:e.sentence}),s.length>0?(0,r.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:s.map((t,o)=>t.href!==void 0?(0,r.jsx)("a",{href:t.href,...t.target?{target:t.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{t.onSelect?.(),l()},style:{...f,...o===0?S:{}},children:t.label},t.label):(0,r.jsx)("button",{type:"button","data-testid":"notice-action",...t.keys?{"aria-keyshortcuts":t.keys,title:`${t.label} \u2014 ${T(t.keys)}`}:{},onClick:()=>{l(),t.onSelect?.()},style:{...f,...o===0?S:{}},children:t.label},t.label))}):null,a&&L(e)?(0,r.jsx)("button",{type:"button","data-testid":"notice-report","aria-label":`Report this: ${H(e.sentence)}`,onClick:()=>a.tell({message:e.sentence,...e.code?{code:e.code}:{},...a.where(),version:b}),style:f,children:"Report this"}):null,(0,r.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${e.sentence}`,title:"Dismiss",onClick:l,style:z,children:"\xD7"})]})}var f={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},S={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},z={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};export{W as NoticeStacks,H as firstSentenceOf,L as reportable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B,b as ve}from"./chunk.
|
|
1
|
+
import{a as B,b as ve}from"./chunk.CJHCUHVN.js";import{a as ye,c as he,d as be,f as we}from"./chunk.DCIYOZYP.js";import{b as S,c as fe,d as me}from"./chunk.T3RFZ66S.js";import{k as ce,l as ge}from"./chunk.TDWJU6GW.js";import{b as pe,k as q}from"./chunk.P3Z4ZCL3.js";import{b as de,e as ue}from"./chunk.45OLF6BK.js";import{G as Re,_ as se,h as ae,ja as le,u as ie}from"./chunk.ASNVH2G4.js";import{Oa as te,Za as re,_a as oe,ha as Z,ma as ee,va as ne}from"./chunk.ZDUKVXBI.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Ie}from"./chunk.Q6WOIE5I.js";import{A as Oe,B as Dn,C as He,D as xe,E as Jn,F as ei,G as Yn,H as Qn,I as re,J as Ye,K as ni,L as Ot,M as Qe,N as ti,O as Xn,P as ai,Q as Zn,R as Nt,S as ri,T as fe,U as ln,V as pe,W as Aa,a as J,b as Ne,c as ae,d as Et,e as Sn,f as Le,g as va,h as on,i as gn,j as Jo,k as ba,l as Fe,m as Yo,n as Qo,o as F,p as je,q as ka,r as xa,s as In,t as ge,u as Ve,v as he,w as L,x as ve,y as Y,z as Ue}from"./chunk.4TDYDIIM.js";import{c as Sa,d as Xo,e as Zo,f as sn,g as Pa,i as le}from"./chunk.STHWM422.js";import{a as Uo,d as _o,e as zo}from"./chunk.Q355UPFG.js";import{a as Io,c as Do,f as Wo,g as Bo,i as Ko,j as Go,l as qo,m as jo,o as Vo}from"./chunk.IZUAZ6EV.js";import{a as Tt,b as bn}from"./chunk.KFYSKZC4.js";import{a as Ro,b as Lo,c as To,d as wa}from"./chunk.VNI6HZEF.js";import{b as Co}from"./chunk.THLT6NVO.js";import{a as Eo,b as Oo,d as Rt,e as No,f as Mo,g as $o,j as Lt}from"./chunk.KMFH26SS.js";import{m as Ao}from"./chunk.JJSZLCNU.js";import{a as go,b as fo,c as mo,e as Pt,f as ha,h as At}from"./chunk.JMXBMLKH.js";import{d as yo,e as St,f as ho,g as wo,o as kt,p as So,r as ko,t as xt}from"./chunk.PVAYYFT2.js";import{a as yt,b as Wr,c as Br,d as ht,e as Kr}from"./chunk.I46VNAMS.js";import{b as so,c as lo,e as co,f as fa}from"./chunk.3BE4SHZD.js";import{a as Ct,b as zn,c as xo,e as Po}from"./chunk.L3ST2YKI.js";import{a as ua,b as ro}from"./chunk.CJHCUHVN.js";import{a as Hn,b as to,e as ao}from"./chunk.DCIYOZYP.js";import{a as po}from"./chunk.BJUUSIQY.js";import{a as ma}from"./chunk.VGQDPEB5.js";import{a as ga,b as oo,c as io}from"./chunk.WIVNFOQR.js";import{a as uo}from"./chunk.53GQQETN.js";import{c as bt,d as Ur,e as _r,f as zr,j as Jr,l as vn,n as Yr}from"./chunk.J7GH2CGV.js";import{a as Vr}from"./chunk.SMF5S4DQ.js";import{b as Sr,c as kr}from"./chunk.QMGBAKX6.js";import{d as da,g as ca,i as br}from"./chunk.PS765ODQ.js";import{A as Zr,B as eo,C as no,n as _n,s as rn,t as Qr,z as Xr}from"./chunk.DEBW4FH6.js";import{g as jr}from"./chunk.T3RFZ66S.js";import{b as wt,c as Gr,d as vt,e as qr,l as Fn}from"./chunk.P3Z4ZCL3.js";import{G as ya,O as Fo,R as Ho,e as Ir,f as Dr,w as vo,x as bo}from"./chunk.GH6QX7JR.js";import{c as us}from"./chunk.J4D4BIB4.js";import{$ as pa,Aa as an,G as Re,La as mt,M as Ar,O as Cr,Q as Rr,S as Lr,Y as Tr,Ya as Hr,_ as j,da as Er,ea as Or,ia as Nr,ja as be,ma as Mr,na as $r,r as Pr,ra as Fr,v as Je,va as $n,xa as wn,za as tn}from"./chunk.ASNVH2G4.js";import{a as xr}from"./chunk.SDO3U72B.js";import{Ac as ia,C as ut,Ga as ar,Gb as oa,Ha as rr,Hb as sr,Lc as cr,Ld as mr,N as er,Qb as lr,Tb as Nn,Tc as pr,Z as En,ae as la,ce as yr,fc as dr,ge as ft,ha as pn,he as hr,je as Vn,la as hn,ma as se,oa as On,pa as nr,qa as un,qd as sa,rb as or,rd as ur,sa as tr,se as wr,tb as ir,te as Mn,ua as gt,ue as Un,va as qe,yd as gr,zd as fr,ze as vr}from"./chunk.ZDUKVXBI.js";import{b as M}from"./chunk.AJZBJBMO.js";var gs=new Set(["text","date","number","choice","several"]);function oi(e,n,t){let a=e.graph.getNode(n);if(!a)return[];let r=t??e.seenFor,o=e.schema.tryDefinition(a.kind),i=new Set(bt(o)),s=o?.fields?.shape;return _n(e,n,...r?[{principal:r}]:[]).filter(l=>{let d=a[l.field],c=d==null||d===""||Array.isArray(d)&&d.length===0,m=l.shape.type==="several"?l.shape.of.type==="choice"?"several":"":l.shape.type,g=l.open.length===0&&(l.takesValue?m==="boolean":ii(s?.[l.field]));return o?.display?.format?.[l.field]!==void 0?!1:c&&!i.has(l.field)&&(g||l.takesValue&&l.open.length===0&&gs.has(m))}).map(l=>l.field)}function ii(e){let n=ut(e);return n?n.type==="optional"||n.type==="nullable"||n.type==="default"?ii(n.innerType):n.type==="boolean":!1}function Mt(e,n,t={}){let a=e.graph.getNode(n);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=s=>se(e.schema.tryDefinition(s.kind),s),i=new Map;for(let s of e.graph.allEdges()){let l=s.from===n?"out":s.to===n?"in":null;if(!l)continue;let d=l==="out"?s.to:s.from,c=e.graph.getNode(d);if(!c)continue;let g=(l==="out"?r:e.schema.tryDefinition(c.kind))?.edges?.[s.kind],u=l==="in"?g?.inverse??g?.description:g?.description,P=`${s.kind}|${l}|${u??""}`;(i.get(P)??(()=>{let v={edgeKind:s.kind,direction:l,...u?{description:u}:{},targets:[]};return i.set(P,v),v})()).targets.push({id:c.id,kind:c.kind,label:o(c)})}return{id:n,kind:a.kind,label:o(a),fields:vt(vn(e.schema,e.graph,a),r,t.blanks?{blanks:t.blanks}:{}),violations:oa(e.violations(t.context),[n]),actions:ma(e,[n],{focus:n,...t.principal?{principal:t.principal}:{},...t.context?{context:t.context}:{}}),links:[...i.values()].map(s=>{let l=wt(s.targets.flatMap(d=>{let c=e.graph.getNode(d.id);return c?[c]:[]}),d=>e.schema.tryDefinition(d));return{...s,targets:[...s.targets].map(d=>l.has(d.id)?{...d,apart:l.get(d.id)}:d).sort((d,c)=>d.label.localeCompare(c.label))}})}}function kn(e,n,t={}){return{kind:n,members:e.graph.nodesOfKind(n),actions:ma(e,[],{kindSelection:[n],...t.principal?{principal:t.principal}:{},...t.context?{context:t.context}:{}})}}function si(e,n){let t=(o,i)=>`${o}|${JSON.stringify(i)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let i=t(o.mutation,o.args);a.has(i)||a.set(i,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...n].map((o,i)=>({repair:o,declared:i})).sort((o,i)=>(a.get(t(o.repair.mutation,o.repair.args??{}))??r)-(a.get(t(i.repair.mutation,i.repair.args??{}))??r)||o.declared-i.declared).map(o=>o.repair)}function Xe(e){let n=e.schema.kinds.map(r=>({kind:r,plural:un(e.schema,r),count:e.graph.nodesOfKind(r).length})),t=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),i=e.graph.getNode(r.to);if(!o||!i)continue;let s=`${r.kind}|${o.kind}|${i.kind}`;t.set(s,(t.get(s)??0)+1)}let a=[];for(let{kind:r}of n){let o=e.schema.tryDefinition(r)?.edges??{};for(let[i,s]of Object.entries(o)){let l=s.to==="*"||s.to===void 0?(()=>{let d=[...t.keys()].filter(c=>c.startsWith(`${i}|${r}|`)).map(c=>c.split("|")[2]);return d.length>0?d:["*"]})():s.to;for(let d of l)a.push({edgeKind:i,from:r,to:d,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:t.get(`${i}|${r}|${d}`)??0})}}return{kinds:n,relations:a}}var dn=M(Re(),1);var et=M(Re(),1);var De=M(j(),1),ms={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},ys=e=>{try{return decodeURIComponent(e)}catch{return e}};function hs(e,n,t={}){let{store:a}=e,r=a.schema,o=(t.base??"").replace(/\/$/,""),[i="/",s=""]=n.split("#")[0].split("?"),l=(E,x,b)=>({label:E,href:`${o}${x}`,path:x,...b?{current:b}:{}}),d=E=>{let x=t.registry?.sectionOf(E);return x?[x.path===void 0?{label:x.label}:l(x.label,x.path)]:[]},c=E=>t.registry?.sectionOf(E)?.label,m=E=>{let x=c(E);return x===void 0?{}:{section:x}},[g,u,...P]=i.split("/").filter(Boolean).map(ys);if(g===void 0)return{as:"home",label:"Home",trail:[l("Home","/",!0)]};if(g==="places"&&u!==void 0&&P.length===0){let E=new URLSearchParams(s).get("of"),x=new Set(Ye(a,e.principal)),b=e.views?.places()??[],G=b.find(ee=>x.has(ee.kind)&&ee.as===u&&(!E||J(r,ee.kind)===E));if(G){let ee=Et(G.as,ft(G,b)?J(r,G.kind):void 0);return{as:"place",kind:G.kind,label:G.title,...m(G.kind),trail:[...d(G.kind),l(G.title,ee,!0)]}}}let f=P.length===0?Ne(r,g):void 0;if(f!==void 0){let E=l(un(r,f),`/${J(r,f)}`);if(u===void 0)return{as:"list",kind:f,label:E.label,...m(f),trail:[...d(f),{...E,current:!0}]};let x=a.graph.getNode(u),b=x&&x.kind===f?se(r.tryDefinition(f),x):"Nothing lives here";return{as:"record",kind:f,id:u,label:b,...m(f),trail:[...d(f),E,l(b,ae(r,f,u),!0)]}}let v=ms[g]??ws((P.at(-1)??u??g).replace(/[-_]+/g," "));return{as:"page",label:v,trail:[l(v,i,!0)]}}var ws=e=>e.charAt(0).toUpperCase()+e.slice(1),Ca=(0,et.createContext)(null);function vs(e){let n=Le(),t=Sn("/");return le(e.context.store),hs(e.context,`${n.pathname}${n.search}`,{registry:e.registry,base:t})}var bs={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},li={display:"flex",alignItems:"center",gap:6,minWidth:0},di={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function xn({context:e,style:n}){let t=(0,et.useContext)(Ca),a=(0,et.useContext)(Xn);return Zn(a??ks,"trail")||t?.registry?.without().has("trail")?null:(0,De.jsx)(Ss,{root:t??{context:e,registry:void 0},context:e,...n?{style:n}:{}})}function Ss({root:e,context:n,style:t}){let a=vs(e);return a.trail.length<2?null:(0,De.jsx)(xs,{here:a,mark:a.as==="record"?{kind:a.kind,context:n}:void 0,...t?{style:t}:{},"data-testid":"page-trail"})}var ks={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function xs({here:e,mark:n,style:t,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,De.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...t},...a,children:(0,De.jsx)("ol",{style:{...Ve,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,i)=>(0,De.jsxs)("li",{style:o.current?bs:{...li,flexShrink:i===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[i>0&&!o.current?(0,De.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,De.jsxs)(F,{to:o.path,style:{...Oe,...li},...i===r?{"data-testid":"trail-list"}:{},children:[i===r&&n?(0,De.jsx)(xe,{kind:n.kind,brand:n.context.brand,schema:n.context.store.schema,size:8}):null,(0,De.jsx)("span",{style:di,children:o.label})]}):(0,De.jsx)("span",{style:di,children:o.label})]},`${i}:${o.label}`))})})}var O=M(j(),1),Kn="built-in";function $t(e,n,t){return["q","archived","by","with","past","sort","group",...n].some(a=>e.has(a))||t&&e.has("filter")}function We(e){let n=e.views;if(!n)return[];let t=new Set(Ye(e.store,e.principal));return n.places().filter(a=>t.has(a.kind))}function Ft(e,n){let t=e.views?.arrangement?.()?.lists?.[n]?.opens,a=t===void 0?void 0:We(e).find(r=>r.kind===n&&r.as===yr(t));if(a)return{place:a,flows:e.views?.resolve(a.kind,{cardinality:"many",fidelity:"full"},a.as)?.view?.flows===!0}}function Wn(e,n){if(!n.over)return[n.kind];let t=new Set(Ye(e.store,e.principal));return n.over.filter(a=>a===n.kind||t.has(a))}var Pn=e=>`place:${e.kind}:${e.as}`;function Pe(e,n){return Et(n.as,ft(n,e.views?.places()??[])?J(e.store.schema,n.kind):void 0)}function Bn(e,n){let t=e.schema.tryDefinition(n);return e.graph.nodesOfKind(n).filter(a=>hn(t,a))}function Ra(e,n,t){let a=(o,i)=>On(e.schema,i,o),r=(typeof n=="string"?[n]:n).map(o=>a(Bn(e,o).length,o)).join(" and ");return t?`${r} across ${a(Bn(e,t).length,t)}`:r}function La({context:e,place:n,chosen:t,filter:a,bled:r}){let{store:o,views:i,invariantContext:s}=e,d=i?.resolve(n.kind,{cardinality:"many",fidelity:"full"},n.as)?.view,c=[...new Set(o.violations(s).flatMap(u=>u.nodeIds))],m=Wn(e,n).flatMap(u=>Bn(o,u));if(!d)return null;let g=As(o,m,a,c);return(0,O.jsx)(rn,{kind:n.kind,view:n.title,said:"",children:(0,O.jsx)(ln,{when:tn(d)&&!r,children:(0,O.jsx)(d,{nodes:g,label:n.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...t&&t.length>0?{implicated:t}:{},...c.length>0?{flagged:c}:{}})})})}function Ps(e,n,t){let a=t?Vn({filter:t}).filter??[]:[];if(a.length===0)return{filter:null,said:[],dropped:[]};let r=n.map(l=>St(e.schema,l)),o=a.filter(l=>r.some(d=>d.filters.some(c=>c.key===l.key))),i=a.filter(l=>!o.includes(l)).map(l=>`filter ${l.key}`),s=o.filter(l=>!(l.key==="is"&&l.value==="any")).map(l=>l.key==="is"?`that are ${l.value}`:`where ${l.key} is ${l.value}`);return{filter:o.length>0?Pt({filter:o}).filter??null:null,said:s,dropped:i}}function As(e,n,t,a){let r=t?Vn({filter:t}).filter??[]:[];return r.length===0?n:At(n,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function Cs({store:e,views:n,as:t,invariantContext:a}){le(e);let r={store:e,views:n,...a?{invariantContext:a}:{}},o=n.places().find(i=>i.as===t);return o?(0,O.jsx)(La,{context:r,place:o}):null}function Rs({context:e,kind:n}){let{store:t,views:a,invariantContext:r}=e,o=Bn(t,n),i=t.schema.tryDefinition(n),s=re(t,n),d=a?.resolve(n,{cardinality:"many",fidelity:"full"})?.view,c=[...new Set(t.violations(r).flatMap(P=>P.nodeIds))];if(d&&!$n(d))return(0,O.jsx)(rn,{kind:n,view:s,said:"",children:(0,O.jsx)(d,{nodes:o,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...c.length>0?{flagged:c}:{}})});let m=a?.resolve(n,{cardinality:"one",fidelity:"summary"})?.view,g=8,u=o.slice(0,g);return(0,O.jsxs)("div",{"data-testid":"kind-sheet",style:m?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(P=>m?(0,O.jsx)(m,{node:P,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...c.includes(P.id)?{flagged:[P.id]}:{}},P.id):(0,O.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:se(i,P)},P.id)),o.length>g?(0,O.jsxs)("span",{style:{...L,alignSelf:"center",padding:"0 6px"},children:["+",o.length-g," more ",s.toLowerCase()]}):null]})}function Ht(e){let{store:n}=e,t=ni(e),a=We(e),r=e.views?.arrangement?.()?.order??[],o=l=>{let d=l.name===void 0?-1:r.indexOf(`view:${l.name}`);return d>=0?d-r.length:t.indexOf(l.kind)},i=la([...a].sort((l,d)=>o(l)-o(d))).filter(l=>!l.hidden),s=new Set(i.flatMap(l=>l.over??[l.kind]));return[...i.map(l=>({key:Pn(l),kind:l.kind,title:hr(l,a,n.schema),to:Pe(e,l),place:l})),...Ot(e).filter(l=>!s.has(l)).map(l=>({key:`kind:${l}`,kind:l,title:re(n,l),to:`/${J(n.schema,l)}`}))]}function ui(e){let n=new Set(Ht(e).flatMap(t=>t.place?Wn(e,t.place):[t.kind]));return new Set([...n].flatMap(t=>Bn(e.store,t).map(a=>a.id)))}var ci=.72,Ls=540,pi=16/10;function Ts(e){let n=(0,dn.useRef)(null),[t,a]=(0,dn.useState)(e);return(0,dn.useLayoutEffect)(()=>{let r=n.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let s=r.getBoundingClientRect().width;s>0&&a(l=>Math.abs(l-s)<.5?l:s)};o();let i=new ResizeObserver(o);return i.observe(r),()=>i.disconnect()},[]),{ref:n,width:t}}function Es(e){for(let n=e.parentElement;n;n=n.parentElement)if(/(auto|scroll)/.test(getComputedStyle(n).overflowY))return n;return null}function Os(e){let[n,t]=(0,dn.useState)(()=>typeof IntersectionObserver>"u");return(0,dn.useLayoutEffect)(()=>{let a=e.current;if(n||!a)return;let r=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&(r.disconnect(),t(!0))},{root:Es(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[n,e]),n}function Ta({context:e,entry:n,small:t=!1}){let{store:a,brand:r,principal:o}=e,{ref:i,width:s}=Ts(Ls),l=Os(i),d=s/ci,c=Bn(a,n.kind),m=a.schema.tryDefinition(n.kind),g=c.length===0?kn(a,n.kind,{...o?{principal:o}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,u=n.place!==void 0;return(0,O.jsxs)(F,{to:n.to,"data-testid":u?"place-card":"kind-card",className:"graview-gallery-card",style:{...Oe,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,O.jsxs)("span",{ref:i,"data-testid":u?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${pi}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,O.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/pi,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${ci})`,transformOrigin:"0 0"},children:l?(0,O.jsx)(Rt.Provider,{value:null,children:n.place?(0,O.jsx)(La,{context:e,place:n.place}):(0,O.jsx)(Rs,{context:e,kind:n.kind})}):null}),c.length===0?(0,O.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,O.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,O.jsxs)("span",{style:{fontFamily:xa,fontWeight:"var(--graview-weight-display)"},children:["No ",re(a,n.kind).toLowerCase()," yet"]}),g?(0,O.jsxs)("span",{style:L,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,O.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,O.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[u?null:(0,O.jsx)(xe,{kind:n.kind,brand:r,schema:a.schema,size:8}),(0,O.jsx)("span",{style:{fontFamily:xa,fontSize:t?"var(--graview-text-body)":"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:n.title})]}),(0,O.jsxs)("span",{style:L,children:[n.place?Ra(a,Wn(e,n.place),n.place.across):Ra(a,n.kind),!u&&m?.description?` \xB7 ${m.description}`:null]})]})]})}var gi={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Ns={display:"grid",gap:"20px 16px",gridTemplateColumns:"repeat(auto-fill, minmax(clamp(140px, 22%, 260px), 1fr))"},Ms=`
|
|
2
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
+
.graview-gallery-card:hover > span:first-child,
|
|
4
|
+
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
+
`;function It({context:e,small:n=!1}){le(e.store);let t=Ht(e);return t.length===0?null:(0,O.jsxs)("section",{style:n?Ns:gi,"data-testid":"gallery",...n?{"data-small":""}:{},children:[(0,O.jsx)("style",{children:Ms}),t.map(a=>(0,O.jsx)(Ta,{context:e,entry:a,small:n},a.key))]})}function Ea({context:e}){let{store:n}=e;le(n);let t=la(We(e)).filter(r=>!r.hidden),a=Ht(e);return(0,O.jsxs)(fe,{context:e,style:In,children:[(0,O.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,O.jsx)("p",{style:Ve,children:t.length===0?"None of its own yet":`${t.length} ${t.length===1?"picture":"pictures"}`}),(0,O.jsx)(pe,{context:e,children:"Pictures"}),(0,O.jsx)("p",{style:he,children:t.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,O.jsx)("div",{style:gi,"data-testid":"places",children:a.map(r=>(0,O.jsx)(Ta,{context:e,entry:r},r.key))}):null]})}var $s={lede:!0},Fs={lede:!1},Hs={...he,textWrap:"pretty"};function Is(e,n){if(n===void 0)return;let[t]=zr(_r([n]),Yr(e.store,null,null,e.brand?{money:e.brand}:{}));return t?.t==="headline"&&!t.problem&&t.text.trim()!==""?t.text:void 0}function nt({context:e,asList:n}){let{store:t,principal:a}=e;le(t);let r=gn(),o=on(),[i]=je(),s=decodeURIComponent(r.as??""),[l,d]=(0,dn.useState)(null),c=i.get("of"),m=i.get("filter"),g=We(e),u=n??g.find(H=>H.as===s&&(!c||J(t.schema,H.kind)===c));if(!u)return(0,O.jsxs)(fe,{context:e,children:[(0,O.jsx)(pe,{context:e,children:"No picture is called that."}),(0,O.jsx)("p",{style:he,children:(0,O.jsx)(F,{to:"/places",style:Ue,children:(0,O.jsx)(sn,{children:"The pictures there are"})})})]});let P=re(t,u.kind),f=Ps(t,Wn(e,u),m),v=f.filter,E=e.views?.resolve(u.kind,{cardinality:"many",fidelity:"full"},u.as)?.view,x=E?.flows===!0,b=E?.ownHeading===!0,G=an(E),ee=E?.creates!==!1,W=Is(e,E?.lede),de=wn(E)&&e.views?.lookup(u.kind,{cardinality:"many",fidelity:"full"})===E,ie=kn(t,u.kind,{...a?{principal:a}:{},...e.invariantContext?{context:e.invariantContext}:{}}),ne=ee?ie.actions.affordances.map(H=>({affordance:H,mutation:t.allMutations().find(T=>T.name===H.mutation)})).filter(H=>H.mutation!==void 0):[];return(0,O.jsxs)(fe,{context:e,style:{...In,gap:"var(--graview-space-6, 32px)"},spans:G,...G&&b?{bleedTop:"full"}:{},children:[(0,O.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,O.jsx)(xn,{context:e}),(0,O.jsx)(pe,{context:e,unseen:b,children:n?P:u.title}),b?null:(0,O.jsx)("p",{style:Hs,"data-testid":"place-lede",...W!==void 0?{"data-graview-lede":"headline"}:{},children:W??`${Ra(t,Wn(e,u),u.across)}.`}),m&&!x&&f.dropped.length>0?(0,O.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-dropped",children:["This link asked for ",f.dropped.join(", "),", which ",P.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,f.said.length>0&&!x?(0,O.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-narrowed",children:[`Only those ${f.said.join(" and ")}. `,(0,O.jsx)(F,{to:`?${(()=>{let H=new URLSearchParams(i);return H.delete("filter"),H.toString()})()}`,style:{...Y,...L},children:"Show all"})]}):null,b?null:(0,O.jsx)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Wn(e,u).filter(H=>!(de&&H===u.kind)).map((H,T)=>(0,O.jsx)(F,{to:`/${J(t.schema,H)}${e.views?.arrangement?.()?.lists?.[H]?.opens!==void 0?`?drawn=${Kn}${v&&H===u.kind?`&filter=${encodeURIComponent(v)}`:""}`:v&&H===u.kind?`?filter=${encodeURIComponent(v)}`:""}`,style:{...Ue,...L},...T===0?{"data-testid":"place-as-list"}:{},children:(0,O.jsxs)(sn,{children:["All ",(H===u.kind?P:re(t,H)).toLowerCase()," as a list"]})},H))})]}),(0,O.jsx)(ln,{when:G,full:G,children:(0,O.jsx)("div",{"data-testid":"place-lens","data-flows":x?"":void 0,...x?{}:{role:"group","aria-label":u.title,tabIndex:0},style:x?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:H=>{let T=H.target?.closest("[data-graview-pick]"),te=T?.getAttribute("data-graview-pick"),ue=T?.getAttribute("data-graview-joins");if(ue)try{let z=JSON.parse(ue);if(Array.isArray(z)&&z.every(ce=>typeof ce=="string")){H.preventDefault(),d({at:Pn(u),ids:z});return}}catch{}if(!te)return;let Se=t.graph.getNode(te);Se&&(H.preventDefault(),o(ae(t.schema,Se.kind,te)))},children:(0,O.jsx)($o.Provider,{value:W!==void 0?$s:Fs,children:(0,O.jsx)(La,{context:e,place:u,filter:v,bled:G,...l?.at===Pn(u)?{chosen:l.ids}:{}})})})}),ne.length>0?(0,O.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:ne.map(({affordance:H,mutation:T})=>(0,O.jsxs)("section",{style:{...ve,display:"grid",gap:14},children:[(0,O.jsx)("h2",{style:ge,children:T.title??T.name}),T.description?(0,O.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:T.description}):null,(0,O.jsx)(Ie,{store:t,mutation:T,prefilled:H.args,open:H.open,label:H.label,...a?{principal:a}:{}})]},H.id))}):null]})}function Ds(e,n=document){let t=Tt(e);if(!t)return null;let a=[n,...[...n.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let i=o.getAttribute("data-section")??o.id;if(i===e||Tt(i)===t)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Tt(o.textContent??"")===t)return o;return null}function fi(e,n={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let t=n.frames??120,a=0,r=()=>{let o=Ds(e,n.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}t-=1,t>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var _=M(Re(),1);var Dt=M(Re(),1);var An=M(j(),1);function mi({context:e}){return be()?(0,An.jsxs)(An.Fragment,{children:[(0,An.jsx)(Ws,{context:e}),(0,An.jsx)(Do,{face:"pages",on:e.quickAsk??!0})]}):null}function Ws({context:e}){let{store:n}=e,t=be(),{pathname:a}=Le(),r=(0,Dt.useRef)(t?.setSelection);return r.current=t?.setSelection,(0,Dt.useEffect)(()=>{let o=r.current;if(!o)return;let[,i,s]=a.split("/"),l=(()=>{if(i==="places"){let c=e.views?.places().find(m=>m.as===decodeURIComponent(s??""));return c?[Je(c.kind)]:[]}let d=i?Ne(n.schema,i):void 0;return d&&s?[decodeURIComponent(s)]:d?[Pr(d)]:[]})();o(d=>d.length===l.length&&d.every((c,m)=>c===l[m])?d:l)},[a]),null}var Me=M(Re(),1);var hi=M(us(),1);var Ae=M(j(),1);var Bs=mt(xr(()=>(__graviewPreload(import.meta.url,["./chunk.STHWM422.js","./chunk.Q355UPFG.js","./chunk.IZUAZ6EV.js","./chunk.VNI6HZEF.js","./chunk.THLT6NVO.js","./chunk.KMFH26SS.js","./chunk.YF5GCOSZ.js","./chunk.F2BZ4SC4.js","./chunk.WAPY4RCS.js","./chunk.JJSZLCNU.js","./chunk.JKX4J3KG.js","./chunk.JMXBMLKH.js","./chunk.PVAYYFT2.js","./chunk.MB7LKKUD.js","./chunk.I46VNAMS.js","./chunk.3BE4SHZD.js","./chunk.LG2BQ5LB.js","./chunk.L3ST2YKI.js","./chunk.7VCYVCYM.js","./chunk.CJHCUHVN.js","./chunk.MFNWHXGL.js","./chunk.DCIYOZYP.js","./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UPL3D3ZO.js")).then(e=>({default:e.TakeBack}))));function Ks({context:e,docked:n,at:t,...a}){let{store:r}=e,o=le(r),[i]=(0,Me.useState)(()=>r.batches().length),s=(0,Me.useRef)(!1);return s.current||=o>0||!n&&i>0,s.current?(0,Ae.jsx)(Me.Suspense,{fallback:null,children:(0,Ae.jsx)(Bs,{context:e,docked:n,at:t,since:i,...a})}):null}function Gs(e,n,t){let{store:a,principal:r,embedded:o}=e;(0,Me.useEffect)(()=>{if(!t)return;let i=s=>{if(!zo(s))return;let l=s.target,d=l instanceof Node&&n.current?.contains(l),c=l===document.body||l===document.documentElement||l===document;if(!(!d&&!(c&&!o))&&Uo(a,r)){s.preventDefault();try{_o(a,r)}catch{}}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[a,r,o,n,t])}function wi({context:e,registry:n,root:t,children:a}){let r=(0,Me.useMemo)(ai,[]),o=n?.without()??new Set;return Gs(e,t,!o.has("undo")),(0,Ae.jsxs)(Xn.Provider,{value:r,children:[(0,Ae.jsx)(qs,{context:e,placed:r,without:o}),a]})}function qs({context:e,placed:n,without:t}){let[a,r]=(0,Me.useState)(!1);(0,Me.useLayoutEffect)(()=>r(!0),[]);let o=Zn(n,"find"),i=Zn(n,"undo"),s=Le(),l=bo();if(!a)return null;let d=s.pathname.split("/").filter(Boolean),m=(d.length===1?Ne(e.store.schema,d[0]):void 0)!==void 0;return(0,Ae.jsxs)(Ae.Fragment,{children:[!o&&!t.has("find")&&l?(0,hi.createPortal)((0,Ae.jsx)(yi,{context:e,narrowsLists:m}),l.slot):null,!o&&!t.has("find")&&!l?(0,Ae.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,Ae.jsx)(yi,{context:e,narrowsLists:m})}):null,!i&&!t.has("undo")?(0,Ae.jsx)(Ks,{context:e,docked:!0,at:s.pathname+s.search}):null,l?.own&&!t.has("undo")?(0,Ae.jsx)(ti,{context:e,own:l.own}):null]})}function yi({context:e,narrowsLists:n}){return(0,Ae.jsx)(Xn.Provider,{value:null,children:(0,Ae.jsx)(Aa,{context:e,narrowsLists:n})})}var Q=M(Re(),1);var Te=M(j(),1),js=500,Vs=10;function tt(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Us(e){let n=typeof getSelection=="function"?getSelection():null;if(n===null||n.isCollapsed)return!1;for(let t=0;t<n.rangeCount;t++)if(n.getRangeAt(t).intersectsNode(e))return!0;return!1}function vi(e){let n=e.nativeEvent.composedPath?.()[0];return n instanceof Element?n:e.target}function Pi(e){if(e.parentElement)return e.parentElement;let n=e.getRootNode();return n instanceof ShadowRoot?n.host:null}function bi(e,n){for(let t=e;t;t=Pi(t))if(t.hasAttribute(n))return t;return null}var _s='a[href], button, summary, label, input, select, [role="button"], [draggable="true"], [data-graview-pick], [data-graview-listed], [data-graview-record], [data-graview-act], [data-graview-editable], [data-record], [data-act], [data-column]';function zs(e,n,t){for(let a=e;a;a=Pi(a))if(a.matches(_s))return!1;if(typeof getComputedStyle=="function"&&getComputedStyle(e).userSelect==="none")return!1;for(let a of e.childNodes){if(a.nodeType!==Node.TEXT_NODE||!a.nodeValue?.trim())continue;let r=document.createRange();if(r.selectNodeContents(a),typeof r.getClientRects!="function")return!1;for(let o of r.getClientRects())if(n>=o.left&&n<=o.right&&t>=o.top&&t<=o.bottom)return!0}return!1}function Js(e){let n=typeof getSelection=="function"?getSelection():null;if(!n||n.isCollapsed||!e||!n.anchorNode||!e.contains(n.anchorNode))return null;let t=n.toString();return t.trim()?t:null}function Si(e,n,t){let a=navigator.clipboard?.writeText?.(e);if(!a)return n(`${t} could not be copied here`);a.then(()=>n(`${t} copied`),()=>n(`${t} could not be copied here`))}function ki(e){let n=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(n)return n;let t=document.activeElement;return t instanceof HTMLElement&&t!==document.body?t:null}function Ai({context:e,root:n,registry:t,children:a}){return be()===null?(0,Te.jsx)(Te.Fragment,{children:a}):(0,Te.jsx)(Qs,{context:e,root:n,registry:t,children:a})}var Ys=(e,n,t=()=>[],a=()=>!0)=>r=>{let o=new URLSearchParams(n);return o.get("drawn")===Kn||$t(o,t(r),a(r))||e?.lookup(r,"list")!==void 0};function Qs({context:e,root:n,registry:t,children:a}){let{setMenuAt:r}=Nr(),{store:o}=e,i=o.schema,s=on(),{pathname:l,search:d}=Le(),c=Sn("/").replace(/\/$/,""),m=(0,Q.useCallback)((h,w)=>e.views?.places().find(C=>C.as===h&&(w===null||C.kind===w)),[e.views]),g=(0,Q.useCallback)((h,w)=>{let[C="",N,q]=h.split("/").filter(Boolean).map(U=>{try{return decodeURIComponent(U)}catch{return U}});if(q!==void 0)return null;if(C==="places"&&N!==void 0){let U=m(N,new URLSearchParams(w).get("of"));return U?{face:"pages",place:U.as,about:[Je(U.kind)],title:U.title}:null}let Z=Ne(i,C);return Z?N===void 0?{face:"pages",about:[Je(Z)],title:un(i,Z)}:o.graph.getNode(N)?{face:"pages",on:N,about:[N]}:null:null},[i,o,m]),u=(0,Q.useCallback)(h=>{let w=h.href;try{let C=new URL(w,location.href);if(C.origin===location.origin&&(c===""||C.pathname===c||C.pathname.startsWith(`${c}/`))){let N=g(C.pathname.slice(c.length),C.search);if(N)return{...N,href:w}}}catch{}return{face:"pages",about:[],href:w}},[c,g]),P=(0,Q.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),f=(0,Q.useCallback)(h=>{let w=P(),C=h.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(C&&w.on!==void 0&&h.closest("[data-graview-pick], a[href]")===null)return{...w,field:C};let N=h.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(N)return{...w,act:N};let q=h.closest("a[href]"),Z=h.closest("[data-graview-listed]"),U=[h.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),Z&&(!q||Z.contains(q)&&q.classList.contains("graview-spec-item-link"))?Z.getAttribute("data-graview-listed"):null].map($=>$?o.graph.getNode($):void 0).find(Boolean);if(U)return{face:"pages",on:U.id,about:[U.id],href:`${c}${ae(i,U.kind,U.id)}`};if(q)return u(q);let k=h.closest("[data-graview-record]")?.getAttribute("data-graview-record");return k&&o.graph.getNode(k)?{face:"pages",on:k,about:[k]}:w},[P,u,o,i,c]),v=(0,Q.useCallback)((h,w)=>{let C=bi(h,"data-column"),N=C?.getAttribute("data-column")??"",q=N.indexOf(":");if(!C||q<=0||q===N.length-1)return;let Z=N.slice(0,q),U=N.slice(q+1),k=w.place===void 0?void 0:e.views?.places().find(me=>me.as===w.place),$=bi(C,"data-column-kind")?.getAttribute("data-column-kind")??k?.kind??(w.about?.length===1&&w.about[0].startsWith("aggregate:")?xi(w.about[0]):void 0);if(!($===void 0||!i.tryDefinition($)))return{kind:$,field:Z,value:U,label:C.getAttribute("data-column-label")??pn(U)}},[e.views,i]),E=(0,Q.useCallback)(h=>{let w=n.current;if(w===null||!w.contains(h)||tt(h)||h.closest("[data-graview-popover]"))return null;let C=f(h);return{face:"pages",on:C.on,about:C.about??[],field:C.field,place:C.place,href:C.href,act:C.act,column:v(h,C),element:ki(h)}},[f,v,n]),x=(0,Q.useRef)(null),b=(0,Q.useRef)(null),G=(0,Q.useCallback)((h,w,C,N=h,q=!1)=>{if(!q&&(no(N)||eo())){let ye=()=>G(h,w,C,N,!0);Xr().then(ye,ye);return}let Z=f(h),U=v(N,Z),k=Zr(N);b.current=Js(n.current);let $=P(),me={...Z,...U?{column:U}:{},...k?{section:k,title:k.name}:{page:{on:$.on,about:$.about,place:$.place,home:l==="/",at:N}},x:Math.round(w),y:Math.round(C),returnTo:ki(h)};x.current=me,r(me)},[f,P,v,r,n,l]),[ee,W]=(0,Q.useState)(null);(0,Q.useEffect)(()=>{if(!ee)return;let h=setTimeout(()=>W(null),2400);return()=>clearTimeout(h)},[ee]);let de=(0,Q.useCallback)(h=>W({sentence:h,at:Date.now()}),[]),ie=(0,Q.useCallback)(h=>{let w=h.getBoundingClientRect();G(h,w.left+Math.min(16,w.width/2),Math.min(w.bottom,w.top+36))},[G]),ne=(0,Q.useRef)(0),H=(0,Q.useRef)(null),T=(0,Q.useRef)(null),te=(0,Q.useRef)(!1),ue=()=>{H.current&&clearTimeout(H.current.timer),H.current=null};(0,Q.useEffect)(()=>ue,[]),(0,Q.useEffect)(()=>{let h=w=>{if(w.defaultPrevented||!(w.key==="ContextMenu"||w.key==="F10"&&w.shiftKey))return;let C=n.current,N=w.target instanceof Element?w.target:null,q=N===null||N===document.body||N===document.documentElement,Z=C!==null&&N!==null&&C.contains(N);if(!Z&&!(q&&document.querySelector("[data-graview-face='pages']")===C)||tt(N)||N?.closest("[data-graview-popover]"))return;w.preventDefault(),ne.current=Date.now();let U=Z&&N instanceof HTMLElement?N:C?.querySelector("[data-graview-page-title], main h1, main")??null;U&&ie(U)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[n,ie]),(0,Q.useEffect)(()=>{let h=n.current;if(!h)return;let w=C=>{let N=C.detail;N&&r({...N,face:"pages"})};return h.addEventListener(pa,w),()=>h.removeEventListener(pa,w)},[n,r]);let Se=(0,Q.useMemo)(()=>h=>{if(h.face!=="pages")return null;let w=[],C=h.on===void 0?void 0:o.graph.getNode(h.on),N=h.place===void 0?void 0:e.views?.places().find(ye=>ye.as===h.place),q=C?void 0:h.about.length===1&&h.about[0].startsWith("aggregate:")&&!N?xi(h.about[0]):void 0,Z=C?ae(i,C.kind,C.id):N?Pe(e,N):q?`/${J(i,q)}`:void 0,U=Z!==void 0&&l===Z.split("?")[0];Z!==void 0&&!U&&w.push({id:"open",label:"Open",run:()=>s(Z)});let k=Z!==void 0?`${c}${Z}`:h.href;k!==void 0&&(w.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(k,"_blank","noopener")}),w.push({id:"copy-link",label:"Copy link",run:()=>Si(new URL(k,location.href).href,de,"Link")}));let $=h.on===void 0?h.column:void 0;if($){let ye=o.allMutations().find(mn=>mn.creates?.includes($.kind)&&(dr(mn)?.includes($.field)??!1));if(ye&&x.current){let mn=x.current;w.push({id:"add-in-column",label:`Add ${gt(qe(i.tryDefinition($.kind),$.kind))} in ${$.label}`,run:()=>r({...mn,begin:{act:ye.name,given:{[$.field]:$.value}}})})}let Gn=N?Pe(e,N):`/${J(i,$.kind)}`;w.push({id:"show-only-column",label:`Show only ${$.label}`,run:()=>s(bn(Gn,{filter:`${$.field}:${$.value}`}))})}let me=C?`#focus=${encodeURIComponent(C.id)}`:N?`#focus=${encodeURIComponent(Je(N.kind))}&view=${encodeURIComponent(N.as)}`:q?`#focus=${encodeURIComponent(Je(q))}`:void 0;if(me!==void 0&&(e.overview||!e.embedded)){let ye=e.overview;w.push({id:"in-the-scene",label:"Show in the scene",run:()=>ye?ye(me):location.assign(`${e.sceneHref??"/"}${me}`)})}return C===void 0&&h.href===void 0&&w.push({id:"find",label:"Find\u2026",run:()=>{let ye=n.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');ye&&ye.offsetParent!==null?ye.focus():s("/search")}}),w.length>0?{id:"pages",items:w}:null},[o,i,e,l,c,s,n,de,r]),z=(0,Q.useMemo)(()=>h=>{let w=b.current;return h.face!=="pages"||w===null?null:{id:"selection",at:"start",items:[{id:"copy-selection",label:"Copy",run:()=>Si(w,de,"Text")}]}},[de]),ce=(0,Q.useMemo)(()=>h=>{if(h.face!=="pages"||h.field===void 0||h.on===void 0)return null;let w=o.graph.getNode(h.on),C=h.element?.closest("[data-graview-field]")??n.current?.querySelector(`[data-graview-field="${CSS.escape(h.field)}"]`);if(!w||!(C instanceof HTMLElement)||!C.hasAttribute("data-graview-editable"))return null;let N=tr(i.tryDefinition(w.kind),h.field),q=()=>{let Z=C.matches("select")?C:C.getAttribute("role")==="group"?C.querySelector('button[aria-pressed="true"], button'):null;if(Z)return Z.focus();C.click(),C.getAttribute("role")==="switch"&&C.focus()};return{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${N}\u201D`,run:q}]}},[o,i,n]),$e=Bo(),Ee=lo(),Ke=Co(),en=(0,Q.useCallback)((h,w)=>{l===Pe(e,h).split("?")[0]&&s(w?Pe(e,w):"/")},[l,e,s]),nn=Go(en),Ln=qo(),Ce=jo(Ys(t,d,h=>Xe(o).relations.filter(w=>w.from===h||w.to===h).map(w=>w.edgeKind),h=>Ft(e,h)?.flows??!0),new URLSearchParams(d).get("filter")),cn=(0,Q.useMemo)(()=>[z,ce,Ke,Se,...nn?[nn]:[],...Ee?[Ee]:[],...Ln?[Ln]:[],...Ce?[Ce]:[],...$e?[$e]:[]],[z,ce,Ke,Se,nn,Ee,Ln,$e]);return(0,Te.jsxs)(Qr,{sections:cn,children:[(0,Te.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:h=>{let w=h.target,C=T.current;T.current=null,C!==null&&!C.had&&Date.now()-C.at<2e3&&!h.shiftKey&&!h.altKey&&!tt(w)&&getSelection()?.removeAllRanges(),!(h.shiftKey||h.altKey||tt(w)||Us(w))&&(h.preventDefault(),!w.closest("[data-graview-popover]")&&(Date.now()-ne.current<700||(h.clientX===0&&h.clientY===0&&w instanceof HTMLElement?ie(w):G(w,h.clientX,h.clientY,vi(h)))))},onMouseDownCapture:h=>{if(h.button!==2)return;let w=typeof getSelection=="function"?getSelection():null;T.current={at:Date.now(),had:w!==null&&!w.isCollapsed}},onPointerDown:h=>{if(te.current=!1,h.pointerType==="mouse"||!h.isPrimary)return;let w=h.target,C=vi(h);if(tt(w)||w.closest("[data-graview-choose], [data-graview-popover]"))return;let{clientX:N,clientY:q}=h;zs(C,N,q)||(ue(),H.current={x:N,y:q,timer:setTimeout(()=>{H.current=null,te.current=!0,ne.current=Date.now(),G(w,N,q,C)},js)})},onPointerMove:h=>{let w=H.current;w&&Math.hypot(h.clientX-w.x,h.clientY-w.y)>Vs&&ue()},onPointerUp:ue,onPointerCancel:ue,onClickCapture:h=>{te.current&&(te.current=!1,h.preventDefault(),h.stopPropagation())},children:a}),(0,Te.jsx)(el,{openAt:ie,readyAt:E}),(0,Te.jsx)(Ko,{placement:"page"}),(0,Te.jsx)(co,{}),(0,Te.jsx)(Vo,{}),(0,Te.jsx)("p",{role:"status","data-testid":"menu-said",style:ee?Xs:Zs,children:ee?.sentence??""})]})}var Xs={position:"fixed",left:"50%",bottom:24,transform:"translateX(-50%)",margin:0,padding:"6px 12px",borderRadius:8,fontSize:"0.875rem",background:"var(--graview-panel)",color:"var(--graview-ink)",border:"1px solid var(--graview-edge)",boxShadow:"var(--graview-lift-low)",zIndex:fr("toast"),pointerEvents:"none"},Zs={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function xi(e){let n=e.slice(10).split("+");return n.length===1&&n[0]?n[0]:void 0}function el({openAt:e,readyAt:n}){return(0,Te.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:t=>{if(t.target!==t.currentTarget)return;let a=t.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Te.jsx)(Io,{placement:"menu",openActs:e,aimAt:n})})}var V=M(j(),1);function Ci(e,n){return n==="*"?{label:"anything",path:null}:{label:re(e,n),path:`/${J(e.schema,n)}`}}function nl({context:e,relation:n}){let{store:t}=e,a=Ci(t,n.from),r=Ci(t,n.to),o=i=>i.path?(0,V.jsx)(F,{to:i.path,style:{...Oe,fontWeight:550},children:i.label}):(0,V.jsx)("span",{children:i.label});return(0,V.jsxs)("li",{"data-testid":"relation","data-relation":n.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,V.jsx)(Wo,{edgeKind:n.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,V.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,V.jsxs)("span",{children:[o(a)," ",(0,V.jsxs)("span",{style:L,"data-graview-speaks-ids":"",children:[pn(n.edgeKind)," \u2192"]})," ",o(r)]}),n.description||n.inverse?(0,V.jsxs)("span",{style:L,children:[n.description?Qe(n.description):null,n.description&&n.inverse?" \xB7 ":null,n.inverse?`from the other end, ${n.inverse}`:null]}):null]}),r.path?(0,V.jsx)(F,{to:`${r.path}?with=${encodeURIComponent(n.edgeKind)}`,style:{...Y,...L,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:n.count}):(0,V.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:n.count})]})}function Ri({context:e,heading:n=!0}){let{store:t}=e,a=new Set(Ye(t,e.principal)),r=Xe(t).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,V.jsxs)("section",{style:{...ve,display:"grid",gap:12},"data-testid":"kind-map",children:[n?(0,V.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,V.jsx)("h2",{style:ge,children:(0,V.jsx)(F,{to:"/map",style:Oe,children:"Connections"})}),(0,V.jsx)("span",{style:L,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,V.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,V.jsx)(nl,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function Oa({context:e}){let{store:n}=e;le(n);let t=new Set(Ye(n,e.principal)),a=Xe(n),r=a.relations.filter(o=>t.has(o.from));return(0,V.jsxs)(fe,{context:e,children:[(0,V.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,V.jsx)("p",{style:Ve,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,V.jsx)(pe,{context:e,children:"Connections"}),(0,V.jsx)("p",{style:he,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,V.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>t.has(o.kind)).map(o=>(0,V.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,V.jsx)(xe,{kind:o.kind,brand:e.brand,schema:n.schema,size:7}),(0,V.jsx)(F,{to:`/${J(n.schema,o.kind)}`,style:Y,children:o.plural}),(0,V.jsx)("span",{style:L,children:o.count})]},o.kind))}),(0,V.jsx)(Ri,{context:e,heading:!1})]})}function Li({context:e}){let t=[...be()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(t.length===0)return null;let{store:a}=e;return(0,V.jsxs)("section",{style:{...ve,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,V.jsx)("h2",{style:ge,children:t.length===1?"The seat asked something":`The seat asked ${t.length} things`}),(0,V.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:t.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,V.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,V.jsx)("span",{children:r.say}),o?(0,V.jsxs)(F,{to:ae(a.schema,o.kind,o.id),style:{...Y,...L},children:[se(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}function Ei(e){let n=new Set(e.schema.kinds);return(Array.isArray(e.purpose?.jobs)?e.purpose.jobs:[]).flatMap(a=>{if(typeof a!="object"||a===null||typeof a.name!="string"||typeof a.ask!="string"||!n.has(a.kind))return[];let r=sa(a.sort);return[{name:a.name,ask:a.ask,kind:a.kind,plural:nr(e.schema,a.kind),...a.where!==void 0?{where:a.where}:{},...r?{sort:r}:{},...a.act!==void 0?{act:a.act}:{},...a.roles&&a.roles.length>0?{roles:[...a.roles]}:{}}]})}function Oi(e,n){return e.filter(t=>po(t,n.roles))}var Wt=new Map;function Ti(e){if(!Wt.has(e))try{Wt.set(e,kr(e))}catch(n){if(!(n instanceof Sr))throw n;Wt.set(e,null)}return Wt.get(e)}var tl=e=>e instanceof da?e.nodes.length>0:Array.isArray(e)?e.length>0:!!e,al=(e,n)=>n instanceof da?n.nodes.length:n!==null&&typeof n=="object"&&!Array.isArray(n)?se(e.tryDefinition(n.kind),n):n;function Ni(e,n,t){let a=e;if(a.kindsKeptFrom(t).has(n.kind)||!a.schema.tryDefinition(n.kind))return{count:0,ids:[]};let r=a.seenBy(t),o=r.graph,i=r.schema,s=Jr(i),l=r.today?.(),d=(v,E)=>br(v,{graph:o,subject:E,kinds:s,...l?{today:l}:{}}),c=n.where===void 0?void 0:Ti(n.where);if(c===null)return{count:0,ids:[]};let m=o.nodesOfKind(n.kind).filter(v=>{if(!c)return!0;try{return tl(d(c,v))}catch(E){if(!(E instanceof ca))throw E;return!1}}),g=sa(n.sort),u=g&&g.by!=="label"?Ti(g.by):void 0,f=(g?ur(m,g,v=>{if(g.by==="label")return se(i.tryDefinition(v.kind),v);if(u)try{return al(i,d(u,v))}catch(E){if(!(E instanceof ca))throw E;return}}):m).map(v=>v.id);return{count:f.length,ids:f}}var Bt=M(Re(),1);var oe=M(j(),1),rl=5,ol=3,$i={kind:"human"};function Fi(e){if(!e.app)return[];let n=e.principal??$i;return Oi(Ei(e.app),n).map(t=>({job:t,...Ni(e.store,t,n)}))}function Hi({context:e,answered:n}){let t=n.filter(i=>i.count>0),a=n.filter(i=>i.count===0),[r,...o]=t;return(0,oe.jsxs)("div",{style:{display:"grid",gap:40,maxWidth:"46rem",outline:"none"},"data-testid":"jobs",tabIndex:-1,children:[(0,oe.jsx)("style",{children:Dn}),r?(0,oe.jsx)(Mi,{context:e,answered:r,leads:!0}):null,o.map(i=>(0,oe.jsx)(Mi,{context:e,answered:i},i.job.name)),a.length>0?(0,oe.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"jobs-quiet",children:a.map(({job:i})=>(0,oe.jsxs)("li",{"data-testid":"job-quiet","data-job":i.name,style:{overflowWrap:"anywhere"},children:[i.ask," ",(0,oe.jsxs)("span",{style:L,children:["No ",re(e.store,i.kind).toLowerCase()," right now."]})]},i.name))}):null]})}function Mi({context:e,answered:n,leads:t=!1}){let{store:a}=e,{job:r,count:o,ids:i}=n,s=i.slice(0,t?rl:ol),l=re(a,r.kind),d=t?(0,oe.jsx)(pe,{context:e,"data-testid":"job-ask",children:r.ask}):(0,oe.jsx)("h2",{style:ge,"data-testid":"job-ask",children:r.ask});return(0,oe.jsxs)("section",{className:"graview-list",style:{display:"grid",gap:t?12:8,minWidth:0},"data-testid":"job","data-job":r.name,...t?{"data-leads":""}:{},children:[(0,oe.jsxs)("header",{style:{display:"grid",gap:4},children:[d,(0,oe.jsx)("p",{style:{...t?he:L,margin:0},"data-testid":"job-count",children:On(a.schema,r.kind,o)})]}),(0,oe.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",borderBottom:"1px solid var(--graview-edge)"},"data-testid":"job-rows",children:s.map(c=>(0,oe.jsx)(il,{context:e,job:r,id:c},c))}),(0,oe.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"0 12px",alignItems:"baseline"},children:[o>s.length?(0,oe.jsxs)("span",{"data-testid":"job-more",children:[o-s.length," more"]}):null,(0,oe.jsx)(F,{to:`/${J(a.schema,r.kind)}`,style:Ue,"data-testid":"job-all",children:(0,oe.jsxs)(sn,{children:["All ",l.toLowerCase()]})})]})]})}function il({context:e,job:n,id:t}){let{store:a,principal:r,invariantContext:o}=e,[i,s]=(0,Bt.useState)(!1),l=(0,Bt.useRef)(null),d=a.seenBy(r??$i).graph.getNode(t);if(!d)return null;let c=a.schema.tryDefinition(d.kind),m=se(c,d),g=Yn(d,c,m),u=n.act?Mt(a,t,{...r?{principal:r}:{},...o?{context:o}:{}})?.actions.affordances.find(v=>v.mutation===n.act&&v.provider!=="invariant"):void 0,P=u?a.allMutations().find(v=>v.name===u.mutation):void 0,f=`job-${n.name}-${t}`;return(0,oe.jsxs)("li",{ref:l,"data-testid":"job-row","data-graview-record":t,style:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"8px 12px",minHeight:"2.75rem",padding:"8px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,oe.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,oe.jsx)(F,{to:ae(a.schema,d.kind,t),className:"graview-row-title",...m.length>60?{title:m}:{},children:m}),g.length>0?(0,oe.jsx)("span",{className:"graview-row-glance",children:(0,oe.jsx)(Qn,{runs:g})}):null]}),u&&P?(0,oe.jsx)("button",{type:"button","data-testid":"job-act","data-graview-act":u.mutation,"aria-expanded":i,"aria-controls":f,"aria-label":`${u.label}: ${m}`,onClick:()=>s(!i),style:{...He,position:"relative",...i?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:u.label}):null,i&&u&&P?(0,oe.jsx)("div",{id:f,style:{gridColumn:"1 / -1",position:"relative",display:"grid",gap:10,padding:"4px 0 8px"},children:(0,oe.jsx)(Ie,{store:a,mutation:P,prefilled:u.args,open:u.open,label:u.label,autoFocus:!0,onDone:()=>{let v=l.current?.closest('[data-testid="jobs"]');s(!1),requestAnimationFrame(()=>{((l.current?.isConnected?l.current.querySelector('[data-testid="job-act"]'):null)??v?.querySelector('[data-testid="job-act"]')??v)?.focus()})},...r?{principal:r}:{}})}):null]})}var D=M(j(),1);function sl({violations:e}){let n=e.some(t=>t.status==="could-not-judge"||t.status==="over-budget");return(0,D.jsxs)(F,{to:"/problems","data-testid":"problems-here","data-graview-problems-tone":n?"error":"rule",style:{...Y,color:n?"var(--graview-warn)":"var(--graview-ink-muted)"},children:[e.length===1?"A rule is broken":"Rules are broken"," \u2014 see what, and what would fix it"]})}function ll(e,n=5){let t=[],a=0;for(let r=e.length-1;r>=0;r--){let o=e[r];if(Nn(o))a++;else if(t.length<n)t.push(o);else break}return{recent:t,kept:a}}function Na({context:e}){let{principal:n}=e,{store:t,brand:a,invariantContext:r}=e,o=le(t),i=je()[0].get("drawn")==="built-in",s=t.violations(r),{recent:l,kept:d}=ll(t.log.all()),m=Ot(e).map(T=>({kind:T,members:t.graph.nodesOfKind(T).filter(te=>hn(t.schema.tryDefinition(T),te))})),g=m.filter(T=>T.members.length>0),u=m.map(T=>({entry:T,creator:t.allMutations().find(te=>(te.creates??[]).includes(T.kind)&&t.permits({name:te.name,args:{}},e.principal).ok)})).find(T=>T.creator!==void 0),P=g.length===0?"Nothing here yet.":`${g.map(T=>On(t.schema,T.kind,T.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,v=e.views?.homes?.().at(-1)?.name!==void 0,E=i&&v?void 0:e.views?.homeView?.(),x=t.schema.kinds.some(T=>t.graph.nodesOfKind(T).length>0);if(E&&x){let T=[...new Set(s.flatMap(z=>z.nodeIds))],te=an(E),ue=a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",...te?{"data-graview-line-over-view":""}:{},children:a.subtitle}):null,Se=E[Symbol.for("graview.home-blocks")]===!0;return(0,D.jsx)(fe,{context:e,style:In,bleedTop:te?"full":tn(E),spans:te,children:(0,D.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[Se?null:ue,(0,D.jsx)(Mo.Provider,{value:Se?ue:null,children:(0,D.jsx)(ln,{when:tn(E),full:te,children:(0,D.jsx)(rn,{kind:"home",view:"The home's view",said:"",reset:[o,E],children:(0,D.jsx)(E,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1,...T.length>0?{flagged:T}:{}})})})}),v?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"home-original",children:(0,D.jsx)(F,{to:"/?drawn=built-in",style:{color:"inherit"},"data-testid":"built-in-home","aria-label":"The original home page",children:"Original"})}):null]})})}let b=new Set(Ye(t,e.principal)),G=Xe(t).relations.filter(T=>b.has(T.from)&&(T.to==="*"||b.has(T.to))),ee=Fi(e),W=ee.some(T=>T.count>0),de=new Set([...ui(e),...ee.flatMap(T=>T.ids)]),ie=s.filter(T=>T.nodeIds.some(te=>de.has(te))),H=g.length===0&&u!==void 0||ie.length>0||s.length===0&&!W;return(0,D.jsxs)(fe,{context:e,style:In,children:[(0,D.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,W?null:(0,D.jsx)(pe,{context:e,"data-testid":"standing",children:P}),H?(0,D.jsxs)("p",{style:{...he,display:"grid",gap:4},"data-testid":"standing-card",children:[g.length===0&&u?(0,D.jsxs)("span",{children:["Begin with \u201C",u.creator?.title??u.creator?.name,"\u201D, under"," ",(0,D.jsx)(F,{to:`/${J(t.schema,u.entry.kind)}`,style:Y,children:re(t,u.entry.kind)}),"."]}):null,s.length===0?(0,D.jsx)("span",{children:"All rules hold."}):ie.length>0?(0,D.jsx)(sl,{violations:ie}):null]}):null]}),ee.length>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Hi,{context:e,answered:ee}),(0,D.jsxs)("section",{style:{display:"grid",gap:20},"data-testid":"after-the-jobs",children:[W?(0,D.jsxs)("p",{style:{...L,margin:0},"data-testid":"standing",children:[P,s.length===0?" All rules hold.":""]}):null,(0,D.jsx)(It,{context:e,small:!0})]})]}):(0,D.jsx)(It,{context:e}),(0,D.jsxs)("section",{style:{...ve,display:"grid",gap:14},"data-testid":"kinds",children:[(0,D.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,D.jsx)("h2",{style:ge,children:"What is here"}),G.length>0?(0,D.jsx)(F,{to:"/map",style:{...Ue,...L,marginLeft:"auto"},"data-testid":"map-link",children:(0,D.jsxs)(sn,{children:["Connections \xB7 ",G.length===1?"1 relation":`${G.length} relations`]})}):null]}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:m.map(({kind:T,members:te})=>(0,D.jsx)("li",{style:{maxWidth:"100%"},children:(0,D.jsxs)(F,{to:`/${J(t.schema,T)}`,style:{...Oe,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,D.jsx)(xe,{kind:T,brand:a,schema:t.schema,size:7}),(0,D.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:re(t,T)}),(0,D.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:te.length===0?"none yet":En(te.length)})]})},T))})]}),l.length>0||d>0?(0,D.jsxs)("section",{style:{...ve,display:"grid",gap:10},"data-testid":"recently",children:[(0,D.jsx)("h2",{style:ge,children:"Recently"}),l.length>0?(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(T=>(0,D.jsxs)("li",{style:L,"data-testid":"recently-row",children:[(0,D.jsx)("span",{style:{color:"var(--graview-ink)"},children:T.intent})," \u2014 ",Jn(T,n,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},T.id))}):null,d>0?(0,D.jsxs)("p",{style:{...L,margin:0},"data-testid":"recently-kept",children:[l.length>0?"and ":"",d===1?"1 change":`${En(d)} changes`," kept from you"]}):null]}):null]})}var Ii=M(Re(),1);function Di(e,n){(0,Ii.useEffect)(()=>{let t=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return t.set(e,()=>n),()=>void t.delete(e)})}var Ma=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(n=>n.saveShownList(e.read()));function Wi(e,n,t){let a={off:e,about:n,read:t,menu:(r,o,i)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void Ma(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(s=>s.switchExport(a,o,e,i))}]:[]]};return a}function $a(e){let{schema:n,graph:t,kind:a,nodes:r,arrangement:o,offers:i,declaredGroup:s}=e,l=n.tryDefinition(a),d=kt(o.query??""),c=[...o.filter??[],...d.conditions],m=c.some(W=>W.key==="is"&&(W.value==="past"||W.value==="any"))||yo(l,c),g=m||!l?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},u=new Map,P=At(r,g,{schema:n,graph:t,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(W,de)=>{let ie=u.get(W.id);return ie||u.set(W.id,ie=vn(n,t,W)),ie[de]}}),f=P.grouped&&!!o.group?.by,v=s&&o.group?.by===s.by&&!o.group.bucket?i.groups.find(W=>W.key===s.by):void 0,E=s&&v&&(v.type==="choice"||v.type==="boolean")?mo(P.groups,s,{type:v.type,...v.options?{options:v.options}:{}}):P.groups.map(W=>({...W,closed:!1})),x=!!o.query||(o.filter??[]).some(W=>W.key===s?.by),b=W=>v?.type==="boolean"?W==="1"?"true":"false":W,G=e.opened??new Set,ee=E.map(W=>{let de=b(W.key);return{...W,value:de,shut:W.closed&&!x&&!G.has(de)}});return{arrangement:g,showingPast:m,arranged:P,grouped:f,groups:ee,nodes:f?ee.flatMap(W=>W.shut?[]:W.nodes):P.nodes}}var Be=M(Re(),1);var Cn=M(j(),1);function Kt({context:e,withheld:n,style:t,testId:a}){let r=be(),o=pr(n,e.signIn??r?.signIn);return o?(0,Cn.jsx)("p",{style:{...t,margin:0},children:(0,Cn.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:He,children:o.label})}):n.length===0?null:(0,Cn.jsx)("ul",{style:{...t,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:n.map(i=>(0,Cn.jsxs)("li",{style:L,children:[(0,Cn.jsx)("s",{children:i.label})," \u2014 ",i.refusal.message]},i.id))})}var Bi=M(Re(),1);var I=M(j(),1);function Fa({context:e}){let{store:n,brand:t,principal:a,invariantContext:r}=e;le(n);let[o]=je(),i=o.get("q")??"",s=typeof r?.today=="string"?r.today:void 0,l=ko(n,i,{...a?{principal:a}:{},places:We(e).filter(f=>!f.hidden),flagged:new Set(n.violations(r).flatMap(f=>f.nodeIds)),...s?{today:s}:{},limit:200}),d=l.hits.filter(f=>f.about==="node"),c=l.hits.filter(f=>f.about==="kind"||f.about==="place"||f.about==="rule"),m=[...new Set(d.map(f=>f.kind))],g=i.trim(),u=g.length>=2&&l.hits.length===0,P=l.searched.kinds.length===1?l.searched.kinds[0]:void 0;return(0,Bi.useEffect)(()=>{if(!u)return;let f=setTimeout(()=>mr(n,{type:"search-miss",words:g,...P?{kind:P}:{}},a),dl);return()=>clearTimeout(f)},[n,g,u,P,a]),(0,I.jsxs)(fe,{context:e,children:[(0,I.jsx)("style",{children:Dn}),(0,I.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,I.jsx)("p",{style:Ve,children:"Search"}),(0,I.jsx)(pe,{context:e,"data-testid":"search-heading",children:g.length===0?"Find anything by its name":l.hits.length===0?(0,I.jsxs)(I.Fragment,{children:["Nothing here is called \u201C",g,"\u201D."]}):(0,I.jsxs)(I.Fragment,{children:[cl(n,l.byKind)," for \u201C",g,"\u201D"]})}),g.length>0?(0,I.jsxs)("p",{style:{...L,margin:0},"data-testid":"search-searched",children:[xt(n.schema,l.searched),l.conditions.filter(f=>f.key!=="is"&&f.admittedBy.length<l.searched.kinds.length).map(f=>(0,I.jsxs)("span",{children:[" ",f.key,":",f.value," narrows"," ",f.admittedBy.length===0?"nothing here":f.admittedBy.map(v=>re(n,v).toLowerCase()).join(" and "),"."]},`${f.key}:${f.value}`))]}):(0,I.jsxs)("p",{style:he,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,I.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,I.jsx)("code",{children:"is:any"})," includes what is past."]})]}),c.length>0?(0,I.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:c.map(f=>(0,I.jsx)("li",{"data-testid":"search-hit","data-about":f.about,children:f.about==="kind"?(0,I.jsxs)(F,{to:`/${J(n.schema,f.kind)}`,style:Y,children:[f.label,f.count>0?(0,I.jsxs)("span",{style:L,children:[" \xB7 ",f.count," match"]}):null]}):f.about==="place"?(0,I.jsxs)(F,{to:Pe(e,f),style:Y,children:["Go to ",f.title]}):f.about==="rule"?(0,I.jsxs)(F,{to:"/problems",style:Y,children:["The rule \u201C",f.label,"\u201D"]}):null},`${f.about}:${f.about==="rule"?f.name:f.about==="place"?f.as:f.kind}`))}):null,m.map(f=>(0,I.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":f,children:[(0,I.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,I.jsx)(xe,{kind:f,brand:t,schema:n.schema,size:8}),(0,I.jsx)(F,{to:`/${J(n.schema,f)}?${new URLSearchParams({q:g}).toString()}`,style:Y,"data-testid":"search-kind-link",children:re(n,f)}),(0,I.jsx)("span",{children:l.byKind[f]})]}),(0,I.jsx)("ul",{className:"graview-rows",children:d.filter(v=>v.kind===f).map(v=>(0,I.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,I.jsxs)(F,{to:ae(n.schema,f,v.id),className:"graview-row-title",...v.label.length>60?{title:v.label}:{},children:[v.flagged?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,v.label]}),v.apart||!v.current?(0,I.jsx)("span",{className:"graview-row-glance",children:[v.apart,v.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,I.jsx)(Gt,{why:v.why})]},v.id))})]},f)),g.length>0?(0,I.jsx)(pl,{asked:g}):null,g.length>0&&l.hits.length===0?(0,I.jsx)(Gi,{store:n,kinds:l.searched.kinds,words:l.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}var dl=1500;function Gt({why:e}){return e.strength==="near"?(0,I.jsxs)("span",{style:L,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,I.jsxs)("span",{style:L,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function cl(e,n){let t=Object.entries(n).map(([a,r])=>`${r} ${r===1?qe(e.schema.tryDefinition(a),a):re(e,a).toLowerCase()}`);return t.length===0?"Found":t.length===1?Qe(t[0]):Qe(`${t.slice(0,-1).join(", ")} and ${t[t.length-1]}`)}function Ki(e,n,t={}){let a=[];for(let r of n){let o=kn(e,r,{...t.principal?{principal:t.principal}:{},...t.invariantContext?{context:t.invariantContext}:{}});for(let i of qt(e,r,o.actions.affordances))a.some(s=>s.mutation.name===i.mutation.name)||a.push(i)}return a}function qt(e,n,t){let a=e.schema.tryDefinition(n)?.fieldRoles?.label,r=[];for(let o of t){let i=e.allMutations().find(d=>d.name===o.mutation);if(!i||!i.creates?.includes(n)||r.some(d=>d.mutation.name===i.name))continue;let s=uo(i.input).map(d=>d.name),l=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!l||o.args[l]!==void 0||r.push({kind:n,affordance:o,mutation:i,arg:l})}return r}function Gi({store:e,kinds:n,words:t,principal:a,invariantContext:r}){let o=Ki(e,n,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||t.trim().length===0?null:(0,I.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:i,affordance:s,mutation:l,arg:d})=>(0,I.jsxs)("section",{style:{...ve,display:"grid",gap:14},children:[(0,I.jsxs)("h2",{style:ge,children:[Qe(gt(qe(e.schema.tryDefinition(i),i)))," called \u201C",t,"\u201D"]}),(0,I.jsx)(Ie,{store:e,mutation:l,prefilled:s.args,open:s.open,initial:{[d]:t},...a?{principal:a}:{}})]},`${s.id}|${t}`))})}function pl({asked:e}){let n=be();return n?(0,I.jsx)(ul,{asked:e,desk:n.aiDesk}):null}function ul({asked:e,desk:n}){return Dr(n)?(0,I.jsx)("p",{style:{margin:0},children:(0,I.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Ir(n,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{...Y,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var y=M(j(),1),ji=8,Vi=40;function gl(e,n){let t=n?.fields?.shape??{},a=Object.keys(t).find(r=>rr(t[r])&&ar(e[r]));return a===void 0?void 0:e[a]}function Ia({context:e}){let n=gn(),[t]=je(),a=t.get("drawn")===Kn,r=Ne(e.store.schema,n.slug??"");if(!r)return(0,y.jsx)(fe,{context:e,children:(0,y.jsx)(pe,{context:e,children:"No such kind of thing here."})});let o=e.views?.lookup(r,{cardinality:"many",fidelity:"full"}),i=a?void 0:Ft(e,r);if(i){let{place:s,flows:l}=i,d=Xe(e.store).relations.filter(c=>c.from===r||c.to===r).map(c=>c.edgeKind);return $t(t,d,l)?(0,y.jsx)(Ha,{context:e,kind:r}):(0,y.jsx)(nt,{context:e,asList:s})}return o!==void 0&&wn(o)&&!a?(0,y.jsx)(fl,{context:e,kind:r,view:o}):(0,y.jsx)(Ha,{context:e,kind:r})}function fl({context:e,kind:n,view:t}){let{store:a,invariantContext:r}=e;le(a);let o=a.schema.tryDefinition(n),i=re(a,n),s=a.graph.nodesOfKind(n).filter(d=>hn(o,d)),l=[...new Set(a.violations(r).flatMap(d=>d.nodeIds))];return(0,y.jsxs)(fe,{context:e,spans:an(t),children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,y.jsx)(xn,{context:e}),(0,y.jsx)(pe,{context:e,children:i}),(0,y.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"kind-original",children:(0,y.jsx)(F,{to:`/${J(a.schema,n)}?drawn=${Kn}`,style:{color:"inherit"},"data-testid":"built-in-list","aria-label":`The original ${i} page`,children:"Original"})})]}),(0,y.jsx)("section",{"data-testid":"list-view",style:{display:"grid",minWidth:0},children:(0,y.jsx)(rn,{kind:n,view:i,said:"",children:(0,y.jsx)(ln,{when:tn(t),full:an(t),children:(0,y.jsx)(t,{nodes:s,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...l.length>0?{flagged:l}:{}})})})})]})}function Ha({context:e,kind:n,opening:t,row:a,layout:r="list",description:o,bare:i}){let{store:s,brand:l,invariantContext:d}=e;le(s);let[c,m]=je(),g=`list-${(0,Be.useId)().replace(/:/g,"")}`,u=s.schema.tryDefinition(n),P=ir(c.get("archived")),f=s.graph.nodesOfKind(n,{archived:P}),v=Xe(s).relations.filter(p=>p.from===n||p.to===n),E=new Set(s.violations(d).flatMap(p=>p.nodeIds)),x=wo(s.schema,ho(s.schema,St(s.schema,n))),b=v.map(p=>p.edgeKind),G=bl(c,x,b),ee=["sort","filter","group","q","by","with","past","archived",...b].some(p=>c.has(p)),W=f.length>=Vi,de=u?.fieldRoles?.when,ie=e.views?.arrangement?.()?.lists?.[n],ne=fo(ie),H=go(ie?.group),T=vl(W,de),te=t??(ne?{...T,...ne}:T),ue=ee?G.arrangement:ha(te,x).arrangement,Se=ne?.sort,z=ue.sort&&Se?.then&&ue.sort.by===Se.by&&ue.sort.direction===Se.direction?{...ue,sort:Se}:ue,ce=kt(z.query??""),$e=new Set((c.get("open")??"").split(",").filter(Boolean)),Ee=$a({schema:s.schema,graph:s.graph,kind:n,nodes:f,arrangement:z,offers:x,declaredGroup:H,flagged:E,...typeof d?.today=="string"?{today:d.today}:{},opened:$e}),{showingPast:Ke,arranged:en}=Ee,nn=Ee.groups,Ln=be(),Ce=Wi(ie?.export===!1,{kind:n},()=>({title:re(s,n),schema:s.schema,graph:s.graph,kind:n,groups:Ee.groups,grouped:Ee.grouped,onExport:e.onExport??Ln?.onExport,words:{labelOf:se,readableFields:vt,withComputed:vn}}));Di(`list:${n}`,Ce);let cn=p=>p.shut,h=p=>{let S=new URLSearchParams(c),B=new Set($e);B.has(p)?B.delete(p):B.add(p),B.size>0?S.set("open",[...B].join(",")):S.delete("open"),m(S,{replace:!0})},w=en.nodes,C=u?.lifecycle&&!Ke?f.filter(p=>hn(u,p)):f,N=f.length-C.length,q=z.group?.by??null,Z=p=>{let S=new URLSearchParams(c);for(let ke of["sort","filter","group","q","by","with","past","archived",...v.map(ct=>ct.edgeKind)])S.delete(ke);let B=Pt(p);for(let ke of["sort","filter","group","q","archived"])B[ke]&&S.set(ke,B[ke]);![...S.keys()].some(ke=>["sort","filter","group","q"].includes(ke))&&(t||ne||W||de)&&S.set("sort",""),m(S)},{principal:U}=e,k=kn(s,n,{...U?{principal:U}:{},...e.invariantContext?{context:e.invariantContext}:{}}),$=k.actions.affordances.map(p=>({affordance:p,mutation:s.allMutations().find(S=>S.name===p.mutation)})).filter(p=>p.mutation!==void 0),me=k.actions.withheld,ye=()=>new Set(w.length===0?$.map(({mutation:p})=>p.name):[]),[Gn,mn]=(0,Be.useState)(()=>({kind:n,open:ye()}));Gn.kind!==n&&mn({kind:n,open:ye()});let qa=p=>(Gn.kind===n?Gn.open:ye()).has(p),ja=(p,S)=>mn(B=>{let ke=new Set(B.open);return S?ke.add(p):ke.delete(p),{kind:B.kind,open:ke}}),Va=`begin-${(0,Be.useId)().replace(/:/g,"")}`,Ua=ce.words&&w.length===0?Object.fromEntries(qt(s,n,k.actions.affordances).map(p=>[p.mutation.name,p.arg])):{},yn=re(s,n),ot=e.views?.lookup(n,{cardinality:"one",fidelity:"glyph"}),zt=ot!==void 0&&!$n(ot)?ot:void 0,Jt=(z.group?.bucket??"day")==="day"?z.group?.by:void 0,Yt=(z.filter??[]).map(p=>p.key),rs=Yt.filter(p=>Yt.indexOf(p)===Yt.lastIndexOf(p)&&/choice|boolean/.test(x.filters.find(S=>S.key===p)?.type??"")),Qt=p=>{let S={...u?.computed?vn(s.schema,s.graph,p):p};Jt&&!String(S[Jt]).includes("T")&&delete S[Jt];for(let B of rs)delete S[B];return S},_a=p=>Vr(u?.fields?.shape?.[p])?.type==="enum",it=p=>{let S=se(u,p);if(a)return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":p.id,style:{minWidth:0},...aa(p.id),children:[ta(p,S),a(p,{label:S,href:ae(s.schema,n,p.id),flagged:E.has(p.id),glance:ei(Qt(p),u,S)})]},p.id);if(zt){let ra=Lt(ot,p,s.graph),cs=Object.fromEntries(Object.entries(Qt(p)).filter(([ps])=>!ra?.fields.has(ps))),Za=ra?Yn(cs,u,ra.title??S,_a):[];return(0,y.jsxs)("li",{"data-testid":"record-row","data-graview-record":p.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...aa(p.id),children:[ta(p,S),(0,y.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,y.jsx)(zt,{node:p,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...E.has(p.id)?{flagged:[p.id]}:{}})}),Za.length>0?(0,y.jsx)("span",{style:{...L,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,y.jsx)(Qn,{runs:Za})}):null,(0,y.jsx)(xl,{to:ae(s.schema,n,p.id),label:E.has(p.id)?`${S} \u2014 implicated in a problem`:S})]},p.id)}let B=Yn(Qt(p),u,S,_a),ke=B.length>0,ct=ce.words?So(u,p,ce.words):void 0,Qa=W?void 0:Ur(p,u),pt=gl(p,u),Xa=(0,y.jsxs)(F,{to:ae(s.schema,n,p.id),className:"graview-row-title",...S.length>60?{title:S}:{},children:[E.has(p.id)?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,S]});return(0,y.jsxs)("li",{className:"graview-row","data-graview-record":p.id,...aa(p.id),children:[ta(p,S),Qa?(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,y.jsx)(Hn,{as:"thumb",file:Qa}),Xa]}):Xa,ke||pt?(0,y.jsxs)("span",{className:"graview-row-glance",children:[(0,y.jsx)(Qn,{runs:B}),ke&&pt?" \xB7 ":null,pt?(0,y.jsx)(Ct,{address:pt}):null]}):null,ct?(0,y.jsx)(Gt,{why:ct}):null]},p.id)},Xt=We(e).filter(p=>p.kind===n&&!p.hidden),za=ie?.filters,os=(z.filter??[]).some(p=>p.key!=="is"||p.value!=="any"),is=!!(z.sort||z.group||z.query||os),ss=C.length>=ji||ee&&is,ze=z.sort?x.sorts.find(p=>p.key===z.sort.by):void 0,Zt=ze?.type==="date"||ze!==void 0&&ze.key===de,Ja=W&&!en.grouped&&ze&&(ze.about==="label"||ze.type==="text"||Zt)?p=>{let S=ze.about==="label"?se(u,p):p[ze.key];if(typeof S!="string"||S.length===0)return Zt?"No date":"#";if(Zt)return S.slice(0,4);let B=S.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(B)?B:"#"}:void 0,st=Ja?w.reduce((p,S)=>{let B=Ja(S);return p.at(-1)?.key===B?p.at(-1).nodes.push(S):p.push({key:B,nodes:[S]}),p},[]):void 0,Ya=Ee.nodes,ea=(0,Be.useMemo)(()=>Ya.map(p=>p.id),[Ya.map(p=>p.id).join(`
|
|
6
|
+
`)]),Ge=Ro(ea),na=(0,Be.useId)(),qn=(U?s.permittedMutations(U):s.permittedMutations()).some(p=>{let S=p.subject?.kinds;return S!==void 0&&(S==="*"||S.includes(n))}),ta=(p,S)=>qn?(0,y.jsx)("span",{className:"graview-choose-at",children:(0,y.jsx)("input",{...Ge.boxProps(p.id,S),onPointerEnter:wa,onFocus:wa})}):null,aa=p=>qn?{"data-graview-choose":p}:{},ls=(0,Be.useCallback)(p=>{Ge.choose(p),requestAnimationFrame(()=>{let S=Ge.list.current;((p[0]===void 0?null:S?.querySelector(`[data-graview-choose-box="${CSS.escape(p[0])}"]`))??S)?.focus({preventScroll:!0})})},[Ge]),Tn=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||zt?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,lt=Tn?void 0:"graview-rows",jn=p=>`list-at-${p.replace(/[^\p{L}\p{N}]/gu,"_")}`,dt=v.map(p=>{let S=p.from===n?p.to:p.from,B=p.from===n?p.description:p.inverse??p.description;return{relation:p,far:S,words:B}}),ds=new Set(dt.map(p=>(p.words??"").toLowerCase()).filter((p,S,B)=>p&&B.indexOf(p)!==S));return(0,y.jsxs)(i?wl:fe,{context:e,children:[(0,y.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("header",{style:{display:"grid",gap:4},children:[i?null:(0,y.jsx)(xn,{context:e}),(0,y.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,y.jsx)(xe,{kind:n,brand:l,schema:s.schema,size:8}),(0,y.jsx)(pe,{context:e,children:yn}),$.length>0?(0,y.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:$.map(({affordance:p,mutation:S})=>(0,y.jsx)(Sl,{name:S.name,title:S.title??S.name,panel:`${Va}-${S.name}`,open:qa(S.name),onOpen:B=>ja(S.name,B)},p.id))}):null,!Ce.off&&C.length>0?(0,y.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void Ma(Ce),style:{...Oe,minHeight:28,margin:"-4px 0",...$.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),w.length>0?(0,y.jsx)(Xo,{place:"here",to:[{label:`Skip to the ${w.length===1?qe(u,n):`${w.length} ${yn.toLowerCase()}`}`,testid:"records",go:()=>{let p=document.querySelector(`[data-graview-skip-target="${CSS.escape(na)}"]`);Sa(p?.querySelector('[data-graview-choose-box][tabindex="0"]')??p)}},...C.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let p=document.querySelector(`[data-graview-skip-target="${CSS.escape(na)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');Sa(p?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??p)}}]:[]]}):null,o??u?.description?(0,y.jsx)("p",{style:he,children:o??u?.description}):null,dt.length>0||Xt.length>0?(0,y.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[dt.length>0?(0,y.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",dt.map(({relation:p,far:S,words:B},ke)=>(0,y.jsxs)("span",{"data-relation":p.edgeKind,children:[ke>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,S==="*"?Qe(B??pn(p.edgeKind)):(0,y.jsx)(F,{to:`/${J(s.schema,S)}`,style:Y,title:re(s,S),children:B&&ds.has(B.toLowerCase())?`${Qe(B)}: ${re(s,S).toLowerCase()}`:Qe(B??re(s,S))})]},`${p.edgeKind}|${p.from}|${p.to}`))]}):null,Xt.length>0?(0,y.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",Xt.map((p,S)=>(0,y.jsxs)("span",{children:[S>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)(F,{to:Pe(e,p),style:Y,children:p.title})]},Pn(p)))]}):null]}):null]}),$.length>0?(0,y.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:$.map(({affordance:p,mutation:S})=>{let B=!!(Ua[S.name]&&w.length===0);return(0,y.jsx)(kl,{name:S.name,id:`${Va}-${S.name}`,description:S.description,open:qa(S.name),onClose:()=>ja(S.name,!1),children:(0,y.jsx)(Ie,{store:s,mutation:S,prefilled:p.args,open:p.open,...B?{initial:{[Ua[S.name]]:ce.words}}:{},...e.principal?{principal:e.principal}:{}},B?`${S.name}|${ce.words}`:S.name)},p.id)})}):null,G.dropped.length>0?(0,y.jsxs)("p",{style:{...L,margin:0},"data-testid":"list-dropped",children:["This link asked for ",G.dropped.join(", "),", which ",yn.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,C.length>0?(0,y.jsx)(Ao,{schema:s.schema,graph:s.graph,kind:n,arrangement:z,onChange:Z,kept:{shown:w.length,of:C.length},noun:{one:qe(u,n),many:yn.toLowerCase()},...ss?{}:{allow:!1},...za?{filters:za}:{},offers:x,chips:{nodes:C,flagged:E,...typeof d?.today=="string"?{today:d.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,y.jsx)("style",{children:Dn}),qn?(0,y.jsx)("style",{children:Lo+hl}):null,(0,y.jsx)("div",{className:"graview-list","data-graview-skip-target":na,...qn?{...Ge.listProps,ref:Ge.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ge.chosen.length>0?`${yn}, ${Ge.chosen.length} chosen`:yn,role:"group"}:{},children:w.length===0&&ce.words?(0,y.jsxs)("p",{style:he,"data-testid":"none-yet",children:["Nothing here is called \u201C",ce.words,"\u201D."," ",(0,y.jsx)("span",{style:L,"data-testid":"list-searched",children:xt(s.schema,{kinds:[n],past:Ke})})," ",(0,y.jsx)(F,{to:"?",style:Y,children:"Show every one"})]}):w.length===0?(0,y.jsxs)("p",{style:he,"data-testid":"none-yet",children:[z.filter?.length||z.query?"None of them.":"None yet",!z.filter?.length&&!z.query&&$.length>0?` \u2014 the first one starts above, with \u201C${$[0]?.mutation.title??$[0]?.mutation.name}\u201D.`:!z.filter?.length&&!z.query?".":"",z.filter?.length||z.query?(0,y.jsxs)(y.Fragment,{children:[" ",(0,y.jsx)(F,{to:"?",style:Y,children:"Show every one"})]}):null]}):en.grouped&&q?(0,y.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":q,children:nn.map(p=>{if(!p.closed)return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,y.jsxs)("h2",{className:"graview-group-head",children:[p.label," ",(0,y.jsx)("span",{children:p.nodes.length})]}),(0,y.jsx)("ul",{style:Tn,className:lt,"data-graview-rows":"",children:p.nodes.map(it)})]},p.key||"-");let S=cn(p),B=`${g}-${jn(p.key||"none")}`;return(0,y.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":S?"shut":"open",children:[(0,y.jsx)("h2",{className:"graview-group-head",children:(0,y.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!S,"aria-controls":B,"data-testid":"list-group-toggle",onClick:()=>h(p.value),children:[(0,y.jsx)("span",{"aria-hidden":"true",children:S?"\u25B8":"\u25BE"}),p.label," ",(0,y.jsxs)("span",{children:["\xB7 ",p.nodes.length]}),(0,y.jsxs)("span",{style:ml,children:[" ",p.nodes.length===1?qe(u,n):yn.toLowerCase()]})]})}),(0,y.jsx)("ul",{id:B,style:S?{...Tn,display:"none"}:Tn,className:lt,"data-graview-rows":"",hidden:S,children:S?null:p.nodes.map(it)})]},p.key||"-")})}):st&&st.length>1?(0,y.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":ze?.type==="date"?"year":"letter",children:[(0,y.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...L,display:"flex",flexWrap:"wrap",gap:ze?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:st.map(p=>(0,y.jsx)("a",{href:`#${jn(p.key)}`,onClick:S=>{S.preventDefault(),document.getElementById(jn(p.key))?.scrollIntoView({block:"start"})},style:{...Oe,minWidth:24,justifyContent:"center"},children:p.key},p.key))}),st.map(p=>(0,y.jsxs)("section",{"data-testid":"list-section","aria-labelledby":jn(p.key),style:{display:"grid",gap:0},children:[(0,y.jsx)("h2",{id:jn(p.key),className:"graview-group-head",children:p.key}),(0,y.jsx)("ul",{style:Tn,className:lt,"data-graview-rows":"",children:p.nodes.map(it)})]},p.key))]}):(0,y.jsx)("ul",{style:Tn,className:lt,"data-testid":"records","data-graview-rows":"",children:w.map(it)})}),qn?(0,y.jsx)(To,{store:s,chosen:Ge.chosen,...U?{principal:U}:{},...d?{context:d}:{},anchor:yl,of:ea.length,onChooseAll:()=>Ge.choose(ea),onClear:Ge.clear,onActed:ls}):null,N>0?(0,y.jsxs)(F,{to:qi(c,"filter","is:any"),style:{...Y,...L,justifySelf:"start"},"data-testid":"past-link",children:["+",N," past"]}):null,P===!1&&s.graph.count(n,{archived:!0})>0?(0,y.jsxs)(F,{to:qi(c,"archived","true"),style:{...Y,...L,justifySelf:"start"},"data-testid":"archived-link",children:["+",s.graph.count(n,{archived:!0})," archived"]}):null]}),(0,y.jsx)(Kt,{context:e,withheld:me,style:ve,testId:"withheld"})]})}var ml={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},yl=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,hl=`
|
|
7
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${gr.raised};display:flex;align-items:center}
|
|
10
|
+
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
+
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
+
.graview-choose-at{left:-34px}
|
|
13
|
+
}
|
|
14
|
+
@media (pointer: coarse){
|
|
15
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
+
}
|
|
18
|
+
`;function wl({children:e}){return(0,y.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var vl=(e,n)=>n?{sort:{by:n,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function bl(e,n,t){let a=Vn({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),i=a.group??(o?{by:o}:void 0);for(let l of t){let d=e.get(l);d&&r.push({key:l,value:d})}let s=e.get("with");return s&&r.push({key:s,value:"*"}),e.get("past")==="1"&&!r.some(l=>l.key==="is")&&r.push({key:"is",value:"any"}),ha({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...i?{group:i}:{},...a.archived!==void 0?{archived:a.archived}:{}},n)}function qi(e,n,t){let a=new URLSearchParams(e);return a.set(n,t),a.delete("past"),`?${a.toString()}`}function Sl({name:e,title:n,panel:t,open:a,onOpen:r}){return(0,y.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":t,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(t)?.querySelector("input, select, textarea, button")?.focus())},style:{...Oe,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,y.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),n]})}function kl({name:e,id:n,description:t,open:a,onClose:r,children:o}){return(0,y.jsxs)("div",{"data-testid":`act-${e}`,id:n,hidden:!a,onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),r(),document.querySelector(`[aria-controls="${n}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[t?(0,y.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:t}):null,o]})}function xl({to:e,label:n}){let t=(0,Be.useRef)(null);return Eo(t),(0,y.jsx)(F,{ref:t,to:e,"aria-label":n,style:{position:"absolute",inset:0,borderRadius:6}})}var Ze=M(Re(),1);var at=M(Re(),1);var K=M(j(),1);function Da({context:e}){let{store:n,brand:t,invariantContext:a,principal:r}=e;le(n);let o=n.violations(a),i=n.allInvariants(),s=yt(n,o),l=Wr(n.schema,i);return(0,K.jsxs)(fe,{context:e,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)(pe,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,K.jsx)("p",{style:he,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":sr(o)})]}),(0,K.jsx)(Li,{context:e}),s.map((d,c)=>{let m=d.nodeIds[0],g=m?n.graph.getNode(m):void 0;return(0,K.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:[d.line?null:(0,K.jsx)(jt,{violation:d,schema:n.schema,...t?{brand:t}:{}}),g?(0,K.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(xe,{kind:g.kind,brand:t,schema:n.schema,size:7}),(0,K.jsx)(F,{to:ae(n.schema,g.kind,g.id),style:Y,children:se(n.schema.tryDefinition(g.kind),g)})]}):null,d.line?(0,K.jsx)(jt,{violation:d,schema:n.schema,...t?{brand:t}:{}}):null,(0,K.jsx)(Vt,{store:n,repairs:d.repairs,...r?{principal:r}:{}})]},c)}),i.length>0?(0,K.jsxs)("section",{style:{...ve,display:"grid",gap:12},"data-testid":"rules",children:[(0,K.jsx)("h2",{style:ge,children:"The rules"}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(d=>{let c=o.filter(u=>u.invariant===d.name).length,m=l.get(d.name),g=d.label??d.name;return(0,K.jsxs)("li",{"data-graview-rule":d.name,style:{display:"grid",gap:2},children:[(0,K.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[m?(0,K.jsx)(ht,{line:m,schema:n.schema,...t?{brand:t}:{},style:{flex:"1 1 18rem"}}):(0,K.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:g}),(0,K.jsx)("span",{style:{...L,color:c>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:c===0?"holds":`broken in ${c} ${c===1?"place":"places"}`})]}),m&&g.trim().length>0?(0,K.jsx)("span",{style:L,children:g}):null]},d.name)})})]}):null]})}function jt({violation:e,schema:n,brand:t}){if(!e.line)return(0,K.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=Kr(e),r=Br(e);return r?(0,K.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,K.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,K.jsx)("span",{style:L,children:a}):null,(0,K.jsxs)("details",{"data-testid":"problem-judged",style:L,children:[(0,K.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,K.jsx)(ht,{line:e.line,schema:n,...t?{brand:t}:{},lead:"none"})]})]}):(0,K.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,K.jsx)(ht,{line:e.line,schema:n,...t?{brand:t}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,K.jsx)("span",{style:L,children:a}):null]})}function Vt({store:e,repairs:n,principal:t}){let[a,r]=(0,at.useState)(null),[o,i]=(0,at.useState)(null),s=(0,at.useRef)([]);if(n.length===0)return null;let l=a===null?null:n[a],d=l&&(l.missing??[]).length>0?e.allMutations().find(c=>c.name===l.mutation):void 0;return(0,K.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,K.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:n.map((c,m)=>{let g=(c.missing??[]).length>0,u=e.permits({name:c.mutation,args:{...c.args}},t);return u.ok?(0,K.jsx)("button",{ref:P=>{s.current[m]=P},type:"button","data-graview-repair":c.mutation,"data-graview-asks":g||void 0,"aria-expanded":g?a===m:void 0,onClick:()=>{if(i(null),g){r(a===m?null:m);return}r(null);try{e.apply({name:c.mutation,args:{...c.args}},t?{author:t}:{})}catch(P){i(Fn(e.schema,e.allMutations(),P))}},style:He,children:g?`${c.label} \u2026`:c.label},m):(0,K.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...L,margin:0},children:[(0,K.jsx)("s",{children:c.label})," \u2014 ",u.refusal.message]},m)})}),d&&l?(0,K.jsx)(Ie,{store:e,mutation:d,prefilled:{...l.args},only:l.missing??[],label:l.label,autoFocus:!0,onDone:()=>{let c=a;r(null),requestAnimationFrame(()=>{let m=c===null?null:s.current[c];if(m?.isConnected){m.focus();return}let g=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");g&&(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus())})},...t?{principal:t}:{}}):null,l&&!d&&(l.missing??[]).length>0?(0,K.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:ka},children:["\u201C",l.label,"\u201D names ",l.mutation,", which this app does not declare."]}):null,o?(0,K.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:ka},children:o}):null]})}var rt=M(Re(),1);var Wa=M(Re(),1);var fn=M(j(),1);function Ui({store:e,link:n,principal:t}){let[a,r]=(0,Wa.useState)(!1),[o,i]=(0,Wa.useState)(null),s=oo(n);return(0,fn.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,fn.jsx)("button",{type:"button","data-graview-provisional":"",title:s,"aria-label":`Unsure link: ${s}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,fn.jsxs)("span",{style:{...L,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,fn.jsx)("span",{children:s}),(0,fn.jsx)("button",{type:"button",style:{...He,padding:"4px 10px"},onClick:()=>{try{e.apply({name:cr,args:{kind:n.edge.kind,from:n.edge.from,to:n.edge.to}},t?{author:t}:{}),r(!1)}catch(l){i(Fn(e.schema,e.allMutations(),l))}},children:"Keep this link"}),o?(0,fn.jsx)("span",{role:"alert",children:o}):null]}):null]})}var we=M(j(),1);function _i({nodeId:e,node:n,field:t,inPlace:a,labelStyle:r=Ve,late:o=!1,required:i=!1}){return t.blank?(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},"data-graview-blank-fact":t.key,"data-graview-fact":t.key,children:[(0,we.jsx)("dt",{style:r,children:t.label}),(0,we.jsxs)("dd",{style:{margin:0,minWidth:0},children:[a?(0,we.jsx)(zn,{nodeId:e,field:t.key,value:"",said:`${t.label}: add`,blank:!0}):null,i?(0,we.jsx)("span",{"data-graview-needed":t.key,style:{marginLeft:8,fontSize:"0.75rem",color:"var(--graview-warn)"},children:"Needed"}):null]})]}):t.files?(0,we.jsx)(Hn,{as:"field",read:!a,nodeId:e,field:t.key,label:t.label,files:t.files,labelStyle:r,style:{gap:4}}):t.long?(0,we.jsx)(Po,{nodeId:e,field:t.key,label:t.label,value:t.value,markdown:t.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},"data-graview-fact":t.key,children:[(0,we.jsx)("dt",{style:r,children:t.label}),(0,we.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:t.linked?(0,we.jsx)(to,{relation:t.linked.relation,refs:t.linked.refs,...a?{nodeId:e,field:t.key}:{}}):t.app?(0,we.jsx)(Ct,{address:t.app,as:"record",...a?{nodeId:e,field:t.key}:{}}):t.href?(0,we.jsx)(xo,{href:t.href,field:t.key,value:t.value,stored:t.stored,...a?{nodeId:e}:{}}):a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(zn,{nodeId:e,field:t.key,value:t.value,stored:t.stored,late:o}),t.repeats?(0,we.jsx)(ao,{nodeId:e,field:t.key,start:n?.[t.key],value:n?.[`${t.key}Repeat`],label:`${t.label} repeats`}):null]}):t.value})]})}var Rn=M(Re(),1),_e=M(j(),1),Pl=7,Al=40;function Ba({label:e,offered:n,onPick:t,onClose:a}){let[r,o]=(0,Rn.useState)(""),i=(0,Rn.useRef)(null),s=(0,Rn.useRef)(null),l=n.length>Pl,d=r.trim().toLowerCase(),c=d===""?n:n.filter(u=>`${u.label} ${u.apart??""}`.toLowerCase().includes(d)),m=c.slice(0,Al);(0,Rn.useEffect)(()=>{(s.current??i.current?.querySelector("button[data-graview-candidate]"))?.focus()},[]);let g=(u,P)=>{let f=[...i.current?.querySelectorAll("input, button[data-graview-candidate]")??[]],v=f.indexOf(u);f[Math.max(0,Math.min(f.length-1,v+P))]?.focus()};return(0,_e.jsxs)("div",{ref:i,role:"group","aria-label":e,"data-graview-relation-picker":"",onKeyDown:u=>{u.key==="Escape"?(u.preventDefault(),u.stopPropagation(),a()):(u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),g(u.target,u.key==="ArrowDown"?1:-1))},onBlur:u=>{let P=u.relatedTarget;P&&!u.currentTarget.contains(P)&&a()},style:{display:"grid",gap:6,marginTop:8,padding:"8px 0",maxWidth:420,minWidth:0},children:[l?(0,_e.jsx)("input",{ref:s,type:"search","aria-label":`${e}: find one`,placeholder:"Find one\u2026",value:r,onChange:u=>o(u.target.value),onKeyDown:u=>{u.key==="Enter"&&m[0]&&(u.preventDefault(),t(m[0].id))},style:{font:"inherit",fontSize:"inherit",minHeight:32,padding:"0 10px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)",minWidth:0}}):null,m.length>0?(0,_e.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",maxHeight:280,overflowY:"auto"},children:m.map(u=>(0,_e.jsx)("li",{children:(0,_e.jsxs)("button",{type:"button","data-graview-candidate":u.id,onClick:()=>t(u.id),style:{all:"unset",cursor:"pointer",boxSizing:"border-box",display:"flex",gap:8,alignItems:"baseline",width:"100%",minHeight:32,padding:"4px 8px",borderRadius:"var(--graview-radius-sm, 8px)",color:"var(--graview-ink)",overflowWrap:"anywhere"},className:"graview-candidate",children:[u.label,u.apart?(0,_e.jsx)("span",{style:{color:"var(--graview-ink-muted)",fontSize:"0.875em"},children:u.apart}):null]})},u.id))}):(0,_e.jsx)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:n.length===0?"Nothing else to choose.":"Nothing matches."}),c.length>m.length?(0,_e.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)",fontSize:"0.875em"},children:[c.length-m.length," more \u2014 type to narrow them."]}):null,(0,_e.jsx)("style",{children:".graview-candidate:hover,.graview-candidate:focus-visible{background:var(--graview-panel)}.graview-candidate:focus-visible{outline:2px solid var(--graview-accent);outline-offset:-2px}"})]})}var X=M(j(),1);function Ji({context:e,id:n,facts:t,fields:a,relations:r,inPlace:o,heading:i,className:s,style:l,children:d}){let{store:c}=e,m=c.graph.getNode(n),g=c.schema.tryDefinition(t.kind),u=g?.fields?.shape??{},P=new Set(t.violations.flatMap(f=>f.repairs.filter(v=>Object.values(v.args??{}).includes(n)).flatMap(v=>v.missing??[])));return a.length===0&&r.length===0&&!d?null:(0,X.jsxs)("section",{"data-testid":"record-fields","data-graview-fact-sheet":"",className:s,style:{display:"grid",gap:16,minWidth:0,...l},children:[(0,X.jsx)("style",{children:Ml}),i??(0,X.jsx)("h2",{style:ge,children:"The facts"}),qr(g,a).map((f,v)=>(0,X.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},children:[f.title?(0,X.jsx)("h3",{"data-graview-field-group":f.title,style:Tl,children:f.title}):null,(0,X.jsx)("dl",{"data-graview-sheet":"",children:f.fields.map(E=>(0,X.jsx)(_i,{nodeId:n,node:m,field:E,inPlace:o,labelStyle:Ut,late:P.has(E.key),required:E.blank===!0&&Rl(u[E.key])},E.key))})]},v)),d?(0,X.jsx)("dl",{"data-graview-sheet":"",children:d}):null,r.length>0?(0,X.jsx)("dl",{"data-graview-sheet":"","data-graview-relations":"",children:r.map(f=>(0,X.jsx)(Ll,{context:e,id:n,relation:f,inPlace:o},f.key))}):null]})}function Cl(e,n,t){let a=n.filter(o=>!t.includes(o)).flatMap(o=>{let i=e.graph.getNode(o);return i?[i]:[]}),r=wt(a,o=>e.schema.tryDefinition(o));return a.map(o=>({id:o.id,label:se(e.schema.tryDefinition(o.kind),o),apart:r.get(o.id)})).sort((o,i)=>o.label.localeCompare(i.label))}function Rl(e){let n=ut(e)?.type;return n!==void 0&&n!=="optional"&&n!=="nullable"&&n!=="default"}function Ll({context:e,id:n,relation:t,inPlace:a}){let{store:r,brand:o,principal:i}=e,[s,l]=(0,rt.useState)(!1),[d,c]=(0,rt.useState)(void 0),m=(0,rt.useRef)(null),g=a?t.set:void 0,u=a?t.remove:void 0,P=()=>requestAnimationFrame(()=>{let x=document.activeElement;if(x&&x!==document.body&&x.isConnected)return;let b=m.current;(b?.querySelector("[data-graview-relation-set]")??b?.querySelector("a, button"))?.focus()}),f=x=>{try{r.apply(x,i?{author:i}:{}),c(void 0)}catch(b){c(Fn(r.schema,r.allMutations(),b))}},v=t.targets.length===0,E=x=>(0,X.jsx)("button",{type:"button","data-graview-relation-set":g.affordance.mutation,"aria-expanded":s,title:`${g.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{c(void 0),l(!s)},style:Nl,children:x});return(0,X.jsxs)("div",{ref:m,"data-graview-relation":t.edgeKind,"data-graview-direction":t.direction,...t.one?{"data-graview-one":""}:{},children:[(0,X.jsx)("dt",{style:Ut,children:t.label}),(0,X.jsxs)("dd",{style:{margin:0,minWidth:0},children:[(0,X.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:6},children:[t.targets.map(x=>{let b=io(r,t.direction==="in"?{kind:t.edgeKind,from:x.id,to:n}:{kind:t.edgeKind,from:n,to:x.id});return(0,X.jsxs)("span",{"data-graview-chip":x.id,style:El,children:[(0,X.jsx)(xe,{kind:x.kind,...o?{brand:o}:{},schema:r.schema,size:6}),(0,X.jsxs)(F,{to:ae(r.schema,x.kind,x.id),style:Ol,children:[x.label,x.apart?(0,X.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:[" \xB7 ",x.apart]}):null]}),b?.provisional?(0,X.jsx)(Ui,{store:r,link:b,...i?{principal:i}:{}}):null,t.one&&g?(0,X.jsx)("button",{type:"button","data-graview-relation-set":g.affordance.mutation,"aria-label":g.affordance.label,"aria-expanded":s,title:`${g.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{c(void 0),l(!s)},style:zi,children:(0,X.jsx)("span",{"aria-hidden":"true",children:"\u25BE"})}):null,!t.one&&u?(0,X.jsx)("button",{type:"button","data-graview-relation-remove":u.affordance.mutation,"aria-label":`${u.affordance.label}: ${x.label}`,title:`${u.affordance.label} \u2014 an act, so it is in the history and can be taken back`,onClick:()=>{f({name:u.affordance.mutation,args:{...u.affordance.args,[u.arg]:x.id}}),P()},style:zi,children:(0,X.jsx)("span",{"aria-hidden":"true",children:"\xD7"})}):null]},x.id)}),g&&(v||!t.one)?E(g.affordance.label):null,v&&!g?(0,X.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:"None"}):null,d?(0,X.jsx)("span",{role:"status","data-graview-refused":t.edgeKind,style:{fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:d}):null]}),s&&g?(0,X.jsx)(Ba,{label:g.affordance.label,offered:Cl(r,g.candidates,t.targets.map(x=>x.id)),onPick:x=>{l(!1),f({name:g.affordance.mutation,args:{...g.affordance.args,[g.arg]:x}}),P()},onClose:()=>{l(!1),P()}}):null,!t.one&&t.targets.length>0?[...new Set(t.targets.map(x=>x.kind))].map(x=>(0,X.jsx)(F,{to:`/${J(r.schema,x)}?${encodeURIComponent(t.edgeKind)}=${encodeURIComponent(n)}`,style:{...Ue,...L,display:"inline-flex",marginTop:4},"data-testid":"related-all",children:(0,X.jsxs)(sn,{children:["Sort and filter ",t.description??`these ${re(r,x).toLowerCase()}`,t.targets.some(b=>b.kind!==x)?` (${re(r,x).toLowerCase()})`:""]})},x)):null]})]})}var Ut={margin:0,color:"var(--graview-ink-muted)",fontSize:"var(--graview-text-small)",lineHeight:1.5,paddingTop:2},Tl={margin:0,fontSize:"var(--graview-text-small)",color:"var(--graview-ink)",fontWeight:"var(--graview-weight-label)"},El={display:"inline-flex",alignItems:"center",gap:6,maxWidth:"100%",minHeight:28,padding:"0 4px 0 10px",borderRadius:999,background:"var(--graview-panel)",color:"var(--graview-ink)"},Ol={...Y,color:"var(--graview-ink)",textDecoration:"none",overflowWrap:"anywhere",minHeight:24,display:"inline-flex",alignItems:"center",paddingRight:6},zi={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:24,minHeight:24,borderRadius:999,color:"var(--graview-ink-muted)"},Nl={all:"unset",cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:28,padding:0,color:"var(--graview-ink-muted)",borderBottom:"1px dashed var(--graview-edge-bright)"},Yi={font:"inherit",fontSize:"inherit",color:"inherit",background:"none",border:0,padding:0,minHeight:24,cursor:"pointer",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:"0.2em"},Ka={font:"inherit",fontSize:"var(--graview-text-body)",color:"var(--graview-ink)",background:"none",border:0,borderRadius:"var(--graview-radius-sm, 8px)",padding:"4px 0",minHeight:32,cursor:"pointer",textAlign:"start",textDecoration:"underline",textDecorationColor:"var(--graview-edge)",textUnderlineOffset:"0.25em"},Ml=`[data-graview-sheet]{margin:0;display:grid;grid-template-columns:minmax(0,10rem) minmax(0,1fr);column-gap:28px;row-gap:12px;align-items:baseline;min-width:0}
|
|
19
|
+
[data-graview-sheet]>*{display:grid!important;grid-column:1/-1!important;grid-template-columns:subgrid;column-gap:28px!important;row-gap:4px!important;align-items:baseline;min-width:0}
|
|
20
|
+
[data-graview-sheet]>*>dt{grid-column:1}[data-graview-sheet]>*>dd{grid-column:2;margin:0}
|
|
21
|
+
[data-graview-sheet]>[data-graview-long]>dt,[data-graview-sheet]>[data-graview-long]>dd,[data-graview-sheet]>[data-graview-files]>dt,[data-graview-sheet]>[data-graview-files]>dd{grid-column:1/-1}
|
|
22
|
+
[data-graview-chip] a:hover{text-decoration:underline}[data-graview-chip] button:hover,[data-graview-relation-set]:hover{color:var(--graview-ink)}
|
|
23
|
+
@media (max-width:560px){[data-graview-sheet]{grid-template-columns:minmax(0,1fr)}[data-graview-sheet]>*>dt,[data-graview-sheet]>*>dd{grid-column:1}}`;var $l=e=>e.charAt(0).toUpperCase()+e.slice(1);function Fl(e,n,t){if(t.provider==="invariant"||t.batch)return;let a=e.allMutations().find(v=>v.name===t.mutation);if(!a?.subject||a.creates?.length)return;let r=a.connects??[],o=a.severs??[],i=new Set([...r,...o]);if(i.size!==1)return;let s=[...i][0],l=t.open.filter(v=>!v.optional);if(l.length!==1||!l[0].kinds?.length)return;let d=l[0],c=Object.entries(t.args).find(([,v])=>v===n)?.[0];if(c===void 0)return;let m=e.graph.getNode(n);if(!m)return;let g=c===a.subject.arg,u=g?[m.kind]:d.kinds;for(let v of u){let E=e.schema.tryDefinition(v);if(E&&ia(a,E).length>0)return}let P=u.some(v=>!!e.schema.tryDefinition(v)?.edges?.[s]);return{relation:s,direction:g===P?"out":"in",verb:r.includes(s)?"set":"remove",moves:r.includes(s)&&o.includes(s)&&g,act:{affordance:t,arg:d.name,candidates:d.candidates??[]},farKinds:d.kinds}}function Hl(e,n,t,a,r){if(a==="out")return e.schema.tryDefinition(n)?.edges?.[t]?.description;for(let o of r){let i=e.schema.tryDefinition(o)?.edges?.[t];if(i)return i.inverse??i.description}}function Qi(e,n,t){let a=t.actions.affordances.flatMap(i=>{let s=Fl(e,n,i);return s?[s]:[]}),r=t.links.map(i=>({group:i,set:void 0,remove:void 0,moves:!1})),o=(i,s)=>i.group.edgeKind===s.relation&&i.group.direction===s.direction&&(i.group.targets.length===0||i.group.targets.some(l=>s.farKinds.includes(l.kind)||s.farKinds.includes("*")));for(let i of a){let s=r.find(l=>o(l,i));if(!s&&i.verb==="set"){let l=Hl(e,t.kind,i.relation,i.direction,i.farKinds);s={group:{edgeKind:i.relation,direction:i.direction,...l?{description:l}:{},targets:[]},set:void 0,remove:void 0,moves:!1},r.push(s)}s&&(i.verb==="set"&&!s.set&&(s.set=i.act,s.moves=i.moves),i.verb==="remove"&&!s.remove&&(s.remove=i.act))}return r.map(({group:i,set:s,remove:l,moves:d})=>({...i,key:`${i.edgeKind}|${i.direction}|${i.description??""}`,label:i.description?$l(i.description):`${i.direction==="in"?"\u2190 ":"\u2192 "}${pn(i.edgeKind)}`,one:i.direction==="out"&&e.schema.edge(i.edgeKind)?.cardinality==="one"||d,...s?{set:s}:{},...l?{remove:l}:{}}))}function Il(e,n,t,a){let r=e.graph.getNode(n);if(!r)return new Set;let o=e.schema.tryDefinition(r.kind),i=new Set(a.fields),s=new Map;for(let c of _n(e,n,a.principal?{principal:a.principal}:{}))i.has(c.field)&&s.set(c.field,new Set([c.mutation,...c.alternatives.map(m=>m.mutation)]));let l=new Set(a.relations.flatMap(c=>[c.set?.affordance.id,c.remove?.affordance.id]).filter(c=>c!==void 0)),d=new Set;for(let c of t.affordances){if(c.provider==="invariant"||c.batch)continue;if(l.has(c.id)){d.add(c.id);continue}let m=e.allMutations().find(P=>P.name===c.mutation);if(!m?.subject||!o||m.creates?.length||m.connects?.length||m.severs?.length||c.args[m.subject.arg]!==n)continue;let g=ia(m,o);if(g.length!==1)continue;let u=g[0];s.get(u)?.has(m.name)&&(c.open.some(P=>!P.optional&&P.name!==u)||d.add(c.id))}return d}function Xi(e,n,t,a){let r=Il(e,n,t,a);return r.size===0?t:{...t,affordances:t.affordances.filter(o=>!r.has(o.id))}}function Zi(e,n,t,a){let r=e.graph.getNode(n);if(r)return _n(e,n,a?{principal:a}:{}).find(o=>o.takesValue&&o.open.length===0&&o.shape.type==="text"&&r[o.field]===t)?.field}var A=M(j(),1),Dl=[];function Ga({context:e}){let{store:n,brand:t,principal:a,invariantContext:r}=e,o=le(n),i=be()!==null,s=gn(),l=je()[0].get("drawn")==="built-in",d=decodeURIComponent(s.id??""),c=Mt(n,d,{...a?{principal:a}:{},...r?{context:r}:{},...i?{blanks:oi(n,d,a)}:{}}),m=yt(n,c?.violations??Dl),[g,u]=(0,Ze.useState)(null),[P,f]=(0,Ze.useState)(!1),[v,E]=(0,Ze.useState)(null),[x,b]=(0,Ze.useState)(null),G=x!==null&&x.id===d&&x.tick===o,ee=(0,Ze.useRef)(null),W=(0,Ze.useRef)(null),de=ro({flow:"both",letters:!0}),ie=k=>{(ee.current?.parentElement?.querySelector(`[data-affordance="${k.replace(/["\\]/g,"\\$&")}"]`)??ee.current)?.focus()};if(!c)return(0,A.jsx)(fe,{context:e,children:(0,A.jsx)(pe,{context:e,children:"Nothing lives at this address."})});let ne=n.graph.getNode(d),H=n.schema.tryDefinition(c.kind),T=H?.describe&&ne?Gr(H,ne):null,te=[...n.log.all()].filter(k=>!Nn(k)&&(k.writes.includes(d)||k.reads.includes(d))).slice(-8).reverse(),ue=n.log.all().find(k=>!Nn(k)&&k.undoes===void 0&&k.primitives.some($=>$.op==="add-node"&&$.node.id===d)),Se=a??n.seenFor,z=Se?c.actions.withheld.filter(k=>k.provider!=="invariant"&&n.mayPropose({name:k.mutation,args:{...k.args}},Se)):[],ce=e.views?.lookup(c.kind,{cardinality:"one",fidelity:"full"}),$e=ce!==void 0&&!$n(ce)&&!(l&&wn(ce))?ce:void 0,Ee=$e&&ne&&!G?Lt(ce,ne,n.graph):void 0,Ke=i?Zi(n,d,c.label,a):void 0,en=c.fields.filter(k=>!Ee?.fields.has(k.key)&&k.key!==Ke),nn=Qi(n,d,c).flatMap(k=>{if(!Ee)return[k];let $=k.targets.filter(me=>!Ee.records.has(me.id));return $.length>0||k.targets.length===0&&k.set?[{...k,targets:$}]:[]}),Ce=[...(i?Xi(n,d,c.actions,{fields:[...en.map(k=>k.key),...Ke?[Ke]:[]],relations:nn,...a?{principal:a}:{}}):c.actions).affordances.filter(k=>k.provider!=="invariant"),...z],cn=Ce.filter(k=>k.destructive||k.setsAside),h=P||cn.length<2||cn.length===Ce.length?Ce:Ce.filter(k=>!cn.includes(k)),w=$e!==void 0&&wn(ce)&&!G,C=w&&ne!==void 0&&ce.ownHeading===!0,N=i&&bt(H).length>0,q=ne?jr(e.app?.connections,c.kind,d):void 0,Z=We(e).filter(k=>!k.hidden&&(k.kind===c.kind||k.across===c.kind)),U=$e!==void 0&&ne!==void 0&&an(ce);return(0,A.jsxs)(fe,{context:e,spans:U,...U&&C?{bleedTop:"full"}:{},children:[(0,A.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,A.jsx)(xn,{context:e}),C?(0,A.jsx)(pe,{context:e,unseen:!0,children:c.label}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(pe,{context:e,children:Ke?(0,A.jsx)(zn,{nodeId:d,field:Ke,value:c.label,said:c.label}):c.label}),T&&T!==c.label?(0,A.jsx)("p",{style:he,children:T}):null,ue?.lineage?(0,A.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-lineage",children:["Made by ",Jn(ue,a,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",ga(ue.lineage)]}):null,(0,A.jsxs)("div",{style:{...L,display:"flex",flexWrap:"wrap",alignItems:"center",gap:"4px 20px"},"data-graview-record-asides":"",children:[(0,A.jsx)(Pa,{context:e,stop:`#focus=${encodeURIComponent(d)}`,style:{...Ue,...L},"data-testid":"spatial-link"}),i&&ne?(0,A.jsx)(fa,{choices:[{on:"changed",record:d},{on:"act",record:d},{on:"reaches",kind:c.kind,condition:"",record:d}],label:"Notify me when this changes",testId:"record-notify",style:Yi}):null]}),Z.length>0?(0,A.jsx)(Wl,{context:e,places:Z}):null,q?(0,A.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-kept-in-step","data-graview-system":q.system,children:["Kept in step with ",q.words,q.href?(0,A.jsxs)(A.Fragment,{children:[" \xB7 ",(0,A.jsxs)("a",{href:q.href,target:"_blank",rel:"noopener noreferrer",style:Y,children:["Open in ",q.system==="notion"?"Notion":"Google Calendar"]})]}):null]}):null]})]}),ne&&or(ne)?(0,A.jsx)(Gl,{context:e,id:d,kind:c.kind}):null,ne&&lr(n,d)?(0,A.jsx)(Kl,{context:e,id:d,kind:c.kind}):null,$e&&ne?(0,A.jsxs)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:[(0,A.jsx)(Oo,{children:(0,A.jsx)(ln,{when:tn(ce),full:U,children:(0,A.jsx)(rn,{kind:c.kind,view:`This ${qe(H,c.kind)}'s view`,said:"",reset:[o],onCaught:()=>b({id:d,tick:o}),children:(0,A.jsx)($e,{node:ne,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...c.violations.length>0?{flagged:[d]}:{}})},d)})}),w?(0,A.jsx)("p",{style:{margin:"8px 0 0",color:"var(--graview-ink-muted)",fontSize:"0.875rem"},"data-testid":"record-original",children:(0,A.jsx)(F,{to:`${ae(n.schema,c.kind,d)}?drawn=built-in`,style:{color:"inherit"},"data-testid":"built-in-page","aria-label":"The original page",children:"Original"})}):null]}):null,c.violations.length>0?(0,A.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:m.map((k,$)=>(0,A.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,A.jsx)(jt,{violation:k,schema:n.schema,...t?{brand:t}:{}}),(0,A.jsx)(Vt,{store:n,repairs:si(c.actions,k.repairs),...a?{principal:a}:{}})]},$))}):null,!w&&(en.length>0||N||nn.length>0)?(0,A.jsx)(Ji,{context:e,id:d,facts:c,fields:en,relations:nn,inPlace:i,style:ve,children:N?(0,A.jsx)(Hn,{as:"unfilled",nodeId:d,skip:[...Ee?.fields??[]],labelStyle:Ut,style:{gap:4}}):null}):null,!w&&(Ce.length>0||c.actions.withheld.length>0)?(0,A.jsxs)("section",{style:{...ve,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,A.jsx)("h2",{style:ge,ref:ee,tabIndex:-1,children:"What can be done"}),(0,A.jsxs)("div",{role:"toolbar","aria-label":"What can be done","aria-orientation":"vertical",...de,style:{display:"grid",justifyItems:"start",gap:2},children:[h.map(k=>{let $=g===k.id;return(0,A.jsx)("button",{type:"button","data-affordance":k.id,"data-rank":k.rank,"data-graview-act":k.mutation,[ua]:"",autoFocus:P&&k===cn[0],"aria-expanded":$,onClick:()=>u($?null:k.id),style:{...Ka,...$?{color:"var(--graview-accent)"}:{}},children:k.label},k.id)}),h.length<Ce.length?(0,A.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>f(!0),style:{...Ka,...L},"data-testid":"record-actions-more",[ua]:"",children:["Show ",Ce.length-h.length," more"]}):null]}),Ce.map(k=>{if(g!==k.id)return null;let $=n.allMutations().find(me=>me.name===k.mutation);return $?(0,A.jsxs)("div",{ref:W,onKeyDown:me=>{if(me.key!=="Escape"||me.defaultPrevented)return;me.preventDefault(),u(null);let ye=k.id;requestAnimationFrame(()=>ie(ye))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,A.jsx)("h3",{style:ge,children:k.label}),$.description?(0,A.jsx)("p",{style:{...L,margin:0},children:$.description}):null,(0,A.jsx)(Ie,{store:n,mutation:$,prefilled:k.args,open:k.open,label:k.label,autoFocus:!0,onDone:()=>{u(null),E(k.mutation);let me=k.id;requestAnimationFrame(()=>ie(me))},...a?{principal:a}:{}})]},k.id):null}),i&&v!==null&&g===null?(0,A.jsx)(fa,{choices:[{on:"act",act:v,record:d},{on:"act",act:v}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...He,...L,justifySelf:"start"}}):null,(0,A.jsx)(Kt,{context:e,withheld:c.actions.withheld.filter(k=>!z.includes(k))})]}):null,i?(0,A.jsx)(Zo,{id:d,style:ve,headingStyle:ge}):null,te.length>0?(0,A.jsxs)("section",{style:{...ve,display:"grid",gap:10},"data-testid":"record-history",children:[(0,A.jsx)("h2",{style:ge,children:"What has happened"}),(0,A.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:te.map(k=>(0,A.jsxs)("li",{style:L,children:[(0,A.jsx)("span",{style:{color:"var(--graview-ink)"},children:k.intent}),k.lineage?(0,A.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",ga(k.lineage)]}):null," \u2014 ",Jn(k,a,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},k.id))})]}):null]})}function Wl({context:e,places:n}){let[t,a]=(0,Ze.useState)(!1),r=(0,Ze.useRef)(null),o=t||n.length<=_t+1?0:n.length-_t;return(0,A.jsxs)("p",{ref:r,style:{...L,margin:0},"data-testid":"seen-in",...t?{"data-open":""}:{},children:["Seen in:"," ",n.map((i,s)=>(0,A.jsxs)("span",{...o>0&&s>=_t?{"data-graview-later":""}:{},children:[s>0?(0,A.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,A.jsx)(F,{to:Pe(e,i),style:Y,children:i.title})]},Pn(i))),o>0?(0,A.jsxs)(A.Fragment,{children:[" ",(0,A.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{...Y,...L,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[_t]?.focus())},children:[o," more"]}),(0,A.jsx)("style",{children:Bl})]}):null]})}var _t=3,Bl="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function Kl({context:e,id:n,kind:t}){let{store:a,principal:r}=e,o={name:`allow-tidying-${t}`,args:{id:n}},i=a.allMutations().some(s=>s.name===o.name)&&a.permits(o,r).ok;return(0,A.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,A.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,A.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),i?(0,A.jsx)("button",{type:"button",style:He,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Gl({context:e,id:n,kind:t}){let{store:a,principal:r}=e,o={name:`unarchive-${t}`,args:{id:n}},i=a.allMutations().some(d=>d.name===o.name)&&a.permits(o,r).ok,s=[...a.log.all()].reverse().find(d=>!Nn(d)&&d.mergedInto!==void 0&&d.writes.includes(n)),l=s?.mergedInto!==void 0?a.graph.getNode(s.mergedInto):void 0;return(0,A.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,A.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,A.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",l?(0,A.jsxs)(A.Fragment,{children:[" ","Merged into ",(0,A.jsx)(F,{to:ae(a.schema,l.kind,l.id),style:Y,children:se(a.schema.tryDefinition(l.kind),l)}),"."]}):null]}),i?(0,A.jsx)("button",{type:"button",style:He,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var R=M(j(),1),ql=mt(()=>(__graviewPreload(import.meta.url,["./chunk.4TDYDIIM.js","./chunk.STHWM422.js","./chunk.Q355UPFG.js","./chunk.IZUAZ6EV.js","./chunk.VNI6HZEF.js","./chunk.THLT6NVO.js","./chunk.KMFH26SS.js","./chunk.YF5GCOSZ.js","./chunk.F2BZ4SC4.js","./chunk.WAPY4RCS.js","./chunk.JJSZLCNU.js","./chunk.JKX4J3KG.js","./chunk.JMXBMLKH.js","./chunk.PVAYYFT2.js","./chunk.MB7LKKUD.js","./chunk.I46VNAMS.js","./chunk.3BE4SHZD.js","./chunk.LG2BQ5LB.js","./chunk.L3ST2YKI.js","./chunk.7VCYVCYM.js","./chunk.CJHCUHVN.js","./chunk.MFNWHXGL.js","./chunk.DCIYOZYP.js","./chunk.WVUJXDXZ.js","./chunk.J7GH2CGV.js","./chunk.SMF5S4DQ.js","./chunk.XP4IVKKR.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.MIE4TJRW.js","./chunk.DEBW4FH6.js","./chunk.RD2FSSLV.js","./chunk.OWHH7JDV.js","./chunk.T3RFZ66S.js","./chunk.TDWJU6GW.js","./chunk.P3Z4ZCL3.js","./chunk.45OLF6BK.js","./chunk.T6ISUVUP.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.HVRUHRXR.js")).then(e=>({default:e.DraftPage}))),jl={kind:"human"};function Vl({list:e,store:n}){let t=new Set(e.members.map(i=>i.kind)),a=e.total-e.members.length,r=t.size===1?[...t][0]:void 0;if(!r)return(0,R.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=un(n.schema,r).toLowerCase();return(0,R.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,R.jsx)(F,{to:`/${J(n.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===n.graph.nodesOfKind(r).length?`See all ${En(e.total)} ${o}`:`${En(a)} more \xB7 all ${o}`})})}function Ul({context:e,children:n}){let t=on(),a=e.store.schema,r=Sn("/").replace(/\/$/,""),o=(0,_.useMemo)(()=>({href:i=>`${r}${ae(a,i.kind,i.id)}`,go:i=>t(ae(a,i.kind,i.id)),more:i=>(0,R.jsx)(Vl,{list:i,store:e.store})}),[r,a,t,e.store]);return(0,R.jsx)(Rt.Provider,{value:o,children:(0,R.jsx)(No.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:n})})}var ns=(0,_.createContext)(void 0);function _l({steering:e}){let n=Le(),t=on(),a=`${n.pathname}${n.search}`;return(0,_.useLayoutEffect)(()=>e.at(a),[a,e]),(0,_.useLayoutEffect)(()=>{let r=i=>{i!==a&&t(i)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,t,e]),null}function zl({context:e,to:n}){let{pathname:t}=Le(),a=be(),r=(n??a)?.sayWhere,o=Jl(e,t);return(0,_.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function Jl(e,n){let[t="",a,r]=n.split("/").filter(Boolean).map(i=>{try{return decodeURIComponent(i)}catch{return i}});if(r!==void 0)return"#";if(t==="places"&&a!==void 0){if(a===Mn)return"#overview=1";let i=e.views?.places().find(s=>s.as===a);return i?`#focus=${encodeURIComponent(Je(i.kind))}&view=${encodeURIComponent(i.as)}`:"#"}let o=Ne(e.store.schema,t);return o?`#focus=${encodeURIComponent(a??Je(o))}`:"#"}function Yl({onNavigate:e,path:n}){let t=Le(),a=va(),r=on(),o=t.hash&&!t.hash.includes("=")?t.hash:"",i=`${t.pathname}${t.search}${o}`,s=(0,_.useRef)(e);s.current=e;let l=(0,_.useRef)(null);(0,_.useEffect)(()=>{let c=l.current;l.current=i,c!==null&&(i===c&&a!=="PUSH"||s.current?.(i,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[t.key]);let d=(0,_.useRef)(n);return(0,_.useEffect)(()=>{n===void 0||n===d.current||(d.current=n,n!==i&&r(n))},[n]),null}function es({context:e,registry:n,page:t}){let a=gn(),r=Ne(e.store.schema,a.slug??""),o=t==="list"?Ia:Ga,s=(r?n?.lookup(r,t):void 0)??o;return(0,R.jsx)(s,{context:e})}function Ql({context:e,registry:n,children:t}){let a=(0,_.useRef)(null);return Hr(a),(0,R.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,R.jsx)(wi,{context:e,registry:n,root:a,children:(0,R.jsx)(Ai,{context:e,root:a,registry:n,children:t})})})}function Xl(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function Zl(){let{pathname:e}=Le(),n=va(),t=(0,_.useRef)(null);(0,_.useLayoutEffect)(()=>{if(n!=="POP"){for(let o=t.current?.parentElement;o;o=o.parentElement){let{overflowY:i}=getComputedStyle(o);if((i==="auto"||i==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,_.useRef)(e),r=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(Xl(o))return;let i=t.current?.closest("main")??document.querySelector("main"),l=t.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??i?.querySelector("h1, h2")??null??i??null;l&&(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus({preventScroll:!0}))},[e]),(0,R.jsx)("span",{ref:t,hidden:!0,"data-graview-scroll-reset":""})}function ts({context:e,children:n}){let t=on(),a=Sn("/").replace(/\/$/,""),r=(0,_.useContext)(ns),o=(0,_.useMemo)(()=>{let i=(c,m)=>{if("record"in c){let g=e.store.graph.getNode(c.record);return g?bn(ae(e.store.schema,g.kind,c.record),{section:m?.section}):void 0}if("place"in c){if(c.place===wr)return bn("/",{section:m?.section});if(c.place===Mn)return Un;let g=e.views?.places().find(u=>u.as===c.place);return g?bn(Pe(e,g),m):void 0}return e.store.schema.tryDefinition(c.list)?bn(`/${J(e.store.schema,c.list)}`,m):void 0},s=c=>{c!==void 0&&t(c)},l=()=>{if(e.overview)return e.overview();e.embedded||window.location.assign(e.sceneHref??"/")},d=()=>e.overview?r===!1?void 0:r?r(Un):`${a}${Un}`:e.embedded?void 0:e.sceneHref??"/";return{record:(c,m)=>s(i({record:c},m)),place:(c,m)=>c===Mn?l():s(i({place:c},m)),list:(c,m)=>s(i({list:c},m)),draft:()=>t("/~draft"),href:(c,m)=>{if("place"in c&&c.place===Mn)return d();let g=r===!1?void 0:i(c,m);if(g!==void 0)return r?r(g):`${a}${g}`}}},[e,t,a,r]);return(0,R.jsx)(Fr.Provider,{value:o,children:n})}function ed(){let{pathname:e,search:n,hash:t}=Le();return(0,_.useEffect)(()=>{let a=decodeURIComponent(t.replace(/^#/,""));if(!(!a||a.includes("=")))return fi(a)},[e,n,t]),null}function nd({context:e,Home:n}){let t=Le(),a=e.views,r=t.key==="default"&&!(a&&Mr(a));(0,_.useEffect)(()=>{a&&$r(a)},[a]);let o=r?vr(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,i=o?.to==="place"?Pe(e,o.place):o?.to==="kind"?`/${J(e.store.schema,o.kind)}`:void 0;return i?(0,R.jsx)(ba,{to:i,replace:!0}):(0,R.jsx)(n,{context:e})}function as({context:e,registry:n}){let t=n?.lookupSurface("shell"),a=t!==void 0,r=a&&(n?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,i=f=>t===void 0?(0,R.jsx)(Nt,{context:e,children:f}):r?(0,R.jsx)(t,{context:e,children:f}):(0,R.jsx)(Nt,{context:e,children:(0,R.jsx)(t,{context:o,children:f})}),s=n?.lookupSurface("home")??Na,l=n?.lookupSurface("problems")??Da,d=a?{...o,framed:!0}:e,[c,m]=(0,_.useState)(null),g=(0,_.useMemo)(()=>({context:d,registry:n}),[d,n]),u=(0,_.useMemo)(()=>({onFind:m,find:!(n?.without().has("find")??!1),places:!(n?.without().has("places")??!1)}),[n]),P=(0,R.jsx)(Ca.Provider,{value:g,children:(0,R.jsx)(ts,{context:e,children:(0,R.jsx)(Ql,{context:e,registry:n,children:i((0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(so,{face:"pages"}),(0,R.jsxs)(Ul,{context:d,children:[(0,R.jsx)(Zl,{}),(0,R.jsx)(ed,{}),(0,R.jsxs)(Yo,{children:[(n?.routes()??[]).map(({path:f,component:v})=>(0,R.jsx)(Fe,{path:f,element:(0,R.jsx)(v,{context:d})},f)),(0,R.jsx)(Fe,{path:"/",element:(0,R.jsx)(nd,{context:d,Home:s})}),(0,R.jsx)(Fe,{path:"/problems",element:(0,R.jsx)(l,{context:d})}),(0,R.jsx)(Fe,{path:"/~draft",element:(0,R.jsx)(_.Suspense,{fallback:null,children:(0,R.jsx)(ql,{context:d})})}),(0,R.jsx)(Fe,{path:"/search",element:(0,R.jsx)(Fa,{context:d})}),(0,R.jsx)(Fe,{path:"/map",element:(0,R.jsx)(Oa,{context:d})}),(0,R.jsx)(Fe,{path:"/places",element:(0,R.jsx)(Ea,{context:d})}),We(d).some(f=>f.as===Mn)?null:(0,R.jsx)(Fe,{path:Un,element:(0,R.jsx)(ba,{to:"/",replace:!0})}),(0,R.jsx)(Fe,{path:"/places/:as",element:(0,R.jsx)(nt,{context:d})}),(0,R.jsx)(Fe,{path:"/:slug",element:(0,R.jsx)(es,{context:d,registry:n,page:"list"})}),(0,R.jsx)(Fe,{path:"/:slug/:id",element:(0,R.jsx)(es,{context:d,registry:n,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?P:(0,R.jsx)(ri.Provider,{value:u,children:(0,R.jsx)(vo.Provider,{value:c,children:P})})}var td=()=>typeof document>"u"?null:document.body;function ad({context:e,registry:n,basename:t,initialPath:a,onNavigate:r,path:o,steering:i,firstLook:s,hrefOf:l,typing:d}){let[c,m]=(0,_.useState)(void 0),g=c!==void 0&&c.from===e.principal?{...e,principal:c.seat}:e;(0,_.useState)(()=>g.views?Fo(g.views,g.store.schema,ya(g.brand,g.store.schema)):void 0);let u=be(),P=d??g.typing;er({reader:g.locale??u?.locale,app:g.brand?.locale??g.app?.brand?.locale,readerTimeZone:g.timeZone??u?.timeZone,appTimeZone:g.brand?.timeZone??g.app?.brand?.timeZone});let f=g.principal??jl,v=Tr(g.store,f,g.history),x=(v.past&&v.live===g.store?v.past.store:g.store).seenBy(f),b=x===g.store?g:{...g,store:x};Er(g.store,g.principal);let G=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Yl,{onNavigate:r,path:o}),i?(0,R.jsx)(_l,{steering:i}):null,b.presence||u?(0,R.jsx)(zl,{context:b,to:u}):null,(0,R.jsx)(as,{context:b,...n?{registry:n}:{}}),s?(0,R.jsx)(Ho,{firstLook:s,root:td,app:ya(g.brand,g.store.schema)}):null]}),ee=b.views?(0,R.jsxs)(Or,{store:b.store,views:b.views,...b.principal?{principal:b.principal}:{},...b.brand?{brand:b.brand}:{},...b.locale?{locale:b.locale}:{},...b.timeZone?{timeZone:b.timeZone}:{},...b.settings?{settings:b.settings}:{},...b.presence&&!u?{presence:b.presence}:{},...P?{typing:P}:{},...b.people?{people:b.people}:{},...b.seats?{seats:b.seats}:{},onSeat:T=>u?u.takeSeat(T):m({from:e.principal,seat:T}),...b.onKeepLens?{onKeepLens:b.onKeepLens}:{},...b.onProposeChange?{onProposeChange:b.onProposeChange}:{},...b.composeChange?{composeChange:b.composeChange}:{},...b.onDraftChange?{onDraftChange:b.onDraftChange}:{},...b.displayOptions?{displayOptions:b.displayOptions}:{},...b.keptViews?{keptViews:b.keptViews}:{},...b.onExport?{onExport:b.onExport}:{},...b.ai?{ai:b.ai}:{},...b.subscriptions?{subscriptions:b.subscriptions}:{},dismissals:b.dismissals,whileAway:b.whileAway,...b.signIn?{signIn:b.signIn}:{},resolveApp:b.resolveApp??u?.resolveApp,linkedRecords:b.linkedRecords??u?.linkedRecords,...b.app?{app:b.app}:{},...b.menuSections?{menuSections:b.menuSections}:{},children:[G,(0,R.jsx)(ts,{context:b,children:(0,R.jsx)(mi,{context:b})})]}):G,W=(0,R.jsx)(Lr.Provider,{value:v,children:ee}),de=b.assetsAt?(0,R.jsx)(Cr.Provider,{value:b.assetsAt,children:W}):W,ie=b.files?(0,R.jsx)(Ar.Provider,{value:b.files,children:de}):de,ne=b.viewerState?(0,R.jsx)(Rr.Provider,{value:b.viewerState,children:ie}):ie,H=l===void 0?ne:(0,R.jsx)(ns.Provider,{value:l,children:ne});if(a!==void 0){let T=t===void 0?a:`${t.replace(/\/$/,"")}${a}`;return(0,R.jsx)(Jo,{initialEntries:[T],...t===void 0?{}:{basename:t},children:H})}return(0,R.jsx)(Qo,{...t===void 0?{}:{basename:t},children:H})}export{Cs as a,ad as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{q as K}from"./chunk.
|
|
1
|
+
import{q as K}from"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as R,_ as x,ia as N,ja as $}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import{Xd as v,Yd as b,Zd as f,de as h,fe as k,qa as g}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as w}from"./chunk.AJZBJBMO.js";var u=w(R(),1);var o=w(x(),1),E=()=>()=>{};function C(e){let n=(0,u.useMemo)(()=>e?.onChange?i=>e.onChange(i):E,[e]),t=()=>e?.current()??b;return(0,u.useSyncExternalStore)(n,t,t)}var D=(e,n)=>e.lens?n.may.lenses:n.may.views;async function p(e,n,t){try{return await n(),!0}catch(i){let r=i?.code,d=typeof r=="string"?r:void 0;return e?.notify({kind:"toast",tone:"bad",sentence:i instanceof Error&&i.message?i.message:t,...d?{code:d}:{}}),!1}}function H(e,n,t,i,r){let d=e.name;return p(r,()=>n==="view"&&d!==void 0?i?t.hide(d):t.show(d):t.lens?.({op:"set-lens-hidden",title:e.title,on:e.kind,hidden:i}),i?`\u201C${e.title}\u201D could not be hidden.`:`\u201C${e.title}\u201D could not be shown.`)}function L(e,n,t,i,r){return p(r,()=>t.lens?.({op:"set-lens-hidden",title:e,hidden:i}),i?`\u201C${n}\u201D could not be hidden.`:`\u201C${n}\u201D could not be shown.`)}function V(e,n,t){return p(t,()=>n.restore(e.name),`\u201C${e.title}\u201D could not be restored.`)}async function A(e,n,t,i){let r=n==="view"&&e.name!==void 0?e.name:v(e.title),d=await p(i,()=>n==="view"&&e.name!==void 0?t.remove(e.name,{title:e.title,kind:e.kind}):t.lens?.({op:"remove-lens",title:e.title,on:e.kind}),`\u201C${e.title}\u201D could not be deleted.`);return d&&i?.notify({kind:"toast",id:`deleted-view-${r}`,sentence:`Deleted \u201C${e.title}\u201D. It is under Recently deleted in the places for ${30} days.`,action:{label:"Restore",onSelect:()=>void V({name:r,title:e.title},t,i)}}),d}function G(){let e=$(),n=e?.keptViews,t=C(n),i=e?.views;return(0,u.useMemo)(()=>{if(!n||!i)return null;let r=s=>f(s,t,n),d=new Set,c=i.places().filter(s=>{if(!s.hidden||r(s)===null)return!1;let m=`${s.name??""}|${s.title}`;return d.has(m)?!1:(d.add(m),!0)}),l=e?.store.schema,y=t.may.lenses&&n.lens&&l?(i.arrangement?.()?.hide??[]).filter(s=>l.tryDefinition(s)!==void 0).map(s=>({kind:s,title:g(l,s),path:h(l,s)})):[];return{keeper:n,hidden:c,lists:y,removed:t.removed.filter(s=>D(s,t)),how:r}},[n,t,i,e?.store.schema])}function T(e,n){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(n??"en-US",{month:"short",day:"numeric"})}var I=`.graview-bar-list li.graview-bar-tidied{display:flex;align-items:flex-start;gap:8px;padding:0 0 0 2px}
|
|
2
2
|
.graview-bar-tidied>.graview-bar-item,.graview-bar-gone{flex:1 1 auto;min-width:0}
|
|
3
3
|
.graview-bar-gone{display:grid;gap:1px;padding:7px 8px;font-size:.875rem;line-height:1.3;overflow-wrap:anywhere;color:var(--graview-ink-muted)}
|
|
4
4
|
.graview-bar-gone small{font-size:.75rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{t as P}from"./chunk.DEBW4FH6.js";import{G as w,Qa as S,T as C,W as x,_ as m,ia as h,ja as I,s as g,w as A,x as M}from"./chunk.ASNVH2G4.js";import{a as y}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var d=p(w(),1),b=p(m(),1),v=S(y(()=>(__graviewPreload(import.meta.url,["./chunk.A4TBVXHQ.js","./chunk.7QGDWAHH.js","./chunk.YC2IDHQX.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CUEPNS3Z.js")))),B=v.part((e,n)=>(0,b.jsx)(e.Timeline,{...n}),{what:"The timeline"}),H=()=>v.prefetch();function K({face:e}){let n=C(),t=(0,d.useContext)(x),c=(0,d.useRef)(n);c.current=n;let o=n!==null;return(0,d.useEffect)(()=>{if(!(!t||!o))return t.listen(({focus:s})=>{let r=c.current;r?.show(r.live.log.length,{focus:s})})},[t,o]),n?.open?(0,b.jsx)(d.Suspense,{fallback:null,children:(0,b.jsx)(B,{face:e})}):null}var i=p(w(),1),u=p(m(),1),D=new WeakMap,E=e=>{let n=D.get(e);return n||D.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function N(e,n){let t=E(e);t.ask=n,k(t)}var T=S(y(()=>(__graviewPreload(import.meta.url,["./chunk.NKRDVOLJ.js","./chunk.YC2IDHQX.js","./chunk.R5YGW5ZX.js","./chunk.QMGBAKX6.js","./chunk.PS765ODQ.js","./chunk.GH6QX7JR.js","./chunk.J4D4BIB4.js","./chunk.ASNVH2G4.js","./chunk.SDO3U72B.js","./chunk.ZDUKVXBI.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.J3CUBMUZ.js")))),W=T.part((e,n)=>{let t=e.NotifySheet;return(0,u.jsx)(t,{...n})},{what:"Notify me"}),F=T.part((e,n)=>{let t=e.NotifiedList;return(0,u.jsx)(t,{...n})},{quiet:!0}),O=(e,n)=>n===void 0&&(e.onBehalfOf??e).id!==void 0;function L(e,n,t){let c=f=>t.tryDefinition(f)?.noun??f.replace(/[-_]+/g," "),o=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let f=o!==void 0&&n(o)!==void 0?o:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...f!==void 0?{record:f}:{}},...f!==void 0?[{on:"act",act:e.act}]:[]]}}if(o===void 0)return null;let s=n(o);if(s!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:o},{on:"act",record:o},{on:"reaches",kind:s,condition:"",record:o}]};let r=g(o)!==null?[g(o)]:A(o)?M(o):[];if(r.length!==1||!t.kinds.includes(r[0]))return null;let l=r[0],a=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(a)?"an":"a"} ${a} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function R(){let{store:e,principal:n,subscriptions:t,signIn:c}=h(),o=O(n,c);return(0,i.useMemo)(()=>o?s=>{let r=L(s,a=>e.graph.getNode(a)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>N(t,{choices:r.choices,returnTo:s.element??null})}],prepare:()=>T.prefetch()}:null}:null,[o,e,t])}var z=[];function V({children:e}){let n=R(),t=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:t,children:e})}function X(){let{subscriptions:e}=h(),n=(0,i.useId)(),t=E(e);(0,i.useEffect)(()=>(t.doors.push(n),k(t),()=>{t.doors.splice(t.doors.indexOf(n),1),k(t)}),[t,n]);let c=(0,i.useMemo)(()=>r=>(t.listeners.add(r),()=>void t.listeners.delete(r)),[t]),o=(0,i.useSyncExternalStore)(c,()=>t.ask,()=>null),s=(0,i.useSyncExternalStore)(c,()=>t.doors[0]===n,()=>!1);return!o||!s?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{ask:o,close:()=>N(e,null)})})}function Y({choices:e,label:n="Notify me",style:t,className:c,testId:o="notify-me"}){let{principal:s,subscriptions:r,signIn:l}=h();return O(s,l)?(0,u.jsx)("button",{type:"button","data-testid":o,className:c,onClick:a=>N(r,{choices:e,returnTo:a.currentTarget}),style:t,children:n}):null}function G(){let e=I(),n=e?.subscriptions,t=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,o]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(t===void 0||!n)return;let s=!0,r=()=>void Promise.resolve(n.list(t)).then(a=>s&&o(a.length),()=>s&&o(0));r();let l=n.onChange?.(r);return()=>{s=!1,l?.()}},[n,t]),c}function Z({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(F,{...e?{style:e}:{}})})}export{H as a,K as b,R as c,V as d,X as e,Y as f,G as g,Z as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{G as W,_ as x}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function H({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{H as WhenMonth};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{P as b,Z as g,ha as h,ia as $,mc as x,qc as k}from"./chunk.
|
|
1
|
+
import{P as b,Z as g,ha as h,ia as $,mc as x,qc as k}from"./chunk.ZDUKVXBI.js";function z(t,n,e){let r=t?.display?.format?.[n];return r?r(e):typeof e=="string"?$(e):String(e)}function B(t,n,e,r){let s=t.tryDefinition(n)?.edges,i=s&&Object.hasOwn(s,e)?s[e]:void 0;return(r==="out"?i?.description:i?.inverse)??h(e).toLowerCase()}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,m=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,O=/^ {0,3}(?:`{3,}|~{3,})/,S=/^ {0,3}(?:>[ \t]?)+/,F=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,T={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function _(t){return t.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(n,e)=>T[e]??"")}function N(t,n,e){let r=t.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),s=[],i=[],u=0,d=!1,a=()=>{let o=i.join(" ").replace(/\s+/g," ").trim();o&&(s.push(o),u+=o.length),i=[]},c=0;for(;c<r.length&&u<=e;){let o=r[c++];if(n&&O.test(o)){d=!d,d||a();continue}if(!d&&(o.trim().length===0||n&&(R.test(o)||F.test(o.trim())))){a();continue}let f=!d&&n&&w.test(o),l=!d&&m.test(o);if((f||l)&&a(),n&&!d?(o=o.replace(S,""),f&&(o=o.replace(w,"").replace(/[ \t]+#+[ \t]*$/,"")),l&&(o=o.replace(m,"")),o.includes("|")&&(o=o.replace(/^[ \t]*\||\|[ \t]*$/g,"").split("|").map(p=>p.trim()).filter(Boolean).join(" \xB7 ")),o=_(Number.isFinite(e)?o.slice(0,e*2+200):o)):l&&(o=o.replace(m,"")),i.push(o),f&&a(),i.reduce((p,A)=>p+A.length,0)>e)break}return a(),{blocks:s,more:r.slice(c).some(o=>o.trim().length>0&&!(n&&(O.test(o)||R.test(o))))}}function E(t,n){return`${(t.slice(0,n+1).replace(/\s+\S*$/,"")||t.slice(0,n)).replace(/[\s,;:.—-]+$/,"")}\u2026`}function Q(t,n={}){let e=n.most??160,{blocks:r,more:s}=N(t,n.markdown===!0,e),i=r[0]??"";if(i.length<=e)return(s||r.length>1)&&i.length>0&&!/[.!?…:]$/.test(i)?`${i}\u2026`:i;let u=k(i);return u&&u.length<=e?u:E(i,e)}var X=t=>N(t,!0,Number.POSITIVE_INFINITY).blocks.join(" ");var j={d:1440,h:60,m:1};function K(t){if(typeof t=="number")return Number.isFinite(t)&&t>=0?Math.round(t):void 0;if(typeof t!="string")return;let n=t.trim().toLowerCase();if(/^\d+$/.test(n))return Number(n);let e=/^(\d+):([0-5]\d)(?::([0-5]\d))?$/.exec(n);if(e)return Number(e[1])*60+Number(e[2])+Math.round(Number(e[3]??0)/60);let r=0,s=!1,i=n.replace(/(\d*[.,]?\d+) *(days?|d|hours?|hrs?|hr|h|minutes?|mins?|min|m)(?![a-z])/g,(u,d,a)=>(s=!0,r+=Number(d.replace(",","."))*j[a[0]]," "));return s&&/^[\s,+]*(?:and[\s,+]*)*$/.test(i)?Math.round(r):void 0}function I(t,n){if(!Number.isFinite(t))return String(t);let e=Math.round(Math.abs(t)),r=Math.floor(e/60),s=e%60,i=[r?`${g(r,n)} h`:"",s||!r?`${g(s,n)} min`:""].filter(Boolean).join(" ");return t<0?`\u2212${i}`:i}var M=/^(\+?1[ .-]?)?\(?([2-9]\d\d)\)?[ .-]?(\d{3})[ .-]?(\d{4})(?: *(?:ext\.?|x|#) *(\d+))?$/i;function W(t,n){let e=t.trim(),r=/[-_](US|CA)\b/i.test(b(n))?M.exec(e):null;if(!r)return e;let[,s,i,u,d,a]=r;return`${s?.startsWith("+")?"+1 ":""}(${i}) ${u}-${d}${a?` ext. ${a}`:""}`}function D(t){let[,n="",e]=/^(.*?)(?: *(?:ext\.?|x|#) *(\d+))?$/i.exec(t.trim())??[],r=n.replace(/\D/g,"");return r.length<3?void 0:`tel:${n.startsWith("+")?"+":""}${r}${e?`;ext=${e}`:""}`}var P=()=>/Mac|iPhone|iPad|iPod/.test(globalThis.navigator?.userAgent??"");function L(t,n=P()){let e=encodeURIComponent(t.trim());return n?`https://maps.apple.com/?q=${e}`:`https://www.google.com/maps/search/?api=1&query=${e}`}var q=t=>t?.fields?.shape??{},C=(t,n)=>{let e=q(t);return Object.hasOwn(e,n)?x(e[n]):void 0},y=(t,n)=>{let e=t?.computed,r=e&&Object.hasOwn(e,n)?e[n]:void 0;return typeof r=="object"?r:void 0},H=(t,n)=>{let e=y(t,n);return e?.as??(e?.format==="duration"?"duration":void 0)};function v(t,n){let e=y(t,n);if(!e)return;if(e.amount)return e.amount;let r=e.format==="money"||e.format==="percent"?e.format:void 0;return r||!e.format&&e.unit?{...r?{format:r}:{},...e.unit?{unit:e.unit}:{}}:void 0}function ee(t,n){return y(t,n)?.hidden===!0}function ne(t,n){return C(t,n)??(t&&H(t,n)==="duration"?"duration":void 0)}function te(t,n,e){return t==="duration"?typeof n=="number"?I(n,e):void 0:t==="phone"?typeof n=="string"?W(n,e):void 0:t==="place"&&typeof n=="string"?n.trim():void 0}function re(t,n){if(!(typeof n!="string"||!n.trim()))return t==="phone"?D(n):t==="place"?L(n):void 0}export{z as a,B as b,Q as c,X as d,K as e,v as f,ee as g,ne as h,te as i,re as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.GH6QX7JR.js";import"./chunk.J4D4BIB4.js";import{_ as o,ia as n}from"./chunk.ASNVH2G4.js";import"./chunk.SDO3U72B.js";import"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import{b as t}from"./chunk.AJZBJBMO.js";var a=t(o(),1),d=[["waiting","Waiting"],["active","Under way: darker and taller"],["done","Done: flat and pale"],["flagged","A problem, or past its due date"],["recent","Changed since you were last here"],["own","Yours"]],g=i=>{let e=r=>`color-mix(in oklab,var(--graview-ink) ${r}%,var(--graview-panel))`;return`.graview-map-key{display:grid;gap:4px;padding:2px 4px 8px;margin-bottom:6px;border-bottom:1px solid var(--graview-edge);font-size:.8125rem;color:var(--graview-ink-muted)}
|
|
2
2
|
.graview-map-key>div{display:flex;align-items:center;gap:8px}
|
|
3
3
|
.graview-map-key>div:first-child{color:var(--graview-ink)}
|
|
4
4
|
.graview-map-key i{flex:none;width:14px;height:10px;border-radius:2px;background:${e(i?34:42)}}
|