graview 0.1.43 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.6AYTF53S.js → chunk.2EFH63WS.js} +1 -1
- package/dist/preview/{chunk.YPEZZLOY.js → chunk.2JJYGYT2.js} +1 -1
- package/dist/preview/chunk.2LKMNEWZ.js +1 -0
- package/dist/preview/{chunk.X5WB4GJ4.js → chunk.2YABX3SC.js} +1 -1
- package/dist/preview/{chunk.OIJP6PQV.js → chunk.3HSPWSAI.js} +1 -1
- package/dist/preview/chunk.3NMINX5Z.js +1 -0
- package/dist/preview/{chunk.SKB4XSDG.js → chunk.4HYJHGI4.js} +1 -1
- package/dist/preview/{chunk.F6CPM7SL.js → chunk.4KNEBLB7.js} +1 -1
- package/dist/preview/{chunk.3GQL4K3Q.js → chunk.4RJZVTW7.js} +1 -1
- package/dist/preview/{chunk.N3FONYEP.js → chunk.4XOWRYRU.js} +2 -2
- package/dist/preview/{chunk.4P3LS2OE.js → chunk.55D33E5A.js} +1 -1
- package/dist/preview/{chunk.FTF67QE2.js → chunk.5B2LH2SR.js} +1 -1
- package/dist/preview/chunk.5EDA3JHU.js +1 -0
- package/dist/preview/{chunk.TX65ZO27.js → chunk.5O5IJVLN.js} +1 -1
- package/dist/preview/chunk.5R2R364Q.js +1 -0
- package/dist/preview/{chunk.6BU3GCHK.js → chunk.63JLXGYX.js} +1 -1
- package/dist/preview/{chunk.XGRMQUFB.js → chunk.64WM4IBI.js} +1 -1
- package/dist/preview/chunk.66JF3UMG.js +1 -0
- package/dist/preview/chunk.6BJBPDF3.js +349 -0
- package/dist/preview/{chunk.T4M4MLOS.js → chunk.6KWFTSK4.js} +1 -1
- package/dist/preview/{chunk.EBTYR5CZ.js → chunk.6MADC6DM.js} +1 -1
- package/dist/preview/{chunk.WH2RYGXR.js → chunk.6RY6OSE6.js} +1 -1
- package/dist/preview/{chunk.4YLBGGWT.js → chunk.6SJA4FSW.js} +1 -1
- package/dist/preview/chunk.6SWW6KEV.js +1 -0
- package/dist/preview/chunk.6UIW664O.js +6 -0
- package/dist/preview/chunk.6USUVORO.js +1 -0
- package/dist/preview/{chunk.B2KDYES6.js → chunk.6X3G3PWL.js} +1 -1
- package/dist/preview/chunk.7KVWV577.js +1 -0
- package/dist/preview/{chunk.DZN26GKS.js → chunk.7ZRFXI73.js} +1 -1
- package/dist/preview/chunk.AS4CQBOQ.js +5 -0
- package/dist/preview/{chunk.C3DX4LWD.js → chunk.B6KT6BTG.js} +4 -4
- package/dist/preview/{chunk.RDXDEFOC.js → chunk.BGYY55VO.js} +1 -1
- package/dist/preview/{chunk.A3WOUDOG.js → chunk.BNPQUI3F.js} +1 -1
- package/dist/preview/chunk.BRDAO2OF.js +4 -0
- package/dist/preview/{chunk.C3X3R7LP.js → chunk.BS2SJC2P.js} +2 -2
- package/dist/preview/{chunk.RQBX7M7Q.js → chunk.C2UFMFJ3.js} +2 -2
- package/dist/preview/{chunk.S2MP53RO.js → chunk.CBUSFM3E.js} +1 -1
- package/dist/preview/chunk.CSDERNQV.js +1 -0
- package/dist/preview/chunk.DLFWBG33.js +1 -0
- package/dist/preview/{chunk.5TBK44MK.js → chunk.DQHPEKWK.js} +1 -1
- package/dist/preview/{chunk.5J2HETUO.js → chunk.DQOCBKC3.js} +1 -1
- package/dist/preview/{chunk.R7F6UJVG.js → chunk.DX357TZ3.js} +1 -1
- package/dist/preview/{chunk.T4QT5SZY.js → chunk.E37V2EJM.js} +1 -1
- package/dist/preview/{chunk.XAXZCOZK.js → chunk.E4G6DXSB.js} +1 -1
- package/dist/preview/chunk.EAUVEVVO.js +1 -0
- package/dist/preview/chunk.EVW5YY3W.js +1 -0
- package/dist/preview/chunk.F6HMZL65.js +1 -0
- package/dist/preview/{chunk.IJ2AF3AW.js → chunk.FCAYURB4.js} +1 -1
- package/dist/preview/{chunk.LDU25CCL.js → chunk.FF6DBQMB.js} +1 -1
- package/dist/preview/chunk.FHZBXMXR.js +33 -0
- package/dist/preview/{chunk.26SI4K3P.js → chunk.FOFLD64U.js} +1 -1
- package/dist/preview/{chunk.BYVE2NQY.js → chunk.FPASZ4RD.js} +1 -1
- package/dist/preview/{chunk.KR3J27IA.js → chunk.FTM64IDI.js} +1 -1
- package/dist/preview/chunk.GEPNIMXW.js +1 -0
- package/dist/preview/{chunk.25VAWLKJ.js → chunk.GER2XRD4.js} +1 -1
- package/dist/preview/chunk.GFLAGZSB.js +1 -0
- package/dist/preview/{chunk.JNCSGUO3.js → chunk.GIYFEGAP.js} +1 -1
- package/dist/preview/chunk.GVY5UQTJ.js +1 -0
- package/dist/preview/{chunk.DYW4D74X.js → chunk.H7KCWCB4.js} +1 -1
- package/dist/preview/{chunk.RSYFIL2Z.js → chunk.HDRD33II.js} +1 -1
- package/dist/preview/{chunk.3B47UX2J.js → chunk.HGTPTRMM.js} +1 -1
- package/dist/preview/chunk.HWCHFQ7O.js +6 -0
- package/dist/preview/{chunk.4ZHUGSJL.js → chunk.HZGVEHEN.js} +1 -1
- package/dist/preview/{chunk.I4HUBO22.js → chunk.ICCIZDTQ.js} +1 -1
- package/dist/preview/{chunk.YKN2VWWQ.js → chunk.ICGNIK3Z.js} +2 -2
- package/dist/preview/chunk.II7VTGNC.js +1 -0
- package/dist/preview/{chunk.R2B2ZAWI.js → chunk.IKX4VDTW.js} +1 -1
- package/dist/preview/chunk.IW7YFPGG.js +1 -0
- package/dist/preview/chunk.J7G3AATY.js +14 -0
- package/dist/preview/{chunk.DJ3BD7AZ.js → chunk.JBW3DI7E.js} +1 -1
- package/dist/preview/{chunk.6IEDQHKI.js → chunk.JDMXZFSG.js} +1 -1
- package/dist/preview/{chunk.4IDXQVSW.js → chunk.JHIUG25Q.js} +1 -1
- package/dist/preview/{chunk.OWL5GZ6U.js → chunk.JLEC3USG.js} +1 -1
- package/dist/preview/{chunk.ZRICIE6T.js → chunk.JLYNMAME.js} +1 -1
- package/dist/preview/{chunk.C5NOO4CC.js → chunk.JR7RDOEP.js} +1 -1
- package/dist/preview/{chunk.KWQ67UK2.js → chunk.JSSFA3FC.js} +1 -1
- package/dist/preview/chunk.K46YRA65.js +1 -0
- package/dist/preview/chunk.K6KMLD2B.js +21 -0
- package/dist/preview/{chunk.ONSG3OIL.js → chunk.KBHU54NM.js} +1 -1
- package/dist/preview/{chunk.6ROYIMQ2.js → chunk.KRGM25HF.js} +1 -1
- package/dist/preview/chunk.KUUDW7VR.js +1 -0
- package/dist/preview/{chunk.TMBFLZNH.js → chunk.KWQ7QOHD.js} +1 -1
- package/dist/preview/chunk.L24FCXZ7.js +1 -0
- package/dist/preview/{chunk.7TU2PDYW.js → chunk.L2PI7V4R.js} +1 -1
- package/dist/preview/{chunk.NH6D6TWY.js → chunk.L3FOLN3K.js} +1 -1
- package/dist/preview/{chunk.PWYMZWAN.js → chunk.L3FQZCWI.js} +1 -1
- package/dist/preview/{chunk.IJU322EP.js → chunk.LEO2KWLZ.js} +1 -1
- package/dist/preview/{chunk.3HLNRVFY.js → chunk.LNG3CQNI.js} +1 -1
- package/dist/preview/{chunk.27QYTMXP.js → chunk.LSLLKICK.js} +1 -1
- package/dist/preview/{chunk.QXTLZSBL.js → chunk.M5GJHVWZ.js} +1 -1
- package/dist/preview/{chunk.GZA5ZNLJ.js → chunk.MGWMGLWE.js} +1 -1
- package/dist/preview/{chunk.7MXQRSNR.js → chunk.NIVTK2W5.js} +1 -1
- package/dist/preview/chunk.NMIXBH37.js +1 -0
- package/dist/preview/{chunk.6PF5LWRK.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/chunk.OMZ3LDDN.js +1 -0
- package/dist/preview/{chunk.QWY54AVN.js → chunk.OYHQSXNC.js} +1 -1
- package/dist/preview/{chunk.BT6FUNQI.js → chunk.PKUDIWIF.js} +1 -1
- package/dist/preview/chunk.PRD3UNJX.js +7 -0
- package/dist/preview/{chunk.FKLEIR4Y.js → chunk.Q7RQC3F7.js} +1 -1
- package/dist/preview/{chunk.BYVLGDVJ.js → chunk.QGVLJTZS.js} +1 -1
- package/dist/preview/chunk.QPCSS322.js +1 -0
- package/dist/preview/{chunk.ZEC64CK6.js → chunk.R2AG4NHQ.js} +1 -1
- package/dist/preview/{chunk.7XCBIID7.js → chunk.RNEJYIQ7.js} +1 -1
- package/dist/preview/chunk.RPX35VYU.js +1 -0
- package/dist/preview/{chunk.CO2ZPX3D.js → chunk.RYRTKIKB.js} +2 -2
- package/dist/preview/chunk.S5MQVPLF.js +1 -0
- package/dist/preview/{chunk.Z56L6V6Z.js → chunk.S6WHA4CW.js} +1 -1
- package/dist/preview/{chunk.XBV4WO7D.js → chunk.SDU76JU6.js} +1 -1
- package/dist/preview/{chunk.GSZYT6GF.js → chunk.SGKPGVBB.js} +1 -1
- package/dist/preview/chunk.SZ34UAQ3.js +2 -0
- package/dist/preview/chunk.T7XH7FVJ.js +1 -0
- package/dist/preview/{chunk.MI2HL3LQ.js → chunk.TBQOSI4J.js} +1 -1
- package/dist/preview/{chunk.WWR7Y2KE.js → chunk.TBSNNOQU.js} +1 -1
- package/dist/preview/{chunk.CW6IPHRR.js → chunk.TOXWNEOQ.js} +2 -2
- package/dist/preview/{chunk.T4Q6OLZU.js → chunk.UHX4WTM7.js} +1 -1
- package/dist/preview/chunk.UJKT2G6M.js +5 -0
- package/dist/preview/{chunk.Q5XICUDZ.js → chunk.UKAPFIPJ.js} +1 -1
- package/dist/preview/{chunk.7ROWZZN5.js → chunk.UM7GWXEW.js} +1 -1
- package/dist/preview/{chunk.OH2N3SX7.js → chunk.UNCS63AM.js} +1 -1
- package/dist/preview/{chunk.PEXPTDX7.js → chunk.URXSZQSF.js} +1 -1
- package/dist/preview/{chunk.7IXLH7PR.js → chunk.UY7IOVR6.js} +1 -1
- package/dist/preview/{chunk.6XEATXZC.js → chunk.V5FIZIX2.js} +1 -1
- package/dist/preview/chunk.VC3BX2ZF.js +1 -0
- package/dist/preview/{chunk.FCPH4YZN.js → chunk.VSAPJAT3.js} +1 -1
- package/dist/preview/{chunk.MBOOUJOE.js → chunk.VW2VCPJX.js} +1 -1
- package/dist/preview/chunk.W2RCWPLK.js +1 -0
- package/dist/preview/{chunk.ZE4U4JBF.js → chunk.W44VRHKS.js} +2 -2
- package/dist/preview/{chunk.SGRKCQ2X.js → chunk.WAB7UDHU.js} +1 -1
- package/dist/preview/chunk.WBHM5I3I.js +1 -0
- package/dist/preview/chunk.WM2LWHTJ.js +1 -0
- package/dist/preview/{chunk.ZE6LJVVN.js → chunk.WPOTEXJZ.js} +1 -1
- package/dist/preview/{chunk.RPDTWQKA.js → chunk.WSTBCWW7.js} +3 -3
- package/dist/preview/{chunk.XFQUVMRI.js → chunk.XMCFZD3A.js} +1 -1
- package/dist/preview/chunk.XWAMQPUM.js +25 -0
- package/dist/preview/{chunk.IQ3LUSD6.js → chunk.XXEYRHRG.js} +1 -1
- package/dist/preview/{chunk.CTSPNTDX.js → chunk.Y5ARSVH4.js} +1 -1
- package/dist/preview/{chunk.DQR45N7V.js → chunk.Z6TMIAAB.js} +1 -1
- package/dist/preview/chunk.ZBR2QY67.js +104 -0
- package/dist/preview/chunk.ZEAH57AZ.js +1 -0
- package/dist/preview/{chunk.FLMNHV6A.js → chunk.ZJ2VS4M4.js} +1 -1
- package/dist/preview/chunk.ZTIF23VF.js +1 -0
- package/dist/preview/index.html +49 -45
- package/dist/preview/page.js +2 -34
- package/package.json +6 -6
- package/dist/preview/chunk.22E4GKYU.js +0 -1
- package/dist/preview/chunk.2JMJTREH.js +0 -1
- package/dist/preview/chunk.3JATXDSP.js +0 -1
- package/dist/preview/chunk.4C65DXZB.js +0 -1
- package/dist/preview/chunk.4HAGPMY6.js +0 -117
- package/dist/preview/chunk.4ZSHTUNK.js +0 -1
- package/dist/preview/chunk.5BJW4IPW.js +0 -1
- package/dist/preview/chunk.63DI7XNE.js +0 -21
- package/dist/preview/chunk.64MP7636.js +0 -1
- package/dist/preview/chunk.6K4JBLOP.js +0 -1
- package/dist/preview/chunk.7L6LYXCV.js +0 -25
- package/dist/preview/chunk.7MQ7UWVW.js +0 -5
- package/dist/preview/chunk.AXJJUCWT.js +0 -1
- package/dist/preview/chunk.CXJXVBGF.js +0 -1
- package/dist/preview/chunk.E5PHLNXR.js +0 -1
- package/dist/preview/chunk.EPPAFWP7.js +0 -5
- package/dist/preview/chunk.GAFYE37S.js +0 -3
- package/dist/preview/chunk.GNPYSMHA.js +0 -1
- package/dist/preview/chunk.HMABYAZR.js +0 -1
- package/dist/preview/chunk.IWUSCCZN.js +0 -1
- package/dist/preview/chunk.K6SPN4D6.js +0 -7
- package/dist/preview/chunk.KBMVUIWR.js +0 -6
- package/dist/preview/chunk.KG5R4GTK.js +0 -1
- package/dist/preview/chunk.LBIDNJ6G.js +0 -1
- package/dist/preview/chunk.MXU3VQSQ.js +0 -1
- package/dist/preview/chunk.NQTCOBOQ.js +0 -1
- package/dist/preview/chunk.O4X5WJIC.js +0 -1
- package/dist/preview/chunk.ORKXXLWD.js +0 -1
- package/dist/preview/chunk.OUN2H3TR.js +0 -1
- package/dist/preview/chunk.QJUFVEAU.js +0 -1
- package/dist/preview/chunk.RY4E4JRI.js +0 -1
- package/dist/preview/chunk.S6BZXNMV.js +0 -1
- package/dist/preview/chunk.U3ETEQDO.js +0 -1
- package/dist/preview/chunk.VCOIFBUE.js +0 -1
- package/dist/preview/chunk.VP35BUUZ.js +0 -349
- package/dist/preview/chunk.XVWJD2DG.js +0 -2
- package/dist/preview/chunk.YQDIVHCH.js +0 -1
- package/dist/preview/chunk.YWVOACSX.js +0 -5
- package/dist/preview/chunk.ZHRW2UF4.js +0 -1
- package/dist/preview/chunk.ZUJZVK2X.js +0 -1
|
@@ -1,117 +0,0 @@
|
|
|
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 pt,B as ye,C as Dn,D as Be,E as ze,F as oi,G as Kn,H as Te,I as si,J as li,K as W,L as ut,M as vt,N as di,O as bt,P as Xt,Q as ci,R as ae,S as ie,T as qn,a as _,b as xe,c as Q,d as zt,e as Hn,f as Wn,g as ct,h as ee,i as be,j as re,k as L,l as ne,m as G,n as Pe,o as _t,p as Ae,q as ue,r as ai,s as wt,t as Yt,u as Z,v as We,w as ri,x as Qt,y as Le,z as ii}from"./chunk.C3DX4LWD.js";import{b as In,c as ti,d as ni,e as Zt,g as X}from"./chunk.EPPAFWP7.js";import{a as Xr,d as Jr,e as ei}from"./chunk.UGFDSE37.js";import{a as jr,c as zr,f as _r,g as Yr,i as Qr,j as Zr}from"./chunk.O4X5WJIC.js";import{a as Hr,b as Wr,c as Dr,d as Fn}from"./chunk.CO2ZPX3D.js";import{b as Ir}from"./chunk.QXTLZSBL.js";import{a as Kr,b as qr,d as Gt,e as Br,f as Gr,i as Ut}from"./chunk.4ZHUGSJL.js";import{a as Vt,b as jt}from"./chunk.PXQVXBNG.js";import{a as Ft,b as ja,c as za,d as It,e as _a}from"./chunk.BYVE2NQY.js";import{b as ir,c as mr,e as fr,f as En}from"./chunk.X5WB4GJ4.js";import{a as qt,b as Bt,c as $r,e as Or}from"./chunk.27QYTMXP.js";import{a as je,b as dr,c as cr,d as pr,e as ur,f as gr}from"./chunk.VCOIFBUE.js";import{m as Fr}from"./chunk.FLMNHV6A.js";import{a as br,b as kr,c as Sr,e as Nr,f as On,h as Kt}from"./chunk.BT6FUNQI.js";import{d as Ar,e as Cr,f as Rr,g as Lr,n as Tr,o as Mr,q as Er,s as Dt}from"./chunk.MBOOUJOE.js";import{a as Nn}from"./chunk.Q5XICUDZ.js";import{a as Tn,b as ar,c as rr}from"./chunk.UT6642FC.js";import{a as Wt,b as yr,c as hr,d as wr,e as vr}from"./chunk.KG5R4GTK.js";import{c as or,d as sr,j as ht}from"./chunk.QWY54AVN.js";import{r as Mn,s as lr}from"./chunk.EBTYR5CZ.js";import{f as Xa,g as dt,i as Ja,j as er,k as Ln,q as tr,r as nr}from"./chunk.RSYFIL2Z.js";import{b as Ht,c as Ya,d as Qa,e as Za}from"./chunk.R7F6UJVG.js";import{C as $n,K as Ur,N as Vr,e as Ua,f as Va,j as Xi,u as xr,v as Pr}from"./chunk.VP35BUUZ.js";import{$ as pe,Ca as Ga,G as Fe,L as $a,N as Oa,Q as Fa,R as j,S as Rn,V as Ia,W as Ha,_ as Wa,ca as Da,da as Ka,fa as qa,ja as lt,la as Ba,oa as Ot,r as Na,v as He}from"./chunk.7L6LYXCV.js";import{a as Ea}from"./chunk.SDO3U72B.js";import{$c as La,J as ya,U as yt,Vc as An,Wb as Pa,Xa as ka,Za as Sa,Zb as Aa,_b as Ca,_c as Nt,ba as st,bd as $t,ca as se,ea as Se,fa as Mt,gb as Pn,ha as Ve,hb as xa,ja as ha,ka as wa,kd as Cn,la as qe,ld as Ta,pd as Ma,qb as Et,vc as Ra,wa as va,xa as ba}from"./chunk.7MQ7UWVW.js";import{b as I}from"./chunk.AJZBJBMO.js";function pi(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let r=t.schema.tryDefinition(a.kind),i=l=>se(t.schema.tryDefinition(l.kind),l),o=new Map;for(let l of t.graph.allEdges()){let d=l.from===e?"out":l.to===e?"in":null;if(!d)continue;let c=d==="out"?l.to:l.from,p=t.graph.getNode(c);if(!p)continue;let f=(d==="out"?r:t.schema.tryDefinition(p.kind))?.edges?.[l.kind],u=d==="in"?f?.inverse??f?.description:f?.description,k=`${l.kind}|${d}|${u??""}`;(o.get(k)??(()=>{let y={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(k,y),y})()).targets.push({id:p.id,kind:p.kind,label:i(p)})}return{id:e,kind:a.kind,label:i(a),fields:Qa(ht(t.schema,t.graph,a),r),violations:Pn(t.violations(n.context),[e]),actions:Nn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Ht(l.targets.flatMap(c=>{let p=t.graph.getNode(c.id);return p?[p]:[]}),c=>t.schema.tryDefinition(c));return{...l,targets:[...l.targets].map(c=>d.has(c.id)?{...c,apart:d.get(c.id)}:c).sort((c,p)=>c.label.localeCompare(p.label))}})}}function Ze(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:Nn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ui(t,e){let n=(i,o)=>`${i}|${JSON.stringify(o)}`,a=new Map;for(let i of[...t.affordances,...t.withheld]){if(i.provider!=="invariant")continue;let o=n(i.mutation,i.args);a.has(o)||a.set(o,i.rank??Number.MAX_SAFE_INTEGER)}let r=Number.MAX_SAFE_INTEGER;return[...e].map((i,o)=>({repair:i,declared:o})).sort((i,o)=>(a.get(n(i.repair.mutation,i.repair.args??{}))??r)-(a.get(n(o.repair.mutation,o.repair.args??{}))??r)||i.declared-o.declared).map(i=>i.repair)}function Xe(t){let e=t.schema.kinds.map(r=>({kind:r,plural:Ve(t.schema,r),count:t.graph.nodesOfKind(r).length})),n=new Map;for(let r of t.graph.allEdges()){let i=t.graph.getNode(r.from),o=t.graph.getNode(r.to);if(!i||!o)continue;let l=`${r.kind}|${i.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:r}of e){let i=t.schema.tryDefinition(r)?.edges??{};for(let[o,l]of Object.entries(i)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${r}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:r,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${r}|${c}`)??0})}}return{kinds:e,relations:a}}var Ge=I(Fe(),1);var Je=I(Fe(),1),P=I(j(),1),Ji=`
|
|
2
|
-
form:where([data-graview-part="form"]) {
|
|
3
|
-
/* A grid item of the section above it and a grid container for the
|
|
4
|
-
fields below: both halves are allowed to be narrower than what is in
|
|
5
|
-
them, or a big enough text size pushes the page sideways. See the note
|
|
6
|
-
on \`column\` in pages.tsx. */
|
|
7
|
-
display: grid;
|
|
8
|
-
grid-template-columns: minmax(0, 1fr);
|
|
9
|
-
min-width: 0;
|
|
10
|
-
gap: 12px;
|
|
11
|
-
}
|
|
12
|
-
label:where([data-graview-part="field"]),
|
|
13
|
-
div:where([data-graview-part="field"][data-graview-field="date"]) {
|
|
14
|
-
display: grid;
|
|
15
|
-
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
16
|
-
grid-template-columns: minmax(0, 1fr);
|
|
17
|
-
min-width: 0;
|
|
18
|
-
gap: 4px;
|
|
19
|
-
}
|
|
20
|
-
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
21
|
-
grid-auto-flow: column;
|
|
22
|
-
justify-content: start;
|
|
23
|
-
align-items: center;
|
|
24
|
-
}
|
|
25
|
-
span:where([data-graview-part="label"]),
|
|
26
|
-
legend:where([data-graview-part="label"]),
|
|
27
|
-
p:where([data-graview-part="unasked"]) {
|
|
28
|
-
font-size: 0.8125rem;
|
|
29
|
-
color: var(--graview-ink-muted);
|
|
30
|
-
}
|
|
31
|
-
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
32
|
-
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
33
|
-
select:where([data-graview-part="control"]) {
|
|
34
|
-
font: inherit;
|
|
35
|
-
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
36
|
-
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
37
|
-
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
38
|
-
nothing up for anybody. So every picker on the routed face was under
|
|
39
|
-
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
40
|
-
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
41
|
-
\`pnpm engines\`. */
|
|
42
|
-
min-height: 24px;
|
|
43
|
-
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
44
|
-
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
45
|
-
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
46
|
-
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
47
|
-
min-width: 0;
|
|
48
|
-
max-width: 100%;
|
|
49
|
-
text-overflow: ellipsis;
|
|
50
|
-
box-sizing: border-box;
|
|
51
|
-
padding: 7px 10px;
|
|
52
|
-
border-radius: 8px;
|
|
53
|
-
border: 1px solid var(--graview-edge);
|
|
54
|
-
background: var(--graview-panel);
|
|
55
|
-
color: var(--graview-ink);
|
|
56
|
-
}
|
|
57
|
-
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
58
|
-
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
59
|
-
while the native appearance is on \u2014 so every picker on the routed face
|
|
60
|
-
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
61
|
-
asks for, while the same element measured 35 in Chromium. Turning the
|
|
62
|
-
appearance off is what makes the box the size it was asked to be, and it
|
|
63
|
-
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
64
|
-
the scheme is already using. */
|
|
65
|
-
span:where([data-graview-part="picker"]) {
|
|
66
|
-
position: relative;
|
|
67
|
-
display: grid;
|
|
68
|
-
min-width: 0;
|
|
69
|
-
}
|
|
70
|
-
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
71
|
-
appearance: none;
|
|
72
|
-
padding-right: 28px;
|
|
73
|
-
}
|
|
74
|
-
span:where([data-graview-part="chevron"]) {
|
|
75
|
-
position: absolute;
|
|
76
|
-
right: 10px;
|
|
77
|
-
top: 50%;
|
|
78
|
-
transform: translateY(-50%);
|
|
79
|
-
font-size: 0.75rem;
|
|
80
|
-
line-height: 1;
|
|
81
|
-
color: var(--graview-ink-muted);
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
}
|
|
84
|
-
fieldset:where([data-graview-part="group"]) {
|
|
85
|
-
display: grid;
|
|
86
|
-
gap: 10px;
|
|
87
|
-
border: 1px solid var(--graview-edge);
|
|
88
|
-
border-radius: 10px;
|
|
89
|
-
padding: 12px;
|
|
90
|
-
}
|
|
91
|
-
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
92
|
-
div:where([data-graview-part="item"]) {
|
|
93
|
-
display: flex;
|
|
94
|
-
gap: 8px;
|
|
95
|
-
align-items: end;
|
|
96
|
-
}
|
|
97
|
-
button:where([data-graview-part="add"]),
|
|
98
|
-
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
99
|
-
p:where([data-graview-part="refused"]) {
|
|
100
|
-
margin: 0;
|
|
101
|
-
color: var(--graview-warn);
|
|
102
|
-
font-size: 0.875rem;
|
|
103
|
-
}
|
|
104
|
-
`;function eo({title:t,name:e,optional:n,amount:a,value:r,onChange:i}){let o=Ja(a),[l,d]=(0,Je.useState)(()=>typeof r=="number"?er(r,a):""),c=l.trim()!==""&&Ln(l,a)===void 0;return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"number","data-graview-amount":a.format??"unit",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:t}),(0,P.jsxs)("span",{"data-graview-part":"amount",style:{display:"flex",alignItems:"center",gap:6},children:[o.prefix?(0,P.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.prefix}):null,(0,P.jsx)("input",{type:"text",inputMode:"decimal",name:e,required:!n,placeholder:o.placeholder,title:o.hint,"aria-invalid":c||void 0,value:l,onChange:p=>{d(p.target.value),i(Ln(p.target.value,a))},"data-graview-part":"control",style:{flex:1,minWidth:0}}),o.suffix?(0,P.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.suffix}):null]}),c?(0,P.jsxs)("span",{"data-graview-part":"hint",role:"status",children:["Not an amount ",o.hint,": write it like ",o.prefix??"",o.placeholder,o.suffix?` ${o.suffix}`:""]}):null]})}function gi({children:t}){return(0,P.jsxs)("span",{"data-graview-part":"picker",children:[t,(0,P.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var to=t=>({label:Se(t),option:e=>e}),no={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Jt({store:t,spec:e,value:n,onChange:a,prefilled:r,open:i,words:o=to,values:l}){if(e.name in r&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(g=>Se(qe(t.schema.tryDefinition(g),g))).join(" or "):o(e.name).label,c=!(e.optional||e.control==="boolean"),p=c?(0,P.jsxs)(P.Fragment,{children:[d,(0,P.jsx)("span",{"aria-hidden":"true",children:" *"})]}):d;switch(e.control){case"text":case"date":return e.control==="text"&&e.long?(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,P.jsxs)("span",{"data-graview-part":"label",children:[p,e.markdown?(0,P.jsx)("span",{style:{fontWeight:"normal",color:"var(--graview-ink-faint)"},children:" \xB7 Markdown"}):null]}),(0,P.jsx)("textarea",{name:e.name,required:!e.optional,rows:6,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value),"data-graview-part":"control",style:{fieldSizing:"content",minHeight:"7.5em",resize:"vertical",font:"inherit",lineHeight:1.5}})]}):e.control==="date"?(0,P.jsxs)("div",{"data-graview-part":"field","data-graview-field":"date",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gr,{name:e.name,label:o(e.name).label,required:!e.optional,value:typeof n=="string"&&n!==""?n:void 0,time:e.time===!0,instant:e.instant===!0,onChange:a})]}):(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control==="text"&&e.holds?e.holds:e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)("input",{type:e.control==="text"&&e.holds==="phone"?"tel":"text",name:e.name,required:!e.optional,...e.control==="text"&&e.app?{placeholder:"@owner/app or https://\u2026"}:{},...e.control==="text"&&e.holds?{placeholder:no[e.holds]}:{},...e.control==="text"&&e.holds==="phone"?{autoComplete:"tel"}:{},value:typeof n=="string"?n:typeof n=="number"?String(n):"",onChange:g=>a(g.target.value),"data-graview-part":"control"})]});case"number":return e.amount?(0,P.jsx)(eo,{title:p,name:e.name,optional:e.optional,amount:e.amount,value:n,onChange:a}):(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)("input",{type:"number",name:e.name,required:!e.optional,...e.min===void 0?{}:{min:e.min},...e.max===void 0?{}:{max:e.max},...e.step===void 0?{}:{step:e.step},value:typeof n=="number"?n:"",onChange:g=>a(g.target.value===""?void 0:Number(g.target.value)),"data-graview-part":"control"})]});case"boolean":return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,P.jsx)("input",{type:"checkbox",name:e.name,checked:n===!0,onChange:g=>a(g.target.checked),"data-graview-part":"control"}),(0,P.jsx)("span",{"data-graview-part":"label",children:p})]});case"choice":return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gi,{children:(0,P.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:g=>a(g.target.value||void 0),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),(e.options??[]).map(g=>(0,P.jsx)("option",{value:g,children:o(e.name).option(g)},g))]})})]});case"node":{let g=i.find(y=>y.name===e.name)?.candidates,f=new Set(Object.values(r).filter(y=>typeof y=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(y=>t.graph.nodesOfKind(y))).filter(y=>!f.has(y.id)),k=g?g.map(y=>t.graph.getNode(y)).filter(y=>y!==void 0):u,E=Ht(k,y=>t.schema.tryDefinition(y));return(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,P.jsx)("span",{"data-graview-part":"label",children:p}),(0,P.jsx)(gi,{children:(0,P.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:y=>a(y.target.value||void 0),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),k.map(y=>{let x=E.get(y.id);return(0,P.jsxs)("option",{value:y.id,children:[se(t.schema.tryDefinition(y.kind),y),x?` \xB7 ${x}`:""]},y.id)})]})})]})}case"group":{let g=n??{};return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),e.fields.map(f=>(0,P.jsx)(Jt,{store:t,spec:f,value:g[f.name],onChange:u=>a({...g,[f.name]:u}),prefilled:r,open:i,words:o},f.name))]})}case"variant":{let g=n??{},f=typeof g[e.tag]=="string"?g[e.tag]:"",u=e.options.find(k=>k.value===f);return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),(0,P.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,P.jsx)("span",{"data-graview-part":"label",children:Se(e.tag)}),(0,P.jsxs)("select",{value:f,onChange:k=>a({[e.tag]:k.target.value}),"data-graview-part":"control",children:[(0,P.jsx)("option",{value:"",children:"\u2014"}),e.options.map(k=>(0,P.jsx)("option",{value:k.value,children:Se(k.value)},k.value))]})]}),u?.fields.map(k=>(0,P.jsx)(Jt,{store:t,spec:k,value:g[k.name],onChange:E=>a({...g,[k.name]:E}),prefilled:r,open:i,words:o},k.name))]})}case"file":case"list":{let g=e.control==="file"?e:e.item.control==="file"?e.item:void 0;if(g||e.control==="file")return(0,P.jsx)(je,{as:"control",title:c?`${d} *`:d,value:n,onChange:a,several:g!==e,image:g?.image===!0,video:g?.video===!0,label:d});let f=Array.isArray(n)?n:[];return(0,P.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,P.jsx)("legend",{"data-graview-part":"label",children:p}),f.map((u,k)=>(0,P.jsxs)("div",{"data-graview-part":"item",children:[(0,P.jsx)("div",{style:{flex:1},children:(0,P.jsx)(Jt,{store:t,spec:{...e.item,optional:!1},value:u,onChange:E=>a(f.map((y,x)=>x===k?E:y)),prefilled:r,open:i,words:o})}),(0,P.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(f.filter((E,y)=>y!==k)),children:"remove"})]},k)),(0,P.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...f,void 0]),children:"add another"})]})}case"linked":return(0,P.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,P.jsx)(cr,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,P.jsx)(pr,{value:n,onChange:a,start:e.of?l?.[e.of]:void 0,label:`${e.of?o(e.of).label:d} repeats`,name:e.name});case"opaque":return(0,P.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",Se(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function De({store:t,mutation:e,prefilled:n={},open:a=[],onDone:r,principal:i,initial:o,label:l,only:d}){let c=()=>hr(e,t.graph,n),[p,g]=(0,Je.useState)(c),[f,u]=(0,Je.useState)(()=>({...p,...o})),[k,E]=(0,Je.useState)(null),y=i??t.seenFor,x=e.subject&&n[e.subject.arg],N=y?vr(t,y,e,typeof x=="string"?x:void 0):void 0,C=Wt(e.input).filter(K=>(d===void 0||d.includes(K.name))&&!N?.has(K.name)),D=K=>Xa(t.schema,e,K),V=nr(C.filter(K=>K.control==="date").map(K=>K.name)),le=(0,Je.useRef)(void 0),me=(K,Y)=>u(oe=>{let ke={...oe,[K.name]:Y};if(V&&K.name===V.start&&K.control==="date"){let de=b=>typeof b=="string"&&b!==""?b:void 0,fe=de(oe[V.start])??le.current;if(de(Y)){le.current=de(Y);let b=tr(fe,de(Y),de(oe[V.end]),{time:K.time===!0,instant:K.instant===!0});b!==void 0&&(ke[V.end]=b)}}return ke});return(0,P.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:K=>{K.preventDefault();try{t.apply({name:e.name,args:{...wr(yr(C,f),p),...n}},i?{author:i}:{}),E(null);let Y=c();g(Y),u({...Y}),r?.()}catch(Y){E(dt(t.schema,t.allMutations(),Y))}},"data-graview-part":"form",children:[(0,P.jsx)("style",{children:Ji}),C.map(K=>(0,P.jsx)(Jt,{store:t,spec:K,value:f[K.name],values:f,onChange:Y=>me(K,Y),prefilled:n,open:a,words:D},K.name)),k?(0,P.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:k}):null,(0,P.jsx)("button",{type:"submit","data-graview-part":"submit",children:l??e.title??e.name})]})}var kt=I(Fe(),1);var Me=I(j(),1),ro={problems:"Problems",search:"Search",map:"Connections",places:"Pictures","~draft":"A view drawn"},io=t=>{try{return decodeURIComponent(t)}catch{return t}};function oo(t,e,n={}){let{store:a}=t,r=a.schema,i=(n.base??"").replace(/\/$/,""),[o="/",l=""]=e.split("#")[0].split("?"),d=(x,N,C)=>({label:x,href:`${i}${N}`,path:N,...C?{current:C}:{}}),c=x=>{let N=n.registry?.sectionOf(x);return N?[N.path===void 0?{label:N.label}:d(N.label,N.path)]:[]},p=x=>n.registry?.sectionOf(x)?.label,g=x=>{let N=p(x);return N===void 0?{}:{section:N}},[f,u,...k]=o.split("/").filter(Boolean).map(io);if(f===void 0)return{as:"home",label:"Home",trail:[d("Home","/",!0)]};if(f==="places"&&u!==void 0&&k.length===0){let x=new URLSearchParams(l).get("of"),N=new Set(We(a,t.principal)),C=t.views?.places()??[],D=C.find(V=>N.has(V.kind)&&V.as===u&&(!x||_(r,V.kind)===x));if(D){let V=zt(D.as,Nt(D,C)?_(r,D.kind):void 0);return{as:"place",kind:D.kind,label:D.title,...g(D.kind),trail:[...c(D.kind),d(D.title,V,!0)]}}}let E=k.length===0?xe(r,f):void 0;if(E!==void 0){let x=d(Ve(r,E),`/${_(r,E)}`);if(u===void 0)return{as:"list",kind:E,label:x.label,...g(E),trail:[...c(E),{...x,current:!0}]};let N=a.graph.getNode(u),C=N&&N.kind===E?se(r.tryDefinition(E),N):"Nothing lives here";return{as:"record",kind:E,id:u,label:C,...g(E),trail:[...c(E),x,d(C,Q(r,E,u),!0)]}}let y=ro[f]??so((k.at(-1)??u??f).replace(/[-_]+/g," "));return{as:"page",label:y,trail:[d(y,o,!0)]}}var so=t=>t.charAt(0).toUpperCase()+t.slice(1),Bn=(0,kt.createContext)(null);function lo(t){let e=ye(),n=pt("/");return X(t.context.store),oo(t.context,`${e.pathname}${e.search}`,{registry:t.registry,base:n})}var co={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},mi={display:"flex",alignItems:"center",gap:6,minWidth:0},fi={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0,lineHeight:"24px"};function gt({context:t,style:e}){let n=(0,kt.useContext)(Bn),a=(0,kt.useContext)(vt);return bt(a??uo,"trail")||n?.registry?.without().has("trail")?null:(0,Me.jsx)(po,{root:n??{context:t,registry:void 0},context:t,...e?{style:e}:{}})}function po({root:t,context:e,style:n}){let a=lo(t);return a.trail.length<2?null:(0,Me.jsx)(go,{here:a,mark:a.as==="record"?{kind:a.kind,context:e}:void 0,...n?{style:n}:{},"data-testid":"page-trail"})}var uo={count:()=>0,place:()=>()=>{},subscribe:()=>()=>{}};function go({here:t,mark:e,style:n,...a}){let r=t.as==="record"?t.trail.length-2:-1;return(0,Me.jsx)("nav",{"aria-label":"You are here","data-graview-trail":"",style:{minWidth:0,...n},...a,children:(0,Me.jsx)("ol",{style:{...be,listStyle:"none",padding:0,display:"flex",alignItems:"center",gap:6,minWidth:0,overflow:"hidden"},children:t.trail.map((i,o)=>(0,Me.jsxs)("li",{style:i.current?co:{...mi,flexShrink:o===t.trail.length-2?0:1,maxWidth:"100%"},...i.current?{"aria-current":"page"}:{},children:[o>0&&!i.current?(0,Me.jsx)("span",{"aria-hidden":"true",children:"\u203A"}):null,i.current?i.label:i.path!==void 0?(0,Me.jsxs)(W,{to:i.path,style:{...Pe,...mi},...o===r?{"data-testid":"trail-list"}:{},children:[o===r&&e?(0,Me.jsx)(ue,{kind:e.kind,brand:e.context.brand,schema:e.context.store.schema,size:8}):null,(0,Me.jsx)("span",{style:fi,children:i.label})]}):(0,Me.jsx)("span",{style:fi,children:i.label})]},`${o}:${i.label}`))})})}var M=I(j(),1);function Ee(t){let e=t.views;if(!e)return[];let n=new Set(We(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function en(t,e){if(!e.over)return[e.kind];let n=new Set(We(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var et=t=>`place:${t.kind}:${t.as}`;function he(t,e){return zt(e.as,Nt(e,t.views?.places()??[])?_(t.store.schema,e.kind):void 0)}function St(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>st(n,a))}function Gn(t,e,n){let a=(i,o)=>Mt(t.schema,o,i),r=(typeof e=="string"?[e]:e).map(i=>a(St(t,i).length,i)).join(" and ");return n?`${r} across ${a(St(t,n).length,n)}`:r}function Un({context:t,place:e,chosen:n,filter:a}){let{store:r,views:i,invariantContext:o}=t,d=i?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(r.violations(o).flatMap(f=>f.nodeIds))],p=en(t,e).flatMap(f=>St(r,f));if(!d)return null;let g=mo(r,p,a,c);return(0,M.jsx)(Mn,{kind:e.kind,view:e.title,children:(0,M.jsx)(d,{nodes:g,label:e.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...c.length>0?{flagged:c}:{}})})}function mo(t,e,n,a){let r=n?$t({filter:n}).filter??[]:[];return r.length===0?e:Kt(e,{filter:r},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function fo({store:t,views:e,as:n,invariantContext:a}){X(t);let r={store:t,views:e,...a?{invariantContext:a}:{}},i=e.places().find(o=>o.as===n);return i?(0,M.jsx)(Un,{context:r,place:i}):null}function yo({context:t,kind:e}){let{store:n,views:a,invariantContext:r}=t,i=St(n,e),o=n.schema.tryDefinition(e),l=Z(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(r).flatMap(k=>k.nodeIds))];if(c&&!lt(c))return(0,M.jsx)(Mn,{kind:e,children:(0,M.jsx)(c,{nodes:i,label:l,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...p.length>0?{flagged:p}:{}})});let g=a?.resolve(e,{cardinality:"one",fidelity:"summary"})?.view,f=8,u=i.slice(0,f);return(0,M.jsxs)("div",{"data-testid":"kind-sheet",style:g?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[u.map(k=>g?(0,M.jsx)(g,{node:k,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(k.id)?{flagged:[k.id]}:{}},k.id):(0,M.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:se(o,k)},k.id)),i.length>f?(0,M.jsxs)("span",{style:{...L,alignSelf:"center",padding:"0 6px"},children:["+",i.length-f," more ",l.toLowerCase()]}):null]})}function Vn(t){let{store:e}=t,n=ri(t),a=Ee(t),r=An([...a].sort((o,l)=>n.indexOf(o.kind)-n.indexOf(l.kind))).filter(o=>!o.hidden),i=new Set(r.flatMap(o=>o.over??[o.kind]));return[...r.map(o=>({key:et(o),kind:o.kind,title:La(o,a,e.schema),to:he(t,o),place:o})),...Qt(t).filter(o=>!i.has(o)).map(o=>({key:`kind:${o}`,kind:o,title:Z(e,o),to:`/${_(e.schema,o)}`}))]}var yi=.72,ho=540,hi=16/10;function wo(t){let e=(0,Ge.useRef)(null),[n,a]=(0,Ge.useState)(t);return(0,Ge.useLayoutEffect)(()=>{let r=e.current;if(!r||typeof ResizeObserver>"u")return;let i=()=>{let l=r.getBoundingClientRect().width;l>0&&a(d=>Math.abs(d-l)<.5?d:l)};i();let o=new ResizeObserver(i);return o.observe(r),()=>o.disconnect()},[]),{ref:e,width:n}}function vo(t){for(let e=t.parentElement;e;e=e.parentElement)if(/(auto|scroll)/.test(getComputedStyle(e).overflowY))return e;return null}function bo(t){let[e,n]=(0,Ge.useState)(()=>typeof IntersectionObserver>"u");return(0,Ge.useLayoutEffect)(()=>{let a=t.current;if(e||!a)return;let r=new IntersectionObserver(i=>{i.some(o=>o.isIntersecting)&&(r.disconnect(),n(!0))},{root:vo(a),rootMargin:"50% 0px"});return r.observe(a),()=>r.disconnect()},[e,t]),e}function jn({context:t,entry:e}){let{store:n,brand:a,principal:r}=t,{ref:i,width:o}=wo(ho),l=bo(i),d=o/yi,c=St(n,e.kind),p=n.schema.tryDefinition(e.kind),g=c.length===0?Ze(n,e.kind,{...r?{principal:r}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,f=e.place!==void 0;return(0,M.jsxs)(W,{to:e.to,"data-testid":f?"place-card":"kind-card",className:"graview-gallery-card",style:{...Pe,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,M.jsxs)("span",{ref:i,"data-testid":f?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${hi}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,M.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/hi,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${yi})`,transformOrigin:"0 0"},children:l?(0,M.jsx)(Gt.Provider,{value:null,children:e.place?(0,M.jsx)(Un,{context:t,place:e.place}):(0,M.jsx)(yo,{context:t,kind:e.kind})}):null}),c.length===0?(0,M.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,M.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,M.jsxs)("span",{style:{fontFamily:Wn,fontWeight:"var(--graview-weight-display)"},children:["No ",Z(n,e.kind).toLowerCase()," yet"]}),g?(0,M.jsxs)("span",{style:L,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,M.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,M.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[f?null:(0,M.jsx)(ue,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,M.jsx)("span",{style:{fontFamily:Wn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,M.jsxs)("span",{style:L,children:[e.place?Gn(n,en(t,e.place),e.place.across):Gn(n,e.kind),!f&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var wi={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},ko=`
|
|
105
|
-
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
|
-
.graview-gallery-card:hover > span:first-child,
|
|
107
|
-
.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); }
|
|
108
|
-
`;function zn({context:t}){X(t.store);let e=Vn(t);return e.length===0?null:(0,M.jsxs)("section",{style:wi,"data-testid":"gallery",children:[(0,M.jsx)("style",{children:ko}),e.map(n=>(0,M.jsx)(jn,{context:t,entry:n},n.key))]})}function _n({context:t}){let{store:e}=t;X(e);let n=An(Ee(t)).filter(r=>!r.hidden),a=Vn(t);return(0,M.jsxs)(ae,{context:t,style:ct,children:[(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)("p",{style:be,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,M.jsx)(ie,{context:t,children:"Pictures"}),(0,M.jsx)("p",{style:re,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,M.jsx)("div",{style:wi,"data-testid":"places",children:a.map(r=>(0,M.jsx)(jn,{context:t,entry:r},r.key))}):null]})}function Yn({context:t}){let{store:e,principal:n}=t;X(e);let a=ze(),r=Be(),[i]=ut(),o=decodeURIComponent(a.as??""),[l,d]=(0,Ge.useState)(null),c=i.get("of"),p=i.get("filter"),f=Ee(t).find(C=>C.as===o&&(!c||_(e.schema,C.kind)===c));if(!f)return(0,M.jsxs)(ae,{context:t,children:[(0,M.jsx)(ie,{context:t,children:"No picture is called that."}),(0,M.jsx)("p",{style:re,children:(0,M.jsxs)(W,{to:"/places",style:G,children:["The pictures there are ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=Z(e,f.kind),k=t.views?.resolve(f.kind,{cardinality:"many",fidelity:"full"},f.as)?.view,E=k?.flows===!0,y=k?.creates!==!1,x=Ze(e,f.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),N=y?x.actions.affordances.map(C=>({affordance:C,mutation:e.allMutations().find(D=>D.name===C.mutation)})).filter(C=>C.mutation!==void 0):[];return(0,M.jsxs)(ae,{context:t,style:ct,children:[(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)(gt,{context:t}),(0,M.jsx)(ie,{context:t,children:f.title}),(0,M.jsxs)("p",{style:re,"data-testid":"place-lede",children:[Gn(e,en(t,f),f.across),"."]}),p&&!E?(0,M.jsxs)("p",{style:{...L,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(C=>C.replace(":"," is ")).join(" and ")}. `,(0,M.jsx)(W,{to:`?${(()=>{let C=new URLSearchParams(i);return C.delete("filter"),C.toString()})()}`,style:{...G,...L},children:"Show all"})]}):null,(0,M.jsx)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:en(t,f).map((C,D)=>(0,M.jsxs)(W,{to:`/${_(e.schema,C)}`,style:{...G,...L},...D===0?{"data-testid":"place-as-list"}:{},children:["All ",(C===f.kind?u:Z(e,C)).toLowerCase()," as a list ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},C))})]}),(0,M.jsx)("div",{"data-testid":"place-lens","data-flows":E?"":void 0,style:E?{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:C=>{let D=C.target?.closest("[data-graview-pick]"),V=D?.getAttribute("data-graview-pick"),le=D?.getAttribute("data-graview-joins");if(le)try{let K=JSON.parse(le);if(Array.isArray(K)&&K.every(Y=>typeof Y=="string")){C.preventDefault(),d({at:et(f),ids:K});return}}catch{}if(!V)return;let me=e.graph.getNode(V);me&&(C.preventDefault(),r(Q(e.schema,me.kind,V)))},children:(0,M.jsx)(Un,{context:t,place:f,filter:p,...l?.at===et(f)?{chosen:l.ids}:{}})}),N.length>0?(0,M.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:N.map(({affordance:C,mutation:D})=>(0,M.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,M.jsx)("h2",{style:ee,children:D.title??D.name}),D.description?(0,M.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:D.description}):null,(0,M.jsx)(De,{store:e,mutation:D,prefilled:C.args,open:C.open,label:C.label,...n?{principal:n}:{}})]},C.id))}):null]})}function So(t,e=document){let n=Vt(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(r=>r.shadowRoot?[r.shadowRoot]:[])];for(let r of a)for(let i of r.querySelectorAll("[id], [data-section]")){let o=i.getAttribute("data-section")??i.id;if(o===t||Vt(o)===n)return i}for(let r of a)for(let i of r.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(Vt(i.textContent??"")===n)return i;return null}function vi(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,r=()=>{let i=So(t,e.root??document);if(i){i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.scrollIntoView?.({block:"start"}),i.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(r))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(r)}),()=>cancelAnimationFrame(a)}var z=I(Fe(),1);var tn=I(Fe(),1);var tt=I(j(),1);function bi({context:t}){return pe()?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(xo,{context:t}),(0,tt.jsx)(zr,{face:"pages",on:t.quickAsk??!0})]}):null}function xo({context:t}){let{store:e}=t,n=pe(),{pathname:a}=ye(),r=(0,tn.useRef)(n?.setSelection);return r.current=n?.setSelection,(0,tn.useEffect)(()=>{let i=r.current;if(!i)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[He(p.kind)]:[]}let c=o?xe(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[Na(c)]:[]})();i(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var we=I(Fe(),1);var Si=I(Xi(),1);var ge=I(j(),1);var Po=(0,we.lazy)(Ot(Ea(()=>(__graviewPreload(import.meta.url,["./chunk.EPPAFWP7.js","./chunk.UGFDSE37.js","./chunk.O4X5WJIC.js","./chunk.CO2ZPX3D.js","./chunk.QXTLZSBL.js","./chunk.4ZHUGSJL.js","./chunk.DJ3BD7AZ.js","./chunk.S2MP53RO.js","./chunk.7MXQRSNR.js","./chunk.BYVE2NQY.js","./chunk.X5WB4GJ4.js","./chunk.5J2HETUO.js","./chunk.6XEATXZC.js","./chunk.5TBK44MK.js","./chunk.27QYTMXP.js","./chunk.VCOIFBUE.js","./chunk.RQBX7M7Q.js","./chunk.FLMNHV6A.js","./chunk.CTSPNTDX.js","./chunk.BT6FUNQI.js","./chunk.MBOOUJOE.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QWY54AVN.js","./chunk.T4Q6OLZU.js","./chunk.R2B2ZAWI.js","./chunk.7XCBIID7.js","./chunk.MI2HL3LQ.js","./chunk.TMBFLZNH.js","./chunk.GZHZLJBF.js","./chunk.EBTYR5CZ.js","./chunk.OJGHDWI6.js","./chunk.OWL5GZ6U.js","./chunk.RSYFIL2Z.js","./chunk.R7F6UJVG.js","./chunk.DYW4D74X.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.KBMVUIWR.js")).then(t=>({default:t.TakeBack})))));function Ao({context:t,docked:e,at:n,...a}){let{store:r}=t,i=X(r),[o]=(0,we.useState)(()=>r.batches().length),l=(0,we.useRef)(!1);return l.current||=i>0||!e&&o>0,l.current?(0,ge.jsx)(we.Suspense,{fallback:null,children:(0,ge.jsx)(Po,{context:t,docked:e,at:n,since:o,...a})}):null}function Co(t,e,n){let{store:a,principal:r,embedded:i}=t;(0,we.useEffect)(()=>{if(!n)return;let o=l=>{if(!ei(l))return;let d=l.target,c=d instanceof Node&&e.current?.contains(d),p=d===document.body||d===document.documentElement||d===document;if(!(!c&&!(p&&!i))&&Xr(a,r)){l.preventDefault();try{Jr(a,r)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,r,i,e,n])}function xi({context:t,registry:e,root:n,children:a}){let r=(0,we.useMemo)(di,[]),i=e?.without()??new Set;return Co(t,n,!i.has("undo")),(0,ge.jsxs)(vt.Provider,{value:r,children:[(0,ge.jsx)(Ro,{context:t,placed:r,without:i}),a]})}function Ro({context:t,placed:e,without:n}){let[a,r]=(0,we.useState)(!1);(0,we.useLayoutEffect)(()=>r(!0),[]);let i=bt(e,"find"),o=bt(e,"undo"),l=ye(),d=Pr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?xe(t.store.schema,c[0]):void 0)!==void 0;return(0,ge.jsxs)(ge.Fragment,{children:[!i&&!n.has("find")&&d?(0,Si.createPortal)((0,ge.jsx)(ki,{context:t,narrowsLists:g}),d.slot):null,!i&&!n.has("find")&&!d?(0,ge.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,ge.jsx)(ki,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ge.jsx)(Ao,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ge.jsx)(ii,{context:t,own:d.own}):null]})}function ki({context:t,narrowsLists:e}){return(0,ge.jsx)(vt.Provider,{value:null,children:(0,ge.jsx)(qn,{context:t,narrowsLists:e})})}var J=I(Fe(),1);var Ce=I(j(),1),Lo=500,To=10;function nn(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function Mo(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function Pi(t){let e=t.closest('a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])');if(e)return e;let n=document.activeElement;return n instanceof HTMLElement&&n!==document.body?n:null}function Ai({context:t,root:e,children:n}){return pe()===null?(0,Ce.jsx)(Ce.Fragment,{children:n}):(0,Ce.jsx)(Eo,{context:t,root:e,children:n})}function Eo({context:t,root:e,children:n}){let{setMenuAt:a}=Wa(),{store:r}=t,i=r.schema,o=Be(),{pathname:l,search:d}=ye(),c=pt("/").replace(/\/$/,""),p=(0,J.useCallback)((b,h)=>t.views?.places().find(T=>T.as===b&&(h===null||T.kind===h)),[t.views]),g=(0,J.useCallback)((b,h)=>{let[T="",F,m]=b.split("/").filter(Boolean).map(H=>{try{return decodeURIComponent(H)}catch{return H}});if(m!==void 0)return null;if(T==="places"&&F!==void 0){let H=p(F,new URLSearchParams(h).get("of"));return H?{face:"pages",place:H.as,about:[He(H.kind)],title:H.title}:null}let R=xe(i,T);return R?F===void 0?{face:"pages",about:[He(R)],title:Ve(i,R)}:r.graph.getNode(F)?{face:"pages",on:F,about:[F]}:null:null},[i,r,p]),f=(0,J.useCallback)(b=>{let h=b.href;try{let T=new URL(h,location.href);if(T.origin===location.origin&&(c===""||T.pathname===c||T.pathname.startsWith(`${c}/`))){let F=g(T.pathname.slice(c.length),T.search);if(F)return{...F,href:h}}}catch{}return{face:"pages",about:[],href:h}},[c,g]),u=(0,J.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),k=(0,J.useCallback)(b=>{let h=u(),T=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(T&&h.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...h,field:T};let F=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(F)return{...h,act:F};let m=b.closest("a[href]"),R=b.closest("[data-graview-listed]"),H=[b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick"),R&&(!m||R.contains(m)&&m.classList.contains("graview-spec-item-link"))?R.getAttribute("data-graview-listed"):null].map(Ke=>Ke?r.graph.getNode(Ke):void 0).find(Boolean);if(H)return{face:"pages",on:H.id,about:[H.id],href:`${c}${Q(i,H.kind,H.id)}`};if(m)return f(m);let te=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return te&&r.graph.getNode(te)?{face:"pages",on:te,about:[te]}:h},[u,f,r,i,c]),E=(0,J.useCallback)(b=>{let h=e.current;if(h===null||!h.contains(b)||nn(b)||b.closest("[data-graview-popover]"))return null;let T=k(b);return{face:"pages",on:T.on,about:T.about??[],field:T.field,place:T.place,href:T.href,act:T.act,element:Pi(b)}},[k,e]),y=(0,J.useCallback)((b,h,T)=>{let F=k(b);a({...F,x:Math.round(h),y:Math.round(T),returnTo:Pi(b)})},[k,a]),x=(0,J.useCallback)(b=>{let h=b.getBoundingClientRect();y(b,h.left+Math.min(16,h.width/2),Math.min(h.bottom,h.top+36))},[y]),N=(0,J.useRef)(0),C=(0,J.useRef)(null),D=(0,J.useRef)(!1),V=()=>{C.current&&clearTimeout(C.current.timer),C.current=null};(0,J.useEffect)(()=>V,[]),(0,J.useEffect)(()=>{let b=h=>{if(h.defaultPrevented||!(h.key==="ContextMenu"||h.key==="F10"&&h.shiftKey))return;let T=e.current,F=h.target instanceof Element?h.target:null,m=F===null||F===document.body||F===document.documentElement,R=T!==null&&F!==null&&T.contains(F);if(!R&&!(m&&document.querySelector("[data-graview-face='pages']")===T)||nn(F)||F?.closest("[data-graview-popover]"))return;h.preventDefault(),N.current=Date.now();let H=R&&F instanceof HTMLElement?F:T?.querySelector("[data-graview-page-title], main h1, main")??null;H&&x(H)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,x]),(0,J.useEffect)(()=>{let b=e.current;if(!b)return;let h=T=>{let F=T.detail;F&&a({...F,face:"pages"})};return b.addEventListener(Rn,h),()=>b.removeEventListener(Rn,h)},[e,a]);let le=(0,J.useMemo)(()=>b=>{if(b.face!=="pages")return null;let h=[],T=b.on===void 0?void 0:r.graph.getNode(b.on),F=b.place===void 0?void 0:t.views?.places().find($e=>$e.as===b.place),m=T?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!F?No(b.about[0]):void 0,R=T?Q(i,T.kind,T.id):F?he(t,F):m?`/${_(i,m)}`:void 0,H=R!==void 0&&l===R.split("?")[0];R!==void 0&&!H&&h.push({id:"open",label:"Open",run:()=>o(R)});let te=R!==void 0?`${c}${R}`:b.href;te!==void 0&&h.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(te,"_blank","noopener")});let Ke=T?`#focus=${encodeURIComponent(T.id)}`:F?`#focus=${encodeURIComponent(He(F.kind))}&view=${encodeURIComponent(F.as)}`:m?`#focus=${encodeURIComponent(He(m))}`:void 0;if(Ke!==void 0&&(t.overview||!t.embedded)){let $e=t.overview;h.push({id:"in-the-scene",label:"Show in the scene",run:()=>$e?$e(Ke):location.assign(`${t.sceneHref??"/"}${Ke}`)})}return T===void 0&&b.href===void 0&&h.push({id:"find",label:"Find\u2026",run:()=>{let $e=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');$e&&$e.offsetParent!==null?$e.focus():o("/search")}}),h.length>0?{id:"pages",items:h}:null},[r,i,t,l,c,o,e]),me=(0,J.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let h=r.graph.getNode(b.on),T=b.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!h||!(T instanceof HTMLElement)||!T.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ha(i.tryDefinition(h.kind),b.field)}\u201D`,run:()=>T.click()}]}},[r,i,e]),K=Yr(),Y=mr(),oe=Ir(),ke=(0,J.useCallback)((b,h)=>{l===he(t,b).split("?")[0]&&o(h?he(t,h):"/")},[l,t,o]),de=Zr(ke),fe=(0,J.useMemo)(()=>[me,oe,le,...de?[de]:[],...Y?[Y]:[],...K?[K]:[]],[me,oe,le,de,Y,K]);return(0,Ce.jsxs)(lr,{sections:fe,children:[(0,Ce.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let h=b.target;b.shiftKey||nn(h)||Mo(h)||(b.preventDefault(),!h.closest("[data-graview-popover]")&&(Date.now()-N.current<700||(b.clientX===0&&b.clientY===0&&h instanceof HTMLElement?x(h):y(h,b.clientX,b.clientY))))},onPointerDown:b=>{if(D.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let h=b.target;if(nn(h)||h.closest("[data-graview-choose], [data-graview-popover]"))return;V();let{clientX:T,clientY:F}=b;C.current={x:T,y:F,timer:setTimeout(()=>{C.current=null,D.current=!0,N.current=Date.now(),y(h,T,F)},Lo)}},onPointerMove:b=>{let h=C.current;h&&Math.hypot(b.clientX-h.x,b.clientY-h.y)>To&&V()},onPointerUp:V,onPointerCancel:V,onClickCapture:b=>{D.current&&(D.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Ce.jsx)($o,{openAt:x,readyAt:E}),(0,Ce.jsx)(Qr,{placement:"page"}),(0,Ce.jsx)(fr,{})]})}function No(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function $o({openAt:t,readyAt:e}){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)(jr,{placement:"menu",openActs:t,aimAt:e})})}var B=I(j(),1);function Ci(t,e){return e==="*"?{label:"anything",path:null}:{label:Z(t,e),path:`/${_(t.schema,e)}`}}function Oo({context:t,relation:e}){let{store:n}=t,a=Ci(n,e.from),r=Ci(n,e.to),i=o=>o.path?(0,B.jsx)(W,{to:o.path,style:{...Pe,fontWeight:550},children:o.label}):(0,B.jsx)("span",{children:o.label});return(0,B.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,B.jsx)(_r,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,B.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,B.jsxs)("span",{children:[i(a)," ",(0,B.jsxs)("span",{style:L,"data-graview-speaks-ids":"",children:[Se(e.edgeKind)," \u2192"]})," ",i(r)]}),e.description||e.inverse?(0,B.jsxs)("span",{style:L,children:[e.description?Le(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),r.path?(0,B.jsx)(W,{to:`${r.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...G,...L,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${r.label.toLowerCase()} that have this`,children:e.count}):(0,B.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function Ri({context:t,heading:e=!0}){let{store:n}=t,a=new Set(We(n,t.principal)),r=Xe(n).relations.filter(i=>a.has(i.from)&&(i.to==="*"||a.has(i.to)));return r.length===0?null:(0,B.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,B.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,B.jsx)("h2",{style:ee,children:(0,B.jsx)(W,{to:"/map",style:Pe,children:"Connections"})}),(0,B.jsx)("span",{style:L,children:r.length===1?"1 relation":`${r.length} relations`})]}):null,(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:r.map(i=>(0,B.jsx)(Oo,{context:t,relation:i},`${i.edgeKind}|${i.from}|${i.to}`))})]})}function Qn({context:t}){let{store:e}=t;X(e);let n=new Set(We(e,t.principal)),a=Xe(e),r=a.relations.filter(i=>n.has(i.from));return(0,B.jsxs)(ae,{context:t,children:[(0,B.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,B.jsx)("p",{style:be,children:r.length===0?"No relations":`${r.length} ${r.length===1?"relation":"relations"}`}),(0,B.jsx)(ie,{context:t,children:"Connections"}),(0,B.jsx)("p",{style:re,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,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(i=>n.has(i.kind)).map(i=>(0,B.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,B.jsx)(ue,{kind:i.kind,brand:t.brand,schema:e.schema,size:7}),(0,B.jsx)(W,{to:`/${_(e.schema,i.kind)}`,style:G,children:i.plural}),(0,B.jsx)("span",{style:L,children:i.count})]},i.kind))}),(0,B.jsx)(Ri,{context:t,heading:!1})]})}function Li({context:t}){let n=[...pe()?.robots.values()??[]].filter(r=>r.mode==="asking"&&r.say);if(n.length===0)return null;let{store:a}=t;return(0,B.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,B.jsx)("h2",{style:ee,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,B.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(r=>{let i=r.at?a.graph.getNode(r.at):void 0;return(0,B.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,B.jsx)("span",{children:r.say}),i?(0,B.jsxs)(W,{to:Q(a.schema,i.kind,i.id),style:{...G,...L},children:[se(a.schema.tryDefinition(i.kind),i)," \u2192"]}):null]},r.participant)})})]})}var U=I(j(),1);function Zn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:r}=t;X(n);let i=n.violations(r),o=`${i.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,l=[...n.log.all()].slice(-5).reverse(),c=Qt(t).map(x=>({kind:x,members:n.graph.nodesOfKind(x).filter(N=>st(n.schema.tryDefinition(x),N))})),p=c.filter(x=>x.members.length>0),g=c.map(x=>({entry:x,creator:n.allMutations().find(N=>(N.creates??[]).includes(x.kind)&&n.permits({name:N.name,args:{}},t.principal).ok)})).find(x=>x.creator!==void 0),f=p.length===0?"Nothing here yet.":`${p.map(x=>Mt(n.schema,x.kind,x.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(x=>n.graph.nodesOfKind(x).length>0);if(u&&k){let x=a?.subtitle?(0,U.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,N=u[Symbol.for("graview.home-blocks")]===!0;return(0,U.jsx)(ae,{context:t,style:ct,children:(0,U.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[N?null:x,i.length>0?(0,U.jsx)(W,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:o}):null,(0,U.jsx)(Gr.Provider,{value:N?x:null,children:(0,U.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let E=new Set(We(n,t.principal)),y=Xe(n).relations.filter(x=>E.has(x.from)&&(x.to==="*"||E.has(x.to)));return(0,U.jsxs)(ae,{context:t,style:ct,children:[(0,U.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,U.jsx)("p",{style:{...L,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,U.jsx)(ie,{context:t,"data-testid":"standing",children:f}),(0,U.jsxs)("p",{style:{...re,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,U.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,U.jsx)(W,{to:`/${_(n.schema,g.entry.kind)}`,style:G,children:Z(n,g.entry.kind)}),"."]}):null,i.length===0?(0,U.jsx)("span",{children:"All rules hold."}):(0,U.jsx)(W,{to:"/problems",style:{...G,color:"var(--graview-warn)"},children:o})]})]}),(0,U.jsx)(zn,{context:t}),(0,U.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"kinds",children:[(0,U.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,U.jsx)("h2",{style:ee,children:"What is here"}),y.length>0?(0,U.jsxs)(W,{to:"/map",style:{...G,...L,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",y.length===1?"1 relation":`${y.length} relations`," ",(0,U.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:x,members:N})=>(0,U.jsx)("li",{style:{maxWidth:"100%"},children:(0,U.jsxs)(W,{to:`/${_(n.schema,x)}`,style:{...Pe,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,U.jsx)(ue,{kind:x,brand:a,schema:n.schema,size:7}),(0,U.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:Z(n,x)}),(0,U.jsx)("span",{style:{...L,fontVariantNumeric:"tabular-nums"},children:N.length===0?"none yet":yt(N.length)})]})},x))})]}),l.length>0?(0,U.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,U.jsx)("h2",{style:ee,children:"Recently"}),(0,U.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(x=>(0,U.jsxs)("li",{style:L,children:[(0,U.jsx)("span",{style:{color:"var(--graview-ink)"},children:x.intent})," \u2014 ",wt(x,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},x.id))})]}):null]})}var Ne=I(Fe(),1);var nt=I(j(),1);function an({context:t,withheld:e,style:n,testId:a}){let r=pe(),i=Ca(e,t.signIn??r?.signIn);return i?(0,nt.jsx)("p",{style:{...n,margin:0},children:(0,nt.jsx)("button",{type:"button","data-testid":"sign-in",onClick:()=>i.run(),style:Ae,children:i.label})}):e.length===0?null:(0,nt.jsx)("ul",{style:{...n,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},...a?{"data-testid":a}:{},children:e.map(o=>(0,nt.jsxs)("li",{style:L,children:[(0,nt.jsx)("s",{children:o.label})," \u2014 ",o.refusal.message]},o.id))})}var $=I(j(),1);function Xn({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;X(e);let[i]=ut(),o=i.get("q")??"",l=typeof r?.today=="string"?r.today:void 0,d=Er(e,o,{...a?{principal:a}:{},places:Ee(t),flagged:new Set(e.violations(r).flatMap(u=>u.nodeIds)),...l?{today:l}:{},limit:200}),c=d.hits.filter(u=>u.about==="node"),p=d.hits.filter(u=>u.about==="kind"||u.about==="place"||u.about==="rule"),g=[...new Set(c.map(u=>u.kind))],f=o.trim();return(0,$.jsxs)(ae,{context:t,children:[(0,$.jsx)("style",{children:_t}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:be,children:"Search"}),(0,$.jsx)(ie,{context:t,"data-testid":"search-heading",children:f.length===0?"Find anything by its name":d.hits.length===0?(0,$.jsxs)($.Fragment,{children:["Nothing here is called \u201C",f,"\u201D."]}):(0,$.jsxs)($.Fragment,{children:[Fo(e,d.byKind)," for \u201C",f,"\u201D"]})}),f.length>0?(0,$.jsxs)("p",{style:{...L,margin:0},"data-testid":"search-searched",children:[Dt(e.schema,d.searched),d.conditions.filter(u=>u.key!=="is"&&u.admittedBy.length<d.searched.kinds.length).map(u=>(0,$.jsxs)("span",{children:[" ",u.key,":",u.value," narrows"," ",u.admittedBy.length===0?"nothing here":u.admittedBy.map(k=>Z(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.jsxs)("p",{style:re,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,$.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,$.jsx)("code",{children:"is:any"})," includes what is past."]})]}),p.length>0?(0,$.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:p.map(u=>(0,$.jsx)("li",{"data-testid":"search-hit","data-about":u.about,children:u.about==="kind"?(0,$.jsxs)(W,{to:`/${_(e.schema,u.kind)}`,style:G,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:L,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(W,{to:he(t,u),style:G,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(W,{to:"/problems",style:G,children:["The rule \u201C",u.label,"\u201D"]}):null},`${u.about}:${u.about==="rule"?u.name:u.about==="place"?u.as:u.kind}`))}):null,g.map(u=>(0,$.jsxs)("section",{className:"graview-list",style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",minWidth:0},"data-testid":"search-group","data-kind":u,children:[(0,$.jsxs)("h2",{className:"graview-group-head",style:{alignItems:"center"},children:[(0,$.jsx)(ue,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(W,{to:`/${_(e.schema,u)}?${new URLSearchParams({q:f}).toString()}`,style:G,"data-testid":"search-kind-link",children:Z(e,u)}),(0,$.jsx)("span",{children:d.byKind[u]})]}),(0,$.jsx)("ul",{className:"graview-rows",children:c.filter(k=>k.kind===u).map(k=>(0,$.jsxs)("li",{"data-testid":"search-hit","data-about":"node",className:"graview-row",children:[(0,$.jsxs)(W,{to:Q(e.schema,u,k.id),className:"graview-row-title",...k.label.length>60?{title:k.label}:{},children:[k.flagged?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,k.label]}),k.apart||!k.current?(0,$.jsx)("span",{className:"graview-row-glance",children:[k.apart,k.current?"":"past"].filter(Boolean).join(" \xB7 ")}):null,(0,$.jsx)(rn,{why:k.why})]},k.id))})]},u)),f.length>0?(0,$.jsx)(Io,{asked:f}):null,f.length>0&&d.hits.length===0?(0,$.jsx)(Mi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...r?{invariantContext:r}:{}}):null]})}function rn({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:L,"data-testid":"search-why","data-near":"",children:["Near \u201C",t.asked,"\u201D",t.field==="label"?"":` \u2014 ${t.reading}: ${t.fragment}`]}):t.field==="label"?null:(0,$.jsxs)("span",{style:L,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function Fo(t,e){let n=Object.entries(e).map(([a,r])=>`${r} ${r===1?qe(t.schema.tryDefinition(a),a):Z(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?Le(n[0]):Le(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function Ti(t,e,n={}){let a=[];for(let r of e){let i=Ze(t,r,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of on(t,r,i.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function on(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,r=[];for(let i of n){let o=t.allMutations().find(c=>c.name===i.mutation);if(!o||!o.creates?.includes(e)||r.some(c=>c.mutation.name===o.name))continue;let l=Wt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||i.args[d]!==void 0||r.push({kind:e,affordance:i,mutation:o,arg:d})}return r}function Mi({store:t,kinds:e,words:n,principal:a,invariantContext:r}){let i=Ti(t,e,{...a?{principal:a}:{},...r?{invariantContext:r}:{}});return i.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:i.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...ne,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ee,children:[Le(wa(qe(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)(De,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function Io({asked:t}){let e=pe();return e?(0,$.jsx)(Ho,{asked:t,desk:e.aiDesk}):null}function Ho({asked:t,desk:e}){return Va(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Ua(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...G,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var v=I(j(),1),Ni=8,$i=40;function Wo(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(r=>ba(n[r])&&va(t[r]));return a===void 0?void 0:t[a]}function Jn({context:t}){let e=ze(),n=xe(t.store.schema,e.slug??"");return n?(0,v.jsx)(Oi,{context:t,kind:n}):(0,v.jsx)(ae,{context:t,children:(0,v.jsx)(ie,{context:t,children:"No such kind of thing here."})})}function Oi({context:t,kind:e,opening:n,row:a,layout:r="list",description:i,bare:o}){let{store:l,brand:d,invariantContext:c}=t;X(l);let[p,g]=ut(),f=`list-${(0,Ne.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=Sa(p.get("archived")),E=l.graph.nodesOfKind(e,{archived:k}),y=Xe(l).relations.filter(s=>s.from===e||s.to===e),x=new Set(l.violations(c).flatMap(s=>s.nodeIds)),N=Lr(l.schema,Rr(l.schema,Cr(l.schema,e))),C=y.map(s=>s.edgeKind),D=Uo(p,N,C),V=["sort","filter","group","q","by","with","past","archived",...C].some(s=>p.has(s)),le=E.length>=$i,me=u?.fieldRoles?.when,K=t.views?.arrangement?.()?.lists?.[e],Y=kr(K),oe=br(K?.group),ke=Go(le,me),de=n??(Y?{...ke,...Y}:ke),fe=V?D.arrangement:On(de,N).arrangement,b=Y?.sort,h=fe.sort&&b?.then&&fe.sort.by===b.by&&fe.sort.direction===b.direction?{...fe,sort:b}:fe,T=Tr(h.query??""),F=[...h.filter??[],...T.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||Ar(u,[...h.filter??[],...T.conditions]),m=F||!u?.lifecycle?h:{...h,filter:[...h.filter??[],{key:"is",value:"current"}]},R=new Map,H=Kt(E,m,{schema:l.schema,graph:l.graph,flagged:x,...typeof c?.today=="string"?{today:c.today}:{},read:(s,w)=>{let O=R.get(s.id);return O||R.set(s.id,O=ht(l.schema,l.graph,s)),O[w]}}),te=oe&&h.group?.by===oe.by&&!h.group.bucket?N.groups.find(s=>s.key===oe.by):void 0,Ke=oe&&te&&(te.type==="choice"||te.type==="boolean")?Sr(H.groups,oe,{type:te.type,...te.options?{options:te.options}:{}}):H.groups.map(s=>({...s,closed:!1})),$e=new Set((p.get("open")??"").split(",").filter(Boolean)),Ki=!!h.query||(h.filter??[]).some(s=>s.key===oe?.by),aa=s=>te?.type==="boolean"?s==="1"?"true":"false":s,ra=s=>s.closed&&!Ki&&!$e.has(aa(s.key)),qi=s=>{let w=new URLSearchParams(p),O=new Set($e);O.has(s)?O.delete(s):O.add(s),O.size>0?w.set("open",[...O].join(",")):w.delete("open"),g(w,{replace:!0})},Re=H.nodes,rt=u?.lifecycle&&!F?E.filter(s=>st(u,s)):E,ia=E.length-rt.length,dn=h.group?.by??null,Bi=s=>{let w=new URLSearchParams(p);for(let ce of["sort","filter","group","q","by","with","past","archived",...y.map(Lt=>Lt.edgeKind)])w.delete(ce);let O=Nr(s);for(let ce of["sort","filter","group","q","archived"])O[ce]&&w.set(ce,O[ce]);![...w.keys()].some(ce=>["sort","filter","group","q"].includes(ce))&&(n||Y||le||me)&&w.set("sort",""),g(w)},{principal:it}=t,cn=Ze(l,e,{...it?{principal:it}:{},...t.invariantContext?{context:t.invariantContext}:{}}),Ue=cn.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(w=>w.name===s.mutation)})).filter(s=>s.mutation!==void 0),Gi=cn.actions.withheld,pn=()=>new Set(Re.length===0?Ue.map(({mutation:s})=>s.name):[]),[un,oa]=(0,Ne.useState)(()=>({kind:e,open:pn()}));un.kind!==e&&oa({kind:e,open:pn()});let sa=s=>(un.kind===e?un.open:pn()).has(s),la=(s,w)=>oa(O=>{let ce=new Set(O.open);return w?ce.add(s):ce.delete(s),{kind:O.kind,open:ce}}),da=`begin-${(0,Ne.useId)().replace(/:/g,"")}`,ca=T.words&&Re.length===0?Object.fromEntries(on(l,e,cn.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},Ye=Z(l,e),Pt=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),gn=Pt!==void 0&&!lt(Pt)?Pt:void 0,mn=(h.group?.bucket??"day")==="day"?h.group?.by:void 0,fn=(h.filter??[]).map(s=>s.key),Ui=fn.filter(s=>fn.indexOf(s)===fn.lastIndexOf(s)&&/choice|boolean/.test(N.filters.find(w=>w.key===s)?.type??"")),yn=s=>{let w={...u?.computed?ht(l.schema,l.graph,s):s};mn&&!String(w[mn]).includes("T")&&delete w[mn];for(let O of Ui)delete w[O];return w},At=s=>{let w=se(u,s);if(a)return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...Sn(s.id),children:[kn(s,w),a(s,{label:w,href:Q(l.schema,e,s.id),flagged:x.has(s.id),glance:Yt(yn(s),u,w)})]},s.id);if(gn){let xn=Ut(Pt,s,l.graph),Qi=Object.fromEntries(Object.entries(yn(s)).filter(([Zi])=>!xn?.fields.has(Zi))),fa=xn?Yt(Qi,u,xn.title??w):"";return(0,v.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,paddingBlock:10,borderTop:"1px solid var(--graview-edge)"},...Sn(s.id),children:[kn(s,w),(0,v.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,v.jsx)(gn,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...x.has(s.id)?{flagged:[s.id]}:{}})}),fa?(0,v.jsx)("span",{style:{...L,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:fa}):null,(0,v.jsx)(zo,{to:Q(l.schema,e,s.id),label:x.has(s.id)?`${w} \u2014 implicated in a problem`:w})]},s.id)}let O=Yt(yn(s),u,w),ce=T.words?Mr(u,s,T.words):void 0,Lt=le?void 0:sr(s,u),Tt=Wo(s,u),ma=(0,v.jsxs)(W,{to:Q(l.schema,e,s.id),className:"graview-row-title",...w.length>60?{title:w}:{},children:[x.has(s.id)?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,w]});return(0,v.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...Sn(s.id),children:[kn(s,w),Lt?(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,v.jsx)(je,{as:"thumb",file:Lt}),ma]}):ma,O||Tt?(0,v.jsxs)("span",{className:"graview-row-glance",children:[O,O&&Tt?" \xB7 ":null,Tt?(0,v.jsx)(qt,{address:Tt}):null]}):null,ce?(0,v.jsx)(rn,{why:ce}):null]},s.id)},hn=Ee(t).filter(s=>s.kind===e),pa=K?.filters,Vi=(h.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),ji=!!(h.sort||h.group||h.query||Vi),zi=rt.length>=Ni||V&&ji,Ie=h.sort?N.sorts.find(s=>s.key===h.sort.by):void 0,wn=Ie?.type==="date"||Ie!==void 0&&Ie.key===me,ua=le&&!H.grouped&&Ie&&(Ie.about==="label"||Ie.type==="text"||wn)?s=>{let w=Ie.about==="label"?se(u,s):s[Ie.key];if(typeof w!="string"||w.length===0)return wn?"No date":"#";if(wn)return w.slice(0,4);let O=w.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Qe=ua?Re.reduce((s,w)=>{let O=ua(w);return s.at(-1)?.key===O?s.at(-1).nodes.push(w):s.push({key:O,nodes:[w]}),s},[]):void 0,ga=H.grouped&&dn?Ke.flatMap(s=>ra(s)?[]:s.nodes):Qe&&Qe.length>1?Qe.flatMap(s=>s.nodes):Re,vn=(0,Ne.useMemo)(()=>ga.map(s=>s.id),[ga.map(s=>s.id).join(`
|
|
109
|
-
`)]),Oe=Hr(vn),bn=(0,Ne.useId)(),mt=(it?l.permittedMutations(it):l.permittedMutations()).some(s=>{let w=s.subject?.kinds;return w!==void 0&&(w==="*"||w.includes(e))}),kn=(s,w)=>mt?(0,v.jsx)("span",{className:"graview-choose-at",children:(0,v.jsx)("input",{...Oe.boxProps(s.id,w),onPointerEnter:Fn,onFocus:Fn})}):null,Sn=s=>mt?{"data-graview-choose":s}:{},_i=(0,Ne.useCallback)(s=>{Oe.choose(s),requestAnimationFrame(()=>{let w=Oe.list.current;((s[0]===void 0?null:w?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??w)?.focus({preventScroll:!0})})},[Oe]),ot=r==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||gn?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&r==="list"?6:0}:void 0,Ct=ot?void 0:"graview-rows",ft=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,Rt=y.map(s=>{let w=s.from===e?s.to:s.from,O=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:w,words:O}}),Yi=new Set(Rt.map(s=>(s.words??"").toLowerCase()).filter((s,w,O)=>s&&O.indexOf(s)!==w));return(0,v.jsxs)(o?Bo:ae,{context:t,children:[(0,v.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,v.jsxs)("header",{style:{display:"grid",gap:4},children:[o?null:(0,v.jsx)(gt,{context:t}),(0,v.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,v.jsx)(ue,{kind:e,brand:d,schema:l.schema,size:8}),(0,v.jsx)(ie,{context:t,children:Ye}),Ue.length>0?(0,v.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14,rowGap:8},"data-testid":"beginnings-open",children:Ue.map(({affordance:s,mutation:w})=>(0,v.jsx)(Vo,{name:w.name,title:w.title??w.name,panel:`${da}-${w.name}`,open:sa(w.name),onOpen:O=>la(w.name,O)},s.id))}):null]}),Re.length>0?(0,v.jsx)(ti,{place:"here",to:[{label:`Skip to the ${Re.length===1?qe(u,e):`${Re.length} ${Ye.toLowerCase()}`}`,testid:"records",go:()=>{let s=document.querySelector(`[data-graview-skip-target="${CSS.escape(bn)}"]`);In(s?.querySelector('[data-graview-choose-box][tabindex="0"]')??s)}},...rt.length>0?[{label:"Skip to arranging them",testid:"arranging",go:()=>{let s=document.querySelector(`[data-graview-skip-target="${CSS.escape(bn)}"]`)?.parentElement?.querySelector('[role="group"][aria-label="Arrange"]');In(s?.querySelector('button[data-testid$="-add"], button[data-testid$="-all"]')??s)}}]:[]]}):null,i??u?.description?(0,v.jsx)("p",{style:re,children:i??u?.description}):null,Rt.length>0||hn.length>0?(0,v.jsxs)("p",{style:{...L,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Rt.length>0?(0,v.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Rt.map(({relation:s,far:w,words:O},ce)=>(0,v.jsxs)("span",{"data-relation":s.edgeKind,children:[ce>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,w==="*"?Le(O??Se(s.edgeKind)):(0,v.jsx)(W,{to:`/${_(l.schema,w)}`,style:G,title:Z(l,w),children:O&&Yi.has(O.toLowerCase())?`${Le(O)}: ${Z(l,w).toLowerCase()}`:Le(O??Z(l,w))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,hn.length>0?(0,v.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",hn.map((s,w)=>(0,v.jsxs)("span",{children:[w>0?(0,v.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,v.jsx)(W,{to:he(t,s),style:G,children:s.title})]},et(s)))]}):null]}):null]}),Ue.length>0?(0,v.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:Ue.map(({affordance:s,mutation:w})=>{let O=!!(ca[w.name]&&Re.length===0);return(0,v.jsx)(jo,{name:w.name,id:`${da}-${w.name}`,description:w.description,open:sa(w.name),onClose:()=>la(w.name,!1),children:(0,v.jsx)(De,{store:l,mutation:w,prefilled:s.args,open:s.open,...O?{initial:{[ca[w.name]]:T.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${w.name}|${T.words}`:w.name)},s.id)})}):null,D.dropped.length>0?(0,v.jsxs)("p",{style:{...L,margin:0},"data-testid":"list-dropped",children:["This link asked for ",D.dropped.join(", "),", which ",Ye.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,rt.length>0?(0,v.jsx)(Fr,{schema:l.schema,graph:l.graph,kind:e,arrangement:h,onChange:Bi,kept:{shown:Re.length,of:rt.length},noun:{one:qe(u,e),many:Ye.toLowerCase()},...zi?{}:{allow:!1},...pa?{filters:pa}:{},offers:N,chips:{nodes:rt,flagged:x,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,v.jsx)("style",{children:_t}),mt?(0,v.jsx)("style",{children:Wr+qo}):null,(0,v.jsx)("div",{className:"graview-list","data-graview-skip-target":bn,...mt?{...Oe.listProps,ref:Oe.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Oe.chosen.length>0?`${Ye}, ${Oe.chosen.length} chosen`:Ye,role:"group"}:{},children:Re.length===0&&T.words?(0,v.jsxs)("p",{style:re,"data-testid":"none-yet",children:["Nothing here is called \u201C",T.words,"\u201D."," ",(0,v.jsx)("span",{style:L,"data-testid":"list-searched",children:Dt(l.schema,{kinds:[e],past:F})})," ",(0,v.jsx)(W,{to:"?",style:G,children:"Show every one"})]}):Re.length===0?(0,v.jsxs)("p",{style:re,"data-testid":"none-yet",children:[h.filter?.length||h.query?"None of them.":"None yet",!h.filter?.length&&!h.query&&Ue.length>0?` \u2014 the first one starts above, with \u201C${Ue[0]?.mutation.title??Ue[0]?.mutation.name}\u201D.`:!h.filter?.length&&!h.query?".":"",h.filter?.length||h.query?(0,v.jsxs)(v.Fragment,{children:[" ",(0,v.jsx)(W,{to:"?",style:G,children:"Show every one"})]}):null]}):H.grouped&&dn?(0,v.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":dn,children:Ke.map(s=>{if(!s.closed)return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,v.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,v.jsx)("span",{children:s.nodes.length})]}),(0,v.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:s.nodes.map(At)})]},s.key||"-");let w=ra(s),O=`${f}-${ft(s.key||"none")}`;return(0,v.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":w?"shut":"open",children:[(0,v.jsx)("h2",{className:"graview-group-head",children:(0,v.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!w,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>qi(aa(s.key)),children:[(0,v.jsx)("span",{"aria-hidden":"true",children:w?"\u25B8":"\u25BE"}),s.label," ",(0,v.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,v.jsxs)("span",{style:Do,children:[" ",s.nodes.length===1?qe(u,e):Ye.toLowerCase()]})]})}),(0,v.jsx)("ul",{id:O,style:w?{...ot,display:"none"}:ot,className:Ct,"data-graview-rows":"",hidden:w,children:w?null:s.nodes.map(At)})]},s.key||"-")})}):Qe&&Qe.length>1?(0,v.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Ie?.type==="date"?"year":"letter",children:[(0,v.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...L,display:"flex",flexWrap:"wrap",gap:Ie?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Qe.map(s=>(0,v.jsx)("a",{href:`#${ft(s.key)}`,onClick:w=>{w.preventDefault(),document.getElementById(ft(s.key))?.scrollIntoView({block:"start"})},style:{...Pe,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),Qe.map(s=>(0,v.jsxs)("section",{"data-testid":"list-section","aria-labelledby":ft(s.key),style:{display:"grid",gap:0},children:[(0,v.jsx)("h2",{id:ft(s.key),className:"graview-group-head",children:s.key}),(0,v.jsx)("ul",{style:ot,className:Ct,"data-graview-rows":"",children:s.nodes.map(At)})]},s.key))]}):(0,v.jsx)("ul",{style:ot,className:Ct,"data-testid":"records","data-graview-rows":"",children:Re.map(At)})}),mt?(0,v.jsx)(Dr,{store:l,chosen:Oe.chosen,...it?{principal:it}:{},...c?{context:c}:{},anchor:Ko,of:vn.length,onChooseAll:()=>Oe.choose(vn),onClear:Oe.clear,onActed:_i}):null,ia>0?(0,v.jsxs)(W,{to:Ei(p,"filter","is:any"),style:{...G,...L,justifySelf:"start"},"data-testid":"past-link",children:["+",ia," past"]}):null,k===!1&&l.graph.count(e,{archived:!0})>0?(0,v.jsxs)(W,{to:Ei(p,"archived","true"),style:{...G,...L,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),(0,v.jsx)(an,{context:t,withheld:Gi,style:ne,testId:"withheld"})]})}var Do={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},Ko=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,qo=`
|
|
110
|
-
.graview-list[data-graview-choosable]{outline:none}
|
|
111
|
-
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
112
|
-
.graview-choose-at{position:absolute;left:2px;top:0;bottom:0;z-index:${Ra.raised};display:flex;align-items:center}
|
|
113
|
-
@media (pointer: coarse){
|
|
114
|
-
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
|
-
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
|
-
}
|
|
117
|
-
`;function Bo({children:t}){return(0,v.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var Go=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function Uo(t,e,n){let a=$t({...t.get("sort")?{sort:t.get("sort")}:{},...t.get("filter")?{filter:t.get("filter")}:{},...t.get("group")?{group:t.get("group")}:{},...t.get("q")?{q:t.get("q")}:{},...t.get("archived")?{archived:t.get("archived")}:{}}),r=[...a.filter??[]],i=t.get("by"),o=a.group??(i?{by:i}:void 0);for(let d of n){let c=t.get(d);c&&r.push({key:d,value:c})}let l=t.get("with");return l&&r.push({key:l,value:"*"}),t.get("past")==="1"&&!r.some(d=>d.key==="is")&&r.push({key:"is",value:"any"}),On({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...r.length>0?{filter:r}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function Ei(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function Vo({name:t,title:e,panel:n,open:a,onOpen:r}){return(0,v.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{r(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...Pe,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,v.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function jo({name:t,id:e,description:n,open:a,onClose:r,children:i}){return(0,v.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),r(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,v.jsx)("p",{style:{...L,margin:0,maxWidth:"58ch"},children:n}):null,i]})}function zo({to:t,label:e}){let n=(0,Ne.useRef)(null);return Kr(n),(0,v.jsx)(W,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var at=I(Fe(),1);var xt=I(Fe(),1);var q=I(j(),1);function ea({context:t}){let{store:e,brand:n,invariantContext:a,principal:r}=t;X(e);let i=e.violations(a),o=e.allInvariants(),l=Ft(e,i),d=ja(e.schema,o);return(0,q.jsxs)(ae,{context:t,children:[(0,q.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,q.jsx)(ie,{context:t,children:i.length===0?"All rules hold":"What is broken"}),(0,q.jsx)("p",{style:re,"data-testid":"problems-count",children:i.length===0?"Every declared rule is satisfied by what is here.":xa(i)})]}),(0,q.jsx)(Li,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],f=g?e.graph.getNode(g):void 0;return(0,q.jsxs)("section",{style:{display:"grid",gap:10,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:[c.line?null:(0,q.jsx)(sn,{violation:c,schema:e.schema,...n?{brand:n}:{}}),f?(0,q.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,q.jsx)(ue,{kind:f.kind,brand:n,schema:e.schema,size:7}),(0,q.jsx)(W,{to:Q(e.schema,f.kind,f.id),style:G,children:se(e.schema.tryDefinition(f.kind),f)})]}):null,c.line?(0,q.jsx)(sn,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,q.jsx)(ln,{store:e,repairs:c.repairs,...r?{principal:r}:{}})]},p)}),o.length>0?(0,q.jsxs)("section",{style:{...ne,display:"grid",gap:12},"data-testid":"rules",children:[(0,q.jsx)("h2",{style:ee,children:"The rules"}),(0,q.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=i.filter(u=>u.invariant===c.name).length,g=d.get(c.name),f=c.label??c.name;return(0,q.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,q.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[g?(0,q.jsx)(It,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,q.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:f}),(0,q.jsx)("span",{style:{...L,color:p>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:p===0?"holds":`broken in ${p} ${p===1?"place":"places"}`})]}),g&&f.trim().length>0?(0,q.jsx)("span",{style:L,children:f}):null]},c.name)})})]}):null]})}function sn({violation:t,schema:e,brand:n}){if(!t.line)return(0,q.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=_a(t),r=za(t);return r?(0,q.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,q.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:r}),a?(0,q.jsx)("span",{style:L,children:a}):null,(0,q.jsxs)("details",{"data-testid":"problem-judged",style:L,children:[(0,q.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,q.jsx)(It,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,q.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,q.jsx)(It,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,q.jsx)("span",{style:L,children:a}):null]})}function ln({store:t,repairs:e,principal:n}){let[a,r]=(0,xt.useState)(null),[i,o]=(0,xt.useState)(null),l=(0,xt.useRef)([]);if(e.length===0)return null;let d=a===null?null:e[a],c=d&&(d.missing??[]).length>0?t.allMutations().find(p=>p.name===d.mutation):void 0;return(0,q.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,q.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:e.map((p,g)=>{let f=(p.missing??[]).length>0,u=t.permits({name:p.mutation,args:{...p.args}},n);return u.ok?(0,q.jsx)("button",{ref:k=>{l.current[g]=k},type:"button","data-graview-repair":p.mutation,"data-graview-asks":f||void 0,"aria-expanded":f?a===g:void 0,onClick:()=>{if(o(null),f){r(a===g?null:g);return}r(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(dt(t.schema,t.allMutations(),k))}},style:Ae,children:f?`${p.label} \u2026`:p.label},g):(0,q.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...L,margin:0},children:[(0,q.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,q.jsx)(De,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;r(null),requestAnimationFrame(()=>{let g=p===null?null:l.current[p];if(g?.isConnected){g.focus();return}let f=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");f&&(f.hasAttribute("tabindex")||(f.tabIndex=-1),f.focus())})},...n?{principal:n}:{}}):null,d&&!c&&(d.missing??[]).length>0?(0,q.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,i?(0,q.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:Hn},children:i}):null]})}var ta=I(Fe(),1);var _e=I(j(),1);function Fi({store:t,link:e,principal:n}){let[a,r]=(0,ta.useState)(!1),[i,o]=(0,ta.useState)(null),l=ar(e);return(0,_e.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,_e.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"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,_e.jsxs)("span",{style:{...L,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,_e.jsx)("span",{children:l}),(0,_e.jsx)("button",{type:"button",style:{...Ae,padding:"4px 10px"},onClick:()=>{try{t.apply({name:Pa,args:{kind:e.edge.kind,from:e.edge.from,to:e.edge.to}},n?{author:n}:{}),r(!1)}catch(d){o(dt(t.schema,t.allMutations(),d))}},children:"Keep this link"}),i?(0,_e.jsx)("span",{role:"alert",children:i}):null]}):null]})}var ve=I(j(),1);function Ii({nodeId:t,node:e,field:n,inPlace:a,labelStyle:r=be}){return n.files?(0,ve.jsx)(je,{as:"field",read:!a,nodeId:t,field:n.key,label:n.label,files:n.files,labelStyle:r,style:{gap:4}}):n.long?(0,ve.jsx)(Or,{nodeId:t,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,ve.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,ve.jsx)("dt",{style:r,children:n.label}),(0,ve.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:n.linked?(0,ve.jsx)(dr,{relation:n.linked.relation,refs:n.linked.refs,...a?{nodeId:t,field:n.key}:{}}):n.app?(0,ve.jsx)(qt,{address:n.app,as:"record",...a?{nodeId:t,field:n.key}:{}}):n.href?(0,ve.jsx)($r,{href:n.href,field:n.key,value:n.value,stored:n.stored,...a?{nodeId:t}:{}}):a?(0,ve.jsxs)(ve.Fragment,{children:[(0,ve.jsx)(Bt,{nodeId:t,field:n.key,value:n.value,stored:n.stored}),n.repeats?(0,ve.jsx)(ur,{nodeId:t,field:n.key,start:e?.[n.key],value:e?.[`${n.key}Repeat`],label:`${n.label} repeats`}):null]}):n.value})]})}var S=I(j(),1),_o=[];function na({context:t}){let{store:e,brand:n,principal:a,invariantContext:r}=t;X(e);let i=pe()!==null,o=ze(),l=decodeURIComponent(o.id??""),d=pi(e,l,{...a?{principal:a}:{},...r?{context:r}:{}}),c=Ft(e,d?.violations??_o),[p,g]=(0,at.useState)(null),[f,u]=(0,at.useState)(!1),[k,E]=(0,at.useState)(null),y=(0,at.useRef)(null),x=(0,at.useRef)(null),N=m=>{(y.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??y.current)?.focus()};if(!d)return(0,S.jsx)(ae,{context:t,children:(0,S.jsx)(ie,{context:t,children:"Nothing lives at this address."})});let C=e.graph.getNode(l),D=e.schema.tryDefinition(d.kind),V=D?.describe&&C?Ya(D,C):null,le=[...e.log.all()].filter(m=>!Et(m)&&(m.writes.includes(l)||m.reads.includes(l))).slice(-8).reverse(),me=e.log.all().find(m=>!Et(m)&&m.undoes===void 0&&m.primitives.some(R=>R.op==="add-node"&&R.node.id===l)),K=d.actions.affordances.filter(m=>m.provider!=="invariant"),Y=K.filter(m=>m.destructive||m.setsAside),oe=f||Y.length<2?K:K.filter(m=>!Y.includes(m)),ke=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),de=ke!==void 0&&!lt(ke)?ke:void 0,fe=de&&C?Ut(ke,C,e.graph):void 0,b=fe?d.fields.filter(m=>!fe.fields.has(m.key)):d.fields,h=fe?d.links.flatMap(m=>{let R=m.targets.filter(H=>!fe.records.has(H.id));return R.length>0?[{...m,targets:R}]:[]}):d.links,T=de!==void 0&&Ba(ke),F=i&&or(D).length>0;return(0,S.jsxs)(ae,{context:t,children:[(0,S.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,S.jsx)(gt,{context:t}),(0,S.jsx)(ie,{context:t,children:i&&C?.label===d.label?(0,S.jsx)(Bt,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),V&&V!==d.label?(0,S.jsx)("p",{style:re,children:V}):null,me?.lineage?(0,S.jsxs)("p",{style:{...L,margin:0},"data-testid":"record-lineage",children:["Made by ",wt(me,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",Tn(me.lineage)]}):null,(0,S.jsx)(Zt,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...G,...L},"data-testid":"spatial-link"}),i&&C?(0,S.jsx)(En,{choices:[{on:"changed",record:l},{on:"act",record:l},{on:"reaches",kind:d.kind,condition:"",record:l}],label:"Notify me when this changes",testId:"record-notify",style:{...Ae,...L,justifySelf:"start"}}):null,Ee(t).some(m=>m.kind===d.kind||m.across===d.kind)?(0,S.jsxs)("p",{style:{...L,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Ee(t).filter(m=>m.kind===d.kind||m.across===d.kind).map((m,R)=>(0,S.jsxs)("span",{children:[R>0?(0,S.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,S.jsx)(W,{to:he(t,m),style:G,children:m.title})," ",(0,S.jsx)(Zt,{context:t,stop:`#view=${encodeURIComponent(m.as)}`,style:{...G,...L,display:"inline-block",minWidth:24,textAlign:"center"},title:`${m.title}, in the scene`,label:`${m.title}, in the scene`,children:(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},et(m)))]}):null]}),C&&ka(C)?(0,S.jsx)(Qo,{context:t,id:l,kind:d.kind}):null,C&&Aa(e,l)?(0,S.jsx)(Yo,{context:t,id:l,kind:d.kind}):null,de&&C?(0,S.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,S.jsx)(qr,{children:(0,S.jsx)(de,{node:C,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,S.jsx)("section",{"data-testid":"record-violations",style:{display:"grid",gap:12,padding:"16px 18px",borderLeft:"3px solid var(--graview-warn)",background:"var(--graview-panel-warning)",borderRadius:"0 var(--graview-radius, 12px) var(--graview-radius, 12px) 0"},children:c.map((m,R)=>(0,S.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,S.jsx)(sn,{violation:m,schema:e.schema,...n?{brand:n}:{}}),(0,S.jsx)(ln,{store:e,repairs:ui(d.actions,m.repairs),...a?{principal:a}:{}})]},R))}):null,!T&&(b.length>0||F)?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,S.jsx)("h2",{style:ee,children:"The facts"}),Za(D,b).map((m,R)=>{let H=(0,S.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(te=>(0,S.jsx)(Ii,{nodeId:l,node:C,field:te,inPlace:i},te.key))});return m.title?(0,S.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,S.jsx)("h3",{"data-graview-field-group":m.title,style:{...ee,fontSize:"inherit"},children:m.title}),H]},R):(0,S.jsx)("div",{children:H},R)}),F?(0,S.jsx)(je,{as:"unfilled",nodeId:l,skip:[...fe?.fields??[]],labelStyle:be,style:{gap:4}}):null]}):null,(T?[]:h).map(m=>(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:10},children:[(0,S.jsx)("p",{style:be,children:ai(e,m)}),m.description?(0,S.jsx)("h2",{style:ee,children:Le(m.description)}):(0,S.jsxs)("h2",{style:ee,"aria-label":Se(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",Se(m.edgeKind)]}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(R=>{let H=rr(e,m.direction==="in"?{kind:m.edgeKind,from:R.id,to:l}:{kind:m.edgeKind,from:l,to:R.id});return(0,S.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,S.jsx)(ue,{kind:R.kind,brand:n,schema:e.schema,size:7}),(0,S.jsxs)(W,{to:Q(e.schema,R.kind,R.id),style:G,children:[R.label,R.apart?(0,S.jsxs)("span",{style:L,children:[" \xB7 ",R.apart]}):null]}),H?.provisional?(0,S.jsx)(Fi,{store:e,link:H,...a?{principal:a}:{}}):null]},R.id)})}),(m.direction==="out"&&e.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(R=>R.kind))]).map(R=>(0,S.jsxs)(W,{to:`/${_(e.schema,R)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(l)}`,style:{...G,...L},"data-testid":"related-all",children:["Sort and filter ",m.description??`these ${Z(e,R).toLowerCase()}`,m.targets.some(H=>H.kind!==R)?` (${Z(e,R).toLowerCase()})`:""," ",(0,S.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},R))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!T&&(K.length>0||d.actions.withheld.length>0)?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,S.jsx)("h2",{style:ee,ref:y,tabIndex:-1,children:"What can be done"}),(0,S.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[oe.map(m=>{let R=p===m.id;return(0,S.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,autoFocus:f&&m===Y[0],"aria-expanded":R,onClick:()=>{g(R?null:m.id),R||requestAnimationFrame(()=>x.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...Ae,...R?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),oe.length<K.length?(0,S.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...Ae,...L},"data-testid":"record-actions-more",children:["Show ",K.length-oe.length," more"]}):null]}),K.map(m=>{if(p!==m.id)return null;let R=e.allMutations().find(H=>H.name===m.mutation);return R?(0,S.jsxs)("div",{ref:x,onKeyDown:H=>{if(H.key!=="Escape"||H.defaultPrevented)return;H.preventDefault(),g(null);let te=m.id;requestAnimationFrame(()=>N(te))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,S.jsx)("h3",{style:ee,children:m.label}),R.description?(0,S.jsx)("p",{style:{...L,margin:0},children:R.description}):null,(0,S.jsx)(De,{store:e,mutation:R,prefilled:m.args,open:m.open,label:m.label,onDone:()=>{g(null),E(m.mutation);let H=m.id;requestAnimationFrame(()=>N(H))},...a?{principal:a}:{}})]},m.id):null}),i&&k!==null&&p===null?(0,S.jsx)(En,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...Ae,...L,justifySelf:"start"}}):null,(0,S.jsx)(an,{context:t,withheld:d.actions.withheld})]}):null,i?(0,S.jsx)(ni,{id:l,style:ne,headingStyle:ee}):null,le.length>0?(0,S.jsxs)("section",{style:{...ne,display:"grid",gap:10},"data-testid":"record-history",children:[(0,S.jsx)("h2",{style:ee,children:"What has happened"}),(0,S.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:le.map(m=>(0,S.jsxs)("li",{style:L,children:[(0,S.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,S.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",Tn(m.lineage)]}):null," \u2014 ",wt(m,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},m.id))})]}):null]})}function Yo({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===i.name)&&a.permits(i,r).ok;return(0,S.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,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,S.jsx)("button",{type:"button",style:Ae,"data-testid":"allow-tidying",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Allow tidying again"}):null]})}function Qo({context:t,id:e,kind:n}){let{store:a,principal:r}=t,i={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===i.name)&&a.permits(i,r).ok,l=[...a.log.all()].reverse().find(c=>!Et(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,S.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,S.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,S.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,S.jsxs)(S.Fragment,{children:[" ","Merged into ",(0,S.jsx)(W,{to:Q(a.schema,d.kind,d.id),style:G,children:se(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,S.jsx)("button",{type:"button",style:Ae,"data-testid":"bring-it-back",onClick:()=>a.apply(i,r?{author:r}:{}),children:"Bring it back"}):null]})}var A=I(j(),1),Zo=(0,z.lazy)(Ot(()=>(__graviewPreload(import.meta.url,["./chunk.C3DX4LWD.js","./chunk.EPPAFWP7.js","./chunk.UGFDSE37.js","./chunk.O4X5WJIC.js","./chunk.CO2ZPX3D.js","./chunk.QXTLZSBL.js","./chunk.4ZHUGSJL.js","./chunk.DJ3BD7AZ.js","./chunk.S2MP53RO.js","./chunk.7MXQRSNR.js","./chunk.BYVE2NQY.js","./chunk.X5WB4GJ4.js","./chunk.5J2HETUO.js","./chunk.6XEATXZC.js","./chunk.5TBK44MK.js","./chunk.27QYTMXP.js","./chunk.VCOIFBUE.js","./chunk.RQBX7M7Q.js","./chunk.FLMNHV6A.js","./chunk.CTSPNTDX.js","./chunk.BT6FUNQI.js","./chunk.MBOOUJOE.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.QWY54AVN.js","./chunk.T4Q6OLZU.js","./chunk.R2B2ZAWI.js","./chunk.7XCBIID7.js","./chunk.MI2HL3LQ.js","./chunk.TMBFLZNH.js","./chunk.GZHZLJBF.js","./chunk.EBTYR5CZ.js","./chunk.OJGHDWI6.js","./chunk.OWL5GZ6U.js","./chunk.RSYFIL2Z.js","./chunk.R7F6UJVG.js","./chunk.DYW4D74X.js","./chunk.VP35BUUZ.js","./chunk.7L6LYXCV.js","./chunk.SDO3U72B.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.4C65DXZB.js")).then(t=>({default:t.DraftPage})))),Xo={kind:"human"};function Jo({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,r=n.size===1?[...n][0]:void 0;if(!r)return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let i=Ve(e.schema,r).toLowerCase();return(0,A.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,A.jsx)(W,{to:`/${_(e.schema,r)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(r).length?`See all ${yt(t.total)} ${i}`:`${yt(a)} more \xB7 all ${i}`})})}function es({context:t,children:e}){let n=Be(),a=t.store.schema,r=pt("/").replace(/\/$/,""),i=(0,z.useMemo)(()=>({href:o=>`${r}${Q(a,o.kind,o.id)}`,go:o=>n(Q(a,o.kind,o.id)),more:o=>(0,A.jsx)(Jo,{list:o,store:t.store})}),[r,a,n,t.store]);return(0,A.jsx)(Gt.Provider,{value:i,children:(0,A.jsx)(Br.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function ts({steering:t}){let e=ye(),n=Be(),a=`${e.pathname}${e.search}`;return(0,z.useLayoutEffect)(()=>t.at(a),[a,t]),(0,z.useLayoutEffect)(()=>{let r=o=>{o!==a&&n(o)};t.go.current=r;let i=t.pending?.current;return i!==void 0&&(t.pending.current=void 0,r(i)),()=>{t.go.current===r&&(t.go.current=void 0)}},[a,n,t]),null}function ns({context:t,to:e}){let{pathname:n}=ye(),a=pe(),r=(e??a)?.sayWhere,i=as(t,n);return(0,z.useEffect)(()=>(r?.(i),()=>r?.(null)),[r,i]),null}function as(t,e){let[n="",a,r]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(r!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===Cn)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(He(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let i=xe(t.store.schema,n);return i?`#focus=${encodeURIComponent(a??He(i))}`:"#"}function rs({onNavigate:t,path:e}){let n=ye(),a=Dn(),r=Be(),i=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${i}`,l=(0,z.useRef)(t);l.current=t;let d=(0,z.useRef)(null);(0,z.useEffect)(()=>{let p=d.current;d.current=o,p!==null&&(o===p&&a!=="PUSH"||l.current?.(o,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let c=(0,z.useRef)(e);return(0,z.useEffect)(()=>{e===void 0||e===c.current||(c.current=e,e!==o&&r(e))},[e]),null}function Hi({context:t,registry:e,page:n}){let a=ze(),r=xe(t.store.schema,a.slug??""),i=n==="list"?Jn:na,l=(r?e?.lookup(r,n):void 0)??i;return(0,A.jsx)(l,{context:t})}function is({context:t,registry:e,children:n}){let a=(0,z.useRef)(null);return Ga(a),(0,A.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,A.jsx)(xi,{context:t,registry:e,root:a,children:(0,A.jsx)(Ai,{context:t,root:a,children:n})})})}function os(t){return t instanceof HTMLElement?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SELECT"?!0:t.tagName==="INPUT"&&!["button","submit","reset","checkbox","radio","image","file","color","range"].includes(t.type):!1}function ss(){let{pathname:t}=ye(),e=Dn(),n=(0,z.useRef)(null);(0,z.useLayoutEffect)(()=>{if(e!=="POP"){for(let i=n.current?.parentElement;i;i=i.parentElement){let{overflowY:o}=getComputedStyle(i);if((o==="auto"||o==="scroll")&&i.scrollHeight>i.clientHeight){i.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,z.useRef)(t),r=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{if(!r.current&&t===a.current)return;r.current=!0;let i=document.activeElement;if(os(i))return;let o=n.current?.closest("main")??document.querySelector("main"),d=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??o?.querySelector("h1, h2")??null??o??null;d&&(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus({preventScroll:!0}))},[t]),(0,A.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function Wi({context:t,children:e}){let n=Be(),a=(0,z.useMemo)(()=>({record:(r,i)=>{let o=t.store.graph.getNode(r);o&&n(jt(Q(t.store.schema,o.kind,r),{section:i?.section}))},place:(r,i)=>{let o=t.views?.places().find(l=>l.as===r);o&&n(jt(he(t,o),i))},list:(r,i)=>{t.store.schema.tryDefinition(r)&&n(jt(`/${_(t.store.schema,r)}`,i))},draft:()=>n("/~draft")}),[t,n]);return(0,A.jsx)(qa.Provider,{value:a,children:e})}function ls(){let{pathname:t,search:e,hash:n}=ye();return(0,z.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return vi(a)},[t,e,n]),null}function ds({context:t,Home:e}){let n=ye(),a=t.views,r=n.key==="default"&&!(a&&Da(a));(0,z.useEffect)(()=>{a&&Ka(a)},[a]);let i=r?Ma(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=i?.to==="place"?he(t,i.place):i?.to==="kind"?`/${_(t.store.schema,i.kind)}`:void 0;return o?(0,A.jsx)(Kn,{to:o,replace:!0}):(0,A.jsx)(e,{context:t})}function Di({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,r=a&&(e?.without().has("bar")??!1),i=a&&!r&&!t.embedded?{...t,barAbove:!0}:t,o=E=>n===void 0?(0,A.jsx)(Xt,{context:t,children:E}):r?(0,A.jsx)(n,{context:t,children:E}):(0,A.jsx)(Xt,{context:t,children:(0,A.jsx)(n,{context:i,children:E})}),l=e?.lookupSurface("home")??Zn,d=e?.lookupSurface("problems")??ea,c=a?{...i,framed:!0}:t,[p,g]=(0,z.useState)(null),f=(0,z.useMemo)(()=>({context:c,registry:e}),[c,e]),u=(0,z.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),k=(0,A.jsx)(Bn.Provider,{value:f,children:(0,A.jsx)(Wi,{context:t,children:(0,A.jsx)(is,{context:t,registry:e,children:o((0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ir,{face:"pages"}),(0,A.jsxs)(es,{context:c,children:[(0,A.jsx)(ss,{}),(0,A.jsx)(ls,{}),(0,A.jsxs)(si,{children:[(e?.routes()??[]).map(({path:E,component:y})=>(0,A.jsx)(Te,{path:E,element:(0,A.jsx)(y,{context:c})},E)),(0,A.jsx)(Te,{path:"/",element:(0,A.jsx)(ds,{context:c,Home:l})}),(0,A.jsx)(Te,{path:"/problems",element:(0,A.jsx)(d,{context:c})}),(0,A.jsx)(Te,{path:"/~draft",element:(0,A.jsx)(z.Suspense,{fallback:null,children:(0,A.jsx)(Zo,{context:c})})}),(0,A.jsx)(Te,{path:"/search",element:(0,A.jsx)(Xn,{context:c})}),(0,A.jsx)(Te,{path:"/map",element:(0,A.jsx)(Qn,{context:c})}),(0,A.jsx)(Te,{path:"/places",element:(0,A.jsx)(_n,{context:c})}),Ee(c).some(E=>E.as===Cn)?null:(0,A.jsx)(Te,{path:Ta,element:(0,A.jsx)(Kn,{to:"/",replace:!0})}),(0,A.jsx)(Te,{path:"/places/:as",element:(0,A.jsx)(Yn,{context:c})}),(0,A.jsx)(Te,{path:"/:slug",element:(0,A.jsx)(Hi,{context:c,registry:e,page:"list"})}),(0,A.jsx)(Te,{path:"/:slug/:id",element:(0,A.jsx)(Hi,{context:c,registry:e,page:"record"})})]})]})]}))})})});return t.embedded||!a||r?k:(0,A.jsx)(ci.Provider,{value:u,children:(0,A.jsx)(xr.Provider,{value:p,children:k})})}var cs=()=>typeof document>"u"?null:document.body;function ps({context:t,registry:e,basename:n,initialPath:a,onNavigate:r,path:i,steering:o,firstLook:l}){let[d,c]=(0,z.useState)(void 0),p=d!==void 0&&d.from===t.principal?{...t,principal:d.seat}:t;(0,z.useState)(()=>p.views?Ur(p.views,p.store.schema,$n(p.brand,p.store.schema)):void 0);let g=pe();ya({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale,readerTimeZone:p.timeZone??g?.timeZone,appTimeZone:p.brand?.timeZone??p.app?.brand?.timeZone});let f=p.principal??Xo,u=Fa(p.store,f,p.history),E=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(f),y=E===p.store?p:{...p,store:E};Ia(p.store,p.principal);let x=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(rs,{onNavigate:r,path:i}),o?(0,A.jsx)(ts,{steering:o}):null,y.presence||g?(0,A.jsx)(ns,{context:y,to:g}):null,(0,A.jsx)(Di,{context:y,...e?{registry:e}:{}}),l?(0,A.jsx)(Vr,{firstLook:l,root:cs,app:$n(p.brand,p.store.schema)}):null]}),N=y.views?(0,A.jsxs)(Ha,{store:y.store,views:y.views,...y.principal?{principal:y.principal}:{},...y.brand?{brand:y.brand}:{},...y.locale?{locale:y.locale}:{},...y.timeZone?{timeZone:y.timeZone}:{},...y.settings?{settings:y.settings}:{},...y.presence&&!g?{presence:y.presence}:{},...y.people?{people:y.people}:{},...y.seats?{seats:y.seats}:{},onSeat:V=>g?g.takeSeat(V):c({from:t.principal,seat:V}),...y.onKeepLens?{onKeepLens:y.onKeepLens}:{},...y.ai?{ai:y.ai}:{},...y.subscriptions?{subscriptions:y.subscriptions}:{},...y.signIn?{signIn:y.signIn}:{},resolveApp:y.resolveApp??g?.resolveApp,linkedRecords:y.linkedRecords??g?.linkedRecords,...y.app?{app:y.app}:{},...y.menuSections?{menuSections:y.menuSections}:{},children:[x,(0,A.jsx)(Wi,{context:y,children:(0,A.jsx)(bi,{context:y})})]}):x,C=(0,A.jsx)(Oa.Provider,{value:u,children:N}),D=y.files?(0,A.jsx)($a.Provider,{value:y.files,children:C}):C;if(a!==void 0){let V=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,A.jsx)(oi,{initialEntries:[V],...n===void 0?{}:{basename:n},children:D})}return(0,A.jsx)(li,{...n===void 0?{}:{basename:n},children:D})}export{fo as a,ps as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk.PXQVXBNG.js";import{Xc as w}from"./chunk.7MQ7UWVW.js";var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),b=e=>e?._zod?.def;function $(e){let n=b(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=b(n.innerType);return n}function v(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var p=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function T(e,n,t){let r=e.tryDefinition(n);if(!r)return[];let f=new Set(r.display?.hide??[]),o=[];for(let[i,a]of Object.entries(r.fields.shape??{})){if(i==="id"||i==="kind"||i==="label"||f.has(i))continue;let s=$(a);if(s?.type==="array"||s?.type==="object"||s?.type==="record")continue;let u=v(s);o.push({key:i,label:p(i),...u?{options:u}:{}})}let d=new Map;for(let[i,a]of Object.entries(r.edges??{}))d.set(i,a.to==="*"?[]:[...a.to]);for(let i of e.definitions)if(i.kind!==n)for(let[a,s]of Object.entries(i.edges??{}))!d.has(a)&&(s.to==="*"||s.to.includes(n))&&d.set(a,[i.kind]);let c=[];for(let[i,a]of d){o.push({key:i,label:p(i)});let s=t&&a.length===1&&a[0]!==n?e.tryDefinition(a[0]):void 0;for(let[u,l]of Object.entries(s?.fields.shape??{})){let y=$(l);y?.type==="enum"&&!s?.display?.hide?.includes(u)&&c.push({key:`${i}.${u}`,label:`${p(i)} \xB7 ${p(u)}`,options:v(y)})}}return o.push(...c),o.push({key:"is",label:"Is",options:r.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),o}var A=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function x(e,n,t,r={}){if(t==null)return{ok:!0};if(!P(t))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let f=Object.entries(t);if(f.length===0)return{ok:!0};let o=[];for(let a of n)for(let s of T(e,a,r.through===!0))o.some(u=>u.key===s.key)||o.push(s);let d=n[0]?e.tryDefinition(n[0]):void 0,c=d?d.plural??`${p(d.kind)}s`:"These",i=[];for(let[a,s]of f){let u=o.find(y=>y.key===a);if(!u)return{ok:!1,says:`${c.replace(/^./,y=>y.toUpperCase())} have no field "${a}" to filter by${o.length>0?`; they filter by ${A(o.map(y=>y.key))}`:""}.`};if(typeof s!="string"&&typeof s!="number"&&typeof s!="boolean")return{ok:!1,says:`The filter on "${a}" is ${Array.isArray(s)?"a list":s===null?"null":`a ${typeof s}`}; it keeps one value: a word, a number, or true or false.`};let l=String(s);if(l.trim().length===0)return{ok:!1,says:`The filter on "${a}" keeps nothing; give it a value, or leave "${a}" out.`};if(l.includes(","))return{ok:!1,says:`The filter on "${a}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(l))return{ok:!1,says:`${u.label} has no choice "${l}"; its choices are ${A(u.options.map(y=>`"${y}"`))}.`};i.push(`${a}:${l}`)}return{ok:!0,filter:i.join(",")}}var S=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function j(e,n){let t=e.find(o=>o.as===n);if(t)return t;let r=n.trim().toLowerCase(),f=S(n);return e.find(o=>o.title!==void 0&&o.title.trim().toLowerCase()===r)??(f?e.find(o=>o.as===f||o.title!==void 0&&S(o.title)===f):void 0)}function W(e){let n=[];for(let t of e){if(typeof t!="object"||t===null)continue;let{as:r,slug:f,title:o,kind:d}=t,c=typeof r=="string"&&r.length>0?r:typeof f=="string"&&f.length>0?f:void 0;!c||n.some(i=>i.as===c)||n.push({as:c,title:typeof o=="string"?o:c,kind:typeof d=="string"?d:""})}return n}var O=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`,g=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,h=(e,n)=>`${"place"in e?`The place ${g(e.place)}`:`${g(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${O(n)}`;function k(e){let n={};for(let t of e.split(",")){let r=t.indexOf(":");r>0&&(n[t.slice(0,r).trim()]=t.slice(r+1).trim())}return n}function J(e,n=new Set){return e.kinds.filter(t=>!n.has(t)).map(t=>({slug:w(e,t).slice(1),kind:t}))}function R(e,n){let t=[...new Set(n.places.map(l=>l.as))],r=n.lists.map(l=>l.slug).filter(l=>!t.includes(l)),f;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||m(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?g(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};f=e.section}let o=f!==void 0?{section:f}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${g(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...o}};let d="place"in e?e.place:e.record,c=j(n.places,d),i=c?void 0:n.lists.find(l=>l.slug===d||l.kind===d);if(!c&&!i)return{ok:!1,says:`${h(e,n.places.filter((l,y,D)=>D.findIndex(L=>L.as===l.as)===y))}${G(r)}`};let a=c?[c.kind]:[i.kind],s;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${g(d)} cannot be narrowed here: it goes nowhere.`};let l=x(n.schema,a,e.where,{through:i!==void 0});if(!l.ok)return{ok:!1,says:`The filter on ${g(d)} goes nowhere: ${l.says}`};s=l.filter}let u=s?{filter:s}:{};return{ok:!0,arrival:c?{place:c.as,...u,...o}:{list:i.kind,...u,...o}}}var G=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`;function q(e){let n=t=>{let r=R(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}});return r.ok?e.onNavigate?.(r.arrival):e.onLost?.(r.says),r.ok};return{link(t){let r=t.hasAttribute("data-record")||t.hasAttribute("data-place");r&&!t.hasAttribute("data-graview-link")?(t.setAttribute("data-graview-link",""),t.hasAttribute("role")||t.setAttribute("role","link"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")):!r&&t.hasAttribute("data-graview-link")&&(t.removeAttribute("data-graview-link"),t.getAttribute("role")==="link"&&t.removeAttribute("role"))},follow(t){let r=t.getAttribute("data-record"),f=t.getAttribute("data-place"),o=t.getAttribute("data-filter"),d=t.getAttribute("data-section"),c={...o?{where:k(o)}:{},...d?{section:d}:{}};r?n({record:r,...c}):f&&n({place:f,...c})},go:n}}export{W as a,O as b,g as c,h as d,k as e,J as f,R as g,q as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g}from"./chunk.4ZSHTUNK.js";import"./chunk.PXQVXBNG.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{g as createLinks,f as judgeDestination,e as listsOf,c as nowhere,a as placesSaid,b as quoted,d as whereOfWords};
|
|
@@ -1,21 +0,0 @@
|
|
|
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 Je,b as nt,c as st,d as ot,e as it,f as at}from"./chunk.4IDXQVSW.js";import{a as rt,b as ke,c as lt}from"./chunk.IQ3LUSD6.js";import{g as Qe}from"./chunk.GAFYE37S.js";import{e as tt}from"./chunk.4P3LS2OE.js";import{c as Ze,f as et,g as ve}from"./chunk.YPEZZLOY.js";import{b as se,d as oe}from"./chunk.ZUJZVK2X.js";import{a as we,e as Ye}from"./chunk.BBLIT7S7.js";import{a as ne,f as Xe,h as qe}from"./chunk.4ZSHTUNK.js";import"./chunk.PXQVXBNG.js";import{a as H}from"./chunk.SDO3U72B.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var dt=["good","warn","bad","neutral","accent"],ut=["value","max","aria-label","placeholder","disabled"],ct=["click","change"],be=["_blank","_self"],pt=["section","div","span","strong","p","hr","a","button","input","progress"],ie={type:{oneOf:dt}},xe={"gv-card":{host:"section",properties:{tone:ie},events:{},children:"any"},"gv-group":{host:"div",properties:{direction:{type:{oneOf:["row","column"]}}},events:{},children:"any"},"gv-title":{host:"strong",properties:{},events:{},children:"text"},"gv-text":{host:"p",properties:{tone:ie},events:{},children:"text"},"gv-badge":{host:"span",properties:{tone:ie},events:{},children:"text"},"gv-field":{host:"div",properties:{label:{type:"string"}},events:{},children:"text"},"gv-progress":{host:"progress",properties:{value:{type:"number",as:"value"},max:{type:"number",as:"max"},label:{type:"string",as:"aria-label"}},events:{},children:"none"},"gv-divider":{host:"hr",properties:{},events:{},children:"none"},"gv-link":{host:"a",properties:{href:{type:"url"}},events:{},children:"text"},"gv-button":{host:"button",properties:{tone:ie,disabled:{type:"boolean",as:"disabled"}},events:{press:{from:"click"}},children:"text"},"gv-input":{host:"input",properties:{label:{type:"string",as:"aria-label"},value:{type:"string",as:"value"},placeholder:{type:"string",as:"placeholder"}},events:{change:{from:"change",detail:"value"}},children:"none"}},Se=1e4;var Kt=0,Rt=1,Gt=2,Wt=3,ft=1,Lt=2,_t=3,Ot=1,At=3,It=8,Te="~",Me=(s,e)=>Object.prototype.hasOwnProperty.call(s,e),Y=s=>typeof s=="object"&&s!==null&&!Array.isArray(s);function mt(s,e){return e.type==="url"?"href":e.as??`data-gv-${s.toLowerCase()}`}var Nt=2e3;function gt(s,e){if(e==null)return{ok:!0,value:null};let i=s.type;if(i==="boolean")return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,reason:"value"};if(i==="number")return typeof e=="number"&&Number.isFinite(e)?{ok:!0,value:String(e)}:{ok:!1,reason:"value"};if(typeof e!="string"||e.length>Nt)return{ok:!1,reason:i==="url"?"url":"value"};if(typeof i=="object")return i.oneOf.includes(e)?{ok:!0,value:e}:{ok:!1,reason:"value"};if(i==="url"){let f;try{f=new URL(e)}catch{return{ok:!1,reason:"url"}}return f.protocol!=="https:"||f.hostname===""||!/^https:\/\//i.test(e)?{ok:!1,reason:"url"}:{ok:!0,value:f.href}}return{ok:!0,value:e}}function Pt(s){let e=s.host==="a";return pt.includes(s.host)&&(s.target===void 0||e&&be.includes(s.target))&&Object.values(s.properties).every(i=>i.type!=="url"||e)&&Object.values(s.properties).every(i=>i.as===void 0||i.type!=="url"&&ut.includes(i.as))&&Object.values(s.events).every(i=>ct.includes(i.from))}function Ee(s,e){let i=e.kit??xe,f=e.maxNodes??2e3,o=s.ownerDocument,g=[],w=new Map,W={dom:s,name:Te,component:{host:"div",properties:{},events:{},children:"any"},children:[],listeners:new Map,id:Te};w.set(Te,W);let R=e.links?new Set(e.links.origins.flatMap(r=>{try{let d=new URL(r);return d.protocol==="https:"&&d.hostname!==""?[d.origin]:[]}catch{return[]}})):void 0,A=0,M=0,N=!1,c=r=>{g.push(r),g.length>200&&g.shift()},E=()=>({dom:o.createComment(""),children:[],refused:!0,listeners:new Map}),T=(r,d,y)=>{let a=r.component;if(!Me(a.properties,d))return c({reason:"property",element:r.name,name:d});let n=a.properties[d],m=gt(n,y),b=m.ok&&n.type==="url"&&R&&typeof m.value=="string"&&!R.has(new URL(m.value).origin)?{ok:!1,reason:"url"}:m,S=r.dom,h=mt(d,n);if(!b.ok)return S.removeAttribute(h),c({reason:b.reason,element:r.name,name:d});let L=b.value;L===null||L===!1?S.removeAttribute(h):S.setAttribute(h,L===!0?"":L),h==="value"&&"value"in S&&(S.value=typeof L=="string"?L:""),h==="disabled"&&"disabled"in S&&(S.disabled=L!==null&&L!==!1)},v=(r,d,y)=>{let a=r.component;if(!Me(a.events,d))return c({reason:"event",element:r.name,name:d});let n=r.listeners.get(d);if(n&&(n(),r.listeners.delete(d),M-=1),y==null)return;if(!Y(y)||typeof y.listener!="number")return c({reason:"value",element:r.name,name:d});let m=y.listener,b=a.events[d],S=r.dom,h=()=>e.onEvent(m,b.detail==="value"?String(S.value??""):void 0);S.addEventListener(b.from,h),r.listeners.set(d,()=>S.removeEventListener(b.from,h)),M+=1},k=r=>{if(!r.refused){A-=1,r.id!==void 0&&w.delete(r.id);for(let d of r.listeners.values())d();M-=r.listeners.size,r.listeners.clear();for(let d of r.children)k(d)}},_=(r,d)=>{if(!Y(r)||typeof r.id!="string"||w.has(r.id))return c({reason:"record"}),E();if(A>=f)return c({reason:"budget"}),N||(N=!0,e.onOverBudget?.()),E();let y=r.id,a=d.component.children;if(r.type===It)return E();if(r.type===At){if(a==="none")return c({reason:"child",element:d.name}),E();let h={dom:o.createTextNode(String(r.data??"").slice(0,Se)),children:[],text:!0,listeners:new Map,id:y};return w.set(y,h),A+=1,h}if(r.type!==Ot)return c({reason:"record"}),E();let n=String(r.element);if(!Me(i,n)||!Pt(i[n]))return c({reason:"element",element:n}),E();if(a!=="any")return c({reason:"child",element:n}),E();let m=i[n],b=o.createElement(m.host);b.setAttribute("data-gv",n.replace(/^gv-/,"")),b.className=`graview-guest-${n.replace(/^gv-/,"")}`,m.host==="a"&&(b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",m.target??"_blank"),b.setAttribute("referrerpolicy","no-referrer")),m.host==="button"&&b.setAttribute("type","button");let S={dom:b,name:n,component:m,children:[],listeners:new Map,id:y};if(w.set(y,S),A+=1,Y(r.properties))for(let[h,L]of Object.entries(r.properties))T(S,h,L);if(Y(r.attributes))for(let h of Object.keys(r.attributes))c({reason:"attribute",element:n,name:h});if(Y(r.eventListeners))for(let[h,L]of Object.entries(r.eventListeners))v(S,h,L);if(Array.isArray(r.children))for(let h of r.children){let L=_(h,S);S.children.push(L),b.appendChild(L.dom)}return S},P=r=>{if(!Array.isArray(r))return c({reason:"record"});let[d,y]=r,a=typeof y=="string"?w.get(y):void 0;if(!a)return c({reason:"record"});switch(d){case Kt:{if(a.text)return c({reason:"record"});let n=Number(r[3]),m=Number.isInteger(n)&&n>=0&&n<=a.children.length?n:a.children.length,b=_(r[2],a);a.dom.insertBefore(b.dom,a.children[m]?.dom??null),a.children.splice(m,0,b);return}case Rt:{let n=Number(r[2]),m=a.children[n];if(!m)return c({reason:"record"});a.children.splice(n,1),m.dom.parentNode?.removeChild(m.dom),k(m);return}case Gt:if(!a.text)return c({reason:"record"});a.dom.data=String(r[2]??"").slice(0,Se);return;case Wt:{if(a===W||a.text)return c({reason:"record"});let n=String(r[2]),m=r[4]??ft;return m===ft?T(a,n,r[3]):m===_t?v(a,n,r[3]):c(m===Lt?{reason:"attribute",element:a.name,name:n}:{reason:"record"})}default:return c({reason:"record"})}};return{apply(r,d){if(!Array.isArray(r))return c({reason:"record"}),!0;for(let y=0;y<r.length;y+=1){if(d&&y%32===0&&d())return!1;P(r[y])}return!0},get refused(){return g},get size(){return A},get listening(){return M},dispose(){for(let r of W.children)k(r);W.children.length=0,s.replaceChildren()}}}var Ke=`
|
|
2
|
-
.graview-guest { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--graview-ink, inherit); font: inherit; }
|
|
3
|
-
.graview-guest-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--graview-edge, #d0d0d0); border-radius: 10px; background: var(--graview-panel, transparent); }
|
|
4
|
-
.graview-guest-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
5
|
-
.graview-guest-group[data-gv-direction="row"] { flex-direction: row; flex-wrap: wrap; align-items: center; }
|
|
6
|
-
.graview-guest-title { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
|
|
7
|
-
.graview-guest-text { margin: 0; font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
|
|
8
|
-
.graview-guest-badge { align-self: flex-start; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
|
|
9
|
-
.graview-guest-field { font-size: 0.875rem; overflow-wrap: anywhere; }
|
|
10
|
-
.graview-guest-field[data-gv-label]::before { content: attr(data-gv-label) " "; color: var(--graview-ink-muted, inherit); }
|
|
11
|
-
.graview-guest-progress { width: 100%; }
|
|
12
|
-
.graview-guest-divider { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--graview-edge, #d0d0d0); }
|
|
13
|
-
.graview-guest-link { color: var(--graview-accent, inherit); text-decoration: underline; }
|
|
14
|
-
.graview-guest-button { align-self: flex-start; font: inherit; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--graview-edge, #d0d0d0); background: var(--graview-panel, transparent); color: inherit; cursor: pointer; }
|
|
15
|
-
.graview-guest-input { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--graview-edge, #d0d0d0); }
|
|
16
|
-
.graview-guest [data-gv-tone="good"] { color: var(--graview-good, inherit); }
|
|
17
|
-
.graview-guest [data-gv-tone="bad"] { color: var(--graview-bad, inherit); }
|
|
18
|
-
.graview-guest [data-gv-tone="warn"] { color: var(--graview-warn, inherit); }
|
|
19
|
-
.graview-guest [data-gv-tone="accent"] { color: var(--graview-accent, inherit); }
|
|
20
|
-
.graview-guest [data-gv-tone="neutral"] { color: var(--graview-ink-muted, inherit); }
|
|
21
|
-
`;var yt=new WeakSet;function Vt(s,e){if(s.startsWith("blob:"))return"blob:";try{return new URL(s,e.location.href).origin}catch{return s}}function ht(s,e,i){let f=Vt(e,s),o=`this page's Content-Security-Policy${i?` (${i})`:""} does not allow a worker from ${f}: it needs worker-src ${f}`;return yt.has(s)||(yt.add(s),s.console?.warn?.(`Graview: worker views cannot start on this page, because ${o}. A host that will not allow ${f} serves each view's whole script from its own origin and passes worker: { url } (the @graview/guest README, "What the host page allows").`)),o}function Dt(s,e){return s===""?!0:e.startsWith("blob:")?s.startsWith("blob"):e.startsWith(s)||s.startsWith(e)}function ae(s,e){let i="script"in e.source?s.URL.createObjectURL(new s.Blob([e.source.script],{type:"text/javascript"})):void 0,f="script"in e.source?i:e.source.url,o,g,w=!1,W=!1,R=0,A=0,M="",N=0,c=0,E=s.performance,T=E.now(),v,k=a=>{let n=a,m=String(n.effectiveDirective||n.violatedDirective||"").split(" ")[0];/^(worker-src|script-src|script-src-elem|child-src|default-src)$/.test(m)&&Dt(String(n.blockedURI??""),f)&&(v=m)},_=s.document;_?.addEventListener("securitypolicyviolation",k);let P=()=>_?.removeEventListener("securitypolicyviolation",k),r=()=>{W||(W=!0,g?.close(),o?.terminate(),o=void 0,s.clearTimeout(R),s.clearInterval(A),P(),i&&s.URL.revokeObjectURL(i))},d=(a,n)=>{W||(r(),e.onStop(a,n))},y=()=>{s.clearTimeout(R),P(),M=Je();let a=new s.MessageChannel;g=a.port1;let n=Math.max(1,e.silentMs),m=Math.max(10,Math.min(1e3,Math.floor(n/4)));T=E.now();let b=T;A=s.setInterval(()=>{let h=E.now();if(h-b>m*2&&(T+=h-b-m),b=h,h-T>=n)return d("silent");N+=1,a.port1.postMessage({type:"heartbeat",beat:N})},m);let S={graview:"host-hello",protocol:1,nonce:M,view:e.name};o.postMessage(S,[a.port2]),e.onReady(M,a.port1)};try{o=new s.Worker(f,{name:e.name})}catch(a){o=void 0;let n=a,m=n?.name==="SecurityError"?ht(s,f,v):`the worker could not be made: ${String(n?.message??a)}`;queueMicrotask(()=>d("start",m))}return o&&(R=s.setTimeout(()=>d("start",`it never said it was ready in ${e.readyMs.toLocaleString("en-US")} ms`),e.readyMs),o.onerror=a=>{let n=typeof a.message=="string"&&a.message!==""?a.message:void 0;if(w)return void e.onError?.(n??"an error");s.clearTimeout(R),s.setTimeout(()=>!w&&d("start",v?ht(s,f,v):n?`it failed before it said ready: ${n}`:"it failed before it said ready, and the engine gave no reason (a page policy that refuses it, or a script that does not load)"),0)},o.onmessage=a=>{if(!e.limiter.message()||w||!Ye(a.data)||a.data.protocol!==1){e.onDropped();return}w=!0,y()}),{get worker(){return o},answer(a){let n=a;return typeof n!="object"||n===null||n.type!=="heartbeat"||n.nonce!==M?!1:(typeof n.beat=="number"&&n.beat>c&&n.beat<=N&&(c=n.beat,T=E.now()),!0)},stop:r}}function le(s,e){let i=e(),f=0;return{draw(o){let g=e();g-i>=1e3&&(i=g,f=0);let w=o(()=>f+(e()-g)>=s);return f+=e()-g,w&&f<s}}}var Ct=H(()=>(__graviewPreload(import.meta.url,["./chunk.GAFYE37S.js","./chunk.AJZBJBMO.js"]),import("./chunk.YWVOACSX.js"))),Ht=H(()=>(__graviewPreload(import.meta.url,["./chunk.4P3LS2OE.js","./chunk.YPEZZLOY.js","./chunk.ZUJZVK2X.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.U3ETEQDO.js"))),jt=H(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.SHNYYBNW.js"))),Ut=H(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.QWY54AVN.js","./chunk.T4Q6OLZU.js","./chunk.R2B2ZAWI.js","./chunk.7XCBIID7.js","./chunk.MI2HL3LQ.js","./chunk.TMBFLZNH.js","./chunk.DYW4D74X.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.IJ2AF3AW.js"))),Bt=H(()=>(__graviewPreload(import.meta.url,["./chunk.YPEZZLOY.js","./chunk.ZUJZVK2X.js","./chunk.7MQ7UWVW.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.ZRICIE6T.js"))),$t=H(()=>(__graviewPreload(import.meta.url,["./chunk.BBLIT7S7.js","./chunk.AJZBJBMO.js"]),import("./chunk.RRCPEHM4.js")));function Ft(s,e,i){switch(s){case"manifest":return i??"Its manifest names something this app does not have.";case"source":return i??`Its code is longer than the ${e.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`;case"start":return`It could not start${i?`: ${i}.`:"."}`;case"error":return`It failed before it drew anything${i?`: ${i}`:"."}`;case"silent":return`It stopped answering for ${e.silentMs.toLocaleString("en-US")} ms.`;case"nodes":return`It drew more than the ${e.maxNodes.toLocaleString("en-US")} things a view may draw.`;case"flood":return`It sent more than ${e.messages} messages in ${e.messageWindowMs.toLocaleString("en-US")} ms.`;case"slow":return`It took longer than ${e.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`}}function zt(s,e){let i=s.ownerDocument,f=i.defaultView,{manifest:o}=e,g=i.createElement("div");g.className="graview-worker-view",g.setAttribute("role","region"),g.setAttribute("aria-label",o.title??o.name),g.setAttribute("data-worker-view",o.name),g.style.cssText="display:block;position:relative;contain:layout paint style;isolation:isolate;overflow:clip;min-width:0",s.appendChild(g);let w=g.attachShadow({mode:"open"}),W=e.author?i.createElement("p"):void 0;W&&(W.className="graview-worker-view-author",W.setAttribute("data-worker-view-author",o.name),W.style.cssText="margin:4px 0 0;font-size:0.75rem;color:var(--graview-ink-muted, inherit)",W.textContent=e.author,s.appendChild(W));let R={applied:0,refused:0,dropped:0},A=se(e.limits),M={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,messageWindowMs:e.limits?.messageWindowMs??1e3,pushMs:e.limits?.pushMs??1e3,silentMs:e.limits?.silentMs??5e3,drawMs:e.limits?.drawMs??100},N,c,E,T,v=!1,k={applied:0,refused:0,dropped:0},_=[],P=()=>{if(!c)return;let t=c.stats;R.applied+=t.applied-k.applied,R.refused+=t.refused-k.refused,R.dropped+=t.dropped-k.dropped,k={...t}},r=()=>{},d=0,y=()=>{},a=()=>{y(),y=()=>{},P(),c?.dispose(),c=void 0,E?.stop(),r(),f.clearInterval(d)},n=(t,p)=>{if(v)return;v=!0,a(),T?.dispose();let x=Ft(t,M,p);g.removeAttribute("data-worker-view-drawn"),g.setAttribute("data-worker-view-failed",t),e.fallback!==!1&&(e.fallback??m)(g,t,x),e.onFailure?.(t,x)},m=(t,p,x)=>{let K=N??(()=>{try{return ve(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{}})}catch{return}})(),l=i.createElement("div");l.setAttribute("data-graview-fallback",p),l.style.cssText="padding:12px;display:grid;gap:6px;color:var(--graview-ink, inherit);font-family:var(--graview-font-body, inherit)";let I=i.createElement("strong");I.textContent=o.title??o.name;let O=i.createElement("ul");O.style.cssText="margin:0;padding-left:1.2em";for(let $ of[...K?.node?[K.node]:[],...K?.nodes??[]]){let q=i.createElement("li");q.textContent=$.label??$.id,O.appendChild(q)}let B=i.createElement("p");B.style.cssText="margin:0;font-size:0.8125rem;color:var(--graview-ink-muted, inherit)",B.textContent=`This view was stopped. ${x}`,l.append(I,O,B),w.replaceChildren(l)},b=et(o,e.store);if(b.length>0)return queueMicrotask(()=>n("manifest",b.join(" "))),ge();let S=t=>{if(("source"in t?new TextEncoder().encode(t.source).length:"script"in t?new TextEncoder().encode(t.script).length:0)>M.maxSourceBytes)return["source"];let x="source"in t?rt(t.source):[];return x.length>0?["source",x.join(" ")]:void 0},h=e.worker,L=typeof h=="function"?void 0:S(h);if(L)return queueMicrotask(()=>n(...L)),ge();let Re=at(f,()=>We(),"blob"),de=()=>it(()=>e.theme?.()??st(g),e.brand,Re),Ge="",ue=()=>{Ge=JSON.stringify(de()),c?.push()},We=()=>{c&&JSON.stringify(de())!==Ge&&ue()},vt=ot(i,We),j,U,Le=o.pictures?jt().then(({createGuestPictures:t})=>{v||(j=t(f,{as:"blob",view:`"${o.title??o.name}"`,pictures:o.pictures,...e.limits?{limits:e.limits}:{},...e.file?{file:e.file}:{},moved:()=>c?.push(),onLeft:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)}}))}):Promise.resolve();r=()=>{vt(),Re.dispose(),j?.dispose(),X?.dispose(),U?.dispose(),te?.dispose()};let D,J=t=>D?.postMessage(t),_e=!1,Oe=!1,Q=()=>g.toggleAttribute("data-worker-view-drawn",!v&&Oe&&T!==void 0&&_.length===0&&z.size===0&&!j?.waiting()&&!(U?.waiting??0)),F=f.performance,z=new Map,Z=F.now(),ce=Math.max(10,Math.min(250,Math.floor(M.pushMs/4))),kt=()=>{d||(Z=F.now(),d=f.setInterval(()=>{let t=F.now(),p=t-Z>ce*2?t-Z-ce:0;Z=t;for(let[x,K]of z){let l=K+p;if(z.set(x,l),t-l>=M.pushMs)return n("slow")}},ce))},bt=le(M.drawMs,()=>F.now()),Ae=()=>{},pe=t=>{if(v)return;if(!T)return void _.push(t);let p=T;if(!bt.draw(K=>t[0]==="render"?p.apply(t[1],K):(p.style(t[1]),!0)))return n("slow");t[0]==="render"&&Ae()},Ie=()=>Xe(e.store.schema,new Set([...e.store.kindsKeptFrom(e.principal),...e.store.modules.disabledKinds])),ee=qe({sees:t=>e.store.seenBy(e.principal).graph.has(t),places:()=>ne(e.places?.()??[]),lists:Ie,schema:e.store.schema,...e.onNavigate?{onNavigate:e.onNavigate}:e.goTo?{onNavigate:t=>nt(e.goTo(),t)}:{},onLost:t=>{D?.postMessage({type:"notice",text:t}),e.onProblem?.(t)}}),C=new Set,Ne=new Set,X,Pe=!1,Ve=()=>{Pe||(Pe=!0,Ut().then(({createGuestMedia:t})=>{v||(X=t(f,{view:`"${o.title??o.name}"`,pictures:o.pictures!==void 0,shown:()=>N,...e.file?{file:e.file}:{},onProblem:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)}}),X.refresh(w))},()=>e.onProblem?.(`The view "${o.title??o.name}" places a video or a full-screen viewer, and the host's player could not be loaded.`)))},De=!1,Ce=!1,fe=new Map,He=()=>{De||!o.accepts?.length||(De=!0,Bt().then(({createGuestDrops:t})=>{v||(U=t(f,{shadow:w,manifest:o,store:e.store,principal:e.principal,files:()=>e.files?.(),shown:()=>C,hears:()=>Ce,idOf:p=>T?.renderer.idOf(p),send:J,change:(p,x)=>{if(!c)return{ok:!1,reason:"refused",message:"The view has gone."};let K=c.change(p,x);return P(),K},handed:p=>fe.set(p.href,p),onProblem:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)},onBusy:()=>Q()}),U.refresh())},()=>e.onProblem?.(`The view "${o.title??o.name}" takes files, and the host's drop could not be loaded.`)))},te,je=[],Ue=!1,xt=t=>{je=t,te?.bind(t),!(Ue||t.length===0)&&(Ue=!0,$t().then(({createGuestGestures:p,unheardWords:x})=>{if(!v){if(o.gestures!==!0){let K=x(o.title??o.name);return D?.postMessage({type:"notice",text:K}),e.onProblem?.(K)}te=p(w,{root:()=>w.querySelector("[data-graview-view-root]")??void 0,idOf:K=>T?.renderer.idOf(K),send:J}),te.bind(je)}},()=>{}))},St=t=>{let p=e.store.seenBy(e.principal).graph;for(let x of C){let K=p.getNode(x);for(let l of Object.values(K??{}))for(let I of Ze(l))if(I.href===t)return I}},Be=t=>{if(t.localName==="graview-video")return Ve();t.hasAttribute("data-lightbox")&&(t.setAttribute("aria-haspopup","dialog"),Ve())};Promise.all([Ct(),Ht()]).then(([{createOpenDrawing:t},{createPressReader:p,createSaver:x,fillPrefills:K,judgePress:l,prefillOf:I}])=>{if(v)return;let O=p(),B=(u,G)=>{let V=T?.renderer.idOf(u);V!==void 0&&J({type:"dom-event",target:V,event:"acted",pressed:G})},$=x({reader:O,save:(u,G)=>{if(!c)return;let V=c.pressed(l(e.store,o,C,u));P(),B(G,{as:u.as,...V})}}),q=()=>$.flush();f.addEventListener("pagehide",q),y=()=>{f.removeEventListener("pagehide",q),$.flush()};let Tt=new WeakSet;Ae=()=>{K(w,O,Tt,u=>I(e.store,e.principal,o,C,u)),X?.refresh(w),U?.refresh()},T=t(w,{origin:e.origin??f.location.origin,...e.asset?{asset:e.asset}:{},...e.images?{imageOrigins:e.images.origins}:{},...o.pictures?{picture:u=>j?.drawn(u)}:{},onRefused:u=>{if(u.reason!=="url"||u.element!=="img"||u.address===void 0||Ne.has(u.address))return;Ne.add(u.address);let G=Qe(u.address,{...e.images?{origins:e.images.origins}:{},assets:e.asset!==void 0},u.length);D?.postMessage({type:"notice",text:G}),e.onProblem?.(G)},...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>n("nodes"),send:J,onFieldSet:u=>O.filled(u),onAttribute:(u,G)=>{u.localName==="a"&&(G==="data-record"||G==="data-place")&&ee.link(u),G==="data-lightbox"&&Be(u),G==="data-drop"&&He()},decorate:u=>{u.localName==="a"&&ee.link(u),Be(u),u.hasAttribute("data-drop")&&He()},before:(u,G,V)=>{O.heard(u,G),$.heard(u,G,V);let ye=G.closest("a[data-graview-link]");ye&&V.contains(ye)&&(u.type==="click"||u.type==="keydown"&&u.key==="Enter")&&(u.preventDefault(),u.stopPropagation(),ee.follow(ye));let re=G.closest("[data-lightbox]"),Fe=u.type==="keydown"?u.key:void 0;if(re&&V.contains(re)&&u.isTrusted&&(u.type==="click"||(Fe==="Enter"||Fe===" ")&&re.localName!=="button")&&(u.preventDefault(),u.stopPropagation(),X?.open(re)),U?.before(u,G,V))return!1;let he=O.press(u,G,V);if(!he||!c)return;u.stopPropagation();let Mt=c.pressed(l(e.store,o,C,he));P();let ze={as:he.as,...Mt},Et=G.closest("[data-act]");return queueMicrotask(()=>B(Et,ze)),{pressed:ze}}});for(let u of _.splice(0))pe(u);Q()},()=>n("start","the view's drawing could not be loaded"));let me=t=>E=ae(f,{source:t,name:o.name,limiter:A,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>R.dropped+=1,onStop:(p,x)=>n(p,x),onError:p=>{_e||n("error",p)},onReady:(p,x)=>{D=x,kt();let K=oe({store:e.store,principal:e.principal,view:o.name,nonce:p,send:l=>{l.type==="props"&&typeof l.push=="number"&&(z.set(l.push,F.now()),Q()),x.postMessage(l)},props:()=>{let l=ve(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{},theme:de(),...e.places?{places:ne(e.places())}:{}});return C=new Set([...l.node?[l.node.id]:[],...(l.nodes??[]).map(I=>I.id)]),N=l,l},...j?{hand:j.hand}:{},judgeAct:(l,I)=>tt(e.store,o,l,I,{shown:C,file:O=>fe.get(O)??St(O),dropped:O=>fe.has(O)}),onHears:l=>{l.includes("drop")&&(Ce=!0)},onGestures:xt,onRender:l=>{_e=!0,pe(["render",l])},onPushed:(l,I)=>{if(z.delete(l),I>=M.pushMs)return n("slow");Oe=!0,Q()},onFlood:()=>n("flood"),onStyle:l=>pe(["style",l]),places:()=>[...new Set([...ne(e.places?.()??[]).map(l=>l.as),...Ie().map(l=>l.slug)])],...e.limits?{limits:e.limits}:{},limiter:A});c=K,x.onmessage=({data:l})=>{if(!E?.answer(l)&&(K.receive(l),P(),!v&&l?.nonce===p&&l.type==="navigate")){let I={...l.where!==void 0?{where:l.where}:{},...l.section!==void 0?{section:l.section}:{}},O=typeof l.place=="string"?{place:l.place,...I}:typeof l.to=="string"&&{record:l.to,...I};O&&ee.go(O)}},ue()}}),$e=t=>{"source"in t?(o.pictures?Promise.all([ke(t.source),Le]).then(([p])=>p):ke(t.source)).then(p=>{v||me({script:p})},()=>n("start","the view's runtime could not be loaded")):o.pictures?Le.then(()=>{v||me(t)},()=>n("start","the view's pictures could not be loaded")):me(t)};return typeof h=="function"?lt(h).then(t=>{if(v)return;let p=S(t);p?n(...p):$e(t)},t=>n("source",`Its code did not arrive${t instanceof Error&&t.message?`: ${t.message}`:""}.`)):$e(h),ge();function ge(){return{element:g,shadow:w,get worker(){return E?.worker},update:()=>{c&&ue()},get stats(){return P(),R},get refused(){return T?.refused??[]},dispose(){v=!0,a(),T?.dispose(),g.remove(),W?.remove()}}}}var wt="graview-guest-kit";function br(s,e){let i=s.ownerDocument,f=i.defaultView;if(!i.getElementById(wt)){let k=i.createElement("style");k.id=wt,k.textContent=Ke,i.head.appendChild(k)}let o=i.createElement("div");o.className="graview-guest",o.setAttribute("role","group"),o.setAttribute("aria-label",e.title??e.view),o.setAttribute("data-guest-view",e.view),s.appendChild(o);let g={applied:0,refused:0,dropped:0},w=se(e.limits),W=le(e.limits?.drawMs??100,()=>f.performance.now()),R,A,M,N=!1,c={applied:0,refused:0,dropped:0},E=()=>{if(!R)return;let k=R.stats;g.applied+=k.applied-c.applied,g.refused+=k.refused-c.refused,g.dropped+=k.dropped-c.dropped,c={...k}},T=()=>{E(),R?.dispose(),R=void 0,M?.stop()},v=(k,_)=>{N||(N=!0,T(),A?.dispose(),e.onFailure?.(k,_))};return M=ae(f,{source:e.worker,name:e.view,limiter:w,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>g.dropped+=1,onStop:(k,_)=>v(k,_),onReady:(k,_)=>{let P=Ee(o,{...e.kit?{kit:e.kit}:{},...e.links?{links:e.links}:{},onEvent:(d,y)=>_.postMessage({type:"event",listener:d,...y!==void 0?{detail:y}:{}}),...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>v("budget")});A=P;let r=oe({store:e.store,principal:e.principal,view:e.view,nonce:k,send:d=>_.postMessage(d),onRender:d=>{W.draw(y=>P.apply(d,y))||v("slow")},...e.input?{input:e.input}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{},onSize:e.onSize??(d=>o.style.minHeight=`${d}px`),...e.limits?{limits:e.limits}:{},limiter:w});R=r,_.onmessage=d=>{M?.answer(d.data)||(r.receive(d.data),E())},r.push()}}),{element:o,get worker(){return M?.worker},update:()=>R?.push(),get stats(){return E(),g},get refused(){return A?.refused??[]},dispose(){N=!0,T(),A?.dispose(),o.remove()}}}export{xe as GUEST_KIT,Ke as GUEST_KIT_CSS,be as KIT_LINK_TARGETS,dt as KIT_TONES,Ee as createKitRenderer,mt as hostAttribute,gt as kitValue,br as mountGuestWorker,zt as mountWorkerView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ib as w,Qb as S}from"./chunk.7MQ7UWVW.js";function B(s){return[...s.mutations??[],...S(s.schema,s.mutations??[])]}function b(s){let i=[...s.schema.kinds],a=B(s),d=new Map,c=new Map;for(let n of a){c.set(n.name,n.creates??[]);let e=w(n.input).filter(t=>!t.optional&&!t.kinds.includes("*")).flatMap(t=>t.kinds);d.set(n.name,[...new Set(e)])}let g=new Map;for(let n of i)g.set(n,[]);for(let n of a)for(let e of c.get(n.name)??[])g.get(e)?.push(n.name);let p=new Map,l=new Set;for(let n=0;;n+=1){let e=[];for(let t of a)if((d.get(t.name)??[]).every(o=>l.has(o)))for(let o of c.get(t.name)??[])l.has(o)||e.push(o);if(e.length===0)break;for(let t of e)l.add(t),p.set(t,n)}let h=n=>{let e=g.get(n)??[];if(e.length===0)return[];let t=e.map(r=>d.get(r)??[]).sort((r,o)=>r.length-o.length)[0];return[...new Set(t)].filter(r=>r!==n)},y=new Map,u=n=>{let e=y.get(n);if(e)return e;let t=new Set;y.set(n,t);for(let r of h(n)){t.add(r);for(let o of u(r))t.add(o)}return t.delete(n),t},f=new Map(i.map(n=>[n,0]));for(let n of i)for(let e of u(n))f.set(e,(f.get(e)??0)+1);let m=i.map(n=>({kind:n,madeBy:[...g.get(n)??[]].sort(),needs:[...h(n)].sort(),depth:p.get(n)??null})).sort((n,e)=>(n.depth??Number.MAX_SAFE_INTEGER)-(e.depth??Number.MAX_SAFE_INTEGER)||(f.get(e.kind)??0)-(f.get(n.kind)??0)||n.kind.localeCompare(e.kind)),k=m.filter(n=>n.depth===0).map(n=>n.kind),A=[...new Set(a.filter(n=>(d.get(n.name)??[]).length===0).filter(n=>(c.get(n.name)??[]).length>0).map(n=>n.name))].sort(),M=m.filter(n=>n.depth===null).map(n=>({kind:n.kind,why:n.madeBy.length===0?"no act declares that it creates this kind":`every act that makes it needs ${n.needs.map(e=>`"${e}"`).join(", ")}, which nothing can make first`}));return{order:m,roots:k,doors:A,unreachable:M}}export{b as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.JNCSGUO3.js";import"./chunk.ZEC64CK6.js";import"./chunk.VP35BUUZ.js";import"./chunk.7L6LYXCV.js";import"./chunk.SDO3U72B.js";import"./chunk.7MQ7UWVW.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|