graview 0.1.60 → 0.1.62
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/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/preview/{chunk.QDSEVPF3.js → chunk.22BZU7ME.js} +1 -1
- package/dist/preview/chunk.2AT3GRXM.js +1 -0
- package/dist/preview/chunk.2B6P4GPS.js +1 -0
- package/dist/preview/chunk.2GEJNG2U.js +1 -0
- package/dist/preview/{chunk.7N32AVIJ.js → chunk.2N4Z5K5S.js} +1 -1
- package/dist/preview/{chunk.NHUQ2N6J.js → chunk.3FON2Y72.js} +1 -1
- package/dist/preview/chunk.3L37FY3G.js +4 -0
- package/dist/preview/{chunk.ZYM2SSGW.js → chunk.4HEFUOLV.js} +1 -1
- package/dist/preview/chunk.4HRYB7HF.js +1 -0
- package/dist/preview/{chunk.YZ7FUKAL.js → chunk.4TX6VCBT.js} +1 -1
- package/dist/preview/{chunk.IGJZ4UH3.js → chunk.5HGD6OWL.js} +2 -2
- package/dist/preview/{chunk.2USDHXB4.js → chunk.5J3O2FVG.js} +1 -1
- package/dist/preview/{chunk.H45Q3O4F.js → chunk.5MZYCELA.js} +1 -1
- package/dist/preview/{chunk.SRVQJZRT.js → chunk.5ODHHH35.js} +1 -1
- package/dist/preview/{chunk.HDUO2USQ.js → chunk.5STU3KYG.js} +1 -1
- package/dist/preview/{chunk.TFWIG6LL.js → chunk.5YAOKOGV.js} +1 -1
- package/dist/preview/{chunk.BQIHNT7C.js → chunk.66P5IDTH.js} +1 -1
- package/dist/preview/{chunk.M4UD4ARP.js → chunk.6AKW7TXM.js} +1 -1
- package/dist/preview/{chunk.URWAFZHF.js → chunk.6JO5HQDR.js} +1 -1
- package/dist/preview/{chunk.HUJ6YTWE.js → chunk.75GVFX7L.js} +1 -1
- package/dist/preview/{chunk.A3ZXDG6V.js → chunk.7KVUUEZA.js} +1 -1
- package/dist/preview/{chunk.FFTYMBBT.js → chunk.7M4HNKDR.js} +1 -1
- package/dist/preview/chunk.7OBIBPYH.js +1 -0
- package/dist/preview/chunk.7V56P2A7.js +1 -0
- package/dist/preview/chunk.7XLS6XTY.js +1 -0
- package/dist/preview/chunk.7YOAW7ED.js +1 -0
- package/dist/preview/{chunk.FBJARKDT.js → chunk.A3OL2BI2.js} +1 -1
- package/dist/preview/{chunk.NGTRL5U4.js → chunk.A3ZC2JBO.js} +1 -1
- package/dist/preview/{chunk.A5PDXNY6.js → chunk.ACTXR2MI.js} +1 -1
- package/dist/preview/chunk.AFNSAQEQ.js +1 -0
- package/dist/preview/chunk.AI34V6WV.js +74 -0
- package/dist/preview/{chunk.3XGA65Y3.js → chunk.AJSUHPBE.js} +1 -1
- package/dist/preview/chunk.AQRB7LDA.js +1 -0
- package/dist/preview/{chunk.GNBIVVL3.js → chunk.B23WZQXQ.js} +1 -1
- package/dist/preview/chunk.BIDL7GQD.js +0 -0
- package/dist/preview/chunk.BLUKSGI4.js +1 -0
- package/dist/preview/chunk.BZMQDEIY.js +1 -0
- package/dist/preview/chunk.CAKFNKN5.js +1 -0
- package/dist/preview/chunk.CGALLZ54.js +1 -0
- package/dist/preview/{chunk.LSY256J4.js → chunk.CHHYIMB7.js} +1 -1
- package/dist/preview/chunk.CXDGE5ZS.js +1 -0
- package/dist/preview/{chunk.CC5BJH5A.js → chunk.CY3ELWCM.js} +1 -1
- package/dist/preview/chunk.DC35FJAB.js +1 -0
- package/dist/preview/{chunk.AVBTPSQF.js → chunk.DD2NKFDX.js} +1 -1
- package/dist/preview/{chunk.6HF6POIX.js → chunk.DDO3GLEJ.js} +1 -1
- package/dist/preview/{chunk.TLJOZSDD.js → chunk.DDUCIUVW.js} +1 -1
- package/dist/preview/chunk.DEAP3H2L.js +1 -0
- package/dist/preview/chunk.DHJ3FQTR.js +1 -0
- package/dist/preview/{chunk.P6RORYOT.js → chunk.DNVWSWL2.js} +1 -1
- package/dist/preview/chunk.DPEIT3TW.js +1 -0
- package/dist/preview/chunk.DVSTLVIH.js +15 -0
- package/dist/preview/chunk.DZZL5IDD.js +5 -0
- package/dist/preview/{chunk.IGVASEZU.js → chunk.ELOFPE25.js} +1 -1
- package/dist/preview/{chunk.MVWC3VR3.js → chunk.ELTV44HU.js} +2 -2
- package/dist/preview/chunk.EVBCEEQ4.js +1 -0
- package/dist/preview/{chunk.TKVLNBRD.js → chunk.F7YXLYLX.js} +1 -1
- package/dist/preview/{chunk.DCHQHKSA.js → chunk.FULEUL34.js} +1 -1
- package/dist/preview/{chunk.VNDKKTED.js → chunk.G4ULQK64.js} +14 -14
- package/dist/preview/{chunk.Y7G3OGDE.js → chunk.GX4G4BX3.js} +1 -1
- package/dist/preview/chunk.H24OC6OE.js +1 -0
- package/dist/preview/chunk.H5S7OL2U.js +1 -0
- package/dist/preview/chunk.H73ZPYUX.js +1 -0
- package/dist/preview/{chunk.GTKJJYQH.js → chunk.H7N7WN4U.js} +1 -1
- package/dist/preview/chunk.HANJZ6FA.js +1 -0
- package/dist/preview/chunk.HIMQ65QT.js +1 -0
- package/dist/preview/chunk.I77ZGIFE.js +1 -0
- package/dist/preview/{chunk.MJVYWLQQ.js → chunk.ILIIBSGA.js} +1 -1
- package/dist/preview/chunk.IQ3PRWGO.js +104 -0
- package/dist/preview/{chunk.NC7FXY2H.js → chunk.IQMD7DG3.js} +1 -1
- package/dist/preview/chunk.IQPILSV3.js +18 -0
- package/dist/preview/chunk.IYBEXENQ.js +1 -0
- package/dist/preview/{chunk.ULL6ZIJJ.js → chunk.J7Q2WAF4.js} +1 -1
- package/dist/preview/{chunk.TLWT67ON.js → chunk.JT3MFPRD.js} +1 -1
- package/dist/preview/chunk.JYFZCJ4N.js +2 -0
- package/dist/preview/chunk.K2HDEL7I.js +1 -0
- package/dist/preview/chunk.KDXU5DT3.js +1 -0
- package/dist/preview/chunk.KL7E4YHJ.js +1 -0
- package/dist/preview/{chunk.FRYBMS3W.js → chunk.KMV6PJFL.js} +1 -1
- package/dist/preview/{chunk.RXYNW5QB.js → chunk.L3WTKQQL.js} +1 -1
- package/dist/preview/chunk.LAYQ5PFS.js +1 -0
- package/dist/preview/{chunk.KBVTLNS5.js → chunk.LGRLVJGS.js} +3 -3
- package/dist/preview/chunk.LTZUF5VG.js +1 -0
- package/dist/preview/{chunk.OLFJH4RK.js → chunk.M4AYA2PL.js} +1 -1
- package/dist/preview/chunk.M7RESZB6.js +25 -0
- package/dist/preview/{chunk.WXUFATY5.js → chunk.MAKODQO3.js} +1 -1
- package/dist/preview/{chunk.F6V7RWDK.js → chunk.MDEX6ZVE.js} +1 -1
- package/dist/preview/chunk.MGALQLRW.js +1 -0
- package/dist/preview/{chunk.7OPM55I2.js → chunk.MYNMBOLD.js} +1 -1
- package/dist/preview/chunk.N6EJXXQK.js +2 -0
- package/dist/preview/chunk.NAD7ZXYP.js +1 -0
- package/dist/preview/chunk.NHTGAP3G.js +3 -0
- package/dist/preview/{chunk.5IEFTFKQ.js → chunk.NJSK3UO2.js} +1 -1
- package/dist/preview/{chunk.VFOON3Z3.js → chunk.NOGGSLVG.js} +1 -1
- package/dist/preview/chunk.NUWDMH47.js +1 -0
- package/dist/preview/chunk.NUYA4BWI.js +1 -0
- package/dist/preview/{chunk.VUBNBTJP.js → chunk.O2BHPYA4.js} +2 -2
- package/dist/preview/chunk.O75HWF3F.js +1 -0
- package/dist/preview/chunk.OFWNMTGB.js +21 -0
- package/dist/preview/chunk.OKZT2QBM.js +2 -0
- package/dist/preview/{chunk.EL5ICOOM.js → chunk.OUDATENL.js} +1 -1
- package/dist/preview/chunk.OUPURRDE.js +1 -0
- package/dist/preview/{chunk.Y5C4RXG7.js → chunk.OWOOKLIU.js} +2 -1
- package/dist/preview/{chunk.PI44XMY2.js → chunk.OWT3VVOT.js} +1 -1
- package/dist/preview/{chunk.VDMDPZ6U.js → chunk.PCDUV3WP.js} +1 -1
- package/dist/preview/chunk.PD2DECOP.js +1 -0
- package/dist/preview/{chunk.ZXOT3IXJ.js → chunk.PKWQKFPE.js} +1 -1
- package/dist/preview/{chunk.ENL2JJ47.js → chunk.PLTH2LW5.js} +1 -1
- package/dist/preview/{chunk.ZP5RT2EK.js → chunk.PZQNR4KZ.js} +1 -1
- package/dist/preview/chunk.Q5WEOX3Q.js +1 -0
- package/dist/preview/chunk.QDWSU47A.js +1 -0
- package/dist/preview/{chunk.VADQ7ZGA.js → chunk.QGU5QTR6.js} +1 -1
- package/dist/preview/chunk.QHY5NVYH.js +1 -0
- package/dist/preview/{chunk.6ZQAR5ZA.js → chunk.QIPASE42.js} +1 -1
- package/dist/preview/{chunk.7MHCGVGM.js → chunk.RD2X25XB.js} +1 -1
- package/dist/preview/chunk.RMR24LFJ.js +4 -0
- package/dist/preview/chunk.ROZTJ6IY.js +6 -0
- package/dist/preview/{chunk.RQOX5YDW.js → chunk.RPDH32XV.js} +1 -1
- package/dist/preview/chunk.RRKI24WY.js +1 -0
- package/dist/preview/{chunk.HDP3PS7N.js → chunk.RYRQ66JN.js} +1 -1
- package/dist/preview/chunk.SEHRPTNA.js +7 -0
- package/dist/preview/chunk.SGCW2XRC.js +1 -0
- package/dist/preview/{chunk.JPONLMU7.js → chunk.SS7234R6.js} +1 -1
- package/dist/preview/{chunk.BXDM3UMN.js → chunk.SVPKUWZU.js} +1 -1
- package/dist/preview/{chunk.LQVAABPS.js → chunk.SWMDFXUX.js} +1 -1
- package/dist/preview/{chunk.6WHAWOO7.js → chunk.T3UQ7ZQK.js} +1 -1
- package/dist/preview/chunk.T6PU3NKP.js +1 -0
- package/dist/preview/{chunk.6C2MHWSX.js → chunk.T6WHGKWR.js} +1 -1
- package/dist/preview/{chunk.QBLKTFF4.js → chunk.THVC2BEC.js} +1 -1
- package/dist/preview/{chunk.KDRLUBVF.js → chunk.TIALD6SC.js} +1 -1
- package/dist/preview/{chunk.Z2ERZ4S6.js → chunk.TM4EPUNO.js} +1 -1
- package/dist/preview/chunk.U5P23GO7.js +1 -0
- package/dist/preview/chunk.U6ZRJKVM.js +1 -0
- package/dist/preview/chunk.UFDJXQQQ.js +32 -0
- package/dist/preview/{chunk.IOK4GVJC.js → chunk.UKQUUPKE.js} +1 -1
- package/dist/preview/{chunk.TAT2IQUR.js → chunk.UQQKDBIH.js} +1 -1
- package/dist/preview/{chunk.QHDCTAD7.js → chunk.UVA7AALY.js} +1 -1
- package/dist/preview/chunk.UXMPFPFH.js +20 -0
- package/dist/preview/chunk.VACKSKGJ.js +1 -0
- package/dist/preview/{chunk.3UOKUF5Z.js → chunk.VC3V7HLL.js} +1 -1
- package/dist/preview/chunk.VIH5AX7S.js +5 -0
- package/dist/preview/{chunk.4LR64TPU.js → chunk.VJBBVLGZ.js} +1 -1
- package/dist/preview/chunk.VN23AGIY.js +1 -0
- package/dist/preview/{chunk.VZJWJ5XM.js → chunk.W4BKYSZX.js} +1 -1
- package/dist/preview/{chunk.CQT3W2SF.js → chunk.WEOVK2T4.js} +1 -1
- package/dist/preview/chunk.WKI5INH7.js +1 -0
- package/dist/preview/chunk.WPXPVD33.js +88 -0
- package/dist/preview/chunk.X6KYRBL6.js +1 -0
- package/dist/preview/chunk.Y2YYH3JN.js +1 -0
- package/dist/preview/chunk.Y4FZKUOK.js +1 -0
- package/dist/preview/chunk.Y4S7CDRB.js +1 -0
- package/dist/preview/{chunk.YFSBVZTG.js → chunk.YP2QSPXU.js} +1 -1
- package/dist/preview/{chunk.VWJGQDCE.js → chunk.Z2TDZSMN.js} +1 -1
- package/dist/preview/chunk.ZN3PUM2I.js +1 -0
- package/dist/preview/index.html +53 -51
- package/dist/preview/page.js +2 -2
- package/dist/preview/splash.js +57 -0
- package/package.json +6 -6
- package/dist/preview/chunk.2K4TT2BV.js +0 -1
- package/dist/preview/chunk.37TVS7CA.js +0 -1
- package/dist/preview/chunk.3IZ3ABII.js +0 -1
- package/dist/preview/chunk.3MOJF7BA.js +0 -1
- package/dist/preview/chunk.3V4WP7RY.js +0 -18
- package/dist/preview/chunk.3ZT5WQYL.js +0 -1
- package/dist/preview/chunk.4MP72LPR.js +0 -25
- package/dist/preview/chunk.4TCKEG6I.js +0 -1
- package/dist/preview/chunk.5DD62IOW.js +0 -21
- package/dist/preview/chunk.5YOLUDVO.js +0 -1
- package/dist/preview/chunk.644FUGSX.js +0 -1
- package/dist/preview/chunk.67U6M7OV.js +0 -1
- package/dist/preview/chunk.7TFLRR7D.js +0 -1
- package/dist/preview/chunk.7VKSXGTX.js +0 -1
- package/dist/preview/chunk.BF6S5UE4.js +0 -1
- package/dist/preview/chunk.BLPYNNR4.js +0 -1
- package/dist/preview/chunk.BRT27WON.js +0 -1
- package/dist/preview/chunk.BYKD5RLA.js +0 -1
- package/dist/preview/chunk.C7OLSEWK.js +0 -1
- package/dist/preview/chunk.CFKZXLXS.js +0 -1
- package/dist/preview/chunk.CMN6BBAD.js +0 -1
- package/dist/preview/chunk.D7YSL3NK.js +0 -2
- package/dist/preview/chunk.EQXB7LKI.js +0 -1
- package/dist/preview/chunk.ERFT54HT.js +0 -1
- package/dist/preview/chunk.FLUK3UXF.js +0 -1
- package/dist/preview/chunk.G3R4BTI7.js +0 -1
- package/dist/preview/chunk.G4YJPKRG.js +0 -5
- package/dist/preview/chunk.GLWSVSQL.js +0 -1
- package/dist/preview/chunk.I4XQBQRC.js +0 -1
- package/dist/preview/chunk.IBOKXVWN.js +0 -1
- package/dist/preview/chunk.IHBUBZQT.js +0 -2
- package/dist/preview/chunk.JEYQBH33.js +0 -32
- package/dist/preview/chunk.JJGCTGWA.js +0 -1
- package/dist/preview/chunk.KGW75Z5L.js +0 -3
- package/dist/preview/chunk.KI37ZEV3.js +0 -1
- package/dist/preview/chunk.KNYLY7MH.js +0 -1
- package/dist/preview/chunk.L6AWE76F.js +0 -1
- package/dist/preview/chunk.LGEA5257.js +0 -6
- package/dist/preview/chunk.LLYRFVIN.js +0 -104
- package/dist/preview/chunk.LZIBQ3VX.js +0 -1
- package/dist/preview/chunk.MDJWK5W2.js +0 -1
- package/dist/preview/chunk.MSWWWLEA.js +0 -1
- package/dist/preview/chunk.PFSYXD6Q.js +0 -1
- package/dist/preview/chunk.PHC2MI4C.js +0 -1
- package/dist/preview/chunk.PHJ6WPWH.js +0 -1
- package/dist/preview/chunk.PNW5K7BW.js +0 -1
- package/dist/preview/chunk.PXQVXBNG.js +0 -1
- package/dist/preview/chunk.QFUMFQJU.js +0 -1
- package/dist/preview/chunk.QI4SLPQ4.js +0 -4
- package/dist/preview/chunk.QUJS63OJ.js +0 -13
- package/dist/preview/chunk.SB2PZKN5.js +0 -88
- package/dist/preview/chunk.T7LQD67N.js +0 -20
- package/dist/preview/chunk.TY4GQJKC.js +0 -1
- package/dist/preview/chunk.UDCDK7XJ.js +0 -4
- package/dist/preview/chunk.UITT6JWW.js +0 -2
- package/dist/preview/chunk.UJTE7UAP.js +0 -1
- package/dist/preview/chunk.UQWTZJBV.js +0 -1
- package/dist/preview/chunk.VMV464JK.js +0 -1
- package/dist/preview/chunk.VSCIXAHN.js +0 -5
- package/dist/preview/chunk.W3W54DSX.js +0 -1
- package/dist/preview/chunk.WC3DENU4.js +0 -67
- package/dist/preview/chunk.WQ6RCEUQ.js +0 -1
- package/dist/preview/chunk.X6A4VSSD.js +0 -1
- package/dist/preview/chunk.XGASJAV2.js +0 -7
- package/dist/preview/chunk.XR6YR6RV.js +0 -1
- package/dist/preview/chunk.XZPKBHJT.js +0 -1
- package/dist/preview/chunk.YEBGI6ED.js +0 -1
- package/dist/preview/chunk.YH63KQ2G.js +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
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 Te}from"./chunk.IQ3PRWGO.js";import{A as on,B as Ee,C as ko,D as at,E as ye,F as Zn,G as Ve,H as ze,I as xo,J as Xn,K as Me,L as Po,M as Ao,N as F,O as vt,P as Mt,Q as Co,R as Ot,S as sn,T as Ro,U as ie,V as Je,W as se,X as ea,a as U,b as Pe,c as X,d as rn,e as Jn,f as Yn,g as St,h as ne,i as be,j as le,k as R,l as de,m as _,n as We,o as ve,p as bt,q as fe,r as ge,s as So,t as Lt,u as bo,v as Tt,w as Et,x as J,y as Ge,z as vo}from"./chunk.YP2QSPXU.js";import{b as zn,c as ho,d as wo,e as qe,f as Qn,h as ae}from"./chunk.VIH5AX7S.js";import{a as mo,d as fo,e as yo}from"./chunk.Q355UPFG.js";import{a as so,c as lo,f as co,g as po,i as uo,j as go}from"./chunk.VC3V7HLL.js";import{a as an,b as Rt}from"./chunk.BZMQDEIY.js";import{a as Qr,b as Zr,c as Xr,d as _n}from"./chunk.ELTV44HU.js";import{b as Yr}from"./chunk.CY3ELWCM.js";import{a as eo,b as to,d as tn,e as no,f as ao,g as ro,j as nn}from"./chunk.I77ZGIFE.js";import{m as Jr}from"./chunk.SWMDFXUX.js";import{a as Hr,b as Fr,c as Ir,e as Ur,f as Un,h as Zt}from"./chunk.NAD7ZXYP.js";import{d as Dr,e as Wr,f as Gr,g as Br,o as Yt,p as Vr,r as jr,t as Qt}from"./chunk.2GEJNG2U.js";import{a as Ut,b as pr,c as ur,d as _t,e as gr}from"./chunk.4TX6VCBT.js";import{b as Sr,c as Mr,e as Or,f as qn}from"./chunk.TIALD6SC.js";import{a as Kn,b as Er}from"./chunk.66P5IDTH.js";import{a as Xt,b as en,c as _r,e as zr}from"./chunk.LAYQ5PFS.js";import{a as wt,b as Lr,e as Tr}from"./chunk.KDXU5DT3.js";import{a as Nr}from"./chunk.BJUUSIQY.js";import{a as Vn}from"./chunk.PZQNR4KZ.js";import{a as Bn,b as hr,c as wr}from"./chunk.W4BKYSZX.js";import{a as $r}from"./chunk.Y2YYH3JN.js";import{c as vr,d as kr,e as xr,f as Pr,j as Ar,l as nt,n as Cr}from"./chunk.SGCW2XRC.js";import{a as br}from"./chunk.ZN3PUM2I.js";import{b as Ja,c as Ya}from"./chunk.OWT3VVOT.js";import{a as Dn,d as Wn,f as za}from"./chunk.NHTGAP3G.js";import{r as Ct,s as Rr}from"./chunk.UKQUUPKE.js";import{b as mr,c as fr,d as zt,e as yr,l as Jt}from"./chunk.OKZT2QBM.js";import{B as jn,J as oo,M as io,c as dr,d as cr,t as Kr,u as qr}from"./chunk.AI34V6WV.js";import{c as Ri}from"./chunk.G4ULQK64.js";import{Da as jt,G as xe,L as Xa,N as er,Qa as lr,R as tr,T as j,U as Gn,Y as nr,Z as ar,ba as rr,ca as ce,fa as or,ga as ir,ka as sr,oa as yt,qa as ht,r as Za,sa as Ke,v as De}from"./chunk.M7RESZB6.js";import{a as Qa}from"./chunk.SDO3U72B.js";import{$c as Fn,$d as ft,Ca as $a,Da as Ha,Db as mt,Ec as Ga,Gc as Ba,Id as In,N as Ea,Od as qt,Pd as ja,Rd as Vt,Z as ut,_d as Ua,ad as Ka,ae as At,db as Fa,fb as Ia,fe as _a,ga as Xe,hd as qa,ia as et,ja as oe,la as gt,ma as Ma,na as _e,pa as Oa,qa as Na,ra as tt,sb as Hn,tb as Da,ud as Va,vc as Wa}from"./chunk.DZZL5IDD.js";import{b as $}from"./chunk.AJZBJBMO.js";function ln(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let r=e.schema.tryDefinition(a.kind),o=s=>oe(e.schema.tryDefinition(s.kind),s),i=new Map;for(let s of e.graph.allEdges()){let l=s.from===t?"out":s.to===t?"in":null;if(!l)continue;let c=l==="out"?s.to:s.from,u=e.graph.getNode(c);if(!u)continue;let p=(l==="out"?r:e.schema.tryDefinition(u.kind))?.edges?.[s.kind],y=l==="in"?p?.inverse??p?.description:p?.description,L=`${s.kind}|${l}|${y??""}`;(i.get(L)??(()=>{let k={edgeKind:s.kind,direction:l,...y?{description:y}:{},targets:[]};return i.set(L,k),k})()).targets.push({id:u.id,kind:u.kind,label:o(u)})}return{id:t,kind:a.kind,label:o(a),fields:zt(nt(e.schema,e.graph,a),r),violations:Hn(e.violations(n.context),[t]),actions:Vn(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...i.values()].map(s=>{let l=mr(s.targets.flatMap(c=>{let u=e.graph.getNode(c.id);return u?[u]:[]}),c=>e.schema.tryDefinition(c));return{...s,targets:[...s.targets].map(c=>l.has(c.id)?{...c,apart:l.get(c.id)}:c).sort((c,u)=>c.label.localeCompare(u.label))}})}}function rt(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:Vn(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function Lo(e,t){let n=(o,i)=>`${o}|${JSON.stringify(i)}`,a=new Map;for(let o of[...e.affordances,...e.withheld]){if(o.provider!=="invariant")continue;let i=n(o.mutation,o.args);a.has(i)||a.set(i,o.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...t].map((o,i)=>({repair:o,declared:i})).sort((o,i)=>(a.get(n(o.repair.mutation,o.repair.args??{}))??r)-(a.get(n(i.repair.mutation,i.repair.args??{}))??r)||o.declared-i.declared).map(o=>o.repair)}function ot(e){let t=e.schema.kinds.map(r=>({kind:r,plural:_e(e.schema,r),count:e.graph.nodesOfKind(r).length})),n=new Map;for(let r of e.graph.allEdges()){let o=e.graph.getNode(r.from),i=e.graph.getNode(r.to);if(!o||!i)continue;let s=`${r.kind}|${o.kind}|${i.kind}`;n.set(s,(n.get(s)??0)+1)}let a=[];for(let{kind:r}of t){let o=e.schema.tryDefinition(r)?.edges??{};for(let[i,s]of Object.entries(o)){let l=s.to==="*"||s.to===void 0?(()=>{let c=[...n.keys()].filter(u=>u.startsWith(`${i}|${r}|`)).map(u=>u.split("|")[2]);return c.length>0?c:["*"]})():s.to;for(let c of l)a.push({edgeKind:i,from:r,to:c,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:n.get(`${i}|${r}|${c}`)??0})}}return{kinds:t,relations:a}}var je=$(xe(),1);var Nt=$(xe(),1);var Oe=$(j(),1),Ti={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},Ei=e=>{try{return decodeURIComponent(e)}catch{return e}};function Mi(e,t,n={}){let{store:a}=e,r=a.schema,o=(n.base??"").replace(/\/$/,""),[i="/",s=""]=t.split("#")[0].split("?"),l=(M,I,x)=>({label:M,href:`${o}${I}`,path:I,...x?{current:x}:{}}),c=M=>{let I=n.registry?.sectionOf(M);return I?[I.path===void 0?{label:I.label}:l(I.label,I.path)]:[]},u=M=>n.registry?.sectionOf(M)?.label,w=M=>{let I=u(M);return I===void 0?{}:{section:I}},[p,y,...L]=i.split("/").filter(Boolean).map(Ei);if(p===void 0)return{as:"home",label:"Home",trail:[l("Home","/",!0)]};if(p==="places"&&y!==void 0&&L.length===0){let M=new URLSearchParams(s).get("of"),I=new Set(Ge(a,e.principal)),x=e.views?.places()??[],W=x.find(z=>I.has(z.kind)&&z.as===y&&(!M||U(r,z.kind)===M));if(W){let z=rn(W.as,qt(W,x)?U(r,W.kind):void 0);return{as:"place",kind:W.kind,label:W.title,...w(W.kind),trail:[...c(W.kind),l(W.title,z,!0)]}}}let m=L.length===0?Pe(r,p):void 0;if(m!==void 0){let M=l(_e(r,m),`/${U(r,m)}`);if(y===void 0)return{as:"list",kind:m,label:M.label,...w(m),trail:[...c(m),{...M,current:!0}]};let I=a.graph.getNode(y),x=I&&I.kind===m?oe(r.tryDefinition(m),I):"Nothing lives here";return{as:"record",kind:m,id:y,label:x,...w(m),trail:[...c(m),M,l(x,X(r,m,y),!0)]}}let k=Ti[p]??Oi((L.at(-1)??y??p).replace(/[-_]+/g," "));return{as:"page",label:k,trail:[l(k,i,!0)]}}var Oi=e=>e.charAt(0).toUpperCase()+e.slice(1),ta=(0,Nt.createContext)(null);function Ni(e){let t=ye(),n=at("/");return ae(e.context.store),Mi(e.context,`${t.pathname}${t.search}`,{registry:e.registry,base:n})}var $i={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:0},To={display:"flex",alignItems:"center",gap:6,minWidth:0},Eo={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function it({context:e,style:t}){let n=(0,Nt.useContext)(ta),a=(0,Nt.useContext)(Mt);return Ot(a??Fi,"trail")||n?.registry?.without().has("trail")?null:(0,Oe.jsx)(Hi,{root:n??{context:e,registry:void 0},context:e,...t?{style:t}:{}})}function Hi({root:e,context:t,style:n}){let a=Ni(e);return a.trail.length<2?null:(0,Oe.jsx)(Ii,{here:a,mark:a.as==="record"?{kind:a.kind,context:t}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var Fi={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function Ii({here:e,mark:t,style:n,...a}){let r=e.as==="record"?e.trail.length-2:-1;return(0,Oe.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Oe.jsx)("ol",{style:{...be,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:e.trail.map((o,i)=>(0,Oe.jsxs)("li",{style:o.current?$i:{...To,flexShrink:i===e.trail.length-2?0:1,maxWidth:"100%"},...o.current?{"aria-current":"page"}:{},children:[i>0&&!o.current?(0,Oe.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,o.current?o.label:o.path!==void 0?(0,Oe.jsxs)(F,{to:o.path,style:{...ve,...To},...i===r?{"data-testid":"trail-list"}:{},children:[i===r&&t?(0,Oe.jsx)(ge,{kind:t.kind,brand:t.context.brand,schema:t.context.store.schema,size:8}):null,(0,Oe.jsx)("span",{style:Eo,children:o.label})]}):(0,Oe.jsx)("span",{style:Eo,children:o.label})]},`${i}:${o.label}`))})})}var T=$(j(),1);function Fe(e){let t=e.views;if(!t)return[];let n=new Set(Ge(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}function $t(e,t){if(!t.over)return[t.kind];let n=new Set(Ge(e.store,e.principal));return t.over.filter(a=>a===t.kind||n.has(a))}var st=e=>`place:${e.kind}:${e.as}`;function he(e,t){return rn(t.as,qt(t,e.views?.places()??[])?U(e.store.schema,t.kind):void 0)}function kt(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>et(n,a))}function na(e,t,n){let a=(o,i)=>gt(e.schema,i,o),r=(typeof t=="string"?[t]:t).map(o=>a(kt(e,o).length,o)).join(" and ");return n?`${r} across ${a(kt(e,n).length,n)}`:r}function aa({context:e,place:t,chosen:n,filter:a}){let{store:r,views:o,invariantContext:i}=e,l=o?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view,c=[...new Set(r.violations(i).flatMap(p=>p.nodeIds))],u=$t(e,t).flatMap(p=>kt(r,p));if(!l)return null;let w=Di(r,u,a,c);return(0,T.jsx)(Ct,{kind:t.kind,view:t.title,children:(0,T.jsx)(Je,{when:Ke(l),children:(0,T.jsx)(l,{nodes:w,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})})}function Di(e,t,n,a){let r=n?Vt({filter:n}).filter??[]:[];return r.length===0?t:Zt(t,{filter:r},{schema:e.schema,graph:e.graph,flagged:new Set(a)}).nodes}function Wi({store:e,views:t,as:n,invariantContext:a}){ae(e);let r={store:e,views:t,...a?{invariantContext:a}:{}},o=t.places().find(i=>i.as===n);return o?(0,T.jsx)(aa,{context:r,place:o}):null}function Gi({context:e,kind:t}){let{store:n,views:a,invariantContext:r}=e,o=kt(n,t),i=n.schema.tryDefinition(t),s=J(n,t),c=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,u=[...new Set(n.violations(r).flatMap(L=>L.nodeIds))];if(c&&!yt(c))return(0,T.jsx)(Ct,{kind:t,children:(0,T.jsx)(c,{nodes:o,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...u.length>0?{flagged:u}:{}})});let w=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,p=8,y=o.slice(0,p);return(0,T.jsxs)("div",{"data-testid":"kind-sheet",style:w?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[y.map(L=>w?(0,T.jsx)(w,{node:L,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...u.includes(L.id)?{flagged:[L.id]}:{}},L.id):(0,T.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:oe(i,L)},L.id)),o.length>p?(0,T.jsxs)("span",{style:{...R,alignSelf:"center",padding:"0 6px"},children:["+",o.length-p," more ",s.toLowerCase()]}):null]})}function dn(e){let{store:t}=e,n=vo(e),a=Fe(e),r=e.views?.arrangement?.()?.order??[],o=l=>{let c=l.name===void 0?-1:r.indexOf(`view:${l.name}`);return c>=0?c-r.length:n.indexOf(l.kind)},i=In([...a].sort((l,c)=>o(l)-o(c))).filter(l=>!l.hidden),s=new Set(i.flatMap(l=>l.over??[l.kind]));return[...i.map(l=>({key:st(l),kind:l.kind,title:ja(l,a,t.schema),to:he(e,l),place:l})),...on(e).filter(l=>!s.has(l)).map(l=>({key:`kind:${l}`,kind:l,title:J(t,l),to:`/${U(t.schema,l)}`}))]}function No(e){let t=new Set(dn(e).flatMap(n=>n.place?$t(e,n.place):[n.kind]));return new Set([...t].flatMap(n=>kt(e.store,n).map(a=>a.id)))}var Mo=.72,Bi=540,Oo=16/10;function Ki(e){let t=(0,je.useRef)(null),[n,a]=(0,je.useState)(e);return(0,je.useLayoutEffect)(()=>{let r=t.current;if(!r||typeof ResizeObserver>"u")return;let o=()=>{let s=r.getBoundingClientRect().width;s>0&&a(l=>Math.abs(l-s)<.5?l:s)};o();let i=new ResizeObserver(o);return i.observe(r),()=>i.disconnect()},[]),{ref:t,width:n}}function qi(e){for(let t=e.parentElement;t;t=t.parentElement)if(/(auto|scroll)/.test(getComputedStyle(t).overflowY))return t;return null}function Vi(e){let[t,n]=(0,je.useState)(()=>typeof IntersectionObserver>"u");return(0,je.useLayoutEffect)(()=>{let a=e.current;if(t||!a)return;let r=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&(r.disconnect(),n(!0))},{root:qi(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[t,e]),t}function ra({context:e,entry:t,small:n=!1}){let{store:a,brand:r,principal:o}=e,{ref:i,width:s}=Ki(Bi),l=Vi(i),c=s/Mo,u=kt(a,t.kind),w=a.schema.tryDefinition(t.kind),p=u.length===0?rt(a,t.kind,{...o?{principal:o}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,y=t.place!==void 0;return(0,T.jsxs)(F,{to:t.to,"data-testid":y?"place-card":"kind-card",className:"graview-gallery-card",style:{...ve,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,T.jsxs)("span",{ref:i,"data-testid":y?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${Oo}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,T.jsx)("span",{style:{position:"absolute",left:0,top:0,width:c,height:c/Oo,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${Mo})`,transformOrigin:"0 0"},children:l?(0,T.jsx)(tn.Provider,{value:null,children:t.place?(0,T.jsx)(aa,{context:e,place:t.place}):(0,T.jsx)(Gi,{context:e,kind:t.kind})}):null}),u.length===0?(0,T.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,T.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,T.jsxs)("span",{style:{fontFamily:Yn,fontWeight:"var(--graview-weight-display)"},children:["No ",J(a,t.kind).toLowerCase()," yet"]}),p?(0,T.jsxs)("span",{style:R,children:["Begin with \u201C",p.label,"\u201D"]}):null]})}):null]}),(0,T.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,T.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[y?null:(0,T.jsx)(ge,{kind:t.kind,brand:r,schema:a.schema,size:8}),(0,T.jsx)("span",{style:{fontFamily:Yn,fontSize:n?"var(--graview-text-body)":"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:t.title})]}),(0,T.jsxs)("span",{style:R,children:[t.place?na(a,$t(e,t.place),t.place.across):na(a,t.kind),!y&&w?.description?` \xB7 ${w.description}`:null]})]})]})}var $o={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},ji={display:"grid",gap:"20px 16px",gridTemplateColumns:"repeat(auto-fill, minmax(clamp(140px, 22%, 260px), 1fr))"},Ui=`
|
|
2
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
3
|
+
.graview-gallery-card:hover > span:first-child,
|
|
4
|
+
.graview-gallery-card:focus-visible > span:first-child { border-color: var(--graview-edge-bright); box-shadow: 0 1px 0 var(--graview-edge), 0 10px 30px -18px var(--graview-ink); }
|
|
5
|
+
`;function cn({context:e,small:t=!1}){ae(e.store);let n=dn(e);return n.length===0?null:(0,T.jsxs)("section",{style:t?ji:$o,"data-testid":"gallery",...t?{"data-small":""}:{},children:[(0,T.jsx)("style",{children:Ui}),n.map(a=>(0,T.jsx)(ra,{context:e,entry:a,small:t},a.key))]})}function oa({context:e}){let{store:t}=e;ae(t);let n=In(Fe(e)).filter(r=>!r.hidden),a=dn(e);return(0,T.jsxs)(ie,{context:e,style:St,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:be,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,T.jsx)(se,{context:e,children:"Pictures"}),(0,T.jsx)("p",{style:le,children:n.length===0?"Nothing here has a picture of its own yet, so each kind is drawn as the scene draws it. Title a group view and it appears here by name.":"The ways this installation looks at what it holds \u2014 each one the same picture the scene shows, here as a page."})]}),a.length>0?(0,T.jsx)("div",{style:$o,"data-testid":"places",children:a.map(r=>(0,T.jsx)(ra,{context:e,entry:r},r.key))}):null]})}var _i={lede:!0},zi={lede:!1},Ji={...le,textWrap:"pretty"};function Yi(e,t){if(t===void 0)return;let[n]=Pr(xr([t]),Cr(e.store,null,null,e.brand?{money:e.brand}:{}));return n?.t==="headline"&&!n.problem&&n.text.trim()!==""?n.text:void 0}function ia({context:e}){let{store:t,principal:n}=e;ae(t);let a=ze(),r=Ve(),[o]=vt(),i=decodeURIComponent(a.as??""),[s,l]=(0,je.useState)(null),c=o.get("of"),u=o.get("filter"),p=Fe(e).find(A=>A.as===i&&(!c||U(t.schema,A.kind)===c));if(!p)return(0,T.jsxs)(ie,{context:e,children:[(0,T.jsx)(se,{context:e,children:"No picture is called that."}),(0,T.jsx)("p",{style:le,children:(0,T.jsx)(F,{to:"/places",style:We,children:(0,T.jsx)(qe,{children:"The pictures there are"})})})]});let y=J(t,p.kind),L=e.views?.resolve(p.kind,{cardinality:"many",fidelity:"full"},p.as)?.view,m=L?.flows===!0,k=L?.ownHeading===!0,M=L?.creates!==!1,I=Yi(e,L?.lede),x=ht(L)&&e.views?.lookup(p.kind,{cardinality:"many",fidelity:"full"})===L,W=rt(t,p.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}),z=M?W.actions.affordances.map(A=>({affordance:A,mutation:t.allMutations().find(C=>C.name===A.mutation)})).filter(A=>A.mutation!==void 0):[];return(0,T.jsxs)(ie,{context:e,style:{...St,gap:"var(--graview-space-6, 32px)"},children:[(0,T.jsxs)("header",{style:{display:"grid",gap:"var(--graview-space-2, 8px)"},children:[(0,T.jsx)(it,{context:e}),(0,T.jsx)(se,{context:e,unseen:k,children:p.title}),k?null:(0,T.jsx)("p",{style:Ji,"data-testid":"place-lede",...I!==void 0?{"data-graview-lede":"headline"}:{},children:I??`${na(t,$t(e,p),p.across)}.`}),u&&!m?(0,T.jsxs)("p",{style:{...R,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${u.split(",").map(A=>A.replace(":"," is ")).join(" and ")}. `,(0,T.jsx)(F,{to:`?${(()=>{let A=new URLSearchParams(o);return A.delete("filter"),A.toString()})()}`,style:{..._,...R},children:"Show all"})]}):null,(0,T.jsx)("p",{style:{...R,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:$t(e,p).filter(A=>!(x&&A===p.kind)).map((A,C)=>(0,T.jsx)(F,{to:`/${U(t.schema,A)}`,style:{...We,...R},...C===0?{"data-testid":"place-as-list"}:{},children:(0,T.jsxs)(qe,{children:["All ",(A===p.kind?y:J(t,A)).toLowerCase()," as a list"]})},A))})]}),(0,T.jsx)("div",{"data-testid":"place-lens","data-flows":m?"":void 0,...m?{}:{role:"group","aria-label":p.title,tabIndex:0},style:m?{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",maxWidth:"100%"}:{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",maxWidth:"100%",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)"},onClick:A=>{let C=A.target?.closest("[data-graview-pick]"),K=C?.getAttribute("data-graview-pick"),Q=C?.getAttribute("data-graview-joins");if(Q)try{let Re=JSON.parse(Q);if(Array.isArray(Re)&&Re.every(Se=>typeof Se=="string")){A.preventDefault(),l({at:st(p),ids:Re});return}}catch{}if(!K)return;let ke=t.graph.getNode(K);ke&&(A.preventDefault(),r(X(t.schema,ke.kind,K)))},children:(0,T.jsx)(ro.Provider,{value:I!==void 0?_i:zi,children:(0,T.jsx)(aa,{context:e,place:p,filter:u,...s?.at===st(p)?{chosen:s.ids}:{}})})}),z.length>0?(0,T.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:z.map(({affordance:A,mutation:C})=>(0,T.jsxs)("section",{style:{...de,display:"grid",gap:14},children:[(0,T.jsx)("h2",{style:ne,children:C.title??C.name}),C.description?(0,T.jsx)("p",{style:{...R,margin:0,maxWidth:"58ch"},children:C.description}):null,(0,T.jsx)(Te,{store:t,mutation:C,prefilled:A.args,open:A.open,label:A.label,...n?{principal:n}:{}})]},A.id))}):null]})}function Qi(e,t=document){let n=an(e);if(!n)return null;let a=[t,...[...t.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let o of r.querySelectorAll("[id], [data-section]")){let i=o.getAttribute("data-section")??o.id;if(i===e||an(i)===n)return o}for(let r of a)for(let o of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(an(o.textContent??"")===n)return o;return null}function Ho(e,t={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=t.frames??120,a=0,r=()=>{let o=Qi(e,t.root??document);if(o){o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.scrollIntoView?.({block:"start"}),o.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var V=$(xe(),1);var pn=$(xe(),1);var lt=$(j(),1);function Fo({context:e}){return ce()?(0,lt.jsxs)(lt.Fragment,{children:[(0,lt.jsx)(Zi,{context:e}),(0,lt.jsx)(lo,{face:"pages",on:e.quickAsk??!0})]}):null}function Zi({context:e}){let{store:t}=e,n=ce(),{pathname:a}=ye(),r=(0,pn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,pn.useEffect)(()=>{let o=r.current;if(!o)return;let[,i,s]=a.split("/"),l=(()=>{if(i==="places"){let u=e.views?.places().find(w=>w.as===decodeURIComponent(s??""));return u?[De(u.kind)]:[]}let c=i?Pe(t.schema,i):void 0;return c&&s?[decodeURIComponent(s)]:c?[Za(c)]:[]})();o(c=>c.length===l.length&&c.every((u,w)=>u===l[w])?c:l)},[a]),null}var Ae=$(xe(),1);var Do=$(Ri(),1);var me=$(j(),1);var Xi=jt(Qa(()=>(__graviewPreload(import.meta.url,["./chunk.VIH5AX7S.js","./chunk.Q355UPFG.js","./chunk.VC3V7HLL.js","./chunk.ELTV44HU.js","./chunk.CY3ELWCM.js","./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.SWMDFXUX.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.4TX6VCBT.js","./chunk.TIALD6SC.js","./chunk.66P5IDTH.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.5MZYCELA.js")).then(e=>({default:e.TakeBack}))));function es({context:e,docked:t,at:n,...a}){let{store:r}=e,o=ae(r),[i]=(0,Ae.useState)(()=>r.batches().length),s=(0,Ae.useRef)(!1);return s.current||=o>0||!t&&i>0,s.current?(0,me.jsx)(Ae.Suspense,{fallback:null,children:(0,me.jsx)(Xi,{context:e,docked:t,at:n,since:i,...a})}):null}function ts(e,t,n){let{store:a,principal:r,embedded:o}=e;(0,Ae.useEffect)(()=>{if(!n)return;let i=s=>{if(!yo(s))return;let l=s.target,c=l instanceof Node&&t.current?.contains(l),u=l===document.body||l===document.documentElement||l===document;if(!(!c&&!(u&&!o))&&mo(a,r)){s.preventDefault();try{fo(a,r)}catch{}}};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[a,r,o,t,n])}function Wo({context:e,registry:t,root:n,children:a}){let r=(0,Ae.useMemo)(Co,[]),o=t?.without()??new Set;return ts(e,n,!o.has("undo")),(0,me.jsxs)(Mt.Provider,{value:r,children:[(0,me.jsx)(ns,{context:e,placed:r,without:o}),a]})}function ns({context:e,placed:t,without:n}){let[a,r]=(0,Ae.useState)(!1);(0,Ae.useLayoutEffect)(()=>r(!0),[]);let o=Ot(t,"find"),i=Ot(t,"undo"),s=ye(),l=qr();if(!a)return null;let c=s.pathname.split("/").filter(Boolean),w=(c.length===1?Pe(e.store.schema,c[0]):void 0)!==void 0;return(0,me.jsxs)(me.Fragment,{children:[!o&&!n.has("find")&&l?(0,Do.createPortal)((0,me.jsx)(Io,{context:e,narrowsLists:w}),l.slot):null,!o&&!n.has("find")&&!l?(0,me.jsx)("div",{"data-testid":"face-find-bar",style:{display:"flex",alignItems:"center",padding:"8px 16px",borderBottom:"1px solid var(--graview-edge)",background:"var(--graview-bar)",minWidth:0},children:(0,me.jsx)(Io,{context:e,narrowsLists:w})}):null,!i&&!n.has("undo")?(0,me.jsx)(es,{context:e,docked:!0,at:s.pathname+s.search}):null,l?.own&&!n.has("undo")?(0,me.jsx)(ko,{context:e,own:l.own}):null]})}function Io({context:e,narrowsLists:t}){return(0,me.jsx)(Mt.Provider,{value:null,children:(0,me.jsx)(ea,{context:e,narrowsLists:t})})}var re=$(xe(),1);var Ce=$(j(),1),as=500,rs=10;function un(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function os(e){let t=typeof getSelection=="function"?getSelection():null;return t!==null&&!t.isCollapsed&&t.containsNode(e,!0)}function Go(e){let t=e.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(t)return t;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Bo({context:e,root:t,children:n}){return ce()===null?(0,Ce.jsx)(Ce.Fragment,{children:n}):(0,Ce.jsx)(is,{context:e,root:t,children:n})}function is({context:e,root:t,children:n}){let{setMenuAt:a}=rr(),{store:r}=e,o=r.schema,i=Ve(),{pathname:s,search:l}=ye(),c=at("/").replace(/\/$/,""),u=(0,re.useCallback)((b,S)=>e.views?.places().find(E=>E.as===b&&(S===null||E.kind===S)),[e.views]),w=(0,re.useCallback)((b,S)=>{let[E="",H,ee]=b.split("/").filter(Boolean).map(g=>{try{return decodeURIComponent(g)}catch{return g}});if(ee!==void 0)return null;if(E==="places"&&H!==void 0){let g=u(H,new URLSearchParams(S).get("of"));return g?{face:"pages",place:g.as,about:[De(g.kind)],title:g.title}:null}let te=Pe(o,E);return te?H===void 0?{face:"pages",about:[De(te)],title:_e(o,te)}:r.graph.getNode(H)?{face:"pages",on:H,about:[H]}:null:null},[o,r,u]),p=(0,re.useCallback)(b=>{let S=b.href;try{let E=new URL(S,location.href);if(E.origin===location.origin&&(c===""||E.pathname===c||E.pathname.startsWith(`${c}/`))){let H=w(E.pathname.slice(c.length),E.search);if(H)return{...H,href:S}}}catch{}return{face:"pages",about:[],href:S}},[c,w]),y=(0,re.useCallback)(()=>w(s,l)??{face:"pages",about:[]},[w,s,l]),L=(0,re.useCallback)(b=>{let S=y(),E=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(E&&S.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...S,field:E};let H=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(H)return{...S,act:H};let ee=b.closest("a[href]"),te=b.closest("[data-graview-listed]"),g=[b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),te&&(!ee||te.contains(ee)&&ee.classList.contains("graview-spec-item-link"))?te.getAttribute("data-graview-listed"):null].map(Z=>Z?r.graph.getNode(Z):void 0).find(Boolean);if(g)return{face:"pages",on:g.id,about:[g.id],href:`${c}${X(o,g.kind,g.id)}`};if(ee)return p(ee);let O=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return O&&r.graph.getNode(O)?{face:"pages",on:O,about:[O]}:S},[y,p,r,o,c]),m=(0,re.useCallback)(b=>{let S=t.current;if(S===null||!S.contains(b)||un(b)||b.closest("[data-graview-popover]"))return null;let E=L(b);return{face:"pages",on:E.on,about:E.about??[],field:E.field,place:E.place,href:E.href,act:E.act,element:Go(b)}},[L,t]),k=(0,re.useCallback)((b,S,E)=>{let H=L(b);a({...H,x:Math.round(S),y:Math.round(E),returnTo:Go(b)})},[L,a]),M=(0,re.useCallback)(b=>{let S=b.getBoundingClientRect();k(b,S.left+Math.min(16,S.width/2),Math.min(S.bottom,S.top+36))},[k]),I=(0,re.useRef)(0),x=(0,re.useRef)(null),W=(0,re.useRef)(!1),z=()=>{x.current&&clearTimeout(x.current.timer),x.current=null};(0,re.useEffect)(()=>z,[]),(0,re.useEffect)(()=>{let b=S=>{if(S.defaultPrevented||!(S.key==="ContextMenu"||S.key==="F10"&&S.shiftKey))return;let E=t.current,H=S.target instanceof Element?S.target:null,ee=H===null||H===document.body||H===document.documentElement,te=E!==null&&H!==null&&E.contains(H);if(!te&&!(ee&&document.querySelector("[data-graview-face='pages']")===E)||un(H)||H?.closest("[data-graview-popover]"))return;S.preventDefault(),I.current=Date.now();let g=te&&H instanceof HTMLElement?H:E?.querySelector("[data-graview-page-title], main h1, main")??null;g&&M(g)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,M]),(0,re.useEffect)(()=>{let b=t.current;if(!b)return;let S=E=>{let H=E.detail;H&&a({...H,face:"pages"})};return b.addEventListener(Gn,S),()=>b.removeEventListener(Gn,S)},[t,a]);let A=(0,re.useMemo)(()=>b=>{if(b.face!=="pages")return null;let S=[],E=b.on===void 0?void 0:r.graph.getNode(b.on),H=b.place===void 0?void 0:e.views?.places().find(pe=>pe.as===b.place),ee=E?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!H?ss(b.about[0]):void 0,te=E?X(o,E.kind,E.id):H?he(e,H):ee?`/${U(o,ee)}`:void 0,g=te!==void 0&&s===te.split("?")[0];te!==void 0&&!g&&S.push({id:"open",label:"Open",run:()=>i(te)});let O=te!==void 0?`${c}${te}`:b.href;O!==void 0&&S.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(O,"_blank","noopener")});let Z=E?`#focus=${encodeURIComponent(E.id)}`:H?`#focus=${encodeURIComponent(De(H.kind))}&view=${encodeURIComponent(H.as)}`:ee?`#focus=${encodeURIComponent(De(ee))}`:void 0;if(Z!==void 0&&(e.overview||!e.embedded)){let pe=e.overview;S.push({id:"in-the-scene",label:"Show in the scene",run:()=>pe?pe(Z):location.assign(`${e.sceneHref??"/"}${Z}`)})}return E===void 0&&b.href===void 0&&S.push({id:"find",label:"Find\u2026",run:()=>{let pe=t.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');pe&&pe.offsetParent!==null?pe.focus():i("/search")}}),S.length>0?{id:"pages",items:S}:null},[r,o,e,s,c,i,t]),C=(0,re.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let S=r.graph.getNode(b.on),E=b.element?.closest("[data-graview-field]")??t.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!S||!(E instanceof HTMLElement)||!E.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${Oa(o.tryDefinition(S.kind),b.field)}\u201D`,run:()=>E.click()}]}},[r,o,t]),K=po(),Q=Mr(),ke=Yr(),Re=(0,re.useCallback)((b,S)=>{s===he(e,b).split("?")[0]&&i(S?he(e,S):"/")},[s,e,i]),Se=go(Re),Le=(0,re.useMemo)(()=>[C,ke,A,...Se?[Se]:[],...Q?[Q]:[],...K?[K]:[]],[C,ke,A,Se,Q,K]);return(0,Ce.jsxs)(Rr,{sections:Le,children:[(0,Ce.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let S=b.target;b.shiftKey||un(S)||os(S)||(b.preventDefault(),!S.closest("[data-graview-popover]")&&(Date.now()-I.current<700||(b.clientX===0&&b.clientY===0&&S instanceof HTMLElement?M(S):k(S,b.clientX,b.clientY))))},onPointerDown:b=>{if(W.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let S=b.target;if(un(S)||S.closest("[data-graview-choose], [data-graview-popover]"))return;z();let{clientX:E,clientY:H}=b;x.current={x:E,y:H,timer:setTimeout(()=>{x.current=null,W.current=!0,I.current=Date.now(),k(S,E,H)},as)}},onPointerMove:b=>{let S=x.current;S&&Math.hypot(b.clientX-S.x,b.clientY-S.y)>rs&&z()},onPointerUp:z,onPointerCancel:z,onClickCapture:b=>{W.current&&(W.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Ce.jsx)(ls,{openAt:M,readyAt:m}),(0,Ce.jsx)(uo,{placement:"page"}),(0,Ce.jsx)(Or,{})]})}function ss(e){let t=e.slice(10).split("+");return t.length===1&&t[0]?t[0]:void 0}function ls({openAt:e,readyAt:t}){return(0,Ce.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:n=>{if(n.target!==n.currentTarget)return;let a=n.currentTarget.closest("[data-graview-face]"),r=a?.querySelector("[data-graview-page-title]")??a?.querySelector("main h1, main")??null;r&&(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Ce.jsx)(so,{placement:"menu",openActs:e,aimAt:t})})}var q=$(j(),1);function Ko(e,t){return t==="*"?{label:"anything",path:null}:{label:J(e,t),path:`/${U(e.schema,t)}`}}function ds({context:e,relation:t}){let{store:n}=e,a=Ko(n,t.from),r=Ko(n,t.to),o=i=>i.path?(0,q.jsx)(F,{to:i.path,style:{...ve,fontWeight:550},children:i.label}):(0,q.jsx)("span",{children:i.label});return(0,q.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,q.jsx)(co,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,q.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,q.jsxs)("span",{children:[o(a)," ",(0,q.jsxs)("span",{style:R,"data-graview-speaks-ids":"",children:[Xe(t.edgeKind)," \u2192"]})," ",o(r)]}),t.description||t.inverse?(0,q.jsxs)("span",{style:R,children:[t.description?Ee(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),r.path?(0,q.jsx)(F,{to:`${r.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{..._,...R,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:t.count}):(0,q.jsx)("span",{style:{...R,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function qo({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Ge(n,e.principal)),r=ot(n).relations.filter(o=>a.has(o.from)&&(o.to==="*"||a.has(o.to)));return r.length===0?null:(0,q.jsxs)("section",{style:{...de,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,q.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,q.jsx)("h2",{style:ne,children:(0,q.jsx)(F,{to:"/map",style:ve,children:"Connections"})}),(0,q.jsx)("span",{style:R,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(o=>(0,q.jsx)(ds,{context:e,relation:o},`${o.edgeKind}|${o.from}|${o.to}`))})]})}function sa({context:e}){let{store:t}=e;ae(t);let n=new Set(Ge(t,e.principal)),a=ot(t),r=a.relations.filter(o=>n.has(o.from));return(0,q.jsxs)(ie,{context:e,children:[(0,q.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,q.jsx)("p",{style:be,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,q.jsx)(se,{context:e,children:"Connections"}),(0,q.jsx)("p",{style:le,children:r.length===0?"Nothing here is declared to relate to anything else yet.":"The kinds this installation holds, and the relations declared between them \u2014 each in the declaration's own words, with how many of it there are."})]}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(o=>n.has(o.kind)).map(o=>(0,q.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,q.jsx)(ge,{kind:o.kind,brand:e.brand,schema:t.schema,size:7}),(0,q.jsx)(F,{to:`/${U(t.schema,o.kind)}`,style:_,children:o.plural}),(0,q.jsx)("span",{style:R,children:o.count})]},o.kind))}),(0,q.jsx)(qo,{context:e,heading:!1})]})}function Vo({context:e}){let n=[...ce()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=e;return(0,q.jsxs)("section",{style:{...de,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,q.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let o=r.at?a.graph.getNode(r.at):void 0;return(0,q.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,q.jsx)("span",{children:r.say}),o?(0,q.jsxs)(F,{to:X(a.schema,o.kind,o.id),style:{..._,...R},children:[oe(a.schema.tryDefinition(o.kind),o)," \u2192"]}):null]},r.participant)})})]})}function Uo(e){let t=new Set(e.schema.kinds);return(Array.isArray(e.purpose?.jobs)?e.purpose.jobs:[]).flatMap(a=>{if(typeof a!="object"||a===null||typeof a.name!="string"||typeof a.ask!="string"||!t.has(a.kind))return[];let r=Fn(a.sort);return[{name:a.name,ask:a.ask,kind:a.kind,plural:Ma(e.schema,a.kind),...a.where!==void 0?{where:a.where}:{},...r?{sort:r}:{},...a.act!==void 0?{act:a.act}:{},...a.roles&&a.roles.length>0?{roles:[...a.roles]}:{}}]})}function _o(e,t){return e.filter(n=>Nr(n,t.roles))}var gn=new Map;function jo(e){if(!gn.has(e))try{gn.set(e,Ya(e))}catch(t){if(!(t instanceof Ja))throw t;gn.set(e,null)}return gn.get(e)}var cs=e=>e instanceof Dn?e.nodes.length>0:Array.isArray(e)?e.length>0:!!e,ps=(e,t)=>t instanceof Dn?t.nodes.length:t!==null&&typeof t=="object"&&!Array.isArray(t)?oe(e.tryDefinition(t.kind),t):t;function zo(e,t,n){let a=e;if(a.kindsKeptFrom(n).has(t.kind)||!a.schema.tryDefinition(t.kind))return{count:0,ids:[]};let r=a.seenBy(n),o=r.graph,i=r.schema,s=Ar(i),l=r.today?.(),c=(k,M)=>za(k,{graph:o,subject:M,kinds:s,...l?{today:l}:{}}),u=t.where===void 0?void 0:jo(t.where);if(u===null)return{count:0,ids:[]};let w=o.nodesOfKind(t.kind).filter(k=>{if(!u)return!0;try{return cs(c(u,k))}catch(M){if(!(M instanceof Wn))throw M;return!1}}),p=Fn(t.sort),y=p&&p.by!=="label"?jo(p.by):void 0,m=(p?Ka(w,p,k=>{if(p.by==="label")return oe(i.tryDefinition(k.kind),k);if(y)try{return ps(i,c(y,k))}catch(M){if(!(M instanceof Wn))throw M;return}}):w).map(k=>k.id);return{count:m.length,ids:m}}var mn=$(xe(),1);var Y=$(j(),1),us=5,gs=3,Yo={kind:"human"};function Qo(e){if(!e.app)return[];let t=e.principal??Yo;return _o(Uo(e.app),t).map(n=>({job:n,...zo(e.store,n,t)}))}function Zo({context:e,answered:t}){let n=t.filter(i=>i.count>0),a=t.filter(i=>i.count===0),[r,...o]=n;return(0,Y.jsxs)("div",{style:{display:"grid",gap:40,maxWidth:"46rem",outline:"none"},"data-testid":"jobs",tabIndex:-1,children:[(0,Y.jsx)("style",{children:bt}),r?(0,Y.jsx)(Jo,{context:e,answered:r,leads:!0}):null,o.map(i=>(0,Y.jsx)(Jo,{context:e,answered:i},i.job.name)),a.length>0?(0,Y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"jobs-quiet",children:a.map(({job:i})=>(0,Y.jsxs)("li",{"data-testid":"job-quiet","data-job":i.name,style:{overflowWrap:"anywhere"},children:[i.ask," ",(0,Y.jsxs)("span",{style:R,children:["No ",J(e.store,i.kind).toLowerCase()," right now."]})]},i.name))}):null]})}function Jo({context:e,answered:t,leads:n=!1}){let{store:a}=e,{job:r,count:o,ids:i}=t,s=i.slice(0,n?us:gs),l=J(a,r.kind),c=n?(0,Y.jsx)(se,{context:e,"data-testid":"job-ask",children:r.ask}):(0,Y.jsx)("h2",{style:ne,"data-testid":"job-ask",children:r.ask});return(0,Y.jsxs)("section",{className:"graview-list",style:{display:"grid",gap:n?12:8,minWidth:0},"data-testid":"job","data-job":r.name,...n?{"data-leads":""}:{},children:[(0,Y.jsxs)("header",{style:{display:"grid",gap:4},children:[c,(0,Y.jsx)("p",{style:{...n?le:R,margin:0},"data-testid":"job-count",children:gt(a.schema,r.kind,o)})]}),(0,Y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",borderBottom:"1px solid var(--graview-edge)"},"data-testid":"job-rows",children:s.map(u=>(0,Y.jsx)(ms,{context:e,job:r,id:u},u))}),(0,Y.jsxs)("p",{style:{...R,margin:0,display:"flex",flexWrap:"wrap",gap:"0 12px",alignItems:"baseline"},children:[o>s.length?(0,Y.jsxs)("span",{"data-testid":"job-more",children:[o-s.length," more"]}):null,(0,Y.jsx)(F,{to:`/${U(a.schema,r.kind)}`,style:We,"data-testid":"job-all",children:(0,Y.jsxs)(qe,{children:["All ",l.toLowerCase()]})})]})]})}function ms({context:e,job:t,id:n}){let{store:a,principal:r,invariantContext:o}=e,[i,s]=(0,mn.useState)(!1),l=(0,mn.useRef)(null),c=a.seenBy(r??Yo).graph.getNode(n);if(!c)return null;let u=a.schema.tryDefinition(c.kind),w=oe(u,c),p=Tt(c,u,w),y=t.act?ln(a,n,{...r?{principal:r}:{},...o?{context:o}:{}})?.actions.affordances.find(k=>k.mutation===t.act&&k.provider!=="invariant"):void 0,L=y?a.allMutations().find(k=>k.name===y.mutation):void 0,m=`job-${t.name}-${n}`;return(0,Y.jsxs)("li",{ref:l,"data-testid":"job-row","data-graview-record":n,style:{position:"relative",display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",alignItems:"center",gap:"8px 12px",minHeight:"2.75rem",padding:"8px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,Y.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,Y.jsx)(F,{to:X(a.schema,c.kind,n),className:"graview-row-title",...w.length>60?{title:w}:{},children:w}),p.length>0?(0,Y.jsx)("span",{className:"graview-row-glance",children:(0,Y.jsx)(Et,{runs:p})}):null]}),y&&L?(0,Y.jsx)("button",{type:"button","data-testid":"job-act","data-graview-act":y.mutation,"aria-expanded":i,"aria-controls":m,"aria-label":`${y.label}: ${w}`,onClick:()=>s(!i),style:{...fe,position:"relative",...i?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:y.label}):null,i&&y&&L?(0,Y.jsx)("div",{id:m,style:{gridColumn:"1 / -1",position:"relative",display:"grid",gap:10,padding:"4px 0 8px"},children:(0,Y.jsx)(Te,{store:a,mutation:L,prefilled:y.args,open:y.open,label:y.label,autoFocus:!0,onDone:()=>{let k=l.current?.closest('[data-testid="jobs"]');s(!1),requestAnimationFrame(()=>{((l.current?.isConnected?l.current.querySelector('[data-testid="job-act"]'):null)??k?.querySelector('[data-testid="job-act"]')??k)?.focus()})},...r?{principal:r}:{}})}):null]})}var D=$(j(),1);function fs({violations:e}){let t=e.some(n=>n.status==="could-not-judge"||n.status==="over-budget");return(0,D.jsxs)(F,{to:"/problems","data-testid":"problems-here","data-graview-problems-tone":t?"error":"rule",style:{..._,color:t?"var(--graview-warn)":"var(--graview-ink-muted)"},children:[e.length===1?"A rule is broken":"Rules are broken"," \u2014 see what, and what would fix it"]})}function ys(e,t=5){let n=[],a=0;for(let r=e.length-1;r>=0;r--){let o=e[r];if(mt(o))a++;else if(n.length<t)n.push(o);else break}return{recent:n,kept:a}}function la({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:r}=e;ae(n);let o=n.violations(r),{recent:i,kept:s}=ys(n.log.all()),c=on(e).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(K=>et(n.schema.tryDefinition(C),K))})),u=c.filter(C=>C.members.length>0),w=c.map(C=>({entry:C,creator:n.allMutations().find(K=>(K.creates??[]).includes(C.kind)&&n.permits({name:K.name,args:{}},e.principal).ok)})).find(C=>C.creator!==void 0),p=u.length===0?"Nothing here yet.":`${u.map(C=>gt(n.schema,C.kind,C.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,y=e.views?.homeView?.(),L=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(y&&L){let C=[...new Set(o.flatMap(ke=>ke.nodeIds))],K=a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...R,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,Q=y[Symbol.for("graview.home-blocks")]===!0;return(0,D.jsx)(ie,{context:e,style:St,bleedTop:Ke(y),children:(0,D.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[Q?null:K,(0,D.jsx)(ao.Provider,{value:Q?K:null,children:(0,D.jsx)(Je,{when:Ke(y),children:(0,D.jsx)(y,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1,...C.length>0?{flagged:C}:{}})})})]})})}let m=new Set(Ge(n,e.principal)),k=ot(n).relations.filter(C=>m.has(C.from)&&(C.to==="*"||m.has(C.to))),M=Qo(e),I=M.some(C=>C.count>0),x=new Set([...No(e),...M.flatMap(C=>C.ids)]),W=o.filter(C=>C.nodeIds.some(K=>x.has(K))),A=u.length===0&&w!==void 0||W.length>0||o.length===0&&!I;return(0,D.jsxs)(ie,{context:e,style:St,children:[(0,D.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle&&a.subtitleDrawn!==!1?(0,D.jsx)("p",{style:{...R,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,I?null:(0,D.jsx)(se,{context:e,"data-testid":"standing",children:p}),A?(0,D.jsxs)("p",{style:{...le,display:"grid",gap:4},"data-testid":"standing-card",children:[u.length===0&&w?(0,D.jsxs)("span",{children:["Begin with \u201C",w.creator?.title??w.creator?.name,"\u201D, under"," ",(0,D.jsx)(F,{to:`/${U(n.schema,w.entry.kind)}`,style:_,children:J(n,w.entry.kind)}),"."]}):null,o.length===0?(0,D.jsx)("span",{children:"All rules hold."}):W.length>0?(0,D.jsx)(fs,{violations:W}):null]}):null]}),M.length>0?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Zo,{context:e,answered:M}),(0,D.jsxs)("section",{style:{display:"grid",gap:20},"data-testid":"after-the-jobs",children:[I?(0,D.jsxs)("p",{style:{...R,margin:0},"data-testid":"standing",children:[p,o.length===0?" All rules hold.":""]}):null,(0,D.jsx)(cn,{context:e,small:!0})]})]}):(0,D.jsx)(cn,{context:e}),(0,D.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"kinds",children:[(0,D.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,D.jsx)("h2",{style:ne,children:"What is here"}),k.length>0?(0,D.jsx)(F,{to:"/map",style:{...We,...R,marginLeft:"auto"},"data-testid":"map-link",children:(0,D.jsxs)(qe,{children:["Connections \xB7 ",k.length===1?"1 relation":`${k.length} relations`]})}):null]}),(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:C,members:K})=>(0,D.jsx)("li",{style:{maxWidth:"100%"},children:(0,D.jsxs)(F,{to:`/${U(n.schema,C)}`,style:{...ve,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,D.jsx)(ge,{kind:C,brand:a,schema:n.schema,size:7}),(0,D.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:J(n,C)}),(0,D.jsx)("span",{style:{...R,fontVariantNumeric:"tabular-nums"},children:K.length===0?"none yet":ut(K.length)})]})},C))})]}),i.length>0||s>0?(0,D.jsxs)("section",{style:{...de,display:"grid",gap:10},"data-testid":"recently",children:[(0,D.jsx)("h2",{style:ne,children:"Recently"}),i.length>0?(0,D.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:i.map(C=>(0,D.jsxs)("li",{style:R,"data-testid":"recently-row",children:[(0,D.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",Lt(C,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},C.id))}):null,s>0?(0,D.jsxs)("p",{style:{...R,margin:0},"data-testid":"recently-kept",children:[i.length>0?"and ":"",s===1?"1 change":`${ut(s)} changes`," kept from you"]}):null]}):null]})}var Xo=$(xe(),1);function ei(e,t){(0,Xo.useEffect)(()=>{let n=globalThis[Symbol.for("graview.shown-lists")]??=new Map;return n.set(e,()=>t),()=>void n.delete(e)})}var da=e=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(t=>t.saveShownList(e.read()));function ti(e,t,n){let a={off:e,about:t,read:n,menu:(r,o,i)=>[...e?[]:[{id:"export-csv",label:"Export CSV",run:()=>void da(a)}],...r&&o?[{id:e?"export-on":"export-off",label:e?"Turn on export":"Turn off export",run:()=>void (__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.6YGRRXJB.js")).then(s=>s.switchExport(a,o,e,i))}]:[]]};return a}function ca(e){let{schema:t,graph:n,kind:a,nodes:r,arrangement:o,offers:i,declaredGroup:s}=e,l=t.tryDefinition(a),c=Yt(o.query??""),u=[...o.filter??[],...c.conditions],w=u.some(A=>A.key==="is"&&(A.value==="past"||A.value==="any"))||Dr(l,u),p=w||!l?.lifecycle?o:{...o,filter:[...o.filter??[],{key:"is",value:"current"}]},y=new Map,L=Zt(r,p,{schema:t,graph:n,...e.flagged?{flagged:e.flagged}:{},...e.today!==void 0?{today:e.today}:{},read:(A,C)=>{let K=y.get(A.id);return K||y.set(A.id,K=nt(t,n,A)),K[C]}}),m=L.grouped&&!!o.group?.by,k=s&&o.group?.by===s.by&&!o.group.bucket?i.groups.find(A=>A.key===s.by):void 0,M=s&&k&&(k.type==="choice"||k.type==="boolean")?Ir(L.groups,s,{type:k.type,...k.options?{options:k.options}:{}}):L.groups.map(A=>({...A,closed:!1})),I=!!o.query||(o.filter??[]).some(A=>A.key===s?.by),x=A=>k?.type==="boolean"?A==="1"?"true":"false":A,W=e.opened??new Set,z=M.map(A=>{let C=x(A.key);return{...A,value:C,shut:A.closed&&!I&&!W.has(C)}});return{arrangement:p,showingPast:w,arranged:L,grouped:m,groups:z,nodes:m?z.flatMap(A=>A.shut?[]:A.nodes):L.nodes}}var Ne=$(xe(),1);var dt=$(j(),1);function fn({context:e,withheld:t,style:n,testId:a}){let r=ce(),o=Ba(t,e.signIn??r?.signIn);return o?(0,dt.jsx)("p",{style:{...n,margin:0},children:(0,dt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>o.run(),style:fe,children:o.label})}):t.length===0?null:(0,dt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:t.map(i=>(0,dt.jsxs)("li",{style:R,children:[(0,dt.jsx)("s",{children:i.label})," \u2014 ",i.refusal.message]},i.id))})}var ni=$(xe(),1);var N=$(j(),1);function pa({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ae(t);let[o]=vt(),i=o.get("q")??"",s=typeof r?.today=="string"?r.today:void 0,l=jr(t,i,{...a?{principal:a}:{},places:Fe(e),flagged:new Set(t.violations(r).flatMap(m=>m.nodeIds)),...s?{today:s}:{},limit:200}),c=l.hits.filter(m=>m.about==="node"),u=l.hits.filter(m=>m.about==="kind"||m.about==="place"||m.about==="rule"),w=[...new Set(c.map(m=>m.kind))],p=i.trim(),y=p.length>=2&&l.hits.length===0,L=l.searched.kinds.length===1?l.searched.kinds[0]:void 0;return(0,ni.useEffect)(()=>{if(!y)return;let m=setTimeout(()=>Va(t,{type:"search-miss",words:p,...L?{kind:L}:{}},a),hs);return()=>clearTimeout(m)},[t,p,y,L,a]),(0,N.jsxs)(ie,{context:e,children:[(0,N.jsx)("style",{children:bt}),(0,N.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,N.jsx)("p",{style:be,children:"Search"}),(0,N.jsx)(se,{context:e,"data-testid":"search-heading",children:p.length===0?"Find anything by its name":l.hits.length===0?(0,N.jsxs)(N.Fragment,{children:["Nothing here is called \u201C",p,"\u201D."]}):(0,N.jsxs)(N.Fragment,{children:[ws(t,l.byKind)," for \u201C",p,"\u201D"]})}),p.length>0?(0,N.jsxs)("p",{style:{...R,margin:0},"data-testid":"search-searched",children:[Qt(t.schema,l.searched),l.conditions.filter(m=>m.key!=="is"&&m.admittedBy.length<l.searched.kinds.length).map(m=>(0,N.jsxs)("span",{children:[" ",m.key,":",m.value," narrows"," ",m.admittedBy.length===0?"nothing here":m.admittedBy.map(k=>J(t,k).toLowerCase()).join(" and "),"."]},`${m.key}:${m.value}`))]}):(0,N.jsxs)("p",{style:le,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,N.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,N.jsx)("code",{children:"is:any"})," includes what is past."]})]}),u.length>0?(0,N.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:u.map(m=>(0,N.jsx)("li",{"data-testid":"search-hit","data-about":m.about,children:m.about==="kind"?(0,N.jsxs)(F,{to:`/${U(t.schema,m.kind)}`,style:_,children:[m.label,m.count>0?(0,N.jsxs)("span",{style:R,children:[" \xB7 ",m.count," match"]}):null]}):m.about==="place"?(0,N.jsxs)(F,{to:he(e,m),style:_,children:["Go to ",m.title]}):m.about==="rule"?(0,N.jsxs)(F,{to:"/problems",style:_,children:["The rule \u201C",m.label,"\u201D"]}):null},`${m.about}:${m.about==="rule"?m.name:m.about==="place"?m.as:m.kind}`))}):null,w.map(m=>(0,N.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":m,children:[(0,N.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,N.jsx)(ge,{kind:m,brand:n,schema:t.schema,size:8}),(0,N.jsx)(F,{to:`/${U(t.schema,m)}?${new URLSearchParams({q:p}).toString()}`,style:_,"data-testid":"search-kind-link",children:J(t,m)}),(0,N.jsx)("span",{children:l.byKind[m]})]}),(0,N.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===m).map(k=>(0,N.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,N.jsxs)(F,{to:X(t.schema,m,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,N.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,N.jsx)(yn,{why:k.why})]},k.id))})]},m)),p.length>0?(0,N.jsx)(Ss,{asked:p}):null,p.length>0&&l.hits.length===0?(0,N.jsx)(ri,{store:t,kinds:l.searched.kinds,words:l.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}var hs=1500;function yn({why:e}){return e.strength==="near"?(0,N.jsxs)("span",{style:R,"data-testid":"search-why","data-near":"",children:["Near \u201C",e.asked,"\u201D",e.field==="label"?"":` \u2014 ${e.reading}: ${e.fragment}`]}):e.field==="label"?null:(0,N.jsxs)("span",{style:R,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function ws(e,t){let n=Object.entries(t).map(([a,r])=>`${r} ${r===1?tt(e.schema.tryDefinition(a),a):J(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Ee(n[0]):Ee(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function ai(e,t,n={}){let a=[];for(let r of t){let o=rt(e,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let i of hn(e,r,o.actions.affordances))a.some(s=>s.mutation.name===i.mutation.name)||a.push(i)}return a}function hn(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,r=[];for(let o of n){let i=e.allMutations().find(c=>c.name===o.mutation);if(!i||!i.creates?.includes(t)||r.some(c=>c.mutation.name===i.name))continue;let s=$r(i.input).map(c=>c.name),l=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!l||o.args[l]!==void 0||r.push({kind:t,affordance:o,mutation:i,arg:l})}return r}function ri({store:e,kinds:t,words:n,principal:a,invariantContext:r}){let o=ai(e,t,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return o.length===0||n.trim().length===0?null:(0,N.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:o.map(({kind:i,affordance:s,mutation:l,arg:c})=>(0,N.jsxs)("section",{style:{...de,display:"grid",gap:14},children:[(0,N.jsxs)("h2",{style:ne,children:[Ee(Na(tt(e.schema.tryDefinition(i),i)))," called \u201C",n,"\u201D"]}),(0,N.jsx)(Te,{store:e,mutation:l,prefilled:s.args,open:s.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${s.id}|${n}`))})}function Ss({asked:e}){let t=ce();return t?(0,N.jsx)(bs,{asked:e,desk:t.aiDesk}):null}function bs({asked:e,desk:t}){return cr(t)?(0,N.jsx)("p",{style:{margin:0},children:(0,N.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>dr(t,{pointed:{about:[]},asked:e,returnTo:a.currentTarget}),style:{..._,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})}):null}var f=$(j(),1),ii=8,si=40;function vs(e,t){let n=t?.fields?.shape??{},a=Object.keys(n).find(r=>Ha(n[r])&&$a(e[r]));return a===void 0?void 0:e[a]}function ua({context:e}){let t=ze(),n=Pe(e.store.schema,t.slug??"");if(!n)return(0,f.jsx)(ie,{context:e,children:(0,f.jsx)(se,{context:e,children:"No such kind of thing here."})});let a=e.views?.lookup(n,{cardinality:"many",fidelity:"full"});return a!==void 0&&ht(a)?(0,f.jsx)(ks,{context:e,kind:n,view:a}):(0,f.jsx)(li,{context:e,kind:n})}function ks({context:e,kind:t,view:n}){let{store:a,invariantContext:r}=e;ae(a);let o=a.schema.tryDefinition(t),i=J(a,t),s=a.graph.nodesOfKind(t).filter(c=>et(o,c)),l=[...new Set(a.violations(r).flatMap(c=>c.nodeIds))];return(0,f.jsxs)(ie,{context:e,children:[(0,f.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,f.jsx)(it,{context:e}),(0,f.jsx)(se,{context:e,children:i})]}),(0,f.jsx)("section",{"data-testid":"list-view",style:{display:"grid",minWidth:0},children:(0,f.jsx)(Ct,{kind:t,view:i,children:(0,f.jsx)(Je,{when:Ke(n),children:(0,f.jsx)(n,{nodes:s,label:i,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...l.length>0?{flagged:l}:{}})})})})]})}function li({context:e,kind:t,opening:n,row:a,layout:r="list",description:o,bare:i}){let{store:s,brand:l,invariantContext:c}=e;ae(s);let[u,w]=vt(),p=`list-${(0,Ne.useId)().replace(/:/g,"")}`,y=s.schema.tryDefinition(t),L=Ia(u.get("archived")),m=s.graph.nodesOfKind(t,{archived:L}),k=ot(s).relations.filter(d=>d.from===t||d.to===t),M=new Set(s.violations(c).flatMap(d=>d.nodeIds)),I=Br(s.schema,Gr(s.schema,Wr(s.schema,t))),x=k.map(d=>d.edgeKind),W=Ls(u,I,x),z=["sort","filter","group","q","by","with","past","archived",...x].some(d=>u.has(d)),A=m.length>=si,C=y?.fieldRoles?.when,K=e.views?.arrangement?.()?.lists?.[t],Q=Fr(K),ke=Hr(K?.group),Re=Rs(A,C),Se=n??(Q?{...Re,...Q}:Re),Le=z?W.arrangement:Un(Se,I).arrangement,b=Q?.sort,S=Le.sort&&b?.then&&Le.sort.by===b.by&&Le.sort.direction===b.direction?{...Le,sort:b}:Le,E=Yt(S.query??""),H=new Set((u.get("open")??"").split(",").filter(Boolean)),ee=ca({schema:s.schema,graph:s.graph,kind:t,nodes:m,arrangement:S,offers:I,declaredGroup:ke,flagged:M,...typeof c?.today=="string"?{today:c.today}:{},opened:H}),{showingPast:te,arranged:g}=ee,O=ee.groups,Z=ce(),pe=ti(K?.export===!1,{kind:t},()=>({title:J(s,t),schema:s.schema,graph:s.graph,kind:t,groups:ee.groups,grouped:ee.grouped,onExport:e.onExport??Z?.onExport,words:{labelOf:oe,readableFields:zt,withComputed:nt}}));ei(`list:${t}`,pe);let fi=d=>d.shut,yi=d=>{let h=new URLSearchParams(u),G=new Set(H);G.has(d)?G.delete(d):G.add(d),G.size>0?h.set("open",[...G].join(",")):h.delete("open"),w(h,{replace:!0})},$e=g.nodes,Qe=y?.lifecycle&&!te?m.filter(d=>et(y,d)):m,ya=m.length-Qe.length,ha=S.group?.by??null,hi=d=>{let h=new URLSearchParams(u);for(let ue of["sort","filter","group","q","by","with","past","archived",...k.map(Bt=>Bt.edgeKind)])h.delete(ue);let G=Ur(d);for(let ue of["sort","filter","group","q","archived"])G[ue]&&h.set(ue,G[ue]);![...h.keys()].some(ue=>["sort","filter","group","q"].includes(ue))&&(n||Q||A||C)&&h.set("sort",""),w(h)},{principal:ct}=e,vn=rt(s,t,{...ct?{principal:ct}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Be=vn.actions.affordances.map(d=>({affordance:d,mutation:s.allMutations().find(h=>h.name===d.mutation)})).filter(d=>d.mutation!==void 0),wi=vn.actions.withheld,kn=()=>new Set($e.length===0?Be.map(({mutation:d})=>d.name):[]),[xn,wa]=(0,Ne.useState)(()=>({kind:t,open:kn()}));xn.kind!==t&&wa({kind:t,open:kn()});let Sa=d=>(xn.kind===t?xn.open:kn()).has(d),ba=(d,h)=>wa(G=>{let ue=new Set(G.open);return h?ue.add(d):ue.delete(d),{kind:G.kind,open:ue}}),va=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,ka=E.words&&$e.length===0?Object.fromEntries(hn(s,t,vn.actions.affordances).map(d=>[d.mutation.name,d.arg])):{},Ze=J(s,t),Ft=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),Pn=Ft!==void 0&&!yt(Ft)?Ft:void 0,An=(S.group?.bucket??"day")==="day"?S.group?.by:void 0,Cn=(S.filter??[]).map(d=>d.key),Si=Cn.filter(d=>Cn.indexOf(d)===Cn.lastIndexOf(d)&&/choice|boolean/.test(I.filters.find(h=>h.key===d)?.type??"")),Rn=d=>{let h={...y?.computed?nt(s.schema,s.graph,d):d};An&&!String(h[An]).includes("T")&&delete h[An];for(let G of Si)delete h[G];return h},xa=d=>br(y?.fields?.shape?.[d])?.type==="enum",It=d=>{let h=oe(y,d);if(a)return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{minWidth:0},...Nn(d.id),children:[On(d,h),a(d,{label:h,href:X(s.schema,t,d.id),flagged:M.has(d.id),glance:bo(Rn(d),y,h)})]},d.id);if(Pn){let $n=nn(Ft,d,s.graph),Ai=Object.fromEntries(Object.entries(Rn(d)).filter(([Ci])=>!$n?.fields.has(Ci))),Ta=$n?Tt(Ai,y,$n.title??h,xa):[];return(0,f.jsxs)("li",{"data-testid":"record-row","data-graview-record":d.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Nn(d.id),children:[On(d,h),(0,f.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,f.jsx)(Pn,{node:d,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...M.has(d.id)?{flagged:[d.id]}:{}})}),Ta.length>0?(0,f.jsx)("span",{style:{...R,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:(0,f.jsx)(Et,{runs:Ta})}):null,(0,f.jsx)(Ms,{to:X(s.schema,t,d.id),label:M.has(d.id)?`${h} \u2014 implicated in a problem`:h})]},d.id)}let G=Tt(Rn(d),y,h,xa),ue=G.length>0,Bt=E.words?Vr(y,d,E.words):void 0,Ra=A?void 0:kr(d,y),Kt=vs(d,y),La=(0,f.jsxs)(F,{to:X(s.schema,t,d.id),className:"graview-row-title",...h.length>60?{title:h}:{},children:[M.has(d.id)?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,h]});return(0,f.jsxs)("li",{className:"graview-row","data-graview-record":d.id,...Nn(d.id),children:[On(d,h),Ra?(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,f.jsx)(wt,{as:"thumb",file:Ra}),La]}):La,ue||Kt?(0,f.jsxs)("span",{className:"graview-row-glance",children:[(0,f.jsx)(Et,{runs:G}),ue&&Kt?" \xB7 ":null,Kt?(0,f.jsx)(Xt,{address:Kt}):null]}):null,Bt?(0,f.jsx)(yn,{why:Bt}):null]},d.id)},Ln=Fe(e).filter(d=>d.kind===t&&!d.hidden),Pa=K?.filters,bi=(S.filter??[]).some(d=>d.key!=="is"||d.value!=="any"),vi=!!(S.sort||S.group||S.query||bi),ki=Qe.length>=ii||z&&vi,Ie=S.sort?I.sorts.find(d=>d.key===S.sort.by):void 0,Tn=Ie?.type==="date"||Ie!==void 0&&Ie.key===C,Aa=A&&!g.grouped&&Ie&&(Ie.about==="label"||Ie.type==="text"||Tn)?d=>{let h=Ie.about==="label"?oe(y,d):d[Ie.key];if(typeof h!="string"||h.length===0)return Tn?"No date":"#";if(Tn)return h.slice(0,4);let G=h.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(G)?G:"#"}:void 0,Dt=Aa?$e.reduce((d,h)=>{let G=Aa(h);return d.at(-1)?.key===G?d.at(-1).nodes.push(h):d.push({key:G,nodes:[h]}),d},[]):void 0,Ca=ee.nodes,En=(0,Ne.useMemo)(()=>Ca.map(d=>d.id),[Ca.map(d=>d.id).join(`
|
|
6
|
+
`)]),He=Qr(En),Mn=(0,Ne.useId)(),xt=(ct?s.permittedMutations(ct):s.permittedMutations()).some(d=>{let h=d.subject?.kinds;return h!==void 0&&(h==="*"||h.includes(t))}),On=(d,h)=>xt?(0,f.jsx)("span",{className:"graview-choose-at",children:(0,f.jsx)("input",{...He.boxProps(d.id,h),onPointerEnter:_n,onFocus:_n})}):null,Nn=d=>xt?{"data-graview-choose":d}:{},xi=(0,Ne.useCallback)(d=>{He.choose(d),requestAnimationFrame(()=>{let h=He.list.current;((d[0]===void 0?null:h?.querySelector(`[data-graview-choose-box="${CSS.escape(d[0])}"]`))??h)?.focus({preventScroll:!0})})},[He]),pt=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||Pn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Wt=pt?void 0:"graview-rows",Pt=d=>`list-at-${d.replace(/[^\p{L}\p{N}]/gu,"_")}`,Gt=k.map(d=>{let h=d.from===t?d.to:d.from,G=d.from===t?d.description:d.inverse??d.description;return{relation:d,far:h,words:G}}),Pi=new Set(Gt.map(d=>(d.words??"").toLowerCase()).filter((d,h,G)=>d&&G.indexOf(d)!==h));return(0,f.jsxs)(i?Cs:ie,{context:e,children:[(0,f.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,f.jsxs)("header",{style:{display:"grid",gap:4},children:[i?null:(0,f.jsx)(it,{context:e}),(0,f.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,f.jsx)(ge,{kind:t,brand:l,schema:s.schema,size:8}),(0,f.jsx)(se,{context:e,children:Ze}),Be.length>0?(0,f.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Be.map(({affordance:d,mutation:h})=>(0,f.jsx)(Ts,{name:h.name,title:h.title??h.name,panel:`${va}-${h.name}`,open:Sa(h.name),onOpen:G=>ba(h.name,G)},d.id))}):null,!pe.off&&Qe.length>0?(0,f.jsxs)("button",{type:"button","data-testid":"list-export","aria-label":"Export CSV",title:"Export CSV",onClick:()=>void da(pe),style:{...ve,minHeight:28,margin:"-4px 0",...Be.length>0?{}:{marginLeft:"auto"},padding:"0 2px",border:0,background:"none",font:"inherit",color:"var(--graview-ink-muted)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:4},children:"\u2193"}),"CSV"]}):null]}),$e.length>0?(0,f.jsx)(ho,{place:"here",to:[{label:`Skip to the ${$e.length===1?tt(y,t):`${$e.length} ${Ze.toLowerCase()}`}`,testid:"records",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Mn)}"]`);zn(d?.querySelector('[data-graview-choose-box][tabindex="0"]')??d)}},...Qe.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let d=document.querySelector(`[data-graview-skip-target="${CSS.escape(Mn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');zn(d?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??d)}}]:[]]}):null,o??y?.description?(0,f.jsx)("p",{style:le,children:o??y?.description}):null,Gt.length>0||Ln.length>0?(0,f.jsxs)("p",{style:{...R,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Gt.length>0?(0,f.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Gt.map(({relation:d,far:h,words:G},ue)=>(0,f.jsxs)("span",{"data-relation":d.edgeKind,children:[ue>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,h==="*"?Ee(G??Xe(d.edgeKind)):(0,f.jsx)(F,{to:`/${U(s.schema,h)}`,style:_,title:J(s,h),children:G&&Pi.has(G.toLowerCase())?`${Ee(G)}: ${J(s,h).toLowerCase()}`:Ee(G??J(s,h))})]},`${d.edgeKind}|${d.from}|${d.to}`))]}):null,Ln.length>0?(0,f.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",Ln.map((d,h)=>(0,f.jsxs)("span",{children:[h>0?(0,f.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,f.jsx)(F,{to:he(e,d),style:_,children:d.title})]},st(d)))]}):null]}):null]}),Be.length>0?(0,f.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Be.map(({affordance:d,mutation:h})=>{let G=!!(ka[h.name]&&$e.length===0);return(0,f.jsx)(Es,{name:h.name,id:`${va}-${h.name}`,description:h.description,open:Sa(h.name),onClose:()=>ba(h.name,!1),children:(0,f.jsx)(Te,{store:s,mutation:h,prefilled:d.args,open:d.open,...G?{initial:{[ka[h.name]]:E.words}}:{},...e.principal?{principal:e.principal}:{}},G?`${h.name}|${E.words}`:h.name)},d.id)})}):null,W.dropped.length>0?(0,f.jsxs)("p",{style:{...R,margin:0},"data-testid":"list-dropped",children:["This link asked for ",W.dropped.join(", "),", which ",Ze.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,Qe.length>0?(0,f.jsx)(Jr,{schema:s.schema,graph:s.graph,kind:t,arrangement:S,onChange:hi,kept:{shown:$e.length,of:Qe.length},noun:{one:tt(y,t),many:Ze.toLowerCase()},...ki?{}:{allow:!1},...Pa?{filters:Pa}:{},offers:I,chips:{nodes:Qe,flagged:M,...typeof c?.today=="string"?{today:c.today}:{}},query:e.framed===!0&&e.barAbove!==!0}):null,(0,f.jsx)("style",{children:bt}),xt?(0,f.jsx)("style",{children:Zr+As}):null,(0,f.jsx)("div",{className:"graview-list","data-graview-skip-target":Mn,...xt?{...He.listProps,ref:He.list,tabIndex:-1,"data-graview-choosable":"","aria-label":He.chosen.length>0?`${Ze}, ${He.chosen.length} chosen`:Ze,role:"group"}:{},children:$e.length===0&&E.words?(0,f.jsxs)("p",{style:le,"data-testid":"none-yet",children:["Nothing here is called \u201C",E.words,"\u201D."," ",(0,f.jsx)("span",{style:R,"data-testid":"list-searched",children:Qt(s.schema,{kinds:[t],past:te})})," ",(0,f.jsx)(F,{to:"?",style:_,children:"Show every one"})]}):$e.length===0?(0,f.jsxs)("p",{style:le,"data-testid":"none-yet",children:[S.filter?.length||S.query?"None of them.":"None yet",!S.filter?.length&&!S.query&&Be.length>0?` \u2014 the first one starts above, with \u201C${Be[0]?.mutation.title??Be[0]?.mutation.name}\u201D.`:!S.filter?.length&&!S.query?".":"",S.filter?.length||S.query?(0,f.jsxs)(f.Fragment,{children:[" ",(0,f.jsx)(F,{to:"?",style:_,children:"Show every one"})]}):null]}):g.grouped&&ha?(0,f.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":ha,children:O.map(d=>{if(!d.closed)return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,f.jsxs)("h2",{className:"graview-group-head",children:[d.label," ",(0,f.jsx)("span",{children:d.nodes.length})]}),(0,f.jsx)("ul",{style:pt,className:Wt,"data-graview-rows":"",children:d.nodes.map(It)})]},d.key||"-");let h=fi(d),G=`${p}-${Pt(d.key||"none")}`;return(0,f.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":h?"shut":"open",children:[(0,f.jsx)("h2",{className:"graview-group-head",children:(0,f.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!h,"aria-controls":G,"data-testid":"list-group-toggle",onClick:()=>yi(d.value),children:[(0,f.jsx)("span",{"aria-hidden":"true",children:h?"\u25B8":"\u25BE"}),d.label," ",(0,f.jsxs)("span",{children:["\xB7 ",d.nodes.length]}),(0,f.jsxs)("span",{style:xs,children:[" ",d.nodes.length===1?tt(y,t):Ze.toLowerCase()]})]})}),(0,f.jsx)("ul",{id:G,style:h?{...pt,display:"none"}:pt,className:Wt,"data-graview-rows":"",hidden:h,children:h?null:d.nodes.map(It)})]},d.key||"-")})}):Dt&&Dt.length>1?(0,f.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ie?.type==="date"?"year":"letter",children:[(0,f.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...R,display:"flex",flexWrap:"wrap",gap:Ie?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Dt.map(d=>(0,f.jsx)("a",{href:`#${Pt(d.key)}`,onClick:h=>{h.preventDefault(),document.getElementById(Pt(d.key))?.scrollIntoView({block:"start"})},style:{...ve,minWidth:24,justifyContent:"center"},children:d.key},d.key))}),Dt.map(d=>(0,f.jsxs)("section",{"data-testid":"list-section","aria-labelledby":Pt(d.key),style:{display:"grid",gap:0},children:[(0,f.jsx)("h2",{id:Pt(d.key),className:"graview-group-head",children:d.key}),(0,f.jsx)("ul",{style:pt,className:Wt,"data-graview-rows":"",children:d.nodes.map(It)})]},d.key))]}):(0,f.jsx)("ul",{style:pt,className:Wt,"data-testid":"records","data-graview-rows":"",children:$e.map(It)})}),xt?(0,f.jsx)(Xr,{store:s,chosen:He.chosen,...ct?{principal:ct}:{},...c?{context:c}:{},anchor:Ps,of:En.length,onChooseAll:()=>He.choose(En),onClear:He.clear,onActed:xi}):null,ya>0?(0,f.jsxs)(F,{to:oi(u,"filter","is:any"),style:{..._,...R,justifySelf:"start"},"data-testid":"past-link",children:["+",ya," past"]}):null,L===!1&&s.graph.count(t,{archived:!0})>0?(0,f.jsxs)(F,{to:oi(u,"archived","true"),style:{..._,...R,justifySelf:"start"},"data-testid":"archived-link",children:["+",s.graph.count(t,{archived:!0})," archived"]}):null]}),(0,f.jsx)(fn,{context:e,withheld:wi,style:de,testId:"withheld"})]})}var xs={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Ps=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,As=`
|
|
7
|
+
.graview-list[data-graview-choosable]{outline:none}
|
|
8
|
+
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
9
|
+
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${qa.raised};display:flex;align-items:center}
|
|
10
|
+
@media (min-width: 900px) and (pointer: fine){
|
|
11
|
+
.graview-list [data-graview-choose]{padding-left:0}
|
|
12
|
+
.graview-choose-at{left:-34px}
|
|
13
|
+
}
|
|
14
|
+
@media (pointer: coarse){
|
|
15
|
+
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
16
|
+
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
17
|
+
}
|
|
18
|
+
`;function Cs({children:e}){return(0,f.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Rs=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function Ls(e,t,n){let a=Vt({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{},...e.get("archived")?{archived:e.get("archived")}:{}}),r=[...a.filter??[]],o=e.get("by"),i=a.group??(o?{by:o}:void 0);for(let l of n){let c=e.get(l);c&&r.push({key:l,value:c})}let s=e.get("with");return s&&r.push({key:s,value:"*"}),e.get("past")==="1"&&!r.some(l=>l.key==="is")&&r.push({key:"is",value:"any"}),Un({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...i?{group:i}:{},...a.archived!==void 0?{archived:a.archived}:{}},t)}function oi(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Ts({name:e,title:t,panel:n,open:a,onOpen:r}){return(0,f.jsxs)("button",{type:"button","data-testid":`act-open-${e}`,"data-graview-act":e,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ve,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,f.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),t]})}function Es({name:e,id:t,description:n,open:a,onClose:r,children:o}){return(0,f.jsxs)("div",{"data-testid":`act-${e}`,id:t,hidden:!a,onKeyDown:i=>{i.key==="Escape"&&(i.preventDefault(),r(),document.querySelector(`[aria-controls="${t}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,f.jsx)("p",{style:{...R,margin:0,maxWidth:"58ch"},children:n}):null,o]})}function Ms({to:e,label:t}){let n=(0,Ne.useRef)(null);return eo(n),(0,f.jsx)(F,{ref:n,to:e,"aria-label":t,style:{position:"absolute",inset:0,borderRadius:6}})}var Ue=$(xe(),1);var Ht=$(xe(),1);var B=$(j(),1);function ga({context:e}){let{store:t,brand:n,invariantContext:a,principal:r}=e;ae(t);let o=t.violations(a),i=t.allInvariants(),s=Ut(t,o),l=pr(t.schema,i);return(0,B.jsxs)(ie,{context:e,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,B.jsx)(se,{context:e,children:o.length===0?"All rules hold":"What is broken"}),(0,B.jsx)("p",{style:le,"data-testid":"problems-count",children:o.length===0?"Every declared rule is satisfied by what is here.":Da(o)})]}),(0,B.jsx)(Vo,{context:e}),s.map((c,u)=>{let w=c.nodeIds[0],p=w?t.graph.getNode(w):void 0;return(0,B.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:[c.line?null:(0,B.jsx)(wn,{violation:c,schema:t.schema,...n?{brand:n}:{}}),p?(0,B.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,B.jsx)(ge,{kind:p.kind,brand:n,schema:t.schema,size:7}),(0,B.jsx)(F,{to:X(t.schema,p.kind,p.id),style:_,children:oe(t.schema.tryDefinition(p.kind),p)})]}):null,c.line?(0,B.jsx)(wn,{violation:c,schema:t.schema,...n?{brand:n}:{}}):null,(0,B.jsx)(Sn,{store:t,repairs:c.repairs,...r?{principal:r}:{}})]},u)}),i.length>0?(0,B.jsxs)("section",{style:{...de,display:"grid",gap:12},"data-testid":"rules",children:[(0,B.jsx)("h2",{style:ne,children:"The rules"}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(c=>{let u=o.filter(y=>y.invariant===c.name).length,w=l.get(c.name),p=c.label??c.name;return(0,B.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,B.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[w?(0,B.jsx)(_t,{line:w,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,B.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:p}),(0,B.jsx)("span",{style:{...R,color:u>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:u===0?"holds":`broken in ${u} ${u===1?"place":"places"}`})]}),w&&p.trim().length>0?(0,B.jsx)("span",{style:R,children:p}):null]},c.name)})})]}):null]})}function wn({violation:e,schema:t,brand:n}){if(!e.line)return(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=gr(e),r=ur(e);return r?(0,B.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,B.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,B.jsx)("span",{style:R,children:a}):null,(0,B.jsxs)("details",{"data-testid":"problem-judged",style:R,children:[(0,B.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,B.jsx)(_t,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none"})]})]}):(0,B.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,B.jsx)(_t,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,B.jsx)("span",{style:R,children:a}):null]})}function Sn({store:e,repairs:t,principal:n}){let[a,r]=(0,Ht.useState)(null),[o,i]=(0,Ht.useState)(null),s=(0,Ht.useRef)([]);if(t.length===0)return null;let l=a===null?null:t[a],c=l&&(l.missing??[]).length>0?e.allMutations().find(u=>u.name===l.mutation):void 0;return(0,B.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,B.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((u,w)=>{let p=(u.missing??[]).length>0,y=e.permits({name:u.mutation,args:{...u.args}},n);return y.ok?(0,B.jsx)("button",{ref:L=>{s.current[w]=L},type:"button","data-graview-repair":u.mutation,"data-graview-asks":p||void 0,"aria-expanded":p?a===w:void 0,onClick:()=>{if(i(null),p){r(a===w?null:w);return}r(null);try{e.apply({name:u.mutation,args:{...u.args}},n?{author:n}:{})}catch(L){i(Jt(e.schema,e.allMutations(),L))}},style:fe,children:p?`${u.label} \u2026`:u.label},w):(0,B.jsxs)("p",{"data-testid":"withheld","data-withheld":y.refusal.wouldNeed.join(",")||"nobody",style:{...R,margin:0},children:[(0,B.jsx)("s",{children:u.label})," \u2014 ",y.refusal.message]},w)})}),c&&l?(0,B.jsx)(Te,{store:e,mutation:c,prefilled:{...l.args},only:l.missing??[],label:l.label,autoFocus:!0,onDone:()=>{let u=a;r(null),requestAnimationFrame(()=>{let w=u===null?null:s.current[u];if(w?.isConnected){w.focus();return}let p=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");p&&(p.hasAttribute("tabindex")||(p.tabIndex=-1),p.focus())})},...n?{principal:n}:{}}):null,l&&!c&&(l.missing??[]).length>0?(0,B.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Jn},children:["\u201C",l.label,"\u201D names ",l.mutation,", which this app does not declare."]}):null,o?(0,B.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Jn},children:o}):null]})}var ma=$(xe(),1);var Ye=$(j(),1);function di({store:e,link:t,principal:n}){let[a,r]=(0,ma.useState)(!1),[o,i]=(0,ma.useState)(null),s=hr(t);return(0,Ye.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Ye.jsx)("button",{type:"button","data-graview-provisional":"",title:s,"aria-label":`Unsure link: ${s}`,"aria-expanded":a,onClick:()=>r(!a),style:{border:"1px dashed var(--graview-ink-muted)",borderRadius:999,background:"transparent",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"0.75rem",lineHeight:1,padding:"2px 6px",cursor:"pointer"},children:"unsure"}),a?(0,Ye.jsxs)("span",{style:{...R,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Ye.jsx)("span",{children:s}),(0,Ye.jsx)("button",{type:"button",style:{...fe,padding:"4px 10px"},onClick:()=>{try{e.apply({name:Wa,args:{kind:t.edge.kind,from:t.edge.from,to:t.edge.to}},n?{author:n}:{}),r(!1)}catch(l){i(Jt(e.schema,e.allMutations(),l))}},children:"Keep this link"}),o?(0,Ye.jsx)("span",{role:"alert",children:o}):null]}):null]})}var we=$(j(),1);function ci({nodeId:e,node:t,field:n,inPlace:a,labelStyle:r=be}){return n.files?(0,we.jsx)(wt,{as:"field",read:!a,nodeId:e,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,we.jsx)(zr,{nodeId:e,field:n.key,label:n.label,value:n.value,markdown:n.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:r,valueStyle:{lineHeight:1.6}}):(0,we.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,we.jsx)("dt",{style:r,children:n.label}),(0,we.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,we.jsx)(Lr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:e,field:n.key}:{}}):n.app?(0,we.jsx)(Xt,{address:n.app,as:"record",...a?{nodeId:e,field:n.key}:{}}):n.href?(0,we.jsx)(_r,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:e}:{}}):a?(0,we.jsxs)(we.Fragment,{children:[(0,we.jsx)(en,{nodeId:e,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,we.jsx)(Tr,{nodeId:e,field:n.key,start:t?.[n.key],value:t?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var v=$(j(),1),Os=[];function fa({context:e}){let{store:t,brand:n,principal:a,invariantContext:r}=e;ae(t);let o=ce()!==null,i=ze(),s=decodeURIComponent(i.id??""),l=ln(t,s,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ut(t,l?.violations??Os),[u,w]=(0,Ue.useState)(null),[p,y]=(0,Ue.useState)(!1),[L,m]=(0,Ue.useState)(null),k=(0,Ue.useRef)(null),M=(0,Ue.useRef)(null),I=Er({flow:"both",letters:!0}),x=g=>{(k.current?.parentElement?.querySelector(`[data-affordance="${g.replace(/["\\]/g,"\\$&")}"]`)??k.current)?.focus()};if(!l)return(0,v.jsx)(ie,{context:e,children:(0,v.jsx)(se,{context:e,children:"Nothing lives at this address."})});let W=t.graph.getNode(s),z=t.schema.tryDefinition(l.kind),A=z?.describe&&W?fr(z,W):null,C=[...t.log.all()].filter(g=>!mt(g)&&(g.writes.includes(s)||g.reads.includes(s))).slice(-8).reverse(),K=t.log.all().find(g=>!mt(g)&&g.undoes===void 0&&g.primitives.some(O=>O.op==="add-node"&&O.node.id===s)),Q=l.actions.affordances.filter(g=>g.provider!=="invariant"),ke=Q.filter(g=>g.destructive||g.setsAside),Re=p||ke.length<2?Q:Q.filter(g=>!ke.includes(g)),Se=e.views?.lookup(l.kind,{cardinality:"one",fidelity:"full"}),Le=Se!==void 0&&!yt(Se)?Se:void 0,b=Le&&W?nn(Se,W,t.graph):void 0,S=b?l.fields.filter(g=>!b.fields.has(g.key)):l.fields,E=b?l.links.flatMap(g=>{let O=g.targets.filter(Z=>!b.records.has(Z.id));return O.length>0?[{...g,targets:O}]:[]}):l.links,H=Le!==void 0&&ht(Se),ee=o&&vr(z).length>0,te=Fe(e).filter(g=>!g.hidden&&(g.kind===l.kind||g.across===l.kind));return(0,v.jsxs)(ie,{context:e,children:[(0,v.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,v.jsx)(it,{context:e}),(0,v.jsx)(se,{context:e,children:o&&W?.label===l.label?(0,v.jsx)(en,{nodeId:s,field:"label",value:l.label,said:l.label}):l.label}),A&&A!==l.label?(0,v.jsx)("p",{style:le,children:A}):null,K?.lineage?(0,v.jsxs)("p",{style:{...R,margin:0},"data-testid":"record-lineage",children:["Made by ",Lt(K,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}}),", ",Bn(K.lineage)]}):null,(0,v.jsx)(Qn,{context:e,stop:`#focus=${encodeURIComponent(s)}`,style:{...We,...R},"data-testid":"spatial-link"}),o&&W?(0,v.jsx)(qn,{choices:[{on:"changed",record:s},{on:"act",record:s},{on:"reaches",kind:l.kind,condition:"",record:s}],label:"Notify me when this changes",testId:"record-notify",style:{...fe,...R,justifySelf:"start"}}):null,te.length>0?(0,v.jsx)(Ns,{context:e,places:te}):null]}),W&&Fa(W)?(0,v.jsx)(Fs,{context:e,id:s,kind:l.kind}):null,W&&Ga(t,s)?(0,v.jsx)(Hs,{context:e,id:s,kind:l.kind}):null,Le&&W?(0,v.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,v.jsx)(to,{children:(0,v.jsx)(Je,{when:Ke(Se),children:(0,v.jsx)(Le,{node:W,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...l.violations.length>0?{flagged:[s]}:{}})})})}):null,l.violations.length>0?(0,v.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",border:"1px solid var(--graview-edge)",background:"var(--graview-panel-warning)",borderRadius:"var(--graview-radius, 12px)"},children:c.map((g,O)=>(0,v.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,v.jsx)(wn,{violation:g,schema:t.schema,...n?{brand:n}:{}}),(0,v.jsx)(Sn,{store:t,repairs:Lo(l.actions,g.repairs),...a?{principal:a}:{}})]},O))}):null,!H&&(S.length>0||ee)?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,v.jsx)("h2",{style:ne,children:"The facts"}),yr(z,S).map((g,O)=>{let Z=(0,v.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:g.fields.map(pe=>(0,v.jsx)(ci,{nodeId:s,node:W,field:pe,inPlace:o},pe.key))});return g.title?(0,v.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,v.jsx)("h3",{"data-graview-field-group":g.title,style:{...ne,fontSize:"inherit"},children:g.title}),Z]},O):(0,v.jsx)("div",{children:Z},O)}),ee?(0,v.jsx)(wt,{as:"unfilled",nodeId:s,skip:[...b?.fields??[]],labelStyle:be,style:{gap:4}}):null]}):null,(H?[]:E).map(g=>(0,v.jsxs)("section",{style:{...de,display:"grid",gap:10},children:[(0,v.jsx)("p",{style:be,children:So(t,g)}),g.description?(0,v.jsx)("h2",{style:ne,children:Ee(g.description)}):(0,v.jsxs)("h2",{style:ne,"aria-label":Xe(g.edgeKind),children:[g.direction==="in"?"\u2190 ":"\u2192 ",Xe(g.edgeKind)]}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:g.targets.map(O=>{let Z=wr(t,g.direction==="in"?{kind:g.edgeKind,from:O.id,to:s}:{kind:g.edgeKind,from:s,to:O.id});return(0,v.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,v.jsx)(ge,{kind:O.kind,brand:n,schema:t.schema,size:7}),(0,v.jsxs)(F,{to:X(t.schema,O.kind,O.id),style:_,children:[O.label,O.apart?(0,v.jsxs)("span",{style:R,children:[" \xB7 ",O.apart]}):null]}),Z?.provisional?(0,v.jsx)(di,{store:t,link:Z,...a?{principal:a}:{}}):null]},O.id)})}),(g.direction==="out"&&t.schema.edge(g.edgeKind)?.cardinality==="one"?[]:[...new Set(g.targets.map(O=>O.kind))]).map(O=>(0,v.jsx)(F,{to:`/${U(t.schema,O)}?${encodeURIComponent(g.edgeKind)}=${encodeURIComponent(s)}`,style:{...We,...R},"data-testid":"related-all",children:(0,v.jsxs)(qe,{children:["Sort and filter ",g.description??`these ${J(t,O).toLowerCase()}`,g.targets.some(Z=>Z.kind!==O)?` (${J(t,O).toLowerCase()})`:""]})},O))]},`${g.edgeKind}|${g.direction}|${g.description??""}`)),!H&&(Q.length>0||l.actions.withheld.length>0)?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,v.jsx)("h2",{style:ne,ref:k,tabIndex:-1,children:"What can be done"}),(0,v.jsxs)("div",{role:"toolbar","aria-label":"What can be done",...I,style:{display:"flex",flexWrap:"wrap",gap:8},children:[Re.map(g=>{let O=u===g.id;return(0,v.jsx)("button",{type:"button","data-affordance":g.id,"data-rank":g.rank,"data-graview-act":g.mutation,[Kn]:"",autoFocus:p&&g===ke[0],"aria-expanded":O,onClick:()=>w(O?null:g.id),style:{...fe,...O?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:g.label},g.id)}),Re.length<Q.length?(0,v.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>y(!0),style:{...fe,...R},"data-testid":"record-actions-more",[Kn]:"",children:["Show ",Q.length-Re.length," more"]}):null]}),Q.map(g=>{if(u!==g.id)return null;let O=t.allMutations().find(Z=>Z.name===g.mutation);return O?(0,v.jsxs)("div",{ref:M,onKeyDown:Z=>{if(Z.key!=="Escape"||Z.defaultPrevented)return;Z.preventDefault(),w(null);let pe=g.id;requestAnimationFrame(()=>x(pe))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsx)("h3",{style:ne,children:g.label}),O.description?(0,v.jsx)("p",{style:{...R,margin:0},children:O.description}):null,(0,v.jsx)(Te,{store:t,mutation:O,prefilled:g.args,open:g.open,label:g.label,autoFocus:!0,onDone:()=>{w(null),m(g.mutation);let Z=g.id;requestAnimationFrame(()=>x(Z))},...a?{principal:a}:{}})]},g.id):null}),o&&L!==null&&u===null?(0,v.jsx)(qn,{choices:[{on:"act",act:L,record:s},{on:"act",act:L}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...fe,...R,justifySelf:"start"}}):null,(0,v.jsx)(fn,{context:e,withheld:l.actions.withheld})]}):null,o?(0,v.jsx)(wo,{id:s,style:de,headingStyle:ne}):null,C.length>0?(0,v.jsxs)("section",{style:{...de,display:"grid",gap:10},"data-testid":"record-history",children:[(0,v.jsx)("h2",{style:ne,children:"What has happened"}),(0,v.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:C.map(g=>(0,v.jsxs)("li",{style:R,children:[(0,v.jsx)("span",{style:{color:"var(--graview-ink)"},children:g.intent}),g.lineage?(0,v.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Bn(g.lineage)]}):null," \u2014 ",Lt(g,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},g.id))})]}):null]})}function Ns({context:e,places:t}){let[n,a]=(0,Ue.useState)(!1),r=(0,Ue.useRef)(null),o=n||t.length<=bn+1?0:t.length-bn;return(0,v.jsxs)("p",{ref:r,style:{...R,margin:0},"data-testid":"seen-in",...n?{"data-open":""}:{},children:["Seen in:"," ",t.map((i,s)=>(0,v.jsxs)("span",{...o>0&&s>=bn?{"data-graview-later":""}:{},children:[s>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(F,{to:he(e,i),style:_,children:i.title})]},st(i))),o>0?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsxs)("button",{type:"button","data-graview-seen-more":"","aria-expanded":"false",style:{..._,...R,font:"inherit",background:"none",border:0,padding:0,cursor:"pointer"},onClick:()=>{a(!0),requestAnimationFrame(()=>r.current?.querySelectorAll("a")[bn]?.focus())},children:[o," more"]}),(0,v.jsx)("style",{children:$s})]}):null]})}var bn=3,$s="[data-graview-seen-more]{display:none!important}@media (max-width:680px){[data-graview-seen-more]{display:inline!important}[data-testid=seen-in] [data-graview-later]{display:none}}";function Hs({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`allow-tidying-${n}`,args:{id:t}},i=a.allMutations().some(s=>s.name===o.name)&&a.permits(o,r).ok;return(0,v.jsxs)("section",{"data-testid":"record-left-alone",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"allow-tidying",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Fs({context:e,id:t,kind:n}){let{store:a,principal:r}=e,o={name:`unarchive-${n}`,args:{id:t}},i=a.allMutations().some(c=>c.name===o.name)&&a.permits(o,r).ok,s=[...a.log.all()].reverse().find(c=>!mt(c)&&c.mergedInto!==void 0&&c.writes.includes(t)),l=s?.mergedInto!==void 0?a.graph.getNode(s.mergedInto):void 0;return(0,v.jsxs)("section",{"data-testid":"record-archived",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12,padding:"12px 16px",border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,v.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,v.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",l?(0,v.jsxs)(v.Fragment,{children:[" ","Merged into ",(0,v.jsx)(F,{to:X(a.schema,l.kind,l.id),style:_,children:oe(a.schema.tryDefinition(l.kind),l)}),"."]}):null]}),i?(0,v.jsx)("button",{type:"button",style:fe,"data-testid":"bring-it-back",onClick:()=>a.apply(o,r?{author:r}:{}),children:"Bring it back"}):null]})}var P=$(j(),1),Is=jt(()=>(__graviewPreload(import.meta.url,["./chunk.YP2QSPXU.js","./chunk.VIH5AX7S.js","./chunk.Q355UPFG.js","./chunk.VC3V7HLL.js","./chunk.ELTV44HU.js","./chunk.CY3ELWCM.js","./chunk.I77ZGIFE.js","./chunk.OWOOKLIU.js","./chunk.RD2X25XB.js","./chunk.KMV6PJFL.js","./chunk.SWMDFXUX.js","./chunk.A3ZC2JBO.js","./chunk.NAD7ZXYP.js","./chunk.2GEJNG2U.js","./chunk.4TX6VCBT.js","./chunk.TIALD6SC.js","./chunk.66P5IDTH.js","./chunk.UQQKDBIH.js","./chunk.AJSUHPBE.js","./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.CAKFNKN5.js")).then(e=>({default:e.DraftPage}))),Ds={kind:"human"};function Ws({list:e,store:t}){let n=new Set(e.members.map(i=>i.kind)),a=e.total-e.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let o=_e(t.schema,r).toLowerCase();return(0,P.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,P.jsx)(F,{to:`/${U(t.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:e.total===t.graph.nodesOfKind(r).length?`See all ${ut(e.total)} ${o}`:`${ut(a)} more \xB7 all ${o}`})})}function Gs({context:e,children:t}){let n=Ve(),a=e.store.schema,r=at("/").replace(/\/$/,""),o=(0,V.useMemo)(()=>({href:i=>`${r}${X(a,i.kind,i.id)}`,go:i=>n(X(a,i.kind,i.id)),more:i=>(0,P.jsx)(Ws,{list:i,store:e.store})}),[r,a,n,e.store]);return(0,P.jsx)(tn.Provider,{value:o,children:(0,P.jsx)(no.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}var ui=(0,V.createContext)(void 0);function Bs({steering:e}){let t=ye(),n=Ve(),a=`${t.pathname}${t.search}`;return(0,V.useLayoutEffect)(()=>e.at(a),[a,e]),(0,V.useLayoutEffect)(()=>{let r=i=>{i!==a&&n(i)};e.go.current=r;let o=e.pending?.current;return o!==void 0&&(e.pending.current=void 0,r(o)),()=>{e.go.current===r&&(e.go.current=void 0)}},[a,n,e]),null}function Ks({context:e,to:t}){let{pathname:n}=ye(),a=ce(),r=(t??a)?.sayWhere,o=qs(e,n);return(0,V.useEffect)(()=>(r?.(o),()=>r?.(null)),[r,o]),null}function qs(e,t){let[n="",a,r]=t.split("/").filter(Boolean).map(i=>{try{return decodeURIComponent(i)}catch{return i}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===ft)return"#overview=1";let i=e.views?.places().find(s=>s.as===a);return i?`#focus=${encodeURIComponent(De(i.kind))}&view=${encodeURIComponent(i.as)}`:"#"}let o=Pe(e.store.schema,n);return o?`#focus=${encodeURIComponent(a??De(o))}`:"#"}function Vs({onNavigate:e,path:t}){let n=ye(),a=Zn(),r=Ve(),o=n.hash&&!n.hash.includes("=")?n.hash:"",i=`${n.pathname}${n.search}${o}`,s=(0,V.useRef)(e);s.current=e;let l=(0,V.useRef)(null);(0,V.useEffect)(()=>{let u=l.current;l.current=i,u!==null&&(i===u&&a!=="PUSH"||s.current?.(i,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,V.useRef)(t);return(0,V.useEffect)(()=>{t===void 0||t===c.current||(c.current=t,t!==i&&r(t))},[t]),null}function pi({context:e,registry:t,page:n}){let a=ze(),r=Pe(e.store.schema,a.slug??""),o=n==="list"?ua:fa,s=(r?t?.lookup(r,n):void 0)??o;return(0,P.jsx)(s,{context:e})}function js({context:e,registry:t,children:n}){let a=(0,V.useRef)(null);return lr(a),(0,P.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,P.jsx)(Wo,{context:e,registry:t,root:a,children:(0,P.jsx)(Bo,{context:e,root:a,children:n})})})}function Us(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="SELECT"?!0:e.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(e.type):!1}function _s(){let{pathname:e}=ye(),t=Zn(),n=(0,V.useRef)(null);(0,V.useLayoutEffect)(()=>{if(t!=="POP"){for(let o=n.current?.parentElement;o;o=o.parentElement){let{overflowY:i}=getComputedStyle(o);if((i==="auto"||i==="scroll")&&o.scrollHeight>o.clientHeight){o.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,V.useRef)(e),r=(0,V.useRef)(!1);return(0,V.useEffect)(()=>{if(!r.current&&e===a.current)return;r.current=!0;let o=document.activeElement;if(Us(o))return;let i=n.current?.closest("main")??document.querySelector("main"),l=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??i?.querySelector("h1, h2")??null??i??null;l&&(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus({preventScroll:!0}))},[e]),(0,P.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function gi({context:e,children:t}){let n=Ve(),a=at("/").replace(/\/$/,""),r=(0,V.useContext)(ui),o=(0,V.useMemo)(()=>{let i=(u,w)=>{if("record"in u){let p=e.store.graph.getNode(u.record);return p?Rt(X(e.store.schema,p.kind,u.record),{section:w?.section}):void 0}if("place"in u){if(u.place===Ua)return Rt("/",{section:w?.section});if(u.place===ft)return At;let p=e.views?.places().find(y=>y.as===u.place);return p?Rt(he(e,p),w):void 0}return e.store.schema.tryDefinition(u.list)?Rt(`/${U(e.store.schema,u.list)}`,w):void 0},s=u=>{u!==void 0&&n(u)},l=()=>{if(e.overview)return e.overview();e.embedded||window.location.assign(e.sceneHref??"/")},c=()=>e.overview?r===!1?void 0:r?r(At):`${a}${At}`:e.embedded?void 0:e.sceneHref??"/";return{record:(u,w)=>s(i({record:u},w)),place:(u,w)=>u===ft?l():s(i({place:u},w)),list:(u,w)=>s(i({list:u},w)),draft:()=>n("/~draft"),href:(u,w)=>{if("place"in u&&u.place===ft)return c();let p=r===!1?void 0:i(u,w);if(p!==void 0)return r?r(p):`${a}${p}`}}},[e,n,a,r]);return(0,P.jsx)(sr.Provider,{value:o,children:t})}function zs(){let{pathname:e,search:t,hash:n}=ye();return(0,V.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return Ho(a)},[e,t,n]),null}function Js({context:e,Home:t}){let n=ye(),a=e.views,r=n.key==="default"&&!(a&&or(a));(0,V.useEffect)(()=>{a&&ir(a)},[a]);let o=r?_a(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,i=o?.to==="place"?he(e,o.place):o?.to==="kind"?`/${U(e.store.schema,o.kind)}`:void 0;return i?(0,P.jsx)(Xn,{to:i,replace:!0}):(0,P.jsx)(t,{context:e})}function mi({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,r=a&&(t?.without().has("bar")??!1),o=a&&!r&&!e.embedded?{...e,barAbove:!0}:e,i=m=>n===void 0?(0,P.jsx)(sn,{context:e,children:m}):r?(0,P.jsx)(n,{context:e,children:m}):(0,P.jsx)(sn,{context:e,children:(0,P.jsx)(n,{context:o,children:m})}),s=t?.lookupSurface("home")??la,l=t?.lookupSurface("problems")??ga,c=a?{...o,framed:!0}:e,[u,w]=(0,V.useState)(null),p=(0,V.useMemo)(()=>({context:c,registry:t}),[c,t]),y=(0,V.useMemo)(()=>({onFind:w,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),L=(0,P.jsx)(ta.Provider,{value:p,children:(0,P.jsx)(gi,{context:e,children:(0,P.jsx)(js,{context:e,registry:t,children:i((0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Sr,{face:"pages"}),(0,P.jsxs)(Gs,{context:c,children:[(0,P.jsx)(_s,{}),(0,P.jsx)(zs,{}),(0,P.jsxs)(Po,{children:[(t?.routes()??[]).map(({path:m,component:k})=>(0,P.jsx)(Me,{path:m,element:(0,P.jsx)(k,{context:c})},m)),(0,P.jsx)(Me,{path:"/",element:(0,P.jsx)(Js,{context:c,Home:s})}),(0,P.jsx)(Me,{path:"/problems",element:(0,P.jsx)(l,{context:c})}),(0,P.jsx)(Me,{path:"/~draft",element:(0,P.jsx)(V.Suspense,{fallback:null,children:(0,P.jsx)(Is,{context:c})})}),(0,P.jsx)(Me,{path:"/search",element:(0,P.jsx)(pa,{context:c})}),(0,P.jsx)(Me,{path:"/map",element:(0,P.jsx)(sa,{context:c})}),(0,P.jsx)(Me,{path:"/places",element:(0,P.jsx)(oa,{context:c})}),Fe(c).some(m=>m.as===ft)?null:(0,P.jsx)(Me,{path:At,element:(0,P.jsx)(Xn,{to:"/",replace:!0})}),(0,P.jsx)(Me,{path:"/places/:as",element:(0,P.jsx)(ia,{context:c})}),(0,P.jsx)(Me,{path:"/:slug",element:(0,P.jsx)(pi,{context:c,registry:t,page:"list"})}),(0,P.jsx)(Me,{path:"/:slug/:id",element:(0,P.jsx)(pi,{context:c,registry:t,page:"record"})})]})]})]}))})})});return e.embedded||!a||r?L:(0,P.jsx)(Ro.Provider,{value:y,children:(0,P.jsx)(Kr.Provider,{value:u,children:L})})}var Ys=()=>typeof document>"u"?null:document.body;function Qs({context:e,registry:t,basename:n,initialPath:a,onNavigate:r,path:o,steering:i,firstLook:s,hrefOf:l,typing:c}){let[u,w]=(0,V.useState)(void 0),p=u!==void 0&&u.from===e.principal?{...e,principal:u.seat}:e;(0,V.useState)(()=>p.views?oo(p.views,p.store.schema,jn(p.brand,p.store.schema)):void 0);let y=ce(),L=c??p.typing;Ea({reader:p.locale??y?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??y?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let m=p.principal??Ds,k=tr(p.store,m,p.history),I=(k.past&&k.live===p.store?k.past.store:p.store).seenBy(m),x=I===p.store?p:{...p,store:I};nr(p.store,p.principal);let W=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Vs,{onNavigate:r,path:o}),i?(0,P.jsx)(Bs,{steering:i}):null,x.presence||y?(0,P.jsx)(Ks,{context:x,to:y}):null,(0,P.jsx)(mi,{context:x,...t?{registry:t}:{}}),s?(0,P.jsx)(io,{firstLook:s,root:Ys,app:jn(p.brand,p.store.schema)}):null]}),z=x.views?(0,P.jsxs)(ar,{store:x.store,views:x.views,...x.principal?{principal:x.principal}:{},...x.brand?{brand:x.brand}:{},...x.locale?{locale:x.locale}:{},...x.timeZone?{timeZone:x.timeZone}:{},...x.settings?{settings:x.settings}:{},...x.presence&&!y?{presence:x.presence}:{},...L?{typing:L}:{},...x.people?{people:x.people}:{},...x.seats?{seats:x.seats}:{},onSeat:Q=>y?y.takeSeat(Q):w({from:e.principal,seat:Q}),...x.onKeepLens?{onKeepLens:x.onKeepLens}:{},...x.onProposeChange?{onProposeChange:x.onProposeChange}:{},...x.onExport?{onExport:x.onExport}:{},...x.ai?{ai:x.ai}:{},...x.subscriptions?{subscriptions:x.subscriptions}:{},dismissals:x.dismissals,whileAway:x.whileAway,...x.signIn?{signIn:x.signIn}:{},resolveApp:x.resolveApp??y?.resolveApp,linkedRecords:x.linkedRecords??y?.linkedRecords,...x.app?{app:x.app}:{},...x.menuSections?{menuSections:x.menuSections}:{},children:[W,(0,P.jsx)(gi,{context:x,children:(0,P.jsx)(Fo,{context:x})})]}):W,A=(0,P.jsx)(er.Provider,{value:k,children:z}),C=x.files?(0,P.jsx)(Xa.Provider,{value:x.files,children:A}):A,K=l===void 0?C:(0,P.jsx)(ui.Provider,{value:l,children:C});if(a!==void 0){let Q=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,P.jsx)(xo,{initialEntries:[Q],...n===void 0?{}:{basename:n},children:K})}return(0,P.jsx)(Ao,{...n===void 0?{}:{basename:n},children:K})}export{Wi as a,Qs as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.WVUJXDXZ.js";import{k as m,m as i}from"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.ACTXR2MI.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";function a(t){let r=new Map;return(s,o)=>{let e=o.kind,n=r.get(e);return n===void 0&&r.set(e,n=i(t,e).length),n===0?{}:m(t,s,o).values}}export{a as computedOn};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ke,b as Pe,c as Se,d as se,e as Y}from"./chunk.TKUNRFDE.js";import{c as B,e as ae}from"./chunk.
|
|
1
|
+
import{a as ke,b as Pe,c as Se,d as se,e as Y}from"./chunk.TKUNRFDE.js";import{c as B,e as ae}from"./chunk.2N4Z5K5S.js";import{a as ie}from"./chunk.DDUCIUVW.js";import{G as ne,T as te,ba as re,da as oe}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{Z as _,gd as ee,ja as Z}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import{b as A}from"./chunk.AJZBJBMO.js";var f=A(ne(),1);var P=A(ne(),1),$e=(e,n)=>`graview:last-visit:${n??"anyone"}:${e.join(",")}`;function Ee(e,n,r){let t=new Set;for(let o of e)if(!(o.author.id!==void 0&&o.author.id===r)&&Date.parse(o.at)>n)for(let i of o.writes)t.add(i);return t}function le(e,n,r){let t=$e(n,r?.id),[o]=(0,P.useState)(()=>{try{let i=globalThis.localStorage?.getItem(t);return i?Number(i):null}catch{return null}});return(0,P.useEffect)(()=>{let i=()=>{if(document.visibilityState==="hidden")try{globalThis.localStorage?.setItem(t,String(Date.now()))}catch{}};return document.addEventListener("visibilitychange",i),window.addEventListener("pagehide",i),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("pagehide",i)}},[t]),(0,P.useMemo)(()=>o===null?new Set:Ee(e,o,r?.id),[e,o,r?.id])}function de(e,n,r){let t=new Set;if(r===void 0)return t;t.add(r);for(let o of[...e.out(r),...e.in(r)])t.add(o.id);for(let o of n)if(o.author.id===r)for(let i of o.primitives)i.op==="add-node"&&t.add(i.node.id);return t}var g=A(te(),1);function Ne(e,n,r={x:0,y:0}){let t=(o,i)=>{let c=B(o,i,n.cell,n.tilt);return{x:n.originX+r.x+c.x,y:n.originY+r.y+c.y}};return[t(e.col,e.row),t(e.col+e.side,e.row),t(e.col+e.side,e.row+e.side),t(e.col,e.row+e.side)]}var D=e=>e.map(n=>`${n.x.toFixed(1)},${n.y.toFixed(1)}`).join(" ");function Xe({frame:e,width:n,height:r,pan:t,pinned:o,close:i,today:c,swallowed:y,chosen:p=[],onFocus:w}){let{selection:u,store:d,scheme:S,principal:b}=re(),m=oe(),a=(0,f.useMemo)(()=>d.log.all(),[d,m]),h=le(a,d.schema.kinds,b),$=(0,f.useMemo)(()=>de(d.graph,a,b?.id),[d,a,b?.id]),ge=ie(),E=e.city,F=e.nodes.filter(l=>l.plot!==void 0&&Math.round(l.plane)===2),R=E?.cell??0,K=E?.tilt??.5,T=(0,f.useRef)(w);T.current=w;let ce=(0,f.useCallback)(l=>!T.current||y?.current?!1:(T.current(l),!0),[y]),G=(0,f.useRef)(new Map),j=(0,f.useRef)({nodes:void 0,names:new Map});j.current.nodes!==m&&(j.current={nodes:m,names:new Map});let V=j.current.names,O=new Map;for(let l of F){let L=l.aggregate?.memberIds??[],v=ae(d.schema,l.kind),q=s=>v?d.graph.getNode(s)?.[v.field]:void 0,C=L.filter(s=>p.includes(s)),H=`${R}|${K}|${l.plot.col},${l.plot.row},${l.plot.side}|${C.join(",")}|${L.map(s=>`${s}=${String(q(s))}`).join(",")}`,I=G.current.get(l.id);if(I&&I.key===H){O.set(l.id,I);continue}let W={cell:R,originX:0,originY:0,tilt:K},J={x:0,y:0},ve=d.schema.tryDefinition(l.kind),me=s=>{let x=V.get(s);if(x!==void 0)return x;let M=d.graph.getNode(s),U=M?Z(ve,M):s;return V.set(s,U),U},k=v?v.values.map(()=>[]):[[]],N=v?[...v.tiers]:["waiting"];for(let s of C.length>0?[...C,...L.filter(x=>!C.includes(x))]:L){let x=v?v.values.indexOf(q(s)):0;x>=0?k[x].push(s):(k.length===N.length&&(k.push([]),N.push("waiting")),k[k.length-1].push(s))}let{blocks:he,rests:xe}=Y(l.plot,k,N.map(s=>se[s])),be=Ne(l.plot,W,J),Q=v?Be(d.schema,l.kind):void 0;O.set(l.id,{key:H,tile:D(be),rests:xe.map(s=>({count:s.count,rows:s.rows,at:B(s.col,s.row,R,K)})),buildings:he.map(s=>{let M=(Q?d.graph.getNode(s.id):void 0)?.[Q];return{id:s.id,tier:N[s.lane],overdue:typeof M=="string"&&N[s.lane]!=="done"&&M.slice(0,10)<(c??new Date().toISOString().slice(0,10)),name:me(s.id),width:s.footprint*R,...De(s,W,J)}})})}if(G.current=O,!E)return null;let ue={position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},fe=u.join(`
|
|
2
2
|
`),we=ge.join(`
|
|
3
3
|
`),ye=h?[...h].join(`
|
|
4
4
|
`):"",pe=$?[...$].join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fa as V,ga as w}from"./chunk.
|
|
1
|
+
import{fa as V,ga as w}from"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import{Gd as u,Kd as h}from"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var c=i=>[i,...u.filter(o=>o!==i)];function p(i,o){if(o.hidden.length===0&&o.removed.length===0)return i;let a=new Set(o.removed.filter(e=>!e.lens).map(e=>e.name)),f=new Set(o.hidden),r=e=>e?.name!==void 0&&(a.has(e.name)||e.title!==void 0&&f.has(e.name)),m=()=>(i.homes?.()??[]).filter(e=>e.name===void 0||!a.has(e.name)),l=(e,t,d)=>[...i.registrations()].reverse().find(n=>n.kind===e&&n.cardinality===t&&n.fidelity===d&&!n.beside&&!n.hidden&&!r(n)),y=(e,t)=>{for(let d of c(t.fidelity)){let n=l(e,t.cardinality,d);if(n)return n}if(t.cardinality==="one")for(let d of c(t.fidelity)){let n=l(e,"many",d);if(n)return n}},s={...i,register(e,t,d,n){return i.register(e,t,d,n),s},...i.home?{home(e,t){return i.home(e,t),s}}:{},...i.homes?{homes:m,homeView:()=>m().at(-1)?.view}:{},lookup(e,t){return i.lookup(e,t)===void 0?void 0:l(e,t.cardinality,t.fidelity)?.view},places:()=>i.places().filter(e=>!(e.name!==void 0&&a.has(e.name))).map(e=>e.name!==void 0&&f.has(e.name)&&!e.hidden?{...e,hidden:!0}:e),resolve(e,t,d){let n=i.resolve(e,t,d);return!n||!r(n)||d!==void 0&&n.name!==void 0&&!a.has(n.name)&&n.title!==void 0&&h(n.title)===d?n:y(e,t)},all:()=>i.all().filter(e=>!(e.name!==void 0&&a.has(e.name))),homes:()=>(i.homes?.()??[]).filter(e=>!(e.name!==void 0&&a.has(e.name))),homeView:()=>i.homes?s.homes().at(-1)?.view:i.homeView?.()};return V(i)&&w(s),s}function R(i,o,a){let f,r=()=>{let m=o.current();f&&m.hidden===f.hidden&&m.removed===f.removed||(f=m,a(p(i,m)))};return r(),o.onChange?.(r)??(()=>{})}export{p as tidyViews,R as watchTidied};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as Ge}from"./chunk.H5S7OL2U.js";import{c as Me,d as Oe,f as Be}from"./chunk.Y2YYH3JN.js";import{e as Pe,f as Ce,k as Re,l as re,n as Fe}from"./chunk.SGCW2XRC.js";import{f as Se}from"./chunk.OWT3VVOT.js";import{d as _,e as je,k as ne}from"./chunk.OKZT2QBM.js";import{b as De,e as Ae}from"./chunk.ACTXR2MI.js";import{C as Q,L as de,Md as ve,Oc as he,Qc as ye,Sb as fe,Sc as we,Wd as ke,ad as U,bd as be,de as xe,ea as ue,ga as Z,ia as H,ja as T,jc as te,ka as me,kc as ge,la as ee,ma as pe,pa as q,ra as z,vd as $e}from"./chunk.DZZL5IDD.js";function ze(t,e,n){let o=t.tryDefinition(e)?.fields.shape,r=Q(o?.[n]),a=!1,s=!1;for(;r&&(r.type==="optional"||r.type==="default"||r.type==="nullable"||r.type==="prefault");)(r.type==="optional"||r.type==="nullable")&&(a=!0),(r.type==="default"||r.type==="prefault")&&(s=!0),r=Q(r.innerType);if(r?.type!=="enum")return;let p=(r.entries?Object.values(r.entries):r.values??[]).filter(m=>typeof m=="string");return p.length>0?{values:p,empty:a&&!s}:void 0}function L(t,e,n){let o=ze(t,e,n);if(!o)return[];let r=t.tryDefinition(e),a=o.values.map(s=>({value:s,label:De(r,n,s)}));return o.empty&&a.push({value:null,label:`No ${q(r,n).toLowerCase()}`}),a}function X(t,e,n){let o=t[e];return typeof o=="string"&&n.some(r=>r.value===o)?o:null}function se(t,e,n,o,r=L(t.schema,n.kind,o)){return Ie(t,e,n,o,r).flatMap(a=>a.move?[a.move]:[])}function Ie(t,e,n,o,r=L(t.schema,n.kind,o)){let a=Ve(t.schema,t.allMutations(),n.kind,o,r),s=X(n,o,r),p=z(t.schema.tryDefinition(n.kind),n.kind),m=[];for(let{value:A,label:C,by:R,acts:F}of a){if(A===s)continue;let x,I,V;for(let c of F){let w=R==="step"?{[c.subject.arg]:n.id}:{[c.subject.arg]:n.id,[o]:A},S={name:c.name,args:w};if(!c.input.safeParse(w).success){V??=`${c.title??c.name} asks for more than the ${p} itself.`;continue}let k=t.permits(S,e);if(!k.ok){I??=k.refusal?.message??`You may not ${c.title??c.name}.`;continue}try{fe(t.graph,c,w)}catch(f){I??=f instanceof Error?f.message:String(f);continue}x={to:A,call:S,title:c.title??c.name};break}m.push(x?{to:A,label:C,move:x}:{to:A,label:C,why:I??V??`Nothing in this app moves a ${p} to ${C}.`})}return m}function Ve(t,e,n,o,r=L(t,n,o)){let a=Ne(t,e,n,o),s=Ke(t,e,n,o);return r.flatMap(p=>{if(p.value===null)return[];let m=a.filter(A=>A.sets?.[o]===p.value);return[{value:p.value,label:p.label,by:m.length>0?"step":s.length>0?"value":"none",acts:m.length>0?m:s}]})}function Ne(t,e,n,o){return e.filter(r=>r.subject!==void 0&&r.derived===void 0&&typeof r.sets?.[o]=="string"&&te(t,r).includes(n))}function Ke(t,e,n,o){let r=t.tryDefinition(n);return r?e.filter(a=>{if(!a.subject||!te(t,a).includes(n)||!ge(a,r).includes(o))return!1;let s=a.input.shape;return s!==void 0&&o in s}).sort((a,s)=>+(a.derived!==void 0)-+(s.derived!==void 0)):[]}var oe=(t,e)=>e&&t[e]!==void 0?String(t[e]):"";function Xe(t,e,n){let o=c=>t.tryDefinition(c)?e.nodesOfKind(c).filter(w=>H(t.tryDefinition(c),w)):[],r=o(n.rows),a=o(n.columns),s=new Set(r.map(c=>c.id)),p=new Set(a.map(c=>c.id)),m=e.allEdges(),A=[],C=n.link;if(typeof C=="string"){let c=f=>t.tryDefinition(f)?.edges?.[C]?.to,w=(c(n.columns)??[]).some(f=>f===n.rows||f==="*"),S=(c(n.rows)??[]).some(f=>f===n.columns||f==="*"),k=w||!S;for(let f of m){if(f.kind!==C)continue;let j=k?f.to:f.from,i=k?f.from:f.to;s.has(j)&&p.has(i)&&A.push({rowId:j,columnId:i,via:[]})}}else{let c=new Map(C.path.map(S=>[S,new Map]));for(let S of m){let k=c.get(S.kind);if(!k)continue;let f=k.get(S.from);f?f.push(S.to):k.set(S.from,[S.to]);let j=k.get(S.to);j?j.push(S.from):k.set(S.to,[S.from])}let w=new Set;for(let S of a){let k=[{id:S.id,via:[]}];for(let f of C.path){let j=[],i=new Set;for(let v of k)for(let b of c.get(f).get(v.id)??[])i.has(`${v.id}|${b}`)||(i.add(`${v.id}|${b}`),j.push({id:b,via:[...v.via,v.id]}));k=j}for(let f of k){let j=`${f.id}|${S.id}`;!s.has(f.id)||w.has(j)||(w.add(j),A.push({rowId:f.id,columnId:S.id,via:f.via.slice(1)}))}}}let R=n.groupOrder??[],F=c=>R.indexOf(c)===-1?R.length:R.indexOf(c),x=(c,w)=>w==="label"?T(t.tryDefinition(c.kind),c):c[w],I=U(r,n.sort,x).map(c=>{let w=c;return{node:c,label:T(t.tryDefinition(c.kind),c),group:oe(w,n.rowGroup),ref:oe(w,n.rowRef)}}).sort((c,w)=>F(c.group)-F(w.group)||(n.sort!==void 0?0:c.ref<w.ref?-1:c.ref>w.ref?1:0)),V=U(a,n.columnSort,x).map(c=>({node:c,label:T(t.tryDefinition(c.kind),c),group:oe(c,n.columnGroup)})).sort((c,w)=>c.group<w.group?-1:c.group>w.group?1:n.columnSort!==void 0?0:c.node.id<w.node.id?-1:c.node.id>w.node.id?1:0);return{rows:I,columns:V,cells:A}}function We(t,e,n){let{rows:o,columns:r,cells:a}=Xe(t,e,n),s=(i,v)=>ee(t,i,v),p=i=>ee(t,i,1).replace(/^1 /,""),m=i=>({id:i.id,kind:i.kind,title:T(t.tryDefinition(i.kind),i),parts:[]}),A=i=>{let v=e.getNode(i);if(!v)return null;let b=t.tryDefinition(v.kind),P=T(b,v),N=_(v,b,{limit:3,said:[P],glance:!0}).map(K=>K.alone.startsWith(K.label)?`${K.label.toLowerCase()}${K.alone.slice(K.label.length)}`:K.alone);return[P,...N].join(", ")},C=typeof n.link=="string"?[]:n.link.path.slice(0,-1).flatMap((i,v,b)=>{let P=$e(t,n.columns,b.slice(0,v+1));return P.ok?[...P.reached]:[]}),R=be(t,n,{rows:o.length,columns:r.length,cells:a.length});if(R)return[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}.`},{t:"text",text:R}];let F=[{t:"text",text:`${s(n.rows,o.length)} against ${s(n.columns,r.length)}${C.length>0?`, through ${[...new Set(C)].map(i=>s(i,2).replace(/^2 /,"")).join(" and ")}`:""}${r.length>0?`: ${r.map(i=>i.label).join(", ")}`:""}.`}],x=new Map(r.map(i=>[i.node.id,i.label])),I=new Map(r.map((i,v)=>[i.node.id,v])),V=new Map,c=new Map;for(let i of a){let v=V.get(i.rowId);v?v.push(i):V.set(i.rowId,[i]);let b=c.get(i.columnId);b?b.add(i.rowId):c.set(i.columnId,new Set([i.rowId]))}for(let i of o){let b=[...V.get(i.node.id)??[]].sort((P,N)=>I.get(P.columnId)-I.get(N.columnId)).map(P=>{let N=P.via.map(A).filter(K=>K!==null);return`${x.get(P.columnId)}${N.length>0?` (${N.join("; ")})`:""}`});F.push({t:"field",label:i.label,text:b.length>0?b.join(", "):"none"})}F.push({t:"list",as:"name",columns:1,groups:r.map(i=>{let v=c.get(i.node.id)??new Set,b=o.filter(P=>v.has(P.node.id)).map(P=>m(P.node));return{heading:`${i.label} (${b.length})`,items:b}})});let w=new Set(a.map(i=>i.rowId)),S=new Set(a.map(i=>i.columnId)),k=o.filter(i=>!w.has(i.node.id)),f=r.filter(i=>!S.has(i.node.id)),j=n.rows===n.columns;return k.length>0&&F.push({t:"text",text:`${j?`${k.length} with none across`:`${s(n.rows,k.length)} with no ${p(n.columns)}`}: ${k.map(i=>i.label).join(", ")}.`}),f.length>0&&F.push({t:"text",text:`${j?`${f.length} with none down`:`${s(n.columns,f.length)} on no ${p(n.rows)}`}: ${f.map(i=>i.label).join(", ")}.`}),F}function ie(t,e,n,o={}){let{app:r,blocks:a=n?r?.viewSpecs?.[n.kind]?.[o.slot??"page"]:r?.home}=o;if(!a?.length)return[];let s=o.firstHeading??(n||o.blocks?void 0:1),p=Fe(t,e,n,{...o,money:o.money??r?.brand,firstHeading:s});return n&&!p.node?[]:Ce(typeof a[0]?.t=="string"?a:Pe(a),p)}function Y(t,e,n){let o=!(e.optional||e.control==="boolean"),r=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(s=>Z(z(t.tryDefinition(s),s))).join(" or "):n(e.name).label,a={name:e.name,label:r,required:o};switch(e.control){case"text":return{...a,input:e.holds==="duration"?"length of time":e.holds??(e.markdown?"Markdown text":e.long?"long text":e.app?"app address":"text")};case"date":return{...a,input:e.time||e.instant?"date and time":"date"};case"number":return{...a,input:e.amount?"amount":"number",...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max}};case"choice":return{...a,input:"choice",choices:(e.options??[]).map(s=>n(e.name).option(s))};case"boolean":return{...a,input:"yes or no"};case"node":return{...a,input:"record",kinds:e.kinds};case"linked":return{...a,input:"record in another app"};case"file":return{...a,input:e.image?"picture":e.video?"video":"file"};case"repeat":return{...a,input:"how it repeats"};case"list":return{...a,input:`list of ${Y(t,e.item,n).input}`};case"group":return{...a,input:"group",fields:e.fields.map(s=>Y(t,s,n))};case"variant":return{...a,input:"one of",choices:e.options.map(s=>Z(s.value))};default:return{...a,input:"answer"}}}function Te(t,e,n){let o=Oe(t,e,n),r=t.schema,a=Me(r,n).filter(p=>p.name!==n.subject?.arg&&!o.has(p.name)),s=me(n);return{act:n.name,title:s,submit:s,fields:a.map(p=>Y(r,p,m=>ne(r,n,m)))}}function He(t,e){return{act:e.act.name,title:e.title,submit:e.submit,visitor:e.name,fields:e.fields.map(n=>Y(t,n,o=>ne(t,e.act,o)))}}function Le(t,e,n){return t.permittedMutations(e).filter(o=>!o.derived&&!o.subject&&(o.creates??[]).includes(n))}function Ee(t,e=""){let n=[`${e}Form "${t.title}" (${t.visitor?`the visitor form ${t.visitor}, running `:""}act ${t.act}), button "${t.submit}":`],o=(r,a)=>{for(let s of r){let p=s.choices?`${s.input}: ${s.choices.join(", ")}`:s.kinds?`${s.input} (${s.kinds.join(" or ")})`:s.input,m=s.min!==void 0||s.max!==void 0?`, ${s.min??"\u2026"} to ${s.max??"\u2026"}`:"";n.push(`${a}- ${s.label}${s.required?" *":""} (${s.name}) \u2014 ${p}${m}`),s.fields&&o(s.fields,`${a} `)}};return o(t.fields,`${e} `),t.fields.length===0&&n.push(`${e} (asks nothing)`),n}function Ue(t,e){let n=t.viewSpecs??{};return e.filter(o=>o.cardinality==="one"&&o.replaces==="page"&&(n[o.attach]?.page?.length??0)>0).map(o=>{let r=E(t.schema,o.attach,1);return{at:`views.${o.attach}.page`,says:`The view "${o.name}" replaces ${Ye(r)}'s page, so its page slot is never drawn: leave out replaces to draw the slot under the view, or draw what the slot says in the view.`}})}var Ye=t=>`${/^[aeiou]/i.test(t)?"an":"a"} ${t}`,Je=240,Ze=10,Qe=1160,et=40,_e=640,tt=3,nt=t=>Math.max(1,Math.floor((Math.min(t,Qe)-et+Ze)/(Je+Ze)));function rt(t,e,n,o){let{app:r}=o,a=o.width??1440,s=o.today??t.today()??de(r.brand?.timeZone),p=t.seenBy(e),m=p.schema,A=p.graph,C=Ge(r,o.views?{views:o.views}:{}),R=typeof n=="string"?n.trim():n.slug,F=typeof n=="string"?C.find(l=>l.slug===R||l.title===R||l.address===R):C.find(l=>l.slug===n.slug&&l.kind===n.kind)??n,x=!F&&typeof n=="string"?A.getNode(R):void 0,I=!F&&!x?/^\/?forms\/(.+)$/.exec(R)?.[1]:void 0,V=I!==void 0?Be(r,I):void 0;if(V)return{ok:!0,description:st(m,V,a)};if(!F&&!x)return{ok:!1,error:`"${R}" is not a place this app has, nor a record this seat can see.`,places:[...C.map(l=>l.slug),...Object.keys(r.forms??{}).map(l=>`forms/${l}`)]};let c=[],w=r.viewSpecs??{},S=nt(a),k=(l,h)=>ie(p,null,l,{app:r,today:s,...h}),f=(l,h,M)=>{let d=m.tryDefinition(l.kind),g=T(d,l);if(h==="name")return{id:l.id,kind:l.kind,title:g,parts:[]};if(w[l.kind]?.[h]){let G=k(l,{slot:h}),[B,...O]=G,y=B?.t==="title"||h==="row"&&B?.t==="headline";return{id:l.id,kind:l.kind,title:y?B.text:g,parts:j(y?O:G,M,`views.${l.kind}.${h}`,` (${l.id})`,y?1:0)}}if(h==="row")return{id:l.id,kind:l.kind,title:g,parts:[]};let u=d?.computed?re(m,A,l):l,W=_(u,d,{limit:3,said:[g],glance:!0,locale:r.brand?.locale,timeZone:r.brand?.timeZone});return{id:l.id,kind:l.kind,title:g,parts:W.map(G=>({t:"text",text:G.alone}))}};function j(l,h,M,d="",g=0){let $=[];return l.forEach((u,W)=>{let G=`${M}.${W+g}`;switch("problem"in u&&u.problem&&c.push({at:`${G}${d}`,says:u.problem}),u.t){case"title":$.push({t:"heading",level:3,text:u.text});return;case"text":$.push({t:"text",text:u.markdown?Ae(u.text):u.runs?at(u.runs):u.text,...u.tone?{tone:u.tone}:{}});return;case"badge":$.push({t:"badge",text:u.text});return;case"field":case"image":$.push({t:"field",label:u.label,text:u.text});return;case"progress":$.push({t:"progress",label:u.label,text:u.text});return;case"group":$.push(...j(u.blocks,h,`${G}.group`,d));return;case"when":$.push(...j(u.blocks,h,`${G}.show`,d));return;case"divider":case"figure":return;case"headline":$.push({t:"heading",level:u.level,text:u.text});return;case"number":$.push({t:"figure",text:u.text,...u.label?{label:u.label}:{}});return;case"list":{if(u.failed){$.push({t:"text",text:"\u2014"});return}if(u.members.length===0){u.empty&&$.push({t:"list",as:u.as,columns:1,groups:[],empty:u.empty});return}let B=h+1,O=B>tt?"name":u.as,y=(u.groups??[{value:null,members:u.members}]).map(D=>({..."heading"in D&&D.heading?{heading:D.heading,count:(u.everyGroup?.find(J=>J.value===D.value)??D).members.length}:{},items:D.members.map(J=>f(J,O,B))}));$.push({t:"list",as:O,columns:O==="card"?S:1,groups:y,...u.more>0?{more:u.more}:{}});return}}}),$}let i=[],v,b,P,N=[];if(x){b="record";let l=m.tryDefinition(x.kind),h=T(l,x);P={slug:x.id,title:h,kind:x.kind,address:ve(m,x.kind,x.id)};let M=w[x.kind]?.page,d=o.views?.find(g=>g.attach===x.kind&&g.cardinality==="one");if(d&&i.push({t:"view",name:d.name,...d.title?{title:d.title}:{},...d.replaces==="page"?{replaces:!0}:{},...d.parts?{parts:d.parts}:{}}),d?.replaces==="page")b=`view:${d.name}`,c.push(...Ue(r,[d]));else{M&&i.push(...j(k(x,{slot:"page"}),1,`views.${x.kind}.page`));let g=l?.computed?re(m,A,x):x;for(let $ of je(l,_(g,l,{said:[h],locale:r.brand?.locale,timeZone:r.brand?.timeZone}))){$.title&&i.push({t:"heading",level:2,text:$.title});for(let u of $.fields)i.push({t:"field",label:u.label,text:u.value,...u.long?{long:!0}:{},...u.markdown?{markdown:!0}:{}})}}}else{let l=F;P={slug:l.slug,title:l.title,kind:l.kind,address:l.address};let h=l.lens?ke(r).drawn.find(d=>d.as===l.slug&&(l.kind===null||d.kinds.includes(l.kind))):void 0,M=l.kind!==null&&l.view===void 0&&!h?o.views?.find(d=>d.attach===l.kind&&d.cardinality==="many"&&d.replaces==="page"&&!d.hidden):void 0;if(l.kind!==null&&h?.create!==!1&&l.view===void 0&&!M&&(N=Le(t,e,l.kind).map(d=>Te(t,e,d))),l.view!==void 0&&!h){let d=o.views?.find(g=>g.name===l.view);b=`view:${l.view}`,i.push({t:"view",name:l.view,title:d?.title??l.title,...typeof d?.flows=="boolean"?{flows:d.flows}:{},...d?.parts?{parts:d.parts}:{}})}else if(l.kind===null){let d=r.brand,g=d?.name??r.name,$=we(d)?.light,u=$&&ye($)?$:void 0;if(v={name:g,...d?.subtitle&&d.subtitleDrawn!==!1?{subtitle:d.subtitle}:{},...u?{logo:{alt:d?.logoAlt??g,...he(u)?{drawn:"inline SVG"}:{drawn:"image",src:u}}}:{}},r.home)b="blocks",i=j(k(null,{}),0,"views.home");else{b="derived";let W=t.kindsKeptFrom(e),G=new Set([...r.pages?.hide??[],...W,...t.modules.disabledKinds]),B=xe(m.kinds,r.pages?.order).filter(O=>!G.has(O));i.push({t:"heading",level:1,text:r.name??"Home"});for(let O of B){let y=A.nodesOfKind(O).filter(D=>H(m.tryDefinition(O),D)).length;y>0&&i.push({t:"text",text:`${y} ${E(m,O,y)}`})}}}else if(h?.lens==="blocks")b="lens:blocks",i=j(k(null,{blocks:h.options.blocks??[]}),0,`lenses.${h.index}.options.blocks`);else if(h?.lens==="columns"){b="lens:columns";let d=h.options.bindings??{};for(let g of Object.keys(d)){let $=d[g]?.column;if(!$)continue;let u=L(m,g,$),W=U(A.nodesOfKind(g).filter(y=>H(m.tryDefinition(g),y)),h.options.sort,(y,D)=>D==="label"?T(m.tryDefinition(y.kind),y):y[D]);Object.keys(d).length>1&&i.push({t:"heading",level:2,text:E(m,g,2).replace(/^./,y=>y.toUpperCase())}),i.push({t:"text",text:`${W.length} ${E(m,g,W.length)} in columns by ${q(m.tryDefinition(g),$).toLowerCase()}.`});let G=u.map(y=>({column:y,items:W.filter(D=>X(D,$,u)===y.value).map(D=>f(D,"card",1))})).filter(({column:y,items:D})=>y.value!==null||D.length>0).map(({column:y,items:D})=>({heading:`${y.label} (${D.length})`,items:D}));i.push({t:"list",as:"card",columns:1,groups:G});let B=new Map;for(let y of W)for(let D of se(t,e,y,$,u))B.set(D.to,(B.get(D.to)??new Set).add(`"${D.title}"`));let O=u.filter(y=>y.value!==null&&B.has(y.value)).map(y=>`to ${y.label} by ${[...B.get(y.value)].join(" or ")}`);i.push({t:"text",text:O.length>0?`Moves: ${O.join("; ")}.`:"Moves: none for this seat."})}}else if(h?.lens==="coverage")b="lens:coverage",i=We(m,A,h.options);else if(h){b=`lens:${h.lens}`;let d=h.kinds.flatMap(g=>A.nodesOfKind(g).filter($=>H(m.tryDefinition(g),$)));i.push({t:"text",text:`A ${h.lens} of ${d.length} ${h.kinds.map(g=>E(m,g,d.length)).join(" and ")}.`}),i.push({t:"list",as:"name",columns:1,groups:[{items:d.map(g=>f(g,"name",1))}]})}else if(M)b=`view:${M.name}`,i.push({t:"heading",level:1,text:l.title}),i.push({t:"view",name:M.name,...M.title?{title:M.title}:{},replaces:!0,...M.parts?{parts:M.parts}:{}});else{b="derived";let d=A.nodesOfKind(l.kind).filter(g=>H(m.tryDefinition(l.kind),g));i.push({t:"heading",level:1,text:l.title}),d.length===0?i.push({t:"list",as:"row",columns:1,groups:[],empty:`No ${E(m,l.kind,0)} yet.`}):i.push({t:"list",as:"row",columns:1,groups:[{items:d.map(g=>f(g,"row",1))}]})}}let K=e.kind==="system"?"the system":(e.roles??[]).length>0?(e.roles??[]).join(", "):e.kind,qe=a<_e?"phone":"wide",le=P.kind===null?ot(m,A):[],ce={...v?{masthead:v}:{},...le.length>0?{facts:le}:{},place:P,seat:K,width:a,variant:qe,drawnBy:b,parts:i,...N.length>0?{forms:N}:{},problems:c};return{ok:!0,description:{...ce,text:ae(ce)}}}function st(t,e,n){let o=[{t:"heading",level:1,text:e.title},...e.intro?[{t:"text",text:e.intro}]:[]],r={place:{slug:`forms/${e.name}`,title:e.title,kind:null,address:`/forms/${e.name}`},seat:`a visitor (${e.role})`,width:n,variant:n<_e?"phone":"wide",drawnBy:"form",parts:o,forms:[He(t,e)],problems:[]};return{...r,text:ae(r)}}function ot(t,e){let n=Re(t,e,null),o=r=>Array.isArray(r)?r.map(o).join(", "):r===null?"nothing":typeof r=="boolean"?r?"yes":"no":typeof r=="object"?r.label:String(r);return[...Se(t)].map(([r,a])=>{let s=a.label??Z(r);return Object.hasOwn(n.values,r)?{name:r,label:s,value:o(n.values[r])}:{name:r,label:s,refused:n.refused[r]??"it could not be worked out"}})}function E(t,e,n){let o=t.tryDefinition(e);if(n===1)return o?.noun??e;let r=pe(t,e);return ue(r)}function ae(t){let e=[`${t.place.title} (${t.place.address}) \u2014 as ${t.seat}, ${t.width} wide (${t.variant}).`],n=t.masthead;n&&e.push(`Masthead: ${n.logo?`the logo ("${n.logo.alt}", ${n.logo.drawn==="image"?n.logo.src:"inline SVG"}), `:""}${n.name}${n.subtitle?` \u2014 ${n.subtitle}`:""}`);let o=(r,a)=>{for(let s of r)switch(s.t){case"heading":e.push(`${a}${"#".repeat(s.level)} ${s.text}`);break;case"text":e.push(`${a}${s.text}`);break;case"badge":e.push(`${a}[${s.text}]`);break;case"field":case"progress":e.push(`${a}${s.label}: ${s.text}`);break;case"figure":e.push(`${a}${s.text}${s.label?` \u2014 ${s.label}`:""}`);break;case"list":if(s.groups.length===0){s.empty&&e.push(`${a}(${s.empty})`);break}for(let p of s.groups){p.heading&&e.push(`${a}${p.heading}${p.count!==void 0?` (${p.count})`:""}:`);for(let m of p.items)e.push(`${a}${p.heading?" ":""}- ${m.title}`),o(m.parts,`${a}${p.heading?" ":" "}`)}s.as==="card"&&s.columns>1&&e.push(`${a}(cards, ${s.columns} across)`),s.more&&e.push(`${a}and ${s.more} more`);break;case"view":e.push(`${a}[the view "${s.title??s.name}"${s.replaces?", in place of the page":""}${s.flows===!0?", flowing with the page":s.flows===!1?", in a frame of its own":""}]`),s.parts&&o(s.parts,`${a} `);break}};o(t.parts,"");for(let r of t.forms??[])e.push(...Ee(r));if(t.facts){e.push("Facts of the whole graph (what fact('<name>') reads):");for(let r of t.facts)e.push(`- ${r.label} (${r.name}): ${r.value??`not worked out \u2014 ${r.refused}`}`)}if(t.videos&&t.videos.length>0){e.push("Videos:");for(let r of t.videos)e.push(`- ${it(r)}`)}if(t.problems.length>0){e.push("Problems:");for(let r of t.problems)e.push(`- ${r.at}: ${r.says}`)}return e.join(`
|
|
2
|
+
`)}function it(t){let e=t.autoplay?"plays as a background, muted and looping, with no controls":"plays with the browser's controls";return`${t.text} (${t.field} of ${t.record}): ${t.source}${t.duration!==void 0?`, ${Math.round(t.duration)} s`:""}, ${t.poster?"with a poster":"no poster"}; ${e}${t.cover?", filling its box":""}; ${t.playable?"playable":`not playable: ${t.why??"it is not a video a browser plays"}`}.`}function at(t){return t.map((e,n)=>(n===0?"":e.field===void 0&&t[n-1].field===void 0?" \xB7 ":" ")+e.text).join("")}export{L as a,X as b,se as c,Ie as d,Ve as e,Ne as f,Ke as g,ie as h,Ue as i,rt as j,ae as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk.AJZBJBMO.js";var O=e=>Array.isArray(e);function q(e){return e===!0||O(e)||typeof e.width!="number"?Y:e.width}function Q(e){if(e===!0)return()=>!0;if(O(e)){let a=new Set(e);return s=>a.has(s)}let t=new Map;for(let[a,s]of Object.entries(e))typeof s=="string"?t.set(a,new Set([s])):Array.isArray(s)&&t.set(a,new Set(s));return t.size===0?()=>!0:(a,s)=>t.get(a)?.has(s)??!1}var Y=1200,ee="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",J=100,I=4e7,B=e=>/^image\//i.test(e.type)&&!/^image\/svg/i.test(e.type);function P(e,t={}){let a={name:e.name,type:e.type,bytes:e.bytes};return/^video\//i.test(e.type)?{...a,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.caption!==void 0?{caption:e.caption}:{},...e.duration!==void 0?{duration:e.duration}:{},...e.poster?{poster:!0}:{}}:B(e)?{...a,...e.width!==void 0?{width:e.width}:{},...e.height!==void 0?{height:e.height}:{},...e.caption!==void 0?{caption:e.caption}:{},...t.src!==void 0?{src:t.src}:{},...t.left!==void 0?{left:t.left}:{}}:a}var X=new Set(["id","kind","label"]),N=e=>{let t=e;return typeof t=="object"&&t!==null&&typeof t.href=="string"&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.bytes=="number"};function L(e,t){let a=s=>{let l;for(let[h,u]of Object.entries(s)){if(X.has(h))continue;let m=N(u)?t(u,s,h):Array.isArray(u)&&u.length>0&&u.every(N)?u.map(d=>t(d,s,h)):void 0;m!==void 0&&((l??={...s})[h]=m)}return l??s};return{...e,...e.node?{node:a(e.node)}:{},...e.nodes?{nodes:e.nodes.map(a)}:{}}}var F=e=>e.toLocaleString("en-US"),S=(e,t)=>`The picture "${e.name}" on ${t.label?`"${t.label}"`:"a record"}`;function U(e,t,a){let s=q(e),l=t?.pictureBytes??15e5,h=t?.picturesBytes??12e6,u=Math.round(s*Math.min(2,Math.max(1,a||1)));return{width:s,perFile:l,perView:h,need:u,reckon:d=>Math.min(l,Math.ceil(d.bytes*(d.width&&d.width>u?(u/d.width)**2:1))),chosen:Q(e)}}var j=(e,t)=>`${S(e,t)} is left out: at ${F(e.bytes)} bytes it is more than the host fetches for a view.`,C=(e,t,a,s)=>`${S(e,t)} is left out: the view ${a} is handed at most ${F(s)} bytes of pictures, and the pictures before it, in the order its records are handed, took them. A view that draws only some kinds' pictures says which ("pictures": ["<kind>"]).`;function te(e,t){let{perView:a,reckon:s,chosen:l}=U(t.pictures,t.limits,2),h=[],u=0;return{props:L(e,(d,f,b)=>{if(!B(d)||!l(f.kind,b))return P(d);let v=y=>(h.includes(y)||h.push(y),P(d,{left:y}));if(d.bytes>I)return v(j(d,f));let g=s(d);return u+g>a?v(C(d,f,t.view,a)):(u+=g,P(d,{src:t.standIn}))}),left:h}}function ne(e,t){let{width:a,perFile:s,perView:l,need:h,reckon:u,chosen:m}=U(t.pictures,t.limits,e.devicePixelRatio),d=t.shrink??((n,r,i)=>Z(e,n,r,i)),f=new Map,b=new Map,v=new Set,g=!1,y,k=-1/0,z=()=>{if(y!==void 0||g)return;let n=()=>{y=void 0,!g&&(k=e.performance.now(),t.moved())},r=k+J-e.performance.now();r<=0?(y=!0,queueMicrotask(n)):y=e.setTimeout(n,r)},$=n=>{v.has(n)||(v.add(n),t.onLeft?.(n))},x=n=>{n?.state==="ready"&&(b.delete(n.url),n.url.startsWith("blob:")&&e.URL.revokeObjectURL(n.url))},T=S,V,H=n=>new Promise(r=>{let i=new e.Image;i.onload=()=>r(!0),i.onerror=()=>r(!1),e.setTimeout(()=>r(!1),2e3),i.src=n}),M=n=>new Promise((r,i)=>{let w=new e.FileReader;w.onload=()=>r(String(w.result)),w.onerror=i,w.readAsDataURL(n)}),W=async n=>{if(t.as==="blob"){let i=e.URL.createObjectURL(n);return V??=H(i),await V?{url:i,drawn:i}:{url:i,drawn:await M(n)}}let r=await M(n);return{url:r,drawn:r}},E=(n,r,i)=>({state:"left",said:`${T(n,r)} could not be loaded for the view ${t.view}${i?`: the host answered ${i}.`:"."}${i&&!t.file?" A host that serves the app under a base says where a record's files are (file, on the view's definition).":""}`}),D=async(n,r)=>{let i=E(n,r),w=t.file?t.file(n.href):n.href;if(w===void 0)return i;let o=new e.URL(w,e.document.baseURI);if(o.origin!==e.location.origin||!/^https?:$/.test(o.protocol))return i;let p=await e.fetch(o.href,{credentials:"same-origin"}),A=(p.headers.get("content-type")??"").split(";")[0].trim();if(!p.ok)return E(n,r,String(p.status));if(!B({type:A}))return E(n,r,`${A||"no type"}, not a picture`);let c=new e.Blob([await p.arrayBuffer()],{type:A});if(c.size>I)return i;if(!(n.width!==void 0&&n.width<=h)||c.size>s){let G=await d(c,h,s).catch(()=>{});if(G)c=G;else if(c.size>s)return i}return c.size>s?{state:"left",said:`${T(n,r)} is left out: made as small as the ${F(a)} pixels across the view ${t.view} draws a picture at, it is still more than the ${F(s)} bytes one picture is handed.`}:{state:"ready",...await W(c)}},K=(n,r)=>{f.set(n.href,{state:"pending"}),D(n,r).then(i=>_(n.href,i),()=>_(n.href,{state:"left",said:`${T(n,r)} could not be loaded for the view ${t.view}.`}))},_=(n,r)=>{if(g||f.get(n)?.state!=="pending")return x(r);f.set(n,r),r.state==="ready"&&b.set(r.url,r.drawn),r.state==="left"&&$(r.said),z()};return{hand(n){if(g)return L(n,o=>P(o));let r=0,i=new Set,w=L(n,(o,p,A)=>{if(!B(o)||!m(p.kind,A))return P(o);i.add(o.href);let c=f.get(o.href);if(c?.state==="left")return P(o,{left:c.said});if(!c&&o.bytes>I)return c={state:"left",said:j(o,p)},f.set(o.href,c),$(c.said),P(o,{left:c.said});let R=u(o);if(r+R>l){let G=C(o,p,t.view,l);return $(G),P(o,{left:G})}return r+=R,c||K(o,p),P(o,c?.state==="ready"?{src:c.url}:{})});for(let[o,p]of f)i.has(o)||(x(p),f.delete(o));return w},drawn:n=>b.get(n),waiting:()=>y!==void 0||[...f.values()].some(n=>n.state==="pending"),dispose(){g=!0,y!==void 0&&y!==!0&&e.clearTimeout(y);for(let n of f.values())x(n);f.clear(),b.clear()}}}async function Z(e,t,a,s){if(typeof e.createImageBitmap!="function")return;let l=await e.createImageBitmap(t);try{if(l.width<=a&&t.size<=s)return t;let h=Math.min(1,a/l.width),u=Math.max(1,Math.round(l.width*h)),m=Math.max(1,Math.round(l.height*h)),d=e.document.createElement("canvas");d.width=u,d.height=m;let f=d.getContext("2d");if(!f)return;f.drawImage(l,0,0,u,m);let b=y=>new Promise(k=>d.toBlob(k,y,.85)),v=/^image\/(jpeg|webp|png)$/i.test(t.type)?t.type:"image/png",g=await b(v);return g&&g.size<=s?g:await b("image/jpeg")??g??void 0}finally{l.close()}}export{J as PICTURES_SETTLE_MS,I as PICTURE_FETCH_BYTES,ee as PICTURE_STAND_IN,Y as PICTURE_WIDTH,ne as createGuestPictures,P as guestFileOf,L as handFiles,B as isGuestPicture,U as pictureBudget,q as pictureWidthOf,Q as picturesChosen,te as standInPictures};
|
|
@@ -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{G as k,Ia as o,T as n}from"./chunk.M7RESZB6.js";import{a as t}from"./chunk.SDO3U72B.js";import{b as p}from"./chunk.AJZBJBMO.js";var f=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DC35FJAB.js")))),y=f.part((e,r)=>e.drawFiles(r),{quiet:!0});var d=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.OUDATENL.js")))),I=d.part((e,r)=>e.drawLinkedRecord(r),{quiet:!0}),w=d.part((e,r)=>e.drawLinkedPicker(r),{what:"Picking a linked record"});var s=p(n(),1),m=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.O75HWF3F.js")))),g=m.part((e,r)=>(0,s.jsx)(e.RepeatPicker,{...r}),{quiet:!0}),E=m.part((e,r)=>(0,s.jsx)(e.RepeatEditor,{...r}),{quiet:!0});var a=p(k(),1),i=p(n(),1),c=o(t(()=>(__graviewPreload(import.meta.url,["./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.UVA7AALY.js")))),l=c.part((e,r)=>(0,i.jsx)(e.WhenInput,{...r}),{quiet:!0});function M(e){return(0,i.jsx)(a.Suspense,{fallback:(0,i.jsx)("span",{"data-graview-when-arriving":"",style:{display:"inline-block",minHeight:24}}),children:(0,i.jsx)(l,{...e})})}var N=()=>c.load().then(()=>{},()=>{});export{y as a,I as b,w as c,g as d,E as e,M as f,N as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.UFDJXQQQ.js";import"./chunk.ELTV44HU.js";import"./chunk.CY3ELWCM.js";import"./chunk.RMR24LFJ.js";import"./chunk.I77ZGIFE.js";import"./chunk.OWOOKLIU.js";import"./chunk.RD2X25XB.js";import"./chunk.KMV6PJFL.js";import"./chunk.SWMDFXUX.js";import"./chunk.A3ZC2JBO.js";import"./chunk.NAD7ZXYP.js";import"./chunk.2GEJNG2U.js";import"./chunk.HJCQ6I3S.js";import"./chunk.22BZU7ME.js";import"./chunk.2N4Z5K5S.js";import"./chunk.JYFZCJ4N.js";import"./chunk.UQQKDBIH.js";import"./chunk.AJSUHPBE.js";import"./chunk.LAYQ5PFS.js";import"./chunk.KDXU5DT3.js";import"./chunk.O2BHPYA4.js";import"./chunk.M4AYA2PL.js";import"./chunk.H5S7OL2U.js";import"./chunk.PZQNR4KZ.js";import"./chunk.W4BKYSZX.js";import"./chunk.Y2YYH3JN.js";import"./chunk.NOGGSLVG.js";import"./chunk.WVUJXDXZ.js";import"./chunk.SGCW2XRC.js";import"./chunk.ZN3PUM2I.js";import"./chunk.QIPASE42.js";import"./chunk.EVBCEEQ4.js";import"./chunk.OWT3VVOT.js";import"./chunk.NHTGAP3G.js";import"./chunk.GZHZLJBF.js";import"./chunk.UKQUUPKE.js";import"./chunk.OJGHDWI6.js";import"./chunk.DDUCIUVW.js";import"./chunk.NUYA4BWI.js";import"./chunk.OKZT2QBM.js";import"./chunk.ACTXR2MI.js";import"./chunk.AI34V6WV.js";import"./chunk.G4ULQK64.js";import"./chunk.M7RESZB6.js";import"./chunk.SDO3U72B.js";import"./chunk.DZZL5IDD.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as o,l as u}from"./chunk.
|
|
1
|
+
import{g as o,l as u}from"./chunk.M7RESZB6.js";function c(t,n,i){let e=r=>encodeURIComponent(r);return`${o}${e(t)}:${e(n)}:${e(i)}`}function S(t,n,i){let e=new Set(t.shown??[]);if(i?e.add(n):e.delete(n),e.size===0){let{shown:r,...w}=t;return w}return{...t,shown:[...e].sort()}}function l(t,n){if(n===null||n.trim().length===0){let{q:i,...e}=t;return e}return{...t,q:n}}function p(t){let n=t.q!==void 0&&t.within?.q===t.q;return l(n?u(t,"q",null):t,null)}function h(t,n){if(!n){let{past:i,...e}=t;return e}return{...t,past:!0}}function f(t,n){if(n===null||n.x===0&&n.y===0){let{pan:i,...e}=t;return e}return{...t,pan:n}}function d(t,n,i){let e={...t.pins};return i===null?delete e[n]:e[n]=i,{...t,pins:e}}export{c as a,S as b,l as c,p as d,h as e,f,d as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T,c as A,d as m}from"./chunk.
|
|
1
|
+
import{a as T,c as A,d as m}from"./chunk.QDWSU47A.js";import{P as $,S as x}from"./chunk.DZZL5IDD.js";var I=Symbol.for("@graview/core:file"),j=Symbol.for("@graview/core:node-ref"),y=e=>typeof e=="object"&&e!==null?e._zod?.def:void 0;function k(e){let t=y(e);return t?.[I]??(t?.innerType?k(t.innerType):void 0)}function F(e){let t=k(e);if(t)return{as:t,list:!1};let n=y(e);for(;n?.innerType;)n=y(n.innerType);let i=n?.type==="array"?k(n.element):void 0;return i?{as:i,list:!0}:void 0}function M(e){if(typeof e!="object"||e===null)return;let t=e[j];if(t)return t;let n=y(e);return n?.[j]??(n?.innerType?M(n.innerType):void 0)}function z(e){let t=e?.shape??{};return Object.entries(t).flatMap(([n,i])=>{let s=M(i);return s?[{name:n,kinds:s}]:[]})}var R=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.href=="string"&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.bytes=="number",C=e=>(Array.isArray(e)?e:[e]).filter(R);function O(e,t,n){let s=e.schema.tryDefinition(t)?.fields?.shape?.[n];return s===void 0?void 0:F(s)}function D(e,t){if(e===void 0)return[];if(!Array.isArray(e))return[`The view's accepts is a list of { "kind": <a kind>, "field": <its image, video or file field> }.`];let n=[],i=new Set(t.schema.kinds);for(let s of e){let{kind:l,field:r}=s??{};typeof l!="string"||typeof r!="string"?n.push(`Each of the view's accepts is { "kind": <a kind>, "field": <its image, video or file field> }.`):i.has(l)?O(t,l,r)?t.allMutations().some(d=>(d.creates??[]).includes(l)&&Object.hasOwn(d.input?.shape??{},r))||n.push(`No act of this app makes a "${l}" with its "${r}", so a file dropped could become nothing.`):n.push(`The view accepts files into ${l}'s "${r}", which holds no picture, video or file.`):n.push(`The view accepts files for "${l}", which is no kind of this app.`)}return n}function N(e,t,n){if(e===void 0||e===!0)return[];let i=`The view's pictures is true; the kinds whose pictures it draws, ["circuit"]; or { "width": <the widest it draws a picture, in pixels> } with the fields it draws them from, by kind, { "circuit": "photo" }.`;if(typeof e!="object"||e===null)return[i];let s=new Set([...n.attach==="home"?[]:[n.attach],...n.reads?.kinds??[]]),l=new Set(t.schema.kinds),r=[],d=a=>{if(!l.has(a))return void r.push(`The view's pictures chooses "${a}", which is no kind of this app.`);s.has(a)||r.push(`The view's pictures chooses "${a}", whose records it is not handed: add "${a}" to its reads.kinds.`)};if(Array.isArray(e)){if(e.length===0||!e.every(a=>typeof a=="string"))return[i];for(let a of e)d(a);return r}for(let[a,c]of Object.entries(e)){if(a==="width"&&typeof c!="string"&&!Array.isArray(c)){Number.isInteger(c)&&c>=16&&c<=4096||r.push("The view's pictures width is a whole number of pixels from 16 to 4096.");continue}let p=typeof c=="string"?[c]:Array.isArray(c)&&c.length>0&&c.every(u=>typeof u=="string")?c:void 0;if(!p){r.push(`The view's pictures says "${a}": beside "width", it names a kind and the field it draws pictures from, "circuit": "photo", or its fields, "circuit": ["photo", "map"].`);continue}let g=r.length;if(d(a),!(r.length>g))for(let u of p){let f=O(t,a,u);f?f.as==="video"&&r.push(`The view's pictures chooses ${a}'s "${u}", which holds videos: the host plays a video where the view places it, and hands no picture of it.`):r.push(`The view's pictures chooses ${a}'s "${u}", which holds no picture.`)}}return r}function H(e){if(e===void 0)return[];if(typeof e!="object"||e===null||Array.isArray(e))return[`The view's scene is { "maxHeight": <the tallest its preview on the Scene is drawn, in pixels> }.`];let{maxHeight:t,...n}=e,i=[];return Object.keys(n).length>0&&i.push(`The view's scene says ${Object.keys(n).map(s=>`"${s}"`).join(", ")}: only "maxHeight" is read.`),t!==void 0&&!(Number.isInteger(t)&&t>=80&&t<=4e3)&&i.push("The view's scene maxHeight is a whole number of pixels from 80 to 4000."),i}function V(e){return(e.acts??[]).map(t=>typeof t=="string"?{act:t}:t)}function J(e,t){let n=[],i=new Set(t.schema.kinds),s=new Set(t.schema.edgeKinds),l=new Set(t.allMutations().map(d=>d.name));(typeof e.name!="string"||!/^[a-z0-9][a-z0-9-]{0,62}$/.test(e.name))&&n.push(`The view's name "${String(e.name)}" is not lower-case letters, digits and hyphens.`),e.title!==void 0&&(typeof e.title!="string"||e.title.trim()===""||e.title.length>80)&&n.push("The view's title is empty or longer than 80 characters."),e.attach!=="home"&&!i.has(e.attach)&&n.push(`The view attaches to "${e.attach}", which is no kind of this app.`),e.cardinality!=="one"&&e.cardinality!=="many"&&n.push(`The view's cardinality is "${String(e.cardinality)}", not one or many.`),e.attach==="home"&&e.cardinality!=="many"&&n.push("A view of the home draws many records: its cardinality is many."),e.replaces!==void 0&&e.replaces!=="page"?n.push(`The view's replaces is "${String(e.replaces)}": the one thing a view replaces is "page", or leave it out to draw the view above the record's own fields.`):e.replaces==="page"&&e.attach==="home"&&n.push(`The home's view is the home already: replaces "page" is for a view of a kind, of one record (its page) or of many (its list).`),e.gestures!==void 0&&typeof e.gestures!="boolean"&&n.push(`The view's gestures is "${String(e.gestures)}": it is true, or left out.`),e.bleed!==void 0&&typeof e.bleed!="boolean"&&n.push(`The view's bleed is "${String(e.bleed)}": it is true, or left out.`),e.heading!==void 0&&(e.heading!=="own"||e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push(`The view's heading is "${String(e.heading)}": it is "own" on a view that is a place (a title, cardinality many), or left out.`),e.flows!==void 0&&typeof e.flows!="boolean"?n.push(`The view's flows is "${String(e.flows)}": it is false for a view that keeps its place's frame, or left out.`):e.flows===!1&&(e.attach==="home"||e.cardinality!=="many"||e.title===void 0)&&n.push("Only a view that is a place keeps a frame: flows false needs a title and cardinality many on a kind."),n.push(...H(e.scene)),e.scene!==void 0&&(e.attach==="home"||e.cardinality!=="many")&&n.push("Only a view of a kind's members is drawn on the Scene as a card: scene needs cardinality many on a kind."),n.push(...N(e.pictures,t,e)),n.push(...D(e.accepts,t));for(let d of e.reads?.kinds??[])i.has(d)||n.push(`The view reads "${d}", which is no kind of this app.`);for(let d of e.reads?.edges??[])s.has(d)||n.push(`The view reads the edge "${d}", which no kind of this app declares.`);let r=new Set;for(let d of V(e)){l.has(d.act)||n.push(`The view asks for the act "${d.act}", which this app does not declare.`);let a=d.as??d.act;r.has(a)&&n.push(`Two of the view's acts are called "${a}".`),r.add(a)}return n}function _(e,t,n){let i=[...new Set([...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]])];if(i.length<2)return[];let s=new Set(t.reads?.edges??[]),l=r=>new RegExp(`(["'\`])${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\1`).test(n);return e.schema.edgeKinds.filter(r=>{let d=e.schema.edge(r);return!s.has(r)&&d!==void 0&&d.from.some(a=>i.includes(a))&&(d.to==="*"||d.to.some(a=>i.includes(a)))&&l(r)})}function Q(e,t,n){let i=_(e,t,n);if(i.length===0)return;let s=(l,r)=>l.length<2?l[0]??"":`${l.slice(0,-1).join(", ")} ${r} ${l[l.length-1]}`;return`"${t.name}" names ${s(i,"and")} but does not read ${i.length>1?"them":"it"}, so the view is handed no such links: add ${s(i.map(l=>`"${l}"`),"and")} to its manifest's reads.edges.`}function U(e,t){return[...t.attach==="home"?[]:[t.attach],...t.reads?.kinds??[]].some(i=>Object.keys(e.schema.tryDefinition(i)?.computed??{}).length>0)}function X(e,t,n){let{manifest:i}=n,s=n.input??{},r=e.seenBy(t).graph,d=i.attach==="home"?void 0:i.attach,a=d&&i.cardinality==="one"&&s.node?r.getNode(s.node.id):void 0,c=a&&a.kind===d?[a]:[],p=d&&i.cardinality==="many"?s.nodes?s.nodes.flatMap(o=>{let h=r.getNode(o.id);return h&&h.kind===d?[h]:[]}):r.nodesOfKind(d):[],g=new Set([...c,...p].map(o=>o.id)),u=T(r,g,{kinds:(i.reads?.kinds??[]).filter(o=>o!==d||i.cardinality==="one"),edges:i.reads?.edges??[]}),f=new Map;for(let o of[...p,...u.nodes])c.some(h=>h.id===o.id)||f.set(o.id,o);let P=new Set([...c.map(o=>o.id),...f.keys()]),G=[...u.edges],K=new Set(V(i).map(o=>o.act)),W=e.permittedMutations(t).filter(o=>K.has(o.name)).map(o=>({name:o.name,title:o.title??o.name,...o.description!==void 0?{description:o.description}:{},...o.subject?{subject:{kinds:o.subject.kinds,arg:o.subject.arg}}:{}})),b=o=>o?.filter(h=>P.has(h)),S=n.computed,v=o=>S?{...m(e,o),...S(r,o)}:m(e,o);return{view:i.name,...c[0]?{node:v(c[0])}:{},nodes:[...f.values()].map(v),edges:G,...i.title!==void 0?{label:i.title}:s.label!==void 0?{label:s.label}:{},cardinality:i.cardinality,...s.fidelity!==void 0?{fidelity:s.fidelity}:{},...s.mode!==void 0?{mode:s.mode}:{},...s.selected!==void 0?{selected:s.selected}:{},...s.implicated?{implicated:b(s.implicated)}:{},...s.flagged?{flagged:b(s.flagged)}:{},acts:W,...n.theme?{theme:n.theme}:{},locale:$(),timeZone:x(),...A(e.schema,[...c,...f.values()]),...n.places?{places:n.places.filter((o,h,w)=>w.findIndex(E=>E.as===o.as)===h).map(({as:o,title:h,kind:w})=>({as:o,title:h,kind:w}))}:{}}}export{z as a,R as b,C as c,O as d,V as e,J as f,_ as g,Q as h,U as i,X as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as j,b as ge,e as ye,f as fe,g as he}from"./chunk.KDXU5DT3.js";import{b as q}from"./chunk.O2BHPYA4.js";import{c as me}from"./chunk.SGCW2XRC.js";import{n as V}from"./chunk.UKQUUPKE.js";import{b as R,c as de,d as pe,j as ue,k as ce}from"./chunk.NUYA4BWI.js";import{d as se,e as le}from"./chunk.OKZT2QBM.js";import{b as G,f as oe}from"./chunk.ACTXR2MI.js";import{G as we,Ha as ae,Ia as ie,S as te,T as ne,ba as F,ca as re,ea as K}from"./chunk.M7RESZB6.js";import{a as ee}from"./chunk.SDO3U72B.js";import{ga as $,pa as Q,zb as Z}from"./chunk.DZZL5IDD.js";import{b as _}from"./chunk.AJZBJBMO.js";var d=_(we(),1);var Se=ie(ee(()=>(__graviewPreload(import.meta.url,["./chunk.LAYQ5PFS.js","./chunk.KDXU5DT3.js","./chunk.O2BHPYA4.js","./chunk.WVUJXDXZ.js","./chunk.SGCW2XRC.js","./chunk.ZN3PUM2I.js","./chunk.QIPASE42.js","./chunk.EVBCEEQ4.js","./chunk.OWT3VVOT.js","./chunk.NHTGAP3G.js","./chunk.GZHZLJBF.js","./chunk.UKQUUPKE.js","./chunk.OJGHDWI6.js","./chunk.DDUCIUVW.js","./chunk.NUYA4BWI.js","./chunk.OKZT2QBM.js","./chunk.ACTXR2MI.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.DDO3GLEJ.js")))),be=Se.part((i,n)=>i.drawAppLink(n),{quiet:!0});var e=_(ne(),1);function X({nodeId:i,field:n,value:l,stored:s=l,said:g}){let{fields:c,commit:o}=V(i),t=c.find(a=>a.field===n),{store:y,principal:P}=F(),b=y.graph.getNode(i)?.kind,w=y.schema.definitions.find(a=>a.kind===b),f=Q(w,n),L=f.toLowerCase(),r=g??`${f.charAt(0).toUpperCase()}${f.slice(1)}: ${l}`,[S,B]=(0,d.useState)(!1),p=t?.shape.type==="number"?t.shape.amount:void 0,T=p&&s!==""&&Number.isFinite(Number(s))?de(Number(s),p):s,[k,W]=(0,d.useState)(T),x=(0,d.useRef)(null),h=(0,d.useRef)(null),z=(0,d.useRef)(!1),[Y,U]=(0,d.useState)(void 0),C=a=>{z.current=a,B(!1)};(0,d.useEffect)(()=>W(T),[T,S]);let J=t?.shape.type==="date";if((0,d.useEffect)(()=>{if(J)return ae(()=>void he())},[J]),(0,d.useEffect)(()=>{S?x.current?.focus():z.current&&(z.current=!1,h.current?.focus())},[S]),!t)return(0,e.jsx)("span",{"data-graview-field":n,"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${L}`,style:{color:"var(--graview-ink)",cursor:"default",overflowWrap:"anywhere"},children:l});if(!S){let a=(0,e.jsx)("button",{ref:h,type:"button","data-graview-field":n,"data-graview-editable":t.mutation,...r===l?{}:{"aria-label":r},title:`${t.title} \u2014 changes the ${L}, and can be undone`,onClick:()=>{U(void 0),B(!0)},style:{all:"unset",cursor:"text",display:"inline-flex",alignItems:"flex-end",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",paddingBottom:1,borderBottom:"1px dashed var(--graview-edge-bright)",color:"var(--graview-ink)"},children:l});return Y?(0,e.jsxs)(e.Fragment,{children:[a,(0,e.jsx)("span",{role:"status","data-graview-refused":n,style:{marginLeft:6,fontSize:"0.75rem",color:"var(--graview-ink-muted)"},children:Y})]}):a}let N=(a,{left:m=!1}={})=>{if(C(!m),a!==s){if(a===""||a===void 0||a===null){if(s==="")return;t.clearable?o(t,null):U(`${f.charAt(0).toUpperCase()}${f.slice(1)} can't be empty; it keeps ${l}.`);return}t.shape.type==="date"&&typeof a=="string"&&ve(a)||o(t,a)}},ve=a=>{if(t.shape.type!=="date")return!1;let m=c.filter(M=>M.shape.type==="date"&&M.takesValue),E=ce(m.map(M=>M.field),w?.fieldRoles??{}),I=E?.start===n?m.find(M=>M.field===E.end):void 0,v=y.graph.getNode(i)?.[E?.end??""];if(!I||typeof v!="string")return!1;let A=ue(s===""?void 0:s,a,v,{time:t.shape.time===!0,instant:t.shape.instant===!0});if(A===void 0||A===v)return!1;let H=t.call(a),O=I.call(A);return y.applyAll(H.name===O.name?[{name:H.name,args:{...H.args,...O.args}}]:[H,O],{author:P}),!0};if(!t.takesValue){let a=[t,...t.alternatives];return(0,e.jsx)("span",{role:"group","aria-label":`Change ${$(n).toLowerCase()}`,"data-graview-field":n,style:{display:"inline-flex",gap:6,alignItems:"center",flexWrap:"wrap"},onKeyDown:m=>{m.key==="Escape"&&C(!0)},children:a.map((m,E)=>(0,e.jsx)("button",{type:"button",ref:E===0?x:void 0,"data-graview-act":m.mutation,onClick:()=>{C(!0),o(m,void 0)},onBlur:I=>{let u=I.relatedTarget;(!u||!I.currentTarget.parentElement?.contains(u))&&C(!1)},style:{padding:"2px 9px",fontSize:"0.8125rem",borderRadius:999},children:m.title},m.mutation))})}if(t.shape.type==="several"&&t.shape.of.type==="choice"){let a=t.shape.of.options,m=y.graph.getNode(i),E=Array.isArray(m?.[n])?m[n].map(String):[],I=u=>{let v=a.filter(A=>u.includes(A));if(v.length>0)return o(t,v);t.clearable?o(t,null):U(`${f.charAt(0).toUpperCase()}${f.slice(1)} can't be empty; it keeps ${l}.`)};return(0,e.jsxs)("fieldset",{"data-graview-field":n,"data-graview-choices":n,style:{display:"inline-flex",flexWrap:"wrap",gap:"4px 12px",margin:0,padding:"2px 6px",border:"1px solid var(--graview-edge-bright)",borderRadius:6,maxWidth:"100%"},onKeyDown:u=>{u.key==="Escape"&&C(!0)},onBlur:u=>{let v=u.relatedTarget;(!v||!u.currentTarget.contains(v))&&C(!1)},children:[(0,e.jsx)("legend",{style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)"},children:$(n)}),a.map((u,v)=>(0,e.jsxs)("label",{style:{display:"inline-flex",alignItems:"center",gap:4,minHeight:24,cursor:"pointer"},children:[(0,e.jsx)("input",{ref:v===0?x:void 0,type:"checkbox",value:u,checked:E.includes(u),onChange:A=>I(A.target.checked?[...E,u]:E.filter(H=>H!==u))}),G(w,n,u)]},u))]})}return(0,e.jsxs)("form",{style:{display:"inline-flex",flexWrap:"wrap",gap:4,maxWidth:"100%"},onSubmit:a=>{a.preventDefault(),N(ke(t,k))},children:[t.shape.type==="choice"?(0,e.jsx)("select",{ref:x,"aria-label":$(n),"data-graview-field":n,value:k,onChange:a=>N(a.target.value),onBlur:()=>C(!1),style:{font:"inherit",fontSize:"inherit"},children:t.shape.options.map(a=>(0,e.jsx)("option",{value:a,children:G(w,n,a)},a))}):t.shape.type==="date"?(0,e.jsx)(fe,{inputRef:x,label:$(n),value:k===""?void 0:k,time:t.shape.time===!0,instant:t.shape.instant===!0,partial:t.shape.partial===!0,onChange:a=>W(a??""),onLeave:a=>N(a,{left:!0}),onCancel:()=>C(!0),autoSelect:!0,boxStyle:{fontSize:"inherit",minHeight:24,padding:"0 3px"}}):(0,e.jsxs)(e.Fragment,{children:[p&&R(p).prefix?(0,e.jsx)("span",{"aria-hidden":"true",children:R(p).prefix}):null,(0,e.jsx)("input",{ref:x,"aria-label":p?`${$(n)}, ${R(p).hint}`:$(n),"data-graview-field":n,...p?{inputMode:"decimal",placeholder:R(p).placeholder,"data-graview-amount":p.format??"unit"}:{},type:p?"text":t.shape.type==="number"&&!t.shape.duration?"number":"text",...t.shape.type==="number"&&t.shape.duration?{placeholder:"1h 30m"}:{},...t.shape.type==="text"&&t.shape.holds==="phone"?{inputMode:"tel",autoComplete:"tel"}:{},...t.shape.type==="number"&&t.shape.min!==void 0&&!p?{min:t.shape.min}:{},...t.shape.type==="number"&&t.shape.max!==void 0&&!p?{max:t.shape.max}:{},...t.shape.type==="number"&&t.shape.step!==void 0&&!p?{step:t.shape.step}:{},value:k,onChange:a=>W(a.target.value),onBlur:()=>N(ke(t,k),{left:!0}),onKeyDown:a=>{a.key==="Escape"&&C(!0)},style:{font:"inherit",fontSize:"inherit",width:`min(${Math.max(6,k.length+1)}ch, 100%)`,maxWidth:"100%",minWidth:0,boxSizing:"border-box",minHeight:24,display:"inline-flex",alignItems:"center",padding:"0 3px"}}),p&&R(p).suffix?(0,e.jsx)("span",{"aria-hidden":"true",children:R(p).suffix}):null]}),t.open.length>0?(0,e.jsxs)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["also needs ",t.open.map(a=>a.name).join(", ")]}):null]})}function ke(i,n){return n.trim()===""?"":i.shape.type==="number"&&i.shape.amount?pe(n,i.shape.amount):i.shape.type==="number"?i.shape.duration?oe(n)??n:Number(n):i.shape.type==="text"&&i.shape.holds?n.trim():n}function xe({href:i,field:n,value:l,stored:s,nodeId:g}){let c=i.startsWith("tel:"),o=(t,y)=>(0,e.jsx)("a",{href:i,"data-graview-link":n,...y?{"aria-label":y}:{},...c?{}:{target:"_blank",rel:"noopener noreferrer"},style:{display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24,maxWidth:"100%",overflowWrap:"anywhere",color:"var(--graview-accent)"},children:t});return g===void 0?o(l):(0,e.jsxs)("span",{style:{display:"inline-flex",flexWrap:"wrap",alignItems:"center",gap:"0 10px",maxWidth:"100%"},children:[(0,e.jsx)(X,{nodeId:g,field:n,value:l,...s===void 0?{}:{stored:s}}),o(c?"Call":"Map",c?`Call ${l}`:`Open ${l} in maps`)]})}function Ke({id:i,hide:n=[],limit:l=10,labels:s={},shown:g=[]}){let{store:c}=F(),o=K(i);if(!o)return null;let t=c.schema.tryDefinition(o.kind),y=se(o,t,{limit:l,said:g}).filter(b=>!n.includes(b.key)),P=me(t).length>0;return y.length===0&&!P?null:(0,e.jsxs)("div",{"data-graview-fields":o.id,style:{display:"grid",gap:14,alignContent:"start",minWidth:0,fontSize:"0.875rem"},children:[le(t,y).map((b,w)=>{let f=(0,e.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"auto 1fr",gap:"5px 16px",alignContent:"start",minWidth:0},children:b.fields.map(r=>r.files?(0,e.jsx)(j,{as:"field",nodeId:o.id,field:r.key,label:s[r.key]??r.label,files:r.files,labelStyle:D,style:{marginTop:6}},r.key):r.long?(0,e.jsx)(Ee,{nodeId:o.id,field:r.key,label:s[r.key]??r.label,value:r.value,markdown:r.markdown,labelStyle:D,style:{gridColumn:"1 / -1",marginTop:6}},r.key):(0,e.jsxs)("div",{style:{display:"contents"},children:[(0,e.jsx)("dt",{style:{...D,whiteSpace:"nowrap"},children:s[r.key]??r.label}),(0,e.jsxs)("dd",{style:{margin:0,minWidth:0},children:[r.linked?(0,e.jsx)(ge,{relation:r.linked.relation,refs:r.linked.refs,nodeId:o.id,field:r.key}):r.app?(0,e.jsx)(be,{address:r.app,as:"record",nodeId:o.id,field:r.key}):r.href?(0,e.jsx)(xe,{href:r.href,field:r.key,value:r.value,stored:r.stored,nodeId:o.id}):(0,e.jsx)(X,{nodeId:o.id,field:r.key,value:r.value,stored:r.stored}),r.repeats?(0,e.jsx)(ye,{nodeId:o.id,field:r.key,start:o[r.key],value:o[`${r.key}Repeat`],label:`${s[r.key]??r.label} repeats`}):null]})]},r.key))});if(!b.title)return(0,e.jsx)("div",{children:f},w);let L=`graview-field-group-${o.id}-${w}`;return(0,e.jsxs)("div",{role:"group","aria-labelledby":L,style:{display:"grid",gap:6,minWidth:0},children:[(0,e.jsx)("p",{id:L,"data-graview-field-group":b.title,style:Ce,children:b.title}),f]},w)}),P?(0,e.jsx)(j,{as:"unfilled",nodeId:o.id,skip:n,labels:s,labelStyle:D}):null]})}var D={color:"var(--graview-ink-faint)",fontSize:"0.8125rem"},Ce={margin:0,fontSize:"0.75rem",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--graview-ink-muted)",fontWeight:560};function Ee(i){return re()?(0,e.jsx)(Te,{...i}):(0,e.jsx)(Le,{...i})}function Le({field:i,label:n,value:l,labelStyle:s,valueStyle:g,style:c,markdown:o}){return(0,e.jsxs)("div",{"data-graview-long":i,style:{display:"grid",gap:6,minWidth:0,...c},children:[(0,e.jsx)("dt",{style:s,children:n}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...g},children:(0,e.jsx)("div",{"data-graview-field":i,children:(0,e.jsx)(q,{text:l,markdown:o})})})]})}function Te({nodeId:i,field:n,label:l,value:s,labelStyle:g,valueStyle:c,style:o,markdown:t}){let{fields:y,commit:P}=V(i),{store:b,principal:w}=F(),f=(0,d.useContext)(te)!==null&&b.collaborative(i,n),L=y.find(h=>h.field===n&&h.takesValue),r=L&&(!f||b.permits({name:Z,args:{node:i,field:n,at:0,remove:0,insert:""}},w).ok)?L:void 0,[S,B]=(0,d.useState)(!1),p=(0,d.useRef)(null),T=(0,d.useRef)(!1);(0,d.useEffect)(()=>{!S&&T.current&&(T.current=!1,p.current?.focus())},[S]);let k=h=>{T.current=h,B(!1)},W=l.toLowerCase(),x=(0,e.jsx)(q,{text:s,markdown:t});return(0,e.jsxs)("div",{"data-graview-long":n,style:{display:"grid",gap:6,minWidth:0,...o},children:[(0,e.jsxs)("dt",{style:{display:"flex",alignItems:"baseline",gap:10,...g},children:[(0,e.jsx)("span",{children:l}),r&&!S?(0,e.jsx)("button",{ref:p,type:"button","data-graview-editable":r.mutation,"aria-label":`Edit the ${W}`,title:`${r.title} \u2014 changes the ${W}, and can be undone`,onClick:()=>B(!0),style:Ie,children:"Edit"}):null]}),(0,e.jsx)("dd",{style:{margin:0,minWidth:0,...c},children:S&&r?(0,e.jsx)(d.Suspense,{fallback:x,children:(0,e.jsx)(We,{nodeId:i,field:n,label:l,value:s,...t?{markdown:!0}:{},onCancel:()=>k(!0),onDone:h=>k(!h),onSave:(h,z)=>{k(!z),h!==s&&P(r,h)}})}):(0,e.jsx)("div",{"data-graview-field":n,...r?{}:{"data-graview-readonly":"",title:`Read-only \u2014 nothing this app declares changes the ${W}`},...r?{onClick:()=>B(!0)}:{},style:{cursor:r?"text":"default",minWidth:0},children:x})})]})}var We=(0,d.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.O2BHPYA4.js","./chunk.AI34V6WV.js","./chunk.G4ULQK64.js","./chunk.M7RESZB6.js","./chunk.SDO3U72B.js","./chunk.DZZL5IDD.js","./chunk.FQLNBIQ5.js","./chunk.AJZBJBMO.js"]),import("./chunk.ILIIBSGA.js"))),Ie={all:"unset",cursor:"pointer",fontSize:"0.75rem",letterSpacing:"normal",textTransform:"none",color:"var(--graview-accent)",borderBottom:"1px dashed currentColor",minHeight:24,minWidth:24,display:"inline-flex",alignItems:"flex-end"};function Ge({nodeId:i,children:n}){let{fields:l}=V(i),s=K(i);if(!s)return(0,e.jsx)(e.Fragment,{children:n});let g=l.find(c=>{let o=s[c.field];return typeof o=="string"&&o===n});return g?(0,e.jsx)(X,{nodeId:i,field:g.field,value:n,said:n}):(0,e.jsx)(e.Fragment,{children:n})}export{be as a,X as b,xe as c,Ke as d,Ee as e,Ge as f};
|