graview 0.1.70 → 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.4O3STSC4.js → chunk.3RRK6UTN.js} +1 -1
- package/dist/preview/chunk.45HUV56Z.js +1 -0
- package/dist/preview/chunk.4HU2ILFY.js +1 -0
- package/dist/preview/{chunk.M7DJJRFH.js → chunk.4LWWXIM4.js} +1 -1
- package/dist/preview/chunk.4O64QV2Y.js +1 -0
- package/dist/preview/{chunk.KP7HUXH5.js → chunk.4QMAYVPU.js} +1 -1
- package/dist/preview/chunk.4UDST6IF.js +1 -0
- package/dist/preview/{chunk.7TZXDPPO.js → chunk.4YZ2A6SJ.js} +3 -3
- package/dist/preview/{chunk.PAIBRJVZ.js → chunk.4ZEHLUXV.js} +1 -1
- package/dist/preview/{chunk.I7CSRZC2.js → chunk.5EQRIZ6I.js} +1 -1
- package/dist/preview/chunk.5OS4SYHE.js +1 -0
- package/dist/preview/{chunk.ZIGW5VOT.js → chunk.5PQV7GFE.js} +1 -1
- package/dist/preview/{chunk.SSHEFQ4R.js → chunk.5WCSQFS5.js} +1 -1
- package/dist/preview/{chunk.RJ7UV3XI.js → chunk.64K5ELSQ.js} +1 -1
- package/dist/preview/{chunk.2T24FYAO.js → chunk.67S2UWBT.js} +1 -1
- package/dist/preview/{chunk.FXCKKVT5.js → chunk.6A3KTD66.js} +1 -1
- 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.ZGJUCVT5.js → chunk.6TBQV3NO.js} +1 -1
- package/dist/preview/chunk.6ZRVVRDQ.js +1 -0
- package/dist/preview/{chunk.4VTUC5TF.js → chunk.7FI75ZVE.js} +1 -1
- package/dist/preview/{chunk.NKUNCQB3.js → chunk.7KX36ENH.js} +1 -1
- package/dist/preview/{chunk.JPJHM62B.js → chunk.7LPHWJB4.js} +1 -1
- package/dist/preview/chunk.7MDGPTYF.js +1 -0
- package/dist/preview/{chunk.JEQ6CA5M.js → chunk.7PWLRRUS.js} +2 -2
- package/dist/preview/{chunk.YBQUP3KE.js → chunk.7TACFS7Q.js} +1 -1
- package/dist/preview/{chunk.DIVANC3G.js → chunk.7THS3DLZ.js} +1 -1
- package/dist/preview/{chunk.5W7EGQCQ.js → chunk.7XGU6KVF.js} +2 -2
- package/dist/preview/chunk.7ZLCA3WK.js +1 -0
- package/dist/preview/{chunk.4BSEYZMS.js → chunk.ARGEGV5T.js} +1 -1
- package/dist/preview/{chunk.3KF5RYPW.js → chunk.BSWR5SGX.js} +1 -1
- package/dist/preview/{chunk.BBMX3IIO.js → chunk.BWMPC7LK.js} +1 -1
- package/dist/preview/{chunk.55C7WO4X.js → chunk.CEJIH3CN.js} +1 -1
- package/dist/preview/{chunk.F5756PXX.js → chunk.CEOQY5KS.js} +2 -2
- package/dist/preview/{chunk.NZFO6BM3.js → chunk.CGRX6SDE.js} +1 -1
- package/dist/preview/{chunk.C67TMA4U.js → chunk.CPK6CYKN.js} +1 -1
- package/dist/preview/{chunk.T552MHMU.js → chunk.CVN2XFMF.js} +1 -1
- package/dist/preview/{chunk.MGG5DH2S.js → chunk.D4F6QX5L.js} +1 -1
- package/dist/preview/{chunk.M3HLZX6Q.js → chunk.D6ODKMOV.js} +1 -1
- package/dist/preview/{chunk.RECTEAG4.js → chunk.DDSAFU3B.js} +1 -1
- package/dist/preview/{chunk.UJF6YTEO.js → chunk.DG3YNOH3.js} +1 -1
- package/dist/preview/chunk.DGYWNM5U.js +1 -0
- package/dist/preview/{chunk.NBB5ALVJ.js → chunk.DHO3QZYK.js} +1 -1
- package/dist/preview/{chunk.4QBW46XV.js → chunk.DJGZOPAS.js} +1 -1
- package/dist/preview/{chunk.2MWEYNVH.js → chunk.DX7RGK5G.js} +1 -1
- package/dist/preview/{chunk.CZI6J5CE.js → chunk.EA2KYBBR.js} +1 -1
- package/dist/preview/{chunk.DWMFLLJO.js → chunk.EEGVI266.js} +1 -1
- package/dist/preview/{chunk.BQWMHHAZ.js → chunk.EHLV3LND.js} +2 -2
- package/dist/preview/{chunk.3MPLUSVY.js → chunk.EJC7ACZT.js} +1 -1
- package/dist/preview/{chunk.6NYSB6OZ.js → chunk.EJIQDMLU.js} +1 -1
- package/dist/preview/{chunk.QQUZ5RTQ.js → chunk.EOSN5DWW.js} +1 -1
- package/dist/preview/{chunk.2QALBEWP.js → chunk.EPSYX2SF.js} +1 -1
- package/dist/preview/chunk.EUXAIG73.js +1 -0
- package/dist/preview/{chunk.S4QSZRKH.js → chunk.EZQK23AB.js} +1 -1
- package/dist/preview/{chunk.ZTHZHBVN.js → chunk.F5O3HR7X.js} +1 -1
- package/dist/preview/chunk.F6MY6WJ4.js +1 -0
- package/dist/preview/{chunk.UVMHC6VM.js → chunk.F7KVEWFH.js} +1 -1
- package/dist/preview/{chunk.FJXKQZZS.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.IJVR7ZL7.js → chunk.G5AF5IXL.js} +1 -1
- package/dist/preview/{chunk.SCN6IYDG.js → chunk.G767NLBH.js} +1 -1
- package/dist/preview/{chunk.X7HMTN3Z.js → chunk.GFBE4VNT.js} +1 -1
- package/dist/preview/{chunk.U5Q7EVZQ.js → chunk.GFOZVQBQ.js} +1 -1
- package/dist/preview/{chunk.KJAOJTZZ.js → chunk.GKYJQE5A.js} +1 -1
- package/dist/preview/{chunk.YCMMATFK.js → chunk.GOVRX2YX.js} +1 -1
- package/dist/preview/{chunk.U3CV227I.js → chunk.H33XWGAY.js} +1 -1
- package/dist/preview/{chunk.DGDOZHYK.js → chunk.H4BPTMED.js} +1 -1
- package/dist/preview/chunk.HLKDYI6J.js +1 -0
- package/dist/preview/{chunk.C4LC2UEU.js → chunk.HPFEYMGP.js} +1 -1
- package/dist/preview/{chunk.CLJKQLK2.js → chunk.HT35PAHI.js} +2 -2
- package/dist/preview/{chunk.6VG2LCES.js → chunk.HXRHEPPJ.js} +1 -1
- package/dist/preview/{chunk.LZNHTROY.js → chunk.IXYG65TM.js} +1 -1
- package/dist/preview/chunk.IZDB777E.js +1 -0
- package/dist/preview/{chunk.ZQSV5XVB.js → chunk.JAPTTM6Y.js} +1 -1
- package/dist/preview/{chunk.CUA7F3YJ.js → chunk.JCKIJSW7.js} +1 -1
- package/dist/preview/{chunk.WAIIXXVI.js → chunk.JLNTE5CH.js} +2 -2
- package/dist/preview/{chunk.5FQHZVE3.js → chunk.JNK5WBSU.js} +1 -1
- package/dist/preview/chunk.JREA2XDG.js +1 -0
- package/dist/preview/{chunk.CHG522KL.js → chunk.KBJ3UUER.js} +1 -1
- package/dist/preview/{chunk.VBHV4TLG.js → chunk.KHRS2SKB.js} +1 -1
- package/dist/preview/{chunk.CZUUFO6A.js → chunk.KJPLX72N.js} +1 -1
- package/dist/preview/{chunk.7LAXSQQY.js → chunk.KZUHXOZU.js} +2 -2
- package/dist/preview/{chunk.R65YX332.js → chunk.L3MLGFIS.js} +1 -1
- package/dist/preview/{chunk.RXUL6P7Y.js → chunk.L6P55HFW.js} +1 -1
- package/dist/preview/{chunk.J4NY2K2A.js → chunk.LDWWUKKX.js} +1 -1
- package/dist/preview/{chunk.RIP2SAQ5.js → chunk.LHCGC3K6.js} +1 -1
- package/dist/preview/{chunk.IQCMV5WD.js → chunk.LNKY6MT4.js} +1 -1
- package/dist/preview/chunk.LQ5J6YQW.js +1 -0
- package/dist/preview/{chunk.O2XPLDMM.js → chunk.MEAUTBVM.js} +1 -1
- package/dist/preview/chunk.MEBKTW7H.js +17 -0
- package/dist/preview/{chunk.K6EKSURO.js → chunk.MFMC35ET.js} +1 -1
- package/dist/preview/chunk.MJ4T6YXI.js +1 -0
- package/dist/preview/{chunk.SWY6DIE4.js → chunk.MKJV3BM5.js} +3 -3
- package/dist/preview/chunk.ML4X7VVK.js +1 -0
- package/dist/preview/{chunk.ZOSTOVXR.js → chunk.MM7MLBGB.js} +1 -1
- package/dist/preview/{chunk.NCBUECIW.js → chunk.MQNW3O67.js} +1 -1
- package/dist/preview/{chunk.CVVNHQPO.js → chunk.MT252WP4.js} +1 -1
- package/dist/preview/{chunk.VKQONZKR.js → chunk.MWWNKM3I.js} +1 -1
- package/dist/preview/chunk.N3MXLORL.js +3 -0
- package/dist/preview/{chunk.SUYYDJGZ.js → chunk.NH3VXTGX.js} +1 -1
- package/dist/preview/{chunk.IRPMGHZN.js → chunk.NI4OPHTL.js} +1 -1
- package/dist/preview/chunk.NNGG7RCO.js +1 -0
- package/dist/preview/{chunk.MZSWWMX6.js → chunk.NXHEOHRR.js} +1 -1
- package/dist/preview/{chunk.A5ENJJZN.js → chunk.O5RPSUXV.js} +1 -1
- package/dist/preview/{chunk.CM7EDQ4E.js → chunk.OKHXXIMN.js} +1 -1
- package/dist/preview/chunk.OOQG2AEF.js +1 -0
- package/dist/preview/{chunk.MYR36HW4.js → chunk.OPMGQS5J.js} +1 -1
- package/dist/preview/{chunk.TUVPQLFL.js → chunk.OUF2QFZL.js} +1 -1
- package/dist/preview/{chunk.6QMRDSTD.js → chunk.OVSKPBPS.js} +1 -1
- package/dist/preview/chunk.OYMN3IFX.js +1 -0
- package/dist/preview/{chunk.3HFBHLXC.js → chunk.P43LPXXJ.js} +1 -1
- package/dist/preview/{chunk.FSZQTX3K.js → chunk.PGT4ZQDG.js} +4 -4
- package/dist/preview/{chunk.5IM2X3VT.js → chunk.PQTXM4VY.js} +1 -1
- package/dist/preview/{chunk.U2DZE7A5.js → chunk.Q6GEPVQ7.js} +1 -1
- package/dist/preview/{chunk.HMV4ILAC.js → chunk.QDDDKEBH.js} +1 -1
- package/dist/preview/{chunk.6KYTCEIH.js → chunk.QJJWAYHB.js} +1 -1
- package/dist/preview/{chunk.QAERSZVB.js → chunk.QK4QZVQG.js} +1 -1
- package/dist/preview/{chunk.XAN7QXMQ.js → chunk.QKRQPUCE.js} +1 -1
- package/dist/preview/{chunk.I3ADXJQW.js → chunk.QNWGDG2Z.js} +1 -1
- package/dist/preview/{chunk.NZ5TJKPT.js → chunk.QVBP4UZG.js} +2 -2
- package/dist/preview/{chunk.YTRUZ56A.js → chunk.RDUGUC7R.js} +1 -1
- package/dist/preview/{chunk.TVNY7F64.js → chunk.RHIP2UYE.js} +1 -1
- package/dist/preview/{chunk.PYGNO2AV.js → chunk.RJ7VSWTA.js} +3 -3
- package/dist/preview/{chunk.LEZGBHPZ.js → chunk.RO3D2RNP.js} +1 -1
- package/dist/preview/{chunk.KOVTQCHX.js → chunk.S2BMI23H.js} +1 -1
- package/dist/preview/{chunk.XJ4JYROM.js → chunk.SPJ34VHA.js} +1 -1
- package/dist/preview/{chunk.LZ3HO3HM.js → chunk.T6KOL7TW.js} +1 -1
- package/dist/preview/{chunk.BJ3G7J2Z.js → chunk.T6UJEXFL.js} +3 -2
- package/dist/preview/{chunk.T4QRIJE4.js → chunk.TBEKEHFS.js} +1 -1
- package/dist/preview/chunk.TO3ZKCA2.js +1 -0
- package/dist/preview/{chunk.QILGAV7H.js → chunk.TQ3MNB6K.js} +1 -1
- package/dist/preview/{chunk.F5XWYO5W.js → chunk.TRP66PHK.js} +1 -1
- package/dist/preview/{chunk.QODVFVWE.js → chunk.TSZ2S3VG.js} +1 -1
- package/dist/preview/{chunk.DWPM7AWA.js → chunk.TTM5GQ2U.js} +1 -1
- package/dist/preview/chunk.TUBY6SV3.js +1 -0
- package/dist/preview/{chunk.7QWGIGHM.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.MR776WQ2.js → chunk.UQZ2P6KD.js} +1 -1
- package/dist/preview/{chunk.OXXZGPJZ.js → chunk.UZKBFI52.js} +1 -1
- package/dist/preview/{chunk.HIJ72QX6.js → chunk.V5JB5UJS.js} +1 -1
- package/dist/preview/{chunk.3I2SGKKF.js → chunk.VDFQFLTU.js} +1 -1
- package/dist/preview/{chunk.I6HIVTXU.js → chunk.VGYG2IBZ.js} +1 -1
- package/dist/preview/chunk.VICBF3MQ.js +2 -0
- package/dist/preview/{chunk.TD2V74XU.js → chunk.VL3YDD7D.js} +1 -1
- package/dist/preview/{chunk.A7JORJJL.js → chunk.VPFUOTY7.js} +1 -1
- package/dist/preview/{chunk.UWEFODVV.js → chunk.VUDNQOOX.js} +1 -1
- package/dist/preview/{chunk.YIDNZTON.js → chunk.VVIQSFM4.js} +1 -1
- package/dist/preview/{chunk.J65CZJIC.js → chunk.W332P5T3.js} +1 -1
- package/dist/preview/{chunk.S6IKR6RD.js → chunk.W3TJF4EH.js} +1 -1
- package/dist/preview/{chunk.7FTATAH2.js → chunk.W5O5F4FT.js} +1 -1
- package/dist/preview/chunk.W6L2VAJG.js +2 -0
- package/dist/preview/{chunk.QG3LV4RH.js → chunk.WGH2P2YL.js} +1 -1
- package/dist/preview/{chunk.KV3N6VRG.js → chunk.WS5ORRGS.js} +1 -1
- package/dist/preview/{chunk.7HNMG6LG.js → chunk.WU6D3SPL.js} +1 -1
- package/dist/preview/{chunk.MSWOETXN.js → chunk.X2UYEA7H.js} +1 -1
- package/dist/preview/{chunk.FBDCHJS2.js → chunk.X45EITTK.js} +1 -1
- package/dist/preview/{chunk.JIEBGUCA.js → chunk.X7U3JMBR.js} +1 -1
- package/dist/preview/chunk.XSM4OTF4.js +1 -0
- package/dist/preview/{chunk.5A5DI36V.js → chunk.XTHSPLZZ.js} +1 -1
- package/dist/preview/{chunk.TS5APXWC.js → chunk.Y5WQD6KV.js} +1 -1
- package/dist/preview/{chunk.3QPMFUMV.js → chunk.YXVUJ3NB.js} +1 -1
- package/dist/preview/{chunk.F5STM4DX.js → chunk.Z22C2JJ4.js} +1 -1
- package/dist/preview/{chunk.BBLA4PSP.js → chunk.Z2BCOZDZ.js} +1 -1
- package/dist/preview/{chunk.BZXJKWNI.js → chunk.Z3TK2LJM.js} +1 -1
- package/dist/preview/chunk.ZGLOXN7O.js +1 -0
- package/dist/preview/{chunk.UJM5EZDM.js → chunk.ZLQIGZXO.js} +1 -1
- package/dist/preview/{chunk.FUTSLXWN.js → chunk.ZONRIOIA.js} +1 -1
- package/dist/preview/{chunk.NTAC5NNE.js → chunk.ZY3NAJDM.js} +1 -1
- package/dist/preview/index.html +55 -55
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2QOB62XU.js +0 -1
- package/dist/preview/chunk.36FKQJFM.js +0 -2
- package/dist/preview/chunk.3A3DCALP.js +0 -1
- package/dist/preview/chunk.3GPYKWAD.js +0 -1
- package/dist/preview/chunk.3ZP6IDUC.js +0 -1
- package/dist/preview/chunk.53HW224Y.js +0 -1
- package/dist/preview/chunk.AW74DZ5V.js +0 -17
- package/dist/preview/chunk.CCCSZRKU.js +0 -1
- package/dist/preview/chunk.DBSSCJQM.js +0 -1
- package/dist/preview/chunk.DW6KXAUM.js +0 -1
- package/dist/preview/chunk.HHQUCFN4.js +0 -1
- package/dist/preview/chunk.HPWMCS3H.js +0 -23
- package/dist/preview/chunk.HRLCDBMO.js +0 -1
- package/dist/preview/chunk.I7ODVOO5.js +0 -1
- package/dist/preview/chunk.IANOWT3Z.js +0 -1
- package/dist/preview/chunk.IFPJPJ4M.js +0 -1
- package/dist/preview/chunk.IUVRJDL3.js +0 -5
- package/dist/preview/chunk.J4CSY2D5.js +0 -2
- package/dist/preview/chunk.JJIKTTXB.js +0 -1
- package/dist/preview/chunk.KDOJC4FX.js +0 -1
- package/dist/preview/chunk.KLZPUTMU.js +0 -1
- package/dist/preview/chunk.LQ2PDW2M.js +0 -32
- package/dist/preview/chunk.MNWP3TPN.js +0 -1
- package/dist/preview/chunk.NILR2BWR.js +0 -1
- package/dist/preview/chunk.NNYKLENL.js +0 -1
- package/dist/preview/chunk.PZHCWMKT.js +0 -1
- package/dist/preview/chunk.QVID5WHS.js +0 -1
- package/dist/preview/chunk.RHV73CBA.js +0 -3
- package/dist/preview/chunk.RP6C2IUM.js +0 -1
- package/dist/preview/chunk.RPHZY7N4.js +0 -1
- package/dist/preview/chunk.UYBSVE2W.js +0 -1
- package/dist/preview/chunk.WMZ2BINI.js +0 -1
- package/dist/preview/chunk.X2RHBTJI.js +0 -1
- package/dist/preview/chunk.X3FPVFFB.js +0 -1
- package/dist/preview/chunk.X4PFLIXB.js +0 -1
- package/dist/preview/chunk.YR7DKU5T.js +0 -1
- package/dist/preview/chunk.ZBK3FCVE.js +0 -1
- package/dist/preview/chunk.ZH5L746C.js +0 -1
|
@@ -1 +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 le,b as O,c as ue}from"./chunk.RIP2SAQ5.js";import{A as te,C as re,E as oe,G as ae,I as ie,M as se,O as de,R as ce,i as J,j as Q,l as X,r as Y,u as ee,v as ne}from"./chunk.PYGNO2AV.js";import{a as W}from"./chunk.3HFBHLXC.js";import{Ba as _,Ca as F,Da as j,G as $,Pa as Z,Wa as U,Y as G,ga as q,ia as z}from"./chunk.CUA7F3YJ.js";import{a as K}from"./chunk.SDO3U72B.js";import{fd as T,jd as I}from"./chunk.IUVRJDL3.js";import{b as V}from"./chunk.AJZBJBMO.js";var o=V($(),1);var h=V($(),1),k,he=K(()=>(__graviewPreload(import.meta.url,["./chunk.SGYZM6ZU.js","./chunk.CEQQIW7Z.js","./chunk.K6EKSURO.js","./chunk.KJAOJTZZ.js","./chunk.S4QSZRKH.js","./chunk.QDVGHI7R.js","./chunk.R65YX332.js","./chunk.MIE4TJRW.js","./chunk.RP6C2IUM.js","./chunk.RD2FSSLV.js","./chunk.T552MHMU.js","./chunk.ZGJUCVT5.js","./chunk.CVVNHQPO.js","./chunk.YIDNZTON.js","./chunk.QILGAV7H.js","./chunk.I6HIVTXU.js","./chunk.CUA7F3YJ.js","./chunk.SDO3U72B.js","./chunk.IUVRJDL3.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.IFPJPJ4M.js"))),ye=()=>he().then(e=>void(k=e),()=>new Promise(e=>setTimeout(e,2e3)).then(ye)),pe=j(ye),ke=e=>!!e&&k===void 0;function Ae({onReady:e,fetch:n}){return(0,h.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var ge=0;function xe(e){let[n,t]=(0,h.useState)(()=>k);(0,h.useEffect)(()=>{if(!e||n)return;let i=!1;return pe().then(()=>{i||t(k)}),()=>{i=!0}},[e,n]);let r=(0,h.useMemo)(()=>ge+=1,[e]);return{over:(0,h.useMemo)(()=>{let i=n??k;if(!e||!i)return;let{source:s,worker:d,...l}=e,c={...l,worker:d??{source:s},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:g=>i.registerWorkerView(g,c)}},[e,n]),n:r}}var we=[];function me(e,n,t){let[r,a]=(0,h.useState)(we);return(0,h.useEffect)(()=>{let i=()=>void pe().then(()=>a(n.forked()));if(n?.forked)return n.forked().length>0&&i(),n.onChange?.(i)},[n]),(0,h.useMemo)(()=>r.length>0&&k?r.reduce((i,s)=>k.registerWorkerView(i,{manifest:s.manifest,worker:{source:s.source},...s.draft?{keepsNothing:!0}:{}}),F(_(t),e)):e,[e,r,t])}var p=V(G(),1),De=e=>typeof e=="object"?e:{};function Ne({rootRef:e,firstLook:n,app:t}){let r=(0,o.useCallback)(()=>e.current,[e]);return n?(0,p.jsx)(ce,{firstLook:n,root:r,app:t}):null}function Le(e,n,t){let{app:r}=e,a=(0,o.useMemo)(()=>{let s=se(n(r.schema,r.viewSpecs),r),d=t?Se(s,t):s,l=e.views?e.views(r.schema,d):s,c=l===d?s:F(s,l);return de(c,r.schema,ae(e.brand??r.brand,r.schema)),t?t.register(c):c},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]),i=me(a,e.keptViews,r.schema);return Z(i,e.keptViews)}function Se(e,n){let t={...e,register(r,a,i,s){return s?.name!==n.name&&e.register(r,a,i,s),t},...e.home?{home:(r,a)=>(n.home||e.home(r,a),t)}:{}};return t}var B=e=>e?e.getBoundingClientRect().height:0;function Te(e,n,t){let r=(0,o.useRef)(t);r.current=t;let a=t!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let s=()=>{let m=[...i.children],w=m.find(v=>v.hasAttribute("data-graview-app-bar")),f=m.find(v=>v.hasAttribute("data-embed-content")),S=f?.querySelector("[data-embed-measure]")??null,u=m.find(v=>v.hasAttribute("data-graview-place-line"));return{strip:w,line:u,content:f,measure:S}},d=-1,l=()=>{let{strip:m,line:w,content:f,measure:S}=s(),u=Math.ceil(B(m)+B(w)+B(S||f));u!==d&&(d=u,r.current?.(u))};if(l(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(l),g=()=>{c.disconnect();let{strip:m,line:w,content:f,measure:S}=s();for(let u of[i,m,w,f,S])u&&c.observe(u)};g();let R=new MutationObserver(()=>{g(),l()});return R.observe(i,{childList:!0}),()=>{c.disconnect(),R.disconnect()}},[e,n,a])}var Ie=480,ve=0;function Ke(e){let{app:n,seed:t,scheme:r="auto",brand:a=n.brand,fonts:i=!0,height:s="100%",label:d}=e,l=(0,o.useRef)(null);U(l);let c=s==="viewport"?"100dvh":s,g=X(typeof c=="string"&&/vh\b/.test(c)),R=(0,o.useMemo)(()=>`graview-embed-${++ve}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??O(n,t),[e.store,e.remote,n,t]),w=e.presence??e.remote?.presence,f=e.hostContext?.theme,S=ue(r==="auto"&&f===void 0,a?.scheme),u=r==="auto"?f??S:r,v=(0,o.useMemo)(()=>W(u,a,{scope:`.${R}`}),[u,a,R]);J(e.favicon?I(e.assetsAt,T(a)):void 0),Q(e.favicon?a:void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let b=le(a);if(!b||document.querySelector(`link[href="${b}"]`))return;let y=document.createElement("link");y.rel="stylesheet",y.href=b,document.head.appendChild(y)},[a,i]);let C=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let b=l.current,y=C.current;if(C.current=d,!b||!d)return;let P=E=>{let A=E.getAttribute("aria-label")??"",x=y&&y!==d?A.startsWith(`${y} \xB7 `)?A.slice(y.length+3):A===y?"":A:A;x===d&&(E.getAttribute("role")==="region"||E.tagName==="SECTION"&&!E.hasAttribute("role"))&&E.setAttribute("role","group");let L=x.startsWith(`${d} \xB7 `)||x===d?x:x?`${d} \xB7 ${x}`:d;L!==A&&E.setAttribute("aria-label",L)},D=()=>b.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(E=>{E.hasAttribute("data-graview-named-by-lens")||P(E)});D();let N=new MutationObserver(D);return N.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>N.disconnect()},[d]);let H=g?`${c}`.replace(/([\d.]+)[sdl]?vh\b/g,(b,y)=>`${+y*g/100}px`):c;return{rootRef:l,scope:R,css:v,scheme:u,store:m,presence:w,brand:a,auto:s==="auto",height:H}}function We({rootRef:e,board:n,onReport:t,where:r}){let a=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]),i=(0,o.useRef)(r);i.current=r;let s=(0,o.useMemo)(()=>t?{tell:t,where:()=>i.current()}:void 0,[t]);return(0,p.jsx)(Y,{board:n,anchor:a,report:s})}function $e(e){let n=e.split(/[?#]/)[0].split("/").filter(Boolean).map(t=>{try{return decodeURIComponent(t)}catch{return t}});return n.length===0?{place:"home"}:n[0]==="places"?{place:n[1]??"places"}:{place:n[0],...n[1]!==void 0?{record:n[1]}:{}}}function Ge(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,onProposeChange:e.onProposeChange,composeChange:e.composeChange,onDraftChange:e.onDraftChange,displayOptions:e.displayOptions,ai:e.ai,files:e.files,viewerState:e.viewerState,assetsAt:e.assetsAt,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,notifications:e.notifications,onNotificationsSeen:e.onNotificationsSeen,workflowRuns:e.workflowRuns,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function qe({name:e,heading:n,faces:t,at:r,without:a,home:i,reach:s,standing:d,hostActions:l,barActions:c,appMenu:g,schemeChoice:R,share:m,status:w,keeping:f,onFind:S,named:u=!0}){let{brand:v,store:C,principal:H,views:b}=q();z();let y=a?.has("places")?[]:ee({store:C,principal:H,views:b}),P=oe();return(0,p.jsx)(te,{brand:v,name:e,named:u,description:v?.subtitle,heading:n,faces:t,home:i,places:y,current:r===null?null:ne(y,r),reach:s,onFind:S,...t||r===null?{scenePlaces:P}:{},...c?{actions:c}:{},...g?{appMenu:g}:{},...R?{scheme:R}:{},...m?{share:m}:{},...w?{status:w}:{},tools:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ie,{clean:d}),(0,p.jsx)(re,{...l?{hostActions:l}:{},...f?{keeping:f}:{}})]})})}var ze=e=>({appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications});function _e(e){return{appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications}}var je=e=>e===!1?2:Math.min(e+1,6);function Ze(e){let[n,t]=(0,o.useState)(e),r=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:r,at:t,pending:a}),[]),s=(0,o.useCallback)(d=>{if(r.current){r.current(d);return}a.current=d,t(d)},[]);return{at:n,setAt:t,steering:i,steer:s}}function be(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var M=()=>typeof performance<"u"?performance.now():Date.now();function Ue(e,n){let t=(0,o.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,o.useCallback)((r,a)=>t.current.onError?.(be(r),{module:a.module,face:t.current.face}),[])}function Je(e,n){let t=(0,o.useRef)(null);t.current===null&&(t.current=M());let r=(0,o.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,r.current.onReady?.({ms:Math.max(0,M()-(t.current??M())),face:i}))},[])}var fe=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,p.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,p.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,p.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{pe as a,ke as b,Ae as c,xe as d,De as e,Ne as f,Le as g,Te as h,Ie as i,Ke as j,We as k,$e as l,Ge as m,qe as n,ze as o,_e as p,je as q,Ze as r,Ue as s,Je as t,fe as u};
|
|
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 le,b as O,c as ue}from"./chunk.LHCGC3K6.js";import{A as te,C as re,E as oe,G as ae,I as ie,M as se,O as de,R as ce,i as J,j as Q,l as X,r as Y,u as ee,v as ne}from"./chunk.RJ7VSWTA.js";import{a as W}from"./chunk.P43LPXXJ.js";import{Ba as _,Ca as F,Da as j,G as $,Pa as Z,Wa as U,Y as G,ga as q,ia as z}from"./chunk.JCKIJSW7.js";import{a as K}from"./chunk.SDO3U72B.js";import{fd as T,jd as I}from"./chunk.6L6RUOSF.js";import{b as V}from"./chunk.AJZBJBMO.js";var o=V($(),1);var h=V($(),1),k,he=K(()=>(__graviewPreload(import.meta.url,["./chunk.SGYZM6ZU.js","./chunk.CEQQIW7Z.js","./chunk.MFMC35ET.js","./chunk.GKYJQE5A.js","./chunk.EZQK23AB.js","./chunk.QDVGHI7R.js","./chunk.L3MLGFIS.js","./chunk.MIE4TJRW.js","./chunk.3CLTABGP.js","./chunk.RD2FSSLV.js","./chunk.CVN2XFMF.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.JCKIJSW7.js","./chunk.SDO3U72B.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.FNSVGSZI.js"))),ye=()=>he().then(e=>void(k=e),()=>new Promise(e=>setTimeout(e,2e3)).then(ye)),pe=j(ye),ke=e=>!!e&&k===void 0;function Ae({onReady:e,fetch:n}){return(0,h.useLayoutEffect)(()=>void n().then(e),[e,n]),null}var ge=0;function xe(e){let[n,t]=(0,h.useState)(()=>k);(0,h.useEffect)(()=>{if(!e||n)return;let i=!1;return pe().then(()=>{i||t(k)}),()=>{i=!0}},[e,n]);let r=(0,h.useMemo)(()=>ge+=1,[e]);return{over:(0,h.useMemo)(()=>{let i=n??k;if(!e||!i)return;let{source:s,worker:d,...l}=e,c={...l,worker:d??{source:s},draft:!0};return{name:e.manifest.name,home:e.manifest.attach==="home",register:g=>i.registerWorkerView(g,c)}},[e,n]),n:r}}var we=[];function me(e,n,t){let[r,a]=(0,h.useState)(we);return(0,h.useEffect)(()=>{let i=()=>void pe().then(()=>a(n.forked()));if(n?.forked)return n.forked().length>0&&i(),n.onChange?.(i)},[n]),(0,h.useMemo)(()=>r.length>0&&k?r.reduce((i,s)=>k.registerWorkerView(i,{manifest:s.manifest,worker:{source:s.source},...s.draft?{keepsNothing:!0}:{}}),F(_(t),e)):e,[e,r,t])}var p=V(G(),1),De=e=>typeof e=="object"?e:{};function Ne({rootRef:e,firstLook:n,app:t}){let r=(0,o.useCallback)(()=>e.current,[e]);return n?(0,p.jsx)(ce,{firstLook:n,root:r,app:t}):null}function Le(e,n,t){let{app:r}=e,a=(0,o.useMemo)(()=>{let s=se(n(r.schema,r.viewSpecs),r),d=t?Se(s,t):s,l=e.views?e.views(r.schema,d):s,c=l===d?s:F(s,l);return de(c,r.schema,ae(e.brand??r.brand,r.schema)),t?t.register(c):c},[e.views,r.schema,r.viewSpecs,r.lenses,r.pages,r.home,t]),i=me(a,e.keptViews,r.schema);return Z(i,e.keptViews)}function Se(e,n){let t={...e,register(r,a,i,s){return s?.name!==n.name&&e.register(r,a,i,s),t},...e.home?{home:(r,a)=>(n.home||e.home(r,a),t)}:{}};return t}var B=e=>e?e.getBoundingClientRect().height:0;function Te(e,n,t){let r=(0,o.useRef)(t);r.current=t;let a=t!==void 0;(0,o.useLayoutEffect)(()=>{let i=e.current;if(!i||!a)return;let s=()=>{let m=[...i.children],w=m.find(v=>v.hasAttribute("data-graview-app-bar")),f=m.find(v=>v.hasAttribute("data-embed-content")),S=f?.querySelector("[data-embed-measure]")??null,u=m.find(v=>v.hasAttribute("data-graview-place-line"));return{strip:w,line:u,content:f,measure:S}},d=-1,l=()=>{let{strip:m,line:w,content:f,measure:S}=s(),u=Math.ceil(B(m)+B(w)+B(S||f));u!==d&&(d=u,r.current?.(u))};if(l(),typeof ResizeObserver>"u")return;let c=new ResizeObserver(l),g=()=>{c.disconnect();let{strip:m,line:w,content:f,measure:S}=s();for(let u of[i,m,w,f,S])u&&c.observe(u)};g();let R=new MutationObserver(()=>{g(),l()});return R.observe(i,{childList:!0}),()=>{c.disconnect(),R.disconnect()}},[e,n,a])}var Ie=480,ve=0;function Ke(e){let{app:n,seed:t,scheme:r="auto",brand:a=n.brand,fonts:i=!0,height:s="100%",label:d}=e,l=(0,o.useRef)(null);U(l);let c=s==="viewport"?"100dvh":s,g=X(typeof c=="string"&&/vh\b/.test(c)),R=(0,o.useMemo)(()=>`graview-embed-${++ve}`,[]),m=(0,o.useMemo)(()=>e.store??e.remote?.store??O(n,t),[e.store,e.remote,n,t]),w=e.presence??e.remote?.presence,f=e.hostContext?.theme,S=ue(r==="auto"&&f===void 0,a?.scheme),u=r==="auto"?f??S:r,v=(0,o.useMemo)(()=>W(u,a,{scope:`.${R}`}),[u,a,R]);J(e.favicon?I(e.assetsAt,T(a)):void 0),Q(e.favicon?a:void 0),(0,o.useEffect)(()=>{if(!i||typeof document>"u")return;let b=le(a);if(!b||document.querySelector(`link[href="${b}"]`))return;let y=document.createElement("link");y.rel="stylesheet",y.href=b,document.head.appendChild(y)},[a,i]);let C=(0,o.useRef)(void 0);(0,o.useLayoutEffect)(()=>{let b=l.current,y=C.current;if(C.current=d,!b||!d)return;let P=E=>{let A=E.getAttribute("aria-label")??"",x=y&&y!==d?A.startsWith(`${y} \xB7 `)?A.slice(y.length+3):A===y?"":A:A;x===d&&(E.getAttribute("role")==="region"||E.tagName==="SECTION"&&!E.hasAttribute("role"))&&E.setAttribute("role","group");let L=x.startsWith(`${d} \xB7 `)||x===d?x:x?`${d} \xB7 ${x}`:d;L!==A&&E.setAttribute("aria-label",L)},D=()=>b.querySelectorAll("aside, nav, main, header, footer, section[aria-label]:not([role]), [role=region], [role=complementary], [role=navigation], [role=search]").forEach(E=>{E.hasAttribute("data-graview-named-by-lens")||P(E)});D();let N=new MutationObserver(D);return N.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["aria-label"]}),()=>N.disconnect()},[d]);let H=g?`${c}`.replace(/([\d.]+)[sdl]?vh\b/g,(b,y)=>`${+y*g/100}px`):c;return{rootRef:l,scope:R,css:v,scheme:u,store:m,presence:w,brand:a,auto:s==="auto",height:H}}function We({rootRef:e,board:n,onReport:t,where:r}){let a=(0,o.useCallback)(()=>e.current?.querySelector("[data-embed-content]")??e.current,[e]),i=(0,o.useRef)(r);i.current=r;let s=(0,o.useMemo)(()=>t?{tell:t,where:()=>i.current()}:void 0,[t]);return(0,p.jsx)(Y,{board:n,anchor:a,report:s})}function $e(e){let n=e.split(/[?#]/)[0].split("/").filter(Boolean).map(t=>{try{return decodeURIComponent(t)}catch{return t}});return n.length===0?{place:"home"}:n[0]==="places"?{place:n[1]??"places"}:{place:n[0],...n[1]!==void 0?{record:n[1]}:{}}}function Ge(e,n,t){return{brand:t,locale:e.locale,timeZone:e.timeZone,principal:e.principal,seats:e.seats,presence:n,typing:e.remote?.typing,people:e.people,memory:e.memory,presenceTtlMs:e.presenceTtlMs,onKeepLens:e.onKeepLens,onProposeChange:e.onProposeChange,composeChange:e.composeChange,onDraftChange:e.onDraftChange,displayOptions:e.displayOptions,ai:e.ai,files:e.files,viewerState:e.viewerState,assetsAt:e.assetsAt,resolveApp:e.resolveApp,history:e.history,linkedRecords:e.linkedRecords,subscriptions:e.subscriptions,dismissals:e.dismissals,whileAway:e.whileAway,notifications:e.notifications,onNotificationsSeen:e.onNotificationsSeen,workflowRuns:e.workflowRuns,keptViews:e.keptViews,onExport:e.onExport,signIn:e.signIn,menuSections:e.menuSections,app:e.app}}function qe({name:e,heading:n,faces:t,at:r,without:a,home:i,reach:s,standing:d,hostActions:l,barActions:c,appMenu:g,schemeChoice:R,share:m,status:w,keeping:f,onFind:S,named:u=!0}){let{brand:v,store:C,principal:H,views:b}=q();z();let y=a?.has("places")?[]:ee({store:C,principal:H,views:b}),P=oe();return(0,p.jsx)(te,{brand:v,name:e,named:u,description:v?.subtitle,heading:n,faces:t,home:i,places:y,current:r===null?null:ne(y,r),reach:s,onFind:S,...t||r===null?{scenePlaces:P}:{},...c?{actions:c}:{},...g?{appMenu:g}:{},...R?{scheme:R}:{},...m?{share:m}:{},...w?{status:w}:{},tools:(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(ie,{clean:d}),(0,p.jsx)(re,{...l?{hostActions:l}:{},...f?{keeping:f}:{}})]})})}var ze=e=>({appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications});function _e(e){return{appMenu:e.appMenu,share:e.share,status:e.status,schemeChoice:e.schemeChoice,notifications:e.notifications}}var je=e=>e===!1?2:Math.min(e+1,6);function Ze(e){let[n,t]=(0,o.useState)(e),r=(0,o.useRef)(void 0),a=(0,o.useRef)(void 0),i=(0,o.useMemo)(()=>({go:r,at:t,pending:a}),[]),s=(0,o.useCallback)(d=>{if(r.current){r.current(d);return}a.current=d,t(d)},[]);return{at:n,setAt:t,steering:i,steer:s}}function be(e){let n=typeof e=="object"&&e!==null?e.name:void 0;return{name:typeof n=="string"&&n.length>0?n:typeof e=="object"?"Error":typeof e}}var M=()=>typeof performance<"u"?performance.now():Date.now();function Ue(e,n){let t=(0,o.useRef)({onError:e,face:n});return t.current={onError:e,face:n},(0,o.useCallback)((r,a)=>t.current.onError?.(be(r),{module:a.module,face:t.current.face}),[])}function Je(e,n){let t=(0,o.useRef)(null);t.current===null&&(t.current=M());let r=(0,o.useRef)({onReady:e,face:n});r.current={onReady:e,face:n};let a=(0,o.useRef)(!1);return(0,o.useCallback)(i=>{a.current||(a.current=!0,r.current.onReady?.({ms:Math.max(0,M()-(t.current??M())),face:i}))},[])}var fe=class extends o.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(n,t){console.error(`[graview] ${this.props.module} threw while rendering`,n,t.componentStack),this.props.report(n,{module:this.props.module})}render(){return this.state.failed?(0,p.jsxs)("div",{role:"alert","data-graview-face-error":this.props.module,...this.props.content?{"data-embed-content":""}:{},style:this.props.content?{flex:"1 1 auto",display:"grid",alignContent:"center",justifyItems:"center",gap:8,padding:24,background:"var(--graview-ground)",color:"var(--graview-ink)",fontSize:"0.9375rem"}:{display:"inline-flex",alignItems:"center",gap:6,fontSize:"0.8125rem",color:"var(--graview-ink-muted)"},children:[(0,p.jsx)("span",{children:this.props.content?"This part of the app could not draw.":"Could not draw."}),(0,p.jsx)("button",{type:"button",onClick:()=>this.setState({failed:!1}),style:{padding:"3px 11px",fontSize:"0.8125rem"},children:"Try again"})]}):this.props.children}};export{pe as a,ke as b,Ae as c,xe as d,De as e,Ne as f,Le as g,Te as h,Ie as i,Ke as j,We as k,$e as l,Ge as m,qe as n,ze as o,_e as p,je as q,Ze as r,Ue as s,Je as t,fe as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c,b as d,c as e,d as f,e as g,f as h,g as i,h as j,i as k,j as l,k as m,l as n,m as o,n as p}from"./chunk.ARGEGV5T.js";import{a,b}from"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.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"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{j as ARRANGE_NARROW,o as ArrangeBar,e as CHIP_FIELDS,d as MANY_AT_THE_FAR_END,c as TYPED_FROM,p as arrangementCaption,a as arrangementOf,i as chipOffers,m as directionWords,g as farCount,f as farCounts,l as inSentence,h as offeredFilters,n as preloadArrangeLists,k as sayCondition,b as withArrangement};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{P as b,Z as g,ha as h,ia as $,mc as x,qc as k}from"./chunk.
|
|
1
|
+
import{P as b,Z as g,ha as h,ia as $,mc as x,qc as k}from"./chunk.6L6RUOSF.js";function z(t,n,e){let r=t?.display?.format?.[n];return r?r(e):typeof e=="string"?$(e):String(e)}function B(t,n,e,r){let s=t.tryDefinition(n)?.edges,i=s&&Object.hasOwn(s,e)?s[e]:void 0;return(r==="out"?i?.description:i?.inverse)??h(e).toLowerCase()}var w=/^ {0,3}#{1,6}(?:[ \t]+|$)/,m=/^[ \t]*(?:[-*+•]|\d{1,9}[.)])[ \t]+(?:\[[ xX]\][ \t]+)?/,R=/^ {0,3}(?:(?:-[ \t]*){3,}|(?:\*[ \t]*){3,}|(?:_[ \t]*){3,})$/,O=/^ {0,3}(?:`{3,}|~{3,})/,S=/^ {0,3}(?:>[ \t]?)+/,F=/^\|?\s*:?-{2,}:?\s*(?:\|\s*:?-{2,}:?\s*)*\|?$/,T={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'",nbsp:" "};function _(t){return t.replace(/!?\[([^\]\n]{0,500})\]\([^)\n]{0,500}\)/g,"$1").replace(/<((?:https?:|mailto:)[^>\s]*)>/gi,"$1").replace(/<\/?[A-Za-z][^<>\n]*>/g,"").replace(/`+([^`\n]*)`+/g,"$1").replace(/(\*\*|__|~~)(?=\S)([^\n]{0,500}?\S)\1/g,"$2").replace(/(^|[^\w*])\*(?=\S)([^*\n]{0,500}?\S)\*(?![\w*])/g,"$1$2").replace(/(^|\W)_(?=\S)([^_\n]{0,500}?\S)_(?!\w)/g,"$1$2").replace(/\\([\\`*_{}[\]()#+\-.!>|~])/g,"$1").replace(/&(amp|lt|gt|quot|#39|nbsp);/g,(n,e)=>T[e]??"")}function N(t,n,e){let r=t.replace(/\r\n?/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),s=[],i=[],u=0,d=!1,a=()=>{let o=i.join(" ").replace(/\s+/g," ").trim();o&&(s.push(o),u+=o.length),i=[]},c=0;for(;c<r.length&&u<=e;){let o=r[c++];if(n&&O.test(o)){d=!d,d||a();continue}if(!d&&(o.trim().length===0||n&&(R.test(o)||F.test(o.trim())))){a();continue}let f=!d&&n&&w.test(o),l=!d&&m.test(o);if((f||l)&&a(),n&&!d?(o=o.replace(S,""),f&&(o=o.replace(w,"").replace(/[ \t]+#+[ \t]*$/,"")),l&&(o=o.replace(m,"")),o.includes("|")&&(o=o.replace(/^[ \t]*\||\|[ \t]*$/g,"").split("|").map(p=>p.trim()).filter(Boolean).join(" \xB7 ")),o=_(Number.isFinite(e)?o.slice(0,e*2+200):o)):l&&(o=o.replace(m,"")),i.push(o),f&&a(),i.reduce((p,A)=>p+A.length,0)>e)break}return a(),{blocks:s,more:r.slice(c).some(o=>o.trim().length>0&&!(n&&(O.test(o)||R.test(o))))}}function E(t,n){return`${(t.slice(0,n+1).replace(/\s+\S*$/,"")||t.slice(0,n)).replace(/[\s,;:.—-]+$/,"")}\u2026`}function Q(t,n={}){let e=n.most??160,{blocks:r,more:s}=N(t,n.markdown===!0,e),i=r[0]??"";if(i.length<=e)return(s||r.length>1)&&i.length>0&&!/[.!?…:]$/.test(i)?`${i}\u2026`:i;let u=k(i);return u&&u.length<=e?u:E(i,e)}var X=t=>N(t,!0,Number.POSITIVE_INFINITY).blocks.join(" ");var j={d:1440,h:60,m:1};function K(t){if(typeof t=="number")return Number.isFinite(t)&&t>=0?Math.round(t):void 0;if(typeof t!="string")return;let n=t.trim().toLowerCase();if(/^\d+$/.test(n))return Number(n);let e=/^(\d+):([0-5]\d)(?::([0-5]\d))?$/.exec(n);if(e)return Number(e[1])*60+Number(e[2])+Math.round(Number(e[3]??0)/60);let r=0,s=!1,i=n.replace(/(\d*[.,]?\d+) *(days?|d|hours?|hrs?|hr|h|minutes?|mins?|min|m)(?![a-z])/g,(u,d,a)=>(s=!0,r+=Number(d.replace(",","."))*j[a[0]]," "));return s&&/^[\s,+]*(?:and[\s,+]*)*$/.test(i)?Math.round(r):void 0}function I(t,n){if(!Number.isFinite(t))return String(t);let e=Math.round(Math.abs(t)),r=Math.floor(e/60),s=e%60,i=[r?`${g(r,n)} h`:"",s||!r?`${g(s,n)} min`:""].filter(Boolean).join(" ");return t<0?`\u2212${i}`:i}var M=/^(\+?1[ .-]?)?\(?([2-9]\d\d)\)?[ .-]?(\d{3})[ .-]?(\d{4})(?: *(?:ext\.?|x|#) *(\d+))?$/i;function W(t,n){let e=t.trim(),r=/[-_](US|CA)\b/i.test(b(n))?M.exec(e):null;if(!r)return e;let[,s,i,u,d,a]=r;return`${s?.startsWith("+")?"+1 ":""}(${i}) ${u}-${d}${a?` ext. ${a}`:""}`}function D(t){let[,n="",e]=/^(.*?)(?: *(?:ext\.?|x|#) *(\d+))?$/i.exec(t.trim())??[],r=n.replace(/\D/g,"");return r.length<3?void 0:`tel:${n.startsWith("+")?"+":""}${r}${e?`;ext=${e}`:""}`}var P=()=>/Mac|iPhone|iPad|iPod/.test(globalThis.navigator?.userAgent??"");function L(t,n=P()){let e=encodeURIComponent(t.trim());return n?`https://maps.apple.com/?q=${e}`:`https://www.google.com/maps/search/?api=1&query=${e}`}var q=t=>t?.fields?.shape??{},C=(t,n)=>{let e=q(t);return Object.hasOwn(e,n)?x(e[n]):void 0},y=(t,n)=>{let e=t?.computed,r=e&&Object.hasOwn(e,n)?e[n]:void 0;return typeof r=="object"?r:void 0},H=(t,n)=>{let e=y(t,n);return e?.as??(e?.format==="duration"?"duration":void 0)};function v(t,n){let e=y(t,n);if(!e)return;if(e.amount)return e.amount;let r=e.format==="money"||e.format==="percent"?e.format:void 0;return r||!e.format&&e.unit?{...r?{format:r}:{},...e.unit?{unit:e.unit}:{}}:void 0}function ee(t,n){return y(t,n)?.hidden===!0}function ne(t,n){return C(t,n)??(t&&H(t,n)==="duration"?"duration":void 0)}function te(t,n,e){return t==="duration"?typeof n=="number"?I(n,e):void 0:t==="phone"?typeof n=="string"?W(n,e):void 0:t==="place"&&typeof n=="string"?n.trim():void 0}function re(t,n){if(!(typeof n!="string"||!n.trim()))return t==="phone"?D(n):t==="place"?L(n):void 0}export{z as a,B as b,Q as c,X as d,K as e,v as f,ee as g,ne as h,te as i,re as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as b,e as y}from"./chunk.FSZQTX3K.js";var e={},h={empty:!0},N={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},p={div:e,section:e,article:e,aside:e,header:e,footer:e,nav:e,hgroup:e,search:e,address:e,figure:e,figcaption:e,blockquote:e,p:e,pre:e,hr:h,br:h,wbr:h,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,span:e,strong:e,em:e,b:e,i:e,u:e,s:e,small:e,mark:e,abbr:e,cite:e,q:e,code:e,kbd:e,samp:e,var:e,sub:e,sup:e,dfn:e,bdi:e,bdo:e,ruby:e,rt:e,rp:e,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:e,menu:e,dl:e,dt:e,dd:e,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:e,caption:e,thead:e,tbody:e,tfoot:e,tr:e,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:e,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:e,output:e,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},L=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],U={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(L.map(r=>[r,"css"]))},d={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},g={viewBox:"geometry",preserveAspectRatio:"geometry"},w={oneOf:["userSpaceOnUse","objectBoundingBox"]},E={oneOf:["R","G","B","A"]},l={...d,in:"text",result:"text"},A={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},f={svg:{attributes:{...d,...g}},g:e,defs:e,symbol:{attributes:{...d,...g,refX:"geometry",refY:"geometry"}},use:{attributes:{...d,href:"fragment"}},title:e,desc:e,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...d,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...A}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...A}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...d,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...d,...g,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...g,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:e,filter:{attributes:{...d,filterUnits:w,primitiveUnits:w}},feBlend:{attributes:{...l,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...l,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:l},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(r=>[r,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...l,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...l,in2:"text",scale:"number",xChannelSelector:E,yChannelSelector:E}},feDropShadow:{attributes:{...l,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:l},feGaussianBlur:{attributes:{...l,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:l},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...l,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...l,dx:"number",dy:"number"}},feTurbulence:{attributes:{...d,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var v=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],re=["region"],x={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},R={section:["aria-label","title"]},ne=["aria-labelledby","aria-describedby"];function C(r){return/^aria-[a-z]+$/.test(r)}function j(r){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(r)}var O=4e3,_=1e5,m=512e3,oe=1e4,se="http://www.w3.org/1999/xhtml",ae="http://www.w3.org/2000/svg",B=new Map(Object.keys(f).map(r=>[r.toLowerCase(),r]));function S(r){return B.get(r.toLowerCase())}function T(r,o,t){let s=t.toLowerCase(),i=r==="html"?[p[o]?.attributes,N]:[f[o]?.attributes,U],n=r==="svg"&&s==="xlink:href"?"href":s;for(let a of i)if(a){for(let[u,c]of Object.entries(a))if(u.toLowerCase()===n)return{name:u,kind:c}}if(C(s)||j(s))return{name:s,kind:"text"}}function de(r,o){if(o==="svg"){let s=S(r);return s?{namespace:"svg",name:s}:{refused:{reason:"element",element:r}}}let t=r.toLowerCase();return t==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(p,t)?Object.prototype.hasOwnProperty.call(x,t)?{namespace:"html",name:x[t],as:t}:{namespace:"html",name:t}:{refused:{reason:"element",element:r}}}function me(r,o){return(r==="html"?p[o]:f[o])?.empty===!0}var z=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,G=/^[0-9A-Za-z\s.,+\-%()]*$/,P=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,I=/^data:image\/(png|gif|jpeg|webp|avif|bmp|svg\+xml)(;[A-Za-z0-9=._+-]+)*,/i,$=/^\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,k=/\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,D=/^\/(?!\/)(?!(?:.*\/)?\.\.?(?:\/|$))(?!.*%(?:2e|2f|5c))[^\\\s?#"'<>]*$/i;function V(r,o){if($.test(r))return r;let t=r;if(/^https?:\/\//i.test(r))try{let s=new URL(r);if(o==="null"||s.origin!==o||s.username!==""||s.password!==""||s.search!==""||s.hash!=="")return;t=r.slice(s.origin.length)}catch{return}if(D.test(t))return k.exec(t)?.[0]}function ce(r,o={},t){let s=r.length>120?`${r.slice(0,119)}\u2026`:r,i=M(o.origins),n=k.exec(r.split(/[?#]/)[0])?.[0],a=t!==void 0&&t>m?` It is a data: image of ${t.toLocaleString("en-US")} characters, more than the ${m.toLocaleString("en-US")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:n?o.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${n}.`:" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.":/^https:\/\//i.test(r)?i.length>0?` Its origin is not one the host lists for images (${i.join(", ")}).`:" The host lists no origin a view's images may come from (images.origins, on the view's definition).":"",u=["a data: image",...o.assets?["the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...i.length>0?[`an https: image from ${i.join(", ")}`]:[]];return`The image "${s}" was not drawn.${a} A view here shows ${u.slice(0,-1).join(", ")} or ${u[u.length-1]}.`}function M(r){return(r??[]).flatMap(o=>{try{let t=new URL(o);return t.protocol==="https:"&&t.hostname!==""&&t.username===""&&t.password===""?[t.origin]:[]}catch{return[]}})}function F(r,o){if(!(!o||o.length===0||!/^https:\/\//i.test(r)))try{let t=new URL(r);return t.protocol!=="https:"||t.username!==""||t.password!==""?void 0:M(o).includes(t.origin)?t.href:void 0}catch{return}}function ge(r,o,t,s,i){let n=T(r,o,t);if(!n)return{refused:{reason:"attribute",element:o,name:t}};if(r==="html"&&R[o]?.includes(n.name))return{refused:{reason:"attribute",element:o,name:t}};if(s===null)return{name:n.name,value:null};let a=H(n.name,n.kind,s,i);return"refused"in a?{refused:{...a.refused,element:o,...n.kind==="image"&&a.refused.reason==="url"?{address:s.slice(0,200),...s.length>m?{length:s.length}:{}}:{},...n.kind==="link"?{address:s.slice(0,200)}:{}}}:n.name==="role"&&a.value.split(/\s+/).some(u=>v.includes(u.toLowerCase()))?{refused:{reason:"value",element:o,name:t}}:n.name==="aria-live"&&!["polite","off"].includes(a.value.toLowerCase())?{refused:{reason:"value",element:o,name:t}}:{name:n.name,value:a.value,...a.dropped?{dropped:a.dropped.map(u=>({reason:u.reason==="url"?"url":"css",element:o,name:n.name,css:u}))}:{}}}function H(r,o,t,s){let i=(n,a)=>({refused:{reason:n,name:r,...a?{css:a}:{}}});if(o==="geometry")return t.length>_||!G.test(t)||/url/i.test(t)?i("value"):{value:t};if(o==="image"){let n=s.picture?.(t);if(n!==void 0)return{value:n};if(t.length>m)return i("url");if(I.test(t))return{value:t};if(t.startsWith(`blob:${s.origin}/`)&&/^blob:[^\s"'<>]+$/.test(t))return{value:t};let a=s.asset?V(t,s.origin):void 0;if(a!==void 0){let c=s.asset(a);if(c)return{value:c}}let u=F(t,s.imageOrigins);return u?{value:u}:i("url")}if(o==="link"){let n=s.link?.(t);return n===void 0?i("url"):{value:n}}if(t.length>O)return i("value");if(typeof o=="object"){let n=o.oneOf.find(a=>a.toLowerCase()===t.toLowerCase());return n===void 0?i("value"):{value:n}}switch(o){case"text":return{value:t};case"number":return z.test(t.trim())&&Number.isFinite(Number(t))?{value:t.trim()}:i("value");case"boolean":return{value:""};case"fragment":return P.test(t)?{value:t}:i("url");case"style":{let n=b(t,O);return n.refused.length>0&&n.css===""?i(n.refused[0].reason==="url"?"url":"css",n.refused[0]):{value:n.css,...n.refused.length>0?{dropped:n.refused}:{}}}case"css":{let n=y(r,t);return"refused"in n?i(n.refused.reason==="url"?"url":"css",n.refused):{value:n.value}}}}export{re as a,ne as b,oe as c,se as d,ae as e,de as f,me as g,ce as h,M as i,ge as j};
|
|
1
|
+
import{d as b,e as y}from"./chunk.PGT4ZQDG.js";var e={},h={empty:!0},N={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},p={div:e,section:e,article:e,aside:e,header:e,footer:e,nav:e,hgroup:e,search:e,address:e,figure:e,figcaption:e,blockquote:e,p:e,pre:e,hr:h,br:h,wbr:h,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,span:e,strong:e,em:e,b:e,i:e,u:e,s:e,small:e,mark:e,abbr:e,cite:e,q:e,code:e,kbd:e,samp:e,var:e,sub:e,sup:e,dfn:e,bdi:e,bdo:e,ruby:e,rt:e,rp:e,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:e,menu:e,dl:e,dt:e,dd:e,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:e,caption:e,thead:e,tbody:e,tfoot:e,tr:e,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:e,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:e,output:e,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},L=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],U={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(L.map(r=>[r,"css"]))},d={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},g={viewBox:"geometry",preserveAspectRatio:"geometry"},w={oneOf:["userSpaceOnUse","objectBoundingBox"]},E={oneOf:["R","G","B","A"]},l={...d,in:"text",result:"text"},A={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},f={svg:{attributes:{...d,...g}},g:e,defs:e,symbol:{attributes:{...d,...g,refX:"geometry",refY:"geometry"}},use:{attributes:{...d,href:"fragment"}},title:e,desc:e,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...d,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...A}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...A}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...d,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...d,...g,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...g,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:e,filter:{attributes:{...d,filterUnits:w,primitiveUnits:w}},feBlend:{attributes:{...l,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...l,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:l},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(r=>[r,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...l,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...l,in2:"text",scale:"number",xChannelSelector:E,yChannelSelector:E}},feDropShadow:{attributes:{...l,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:l},feGaussianBlur:{attributes:{...l,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:l},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...l,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...l,dx:"number",dy:"number"}},feTurbulence:{attributes:{...d,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var v=["alert","alertdialog","dialog","banner","main","navigation","contentinfo","complementary","search","form","application","status","log","marquee","timer"],re=["region"],x={nav:"div",header:"div",footer:"div",aside:"div",search:"div",output:"span"},R={section:["aria-label","title"]},ne=["aria-labelledby","aria-describedby"];function C(r){return/^aria-[a-z]+$/.test(r)}function j(r){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(r)}var O=4e3,_=1e5,m=512e3,oe=1e4,se="http://www.w3.org/1999/xhtml",ae="http://www.w3.org/2000/svg",B=new Map(Object.keys(f).map(r=>[r.toLowerCase(),r]));function S(r){return B.get(r.toLowerCase())}function T(r,o,t){let s=t.toLowerCase(),i=r==="html"?[p[o]?.attributes,N]:[f[o]?.attributes,U],n=r==="svg"&&s==="xlink:href"?"href":s;for(let a of i)if(a){for(let[u,c]of Object.entries(a))if(u.toLowerCase()===n)return{name:u,kind:c}}if(C(s)||j(s))return{name:s,kind:"text"}}function de(r,o){if(o==="svg"){let s=S(r);return s?{namespace:"svg",name:s}:{refused:{reason:"element",element:r}}}let t=r.toLowerCase();return t==="svg"?{namespace:"svg",name:"svg"}:Object.prototype.hasOwnProperty.call(p,t)?Object.prototype.hasOwnProperty.call(x,t)?{namespace:"html",name:x[t],as:t}:{namespace:"html",name:t}:{refused:{reason:"element",element:r}}}function me(r,o){return(r==="html"?p[o]:f[o])?.empty===!0}var z=/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,G=/^[0-9A-Za-z\s.,+\-%()]*$/,P=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,I=/^data:image\/(png|gif|jpeg|webp|avif|bmp|svg\+xml)(;[A-Za-z0-9=._+-]+)*,/i,$=/^\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,k=/\/graview\/assets\/[0-9a-f]{64}\.(png|gif|jpe?g|webp|avif|svg|ico)$/,D=/^\/(?!\/)(?!(?:.*\/)?\.\.?(?:\/|$))(?!.*%(?:2e|2f|5c))[^\\\s?#"'<>]*$/i;function V(r,o){if($.test(r))return r;let t=r;if(/^https?:\/\//i.test(r))try{let s=new URL(r);if(o==="null"||s.origin!==o||s.username!==""||s.password!==""||s.search!==""||s.hash!=="")return;t=r.slice(s.origin.length)}catch{return}if(D.test(t))return k.exec(t)?.[0]}function ce(r,o={},t){let s=r.length>120?`${r.slice(0,119)}\u2026`:r,i=M(o.origins),n=k.exec(r.split(/[?#]/)[0])?.[0],a=t!==void 0&&t>m?` It is a data: image of ${t.toLocaleString("en-US")} characters, more than the ${m.toLocaleString("en-US")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:n?o.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${n}.`:" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.":/^https:\/\//i.test(r)?i.length>0?` Its origin is not one the host lists for images (${i.join(", ")}).`:" The host lists no origin a view's images may come from (images.origins, on the view's definition).":"",u=["a data: image",...o.assets?["the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)"]:[],"a picture on a record (pictures in its manifest)",...i.length>0?[`an https: image from ${i.join(", ")}`]:[]];return`The image "${s}" was not drawn.${a} A view here shows ${u.slice(0,-1).join(", ")} or ${u[u.length-1]}.`}function M(r){return(r??[]).flatMap(o=>{try{let t=new URL(o);return t.protocol==="https:"&&t.hostname!==""&&t.username===""&&t.password===""?[t.origin]:[]}catch{return[]}})}function F(r,o){if(!(!o||o.length===0||!/^https:\/\//i.test(r)))try{let t=new URL(r);return t.protocol!=="https:"||t.username!==""||t.password!==""?void 0:M(o).includes(t.origin)?t.href:void 0}catch{return}}function ge(r,o,t,s,i){let n=T(r,o,t);if(!n)return{refused:{reason:"attribute",element:o,name:t}};if(r==="html"&&R[o]?.includes(n.name))return{refused:{reason:"attribute",element:o,name:t}};if(s===null)return{name:n.name,value:null};let a=H(n.name,n.kind,s,i);return"refused"in a?{refused:{...a.refused,element:o,...n.kind==="image"&&a.refused.reason==="url"?{address:s.slice(0,200),...s.length>m?{length:s.length}:{}}:{},...n.kind==="link"?{address:s.slice(0,200)}:{}}}:n.name==="role"&&a.value.split(/\s+/).some(u=>v.includes(u.toLowerCase()))?{refused:{reason:"value",element:o,name:t}}:n.name==="aria-live"&&!["polite","off"].includes(a.value.toLowerCase())?{refused:{reason:"value",element:o,name:t}}:{name:n.name,value:a.value,...a.dropped?{dropped:a.dropped.map(u=>({reason:u.reason==="url"?"url":"css",element:o,name:n.name,css:u}))}:{}}}function H(r,o,t,s){let i=(n,a)=>({refused:{reason:n,name:r,...a?{css:a}:{}}});if(o==="geometry")return t.length>_||!G.test(t)||/url/i.test(t)?i("value"):{value:t};if(o==="image"){let n=s.picture?.(t);if(n!==void 0)return{value:n};if(t.length>m)return i("url");if(I.test(t))return{value:t};if(t.startsWith(`blob:${s.origin}/`)&&/^blob:[^\s"'<>]+$/.test(t))return{value:t};let a=s.asset?V(t,s.origin):void 0;if(a!==void 0){let c=s.asset(a);if(c)return{value:c}}let u=F(t,s.imageOrigins);return u?{value:u}:i("url")}if(o==="link"){let n=s.link?.(t);return n===void 0?i("url"):{value:n}}if(t.length>O)return i("value");if(typeof o=="object"){let n=o.oneOf.find(a=>a.toLowerCase()===t.toLowerCase());return n===void 0?i("value"):{value:n}}switch(o){case"text":return{value:t};case"number":return z.test(t.trim())&&Number.isFinite(Number(t))?{value:t.trim()}:i("value");case"boolean":return{value:""};case"fragment":return P.test(t)?{value:t}:i("url");case"style":{let n=b(t,O);return n.refused.length>0&&n.css===""?i(n.refused[0].reason==="url"?"url":"css",n.refused[0]):{value:n.css,...n.refused.length>0?{dropped:n.refused}:{}}}case"css":{let n=y(r,t);return"refused"in n?i(n.refused.reason==="url"?"url":"css",n.refused):{value:n.value}}}}export{re as a,ne as b,oe as c,se as d,ae as e,de as f,me as g,ce as h,M as i,ge as j};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.
|
|
1
|
+
import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as W,Y as x}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as D}from"./chunk.AJZBJBMO.js";var g=D(W(),1);var o=D(x(),1),v=864e5,l=t=>Date.UTC(+t.slice(0,4),+t.slice(5,7)-1,+t.slice(8,10)),I=t=>new Date(t).toISOString().slice(0,10),s=(t,i)=>I(l(t)+i*v),m=(t,i)=>{let a=new Date(l(t)),u=a.getUTCMonth()+i,d=Date.UTC(a.getUTCFullYear(),u,1),w=new Date(Date.UTC(a.getUTCFullYear(),u+1,0)).getUTCDate();return I(d+(Math.min(a.getUTCDate(),w)-1)*v)};function p(t,i,a){try{return new Intl.DateTimeFormat(t??"en-US",{...i,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en-US",{...i,timeZone:"UTC"}).format(a)}}function F(t){try{let i=new Intl.Locale(t??"en-US"),a=i.getWeekInfo?.().firstDay??i.weekInfo?.firstDay;if(a!==void 0)return a%7}catch{return 0}return/^en-US|^en$|-(US|CA|JP|BR|IL|MX|PH)$/.test(t??"en-US")?0:1}function H({id:t,label:i,selected:a,today:u,locale:d,onPick:w,onClose:T}){let[r,f]=(0,g.useState)(a??u),U=(0,g.useRef)(null),y=F(d),b=`${r.slice(0,7)}-01`,M=(new Date(l(b)).getUTCDay()-y+7)%7,P=s(b,-M),A=Array.from({length:6},(e,n)=>Array.from({length:7},(S,c)=>s(P,n*7+c))),$=p(d,{month:"long",year:"numeric"},l(b)),h=(0,g.useRef)(!0);(0,g.useEffect)(()=>{h.current&&U.current?.querySelector(`[data-day="${r}"]`)?.focus(),h.current=!1},[r]);let E=e=>{let n={ArrowLeft:()=>s(r,-1),ArrowRight:()=>s(r,1),ArrowUp:()=>s(r,-7),ArrowDown:()=>s(r,7),PageUp:()=>m(r,e.shiftKey?-12:-1),PageDown:()=>m(r,e.shiftKey?12:1),Home:()=>s(r,-((new Date(l(r)).getUTCDay()-y+7)%7)),End:()=>s(r,6-(new Date(l(r)).getUTCDay()-y+7)%7)};n[e.key]?(e.preventDefault(),h.current=!0,f(n[e.key]())):e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},R=Array.from({length:7},(e,n)=>l("1970-01-04")+(y+n)%7*v),C={minWidth:32,minHeight:32,padding:"0 8px",borderRadius:6};return(0,o.jsxs)("div",{id:t,role:"group","aria-label":`Pick a date for ${i}`,"data-graview-part":"when-month",onKeyDown:e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),T())},style:{flexBasis:"100%",width:"min(100%, 20rem)",boxSizing:"border-box",padding:8,border:"1px solid var(--graview-edge)",borderRadius:8,background:"var(--graview-panel)",color:"var(--graview-ink)"},children:[(0,o.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,marginBottom:6},children:[(0,o.jsx)("button",{type:"button","aria-label":"Previous month",onClick:()=>f(m(r,-1)),style:C,children:"\u2039"}),(0,o.jsx)("span",{id:`${t}-title`,"aria-live":"polite",style:{fontWeight:600,fontSize:"0.875rem"},children:$}),(0,o.jsx)("button",{type:"button","aria-label":"Next month",onClick:()=>f(m(r,1)),style:C,children:"\u203A"})]}),(0,o.jsxs)("table",{ref:U,role:"grid","aria-labelledby":`${t}-title`,onKeyDown:E,style:{width:"100%",borderCollapse:"collapse",tableLayout:"fixed",fontSize:"0.8125rem"},children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:R.map(e=>(0,o.jsx)("th",{scope:"col",abbr:p(d,{weekday:"long"},e),style:{fontWeight:500,color:"var(--graview-ink-faint)",padding:"2px 0"},children:p(d,{weekday:"narrow"},e)},e))})}),(0,o.jsx)("tbody",{children:A.map(e=>(0,o.jsx)("tr",{children:e.map(n=>{let S=n.slice(0,7)===b.slice(0,7),c=n===a,k=n===u;return(0,o.jsx)("td",{role:"gridcell","aria-selected":c||void 0,style:{padding:1,textAlign:"center"},children:(0,o.jsx)("button",{type:"button","data-day":n,tabIndex:n===r?0:-1,"aria-label":`${p(d,{weekday:"long",year:"numeric",month:"long",day:"numeric"},l(n))}${k?", today":""}${c?", selected":""}`,...k?{"aria-current":"date"}:{},onClick:()=>w(n),onFocus:()=>n!==r&&f(n),style:{width:"100%",minHeight:36,padding:0,borderRadius:6,border:k?"1px solid var(--graview-accent)":"1px solid transparent",background:c?"var(--graview-accent)":"transparent",color:c?"var(--graview-accent-ink)":S?"var(--graview-ink)":"var(--graview-ink-faint)",fontWeight:c?600:400},children:Number(n.slice(8,10))})},n)})},e[0]))})]})]})}export{H as WhenMonth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X}from"./chunk.
|
|
1
|
+
import{b as X}from"./chunk.7PWLRRUS.js";import"./chunk.RJ7VSWTA.js";import"./chunk.P43LPXXJ.js";import{G as ce,Y,ga as N,ja as _}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{Ee as U,Jb as R}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as O}from"./chunk.AJZBJBMO.js";var u=O(ce(),1);function M(e,t,s=!1){if(e<t.at||e===t.at&&s)return e;let i=t.at+t.removed.length;return e>=i?e+t.inserted.length-t.removed.length:s?t.at:t.at+t.inserted.length}var G=e=>e>=55296&&e<=56319,V=e=>e>=56320&&e<=57343;function q(e,t,s){let i=Math.min(e.length,t.length),n=0,l=Math.max(0,Math.min(i,t.length-s));for(;n<l&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;let r=0;for(;r<i-n&&e.charCodeAt(r)===t.charCodeAt(r);)r++;return r>0&&G(e.charCodeAt(r-1))&&r--,n>0&&V(e.charCodeAt(e.length-n))&&n--,{at:r,removed:e.slice(r,e.length-n),inserted:t.slice(r,t.length-n)}}function B(e,t){let s=Math.min(e.length,t.length),i=0;for(;i<s&&e.charCodeAt(i)===t.charCodeAt(i);)i++;i>0&&G(e.charCodeAt(i-1))&&i--;let n=0;for(;n<s-i&&e.charCodeAt(e.length-1-n)===t.charCodeAt(t.length-1-n);)n++;return n>0&&V(e.charCodeAt(e.length-n))&&n--,{at:i,removed:e.slice(i,e.length-n),inserted:t.slice(i,t.length-n)}}function Z(e,t){let s=c=>c.at+c.removed.length;if(s(e)<t.at)return e;if(e.at>s(t))return{...e,at:e.at+t.inserted.length-t.removed.length};let i=Math.min(e.at,t.at),n=s(e)-s(t),l=e.removed.slice(0,t.at-i)+t.inserted+(n>0?e.removed.slice(e.removed.length-n):""),r=t.at<=e.at?t.inserted+e.inserted:e.inserted+t.inserted,d=B(l,r);return{...d,at:i+d.at}}function I(e,t){let s=M(e.start,t,!0),i=e.end===e.start?s:M(e.end,t);return{start:s,end:Math.max(s,i)}}function le(e,t){let{kind:s,id:i,session:n}=e.author,l=`${s}:${i??""}:`;return t.startsWith(l)&&(!n||t.slice(l.length)===n)}function J(e,t,s,i){let n=e.anchor,l=e.head;for(let d of s)if(!(d.seq<e.rev||le(d,t)))for(let c of d.primitives)c.op!=="splice-text"||c.id!==e.node||c.field!==e.field||(n=M(n,c),l=M(l,c));let r=d=>Math.max(0,Math.min(i,d));return{start:r(n),end:r(l)}}var W=(e,t,s)=>e.ops.length>0&&e.ops.every(i=>{let n=i.mutation?.args;return i.mutation?.name===R&&n?.node===t&&n.field===s}),de=(e,t,s,i)=>t.ops.length>0&&t.ops.every(n=>n.undoes!==void 0)&&e.batches().some(n=>t.ops.some(l=>l.undoes===n.id||l.undoes===n.ops[0]?.id)&&W(n,s,i)),Q=(e,t)=>e.author.kind==="human"&&(t?.id===void 0||e.author.id===void 0||e.author.id===t.id);function j(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(!(!Q(r,t)||r.undone||!W(r,s,i))&&e.canUndo(r.id).ok)return r.id}}function ee(e,t,s,i){let n=e.batches();for(let l=n.length-1;l>=0;l--){let r=n[l];if(Q(r,t)){if(W(r,s,i))return;if(de(e,r,s,i))return r.undone?void 0:r.id}}}var p=O(Y(),1);function ue(e){let{store:t}=N(),{live:s,nodeId:i,field:n}=e,[l,r]=(0,u.useState)(null);return(0,u.useEffect)(()=>{let d=!0;return s.typing(i,n).then(c=>d&&r(c)),()=>{d=!1}},[i,n]),l&&!t.collaborative(i,n)?(0,p.jsx)(p.Fragment,{children:e.writtenWhole}):(0,p.jsx)(pe,{...e,typing:l})}function pe({nodeId:e,field:t,label:s,markdown:i,live:n,onDone:l,typing:r}){let{store:d,principal:c}=N(),m=_(e),f=ne(m?.[t]),[T,ie]=(0,u.useState)(!1),v=(0,u.useRef)(null),D=(0,u.useRef)(f),E=(0,u.useRef)(!1),H=(0,u.useRef)(n);H.current=n;let K=()=>ne(d.graph.getNode(e)?.[t]),b=!r||d.permits({name:R,args:{node:e,field:t,at:0,remove:0,insert:""}},c).ok;(0,u.useEffect)(()=>v.current?.focus(),[T,r]);let C=(0,u.useRef)(void 0),k=()=>{C.current===void 0&&(C.current=setTimeout(()=>{C.current=void 0;let o=v.current;if(!o||o.ownerDocument.activeElement!==o)return;let a=o.selectionDirection==="backward";H.current.sayCaret({node:e,field:t,anchor:a?o.selectionEnd:o.selectionStart,head:a?o.selectionStart:o.selectionEnd,rev:d.log.length})},ge))};(0,u.useEffect)(()=>()=>{clearTimeout(C.current),H.current.sayCaret(null)},[]);let F=o=>{let a=v.current;if(a){if(a.value!==o){let h=I({start:a.selectionStart,end:a.selectionEnd},B(a.value,o)),g=a.selectionDirection??"none";a.value=o,a.setSelectionRange(h.start,h.end,g)}D.current=o}},$=()=>{let o=v.current;if(!o||!r||!b||E.current)return;let a=D.current,h=K(),g=q(a,o.value,o.selectionEnd);if(g.removed===""&&g.inserted==="")return F(h);let y=a===h?g:Z(g,B(a,h));try{r.splice(y.at,y.removed.length,y.inserted)}catch{}let w=K();if(o.value!==w){o.value=w;let S=Math.min(w.length,y.at+y.inserted.length);o.setSelectionRange(S,S)}D.current=w,k()};(0,u.useLayoutEffect)(()=>{E.current||F(f)},[f]);let ae=async o=>{if(!r)return;r.flush();for(let h=0;r.waiting()>0&&h<100;h++)await new Promise(g=>setTimeout(g,30));let a=o?ee(d,c,e,t):j(d,c,e,t);if(a)try{o?d.redo(a,{author:c}):d.undo(a,{author:c})}catch{}},x=o=>{r?.flush(),n.sayCaret(null),l(o)},A=(0,u.useRef)(void 0);(0,u.useEffect)(()=>()=>A.current?.(),[]);let se=o=>{A.current?.();let a=o.ownerDocument,h=v.current?.closest("[data-graview-live]"),g=P=>{let L=P.target;if(L instanceof Node&&h?.contains(L))return S();L instanceof Element&&L.closest(te)||(S(),x(!0))},y=()=>{let P=a.activeElement;P!==null&&P!==a.body||o.isConnected&&fe(o)||(S(),v.current?.focus({preventScroll:!0}))},w=new MutationObserver(y);w.observe(a.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","hidden"]}),a.addEventListener("focusin",g),a.addEventListener("toggle",y,!0);let S=()=>{A.current=void 0,w.disconnect(),a.removeEventListener("focusin",g),a.removeEventListener("toggle",y,!0)};A.current=S},z=[...n.who.values()].filter(o=>o.caret?.node===e&&o.caret.field===t);return(0,p.jsxs)("div",{style:{display:"grid",gap:8,minWidth:0},"data-graview-live":t,children:[T?(0,p.jsx)("div",{"data-graview-preview":t,"aria-label":`${s}, as it will read`,role:"region",style:ye,children:(0,p.jsx)(X,{text:f,markdown:!0})}):(0,p.jsxs)("div",{style:{position:"relative",minWidth:0},children:[(0,p.jsx)("textarea",{ref:v,"aria-label":s,"data-graview-field":t,defaultValue:f,readOnly:!r||!b,rows:3,onInput:$,onCompositionStart:()=>{E.current=!0},onCompositionEnd:()=>{E.current=!1,$()},onSelect:k,onFocus:k,onPointerDown:()=>r?.flush(),onKeyDown:o=>{let a=o.key;a==="Escape"?(o.preventDefault(),x(!1)):(o.metaKey||o.ctrlKey)&&!o.altKey&&a.toLowerCase()==="z"?(o.preventDefault(),ae(o.shiftKey)):(o.metaKey||o.ctrlKey)&&a==="Enter"?(o.preventDefault(),x(!1)):(a==="Enter"||me.has(a))&&r?.flush()},onKeyUp:k,onBlur:o=>{r?.flush(),n.sayCaret(null);let a=o.relatedTarget;if(a instanceof Node&&o.currentTarget.closest("[data-graview-live]")?.contains(a))return;let h=a instanceof Element?a.closest(te):null;if(h)return se(h);x(!0)},style:ve}),z.length>0?(0,p.jsx)(he,{text:f,others:z,area:v,log:d.log.all()}):null]}),(0,p.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8},children:[(0,p.jsx)("button",{type:"button",onClick:()=>x(!1),style:re,children:"Done"}),i?(0,p.jsx)("button",{type:"button","aria-pressed":T,onClick:()=>ie(!T),style:re,children:T?"Write":"Preview"}):null,(0,p.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},...b?{}:{"data-graview-readonly":""},children:b?"Saved as you type \xB7 Ctrl or \u2318 Z takes back your typing":`Read only: the ${s.toLowerCase()} can't be changed here now`})]})]})}function he({text:e,others:t,area:s,log:i}){let n=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{let c=s.current,m=n.current;if(!c||!m)return;let f=()=>{m.scrollTop=c.scrollTop};return f(),c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)});let l=t.map(c=>({one:c,at:J(c.caret,c.participant,i,e.length).end})).sort((c,m)=>c.at-m.at),r=[],d=0;for(let{one:c,at:m}of l){r.push(e.slice(d,m)),d=m;let f=U(c)||"Somebody";r.push((0,p.jsx)("span",{"data-graview-caret":c.participant,title:`${f} is typing here`,style:{borderLeft:`2px solid hsl(${Math.round(c.hue)} 55% 52%)`,marginLeft:-1,marginRight:-1,pointerEvents:"auto"}},c.participant))}return r.push(`${e.slice(d)}\u200B`),(0,p.jsx)("div",{ref:n,"aria-hidden":"true",style:we,children:r})}var te='[data-graview-overlay], dialog, [role="dialog"], [role="alertdialog"], [popover]',fe=e=>{if(e.hasAttribute("hidden")||e instanceof HTMLDialogElement&&!e.open)return!1;if(e.hasAttribute("popover"))try{return e.matches(":popover-open")}catch{}return!0},ge=120,ne=e=>typeof e=="string"?e:"",me=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"]),ye={minHeight:"7.5em",padding:"8px 10px",border:"1px dashed var(--graview-edge-bright)",borderRadius:6,lineHeight:1.6,minWidth:0},re={font:"inherit",fontSize:"0.8125rem",minHeight:28,padding:"2px 12px"},oe={font:"inherit",lineHeight:1.5,width:"100%",boxSizing:"border-box",minHeight:"7.5em",padding:"8px 10px",borderRadius:6},ve={...oe,resize:"vertical",fieldSizing:"content",color:"var(--graview-ink)",background:"var(--graview-panel, transparent)",border:"1px solid var(--graview-edge-bright)"},we={...oe,position:"absolute",inset:0,height:"100%",border:"1px solid transparent",color:"transparent",whiteSpace:"pre-wrap",overflowWrap:"break-word",overflow:"hidden",pointerEvents:"none"};export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk.6BBUTKFC.js";import"./chunk.Z22C2JJ4.js";import"./chunk.MKJV3BM5.js";import"./chunk.CEOQY5KS.js";import"./chunk.Q355UPFG.js";import{p as s}from"./chunk.4HU2ILFY.js";import"./chunk.WGH2P2YL.js";import"./chunk.EHLV3LND.js";import"./chunk.EPSYX2SF.js";import"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.ARGEGV5T.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import"./chunk.MB7LKKUD.js";import"./chunk.QJJWAYHB.js";import"./chunk.6A3KTD66.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.OKHXXIMN.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import"./chunk.7KX36ENH.js";import"./chunk.BJUUSIQY.js";import"./chunk.QDDDKEBH.js";import"./chunk.QKRQPUCE.js";import"./chunk.XOZU4OFA.js";import"./chunk.KBJ3UUER.js";import"./chunk.WVUJXDXZ.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.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{G as y,Y as i}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h}from"./chunk.
|
|
1
|
+
import{a as h}from"./chunk.VGYG2IBZ.js";import{D as g,Ea as a,H as k,Ha as b,K as w,mc as x}from"./chunk.6L6RUOSF.js";var s=i=>i?._zod?.def,O=Symbol.for("@graview/core:collaborative"),v=/^\^\\d\{4\}-\\d\{2\}-\\d\{2\}\$$/;function R(i){let t=s(i),u=!0,f;for(let e=0;t&&e<4;e++){if(t.type==="optional"||t.type==="nullable")u=!1;else if(t.type==="default")u=!1,f=t.defaultValue;else break;t=s(t.innerType)}if(!t)return{why:"it is not a zod field"};let l=g(i),r={...u?{required:!0}:{},...f!==void 0?{default:f}:{},...l?{description:l}:{}},p=(t.checks??[]).map(e=>s(e)),c=a(i);if(c)return{spec:{type:c,...r}};if(b(i))return{spec:{type:"app-link",...r}};let d;for(let e=s(i),n=0;e&&d===void 0&&n<4;e=s(e.innerType),n++)d=e[O];let m=e=>d!==void 0&&d===1!=(e==="text")?{collaborative:d===1}:{};if(h(i))return{spec:{type:"text",format:"markdown",...r,...m("text")}};let y=x(i);if(y)return{spec:{type:y,...r}};switch(t.type){case"string":{let e=t.format;return e==="email"?{spec:{type:"email",...r}}:e==="url"?{spec:{type:"url",...r}}:e==="date"?{spec:{type:"date",...r}}:e==="datetime"||p.some(n=>n?.fn===w)?{spec:{type:"datetime",...r}}:p.some(n=>n?.format==="regex"&&(v.test(String(n?.pattern?.source??""))||n?.pattern?.source===k.source))?{spec:{type:"date",...r}}:{spec:{type:"string",...r,...m("string")}}}case"number":{let e={};for(let n of p){let o=n?.value;typeof o=="number"&&(n?.check==="greater_than"&&n.inclusive?e.min=Math.max(e.min??o,o):n?.check==="less_than"&&n.inclusive?e.max=Math.min(e.max??o,o):n?.check==="multiple_of"&&(e.step=o))}return{spec:{type:p.some(n=>n?.format==="safeint"||n?.format==="int")?"integer":"number",...e,...r}}}case"boolean":return{spec:{type:"boolean",...r}};case"enum":{let e=Object.keys(t.entries??{});return e.length>0?{spec:{type:"enum",options:e,...r}}:{why:"it is an enum with no options"}}case"array":{let e=s(t.element);if(e?.type==="enum"){let o=Object.keys(e.entries??{});return o.length>0?{spec:{type:"enum",multiple:!0,options:o,...r}}:{why:"it is a list of an enum with no options"}}let n=a(t.element)??(e?.type==="number"?"number":e?.type==="string"?"string":void 0);return n?{spec:{type:"list",of:n,...r}}:{why:`it is a list of ${String(e?.type??"something")}, and a document lists words, numbers, dates, images, videos or files`}}default:return{why:`it is a ${String(t.type)}, which a document has no field type for`}}}function T(i){let t=R(i);return"spec"in t?t.spec:void 0}export{T as a};
|
|
@@ -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{r as Fe}from"./chunk.NXHEOHRR.js";import{a as Je,b as Ee,f as He,g as je,l as Ie,m as ze,n as Le}from"./chunk.G767NLBH.js";import{a as We}from"./chunk.QDDDKEBH.js";import{e as X}from"./chunk.KBJ3UUER.js";import{a as j}from"./chunk.UQZ2P6KD.js";import{f as $e,g as Y,i as De}from"./chunk.VVIQSFM4.js";import{a as be}from"./chunk.VGYG2IBZ.js";import{Ha as me,Ka as K,Ma as he,Mb as ve,O as pe,Oa as ye,Pa as Z,Pd as Pe,Rd as Me,Sd as Ne,Wa as ge,Xa as we,Yb as Ae,_a as ke,a as fe,ec as Oe,fc as Re,jc as _e,mc as Te,na as G,pb as q,pc as C,tb as Se,xc as xe}from"./chunk.6L6RUOSF.js";var E=(t,e,n)=>{(t[e]===void 0||n>t[e])&&(t[e]=n)},H=(t,e,n)=>{(t[e]===void 0||n<t[e])&&(t[e]=n)},Q=(t,e)=>{t.format=e,e.includes("int")&&(t.isInt=!0)},qe=(t,e)=>{t.mime=t.mime?t.mime.filter(n=>e.includes(n)):[...e]},Ce=(t,e)=>{t.multipleOf??=[],t.multipleOf.includes(e)||t.multipleOf.push(e)},Be=(t,e)=>(t.patterns??=new Set).add(e),gt={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function I(t){let e={},{def:n,bag:o}=t._zod,i=t._zod.traits.has("$ZodCheck")?[t,...n.checks??[]]:n.checks??[];for(let r of i){let a=r._zod.def;switch(a.check){case"greater_than":E(e,a.inclusive?"minimum":"exclusiveMinimum",a.value);break;case"less_than":H(e,a.inclusive?"maximum":"exclusiveMaximum",a.value);break;case"multiple_of":Ce(e,a.value);break;case"number_format":{Q(e,a.format);let d=gt[a.format];d&&(E(e,"minimum",d[0]),H(e,"maximum",d[1]));break}case"bigint_format":Q(e,a.format);break;case"min_length":case"min_size":E(e,"minimum",a.minimum);break;case"max_length":case"max_size":H(e,"maximum",a.maximum);break;case"length_equals":E(e,"minimum",a.length),H(e,"maximum",a.length);break;case"size_equals":E(e,"minimum",a.size),H(e,"maximum",a.size);break;case"string_format":Q(e,a.format),a.pattern&&Be(e,a.pattern),(a.format==="base64"||a.format==="base64url")&&(e.contentEncoding=a.format),(a.local||a.precision===-1)&&(e.laxFormat=!0);break;case"mime_type":qe(e,a.mime);break}}o.minimum!==void 0&&E(e,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&E(e,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&H(e,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&H(e,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Ce(e,o.multipleOf),o.format!==void 0&&(e.format??=o.format,o.format.includes("int")&&(e.isInt=!0)),o.mime&&qe(e,o.mime);for(let r of o.patterns??[])Be(e,r);return e}var wt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""};function L(t){let e=t._zod.def;return e.type==="pipe"&&e.in._zod.traits.has("$ZodTransform")?L(e.out):e.type==="catch"?L(e.innerType):t._zod.optin}var kt=new Set(["promise","optional","nonoptional","nullable","readonly","default","prefault","catch"]);function T(t,e=new Set){if(e.has(t))return!1;e.add(t);let n=t._zod.def,o=n.type;return o==="transform"?!0:o==="array"?T(n.element,e):o==="set"?T(n.valueType,e):o==="lazy"?T(n.getter(),e):kt.has(o)?T(n.innerType,e):o==="intersection"?T(n.left,e)||T(n.right,e):o==="record"||o==="map"?T(n.keyType,e)||T(n.valueType,e):o==="pipe"?t._zod.traits.has("$ZodCodec")||T(n.in,e)||T(n.out,e):o==="object"?Object.values(n.shape).some(i=>T(i,e)):o==="union"?n.options.some(i=>T(i,e)):o==="tuple"?n.items.some(i=>T(i,e))||(n.rest?T(n.rest,e):!1):!1}function bt(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n])=>e.indexOf(+n)===-1).map(([,n])=>n)}function Ge(t){let e=t.anyOf;if(!Array.isArray(e)||e.length===0||t.type!==void 0)return;let n=[];for(let o of e){if(!o||typeof o!="object")return;Ge(o);let i=Object.keys(o);if(i.length!==1||i[0]!=="type")return;for(let r of[o.type].flat()){if(typeof r!="string")return;n.includes(r)||n.push(r)}}delete t.anyOf,t.type=n.length===1?n[0]:n}var Ke=new Set(["type","properties","required","additionalProperties"]),Ue=t=>{let e=t.additionalProperties;return e&&typeof e=="object"&&Object.keys(e).length?e:null},Ve=(t,e)=>JSON.stringify(t)===JSON.stringify(e);function ee(t){for(let i of t){if(typeof i!="object"||i.type!=="object")return null;for(let r in i)if(!Ke.has(r))return null}let e={},n=new Set;for(let i of t){for(let r in i.properties){if(Object.prototype.hasOwnProperty.call(e,r))continue;let a=[];for(let d of t){let s=d.properties?.[r]??Ue(d);s&&!a.some(g=>Ve(g,s))&&a.push(s)}e[r]=a.length===1?a[0]:ee(a)??{allOf:a}}for(let r of i.required??[])n.add(r)}let o={type:"object",properties:e};if(n.size&&(o.required=[...n]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let r of t){let a=Ue(r);a&&!i.some(d=>Ve(d,a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function St(t){let e=t.allOf;if(!Array.isArray(e)||e.length<2)return;for(let i of Ke)if(i in t)return;let n=e.filter(i=>Array.isArray(i.oneOf)||Array.isArray(i.anyOf)),o;if(!n.length)o=ee(e);else{let i=n[0],r=Array.isArray(i.oneOf)?"oneOf":"anyOf";if(Object.keys(i).length!==1)return;let a=e.filter(s=>s!==i),d=i[r].map(s=>ee([...a,s]));if(d.some(s=>!s))return;o={[r]:d}}o&&(delete t.allOf,Object.assign(t,o))}function Ze(t){let e=t;for(let k of["anyOf","oneOf"]){let R=e[k];if(!Array.isArray(R))continue;let v=R.map(Ze);v.some((A,m)=>A!==R[m])&&(e={...e,[k]:v})}let n=[e.type].flat(),o=!n.includes("string")&&n.some(k=>k==="number"||k==="integer"),i=e.enum??(e.const!==void 0?[e.const]:void 0);if(!o&&!i?.some(k=>typeof k=="number"))return e;let{minimum:r,maximum:a,exclusiveMinimum:d,exclusiveMaximum:s,multipleOf:g,format:p,id:w,...h}=e;return h.enum?h.enum=h.enum.map(k=>typeof k=="number"?String(k):k):typeof h.const=="number"&&(h.const=String(h.const)),o&&(h.type="string",i||(h.pattern=n.includes("number")?"^-?\\d+(?:\\.\\d+)?$":"^-?\\d+$")),h}var B=class{constructor(e,n){this.override=e;this.refs=n}done=new Map;path=[];cyclic=new Map;write(e,n=!1){let o=this.refs.get(e);if(o!==void 0&&!n)return{$ref:o};if(this.path.includes(e))return this.cyclic.has(e)||this.cyclic.set(e,""),{};let i=this.done.get(e);if(i)return i;this.path.push(e);try{let r=this.written(e);return this.done.set(e,r),r}finally{this.path.pop()}}written(e){let n={},o,i=e._zod.toJSONSchema?.();i?Object.assign(n,i):o=this.process(e,n);let r=fe.get(e);if(r)for(let d of Object.keys(r))n[d]=r[d];T(e)&&(delete n.examples,delete n.default),"_prefault"in n&&(n.default??=n._prefault,delete n._prefault);let a=n;if(o){let d=this.write(o);a={...n};for(let s of Object.keys(d))s in n||(a[s]=d[s])}return this.override({zodSchema:e,jsonSchema:a}),Ge(a),e._zod.def.type==="intersection"&&St(a),a}process(e,n){let o=e._zod.def;switch(o.type){case"string":{n.type="string";let{minimum:i,maximum:r,format:a,patterns:d,contentEncoding:s,laxFormat:g}=I(e);if(typeof i=="number"&&(n.minLength=i),typeof r=="number"&&(n.maxLength=r),a&&(n.format=wt[a]??a,(n.format===""||a==="time"||g)&&delete n.format),s&&(n.contentEncoding=s),d&&d.size>0){let p=[...d];p.length===1?n.pattern=p[0].source:n.allOf=p.map(w=>({pattern:w.source}))}return}case"number":{let{minimum:i,maximum:r,multipleOf:a,exclusiveMinimum:d,exclusiveMaximum:s,isInt:g}=I(e);if(n.type=g?"integer":"number",typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY)?n.exclusiveMinimum=d:typeof i=="number"&&(n.minimum=i),typeof s=="number"&&s<=(r??Number.POSITIVE_INFINITY)?n.exclusiveMaximum=s:typeof r=="number"&&(n.maximum=r),a){let[p,...w]=new Set(a.filter(h=>Number.isFinite(h)&&h!==0).map(Math.abs));p!==void 0&&(n.multipleOf=p),w.length&&(n.allOf=[...n.allOf??[],...w.map(h=>({multipleOf:h}))])}return}case"boolean":case"success":n.type="boolean";return;case"null":n.type="null";return;case"never":n.not={};return;case"enum":{let i=bt(o.entries);i.length===0?n.not={}:(i.every(r=>typeof r=="number")&&(n.type="number"),i.every(r=>typeof r=="string")&&(n.type="string"),n.enum=i);return}case"literal":{let i=o.values.filter(r=>r!==void 0).map(r=>typeof r=="bigint"?Number(r):r);if(o.values.length===0)n.not={};else if(i.length===1)n.type=i[0]===null?"null":typeof i[0],n.const=i[0];else if(i.length>1){for(let r of["number","string","boolean"])i.every(a=>typeof a===r)&&(n.type=r);i.every(r=>r===null)&&(n.type="null"),n.enum=i}return}case"template_literal":n.type="string",n.pattern=e._zod.pattern.source;return;case"file":{n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:i,maximum:r,mime:a}=I(e);i!==void 0&&(n.minLength=i),r!==void 0&&(n.maxLength=r),a&&(a.length===0?n.not={}:a.length===1?n.contentMediaType=a[0]:n.anyOf=a.map(d=>({contentMediaType:d})));return}case"array":{let{minimum:i,maximum:r}=I(e);typeof i=="number"&&(n.minItems=i),typeof r=="number"&&(n.maxItems=r),n.type="array",n.items=this.write(o.element);return}case"object":{let i=o.shape;n.type="object";let r={};n.properties=r;for(let d in i)Object.defineProperty(r,d,{value:this.write(i[d]),writable:!0,enumerable:!0,configurable:!0});let a=Object.keys(i).filter(d=>L(i[d])===void 0);a.length>0&&(n.required=a),o.catchall?._zod.def.type==="never"?n.additionalProperties=!1:o.catchall&&(n.additionalProperties=this.write(o.catchall));return}case"union":n[o.inclusive===!1?"oneOf":"anyOf"]=o.options.map(i=>this.write(i));return;case"intersection":{let i=d=>"allOf"in d&&Object.keys(d).length===1,r=this.write(o.left),a=this.write(o.right);n.allOf=[...i(r)?r.allOf:[r],...i(a)?a.allOf:[a]];return}case"tuple":{let i=o.items;n.type="array",n.prefixItems=i.map(s=>this.write(s)),o.rest?n.items=this.write(o.rest):n.items=!1;let r=i.length;for(;r>0&&L(i[r-1])!==void 0;)r-=1;r>0&&(n.minItems=r),o.rest||(n.maxItems=i.length);let{minimum:a,maximum:d}=I(e);typeof a=="number"&&(n.minItems=a),typeof d=="number"&&(n.maxItems=d);return}case"record":{let i=o.keyType;n.type="object";let r=I(i).patterns;if(o.mode==="loose"&&r&&r.size>0){let d=this.write(o.valueType),s={};for(let g of r)s[g.source]=d;n.patternProperties=s}else n.propertyNames=Ze(this.write(i)),n.additionalProperties=this.write(o.valueType);let a=i._zod.values;if(a&&!o.partial&&L(o.valueType)===void 0){let d=[...a].filter(s=>typeof s=="string"||typeof s=="number");d.length>0&&(n.required=d.map(String))}return}case"nullable":n.anyOf=[this.write(o.innerType),{type:"null"}];return;case"default":case"prefault":{let i=o.defaultValue,r,a=!1,d=JSON.stringify(i,(s,g)=>typeof g=="bigint"?(a=!0,null):g);return!a&&d!==void 0&&(r=JSON.parse(d)),a||(n[o.type==="default"?"default":"_prefault"]=r),o.innerType}case"catch":{try{n.default=o.catchValue(void 0)}catch{}return o.innerType}case"readonly":return n.readOnly=!0,o.innerType;case"pipe":return o.in._zod.traits.has("$ZodTransform")?o.out:o.in;case"lazy":return e._zod.innerType;case"optional":case"nonoptional":case"promise":return o.innerType;default:return}}};function Ye(t,e=()=>{}){let n=t,o=new B(e,new Map),i=o.write(n,!0);if(o.cyclic.size>0){let r=new Map,a=0,d=[];for(let g of o.cyclic.keys())if(g===n)r.set(g,"#");else{let p=`__schema${a++}`;r.set(g,`#/$defs/${p}`),d.push([g,p])}o=new B(e,r),i=o.write(n,!0);let s={};for(let[g,p]of d)s[p]=o.write(g,!0);d.length>0&&(i={...i,$defs:s})}return JSON.parse(JSON.stringify({$schema:"https://json-schema.org/draft/2020-12/schema",...i}))}function Xe(t){return Ye(t,Ot)}var vt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string"},At={phone:"A phone number as it is written, like +1 555 123 4567 or 020 7946 0958 ext. 12.",place:"An address or a place's name, as a person would search a map for it.",duration:"A length of time in whole minutes: 90 is 1 h 30 min."};function Ot(t){me(t.zodSchema)&&(t.jsonSchema["x-graview-app-link"]=!0);let e=ye(t.zodSchema);if(e&&(t.jsonSchema.type==="string"||t.jsonSchema.type==="array")){t.jsonSchema["x-graview-linked"]={address:e.address,kinds:[...e.kinds],cardinality:e.cardinality};let s=e.kinds.join(" or "),g=`${e.cardinality==="many"?"Records":"A record"}: a ${s} in the app ${e.address}, as "${e.kinds[0]}:<id>" \u2014 an id found there with find_linked. Linking never changes that app.`,p=t.jsonSchema.description;typeof p=="string"&&p.includes(g)||(t.jsonSchema.description=`${typeof p=="string"&&p?`${p.replace(/\.?$/,".")} `:""}${g}`)}if(ke(t.zodSchema)&&(t.jsonSchema["x-graview-repeat"]=!0,!t.jsonSchema.type&&!t.jsonSchema.anyOf&&!t.jsonSchema.oneOf&&Object.assign(t.jsonSchema,Rt())),be(t.zodSchema)){t.jsonSchema.contentMediaType="text/markdown";let s=t.jsonSchema.description;typeof s=="string"&&s.endsWith("Written in Markdown.")||(t.jsonSchema.description=`${typeof s=="string"&&s?`${s.replace(/\.?$/,".")} `:""}Written in Markdown.`)}let n=Te(t.zodSchema);if(n){let s=t.jsonSchema;s["x-graview-type"]=n,n==="duration"&&(s["x-graview-unit"]="minutes"),s.description??=At[n]}let o=_e(t.zodSchema,!1);if(o){let s=$e(o);t.jsonSchema["x-graview-format"]=s.format??"unit",s.currency&&(t.jsonSchema["x-graview-currency"]=s.currency),s.unit&&s.format!=="money"&&(t.jsonSchema["x-graview-unit"]=s.unit);let g=t.jsonSchema.description;t.jsonSchema.description=typeof g=="string"&&g.length>0?`${g} ${Y(s)}`:Y(s)}let i=t.zodSchema._zod?.def;if(!i||i.type!=="string"||typeof i.format!="string"||i.format==="regex")return;let r=t.jsonSchema,a=(i.checks??[]).map(s=>s._zod?.def).filter(s=>s?.format==="regex"&&s.pattern instanceof RegExp).map(s=>s.pattern.source);delete r.pattern;let d=r.allOf;Array.isArray(d)&&d.every(s=>typeof s=="object"&&s!==null&&Object.keys(s).length===1&&"pattern"in s)&&delete r.allOf,r.format=vt[i.format]??i.format,a.length===1?r.pattern=a[0]:a.length>1&&(r.allOf=a.map(s=>({pattern:s})))}function te(t,e){let n=C(t.input),o=Xe(t.input);if(e&&o.properties){let r=a=>e.includes(a)?e.indexOf(a):e.length;o.properties=Object.fromEntries(Object.entries(o.properties).sort(([a],[d])=>r(a)-r(d)))}let i=o.properties??{};if(Oe(t)){let r=t.creates.join(" | ");i.id={type:"string",minLength:1,description:`Optional: the id for the ${r} this makes, beginning with its kind (${t.creates.map(a=>`"${a}:"`).join(" or ")}). Refused if the graph already has it; left out, one is minted from the label.`},o.properties=i}Re(t)&&(o.additionalProperties=!1);for(let r of n){let a=i[r.name];if(!a)continue;let d=r.kinds.includes("*")?"any node kind":r.kinds.join(" | ");a.description=[a.description,`Id of a node (${d}).`].filter(Boolean).join(" ")}return{name:t.name,...t.title===void 0?{}:{title:t.title},description:t.description??t.title??t.name,inputSchema:o,nodeRefs:n}}function Rt(){let t={type:"string",pattern:"^\\d{4}-\\d{2}-\\d{2}$"},e=(n,o)=>({type:"integer",minimum:n,maximum:o});return{type:"object",description:'How the date beside it repeats; the date is the first occurrence. "on" is weekdays for "week", days of the month (-1 the last) for "month".',properties:{every:{type:"string",enum:[...we]},interval:e(1,99),on:{type:"array",minItems:1,maxItems:31,items:{anyOf:[{type:"string",enum:[...ge]},e(-1,31)]}},until:t,count:e(1,1e3),except:{type:"array",maxItems:500,items:t},continues:{type:"string",maxLength:200}},required:["every"],additionalProperties:!1}}function Qe(t){let e=new Set;for(let n=t;n;n=n.onBehalfOf)n.id!==void 0&&e.add(`${n.kind}:${n.id}`);return e}function U(t,e){let n=Qe(e),o=p=>{if(p.kind==="rule")return!1;let w=Qe(p);if(w.size===0)return!1;for(let h of w)if(n.has(h))return!1;return!0},i,r=()=>{if(i)return i;i=new Map;for(let p of t.log.live()){if(p.undoes!==void 0)continue;let w=o(p.author)?p.author:void 0;for(let h of p.primitives){h.op==="remove-node"&&i.delete(h.node.id);let k=h.op==="add-node"?h.node.id:h.op==="patch-node"||h.op==="splice-text"?h.id:void 0;if(k===void 0)continue;let R=h.op==="add-node"?Object.keys(h.node):h.op==="splice-text"?[h.field]:Object.keys(h.after),v=i.get(k);(h.op==="add-node"||!v)&&i.set(k,v=new Map);for(let A of R)A==="id"||A==="kind"||(w?v.set(A,w):v.delete(A))}}return i},a=t.schema,d=new Map,s=(p,w)=>{let h=`${p}\0${w}`,k=d.get(h);if(k===void 0){let R=a.tryDefinition(p)?.fields?.shape;k=R!==void 0&&w in R&&De(R[w]).type==="text",d.set(h,k)}return k},g=p=>t.graph.getNode(p)?.kind;return{prose:s,say:p=>q(p,{graph:t.graph,schema:a}),fieldBy(p,w){let h=g(p);if(!(h===void 0||!s(h,w)))return r().get(p)?.get(w)},recordBy(p){let w=g(p),h=r().get(p);if(w===void 0||!h)return;let k;for(let[R,v]of h)s(w,R)&&(k=v);return k}}}var ne=(t,e,n)=>({untrusted:!0,authoredBy:n.say(e),text:t}),_t="the host's ranker";function et(t,e){return{...t,hits:t.hits.map(n=>{if(n.about!=="node")return n;n.why.by==="meaning"&&n.why.matched!==void 0&&(n={...n,why:{...n.why,matched:{untrusted:!0,authoredBy:_t,text:n.why.matched}}});let o=e.recordBy(n.id);if(!o)return n;let i=e.prose(n.kind,n.why.field)?e.fieldBy(n.id,n.why.field):o;return{...n,label:ne(n.label,o,e),...n.apart!==void 0?{apart:ne(n.apart,o,e)}:{},why:i?{...n.why,fragment:ne(n.why.fragment,i,e)}:n.why}})}}var ie=(t,e,n)=>({title:t,readOnlyHint:e,destructiveHint:!1,idempotentHint:n,openWorldHint:!1}),Tt={name:"subscribe",title:"Notify me when something happens",description:`Subscribe the person you act for to be told when something happens in this app \u2014 their host delivers it (an email, a push). on is one of: "act" (an act runs; give act, its declared name, and/or record), "created" (a record of kind is added), "changed" (a record of kind, or the one record, changes), "reaches" (a record of kind, or the one record, comes to satisfy condition, an expression in the app's rule language such as done == true or amount > 100). They are told only of changes someone else made, unless alsoMine is true, and only of records they may see. Returns the subscription and its sentence. Changes nothing in the app.`,inputSchema:{type:"object",properties:{on:{type:"string",enum:["act","created","changed","reaches"],description:"What to be told of."},act:{type:"string",description:"An act's declared name, for on: act."},kind:{type:"string",description:"A kind, for created, changed and reaches."},record:{type:"string",description:"One record, by id or name: for act, changed and reaches."},condition:{type:"string",description:"For reaches: what the record should come to satisfy, in the rule language (done == true)."},alsoMine:{type:"boolean",description:"Also when the person themselves made the change; false when unsaid."}},required:["on"],additionalProperties:!1},mutating:!1,annotations:ie("Notify me when something happens",!1,!1)},xt={name:"unsubscribe",title:"Stop notifying me",description:"Take away one of the person's subscriptions, by the id list_subscriptions or subscribe answered. Changes nothing in the app.",inputSchema:{type:"object",properties:{id:{type:"string",description:"The subscription's id."}},required:["id"],additionalProperties:!1},mutating:!1,annotations:ie("Stop notifying me",!1,!0)},Pt={name:"list_subscriptions",title:"What I am notified of",description:`List what the person you act for is told of in this app: each subscription's id and its sentence ("When someone else adds a task").`,inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:ie("What I am notified of",!0,!0)},oe=[Tt,xt,Pt];var it=t=>({type:"string",enum:[...t],description:"The workflow, by its name."}),tt=t=>({name:"run_workflow",title:"Run a workflow now",description:"Run one of the app's workflows now, by hand, as the app's own actor: its steps make, change, set aside or suggest what they say, as its approve setting says. With dryRun: true nothing is kept and the answer says what it would do. The first run after a workflow is added or changed is a dry run whatever you ask; run it again to keep it. A paused workflow only dry-runs. Returns the run: its outcome, what it made, changed, archived and suggested, what it held back and why.",inputSchema:{type:"object",properties:{name:it(t),dryRun:{type:"boolean",description:"Keep nothing; say what it would do. False when unsaid."}},required:["name"],additionalProperties:!1},mutating:!0,annotations:{title:"Run a workflow now",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}}),nt=(t,e)=>({name:t?"pause_workflow":"resume_workflow",title:t?"Pause a workflow":"Resume a workflow",description:t?"Pause one of the app's workflows: it runs on no schedule and no change until it is resumed, and run_workflow only dry-runs it. Changes the app's declaration, not its records. Returns the edit that takes it back.":"Resume a paused workflow: it runs again on its schedule and the changes it waits for. Changes the app's declaration, not its records. Returns the edit that takes it back.",inputSchema:{type:"object",properties:{name:it(e)},required:["name"],additionalProperties:!1},mutating:!0,annotations:{title:t?"Pause a workflow":"Resume a workflow",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}),ot=["run_workflow","pause_workflow","resume_workflow"];function rt(t,e){return e===void 0||t.length===0?[]:e==="manage"?[tt(t),nt(!0,t),nt(!1,t)]:[tt(t)]}function Mt(t){return{run:t.id,workflow:t.workflow,outcome:t.outcome,dry:t.dry,made:t.made,changed:t.changed,archived:t.archived,suggested:t.suggested,heldBack:t.heldBack,notes:t.notes}}async function at(t,e,n){let o=n.workflows.declared(),i=o.map(w=>w.name),r=String(e.name??"");if(!i.includes(r))return{ok:!1,error:`No workflow is called "${r}". The app's workflows are: ${i.join(", ")||"none"}. Nothing was changed.`,reason:"invalid"};if(t==="run_workflow"){let w=await n.workflows.run(r,{dryRun:e.dryRun===!0,...n.principal.id!==void 0?{who:n.principal.id}:{}});return{ok:!0,data:Mt(w)}}let a=n.workflows.edit;if(!a)return{ok:!1,error:"This seat's host does not write the app's declaration, so it cannot pause or resume a workflow. Nothing was changed.",reason:"forbidden"};let d=t==="pause_workflow",s=o.find(w=>w.name===r),g=s.status;if(g==="paused"===d)return{ok:!0,data:{workflow:r,status:g,said:`\u201C${s.title}\u201D is already ${g}. Nothing was changed.`}};let p=await a({op:d?"pause-workflow":"resume-workflow",name:r});return p.ok?{ok:!0,data:{workflow:r,status:d?"paused":"active",...p.said?{said:p.said}:{},undo:{op:d?"resume-workflow":"pause-workflow",name:r}}}:{ok:!1,error:p.error}}var F=t=>{let e;return()=>e??=t().catch(n=>{throw e=void 0,n})},Nt=F(()=>(__graviewPreload(import.meta.url,["./chunk.DDSAFU3B.js","./chunk.7KX36ENH.js","./chunk.KBJ3UUER.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.NNGG7RCO.js"))),$t=()=>(__graviewPreload(import.meta.url,["./chunk.UQZ2P6KD.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DG3YNOH3.js")).catch(()=>{}),Dt=async()=>{(await $t())?.judgeWithLines()},W=F(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.BSWR5SGX.js"))),Jt=F(()=>(__graviewPreload(import.meta.url,["./chunk.64K5ELSQ.js","./chunk.G4JJXA63.js","./chunk.TBY5IR7C.js","./chunk.PQTXM4VY.js","./chunk.BIDL7GQD.js","./chunk.7KX36ENH.js","./chunk.SPJ34VHA.js","./chunk.XOZU4OFA.js","./chunk.KBJ3UUER.js","./chunk.Q5WEOX3Q.js","./chunk.4O64QV2Y.js","./chunk.OYMN3IFX.js","./chunk.UQZ2P6KD.js","./chunk.WVUJXDXZ.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.45HUV56Z.js"))),Et=F(()=>(__graviewPreload(import.meta.url,["./chunk.6ZRVVRDQ.js","./chunk.DDSAFU3B.js","./chunk.7KX36ENH.js","./chunk.QDDDKEBH.js","./chunk.QKRQPUCE.js","./chunk.KBJ3UUER.js","./chunk.NI4OPHTL.js","./chunk.U5KJQFAP.js","./chunk.FOHZPYUV.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.6TBQV3NO.js","./chunk.MT252WP4.js","./chunk.VVIQSFM4.js","./chunk.TQ3MNB6K.js","./chunk.VGYG2IBZ.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.XSM4OTF4.js"))),Ht=F(()=>(__graviewPreload(import.meta.url,["./chunk.VL3YDD7D.js","./chunk.OPMGQS5J.js","./chunk.IXYG65TM.js","./chunk.W6L2VAJG.js","./chunk.N3MXLORL.js","./chunk.6L6RUOSF.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.O5RPSUXV.js")));var jt=t=>t.definitions.some(e=>Z(e).size>0),st=t=>({value:K(t),label:t.label,...t.describe?{describe:t.describe}:{},...t.card?{card:t.card}:{},fields:t.fields,...t.app?{app:t.app}:{}});async function It(t,e,n,o){let i=String(n.relation??""),[r,a]=i.includes(".")?i.split(".",2):[void 0,i],d=t.schema.definitions.flatMap(A=>[...Z(A)].map(([m,u])=>({kind:A.kind,name:m,relation:u}))),s=d.filter(A=>A.name===a&&(r===void 0||A.kind===r));if(s.length!==1){let A=d.map(m=>`${m.kind}.${m.name}`).join(", ")||"none";return{ok:!1,error:`${s.length===0?`No relation to another app is called "${i}"`:`"${i}" names a relation of several kinds`}. The relations to other apps are: ${A}.`}}let{kind:g,name:p,relation:w}=s[0];if(!o)return{ok:!1,error:`This seat cannot read ${w.address}: its host reads no other app's records. Nothing was changed.`};let h={kind:e.kind,...e.id===void 0?{}:{id:e.id},...e.roles?{roles:e.roles}:{},...e.onBehalfOf?{onBehalfOf:e.onBehalfOf}:{}},k=typeof n.of=="string"?n.of:void 0;if(k!==void 0){let A=t.graph.getNode(k);if(!A||A.kind!==g)return{ok:!1,error:`No ${g} "${k}".`};let m=he(A[p],w),u=await Promise.all(m.map(b=>Promise.resolve().then(()=>o.resolve(b,h)).catch(()=>null)));return{ok:!0,data:{relation:`${g}.${p}`,app:w.address,records:u.map((b,S)=>b===null?{value:K(m[S]),missing:!0}:"denied"in b?{denied:!0,said:"linked record (no access)"}:st(b))},reads:[k]}}let R=typeof n.limit=="number"&&n.limit>0?Math.min(n.limit,20):20,v=await Promise.resolve().then(()=>o.find({address:w.address,kinds:w.kinds,query:String(n.query??""),limit:R},h)).catch(()=>[]);return Array.isArray(v)?{ok:!0,data:{relation:`${g}.${p}`,app:w.address,records:v.map(st),link:`edit-${g} with ${p} set to a record's value`}}:{ok:!0,data:{relation:`${g}.${p}`,app:w.address,denied:!0,said:"linked record (no access)"}}}var M=t=>({title:t,readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}),dt={description:'Which records: false (the default) the live ones, true only the archived ones, "all" both. An archived record is set aside, not gone: unarchive-<kind> brings it back.',anyOf:[{type:"boolean"},{type:"string",enum:["all"]}]},re={type:"number",description:"Where the page starts; 0 when unsaid."},se=[{name:"search_graph",title:"Find by name",description:"Find things by name: records whose name or readable fields carry the words, and the kinds, places and rules the words name \u2014 each with why it matched. Reach for this before get_graph when you know what something is called. Words match the start of words, case and accents aside; key:value tokens narrow as a list's filter does (done:false, is:any for past records, kind:<kind>). Pass subject (a node id) to get the acts you may run on it as hits too. When few records match exactly, records with a near word follow \u2014 a typo, another form of the word, a meaning \u2014 each with near: true and why.matched, the record's own word that answered.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Words, with optional key:value conditions."},limit:{type:"number",description:"Most hits to return; at most 20."},subject:{type:"string",description:"A node id whose acts to include."},archived:dt},required:["query"],additionalProperties:!1},mutating:!1,annotations:M("Find by name")},{name:"get_graph",title:"Read the graph",description:"Read the graph, 25 nodes a page: their fields, the edges out of them, and how many more. Start here when you need the shape of the domain rather than one thing in it.",inputSchema:{type:"object",properties:{offset:re,archived:dt},additionalProperties:!1},mutating:!1,annotations:M("Read the graph")},{name:"get_node",title:"Read one node",description:"Read one node: its fields, its links (id, kind and label, 20 each way a page), the violations that implicate it, and its computed values: read-only fields worked out from what you can see, which no act sets. Use this to check a thing before you change it.",inputSchema:{type:"object",properties:{id:{type:"string",description:"A node's id, or its name."},offset:re},required:["id"],additionalProperties:!1},mutating:!1,annotations:M("Read one node")},{name:"get_violations",title:"List the problems",description:"List the invariant violations the graph currently has, 20 a page, with the repairs that would resolve each one. Read this before proposing work: a rule that is already broken is more urgent than anything you could add.",inputSchema:{type:"object",properties:{offset:re,context:{type:"object",description:"Evaluation context, e.g. { weekStart }."}},additionalProperties:!1},mutating:!1,annotations:M("List the problems")},{name:"get_affordances",title:"Ask what can be done",description:"Ask what can legally be done with a selection, ranked. Prefer these over composing a mutation by hand: they are derived from the schema, the invariants and the shape of the graph, so they cannot name an action that does not exist.",inputSchema:{type:"object",properties:{selection:{type:"array",items:{type:"string"},description:"Node ids."},context:{type:"object"}},required:["selection"],additionalProperties:!1},mutating:!1,annotations:M("Ask what can be done")},{name:"describe_place",title:"Say what a place shows",description:`Say what one place of the app shows you, as a person in your seat would see it: its headings, its figures as drawn, its lists with each record's title and what its card or row says, the headings a list is grouped under, what an empty list says, the forms it offers (each field in the order asked, its label, whether it must be answered, what it takes and its choices), and any block that could not be worked out. Pass a place's slug ("home", a lens's address like "the-offers", a kind's like "offers"), a record's id, or a visitor form's "forms/<name>", and width 390 for a phone. Use it after a change to check what somebody now sees, instead of guessing.`,inputSchema:{type:"object",properties:{place:{type:"string",description:`"home", a place's slug, a record's id, or "forms/<name>" for a visitor form.`},width:{type:"number",description:"The screen's width in CSS pixels; 390 is a phone, 1440 when unsaid."}},required:["place"],additionalProperties:!1},mutating:!1,annotations:M("Say what a place shows")},{name:"preview_mutation",title:"Try an act without applying it",description:"Try a mutation without applying it: get back the diff it would produce and any invariant it would break. Do this when you are unsure, rather than applying and undoing.",inputSchema:{type:"object",properties:{mutation:{type:"string"},args:{type:"object"}},required:["mutation","args"],additionalProperties:!1},mutating:!1,annotations:M("Try an act without applying it")},{name:"undo_batch",title:"Undo a batch",description:"Undo one batch of operations. Fails, naming the blocking operation, when a later operation read what it wrote.",inputSchema:{type:"object",properties:{batch:{type:"string"},include:{type:"array",items:{type:"string"}}},required:["batch"],additionalProperties:!1},mutating:!0,annotations:{title:"Undo a batch",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},{name:"list_suggestions",title:"List what is suggested",description:"List the suggestions waiting for a person: changes the app's own actor proposed and did not make, each with its id, what it would do, who suggested it, what it was based on and how sure (0 to 1), and the votes on it (tally: for, against, and this seat's own as mine). Nothing changes until one is accepted (accept_suggestion) or declined (decline_suggestion); a declined one is never suggested again.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:M("List what is suggested")},{name:"accept_suggestion",title:"Accept a suggestion",description:`Make a waiting suggestion's change, as this seat, carrying what it was based on. Returns the batch (undo_batch takes it back). From a seat that may see the suggestion and may not make the change, it records this seat's vote for it instead (voted: "for"; a later vote replaces it) and the suggestion still waits for someone who may.`,inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Accept a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1}},{name:"decline_suggestion",title:"Decline a suggestion",description:`Decline a waiting suggestion: nothing changes, the decline is kept in the log, and the same change is never suggested or made by the app's own actor again. From a seat that may not make the change, it records this seat's vote against it instead (voted: "against") and the suggestion still waits.`,inputSchema:{type:"object",properties:{suggestion:{type:"string",description:"The suggestion's id, from list_suggestions."}},required:["suggestion"],additionalProperties:!1},mutating:!0,annotations:{title:"Decline a suggestion",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}}],lt={name:"act_on_several",title:"Do one act to several records",description:`Run one act on several records at once, as one change with one undo. act is the act (its tool name or its declared name), records the records it runs on (ids or names; each goes in the act's subject), args what every call shares ("Set stage to Declined" is args { stage: "declined" }). Each record is judged on its own: one this seat may not change is named with why, and the rest still apply. Returns the batch (undo_batch takes it all back), the records changed, those already so, and those refused.`,inputSchema:{type:"object",properties:{act:{type:"string",description:"The act to run on each record."},records:{type:"array",items:{type:"string"},minItems:1,maxItems:200,description:"Ids or names of the records."},args:{type:"object",description:"Arguments every call shares, besides the record."}},required:["act","records"],additionalProperties:!1},mutating:!0,annotations:{title:"Do one act to several records",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!1}},ue={name:"suggest_changes",title:"Suggest changes",description:"Keep calls ({ act, args }) as one suggestion a person accepts or declines, with its basis and confidence (0 to 1). Changes nothing; a declined change is refused.",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object"}},basis:{type:"string"},confidence:{type:"number"}},required:["calls","basis"]},mutating:!0,annotations:{title:"Suggest changes",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},ut={name:"propose_changes",title:"Propose changes for review",description:"Propose calls ({ act, args }) this seat may not run as one proposal that somebody who may run them accepts or declines, with what it is for in the person's words (intent). Changes nothing now; each call is judged as it would be for the reviewer, and an act this seat may neither run nor propose is refused. Returns the proposal's id (list_suggestions shows it waiting).",inputSchema:{type:"object",properties:{calls:{type:"array",items:{type:"object",properties:{act:{type:"string"},args:{type:"object"}},required:["act","args"]}},intent:{type:"string",description:"What the proposal is for, in words: 1 to 500 characters."}},required:["calls"],additionalProperties:!1},mutating:!0,annotations:{title:"Propose changes for review",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},de={type:"object",description:"A lens, as draft_view returns one.",properties:{title:{type:"string"},lens:{type:"string"},on:{type:"string"},bindings:{type:"object"},options:{type:"object"}},required:["title","lens","on"]},ce={name:"draft_view",title:"Draw a view",description:'Draw a view of the data from words ("a board of tasks by status", "who covers what") as a lens the app could keep; or check a lens you wrote (lens); or change the one on screen (current, with ask: "only this month"). Returns the lens and its add-lens edit, or one sentence saying why not. Writes nothing.',inputSchema:{type:"object",properties:{ask:{type:"string",description:"What to see, in words."},lens:de,current:de},additionalProperties:!1},mutating:!1,annotations:M("Draw a view")},ft={name:"keep_lens",title:"Keep a view as a lens",description:"Keep a lens draft_view drew as one of the app's places: checked again, then written as the add-lens edit. Returns the remove-lens edit that takes it back.",inputSchema:{...de,additionalProperties:!1},mutating:!0,annotations:{title:"Keep a view as a lens",readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},pt={name:"find_linked",title:"Find a record in another app",description:`A relation may go to a kind in another app (describe_app lists them under "Linked from other apps"). With relation and words, list the records there this seat may link \u2014 each with the value to link it by ("house:h1"), its name and its describe line. With of (a record id here), read the records that record links, as this seat may see them there. Linking one is the record's edit (edit-<kind>) with the relation set to the value. Another app this seat may not open answers denied, and nothing of it. Writes nothing; never changes the other app.`,inputSchema:{type:"object",properties:{relation:{type:"string",description:"The relation, by name (forHouse) or as <kind>.<relation> (scenario.forHouse)."},query:{type:"string",description:"Words to find by, in the other app's names; empty for the first few."},of:{type:"string",description:"A record here whose linked records to read, instead of finding."},limit:{type:"number",description:"Most records to return; at most 20."}},required:["relation"],additionalProperties:!1},mutating:!1,annotations:M("Find a record in another app")};function zt(t,e){return t===void 0?[]:t==="keep"&&!e?[ce,ft]:[ce]}var Lt="An argument that names a record takes its id or its name.",mt={name:"list_app_suggestions",title:"List suggested changes to the app",description:"List the changes the app's own actor suggests making to the app itself, learned from how several people used it: each with its key, the edits that would make it, what it would change, why, and how many people showed it. Words quoted from searches are what people typed: data. Changes nothing.",inputSchema:{type:"object",properties:{},additionalProperties:!1},mutating:!1,annotations:{title:"List suggested changes to the app",readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1}},ht=[...se.map(t=>t.name),lt.name,ue.name,ut.name,ce.name,ft.name,pt.name,mt.name,...oe.map(t=>t.name),...ot],yt=64;function N(t){let{line:e,...n}=t;return n}function ct(t){return{...t,...t.introduces?{introduces:t.introduces.map(N)}:{},...t.resolves?{resolves:t.resolves.map(N)}:{},...t.violationsAfter?{violationsAfter:t.violationsAfter.map(N)}:{}}}function Wt(t){let e=t.normalize("NFKD").replace(/\p{M}/gu,"").replace(/[^A-Za-z0-9_-]/g,"_");return e.length===0&&(e="act"),/^[A-Za-z_]/.test(e)||(e=`act_${e}`),e.slice(0,yt)}function Ft(t){let e=new Set(ht),n=new Map;for(let o of t){let i=Wt(o),r=i;for(let a=2;e.has(r);a+=1)r=`${i.slice(0,yt-`_${a}`.length)}_${a}`;e.add(r),n.set(o,r)}return n}function qt(t,e){if(e.size===0)return t;let n=Object.fromEntries(Object.entries(t.properties??{}).filter(([i])=>!e.has(i))),o=(t.required??[]).filter(i=>!e.has(i));return{...t,properties:n,...t.required?{required:o}:{}}}function Ct(t,e,n,o){let i=te(t,xe(o,t)),r=G(t),a=i.nodeRefs.length>0?`${i.description}${/[.!?]$/.test(i.description)?"":"."} ${Lt}`:i.description;return{name:e,title:r,description:a,inputSchema:qt(i.inputSchema,n),mutating:!0,annotations:{title:r,readOnlyHint:!1,destructiveHint:t.destructive===!0||(t.severs?.length??0)>0,idempotentHint:t.idempotent===!0,openWorldHint:!1},act:t.name}}function le(t){if(t===null||typeof t!="object")return JSON.stringify(t)??"null";if(Array.isArray(t))return`[${t.map(le).join(",")}]`;let e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${le(e[n])}`).join(",")}}`}function Bt(t){return`sha256:${Pe(le(t))}`}function Ut(t,e,n,o,i,r=!1,a=!1,d=!1,s,g=!1,p=[],w=!1){let h=Ft(t.map(v=>v.name)),k=[...zt(o,n),...r?[pt]:[],...a?oe:[],...g?[mt]:[]];return{definitions:n?[...se.filter(v=>!v.mutating),...k]:[...se,lt,...d?[ue]:[],...w?[ut]:[],...k,...p,...t.filter(v=>e.has(v.name)).map(v=>Ct(v,h.get(v.name),i(v),s))],names:h}}function Wn(t,e={}){let n=e.author??{kind:"agent"},o=t.allMutations(),i=new Set(t.permittedMutations(n).map(m=>m.name)),{definitions:r,names:a}=Ut(o,i,e.readOnly===!0,e.drafts?e.drafts.keep?"keep":"draw":void 0,m=>X(t.schema,t.policy,n,m),jt(t.schema),e.subscriptions!==void 0,ve(n),t.schema,e.learned!==void 0,rt(e.workflows?.declared().map(m=>m.name)??[],e.workflows?e.workflows.edit?"manage":"run":void 0),Le(t.policy,n,o).length>0),d=Bt(r),s={app:e.app?.brand?.locale,appTimeZone:e.app?.brand?.timeZone},g=m=>pe(s,m),p=m=>{if(!ht.includes(m)){for(let[u,b]of a)if(b===m)return u;return a.has(m)?m:Me(m,a.keys())}},w=m=>{let u=Ne(m,a.keys());return u?` Did you mean "${u}"?`:""},h=m=>{let u=r.find(S=>S.name===m)??r.find(S=>S.act===m);if(u)return u;let b=p(m);return b===void 0?void 0:r.find(S=>S.act===b)},k=(m,u)=>{let b=o.find(l=>l.name===m);if(!b)return{args:u,resolved:[]};let S={...u},c=[];for(let l of C(b.input)){let f=S[l.name];if(typeof f!="string"||f.trim()==="")continue;let y=t.resolveRef(l,f,n);if(!y.ok){let O=y.reason==="none"?` Nothing was changed. Use search_graph to look it up, then pass its id as ${l.name}.`:" Nothing was changed.";return{ok:!1,error:`${y.message}${O}`,argument:l.name,candidates:y.candidates}}y.by!=="id"&&(S[l.name]=y.id,c.push({argument:l.name,given:f,id:y.id,label:y.label}))}return{args:S,resolved:c}},R=async(m,u)=>{try{await Dt();let b=h(m);if(!b&&m===ue.name)return{ok:!1,error:"Only the app's own actor (automated: true) suggests changes.",reason:"forbidden"};if(!b){let c=p(m);if(c){let l=t.permits({name:c,args:u},n);if(!l.ok)return{ok:!1,error:l.refusal.message,reason:"forbidden"}}return{ok:!1,error:`Unknown tool "${m}".${w(m)} Available: ${r.map(l=>l.name).join(", ")}`}}if(b.mutating&&e.readOnly)return{ok:!1,error:`"${m}" changes the graph, and this seat is read-only.`,reason:"forbidden"};if(b.act!==void 0){let c=k(b.act,u);if("ok"in c)return c;let l=b.act,f=g(()=>j(t,n,t.apply({name:l,args:c.args},{...e.author?{author:e.author}:{},...V(e.via)})));return{ok:!0,data:{batch:f.batch,intent:f.intent,introduces:f.introduces.map(N),resolves:f.resolves.map(N),...c.resolved.length>0?{resolved:c.resolved}:{}},diff:f.diff}}let S=t.seenBy(n);switch(b.name){case"search_graph":{let c=typeof e.places=="function"?e.places():e.places,l=typeof u.subject=="string"?u.subject:void 0,f=Fe(S,String(u.query??""),{principal:n,rank:e.near,archived:Se(u.archived),limit:typeof u.limit=="number"&&u.limit>0?Math.min(u.limit,20):20,...c?{places:c}:{},...l?{subject:l,from:[l]}:{}}),y=f.later?await f.later:f;return{ok:!0,data:(await W()).searchRead(y,et(y,U(S,n))),reads:y.hits.flatMap(O=>O.about==="node"?[O.id]:[])}}case"get_graph":return{ok:!0,...(await W()).graphRead(S,U(S,n),u)};case"get_node":{let c=String(u.id??""),l=c,f;if(!S.graph.getNode(c)){let O=c.trim()===""?void 0:t.resolveRef({name:"id",kinds:["*"]},c,n);if(O?.ok)l=O.id,f={argument:"id",given:c,id:l,label:O.label};else return O?.reason==="ambiguous"?{ok:!1,error:O.message,argument:"id",candidates:O.candidates}:{ok:!1,error:`No node "${c}".`}}let y=(await W()).nodeRead(S,U(S,n),l,u);return{ok:!0,data:f?{...y.data,resolved:[f]}:y.data,reads:y.reads}}case"describe_place":{let c=e.app??{name:"",schema:t.schema},l=typeof u.width=="number"&&Number.isFinite(u.width)&&u.width>0?u.width:1440,{describePlace:f}=await Nt(),y=f(t,n,String(u.place??""),{app:c,width:l});if(!y.ok)return{ok:!1,error:`${y.error} The places are: ${y.places.join(", ")}.`};let O=new Set,P=z=>{for(let D of z)for(let x of D.groups??[])for(let $ of x.items)O.add($.id),P($.parts)};return P(y.description.parts),{ok:!0,data:y.description,reads:[...O]}}case"find_linked":return It(S,n,u,e.linked);case"draft_view":case"keep_lens":{let c=e.app??{name:"",schema:t.schema};return(await Jt()).runDraftTool(b.name,u,{app:c,principal:n,...e.drafts?{drafts:e.drafts}:{}})}case"get_violations":{let c=S.violations(u.context);return{ok:!0,...(await W()).violationsRead(c,u)}}case"get_affordances":{let c=u.selection??[];return{ok:!0,data:We(S,c,{...typeof e.derive=="function"?e.derive():e.derive,...e.author?{principal:e.author}:{},...u.context?{context:u.context}:{}}),reads:c.filter(f=>S.graph.has(f))}}case"preview_mutation":{let c=String(u.mutation),l=p(c)??c,f=k(l,u.args??{});if("ok"in f)return f;let y=t.missingFor({name:l,args:f.args},n);if(y)return{ok:!1,error:y.message,reason:"missing"};let O=j(t,n,t.preview({name:l,args:f.args},void 0,{author:n})),P=ct(O);return{ok:!0,data:f.resolved.length>0?{...P,resolved:f.resolved}:P}}case"act_on_several":{let c=String(u.act??""),l=p(c)??c,f=o.find(_=>_.name===l);if(!f||!i.has(l)){let _=f?t.permits({name:l,args:{}},n):void 0;return _&&!_.ok?{ok:!1,error:_.refusal.message,reason:"forbidden"}:{ok:!1,error:`There is no act "${c}" this seat may run.${w(c)} Nothing was changed.`,reason:"invalid"}}let y=f.subject;if(!y)return{ok:!1,error:`"${G(f)}" does not act on a record, so it cannot be run on several. Nothing was changed.`,reason:"invalid"};let O=Array.isArray(u.records)?u.records.filter(_=>typeof _=="string"&&_.trim()!==""):[];if(O.length===0)return{ok:!1,error:"Name at least one record. Nothing was changed.",reason:"invalid"};let P=[],z=[];for(let _ of O.slice(0,200)){let J=t.resolveRef({name:y.arg,kinds:y.kinds},_,n);if(!J.ok)return{ok:!1,error:`${J.message} Nothing was changed.`,argument:"records",candidates:J.candidates};P.push(J.id),J.by!=="id"&&z.push({argument:"records",given:_,id:J.id,label:J.label})}let D=k(l,{...u.args??{}});if("ok"in D)return D;let x=(await Et()).actOnSeveral(t,{mutation:l,subject:y.arg,args:D.args},P,{author:n,...V(e.via)}),$=x.result?j(t,n,x.result):void 0;return{ok:!0,data:{...x.batch?{batch:x.batch,intent:x.intent}:{},applied:x.applied,unchanged:x.unchanged,refused:x.refused.map(_=>({record:_.id,label:_.label,error:_.message,reason:_.reason})),...x.allOrNothing?{keptNone:!0}:{},...$?{introduces:$.introduces.map(N),resolves:$.resolves.map(N)}:{},...z.length>0||D.resolved.length>0?{resolved:[...z,...D.resolved]}:{}},...$?{diff:$.diff}:{}}}case"subscribe":case"unsubscribe":case"list_subscriptions":{let c=await(await Ht()).runSubscriptionTool(b.name,u,{store:t,principal:e.subscriber??n,app:e.app?.name??"app",subscriptions:e.subscriptions});return c.ok?{ok:!0,data:c.data}:{ok:!1,error:c.error}}case"run_workflow":case"pause_workflow":case"resume_workflow":{let c=await at(b.name,u,{principal:n,workflows:e.workflows});return c.ok?{ok:!0,data:c.data}:{ok:!1,error:c.error,...c.reason?{reason:c.reason}:{}}}case"list_app_suggestions":return{ok:!0,data:{suggestions:(await e.learned()).map(({key:l,said:f,why:y,edits:O,evidence:P})=>({key:l,said:f,why:y,edits:O,evidence:P}))}};case"list_suggestions":{let c=Ee(t,n).map(l=>{let f=q(l.author,{graph:S.graph,schema:t.schema});return{id:l.id,intent:l.intent,by:f,at:l.at,about:l.about,tally:l.tally,...Ie(l)?{proposedBy:l.lineage.proposedBy}:{},...l.lineage?{basis:{untrusted:!0,authoredBy:f,text:l.lineage.basis},...l.lineage.confidence!==void 0?{confidence:l.lineage.confidence}:{}}:{}}});return{ok:!0,data:{suggestions:c},reads:[...new Set(c.flatMap(l=>l.about))]}}case"suggest_changes":{let c=u.calls.map(f=>({name:p(f.act)??f.act,args:f.args}));return{ok:!0,data:{suggestion:Je(t,c,{author:n,lineage:{basis:u.basis,confidence:u.confidence},...V(e.via)})?.id??null}}}case"propose_changes":{let c=(u.calls??[]).map(y=>({name:p(y.act)??y.act,args:y.args??{}})),l=typeof u.intent=="string"&&u.intent.trim()!==""?u.intent.trim():void 0,f=ze(t,n,c,l);return{ok:!0,data:{proposal:f?.id??null,...f?{intent:f.intent}:{}}}}case"accept_suggestion":case"decline_suggestion":{let c=String(u.suggestion??""),l={author:n,...V(e.via)},f=b.name==="accept_suggestion"?He(t,c,l):je(t,c,l),y=j(t,n,f);return{ok:!0,data:{batch:y.batch,intent:y.intent,...f.voted?{voted:f.voted}:{},introduces:y.introduces.map(N),resolves:y.resolves.map(N)},diff:y.diff}}case"undo_batch":{let c=String(u.batch),l=u.include??[],f=S.canUndo([c,...l]);if(!f.ok)return{ok:!1,error:f.message};let y=j(t,n,t.undo([c,...l],{...e.author?{author:e.author}:{}}));return{ok:!0,data:ct(y),diff:y.diff}}default:return{ok:!1,error:`Unknown tool "${m}".`}}}catch(b){let{reason:S,wouldNeed:c}=Ae(b);return{ok:!1,error:b instanceof Error?b.message:String(b),reason:S,...c?{wouldNeed:c}:{}}}},v=new Set,A=m=>{for(let u of v)u(m)};return{definitions:r,hash:d,...e.author?{author:e.author}:{},onDiff(m){return t.subscribe(m)},onCall(m){return v.add(m),()=>v.delete(m)},async call(m,u){let b=h(m)?.mutating??!1,S={name:m,args:u,mutating:b,at:new Date().toISOString()};A({...S,phase:"running"});let c=f=>(A(f.ok?{...S,phase:"ok",...!b&&f.reads?{reads:f.reads}:{}}:{...S,phase:"failed",error:f.error}),f),l=await R(m,u);return c(l.ok&&!b?{...l,data:(await W()).withinReadChars(m,l.data)}:l)}}}function V(t){let e=typeof t=="function"?t():t;return e?{via:e}:{}}export{le as a,Wn as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as G,b as q}from"./chunk.LQ5J6YQW.js";import{e as Ke}from"./chunk.7LPHWJB4.js";import"./chunk.W332P5T3.js";import{b as je}from"./chunk.VDFQFLTU.js";import"./chunk.PGT4ZQDG.js";import{a as Ne,c as K,d as Me}from"./chunk.D4F6QX5L.js";import{b as He}from"./chunk.V5JB5UJS.js";import"./chunk.EHLV3LND.js";import"./chunk.EPSYX2SF.js";import"./chunk.JLNTE5CH.js";import"./chunk.DDSAFU3B.js";import"./chunk.EOSN5DWW.js";import"./chunk.T6UJEXFL.js";import"./chunk.7THS3DLZ.js";import"./chunk.4QMAYVPU.js";import"./chunk.ARGEGV5T.js";import"./chunk.WS5ORRGS.js";import"./chunk.ZONRIOIA.js";import"./chunk.NXHEOHRR.js";import"./chunk.HJCQ6I3S.js";import"./chunk.DJGZOPAS.js";import{e as Te}from"./chunk.GFOZVQBQ.js";import"./chunk.MQNW3O67.js";import"./chunk.67S2UWBT.js";import"./chunk.7PWLRRUS.js";import"./chunk.NH3VXTGX.js";import"./chunk.6IMRCKB4.js";import{a as ee,b as Ie,c as ne,f as Pe,j as $e,l as Re}from"./chunk.64K5ELSQ.js";import"./chunk.G4JJXA63.js";import{a as xe}from"./chunk.TBY5IR7C.js";import"./chunk.PQTXM4VY.js";import"./chunk.BIDL7GQD.js";import"./chunk.7KX36ENH.js";import"./chunk.HXRHEPPJ.js";import"./chunk.QNWGDG2Z.js";import"./chunk.BJUUSIQY.js";import"./chunk.QDDDKEBH.js";import"./chunk.QKRQPUCE.js";import"./chunk.SPJ34VHA.js";import"./chunk.XOZU4OFA.js";import"./chunk.KBJ3UUER.js";import"./chunk.Q5WEOX3Q.js";import"./chunk.4O64QV2Y.js";import"./chunk.OYMN3IFX.js";import"./chunk.UQZ2P6KD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.NI4OPHTL.js";import{a as Ae}from"./chunk.U5KJQFAP.js";import"./chunk.FOHZPYUV.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import"./chunk.MIE4TJRW.js";import{s as Ee}from"./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{G as Le}from"./chunk.RJ7VSWTA.js";import{c as mn}from"./chunk.P43LPXXJ.js";import{D as ve,G as hn,Y as De,ga as Z,ia as Ce}from"./chunk.JCKIJSW7.js";import"./chunk.SDO3U72B.js";import{L as we,ea as ke,la as Y,ma as be,sa as Oe,va as Se}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import{b as _}from"./chunk.AJZBJBMO.js";var u=_(hn(),1),sn=_(mn(),1);var ie=e=>e.lens==="blocks",te=(e,n)=>e.place===void 0&&e.filter!==void 0&&e.filter!==""&&ie(n),Fe=4,gn=/^\d{4}-\d{2}-\d{2}/,wn=e=>e.charAt(0).toUpperCase()+e.slice(1),We=(e,n)=>e.tryDefinition(n)?.fields?.shape??{};function kn(e,n){let t=We(e,n),r=Object.keys(t).filter(i=>{let d=Ae(t[i]);return d?.type==="enum"&&!d.multiple}),o=Te(e,n)?.field;return o&&r.includes(o)?[o,...r.filter(i=>i!==o)]:r}function bn(e,n,t){let r=d=>t.some(c=>typeof c[d]=="string"&&gn.test(c[d])),o=Me(e,n);if(o&&r(o.field))return{start:o.field,...o.end?{end:o.end}:{},...o.done?{done:o.done}:{}};let i=Object.keys(We(e,n)).find(d=>["date","datetime"].includes(K(e,n,d)??"")&&r(d));return i?{start:i}:void 0}function On(e){let{app:n,kind:t,nodes:r,today:o}=e,i=n.schema,d=i.tryDefinition(t),c=m=>Oe(d,m).toLowerCase(),s=m=>r.some(C=>C[m]!==void 0&&C[m]!==null&&C[m]!==""),h=kn(i,t).filter(s),p=[],l=h[0];l&&r.length<=Ne&&p.push({recipe:{lens:"columns",kind:t,column:l},label:`Board by ${c(l)}`,phrase:`a board by ${c(l)}`,shape:"board"});let y=bn(i,t,r);if(y){let m=o.slice(0,7),C=r.some(b=>typeof b[y.start]=="string"&&b[y.start].startsWith(m)),A={lens:"calendar",kind:t,start:y.start,...y.end?{end:y.end}:{},...y.done?{done:y.done}:{},range:"month"};p.push(C?{recipe:A,label:`Calendar by ${c(y.start)}`,phrase:`a calendar by ${c(y.start)}`,shape:"calendar"}:{recipe:{lens:"blocks",kind:t,as:"row",sort:{by:y.start}},label:`In order of ${c(y.start)}`,phrase:`a list in order of ${c(y.start)}`,shape:"order"})}let S=d?.fieldRoles??{},[v,I,D]=[S.start,S.end,S.column??S.day];v&&I&&D&&K(i,t,v)==="number"&&K(i,t,I)==="number"&&K(i,t,D)==="enum"&&s(v)&&s(D)&&p.push({recipe:{lens:"timeline",kind:t,start:v,end:I,column:D},label:`Timeline by ${c(D)}`,phrase:`a timeline by ${c(D)}`,shape:"timeline"});for(let[m,C]of Object.entries(d?.edges??{})){let A=Array.isArray(C?.to)?C.to.find(w=>w!==t&&i.tryDefinition(w)):void 0;if(!A||!e.linked||!r.some(w=>e.linked(w.id,m)))continue;let b=Se(i.tryDefinition(A),A);p.push({recipe:{lens:"coverage",kind:t,across:A,link:m},label:`Grid by ${b}`,phrase:`a grid by ${b}`,shape:"grid"});break}return p.push({recipe:{lens:"blocks",kind:t,as:"card"},label:"Cards",phrase:"cards",shape:"cards"}),l?p.push({recipe:{lens:"blocks",kind:t,as:"row",group:l},label:`Rows by ${c(l)}`,phrase:`rows by ${c(l)}`,shape:"rows"}):e.place!==void 0&&p.push({recipe:{lens:"blocks",kind:t,as:"row"},label:"Rows",phrase:"rows",shape:"rows"}),p}var L=e=>JSON.stringify([e.name??e.lens,e.bindings??{},e.options?.blocks??e.options?.range??null]);function _e(e){return e.name==="columns"?"board":e.name==="coverage"?"grid":e.name==="blocks"?e.options?.blocks?.some(n=>n.as==="card")?"cards":"rows":e.name}var T=e=>e.lenses??[],Ge=(e,n)=>e.on===n||e.on===void 0&&Object.prototype.hasOwnProperty.call(e.bindings??{},n),se=e=>e.app.pages?.lists?.[e.kind]?.opens;function qe(e,n){let t={lens:n.name,on:e.kind,...n.bindings?{bindings:n.bindings}:{},...n.options?{options:n.options}:{}};if(e.place!==void 0){let r=T(e.app).find(o=>o.title===e.place);return[{op:"add-lens",title:e.place,...t,replace:e.place,...r?.create===!1?{create:!1}:{}}]}return[{op:"add-lens",title:n.title,...t},{op:"set-lens-hidden",title:n.title,on:e.kind,hidden:!0},B(e,n.title)]}var B=(e,n)=>({op:"arrange-pages",opens:{[e.kind]:n}}),Be=(e,n)=>{if(e.place!==void 0)return;let t=L(n),r=JSON.stringify(n.options??{});return T(e.app).find(o=>o.hidden===!0&&Ge(o,e.kind)&&L(o)===t&&JSON.stringify(o.options??{})===r)};function oe(e,n){if(!e.compose||!e.document)return!1;try{return e.compose({document:e.document,edits:n}).ok}catch{return!1}}function Sn(e,n){let t=new Set(T(e).map(r=>r.title));if(!t.has(n))return n;for(let r=2;;r++)if(!t.has(`${n} ${r}`))return`${n} ${r}`}var Ue=e=>{let n=e.place===void 0?void 0:T(e.app).find(t=>t.title===e.place);return n!==void 0&&G(n,e.kind)};function Je(e){let n=e.place??se(e),t=n===void 0?void 0:T(e.app).find(r=>r.title===n);return t&&!G(t,e.kind)?L(t):void 0}function Ve(e,n,t){if(Ue(e))return;let r=Pe(n),o=L(r);if(o===Je(e))return;let i={...r,on:e.kind,title:Sn(e.app,r.title)},d=ne(e.app,i,e.sight);if(!d.ok||te(e,d.drawn))return;let c=Be(e,i);if(c&&c.title===se(e))return;let s=c?[B(e,c.title)]:qe(e,i);if(oe(e,s))return{...t,shape:_e(i),title:c?.title??i.title,drawing:o,drawn:d.drawn,edits:s}}function ze(e){if(e.nodes.length===0||Ue(e))return[];let n=Je(e),t=new Set(n?[n]:[]),r=[];if(e.place===void 0)for(let o of T(e.app)){if(o.title===void 0||o.hidden===!0||!Ge(o,e.kind)||o.title===se(e)||G(o,e.kind))continue;let i=ne({...e.app,lenses:T(e.app).filter(s=>s!==o)},{...o,on:e.kind},e.sight);if(!i.ok||te(e,i.drawn))continue;let d=[B(e,o.title)];if(!oe(e,d))continue;let c=L(o);t.add(c),r.push({key:`place:${o.title}`,label:o.title,phrase:`\u201C${o.title}\u201D`,shape:_e(o),from:"place",title:o.title,drawing:c,drawn:i.drawn,edits:d})}for(let o of On(e)){let i=$e(o.recipe,{app:e.app,...e.sight?{sight:e.sight}:{}});if(ee(i)||te(e,i.drawn))continue;let d=L(i.lens);if(t.has(d))continue;let c=Be(e,i.lens),s=c?[B(e,c.title)]:qe(e,i.lens);oe(e,s)&&(t.add(d),r.push({key:`${o.shape}:${d}`,label:o.label,phrase:o.phrase,shape:o.shape,from:"graview",title:c?.title??i.lens.title,drawing:d,drawn:i.drawn,edits:s}))}for(let o of e.offers??[]){let i=ae(e,o);!i||t.has(i.drawing)||(t.add(i.drawing),r.push(i))}return Cn(r,e.choices??[],e.kind)}var vn=e=>{let n=e;return typeof n?.id=="string"&&n.id!==""&&typeof n.label=="string"&&n.label!==""&&typeof n.lens=="object"&&n.lens!==null};function ae(e,n){if(vn(n))try{return Ve(e,n.lens,{key:`host:${n.id}`,label:n.label,phrase:ke(n.label),from:"host",hostId:n.id,...typeof n.weight=="number"?{weight:n.weight}:{}})}catch{return}}function Qe(e,n){try{let t=e?.offers?.(n);if(Array.isArray(t))return{now:t};if(typeof t?.then=="function")return{now:[],late:Promise.resolve(t).then(r=>Array.isArray(r)?r:[],()=>[])}}catch{}return{now:[]}}function Xe(e){try{let n=e?.chosen?.();return Array.isArray(n)?n.filter(Ze):[]}catch{return[]}}async function Ye(e,n){try{let t=await Re(`Whatever would make ${e.name.toLowerCase()} clearest to read`,{app:e.app,complete:n,...e.sight?{sight:e.sight}:{}});if(ee(t))return;let r=t.lens;return Ve(e,{lens:r.name,title:r.title,...r.bindings?{bindings:r.bindings}:{},...r.options?{options:r.options}:{}},{key:`model:${L(r)}`,label:wn(r.title),phrase:`\u201C${r.title}\u201D`,from:"model"})}catch{return}}function Dn(e,n,t){let r=o=>n.reduce((i,d)=>i+(d.key===o.key||d.shape===o.shape?d.kind===t?3:1:0),o.weight??0);return e.map((o,i)=>({option:o,at:i,score:r(o)})).sort((o,i)=>i.score-o.score||o.at-i.at).map(o=>o.option)}function Cn(e,n,t){let r=Dn(e,n,t),o=r.slice(0,Fe),i=r.find(d=>d.from==="host");return i&&!o.includes(i)&&(o[o.length-1]=i),o}var Ze=e=>{let n=e;return typeof n?.key=="string"&&typeof n.shape=="string"&&typeof n.kind=="string"},re=e=>`graview:display-choices:${e}`,An=40,en=new Map;function U(e){try{let n=JSON.parse(localStorage.getItem(re(e))??"null");if(Array.isArray(n))return n.filter(Ze)}catch{}return en.get(e)??[]}function nn(e,n){en.set(e,n);try{n.length===0?localStorage.removeItem(re(e)):localStorage.setItem(re(e),JSON.stringify(n))}catch{}}function En(e,n){nn(e,[...U(e),n].slice(-An))}function xn(e,n,t){nn(e,U(e).filter(r=>!(r.key===n&&r.at===t)))}function In(e,n){let t=`${n} shows as ${e.phrase}.`;return{said:t,add:[],drop:[],card:{said:t,adds:[],keeps:[],drops:[],breaking:[]},edits:e.edits}}function tn(e){let n=new Set,t={options:e.options,shown:null,phase:"choosing",canUndo:!1},r,o,i=[],d=s=>{t={...t,...s},n.forEach(h=>h())},c=s=>{if(o)try{e.onKept?.({kept:o,offered:i,undone:s})}catch{}};return{get:()=>t,subscribe(s){return n.add(s),()=>void n.delete(s)},flip(s){if(t.phase!=="choosing"||s===t.shown||s!==null&&!t.options.some(l=>l.key===s))return;let{said:h,...p}=t;t=p,d({shown:s})},join(s){if(t.phase!=="choosing")return;let h=s.filter(l=>!t.options.some(y=>y.key===l.key||y.drawing===l.drawing));if(h.length===0)return;let p=[...t.options,...h];for(let l=p.length-1;l>=0&&p.length>Fe;l--)p[l].from!=="host"&&p[l].from!=="model"&&p[l].key!==t.shown&&p.splice(l,1);d({options:p})},drop(s){t.options.some(h=>h.key===s)&&d({options:t.options.filter(h=>h.key!==s),shown:t.shown===s?null:t.shown})},async keep(){let s=t.options.find(p=>p.key===t.shown);if(!s||t.phase!=="choosing")return;d({phase:"keeping"});let h;try{h=await e.propose(In(s,e.name))}catch{return d({phase:"choosing",said:"It couldn't be kept."})}if(h==="declined")return d({phase:"choosing",said:"It wasn't kept."});typeof h=="object"&&(r=h.undo),i=t.options.map(p=>p.key),o={key:s.key,kind:e.kind??"",shape:s.shape,from:s.from,...s.hostId?{hostId:s.hostId}:{},at:new Date().toISOString()},e.appKey!==void 0&&En(e.appKey,o),c(!1),d({phase:"kept",said:`${e.name} now shows as ${s.phrase}.`,canUndo:r!==void 0,...typeof h=="object"&&h.note?{note:h.note}:{}})},async undo(){let s=r;if(t.phase!=="kept"||!s)return;r=void 0;try{await s()}catch{return r=s,d({said:"It couldn't be put back."})}o&&e.appKey!==void 0&&xn(e.appKey,o.key,o.at),c(!0);let{note:h,...p}=t;t=p,d({phase:"undone",said:`${e.name} is as it was.`,canUndo:!1})}}}function on(e,n,t){let r=e.tryDefinition(n);return t.slice(0,200).map(o=>be(r,o)).filter(o=>o.length>1)}var k=_(De(),1),de=new Map,Pn=e=>e?.querySelector("main")??e??null,J=e=>Pn(e.main?.isConnected?e.main:document.querySelector("[data-graview-page-main], main")??document.querySelector("[data-graview-face]"));function rn(e){let n=e.querySelector("[data-graview-page-title]"),t=n?.closest("header")??n?.parentElement??null;return t&&t!==e&&e.contains(t)?t:null}var M="data-graview-under-option",le="data-graview-option-wide",N="__now__",$n=(0,u.memo)(function({option:n,shown:t,names:r,nodes:o,drew:i,failed:d}){let c=(0,u.useRef)(null),s=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{s.current&&(s.current.inert=!0)},[]),(0,u.useLayoutEffect)(()=>{let l=()=>{let S=(c.current?.textContent??"").toLowerCase();return r.some(v=>S.includes(v.toLowerCase()))};if(l())return i(n.key);let y=[100,400,1500].map((S,v,I)=>setTimeout(()=>{l()?i(n.key):v===I.length-1&&d(n.key)},S));return()=>y.forEach(clearTimeout)},[n.key]);let h=(0,u.useMemo)(()=>He(n.drawn),[n.drawn]),p=ie(n.drawn);return(0,k.jsx)("div",{ref:c,"data-testid":"display-option-pane","data-display-option":n.key,"data-shown":t?"":void 0,style:{...p?Hn:Tn,...t?{}:Nn},children:(0,k.jsx)("div",{ref:s,style:p?void 0:Mn,children:(0,k.jsx)(Ee,{kind:n.drawn.kinds[0]??"",view:n.title,children:(0,k.jsx)(h,{nodes:o,label:n.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})})});function Rn({options:e,shown:n,names:t,drew:r,failed:o,kind:i,filter:d}){let{store:c}=Z();Ce();let s=c.schema.tryDefinition(i),h=c.graph.nodesOfKind(i).filter(y=>Y(s,y)),p=d?new Set(c.violations().flatMap(y=>y.nodeIds)):void 0,l=q(c.schema,c.graph,i,h,d,p);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)("style",{children:`[${M}]{display:none !important}[${le}]{max-width:1160px !important}`}),e.map(y=>(0,k.jsx)($n,{option:y,shown:y.key===n,names:t,nodes:l,drew:r,failed:o},y.key))]})}function rt({ask:e,close:n}){let t=Z(),{ai:r,app:o,brand:i,composeChange:d,displayOptions:c,onProposeChange:s,principal:h,store:p}=t,l=e.part,y=l.kind,S=Le(i,p.schema),v=()=>p.graph.nodesOfKind(y).filter(a=>Y(p.schema.tryDefinition(y),a)),[I]=(0,u.useState)(()=>on(p.schema,y,q(p.schema,p.graph,y,v(),l.filter,l.filter?new Set(p.violations().flatMap(a=>a.nodeIds)):void 0))),[D]=(0,u.useState)(()=>{let a=de.get(e.at);if(a)return a;let f={...o,schema:p.schema},g={app:f,document:je(o??{}),compose:d,kind:y,name:l.name,nodes:v(),today:p.today()??we(),sight:Ie(f,h),linked:(x,H)=>p.graph.outEdges(x).some(R=>R.kind===H),...l.slot==="place"?{place:l.name}:{},...l.filter?{filter:l.filter}:{}},E=[...U(S),...Xe(c)],un={kind:y,name:l.name,...l.slot==="place"?{place:l.name}:{}},me=Qe(c,un),X=tn({options:ze({...g,choices:E,offers:me.now}),name:l.name,kind:y,appKey:S,propose:x=>s(x),...c?.onChoice?{onKept:c.onChoice}:{}});if(me.late?.then(x=>X.join(x.flatMap(H=>ae(g,H)??[]))),ve(r)){let x=r.thinking,H=x?R=>x.think({prompt:R.prompt,system:R.system??"",state:{},catalog:[]}):r.complete;H&&Ye(g,H).then(R=>R?X.join([R]):void 0)}let ge={flips:X,opened:!1};return de.set(e.at,ge),ge}),{flips:m}=D,C=(0,u.useSyncExternalStore)(m.subscribe,m.get,m.get),{options:A,shown:b,phase:w,said:ce,note:pe}=C,P=w==="choosing"||w==="keeping",[dn,ln]=(0,u.useState)(()=>new Set),cn=(0,u.useMemo)(()=>a=>ln(f=>f.has(a)?f:new Set([...f,a])),[]),pn=(0,u.useMemo)(()=>a=>m.drop(a),[m]),j=A.filter(a=>dn.has(a.key));(0,u.useEffect)(()=>{D.opened||w!=="choosing"||j.length===0||(D.opened=!0,m.flip(j[0].key))},[D,m,w,j]);let[O,fe]=(0,u.useState)(null);(0,u.useLayoutEffect)(()=>{if(!P)return;let a=J(l);if(!a)return;let f=document.createElement("div");f.setAttribute("data-testid","display-options-stage"),Object.assign(f.style,Ln);let g=rn(a);return g?.parentElement?g.parentElement.insertBefore(f,g.nextSibling):a.insertBefore(f,a.firstChild),fe(f),()=>{f.remove(),fe(null)}},[P]),(0,u.useLayoutEffect)(()=>{let a=O?J(l):null;if(!a)return;let f=b===null;if(O.style.position=f?"absolute":"relative",O.style.height=f?"0":"auto",O.style.visibility=f?"hidden":"visible",O.setAttribute("data-display-shown",b??N),!f){a.setAttribute(le,"");for(let g=O;g!==a&&g.parentElement;g=g.parentElement)for(let E of g.parentElement.children)E!==g&&E!==rn(a)&&E.localName!=="style"&&E.setAttribute(M,"")}return()=>{a.removeAttribute(le);for(let g of a.querySelectorAll(`[${M}]`))g.removeAttribute(M)}});let ye=()=>{de.delete(e.at),n()},F=()=>{let a=J(l);for(let g of a?.querySelectorAll(`[${M}]`)??[])g.removeAttribute(M);O&&(O.style.display="none");let f=e.returnTo?.isConnected?e.returnTo:document.querySelector("[data-graview-page-title], main h1");f&&!f.hasAttribute("tabindex")&&!f.matches("a[href], button, input, select, textarea")&&f.setAttribute("tabindex","-1"),f?.focus?.({preventScroll:!0}),ye()};(0,u.useEffect)(()=>{if(!P||!O)return;let a=location.pathname,f=()=>J(l)?.querySelector("[data-graview-page-title]")?.textContent??null,g=f(),E=setInterval(()=>{m.get().phase!=="keeping"&&(location.pathname!==a||!O.isConnected||f()!==g)&&ye()},250);return()=>clearInterval(E)},[P,O]);let ue=(0,u.useRef)(F);ue.current=F,(0,u.useEffect)(()=>{let a=f=>{f.key!=="Escape"||m.get().phase==="keeping"||document.querySelector("[data-graview-popover]:not([data-better-bar]):not([hidden]), [data-testid='context-menu']")||(f.preventDefault(),ue.current())};return document.addEventListener("keydown",a,!0),()=>document.removeEventListener("keydown",a,!0)},[m]);let W=xe(p,h);(0,u.useEffect)(()=>{!W&&w==="choosing"&&F()},[W,w]);let V=(0,u.useRef)(null),he=(0,u.useRef)(!1);(0,u.useEffect)(()=>{w!=="choosing"||b===null||he.current||(he.current=!0,V.current?.querySelector('[role="radio"][aria-checked="true"]')?.focus({preventScroll:!0}))},[w,j.length,b]);let $=[{key:N,label:"As it is now"},...j],fn=a=>{let f=a.key==="ArrowRight"||a.key==="ArrowDown"?1:a.key==="ArrowLeft"||a.key==="ArrowUp"?-1:0,g=f!==0?$[($.findIndex(E=>E.key===(b??N))+f+$.length)%$.length]:a.key==="Home"?$[0]:a.key==="End"?$.at(-1):void 0;g&&(a.preventDefault(),m.flip(g.key===N?null:g.key),V.current?.querySelector(`[data-option="${CSS.escape(g.key)}"]`)?.focus({preventScroll:!0}))},z=A.find(a=>a.key===b),yn=P?ce??(z?z.label:`${l.name} as it is now`):ce??"",Q=w==="choosing"&&A.length===0;return(0,k.jsxs)(k.Fragment,{children:[O&&P?(0,sn.createPortal)((0,k.jsx)(Rn,{options:A,shown:b,names:I,drew:cn,failed:pn,kind:y,filter:l.filter}),O):null,(0,k.jsx)(Ke,{phase:`options-${w}`,name:l.name,said:Q?`There are no other ways to show ${l.name} yet.`:yn,...P&&!Q?{scope:"Nothing changes until you keep one. Everyone in this app sees the one you keep."}:{},...pe?{note:pe}:{},...w==="choosing"&&z&&W?{keep:()=>void m.keep()}:{},...w==="kept"&&C.canUndo&&W?{undo:()=>void m.undo()}:{},...w!=="keeping"?{close:F}:{},children:w==="choosing"&&!Q?(0,k.jsx)("div",{ref:V,role:"radiogroup","aria-label":`Ways to show ${l.name}`,"data-testid":"display-options",onKeyDown:fn,style:jn,children:$.map(a=>{let f=a.key===(b??N);return(0,k.jsx)("button",{type:"button",role:"radio","aria-checked":f,tabIndex:f?0:-1,"data-testid":"display-option","data-option":a.key,onClick:()=>m.flip(a.key===N?null:a.key),style:f?Kn:an,children:a.label},a.key)})}):null})]})}var Ln={position:"relative",minWidth:"0",maxWidth:"100%",width:"100%",overflow:"clip"},Tn={boxSizing:"border-box",height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},Hn={display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"},Nn={position:"absolute",top:0,left:0,right:0,visibility:"hidden",pointerEvents:"none"},Mn={display:"grid",gridTemplateRows:"minmax(0, 1fr)",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0,minHeight:0},jn={display:"flex",flexWrap:"wrap",gap:6,marginTop:4},an={minHeight:34,padding:"0 12px",font:"inherit",borderRadius:8,cursor:"pointer",color:"var(--graview-ink)",background:"transparent",border:"1px solid var(--graview-edge)"},Kn={...an,fontWeight:600,border:"1px solid var(--graview-accent)",boxShadow:"inset 0 0 0 1px var(--graview-accent)"};export{rt as DisplaySwitch};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bd as E,Cd as G,Ed as F,Fd as J,Lb as O,Sb as P,Ub as h,Vb as j,cc as x,fb as k}from"./chunk.
|
|
1
|
+
import{Bd as E,Cd as G,Ed as F,Fd as J,Lb as O,Sb as P,Ub as h,Vb as j,cc as x,fb as k}from"./chunk.6L6RUOSF.js";var W=(o,a)=>{let t=o.kindOf(a);return t===void 0?void 0:o.kept?.({id:a,kind:t})};function w(o,a){return o.flatMap(t=>{if(t.op==="splice-text")return W(a,t.id)?.(t.field)?[]:[t];if(t.op!=="patch-node")return[t];let i=W(a,t.id);if(!i||!Object.keys(t.after).some(i))return[t];let c=r=>Object.fromEntries(Object.entries(r).filter(([f])=>!i(f))),n=c(t.after);return Object.keys(n).length===0?[]:[{op:"patch-node",id:t.id,before:c(t.before),after:n}]})}function _(o,a,t){if(!G(o,a))return t;let i=F(o,a),c=r=>o.graph.getNode(r)!==void 0||x(o.log).kindOf(r)!==void 0,n={...t};if(t.diff){let r=t.diff,f=E(o.log),l=o.log.length??o.log.all().length,u=t.ops?.[0]?.seq??l,M=k(a).id,y=(e,s)=>d=>f.writerAt(e,d,s),m=(e,s)=>i.shows(e.id)?i.servedWith(e,s):void 0,b=(e,s)=>e.flatMap(d=>m(d,s(d.id))??[]),S=e=>i.shows(e.from)&&i.shows(e.to)&&!h(e,i.sees),v=(e,s)=>t.ops?y(e,l):d=>s===void 0||s.includes(d)?M:f.writerAt(e,d,l),D=r.changedNodes.flatMap(e=>{let s=m(e.before,y(e.before.id,u)),d=m(e.after,v(e.after.id,e.fields));return s&&d?[{before:s,after:d,fields:e.fields.filter(p=>p in s||p in d)}]:[]}),B=new Set(r.changedNodes.map(e=>e.after.id)),g=new Map;for(let e of t.ops?.flatMap(s=>s.primitives)??t.primitives??[])e.op!=="patch-node"&&e.op!=="splice-text"||B.has(e.id)||g.set(e.id,[...g.get(e.id)??[],...e.op==="splice-text"?[e.field]:Object.keys(e.after)]);let I=[...g].flatMap(([e,s])=>{let d=o.graph.getNode(e);if(!d)return[];let p=m(d,y(e,u)),N=m(d,v(e,s));return p&&N&&JSON.stringify(p)!==JSON.stringify(N)?[{before:p,after:N,fields:s}]:[]});n.diff={addedNodes:b(r.addedNodes,e=>v(e)),removedNodes:b(r.removedNodes,e=>y(e,u)),changedNodes:[...D,...I],addedEdges:r.addedEdges.filter(S),removedEdges:r.removedEdges.filter(S),touched:[...r.touched.filter(i.shows),...[...g.keys()].filter(e=>i.shows(e)&&!r.touched.includes(e))]}}if(t.ops&&(n.ops=j(t.ops,i)),t.primitives){let r=n.ops;n.primitives=r?r.flatMap(f=>f.primitives):i.timeline?O(t.primitives,i.timeline,{served:(f,l)=>i.servedWith(f,l),edgeClean:f=>!h(f,i.sees),sees:i.sees},k(a).id):j([{id:"",seq:0,batch:"",author:{kind:"system"},intent:"",mutation:null,primitives:t.primitives,reads:[],writes:[],at:""}],i)[0].primitives}return i.kept&&n.primitives&&(n.primitives=w(n.primitives,i)),t.reads&&(n.reads=t.reads.filter(r=>i.shows(r)&&c(r))),t.writes&&(n.writes=t.writes.filter(i.shows)),t.intent!==void 0&&h(t.intent,i.sees)&&(n.intent=P),t.violationsAfter&&Object.assign(n,A?A(o,J(o,a),!!t.ops,n.primitives??[]):{introduces:[],resolves:[],violationsAfter:[]}),n}var A,z=o=>void(A=o);export{_ as a,z as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as T,c as m,d as k}from"./chunk.
|
|
1
|
+
import{b as T,c as m,d as k}from"./chunk.MFMC35ET.js";import{b as v,d as w,e as P,f as M,g as N}from"./chunk.M5FP4Y4Q.js";var j=new Set(["input","select","textarea"]),g=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&j.has(r.localName),R=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",S=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function y(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(t=>t.value).join("\0")}`:`value:${r.value}`}function D(r=t=>t.isTrusted){let t=new WeakMap,s=new WeakSet,o=new WeakMap,i={heard(e,n){if(!(!g(n)||!r(e))&&(e.type==="input"||e.type==="change"&&R(n))&&((R(n)||S(n))&&s.delete(n),S(n)&&o.delete(n),t.set(n,y(n)),n.type==="radio"&&n.name)){let u=n.getRootNode();for(let c of u.querySelectorAll?.('input[type="radio"]')??[])c.name===n.name&&t.set(c,y(c))}},filled(e){t.delete(e),o.delete(e),g(e)&&!S(e)?s.add(e):s.delete(e)},press(e,n,u){if(!r(e))return;let c=n.closest("[data-act]");if(!c||!w(c))return;let l=e.type==="keydown"?e.key:void 0;if(!(e.type!=="click"&&!((l==="Enter"||l===" ")&&n===c&&!v(c))))return i.collect(c,u)},collect(e,n){if(!e.hasAttribute("data-act")||!n.contains(e))return;let u=e.closest("[data-record]"),c=e.closest("fieldset, [role='group']")??n,l=[];for(let a of c.querySelectorAll("input[name], select[name], textarea[name]")){let d=a,f=!s.has(d)&&t.get(d)===y(d);if(d.type==="radio"){if(!d.checked)continue;l.push({name:d.name,value:d.value,typed:f,empty:!1,chosen:!0});continue}if(d.localName==="select"){l.push({name:d.name,value:d.value,typed:f,empty:d.value===""&&!f,chosen:!0});continue}if(d.type==="checkbox"){l.push({name:d.name,value:d.checked,typed:f,empty:!d.checked&&!s.has(d)&&!f});continue}let O=(d.type==="number"||d.type==="range")&&d.value!==""&&Number.isFinite(d.valueAsNumber)?d.valueAsNumber:d.value,x=f?o.get(d):void 0;l.push({name:d.name,value:O,typed:f,empty:d.value===""&&!f,...x?{from:x}:{}})}return{as:e.getAttribute("data-act")??"",...u&&n.contains(u)?{record:u.getAttribute("data-record")}:{},fields:l}},prefilled(e,n){s.delete(e),o.set(e,n),t.set(e,y(e))}};return i}var b=new WeakMap,L=(r,t)=>{t.tab&&r.removeAttribute("tabindex"),t.role&&r.getAttribute("role")==="button"&&r.removeAttribute("role"),r.removeAttribute("data-graview-press"),b.delete(r)};function V(r){for(let t of r.querySelectorAll("[data-act], [data-graview-press], [role], [aria-pressed], [aria-expanded]")){let s=b.get(t),o=w(t)&&!v(t)&&!g(t),i=!o&&P(t,s?.role?null:t.getAttribute("role"));if(s&&(s.bound!==o||!(o||i))&&L(t,s),(o||i)&&!b.has(t)){let e=!M(t),n=o&&N(t);e&&t.setAttribute("tabindex","0"),n&&t.setAttribute("role","button"),t.setAttribute("data-graview-press",""),b.set(t,{tab:e,role:n,bound:o})}}}var h=new WeakSet;function z(r){for(let t of r.querySelectorAll("svg")){let s=t.hasAttribute("role")||t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||[...t.children].some(e=>e.localName==="title"),o=t.hasAttribute("tabindex")||t.hasAttribute("data-graview-link")||t.hasAttribute("data-graview-press")||t.querySelector("[tabindex], [data-graview-link], [data-graview-press], a")!==null,i=!s&&!o;i&&!h.has(t)&&!t.hasAttribute("aria-hidden")?(t.setAttribute("aria-hidden","true"),h.add(t)):!i&&h.has(t)&&(t.removeAttribute("aria-hidden"),h.delete(t))}}var I=1e3;function H(r){let t=r.getAttribute("data-debounce")?.trim(),s=t?Number(t):Number.NaN;return Number.isFinite(s)?Math.min(1e4,Math.max(250,Math.round(s))):I}function B(r){let t=r.trusted??(e=>e.isTrusted),s=r.timers??{set:(e,n)=>setTimeout(e,n),clear:e=>clearTimeout(e)},o=new Map,i=(e,n)=>{let u=o.get(e);u&&s.clear(u.handle),o.delete(e);let c=r.reader.collect(e,n);c&&r.save(c,e)};return{heard(e,n,u){if(!g(n)||!t(e)||!n.hasAttribute("data-act"))return;let c=n.getAttribute("data-save");if(e.type==="input"&&c==="input"){let l=o.get(n);l&&s.clear(l.handle),o.set(n,{root:u,handle:s.set(()=>i(n,u),H(n))})}else e.type==="change"&&(c==="change"||c==="input"&&o.has(n))&&i(n,u)},flush(){for(let[e,{root:n}]of[...o])i(e,n)},get waiting(){return o.size}}}var q=new Set(["text","search","email","url","tel","number"]);function C(r,t,s,o){for(let i of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=i;if(s.has(e))continue;let n=e.getAttribute("data-prefill")??"";if(n===""||e.getAttribute("name")!==n||e.localName==="input"&&!q.has(e.type))continue;if(e.value!==""){s.add(e);continue}let c=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),a=new Set(c.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),d=l&&r.contains(l)?l.getAttribute("data-record"):a.size===1?[...a][0]:void 0;if(!d)continue;let f=o({record:d,field:n,acts:c.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,s.add(e),e.value!==f){e.value="";continue}t.prefilled(e,{record:d,field:n,value:f})}}}function J(r,t,s,o){let i=k(t,o.as);if(!i)return m("undeclared",`This view may not ask for \u201C${o.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(a=>a.name===i.act);if(!e)return m("unknown-act","There is no act by that name here.");let n={};if(o.record!==void 0){let a=i.record??e.subject?.arg;if(!a)return m("unbound",`\u201C${o.as}\u201D is not done to a record.`);if(!s.has(o.record))return m("unbound","That press is bound to a record this view was not shown.");n[a]=o.record}for(let[a,d]of Object.entries(i.constants??{})){if(a in n)return m("malformed",`\u201C${a}\u201D is both the bound record and a constant.`);n[a]=d}let u=e.input?.shape??{},c=new Set(Object.keys(u)),l=new Set;for(let a of o.fields){if(!c.has(a.name)||a.name in n)continue;if(l.has(a.name))return m("malformed",`Two fields here are called \u201C${a.name}\u201D.`);l.add(a.name);let d=u[a.name];if(!a.chosen&&a.value===""&&!E(d,"")){a.typed&&a.from&&E(d,null)&&(n[a.name]=null);continue}if(a.typed&&a.chosen){let f=T(u[a.name])?.find(p=>String(p)===String(a.value));if(f!==void 0)n[a.name]=f;else if(typeof a.value=="string"&&s.has(a.value))n[a.name]=a.value;else return m("untyped",`\u201C${a.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(a.typed&&a.from&&!(o.record===a.from.record&&a.name===a.from.field&&A(r,i,a.from.record,a.from.field)))return m("untyped",`\u201C${a.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(a.typed&&a.from&&String(a.value)===a.from.value)n[a.name]=r.graph.getNode(a.from.record)?.[a.name]??a.value;else if(a.typed)n[a.name]=a.value;else if(!a.empty)if(F(r,d,a.value,o.record!==void 0&&A(r,i,o.record,a.name)?o.record:void 0,a.name))n[a.name]=a.value;else return m("untyped",`\u201C${a.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:i.act,args:n}}function E(r,t){let s=r?.safeParse;return typeof s=="function"?s.call(r,t).success:!1}function $(r){let t=r;for(let s=0;s<8&&t?._zod?.def;s+=1){let o=t._zod.def;if(o.type==="default"||o.type==="prefault"){let i=o.defaultValue;return{value:typeof i=="function"?i():i}}if(!("innerType"in o))return;t=o.innerType}}function F(r,t,s,o,i){if(!E(t,s))return!1;if(s===0||s===!1||s==="0")return!0;let e=$(t);if(e&&Object.is(e.value,s))return!0;if(o===void 0)return!1;let n=r.graph.getNode(o)?.[i];return n!=null&&String(n)===String(s)}function A(r,t,s,o){let i=r.allMutations().find(c=>c.name===t.act),e=i?.subject;if(!i||!e||(t.record??e.arg)!==e.arg||o===e.arg||Object.hasOwn(t.constants??{},o)||!Object.hasOwn(i.input.shape??{},o)||Object.keys(i.writesOther??{}).length>0)return!1;let n=r.graph.getNode(s)?.kind,u=n===void 0?void 0:r.schema.tryDefinition(n);return!u||e.kinds!=="*"&&!e.kinds.includes(n)||!Object.hasOwn(u.fields.shape??{},o)?!1:i.writes?.includes(o)??!1}function K(r,t,s,o,i){if(!o.has(i.record))return;let e=r.seenBy(t).graph.getNode(i.record);if(!e||!i.acts.some(c=>{let l=k(s,c);if(!l||!A(r,l,i.record,i.field))return!1;let a=r.allMutations().find(d=>d.name===l.act).subject;return r.permits({name:l.act,args:{[a.arg]:i.record}},t).ok}))return;let u=e[i.field];return typeof u=="string"?u:typeof u=="number"&&Number.isFinite(u)?String(u):void 0}export{D as a,V as b,z as c,I as d,H as e,B as f,C as g,J as h,E as i,A as j,K as k};
|