graview 0.1.56 → 0.1.58
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.27CW6SCT.js +3 -0
- package/dist/preview/{chunk.UQQAGT3R.js → chunk.2EDC63RI.js} +1 -1
- package/dist/preview/chunk.2VYNNWW5.js +18 -0
- package/dist/preview/chunk.32FMOHZK.js +1 -0
- package/dist/preview/{chunk.VLBY66PB.js → chunk.34TW32TB.js} +2 -2
- package/dist/preview/{chunk.AM2YRNOQ.js → chunk.3FCOFEGW.js} +1 -1
- package/dist/preview/{chunk.LKK7VQBA.js → chunk.3OYGXYQY.js} +1 -1
- package/dist/preview/{chunk.XJFAUOJS.js → chunk.3YZHZGTM.js} +1 -1
- package/dist/preview/{chunk.AIK3Z25Y.js → chunk.43OKZU73.js} +1 -1
- package/dist/preview/{chunk.QSO5BP2H.js → chunk.4444RPWW.js} +1 -1
- package/dist/preview/{chunk.4EY6WPSM.js → chunk.47JQPYXL.js} +2 -2
- package/dist/preview/{chunk.N3Q5CPVA.js → chunk.4AFFPYOK.js} +1 -1
- package/dist/preview/chunk.4GGPPCMM.js +1 -0
- package/dist/preview/{chunk.PRV3KYT6.js → chunk.4HSH2UIK.js} +2 -2
- package/dist/preview/{chunk.7Z4USR3Y.js → chunk.4KC35UNR.js} +1 -1
- package/dist/preview/{chunk.LP3SHWJG.js → chunk.4Y2JTY6Q.js} +1 -1
- package/dist/preview/{chunk.6HLKAUWF.js → chunk.5ICIMQE6.js} +1 -1
- package/dist/preview/{chunk.KY7QD22S.js → chunk.5IEFTFKQ.js} +1 -1
- package/dist/preview/{chunk.JHFHIG4P.js → chunk.64R3K2OE.js} +1 -1
- package/dist/preview/chunk.6K7EN2YI.js +1 -0
- package/dist/preview/{chunk.45VIF2SX.js → chunk.6VC6AGYV.js} +2 -2
- package/dist/preview/{chunk.PMPDLE56.js → chunk.6W7O5YLL.js} +1 -1
- package/dist/preview/chunk.7BBGRTXM.js +5 -0
- package/dist/preview/{chunk.CGM7OER2.js → chunk.7MSFDD7J.js} +1 -1
- package/dist/preview/chunk.7SQAKSJD.js +2 -0
- package/dist/preview/{chunk.VEOS25PQ.js → chunk.7V23SXGJ.js} +1 -1
- package/dist/preview/{chunk.C2VFDBSG.js → chunk.A6C4AGJJ.js} +1 -1
- package/dist/preview/chunk.ACYDJQRC.js +1 -0
- package/dist/preview/{chunk.NBLMANHT.js → chunk.ARWBIBSI.js} +1 -1
- package/dist/preview/{chunk.KBL4Y4UN.js → chunk.B2GVJD6H.js} +1 -1
- package/dist/preview/{chunk.2DETYEJM.js → chunk.B3WZHPM3.js} +1 -1
- package/dist/preview/{chunk.IT763BYH.js → chunk.BB33TI4S.js} +1 -1
- package/dist/preview/{chunk.3X3GLNWQ.js → chunk.BKVBX2YB.js} +1 -1
- package/dist/preview/{chunk.VYW7DSUW.js → chunk.BTVBZ6KE.js} +2 -2
- package/dist/preview/{chunk.JZDKHWRL.js → chunk.CCWPF5PK.js} +1 -1
- package/dist/preview/{chunk.QAIYYIZQ.js → chunk.D5KTGX7F.js} +1 -1
- package/dist/preview/{chunk.YLMOGGEP.js → chunk.DBZHRYBK.js} +1 -1
- package/dist/preview/{chunk.GUP7LC5O.js → chunk.DM767F2Q.js} +2 -2
- package/dist/preview/{chunk.65Q5MKDW.js → chunk.E34OQVSR.js} +1 -1
- package/dist/preview/{chunk.N7EEPFYV.js → chunk.E5MSFXL6.js} +1 -1
- package/dist/preview/{chunk.DTSTUC2W.js → chunk.EB4NVTJL.js} +1 -1
- package/dist/preview/{chunk.5MS2TQFX.js → chunk.ELAMMS2V.js} +1 -1
- package/dist/preview/chunk.ELERUERU.js +1 -0
- package/dist/preview/{chunk.XGCOWCA2.js → chunk.EPPXZZPK.js} +1 -1
- package/dist/preview/chunk.EQTSV7BK.js +2 -0
- package/dist/preview/{chunk.QNNRSPIJ.js → chunk.ETBFD76E.js} +1 -1
- package/dist/preview/{chunk.OBUKZQCZ.js → chunk.F7SF6EP2.js} +1 -1
- package/dist/preview/chunk.GCBZ3WE2.js +1 -0
- package/dist/preview/{chunk.ONGZ3YQF.js → chunk.GDOTG7YA.js} +1 -1
- package/dist/preview/{chunk.SVAQGVS4.js → chunk.GEB2DFBU.js} +1 -1
- package/dist/preview/chunk.GKSUTAIX.js +1 -0
- package/dist/preview/{chunk.VDD3RHLB.js → chunk.GP7F3PEF.js} +1 -1
- package/dist/preview/{chunk.AKW6NR3X.js → chunk.GQBJVCSM.js} +1 -1
- package/dist/preview/chunk.GUEHKCWN.js +1 -0
- package/dist/preview/{chunk.NQ4VGKEC.js → chunk.GZB6A6KF.js} +1 -1
- package/dist/preview/{chunk.2E6EWVWR.js → chunk.H3BFHI3G.js} +1 -1
- package/dist/preview/{chunk.7RJGEU3Y.js → chunk.HEWVPXRE.js} +1 -1
- package/dist/preview/{chunk.J3YBEZKE.js → chunk.HMFJT4KO.js} +1 -1
- package/dist/preview/{chunk.NFU4UM6F.js → chunk.HS3GHAUR.js} +1 -1
- package/dist/preview/{chunk.NPAWTPLQ.js → chunk.HT2BEOEV.js} +1 -1
- package/dist/preview/{chunk.7O6Z3BFR.js → chunk.HXRV3WVJ.js} +1 -1
- package/dist/preview/{chunk.MJMVGW6Z.js → chunk.HZB5F476.js} +1 -1
- package/dist/preview/{chunk.WPJVMVAL.js → chunk.I3WWCPQ2.js} +1 -1
- package/dist/preview/{chunk.IUQOSPQX.js → chunk.IDJPBWL2.js} +1 -1
- package/dist/preview/{chunk.4KMY24YC.js → chunk.ILRCNTGT.js} +1 -1
- package/dist/preview/{chunk.T6HG2XIP.js → chunk.INZQ6WZM.js} +1 -1
- package/dist/preview/{chunk.ILSK2E3R.js → chunk.IULQRCEE.js} +1 -1
- package/dist/preview/{chunk.IF4FCQPG.js → chunk.JB7TTJXQ.js} +1 -1
- package/dist/preview/{chunk.E4HSSGF7.js → chunk.JES77WXG.js} +1 -1
- package/dist/preview/{chunk.SRC37GNP.js → chunk.JGKA5QBX.js} +1 -1
- package/dist/preview/chunk.JOAN54PN.js +1 -0
- package/dist/preview/{chunk.2YNZVNCA.js → chunk.JUNMJYH5.js} +1 -1
- package/dist/preview/{chunk.MORMTKVR.js → chunk.KFQSYCY3.js} +1 -1
- package/dist/preview/{chunk.TXWCTHMI.js → chunk.KJ264E6K.js} +1 -1
- package/dist/preview/{chunk.NUE5VG4G.js → chunk.KJHPDL4N.js} +1 -1
- package/dist/preview/{chunk.SOTB6C5A.js → chunk.KKNDX4JT.js} +1 -1
- package/dist/preview/chunk.KNYLY7MH.js +1 -0
- package/dist/preview/{chunk.YL5ZCRHQ.js → chunk.KWJWAIQJ.js} +1 -1
- package/dist/preview/{chunk.V3NPUAPB.js → chunk.KXPRILAO.js} +1 -1
- package/dist/preview/chunk.L7V24JPO.js +1 -0
- package/dist/preview/chunk.LA4CPZ2N.js +1 -0
- package/dist/preview/{chunk.E33EJU3Q.js → chunk.LCPGZK7G.js} +1 -1
- package/dist/preview/chunk.LDAYDCUO.js +1 -0
- package/dist/preview/{chunk.64IKLRUS.js → chunk.LL2MLSPH.js} +1 -1
- package/dist/preview/{chunk.22MIRLL6.js → chunk.LMN4TSAP.js} +1 -1
- package/dist/preview/{chunk.IRMO4FUC.js → chunk.LO3U3P55.js} +1 -1
- package/dist/preview/{chunk.DH7M57SE.js → chunk.LRUNFSHP.js} +1 -1
- package/dist/preview/{chunk.MLRPCZVS.js → chunk.LY3YOWKV.js} +1 -1
- package/dist/preview/{chunk.DWMAFMYZ.js → chunk.M34CS7DI.js} +1 -1
- package/dist/preview/{chunk.I2C5LPB5.js → chunk.MQ5HBUBL.js} +1 -1
- package/dist/preview/chunk.MV3AJ7JH.js +1 -0
- package/dist/preview/chunk.MYNQWWCL.js +1 -0
- package/dist/preview/{chunk.E4EN4X5F.js → chunk.NFX24NUI.js} +1 -1
- package/dist/preview/{chunk.PJCVFYFU.js → chunk.NKC3JILT.js} +1 -1
- package/dist/preview/{chunk.MFDSWA2W.js → chunk.NOFWGDOT.js} +1 -1
- package/dist/preview/{chunk.QW3QLE53.js → chunk.O4CVKTPJ.js} +1 -1
- package/dist/preview/{chunk.TAIYNHSW.js → chunk.OASYYMG5.js} +1 -1
- package/dist/preview/{chunk.G3ORIU7C.js → chunk.OHQ3JH65.js} +1 -1
- package/dist/preview/{chunk.2OX4YI46.js → chunk.PBCNOFQH.js} +1 -1
- package/dist/preview/{chunk.V6X3U3JF.js → chunk.PHC2MI4C.js} +1 -1
- package/dist/preview/chunk.PM3SYXKB.js +1 -0
- package/dist/preview/{chunk.K2JE3PD7.js → chunk.POBMGM3X.js} +1 -1
- package/dist/preview/{chunk.LLOZKUCA.js → chunk.PZG3B7F4.js} +1 -1
- package/dist/preview/chunk.QB25SMP6.js +1 -0
- package/dist/preview/{chunk.FCUDBMGC.js → chunk.QGV7H7RQ.js} +1 -1
- package/dist/preview/chunk.QPXXY2DL.js +1133 -0
- package/dist/preview/chunk.QUJS63OJ.js +13 -0
- package/dist/preview/{chunk.Q7X2IVLH.js → chunk.R7LFO7KI.js} +1 -1
- package/dist/preview/{chunk.7NP2I2UP.js → chunk.RE7DELSR.js} +1 -1
- package/dist/preview/{chunk.XY5EVI22.js → chunk.RRKYJYZJ.js} +1 -1
- package/dist/preview/{chunk.APXYWI3L.js → chunk.S2H7B6RG.js} +1 -1
- package/dist/preview/chunk.S5MGE2U5.js +1 -0
- package/dist/preview/{chunk.D6KF72MZ.js → chunk.SDVPJYVF.js} +1 -1
- package/dist/preview/{chunk.FBR4HJ2Q.js → chunk.SPXRLO5K.js} +1 -1
- package/dist/preview/chunk.TBW7CU4G.js +1 -0
- package/dist/preview/{chunk.USB6B6L3.js → chunk.TF5I4VHX.js} +1 -1
- package/dist/preview/{chunk.4EUH6TLG.js → chunk.TJ647W6J.js} +2 -2
- package/dist/preview/{chunk.ZFXHZZHW.js → chunk.TJOXNEFU.js} +1 -1
- package/dist/preview/{chunk.WMB2NNBD.js → chunk.TUUVVO5U.js} +1 -1
- package/dist/preview/{chunk.AZUTYY2S.js → chunk.TWKXSLYY.js} +4 -4
- package/dist/preview/chunk.TXGNPW76.js +1 -0
- package/dist/preview/{chunk.VSM72NVF.js → chunk.U6O3MMQR.js} +1 -1
- package/dist/preview/{chunk.EC5IWN74.js → chunk.UAP5M3CD.js} +2 -2
- package/dist/preview/chunk.UDCDK7XJ.js +4 -0
- package/dist/preview/chunk.UKMVJV6Q.js +1 -0
- package/dist/preview/chunk.UUG3BYVN.js +1 -0
- package/dist/preview/{chunk.RDL6652E.js → chunk.VG7OWV2H.js} +1 -1
- package/dist/preview/{chunk.BNEOLRQG.js → chunk.VHSWBFXB.js} +1 -1
- package/dist/preview/{chunk.D4LN33J2.js → chunk.VUPLFUUS.js} +1 -1
- package/dist/preview/chunk.WJFQIE3Y.js +1 -0
- package/dist/preview/{chunk.AQCU6TPV.js → chunk.WNQFHMNR.js} +1 -1
- package/dist/preview/{chunk.CKV2QCH5.js → chunk.WNSC3RWD.js} +1 -1
- package/dist/preview/{chunk.CU2NQ5WF.js → chunk.WQOI6BLM.js} +1 -1
- package/dist/preview/{chunk.RXYE2DAJ.js → chunk.WXIEQZLY.js} +1 -1
- package/dist/preview/{chunk.2HZGUVB2.js → chunk.XN2RVXOI.js} +1 -1
- package/dist/preview/{chunk.USQNSNIA.js → chunk.XU34T2H4.js} +1 -1
- package/dist/preview/{chunk.HFVMGTNL.js → chunk.YD3TKV6P.js} +2 -2
- package/dist/preview/{chunk.K5YLQAFW.js → chunk.YHTE34RN.js} +1 -1
- package/dist/preview/chunk.YIA2EDVF.js +3 -0
- package/dist/preview/{chunk.JQY2UKU6.js → chunk.YP2F5UGY.js} +1 -1
- package/dist/preview/{chunk.D6BMAGPR.js → chunk.YS6GVLIP.js} +1 -1
- package/dist/preview/{chunk.O6LDZWLR.js → chunk.YZZONE4M.js} +1 -1
- package/dist/preview/{chunk.5B4HNQGR.js → chunk.ZN5HTWSI.js} +1 -1
- package/dist/preview/{chunk.AKVBU5K5.js → chunk.ZOHMWSHD.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2BLRCT3E.js +0 -1
- package/dist/preview/chunk.3V2WH6F7.js +0 -1
- package/dist/preview/chunk.4YI6656P.js +0 -1
- package/dist/preview/chunk.5MSWUTDB.js +0 -1
- package/dist/preview/chunk.6Q6BW4QT.js +0 -2
- package/dist/preview/chunk.7U2JO7ET.js +0 -3
- package/dist/preview/chunk.7Z2PRPYE.js +0 -1
- package/dist/preview/chunk.AGTFYPXY.js +0 -1
- package/dist/preview/chunk.BT7RLFPO.js +0 -1
- package/dist/preview/chunk.DPPT6WAJ.js +0 -2
- package/dist/preview/chunk.DVG47BK3.js +0 -1
- package/dist/preview/chunk.DZYLH5IM.js +0 -1
- package/dist/preview/chunk.E5XNQTEU.js +0 -1
- package/dist/preview/chunk.F5RN6YXG.js +0 -4
- package/dist/preview/chunk.FOQENWF5.js +0 -1
- package/dist/preview/chunk.GNQW4JOG.js +0 -18
- package/dist/preview/chunk.HVN2DVP3.js +0 -1
- package/dist/preview/chunk.JL4DGITZ.js +0 -1
- package/dist/preview/chunk.K4MO22RM.js +0 -1
- package/dist/preview/chunk.KMEKMCKG.js +0 -3
- package/dist/preview/chunk.LVOVPU64.js +0 -1
- package/dist/preview/chunk.MEJUAV3Y.js +0 -1
- package/dist/preview/chunk.OYGPNO7A.js +0 -1
- package/dist/preview/chunk.QYFZ7AZS.js +0 -1132
- package/dist/preview/chunk.RR2IFETZ.js +0 -1
- package/dist/preview/chunk.T2RME6XF.js +0 -1
- package/dist/preview/chunk.TAJ2R44N.js +0 -1
- package/dist/preview/chunk.TQCRFZ53.js +0 -1
- package/dist/preview/chunk.UE5YS3GN.js +0 -1
- package/dist/preview/chunk.VIQ6EF2O.js +0 -1
- package/dist/preview/chunk.XE72DFBV.js +0 -13
- package/dist/preview/chunk.YEJ4LNUP.js +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as cn,c as ln,d as oe,e as fn,f as ie,h as Ae,i as ze,n as pn,r as ae}from"./chunk.KMEKMCKG.js";import{B as ue,Ba as Ue,C as re,Db as W,Ea as We,F as Ke,Ga as Je,Gb as tn,H as Ie,Ic as sn,J as qe,Jc as xe,K as Be,Ka as we,Kb as rn,Kc as dn,La as ve,Lc as Re,Pb as on,Ra as Ye,Ua as Qe,b as $e,c as Ge,d as Me,da as ke,e as K,ea as _e,eb as Xe,g as ce,gb as en,h as F,i as Pe,j as Fe,k as le,l as Ne,lb as Oe,m as Ce,mb as nn,na as He,o as Ve,p as fe,q as he,v as Ze,x as te,xc as an,ya as be,z as pe}from"./chunk.YEJ4LNUP.js";function un(e){if(typeof e=="string")return{form:"string",light:e};if(typeof e!="object"||e===null)return;let a=e,n=w=>typeof a[w]=="string"?a[w]:void 0,t=n("light")??n("src");if(t===void 0)return;let[i,f,m]=[n("dark"),n("alt"),n("darkFallback")];return{form:n("light")!==void 0?"light":"src",light:t,...i!==void 0?{dark:i}:{},...f!==void 0?{alt:f}:{},...m!==void 0?{darkFallback:m}:{}}}function Nn(e,a){let n=e.brand??{},t=n.ground,i=n.accent?Re(n.accent,t):void 0;t&&dn(i?.ok?i.schemes:xe(t),n.accent)&&(a.push(ze("brand","brand.ground","words would not read on that page background, so the app keeps Graview's","pick a lighter ground for the light scheme, a darker one for the dark")),t=void 0,i=n.accent?Re(n.accent):void 0),i&&!i.ok&&a.push(ze("brand","brand.accent",`that accent cannot make a readable brand, so the app keeps Graview's colors: ${i.why}`,"pick a color further from orange-red, or a darker one"));let f=un(n.logo),m=n.name??e.name,w=n.typography?Object.fromEntries(Object.entries(n.typography).filter(([,E])=>typeof E=="string"&&!/url\(|@import|[;{}<>\\]/i.test(E)).map(([E,D])=>[E,sn(D)])):void 0;return{name:m,schemes:i?.ok?i.schemes:t?xe(t):an,...n.currency?{currency:n.currency}:{},...n.locale?{locale:n.locale}:{},...n.timeZone?{timeZone:n.timeZone}:{},...f?{logo:f.dark||f.darkFallback==="invert"?{light:f.light,...f.dark?{dark:f.dark}:{darkFallback:"invert"}}:f.light,logoAlt:f.alt??m}:{},...n.favicon?{favicon:n.favicon}:{},...e.description?{subtitle:e.description}:{},...n.subtitle===!1?{subtitleDrawn:!1}:{},...w?{typography:w}:{},...n.shape?{shape:n.shape}:{},...n.accents?{accents:n.accents}:{},...n.scheme?{scheme:n.scheme}:{}}}function mn(e){let{currency:a,locale:n,timeZone:t}=e.brand??{};return{...a?{currency:a}:{},...n?{locale:n}:{},...t?{timeZone:t}:{}}}var xn=Symbol.for("@graview/core:typed-field"),gn=(e,a)=>(/^(phone|place|duration)$/.test(a)&&(re(e)[xn]=a),e),yn=/^(?=(?:\D*\d){3})\+?[\d ()./-]+(?: *(?:ext\.?|x|#) *\d+)?$/i;function hn(e){let a=F().check(K(300),pe(t=>We(t,e)!==void 0,`a record of ${e.kinds.join(" or ")} in ${e.address}, as "<kind>:<id>"`)),n=e.cardinality==="one"?a:fe(a).check(K(200));return Je(e.description?n.check(ue(e.description)):n,e)}var An=new WeakMap;function kn(e,a){An.set(e,a)}var zn=[{where:"settings[]",was:"honoured",now:"honored",since:"0.1.16"},{where:"pages",was:"overview",now:"scene",since:"0.1.17"}],I=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function bn(e,a=zn){if(!I(e))return{document:e,respelled:[]};let n=[],t=e;for(let i of a)t=Se(t,i.where.split("."),i,"",n);return{document:t,respelled:n}}function Se(e,a,n,t,i){if(a.length===0){if(!I(e)||!Object.hasOwn(e,n.was))return e;i.push(`${t}${n.was}`);let{[n.was]:$,...N}=e;return Object.hasOwn(e,n.now)?N:{...N,[n.now]:$}}if(!I(e))return e;let[f,...m]=a,w=f.endsWith("[]"),E=w?f.slice(0,-2):f,D=e[E],B=D;if(!w)B=Se(D,m,n,`${t}${E}.`,i);else if(Array.isArray(D)){let $=D.map((N,J)=>Se(N,m,n,`${t}${E}.${J}.`,i));B=$.some((N,J)=>N!==D[J])?$:D}return B===D?e:{...e,[E]:B}}var wn="graview-compiled@1";function Sn(e,a){return e.find(([n,t])=>n!==q&&"ref"in t&&(t.ref==="*"||t.ref.includes(a)))?.[0]}var q="id",me=e=>typeof e=="string"&&/^\$[A-Za-z][A-Za-z0-9]*$/.test(e)?e.slice(1):void 0;function vn(e){let a=Object.entries(e.fields),n=t=>["name","title","label"].find(i=>t.some(([f])=>f===i))??t[0]?.[0];return n(a.filter(([,t])=>t.required&&(t.type==="string"||t.type==="text")))??n(a.filter(([,t])=>t.type==="string"))}function On(e,a,n){let t;switch(e.type){case"string":case"place":t=F().check(K(500));break;case"phone":t=F().check(K(40),ce(yn,"a phone number"));break;case"text":t=F().check(K(2e4)),e.format&&(re(t)[Symbol.for("@graview/core:markdown")]=1);break;case"number":case"integer":case"duration":{let f=e.min??(e.type==="duration"?0:void 0),m=[...e.type==="number"?[]:[Ne()],...f===void 0?[]:[Ge(f)],...e.max===void 0?[]:[$e(e.max)],...e.step===void 0?[]:[Me(e.step)]];t=m.length>0?le().check(...m):le();break}case"boolean":t=Ce();break;case"date":t=F().check(ce(Ie,"a date like 2026-10-02, or a month (2016-05) or a year (2006) alone"));break;case"datetime":t=F().check(pe(qe,"a date and time like 2026-10-02T14:30:00Z"));break;case"enum":t=Ze(e.options);break;case"list":t=fe(e.of==="number"?le():e.of==="date"?F().check(ce(Ke)):e.of==="image"||e.of==="video"||e.of==="file"?be(e.of):F().check(K(500))).check(K(200));break;case"image":case"video":case"file":t=be(e.type);break;case"app-link":t=Ue();break;case"url":t=Fe();break;case"email":t=Pe();break}let i=e.type==="number"||e.type==="integer";return gn(t,i&&e.format==="duration"?"duration":e.type),e.collaborative!==void 0&&(e.type==="text"||e.type==="string")&&(re(t)[Symbol.for("@graview/core:collaborative")]=e.collaborative?1:0),e.description&&(t=t.check(ue(e.description))),i&&(e.format==="money"||e.format==="percent"||!e.format&&e.unit)&&rn(t,{...n,...e.format?{format:e.format}:{},...e.unit?{unit:e.unit}:{}}),a?te(t):t}var se=e=>{throw new W(`there is no record "${e}"`,"invalid")},jn=(e,a)=>"field"in e?On(e.field,e.optional,a):"ref"in e?on(e.ref):te(Ve()),En=new WeakMap;var je=(e,a)=>I(a)&&Object.keys(e??{}).length===Object.keys(a).length&&Object.keys(e??{}).every(n=>Object.hasOwn(a,n));function ct(e,a={}){let n=I(e)?e.format:void 0;if(n!==wn)return{ok:!1,findings:[Ae("compiled-format","format",n===void 0?"this is not a compiled Graview app":`this compiled app is ${JSON.stringify(n)}, and this build reads ${wn}`,"compile the document instead")]};let t=e,i=bn(t.document).document,f=i===t.document?t:{...t,document:i},m=I(i)&&typeof i.name=="string"&&I(i.kinds)&&je(i.kinds,f.kinds)&&je(i.acts,f.acts)&&je(i.rules,f.rules)&&Array.isArray(f.edges)&&Array.isArray(f.findings),w={ok:!1,findings:[Ae("compiled-shape","","this compiled app's parts do not match its document","compile the document instead")]};if(!m)return w;try{return Dn(f,a)}catch{return w}}function Dn(e,a={}){let{document:n}=e,t=n.brand?.timeZone,i=a.today??(()=>Be(t)),f=new Map(e.edges.map(([h,o])=>[h,o])),m=new Map;for(let[h,o]of Object.entries(n.kinds)){let A=e.kinds[h]?.computed,x=ve(o.edges);m.set(h,{fields:new Set([...Object.keys(o.fields),...x.keys()]),edges:new Map(Object.entries(we(o.edges)).map(([T,G])=>[T,G.cardinality??"many"])),...A?{computed:new Map(A)}:{},...x.size>0?{linked:x}:{}})}e.facts&&m.set(ln,{computed:new Map(e.facts)});let w=mn(n),E=new Map,D=Object.entries(n.kinds).map(([h,o])=>{let A={};for(let[r,d]of Object.entries(o.fields))A[r]=On(d,!d.required,w),d.repeats&&(A[Ye(r)]=te(Qe()));for(let[r,d]of ve(o.edges))A[r]=te(hn(d));let{label:x,describe:T,durations:G}=e.kinds[h]??{},M=Object.entries(o.computed??{}).map(([r,d])=>[r,typeof d=="string"?{expr:d}:d]),Y=Object.hasOwn(o.fields,"label")&&!o.fields.label.label&&!/\{\s*label\b/.test(o.label??`{${vn(o)??""}}`),_=Object.fromEntries([...Y?[["label","Label"]]:[],...Object.entries(o.fields).filter(([,r])=>r.label).map(([r,d])=>[r,d.label]),...M.filter(([,r])=>r.label).map(([r,d])=>[r,d.label])]),z=Object.keys(_).length>0,g=Object.entries(o.fields).filter(([,r])=>r.type==="enum"&&r.optionLabels&&Object.keys(r.optionLabels).length>0),L=Object.fromEntries(g.map(([r,d])=>[r,R=>typeof R=="string"&&Object.hasOwn(d.optionLabels,R)?d.optionLabels[R]:ke(String(R))])),C=g.length>0,P=Object.fromEntries(Object.entries(o.fields).filter(([,r])=>r.default!==void 0).map(([r,d])=>[r,d.default]));E.set(h,P);let H=Object.fromEntries(Object.entries(we(o.edges)).map(([r,{renamedFrom:d,...R}])=>[r,R])),V=Object.entries(o.fields).flatMap(([r,d])=>d.aliases?[[r,d.aliases]]:[]),S=r=>o[r]?{[r]:o[r]}:{};return _e(h,{fields:he(A),edges:H,...S("plural"),...S("noun"),...S("aliases"),...V.length>0?{fieldAliases:Object.fromEntries(V)}:{},...S("description"),...x?{label:r=>ae(x,{node:r,kinds:m,today:i(),money:w})||r.id}:{},...T?{describe:r=>ae(T,{node:r,kinds:m,today:i(),money:w})}:{},...S("lifecycle"),...S("figure"),...S("fieldRoles"),...S("people"),archives:o.archives,...o.tidying?{tidying:o.tidying}:{},...M.length>0?{computed:Object.fromEntries(M.map(([r,d])=>[r,G?.includes(r)?{...d,as:"duration"}:o.computed[r]]))}:{},...z||C||o.glance||o.page?{display:{...z?{labels:_}:{},...C?{format:L}:{},...o.glance?{glance:[...o.glance]}:{},...o.page?{page:o.page}:{}}}:{},...Object.keys(P).length>0?{defaults:P}:{}})}),B=Xe(D,n.computed);function $(h){return B.tryDefinition(h.kind)?.label?.(h)??h.id}let N=h=>({id:"",kind:h,...E.get(h)}),J=[];for(let[h,o]of Object.entries(n.acts??{})){let A=e.acts[h],{title:x,effects:T,guard:G,refusal:M,destructive:Y,idempotent:_,creates:z,connects:g,severs:L,writes:C,writesOther:P,sets:H}=A,V=new Map(A.args),S={};for(let[c,v]of V)S[c]=jn(v,w);let r=[o.on??[]].flat(),d=new Map(A.exprs),R=T.find(c=>"create"in c),Q=(c,v,p,b=null)=>{if(I(c)&&"expr"in c)return ie(d.get(c.expr),{graph:p,subject:b,kinds:m,bindings:v,today:i()});let k=me(c);return k===void 0?typeof c=="string"&&c.startsWith("$$")?c.slice(1):c:k==="now"?new Date().toISOString():k==="today"?i():v[k]},Te=(c,v)=>{if(!R)return"";let p=n.kinds[R.create].fields,b=N(R.create),k=[];for(let[O,ne]of Object.entries(R.set??{})){try{b[O]=Q(ne,c,v)??b[O]}catch{}let X=me(ne);X&&c[X]!==void 0&&k.push(O)}let Z=$(b).trim(),U=k.filter(O=>b[O]!==!1&&p[O].type!=="text"&&!(/[^]{41}/.test(b[O])||/ .*[.!?]$/.test(b[O])&&!/[ .][A-Z]\w{0,3}\.$/.test(b[O]))&&$({...b,[O]:void 0}).trim()===Z).map(O=>b[O]===!0?p[O].label??ke(O):pn(b[O],p[O].format,i(),[],w));return Z&&U.length>0?`${Z} (${U.join(", ")})`:Z};J.push(tn(h,{input:he(S),title:x,...o.description?{description:o.description}:{},...o.fromTheOtherEnd?{fromTheOtherEnd:o.fromTheOtherEnd}:{},...V.has(q)?{subject:{kinds:r.length>0?r:"*",arg:q}}:{},...Y?{destructive:!0}:{},..._?{idempotent:!0}:{},...z.length>0?{creates:z}:{},...g.length>0?{connects:g}:{},...L.length>0?{severs:L}:{},writes:C,...Object.keys(P).length>0?{writesOther:P}:{},...Object.keys(H).length>0?{sets:H}:{},describe:(c,v)=>{let p=typeof c[q]=="string"?v.getNode(c[q]):void 0,b=p?$(p):Te(c,v);return b?`${x}: ${b}`:x},apply(c,v){let p=c.graph,b=typeof v[q]=="string"?v[q]:void 0,k=b?p.getNode(b):void 0;if(b&&!k&&se(b),k&&r.length>0&&!r.includes(k.kind))throw new W(`"${x}" acts on ${r.join(" or ")}, not on ${He(k.kind)}`,"invalid");let Z={};for(let[s,l]of Object.entries(v))l!==void 0&&(Z[s]=l);if(G&&k){let s;try{s=ie(G,{graph:p,subject:k,kinds:m,bindings:Z,today:i()})}catch(l){throw l instanceof oe?new W(`"${x}" could not be judged: ${l.sentence}`):l}if(s!==!0)throw new W(M?ae(M,{node:k,kinds:m,graph:p,bindings:Z,today:i(),money:w}):`"${x}" is not allowed for ${$(k)} right now`)}let U=new Map,O=s=>p.has(s)||[...U.values()].includes(s),ne=new Set,X=s=>{let l=en(s);ne.has(l)||(ne.add(l),c.removeEdge(s))},ee=(s,l)=>{let u=me(s);if(u==="subject")return b;if(u==="me"){let y=c.me;if(y&&n.kinds[p.getNode(y)?.kind]?.people)return y;throw new W(`"${x}" is done as you, and you have no record here`)}if(U.has(u))return U.get(u);try{return Q(s,Z,p,l??k??null)}catch(y){throw y instanceof oe?new W(`"${x}" could not work out a value: ${y.sentence}`):y}};for(let s of T)if("create"in s){let l=n.kinds[s.create],u=N(s.create);for(let[ye,de]of Object.entries(s.set??{})){let Le=ee(de,void 0);Le!==void 0&&(u[ye]=Le)}let y=vn(l),j=c.freshId(String((y&&u[y])??s.create),s.create);c.addNode({...u,id:j}),s.as&&U.set(s.as,j)}else if("connect"in s||"sever"in s){let l="connect"in s?s.connect:s.sever,u=String(ee(s.from,void 0)??""),y=String(ee(s.to,void 0)??"");if(O(u)||se(u),O(y)||se(y),"connect"in s){if(f.get(l)?.cardinality==="one")for(let j of p.out(u,l))j.id!==y&&X({kind:l,from:u,to:j.id});p.out(u,l).some(j=>j.id===y)||c.addEdge({kind:l,from:u,to:y})}else X({kind:l,from:u,to:y})}else if("set"in s){let l=String(ee(s.target??"$subject",void 0)??""),u=p.getNode(l);!u&&!O(l)&&se(l);let y={};for(let[j,ye]of Object.entries(s.set)){let de=ee(ye,u);de!==void 0&&(y[j]=de)}Object.keys(y).length>0&&c.patchNode(l,y)}else if("remove"in s){let l=String(ee(s.remove,void 0)??"");p.has(l)||se(l),c.removeNode(l)}else if("replace"in s&&k){let l=v.to;for(let u of s.replace){let y=f.get(u)?.from.includes(k.kind)??!0;for(let j of y?p.out(k.id,u):p.in(k.id,u))u===s.keep&&j.id===l||X(y?{kind:u,from:k.id,to:j.id}:{kind:u,from:j.id,to:k.id})}}}}))}let Ee=[];for(let[h,o]of Object.entries(n.rules??{})){let{title:A,require:x,when:T,says:G}=e.rules[h],M=o.repairs??[],Y=(z,g,L=i(),C)=>{let P=[],H={graph:z,subject:g,kinds:m,today:L,...C?{linked:C}:{},onUnread:r=>P.push(r)},V;try{if(T&&ie(T,H)!==!0)return[];if(V=ie(x,H)===!0,!V&&P.length>0)throw new oe(`it reads ${cn(P[0])}`,0)}catch(r){throw r instanceof fn?new nn(r.sentence):r instanceof oe?new Error(r.sentence):r}if(V)return[];let S=M.flatMap(r=>{let d=n.acts?.[r.act],R={},Q=g&&d?.on&&d.fromTheOtherEnd&&![d.on].flat().includes(g.kind)?Sn(e.acts[r.act].args,g.kind):void 0;Q?R[Q]=g.id:g&&(d?.on||/^(edit|remove|archive|unarchive|merge|skip|detach|split)-/.test(r.act))&&(R[q]=g.id);for(let[v,p]of Object.entries(r.args??{}))R[v]=me(p)==="subject"?g?.id:p;let c=(d?e.acts[r.act].args:[]).filter(([v,p])=>p.required&&R[v]===void 0).map(([v])=>v);return[{mutation:r.act,label:r.label??(Q?d.fromTheOtherEnd:d?.title)??r.act.replace(/-/g," "),args:R,...c.length>0?{missing:c}:{}}]});return[{invariant:h,...g?{subjectId:g.id}:{},label:A,message:G?ae(G,{node:g,kinds:m,graph:z,today:L,money:w}):g?`${$(g)}: ${A}`:A,nodeIds:g?[g.id]:[],repairs:S}]},_={label:A,shape:{over:o.over,require:x,when:T,says:G,declared:n.kinds,money:w,kinds:m,today:i},judgment:{require:o.require,...o.when?{when:o.when}:{},...o.says?{says:o.says}:{}},...o.description?{description:o.description}:{},...M.length>0?{repairs:M.map(z=>z.act)}:{}};Ee.push(o.over==="graph"?Oe(h,{scope:"graph",..._,evaluate:({graph:z,today:g,context:L})=>Y(z,null,g,L?.linked)}):Oe(h,{scope:{kind:o.over},..._,evaluate:({graph:z,subject:g,today:L,context:C})=>Y(z,g,L,C?.linked)}))}let De=n.policy&&{...n.policy,...n.roles?{roles:n.roles}:{}},ge={name:n.name,schema:B,mutations:J,invariants:Ee,...De?{policy:De}:{},...e.brand?{brand:e.brand}:{},...n.modules?{modules:n.modules}:{},...n.lenses?{lenses:n.lenses}:{},...n.pages?{pages:n.pages}:{},...n.settings?{settings:n.settings}:{},...n.connections?{connections:n.connections}:{},...n.forms?{forms:n.forms}:{},...n.publishing?{publishing:n.publishing}:{},...n.purpose?{purpose:n.purpose}:{},...e.viewSpecs?{viewSpecs:e.viewSpecs}:{},...e.home?{home:e.home}:{},version:n.version??1};return kn(ge,n),En.set(ge,e),{ok:!0,app:ge,document:n,findings:e.findings,sights:n.policy?.sees,kinds:m}}export{bn as a,Nn as b,wn as c,q as d,me as e,vn as f,ct as g,Dn as h};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{F as C,Fa as X,H as J,I as B,K as F,Mb as I,Na as v,Q as O,T as j,Tb as tn,U as Q,V as U,W as K,Ya as nn,aa as P,ab as en,ca as Z,na as z}from"./chunk.YEJ4LNUP.js";var fn=1e4,g=class{constructor(a){this.nodes=a}},on=Symbol.for("@graview/core:far-record"),cn=e=>typeof e=="object"&&e!==null&&e[on]===!0;function pn(e){let a={...e.fields,id:`@${e.address}/${e.kind}:${e.id}`,kind:`@${e.address}/${e.kind}`,label:e.label};return Object.defineProperty(a,on,{value:!0}),a}function Rn(e){let a=`the linked record in ${e.ref.address}`;return e.reason==="denied"?`${a} is not one this viewer may open`:`${a} has not been read`}var gn="",c=class extends Error{constructor(u,f){super(u);this.sentence=u;this.at=f}},W=class extends c{},V=e=>e!==null&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof g)&&typeof e.id=="string",rn=e=>{let a=new Set;return new g(e.filter(u=>!a.has(u.id)&&a.add(u.id)))},w=e=>e===null?"nothing":e instanceof g?"a set of records":Array.isArray(e)?"a list":V(e)?"a record":typeof e=="string"?"a word":typeof e;function an(e,a){let u=a.budget??fn,f=(n,s)=>{if(u-=n,u<0)throw new W("this rule looks at too much of the graph to judge in one go",s)},d=a.today??F(),A=a.now??new Date().toISOString(),k=new Map,N=new Set,b=a.bindings,H=(n,s,t,o)=>{let l=`${n?.id}\0${s}`;if(k.has(l))return k.get(l);if(N.has(l))throw new c(`"${s}"${n?` of ${z(n.kind)}`:""} depends on itself`,o);N.add(l);let r=b;b=void 0;try{let i=$(t,n);return k.set(l,i),i}finally{b=r,N.delete(l)}},E=(n,s,t)=>{f(1,t);let o=a.kinds.get(n.kind),l=o?.computed?.get(s);if(l)return H(n,s,l,t);let r=o?.linked?.get(s);if(r){let y=X(Object.hasOwn(n,s)?n[s]:void 0,r);f(y.length,t);let m=a.linked??v(a.graph),h=y.flatMap(S=>{let _=m?m(S):{unread:!0};return"record"in _?[pn(_.record)]:(a.onUnread?.({relation:s,ref:S,reason:"denied"in _?"denied":"unread"}),[])});return r.cardinality==="one"?h[0]??null:new g(h)}let i=Object.hasOwn(n,s);if(o?.fields.has(s)||i){let y=i?nn(n,s,d):void 0;return y===void 0?null:y}let p=o?.edges.get(s);if(p){let y=a.graph.out(n.id,s);return f(y.length,t),p==="one"?y[0]??null:new g(y)}if(s==="id")return n.id;if(cn(n))return null;throw new c(`${z(n.kind)} has no field or relation called "${s}"`,t)},x=(n,s,t)=>{if(n instanceof g)return n;if(n===null)return new g([]);if(V(n))return new g([n]);throw new c(`${t}(\u2026) needs a set of records, and was given ${w(n)}`,s)},G=(n,s,t)=>{if(n===null)return null;if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);throw new c(`${t}(\u2026) needs a word, and was given ${w(n)}`,s)},D=(n,s,t)=>{let o=G(n,s,t);if(o===null)return null;let l=Date.parse(o.length===10?`${o}T00:00:00Z`:o);if(Number.isNaN(l))throw new c(`${t}(\u2026) needs a date, and "${o}" is not one`,s);return l},M=(n,s)=>V(n)&&V(s)?n.id===s.id:V(n)&&typeof s=="string"?n.id===s:typeof n=="string"&&V(s)?n===s.id:Array.isArray(n)&&Array.isArray(s)?n.length===s.length&&n.every((t,o)=>M(t,s[o])):n===s,R=(n,s,t)=>{if(n===null)return!1;if(typeof n=="boolean")return n;throw new c(`${t} must be true or false, and was ${w(n)}`,s)},T=(n,s)=>$(s,n);function $(n,s){switch(f(1,n.at),n.t){case"lit":return n.value;case"list":return n.items.map(t=>$(t,s));case"ident":{let t=b&&Object.hasOwn(b,n.name)?b[n.name]:void 0;if(t!==void 0)return t;if(s)return E(s,n.name,n.at);throw new c(`"${n.name}" means nothing in a rule over the whole graph`,n.at)}case"member":{let t=$(n.object,s);if(t===null)return null;if(V(t))return E(t,n.name,n.at);throw new c(`".${n.name}" needs a record before it, and was given ${w(t)}`,n.at)}case"unary":{let t=$(n.operand,s);if(n.op==="!")return!R(t,n.at,"what follows not");if(t===null)return null;if(typeof t!="number")throw new c(`"-" needs a number, and was given ${w(t)}`,n.at);return-t}case"where":{let t=x($(n.set,s),n.at,"where");return f(t.nodes.length,n.at),new g(t.nodes.filter(o=>R(T(o,n.filter),n.at,"a where condition")))}case"binary":return ln(n,s);case"call":return un(n,s)}}function ln(n,s){if(n.op==="&&")return R($(n.left,s),n.at,"each side of and")&&R($(n.right,s),n.at,"each side of and");if(n.op==="||")return R($(n.left,s),n.at,"each side of or")||R($(n.right,s),n.at,"each side of or");let t=$(n.left,s),o=$(n.right,s);if(n.op==="&"||n.op==="|"||n.op==="-"&&(t instanceof g||o instanceof g)){let l=x(t,n.at,n.op).nodes,r=x(o,n.at,n.op).nodes;f(l.length+r.length,n.at);let i=new Set(r.map(p=>p.id));return rn(n.op==="|"?[...l,...r]:l.filter(p=>i.has(p.id)===(n.op==="&")))}switch(n.op){case"==":return M(t,o);case"!=":return!M(t,o);case"in":{if(o===null)return!1;if(o instanceof g)return o.nodes.some(l=>M(t,l));if(Array.isArray(o))return o.some(l=>M(t,l));if(typeof o=="string"&&typeof t=="string")return o.includes(t);throw new c(`"in" needs a list or a set on its right, and was given ${w(o)}`,n.at)}case"<":case"<=":case">":case">=":{if(t===null||o===null)return!1;if(!(typeof t=="number"&&typeof o=="number"||typeof t=="string"&&typeof o=="string"))throw new c(`cannot compare ${w(t)} with ${w(o)}`,n.at);return n.op==="<"?t<o:n.op==="<="?t<=o:n.op===">"?t>o:t>=o}default:{if(t===null||o===null)return null;if(n.op==="+"&&(typeof t=="string"||typeof o=="string")){let l=`${G(t,n.at,"+")}${G(o,n.at,"+")}`;if(l.length>1e4)throw new c("that makes a word too long",n.at);return l}if(typeof t!="number"||typeof o!="number")throw new c(`"${n.op}" needs numbers, and was given ${w(t)} and ${w(o)}`,n.at);return(n.op==="/"||n.op==="%")&&o===0?null:n.op==="+"?t+o:n.op==="-"?t-o:n.op==="*"?t*o:n.op==="/"?t/o:t%o}}}function un(n,s){let t=(r,i=r)=>{if(n.args.length<r||n.args.length>i)throw new c(`${n.fn}(\u2026) takes ${r===i?r:`${r} to ${i}`} argument${i===1?"":"s"}`,n.at)},o=r=>$(n.args[r],s),l=r=>{let i=o(r);if(typeof i!="string")throw new c(`${n.fn}(\u2026) needs a quoted name, like ${n.fn}('name')`,n.at);return i};switch(n.fn){case"out":case"in":{t(1,2);let r=(y,m)=>n.fn==="out"?a.graph.out(y,m):a.graph.in(y,m);if(n.args.length===2){let y=x(o(0),n.at,n.fn).nodes,m=l(1);return rn(y.flatMap(h=>{let S=r(h.id,m);return f(S.length+1,n.at),S}))}let i=l(0);if(!s)throw new c(`${n.fn}('${i}') needs a record to start from`,n.at);let p=r(s.id,i);return f(p.length,n.at),new g(p)}case"all":{t(1,2);let r=a.graph.nodesOfKind(l(0),{archived:n.args.length===2?o(1):!1});return f(r.length,n.at),new g(r)}case"archived":return t(0,1),en(n.args.length===1?o(0):s);case"count":return t(1),x(o(0),n.at,"count").nodes.length;case"exists":return t(1),x(o(0),n.at,"exists").nodes.length>0;case"every":case"some":{t(2);let r=x(o(0),n.at,n.fn);f(r.nodes.length,n.at);let i=p=>R(T(p,n.args[1]),n.at,`the condition in ${n.fn}(\u2026)`);return n.fn==="every"?r.nodes.every(i):r.nodes.some(i)}case"sum":case"min":case"max":{t(2);let r=x(o(0),n.at,n.fn);f(r.nodes.length,n.at);let i=n.args[1],p=i.t==="lit"&&typeof i.value=="string"?i.value:void 0,y=i.t==="ident"?`'${i.name}'`:p!==void 0?`'${p}'`:"\u2026",m=r.nodes.map(h=>i.t==="ident"?E(h,i.name,n.at):p!==void 0?E(h,p,n.at):T(h,i)).filter(h=>{if(h===null)return!1;if(typeof h!="number")throw new c(`${n.fn}(\u2026, ${y}) needs a number for each member, and found ${w(h)}`,n.at);return!0});return n.fn==="sum"?m.reduce((h,S)=>h+S,0):m.length===0?null:n.fn==="min"?Math.min(...m):Math.max(...m)}case"fact":{t(1);let r=l(0),i=a.kinds.get(gn)?.computed?.get(r);if(!i)throw new c(`no fact is called "${r}"`,n.at);return H(null,r,i,n.at)}case"first":return t(1),x(o(0),n.at,"first").nodes[0]??null;case"sort":{t(2,3);let r=x(o(0),n.at,"sort"),i=n.args.length===3?o(2):"asc";if(i!=="asc"&&i!=="desc")throw new c("sort(\u2026) goes 'asc' or 'desc'",n.at);let p=r.nodes.length;f(p+p*Math.ceil(Math.log2(p+1)),n.at);let y=r.nodes.map((h,S)=>({node:h,i:S,key:T(h,n.args[1])})),m=i==="desc"?-1:1;return y.sort((h,S)=>Y(h.key,S.key,m,n.at)||h.i-S.i),new g(y.map(h=>h.node))}case"either":{if(n.args.length<1)throw new c("either(\u2026) takes at least one argument",n.at);for(let r=0;r<n.args.length;r++){let i=o(r);if(i!==null&&!(i instanceof g&&i.nodes.length===0))return i}return null}case"present":{t(1);let r=o(0);return r===null||r===""?!1:Array.isArray(r)?r.length>0:r instanceof g?r.nodes.length>0:!0}case"len":{t(1);let r=o(0);if(r===null)return 0;if(typeof r=="string"||Array.isArray(r))return r.length;if(r instanceof g)return r.nodes.length;throw new c(`len(\u2026) needs a word or a list, and was given ${w(r)}`,n.at)}case"contains":case"startsWith":{t(2);let r=o(0),i=o(1);if(r===null||i===null)return!1;if(n.fn==="contains"&&Array.isArray(r))return r.some(m=>M(m,i));let p=G(r,n.at,n.fn),y=G(i,n.at,n.fn);return n.fn==="contains"?p.toLowerCase().includes(y.toLowerCase()):p.startsWith(y)}case"lower":{t(1);let r=G(o(0),n.at,"lower");return r===null?null:r.toLowerCase()}case"today":return t(0),d;case"now":return t(0),A;case"date":{t(1);let r=D(o(0),n.at,"date");return r===null?null:new Date(r).toISOString().slice(0,10)}case"days":case"hours":{t(2);let r=D(o(0),n.at,n.fn),i=D(o(1),n.at,n.fn);if(r===null||i===null)return null;let p=(i-r)/(n.fn==="days"?864e5:36e5);return n.fn==="days"?Math.round(p):p}case"if":return t(3),R(o(0),n.at,"the condition in if(\u2026)")?o(1):o(2);default:throw new c(`"${n.fn}" is not a function the rule language knows`,n.at)}}function Y(n,s,t,o){if(n===null||s===null)return n===s?0:n===null?1:-1;if(Array.isArray(n)&&Array.isArray(s)){for(let r=0;r<Math.max(n.length,s.length);r++){let i=Y(n[r]??null,s[r]??null,t,o);if(i!==0)return i}return 0}let l=r=>typeof r=="number"||typeof r=="string"||typeof r=="boolean"?typeof r:w(r);if(l(n)!==l(s)||typeof n=="object"||typeof s=="object")throw new c(`sort(\u2026) cannot put ${w(n)} and ${w(s)} in order`,o);return typeof n=="string"?t*(n<s?-1:n>s?1:0):t*(Number(n)-Number(s))}return $(e,a.subject)}var Vn=["out","in","all","count","exists","every","some","sum","min","max","present","len","contains","startsWith","lower","today","now","date","days","hours","if","first","sort","either","fact","archived"];var Mn=(e,a,u,f)=>({severity:"error",code:e,path:a,message:u,...f?{fix:f}:{}}),On=(e,a,u,f,d)=>({severity:"warning",code:e,path:a,message:u,...f?{fix:f}:{},...d&&d.length>0?{edits:d}:{}}),En=e=>e.some(a=>a.severity==="error");function Tn(e){return e.map(a=>`${a.severity==="error"?"\u2717":a.severity==="warning"?"!":"\xB7"} ${a.path||"(document)"}: ${a.message}${a.fix?` \u2014 ${a.fix}`:""}${(a.edits??[]).map(u=>`
|
|
2
|
-
edit: ${JSON.stringify(u)}`).join("")}`).join(`
|
|
3
|
-
`)}var Un=["money","percent","date","time","datetime","relative","upper","lower","count","words","and","plural","excerpt"],yn={getNode:()=>{},allNodes:()=>[],allEdges:()=>[],nodesOfKind:()=>[],edgesOfKind:()=>[],out:()=>[],in:()=>[],neighbors:()=>[],has:()=>!1};function Kn(e,a,u,f=[],d,A=L){return q(e,a,u,f,d,A)}var hn=(e,a)=>e.capital?P(a):a,mn=new Set(["words","plural","relative"]);function Pn(e,a){let u=e[0];return!u||u.text!==void 0||!u.format||!mn.has(u.format)?a:/^[a-z][a-z'’-]*(?=\s|$|[,.;:!?])/.test(a)?P(a):a}function wn(e){return e?a=>{let u=e.tryDefinition(a.kind)?.label;return u?u(a):L(a)}:L}var sn=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"],dn=["","","twenty","thirty","forty","fifty","sixty","seventy","eighty","ninety"];function $n(e,a){return!Number.isInteger(e)||e<0||e>99?K(e,a):e<20?sn[e]:e%10===0?dn[e/10]:`${dn[Math.floor(e/10)]}-${sn[e%10]}`}function An(e){return/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/i.test(e)?`${e}es`:`${e}s`}var L=e=>String(e.name??e.title??e.label??e.id);function q(e,a,u,f=[],d,A=L){if(a==="plural"){let k=e instanceof g?e.nodes.length:Array.isArray(e)?e.length:typeof e=="number"?e:null;return k===null||f[0]===void 0?"\u2014":k===1?f[0]:f[1]??An(f[0])}if(e===null)return"\u2014";if(e instanceof g)return a==="count"?String(e.nodes.length):a==="and"?Z(e.nodes.map(A)):e.nodes.map(A).join(", ");if(Array.isArray(e)){if(a==="count")return String(e.length);let k=e.map(N=>q(N,void 0,u,[],d,A));return a==="and"?Z(k):k.join(", ")}if(typeof e=="object")return A(e);switch(a){case"words":return typeof e=="number"?$n(e,d?.locale):String(e);case"money":return typeof e=="number"?I(e,d):String(e);case"percent":return typeof e=="number"?K(e,d?.locale,{style:"percent",maximumFractionDigits:0}):String(e);case"upper":return String(e).toUpperCase();case"lower":return String(e).toLowerCase();case"excerpt":return tn(String(e),Number(f[0])||void 0);case"date":return O(U(String(e),d?.timeZone)??String(e).slice(0,10),d?.locale);case"time":return typeof e=="string"&&C.test(e)?O(e,d?.locale):Q(String(e),d?.locale,d?.timeZone);case"datetime":return typeof e=="string"&&C.test(e)?O(e,d?.locale):j(String(e),d?.locale,d?.timeZone);case"relative":{let k=U(String(e),d?.timeZone),N=k===void 0?Date.parse(String(e)):Date.parse(`${k}T00:00:00Z`);if(Number.isNaN(N))return String(e);let b=Math.round((N-Date.parse(`${u}T00:00:00Z`))/864e5);return b===0?"today":b===1?"tomorrow":b===-1?"yesterday":b>0?`in ${b} days`:`${-b} days ago`}default:return typeof e=="string"&&J.test(e)?O(e,d?.locale):typeof e=="string"&&B.test(e)?j(e,d?.locale,d?.timeZone):String(e)}}function Zn(e,a){let u=a.today??F(),f=a.name??wn(a.graph?.schema);return e.map(d=>{if(d.text!==void 0)return d.text;try{let A=an(d.expr,{graph:a.graph??yn,subject:a.node,kinds:a.kinds,today:u,budget:a.budget??500,...a.bindings?{bindings:a.bindings}:{}});return hn(d,q(A,d.format,u,d.formatArgs,a.money,f))}catch(A){if(A instanceof c)return"\u2014";throw A}}).join("")}export{g as a,Rn as b,gn as c,c as d,W as e,an as f,Vn as g,Mn as h,On as i,En as j,Tn as k,Un as l,yn as m,Kn as n,hn as o,Pn as p,wn as q,Zn as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk.Q7X2IVLH.js";import"./chunk.NFU4UM6F.js";import"./chunk.AKVBU5K5.js";import"./chunk.LLOZKUCA.js";import"./chunk.DH7M57SE.js";import"./chunk.CKV2QCH5.js";import"./chunk.TAJ2R44N.js";import"./chunk.V3NPUAPB.js";import{b as n}from"./chunk.65Q5MKDW.js";import"./chunk.JZDKHWRL.js";import"./chunk.GZHZLJBF.js";import"./chunk.E5XNQTEU.js";import"./chunk.OJGHDWI6.js";import"./chunk.K5YLQAFW.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{T as i}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import{b as o}from"./chunk.AJZBJBMO.js";var e=o(i(),1);function m({entries:d,style:l,headingStyle:p,className:r}){return(0,e.jsxs)("section",{...r?{className:r}:{},"data-testid":"record-ai","aria-label":"What AI did here",style:{display:"grid",gap:10,...l},children:[(0,e.jsx)("h2",{style:p??{margin:0,fontSize:"1rem"},children:"What AI did here"}),(0,e.jsx)("ol",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8,fontSize:"0.875rem"},children:d.slice(0,8).map(t=>(0,e.jsx)(n,{entry:t,undo:s=>(0,e.jsx)(a,{batch:s})},t.id))})]})}export{m as RecordInteractions};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{G as l,N as p,U as k,W as y,c}from"./chunk.AZUTYY2S.js";import"./chunk.45VIF2SX.js";import{b as m}from"./chunk.IUQOSPQX.js";import"./chunk.UGFDSE37.js";import"./chunk.VYW7DSUW.js";import"./chunk.LKK7VQBA.js";import"./chunk.RR2IFETZ.js";import"./chunk.ONGZ3YQF.js";import"./chunk.XGCOWCA2.js";import"./chunk.MORMTKVR.js";import"./chunk.CU2NQ5WF.js";import"./chunk.E33EJU3Q.js";import"./chunk.PJCVFYFU.js";import"./chunk.7RJGEU3Y.js";import"./chunk.22MIRLL6.js";import"./chunk.NFU4UM6F.js";import"./chunk.DH7M57SE.js";import"./chunk.AIK3Z25Y.js";import"./chunk.CKV2QCH5.js";import"./chunk.BT7RLFPO.js";import"./chunk.TAJ2R44N.js";import"./chunk.VLBY66PB.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.T2RME6XF.js";import"./chunk.SOTB6C5A.js";import"./chunk.TQCRFZ53.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.GZHZLJBF.js";import"./chunk.E5XNQTEU.js";import"./chunk.OJGHDWI6.js";import"./chunk.K5YLQAFW.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.HFVMGTNL.js";import"./chunk.7Z4USR3Y.js";import{G as S,H as s,I as d,T as f,ca as g}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.AQCU6TPV.js";import"./chunk.6Q6BW4QT.js";import"./chunk.DTSTUC2W.js";import"./chunk.RDL6652E.js";import"./chunk.V3NPUAPB.js";import"./chunk.IT763BYH.js";import"./chunk.T2RME6XF.js";import"./chunk.SOTB6C5A.js";import"./chunk.TQCRFZ53.js";import"./chunk.6HLKAUWF.js";import"./chunk.FCUDBMGC.js";import"./chunk.KMEKMCKG.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|