graview 0.1.69 → 0.1.71
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.23DATB5Y.js +1 -0
- package/dist/preview/chunk.2INDKSJI.js +1 -0
- package/dist/preview/chunk.3CLTABGP.js +1 -0
- package/dist/preview/chunk.3RRK6UTN.js +8 -0
- package/dist/preview/chunk.45HUV56Z.js +1 -0
- package/dist/preview/chunk.4HU2ILFY.js +1 -0
- package/dist/preview/{chunk.3VNOTHA5.js → chunk.4LWWXIM4.js} +1 -1
- package/dist/preview/chunk.4O64QV2Y.js +1 -0
- package/dist/preview/{chunk.PJL3I2IW.js → chunk.4QMAYVPU.js} +1 -1
- package/dist/preview/chunk.4UDST6IF.js +1 -0
- package/dist/preview/{chunk.6BNSDPZE.js → chunk.4YZ2A6SJ.js} +3 -3
- package/dist/preview/{chunk.523EFGHU.js → chunk.4ZEHLUXV.js} +1 -1
- package/dist/preview/{chunk.F4CDJBDS.js → chunk.5EQRIZ6I.js} +1 -1
- package/dist/preview/chunk.5OS4SYHE.js +1 -0
- package/dist/preview/{chunk.BO32A3W5.js → chunk.5PQV7GFE.js} +1 -1
- package/dist/preview/{chunk.PZ3KM3TY.js → chunk.5WCSQFS5.js} +1 -1
- package/dist/preview/{chunk.HU3KEWFO.js → chunk.64K5ELSQ.js} +1 -1
- package/dist/preview/{chunk.MKN7ADJB.js → chunk.67S2UWBT.js} +1 -1
- package/dist/preview/chunk.6A3KTD66.js +1 -0
- package/dist/preview/chunk.6BBUTKFC.js +23 -0
- package/dist/preview/chunk.6IMRCKB4.js +1 -0
- package/dist/preview/chunk.6L6RUOSF.js +5 -0
- package/dist/preview/{chunk.MH3AQO2R.js → chunk.6TBQV3NO.js} +1 -1
- package/dist/preview/chunk.6ZRVVRDQ.js +1 -0
- package/dist/preview/{chunk.YZKHTBTC.js → chunk.7FI75ZVE.js} +1 -1
- package/dist/preview/{chunk.IO5VFTXC.js → chunk.7KX36ENH.js} +1 -1
- package/dist/preview/chunk.7LPHWJB4.js +3 -0
- package/dist/preview/chunk.7MDGPTYF.js +1 -0
- package/dist/preview/{chunk.I4H2GS4O.js → chunk.7PWLRRUS.js} +2 -2
- package/dist/preview/{chunk.7T2P42VW.js → chunk.7TACFS7Q.js} +1 -1
- package/dist/preview/{chunk.KLEKC4ZX.js → chunk.7THS3DLZ.js} +1 -1
- package/dist/preview/{chunk.CSVDBDRZ.js → chunk.7XGU6KVF.js} +2 -2
- package/dist/preview/chunk.7ZLCA3WK.js +1 -0
- package/dist/preview/{chunk.RRCPEHM4.js → chunk.AIFT2HNP.js} +1 -1
- package/dist/preview/{chunk.LMZ2WMGH.js → chunk.ARGEGV5T.js} +1 -1
- package/dist/preview/{chunk.4FJ4OPSJ.js → chunk.BSWR5SGX.js} +1 -1
- package/dist/preview/{chunk.RNAL35ID.js → chunk.BWMPC7LK.js} +1 -1
- package/dist/preview/{chunk.KW7PHJYX.js → chunk.CEJIH3CN.js} +1 -1
- package/dist/preview/chunk.CEOQY5KS.js +5 -0
- package/dist/preview/{chunk.G43YUGNW.js → chunk.CGRX6SDE.js} +1 -1
- package/dist/preview/chunk.CPK6CYKN.js +111 -0
- package/dist/preview/{chunk.AZRICZKT.js → chunk.CVN2XFMF.js} +1 -1
- package/dist/preview/chunk.D4F6QX5L.js +1 -0
- package/dist/preview/{chunk.JPAE6K4E.js → chunk.D6ODKMOV.js} +1 -1
- package/dist/preview/{chunk.CCCONK73.js → chunk.DDSAFU3B.js} +1 -1
- package/dist/preview/{chunk.AHYMIVBX.js → chunk.DG3YNOH3.js} +1 -1
- package/dist/preview/chunk.DGYWNM5U.js +1 -0
- package/dist/preview/{chunk.ML5EHDZG.js → chunk.DHO3QZYK.js} +1 -1
- package/dist/preview/{chunk.EL7XXGQY.js → chunk.DJGZOPAS.js} +1 -1
- package/dist/preview/chunk.DOJCYXIJ.js +1 -0
- package/dist/preview/{chunk.CKSRW3LA.js → chunk.DX7RGK5G.js} +1 -1
- package/dist/preview/{chunk.QK7EUIPL.js → chunk.EA2KYBBR.js} +1 -1
- package/dist/preview/chunk.EEGVI266.js +1 -0
- package/dist/preview/{chunk.I7OFRF6N.js → chunk.EHLV3LND.js} +2 -2
- package/dist/preview/{chunk.QEBD7SC4.js → chunk.EJC7ACZT.js} +4 -2
- package/dist/preview/{chunk.QRNKGPAD.js → chunk.EJIQDMLU.js} +1 -1
- package/dist/preview/chunk.EOSN5DWW.js +1 -0
- package/dist/preview/{chunk.4RPKCW4J.js → chunk.EPSYX2SF.js} +1 -1
- package/dist/preview/chunk.EUXAIG73.js +1 -0
- package/dist/preview/chunk.EZQK23AB.js +1 -0
- package/dist/preview/{chunk.KKFKSJUN.js → chunk.F5O3HR7X.js} +1 -1
- package/dist/preview/chunk.F6MY6WJ4.js +1 -0
- package/dist/preview/{chunk.GTF6EMVE.js → chunk.F7KVEWFH.js} +1 -1
- package/dist/preview/{chunk.EEUCRZA3.js → chunk.FIUPDGUZ.js} +1 -1
- package/dist/preview/chunk.FNSVGSZI.js +1 -0
- package/dist/preview/chunk.FOHZPYUV.js +1 -0
- package/dist/preview/chunk.FW6M6GIU.js +32 -0
- package/dist/preview/{chunk.VXPEXUQF.js → chunk.G5AF5IXL.js} +1 -1
- package/dist/preview/chunk.G767NLBH.js +1 -0
- package/dist/preview/chunk.GFBE4VNT.js +1 -0
- package/dist/preview/{chunk.CDSHUWSK.js → chunk.GFOZVQBQ.js} +1 -1
- package/dist/preview/chunk.GKYJQE5A.js +1 -0
- package/dist/preview/chunk.GOVRX2YX.js +4 -0
- package/dist/preview/{chunk.T3PELB6I.js → chunk.H33XWGAY.js} +1 -1
- package/dist/preview/{chunk.2AL26ZPJ.js → chunk.H4BPTMED.js} +1 -1
- package/dist/preview/chunk.HLKDYI6J.js +1 -0
- package/dist/preview/{chunk.VEQIH7HR.js → chunk.HPFEYMGP.js} +1 -1
- package/dist/preview/chunk.HT35PAHI.js +21 -0
- package/dist/preview/{chunk.VR553M6J.js → chunk.HXRHEPPJ.js} +1 -1
- package/dist/preview/chunk.IPKODEOZ.js +1 -0
- package/dist/preview/{chunk.EP7YT7LT.js → chunk.IXYG65TM.js} +1 -1
- package/dist/preview/chunk.IZDB777E.js +1 -0
- package/dist/preview/{chunk.VBBH5R5T.js → chunk.JAPTTM6Y.js} +1 -1
- package/dist/preview/chunk.JCKIJSW7.js +25 -0
- package/dist/preview/{chunk.4R7H3GIL.js → chunk.JLNTE5CH.js} +2 -2
- package/dist/preview/chunk.JNK5WBSU.js +1 -0
- package/dist/preview/chunk.JREA2XDG.js +1 -0
- package/dist/preview/{chunk.WV6SP6IJ.js → chunk.KBJ3UUER.js} +1 -1
- package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
- package/dist/preview/{chunk.ISZFRLNJ.js → chunk.KJPLX72N.js} +1 -1
- package/dist/preview/chunk.KZUHXOZU.js +21 -0
- package/dist/preview/{chunk.6ZFYFT5A.js → chunk.L3MLGFIS.js} +1 -1
- package/dist/preview/{chunk.KEGL6NBD.js → chunk.L6P55HFW.js} +1 -1
- package/dist/preview/{chunk.N7A3T5QU.js → chunk.LDWWUKKX.js} +1 -1
- package/dist/preview/{chunk.CA2SYEYE.js → chunk.LHCGC3K6.js} +1 -1
- package/dist/preview/{chunk.BQORHDAH.js → chunk.LNKY6MT4.js} +1 -1
- package/dist/preview/chunk.LQ5J6YQW.js +1 -0
- package/dist/preview/{chunk.47VEV4BX.js → chunk.MEAUTBVM.js} +1 -1
- package/dist/preview/chunk.MEBKTW7H.js +17 -0
- package/dist/preview/{chunk.WQ7K5O2I.js → chunk.MFMC35ET.js} +1 -1
- package/dist/preview/chunk.MJ4T6YXI.js +1 -0
- package/dist/preview/chunk.MKJV3BM5.js +240 -0
- package/dist/preview/chunk.ML4X7VVK.js +1 -0
- package/dist/preview/chunk.MM7MLBGB.js +1 -0
- package/dist/preview/{chunk.5MOXQUZH.js → chunk.MQNW3O67.js} +1 -1
- package/dist/preview/{chunk.J2N7EKMX.js → chunk.MT252WP4.js} +1 -1
- package/dist/preview/chunk.MWWNKM3I.js +1 -0
- package/dist/preview/chunk.N3MXLORL.js +3 -0
- package/dist/preview/chunk.NH3VXTGX.js +1 -0
- package/dist/preview/{chunk.B422DSYN.js → chunk.NI4OPHTL.js} +1 -1
- package/dist/preview/chunk.NNGG7RCO.js +1 -0
- package/dist/preview/{chunk.LKM2R5UF.js → chunk.NXHEOHRR.js} +1 -1
- package/dist/preview/{chunk.TQQDUJLX.js → chunk.O5RPSUXV.js} +1 -1
- package/dist/preview/{chunk.FE3SINPK.js → chunk.OKHXXIMN.js} +1 -1
- package/dist/preview/chunk.ONAH6MC4.js +1 -0
- package/dist/preview/chunk.OOQG2AEF.js +1 -0
- package/dist/preview/{chunk.ZQYHNFRZ.js → chunk.OPMGQS5J.js} +1 -1
- package/dist/preview/{chunk.UHJSZ2XZ.js → chunk.OUF2QFZL.js} +1 -1
- package/dist/preview/{chunk.CUEIGKFG.js → chunk.OVSKPBPS.js} +1 -1
- package/dist/preview/chunk.OYMN3IFX.js +1 -0
- package/dist/preview/{chunk.QNC2OKLF.js → chunk.P43LPXXJ.js} +1 -1
- package/dist/preview/chunk.PGT4ZQDG.js +4 -0
- package/dist/preview/{chunk.WFJCC6G3.js → chunk.PQTXM4VY.js} +1 -1
- package/dist/preview/{chunk.KHKCTVHD.js → chunk.Q6GEPVQ7.js} +1 -1
- package/dist/preview/chunk.QDDDKEBH.js +1 -0
- package/dist/preview/{chunk.26RYER7Y.js → chunk.QJJWAYHB.js} +1 -1
- package/dist/preview/chunk.QK4QZVQG.js +1 -0
- package/dist/preview/{chunk.CLIC2QBA.js → chunk.QKRQPUCE.js} +1 -1
- package/dist/preview/{chunk.DU76ASS4.js → chunk.QNWGDG2Z.js} +2 -2
- package/dist/preview/{chunk.447RWLS7.js → chunk.QVBP4UZG.js} +2 -2
- package/dist/preview/chunk.RDUGUC7R.js +1 -0
- package/dist/preview/{chunk.EK3JXEZL.js → chunk.RHIP2UYE.js} +1 -1
- package/dist/preview/chunk.RJ7VSWTA.js +87 -0
- package/dist/preview/{chunk.JHAMSDAI.js → chunk.RO3D2RNP.js} +1 -1
- package/dist/preview/{chunk.C6CT6F4C.js → chunk.S2BMI23H.js} +1 -1
- package/dist/preview/{chunk.ZRBGYXAO.js → chunk.SGYZM6ZU.js} +1 -1
- package/dist/preview/{chunk.UPOYRCKI.js → chunk.SPJ34VHA.js} +1 -1
- package/dist/preview/{chunk.UAEOCWSG.js → chunk.T6KOL7TW.js} +1 -1
- package/dist/preview/{chunk.AUNQNTKY.js → chunk.T6UJEXFL.js} +3 -2
- package/dist/preview/chunk.TBEKEHFS.js +1 -0
- package/dist/preview/chunk.TO3ZKCA2.js +1 -0
- package/dist/preview/{chunk.FIY4RUK5.js → chunk.TQ3MNB6K.js} +1 -1
- package/dist/preview/{chunk.GG47EIKO.js → chunk.TRP66PHK.js} +1 -1
- package/dist/preview/{chunk.LGNGFG5V.js → chunk.TSZ2S3VG.js} +1 -1
- package/dist/preview/chunk.TTM5GQ2U.js +1 -0
- package/dist/preview/chunk.TUBY6SV3.js +1 -0
- package/dist/preview/{chunk.ZE5RSKXF.js → chunk.U5KJQFAP.js} +1 -1
- package/dist/preview/chunk.U6V4KZF5.js +1 -0
- package/dist/preview/chunk.UJ7RTNT4.js +1 -0
- package/dist/preview/{chunk.HCX6KPRF.js → chunk.UQZ2P6KD.js} +1 -1
- package/dist/preview/{chunk.CLZYNFFH.js → chunk.UZKBFI52.js} +1 -1
- package/dist/preview/{chunk.66TRDXYR.js → chunk.V5JB5UJS.js} +2 -2
- package/dist/preview/{chunk.3TKIZGC7.js → chunk.VDFQFLTU.js} +1 -1
- package/dist/preview/{chunk.IY3DV52G.js → chunk.VGYG2IBZ.js} +1 -1
- package/dist/preview/chunk.VICBF3MQ.js +2 -0
- package/dist/preview/{chunk.EQZPEOIW.js → chunk.VL3YDD7D.js} +1 -1
- package/dist/preview/{chunk.IYHY4VEC.js → chunk.VPFUOTY7.js} +1 -1
- package/dist/preview/chunk.VUDNQOOX.js +1 -0
- package/dist/preview/{chunk.P26ATAAI.js → chunk.VVIQSFM4.js} +1 -1
- package/dist/preview/{chunk.DO3FQM6R.js → chunk.W332P5T3.js} +6 -6
- package/dist/preview/{chunk.POKGLN4T.js → chunk.W3TJF4EH.js} +1 -1
- package/dist/preview/{chunk.D5JZQZ74.js → chunk.W5O5F4FT.js} +1 -1
- package/dist/preview/chunk.W6L2VAJG.js +2 -0
- package/dist/preview/{chunk.O7NYSO6F.js → chunk.WGH2P2YL.js} +1 -1
- package/dist/preview/{chunk.OD5QZHRC.js → chunk.WS5ORRGS.js} +1 -1
- package/dist/preview/{chunk.VQDL4EEP.js → chunk.WU6D3SPL.js} +1 -1
- package/dist/preview/{chunk.MV27WMNW.js → chunk.X2UYEA7H.js} +1 -1
- package/dist/preview/chunk.X45EITTK.js +18 -0
- package/dist/preview/{chunk.TAJBXG5U.js → chunk.X7U3JMBR.js} +1 -1
- package/dist/preview/chunk.XSM4OTF4.js +1 -0
- package/dist/preview/{chunk.DRAPVGQZ.js → chunk.XTHSPLZZ.js} +1 -1
- package/dist/preview/{chunk.VQOYFBEV.js → chunk.Y5WQD6KV.js} +1 -1
- package/dist/preview/chunk.YXVUJ3NB.js +1 -0
- package/dist/preview/{chunk.NRECR3NQ.js → chunk.Z22C2JJ4.js} +1 -1
- package/dist/preview/{chunk.TQRC5VAM.js → chunk.Z2BCOZDZ.js} +1 -1
- package/dist/preview/{chunk.S2NQRD6W.js → chunk.Z3TK2LJM.js} +1 -1
- package/dist/preview/chunk.ZGLOXN7O.js +1 -0
- package/dist/preview/{chunk.R7POSVUK.js → chunk.ZLQIGZXO.js} +2 -2
- package/dist/preview/{chunk.YJ4PFOPC.js → chunk.ZONRIOIA.js} +1 -1
- package/dist/preview/{chunk.QVCKTDG3.js → chunk.ZY3NAJDM.js} +1 -1
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +7 -7
- package/dist/preview/chunk.2WFOKJB4.js +0 -1
- package/dist/preview/chunk.32SHA3EY.js +0 -1
- package/dist/preview/chunk.3D37E2G5.js +0 -1
- package/dist/preview/chunk.3PT3BU6K.js +0 -1
- package/dist/preview/chunk.3XTIYX6M.js +0 -1
- package/dist/preview/chunk.4O7WYLCK.js +0 -1
- package/dist/preview/chunk.5DU6FA5R.js +0 -1
- package/dist/preview/chunk.5TWRTGP6.js +0 -1
- package/dist/preview/chunk.6BR2SUAE.js +0 -1
- package/dist/preview/chunk.6TDVNWFU.js +0 -17
- package/dist/preview/chunk.6XBQDXT6.js +0 -3
- package/dist/preview/chunk.7L3I776Z.js +0 -1
- package/dist/preview/chunk.7OLKVOS6.js +0 -1
- package/dist/preview/chunk.AG7WJYM5.js +0 -3
- package/dist/preview/chunk.AMAOZVEO.js +0 -1
- package/dist/preview/chunk.AMV2ILR6.js +0 -1
- package/dist/preview/chunk.B5EFNTDA.js +0 -1
- package/dist/preview/chunk.BBLIT7S7.js +0 -1
- package/dist/preview/chunk.BSQI3KM2.js +0 -1
- package/dist/preview/chunk.CYEPHT7V.js +0 -1
- package/dist/preview/chunk.D3SWJ7OS.js +0 -1
- package/dist/preview/chunk.DHPXRDT5.js +0 -5
- package/dist/preview/chunk.DKUEZPGR.js +0 -1
- package/dist/preview/chunk.FWXW4T4I.js +0 -25
- package/dist/preview/chunk.GF5CZPZ7.js +0 -1
- package/dist/preview/chunk.GPBHUIZQ.js +0 -2
- package/dist/preview/chunk.GVFGS2HY.js +0 -1
- package/dist/preview/chunk.HGH27XZG.js +0 -23
- package/dist/preview/chunk.HMJXB6KC.js +0 -5
- package/dist/preview/chunk.HTEQCRVP.js +0 -1
- package/dist/preview/chunk.I7KN732Z.js +0 -2
- package/dist/preview/chunk.IAVIYJTL.js +0 -1
- package/dist/preview/chunk.IPKESOIU.js +0 -21
- package/dist/preview/chunk.IRNEWNUB.js +0 -1
- package/dist/preview/chunk.J7O23NKZ.js +0 -22
- package/dist/preview/chunk.JDUA5PH2.js +0 -1
- package/dist/preview/chunk.JN3WZGJY.js +0 -1
- package/dist/preview/chunk.JQEXH23N.js +0 -1
- package/dist/preview/chunk.KVQYOFDV.js +0 -1
- package/dist/preview/chunk.LAVLPYSC.js +0 -1
- package/dist/preview/chunk.MATUPDZ3.js +0 -1
- package/dist/preview/chunk.MD3N26BC.js +0 -23
- package/dist/preview/chunk.MHHNO3O2.js +0 -1
- package/dist/preview/chunk.MUWI54IP.js +0 -1
- package/dist/preview/chunk.NLZHNPDU.js +0 -93
- package/dist/preview/chunk.NSAGOOJW.js +0 -1
- package/dist/preview/chunk.NYLKG25K.js +0 -4
- package/dist/preview/chunk.OWO3OV62.js +0 -1
- package/dist/preview/chunk.ROYCJXPE.js +0 -1
- package/dist/preview/chunk.RZ73YG5K.js +0 -1
- package/dist/preview/chunk.SAWASNDO.js +0 -1
- package/dist/preview/chunk.SCVKHGO3.js +0 -1
- package/dist/preview/chunk.SM37MNS2.js +0 -1
- package/dist/preview/chunk.T2BZBR7S.js +0 -50
- package/dist/preview/chunk.TLPCYKLW.js +0 -3
- package/dist/preview/chunk.U563J5IM.js +0 -1
- package/dist/preview/chunk.U6QXLNHF.js +0 -15
- package/dist/preview/chunk.VBYJBW32.js +0 -1
- package/dist/preview/chunk.VHLL6VC6.js +0 -1
- package/dist/preview/chunk.W3WXI5B3.js +0 -1
- package/dist/preview/chunk.W43XWQRC.js +0 -1
- package/dist/preview/chunk.WJHLE73Y.js +0 -111
- package/dist/preview/chunk.ZT3ZG52B.js +0 -1
- package/dist/preview/chunk.ZU3RPI34.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as g}from"./chunk.
|
|
1
|
+
import{h as g}from"./chunk.RJ7VSWTA.js";import{Y as p}from"./chunk.JCKIJSW7.js";import{Xc as u,dd as c}from"./chunk.6L6RUOSF.js";import{b as h}from"./chunk.AJZBJBMO.js";var s={person:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="11.6" cy="5.4" r="2.5"/><path d="M7.9 12.4c0-2.1 1.7-3.8 3.7-3.8s3.7 1.7 3.7 3.8v3.2H7.9z"/><path d="M8 12.6 6.4 17.2"/><path d="M15.2 12.6 16.8 17.2"/><path d="M9.8 15.6v5"/><path d="M13.4 15.6v5"/></svg>',plot:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.6 9.4 12 4.6l9.4 4.8-9.4 4.8z"/><path d="M2.6 9.4v4.4l9.4 4.8 9.4-4.8V9.4"/><path d="M12 14.2v4.4"/><path d="M7 11.9v3"/><path d="M17 11.9v3"/></svg>',box:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.4 7.9 12 3.6l8.6 4.3-8.6 4.3z"/><path d="M3.4 7.9v8.2L12 20.4l8.6-4.3V7.9"/><path d="M12 12.2v8.2"/></svg>',task:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M4.4 6.6 12 2.9l7.6 3.7v9.5L12 19.8 4.4 16.1z"/><path d="M12 12.4v7.4"/><path d="M4.4 6.6 12 10.3l7.6-3.7"/><path d="M8 9.6l2.4 2.4L16 8.4"/></svg>',shift:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M3.2 8.2 12 4l8.8 4.2-8.8 4.2z"/><path d="M3.2 8.2v7.2L12 19.6l8.8-4.2V8.2"/><path d="M12 12.4v7.2"/><path d="M6.6 10.8v3.4"/><path d="M9.3 12v3.4"/></svg>',list:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 10.4 12 6l9.2 4.4-9.2 4.4z"/><path d="M2.8 10.4v3.2L12 18l9.2-4.4v-3.2"/><path d="M6.6 8.6 15.8 13"/><path d="M9.4 7.2 18.6 11.6"/></svg>',vehicle:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M2.8 14.2 5 9.4l8.6-1.6 5.4 3-1 3.6z"/><path d="M2.8 14.2v2.2h2.4"/><path d="M18 16.4h1.9l.1-2.2"/><circle cx="7.6" cy="16.6" r="1.9"/><circle cx="16.1" cy="16.6" r="1.9"/><path d="M8.6 8.2 9.8 12l7.2-1"/></svg>',rule:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M5.4 19.4V6.6l12 12.8z"/><path d="M5.4 6.6 7.6 5.5l12 12.8-2.2 1.1"/><path d="M5.4 19.4 7.6 18.3h12"/><path d="M5.4 10.1h1.7"/><path d="M5.4 13.3h1.7"/><path d="M5.4 16.5h1.7"/></svg>',note:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"><path d="M6.2 6.2 14.8 10.5v9L6.2 15.2z"/><path d="M12.4 9.3 14.8 10.5l-.6 2.3"/><path d="M8.2 10.6 12.8 12.9"/><path d="M8.2 13.2 11.4 14.8"/></svg>'},w=Object.keys(s);function o(e){if(!e)return;let t=s[e];return t||(e.trimStart().startsWith("<svg")&&c(e)===null?e:void 0)}var a=h(p(),1);function j({kind:e,schema:t,brand:i,size:r=16,title:n}){let f=t?.tryDefinition?.(e)?.figure,d=o(i?.figures?.[e]??f),l=Math.round(u(e,i?.accents)),v=g(d);return d?(0,a.jsx)("span",{"aria-hidden":n===void 0?"true":void 0,...n===void 0?{}:{role:"img","aria-label":n},"data-graview-figure":e,"data-graview-figure-kind":"figure",dangerouslySetInnerHTML:v,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:r,height:r,flex:"0 0 auto",color:`hsl(${l} 55% 52%)`,"--graview-figure-size":`${r}px`}}):(0,a.jsx)("span",{"aria-hidden":n===void 0?"true":void 0,...n===void 0?{}:{role:"img","aria-label":n},"data-graview-figure":e,"data-graview-figure-kind":"dot",style:{display:"inline-block",width:Math.round(r*.8),height:Math.round(r*.5),flex:"0 0 auto",background:`hsl(${l} 55% 52%)`,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)"}})}function A(e,t,i){return o(i?.figures?.[e]??t?.tryDefinition?.(e)?.figure)!==void 0}export{j as a,A as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as b,R as c,S as T,U as p,V as D}from"./chunk.
|
|
1
|
+
import{E as b,R as c,S as T,U as p,V as D}from"./chunk.6L6RUOSF.js";var S=864e5,N=/^(\d{4})-(\d{2})-(\d{2})/,s=n=>String(n).padStart(2,"0"),g=n=>new Date(n).toISOString().slice(0,10),m=n=>Date.UTC(+n.slice(0,4),+n.slice(5,7)-1,+n.slice(8,10)),W=(n,e)=>g(m(n)+e*S),M=n=>new Date(m(n)).getUTCDay();function A(n,e,t){if(!(e>=1&&e<=12&&t>=1&&t<=31))return;let r=`${String(n).padStart(4,"0")}-${s(e)}-${s(t)}`;return g(m(r))===r?r:void 0}function O(n=new Date){let e=c();return e?p(n.getTime(),e):{day:`${n.getFullYear()}-${s(n.getMonth()+1)}-${s(n.getDate())}`,minutes:n.getHours()*60+n.getMinutes()}}var $=n=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(n);function f(n){if(typeof n!="string")return;if($(n)){let r=new Date(n);return Number.isNaN(r.getTime())?void 0:O(r)}let e=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2}))?/.exec(n);if(!e||!A(Number(e[1]),Number(e[2]),Number(e[3])))return;let t=n.slice(0,10);return e[4]===void 0?{day:t}:{day:t,minutes:Number(e[4])*60+Number(e[5])}}function x(n,e){if(!e.time)return n.day;let t=n.minutes??9*60;if(!e.instant)return`${n.day}T${s(Math.floor(t/60))}:${s(t%60)}`;let r=c(),[,i,a,d]=N.exec(n.day);return(r?new Date(D(n.day,t,r)):new Date(Number(i),Number(a)-1,Number(d),Math.floor(t/60),t%60)).toISOString().replace(/\.\d{3}Z$/,"Z")}function Z(n,e=new Date){let t=T(),r=t;try{r=new Intl.DateTimeFormat(n??b,{timeZoneName:"short",timeZone:t}).formatToParts(e).find(i=>i.type==="timeZoneName")?.value??t}catch{r=t}return{zone:t,short:r}}function z(n,e,t,r){let i=f(e);if(!i)return t;let a=n===void 0?void 0:f(n),d=t===void 0?void 0:f(t),o=u=>m(u.day)+(u.minutes??0)*6e4,l=(u,h)=>{let y=o(u)+h;return{day:g(y),...r.time?{minutes:Math.round(y%S/6e4)}:{}}};return a&&d?x(l(d,o(i)-o(a)),r):d&&o(d)>=o(i)?t:r.time?x(l(i,36e5),r):t}var _=/^(start|starts|startsAt|startsOn|startAt|begins|from|opens|checkIn)$/i,w=/^(end|ends|endsAt|endsOn|endAt|until|to|finish|finishes|closes|through|checkOut)$/i;function F(n,e={}){let t=(e.start&&n.includes(e.start)?e.start:void 0)??n.find(i=>_.test(i)),r=(e.end&&n.includes(e.end)?e.end:void 0)??n.find(i=>i!==t&&w.test(i));return t&&r?{start:t,end:r}:void 0}export{S as a,m as b,W as c,M as d,A as e,O as f,$ as g,f as h,x as i,Z as j,z as k,F as l};
|
|
@@ -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{a as j,g as oe,h as re}from"./chunk.6A3KTD66.js";import{a as A,b as T,c as I,d as P}from"./chunk.U5P23GO7.js";import{a as R}from"./chunk.RO3D2RNP.js";import{b}from"./chunk.MEAUTBVM.js";import{a as te,b as ne,c as ae}from"./chunk.RDUGUC7R.js";import{a as ie}from"./chunk.QKRQPUCE.js";import{a as C}from"./chunk.6TBQV3NO.js";import{m as ee}from"./chunk.RJ7VSWTA.js";import{G as X,J as K,Oa as Z,T as H,U as z,Y as J,ga as k,qa as Q}from"./chunk.JCKIJSW7.js";import{a as G}from"./chunk.SDO3U72B.js";import{Ie as _,Tb as S,ha as V,ma as Y,pb as N,qb as q}from"./chunk.6L6RUOSF.js";import{b as E}from"./chunk.AJZBJBMO.js";var u=E(X(),1);var se=E(X(),1);function U(){let{ai:n,aiDesk:a}=k(),{entries:o}=K(a),i=n.off===!0;return(0,se.useEffect)(()=>{i||a.load()},[a,i]),i?[]:o}var t=E(J(),1),pe=Z(G(()=>(__graviewPreload(import.meta.url,["./chunk.S2BMI23H.js","./chunk.U5P23GO7.js","./chunk.F7KVEWFH.js","./chunk.RJ7VSWTA.js","./chunk.P43LPXXJ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.7ZLCA3WK.js")))),he=pe.part((n,a)=>(0,t.jsx)(n.InteractionRow,{...a}),{quiet:!0,as:"li"}),fe=pe.part((n,a)=>(0,t.jsx)(n.ActivityFilter,{...a}),{quiet:!0,as:"div"}),me=n=>n.undoes===void 0&&n.primitives.some(a=>a.op==="remove-node"||a.op==="patch-node"&&a.after[q]===!0&&a.before[q]!==!0);function ve(n){let a=[...new Set(n.ops.filter(o=>!S(o)&&me(o)).map(o=>o.intent))].filter(o=>o!==n.intent);return a.length===0?n.intent:`${n.intent} \u2014 ${a.join("; ")}`}var de=n=>n.id==="examples"||n.id.startsWith("examples:"),we="Example records from the template",le=(n,a,o=ce(n,[a]))=>({intent:de(a)?we:ve(a),...de(a)?{examples:!0}:{},author:a.author.kind,...a.author.id?{authorId:a.author.id}:{},by:a.author,...a.ops[0]?.via?{via:a.ops[0].via}:{},...a.lineage&&a.lineage.stopsKind!==!0?{basis:ie(a.lineage)}:{},touched:[...new Set(a.ops.filter(i=>!S(i)).flatMap(i=>i.writes))],...ke(a.ops.filter(i=>!S(i)).flatMap(i=>i.writes),o),batch:a.id,at:a.at,...a.lineage?.interaction?{interaction:a.lineage.interaction}:{},seq:a.ops.at(-1).seq+1,...a.ops.every(S)?{withheld:!0}:{}});function ge(n=4){let{store:a,principal:o}=k(),i=z(a,o),l=i.log.length;return(0,u.useMemo)(()=>{let s=i.batches(),d=ce(i,s);return ne(s,r=>i.log.get(r)).reverse().slice(0,n).map(r=>{if("batch"in r){let y=le(i,r.batch,d);return r.typed?{...y,intent:te(r.typed,i.schema,i.graph),batches:r.typed.batches.filter(g=>!g.undone).map(g=>g.id)}:y}let h=[...r.digest.batches].reverse().map(y=>le(i,y,d));return{intent:ae(r.digest),author:r.digest.author.kind,...r.digest.author.id?{authorId:r.digest.author.id}:{},by:r.digest.author,touched:[...new Set(h.flatMap(y=>y.touched))],batch:"",...h[0]?.at?{at:h[0].at}:{},seq:h[0]?.seq??0,digest:h}})},[i,l,n])}function ce(n,a){let o=new Map;for(let i of a)for(let l of i.ops)if(!S(l))for(let s of l.primitives)(s.op==="add-node"||s.op==="remove-node")&&s.node&&o.set(s.node.id,Y(n.schema.tryDefinition(s.node.kind),s.node));return o}function ke(n,a){let o={};for(let i of n){let l=a.get(i);l!==void 0&&(o[i]=l)}return Object.keys(o).length>0?{named:o}:{}}function be({change:n}){let{store:a,principal:o,seats:i,people:l}=k();return(0,t.jsxs)("strong",{style:{fontWeight:600},children:[n.author==="human"&&n.by?.onBehalfOf===void 0&&(n.authorId===void 0||o.id===void 0||n.authorId===o.id)?"you":N(n.by??{kind:n.author,id:n.authorId},{graph:a.graph,schema:a.schema,seats:i,people:l}),C(n.via)?(0,t.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",C(n.via)]}):null]})}function xe({change:n,goes:a}){let{store:o}=k(),[i,l]=(0,u.useState)(!1),s=n.digest??[];return(0,t.jsxs)("li",{"data-testid":"activity-digest",style:{...A,gap:5},children:[(0,t.jsxs)("div",{"data-graview-activity-head":"",style:T,children:[(0,t.jsxs)("span",{"data-graview-activity-words":"",style:I,children:[(0,t.jsx)(be,{change:n})," ",(0,t.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:n.intent})]}),(0,t.jsx)("button",{type:"button","data-testid":"digest-toggle","aria-expanded":i,onClick:()=>l(d=>!d),style:{marginLeft:"auto",flex:"0 0 auto",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem"},children:i?"Hide":"Show each"})]}),i?(0,t.jsx)("ol",{"data-testid":"digest-changes",style:{margin:0,padding:"0 0 0 10px",listStyle:"none",display:"grid",gap:6,borderLeft:"1px solid var(--graview-edge)"},children:s.map(d=>(0,t.jsxs)("li",{"data-testid":"digest-change",style:A,children:[(0,t.jsxs)("div",{"data-graview-activity-head":"",style:T,children:[(0,t.jsxs)("span",{"data-graview-activity-words":"",style:I,children:[(0,t.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:d.intent}),d.basis?(0,t.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",d.basis]}):null]}),d.withheld?null:(0,t.jsx)($,{batch:d.batch})]}),d.touched.length>0?(0,t.jsx)("div",{"data-touched":d.touched.join(" "),style:P,children:d.touched.slice(0,4).map(r=>(0,t.jsx)(R,{id:r,label:o.graph.has(r)?b(o,r):d.named?.[r]??b(o,r),go:a(r),testId:"activity-record"},r))}):null]},d.batch))}):null]})}function $({batch:n,label:a="Undo"}){let{store:o,principal:i,noteSeat:l}=k(),s=z(o,i),d=H()?.open??!1,r=s.log.length,[h,y]=(0,u.useState)(null),g=(0,u.useMemo)(()=>s.canUndo(n),[s,n,r]),x=(0,u.useMemo)(()=>g.ok?s.mayUndo(n,i):{ok:!0},[s,n,r,i,g]),B=x.ok?x:s.mayUndo(n,i);if(d||!g.ok&&g.ops.length===0||!B.ok)return null;let m=!g.ok,W=m?g.includeBatches:[];return(0,t.jsxs)("span",{style:{marginLeft:"auto",flex:"0 0 auto",display:"grid",justifyItems:"end",gap:2},children:[(0,t.jsx)("button",{type:"button","data-testid":"undo-turn",title:m?`${g.message} \u2014 undo those too`:"Take this back, keeping everything since",onClick:()=>{y(null);try{let v=typeof n=="string"?[n]:n,L=s.log.all().find(O=>v.includes(O.batch)&&O.author.kind==="agent");s.undo(m?[...v,...W]:typeof n=="string"?n:[...n],{author:i}),L&&l({type:"home",author:L.author})}catch(v){y(v instanceof Error?v.message:String(v))}},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,padding:"1px 8px",fontSize:"0.75rem",...m?{borderColor:"var(--graview-warn)",color:"var(--graview-warn)"}:{}},children:m?`Undo ${(typeof n=="string"?1:n.length)+W.length} changes`:a}),h?(0,t.jsx)("span",{"data-testid":"undo-refused",role:"alert",style:{fontSize:"0.75rem",lineHeight:1.4,color:"var(--graview-warn)",maxWidth:260,textAlign:"right"},children:h}):null]})}function Se({seq:n,intent:a}){let o=H();if(!o)return null;let i=o.past?.seq===n;return(0,t.jsxs)("button",{type:"button","data-testid":"show-past","aria-label":`Show the app as it was after \u201C${a}\u201D`,title:"Show the app as it was here","aria-pressed":i,onPointerEnter:j,onFocus:j,onClick:()=>o.show(n),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,minHeight:24,minWidth:24,padding:"1px 6px",fontSize:"0.75rem",whiteSpace:"nowrap",flex:"0 0 auto"},children:[(0,t.jsxs)("svg",{width:"13",height:"13",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[(0,t.jsx)("path",{d:"M2.5 8 a5.5 5.5 0 1 0 1.6-3.9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,t.jsx)("path",{d:"M2 2.5 V5.5 H5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M8 5 V8 L10 9.25",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"As it was"]})}function Ae(){let n=()=>_(window.location.href);return(0,t.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:a=>{a.preventDefault(),window.location.assign(n())},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,fontSize:"0.8125rem",color:"var(--graview-ink-muted)",textDecoration:"underline",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3},children:"Start fresh"})}function Ue({calls:n,seat:a,remembers:o=!1,close:i,headed:l=!0}){let s=ge(),{store:d,principal:r,seats:h,people:y}=k(),g=U(),[x,B]=(0,u.useState)("all"),[m,W]=(0,u.useState)(!1),v=e=>e!==void 0&&(e.id===r.id||e.onBehalfOf?.id===r.id)&&r.id!==void 0,L=new Set(g.map(e=>e.id)),O=s.filter(e=>!(e.interaction!==void 0&&L.has(e.interaction))&&(!m||v(e.by))),ue=g.filter(e=>!m||v(e.by)).slice(0,4),M=[...x==="ai"?[]:O.map(e=>({at:e.at??"",change:e})),...x==="changes"?[]:ue.map(e=>({at:e.at,entry:e}))].sort((e,f)=>e.at<f.at?1:e.at>f.at?-1:0),w=z(d,r),ye=Q(),F=H(),D=e=>w.graph.has(e)?f=>{i(),F?.past&&F.show(null),ye.record(f)}:null;return(0,t.jsxs)(t.Fragment,{children:[l?(0,t.jsx)("h2",{style:{...ee,margin:0},children:"Activity"}):null,a!==void 0?(0,t.jsxs)("div",{"data-testid":"agent-seat-row",style:{display:"grid",gap:5,paddingBottom:n.length>0||M.length>0?9:0,...n.length>0||M.length>0?{borderBottom:"1px solid var(--graview-edge)"}:{}},children:[(0,t.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:"The agent's seat"}),a]}):null,n.length>0?(0,t.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:7},children:n.slice(0,6).map((e,f)=>(0,t.jsxs)("li",{style:{...A,gap:2,fontSize:"0.8125rem"},children:[(0,t.jsxs)("div",{"data-graview-activity-head":"",style:T,children:[(0,t.jsx)("span",{"aria-hidden":"true",style:{width:6,height:6,borderRadius:999,flex:"0 0 auto",background:e.phase==="running"?"var(--graview-accent)":e.phase==="failed"?"var(--graview-warn)":"var(--graview-edge-bright)"}}),(0,t.jsxs)("span",{"data-graview-activity-words":"",style:{...I,color:"var(--graview-ink)"},children:[e.mutating?"changed":"read"," \xB7"," ",w.allMutations().find(p=>p.name===e.name)?.title??V(e.name)]})]}),!e.mutating&&e.reads&&e.reads.length>0?(0,t.jsxs)("div",{"data-testid":"activity-reads",style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:[[...new Set(e.reads)].slice(0,3).map(p=>(0,t.jsx)(R,{id:p,label:b(w,p),go:D(p),testId:"activity-record"},p)),new Set(e.reads).size>3?(0,t.jsxs)("span",{style:{color:"var(--graview-ink-muted)"},children:["+",new Set(e.reads).size-3]}):null]}):Object.values(e.args).some(p=>typeof p=="string")?(0,t.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,paddingLeft:12},children:Object.entries(e.args).filter(p=>typeof p[1]=="string").slice(0,3).map(([p,c])=>(0,t.jsx)(R,{id:c,label:b(w,c),go:D(c),testId:"activity-record"},p))}):null,e.error?(0,t.jsx)("div",{style:{paddingLeft:12,color:"var(--graview-warn)"},children:e.error}):null]},`${e.at}:${f}`))}):null,g.length>0?(0,t.jsx)(u.Suspense,{fallback:null,children:(0,t.jsx)(fe,{shows:x,onShows:B,mine:m,onMine:W})}):null,M.length>0?(0,t.jsx)("ol",{"data-testid":"diff-log",style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6,fontSize:"0.8125rem"},children:M.map(({change:e,entry:f},p)=>f!==void 0?(0,t.jsx)(u.Suspense,{fallback:null,children:(0,t.jsx)(he,{entry:f,undo:c=>(0,t.jsx)($,{batch:c})})},`ai:${f.id}`):e.digest?(0,t.jsx)(xe,{change:e,goes:D},`digest:${e.digest[0]?.batch??p}`):e.withheld?(0,t.jsx)("li",{"data-testid":"withheld-change",style:A,children:(0,t.jsx)("span",{"data-touched":"",style:{...I,color:"var(--graview-ink-muted)",fontStyle:"italic"},children:e.intent})},`change:${p}`):(0,t.jsxs)("li",{"data-batch":e.batch,style:A,children:[(0,t.jsxs)("div",{"data-graview-activity-head":"",style:T,children:[(0,t.jsx)("span",{"data-graview-activity-words":"",style:I,children:e.examples?e.intent:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("strong",{style:{fontWeight:600},children:[e.author==="human"&&e.by?.onBehalfOf===void 0&&(e.authorId===void 0||r.id===void 0||e.authorId===r.id)?"you":N(e.by??{kind:e.author,id:e.authorId},{graph:w.graph,schema:w.schema,seats:h,people:y}),C(e.via)?(0,t.jsxs)("span",{style:{fontWeight:400,color:"var(--graview-ink-muted)"},children:[", ",C(e.via)]}):null]})," ",(0,t.jsx)("span",{style:{color:"var(--graview-ink-muted)"},children:e.intent}),e.basis?(0,t.jsxs)("span",{"data-graview-lineage":"",style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",e.basis]}):null]})}),e.batch?(0,t.jsx)(Se,{seq:e.seq,intent:e.intent}):null,e.batch?(0,t.jsx)($,{batch:e.batches&&e.batches.length>0?e.batches.length===1?e.batches[0]:e.batches:e.batch,...e.examples?{label:"Remove examples"}:{}}):null]}),(0,t.jsx)("div",{"data-touched":e.touched.join(" "),style:P,children:e.touched.slice(0,4).map(c=>(0,t.jsx)(R,{id:c,label:w.graph.has(c)?b(w,c):e.named?.[c]??b(w,c),go:D(c),testId:"activity-record"},c))})]},`change:${p}`))}):null,(0,t.jsx)(re,{style:{paddingTop:8,borderTop:"1px solid var(--graview-edge)"}}),o?(0,t.jsxs)("div",{"data-testid":"remembered",style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:10,paddingTop:8,borderTop:"1px solid var(--graview-edge)",fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:[(0,t.jsx)("span",{children:"Remembered in this browser"}),(0,t.jsx)(Ae,{})]}):null]})}function $e({calls:n,seat:a,remembers:o=!1}){let i=ge(),l=U(),s=oe();return{has:!(a===void 0&&n.length===0&&i.length===0&&l.length===0&&!o&&s===0),recent:i.length,running:n.some(d=>d.phase==="running")}}export{U as a,he as b,$ as c,Ue as d,$e as e};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{F as j,G as D,H as cn,I as q,J as _,L as v,M as gn,Ma as bn,Q as yn,T as L,U as pn,Ua as kn,V as hn,W as J,X as mn,Y as B,Z as Q,da as X,db as An,fa as nn,ia as wn,ja as $n,kc as tn,rb as Sn,rc as xn,ua as en}from"./chunk.6L6RUOSF.js";var rn="$subject",on="$arg",we=e=>e.t==="ident"?e.name===rn?"subject":e.name===on?"arg":void 0:void 0;var Qn=864e5,Z=e=>String(e).padStart(2,"0"),K=e=>new Date(e).toISOString().slice(0,10),T=e=>Date.UTC(+e.slice(0,4),+e.slice(5,7)-1,+e.slice(8,10)),Xn=(e,t)=>K(T(e)+t*Qn),En=e=>new Date(T(e)).getUTCDay(),ne=e=>/T\d\d:\d\d(:[\d.]+)?(Z|[+-]\d\d:?\d\d)$/.test(e),an=["sun","mon","tue","wed","thu","fri","sat"],Tn=e=>gn(e)??"UTC";function Gn(e,t){if(j.test(e))return K(T(e))===e?{day:e}:void 0;if(D.test(e))return{day:e.length===4?`${e}-01-01`:`${e}-01`};if(_.test(e)&&!ne(e)){let l=e.slice(0,10);return K(T(l))!==l?void 0:{day:l,minutes:Number(e.slice(11,13))*60+Number(e.slice(14,16))}}let s=Date.parse(e);if(!Number.isNaN(s))return{...pn(s,t),stamp:s}}var Nn=["EEEE","EEE","MMMM","MMM","yyyy","HH","mm","h","a","d"],Mn=/[A-Za-z]+/y;function ee(e){let t=[],s=0;for(;s<e.length;){let l=e[s];if(l==="'"){let f="",c=s+1;for(;c<e.length;c++){if(e[c]==="'"){if(e[c+1]==="'"){f+="'",c++;continue}break}f+=e[c]}if(c>=e.length)return`the quoted words in "${e}" are never closed`;t.push({text:f}),s=c+1;continue}Mn.lastIndex=s;let u=Mn.exec(e);if(u){let f=u[0];for(;f.length>0;){let c=Nn.find(w=>f.startsWith(w));if(!c)return`"${f}" is not a piece of a date pattern; the pieces are ${Nn.map(w=>`${w}`).join(", ")}, and other words go in single quotes`;t.push(c),f=f.slice(c.length)}s+=u[0].length;continue}t.push({text:l}),s++}return t}var Rn="UTC",On=new Map;function te(e,t){let s=`${e}|${JSON.stringify(t)}`,l=On.get(s);if(!l){try{l=new Intl.DateTimeFormat(e,{...t,timeZone:Rn})}catch{l=new Intl.DateTimeFormat("en-US",{...t,timeZone:Rn})}On.set(s,l)}return l}var P=(e,t,s,l)=>te(e,t).formatToParts(s).find(u=>u.type===l)?.value??"";function Fn(e,t,s){let l=ee(t);if(typeof l=="string")return{problem:l};let u=yn(s),f=T(e.day),c=e.minutes,w=c===void 0?void 0:f+c*6e4;return l.map(k=>{if(typeof k!="string")return k.text;switch(k){case"EEEE":return P(u,{weekday:"long"},f,"weekday");case"EEE":return P(u,{weekday:"short"},f,"weekday");case"MMMM":return P(u,{month:"long"},f,"month");case"MMM":return P(u,{month:"short"},f,"month");case"yyyy":return e.day.slice(0,4);case"d":return String(Number(e.day.slice(8,10)));case"HH":return c===void 0?"":Z(Math.floor(c/60));case"mm":return c===void 0?"":Z(c%60);case"h":return c===void 0?"":String((Math.floor(c/60)+11)%12+1);case"a":return w===void 0?"":P(u,{hour:"numeric",hour12:!0},w,"dayPeriod")}}).join("")}var re=/^(\d{1,2}):(\d{2})$/;function Vn(e){let t=re.exec(e.trim());if(!t)return;let s=Number(t[1]),l=Number(t[2]);return s<=23&&l<=59?s*60+l:void 0}var Dn=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"Z"),oe=(e,t)=>`${e}T${Z(Math.floor(t/60))}:${Z(t%60)}`;function _n(e,t,s){return Dn(hn(e.day,t,s))}function Wn(e,t){if(e.stamp!==void 0)return Dn(e.stamp+t*6e4);let s=T(e.day)+(e.minutes??0)*6e4+t*6e4,l=K(s);return oe(l,Math.round((s-T(l))/6e4))}var Cn=e=>an[En(e.day)];function In(e,t){let s=(En(e.day)-an.indexOf(t)+7)%7;return Xn(e.day,-s)}var jn=e=>typeof e=="string"&&an.includes(e);var Ln=1e4,$=class{constructor(t){this.nodes=t}},Un=Symbol.for("@graview/core:far-record"),ae=e=>typeof e=="object"&&e!==null&&e[Un]===!0;function ie(e){let t={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(t,Un,{value:!0}),t}function Ee(e){let t=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${t} is not one this viewer may open`:`${t} has not been read`}var se="",y=class extends Error{constructor(s,l){super(s);this.sentence=s;this.at=l}},sn=class extends y{},G=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof $)&&typeof e.id=="string",Pn=e=>{let t=new Set;return new $(e.filter(s=>!t.has(s.id)&&t.add(s.id)))},A=e=>e===null?"nothing":e instanceof $?"a set of records":Array.isArray(e)?"a list":G(e)?"a record":typeof e=="string"?"a word":typeof e;function de(e,t){if(!D.test(e)&&!D.test(t))return;let s=f=>q(_.test(f)?f.slice(0,10):f),l=s(e),u=s(t);return l&&u?[l,u]:void 0}function vn(e,t){let s=t.budget??Ln,l=(n,i)=>{if(s-=n,s<0)throw new sn("this rule looks at too much of the graph to judge in one go",i)},u=t.today??v(),f=t.now??new Date().toISOString(),c=Tn(t.timeZone),w=new Map,k=new Set,S=t.bindings,F=t.args,W=t.subject,O=!1,ln=(n,i,o,a)=>{let p=`${n?.id}\0${i}`;if(w.has(p))return w.get(p);if(k.has(p))throw new y(`"${i}"${n?` of ${en(n.kind)}`:""} depends on itself`,a);k.add(p);let[r,d,g,h]=[S,F,W,O];S=F=void 0,W=n,O=!1;let b=s;s=Math.max(b,Ln);try{let m=x(o,n);return w.set(p,m),m}finally{s=b,S=r,F=d,W=g,O=h,k.delete(p)}},C=(n,i,o)=>{l(1,o);let a=t.kinds.get(n.kind),p=a?.computed?.get(i);if(p)return ln(n,i,p,o);let r=a?.linked?.get(i);if(r){let h=bn(Object.hasOwn(n,i)?n[i]:void 0,r);l(h.length,o);let b=t.linked??kn(t.graph),m=h.flatMap(N=>{let Y=b?b(N):{unread:!0};return"record"in Y?[ie(Y.record)]:(t.onUnread?.({relation:i,ref:N,reason:"denied"in Y?"denied":"unread"}),[])});return r.cardinality==="one"?m[0]??null:new $(m)}let d=Object.hasOwn(n,i);if(a?.fields.has(i)||d){let h=d?An(n,i,u):void 0;return h===void 0?null:h}let g=a?.edges.get(i);if(g){let h=t.graph.out(n.id,i);return l(h.length,o),g==="one"?h[0]??null:new $(h)}if(i==="id")return n.id;if(ae(n))return null;throw new y(`${en(n.kind)} has no field or relation called "${i}"`,o)},M=(n,i,o)=>{if(n instanceof $)return n;if(n===null)return new $([]);if(G(n))return new $([n]);throw new y(`${o}(\u2026) needs a set of records, and was given ${A(n)}`,i)},E=(n,i,o)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new y(`${o}(\u2026) needs a word, and was given ${A(n)}`,i)},H=(n,i,o)=>{let a=E(n,i,o);if(a===null)return null;let p=D.test(a)?q(a).from:a,r=Date.parse(p.length===10?`${p}T00:00:00Z`:p);if(Number.isNaN(r))throw new y(`${o}(\u2026) needs a date, and "${a}" is not one`,i);return r},I=(n,i,o)=>{if(n===null)return null;if(typeof n!="string")throw new y(`${o}(\u2026) needs a date, and was given ${A(n)}`,i);let a=Gn(n,c);if(!a)throw new y(`${o}(\u2026) needs a date, and "${n}" is not one`,i);return a},V=(n,i)=>G(n)&&G(i)?n.id===i.id:G(n)&&typeof i=="string"?n.id===i:typeof n=="string"&&G(i)?n===i.id:Array.isArray(n)&&Array.isArray(i)?n.length===i.length&&n.every((o,a)=>V(o,i[a])):n===i,R=(n,i,o)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new y(`${o} must be true or false, and was ${A(n)}`,i)},U=(n,i)=>{let o=O;O=!0;try{return x(i,n)}finally{O=o}},qn=(n,i)=>{let o=t.kinds.get(n.kind);return o?o.fields.has(i)||o.edges.has(i)||o.computed?.has(i)===!0||o.linked?.has(i)===!0:Object.hasOwn(n,i)};function x(n,i){switch(l(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(o=>x(o,i));case"ident":{if(n.name===rn){if(W)return W}else{if(O&&i&&qn(i,n.name))return C(i,n.name,n.at);let o=S&&Object.hasOwn(S,n.name)?S[n.name]:void 0;if(o!==void 0)return o;if(i)return C(i,n.name,n.at)}throw new y(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{if(n.object.t==="ident"&&n.object.name===on)return F&&Object.hasOwn(F,n.name)?F[n.name]??null:null;let o=x(n.object,i);if(o===null)return null;if(G(o))return C(o,n.name,n.at);throw new y(`".${n.name}" needs a record before it, and was given ${A(o)}`,n.at)}case"unary":{let o=x(n.operand,i);if(n.op==="!")return!R(o,n.at,"what follows not");if(o===null)return null;if(typeof o!="number")throw new y(`"-" needs a number, and was given ${A(o)}`,n.at);return-o}case"where":{let o=M(x(n.set,i),n.at,"where");return l(o.nodes.length,n.at),new $(o.nodes.filter(a=>R(U(a,n.filter),n.at,"a where condition")))}case"binary":return Jn(n,i);case"call":return Bn(n,i)}}function Jn(n,i){if(n.op==="&&")return R(x(n.left,i),n.at,"each side of and")&&R(x(n.right,i),n.at,"each side of and");if(n.op==="||")return R(x(n.left,i),n.at,"each side of or")||R(x(n.right,i),n.at,"each side of or");let o=x(n.left,i),a=x(n.right,i);if(n.op==="&"||n.op==="|"||n.op==="-"&&(o instanceof $||a instanceof $)){let p=M(o,n.at,n.op).nodes,r=M(a,n.at,n.op).nodes;l(p.length+r.length,n.at);let d=new Set(r.map(g=>g.id));return Pn(n.op==="|"?[...p,...r]:p.filter(g=>d.has(g.id)===(n.op==="&")))}switch(n.op){case"==":return V(o,a);case"!=":return!V(o,a);case"in":{if(a===null)return!1;if(a instanceof $)return a.nodes.some(p=>V(o,p));if(Array.isArray(a))return a.some(p=>V(o,p));if(typeof a=="string"&&typeof o=="string")return a.includes(o);throw new y(`"in" needs a list or a set on its right, and was given ${A(a)}`,n.at)}case"<":case"<=":case">":case">=":{if(o===null||a===null)return!1;if(!(typeof o=="number"&&typeof a=="number"||typeof o=="string"&&typeof a=="string"))throw new y(`cannot compare ${A(o)} with ${A(a)}`,n.at);let r=typeof o=="string"&&typeof a=="string"?de(o,a):void 0;if(r){let[d,g]=r,h=d.to<g.from,b=d.from>g.to,m=d.from===g.from&&d.to===g.to;return n.op==="<"?h:n.op==="<="?h||m:n.op===">"?b:b||m}return n.op==="<"?o<a:n.op==="<="?o<=a:n.op===">"?o>a:o>=a}default:{if(o===null||a===null)return null;if(n.op==="+"&&(typeof o=="string"||typeof a=="string")){let p=`${E(o,n.at,"+")}${E(a,n.at,"+")}`;if(p.length>1e4)throw new y("that makes a word too long",n.at);return p}if(typeof o!="number"||typeof a!="number")throw new y(`"${n.op}" needs numbers, and was given ${A(o)} and ${A(a)}`,n.at);return(n.op==="/"||n.op==="%")&&a===0?null:n.op==="+"?o+a:n.op==="-"?o-a:n.op==="*"?o*a:n.op==="/"?o/a:o%a}}}function un(n,i){let o=n.t==="call"&&(n.fn==="in"||n.fn==="out")&&n.args.length===1?n.args[0]:void 0;if(!(!i||o?.t!=="lit"||typeof o.value!="string"))return l(1,n.at),n.fn==="out"?t.graph.out(i.id,o.value):t.graph.in(i.id,o.value)}function Bn(n,i){let o=(r,d=r)=>{if(n.args.length<r||n.args.length>d)throw new y(`${n.fn}(\u2026) takes ${r===d?r:`${r} to ${d}`} argument${d===1?"":"s"}`,n.at)},a=r=>x(n.args[r],i),p=r=>{let d=a(r);if(typeof d!="string")throw new y(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return d};switch(n.fn){case"out":case"in":{o(1,2);let r=(h,b)=>n.fn==="out"?t.graph.out(h,b):t.graph.in(h,b);if(n.args.length===2){let h=M(a(0),n.at,n.fn).nodes,b=p(1);return Pn(h.flatMap(m=>{let N=r(m.id,b);return l(N.length+1,n.at),N}))}let d=p(0);if(!i)throw new y(`${n.fn}('${d}') needs a record to start from`,n.at);let g=r(i.id,d);return l(g.length,n.at),new $(g)}case"all":{o(1,2);let r=t.graph.nodesOfKind(p(0),{archived:n.args.length===2?a(1):!1});return l(r.length,n.at),new $(r)}case"archived":return o(0,1),Sn(n.args.length===1?a(0):i);case"count":return o(1),(un(n.args[0],i)??M(a(0),n.at,"count").nodes).length;case"exists":return o(1),(un(n.args[0],i)??M(a(0),n.at,"exists").nodes).length>0;case"every":case"some":{o(2);let r=M(a(0),n.at,n.fn);l(r.nodes.length,n.at);let d=g=>R(U(g,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(d):r.nodes.some(d)}case"sum":case"min":case"max":{o(2);let r=M(a(0),n.at,n.fn);l(r.nodes.length,n.at);let d=n.args[1],g=d.t==="lit"&&typeof d.value=="string"?d.value:void 0,h=d.t==="ident"?`'${d.name}'`:g!==void 0?`'${g}'`:"\u2026",b=r.nodes.map(m=>d.t==="ident"?C(m,d.name,n.at):g!==void 0?C(m,g,n.at):U(m,d)).filter(m=>{if(m===null)return!1;if(typeof m!="number")throw new y(`${n.fn}(\u2026, ${h}) needs a number for each member, and found ${A(m)}`,n.at);return!0});return n.fn==="sum"?b.reduce((m,N)=>m+N,0):b.length===0?null:n.fn==="min"?Math.min(...b):Math.max(...b)}case"fact":{o(1);let r=p(0),d=t.kinds.get(se)?.computed?.get(r);if(!d)throw new y(`no fact is called "${r}"`,n.at);return ln(null,r,d,n.at)}case"first":return o(1),M(a(0),n.at,"first").nodes[0]??null;case"sort":{o(2,3);let r=M(a(0),n.at,"sort"),d=n.args.length===3?a(2):"asc";if(d!=="asc"&&d!=="desc")throw new y("sort(\u2026) goes 'asc' or 'desc'",n.at);let g=r.nodes.length;l(g+g*Math.ceil(Math.log2(g+1)),n.at);let h=r.nodes.map((m,N)=>({node:m,i:N,key:U(m,n.args[1])})),b=d==="desc"?-1:1;return h.sort((m,N)=>fn(m.key,N.key,b,n.at)||m.i-N.i),new $(h.map(m=>m.node))}case"either":{if(n.args.length<1)throw new y("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let d=a(r);if(d!==null&&!(d instanceof $&&d.nodes.length===0))return d}return null}case"present":{o(1);let r=a(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof $?r.nodes.length>0:!0}case"len":{o(1);let r=a(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof $)return r.nodes.length;throw new y(`len(\u2026) needs a word or a list, and was given ${A(r)}`,n.at)}case"contains":case"startsWith":{o(2);let r=a(0),d=a(1);if(r===null||d===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(b=>V(b,d));let g=E(r,n.at,n.fn),h=E(d,n.at,n.fn);return n.fn==="contains"?g.toLowerCase().includes(h.toLowerCase()):g.startsWith(h)}case"lower":{o(1);let r=E(a(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"concat":{if(n.args.length<1)throw new y("concat(\u2026) takes at least one argument",n.at);let r="";for(let d=0;d<n.args.length;d++)r+=E(a(d),n.at,"concat")??"";if(r.length>1e4)throw new y("that makes a word too long",n.at);return r}case"format":{o(2);let r=I(a(0),n.at,"format"),d=a(1);if(typeof d!="string")throw new y("format(\u2026) says its pattern in quotes, like format(start, 'EEE h:mm a')",n.at);if(r===null)return null;let g=Fn(r,d,t.locale);if(typeof g!="string")throw new y(g.problem,n.at);return g}case"datetime":case"at":{o(2);let r=I(a(0),n.at,n.fn),d=a(1);if(d===null||r===null)return null;let g=typeof d=="string"?Vn(d):void 0;if(g===void 0)throw new y(`${n.fn}(\u2026) needs a time of day written like '09:30', and was given ${typeof d=="string"?`"${d}"`:A(d)}`,n.at);return _n(r,g,c)}case"addMinutes":{o(2);let r=I(a(0),n.at,"addMinutes"),d=a(1);if(r===null||d===null)return null;if(typeof d!="number"||!Number.isFinite(d))throw new y(`addMinutes(\u2026) needs a number of minutes, and was given ${A(d)}`,n.at);return Wn(r,Math.round(d))}case"weekday":{o(1);let r=I(a(0),n.at,"weekday");return r===null?null:Cn(r)}case"startOfWeek":{o(1,2);let r=I(a(0),n.at,"startOfWeek"),d=n.args.length===2?a(1):"mon";if(!jn(d))throw new y("startOfWeek(\u2026) starts the week on a day said 'mon' to 'sun'",n.at);return r===null?null:In(r,d)}case"today":return o(0),u;case"now":return o(0),f;case"date":{o(1);let r=H(a(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{o(2);let r=H(a(0),n.at,n.fn),d=H(a(1),n.at,n.fn);if(r===null||d===null)return null;let g=(d-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(g):g}case"round":{o(1,2);let r=a(0);if(r===null)return null;if(typeof r!="number")throw new y(`round(\u2026) needs a number, and was given ${A(r)}`,n.at);let d=n.args.length===2?a(1):0;if(typeof d!="number"||!Number.isInteger(d)||d<0||d>12)throw new y("round(\u2026, places) takes a whole number of places from 0 to 12",n.at);let g=10**d,h=Math.sign(r)*Math.round(Math.abs(r)*g*(1+Number.EPSILON))/g;return Object.is(h,-0)?0:h}case"if":return o(3),R(a(0),n.at,"the condition in if(\u2026)")?a(1):a(2);default:throw new y(`"${n.fn}" is not a function the rule language knows`,n.at)}}function fn(n,i,o,a){if(n===null||i===null)return n===i?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(i)){for(let r=0;r<Math.max(n.length,i.length);r++){let d=fn(n[r]??null,i[r]??null,o,a);if(d!==0)return d}return 0}let p=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:A(r);if(p(n)!==p(i)||typeof n=="object"||typeof i=="object")throw new y(`sort(\u2026) cannot put ${A(n)} and ${A(i)} in order`,a);return typeof n=="string"?o*(n<i?-1:n>i?1:0):o*(Number(n)-Number(i))}return x(e,t.subject)}var Te=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived","round","concat","format","datetime","at","addMinutes","weekday","startOfWeek"];var le=(e,t,s,l,u)=>({severity:"error",code:e,path:t,message:s,...l?{fix:l}:{},...u}),Fe=(e,t,s,l,u)=>({...le(e,t,s,l,u?.length?{edits:u}:void 0),severity:"warning"}),Ve=e=>e.some(t=>t.severity==="error");function ue(e,t){return[...(e.edits??[]).map(s=>`${t}edit: ${JSON.stringify(s)}`),...e.details?[`${t}details: ${e.details}`]:[],...(e.fixes??[]).flatMap(s=>[`${t}fix: ${s.label}`,...(s.edits??[]).map(l=>`${t} edit: ${JSON.stringify(l)}`)])].map(s=>`
|
|
2
|
+
${s}`).join("")}function De(e){return e.map(t=>`${t.severity==="error"?"\u2717":t.severity==="warning"?"!":"\xB7"} ${t.path||"(document)"}: ${t.message}${t.fix?` \u2014 ${t.fix}`:""}${ue(t," ")}`).join(`
|
|
3
|
+
`)}var fe=(e,t)=>e.to==="*"||e.to.includes(t);function Zn(e,t,s){let l=s(e);if(l){if(t.some(u=>l.from.includes(u)))return{step:{relation:e,out:!0},far:l.to};if(t.some(u=>fe(l,u)))return{step:{relation:e,out:!1},far:l.from}}}function We(e,t,s,l){if(!l(t.every))return{problem:{key:"every",message:`"${t.every}" is not a kind this document declares`}};let u=Zn(t.through,[e],s);if(!u){let S=s(t.through);return{problem:{key:"through",message:S?`"${t.through}" is a relation of ${S.from.join(", ")}, not of ${e}, so a ${e} cannot be followed through it`:`"${t.through}" is not a relation any kind declares`,fix:S?`name a relation ${e} declares, or one that points at ${e}`:void 0}}}let f=u.far==="*"?"*":u.far;if(!t.via)return f==="*"||f.includes(t.every)?{plan:{every:t.every,through:u.step}}:{problem:{key:"through",message:`"${t.through}" reaches ${f.join(", ")}, not ${t.every}`,fix:`add "via": the relation from ${f.join(" or ")} to ${t.every}, or name a relation that reaches ${t.every}`}};let c=f==="*"?[t.every]:f,w=Zn(t.via,c,s);if(!w){let S=s(t.via);return{problem:{key:"via",message:S?`"${t.via}" is a relation of ${S.from.join(", ")}, which "${t.through}" does not reach`:`"${t.via}" is not a relation any kind declares`,fix:S?`name a relation of ${c.join(" or ")}, or one that points at it`:void 0}}}let k=f==="*"?[t.every]:w.far;return k==="*"||k.includes(t.every)?{plan:{every:t.every,through:u.step,via:f==="*"?{relation:w.step.relation,out:!w.step.out}:w.step}}:{problem:{key:"via",message:`"${t.via}" reaches ${k.join(", ")}, not ${t.every}`,fix:`name a relation that reaches ${t.every}`}}}var Kn=(e,t,s)=>s.out?e.out(t,s.relation):e.in(t,s.relation);function Ce(e,t,s){let l=new Set;for(let u of Kn(e,t.id,s.through)){if(!s.via){l.add(u.id);continue}for(let f of Kn(e,u.id,s.via))l.add(f.id)}return e.nodesOfKind(s.every).filter(u=>!l.has(u.id))}var Ke=["money","percent","date","time","datetime","relative","upper","lower","count","words","and","plural","excerpt"],ce={getNode:()=>{},allNodes:()=>[],allEdges:()=>[],nodesOfKind:()=>[],edgesOfKind:()=>[],out:()=>[],in:()=>[],neighbors:()=>[],has:()=>!1};function ze(e,t,s,l=[],u,f=z){return dn(e,t,s,l,u,f)}var zn=(e,t)=>e.capital?X(t):t,ge=new Set(["words","plural","relative"]);function He(e,t){let s=e[0];return!s||s.text!==void 0||!s.format||!ge.has(s.format)?t:/^[a-z][a-z'’-]*(?=\s|$|[,.;:!?])/.test(t)?X(t):t}function ye(e){return e?t=>{let s=e.tryDefinition(t.kind)?.label;return s?s(t):z(t)}:z}var Hn=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],Yn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function pe(e,t){return!Number.isInteger(e)||e<0||e>99?Q(e,t):e<20?Hn[e]:e%10===0?Yn[e/10]:`${Yn[Math.floor(e/10)]}-${Hn[e%10]}`}function he(e){return/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:`${e}s`}var z=e=>String(e.name??e.title??e.label??e.id);function dn(e,t,s,l=[],u,f=z){if(t==="plural"){let c=e instanceof $?e.nodes.length:Array.isArray(e)?e.length:typeof e=="number"?e:null;return c===null||l[0]===void 0?"\u2014":c===1?l[0]:l[1]??he(l[0])}if(e===null)return"\u2014";if(e instanceof $)return t==="count"?String(e.nodes.length):t==="and"?nn(e.nodes.map(f)):e.nodes.map(f).join(", ");if(Array.isArray(e)){if(t==="count")return String(e.length);let c=e.map(w=>dn(w,void 0,s,[],u,f));return t==="and"?nn(c):c.join(", ")}if(typeof e=="object")return f(e);switch(t){case"words":return typeof e=="number"?pe(e,u?.locale):String(e);case"money":return typeof e=="number"?tn(e,u,l[0]==="0"?0:void 0):String(e);case"percent":return typeof e=="number"?Q(e,u?.locale,{style:"percent",maximumFractionDigits:0}):String(e);case"upper":return String(e).toUpperCase();case"lower":return String(e).toLowerCase();case"excerpt":return xn(String(e),Number(l[0])||void 0);case"date":return L(B(String(e),u?.timeZone)??String(e).slice(0,10),u?.locale);case"time":return typeof e=="string"&&j.test(e)?L(e,u?.locale):mn(String(e),u?.locale,u?.timeZone);case"datetime":return typeof e=="string"&&j.test(e)?L(e,u?.locale):J(String(e),u?.locale,u?.timeZone);case"relative":{let c=B(String(e),u?.timeZone),w=c===void 0?Date.parse(String(e)):Date.parse(`${c}T00:00:00Z`);if(Number.isNaN(w))return String(e);let k=Math.round((w-Date.parse(`${s}T00:00:00Z`))/864e5);return k===0?"today":k===1?"tomorrow":k===-1?"yesterday":k>0?`in ${k} days`:`${-k} days ago`}default:return typeof e=="string"&&cn.test(e)?L(e,u?.locale):typeof e=="string"&&_.test(e)?J(e,u?.locale,u?.timeZone):String(e)}}function me(e,t,s){return(Array.isArray(e)?e:[e]).map(l=>t[String(l)]??(s?wn(String(l)):$n(String(l)))).join(", ")}function Ye(e,t){let s=t.today??v(),l=t.name??ye(t.graph?.schema);return e.map(u=>{if(u.text!==void 0)return u.text;try{let f=vn(u.expr,{graph:t.graph??ce,subject:t.node,kinds:t.kinds,today:s,budget:t.budget??500,...t.bindings?{bindings:t.bindings}:{},...t.args?{args:t.args}:{}}),c=u.expr,w=c.t==="ident"||c.t==="member"&&c.object.t==="ident"&&c.object.name[0]==="$"?c.name:void 0,k=!u.format&&w!==void 0&&t.node?t.kinds.get(t.node.kind)?.choices?.get(w):void 0;return k&&(typeof f=="string"||Array.isArray(f))?zn(u,me(f,k,e.length===1)):zn(u,dn(f,u.format,s,u.formatArgs,t.money,l))}catch(f){if(f instanceof y)return"\u2014";throw f}}).join("")}export{rn as a,on as b,we as c,$ as d,Ee as e,se as f,y as g,sn as h,vn as i,Te as j,le as k,Fe as l,Ve as m,De as n,Ke as o,ce as p,ze as q,zn as r,He as s,ye as t,me as u,Ye as v,We as w,Ce as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m}from"./chunk.RJ7VSWTA.js";import{G as N,Y as f,aa as y}from"./chunk.JCKIJSW7.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(N(),1);var a=g(f(),1);var R={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},T={color:"var(--graview-ink-muted, #55514a)"},C={color:"var(--graview-ink-faint, #625d55)"};function H(e){let[l,o]=(0,p.useState)(z);return(0,p.useEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let t=()=>{let i=W(r,parseFloat(getComputedStyle(r).paddingBottom)||0);o(s=>s.overflowing===i.overflowing&&s.above===i.above&&s.below===i.below?s:i)};t();let d=new ResizeObserver(t);d.observe(r);for(let i of r.children)d.observe(i);return r.addEventListener("scroll",t,{passive:!0}),()=>{d.disconnect(),r.removeEventListener("scroll",t)}}),l}var z={overflowing:!1,above:!1,below:!1};function W(e,l=0){let o=e.scrollHeight>e.clientHeight+1,r=e.scrollWidth>e.clientWidth+1;return{overflowing:o||r,above:o&&e.scrollTop>1,below:o&&e.scrollTop+e.clientHeight<e.scrollHeight-l-1}}var A=(0,p.createContext)(null),I=(0,p.createContext)(null);function O({level:e,said:l=!0,style:o,children:r}){if(e===void 0)return(0,a.jsx)("strong",{style:o,...l?{}:{"aria-hidden":!0},children:r});let t=`h${e}`;return(0,a.jsx)(t,{style:{margin:0,...o},children:r})}function E({title:e,subtitle:l,meta:o,selected:r,tone:t="default",children:d,style:i,fit:s=!1,variant:w,heading:b}){let c=(0,p.useRef)(null),{overflowing:v,above:x,below:S}=H(c),P=y(),n=(w??(P==="fullscreen"?"page":"card"))==="page",k=(0,p.useContext)(A),u=(0,p.useContext)(I);return(0,a.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":n?"page":"card","data-selected":r||void 0,style:{display:"flex",flexDirection:"column",gap:n?12:"var(--graview-gap, 7px)",height:n||s?"auto":"100%",maxHeight:n?"none":"100%",padding:n?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:n?0:"var(--graview-radius, 12px)",border:n?"none":`1px solid ${r?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:n?"none":r?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:n?"visible":"hidden",...R[t],...n?{background:"transparent"}:{},...i},children:[t==="warning"?(0,a.jsx)("span",{"data-graview-broken":"",style:m,children:"Implicated in a problem."}):null,e===void 0||e===k?null:(0,a.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[t==="warning"?(0,a.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,a.jsx)(O,{level:b,said:u===null||e!==u,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:n?"1.5625rem":"0.9375rem",lineHeight:n?1.15:1.25,fontWeight:n?600:560,letterSpacing:n?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),o===void 0?null:(0,a.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...C},children:o})]}),l===void 0?null:(0,a.jsx)("div",{style:{fontSize:n?"0.90625rem":"0.8125rem",lineHeight:1.5,...T},children:l}),(0,a.jsx)("div",{ref:c,className:n?void 0:"graview-scroll",...v&&!n?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:n?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...n?{overflow:"visible"}:{marginBottom:"calc(-1 * var(--graview-pad, 15px))",paddingBottom:"var(--graview-pad, 15px)"},...!n&&!v?{overflow:"hidden"}:{}},"data-graview-more-above":x&&!n?"":void 0,"data-graview-more-below":S&&!n?"":void 0,children:d})]})}function h({label:e,hue:l,selected:o,title:r,pickId:t,emphasis:d}){let i=typeof e=="string"?e:void 0,s=l===void 0?void 0:Math.round(l);return(0,a.jsxs)("span",{"data-graview-primitive":"chip","data-selected":o||void 0,"data-graview-pick":t,"data-graview-emphasis":d,title:r??i,style:{cursor:t?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${o?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:o?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,a.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,a.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function L({items:e,max:l=8,selectedIds:o=[],pick:r=!1}){let t=e.slice(0,l),d=e.length-t.length;return(0,a.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[t.map(i=>(0,a.jsx)(h,{label:i.label,...i.hue===void 0?{}:{hue:i.hue},...r?{pickId:i.id}:{},...i.emphasis===void 0?{}:{emphasis:i.emphasis},selected:o.includes(i.id)},i.id)),d>0?(0,a.jsx)(h,{label:`+${d} more`}):null]})}function F({label:e,count:l,items:o,onExpand:r,flagged:t,problems:d}){return(0,a.jsx)(E,{title:e,meta:d?(0,a.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[d,(0,a.jsx)("span",{children:l})]}):l,tone:t?"warning":"muted",style:r?{cursor:"zoom-in"}:void 0,children:o&&o.length>0?(0,a.jsx)(L,{items:o,max:6,pick:!0}):null})}export{A as a,I as b,E as c,h as d,L as e,F as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk.ZE5RSKXF.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.DKUEZPGR.js";import{a as me}from"./chunk.EP7YT7LT.js";import{c as T,e as de,f as pe}from"./chunk.I7KN732Z.js";import{a as j,b as re,c as te,d as oe,f as G,m as ae,n as b,o as V,p as B,q as v,r as ie}from"./chunk.TLPCYKLW.js";import{a as x,c as ce,d as ge,f as he,h as be,i as we,j as Se}from"./chunk.FIY4RUK5.js";import{$b as ee,Aa as A,Ba as q,C as P,Ca as O,Da as M,L as K,La as Q,W as z,Z as F,ac as ne,bc as C,da as J,ha as X,la as Z,ra as N,ua as Y,za as E}from"./chunk.DHPXRDT5.js";var Re=e=>e.caption?.trim()||e.name,D=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>E(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ee=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ee(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:G(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var De=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if(De(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?Be(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,v(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var $e=" \xB7 ";function Ue(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split($e).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:x(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ee(t.value)?t.value:"neutral"}function We(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Ge=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},Be=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return x(t.definition,e,n);let d=we(Ge(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return x(t.definition,e,n);let l=typeof n=="number"?Be(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map(D).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?Ue(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,v(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?We(d):Se(Ge(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>E(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map(D).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?B(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?B(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:B(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Gn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function $(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var U=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=$(t,o.kind,n).indexOf(String(U(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>$(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of $(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>U(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(x(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(U(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=v(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function xe(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(xe):e.t==="when"?e.show.some(xe):!1}function ve(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function W(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=W(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=G(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=ve(e,n)),r}function Dn(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:W(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Gn as h,xe as i,W as j,Qe as k,Mn as l,Cn as m,Dn as n};
|
|
1
|
+
import{a as _}from"./chunk.U5KJQFAP.js";import{a as se,b as le,c as ue,d as fe,e as L,f as I,g as ye}from"./chunk.FOHZPYUV.js";import{a as me}from"./chunk.IXYG65TM.js";import{c as T,e as de,f as pe}from"./chunk.W6L2VAJG.js";import{d as j,e as re,f as te,g as oe,i as B,p as ae,q as b,r as V,s as v,t as x,u as ie}from"./chunk.N3MXLORL.js";import{a as E,c as ce,d as ge,f as he,h as be,i as we,j as Se}from"./chunk.TQ3MNB6K.js";import{Aa as G,Ba as A,C as P,Ca as q,Da as O,Ea as M,L as K,Ma as Q,W as z,Z as F,da as J,ia as X,jc as ee,kc as ne,lc as C,ma as Z,sa as N,va as Y}from"./chunk.6L6RUOSF.js";var Re=e=>e.caption?.trim()||e.name,$=e=>A(e)?`${Re(e)}, ${q(e)}`:Re(e);function dn(e){let n=Math.max(0,Math.round(e)),t=a=>String(a).padStart(2,"0"),r=Math.floor(n/3600),o=Math.floor(n%3600/60);return r>0?`${r}:${t(o)}:${t(n%60)}`:`${o}:${t(n%60)}`}function Ne(e){let n=e?.fields?.shape??{};return Object.keys(n).filter(t=>{let r=P(n[t]);for(;r?.innerType;)r=P(r.innerType);return M(n[t])!==void 0||r?.type==="array"&&M(r.element)!==void 0})}function sn(e,n){for(let t of Ne(n)){let r=O(e[t]).find(o=>G(o)||A(o));if(r)return r}}var k=e=>{try{return e()}catch{return null}},Ge=e=>typeof e=="string"&&se.includes(e);function Me(e){if(e!==void 0)return Ge(e)?e:e&&typeof e=="object"&&typeof e.expr=="string"?{expr:k(()=>T(e.expr))}:"neutral"}var Ce=4;function Ve(e){let n=typeof e.list=="string"?k(()=>T(e.list)):null,t=e.sort,r=typeof t=="string"?t:t&&typeof t=="object"&&typeof t.by=="string"?t.by:void 0,o=t&&typeof t=="object"?t.direction:void 0,a=n,d;if(n&&r!==void 0)if(o==="choices")d=r;else{let y=k(()=>T(r));a=y?{t:"call",fn:"sort",args:[n,y,{t:"lit",value:o==="desc"?"desc":"asc",at:0}],at:0}:null}let l=typeof e.limit=="number"&&Number.isInteger(e.limit)&&e.limit>=1?Math.min(e.limit,L):void 0,i=e.group,s=typeof i=="string"?i:i&&typeof i=="object"&&typeof i.by=="string"?i.by:void 0,f=i&&typeof i=="object"&&i.headings&&typeof i.headings=="object"?i.headings:{};return{t:"list",source:a,...d?{choiceOrder:d}:{},...l?{limit:l}:{},...s?{group:{by:s,headings:Object.fromEntries(Object.entries(f).filter(y=>typeof y[1]=="string"))}}:{},...typeof e.empty=="string"?{empty:e.empty}:{},as:e.as==="card"?"card":"row"}}function ke(e,n=1,t=""){if(!Array.isArray(e)||n>Ce)return[];let r={};return e.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];let a=o,d=p=>typeof p=="string"?k(()=>de(p)):null,l=p=>typeof p=="string"?k(()=>T(p)):null,i=Me(a.tone),s=typeof a.label=="string"?a.label:void 0,f=p=>Object.hasOwn(a,p),y=typeof a.currency=="string"&&/^[A-Z]{3}$/.test(a.currency)?a.currency:void 0,u=f("list")?"list":f("headline")?"headline":typeof a.figure=="string"?"number":Le.find(f);if(!u)return[];let m=r[u]=(r[u]??0)+1,c=a.key,R=typeof c=="string"&&c?c:`${t}${u}.${m}`;return[{...(()=>{switch(u){case"list":return Ve(a);case"number":{let p=ue.includes(a.as)?a.as:void 0,H=fe.includes(a.emphasis)?a.emphasis:void 0;return{t:u,value:l(a.figure),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:d(s)}:{},...H?{emphasis:H}:{}}}case"headline":case"title":return{t:u,parts:d(a[u])};case"text":{let p=a.lines;return{t:u,parts:d(a[u]),...i?{tone:i}:{},...typeof p=="number"&&Number.isInteger(p)&&p>=0?{lines:p}:{}}}case"badge":return{t:u,parts:d(a[u]),...i?{tone:i}:{}};case"field":{let p=le.includes(a.as)?a.as:void 0;return{t:u,field:String(a.field),...p?{as:p}:{},...y?{currency:y}:{},...s?{label:s}:{}}}case"image":return{t:u,field:String(a.image),as:a.as==="gallery"?"gallery":"thumb",...s?{label:s}:{}};case"progress":{let p=a.progress??{};return{t:u,value:l(p.value),max:l(p.max),...s?{label:d(s)}:{}}}case"group":return{t:u,blocks:ke(a.group,n+1,`${R}.`),direction:a.direction==="row"?"row":"column"};case"when":return{t:u,when:l(a.when),show:ke(a.show,n+1,`${R}.`)};default:return{t:u}}})(),key:R}]})}var Le=["title","text","badge","field","image","progress","group","when","divider","figure"],g="\u2014",Ie=500;function w(e,n){if(!e)return{ok:!1,problem:"an expression that does not parse"};try{return{ok:!0,value:B(e,{graph:n.graph??ae,subject:n.node,kinds:n.kinds,today:n.today,budget:n.budget??Ie})}}catch(t){return{ok:!1,problem:t instanceof Error?t.message:String(t)}}}function _e(e,n){let t=e.definition?.display?.format?.[n],r=e.fields[n]?.options??[];return t?Object.fromEntries(r.flatMap(o=>{let a=t(o);return a!==X(o)?[[o,a]]:[]})):{}}var $e=(e,n,t)=>!e.format&&e.expr?.t==="ident"&&typeof t=="string"&&n.fields[e.expr.name]?.format==="markdown";function S(e,n,t){if(!e)return{text:g,problem:"a template that does not parse"};let r,o;return{text:e.map(d=>{if(d.text!==void 0)return d.text;let l=w(d.expr??null,n);if(!l.ok)return r??=`{${d.source??""}}: ${l.problem}`,g;if($e(d,n,l.value))return n.glance?ce(l.value,{markdown:!0}):t&&e.length===1?(o=!0,l.value):ge(l.value);let i=!d.format&&d.expr?.t==="ident"&&n.fields[d.expr.name]?.type==="enum"?d.expr.name:void 0;if(i&&(typeof l.value=="string"||Array.isArray(l.value)))return V(d,ie(l.value,_e(n,i),e.length===1));let s=!d.format&&d.expr?.t==="ident"&&typeof l.value=="number"?ve(n,d.expr.name):void 0;return V(d,s?C(l.value,s):b(l.value,d.format,n.today,d.formatArgs,n.money,x(n.schema)))}).join(""),...r?{problem:r}:{},...o?{markdown:o}:{}}}var De=" \xB7 ";function We(e,n){if(!e||!n.node)return;let t=[[]];for(let d of e){if(d.text===void 0){t[t.length-1].push(d);continue}d.text.split(De).forEach((i,s)=>{s>0&&t.push([]),i!==""&&t[t.length-1].push({text:i})})}if(t.length<2)return;let r=d=>{let[l]=d;if(!(d.length!==1||!l||l.format||l.expr?.t!=="ident"))return n.fields[l.expr.name]?.type==="enum"?l.expr.name:void 0},o=0,a=t.flatMap(d=>{let l=r(d);if(l){let s=Object.hasOwn(n.node,l)?n.node[l]:void 0;return s==null||s===""?[]:(o++,[{text:E(n.definition,l,s),field:l}])}let i=S(d,n).text.trim();return i===""||i===g?[]:[{text:i}]});return o>0?a:void 0}function Ae(e,n){if(e===void 0)return;if(typeof e=="string")return e;let t=w(e.expr,n);return t.ok&&Ge(t.value)?t.value:"neutral"}function Ue(e){if(typeof e=="string")try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"?n.href:void 0}catch{return}}var Be=(e,n)=>{let t=e.fields[n]?.type;return t==="phone"||t==="place"||t==="duration"?t:be(e.definition,n)},ve=(e,n)=>ee(e.definition?.fields?.shape?.[n])??he(e.definition,n);function He(e,n,t,r,o){if(n==null||n==="")return g;if(typeof n=="boolean")return n?"yes":"no";if(r)return b(n,r,t.today,[],o?{...t.money,currency:o}:t.money);let a=t.fields[e];if(t.definition?.display?.format?.[e])return E(t.definition,e,n);let d=we(Be(t,e),n,t.money?.locale);if(d!==void 0)return d;if(a?.type==="date")return b(n,"date",t.today,[],t.money);if(a?.type==="datetime"&&typeof n=="string")return z(n,t.money?.locale,t.money?.timeZone);if(a?.type==="enum"&&(typeof n=="string"||Array.isArray(n)))return E(t.definition,e,n);let l=typeof n=="number"?ve(t,e):void 0;if(l)return C(n,l);if(typeof n=="number")return F(n,t.money?.locale,{});let i=O(n);return i[0]?i.map($).join(", "):Array.isArray(n)?n.map(s=>String(s)).join(", "):typeof n=="object"?g:String(n)}function Ke(e,n,t,r,o){return typeof e!="number"?String(e):n==="money"?ne(e,t?{...o,currency:t}:o):n==="percent"?b(e,n,r,[],o):F(e,o?.locale)}var h=(e,n)=>n?{...e,problem:n}:e;function Oe(e){return e.firstHeading===void 0?e:{...e,firstHeading:void 0}}function ze(e,n,t){switch(e.t){case"title":{let r=S(e.parts,n);return h({t:"title",text:r.text},r.problem)}case"text":{let r=S(e.parts,n,!0),o=Ae(e.tone,n),a=n.glance&&!r.problem?We(e.parts,n):void 0;return h({t:"text",text:r.text,...o?{tone:o}:{},...e.lines!==void 0?{lines:e.lines}:{},...r.markdown?{markdown:r.markdown}:{},...a?{runs:a}:{}},r.problem)}case"badge":{let r=S(e.parts,n);return h({t:"badge",text:r.text,tone:Ae(e.tone,n)??"neutral"},r.problem)}case"field":{let r=e.label??N(n.definition,e.field);if(!n.node)return{t:"field",field:e.field,label:r,text:g,problem:`"${e.field}" names a field, and these blocks are about no one record`};let o=e.as===void 0?n.kinds.get(n.node.kind)?.linked?.get(e.field):void 0;if(o){let y=Q(Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0,o);return{t:"field",field:e.field,label:r,text:y.length>0?"linked record":g,...y.length>0?{linked:{relation:o,refs:y}}:{}}}let a=n.kinds.get(n.node.kind)?.computed?.has(e.field),d,l;if(a){let y=w({t:"ident",name:e.field,at:0},n);y.ok?d=y.value!==null&&typeof y.value=="object"?b(y.value,void 0,n.today,[],n.money,x(n.schema)):y.value:l=y.problem}else d=Object.hasOwn(n.node,e.field)?n.node[e.field]:void 0;let i=e.as!==void 0?void 0:n.fields[e.field]?.type==="url"?Ue(d):Se(Be(n,e.field),d),s=k(()=>He(e.field,d,n,e.as,e.currency))??g,f=n.fields[e.field]?.type==="app-link"&&e.as===void 0&&typeof d=="string"?d:void 0;return h({t:"field",field:e.field,label:r,text:s,...i?{href:i}:{},...f?{app:f}:{}},l)}case"image":{let r=O(n.node&&Object.hasOwn(n.node,e.field)?n.node[e.field]:null),o=e.as==="gallery"?r:r.filter(a=>G(a)||A(a)).slice(0,1);return{t:"image",field:e.field,label:e.label??N(n.definition,e.field),as:e.as,files:o,text:o.map($).join(", ")||g}}case"progress":{let r=w(e.value,n),o=w(e.max,n),a=e.label?S(e.label,n):{text:"Progress"},d=e.label?v(e.label,a.text):a.text,l=r.ok?o.ok?a.problem:o.problem:r.problem;return r.ok&&o.ok&&typeof r.value=="number"&&typeof o.value=="number"&&Number.isFinite(r.value)&&Number.isFinite(o.value)&&o.value>0?h({t:"progress",label:d,value:r.value,max:o.value,text:`${b(r.value,void 0,n.today)} of ${b(o.value,void 0,n.today)}`},l):h({t:"progress",label:d,text:g},l)}case"group":return{t:"group",direction:e.direction,blocks:je(e.blocks,Oe(n))};case"when":{let r=w(e.when,n),o=r.ok&&r.value===!0;return h({t:"when",shown:o,blocks:o?je(e.show,Oe(n)):[]},r.ok?void 0:r.problem)}case"divider":return{t:"divider"};case"figure":return{t:"figure"};case"headline":{let r=S(e.parts,n),o=Math.min(6,Math.max(1,(t?n.firstHeading:void 0)??n.heading??3));return h({t:"headline",level:o,text:e.parts?v(e.parts,r.text):r.text},r.problem)}case"number":{let r=w(e.value,n),o=!r.ok||r.value===null||typeof r.value=="object"?g:Ke(r.value,e.as,e.currency,n.today,n.money),a=e.label?S(e.label,n):void 0;return h({t:"number",text:o,...a&&e.label?{label:v(e.label,a.text)}:{},...e.emphasis?{emphasis:e.emphasis}:{}},r.ok?a?.problem:r.problem)}case"list":return Xe(e,n)}}function je(e,n){let t=e.findIndex(r=>r.t==="headline");return e.map((r,o)=>({...ze(r,n,o===t),key:r.key}))}function Te(e,n){let t=n.trim().toLowerCase();return e.some(r=>{switch(r.t){case"title":case"headline":return r.text.trim()!=="";case"text":case"badge":return t!==""&&r.text.toLowerCase().includes(t);case"group":return Te(r.blocks,n);case"when":return r.shown&&Te(r.blocks,n);default:return!1}})}var Je=new Set(["every","some","sum","min","max","sort"]);function Bn(e,n){let t=new Set,r=new Set,o=i=>{if(i)switch(i.t){case"ident":i.name.startsWith("$")||t.add(i.name);return;case"list":i.items.forEach(o);return;case"member":return i.object.t==="ident"&&i.object.name==="$subject"&&t.add(i.name),o(i.object);case"unary":return o(i.operand);case"binary":return o(i.left),o(i.right);case"where":return o(i.set);case"call":i.args.forEach((s,f)=>{f===1&&Je.has(i.fn)||o(s)});return;default:return}},a=i=>{for(let s of i??[])o(s.expr)},d=(i,s)=>{i.forEach((f,y)=>{let u=s[y];if(u)switch(f.t){case"field":case"image":t.add(f.field);return;case"title":case"text":case"badge":case"headline":a(f.parts);return;case"number":o(f.value),a(f.label);return;case"progress":o(f.value),o(f.max);return;case"group":u.t==="group"&&d(f.blocks,u.blocks);return;case"when":u.t==="when"&&u.shown&&d(f.show,u.blocks);return;case"list":if(u.t==="list")for(let m of u.members)r.add(m.id);return;default:return}})};d(e,n);let l=n[0];return{fields:t,records:r,...e[0]?.t==="title"&&l?.t==="title"?{title:l.text}:{}}}function Xe(e,n){let t=Math.min(6,(n.heading??3)+1),r=w(e.source,n);if(!r.ok)return{t:"list",as:e.as,failed:!0,members:[],headingLevel:t,more:0,problem:r.problem};let o=r.value,a=o instanceof j?o.nodes:o!==null&&typeof o=="object"&&!Array.isArray(o)?[o]:[];e.choiceOrder&&n.schema&&(a=Ze(a,e.choiceOrder,n.schema));let d=a.length,l=a.slice(0,e.limit??L),i=l.slice(0,I),s=l.slice(I),f=(e.limit===void 0?d:l.length)-i.length,y=c=>e.group&&n.schema&&c.length>0?Ye(c,e.group,n.schema,n.graph):void 0,u=y(i),m=s.length>0?y(l):void 0;return{t:"list",as:e.as,failed:!1,members:i,...s.length>0?{rest:s}:{},...u?{groups:u}:{},...m?{everyGroup:m}:{},headingLevel:t,...i.length===0&&e.empty?{empty:e.empty}:{},more:f,total:d}}function D(e,n,t){let r=e.tryDefinition(n)?.fields?.shape,o=r&&Object.hasOwn(r,t)?_(r[t]):void 0;return o?.type==="enum"?o.options??[]:[]}var W=(e,n)=>Object.hasOwn(e,n)?e[n]:void 0;function Ze(e,n,t){let r=o=>{let a=D(t,o.kind,n).indexOf(String(W(o,n)));return a<0?Number.MAX_SAFE_INTEGER:a};return e.map((o,a)=>({node:o,i:a,rank:r(o)})).sort((o,a)=>o.rank-a.rank||o.i-a.i).map(o=>o.node)}function Ye(e,n,t,r){let o=e.some(i=>D(t,i.kind,n.by).length>0)?void 0:ye(n.by);if(o&&r)return qe(e,o,n.headings,t,r);let a=[];for(let i of e)for(let s of D(t,i.kind,n.by))a.includes(s)||a.push(s);let d=[];for(let i of a){let s=e.filter(y=>W(y,n.by)===i);if(s.length===0)continue;let f=t.tryDefinition(s[0].kind);d.push({value:i,heading:n.headings[i]??J(E(f,n.by,i)),members:s})}let l=e.filter(i=>!a.includes(String(W(i,n.by))));return l.length>0&&d.push({value:null,members:l}),d}function qe(e,n,t,r,o){let a=u=>n.way??(Object.hasOwn(r.tryDefinition(u.kind)?.edges??{},n.edge)?"out":"in"),d=new Map,l=[],i=x(r),s;for(let u of e){let m=a(u)==="out"?o.out(u.id,n.edge):o.in(u.id,n.edge);m.length===0&&l.push(u);for(let c of m){s??=c.kind;let R=d.get(c.id)??{node:c,members:[]};R.members.push(u),d.set(c.id,R)}}let f=[...d.values()].map(({node:u,members:m})=>({value:u.id,heading:t[u.id]??i(u),members:m})).sort((u,m)=>u.heading.localeCompare(m.heading,void 0,{numeric:!0}));!s&&e[0]&&a(e[0])==="out"&&(s=(r.tryDefinition(e[0].kind)?.edges??{})[n.edge]?.to?.[0]);let y=s&&s!=="*"?Y(r.tryDefinition(s),s):void 0;return l.length>0&&f.push({value:null,...y?{heading:`No ${y}`}:{},members:l}),f}function Ee(e){return e.t==="list"||e.t==="headline"||e.t==="number"||e.t==="image"&&e.as==="gallery"?!0:e.t==="group"?e.blocks.some(Ee):e.t==="when"?e.show.some(Ee):!1}function xe(e,n){let t=e.tryDefinition(n)?.fields?.shape??{},r={};for(let[o,a]of Object.entries(t)){let d=_(a);d&&(r[o]=d)}return r}var Pe=new WeakMap;function U(e){let n=Pe.get(e);return n||Pe.set(e,n=me(e)),n}function Qe(e,n,t,r={}){let o=U(e),a={},d={},l=i=>{if(i instanceof j)return i.nodes.map(s=>l(s));if(Array.isArray(i))return i.map(s=>l(s));if(i!==null&&typeof i=="object"){let s=i;return{id:s.id,kind:s.kind,label:Z(e.tryDefinition(s.kind),s)}}return i};for(let[i,s]of o.get(t?t.kind:te)?.computed??[])try{let f=[],y=B(s,{graph:n,subject:t,kinds:o,...r.today?{today:r.today}:{},...r.budget?{budget:r.budget}:{},...r.linked?{linked:r.linked}:{},onUnread:u=>f.push(u)});f.length>0&&(y===null||y instanceof j&&y.nodes.length===0)?d[i]=re(f[0]):a[i]=l(y)}catch(f){if(!(f instanceof oe))throw f;d[i]=f.sentence}return{values:a,refused:d}}function Mn(e,n,t){let{values:r}=Qe(e,n,t);if(Object.keys(r).length===0)return t;let o=a=>Array.isArray(a)?a.map(o):a!==null&&typeof a=="object"?a.label:a;return{...t,...Object.fromEntries(Object.entries(r).map(([a,d])=>[a,o(d)]))}}function Cn(e,n){return[...pe(e.tryDefinition(n)).keys()]}var en=500,nn=2e4,Fe=new WeakMap;function rn(e,n){let t=Fe.get(e);t||Fe.set(e,t=new Map);let r=t.get(n);return r||t.set(n,r=xe(e,n)),r}function $n(e,n,t,r={}){if(n&&typeof e.seenBy!="function")throw new TypeError("blockContextFor: a seat is read from a store (its `seenBy`); a bare { graph, schema } is read as it is handed, with no principal");let o=n?e.seenBy(n):e,a=n&&t?o.graph.getNode(t.id)??null:t,d=o.schema,l=a&&d.tryDefinition(a.kind),i=!a||(r.slot??"page")==="page",{money:s,firstHeading:f}=r;return{node:a,graph:o.graph,schema:d,kinds:U(d),fields:a?rn(d,a.kind):{},definition:l||void 0,today:r.today??o.today?.()??K(s?.timeZone),money:s,heading:r.heading??(i?2:3),firstHeading:f,budget:r.budget??(i?nn:en),...i?{}:{glance:!0}}}export{Re as a,dn as b,Ne as c,sn as d,ke as e,je as f,Te as g,Bn as h,Ee as i,U as j,Qe as k,Mn as l,Cn as m,$n as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk.DDSAFU3B.js";import"./chunk.7KX36ENH.js";import"./chunk.KBJ3UUER.js";import"./chunk.NI4OPHTL.js";import"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{g as columnActs,d as columnChoices,c as columnMoves,b as columnOf,e as columnReach,f as columnSteps,j as describePlace,k as placeText,h as resolveFor,i as shadowedPageSlots,a as statusColumns};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Ce,d as $e,i as U}from"./chunk.P26ATAAI.js";import{d as Te}from"./chunk.FIY4RUK5.js";import{$d as We,Kc as se,L as ke,Qb as ae,Wd as Re,Zd as De,ae as Me,cb as Se,da as M,fa as xe,ga as W,gb as G,ka as _,la as z,ma as Ae,oa as we,pa as Ne,ve as je,wd as ve,xd as Oe}from"./chunk.DHPXRDT5.js";function V(n,e){return n.display?.labels?.[e]??W(e)}function de(n){let e=U(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,i=n.tryDefinition(e);for(let[r,a]of Object.entries(i?.edges??{}))t.set(r,{key:r,label:a.description?M(a.description):W(r),about:"edge",far:a.to==="*"?[...n.kinds]:[...a.to]});for(let r of n.definitions)if(r.kind!==e)for(let[a,s]of Object.entries(r.edges??{}))t.has(a)||s.to!=="*"&&!s.to.includes(e)||t.set(a,{key:a,label:s.inverse?M(s.inverse):W(a),about:"edge",far:[r.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let i=t.retired.map(String);return e.some(r=>r.key===t.field&&i.includes(r.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let i=new Set(t.display?.hide??[]),r=t.fields.shape??{},a=[{key:"label",label:"Name",about:"label",type:"text"}],s=[],u=[];for(let[g,k]of Object.entries(r)){if(g==="id"||g==="kind"||g==="label"||i.has(g))continue;let A=en(k);if(A){s.push({key:g,label:V(t,g),about:"field",type:"choice",options:A});continue}let w=de(k);if(!w)continue;let N=V(t,g),O=w==="choice"?Le(k):w==="boolean"?["true","false"]:void 0,S={key:g,label:N,about:"field",type:w,...O?{options:O}:{}};a.push(S),s.push(S),(w==="boolean"||w==="choice")&&u.push(S),w==="date"&&u.push({...S,buckets:["day","week","month","year","decade"]})}for(let g of Je(n,e))a.push(g),s.push(g),u.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};s.push(l);let y=t.fieldRoles?.order,f=y&&(y in r||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:a,filters:s,groups:u,...f?{natural:f}:{}}}function On(n,e){let t=[];for(let r of e.filters){let a=r.about==="edge"&&r.far?.length===1?n.tryDefinition(r.far[0]):void 0;if(!(!a||a.kind===e.kind))for(let[s,u]of Object.entries(a.fields.shape??{}))de(u)!=="choice"||a.display?.hide?.includes(s)||t.push({key:`${r.key}.${s}`,label:`${r.label} \xB7 ${V(a,s)}`,about:"via",type:"choice",options:Le(u),far:[a.kind]})}if(t.length===0)return e;let i=e.filters.filter(r=>r.about!=="is");return{...e,filters:[...i,...t,...e.filters.filter(r=>r.about==="is")]}}function Rn(n,e){let t=n.tryDefinition(e.kind),i=Object.entries(t?.computed??{});if(!t||i.length===0)return e;let r=i.filter(([a])=>!e.sorts.some(s=>s.key===a)).map(([a,s])=>({key:a,label:(typeof s=="object"?s.label:void 0)??V(t,a),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...r]}}function Le(n){let e=U(n);return e.type==="choice"?e.options:[]}function en(n){let e=U(n);return e.type==="several"&&e.of.type==="choice"?e.of.options:void 0}var Ie=n=>n,Pe=n=>n;function nn(n,e,t){let i=new Map;for(let r of[...n.out(e,t),...n.in(e,t)])i.set(r.id,r);return[...i.values()]}function le(n,e,t){let i=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return _(i,Pe(e),n.today);case"past":return!_(i,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let r=i?.fields.shape??{};if(t.key in r){let l=Se(Ie(e),t.key,n.today??ke()),y=de(r[t.key]);if(y==="date"){let[f,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let k=l.slice(0,10);return f==="before"?k<g:f==="after"?k>g:k===g}if(y==="boolean")return String(l)===t.value;if(Array.isArray(l))return l.some(f=>String(f)===t.value);if(y==="number"){let f=t.value.lastIndexOf(":"),g=f>0?t.value.slice(0,f):"",k=Number(t.value.slice(f+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(k)?!1:g==="at-most"?l<=k:l>=k}return String(l)===t.value}let[a,s]=t.key.split("."),u=nn(n.graph,e.id,a);return s?u.some(l=>String(Ie(l)[s])===t.value):t.value==="*"?u.length>0:t.value==="none"?u.length===0:u.some(l=>l.id===t.value)}var tn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var X=new Map,rn=5e4;function $(n){let e=X.get(n);if(e===void 0){X.size>=rn&&X.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},X.set(n,e)}return e}var T=n=>[...$(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:i}=$(n),r=e.join("");if(t.length===0)return;if(t===r)return"exact";if(e.every(s=>i.some(u=>u.startsWith(s))))return t.startsWith(r)?"prefix":e.every(s=>i.includes(s))?"word":"part"}function q(n,e,t=48){let i=n.replace(/\s+/g," ").trim();if(i.length<=t)return i;let r=e[0],a=i.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),s=r?a.search(new RegExp(`(^|[^\\p{L}\\p{N}])${on(r)}`,"u")):-1,u=s<0?0:s+(a[s]&&/[\p{L}\p{N}]/u.test(a[s])?0:1),l=Math.max(0,u-Math.floor(t/3));if(l>0){let f=i.lastIndexOf(" ",l);l=f<0?0:f+1}let y=Math.min(i.length,l+t);if(y<i.length){let f=i.indexOf(" ",y);y=f<0||f-y>16?y:f}return`${l>0?"\u2026":""}${i.slice(l,y).trim()}${y<i.length?"\u2026":""}`}var on=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),an=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function sn(n){let e=[],t=[];for(let i of n.trim().split(/\s+/).filter(Boolean)){let r=an.exec(i);r?t.push({key:r[1],value:r[2]}):e.push(i)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function Q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let i=dn(n,e);return Ee.set(e,{definition:n,texts:i}),i}function dn(n,e){let t=z(n,e),i=[{field:"label",reading:"Name",text:t}];for(let r of $e(e,n,{limit:Number.POSITIVE_INFINITY}))r.key==="label"||r.value===t||typeof e[r.key]!="boolean"&&i.push({field:r.key,reading:r.label,text:r.markdown?Te(r.value):r.value});return i}var I={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let i=[],r=Array.from({length:e.length+1},(a,s)=>s);for(let a=1;a<=n.length;a++){let s=[a],u=a;for(let l=1;l<=e.length;l++){let y=Math.min(r[l]+1,s[l-1]+1,r[l-1]+(n[a-1]===e[l-1]?0:1));a>1&&l>1&&n[a-1]===e[l-2]&&n[a-2]===e[l-1]&&(y=Math.min(y,i[l-2]+1)),s[l]=y,y<u&&(u=y)}if(u>t)return t+1;i=r,r=s}return r[e.length]}var Y=new Map;function ln(n,e){let t=Y.get(n);t||(Y.size>=64&&Y.clear(),Y.set(n,t=new Map));let i=t.get(e);return i===void 0&&(i=cn(n,e)??null,t.set(e,i)),i??void 0}function cn(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let i=n.length<4?0:n.length<=7?1:2;if(i!==0){if(He(n,e,i)<=i)return"spelling";if(n.length>=5){for(let r=n.length-i;r<=n.length+i;r++)if(r<e.length&&He(n,e.slice(0,r),i)<=i)return"spelling"}}}function fn(n,e){let t=e.length>1?e.filter(r=>!Ge.has(r)):e;if(t.length===0)return;let i;for(let r of t){let a;for(let s of n){for(let u of $(s.text).tokens){if(u.startsWith(r)){a={text:s,matched:u};break}let l=a?void 0:ln(r,u);l&&(a={text:s,matched:u,by:l})}if(a&&!a.by)break}if(!a)return;a.by&&!i&&(i={text:a.text,asked:r,matched:a.matched,by:a.by})}if(i)return{field:i.text.field,reading:i.text.reading,fragment:q(i.text.text,[i.matched]),strength:"near",asked:i.asked,matched:i.matched,by:i.by}}var un=80;function gn(n,e,t){let i=T(e).filter(s=>!Ge.has(s)).join(" ")||e,r=t===void 0?[]:T(t),a=r.length>0&&n.find(s=>r.every(u=>$(s.text).tokens.some(l=>l.startsWith(u))))||n[0];return{field:a.field,reading:a.reading,fragment:q(a.text,r),strength:"near",asked:i,matched:(t??a.text).slice(0,un),by:"meaning"}}function _e(n,e,t,i){let r=T(t);if(r.length===0)return;if(i){let A=Q(n,e),w=i.includes("label")||i.some(v=>typeof e[v]=="string"&&e[v]===A[0].text),N=A.filter((v,D)=>D===0?w:i.includes(v.field)),O=v=>D=>$(D.text).tokens.some(P=>P.startsWith(v));if(!r.every(v=>N.some(O(v))))return;let S=N.find(O(r[0]));return{field:S.field,reading:S.reading,fragment:q(S.text,r),strength:S.field==="label"?j(S.text,r)??"field":"field"}}let a=Q(n,e),[s,...u]=a,l=j(s.text,r);if(l)return{field:"label",reading:s.reading,fragment:q(s.text,r),strength:l};let y=A=>w=>$(w.text).tokens.some(N=>N.startsWith(A));if(!r.every(A=>a.some(y(A))))return;let f=T(s.text),g=r.find(A=>!f.some(w=>w.startsWith(A)))??r[0],k=u.find(y(g));return{field:k.field,reading:k.reading,fragment:q(k.text,[g]),strength:"field"}}var yn=512,hn=64;function pn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-yn),i=n[n.length-1].seq;for(let r of t){let a=Math.pow(.5,(i-r.seq)/hn);for(let s of r.writes)e.set(s,(e.get(s)??0)+a)}return e}var ue=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function mn(n,e,t){let i=n.tryDefinition(e),r=[{field:"plural",text:ue(i,e)},{field:"kind",text:W(e)},...i?.noun?[{field:"noun",text:i.noun}]:[],...(i?.aliases??[]).map(s=>({field:"alias",text:s}))],a;for(let s of r){let u=j(s.text,t);u&&(!a||I[u]<I[a.strength])&&(a={strength:u,...s})}return a}var bn,kn=(n,e)=>(bn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||kn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function En(n,e,t={}){let i=n.schema,r=sn(e),a=T(r.words),s=t.principal??{kind:"human"},u=n.kindsKeptFrom(s),l=n.modules.disabledKinds,y=r.conditions.filter(o=>o.key==="kind").map(o=>o.value),f=r.conditions.filter(o=>o.key==="is").map(o=>o.value),g=f.includes("any")||f.includes("past"),k=f.includes("past")&&!f.includes("any")&&!f.includes("current"),A=f.includes("archived")?!0:t.archived??"all",w=(o,d)=>{let c=ce(d),h=i.tryDefinition(o);return ce(o)===c||ce(ue(h,o))===c},N=i.kinds.filter(o=>!u.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(y.length===0||y.some(d=>w(o,d)))),S=r.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:N.filter(d=>Be(i,d).filters.some(c=>c.key===o.key))})),v=S.filter(o=>o.key!=="is"),D=f.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),P={kinds:N,past:g},Qe={hits:[],words:r.words,conditions:S,searched:P,byKind:{},total:0,matched:[]};if(a.length===0&&v.length===0&&D.length===0)return Qe;let J=t.today,F=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??pn(n.log.all()),Z=new Set;for(let o of t.from??[]){Z.add(o);for(let d of n.graph.neighbors(o))Z.add(d.id)}let ge=ve(n,s)?Oe(n,s):void 0,ee=ae.keptFrom?.(n,s)&&n.seenBy(s).graph,ne=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:i,graph:n.graph,flagged:F,...J?{today:J}:{}},R=[],B={},L=[],E=[],K=(o,d,c,h,p,m)=>{let x=z(c,o);B[d]=(B[d]??0)+1,R.push({hit:{about:"node",id:o.id,kind:d,label:x,why:p,current:h,flagged:F.has(o.id),address:ne(`${fe(c,d)}/${encodeURIComponent(o.id)}`),...m===void 0?{}:{near:!0},...G(o)?{archived:!0}:{}},...m===void 0?{}:{nearly:2-m},tier:I[p.strength],inKind:d===t.inKind?0:1,near:Z.has(o.id)?0:1,past:h?0:1,archived:G(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:F.has(o.id)?0:1,name:x,id:o.id})};for(let o of N){let d=i.tryDefinition(o),c=S.filter(p=>p.key!=="is"&&p.admittedBy.includes(o));if(a.length===0&&c.length===0&&D.length===0)continue;let h=Fe(d,c);for(let p of n.graph.nodesOfKind(o,{archived:A})){if(ge&&!ge(p.id))continue;let m=ee?ee.getNode(p.id):p;if(!m)continue;let x=_(d,m,J);if(!g&&!h&&!x){if(a.length>0&&f.length===0&&c.every(b=>le(ye,m,b))){let b=_e(d,m,r.words);b&&E.push({node:m,kind:o,definition:d,why:b})}continue}if(k&&x||!c.every(b=>le(ye,m,b))||f.includes("flagged")&&!F.has(m.id)||f.includes("clear")&&F.has(m.id))continue;let C=a.length>0?_e(d,m,r.words):c[0]?{field:c[0].key,reading:W(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${D[0]}`,strength:"field"};C?K(m,o,d,x,C):a.length>0&&L.push({node:m,kind:o,definition:d,current:x})}}let te=o=>o.strength!=="field",re=!1;if(E.length>0&&R.length===0){re=!0;for(let o of E)K(o.node,o.kind,o.definition,!1,o.why)}else if(E.some(o=>te(o.why))&&!R.some(o=>te(o.hit.why))){re=!0;for(let o of E)te(o.why)&&K(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&a.length>0&&R.length<tn&&L.length>0,ie=new Set;if(he)for(let o of L){let d=fn(Q(o.definition,o.node),a);d&&(ie.add(o.node.id),K(o.node,o.kind,o.definition,o.current,d,d.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:I[o],oe=(o,d,c,h)=>({hit:o,tier:Ve(d),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(a.length>0){for(let d of N){let c=mn(i,d,a);if(!c)continue;let h=Ne(i,d),p={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};R.push(oe({about:"kind",kind:d,label:h,why:p,count:B[d]??0,address:ne(fe(i.tryDefinition(d),d))},c.strength,h,`kind:${d}`))}let o=t.places??[];for(let d of Re(o.filter(c=>N.includes(c.kind)))){if(d.across&&u.has(d.across))continue;let c=j(d.title,a);if(!c)continue;let h={field:"title",reading:"Title",fragment:d.title,strength:c},p=Me(d,o)?fe(i.tryDefinition(d.kind),d.kind).slice(1):void 0,m=ne(We(d.as,p));R.push(oe({about:"place",kind:d.kind,title:d.title,as:d.as,why:h,address:m},c,d.title,`place:${d.kind}:${d.as}`))}for(let d of n.allInvariants()){let c=d.scope==="graph"?void 0:d.scope.kind;if(c&&!N.includes(c))continue;let h=d.label??W(d.name),p=j(h,a),m=p?void 0:j(W(d.name),a),x=p??m;if(!x)continue;let C={field:p?"label":"name",reading:p?"Rule":"Name",fragment:p?h:d.name,strength:x};R.push(oe({about:"rule",name:d.name,label:h,...c?{kind:c}:{},why:C},x,h,`rule:${d.name}`))}}let pe=()=>{R.sort(qe);let o=t.limit??50,d=R.slice(0,o).map(b=>b.hit),c=d.flatMap(b=>b.about==="node"?[(ee||n.graph).getNode(b.id)]:[]).filter(Boolean),h=Ce(c,b=>i.tryDefinition(b)),p=d.map(b=>b.about==="node"&&h.has(b.id)?{...b,apart:h.get(b.id)}:b),m=Object.values(B).reduce((b,Ye)=>b+Ye,0),x=R.flatMap(b=>b.hit.about==="node"?[b.hit.id]:[]),C=t.subject&&N.includes(String(n.graph.getNode(t.subject)?.kind))?xn(n,t.subject,r.words,{principal:s}):[];return{hits:[...p,...C],words:r.words,conditions:S,searched:re?{...P,past:!0}:P,byKind:{...B},total:m,matched:x}},H=pe(),me=t.rank;if(!he||!me)return H;let be=L.filter(o=>!ie.has(o.node.id)).map(({node:o,kind:d,definition:c})=>({id:o.id,kind:d,label:z(c,o),texts:Q(c,o)}));if(be.length===0)return H;let Xe=(async()=>{let o;try{o=await me(r.words,be)}catch{return H}let d=new Map(L.filter(h=>!ie.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:p,matched:m}of Array.isArray(o)?o:[]){let x=d.get(h);!x||!(p>0)||(d.delete(h),c=!0,K(x.node,x.kind,x.definition,x.current,gn(Q(x.definition,x.node),r.words,typeof m=="string"?m:void 0),Math.min(1,p)))}return c?pe():H})();return{...H,later:Xe}}function xn(n,e,t,i={}){let r=i.principal??{kind:"human"},a=(ae.keptFrom?.(n,r)?n.seenBy(r):n).graph.getNode(e);if(!a)return[];if(n.kindsKeptFrom(r).has(a.kind))return[];let s=T(t),u=z(n.schema.tryDefinition(a.kind),a),l=[];for(let f of n.allMutations()){let g=f.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(a.kind))continue;let k=f.derived?.act;if((k==="archive"||k==="merge")&&G(a)||k==="unarchive"&&!G(a)||k==="leave-alone"&&se(a)||k==="allow-tidying"&&!se(a)||!n.permits({name:f.name,args:{[g.arg]:a.id}},r).ok)continue;let A=Ae(f),w=T(A),N=s.filter(v=>w.some(D=>D.startsWith(v))),O=N.length>0?j(A,N):void 0,S=O?{field:"title",reading:"Act",fragment:A,strength:O}:{field:"subject",reading:"On",fragment:u,strength:"field"};l.push({hit:{about:"act",name:f.name,title:A,subject:a.id,why:S,destructive:f.destructive===!0},tier:O?I[O]:I.field+1,inKind:0,near:0,past:f.destructive?1:0,touched:0,flagged:f.pinned?0:1,name:A,id:`act:${f.name}`})}l.sort(qe);let y=l.map(f=>f.hit);return i.limit===void 0?y:y.slice(0,i.limit)}function Kn(n,e){let t=e.kinds.map((a,s)=>{let u=ue(n.tryDefinition(a),a);return s===0?u:u.toLowerCase()}),i=xe(t)||"Nothing";return e.kinds.some(a=>n.tryDefinition(a)?.lifecycle)?e.past?`${M(i)}, past ones included.`:`${M(i)}, current ones; add is:any for past ones.`:`${M(i)}.`}export{V as a,de as b,Je as c,Fe as d,Be as e,On as f,Rn as g,Le as h,Ie as i,Pe as j,nn as k,le as l,ze as m,ce as n,sn as o,_e as p,pn as q,En as r,xn as s,Kn as t};
|
|
1
|
+
import{b as Ce,d as $e,i as U}from"./chunk.VVIQSFM4.js";import{d as Te}from"./chunk.TQ3MNB6K.js";import{Be as je,Cd as ve,Dd as Oe,L as ke,Pb as ae,_b as se,ae as Re,da as M,db as Se,de as De,fa as xe,fe as We,ge as Me,ha as W,la as _,ma as z,na as Ae,pa as we,qa as Ne,rb as G}from"./chunk.6L6RUOSF.js";function V(n,e){return n.display?.labels?.[e]??W(e)}function de(n){let e=U(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Je(n,e){let t=new Map,i=n.tryDefinition(e);for(let[r,a]of Object.entries(i?.edges??{}))t.set(r,{key:r,label:a.description?M(a.description):W(r),about:"edge",far:a.to==="*"?[...n.kinds]:[...a.to]});for(let r of n.definitions)if(r.kind!==e)for(let[a,s]of Object.entries(r.edges??{}))t.has(a)||s.to!=="*"&&!s.to.includes(e)||t.set(a,{key:a,label:s.inverse?M(s.inverse):W(a),about:"edge",far:[r.kind]});return[...t.values()]}var Ze=["current","past","any","flagged","clear"];function Fe(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let i=t.retired.map(String);return e.some(r=>r.key===t.field&&i.includes(r.value))}function Be(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let i=new Set(t.display?.hide??[]),r=t.fields.shape??{},a=[{key:"label",label:"Name",about:"label",type:"text"}],s=[],u=[];for(let[g,k]of Object.entries(r)){if(g==="id"||g==="kind"||g==="label"||i.has(g))continue;let A=en(k);if(A){s.push({key:g,label:V(t,g),about:"field",type:"choice",options:A});continue}let w=de(k);if(!w)continue;let N=V(t,g),O=w==="choice"?Le(k):w==="boolean"?["true","false"]:void 0,S={key:g,label:N,about:"field",type:w,...O?{options:O}:{}};a.push(S),s.push(S),(w==="boolean"||w==="choice")&&u.push(S),w==="date"&&u.push({...S,buckets:["day","week","month","year","decade"]})}for(let g of Je(n,e))a.push(g),s.push(g),u.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Ze]:["flagged","clear"]};s.push(l);let y=t.fieldRoles?.order,f=y&&(y in r||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:a,filters:s,groups:u,...f?{natural:f}:{}}}function On(n,e){let t=[];for(let r of e.filters){let a=r.about==="edge"&&r.far?.length===1?n.tryDefinition(r.far[0]):void 0;if(!(!a||a.kind===e.kind))for(let[s,u]of Object.entries(a.fields.shape??{}))de(u)!=="choice"||a.display?.hide?.includes(s)||t.push({key:`${r.key}.${s}`,label:`${r.label} \xB7 ${V(a,s)}`,about:"via",type:"choice",options:Le(u),far:[a.kind]})}if(t.length===0)return e;let i=e.filters.filter(r=>r.about!=="is");return{...e,filters:[...i,...t,...e.filters.filter(r=>r.about==="is")]}}function Rn(n,e){let t=n.tryDefinition(e.kind),i=Object.entries(t?.computed??{});if(!t||i.length===0)return e;let r=i.filter(([a])=>!e.sorts.some(s=>s.key===a)).map(([a,s])=>({key:a,label:(typeof s=="object"?s.label:void 0)??V(t,a),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...r]}}function Le(n){let e=U(n);return e.type==="choice"?e.options:[]}function en(n){let e=U(n);return e.type==="several"&&e.of.type==="choice"?e.of.options:void 0}var Ie=n=>n,Pe=n=>n;function nn(n,e,t){let i=new Map;for(let r of[...n.out(e,t),...n.in(e,t)])i.set(r.id,r);return[...i.values()]}function le(n,e,t){let i=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return _(i,Pe(e),n.today);case"past":return!_(i,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let r=i?.fields.shape??{};if(t.key in r){let l=Se(Ie(e),t.key,n.today??ke()),y=de(r[t.key]);if(y==="date"){let[f,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let k=l.slice(0,10);return f==="before"?k<g:f==="after"?k>g:k===g}if(y==="boolean")return String(l)===t.value;if(Array.isArray(l))return l.some(f=>String(f)===t.value);if(y==="number"){let f=t.value.lastIndexOf(":"),g=f>0?t.value.slice(0,f):"",k=Number(t.value.slice(f+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(k)?!1:g==="at-most"?l<=k:l>=k}return String(l)===t.value}let[a,s]=t.key.split("."),u=nn(n.graph,e.id,a);return s?u.some(l=>String(Ie(l)[s])===t.value):t.value==="*"?u.length>0:t.value==="none"?u.length===0:u.some(l=>l.id===t.value)}var tn=5;function ze(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function ce(n){return ze(n).replace(/ /g,"")}var X=new Map,rn=5e4;function $(n){let e=X.get(n);if(e===void 0){X.size>=rn&&X.clear();let t=ze(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},X.set(n,e)}return e}var T=n=>[...$(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:i}=$(n),r=e.join("");if(t.length===0)return;if(t===r)return"exact";if(e.every(s=>i.some(u=>u.startsWith(s))))return t.startsWith(r)?"prefix":e.every(s=>i.includes(s))?"word":"part"}function q(n,e,t=48){let i=n.replace(/\s+/g," ").trim();if(i.length<=t)return i;let r=e[0],a=i.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),s=r?a.search(new RegExp(`(^|[^\\p{L}\\p{N}])${on(r)}`,"u")):-1,u=s<0?0:s+(a[s]&&/[\p{L}\p{N}]/u.test(a[s])?0:1),l=Math.max(0,u-Math.floor(t/3));if(l>0){let f=i.lastIndexOf(" ",l);l=f<0?0:f+1}let y=Math.min(i.length,l+t);if(y<i.length){let f=i.indexOf(" ",y);y=f<0||f-y>16?y:f}return`${l>0?"\u2026":""}${i.slice(l,y).trim()}${y<i.length?"\u2026":""}`}var on=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),an=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function sn(n){let e=[],t=[];for(let i of n.trim().split(/\s+/).filter(Boolean)){let r=an.exec(i);r?t.push({key:r[1],value:r[2]}):e.push(i)}return{words:e.join(" "),conditions:t}}var Ee=new WeakMap;function Q(n,e){let t=Ee.get(e);if(t&&t.definition===n)return t.texts;let i=dn(n,e);return Ee.set(e,{definition:n,texts:i}),i}function dn(n,e){let t=z(n,e),i=[{field:"label",reading:"Name",text:t}];for(let r of $e(e,n,{limit:Number.POSITIVE_INFINITY}))r.key==="label"||r.value===t||typeof e[r.key]!="boolean"&&i.push({field:r.key,reading:r.label,text:r.markdown?Te(r.value):r.value});return i}var I={exact:0,prefix:1,word:2,part:3,field:4,near:5},Ge=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ke(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function He(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let i=[],r=Array.from({length:e.length+1},(a,s)=>s);for(let a=1;a<=n.length;a++){let s=[a],u=a;for(let l=1;l<=e.length;l++){let y=Math.min(r[l]+1,s[l-1]+1,r[l-1]+(n[a-1]===e[l-1]?0:1));a>1&&l>1&&n[a-1]===e[l-2]&&n[a-2]===e[l-1]&&(y=Math.min(y,i[l-2]+1)),s[l]=y,y<u&&(u=y)}if(u>t)return t+1;i=r,r=s}return r[e.length]}var Y=new Map;function ln(n,e){let t=Y.get(n);t||(Y.size>=64&&Y.clear(),Y.set(n,t=new Map));let i=t.get(e);return i===void 0&&(i=cn(n,e)??null,t.set(e,i)),i??void 0}function cn(n,e){if(/\d/.test(n))return;let t=Ke(n);if(t.length>=3&&(Ke(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let i=n.length<4?0:n.length<=7?1:2;if(i!==0){if(He(n,e,i)<=i)return"spelling";if(n.length>=5){for(let r=n.length-i;r<=n.length+i;r++)if(r<e.length&&He(n,e.slice(0,r),i)<=i)return"spelling"}}}function fn(n,e){let t=e.length>1?e.filter(r=>!Ge.has(r)):e;if(t.length===0)return;let i;for(let r of t){let a;for(let s of n){for(let u of $(s.text).tokens){if(u.startsWith(r)){a={text:s,matched:u};break}let l=a?void 0:ln(r,u);l&&(a={text:s,matched:u,by:l})}if(a&&!a.by)break}if(!a)return;a.by&&!i&&(i={text:a.text,asked:r,matched:a.matched,by:a.by})}if(i)return{field:i.text.field,reading:i.text.reading,fragment:q(i.text.text,[i.matched]),strength:"near",asked:i.asked,matched:i.matched,by:i.by}}var un=80;function gn(n,e,t){let i=T(e).filter(s=>!Ge.has(s)).join(" ")||e,r=t===void 0?[]:T(t),a=r.length>0&&n.find(s=>r.every(u=>$(s.text).tokens.some(l=>l.startsWith(u))))||n[0];return{field:a.field,reading:a.reading,fragment:q(a.text,r),strength:"near",asked:i,matched:(t??a.text).slice(0,un),by:"meaning"}}function _e(n,e,t,i){let r=T(t);if(r.length===0)return;if(i){let A=Q(n,e),w=i.includes("label")||i.some(v=>typeof e[v]=="string"&&e[v]===A[0].text),N=A.filter((v,D)=>D===0?w:i.includes(v.field)),O=v=>D=>$(D.text).tokens.some(P=>P.startsWith(v));if(!r.every(v=>N.some(O(v))))return;let S=N.find(O(r[0]));return{field:S.field,reading:S.reading,fragment:q(S.text,r),strength:S.field==="label"?j(S.text,r)??"field":"field"}}let a=Q(n,e),[s,...u]=a,l=j(s.text,r);if(l)return{field:"label",reading:s.reading,fragment:q(s.text,r),strength:l};let y=A=>w=>$(w.text).tokens.some(N=>N.startsWith(A));if(!r.every(A=>a.some(y(A))))return;let f=T(s.text),g=r.find(A=>!f.some(w=>w.startsWith(A)))??r[0],k=u.find(y(g));return{field:k.field,reading:k.reading,fragment:q(k.text,[g]),strength:"field"}}var yn=512,hn=64;function pn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-yn),i=n[n.length-1].seq;for(let r of t){let a=Math.pow(.5,(i-r.seq)/hn);for(let s of r.writes)e.set(s,(e.get(s)??0)+a)}return e}var ue=(n,e)=>we({tryDefinition:()=>n},e),fe=(n,e)=>De({tryDefinition:()=>n},e);function mn(n,e,t){let i=n.tryDefinition(e),r=[{field:"plural",text:ue(i,e)},{field:"kind",text:W(e)},...i?.noun?[{field:"noun",text:i.noun}]:[],...(i?.aliases??[]).map(s=>({field:"alias",text:s}))],a;for(let s of r){let u=j(s.text,t);u&&(!a||I[u]<I[a.strength])&&(a={strength:u,...s})}return a}var bn,kn=(n,e)=>(bn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),qe=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||kn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function En(n,e,t={}){let i=n.schema,r=sn(e),a=T(r.words),s=t.principal??{kind:"human"},u=n.kindsKeptFrom(s),l=n.modules.disabledKinds,y=r.conditions.filter(o=>o.key==="kind").map(o=>o.value),f=r.conditions.filter(o=>o.key==="is").map(o=>o.value),g=f.includes("any")||f.includes("past"),k=f.includes("past")&&!f.includes("any")&&!f.includes("current"),A=f.includes("archived")?!0:t.archived??"all",w=(o,d)=>{let c=ce(d),h=i.tryDefinition(o);return ce(o)===c||ce(ue(h,o))===c},N=i.kinds.filter(o=>!u.has(o)&&!l.has(o)&&(t.kinds===void 0||t.kinds.includes(o))&&(y.length===0||y.some(d=>w(o,d)))),S=r.conditions.filter(o=>o.key!=="kind").map(o=>({...o,admittedBy:N.filter(d=>Be(i,d).filters.some(c=>c.key===o.key))})),v=S.filter(o=>o.key!=="is"),D=f.filter(o=>o==="flagged"||o==="clear"||o==="past"||o==="archived"),P={kinds:N,past:g},Qe={hits:[],words:r.words,conditions:S,searched:P,byKind:{},total:0,matched:[]};if(a.length===0&&v.length===0&&D.length===0)return Qe;let J=t.today,F=t.flagged??new Set(n.violations().flatMap(o=>o.nodeIds)),Ue=t.touched??pn(n.log.all()),Z=new Set;for(let o of t.from??[]){Z.add(o);for(let d of n.graph.neighbors(o))Z.add(d.id)}let ge=ve(n,s)?Oe(n,s):void 0,ee=se.keptFrom?.(n,s)&&n.seenBy(s).graph,ne=o=>je(o,t.basePath===void 0?{}:{basePath:t.basePath}),ye={schema:i,graph:n.graph,flagged:F,...J?{today:J}:{}},R=[],B={},L=[],E=[],K=(o,d,c,h,p,m)=>{let x=z(c,o);B[d]=(B[d]??0)+1,R.push({hit:{about:"node",id:o.id,kind:d,label:x,why:p,current:h,flagged:F.has(o.id),address:ne(`${fe(c,d)}/${encodeURIComponent(o.id)}`),...m===void 0?{}:{near:!0},...G(o)?{archived:!0}:{}},...m===void 0?{}:{nearly:2-m},tier:I[p.strength],inKind:d===t.inKind?0:1,near:Z.has(o.id)?0:1,past:h?0:1,archived:G(o)?1:0,touched:-(Ue.get(o.id)??0),flagged:F.has(o.id)?0:1,name:x,id:o.id})};for(let o of N){let d=i.tryDefinition(o),c=S.filter(p=>p.key!=="is"&&p.admittedBy.includes(o));if(a.length===0&&c.length===0&&D.length===0)continue;let h=Fe(d,c);for(let p of n.graph.nodesOfKind(o,{archived:A})){if(ge&&!ge(p.id))continue;let m=ee?ee.getNode(p.id):p;if(!m)continue;let x=_(d,m,J);if(!g&&!h&&!x){if(a.length>0&&f.length===0&&c.every(b=>le(ye,m,b))){let b=_e(d,m,r.words);b&&E.push({node:m,kind:o,definition:d,why:b})}continue}if(k&&x||!c.every(b=>le(ye,m,b))||f.includes("flagged")&&!F.has(m.id)||f.includes("clear")&&F.has(m.id))continue;let C=a.length>0?_e(d,m,r.words):c[0]?{field:c[0].key,reading:W(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${D[0]}`,strength:"field"};C?K(m,o,d,x,C):a.length>0&&L.push({node:m,kind:o,definition:d,current:x})}}let te=o=>o.strength!=="field",re=!1;if(E.length>0&&R.length===0){re=!0;for(let o of E)K(o.node,o.kind,o.definition,!1,o.why)}else if(E.some(o=>te(o.why))&&!R.some(o=>te(o.hit.why))){re=!0;for(let o of E)te(o.why)&&K(o.node,o.kind,o.definition,!1,o.why)}let he=t.near!==!1&&a.length>0&&R.length<tn&&L.length>0,ie=new Set;if(he)for(let o of L){let d=fn(Q(o.definition,o.node),a);d&&(ie.add(o.node.id),K(o.node,o.kind,o.definition,o.current,d,d.by==="stem"?.9:.8))}let Ve=o=>o==="exact"||o==="prefix"?-1:I[o],oe=(o,d,c,h)=>({hit:o,tier:Ve(d),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(a.length>0){for(let d of N){let c=mn(i,d,a);if(!c)continue;let h=Ne(i,d),p={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};R.push(oe({about:"kind",kind:d,label:h,why:p,count:B[d]??0,address:ne(fe(i.tryDefinition(d),d))},c.strength,h,`kind:${d}`))}let o=t.places??[];for(let d of Re(o.filter(c=>N.includes(c.kind)))){if(d.across&&u.has(d.across))continue;let c=j(d.title,a);if(!c)continue;let h={field:"title",reading:"Title",fragment:d.title,strength:c},p=Me(d,o)?fe(i.tryDefinition(d.kind),d.kind).slice(1):void 0,m=ne(We(d.as,p));R.push(oe({about:"place",kind:d.kind,title:d.title,as:d.as,why:h,address:m},c,d.title,`place:${d.kind}:${d.as}`))}for(let d of n.allInvariants()){let c=d.scope==="graph"?void 0:d.scope.kind;if(c&&!N.includes(c))continue;let h=d.label??W(d.name),p=j(h,a),m=p?void 0:j(W(d.name),a),x=p??m;if(!x)continue;let C={field:p?"label":"name",reading:p?"Rule":"Name",fragment:p?h:d.name,strength:x};R.push(oe({about:"rule",name:d.name,label:h,...c?{kind:c}:{},why:C},x,h,`rule:${d.name}`))}}let pe=()=>{R.sort(qe);let o=t.limit??50,d=R.slice(0,o).map(b=>b.hit),c=d.flatMap(b=>b.about==="node"?[(ee||n.graph).getNode(b.id)]:[]).filter(Boolean),h=Ce(c,b=>i.tryDefinition(b)),p=d.map(b=>b.about==="node"&&h.has(b.id)?{...b,apart:h.get(b.id)}:b),m=Object.values(B).reduce((b,Ye)=>b+Ye,0),x=R.flatMap(b=>b.hit.about==="node"?[b.hit.id]:[]),C=t.subject&&N.includes(String(n.graph.getNode(t.subject)?.kind))?xn(n,t.subject,r.words,{principal:s}):[];return{hits:[...p,...C],words:r.words,conditions:S,searched:re?{...P,past:!0}:P,byKind:{...B},total:m,matched:x}},H=pe(),me=t.rank;if(!he||!me)return H;let be=L.filter(o=>!ie.has(o.node.id)).map(({node:o,kind:d,definition:c})=>({id:o.id,kind:d,label:z(c,o),texts:Q(c,o)}));if(be.length===0)return H;let Xe=(async()=>{let o;try{o=await me(r.words,be)}catch{return H}let d=new Map(L.filter(h=>!ie.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:p,matched:m}of Array.isArray(o)?o:[]){let x=d.get(h);!x||!(p>0)||(d.delete(h),c=!0,K(x.node,x.kind,x.definition,x.current,gn(Q(x.definition,x.node),r.words,typeof m=="string"?m:void 0),Math.min(1,p)))}return c?pe():H})();return{...H,later:Xe}}function xn(n,e,t,i={}){let r=i.principal??{kind:"human"},a=(se.keptFrom?.(n,r)?n.seenBy(r):n).graph.getNode(e);if(!a)return[];if(n.kindsKeptFrom(r).has(a.kind))return[];let s=T(t),u=z(n.schema.tryDefinition(a.kind),a),l=[];for(let f of n.allMutations()){let g=f.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(a.kind))continue;let k=f.derived?.act;if((k==="archive"||k==="merge")&&G(a)||k==="unarchive"&&!G(a)||k==="leave-alone"&&ae(a)||k==="allow-tidying"&&!ae(a)||!n.permits({name:f.name,args:{[g.arg]:a.id}},r).ok)continue;let A=Ae(f),w=T(A),N=s.filter(v=>w.some(D=>D.startsWith(v))),O=N.length>0?j(A,N):void 0,S=O?{field:"title",reading:"Act",fragment:A,strength:O}:{field:"subject",reading:"On",fragment:u,strength:"field"};l.push({hit:{about:"act",name:f.name,title:A,subject:a.id,why:S,destructive:f.destructive===!0},tier:O?I[O]:I.field+1,inKind:0,near:0,past:f.destructive?1:0,touched:0,flagged:f.pinned?0:1,name:A,id:`act:${f.name}`})}l.sort(qe);let y=l.map(f=>f.hit);return i.limit===void 0?y:y.slice(0,i.limit)}function Kn(n,e){let t=e.kinds.map((a,s)=>{let u=ue(n.tryDefinition(a),a);return s===0?u:u.toLowerCase()}),i=xe(t)||"Nothing";return e.kinds.some(a=>n.tryDefinition(a)?.lifecycle)?e.past?`${M(i)}, past ones included.`:`${M(i)}, current ones; add is:any for past ones.`:`${M(i)}.`}export{V as a,de as b,Je as c,Fe as d,Be as e,On as f,Rn as g,Le as h,Ie as i,Pe as j,nn as k,le as l,ze as m,ce as n,sn as o,_e as p,pn as q,En as r,xn as s,Kn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y,b as h}from"./chunk.
|
|
1
|
+
import{a as y,b as h}from"./chunk.VL3YDD7D.js";import"./chunk.OPMGQS5J.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import{Hd as b}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as T}from"./chunk.
|
|
1
|
+
import{G as T}from"./chunk.JCKIJSW7.js";import{b as g}from"./chunk.AJZBJBMO.js";var s=g(T(),1),m="data-graview-roving",E="data-graview-roving-item",L={ArrowDown:{column:1,both:1},ArrowUp:{column:-1,both:-1},ArrowRight:{column:0,both:1},ArrowLeft:{column:0,both:-1}},w=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&!["button","checkbox","radio","submit"].includes(e.type));function p(e){return[...e.querySelectorAll(`[${E}]`)].filter(c=>c.closest(`[${m}]`)===e&&!c.disabled&&c.getAttribute("aria-hidden")!=="true")}var M=e=>(e.textContent?.trim()||e.getAttribute("aria-label")||"").toLowerCase();function H({flow:e="column",letters:c=!1}={}){let a=(0,s.useRef)(null),i=(0,s.useRef)(null),f=(0,s.useCallback)(()=>{let t=a.current;if(!t)return;let n=p(t);if(n.length===0)return;let o=typeof document>"u"?null:document.activeElement,u=n.find(r=>r===o)??(i.current&&n.includes(i.current)?i.current:n[0]);for(let r of n){let l=r===u?"0":"-1";r.getAttribute("tabindex")!==l&&r.setAttribute("tabindex",l)}},[]);(0,s.useLayoutEffect)(f);let d=t=>{t&&(i.current=t,t.focus(),f())};return{ref:a,[m]:c?"letters":"",onFocus:t=>{let n=t.target.closest?.(`[${E}]`);n&&n.closest(`[${m}]`)===a.current&&i.current!==n&&(i.current=n,f())},onKeyDown:t=>{let n=a.current;if(!n||t.metaKey||t.ctrlKey||t.altKey||w(t.target))return;let o=p(n),u=o.findIndex(l=>l===t.target||l.contains(t.target));if(u<0)return;let r=L[t.key]?.[e];if(r){t.preventDefault(),t.stopPropagation(),d(o[Math.max(0,Math.min(o.length-1,u+r))]);return}if(t.key==="Home"||t.key==="End"){t.preventDefault(),t.stopPropagation(),d(t.key==="Home"?o[0]:o[o.length-1]);return}if(c&&t.key.length===1&&t.key.trim()!==""){let l=t.key.toLowerCase(),y=[...o.slice(u+1),...o.slice(0,u+1)].find(b=>M(b).startsWith(l));if(!y)return;t.preventDefault(),t.stopPropagation(),d(y)}}}}export{E as a,H as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r=1,t="allow-scripts",o="null";function a(e,n){if(typeof e!="string"||e.length===0||e.length>200)return"A kept value's key is a string of 1 to 200 characters, so this one was not kept.";if(n!==null){if(typeof n!="string")return"A view keeps a string or null; JSON.stringify anything else, so this one was not kept.";if(n.length>4096||new TextEncoder().encode(n).length>4096)return"A kept value is at most 4 KB, and this one is longer, so it was not kept."}}var l=["wheel","drag","pinch"];function d(e){return typeof e=="object"&&e!==null&&e.graview==="guest-ready"}export{r as a,t as b,o as c,a as d,l as e,d as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i}from"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import"./chunk.WVUJXDXZ.js";import{e as l}from"./chunk.NI4OPHTL.js";import"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.MIE4TJRW.js";import"./chunk.3CLTABGP.js";import"./chunk.RD2FSSLV.js";import"./chunk.CVN2XFMF.js";import"./chunk.6TBQV3NO.js";import"./chunk.MT252WP4.js";import"./chunk.VVIQSFM4.js";import"./chunk.TQ3MNB6K.js";import"./chunk.VGYG2IBZ.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{Y as m}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as g}from"./chunk.AJZBJBMO.js";var a=g(m(),1),r=new WeakMap;function c(n){let o=r.get(n);if(!o){let t=l(n);o=e=>e.mode==="fullscreen"?(0,a.jsx)(i,{blocks:t,slot:"home",heading:2,firstHeading:1,...e.flagged?{flagged:e.flagged}:{}}):(0,a.jsx)(i,{blocks:t,slot:"home",heading:3,firstHeading:2,...e.flagged?{flagged:e.flagged}:{}}),r.set(n,o)}return o}export{c as homeView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Jb as a,ma as l,sa as p}from"./chunk.6L6RUOSF.js";import{c}from"./chunk.FQLNBIQ5.js";function m(e){if(e.withheld===!0||e.undoes!==void 0||e.mutation?.name!==a)return;let{node:n,field:r}=e.mutation.args??{};return typeof n=="string"&&typeof r=="string"?{node:n,field:r}:void 0}function R(e,n){return e.kind!==n.kind?!1:e.id!==void 0||n.id!==void 0?e.id===n.id&&e.onBehalfOf===n.onBehalfOf:(e.name??"")===(n.name??"")}var f=e=>{let n=0;for(let r of e)n++;return n};function k(e){if(e.length===0)return;let n=m(e[0]);if(!n)return;let r=0,o=0;for(let i of e){let d=m(i);if(!d||d.node!==n.node||d.field!==n.field)return;for(let t of i.primitives)if(t.op==="splice-text"&&t.id===n.node&&t.field===n.field)r+=f(t.inserted),o+=f(t.removed);else if(t.op==="patch-node"&&t.id===n.node&&Object.prototype.hasOwnProperty.call(t.after,n.field)){let s=t.before[n.field],u=t.after[n.field];r+=typeof u=="string"?f(u):0,o+=typeof s=="string"&&!c(s)?f(s):0}}return{...n,inserted:r,removed:o}}var T=(e,n)=>({node:e.node,field:e.field,inserted:e.inserted+n.inserted,removed:e.removed+n.removed});function y(e){return`(${[...e.inserted>0||e.removed===0?[`+${e.inserted}`]:[],...e.removed>0?[`\u2212${e.removed}`]:[]].join(" ")})`}function w(e,n,r,o=!0){let i=r?.getNode(e.node),d=i?n.tryDefinition(i.kind):void 0,t=p(d,e.field);return`Wrote in ${i&&o?`${l(d,i)}'s ${t.toLowerCase()}`:t} ${y(e)}`}export{R as a,k as b,T as c,w as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{zc as k}from"./chunk.6L6RUOSF.js";function C(e){let o=e+1;return o*o-x(o).length}function x(e){if(e<3)return[];if(e%2===1){let s=(e-1)/2;return[[s,s]]}let o=e/2-1,t=e/2;return[[o,o],[t,o],[o,t],[t,t]]}function M(e){let o=2166136261;for(let t=0;t<e.length;t++)o=Math.imul(o^e.charCodeAt(t),16777619);return(o>>>0)%1e3/1e3}function O(e,o){let t=e.side+1,s=new Set(x(t).map(([r,d])=>`${r},${d}`)),a=e.side/t,l=[];for(let r=0;r<t;r++)for(let d=0;d<t;d++)s.has(`${d},${r}`)||l.push([d,r]);l.sort((r,d)=>r[0]+r[1]-(d[0]+d[1])||r[0]-d[0]);let i=o.slice(0,l.length);return{buildings:i.map((r,d)=>{let[m,y]=l[d];return{id:r,col:e.col+(m+.5)*a,row:e.row+(y+.5)*a,footprint:a*.62,height:.55+M(r)*.7}}),rest:Math.max(0,o.length-i.length)}}var S={done:.12,waiting:.55,active:1.05};function T(e,o,t=[]){let s=e.side,a=s/Math.max(1,o.length),l=Math.max(1,...o.map(n=>n.length)),i=a;for(let n=1;a/n>=s/8-1e-9&&(i=a/n,!(n*Math.floor(s/i+1e-9)>=l));n++);let c=Math.max(1,Math.floor(a/i+1e-9)),r=Math.max(1,Math.floor(s/i+1e-9)),d=s/r,m=[],y=[];return o.forEach((n,u)=>{let g=n.slice(0,c*r);if(g.forEach((j,b)=>{m.push({id:j,lane:u,col:e.col+(b%r+.5)*d,row:e.row+u*a+(Math.floor(b/r)+.5)*i,footprint:Math.min(d,i)*.66,height:t[u]??S.waiting})}),n.length<=g.length)return;let p=y[0],w=n.length-g.length;p?y[0]={...p,count:p.count+w,rows:p.rows+1}:y.push({lane:u,count:w,rows:1,col:e.col-.15,row:e.row+(u+.5)*a})}),m.sort((n,u)=>n.col+n.row-(u.col+u.row)||n.col-u.col),{blocks:m,rests:y}}var R=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),f=e=>typeof e=="string"?[e]:Array.isArray(e)?e.filter(o=>typeof o=="string"):[];function $(e,o,t){let s=Object.entries(o??{});if(s.length===0)return[];let a=new Set(e.schema.kinds),l=new Map(t.map(c=>[c.name,c])),i=c=>{let r=l.get(c);return r?[...k(e.schema,r),...r.creates??[]]:[]};return s.map(([c,r])=>{let d=[],m=[];for(let n of r.when??[])d.push(...f(n.made),...f(n.changed));for(let n of r.steps??[]){let u=R(n.over)?f(n.over.kind):[],g=Array.isArray(n.from)?n.from.flatMap(p=>R(p)?f(p.kind):[]):[];d.push(...u,...f(n.reads),...g,...f(n.archive),...f(n.classify)),m.push(...[...f(n.act),...f(n.acts)].flatMap(i),...f(n.generate),...f(n.archive),...f(n.classify))}let y=n=>[...new Set(n)].filter(u=>a.has(u));return{name:c,title:r.title,status:r.status==="paused"?"paused":"active",reads:y(d),writes:y(m)}})}function v(e,o){let t=new Map,s=[];for(let a of e){let l=[...a.writes,...a.reads].find(r=>o.has(r));if(l===void 0)continue;let i=o.get(l),c=t.get(l)??0;t.set(l,c+1),s.push({name:a.name,beside:l,col:i.col+i.side+1,row:i.row+.5+c})}return s}var h=e=>typeof e=="number"?Number.isFinite(e)&&e>0?Math.floor(e):0:Array.isArray(e)?e.length:0;function A(e,o=Date.now()){let t=Math.floor((new Date(o).getTime()-new Date(e).getTime())/6e4);if(!Number.isFinite(t)||t<1)return"just now";if(t<60)return t===1?"a minute ago":`${t} minutes ago`;let s=Math.floor(t/60);if(s<24)return s===1?"an hour ago":`${s} hours ago`;let a=Math.floor(s/24);return a===1?"yesterday":`${a} days ago`}function D(e,o=Date.now()){if(!e)return"Has not run yet";let t=`Last ran ${A(e.finished,o)}`;if(e.outcome==="failed")return`${t} and failed`;if(e.outcome==="held")return`${t}: held back`;let a=[[h(e.made),e.dry?"would make":"made"],[h(e.changed),e.dry?"would change":"changed"],[h(e.archived),e.dry?"would set aside":"set aside"],[h(e.suggested),e.dry?"would suggest":"suggested"]].filter(([i])=>i>0).map(([i,c])=>`${c} ${i}`),l=a.length>0?a.join(", "):"nothing new";return`${t}${e.dry?", as a dry run":""}: ${l}${e.outcome==="partial"?" (part of it did not run)":""}`}export{C as a,M as b,O as c,S as d,T as e,$ as f,v as g,D as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{Y as T}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var F=/^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)/,D=/^ {0,3}(#{1,6})(?:[ \t]+|$)/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,v=/^ {0,3}>[ \t]?/,_=/^([ \t]*)([-*+]|(\d{1,9})[.)])(?:[ \t]+|$)/,K=/^\|?\s*:?-+:?\s*(?:\|\s*:?-+:?\s*)+\|?$|^\|\s*:?-+:?\s*\|$/,w=/^[ \t]*$/;function O(t){let n=F.exec(t);if(!(!n||n[1][0]==="`"&&t.indexOf("`",n[0].length)>=0))return{mark:n[1],lang:n[2]}}function U(t,n){let r=t.trim().slice(n).trim(),e=r.length;for(;e>0&&r[e-1]==="#";)e--;return(e===0||r[e-1]===" "||r[e-1]===" ")&&(r=r.slice(0,e).trim()),r}var $=t=>O(t)!==void 0||D.test(t)||R.test(t)||v.test(t)||_.test(t),b=t=>[...t].reduce((n,r)=>r===" "?n+4-n%4:n+1,0);function E(t){let n=t.trim().replace(/^\|/,"").replace(/(?<!\\)\|$/,""),r=[],e="",l=!1;for(let c=0;c<n.length;c++){let h=n[c];h==="\\"&&n[c+1]==="|"?(e+="|",c++):h==="`"?(l=!l,e+=h):h==="|"&&!l?(r.push(e.trim()),e=""):e+=h}return r.push(e.trim()),r}function W(t){return B(t.replace(/\r\n?/g,`
|
|
2
2
|
`).replace(/\0/g,"\uFFFD").split(`
|
|
3
3
|
`),0)}function B(t,n){let r=[],e=0;for(;e<t.length;){let l=t[e];if(w.test(l)){e++;continue}let c=O(l);if(c){let o=new RegExp(`^ {0,3}${c.mark[0]==="`"?"`":"~"}{${c.mark.length},}[ \\t]*$`),a=[];for(e++;e<t.length&&!o.test(t[e]);)a.push(t[e++]);e++,r.push({t:"code",text:a.join(`
|
|
4
4
|
`),...c.lang?{lang:c.lang}:{}});continue}let h=D.exec(l);if(h){r.push({t:"heading",level:h[1].length,children:k(U(l,h[1].length),0)}),e++;continue}if(R.test(l)){r.push({t:"rule"}),e++;continue}if(v.test(l)){let o=[];for(;e<t.length&&(v.test(t[e])||o.length>0&&!w.test(t[e])&&!$(t[e])&&!w.test(o[o.length-1]));)o.push(t[e++].replace(v,""));r.push(n<8?{t:"quote",blocks:B(o,n+1)}:{t:"p",children:k(o.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as wn,f as bn,g as ie,h as vn,i as X,k as $e,l as De,q as On,v as de,x as xn}from"./chunk.N3MXLORL.js";import{$a as an,B as we,C as pe,Db as ze,Eb as cn,F as Ue,Fa as Re,H as We,Ia as nn,K as Je,L as Ye,La as tn,Na as rn,Ra as Se,Sa as Ae,Xb as I,Ya as on,_c as gn,ac as ln,b as Ce,bc as fn,c as Ie,d as Ve,dc as un,e as B,g as ye,h as _,ha as xe,i as Ke,ia as Qe,ic as pn,j as Ze,k as he,ka as Xe,l as qe,ld as yn,m as Be,md as hn,nc as mn,nd as Ee,o as _e,od as kn,p as fe,pd as je,q as Oe,ua as en,v as He,vb as sn,x as ue,yb as dn,z as ke}from"./chunk.6L6RUOSF.js";var Gn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Rn(e,d=Gn){if(!H(e))return{document:e,respelled:[]};let n=[],t=e;for(let s of d)t=Le(t,s.where.split("."),s,"",n);return{document:t,respelled:n}}function Le(e,d,n,t,s){if(d.length===0){if(!H(e)||!Object.hasOwn(e,n.was))return e;s.push(`${t}${n.was}`);let{[n.was]:ae,...U}=e;return Object.hasOwn(e,n.now)?U:{...U,[n.now]:ae}}if(!H(e))return e;let[g,...j]=d,w=g.endsWith("[]"),x=w?g.slice(0,-2):g,N=e[x],ne=N;if(!w)ne=Le(N,j,n,`${t}${x}.`,s);else if(Array.isArray(N)){let ae=N.map((U,L)=>Le(U,j,n,`${t}${x}.${L}.`,s));ne=ae.some((U,L)=>U!==N[L])?ae:N}return ne===N?e:{...e,[x]:ne}}var Sn=new WeakMap;function An(e,d){Sn.set(e,d)}function qn(e){return Sn.get(e)}function zn(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let d=e,n=w=>typeof d[w]=="string"?d[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[s,g,j]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...s!==void 0?{dark:s}:{},...g!==void 0?{alt:g}:{},...j!==void 0?{darkFallback:j}:{}}}function Xn(e,d){let n=e.brand??{},t=n.ground,s=n.accent?je(n.accent,t):void 0;t&&kn(s?.ok?s.schemes:Ee(t),n.accent)&&(d.push(De("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,s=n.accent?je(n.accent):void 0),s&&!s.ok&&d.push(De("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${s.why}`,"pick a color further from orange-red, or a darker one"));let g=zn(n.logo),j=n.name??e.name,w=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,x])=>typeof x=="string"&&hn(x)===null).map(([x,N])=>[x,yn(N)])):void 0;return{name:j,schemes:s?.ok?s.schemes:t?Ee(t):gn,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...g?{logo:g.dark||g.darkFallback==="invert"?{light:g.light,...g.dark?{dark:g.dark}:{darkFallback:"invert"}}:g.light,logoAlt:g.alt??j}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...w?{typography:w}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{},...n.views&&(n.views.css||n.views.motion||n.views.fonts?.length)?{views:{...n.views.css?{css:n.views.css}:{},...n.views.motion?{motion:n.views.motion}:{},...n.views.fonts?.length?{fonts:n.views.fonts}:{}}}:{}}}function En(e){let{currency:d,locale:n,timeZone:t}=e.brand??{};return{...d?{currency:d}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var Mn=Symbol.for("@graview/core:typed-field"),jn=(e,d)=>(/^(phone|place|duration)$/.test(d)&&(pe(e)[Mn]=d),e),$n=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function Dn(e){let d=_().check(B(300),ke(t=>tn(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?d:fe(d).check(B(200));return rn(e.description?n.check(we(e.description)):n,e)}var Ln="graview-compiled@1";function Nn(e,d){return e.find(([n,t])=>n!==ee&&"ref"in t&&(t.ref==="*"||t.ref.includes(d)))?.[0]}var ee="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function Pn(e){let d=Object.entries(e.fields),n=t=>["name","title","label"].find(s=>t.some(([g])=>g===s))??t[0]?.[0];return n(d.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(d.filter(([,t])=>t.type==="string"))}function Tn(e,d,n){let t;switch(e.type){case"string":case"place":t=_().check(B(500));break;case"phone":t=_().check(B(40),ye($n,"a phone number"));break;case"text":t=_().check(B(2e4)),e.format&&(pe(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let g=e.min??(e.type==="duration"?0:void 0),j=[...e.type==="number"?[]:[qe()],...g===void 0?[]:[Ie(g)],...e.max===void 0?[]:[Ce(e.max)],...e.step===void 0?[]:[Ve(e.step)]];t=j.length>0?he().check(...j):he();break}case"boolean":t=Be();break;case"date":t=_().check(ye(We,"a date like 2026-10-02, or a month (2016-05) or a year (2006) alone"));break;case"datetime":t=_().check(ke(Je,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=He(e.options),e.multiple&&(t=fe(t).check(B(e.options.length)));break;case"list":t=fe(e.of==="number"?he():e.of==="date"?_().check(ye(Ue)):e.of==="image"||e.of==="video"||e.of==="file"?Re(e.of):_().check(B(500))).check(B(200));break;case"image":case"video":case"file":t=Re(e.type);break;case"app-link":t=nn();break;case"url":t=Ze();break;case"email":t=Ke();break}let s=e.type==="number"||e.type==="integer";return jn(t,s&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(pe(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(we(e.description))),s&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&pn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{},...e.places===0?{places:0}:{}}),d?ue(t):t}var ge=e=>{throw new I(`there is no record "${e}"`,"invalid")},Cn=(e,d)=>"field"in e?Tn(e.field,e.optional,d):"ref"in e?mn(e.ref):ue(_e()),In=new WeakMap;var Pe=(e,d)=>H(d)&&Object.keys(e??{}).length===Object.keys(d).length&&Object.keys(e??{}).every(n=>Object.hasOwn(d,n));function Rt(e,d={}){let n=H(e)?e.format:void 0;if(n!==Ln)return{ok:!1,findings:[$e("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${Ln}`,"compile the document instead")]};let t=e,s=Rn(t.document).document,g=s===t.document?t:{...t,document:s},j=H(s)&&typeof s.name=="string"&&H(s.kinds)&&Pe(s.kinds,g.kinds)&&Pe(s.acts,g.acts)&&Pe(s.rules,g.rules)&&Array.isArray(g.edges)&&Array.isArray(g.findings),w={ok:!1,findings:[$e("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!j)return w;try{return Vn(g,d)}catch{return w}}function Vn(e,d={}){let{document:n}=e,t=n.brand?.timeZone,s=d.today??(()=>Ye(t)),g={...n.brand?.locale?{locale:n.brand.locale}:{},...t?{timeZone:t}:{}},j=new Map(e.edges.map(([y,o])=>[y,o])),w=new Map;for(let[y,o]of Object.entries(n.kinds)){let R=e.kinds[y]?.computed,v=Ae(o.edges),$=new Map(Object.entries(o.fields).flatMap(([z,O])=>O.type==="enum"?[[z,O.optionLabels??{}]]:[]));w.set(y,{fields:new Set([...Object.keys(o.fields),...v.keys()]),edges:new Map(Object.entries(Se(o.edges)).map(([z,O])=>[z,O.cardinality??"many"])),...R?{computed:new Map(R)}:{},...v.size>0?{linked:v}:{},...$.size>0?{choices:$}:{}})}e.facts&&w.set(bn,{computed:new Map(e.facts)});let x=En(n),N=y=>({from:y.from,via:y.via,sourceEnd:y.sourceEnd,back:y.back,values(o,R,v){let $={};for(let[z,O]of y.set)if("value"in O)$[z]=O.value;else try{let P=X(O.expr,{graph:o,subject:R,kinds:w,bindings:{to:v},today:s(),...g});(P===null||typeof P!="object"||Array.isArray(P))&&($[z]=P)}catch(P){if(!(P instanceof ie))throw P}return $}}),ne=new Map,ae=Object.entries(n.kinds).map(([y,o])=>{let R={};for(let[r,i]of Object.entries(o.fields))R[r]=Tn(i,!i.required,x),i.repeats&&(R[on(r)]=ue(an()));for(let[r,i]of Ae(o.edges))R[r]=ue(Dn(i));let{label:v,describe:$,durations:z}=e.kinds[y]??{},O=Object.entries(o.computed??{}).map(([r,i])=>[r,typeof i=="string"?{expr:i}:i]),P=Object.hasOwn(o.fields,"label")&&!o.fields.label.label&&!/\{\s*label\b/.test(o.label??`{${Pn(o)??""}}`),te=Object.fromEntries([...P?[["label","Label"]]:[],...Object.entries(o.fields).filter(([,r])=>r.label).map(([r,i])=>[r,i.label]),...O.filter(([,r])=>r.label).map(([r,i])=>[r,i.label])]),J=Object.keys(te).length>0,D=Object.entries(o.fields).filter(([,r])=>r.type==="enum"&&(r.optionLabels&&Object.keys(r.optionLabels).length>0||r.multiple)),m=r=>i=>typeof i=="string"&&r.optionLabels&&Object.hasOwn(r.optionLabels,i)?r.optionLabels[i]:Qe(String(i)),C=Object.fromEntries(D.map(([r,i])=>[r,i.multiple?E=>Array.isArray(E)?E.map(m(i)).join(", "):m(i)(E):m(i)])),V=D.length>0,K=Object.fromEntries(Object.entries(o.fields).filter(([,r])=>r.default!==void 0).map(([r,i])=>[r,i.default]));ne.set(y,K);let W=Object.fromEntries(Object.entries(Se(o.edges)).map(([r,{renamedFrom:i,...E}])=>[r,E])),Z=Object.entries(o.fields).flatMap(([r,i])=>i.aliases?[[r,i.aliases]]:[]),T=r=>o[r]?{[r]:o[r]}:{};return Xe(y,{fields:Oe(R),edges:W,...T("plural"),...T("noun"),...T("aliases"),...Z.length>0?{fieldAliases:Object.fromEntries(Z)}:{},...T("description"),...v?{label:r=>de(v,{node:r,kinds:w,today:s(),money:x})||r.id}:{},...$?{describe:r=>de($,{node:r,kinds:w,today:s(),money:x})}:{},...T("lifecycle"),...T("figure"),...T("fieldRoles"),...T("people"),archives:o.archives,...o.tidying?{tidying:o.tidying}:{},...O.length>0?{computed:Object.fromEntries(O.map(([r,i])=>[r,Kn(i,z?.includes(r)??!1,x)??o.computed[r]]))}:{},...J||V||o.glance||o.page?{display:{...J?{labels:te}:{},...V?{format:C}:{},...o.glance?{glance:[...o.glance]}:{},...o.page?{page:o.page}:{}}}:{},...Object.keys(K).length>0?{defaults:K}:{},...e.kinds[y]?.keptInStep?{keptInStep:e.kinds[y].keptInStep}:{},...e.kinds[y]?.derives?{derives:N(e.kinds[y].derives)}:{}})}),U=sn(ae,n.computed);function L(y){return U.tryDefinition(y.kind)?.label?.(y)??y.id}let Te=y=>({id:"",kind:y,...ne.get(y)}),Ge=[];for(let[y,o]of Object.entries(n.acts??{})){let R=e.acts[y],{title:v,effects:$,guard:z,refusal:O,destructive:P,idempotent:te,creates:J,connects:D,severs:m,writes:C,writesOther:V,sets:K}=R,W={};for(let c of $)"through"in c&&(W[c.through]=[...new Set([...W[c.through]??[],...Object.keys(c.set)])]);let Z=new Map(R.args),T={};for(let[c,S]of Z)T[c]=Cn(S,x);let r=[o.on??[]].flat(),i=new Map(R.exprs),E=$.find(c=>"create"in c),Y=(c,S,l,b=null)=>{if(H(c)&&"expr"in c)return X(i.get(c.expr),{graph:l,subject:b,kinds:w,bindings:S,args:S,today:s(),...g});let h=me(c);return h===void 0?typeof c=="string"&&c.startsWith("$$")?c.slice(1):c:h==="now"?new Date().toISOString():h==="today"?s():S[h]},ce=(c,S)=>{if(!E)return"";let l=n.kinds[E.create].fields,b=Te(E.create),h=[];for(let[A,le]of Object.entries(E.set??{})){try{b[A]=Y(le,c,S)??b[A]}catch{}let se=me(le);se&&c[se]!==void 0&&h.push(A)}let G=L(b).trim(),re=h.filter(A=>b[A]!==!1&&l[A].type!=="text"&&!(/[^]{41}/.test(b[A])||/ .*[.!?]$/.test(b[A])&&!/[ .][A-Z]\w{0,3}\.$/.test(b[A]))&&L({...b,[A]:void 0}).trim()===G).map(A=>b[A]===!0?l[A].label??xe(A):On(b[A],l[A].format,s(),[],x));return G&&re.length>0?`${G} (${re.join(", ")})`:G};Ge.push(un(y,{input:Oe(T),title:v,...o.description?{description:o.description}:{},...o.fromTheOtherEnd?{fromTheOtherEnd:o.fromTheOtherEnd}:{},...Z.has(ee)?{subject:{kinds:r.length>0?r:"*",arg:ee}}:{},...P?{destructive:!0}:{},...te?{idempotent:!0}:{},...JSON.stringify(o).includes('"$me"')?{doneAsMe:!0}:{},...J.length>0?{creates:J}:{},...D.length>0?{connects:D}:{},...m.length>0?{severs:m}:{},writes:C,...Object.keys(V).length>0?{writesOther:V}:{},...Object.keys(W).length>0?{writesLinked:W}:{},...Object.keys(K).length>0?{sets:K}:{},...z?{allowedOn:(c,S)=>{let l=c.getNode(S);if(!l||r.length>0&&!r.includes(l.kind))return!1;try{return X(z,{graph:c,subject:l,kinds:w,bindings:{},today:s(),...g})===!0}catch{return!1}}}:{},describe:(c,S)=>{let l=typeof c[ee]=="string"?S.getNode(c[ee]):void 0,b=l?L(l):ce(c,S);return b?`${v}: ${b}`:v},apply(c,S){let l=c.graph,b=typeof S[ee]=="string"?S[ee]:void 0,h=b?l.getNode(b):void 0;if(b&&!h&&ge(b),h&&r.length>0&&!r.includes(h.kind))throw new I(`"${v}" acts on ${r.join(" or ")}, not on ${en(h.kind)}`,"invalid");let G={};for(let[a,p]of Object.entries(S))p!==void 0&&(G[a]=p);if(z&&h){let a;try{a=X(z,{graph:l,subject:h,kinds:w,bindings:G,args:G,today:s(),...g})}catch(p){throw p instanceof ie?new I(`"${v}" could not be judged: ${p.sentence}`):p}if(a!==!0)throw new I(O?de(O,{node:h,kinds:w,graph:l,bindings:G,args:G,today:s(),money:x}):`"${v}" is not allowed for ${L(h)} right now`)}let re=new Map,A=a=>l.has(a)||[...re.values()].includes(a),le=new Set,se=a=>{let p=dn(a);le.has(p)||(le.add(p),c.removeEdge(a))},ve=(a,p,f)=>{let u=a===void 0?void 0:n.kinds[a],k=u?.fields[p];if(k?.required){let M=k.label??xe(p);throw new I(`"${v}" cannot clear ${M}${f?` of ${L(f)}`:""}: every ${u.noun??a} has one`,"invalid")}},oe=(a,p)=>{let f=me(a);if(f==="subject")return b;if(f==="me"){let u=c.me;if(u&&n.kinds[l.getNode(u)?.kind]?.people)return u;throw new I(`"${v}" is done as you, and you have no record here`)}if(re.has(f))return re.get(f);try{return Y(a,G,l,p??h??null)}catch(u){throw u instanceof ie?new I(`"${v}" could not work out a value: ${u.sentence}`):u}};for(let a of $)if("create"in a){let p=n.kinds[a.create],f=Te(a.create);for(let[q,Q]of Object.entries(a.set??{})){let Ne=Q===null?ve(a.create,q):oe(Q,void 0);Ne!==void 0&&(f[q]=Ne)}let u=Pn(p),k=String((u&&f[u])??a.create),M=fn(k,a.create,f,(q,Q)=>ln(n.policy?.sees,q,Q)),F=c.freshId(M?a.create:k,a.create,f);c.addNode({...f,id:F}),a.as&&re.set(a.as,F)}else if("connect"in a||"sever"in a){let p="connect"in a?a.connect:a.sever,f=String(oe(a.from,void 0)??""),u=String(oe(a.to,void 0)??"");if(A(f)||ge(f),A(u)||ge(u),"connect"in a){if(j.get(p)?.cardinality==="one")for(let k of l.out(f,p))k.id!==u&&se({kind:p,from:f,to:k.id});l.out(f,p).some(k=>k.id===u)||c.addEdge({kind:p,from:f,to:u})}else{let k=[l.getNode(f),l.getNode(u)];if(k[0]&&k[1]&&!l.out(f,p,{archived:"all"}).some(M=>M.id===u))throw new I(`"${v}" has nothing to take away: ${L(k[0])} is not linked to ${L(k[1])} that way`);se({kind:p,from:f,to:u})}}else if("through"in a){if(!h)throw new I(`"${v}" carries a change to linked records, and has no record to start from`,"invalid");let f=j.get(a.through)?.from.includes(h.kind)??!0?l.out(h.id,a.through):l.in(h.id,a.through);for(let u of f){let k={};for(let[M,F]of Object.entries(a.set)){let q;if(me(F)==="to")q=u.id;else if(H(F)&&"expr"in F)try{q=X(i.get(F.expr),{graph:l,subject:h,kinds:w,bindings:{...G,to:u},args:G,today:s(),...g})}catch(Q){throw Q instanceof ie?new I(`"${v}" could not work out a value for ${L(u)}: ${Q.sentence}`):Q}else q=oe(F,void 0);F===null?k[M]=ve(u.kind,M,u):q!==void 0&&(k[M]=q)}Object.keys(k).length>0&&c.patchNode(u.id,k)}}else if("set"in a){let p=String(oe(a.target??"$subject",void 0)??""),f=l.getNode(p);!f&&!A(p)&&ge(p);let u={};for(let[k,M]of Object.entries(a.set))if(M===null)u[k]=ve(f?.kind,k,f);else{let F=oe(M,f);F!==void 0&&(u[k]=F)}Object.keys(u).length>0&&c.patchNode(p,u)}else if("remove"in a){let p=String(oe(a.remove,void 0)??"");l.has(p)||ge(p),c.removeNode(p)}else if("replace"in a&&h){let p=S.to;for(let f of a.replace){let u=j.get(f)?.from.includes(h.kind)??!0;for(let k of u?l.out(h.id,f):l.in(h.id,f))f===a.keep&&k.id===p||se(u?{kind:f,from:h.id,to:k.id}:{kind:f,from:k.id,to:h.id})}}}}))}let Me=[];for(let[y,o]of Object.entries(n.rules??{})){let{title:R,require:v,when:$,says:z,covers:O}=e.rules[y],P=o.repairs??[],te=(D,m,C=s(),V)=>{let K=[],W={graph:D,subject:m,kinds:w,today:C,...g,...V?{linked:V}:{},onUnread:i=>K.push(i)},Z,T=[];try{if($&&X($,W)!==!0)return[];if(O&&m?(T=xn(D,m,O),Z=T.length===0):Z=X(v,W)===!0,!Z&&K.length>0)throw new ie(`it reads ${wn(K[0])}`,0)}catch(i){throw i instanceof vn?new cn(i.sentence):i instanceof ie?new Error(i.sentence):i}if(Z)return[];let r=P.flatMap(i=>{let E=n.acts?.[i.act],Y={},ce=m&&E?.on&&E.fromTheOtherEnd&&![E.on].flat().includes(m.kind)?Nn(e.acts[i.act].args,m.kind):void 0;ce?Y[ce]=m.id:m&&(E?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(i.act))&&(Y[ee]=m.id);for(let[l,b]of Object.entries(i.args??{}))Y[l]=me(b)==="subject"?m?.id:b;let S=(E?e.acts[i.act].args:[]).filter(([l,b])=>b.required&&Y[l]===void 0).map(([l])=>l);return[{mutation:i.act,label:i.label??(ce?E.fromTheOtherEnd:E?.title)??i.act.replace(/-/g," "),args:Y,...S.length>0?{missing:S}:{}}]});return O&&m?T.map(i=>({invariant:y,subjectId:m.id,label:R,message:z?de(z,{node:m,kinds:w,graph:D,today:C,money:x,bindings:{[m.kind]:m,[i.kind]:i}}):`${L(m)}: ${R} \u2014 ${L(i)}`,nodeIds:[m.id,i.id],repairs:r})):[{invariant:y,...m?{subjectId:m.id}:{},label:R,message:z?de(z,{node:m,kinds:w,graph:D,today:C,money:x}):m?`${L(m)}: ${R}`:R,nodeIds:m?[m.id]:[],repairs:r}]},J={label:R,shape:{over:o.over,require:v,...O?{covers:O}:{},when:$,says:z,declared:n.kinds,money:x,kinds:w,today:s},judgment:{...o.require?{require:o.require}:{},...o.covers?{covers:o.covers}:{},...o.when?{when:o.when}:{},...o.says?{says:o.says}:{}},...o.description?{description:o.description}:{},...P.length>0?{repairs:P.map(D=>D.act)}:{}};Me.push(o.over==="graph"?ze(y,{scope:"graph",...J,evaluate:({graph:D,today:m,context:C})=>te(D,null,m,C?.linked)}):ze(y,{scope:{kind:o.over},...J,evaluate:({graph:D,subject:m,today:C,context:V})=>te(D,m,C,V?.linked)}))}let Fe=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},be={name:n.name,schema:U,mutations:Ge,invariants:Me,...Fe?{policy:Fe}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.tidying?{tidying:n.tidying}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return An(be,n),In.set(be,e),{ok:!0,app:be,document:n,findings:e.findings,sights:n.policy?.sees,kinds:w}}function Kn(e,d,n){let t=d||e.format==="duration",s=e.format==="money"||e.format==="percent"||!e.format&&e.unit!==void 0;if(!(!t&&!s))return{...e,...t?{as:"duration"}:{},...s?{amount:{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{},...e.places===0?{places:0}:{}}}:{}}}export{H as a,Rn as b,qn as c,Xn as d,Ln as e,ee as f,me as g,Pn as h,Rt as i,Vn as j};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as I}from"./chunk.
|
|
1
|
+
import{G as I}from"./chunk.JCKIJSW7.js";import{$c as y,Ad as R,Zc as $,_c as k,ad as _,bd as O,hd as x,ud as S,wd as T,zd as E}from"./chunk.6L6RUOSF.js";import{a as b}from"./chunk.AJZBJBMO.js";var N=b(l=>{"use strict";var V=I();function D(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var s={d:{f:d,r:function(){throw Error(D(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},j=Symbol.for("react.portal");function W(r,e,a){var t=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:j,key:t==null?null:""+t,children:r,containerInfo:e,implementation:a}}var u=V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s;l.createPortal=function(r,e){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(D(299));return W(r,e,null,a)};l.flushSync=function(r){var e=u.T,a=s.p;try{if(u.T=null,s.p=2,r)return r()}finally{u.T=e,s.p=a,s.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,s.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&s.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin),n=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;a==="style"?s.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:t,integrity:n,fetchPriority:i}):a==="script"&&s.d.X(r,{crossOrigin:t,integrity:n,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var a=h(e.as,e.crossOrigin);s.d.M(r,{crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&s.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var a=e.as,t=h(a,e.crossOrigin);s.d.L(r,a,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var a=h(e.as,e.crossOrigin);s.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:a,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else s.d.m(r)};l.requestFormReset=function(r){s.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,a){return u.H.useFormState(r,e,a)};l.useFormStatus=function(){return u.H.useHostTransitionStatus()};l.version="19.2.8"});var Y=b((J,P)=>{"use strict";function L(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(L)}catch(r){console.error(r)}}L(),P.exports=N()});var B={name:"Graview",typography:{body:y.body,mono:y.mono},schemes:k},A={ground:"--graview-ground",groundDeep:"--graview-ground-deep",wash:"--graview-wash",panel:"--graview-panel",panelMuted:"--graview-panel-muted",panelWarning:"--graview-panel-warning",edge:"--graview-edge",edgeBright:"--graview-edge-bright",ink:"--graview-ink",inkMuted:"--graview-ink-muted",inkFaint:"--graview-ink-faint",accent:"--graview-accent",accentDim:"--graview-accent-dim",accentInk:"--graview-accent-ink",warn:"--graview-warn",good:"--graview-good",bad:"--graview-bad",glow:"--graview-glow",bar:"--graview-bar",float:"--graview-float",liftLow:"--graview-lift-low",liftHigh:"--graview-lift-high",tintAlpha:"--graview-tint-alpha",tintLightness:"--graview-tint-lightness",gridAlpha:"--graview-grid-alpha"};function H(r){return Object.keys(A).map(e=>` ${A[e]}: ${r[e]};`).join(`
|
|
2
2
|
`)}function C(r,e){let a=r===e?r:`${r} ${e}`;return` ${a} [data-graview-view] { transition: none; }
|
|
3
3
|
${a} [data-graview-touched] > * { animation: none; }
|
|
4
4
|
${a} [data-graview-view][data-graview-wrote] > *,
|