graview 0.1.32 → 0.1.34
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.7GKUVQVF.js → chunk.2UPGH6FT.js} +1 -1
- package/dist/preview/{chunk.I6FPNX43.js → chunk.2YCFK5HU.js} +1 -1
- package/dist/preview/{chunk.4HZ7QTXZ.js → chunk.2YGQVI6T.js} +1 -1
- package/dist/preview/{chunk.3K6YSVHC.js → chunk.34CYK2DF.js} +1 -1
- package/dist/preview/{chunk.3TVXGJTU.js → chunk.35KI7XYV.js} +1 -1
- package/dist/preview/{chunk.COQKECUH.js → chunk.3C4RJIJU.js} +1 -1
- package/dist/preview/{chunk.TAQ764IQ.js → chunk.3H4NVUWV.js} +1 -1
- package/dist/preview/{chunk.K5ME5GCG.js → chunk.3MWBWSYF.js} +1 -1
- package/dist/preview/{chunk.MAF7C3VM.js → chunk.4K5QCJFH.js} +1 -1
- package/dist/preview/{chunk.ULRW47RP.js → chunk.52QAIGCD.js} +1 -1
- package/dist/preview/{chunk.D75KC3LL.js → chunk.577PGFUT.js} +1 -1
- package/dist/preview/{chunk.EBGAYL32.js → chunk.5EAQDBBE.js} +1 -1
- package/dist/preview/{chunk.4MERAWS2.js → chunk.6A62UVAE.js} +1 -1
- package/dist/preview/{chunk.7T7NZZTC.js → chunk.6FBQP336.js} +1 -1
- package/dist/preview/{chunk.EF3XNU4O.js → chunk.6K2HASOH.js} +1 -1
- package/dist/preview/chunk.6P7P2AW7.js +1 -0
- package/dist/preview/{chunk.LXBOVRFI.js → chunk.6VRJII5M.js} +1 -1
- package/dist/preview/{chunk.VG3O4LWB.js → chunk.6XO4PECH.js} +1 -1
- package/dist/preview/{chunk.GYICGZMG.js → chunk.7HPPJVIV.js} +2 -2
- package/dist/preview/{chunk.PIP6Z563.js → chunk.7JNDZWD6.js} +1 -1
- package/dist/preview/{chunk.6UGEYZAC.js → chunk.7MTX33WD.js} +1 -1
- package/dist/preview/{chunk.ASCLIM2P.js → chunk.7VUPKOKC.js} +1 -1
- package/dist/preview/{chunk.LLLZEGRK.js → chunk.7WHWD5YJ.js} +1 -1
- package/dist/preview/{chunk.NM6MZYFN.js → chunk.7X2ZO5BD.js} +1 -1
- package/dist/preview/{chunk.XNJEFUF7.js → chunk.AHCI7ZDO.js} +1 -1
- package/dist/preview/{chunk.JFAOHHJJ.js → chunk.APNN6BKF.js} +1 -1
- package/dist/preview/{chunk.QGTSHKJL.js → chunk.B2WRXGFI.js} +1 -1
- package/dist/preview/{chunk.HLTRQU4Y.js → chunk.B6VI576I.js} +1 -1
- package/dist/preview/{chunk.NTF7FVB2.js → chunk.BU2DSZ2L.js} +1 -1
- package/dist/preview/{chunk.T5VG5A6V.js → chunk.CNMITOKP.js} +1 -1
- package/dist/preview/chunk.CPW465TM.js +1 -0
- package/dist/preview/{chunk.47STJVRV.js → chunk.CZRX2FDI.js} +1 -1
- package/dist/preview/{chunk.GV2CQVKV.js → chunk.DMNXYMLC.js} +1 -1
- package/dist/preview/{chunk.F6ZK7RMB.js → chunk.DNDHDDM6.js} +2 -2
- package/dist/preview/{chunk.MWGGV7DE.js → chunk.DUUARGPE.js} +1 -1
- package/dist/preview/chunk.E7EQ2VTE.js +1 -0
- package/dist/preview/{chunk.UHUGOTUU.js → chunk.ETWVQ3A2.js} +1 -1
- package/dist/preview/{chunk.BNV77BQZ.js → chunk.F6WYSDSI.js} +3 -3
- package/dist/preview/{chunk.FWTIUYXH.js → chunk.FBY5IUGU.js} +1 -1
- package/dist/preview/{chunk.UATVTXZY.js → chunk.FCRFQ7ZW.js} +1 -1
- package/dist/preview/chunk.FRS3S7DN.js +1 -0
- package/dist/preview/{chunk.UGFJKSHU.js → chunk.FSAHO3LV.js} +1 -1
- package/dist/preview/{chunk.JQU5GEU3.js → chunk.FUQVNXLB.js} +1 -1
- package/dist/preview/{chunk.JDUJDAGA.js → chunk.G64AREGA.js} +1 -1
- package/dist/preview/{chunk.CN3UEF5N.js → chunk.GMOTRAKJ.js} +1 -1
- package/dist/preview/chunk.GNSAKLP2.js +1 -0
- package/dist/preview/{chunk.RCKTBOY2.js → chunk.HCDKSDIS.js} +1 -1
- package/dist/preview/chunk.HH6P4BLT.js +1 -0
- package/dist/preview/{chunk.AOSMJKLH.js → chunk.HJ56Q6WB.js} +1 -1
- package/dist/preview/chunk.HP3ZEDCD.js +117 -0
- package/dist/preview/{chunk.G5NZVPJU.js → chunk.HPD5ZDZH.js} +1 -1
- package/dist/preview/chunk.HPEGQN6E.js +1 -0
- package/dist/preview/chunk.HUKAVTMX.js +1 -0
- package/dist/preview/chunk.HWITWOP3.js +3 -0
- package/dist/preview/{chunk.3TY5NFLY.js → chunk.IHFNLKXV.js} +1 -1
- package/dist/preview/{chunk.2NIOHEMX.js → chunk.JQDYGI6G.js} +1 -1
- package/dist/preview/chunk.JZBBGY4B.js +1 -0
- package/dist/preview/chunk.KA3KI4UA.js +1 -0
- package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/{chunk.HAIG6NVX.js → chunk.LAF6GTBN.js} +1 -1
- package/dist/preview/{chunk.UNL2HIF2.js → chunk.LCFDM7XY.js} +1 -1
- package/dist/preview/{chunk.E2YEOMPH.js → chunk.LIIC25G6.js} +1 -1
- package/dist/preview/chunk.M5HADQPP.js +1 -0
- package/dist/preview/chunk.MWJUZG3C.js +6 -0
- package/dist/preview/chunk.OMMKD2NU.js +2 -0
- package/dist/preview/{chunk.JOOQUWLT.js → chunk.PNVR3CXR.js} +2 -2
- package/dist/preview/{chunk.PBSMLINK.js → chunk.PPUAPAWR.js} +1 -1
- package/dist/preview/{chunk.SYAEBGDC.js → chunk.PW7YH6JV.js} +1 -1
- package/dist/preview/{chunk.OC6IWRQ3.js → chunk.Q7TP4RFE.js} +1 -1
- package/dist/preview/{chunk.CIPS2OGR.js → chunk.QPAUQJON.js} +1 -1
- package/dist/preview/{chunk.UZGRRDHD.js → chunk.QU356VB2.js} +1 -1
- package/dist/preview/chunk.QVKKXMNK.js +1 -0
- package/dist/preview/{chunk.3AGY4QVS.js → chunk.QVUL2FSI.js} +1 -1
- package/dist/preview/chunk.RH45AW2W.js +1 -0
- package/dist/preview/{chunk.6YCBYL2Y.js → chunk.RIW7SQH4.js} +1 -1
- package/dist/preview/{chunk.H7EPE74C.js → chunk.RN3EZVV4.js} +1 -1
- package/dist/preview/{chunk.3HXN4BOY.js → chunk.RYEAMM73.js} +1 -1
- package/dist/preview/{chunk.YIR7PPF3.js → chunk.SIH6RCAI.js} +1 -1
- package/dist/preview/{chunk.NRAYZY3X.js → chunk.T2L4NPSB.js} +1 -1
- package/dist/preview/{chunk.DHIUSUCL.js → chunk.T3M4FALL.js} +5 -5
- package/dist/preview/{chunk.CX3KL2C5.js → chunk.TCSZZAYB.js} +1 -1
- package/dist/preview/chunk.TPX6AVJL.js +1 -0
- package/dist/preview/{chunk.5UL7YDUD.js → chunk.U5ACEYAN.js} +1 -1
- package/dist/preview/{chunk.5T5XGILP.js → chunk.UA5UYINM.js} +1 -1
- package/dist/preview/{chunk.GO4XBWJO.js → chunk.UCIQIPBQ.js} +1 -1
- package/dist/preview/{chunk.EKPRNDUV.js → chunk.UHQD3NTK.js} +1 -1
- package/dist/preview/{chunk.RIJUCHP4.js → chunk.VKH3ZPPQ.js} +1 -1
- package/dist/preview/{chunk.UBFNZMUX.js → chunk.VMGWYCXU.js} +1 -1
- package/dist/preview/chunk.VOFUIWAX.js +27 -0
- package/dist/preview/{chunk.DYSPCGXX.js → chunk.VSOB2QEK.js} +1 -1
- package/dist/preview/{chunk.R6K6GF5R.js → chunk.VZHV25JE.js} +1 -1
- package/dist/preview/chunk.WAB6ZS2V.js +1 -0
- package/dist/preview/chunk.WLBXBNNH.js +1 -0
- package/dist/preview/chunk.WPCGHGDA.js +1 -0
- package/dist/preview/{chunk.QYZNAUIR.js → chunk.WYEYYCBH.js} +1 -1
- package/dist/preview/{chunk.MNP4JI33.js → chunk.X7W27IRI.js} +4 -4
- package/dist/preview/{chunk.J25KOSNW.js → chunk.XK4FVT2X.js} +1 -1
- package/dist/preview/{chunk.CWHRDBOF.js → chunk.XXMYKBLT.js} +1 -1
- package/dist/preview/{chunk.CDP2XL66.js → chunk.XZYJRNRY.js} +1 -1
- package/dist/preview/chunk.YCIX53AR.js +1 -0
- package/dist/preview/chunk.YEYY273R.js +1 -0
- package/dist/preview/{chunk.EJPI3ST6.js → chunk.YJCT3DV2.js} +1 -1
- package/dist/preview/chunk.YT2CYCVT.js +1 -0
- package/dist/preview/{chunk.B2GLDIAS.js → chunk.Z7ZCR4LN.js} +1 -1
- package/dist/preview/{chunk.CAVBSL27.js → chunk.ZE4CTZQ3.js} +1 -1
- package/dist/preview/chunk.ZFWV4JAJ.js +1 -0
- package/dist/preview/{chunk.5H4VXLZF.js → chunk.ZJX6ZKKM.js} +1 -1
- package/dist/preview/chunk.ZPQKAJRI.js +1 -0
- package/dist/preview/{chunk.OKRNJXTV.js → chunk.ZSW74NVJ.js} +1 -1
- package/dist/preview/chunk.ZTD2CNC3.js +25 -0
- package/dist/preview/{chunk.QVVJRSRM.js → chunk.ZTFW7RKP.js} +1 -1
- package/dist/preview/index.html +42 -42
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4HRAQNJO.js +0 -27
- package/dist/preview/chunk.52W7WYME.js +0 -1
- package/dist/preview/chunk.5TVB6BUY.js +0 -1
- package/dist/preview/chunk.63GXY2ME.js +0 -1
- package/dist/preview/chunk.6QWV5MVH.js +0 -25
- package/dist/preview/chunk.AKFKM4SW.js +0 -3
- package/dist/preview/chunk.BOO6WVM4.js +0 -117
- package/dist/preview/chunk.BQ3JHEHV.js +0 -1
- package/dist/preview/chunk.CJJLJ3KW.js +0 -2
- package/dist/preview/chunk.DAZ2VSRD.js +0 -1
- package/dist/preview/chunk.ERIT3R6N.js +0 -1
- package/dist/preview/chunk.EYTBDMTW.js +0 -1
- package/dist/preview/chunk.F6EH7HI2.js +0 -1
- package/dist/preview/chunk.FSTCX2AI.js +0 -1
- package/dist/preview/chunk.H7BST3XO.js +0 -1
- package/dist/preview/chunk.IDVAR5HM.js +0 -1
- package/dist/preview/chunk.K7PMDSOL.js +0 -1
- package/dist/preview/chunk.KSES5U5B.js +0 -1
- package/dist/preview/chunk.LR3VDXPI.js +0 -1
- package/dist/preview/chunk.N6OX4NEQ.js +0 -1
- package/dist/preview/chunk.PHKSMUIA.js +0 -1
- package/dist/preview/chunk.SHTJZ6UX.js +0 -1
- package/dist/preview/chunk.TCNBCTWO.js +0 -1
- package/dist/preview/chunk.WAZ7OGBD.js +0 -1
- package/dist/preview/chunk.XANVHJQ4.js +0 -1
- package/dist/preview/chunk.XKABS745.js +0 -1
- package/dist/preview/chunk.XMC7YDWT.js +0 -1
- package/dist/preview/chunk.Y6ZNFQK3.js +0 -6
|
@@ -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 Ur,B as ke,C as bn,D as Ie,E as qe,F as jr,G as Sn,H as Pe,I as zr,J as _r,K as I,L as it,M as xn,N as Yr,O as Pn,P as Wt,Q as Qr,R as ie,S as le,T as An,a as Q,b as Re,c as te,d as Kr,e as vn,f as kn,g as rt,h as ne,i as he,j as se,k as A,l as re,m as B,n as ve,o as Ft,p as Le,q as me,r as Br,s as ut,t as It,u as ee,v as Ke,w as Gr,x as Dt,y as xe,z as Vr}from"./chunk.NM6MZYFN.js";import{b as qr,c as Ot,e as ae}from"./chunk.63GXY2ME.js";import{a as Dr,d as Wr,e as Hr}from"./chunk.UGFDSE37.js";import{a as Er,c as $r,f as Or,g as Fr,i as Ir}from"./chunk.FSTCX2AI.js";import{a as xr,b as Pr,c as Ar,d as wn}from"./chunk.Y6ZNFQK3.js";import{a as Cr,b as Rr,d as Et,e as Lr,f as Tr,i as $t}from"./chunk.NRAYZY3X.js";import{a as Nt,b as hn,c as kr,e as br}from"./chunk.3HXN4BOY.js";import{m as Sr}from"./chunk.UHUGOTUU.js";import{a as sr,b as lr,c as dr,e as vr,f as yn,h as Mt}from"./chunk.EBGAYL32.js";import{d as ur,e as gr,f as mr,g as fr,n as yr,o as hr,q as wr,s as Tt}from"./chunk.DAZ2VSRD.js";import{a as mn}from"./chunk.XANVHJQ4.js";import{a as Lt,b as ar,c as rr,d as ir,e as or}from"./chunk.CAVBSL27.js";import{a as At,b as $a,c as Oa,d as Ct,e as Fa}from"./chunk.J25KOSNW.js";import{b as ja,c as tr,e as nr,f as gn}from"./chunk.LR3VDXPI.js";import{a as Ve,b as Qa,c as Xa,d as Ja,e as Za,f as er}from"./chunk.SHTJZ6UX.js";import{a as pn,b as Va,c as Ua}from"./chunk.UT6642FC.js";import{b as za,c as _a,i as pt}from"./chunk.ULRW47RP.js";import{r as un,s as Ya}from"./chunk.XMC7YDWT.js";import{f as Ha,g as at,i as Ka,j as qa,k as cn,q as Ba,r as Ga}from"./chunk.B2GLDIAS.js";import{b as Rt,c as Ia,d as Da,e as Wa}from"./chunk.6YCBYL2Y.js";import{C as fn,K as Mr,N as Nr,e as Na,f as Ea,j as Ei,q as cr,r as pr}from"./chunk.JOOQUWLT.js";import{F as Ee,K as ka,M as ba,P as Sa,Q as Y,T as xa,U as Pa,Y as Aa,Z as ye,a as wa,aa as Ca,ba as Ra,da as La,ha as nt,ia as Ta,ra as Ma,s as va,w as Ne}from"./chunk.6QWV5MVH.js";import{Dc as ma,Ec as fa,Gb as pa,Gc as Pt,I as aa,Jb as ua,Ma as la,N as ct,Oa as da,Oc as dn,Pc as ya,Tc as ha,W as et,X as ge,Ya as sn,Z as we,Za as ca,_ as St,aa as tt,ca as ra,da as ia,dc as ga,ea as He,fb as xt,la as oa,ma as sa,yc as ln}from"./chunk.MNP4JI33.js";import{b as H}from"./chunk.AJZBJBMO.js";function Xr(t,e,n={}){let a=t.graph.getNode(e);if(!a)return;let i=t.schema.tryDefinition(a.kind),r=l=>ge(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"?i: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 v={edgeKind:l.kind,direction:d,...u?{description:u}:{},targets:[]};return o.set(k,v),v})()).targets.push({id:p.id,kind:p.kind,label:r(p)})}return{id:e,kind:a.kind,label:r(a),fields:Da(pt(t.schema,t.graph,a),i),violations:sn(t.violations(n.context),[e]),actions:mn(t,[e],{focus:e,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...o.values()].map(l=>{let d=Rt(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 Ue(t,e,n={}){return{kind:e,members:t.graph.nodesOfKind(e),actions:mn(t,[],{kindSelection:[e],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function Jr(t,e){let n=(r,o)=>`${r}|${JSON.stringify(o)}`,a=new Map;for(let r of[...t.affordances,...t.withheld]){if(r.provider!=="invariant")continue;let o=n(r.mutation,r.args);a.has(o)||a.set(o,r.rank??Number.MAX_SAFE_INTEGER)}let i=Number.MAX_SAFE_INTEGER;return[...e].map((r,o)=>({repair:r,declared:o})).sort((r,o)=>(a.get(n(r.repair.mutation,r.repair.args??{}))??i)-(a.get(n(o.repair.mutation,o.repair.args??{}))??i)||r.declared-o.declared).map(r=>r.repair)}function je(t){let e=t.schema.kinds.map(i=>({kind:i,plural:tt(t.schema,i),count:t.graph.nodesOfKind(i).length})),n=new Map;for(let i of t.graph.allEdges()){let r=t.graph.getNode(i.from),o=t.graph.getNode(i.to);if(!r||!o)continue;let l=`${i.kind}|${r.kind}|${o.kind}`;n.set(l,(n.get(l)??0)+1)}let a=[];for(let{kind:i}of e){let r=t.schema.tryDefinition(i)?.edges??{};for(let[o,l]of Object.entries(r)){let d=l.to==="*"||l.to===void 0?(()=>{let c=[...n.keys()].filter(p=>p.startsWith(`${o}|${i}|`)).map(p=>p.split("|")[2]);return c.length>0?c:["*"]})():l.to;for(let c of d)a.push({edgeKind:o,from:i,to:c,...l.description?{description:l.description}:{},...l.inverse?{inverse:l.inverse}:{},count:n.get(`${o}|${i}|${c}`)??0})}}return{kinds:e,relations:a}}var De=H(Ee(),1);var ze=H(Ee(),1),S=H(Y(),1),$i=`
|
|
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 Oi({title:t,name:e,optional:n,amount:a,value:i,onChange:r}){let o=Ka(a),[l,d]=(0,ze.useState)(()=>typeof i=="number"?qa(i,a):""),c=l.trim()!==""&&cn(l,a)===void 0;return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"number","data-graview-amount":a.format??"unit",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:t}),(0,S.jsxs)("span",{"data-graview-part":"amount",style:{display:"flex",alignItems:"center",gap:6},children:[o.prefix?(0,S.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.prefix}):null,(0,S.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),r(cn(p.target.value,a))},"data-graview-part":"control",style:{flex:1,minWidth:0}}),o.suffix?(0,S.jsx)("span",{"data-graview-part":"amount-symbol","aria-hidden":"true",children:o.suffix}):null]}),c?(0,S.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 Zr({children:t}){return(0,S.jsxs)("span",{"data-graview-part":"picker",children:[t,(0,S.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var Fi=t=>({label:we(t),option:e=>e}),Ii={phone:"+1 555 123 4567",place:"An address or a place's name",duration:"1h 30m, 90 or 1:30"};function Ht({store:t,spec:e,value:n,onChange:a,prefilled:i,open:r,words:o=Fi,values:l}){if(e.name in i&&e.control!=="group"&&e.control!=="variant")return null;let d=e.control==="node"&&!e.kinds.includes("*")?e.kinds.map(g=>we(He(t.schema.tryDefinition(g),g))).join(" or "):o(e.name).label,c=!(e.optional||e.control==="boolean"),p=c?(0,S.jsxs)(S.Fragment,{children:[d,(0,S.jsx)("span",{"aria-hidden":"true",children:" *"})]}):d;switch(e.control){case"text":case"date":return e.control==="text"&&e.long?(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,S.jsxs)("span",{"data-graview-part":"label",children:[p,e.markdown?(0,S.jsx)("span",{style:{fontWeight:"normal",color:"var(--graview-ink-faint)"},children:" \xB7 Markdown"}):null]}),(0,S.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,S.jsxs)("div",{"data-graview-part":"field","data-graview-field":"date",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(er,{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,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control==="text"&&e.holds?e.holds:e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.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:Ii[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,S.jsx)(Oi,{title:p,name:e.name,optional:e.optional,amount:e.amount,value:n,onChange:a}):(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.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,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,S.jsx)("input",{type:"checkbox",name:e.name,checked:n===!0,onChange:g=>a(g.target.checked),"data-graview-part":"control"}),(0,S.jsx)("span",{"data-graview-part":"label",children:p})]});case"choice":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(Zr,{children:(0,S.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,S.jsx)("option",{value:"",children:"\u2014"}),(e.options??[]).map(g=>(0,S.jsx)("option",{value:g,children:o(e.name).option(g)},g))]})})]});case"node":{let g=r.find(v=>v.name===e.name)?.candidates,f=new Set(Object.values(i).filter(v=>typeof v=="string")),u=(e.kinds.includes("*")?[...t.graph.allNodes()]:e.kinds.flatMap(v=>t.graph.nodesOfKind(v))).filter(v=>!f.has(v.id)),k=g?g.map(v=>t.graph.getNode(v)).filter(v=>v!==void 0):u,q=Rt(k,v=>t.schema.tryDefinition(v));return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":e.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:p}),(0,S.jsx)(Zr,{children:(0,S.jsxs)("select",{name:e.name,required:!e.optional,value:typeof n=="string"?n:"",onChange:v=>a(v.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),k.map(v=>{let C=q.get(v.id);return(0,S.jsxs)("option",{value:v.id,children:[ge(t.schema.tryDefinition(v.kind),v),C?` \xB7 ${C}`:""]},v.id)})]})})]})}case"group":{let g=n??{};return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),e.fields.map(f=>(0,S.jsx)(Ht,{store:t,spec:f,value:g[f.name],onChange:u=>a({...g,[f.name]:u}),prefilled:i,open:r,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,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":e.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:we(e.tag)}),(0,S.jsxs)("select",{value:f,onChange:k=>a({[e.tag]:k.target.value}),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),e.options.map(k=>(0,S.jsx)("option",{value:k.value,children:we(k.value)},k.value))]})]}),u?.fields.map(k=>(0,S.jsx)(Ht,{store:t,spec:k,value:g[k.name],onChange:q=>a({...g,[k.name]:q}),prefilled:i,open:r,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,S.jsx)(Ve,{as:"control",title:c?`${d} *`:d,value:n,onChange:a,several:g!==e,image:g?.image===!0,label:d});let f=Array.isArray(n)?n:[];return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:p}),f.map((u,k)=>(0,S.jsxs)("div",{"data-graview-part":"item",children:[(0,S.jsx)("div",{style:{flex:1},children:(0,S.jsx)(Ht,{store:t,spec:{...e.item,optional:!1},value:u,onChange:q=>a(f.map((v,C)=>C===k?q:v)),prefilled:i,open:r,words:o})}),(0,S.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(f.filter((q,v)=>v!==k)),children:"remove"})]},k)),(0,S.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...f,void 0]),children:"add another"})]})}case"linked":return(0,S.jsx)("div",{"data-graview-part":"field","data-graview-field":"linked",children:(0,S.jsx)(Xa,{relation:e.relation,value:n,onChange:a,label:d})});case"repeat":return(0,S.jsx)(Ja,{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,S.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",we(e.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function $e({store:t,mutation:e,prefilled:n={},open:a=[],onDone:i,principal:r,initial:o,label:l,only:d}){let c=()=>rr(e,t.graph,n),[p,g]=(0,ze.useState)(c),[f,u]=(0,ze.useState)(()=>({...p,...o})),[k,q]=(0,ze.useState)(null),v=r??t.seenFor,C=e.subject&&n[e.subject.arg],G=v?or(t,v,e,typeof C=="string"?C:void 0):void 0,L=Lt(e.input).filter(D=>(d===void 0||d.includes(D.name))&&!G?.has(D.name)),U=D=>Ha(t.schema,e,D),X=Ga(L.filter(D=>D.control==="date").map(D=>D.name)),de=(0,ze.useRef)(void 0),ce=(D,J)=>u(b=>{let P={...b,[D.name]:J};if(X&&D.name===X.start&&D.control==="date"){let M=_=>typeof _=="string"&&_!==""?_:void 0,N=M(b[X.start])??de.current;if(M(J)){de.current=M(J);let _=Ba(N,M(J),M(b[X.end]),{time:D.time===!0,instant:D.instant===!0});_!==void 0&&(P[X.end]=_)}}return P});return(0,S.jsxs)("form",{"data-testid":`form-${e.name}`,onSubmit:D=>{D.preventDefault();try{t.apply({name:e.name,args:{...ir(ar(L,f),p),...n}},r?{author:r}:{}),q(null);let J=c();g(J),u({...J}),i?.()}catch(J){q(at(t.schema,t.allMutations(),J))}},"data-graview-part":"form",children:[(0,S.jsx)("style",{children:$i}),L.map(D=>(0,S.jsx)(Ht,{store:t,spec:D,value:f[D.name],values:f,onChange:J=>ce(D,J),prefilled:n,open:a,words:U},D.name)),k?(0,S.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:k}):null,(0,S.jsx)("button",{type:"submit","data-graview-part":"submit",children:l??e.title??e.name})]})}var R=H(Y(),1);function Ae(t){let e=t.views;if(!e)return[];let n=new Set(Ke(t.store,t.principal));return e.places().filter(a=>n.has(a.kind))}function Kt(t,e){if(!e.over)return[e.kind];let n=new Set(Ke(t.store,t.principal));return e.over.filter(a=>a===e.kind||n.has(a))}var _e=t=>`place:${t.kind}:${t.as}`;function be(t,e){return Kr(e.as,ma(e,t.views?.places()??[])?Q(t.store.schema,e.kind):void 0)}function gt(t,e){let n=t.schema.tryDefinition(e);return t.graph.nodesOfKind(e).filter(a=>et(n,a))}function Cn(t,e,n){let a=(r,o)=>St(t.schema,o,r),i=(typeof e=="string"?[e]:e).map(r=>a(gt(t,r).length,r)).join(" and ");return n?`${i} across ${a(gt(t,n).length,n)}`:i}function Rn({context:t,place:e,chosen:n,filter:a}){let{store:i,views:r,invariantContext:o}=t,d=r?.resolve(e.kind,{cardinality:"many",fidelity:"full"},e.as)?.view,c=[...new Set(i.violations(o).flatMap(f=>f.nodeIds))],p=Kt(t,e).flatMap(f=>gt(i,f));if(!d)return null;let g=Di(i,p,a,c);return(0,R.jsx)(un,{kind:e.kind,view:e.title,children:(0,R.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 Di(t,e,n,a){let i=n?Pt({filter:n}).filter??[]:[];return i.length===0?e:Mt(e,{filter:i},{schema:t.schema,graph:t.graph,flagged:new Set(a)}).nodes}function Wi({store:t,views:e,as:n,invariantContext:a}){ae(t);let i={store:t,views:e,...a?{invariantContext:a}:{}},r=e.places().find(o=>o.as===n);return r?(0,R.jsx)(Rn,{context:i,place:r}):null}function Hi({context:t,kind:e}){let{store:n,views:a,invariantContext:i}=t,r=gt(n,e),o=n.schema.tryDefinition(e),l=ee(n,e),c=a?.resolve(e,{cardinality:"many",fidelity:"full"})?.view,p=[...new Set(n.violations(i).flatMap(k=>k.nodeIds))];if(c&&!nt(c))return(0,R.jsx)(un,{kind:e,children:(0,R.jsx)(c,{nodes:r,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=r.slice(0,f);return(0,R.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,R.jsx)(g,{node:k,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...p.includes(k.id)?{flagged:[k.id]}:{}},k.id):(0,R.jsx)("span",{style:{padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:ge(o,k)},k.id)),r.length>f?(0,R.jsxs)("span",{style:{...A,alignSelf:"center",padding:"0 6px"},children:["+",r.length-f," more ",l.toLowerCase()]}):null]})}function Ln(t){let{store:e}=t,n=Gr(t),a=Ae(t),i=ln([...a].sort((o,l)=>n.indexOf(o.kind)-n.indexOf(l.kind))).filter(o=>!o.hidden),r=new Set(i.flatMap(o=>o.over??[o.kind]));return[...i.map(o=>({key:_e(o),kind:o.kind,title:fa(o,a,e.schema),to:be(t,o),place:o})),...Dt(t).filter(o=>!r.has(o)).map(o=>({key:`kind:${o}`,kind:o,title:ee(e,o),to:`/${Q(e.schema,o)}`}))]}var ei=.72,Ki=540,ti=16/10;function qi(t){let e=(0,De.useRef)(null),[n,a]=(0,De.useState)(t);return(0,De.useLayoutEffect)(()=>{let i=e.current;if(!i||typeof ResizeObserver>"u")return;let r=()=>{let l=i.getBoundingClientRect().width;l>0&&a(d=>Math.abs(d-l)<.5?d:l)};r();let o=new ResizeObserver(r);return o.observe(i),()=>o.disconnect()},[]),{ref:e,width:n}}function Bi(t){for(let e=t.parentElement;e;e=e.parentElement)if(/(auto|scroll)/.test(getComputedStyle(e).overflowY))return e;return null}function Gi(t){let[e,n]=(0,De.useState)(()=>typeof IntersectionObserver>"u");return(0,De.useLayoutEffect)(()=>{let a=t.current;if(e||!a)return;let i=new IntersectionObserver(r=>{r.some(o=>o.isIntersecting)&&(i.disconnect(),n(!0))},{root:Bi(a),rootMargin:"50% 0px"});return i.observe(a),()=>i.disconnect()},[e,t]),e}function Tn({context:t,entry:e}){let{store:n,brand:a,principal:i}=t,{ref:r,width:o}=qi(Ki),l=Gi(r),d=o/ei,c=gt(n,e.kind),p=n.schema.tryDefinition(e.kind),g=c.length===0?Ue(n,e.kind,{...i?{principal:i}:{},...t.invariantContext?{context:t.invariantContext}:{}}).actions.affordances[0]:void 0,f=e.place!==void 0;return(0,R.jsxs)(I,{to:e.to,"data-testid":f?"place-card":"kind-card",className:"graview-gallery-card",style:{...ve,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,R.jsxs)("span",{ref:r,"data-testid":f?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${ti}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,R.jsx)("span",{style:{position:"absolute",left:0,top:0,width:d,height:d/ti,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${ei})`,transformOrigin:"0 0"},children:l?(0,R.jsx)(Et.Provider,{value:null,children:e.place?(0,R.jsx)(Rn,{context:t,place:e.place}):(0,R.jsx)(Hi,{context:t,kind:e.kind})}):null}),c.length===0?(0,R.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,R.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,R.jsxs)("span",{style:{fontFamily:kn,fontWeight:"var(--graview-weight-display)"},children:["No ",ee(n,e.kind).toLowerCase()," yet"]}),g?(0,R.jsxs)("span",{style:A,children:["Begin with \u201C",g.label,"\u201D"]}):null]})}):null]}),(0,R.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,R.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[f?null:(0,R.jsx)(me,{kind:e.kind,brand:a,schema:n.schema,size:8}),(0,R.jsx)("span",{style:{fontFamily:kn,fontSize:"var(--graview-text-heading)",fontWeight:"var(--graview-weight-display)",lineHeight:1.3,overflowWrap:"anywhere",textWrap:"balance"},children:e.title})]}),(0,R.jsxs)("span",{style:A,children:[e.place?Cn(n,Kt(t,e.place),e.place.across):Cn(n,e.kind),!f&&p?.description?` \xB7 ${p.description}`:null]})]})]})}var ni={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Vi=`
|
|
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 Mn({context:t}){ae(t.store);let e=Ln(t);return e.length===0?null:(0,R.jsxs)("section",{style:ni,"data-testid":"gallery",children:[(0,R.jsx)("style",{children:Vi}),e.map(n=>(0,R.jsx)(Tn,{context:t,entry:n},n.key))]})}function Nn({context:t}){let{store:e}=t;ae(e);let n=ln(Ae(t)).filter(i=>!i.hidden),a=Ln(t);return(0,R.jsxs)(ie,{context:t,style:rt,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:he,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,R.jsx)(le,{context:t,children:"Pictures"}),(0,R.jsx)("p",{style:se,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,R.jsx)("div",{style:ni,"data-testid":"places",children:a.map(i=>(0,R.jsx)(Tn,{context:t,entry:i},i.key))}):null]})}function En({context:t}){let{store:e,principal:n}=t;ae(e);let a=qe(),i=Ie(),[r]=it(),o=decodeURIComponent(a.as??""),[l,d]=(0,De.useState)(null),c=r.get("of"),p=r.get("filter"),f=Ae(t).find(L=>L.as===o&&(!c||Q(e.schema,L.kind)===c));if(!f)return(0,R.jsxs)(ie,{context:t,children:[(0,R.jsx)(le,{context:t,children:"No picture is called that."}),(0,R.jsx)("p",{style:se,children:(0,R.jsxs)(I,{to:"/places",style:B,children:["The pictures there are ",(0,R.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]});let u=ee(e,f.kind),k=t.views?.resolve(f.kind,{cardinality:"many",fidelity:"full"},f.as)?.view,q=k?.flows===!0,v=k?.creates!==!1,C=Ue(e,f.kind,{...n?{principal:n}:{},...t.invariantContext?{context:t.invariantContext}:{}}),G=v?C.actions.affordances.map(L=>({affordance:L,mutation:e.allMutations().find(U=>U.name===L.mutation)})).filter(L=>L.mutation!==void 0):[];return(0,R.jsxs)(ie,{context:t,style:rt,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)(le,{context:t,children:f.title}),(0,R.jsxs)("p",{style:se,"data-testid":"place-lede",children:[Cn(e,Kt(t,f),f.across),"."]}),p&&!q?(0,R.jsxs)("p",{style:{...A,margin:0},"data-testid":"place-narrowed",children:[`Only those where ${p.split(",").map(L=>L.replace(":"," is ")).join(" and ")}. `,(0,R.jsx)(I,{to:`?${(()=>{let L=new URLSearchParams(r);return L.delete("filter"),L.toString()})()}`,style:{...B,...A},children:"Show all"})]}):null,(0,R.jsx)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",gap:"4px 16px"},children:Kt(t,f).map((L,U)=>(0,R.jsxs)(I,{to:`/${Q(e.schema,L)}`,style:{...B,...A},...U===0?{"data-testid":"place-as-list"}:{},children:["All ",(L===f.kind?u:ee(e,L)).toLowerCase()," as a list ",(0,R.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},L))})]}),(0,R.jsx)("div",{"data-testid":"place-lens","data-flows":q?"":void 0,style:q?{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:L=>{let U=L.target?.closest("[data-graview-pick]"),X=U?.getAttribute("data-graview-pick"),de=U?.getAttribute("data-graview-joins");if(de)try{let D=JSON.parse(de);if(Array.isArray(D)&&D.every(J=>typeof J=="string")){L.preventDefault(),d({at:_e(f),ids:D});return}}catch{}if(!X)return;let ce=e.graph.getNode(X);ce&&(L.preventDefault(),i(te(e.schema,ce.kind,X)))},children:(0,R.jsx)(Rn,{context:t,place:f,filter:p,...l?.at===_e(f)?{chosen:l.ids}:{}})}),G.length>0?(0,R.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},"data-testid":"place-creators",children:G.map(({affordance:L,mutation:U})=>(0,R.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,R.jsx)("h2",{style:ne,children:U.title??U.name}),U.description?(0,R.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:U.description}):null,(0,R.jsx)($e,{store:e,mutation:U,prefilled:L.args,open:L.open,label:L.label,...n?{principal:n}:{}})]},L.id))}):null]})}function ot(t){return t.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-|-$/g,"")}function mt(t,e={}){let[n="/",a=""]=t.split("#")[0].split("?"),i=new URLSearchParams(a);e.filter&&i.set("filter",e.filter);let r=i.toString(),o=e.section?ot(e.section):"";return`${n}${r?`?${r}`:""}${o?`#${o}`:""}`}function Ui(t,e=document){let n=ot(t);if(!n)return null;let a=[e,...[...e.querySelectorAll("[data-worker-view]")].flatMap(i=>i.shadowRoot?[i.shadowRoot]:[])];for(let i of a)for(let r of i.querySelectorAll("[id], [data-section]")){let o=r.getAttribute("data-section")??r.id;if(o===t||ot(o)===n)return r}for(let i of a)for(let r of i.querySelectorAll("h1, h2, h3, h4, h5, h6, [role=heading]"))if(ot(r.textContent??"")===n)return r;return null}function ai(t,e={}){if(typeof document>"u"||typeof requestAnimationFrame>"u")return()=>{};let n=e.frames??120,a=0,i=()=>{let r=Ui(t,e.root??document);if(r){r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.scrollIntoView?.({block:"start"}),r.focus({preventScroll:!0});return}n-=1,n>0&&(a=requestAnimationFrame(i))};return a=requestAnimationFrame(()=>{a=requestAnimationFrame(i)}),()=>cancelAnimationFrame(a)}var z=H(Ee(),1);var qt=H(Ee(),1);var Ye=H(Y(),1);function ri({context:t}){return ye()?(0,Ye.jsxs)(Ye.Fragment,{children:[(0,Ye.jsx)(ji,{context:t}),(0,Ye.jsx)($r,{face:"pages",on:t.quickAsk??!0})]}):null}function ji({context:t}){let{store:e}=t,n=ye(),{pathname:a}=ke(),i=(0,qt.useRef)(n?.setSelection);return i.current=n?.setSelection,(0,qt.useEffect)(()=>{let r=i.current;if(!r)return;let[,o,l]=a.split("/"),d=(()=>{if(o==="places"){let p=t.views?.places().find(g=>g.as===decodeURIComponent(l??""));return p?[Ne(p.kind)]:[]}let c=o?Re(e.schema,o):void 0;return c&&l?[decodeURIComponent(l)]:c?[va(c)]:[]})();r(c=>c.length===d.length&&c.every((p,g)=>p===d[g])?c:d)},[a]),null}var fe=H(Ee(),1);var oi=H(Ei(),1);var ue=H(Y(),1);var zi=(0,fe.lazy)(wa(()=>(__graviewPreload(import.meta.url,["./chunk.63GXY2ME.js","./chunk.UGFDSE37.js","./chunk.FSTCX2AI.js","./chunk.Y6ZNFQK3.js","./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.J25KOSNW.js","./chunk.LR3VDXPI.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.QGTSHKJL.js")).then(t=>({default:t.TakeBack}))));function _i({context:t,docked:e,at:n}){let{store:a}=t,i=ae(a),[r]=(0,fe.useState)(()=>a.batches().length),o=(0,fe.useRef)(!1);return o.current||=i>0||!e&&r>0,o.current?(0,ue.jsx)(fe.Suspense,{fallback:null,children:(0,ue.jsx)(zi,{context:t,docked:e,at:n,since:r})}):null}function Yi(t,e,n){let{store:a,principal:i,embedded:r}=t;(0,fe.useEffect)(()=>{if(!n)return;let o=l=>{if(!Hr(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&&!r))&&Dr(a,i)){l.preventDefault();try{Wr(a,i)}catch{}}};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[a,i,r,e,n])}function si({context:t,registry:e,root:n,children:a}){let i=(0,fe.useMemo)(Yr,[]),r=e?.without()??new Set;return Yi(t,n,!r.has("undo")),(0,ue.jsxs)(xn.Provider,{value:i,children:[(0,ue.jsx)(Qi,{context:t,placed:i,without:r}),a]})}function Qi({context:t,placed:e,without:n}){let[a,i]=(0,fe.useState)(!1);(0,fe.useLayoutEffect)(()=>i(!0),[]);let r=Pn(e,"find"),o=Pn(e,"undo"),l=ke(),d=pr();if(!a)return null;let c=l.pathname.split("/").filter(Boolean),g=(c.length===1?Re(t.store.schema,c[0]):void 0)!==void 0;return(0,ue.jsxs)(ue.Fragment,{children:[!r&&!n.has("find")&&d?(0,oi.createPortal)((0,ue.jsx)(ii,{context:t,narrowsLists:g}),d.slot):null,!r&&!n.has("find")&&!d?(0,ue.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,ue.jsx)(ii,{context:t,narrowsLists:g})}):null,!o&&!n.has("undo")?(0,ue.jsx)(_i,{context:t,docked:!0,at:l.pathname+l.search}):null,d?.own&&!n.has("undo")?(0,ue.jsx)(Vr,{context:t,own:d.own}):null]})}function ii({context:t,narrowsLists:e}){return(0,ue.jsx)(xn.Provider,{value:null,children:(0,ue.jsx)(An,{context:t,narrowsLists:e})})}var oe=H(Ee(),1);var Se=H(Y(),1),Xi=500,Ji=10;function $n(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 Zi(t){let e=typeof getSelection=="function"?getSelection():null;return e!==null&&!e.isCollapsed&&e.containsNode(t,!0)}function eo(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 li({context:t,root:e,children:n}){return ye()===null?(0,Se.jsx)(Se.Fragment,{children:n}):(0,Se.jsx)(to,{context:t,root:e,children:n})}function to({context:t,root:e,children:n}){let{setMenuAt:a}=Aa(),{store:i}=t,r=i.schema,o=Ie(),{pathname:l,search:d}=ke(),c=Ur("/").replace(/\/$/,""),p=(0,oe.useCallback)((b,P)=>t.views?.places().find(M=>M.as===b&&(P===null||M.kind===P)),[t.views]),g=(0,oe.useCallback)((b,P)=>{let[M="",N,_]=b.split("/").filter(Boolean).map(j=>{try{return decodeURIComponent(j)}catch{return j}});if(_!==void 0)return null;if(M==="places"&&N!==void 0){let j=p(N,new URLSearchParams(P).get("of"));return j?{face:"pages",place:j.as,about:[Ne(j.kind)],title:j.title}:null}let E=Re(r,M);return E?N===void 0?{face:"pages",about:[Ne(E)],title:tt(r,E)}:i.graph.getNode(N)?{face:"pages",on:N,about:[N]}:null:null},[r,i,p]),f=(0,oe.useCallback)(b=>{let P=b.href;try{let M=new URL(P,location.href);if(M.origin===location.origin&&(c===""||M.pathname===c||M.pathname.startsWith(`${c}/`))){let N=g(M.pathname.slice(c.length),M.search);if(N)return{...N,href:P}}}catch{}return{face:"pages",about:[],href:P}},[c,g]),u=(0,oe.useCallback)(()=>g(l,d)??{face:"pages",about:[]},[g,l,d]),k=(0,oe.useCallback)(b=>{let P=u(),M=b.closest("[data-graview-field]")?.getAttribute("data-graview-field");if(M&&P.on!==void 0&&b.closest("[data-graview-pick], a[href]")===null)return{...P,field:M};let N=b.closest("[data-graview-act]")?.getAttribute("data-graview-act");if(N)return{...P,act:N};let _=b.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(_&&i.graph.getNode(_))return{face:"pages",on:_,about:[_],href:`${c}${te(r,i.graph.getNode(_).kind,_)}`};let E=b.closest("a[href]");if(E)return f(E);let j=b.closest("[data-graview-record]")?.getAttribute("data-graview-record");return j&&i.graph.getNode(j)?{face:"pages",on:j,about:[j]}:P},[u,f,i,r,c]),q=(0,oe.useCallback)((b,P,M)=>{let N=k(b);a({...N,x:Math.round(P),y:Math.round(M),returnTo:eo(b)})},[k,a]),v=(0,oe.useCallback)(b=>{let P=b.getBoundingClientRect();q(b,P.left+Math.min(16,P.width/2),Math.min(P.bottom,P.top+36))},[q]),C=(0,oe.useRef)(0),G=(0,oe.useRef)(null),L=(0,oe.useRef)(!1),U=()=>{G.current&&clearTimeout(G.current.timer),G.current=null};(0,oe.useEffect)(()=>U,[]),(0,oe.useEffect)(()=>{let b=P=>{if(P.defaultPrevented||!(P.key==="ContextMenu"||P.key==="F10"&&P.shiftKey))return;let M=e.current,N=P.target instanceof Element?P.target:null,_=N===null||N===document.body||N===document.documentElement,E=M!==null&&N!==null&&M.contains(N);if(!E&&!(_&&document.querySelector("[data-graview-face='pages']")===M)||$n(N)||N?.closest("[data-graview-popover]"))return;P.preventDefault(),C.current=Date.now();let j=E&&N instanceof HTMLElement?N:M?.querySelector("[data-graview-page-title], main h1, main")??null;j&&v(j)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,v]);let X=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages")return null;let P=[],M=b.on===void 0?void 0:i.graph.getNode(b.on),N=b.place===void 0?void 0:t.views?.places().find(T=>T.as===b.place),_=M?void 0:b.about.length===1&&b.about[0].startsWith("aggregate:")&&!N?no(b.about[0]):void 0,E=M?te(r,M.kind,M.id):N?be(t,N):_?`/${Q(r,_)}`:void 0,j=E!==void 0&&l===E.split("?")[0];E!==void 0&&!j&&P.push({id:"open",label:"Open",run:()=>o(E)});let Oe=E!==void 0?`${c}${E}`:b.href;Oe!==void 0&&P.push({id:"open-in-a-new-tab",label:"Open in a new tab",run:()=>void window.open(Oe,"_blank","noopener")});let m=M?`#focus=${encodeURIComponent(M.id)}`:N?`#focus=${encodeURIComponent(Ne(N.kind))}&view=${encodeURIComponent(N.as)}`:_?`#focus=${encodeURIComponent(Ne(_))}`:void 0;if(m!==void 0&&(t.overview||!t.embedded)){let T=t.overview;P.push({id:"in-the-scene",label:"Show in the scene",run:()=>T?T(m):location.assign(`${t.sceneHref??"/"}${m}`)})}return M===void 0&&b.href===void 0&&P.push({id:"find",label:"Find\u2026",run:()=>{let T=e.current?.querySelector('[data-testid="nav-find"]')??document.querySelector('[data-testid="nav-find"]');T&&T.offsetParent!==null?T.focus():o("/search")}}),P.length>0?{id:"pages",items:P}:null},[i,r,t,l,c,o,e]),de=(0,oe.useMemo)(()=>b=>{if(b.face!=="pages"||b.field===void 0||b.on===void 0)return null;let P=i.graph.getNode(b.on),M=b.element?.closest("[data-graview-field]")??e.current?.querySelector(`[data-graview-field="${CSS.escape(b.field)}"]`);return!P||!(M instanceof HTMLElement)||!M.hasAttribute("data-graview-editable")?null:{id:"field",at:"start",items:[{id:"change-field",label:`Change \u201C${ra(r.tryDefinition(P.kind),b.field)}\u201D`,run:()=>M.click()}]}},[i,r,e]),ce=Fr(),D=tr(),J=(0,oe.useMemo)(()=>[de,X,...D?[D]:[],...ce?[ce]:[]],[de,X,D,ce]);return(0,Se.jsxs)(Ya,{sections:J,children:[(0,Se.jsx)("div",{"data-graview-menu-ground":"",style:{display:"contents"},onContextMenu:b=>{let P=b.target;b.shiftKey||$n(P)||Zi(P)||(b.preventDefault(),!P.closest("[data-graview-popover]")&&(Date.now()-C.current<700||(b.clientX===0&&b.clientY===0&&P instanceof HTMLElement?v(P):q(P,b.clientX,b.clientY))))},onPointerDown:b=>{if(L.current=!1,b.pointerType==="mouse"||!b.isPrimary)return;let P=b.target;if($n(P)||P.closest("[data-graview-choose], [data-graview-popover]"))return;U();let{clientX:M,clientY:N}=b;G.current={x:M,y:N,timer:setTimeout(()=>{G.current=null,L.current=!0,C.current=Date.now(),q(P,M,N)},Xi)}},onPointerMove:b=>{let P=G.current;P&&Math.hypot(b.clientX-P.x,b.clientY-P.y)>Ji&&U()},onPointerUp:U,onPointerCancel:U,onClickCapture:b=>{L.current&&(L.current=!1,b.preventDefault(),b.stopPropagation())},children:n}),(0,Se.jsx)(ao,{openAt:v}),(0,Se.jsx)(Ir,{placement:"page"}),(0,Se.jsx)(nr,{})]})}function no(t){let e=t.slice(10).split("+");return e.length===1&&e[0]?e[0]:void 0}function ao({openAt:t}){return(0,Se.jsx)("span",{"data-graview-menu-home":"",tabIndex:-1,onFocus:e=>{if(e.target!==e.currentTarget)return;let n=e.currentTarget.closest("[data-graview-face]"),a=n?.querySelector("[data-graview-page-title]")??n?.querySelector("main h1, main")??null;a&&(a.hasAttribute("tabindex")||a.setAttribute("tabindex","-1"),a.focus({preventScroll:!0}))},style:{position:"absolute",width:0,height:0,overflow:"hidden"},children:(0,Se.jsx)(Er,{placement:"menu",openActs:t})})}var K=H(Y(),1);function di(t,e){return e==="*"?{label:"anything",path:null}:{label:ee(t,e),path:`/${Q(t.schema,e)}`}}function ro({context:t,relation:e}){let{store:n}=t,a=di(n,e.from),i=di(n,e.to),r=o=>o.path?(0,K.jsx)(I,{to:o.path,style:{...ve,fontWeight:550},children:o.label}):(0,K.jsx)("span",{children:o.label});return(0,K.jsxs)("li",{"data-testid":"relation","data-relation":e.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,K.jsx)(Or,{edgeKind:e.edgeKind,...t.brand?.kit?{kit:t.brand.kit}:{}}),(0,K.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,K.jsxs)("span",{children:[r(a)," ",(0,K.jsxs)("span",{style:A,"data-graview-speaks-ids":"",children:[we(e.edgeKind)," \u2192"]})," ",r(i)]}),e.description||e.inverse?(0,K.jsxs)("span",{style:A,children:[e.description?xe(e.description):null,e.description&&e.inverse?" \xB7 ":null,e.inverse?`from the other end, ${e.inverse}`:null]}):null]}),i.path?(0,K.jsx)(I,{to:`${i.path}?with=${encodeURIComponent(e.edgeKind)}`,style:{...B,...A,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${i.label.toLowerCase()} that have this`,children:e.count}):(0,K.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:e.count})]})}function ci({context:t,heading:e=!0}){let{store:n}=t,a=new Set(Ke(n,t.principal)),i=je(n).relations.filter(r=>a.has(r.from)&&(r.to==="*"||a.has(r.to)));return i.length===0?null:(0,K.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"kind-map",children:[e?(0,K.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,K.jsx)("h2",{style:ne,children:(0,K.jsx)(I,{to:"/map",style:ve,children:"Connections"})}),(0,K.jsx)("span",{style:A,children:i.length===1?"1 relation":`${i.length} relations`})]}):null,(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(r=>(0,K.jsx)(ro,{context:t,relation:r},`${r.edgeKind}|${r.from}|${r.to}`))})]})}function On({context:t}){let{store:e}=t;ae(e);let n=new Set(Ke(e,t.principal)),a=je(e),i=a.relations.filter(r=>n.has(r.from));return(0,K.jsxs)(ie,{context:t,children:[(0,K.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,K.jsx)("p",{style:he,children:i.length===0?"No relations":`${i.length} ${i.length===1?"relation":"relations"}`}),(0,K.jsx)(le,{context:t,children:"Connections"}),(0,K.jsx)("p",{style:se,children:i.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,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},"data-testid":"map-kinds",children:a.kinds.filter(r=>n.has(r.kind)).map(r=>(0,K.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,K.jsx)(me,{kind:r.kind,brand:t.brand,schema:e.schema,size:7}),(0,K.jsx)(I,{to:`/${Q(e.schema,r.kind)}`,style:B,children:r.plural}),(0,K.jsx)("span",{style:A,children:r.count})]},r.kind))}),(0,K.jsx)(ci,{context:t,heading:!1})]})}function pi({context:t}){let n=[...ye()?.robots.values()??[]].filter(i=>i.mode==="asking"&&i.say);if(n.length===0)return null;let{store:a}=t;return(0,K.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,K.jsx)("h2",{style:ne,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,K.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:8},children:n.map(i=>{let r=i.at?a.graph.getNode(i.at):void 0;return(0,K.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,K.jsx)("span",{children:i.say}),r?(0,K.jsxs)(I,{to:te(a.schema,r.kind,r.id),style:{...B,...A},children:[ge(a.schema.tryDefinition(r.kind),r)," \u2192"]}):null]},i.participant)})})]})}var V=H(Y(),1);function Fn({context:t}){let{principal:e}=t,{store:n,brand:a,invariantContext:i}=t;ae(n);let r=n.violations(i),o=`${r.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=Dt(t).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(G=>et(n.schema.tryDefinition(C),G))})),p=c.filter(C=>C.members.length>0),g=c.map(C=>({entry:C,creator:n.allMutations().find(G=>(G.creates??[]).includes(C.kind)&&n.permits({name:G.name,args:{}},t.principal).ok)})).find(C=>C.creator!==void 0),f=p.length===0?"Nothing here yet.":`${p.map(C=>St(n.schema,C.kind,C.members.length)).join(", ").replace(/, ([^,]*)$/," and $1")}.`,u=t.views?.homeView?.(),k=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(u&&k){let C=a?.subtitle?(0,V.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,G=u[Symbol.for("graview.home-blocks")]===!0;return(0,V.jsx)(ie,{context:t,style:rt,children:(0,V.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[G?null:C,r.length>0?(0,V.jsx)(I,{to:"/problems",style:{...B,color:"var(--graview-warn)"},children:o}):null,(0,V.jsx)(Tr.Provider,{value:G?C:null,children:(0,V.jsx)(u,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let q=new Set(Ke(n,t.principal)),v=je(n).relations.filter(C=>q.has(C.from)&&(C.to==="*"||q.has(C.to)));return(0,V.jsxs)(ie,{context:t,style:rt,children:[(0,V.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,V.jsx)("p",{style:{...A,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,V.jsx)(le,{context:t,"data-testid":"standing",children:f}),(0,V.jsxs)("p",{style:{...se,display:"grid",gap:4},"data-testid":"standing-card",children:[p.length===0&&g?(0,V.jsxs)("span",{children:["Begin with \u201C",g.creator?.title??g.creator?.name,"\u201D, under"," ",(0,V.jsx)(I,{to:`/${Q(n.schema,g.entry.kind)}`,style:B,children:ee(n,g.entry.kind)}),"."]}):null,r.length===0?(0,V.jsx)("span",{children:"All rules hold."}):(0,V.jsx)(I,{to:"/problems",style:{...B,color:"var(--graview-warn)"},children:o})]})]}),(0,V.jsx)(Mn,{context:t}),(0,V.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"kinds",children:[(0,V.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,V.jsx)("h2",{style:ne,children:"What is here"}),v.length>0?(0,V.jsxs)(I,{to:"/map",style:{...B,...A,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",v.length===1?"1 relation":`${v.length} relations`," ",(0,V.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]}):null]}),(0,V.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:c.map(({kind:C,members:G})=>(0,V.jsx)("li",{style:{maxWidth:"100%"},children:(0,V.jsxs)(I,{to:`/${Q(n.schema,C)}`,style:{...ve,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,V.jsx)(me,{kind:C,brand:a,schema:n.schema,size:7}),(0,V.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:ee(n,C)}),(0,V.jsx)("span",{style:{...A,fontVariantNumeric:"tabular-nums"},children:G.length===0?"none yet":ct(G.length)})]})},C))})]}),l.length>0?(0,V.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,V.jsx)("h2",{style:ne,children:"Recently"}),(0,V.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:l.map(C=>(0,V.jsxs)("li",{style:A,children:[(0,V.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",ut(C,e,{graph:n.graph,schema:n.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},C.id))})]}):null]})}var Te=H(Ee(),1);var $=H(Y(),1);function In({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let[r]=it(),o=r.get("q")??"",l=typeof i?.today=="string"?i.today:void 0,d=wr(e,o,{...a?{principal:a}:{},places:Ae(t),flagged:new Set(e.violations(i).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)(ie,{context:t,children:[(0,$.jsx)("style",{children:Ft}),(0,$.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,$.jsx)("p",{style:he,children:"Search"}),(0,$.jsx)(le,{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:[io(e,d.byKind)," for \u201C",f,"\u201D"]})}),f.length>0?(0,$.jsxs)("p",{style:{...A,margin:0},"data-testid":"search-searched",children:[Tt(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=>ee(e,k).toLowerCase()).join(" and "),"."]},`${u.key}:${u.value}`))]}):(0,$.jsxs)("p",{style:se,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)(I,{to:`/${Q(e.schema,u.kind)}`,style:B,children:[u.label,u.count>0?(0,$.jsxs)("span",{style:A,children:[" \xB7 ",u.count," match"]}):null]}):u.about==="place"?(0,$.jsxs)(I,{to:be(t,u),style:B,children:["Go to ",u.title]}):u.about==="rule"?(0,$.jsxs)(I,{to:"/problems",style:B,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)(me,{kind:u,brand:n,schema:e.schema,size:8}),(0,$.jsx)(I,{to:`/${Q(e.schema,u)}?${new URLSearchParams({q:f}).toString()}`,style:B,"data-testid":"search-kind-link",children:ee(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)(I,{to:te(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)(Bt,{why:k.why})]},k.id))})]},u)),f.length>0?(0,$.jsx)(oo,{asked:f}):null,f.length>0&&d.hits.length===0?(0,$.jsx)(gi,{store:e,kinds:d.searched.kinds,words:d.words,...a?{principal:a}:{},...i?{invariantContext:i}:{}}):null]})}function Bt({why:t}){return t.strength==="near"?(0,$.jsxs)("span",{style:A,"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:A,"data-testid":"search-why",children:[t.reading,": ",t.fragment]})}function io(t,e){let n=Object.entries(e).map(([a,i])=>`${i} ${i===1?He(t.schema.tryDefinition(a),a):ee(t,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?xe(n[0]):xe(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function ui(t,e,n={}){let a=[];for(let i of e){let r=Ue(t,i,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let o of Gt(t,i,r.actions.affordances))a.some(l=>l.mutation.name===o.mutation.name)||a.push(o)}return a}function Gt(t,e,n){let a=t.schema.tryDefinition(e)?.fieldRoles?.label,i=[];for(let r of n){let o=t.allMutations().find(c=>c.name===r.mutation);if(!o||!o.creates?.includes(e)||i.some(c=>c.mutation.name===o.name))continue;let l=Lt(o.input).map(c=>c.name),d=l.includes("label")?"label":a&&l.includes(a)?a:void 0;!d||r.args[d]!==void 0||i.push({kind:e,affordance:r,mutation:o,arg:d})}return i}function gi({store:t,kinds:e,words:n,principal:a,invariantContext:i}){let r=ui(t,e,{...a?{principal:a}:{},...i?{invariantContext:i}:{}});return r.length===0||n.trim().length===0?null:(0,$.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:r.map(({kind:o,affordance:l,mutation:d,arg:c})=>(0,$.jsxs)("section",{style:{...re,display:"grid",gap:14},children:[(0,$.jsxs)("h2",{style:ne,children:[xe(ia(He(t.schema.tryDefinition(o),o)))," called \u201C",n,"\u201D"]}),(0,$.jsx)($e,{store:t,mutation:d,prefilled:l.args,open:l.open,initial:{[c]:n},...a?{principal:a}:{}})]},`${l.id}|${n}`))})}function oo({asked:t}){let e=ye();return e?(0,$.jsx)(so,{asked:t,desk:e.aiDesk}):null}function so({asked:t,desk:e}){return Ea(e)?(0,$.jsx)("p",{style:{margin:0},children:(0,$.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:a=>Na(e,{pointed:{about:[]},asked:t,returnTo:a.currentTarget}),style:{...B,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",t,"\u2019"]})}):null}var w=H(Y(),1),fi=8,yi=40;function lo(t,e){let n=e?.fields?.shape??{},a=Object.keys(n).find(i=>sa(n[i])&&oa(t[i]));return a===void 0?void 0:t[a]}function Dn({context:t}){let e=qe(),n=Re(t.store.schema,e.slug??"");return n?(0,w.jsx)(hi,{context:t,kind:n}):(0,w.jsx)(ie,{context:t,children:(0,w.jsx)(le,{context:t,children:"No such kind of thing here."})})}function hi({context:t,kind:e,opening:n,row:a,layout:i="list",description:r,bare:o}){let{store:l,brand:d,invariantContext:c}=t;ae(l);let[p,g]=it(),f=`list-${(0,Te.useId)().replace(/:/g,"")}`,u=l.schema.tryDefinition(e),k=da(p.get("archived")),q=l.graph.nodesOfKind(e,{archived:k}),v=je(l).relations.filter(s=>s.from===e||s.to===e),C=new Set(l.violations(c).flatMap(s=>s.nodeIds)),G=fr(l.schema,mr(l.schema,gr(l.schema,e))),L=v.map(s=>s.edgeKind),U=fo(p,G,L),X=["sort","filter","group","q","by","with","past","archived",...L].some(s=>p.has(s)),de=q.length>=yi,ce=u?.fieldRoles?.when,D=t.views?.arrangement?.()?.lists?.[e],J=lr(D),b=sr(D?.group),P=mo(de,ce),M=n??(J?{...P,...J}:P),N=X?U.arrangement:yn(M,G).arrangement,_=J?.sort,E=N.sort&&_?.then&&N.sort.by===_.by&&N.sort.direction===_.direction?{...N,sort:_}:N,j=yr(E.query??""),Oe=[...E.filter??[],...j.conditions].some(s=>s.key==="is"&&(s.value==="past"||s.value==="any"))||ur(u,[...E.filter??[],...j.conditions]),m=Oe||!u?.lifecycle?E:{...E,filter:[...E.filter??[],{key:"is",value:"current"}]},T=new Map,Z=Mt(q,m,{schema:l.schema,graph:l.graph,flagged:C,...typeof c?.today=="string"?{today:c.today}:{},read:(s,h)=>{let O=T.get(s.id);return O||T.set(s.id,O=pt(l.schema,l.graph,s)),O[h]}}),F=b&&E.group?.by===b.by&&!E.group.bucket?G.groups.find(s=>s.key===b.by):void 0,qn=b&&F&&(F.type==="choice"||F.type==="boolean")?dr(Z.groups,b,{type:F.type,...F.options?{options:F.options}:{}}):Z.groups.map(s=>({...s,closed:!1})),Bn=new Set((p.get("open")??"").split(",").filter(Boolean)),bi=!!E.query||(E.filter??[]).some(s=>s.key===b?.by),Gn=s=>F?.type==="boolean"?s==="1"?"true":"false":s,Vn=s=>s.closed&&!bi&&!Bn.has(Gn(s.key)),Si=s=>{let h=new URLSearchParams(p),O=new Set(Bn);O.has(s)?O.delete(s):O.add(s),O.size>0?h.set("open",[...O].join(",")):h.delete("open"),g(h,{replace:!0})},Fe=Z.nodes,st=u?.lifecycle&&!Oe?q.filter(s=>et(u,s)):q,Un=q.length-st.length,jt=E.group?.by??null,xi=s=>{let h=new URLSearchParams(p);for(let pe of["sort","filter","group","q","by","with","past","archived",...v.map(kt=>kt.edgeKind)])h.delete(pe);let O=vr(s);for(let pe of["sort","filter","group","q","archived"])O[pe]&&h.set(pe,O[pe]);![...h.keys()].some(pe=>["sort","filter","group","q"].includes(pe))&&(n||J||de||ce)&&h.set("sort",""),g(h)},{principal:Xe}=t,zt=Ue(l,e,{...Xe?{principal:Xe}:{},...t.invariantContext?{context:t.invariantContext}:{}}),We=zt.actions.affordances.map(s=>({affordance:s,mutation:l.allMutations().find(h=>h.name===s.mutation)})).filter(s=>s.mutation!==void 0),jn=zt.actions.withheld,_t=()=>new Set(Fe.length===0?We.map(({mutation:s})=>s.name):[]),[Yt,zn]=(0,Te.useState)(()=>({kind:e,open:_t()}));Yt.kind!==e&&zn({kind:e,open:_t()});let _n=s=>(Yt.kind===e?Yt.open:_t()).has(s),Yn=(s,h)=>zn(O=>{let pe=new Set(O.open);return h?pe.add(s):pe.delete(s),{kind:O.kind,open:pe}}),Qn=`begin-${(0,Te.useId)().replace(/:/g,"")}`,Xn=j.words&&Fe.length===0?Object.fromEntries(Gt(l,e,zt.actions.affordances).map(s=>[s.mutation.name,s.arg])):{},Je=ee(l,e),yt=t.views?.lookup(e,{cardinality:"one",fidelity:"glyph"}),Qt=yt!==void 0&&!nt(yt)?yt:void 0,Xt=(E.group?.bucket??"day")==="day"?E.group?.by:void 0,Jt=(E.filter??[]).map(s=>s.key),Pi=Jt.filter(s=>Jt.indexOf(s)===Jt.lastIndexOf(s)&&/choice|boolean/.test(G.filters.find(h=>h.key===s)?.type??"")),Zt=s=>{let h={...u?.computed?pt(l.schema,l.graph,s):s};Xt&&!String(h[Xt]).includes("T")&&delete h[Xt];for(let O of Pi)delete h[O];return h},ht=s=>{let h=ge(u,s);if(a)return(0,w.jsxs)("li",{"data-testid":"record-row","data-graview-record":s.id,style:{minWidth:0},...rn(s.id),children:[an(s,h),a(s,{label:h,href:te(l.schema,e,s.id),flagged:C.has(s.id),glance:It(Zt(s),u,h)})]},s.id);if(Qt){let on=$t(yt,s,l.graph),Mi=Object.fromEntries(Object.entries(Zt(s)).filter(([Ni])=>!on?.fields.has(Ni))),na=on?It(Mi,u,on.title??h):"";return(0,w.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)"},...rn(s.id),children:[an(s,h),(0,w.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,w.jsx)(Qt,{node:s,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...C.has(s.id)?{flagged:[s.id]}:{}})}),na?(0,w.jsx)("span",{style:{...A,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:na}):null,(0,w.jsx)(wo,{to:te(l.schema,e,s.id),label:C.has(s.id)?`${h} \u2014 implicated in a problem`:h})]},s.id)}let O=It(Zt(s),u,h),pe=j.words?hr(u,s,j.words):void 0,kt=de?void 0:_a(s,u),bt=lo(s,u),ta=(0,w.jsxs)(I,{to:te(l.schema,e,s.id),className:"graview-row-title",...h.length>60?{title:h}:{},children:[C.has(s.id)?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("span",{role:"img","aria-label":"Breaks a rule:",style:{color:"var(--graview-warn)"},children:"\u26A0"})," "]}):null,h]});return(0,w.jsxs)("li",{className:"graview-row","data-graview-record":s.id,...rn(s.id),children:[an(s,h),kt?(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:14,minWidth:0},children:[(0,w.jsx)(Ve,{as:"thumb",file:kt}),ta]}):ta,O||bt?(0,w.jsxs)("span",{className:"graview-row-glance",children:[O,O&&bt?" \xB7 ":null,bt?(0,w.jsx)(Nt,{address:bt}):null]}):null,pe?(0,w.jsx)(Bt,{why:pe}):null]},s.id)},en=Ae(t).filter(s=>s.kind===e),Jn=D?.filters,Ai=(E.filter??[]).some(s=>s.key!=="is"||s.value!=="any"),Ci=!!(E.sort||E.group||E.query||Ai),Ri=st.length>=fi||X&&Ci,Me=E.sort?G.sorts.find(s=>s.key===E.sort.by):void 0,tn=Me?.type==="date"||Me!==void 0&&Me.key===ce,Zn=de&&!Z.grouped&&Me&&(Me.about==="label"||Me.type==="text"||tn)?s=>{let h=Me.about==="label"?ge(u,s):s[Me.key];if(typeof h!="string"||h.length===0)return tn?"No date":"#";if(tn)return h.slice(0,4);let O=h.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(O)?O:"#"}:void 0,Ge=Zn?Fe.reduce((s,h)=>{let O=Zn(h);return s.at(-1)?.key===O?s.at(-1).nodes.push(h):s.push({key:O,nodes:[h]}),s},[]):void 0,ea=Z.grouped&&jt?qn.flatMap(s=>Vn(s)?[]:s.nodes):Ge&&Ge.length>1?Ge.flatMap(s=>s.nodes):Fe,nn=(0,Te.useMemo)(()=>ea.map(s=>s.id),[ea.map(s=>s.id).join(`
|
|
109
|
-
`)]),Ce=xr(nn),lt=(Xe?l.permittedMutations(Xe):l.permittedMutations()).some(s=>{let h=s.subject?.kinds;return h!==void 0&&(h==="*"||h.includes(e))}),an=(s,h)=>lt?(0,w.jsx)("span",{className:"graview-choose-at",children:(0,w.jsx)("input",{...Ce.boxProps(s.id,h),onPointerEnter:wn,onFocus:wn})}):null,rn=s=>lt?{"data-graview-choose":s}:{},Li=(0,Te.useCallback)(s=>{Ce.choose(s),requestAnimationFrame(()=>{let h=Ce.list.current;((s[0]===void 0?null:h?.querySelector(`[data-graview-choose-box="${CSS.escape(s[0])}"]`))??h)?.focus({preventScroll:!0})})},[Ce]),Ze=i==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",alignItems:"start",gap:12}:a||Qt?{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&i==="list"?6:0}:void 0,wt=Ze?void 0:"graview-rows",dt=s=>`list-at-${s.replace(/[^\p{L}\p{N}]/gu,"_")}`,vt=v.map(s=>{let h=s.from===e?s.to:s.from,O=s.from===e?s.description:s.inverse??s.description;return{relation:s,far:h,words:O}}),Ti=new Set(vt.map(s=>(s.words??"").toLowerCase()).filter((s,h,O)=>s&&O.indexOf(s)!==h));return(0,w.jsxs)(o?go:ie,{context:t,children:[(0,w.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,w.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,w.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:10,rowGap:4,minWidth:0},children:[(0,w.jsx)(me,{kind:e,brand:d,schema:l.schema,size:8}),(0,w.jsx)(le,{context:t,children:Je}),We.length>0?(0,w.jsx)("span",{style:{marginLeft:"auto",display:"flex",flexWrap:"wrap",columnGap:14},"data-testid":"beginnings-open",children:We.map(({affordance:s,mutation:h})=>(0,w.jsx)(yo,{name:h.name,title:h.title??h.name,panel:`${Qn}-${h.name}`,open:_n(h.name),onOpen:O=>Yn(h.name,O)},s.id))}):null]}),r??u?.description?(0,w.jsx)("p",{style:se,children:r??u?.description}):null,vt.length>0||en.length>0?(0,w.jsxs)("p",{style:{...A,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[vt.length>0?(0,w.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",vt.map(({relation:s,far:h,words:O},pe)=>(0,w.jsxs)("span",{"data-relation":s.edgeKind,children:[pe>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,h==="*"?xe(O??we(s.edgeKind)):(0,w.jsx)(I,{to:`/${Q(l.schema,h)}`,style:B,title:ee(l,h),children:O&&Ti.has(O.toLowerCase())?`${xe(O)}: ${ee(l,h).toLowerCase()}`:xe(O??ee(l,h))})]},`${s.edgeKind}|${s.from}|${s.to}`))]}):null,en.length>0?(0,w.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",en.map((s,h)=>(0,w.jsxs)("span",{children:[h>0?(0,w.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,w.jsx)(I,{to:be(t,s),style:B,children:s.title})]},_e(s)))]}):null]}):null]}),We.length>0?(0,w.jsx)("div",{style:{display:"contents"},"data-testid":"beginnings",children:We.map(({affordance:s,mutation:h})=>{let O=!!(Xn[h.name]&&Fe.length===0);return(0,w.jsx)(ho,{name:h.name,id:`${Qn}-${h.name}`,description:h.description,open:_n(h.name),onClose:()=>Yn(h.name,!1),children:(0,w.jsx)($e,{store:l,mutation:h,prefilled:s.args,open:s.open,...O?{initial:{[Xn[h.name]]:j.words}}:{},...t.principal?{principal:t.principal}:{}},O?`${h.name}|${j.words}`:h.name)},s.id)})}):null,U.dropped.length>0?(0,w.jsxs)("p",{style:{...A,margin:0},"data-testid":"list-dropped",children:["This link asked for ",U.dropped.join(", "),", which ",Je.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,st.length>0?(0,w.jsx)(Sr,{schema:l.schema,graph:l.graph,kind:e,arrangement:E,onChange:xi,kept:{shown:Fe.length,of:st.length},noun:{one:He(u,e),many:Je.toLowerCase()},...Ri?{}:{allow:!1},...Jn?{filters:Jn}:{},offers:G,chips:{nodes:st,flagged:C,...typeof c?.today=="string"?{today:c.today}:{}},query:t.framed===!0&&t.barAbove!==!0}):null,(0,w.jsx)("style",{children:Ft}),lt?(0,w.jsx)("style",{children:Pr+uo}):null,(0,w.jsx)("div",{className:"graview-list",...lt?{...Ce.listProps,ref:Ce.list,tabIndex:-1,"data-graview-choosable":"","aria-label":Ce.chosen.length>0?`${Je}, ${Ce.chosen.length} chosen`:Je,role:"group"}:{},children:Fe.length===0&&j.words?(0,w.jsxs)("p",{style:se,"data-testid":"none-yet",children:["Nothing here is called \u201C",j.words,"\u201D."," ",(0,w.jsx)("span",{style:A,"data-testid":"list-searched",children:Tt(l.schema,{kinds:[e],past:Oe})})," ",(0,w.jsx)(I,{to:"?",style:B,children:"Show every one"})]}):Fe.length===0?(0,w.jsxs)("p",{style:se,"data-testid":"none-yet",children:[E.filter?.length||E.query?"None of them.":"None yet",!E.filter?.length&&!E.query&&We.length>0?` \u2014 the first one starts above, with \u201C${We[0]?.mutation.title??We[0]?.mutation.name}\u201D.`:!E.filter?.length&&!E.query?".":"",E.filter?.length||E.query?(0,w.jsxs)(w.Fragment,{children:[" ",(0,w.jsx)(I,{to:"?",style:B,children:"Show every one"})]}):null]}):Z.grouped&&jt?(0,w.jsx)("div",{style:{display:"grid",gap:"1rem"},"data-testid":"records","data-grouped":jt,children:qn.map(s=>{if(!s.closed)return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,w.jsxs)("h2",{className:"graview-group-head",children:[s.label," ",(0,w.jsx)("span",{children:s.nodes.length})]}),(0,w.jsx)("ul",{style:Ze,className:wt,"data-graview-rows":"",children:s.nodes.map(ht)})]},s.key||"-");let h=Vn(s),O=`${f}-${dt(s.key||"none")}`;return(0,w.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group","data-closed":h?"shut":"open",children:[(0,w.jsx)("h2",{className:"graview-group-head",children:(0,w.jsxs)("button",{type:"button",className:"graview-group-toggle","aria-expanded":!h,"aria-controls":O,"data-testid":"list-group-toggle",onClick:()=>Si(Gn(s.key)),children:[(0,w.jsx)("span",{"aria-hidden":"true",children:h?"\u25B8":"\u25BE"}),s.label," ",(0,w.jsxs)("span",{children:["\xB7 ",s.nodes.length]}),(0,w.jsxs)("span",{style:co,children:[" ",s.nodes.length===1?He(u,e):Je.toLowerCase()]})]})}),(0,w.jsx)("ul",{id:O,style:h?{...Ze,display:"none"}:Ze,className:wt,"data-graview-rows":"",hidden:h,children:h?null:s.nodes.map(ht)})]},s.key||"-")})}):Ge&&Ge.length>1?(0,w.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":Me?.type==="date"?"year":"letter",children:[(0,w.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...A,display:"flex",flexWrap:"wrap",gap:Me?.type==="date"?"0 10px":"0 4px",lineHeight:1.3},children:Ge.map(s=>(0,w.jsx)("a",{href:`#${dt(s.key)}`,onClick:h=>{h.preventDefault(),document.getElementById(dt(s.key))?.scrollIntoView({block:"start"})},style:{...ve,minWidth:24,justifyContent:"center"},children:s.key},s.key))}),Ge.map(s=>(0,w.jsxs)("section",{"data-testid":"list-section","aria-labelledby":dt(s.key),style:{display:"grid",gap:0},children:[(0,w.jsx)("h2",{id:dt(s.key),className:"graview-group-head",children:s.key}),(0,w.jsx)("ul",{style:Ze,className:wt,"data-graview-rows":"",children:s.nodes.map(ht)})]},s.key))]}):(0,w.jsx)("ul",{style:Ze,className:wt,"data-testid":"records","data-graview-rows":"",children:Fe.map(ht)})}),lt?(0,w.jsx)(Ar,{store:l,chosen:Ce.chosen,...Xe?{principal:Xe}:{},...c?{context:c}:{},anchor:po,of:nn.length,onChooseAll:()=>Ce.choose(nn),onClear:Ce.clear,onActed:Li}):null,Un>0?(0,w.jsxs)(I,{to:mi(p,"filter","is:any"),style:{...B,...A,justifySelf:"start"},"data-testid":"past-link",children:["+",Un," past"]}):null,k===!1&&l.graph.count(e,{archived:!0})>0?(0,w.jsxs)(I,{to:mi(p,"archived","true"),style:{...B,...A,justifySelf:"start"},"data-testid":"archived-link",children:["+",l.graph.count(e,{archived:!0})," archived"]}):null]}),jn.length>0?(0,w.jsx)("ul",{style:{...re,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},"data-testid":"withheld",children:jn.map(s=>(0,w.jsxs)("li",{style:A,children:[(0,w.jsx)("s",{children:s.label})," \u2014 ",s.refusal.message]},s.id))}):null]})}var co={position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0},po=()=>document.querySelector("[data-graview-choosable]")?.closest("[data-embed-content]")??null,uo=`
|
|
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:${ga.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 go({children:t}){return(0,w.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:t})}var mo=(t,e)=>e?{sort:{by:e,direction:"desc"}}:t?{sort:{by:"label",direction:"asc"}}:{};function fo(t,e,n){let a=Pt({...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")}:{}}),i=[...a.filter??[]],r=t.get("by"),o=a.group??(r?{by:r}:void 0);for(let d of n){let c=t.get(d);c&&i.push({key:d,value:c})}let l=t.get("with");return l&&i.push({key:l,value:"*"}),t.get("past")==="1"&&!i.some(d=>d.key==="is")&&i.push({key:"is",value:"any"}),yn({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...i.length>0?{filter:i}:{},...o?{group:o}:{},...a.archived!==void 0?{archived:a.archived}:{}},e)}function mi(t,e,n){let a=new URLSearchParams(t);return a.set(e,n),a.delete("past"),`?${a.toString()}`}function yo({name:t,title:e,panel:n,open:a,onOpen:i}){return(0,w.jsxs)("button",{type:"button","data-testid":`act-open-${t}`,"data-graview-act":t,"aria-expanded":a,"aria-controls":n,onClick:()=>{i(!a),a||requestAnimationFrame(()=>document.getElementById(n)?.querySelector("input, select, textarea, button")?.focus())},style:{...ve,minHeight:28,margin:"-4px 0",padding:"0 2px",border:0,background:"none",font:"inherit",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,w.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:a?"\u2212":"+"}),e]})}function ho({name:t,id:e,description:n,open:a,onClose:i,children:r}){return(0,w.jsxs)("div",{"data-testid":`act-${t}`,id:e,hidden:!a,onKeyDown:o=>{o.key==="Escape"&&(o.preventDefault(),i(),document.querySelector(`[aria-controls="${e}"]`)?.focus())},style:a?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,w.jsx)("p",{style:{...A,margin:0,maxWidth:"58ch"},children:n}):null,r]})}function wo({to:t,label:e}){let n=(0,Te.useRef)(null);return Cr(n),(0,w.jsx)(I,{ref:n,to:t,"aria-label":e,style:{position:"absolute",inset:0,borderRadius:6}})}var Qe=H(Ee(),1);var ft=H(Ee(),1);var W=H(Y(),1);function Wn({context:t}){let{store:e,brand:n,invariantContext:a,principal:i}=t;ae(e);let r=e.violations(a),o=e.allInvariants(),l=At(e,r),d=$a(e.schema,o);return(0,W.jsxs)(ie,{context:t,children:[(0,W.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,W.jsx)(le,{context:t,children:r.length===0?"All rules hold":"What is broken"}),(0,W.jsx)("p",{style:se,"data-testid":"problems-count",children:r.length===0?"Every declared rule is satisfied by what is here.":ca(r)})]}),(0,W.jsx)(pi,{context:t}),l.map((c,p)=>{let g=c.nodeIds[0],f=g?e.graph.getNode(g):void 0;return(0,W.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,W.jsx)(Vt,{violation:c,schema:e.schema,...n?{brand:n}:{}}),f?(0,W.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,W.jsx)(me,{kind:f.kind,brand:n,schema:e.schema,size:7}),(0,W.jsx)(I,{to:te(e.schema,f.kind,f.id),style:B,children:ge(e.schema.tryDefinition(f.kind),f)})]}):null,c.line?(0,W.jsx)(Vt,{violation:c,schema:e.schema,...n?{brand:n}:{}}):null,(0,W.jsx)(Ut,{store:e,repairs:c.repairs,...i?{principal:i}:{}})]},p)}),o.length>0?(0,W.jsxs)("section",{style:{...re,display:"grid",gap:12},"data-testid":"rules",children:[(0,W.jsx)("h2",{style:ne,children:"The rules"}),(0,W.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:o.map(c=>{let p=r.filter(u=>u.invariant===c.name).length,g=d.get(c.name),f=c.label??c.name;return(0,W.jsxs)("li",{"data-graview-rule":c.name,style:{display:"grid",gap:2},children:[(0,W.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[g?(0,W.jsx)(Ct,{line:g,schema:e.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,W.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:f}),(0,W.jsx)("span",{style:{...A,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,W.jsx)("span",{style:A,children:f}):null]},c.name)})})]}):null]})}function Vt({violation:t,schema:e,brand:n}){if(!t.line)return(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:t.message});let a=Fa(t),i=Oa(t);return i?(0,W.jsxs)("div",{style:{display:"grid",gap:4},"data-testid":"problem-line",children:[(0,W.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},"data-testid":"problem-says",children:i}),a?(0,W.jsx)("span",{style:A,children:a}):null,(0,W.jsxs)("details",{"data-testid":"problem-judged",style:A,children:[(0,W.jsx)("summary",{style:{cursor:"pointer",width:"fit-content",minHeight:24},children:"How it is judged"}),(0,W.jsx)(Ct,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none"})]})]}):(0,W.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",children:[(0,W.jsx)(Ct,{line:t.line,schema:e,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)"}}),a?(0,W.jsx)("span",{style:A,children:a}):null]})}function Ut({store:t,repairs:e,principal:n}){let[a,i]=(0,ft.useState)(null),[r,o]=(0,ft.useState)(null),l=(0,ft.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,W.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,W.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,W.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){i(a===g?null:g);return}i(null);try{t.apply({name:p.mutation,args:{...p.args}},n?{author:n}:{})}catch(k){o(at(t.schema,t.allMutations(),k))}},style:Le,children:f?`${p.label} \u2026`:p.label},g):(0,W.jsxs)("p",{"data-testid":"withheld","data-withheld":u.refusal.wouldNeed.join(",")||"nobody",style:{...A,margin:0},children:[(0,W.jsx)("s",{children:p.label})," \u2014 ",u.refusal.message]},g)})}),c&&d?(0,W.jsx)($e,{store:t,mutation:c,prefilled:{...d.args},only:d.missing??[],label:d.label,onDone:()=>{let p=a;i(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,W.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:vn},children:["\u201C",d.label,"\u201D names ",d.mutation,", which this app does not declare."]}):null,r?(0,W.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:vn},children:r}):null]})}var Hn=H(Ee(),1);var Be=H(Y(),1);function wi({store:t,link:e,principal:n}){let[a,i]=(0,Hn.useState)(!1),[r,o]=(0,Hn.useState)(null),l=Va(e);return(0,Be.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,Be.jsx)("button",{type:"button","data-graview-provisional":"",title:l,"aria-label":`Unsure link: ${l}`,"aria-expanded":a,onClick:()=>i(!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,Be.jsxs)("span",{style:{...A,display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,Be.jsx)("span",{children:l}),(0,Be.jsx)("button",{type:"button",style:{...Le,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}:{}),i(!1)}catch(d){o(at(t.schema,t.allMutations(),d))}},children:"Keep this link"}),r?(0,Be.jsx)("span",{role:"alert",children:r}):null]}):null]})}var y=H(Y(),1),vo=[];function Kn({context:t}){let{store:e,brand:n,principal:a,invariantContext:i}=t;ae(e);let r=ye()!==null,o=qe(),l=decodeURIComponent(o.id??""),d=Xr(e,l,{...a?{principal:a}:{},...i?{context:i}:{}}),c=At(e,d?.violations??vo),[p,g]=(0,Qe.useState)(null),[f,u]=(0,Qe.useState)(!1),[k,q]=(0,Qe.useState)(null),v=(0,Qe.useRef)(null),C=(0,Qe.useRef)(null),G=m=>{(v.current?.parentElement?.querySelector(`[data-affordance="${m.replace(/["\\]/g,"\\$&")}"]`)??v.current)?.focus()};if(!d)return(0,y.jsx)(ie,{context:t,children:(0,y.jsx)(le,{context:t,children:"Nothing lives at this address."})});let L=e.graph.getNode(l),U=e.schema.tryDefinition(d.kind),X=U?.describe&&L?Ia(U,L):null,de=[...e.log.all()].filter(m=>!xt(m)&&(m.writes.includes(l)||m.reads.includes(l))).slice(-8).reverse(),ce=e.log.all().find(m=>!xt(m)&&m.undoes===void 0&&m.primitives.some(T=>T.op==="add-node"&&T.node.id===l)),D=d.actions.affordances.filter(m=>m.provider!=="invariant"),J=D.filter(m=>m.destructive||m.setsAside),b=f||J.length<2?D:D.filter(m=>!J.includes(m)),P=t.views?.lookup(d.kind,{cardinality:"one",fidelity:"full"}),M=P!==void 0&&!nt(P)?P:void 0,N=M&&L?$t(P,L,e.graph):void 0,_=N?d.fields.filter(m=>!N.fields.has(m.key)):d.fields,E=N?d.links.flatMap(m=>{let T=m.targets.filter(Z=>!N.records.has(Z.id));return T.length>0?[{...m,targets:T}]:[]}):d.links,j=M!==void 0&&Ta(P),Oe=r&&za(U).length>0;return(0,y.jsxs)(ie,{context:t,children:[(0,y.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,y.jsxs)("p",{style:{...he,display:"flex",alignItems:"center",gap:8},children:[(0,y.jsx)(me,{kind:d.kind,brand:n,schema:e.schema,size:8}),(0,y.jsx)(I,{to:`/${Q(e.schema,d.kind)}`,style:ve,children:ee(e,d.kind)})]}),(0,y.jsx)(le,{context:t,children:r&&L?.label===d.label?(0,y.jsx)(hn,{nodeId:l,field:"label",value:d.label,said:d.label}):d.label}),X&&X!==d.label?(0,y.jsx)("p",{style:se,children:X}):null,ce?.lineage?(0,y.jsxs)("p",{style:{...A,margin:0},"data-testid":"record-lineage",children:["Made by ",ut(ce,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}}),", ",pn(ce.lineage)]}):null,(0,y.jsx)(Ot,{context:t,stop:`#focus=${encodeURIComponent(l)}`,style:{...B,...A},"data-testid":"spatial-link"}),r&&L?(0,y.jsx)(gn,{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:{...Le,...A,justifySelf:"start"}}):null,Ae(t).some(m=>m.kind===d.kind||m.across===d.kind)?(0,y.jsxs)("p",{style:{...A,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",Ae(t).filter(m=>m.kind===d.kind||m.across===d.kind).map((m,T)=>(0,y.jsxs)("span",{children:[T>0?(0,y.jsx)("span",{"aria-hidden":"true",children:" \xB7 "}):null,(0,y.jsx)(I,{to:be(t,m),style:B,children:m.title})," ",(0,y.jsx)(Ot,{context:t,stop:`#view=${encodeURIComponent(m.as)}`,style:{...B,...A,display:"inline-block",minWidth:24,textAlign:"center"},title:`${m.title}, in the scene`,label:`${m.title}, in the scene`,children:(0,y.jsx)("span",{"aria-hidden":"true",children:"\u2197"})})]},_e(m)))]}):null]}),L&&la(L)?(0,y.jsx)(bo,{context:t,id:l,kind:d.kind}):null,L&&ua(e,l)?(0,y.jsx)(ko,{context:t,id:l,kind:d.kind}):null,M&&L?(0,y.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,y.jsx)(Rr,{children:(0,y.jsx)(M,{node:L,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...d.violations.length>0?{flagged:[l]}:{}})})}):null,d.violations.length>0?(0,y.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,T)=>(0,y.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,y.jsx)(Vt,{violation:m,schema:e.schema,...n?{brand:n}:{}}),(0,y.jsx)(Ut,{store:e,repairs:Jr(d.actions,m.repairs),...a?{principal:a}:{}})]},T))}):null,!j&&(_.length>0||Oe)?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,y.jsx)("h2",{style:ne,children:"The facts"}),Wa(U,_).map((m,T)=>{let Z=(0,y.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:m.fields.map(F=>F.files?(0,y.jsx)(Ve,{as:"field",read:!r,nodeId:l,field:F.key,label:F.label,files:F.files,labelStyle:he,style:{gap:4}},F.key):F.long?(0,y.jsx)(br,{nodeId:l,field:F.key,label:F.label,value:F.value,markdown:F.markdown,style:{gridColumn:"1 / -1",gap:4},labelStyle:he,valueStyle:{lineHeight:1.6}},F.key):(0,y.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,y.jsx)("dt",{style:he,children:F.label}),(0,y.jsx)("dd",{style:{margin:0,overflowWrap:"anywhere",minWidth:0},children:F.linked?(0,y.jsx)(Qa,{relation:F.linked.relation,refs:F.linked.refs,...r?{nodeId:l,field:F.key}:{}}):F.app?(0,y.jsx)(Nt,{address:F.app,as:"record",...r?{nodeId:l,field:F.key}:{}}):F.href?(0,y.jsx)(kr,{href:F.href,field:F.key,value:F.value,stored:F.stored,...r?{nodeId:l}:{}}):r?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(hn,{nodeId:l,field:F.key,value:F.value,stored:F.stored}),F.repeats?(0,y.jsx)(Za,{nodeId:l,field:F.key,start:L?.[F.key],value:L?.[`${F.key}Repeat`],label:`${F.label} repeats`}):null]}):F.value})]},F.key))});return m.title?(0,y.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,y.jsx)("h3",{"data-graview-field-group":m.title,style:{...ne,fontSize:"inherit"},children:m.title}),Z]},T):(0,y.jsx)("div",{children:Z},T)}),Oe?(0,y.jsx)(Ve,{as:"unfilled",nodeId:l,skip:[...N?.fields??[]],labelStyle:he,style:{gap:4}}):null]}):null,(j?[]:E).map(m=>(0,y.jsxs)("section",{style:{...re,display:"grid",gap:10},children:[(0,y.jsx)("p",{style:he,children:Br(e,m)}),m.description?(0,y.jsx)("h2",{style:ne,children:xe(m.description)}):(0,y.jsxs)("h2",{style:ne,"aria-label":we(m.edgeKind),children:[m.direction==="in"?"\u2190 ":"\u2192 ",we(m.edgeKind)]}),(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:m.targets.map(T=>{let Z=Ua(e,m.direction==="in"?{kind:m.edgeKind,from:T.id,to:l}:{kind:m.edgeKind,from:l,to:T.id});return(0,y.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,y.jsx)(me,{kind:T.kind,brand:n,schema:e.schema,size:7}),(0,y.jsxs)(I,{to:te(e.schema,T.kind,T.id),style:B,children:[T.label,T.apart?(0,y.jsxs)("span",{style:A,children:[" \xB7 ",T.apart]}):null]}),Z?.provisional?(0,y.jsx)(wi,{store:e,link:Z,...a?{principal:a}:{}}):null]},T.id)})}),(m.direction==="out"&&e.schema.edge(m.edgeKind)?.cardinality==="one"?[]:[...new Set(m.targets.map(T=>T.kind))]).map(T=>(0,y.jsxs)(I,{to:`/${Q(e.schema,T)}?${encodeURIComponent(m.edgeKind)}=${encodeURIComponent(l)}`,style:{...B,...A},"data-testid":"related-all",children:["Sort and filter ",m.description??`these ${ee(e,T).toLowerCase()}`,m.targets.some(Z=>Z.kind!==T)?` (${ee(e,T).toLowerCase()})`:""," ",(0,y.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]},T))]},`${m.edgeKind}|${m.direction}|${m.description??""}`)),!j&&(D.length>0||d.actions.withheld.length>0)?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,y.jsx)("h2",{style:ne,ref:v,tabIndex:-1,children:"What can be done"}),(0,y.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:[b.map(m=>{let T=p===m.id;return(0,y.jsx)("button",{type:"button","data-affordance":m.id,"data-rank":m.rank,"data-graview-act":m.mutation,autoFocus:f&&m===J[0],"aria-expanded":T,onClick:()=>{g(T?null:m.id),T||requestAnimationFrame(()=>C.current?.querySelector("input:not([type=hidden]), select, textarea, button")?.focus())},style:{...Le,...T?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:m.label},m.id)}),b.length<D.length?(0,y.jsxs)("button",{type:"button","aria-expanded":!1,onClick:()=>u(!0),style:{...Le,...A},"data-testid":"record-actions-more",children:["Show ",D.length-b.length," more"]}):null]}),D.map(m=>{if(p!==m.id)return null;let T=e.allMutations().find(Z=>Z.name===m.mutation);return T?(0,y.jsxs)("div",{ref:C,onKeyDown:Z=>{if(Z.key!=="Escape"||Z.defaultPrevented)return;Z.preventDefault(),g(null);let F=m.id;requestAnimationFrame(()=>G(F))},style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,y.jsx)("h3",{style:ne,children:m.label}),T.description?(0,y.jsx)("p",{style:{...A,margin:0},children:T.description}):null,(0,y.jsx)($e,{store:e,mutation:T,prefilled:m.args,open:m.open,label:m.label,onDone:()=>{g(null),q(m.mutation);let Z=m.id;requestAnimationFrame(()=>G(Z))},...a?{principal:a}:{}})]},m.id):null}),r&&k!==null&&p===null?(0,y.jsx)(gn,{choices:[{on:"act",act:k,record:l},{on:"act",act:k}],label:"Notify me when someone else does this",testId:"notify-after-act",style:{...Le,...A,justifySelf:"start"}}):null,d.actions.withheld.length>0?(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:d.actions.withheld.map(m=>(0,y.jsxs)("li",{style:A,children:[(0,y.jsx)("s",{children:m.label})," \u2014 ",m.refusal.message]},m.id))}):null]}):null,r?(0,y.jsx)(qr,{id:l,style:re,headingStyle:ne}):null,de.length>0?(0,y.jsxs)("section",{style:{...re,display:"grid",gap:10},"data-testid":"record-history",children:[(0,y.jsx)("h2",{style:ne,children:"What has happened"}),(0,y.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:de.map(m=>(0,y.jsxs)("li",{style:A,children:[(0,y.jsx)("span",{style:{color:"var(--graview-ink)"},children:m.intent}),m.lineage?(0,y.jsxs)("span",{"data-graview-lineage":"",children:[" \xB7 ",pn(m.lineage)]}):null," \u2014 ",ut(m,a,{graph:e.graph,schema:e.schema,...t.seats?{seats:t.seats}:{},...t.people?{people:t.people}:{}})]},m.id))})]}):null]})}function ko({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`allow-tidying-${n}`,args:{id:e}},o=a.allMutations().some(l=>l.name===r.name)&&a.permits(r,i).ok;return(0,y.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,y.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,y.jsx)("strong",{children:"Left alone."})," Nothing automated changes it; tidying passes it by."]}),o?(0,y.jsx)("button",{type:"button",style:Le,"data-testid":"allow-tidying",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Allow tidying again"}):null]})}function bo({context:t,id:e,kind:n}){let{store:a,principal:i}=t,r={name:`unarchive-${n}`,args:{id:e}},o=a.allMutations().some(c=>c.name===r.name)&&a.permits(r,i).ok,l=[...a.log.all()].reverse().find(c=>!xt(c)&&c.mergedInto!==void 0&&c.writes.includes(e)),d=l?.mergedInto!==void 0?a.graph.getNode(l.mergedInto):void 0;return(0,y.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,y.jsxs)("p",{style:{margin:0,flex:"1 1 16rem"},children:[(0,y.jsx)("strong",{children:"Archived."})," Kept with its ties and history, and out of lists, counts and rules.",d?(0,y.jsxs)(y.Fragment,{children:[" ","Merged into ",(0,y.jsx)(I,{to:te(a.schema,d.kind,d.id),style:B,children:ge(a.schema.tryDefinition(d.kind),d)}),"."]}):null]}),o?(0,y.jsx)("button",{type:"button",style:Le,"data-testid":"bring-it-back",onClick:()=>a.apply(r,i?{author:i}:{}),children:"Bring it back"}):null]})}var x=H(Y(),1),So=(0,z.lazy)(()=>(__graviewPreload(import.meta.url,["./chunk.NM6MZYFN.js","./chunk.63GXY2ME.js","./chunk.UGFDSE37.js","./chunk.FSTCX2AI.js","./chunk.Y6ZNFQK3.js","./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.J25KOSNW.js","./chunk.LR3VDXPI.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.MB7LKKUD.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.TCNBCTWO.js")).then(t=>({default:t.DraftPage}))),xo={kind:"human"};function Po({list:t,store:e}){let n=new Set(t.members.map(o=>o.kind)),a=t.total-t.members.length,i=n.size===1?[...n][0]:void 0;if(!i)return(0,x.jsx)("p",{className:"graview-spec-text graview-spec-more",children:`and ${a} more`});let r=tt(e.schema,i).toLowerCase();return(0,x.jsx)("p",{className:"graview-spec-text graview-spec-more",children:(0,x.jsx)(I,{to:`/${Q(e.schema,i)}`,className:"graview-spec-link graview-spec-see-all","data-testid":"see-all",children:t.total===e.graph.nodesOfKind(i).length?`See all ${ct(t.total)} ${r}`:`${ct(a)} more \xB7 all ${r}`})})}function Ao({context:t,children:e}){let n=Ie(),a=t.store.schema,i=(0,z.useMemo)(()=>({href:r=>te(a,r.kind,r.id),go:r=>n(te(a,r.kind,r.id)),more:r=>(0,x.jsx)(Po,{list:r,store:t.store})}),[a,n,t.store]);return(0,x.jsx)(Et.Provider,{value:i,children:(0,x.jsx)(Lr.Provider,{value:(t.titleLevel??(t.framed&&!t.barAbove?1:2))-1,children:e})})}function Co({steering:t}){let e=ke(),n=Ie(),a=`${e.pathname}${e.search}`;return(0,z.useLayoutEffect)(()=>t.at(a),[a,t]),(0,z.useLayoutEffect)(()=>{let i=o=>{o!==a&&n(o)};t.go.current=i;let r=t.pending?.current;return r!==void 0&&(t.pending.current=void 0,i(r)),()=>{t.go.current===i&&(t.go.current=void 0)}},[a,n,t]),null}function Ro({context:t,to:e}){let{pathname:n}=ke(),a=ye(),i=(e??a)?.sayWhere,r=Lo(t,n);return(0,z.useEffect)(()=>(i?.(r),()=>i?.(null)),[i,r]),null}function Lo(t,e){let[n="",a,i]=e.split("/").filter(Boolean).map(o=>{try{return decodeURIComponent(o)}catch{return o}});if(i!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===dn)return"#overview=1";let o=t.views?.places().find(l=>l.as===a);return o?`#focus=${encodeURIComponent(Ne(o.kind))}&view=${encodeURIComponent(o.as)}`:"#"}let r=Re(t.store.schema,n);return r?`#focus=${encodeURIComponent(a??Ne(r))}`:"#"}function To({onNavigate:t,path:e}){let n=ke(),a=bn(),i=Ie(),r=n.hash&&!n.hash.includes("=")?n.hash:"",o=`${n.pathname}${n.search}${r}`,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&&i(e))},[e]),null}function vi({context:t,registry:e,page:n}){let a=qe(),i=Re(t.store.schema,a.slug??""),r=n==="list"?Dn:Kn,l=(i?e?.lookup(i,n):void 0)??r;return(0,x.jsx)(l,{context:t})}function Mo({context:t,registry:e,children:n}){let a=(0,z.useRef)(null);return Ma(a),(0,x.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,x.jsx)(si,{context:t,registry:e,root:a,children:(0,x.jsx)(li,{context:t,root:a,children:n})})})}function No(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 Eo(){let{pathname:t}=ke(),e=bn(),n=(0,z.useRef)(null);(0,z.useLayoutEffect)(()=>{if(e!=="POP"){for(let r=n.current?.parentElement;r;r=r.parentElement){let{overflowY:o}=getComputedStyle(r);if((o==="auto"||o==="scroll")&&r.scrollHeight>r.clientHeight){r.scrollTop=0;return}}window.scrollTo(0,0)}},[t]);let a=(0,z.useRef)(t),i=(0,z.useRef)(!1);return(0,z.useEffect)(()=>{if(!i.current&&t===a.current)return;i.current=!0;let r=document.activeElement;if(No(r))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,x.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function $o({context:t,children:e}){let n=Ie(),a=(0,z.useMemo)(()=>({record:(i,r)=>{let o=t.store.graph.getNode(i);o&&n(mt(te(t.store.schema,o.kind,i),{section:r?.section}))},place:(i,r)=>{let o=t.views?.places().find(l=>l.as===i);o&&n(mt(be(t,o),r))},list:(i,r)=>{t.store.schema.tryDefinition(i)&&n(mt(`/${Q(t.store.schema,i)}`,r))},draft:()=>n("/~draft")}),[t,n]);return(0,x.jsx)(La.Provider,{value:a,children:e})}function Oo(){let{pathname:t,search:e,hash:n}=ke();return(0,z.useEffect)(()=>{let a=decodeURIComponent(n.replace(/^#/,""));if(!(!a||a.includes("=")))return ai(a)},[t,e,n]),null}function Fo({context:t,Home:e}){let n=ke(),a=t.views,i=n.key==="default"&&!(a&&Ca(a));(0,z.useEffect)(()=>{a&&Ra(a)},[a]);let r=i?ha(t.views?.arrangement?.()?.first,t.store.schema,t.views?.places()??[]):void 0,o=r?.to==="place"?be(t,r.place):r?.to==="kind"?`/${Q(t.store.schema,r.kind)}`:void 0;return o?(0,x.jsx)(Sn,{to:o,replace:!0}):(0,x.jsx)(e,{context:t})}function ki({context:t,registry:e}){let n=e?.lookupSurface("shell"),a=n!==void 0,i=a&&(e?.without().has("bar")??!1),r=a&&!i&&!t.embedded?{...t,barAbove:!0}:t,o=k=>n===void 0?(0,x.jsx)(Wt,{context:t,children:k}):i?(0,x.jsx)(n,{context:t,children:k}):(0,x.jsx)(Wt,{context:t,children:(0,x.jsx)(n,{context:r,children:k})}),l=e?.lookupSurface("home")??Fn,d=e?.lookupSurface("problems")??Wn,c=a?{...r,framed:!0}:t,[p,g]=(0,z.useState)(null),f=(0,z.useMemo)(()=>({onFind:g,find:!(e?.without().has("find")??!1),places:!(e?.without().has("places")??!1)}),[e]),u=(0,x.jsx)(Mo,{context:t,registry:e,children:(0,x.jsx)($o,{context:t,children:o((0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(ja,{face:"pages"}),(0,x.jsxs)(Ao,{context:c,children:[(0,x.jsx)(Eo,{}),(0,x.jsx)(Oo,{}),(0,x.jsxs)(zr,{children:[(e?.routes()??[]).map(({path:k,component:q})=>(0,x.jsx)(Pe,{path:k,element:(0,x.jsx)(q,{context:c})},k)),(0,x.jsx)(Pe,{path:"/",element:(0,x.jsx)(Fo,{context:c,Home:l})}),(0,x.jsx)(Pe,{path:"/problems",element:(0,x.jsx)(d,{context:c})}),(0,x.jsx)(Pe,{path:"/~draft",element:(0,x.jsx)(z.Suspense,{fallback:null,children:(0,x.jsx)(So,{context:c})})}),(0,x.jsx)(Pe,{path:"/search",element:(0,x.jsx)(In,{context:c})}),(0,x.jsx)(Pe,{path:"/map",element:(0,x.jsx)(On,{context:c})}),(0,x.jsx)(Pe,{path:"/places",element:(0,x.jsx)(Nn,{context:c})}),Ae(c).some(k=>k.as===dn)?null:(0,x.jsx)(Pe,{path:ya,element:(0,x.jsx)(Sn,{to:"/",replace:!0})}),(0,x.jsx)(Pe,{path:"/places/:as",element:(0,x.jsx)(En,{context:c})}),(0,x.jsx)(Pe,{path:"/:slug",element:(0,x.jsx)(vi,{context:c,registry:e,page:"list"})}),(0,x.jsx)(Pe,{path:"/:slug/:id",element:(0,x.jsx)(vi,{context:c,registry:e,page:"record"})})]})]})]}))})});return t.embedded||!a||i?u:(0,x.jsx)(Qr.Provider,{value:f,children:(0,x.jsx)(cr.Provider,{value:p,children:u})})}var Io=()=>typeof document>"u"?null:document.body;function Do({context:t,registry:e,basename:n,initialPath:a,onNavigate:i,path:r,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?Mr(p.views,p.store.schema,fn(p.brand,p.store.schema)):void 0);let g=ye();aa({reader:p.locale??g?.locale,app:p.brand?.locale??p.app?.brand?.locale});let f=p.principal??xo,u=Sa(p.store,f,p.history),q=(u.past&&u.live===p.store?u.past.store:p.store).seenBy(f),v=q===p.store?p:{...p,store:q};xa(p.store,p.principal);let C=(0,x.jsxs)(x.Fragment,{children:[i||r!==void 0?(0,x.jsx)(To,{onNavigate:i,path:r}):null,o?(0,x.jsx)(Co,{steering:o}):null,v.presence||g?(0,x.jsx)(Ro,{context:v,to:g}):null,(0,x.jsx)(ki,{context:v,...e?{registry:e}:{}}),l?(0,x.jsx)(Nr,{firstLook:l,root:Io,app:fn(p.brand,p.store.schema)}):null]}),G=v.views?(0,x.jsxs)(Pa,{store:v.store,views:v.views,...v.principal?{principal:v.principal}:{},...v.brand?{brand:v.brand}:{},...v.locale?{locale:v.locale}:{},...v.settings?{settings:v.settings}:{},...v.presence&&!g?{presence:v.presence}:{},...v.people?{people:v.people}:{},...v.seats?{seats:v.seats}:{},onSeat:X=>g?g.takeSeat(X):c({from:t.principal,seat:X}),...v.onKeepLens?{onKeepLens:v.onKeepLens}:{},...v.ai?{ai:v.ai}:{},...v.subscriptions?{subscriptions:v.subscriptions}:{},resolveApp:v.resolveApp??g?.resolveApp,linkedRecords:v.linkedRecords??g?.linkedRecords,...v.app?{app:v.app}:{},...v.menuSections?{menuSections:v.menuSections}:{},children:[C,(0,x.jsx)(ri,{context:v})]}):C,L=(0,x.jsx)(ba.Provider,{value:u,children:G}),U=v.files?(0,x.jsx)(ka.Provider,{value:v.files,children:L}):L;if(a!==void 0){let X=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,x.jsx)(jr,{initialEntries:[X],...n===void 0?{}:{basename:n},children:U})}return(0,x.jsx)(_r,{...n===void 0?{}:{basename:n},children:U})}export{Wi as a,Do as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.GV2CQVKV.js";import"./chunk.4HZ7QTXZ.js";import"./chunk.3TY5NFLY.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import{ib as a}from"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Pe,b as $e}from"./chunk.5A4AOFOA.js";import"./chunk.OF34OZ4V.js";import"./chunk.R6K6GF5R.js";import"./chunk.3AGY4QVS.js";import{i as Ee,j as He}from"./chunk.BNV77BQZ.js";import"./chunk.SYAEBGDC.js";import"./chunk.YIR7PPF3.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.HJCQ6I3S.js";import"./chunk.MWGGV7DE.js";import"./chunk.JQU5GEU3.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import"./chunk.OKRNJXTV.js";import"./chunk.CAVBSL27.js";import"./chunk.COQKECUH.js";import{a as ze,b as x}from"./chunk.EJPI3ST6.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import{b as Te,c as Me}from"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.G5NZVPJU.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import{t as Ce}from"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import{g as Ae}from"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import{c as Se}from"./chunk.UGFJKSHU.js";import{m as ke}from"./chunk.JOOQUWLT.js";import{F as Ge,Q as we,Y as W,i as ve,na as Q,sa as be,v as ye,wa as xe}from"./chunk.6QWV5MVH.js";import{Jb as me,da as K,ea as L,ec as fe,kb as he}from"./chunk.MNP4JI33.js";import{b as Y}from"./chunk.AJZBJBMO.js";var a=Y(Ge(),1);var n=Y(we(),1);function dt({placement:d="float",chosen:o=!0}={}){let{menuAt:r}=W();return d==="menu"&&r===null?o?(0,n.jsx)(Je,{}):null:(0,n.jsx)(Xe,{placement:d})}function Je(){let{store:d,setMenuAt:o,view:r}=W(),{selection:f}=Q(),h=(0,a.useRef)(null),[p,k]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let v=h.current?.offsetParent??h.current?.parentElement;if(!v)return;let w=Math.round(v.getBoundingClientRect().width);w!==p&&k(w)});let S=f.length===1&&!r.overview?d.graph.getNode(f[0]):void 0;return!S||p===null||p>=Re?(0,n.jsx)("span",{ref:h,hidden:!0}):(0,n.jsx)("button",{type:"button",ref:h,"data-testid":"chosen-acts","aria-label":`What can be done with ${x(d,S.id)}`,"aria-haspopup":"menu",onClick:v=>{let w=v.currentTarget.getBoundingClientRect();o({x:Math.round(w.right),y:Math.round(w.bottom+4),on:S.id})},style:{position:"absolute",right:"calc(14px + var(--graview-dock, 0px))",top:98,zIndex:"var(--graview-layer-overview, 10)",minHeight:30,padding:"0 12px",borderRadius:8,fontSize:"0.8125rem",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)"},children:"Acts\u2026"})}var Re=564;function Xe({placement:d}){let{store:o,menuAt:r,setMenuAt:f,view:h}=W(),p=(0,a.useRef)(null),k=(0,a.useRef)(null),S=(0,a.useRef)(null),v=(0,a.useRef)(null);r?.returnTo&&(v.current=r.returnTo);let w=e=>{let i=e.closest("[data-graview-asking]")?.getAttribute("data-graview-asking"),t=e.getAttribute("data-pin-for"),g=i??e.getAttribute("data-affordance")??(t===null?null:`pin:${t}`)??e.getAttribute("data-menu-item");k.current=g===null?null:{key:g,element:e}};(0,a.useEffect)(()=>{let e=p.current,i=k.current;if(i===null||document.activeElement!==document.body||i.element.isConnected)return;let t=i.key;if(!e){k.current=null;let H=v.current;v.current=null,(H?.isConnected?H:S.current)?.focus();return}((t.startsWith("pin:")?e.querySelector(`[data-pin-for="${CSS.escape(t.slice(4))}"]`):null)??e.querySelector(`[data-affordance="${CSS.escape(t)}"]:not([disabled])`)??e).focus()});let[Le,We]=(0,a.useState)(null);(0,a.useLayoutEffect)(()=>{let e=p.current?.offsetParent??p.current?.parentElement;if(e instanceof HTMLElement&&(S.current=e),!e)return;let i=e.getBoundingClientRect();We(t=>t&&t.left===i.left&&t.top===i.top&&t.width===i.width&&t.height===i.height?t:{left:i.left,top:i.top,width:i.width,height:i.height})});let{selection:Ne,set:De,clear:Oe}=Q(),s=r?.about??Ne,[N,Fe]=(0,a.useState)(()=>Pe()),D=r?.on??s[s.length-1],O=r?.about,qe=(0,a.useMemo)(()=>({pins:N,...D===void 0?{}:{focus:D},...O?{about:O}:{}}),[N,D,O]),Be=(0,a.useMemo)(()=>new Set(o.allMutations().filter(e=>e.pinned).map(e=>e.name)),[o]),{affordances:c,withheld:m,observations:G}=Ee(qe),je=r===null?null:{face:r.face??"scene",on:r.on,about:s,field:r.field,place:r.place,href:r.href,act:r.act,element:r.returnTo},J=Ce(je),X=G.some(e=>e.id.startsWith("schema:waits:")),{apply:Ue,preview:_e}=He(),[C,z]=(0,a.useState)(null),[Ve,Z]=(0,a.useState)(!1),[ee,te]=(0,a.useState)(!1),[P,$]=(0,a.useState)(""),[ne,F]=(0,a.useState)(null),q=(0,a.useRef)([]),B=(e,i)=>{try{return _e(e,i),Ue(e,i),F(null),f(null),q.current=[],!0}catch(t){return F(Ae(o.schema,o.allMutations(),t)),q.current=t instanceof he?t.issues.map(g=>String(g.path[0]??"")).filter(Boolean):[],!1}},I=[...new Set(s.flatMap(e=>{let i=o.graph.getNode(e);return i?[i.kind]:[]}))],b=I.length>0?I:[...new Set(s.flatMap(e=>ye(e)))],u=s.length===1?ve(s[0]):null,j=u?{from:o.graph.getNode(u.from),to:o.graph.getNode(u.to)}:null,ie=u?Me(o,u):void 0,re=ie?.provisional?ie:void 0,ae=u?(()=>{let e=o.schema.tryDefinition(o.graph.getNode(u.from)?.kind??"")?.edges?.[u.kind],i=o.graph.getNode(u.to);return e?.inverse&&i?`From ${x(o,i.id)}: ${e.inverse}`:null})():null;(0,a.useEffect)(()=>{z(null),Z(!1),te(!1),F(null),$("")},[s,r?.about]);let l=r!==null,Ye=d==="menu"&&!l,A=(0,a.useRef)(r);A.current=r;let oe=xe("acts",{open:l&&d==="menu",onOpenChange:e=>{e||f(null)},at:()=>A.current?{x:A.current.x,y:A.current.y}:null,returnTo:()=>{let e=A.current?.returnTo;if(e?.isConnected)return e;let i=A.current?.on;return i?document.querySelector(`[data-graview-view="${CSS.escape(i)}"]`):null},align:"start"}),le=(Le?.width??Number.POSITIVE_INFINITY)<Re;if((0,a.useLayoutEffect)(()=>{let e=p.current?.offsetParent;if(!e||!le||l)return;let i=p.current?.getBoundingClientRect().height??0,t=`${Math.round(i)+20}px`;if(e.style.paddingBottom===t)return;let g=e.style.paddingBottom;return e.style.paddingBottom=t,()=>{e.style.paddingBottom=g}}),s.length===0&&!l)return null;let se=r?.title!==void 0||s.length>0&&!(s.length===1&&s[0]===h.focusId),de=Math.max(1,Math.min(9,c.length)),T=[...c.filter(e=>e.provider==="invariant"&&!e.destructive),...c.filter(e=>e.pinned&&e.provider!=="invariant"&&!e.destructive),...c.filter(e=>!e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.ties&&!e.destructive&&!e.pinned&&e.provider!=="invariant"),...c.filter(e=>e.destructive)],ue=T.length>de&&!l,pe=P.trim().toLowerCase(),y=ue&&pe.length>0?T.filter(e=>`${e.label} ${e.why}`.toLowerCase().includes(pe)):null,U=y??(Ve||l?T:T.slice(0,de)),ce=y?0:T.length-U.length,R=[];for(let e of U){let i=!l&&e.provider==="invariant",t=!l&&!i&&e.pinned!==void 0&&!e.destructive,g=!l&&!i&&!t&&e.ties===!0&&!e.destructive,H=i?e.why:t?"pinned":g?"its ties":null,Qe=i?"violation":t||g?"ties":null,V=R[R.length-1];V&&V.heading===H?V.items.push(e):R.push({heading:H,tone:Qe,items:[e]})}let _=c.find(e=>e.id===C),E=s.length===1?x(o,s[0]):null,ge=e=>{if(!E)return e;let i=e.startsWith(`"${E}"`)?e.slice(E.length+2):e.startsWith(E)?e.slice(E.length):null;if(i===null)return e;let t=i.trimStart();return t.length===0?e:t[0].toUpperCase()+t.slice(1)},Ke=new Set(l?[]:U.filter(e=>e.provider==="invariant").map(e=>e.why)),M=G.filter(e=>!Ke.has(e.text)).map(e=>({...e,text:ge(e.text)}));return Ye?null:(0,n.jsxs)("section",{...l?oe.pane:{},ref:e=>{p.current=e,l&&oe.pane.ref(e)},"aria-label":"Inspector","data-graview-offstage":"","data-testid":l?"context-menu":"inspector-strip",tabIndex:-1,onFocus:e=>w(e.target),onBlur:e=>{e.relatedTarget!==null&&(k.current=null)},onMouseDown:e=>e.stopPropagation(),style:{...l?be:{position:"absolute",zIndex:fe("rail")},boxSizing:"border-box",display:"flex",flexDirection:"column",gap:7,padding:"9px 12px",borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",...l?{width:300,maxHeight:"min(52cqh, 420px)",overflow:"auto"}:le?{left:10,right:10,width:"auto",bottom:10,maxHeight:"min(42cqh, 300px)",overflow:"auto"}:{left:14,top:h.overview?"min(296px, 38cqh)":44,width:236,maxHeight:h.overview?"calc(100cqh - min(296px, 38cqh) - 20px)":"calc(68cqh - 94px)",overflow:"auto"}},children:[(0,n.jsx)("h2",{style:{...ke,margin:0},children:"Inspector"}),(0,n.jsxs)("div",{style:{display:se||!l?"flex":"none",alignItems:"baseline",flexWrap:"wrap",gap:"2px 8px",minWidth:0,paddingRight:l?0:24},children:[se?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("strong",{style:{fontSize:"0.9375rem",whiteSpace:"nowrap"},children:r?.title??(s.length===1?x(o,s[0]):`${s.length} selected`)}),I.length>0||u?(0,n.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:u?"relation":I.map(e=>L(o.schema.tryDefinition(e),e)).join(" \xB7 ")}):null,s.length===1&&!u&&r?.face!=="pages"?(0,n.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",whiteSpace:"nowrap"},children:h.expanded.includes(s[0])?"\xB7 double-click closes":"\xB7 double-click opens"}):null]}):null,(0,n.jsx)("span",{style:{flex:"1 1 auto"}})]}),l?null:(0,n.jsx)("button",{type:"button",onClick:()=>{f(null),Oe()},"aria-label":"Clear selection",title:"Clear selection",style:{position:"absolute",top:6,right:6,flex:"0 0 auto",width:24,height:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.875rem",lineHeight:1,borderRadius:7},children:"\xD7"}),u&&j?(0,n.jsxs)("div",{style:{display:"grid",gap:6},children:[ae?(0,n.jsx)("p",{"data-testid":"edge-said",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:ae}):null,re?(0,n.jsx)("p",{"data-testid":"edge-provisional",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:Te(re)}):null,(0,n.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[["from",j.from],["to",j.to]].map(([e,i],t)=>(0,n.jsxs)(a.Fragment,{children:[t===1?(0,n.jsx)("span",{"aria-hidden":"true",style:{color:"var(--graview-ink-faint)"},children:"\u2192"}):null,i?(0,n.jsx)("button",{type:"button","data-testid":`edge-${e}`,onClick:()=>De([i.id]),title:`Select ${x(o,i.id)}`,style:{fontSize:"0.8125rem",padding:"3px 9px",borderRadius:6},children:x(o,i.id)}):(0,n.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink-faint)"},children:"gone"})]},e))})]}):null,!u&&s.length===1&&me(o,s[0])?(0,n.jsx)("p",{"data-testid":"left-alone",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:"Left alone: nothing automated changes it."}):null,M.length>0?(0,n.jsx)("div",{"data-testid":"observations",title:M.map(e=>e.text).join(`
|
|
2
|
-
`),style:{display:"grid",gap:3},children:M.slice(0,2).map(e=>(0,n.jsxs)("p",{style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:[e.text,e===M[1]&&M.length>2?(0,n.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" +",M.length-2]}):null]},e.id))}):null,l?J.start.map(e=>(0,n.jsx)(Ie,{section:e,close:()=>f(null)},e.id)):null,ne?(0,n.jsx)("p",{"data-testid":"refused",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-warn)"},children:ne}):null,ue?(0,n.jsx)("input",{"data-testid":"action-filter",value:P,onChange:e=>$(e.target.value),placeholder:`Filter ${T.length} actions\u2026`,"aria-label":"Filter actions",onKeyDown:e=>{if(e.key==="Escape"){e.stopPropagation(),P.length>0?$(""):e.currentTarget.blur();return}if(e.key==="Enter"&&y?.length===1){let i=y[0];if(i.destructive)return;i.open.length>0?z(i.id):B(i)&&$("")}},style:{font:"inherit",fontSize:"0.875rem",padding:"5px 9px",borderRadius:8,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):null,y!==null&&y.length===0?(0,n.jsxs)("p",{"data-testid":"no-matches",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:["Nothing offered here matches \u201C",P.trim(),"\u201D."]}):null,c.length===0&&!X&&s.length===0?null:c.length===0&&!X?(0,n.jsx)("p",{"data-testid":"no-affordances",style:{margin:0,fontSize:"0.8125rem",lineHeight:1.45,color:"var(--graview-ink-muted)"},children:m.length>0?`Nothing you may do with ${u?"this relation":b.length===1?K(L(o.schema.tryDefinition(b[0]),b[0])):"this mix of kinds"} \u2014 ${m.length} action${m.length===1?"":"s"} withheld.`:u?`Nothing can be done with this line yet \u2014 nothing this app declares makes or breaks \u201C${Se(o.schema,o.graph.getNode(u.from)?.kind??"",u.kind,"out")}\u201D.`:`Nothing can be done with ${b.length===1?K(L(o.schema.tryDefinition(b[0]),b[0])):"this mix of kinds"} yet \u2014 nothing this app declares acts on ${b.length===1?"it":"them"}.`}):(0,n.jsxs)("ol",{"data-testid":"affordances",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[R.map((e,i)=>(0,n.jsxs)(a.Fragment,{children:[e.heading?(0,n.jsxs)("li",{"data-graview-heading":e.tone,style:{fontSize:"0.75rem",lineHeight:1.4,color:e.tone==="violation"?"var(--graview-warn)":"var(--graview-ink-faint)",...e.tone!=="violation"?{letterSpacing:"0.12em",textTransform:"uppercase",fontSize:"0.75rem"}:{},padding:"2px 2px 1px",marginTop:i>0?6:0},children:[e.tone==="violation"?"\u26A0 ":"",e.tone==="violation"?ge(e.heading):e.heading]}):i>0?(0,n.jsx)("li",{"aria-hidden":"true",style:{borderTop:"1px solid var(--graview-edge)",margin:"6px 0 3px"}}):null,e.items.map(t=>(0,n.jsxs)("li",{style:{display:"flex",gap:2,alignItems:"stretch"},children:[(0,n.jsxs)("button",{type:"button","data-affordance":t.id,"data-rank":t.rank,"data-graview-destructive":t.destructive||void 0,"aria-pressed":C===t.id,title:t.why,style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:C===t.id?"var(--graview-accent)":l?"transparent":"var(--graview-edge)",background:l?"none":"var(--graview-panel)",boxShadow:"none",...t.destructive?{color:"var(--graview-warn)"}:{},...C===t.id?{color:"var(--graview-accent)"}:{}},onClick:()=>{if(t.open.length>0){z(C===t.id?null:t.id);return}B(t)},children:[t.label,t.open.length>0?(0,n.jsx)("span",{style:{color:"var(--graview-ink-faint)"},children:" \u2026"}):null,y?.length===1&&y[0]?.id===t.id&&!t.destructive?(0,n.jsx)("span",{"aria-hidden":"true",title:"Enter runs it",style:{float:"right",color:"var(--graview-ink-faint)",fontSize:"0.75rem"},children:"\u21B5"}):null]}),(0,n.jsx)("button",{type:"button","data-testid":"pin-toggle","data-pin-for":t.mutation,"aria-pressed":t.pinned!==void 0,"aria-label":t.pinned!==void 0?`Unpin ${t.label}`:`Pin ${t.label}`,title:t.pinned==="declared"?"Pinned by the app \u2014 unpin it for yourself":t.pinned==="user"?"Unpin":"Pin to the top",onClick:()=>Fe($e(N,t.mutation,Be.has(t.mutation))),style:{flex:"0 0 auto",width:24,minHeight:24,display:"grid",placeItems:"center",padding:0,fontSize:"0.75rem",border:"1px solid transparent",background:"none",boxShadow:"none",borderRadius:7,color:t.pinned==="user"?"var(--graview-accent)":t.pinned==="declared"?"var(--graview-ink-muted)":"var(--graview-ink-faint)"},children:t.pinned!==void 0?"\u2605":"\u2606"})]},t.id))]},`${e.heading??"plain"}-${i}`)),ce>0?(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>Z(!0),title:`Show all ${c.length} actions`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",ce," more"]})}):null]}),m.length>0?(0,n.jsxs)("ul",{"data-testid":"withheld",style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",flexWrap:"nowrap",gap:2},children:[m.slice(0,l||ee?m.length:3).map(e=>(0,n.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,n.jsx)("button",{type:"button",disabled:!0,"data-affordance":e.id,"data-rank":e.rank,"data-withheld":e.refusal.wouldNeed.join(",")||"nobody",style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8,borderStyle:"dashed",width:"100%",textAlign:"left",background:"none"},children:(0,n.jsx)("s",{children:e.label})}),(0,n.jsx)("span",{"data-testid":"withheld-why",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-ink-muted)",padding:"0 10px"},children:e.refusal.message})]},e.id)),!l&&!ee&&m.length>3?(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-testid":"withheld-more",onClick:()=>te(!0),title:`Show all ${m.length} actions this seat may not take`,style:{padding:"4px 10px",fontSize:"0.875rem",borderRadius:8},children:["Show ",m.length-3," more withheld"]})}):null]}):null,l?J.end.map(e=>(0,n.jsx)(Ie,{section:e,close:()=>f(null)},e.id)):null,_?(0,n.jsx)(ze,{affordance:_,onApply:e=>{if(B(_,e))z(null);else return q.current},onCancel:()=>z(null)}):null]})}function Ie({section:d,close:o}){return(0,n.jsxs)("div",{"data-menu-section":d.id,...d.heading?{role:"group","aria-label":d.heading}:{},style:{display:"grid",gap:2,borderTop:"1px solid var(--graview-edge)",paddingTop:5},children:[d.heading?(0,n.jsx)("p",{"aria-hidden":"true",style:{margin:0,padding:"2px 2px 1px",fontSize:"0.75rem",lineHeight:1.4,letterSpacing:"0.12em",textTransform:"uppercase",color:"var(--graview-ink-faint)"},children:d.heading}):null,d.items&&d.items.length>0?(0,n.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:2},children:d.items.map(r=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-menu-item":r.id,onClick:()=>{o(),r.run()},style:{padding:"5px 10px",fontSize:"0.875rem",borderRadius:8,width:"100%",textAlign:"left",borderWidth:1,borderStyle:"solid",borderColor:"transparent",background:"none",boxShadow:"none"},children:[r.label,r.hint?(0,n.jsxs)("span",{style:{color:"var(--graview-ink-faint)"},children:[" \xB7 ",r.hint]}):null]})},r.id))}):null,d.render?.(o)]})}export{dt as InspectorPane};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as ie}from"./chunk.B2GLDIAS.js";import{b as Te,d as Ce}from"./chunk.6YCBYL2Y.js";import{e as je}from"./chunk.UGFJKSHU.js";import{$ as Ae,Ac as Re,Cc as De,Dc as We,H as be,Ib as te,Ka as we,Ma as E,T as R,U as ke,Vc as Me,W as B,X as L,Y as xe,Z as v,aa as Ne,gc as re,kc as Se,lc as ve,yc as Oe}from"./chunk.MNP4JI33.js";function oe(n,e){return n.display?.labels?.[e]??v(e)}function ae(n){let e=ie(n);switch(e.type){case"text":case"date":case"number":case"boolean":case"choice":return e.type;default:return}}function Ye(n,e){let t=new Map,r=n.tryDefinition(e);for(let[o,i]of Object.entries(r?.edges??{}))t.set(o,{key:o,label:i.description?R(i.description):v(o),about:"edge",far:i.to==="*"?[...n.kinds]:[...i.to]});for(let o of n.definitions)if(o.kind!==e)for(let[i,d]of Object.entries(o.edges??{}))t.has(i)||d.to!=="*"&&!d.to.includes(e)||t.set(i,{key:i,label:d.inverse?R(d.inverse):v(i),about:"edge",far:[o.kind]});return[...t.values()]}var Je=["current","past","any","flagged","clear"];function Ie(n,e){let t=n?.lifecycle;if(!t||t.retired==="date")return!1;let r=t.retired.map(String);return e.some(o=>o.key===t.field&&r.includes(o.value))}function Fe(n,e){let t=n.tryDefinition(e);if(!t)return{kind:e,sorts:[],filters:[],groups:[]};let r=new Set(t.display?.hide??[]),o=t.fields.shape??{},i=[{key:"label",label:"Name",about:"label",type:"text"}],d=[],f=[];for(let[g,p]of Object.entries(o)){if(g==="id"||g==="kind"||g==="label"||r.has(g))continue;let A=ae(p);if(!A)continue;let O=oe(t,g),N=A==="choice"?Be(p):A==="boolean"?["true","false"]:void 0,w={key:g,label:O,about:"field",type:A,...N?{options:N}:{}};i.push(w),d.push(w),(A==="boolean"||A==="choice")&&f.push(w),A==="date"&&f.push({...w,buckets:["day","week","month","year","decade"]})}for(let g of Ye(n,e))i.push(g),d.push(g),f.push(g);let l={key:"is",label:t.lifecycle?"Standing and currency":"Standing",about:"is",type:"choice",options:t.lifecycle?[...Je]:["flagged","clear"]};d.push(l);let y=t.fieldRoles?.order,u=y&&(y in o||y==="label")?{by:y,direction:"asc"}:void 0;return{kind:e,sorts:i,filters:d,groups:f,...u?{natural:u}:{}}}function vn(n,e){let t=[];for(let o of e.filters){let i=o.about==="edge"&&o.far?.length===1?n.tryDefinition(o.far[0]):void 0;if(!(!i||i.kind===e.kind))for(let[d,f]of Object.entries(i.fields.shape??{}))ae(f)!=="choice"||i.display?.hide?.includes(d)||t.push({key:`${o.key}.${d}`,label:`${o.label} \xB7 ${oe(i,d)}`,about:"via",type:"choice",options:Be(f),far:[i.kind]})}if(t.length===0)return e;let r=e.filters.filter(o=>o.about!=="is");return{...e,filters:[...r,...t,...e.filters.filter(o=>o.about==="is")]}}function On(n,e){let t=n.tryDefinition(e.kind),r=Object.entries(t?.computed??{});if(!t||r.length===0)return e;let o=r.filter(([i])=>!e.sorts.some(d=>d.key===i)).map(([i,d])=>({key:i,label:(typeof d=="object"?d.label:void 0)??oe(t,i),about:"field",type:"number"}));return{...e,sorts:[...e.sorts,...o]}}function Be(n){let e=ie(n);return e.type==="choice"?e.options:[]}var $e=n=>n,Pe=n=>n;function Ze(n,e,t){let r=new Map;for(let o of[...n.out(e,t),...n.in(e,t)])r.set(o.id,o);return[...r.values()]}function se(n,e,t){let r=n.schema.tryDefinition(e.kind);if(t.key==="is")switch(t.value){case"current":return B(r,Pe(e),n.today);case"past":return!B(r,Pe(e),n.today);case"any":return!0;case"flagged":return n.flagged?.has(e.id)??!1;case"clear":return!(n.flagged?.has(e.id)??!1);default:return!0}let o=r?.fields.shape??{};if(t.key in o){let l=we($e(e),t.key,n.today??be()),y=ae(o[t.key]);if(y==="date"){let[u,g]=t.value.split(":");if(typeof l!="string"||!g)return!1;let p=l.slice(0,10);return u==="before"?p<g:u==="after"?p>g:p===g}if(y==="boolean")return String(l)===t.value;if(y==="number"){let u=t.value.lastIndexOf(":"),g=u>0?t.value.slice(0,u):"",p=Number(t.value.slice(u+1));if(g==="at-most"||g==="at-least")return typeof l!="number"||!Number.isFinite(p)?!1:g==="at-most"?l<=p:l>=p}return String(l)===t.value}let[i,d]=t.key.split("."),f=Ze(n.graph,e.id,i);return d?f.some(l=>String($e(l)[d])===t.value):t.value==="*"?f.length>0:t.value==="none"?f.length===0:f.some(l=>l.id===t.value)}var en=5;function _e(n){return n.normalize("NFD").replace(/\p{M}+/gu,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function de(n){return _e(n).replace(/ /g,"")}var _=new Map,nn=5e4;function K(n){let e=_.get(n);if(e===void 0){_.size>=nn&&_.clear();let t=_e(n);e={tokens:t.split(" ").filter(Boolean),whole:t.replace(/ /g,"")},_.set(n,e)}return e}var D=n=>[...K(n).tokens];function j(n,e){if(e.length===0)return;let{whole:t,tokens:r}=K(n),o=e.join("");if(t.length===0)return;if(t===o)return"exact";if(e.every(d=>r.some(f=>f.startsWith(d))))return t.startsWith(o)?"prefix":e.every(d=>r.includes(d))?"word":"part"}function q(n,e,t=48){let r=n.replace(/\s+/g," ").trim();if(r.length<=t)return r;let o=e[0],i=r.normalize("NFD").replace(/\p{M}/gu,"").toLowerCase(),d=o?i.search(new RegExp(`(^|[^\\p{L}\\p{N}])${tn(o)}`,"u")):-1,f=d<0?0:d+(i[d]&&/[\p{L}\p{N}]/u.test(i[d])?0:1),l=Math.max(0,f-Math.floor(t/3));if(l>0){let u=r.lastIndexOf(" ",l);l=u<0?0:u+1}let y=Math.min(r.length,l+t);if(y<r.length){let u=r.indexOf(" ",y);y=u<0||u-y>16?y:u}return`${l>0?"\u2026":""}${r.slice(l,y).trim()}${y<r.length?"\u2026":""}`}var tn=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),rn=/^([\p{L}][\p{L}\p{N}_-]*):(\S+)$/u;function on(n){let e=[],t=[];for(let r of n.trim().split(/\s+/).filter(Boolean)){let o=rn.exec(r);o?t.push({key:o[1],value:o[2]}):e.push(r)}return{words:e.join(" "),conditions:t}}var Le=new WeakMap;function G(n,e){let t=Le.get(e);if(t&&t.definition===n)return t.texts;let r=an(n,e);return Le.set(e,{definition:n,texts:r}),r}function an(n,e){let t=L(n,e),r=[{field:"label",reading:"Name",text:t}];for(let o of Ce(e,n,{limit:Number.POSITIVE_INFINITY}))o.key==="label"||o.value===t||typeof e[o.key]!="boolean"&&r.push({field:o.key,reading:o.label,text:o.markdown?je(o.value):o.value});return r}var T={exact:0,prefix:1,word:2,part:3,field:4,near:5},ze=new Set(["a","an","the","of","and","or","for","to","in","on","at","by","with","my","our","is"]);function Ee(n){let e=n;e.length>4&&e.endsWith("ies")?e=`${e.slice(0,-3)}y`:e.length>4&&/(ss|x|ch|sh|z)es$/.test(e)?e=e.slice(0,-2):e.length>3&&e.endsWith("s")&&!/(ss|us|is)$/.test(e)&&(e=e.slice(0,-1));for(let t of["ing","ed"])if(e.length>t.length+2&&e.endsWith(t)){e=e.slice(0,-t.length),/([b-df-hj-km-np-rtv-z])\1$/.test(e)&&(e=e.slice(0,-1));break}return e.length>3&&e.endsWith("e")?e.slice(0,-1):e}function Ke(n,e,t){if(Math.abs(n.length-e.length)>t)return t+1;let r=[],o=Array.from({length:e.length+1},(i,d)=>d);for(let i=1;i<=n.length;i++){let d=[i],f=i;for(let l=1;l<=e.length;l++){let y=Math.min(o[l]+1,d[l-1]+1,o[l-1]+(n[i-1]===e[l-1]?0:1));i>1&&l>1&&n[i-1]===e[l-2]&&n[i-2]===e[l-1]&&(y=Math.min(y,r[l-2]+1)),d[l]=y,y<f&&(f=y)}if(f>t)return t+1;r=o,o=d}return o[e.length]}var z=new Map;function sn(n,e){let t=z.get(n);t||(z.size>=64&&z.clear(),z.set(n,t=new Map));let r=t.get(e);return r===void 0&&(r=dn(n,e)??null,t.set(e,r)),r??void 0}function dn(n,e){if(/\d/.test(n))return;let t=Ee(n);if(t.length>=3&&(Ee(e)===t||t.length>=4&&e.startsWith(t)))return"stem";let r=n.length<4?0:n.length<=7?1:2;if(r!==0){if(Ke(n,e,r)<=r)return"spelling";if(n.length>=5){for(let o=n.length-r;o<=n.length+r;o++)if(o<e.length&&Ke(n,e.slice(0,o),r)<=r)return"spelling"}}}function ln(n,e){let t=e.length>1?e.filter(o=>!ze.has(o)):e;if(t.length===0)return;let r;for(let o of t){let i;for(let d of n){for(let f of K(d.text).tokens){if(f.startsWith(o)){i={text:d,matched:f};break}let l=i?void 0:sn(o,f);l&&(i={text:d,matched:f,by:l})}if(i&&!i.by)break}if(!i)return;i.by&&!r&&(r={text:i.text,asked:o,matched:i.matched,by:i.by})}if(r)return{field:r.text.field,reading:r.text.reading,fragment:q(r.text.text,[r.matched]),strength:"near",asked:r.asked,matched:r.matched,by:r.by}}var cn=80;function fn(n,e,t){let r=D(e).filter(d=>!ze.has(d)).join(" ")||e,o=t===void 0?[]:D(t),i=o.length>0&&n.find(d=>o.every(f=>K(d.text).tokens.some(l=>l.startsWith(f))))||n[0];return{field:i.field,reading:i.reading,fragment:q(i.text,o),strength:"near",asked:r,matched:(t??i.text).slice(0,cn),by:"meaning"}}function He(n,e,t){let r=D(t);if(r.length===0)return;let o=G(n,e),[i,...d]=o,f=j(i.text,r);if(f)return{field:"label",reading:i.reading,fragment:q(i.text,r),strength:f};let l=p=>A=>K(A.text).tokens.some(O=>O.startsWith(p));if(!r.every(p=>o.some(l(p))))return;let y=D(i.text),u=r.find(p=>!y.some(A=>A.startsWith(p)))??r[0],g=d.find(l(u));return{field:g.field,reading:g.reading,fragment:q(g.text,[u]),strength:"field"}}var un=512,gn=64;function yn(n){let e=new Map;if(n.length===0)return e;let t=n.slice(-un),r=n[n.length-1].seq;for(let o of t){let i=Math.pow(.5,(r-o.seq)/gn);for(let d of o.writes)e.set(d,(e.get(d)??0)+i)}return e}var ce=(n,e)=>Ae({tryDefinition:()=>n},e),le=(n,e)=>Re({tryDefinition:()=>n},e);function hn(n,e,t){let r=n.tryDefinition(e),o=[{field:"plural",text:ce(r,e)},{field:"kind",text:v(e)},...r?.noun?[{field:"noun",text:r.noun}]:[]],i;for(let d of o){let f=j(d.text,t);f&&(!i||T[f]<T[i.strength])&&(i={strength:f,...d})}return i}var pn,mn=(n,e)=>(pn??=new Intl.Collator(void 0,{sensitivity:"base",numeric:!0})).compare(n,e),Ge=(n,e)=>(n.nearly??0)-(e.nearly??0)||(n.archived??0)-(e.archived??0)||n.tier-e.tier||n.inKind-e.inKind||n.near-e.near||n.past-e.past||n.touched-e.touched||n.flagged-e.flagged||mn(n.name,e.name)||(n.id<e.id?-1:n.id>e.id?1:0);function En(n,e,t={}){let r=n.schema,o=on(e),i=D(o.words),d=t.principal??{kind:"human"},f=n.kindsKeptFrom(d),l=n.modules.disabledKinds,y=o.conditions.filter(a=>a.key==="kind").map(a=>a.value),u=o.conditions.filter(a=>a.key==="is").map(a=>a.value),g=u.includes("any")||u.includes("past"),p=u.includes("past")&&!u.includes("any")&&!u.includes("current"),A=u.includes("archived")?!0:t.archived??"all",O=(a,s)=>{let c=de(s),h=r.tryDefinition(a);return de(a)===c||de(ce(h,a))===c},N=r.kinds.filter(a=>!f.has(a)&&!l.has(a)&&(t.kinds===void 0||t.kinds.includes(a))&&(y.length===0||y.some(s=>O(a,s)))),W=o.conditions.filter(a=>a.key!=="kind").map(a=>({...a,admittedBy:N.filter(s=>Fe(r,s).filters.some(c=>c.key===a.key))})),Q=W.filter(a=>a.key!=="is"),C=u.filter(a=>a==="flagged"||a==="clear"||a==="past"||a==="archived"),U={kinds:N,past:g},qe={hits:[],words:o.words,conditions:W,searched:U,byKind:{},total:0,matched:[]};if(i.length===0&&Q.length===0&&C.length===0)return qe;let V=t.today,$=t.flagged??new Set(n.violations().flatMap(a=>a.nodeIds)),Qe=t.touched??yn(n.log.all()),X=new Set;for(let a of t.from??[]){X.add(a);for(let s of n.graph.neighbors(a))X.add(s.id)}let fe=Se(n,d)?ve(n,d):void 0,Y=re.keptFrom?.(n,d)&&n.seenBy(d).graph,J=a=>Me(a,t.basePath===void 0?{}:{basePath:t.basePath}),ue={schema:r,graph:n.graph,flagged:$,...V?{today:V}:{}},S=[],P={},I=[],Z=[],H=(a,s,c,h,m,b)=>{let x=L(c,a);P[s]=(P[s]??0)+1,S.push({hit:{about:"node",id:a.id,kind:s,label:x,why:m,current:h,flagged:$.has(a.id),address:J(`${le(c,s)}/${encodeURIComponent(a.id)}`),...b===void 0?{}:{near:!0},...E(a)?{archived:!0}:{}},...b===void 0?{}:{nearly:2-b},tier:T[m.strength],inKind:s===t.inKind?0:1,near:X.has(a.id)?0:1,past:h?0:1,archived:E(a)?1:0,touched:-(Qe.get(a.id)??0),flagged:$.has(a.id)?0:1,name:x,id:a.id})};for(let a of N){let s=r.tryDefinition(a),c=W.filter(m=>m.key!=="is"&&m.admittedBy.includes(a));if(i.length===0&&c.length===0&&C.length===0)continue;let h=Ie(s,c);for(let m of n.graph.nodesOfKind(a,{archived:A})){if(fe&&!fe(m.id))continue;let b=Y?Y.getNode(m.id):m;if(!b)continue;let x=B(s,b,V);if(!g&&!h&&!x){if(i.length>0&&u.length===0&&c.every(k=>se(ue,b,k))){let k=He(s,b,o.words);k&&Z.push({node:b,kind:a,definition:s,why:k})}continue}if(p&&x||!c.every(k=>se(ue,b,k))||u.includes("flagged")&&!$.has(b.id)||u.includes("clear")&&$.has(b.id))continue;let M=i.length>0?He(s,b,o.words):c[0]?{field:c[0].key,reading:v(c[0].key),fragment:`${c[0].key}:${c[0].value}`,strength:"field"}:{field:"is",reading:"Is",fragment:`is:${C[0]}`,strength:"field"};M?H(b,a,s,x,M):i.length>0&&I.push({node:b,kind:a,definition:s,current:x})}}let ge=!1;if(Z.length>0&&S.length===0){ge=!0;for(let a of Z)H(a.node,a.kind,a.definition,!1,a.why)}let ye=t.near!==!1&&i.length>0&&S.length<en&&I.length>0,ee=new Set;if(ye)for(let a of I){let s=ln(G(a.definition,a.node),i);s&&(ee.add(a.node.id),H(a.node,a.kind,a.definition,a.current,s,s.by==="stem"?.9:.8))}let Ue=a=>a==="exact"||a==="prefix"?-1:T[a],ne=(a,s,c,h)=>({hit:a,tier:Ue(s),inKind:1,near:1,past:0,touched:0,flagged:1,name:c,id:h});if(i.length>0){for(let s of N){let c=hn(r,s,i);if(!c)continue;let h=Ne(r,s),m={field:c.field,reading:c.field==="plural"?"Plural":"Kind",fragment:c.text,strength:c.strength};S.push(ne({about:"kind",kind:s,label:h,why:m,count:P[s]??0,address:J(le(r.tryDefinition(s),s))},c.strength,h,`kind:${s}`))}let a=t.places??[];for(let s of Oe(a.filter(c=>N.includes(c.kind)))){if(s.across&&f.has(s.across))continue;let c=j(s.title,i);if(!c)continue;let h={field:"title",reading:"Title",fragment:s.title,strength:c},m=We(s,a)?le(r.tryDefinition(s.kind),s.kind).slice(1):void 0,b=J(De(s.as,m));S.push(ne({about:"place",kind:s.kind,title:s.title,as:s.as,why:h,address:b},c,s.title,`place:${s.kind}:${s.as}`))}for(let s of n.allInvariants()){let c=s.scope==="graph"?void 0:s.scope.kind;if(c&&!N.includes(c))continue;let h=s.label??v(s.name),m=j(h,i),b=m?void 0:j(v(s.name),i),x=m??b;if(!x)continue;let M={field:m?"label":"name",reading:m?"Rule":"Name",fragment:m?h:s.name,strength:x};S.push(ne({about:"rule",name:s.name,label:h,...c?{kind:c}:{},why:M},x,h,`rule:${s.name}`))}}let he=()=>{S.sort(Ge);let a=t.limit??50,s=S.slice(0,a).map(k=>k.hit),c=s.flatMap(k=>k.about==="node"?[(Y||n.graph).getNode(k.id)]:[]).filter(Boolean),h=Te(c,k=>r.tryDefinition(k)),m=s.map(k=>k.about==="node"&&h.has(k.id)?{...k,apart:h.get(k.id)}:k),b=Object.values(P).reduce((k,Xe)=>k+Xe,0),x=S.flatMap(k=>k.hit.about==="node"?[k.hit.id]:[]),M=t.subject&&N.includes(String(n.graph.getNode(t.subject)?.kind))?bn(n,t.subject,o.words,{principal:d}):[];return{hits:[...m,...M],words:o.words,conditions:W,searched:ge?{...U,past:!0}:U,byKind:{...P},total:b,matched:x}},F=he(),pe=t.rank;if(!ye||!pe)return F;let me=I.filter(a=>!ee.has(a.node.id)).map(({node:a,kind:s,definition:c})=>({id:a.id,kind:s,label:L(c,a),texts:G(c,a)}));if(me.length===0)return F;let Ve=(async()=>{let a;try{a=await pe(o.words,me)}catch{return F}let s=new Map(I.filter(h=>!ee.has(h.node.id)).map(h=>[h.node.id,h])),c=!1;for(let{id:h,score:m,matched:b}of Array.isArray(a)?a:[]){let x=s.get(h);!x||!(m>0)||(s.delete(h),c=!0,H(x.node,x.kind,x.definition,x.current,fn(G(x.definition,x.node),o.words,typeof b=="string"?b:void 0),Math.min(1,m)))}return c?he():F})();return{...F,later:Ve}}function bn(n,e,t,r={}){let o=r.principal??{kind:"human"},i=(re.keptFrom?.(n,o)?n.seenBy(o):n).graph.getNode(e);if(!i)return[];if(n.kindsKeptFrom(o).has(i.kind))return[];let d=D(t),f=L(n.schema.tryDefinition(i.kind),i),l=[];for(let u of n.allMutations()){let g=u.subject;if(!g||g.kinds!=="*"&&!g.kinds.includes(i.kind))continue;let p=u.derived?.act;if((p==="archive"||p==="merge")&&E(i)||p==="unarchive"&&!E(i)||p==="leave-alone"&&te(i)||p==="allow-tidying"&&!te(i)||!n.permits({name:u.name,args:{[g.arg]:i.id}},o).ok)continue;let A=xe(u),O=D(A),N=d.filter(Q=>O.some(C=>C.startsWith(Q))),w=N.length>0?j(A,N):void 0,W=w?{field:"title",reading:"Act",fragment:A,strength:w}:{field:"subject",reading:"On",fragment:f,strength:"field"};l.push({hit:{about:"act",name:u.name,title:A,subject:i.id,why:W,destructive:u.destructive===!0},tier:w?T[w]:T.field+1,inKind:0,near:0,past:u.destructive?1:0,touched:0,flagged:u.pinned?0:1,name:A,id:`act:${u.name}`})}l.sort(Ge);let y=l.map(u=>u.hit);return r.limit===void 0?y:y.slice(0,r.limit)}function Kn(n,e){let t=e.kinds.map((i,d)=>{let f=ce(n.tryDefinition(i),i);return d===0?f:f.toLowerCase()}),r=ke(t)||"Nothing";return e.kinds.some(i=>n.tryDefinition(i)?.lifecycle)?e.past?`${R(r)}, past ones included.`:`${R(r)}, current ones; add is:any for past ones.`:`${R(r)}.`}export{oe as a,ae as b,Ye as c,Ie as d,Fe as e,vn as f,On as g,Be as h,$e as i,Pe as j,Ze as k,se as l,de as m,on as n,He as o,yn as p,En as q,bn as r,Kn as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as a,k as o}from"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{ja as n}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";var w=new WeakMap;function s(e,i){let t=w.get(e);t||w.set(e,t=new Map);let r=t.get(i);return r||t.set(i,r=a(o(e,n(e)),e,i)),r}export{s as frameworkViews};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.NTF7FVB2.js";import"./chunk.5UL7YDUD.js";import"./chunk.JOOQUWLT.js";import"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";export{a as ActivityFilter,b as InteractionRow};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as n}from"./chunk.BOO6WVM4.js";import"./chunk.NM6MZYFN.js";import"./chunk.63GXY2ME.js";import"./chunk.UGFDSE37.js";import{j as s}from"./chunk.FSTCX2AI.js";import"./chunk.Y6ZNFQK3.js";import"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.UHUGOTUU.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.XANVHJQ4.js";import"./chunk.CAVBSL27.js";import"./chunk.J25KOSNW.js";import"./chunk.LR3VDXPI.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{F as y,Q as i}from"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import{b as r}from"./chunk.AJZBJBMO.js";var c=r(y(),1),e=r(i(),1);function v({store:d,views:t,as:a,scope:o}){let l=(0,c.useMemo)(()=>s({scope:`.${o}`}),[o]);return(0,e.jsxs)("div",{"data-testid":"embed-picture","data-embed-content":"",tabIndex:0,"aria-label":t.places().find(m=>m.as===a)?.title??"The picture",style:{flex:"1 1 auto",minHeight:0,display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)"},children:[(0,e.jsx)("style",{children:l}),(0,e.jsx)(n,{store:d,views:t,as:a})]})}export{v as PictureFace};
|
|
@@ -1 +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 $}from"./chunk.TAQ764IQ.js";import{o as ie,p as _,s as le}from"./chunk.XMC7YDWT.js";import{m as F,n as re,o as ae,p as Q,q as H}from"./chunk.OJGHDWI6.js";import{c as se}from"./chunk.UGFJKSHU.js";import{b as J,c as ne,d as q,e as B,g as oe}from"./chunk.JOOQUWLT.js";import{E,F as D,I as X,N as Z,Q as w,Y as k,Z as ee,_ as O,a as b,na as N,pa as te,xa as S}from"./chunk.6QWV5MVH.js";import{$b as U,aa as j,ec as K}from"./chunk.MNP4JI33.js";import{b as l}from"./chunk.AJZBJBMO.js";var x=l(D(),1),W=l(w(),1),fe="A",V=S(b(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.R6K6GF5R.js","./chunk.3AGY4QVS.js","./chunk.BNV77BQZ.js","./chunk.SYAEBGDC.js","./chunk.YIR7PPF3.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.HJCQ6I3S.js","./chunk.MWGGV7DE.js","./chunk.JQU5GEU3.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.COQKECUH.js","./chunk.EJPI3ST6.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.G5NZVPJU.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.CJJLJ3KW.js"))));var ge=V.part((e,t)=>(0,W.jsx)(e.InspectorPane,{...t}),{what:"This card's acts"});function he(e){let t=()=>{(typeof navigator>"u"||navigator.onLine!==!1)&&e()},n=globalThis;if(n.requestIdleCallback){let c=n.requestIdleCallback(t,{timeout:5e3});return()=>n.cancelIdleCallback?.(c)}let r=setTimeout(t,2500);return()=>clearTimeout(r)}function Le({placement:e="float",openActs:t}={}){let{menuAt:n,setMenuAt:r,registerActsDoor:c}=k(),{selection:u}=N();(0,x.useEffect)(()=>{if(V.current)return;let p=()=>{y(),V.prefetch()},h=he(p),s=["pointerdown","keydown"];for(let v of s)document.addEventListener(v,p,{capture:!0,passive:!0});function y(){h();for(let v of s)document.removeEventListener(v,p,{capture:!0})}return y},[]),(0,x.useEffect)(()=>{if(e==="menu")return c({key:fe,open:t??(p=>{let h=p.getBoundingClientRect(),s=p.closest("[data-graview-pick]")?.getAttribute("data-graview-pick")??p.closest("[data-graview-view]")?.getAttribute("data-graview-view")??void 0;r({x:Math.round(h.left+Math.min(16,h.width/2)),y:Math.round(Math.min(h.bottom,h.top+36)),...s?{on:s}:{}})})}),()=>c(null)},[e,c,r,t]);let m=n!==null||u.length>0,[i,g]=(0,x.useState)(m);return(0,x.useEffect)(()=>{m&&g(!0)},[m]),!i&&!m?null:(0,W.jsx)(x.Suspense,{fallback:null,children:(0,W.jsx)(ge,{placement:e,chosen:t===void 0})})}var z=l(D(),1),G=l(w(),1),ye=S(b(()=>(__graviewPreload(import.meta.url,["./chunk.5A4AOFOA.js","./chunk.OF34OZ4V.js","./chunk.R6K6GF5R.js","./chunk.3AGY4QVS.js","./chunk.2NIOHEMX.js","./chunk.4HRAQNJO.js","./chunk.Y6ZNFQK3.js","./chunk.BNV77BQZ.js","./chunk.SYAEBGDC.js","./chunk.NRAYZY3X.js","./chunk.RIJUCHP4.js","./chunk.TAQ764IQ.js","./chunk.YIR7PPF3.js","./chunk.3HXN4BOY.js","./chunk.GYICGZMG.js","./chunk.UHUGOTUU.js","./chunk.47STJVRV.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.HJCQ6I3S.js","./chunk.MWGGV7DE.js","./chunk.JQU5GEU3.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.COQKECUH.js","./chunk.EJPI3ST6.js","./chunk.CWHRDBOF.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.G5NZVPJU.js","./chunk.WVUJXDXZ.js","./chunk.ULRW47RP.js","./chunk.PBSMLINK.js","./chunk.3TY5NFLY.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.GZHZLJBF.js","./chunk.XMC7YDWT.js","./chunk.6UGEYZAC.js","./chunk.OJGHDWI6.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.K7PMDSOL.js")))),ke=ye.part((e,t)=>{let n=e.DraftFrame;return(0,G.jsx)(n,{...t})},{what:"The view"});function We(e){let{seatTalk:t}=k();return(0,z.useSyncExternalStore)(t.subscribe,()=>t.get().draft!==null,()=>!1)?(0,G.jsx)(z.Suspense,{fallback:null,children:(0,G.jsx)(ke,{...e})}):null}var T=l(D(),1),A=l(w(),1),ce=S(b(()=>(__graviewPreload(import.meta.url,["./chunk.DAZ2VSRD.js","./chunk.AKFKM4SW.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.5UL7YDUD.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.PBSMLINK.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.N6OX4NEQ.js")))),we=ce.part((e,t)=>{let n=e.QuickAskCard;return(0,A.jsx)(n,{...t})},{what:"The quick ask"});function Fe({face:e,on:t=!0}){let{ai:n,aiDesk:r,selection:c,view:u}=k(),m=Z()?.open??!1,i=t&&E(n)&&!m,g=oe(r),p=(0,T.useRef)(null),h=(0,T.useRef)({selection:c,place:u.within?.view});return h.current={selection:c,place:u.within?.view},(0,T.useEffect)(()=>{if(!i)return;let s=ne(r);return s.drawn+=1,q(s),()=>{s.drawn=Math.max(0,s.drawn-1),s.drawn===0&&(s.open=null),q(s)}},[i,r]),(0,T.useEffect)(()=>{if(!i)return;let s=y=>{if(y.defaultPrevented||y.key.toLowerCase()!=="k"||!(y.metaKey||y.ctrlKey)||y.altKey||y.shiftKey)return;let v=p.current?.closest("[data-graview-embed]"),a=y.target,d=!(a instanceof Node)||a===document.body||a===document.documentElement;if(v&&!(d||a instanceof Node&&v.contains(a)))return;y.preventDefault(),ce.prefetch();let f=document.activeElement,{selection:I,place:M}=h.current;B(r,{pointed:{...I[0]!==void 0?{on:I[0]}:{},about:I,...M?{place:M}:{}},returnTo:f instanceof HTMLElement&&f!==document.body?f:null})};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[i,r]),i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("span",{ref:p,hidden:!0,"data-graview-quick-ask":e}),g?(0,A.jsx)(T.Suspense,{fallback:null,children:(0,A.jsx)(we,{face:e,opening:g,close:()=>B(r,null)},g.at)}):null]}):null}var P=l(D(),1),C=l(w(),1),de=S(b(()=>(__graviewPreload(import.meta.url,["./chunk.AKFKM4SW.js","./chunk.XANVHJQ4.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.5UL7YDUD.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.PBSMLINK.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.KSES5U5B.js")))),ve=de.part((e,t)=>{let n=e.InlineAiMenu;return(0,C.jsx)(n,{...t})},{what:"The AI's suggestions"}),be=de.part((e,t)=>{let n=e.GhostTray;return(0,C.jsx)(n,{...t})},{quiet:!0});function Se(){let{ai:e}=k(),t=E(e);return(0,P.useMemo)(()=>t?n=>({id:"inline-ai",heading:"AI",render:r=>(0,C.jsx)(P.Suspense,{fallback:null,children:(0,C.jsx)(ve,{target:n,close:r})})}):null,[t])}var Me=[];function Ye({children:e}){let t=Se(),n=(0,P.useMemo)(()=>t?[t]:Me,[t]);return(0,C.jsx)(le,{sections:n,children:e})}function je(e){let{ai:t,aiDesk:n}=k(),{ghost:r}=X(n);return r===null||r.onCard||t.off?null:(0,C.jsx)(P.Suspense,{fallback:null,children:(0,C.jsx)(be,{...e})})}function Xe(e={}){return e.scope===void 0?$:J($,e.scope)}var L=l(D(),1),o=l(w(),1);function at({inside:e=!1,widthOf:t}={}){let{store:n,view:r,emphasis:c,setEmphasis:u}=k(),m=ie(),{selection:i,set:g}=N(),{show:p}=te(),h=O(),s=(0,L.useMemo)(()=>{let a=new Map;for(let d of n.graph.allEdges()){let f=a.get(d.kind)??{count:0,ends:new Set};f.count+=1;for(let I of[d.from,d.to]){let M=n.graph.getNode(I);M&&f.ends.add(`kind:${M.kind}`)}a.set(d.kind,f)}return[...a.entries()].sort(([d],[f])=>d.localeCompare(f)).map(([d,f])=>({kind:d,count:f.count,ends:[...f.ends]}))},[n,h]),y=Math.max(0,...s.map(a=>a.count));if((0,L.useEffect)(()=>()=>u(null),[u]),!r.overview&&!e||s.length===0)return null;let v=new Set;for(let a of i){if(a.startsWith("kind:")){v.add(a);continue}let d=n.graph.getNode(a);d&&v.add(`kind:${d.kind}`)}return(0,o.jsxs)("section",{"aria-label":"What the lines mean",role:e?"group":void 0,"data-testid":"relation-key",style:e?{display:"grid",gap:1}:{position:"absolute",left:16,top:14,zIndex:K("rail"),display:"grid",gap:1,padding:"8px 10px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-low)",maxWidth:Ae,animation:"graview-settle 380ms 280ms ease backwards"},children:[e?null:(0,o.jsx)("span",{style:{fontSize:"0.75rem",letterSpacing:"0.16em",textTransform:"uppercase",color:"var(--graview-ink-faint)",paddingBottom:2},children:s.length===1?"1 relation":`${s.length} relations`}),t?(0,o.jsx)(xe,{aloft:r.overview===!0}):null,s.map(({kind:a,count:d,ends:f})=>{let{connector:I,style:M}=_(m,a),R=Ie(n.schema,a),pe=c!==null?c===a:v.size===0||f.some(me=>v.has(me));return(0,o.jsxs)("button",{type:"button",title:n.schema.edge(a)?.description===void 0?`${d} of these`:R.words,onMouseEnter:()=>u(a),onMouseLeave:()=>u(null),onFocus:()=>u(a),onBlur:()=>u(null),onClick:()=>{g(f),p(null)},style:{all:"unset",outline:"revert-layer",cursor:"pointer",display:"grid",gridTemplateColumns:"30px 1fr auto",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px",borderRadius:6,opacity:pe?1:.4},children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",style:{display:"block",opacity:I.visible?1:.35},children:r.overview&&t?(0,o.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",className:"graview-key-ribbon",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:t(d,y)}):(0,o.jsx)("path",{d:"M 1 5 L 29 5",fill:"none",stroke:Q(M),strokeWidth:H(M,!0),strokeDasharray:F[M.pattern],strokeLinecap:"round"})}),(0,o.jsxs)("span",{style:{display:"grid",minWidth:0},"data-graview-relation-words":a,children:[(0,o.jsx)("span",{style:{fontSize:"0.8125rem",color:"var(--graview-ink)"},children:R.words}),(0,o.jsx)("span",{style:{fontSize:"0.6875rem",color:"var(--graview-ink-faint)"},children:R.ends})]}),I.visible?null:(0,o.jsx)("span",{"data-graview-quiet":a,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontStyle:"italic"},children:"not drawn"}),(0,o.jsx)("span",{style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)",fontVariantNumeric:"tabular-nums"},children:d})]},a)})]})}var Ae="min(280px, calc(100% - 28px))";function Ie(e,t,n){let r=e.edge(t)?.from??[],c=new Map;for(let i of n!==void 0&&r.includes(n)?[n]:r.length>0?r:[""]){let g=se(e,i,t,"out");c.set(g,[...c.get(g)??[],i])}let u=i=>i==="*"?"anything":j(e,i),m=[...c].map(([i,g])=>{let p=g.flatMap(s=>e.tryDefinition(s)?.edges[t]?.to??[]),h=g[0]&&p.length>0?`${g.map(u).join(", ")} \u2192 ${(p.includes("*")?["*"]:[...new Set(p)]).map(u).join(", ")}`:"";return[i.charAt(0).toUpperCase()+i.slice(1),h]});return{words:m.map(([i])=>i).join(" \xB7 "),ends:m.flatMap(([,i])=>i?[i]:[]).join(" \xB7 ")}}function st({edgeKind:e,kit:t,width:n=30}){let r=ee(),c=(0,L.useMemo)(()=>U(t??r?.brand?.kit),[t,r?.brand?.kit]),{connector:u,style:m}=_(c,e);return(0,o.jsx)("svg",{width:n,height:"8","aria-hidden":"true","data-testid":"relation-mark","data-graview-relation":e,style:{display:"inline-block",verticalAlign:"middle",opacity:u.visible?1:.35},children:(0,o.jsx)("path",{d:`M 1 4 L ${n-1} 4`,fill:"none",stroke:Q(m),strokeWidth:H(m,!0),strokeDasharray:F[m.pattern],strokeLinecap:"round"})})}function xe({aloft:e}){let t={display:"grid",gridTemplateColumns:"30px 1fr",alignItems:"center",gap:8,minHeight:23,padding:"2px 4px"},n={fontSize:"0.75rem",color:"var(--graview-ink-muted)"};return(0,o.jsxs)("div",{role:"group","aria-label":"The lines","data-testid":"line-manners",style:{display:"grid",gap:1,paddingBottom:6,marginBottom:4,borderBottom:"1px solid var(--graview-edge)"},children:[e?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{style:t,"data-graview-manner":"ribbon",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-ink)",strokeOpacity:.35,strokeWidth:6})}),(0,o.jsx)("span",{style:n,children:"A relation between two districts, as wide as the links along it \u2014 point at one for its words"})]}),(0,o.jsxs)("div",{style:t,"data-graview-manner":"record",children:[(0,o.jsxs)("svg",{width:"30",height:"10","aria-hidden":"true",children:[(0,o.jsx)("path",{d:"M 1 5 L 25 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeLinecap:"round"}),(0,o.jsx)("circle",{cx:26,cy:5,r:3,fill:"var(--graview-accent)"})]}),(0,o.jsx)("span",{style:n,children:"A chosen record's link to another record, labeled with the relation"})]}),(0,o.jsxs)("div",{style:t,"data-graview-manner":"district",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeWidth:1.8,strokeDasharray:"5 4"})}),(0,o.jsx)("span",{style:n,children:"A chosen record's links into a district, with how many"})]})]}):null,(0,o.jsxs)("div",{style:t,"data-graview-manner":"unsure",children:[(0,o.jsx)("svg",{width:"30",height:"10","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M 1 5 L 29 5",stroke:"var(--graview-accent)",strokeOpacity:ae,strokeWidth:1.8,strokeDasharray:re,strokeLinecap:"round"})}),(0,o.jsx)("span",{style:n,children:"Unsure: a link its maker was less than sure of, until a person keeps it \u2014 point at its words for what it was based on"})]})]})}var ue=l(D(),1),Y=l(w(),1),Te=S(b(()=>(__graviewPreload(import.meta.url,["./chunk.COQKECUH.js","./chunk.EJPI3ST6.js","./chunk.3K6YSVHC.js","./chunk.SHTJZ6UX.js","./chunk.UT6642FC.js","./chunk.TI4OSTQV.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.7GKUVQVF.js")))),Ce=Te.part(e=>(0,Y.jsx)(e.SuggestedTray,{}),{quiet:!0});function dt(){let{store:e}=k(),t=O();return(0,ue.useMemo)(()=>e.log.all().some(r=>r.suggests!==void 0&&!r.withheld),[e,t])?(0,Y.jsx)(Ce,{}):null}export{Le as a,We as b,Fe as c,at as d,Ae as e,st as f,Se as g,Ye as h,je as i,Xe as j,dt as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.4HRAQNJO.js";import"./chunk.Y6ZNFQK3.js";import"./chunk.BNV77BQZ.js";import"./chunk.SYAEBGDC.js";import"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.UHUGOTUU.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.HJCQ6I3S.js";import"./chunk.MWGGV7DE.js";import"./chunk.JQU5GEU3.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.G5NZVPJU.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk.SYAEBGDC.js";import"./chunk.UZGRRDHD.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";export{f as columnActs,c as columnMoves,b as columnOf,d as columnReach,e as columnSteps,h as describePlace,i as placeText,g as resolveFor,a as statusColumns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk.5A4AOFOA.js";import"./chunk.OF34OZ4V.js";import"./chunk.R6K6GF5R.js";import"./chunk.3AGY4QVS.js";import{a as L,b as R,c as E}from"./chunk.2NIOHEMX.js";import{b as T}from"./chunk.4HRAQNJO.js";import"./chunk.Y6ZNFQK3.js";import"./chunk.BNV77BQZ.js";import"./chunk.SYAEBGDC.js";import"./chunk.NRAYZY3X.js";import"./chunk.RIJUCHP4.js";import"./chunk.TAQ764IQ.js";import"./chunk.YIR7PPF3.js";import"./chunk.3HXN4BOY.js";import"./chunk.GYICGZMG.js";import"./chunk.UHUGOTUU.js";import"./chunk.47STJVRV.js";import"./chunk.EBGAYL32.js";import"./chunk.DAZ2VSRD.js";import"./chunk.HJCQ6I3S.js";import"./chunk.MWGGV7DE.js";import"./chunk.JQU5GEU3.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import"./chunk.OKRNJXTV.js";import"./chunk.CAVBSL27.js";import"./chunk.COQKECUH.js";import"./chunk.EJPI3ST6.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.G5NZVPJU.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ULRW47RP.js";import"./chunk.PBSMLINK.js";import"./chunk.3TY5NFLY.js";import"./chunk.D75KC3LL.js";import"./chunk.FWTIUYXH.js";import"./chunk.MAF7C3VM.js";import"./chunk.GZHZLJBF.js";import{r as x}from"./chunk.XMC7YDWT.js";import"./chunk.6UGEYZAC.js";import"./chunk.OJGHDWI6.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import{F as S,H as $,Q as p,Y as C,_ as A}from"./chunk.6QWV5MVH.js";import{W as h,ec as k}from"./chunk.MNP4JI33.js";import{b as i}from"./chunk.AJZBJBMO.js";var o=i(S(),1);var l=i(S(),1);var g=i(p(),1);var m={font:"inherit",fontSize:"0.875rem",minHeight:24,padding:0,border:0,borderRadius:2,background:"transparent",boxShadow:"none",color:"var(--graview-accent)",textDecoration:"underline",textUnderlineOffset:3,textAlign:"start",cursor:"pointer"};var e=i(p(),1);function I({page:r=!1,go:D,onPick:y,onDiscard:M}){let{store:d,seatTalk:c}=C(),u=$(c),N=E(),b=D??N,{keep:P}=L(b),[H,f]=(0,o.useState)(!1);A();let t=u.draft;(0,o.useEffect)(()=>f(!1),[t]),(0,o.useEffect)(()=>{r||R(!1)},[r]);let v=(0,o.useRef)(null),w=t!==null&&!r;if((0,o.useLayoutEffect)(()=>{let s=v.current;if(!w||!s?.parentElement)return;let n=[];for(let a=s.previousElementSibling;a;a=a.previousElementSibling)a instanceof HTMLElement&&!a.inert&&a.tagName!=="STYLE"&&(a.inert=!0,n.push(a));return()=>{for(let a of n)a.inert=!1}},[w]),!t)return null;let G=T(t.drawn),F=d.schema.tryDefinition(t.kind),q=d.graph.nodesOfKind(t.kind).filter(s=>h(F,s)),z=()=>{c.setDraft(null),M?.()};return(0,e.jsxs)("section",{ref:v,"data-testid":"draft-frame","aria-label":`Draft: ${t.title}`,style:r?{display:"grid",gap:12,minWidth:0}:{position:"absolute",inset:0,zIndex:k("rail"),display:"grid",gridTemplateRows:"auto auto minmax(0, 1fr)",background:"var(--graview-ground, var(--graview-panel))",minHeight:0},children:[(0,e.jsxs)("p",{"data-testid":"draft-line",style:{...K,...r?{}:{padding:"10px 16px"}},children:[r?(0,e.jsx)("span",{children:"Draft"}):(0,e.jsxs)("span",{children:["Draft \u2014 ",(0,e.jsx)("span",{"data-testid":"draft-title",style:{color:"var(--graview-ink)",fontWeight:600},children:t.title})]}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-keep",disabled:H,title:`Keep \u201C${t.title}\u201D as a lens: a place of its own`,onClick:()=>{f(!0),P(t).finally(()=>f(!1))},style:m,children:"Keep as a lens"}),(0,e.jsx)("span",{"aria-hidden":"true",children:"\xB7"}),(0,e.jsx)("button",{type:"button","data-testid":"draft-discard",onClick:z,style:m,children:"Discard"})]}),u.draftNote?(0,e.jsx)("p",{"data-testid":"draft-note",role:"status",style:{margin:0,padding:r?0:"0 16px 8px",fontSize:"0.8125rem",color:"var(--graview-warn)"},children:u.draftNote}):(0,e.jsx)("span",{}),(0,e.jsx)("div",{"data-testid":"draft-lens","data-graview-draft":t.lens.name,style:r?{height:"min(72vh, 760px)",display:"grid",gridTemplateRows:"minmax(0, 1fr)",overflow:"auto",scrollbarGutter:"stable",border:"1px solid var(--graview-edge)",borderRadius:12,background:"var(--graview-panel)"}:{minHeight:0,overflow:"auto",scrollbarGutter:"stable",display:"grid",gridTemplateRows:"minmax(0, 1fr)"},onClick:s=>{let n=s.target?.closest("[data-graview-pick]")?.getAttribute("data-graview-pick");if(!n||!d.graph.getNode(n))return;s.preventDefault();let a=d.graph.getNode(n);y?(c.setDraft(null),y(n)):b({to:"record",id:n,kind:a.kind,label:n,address:"",said:""})},children:(0,e.jsx)(x,{kind:t.kind,view:t.title,children:(0,e.jsx)(G,{nodes:q,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1})})})]})}var K={margin:0,display:"flex",flexWrap:"wrap",alignItems:"baseline",gap:"4px 8px",fontSize:"0.875rem",color:"var(--graview-ink-muted)",borderBottom:"1px solid var(--graview-edge)",paddingBottom:8};export{I as DraftFrame};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g}from"./chunk.AKFKM4SW.js";import"./chunk.XANVHJQ4.js";import"./chunk.OKRNJXTV.js";import"./chunk.CAVBSL27.js";import"./chunk.5UL7YDUD.js";import"./chunk.UT6642FC.js";import"./chunk.TI4OSTQV.js";import"./chunk.PBSMLINK.js";import"./chunk.B2GLDIAS.js";import"./chunk.6YCBYL2Y.js";import"./chunk.UGFJKSHU.js";import"./chunk.JOOQUWLT.js";import"./chunk.6QWV5MVH.js";import"./chunk.MNP4JI33.js";import"./chunk.AJZBJBMO.js";export{g as GhostTray,f as InlineAiMenu,e as askAgain,c as askInline,a as askOf,b as drawPanel,d as takeOffer};
|
|
@@ -1 +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{s as P}from"./chunk.XMC7YDWT.js";import{F as A,N as M,Q as y,Y as m,Z as w,a as p,t as b,x as g,xa as S,y as T}from"./chunk.6QWV5MVH.js";import{b as d}from"./chunk.AJZBJBMO.js";var x=d(A(),1),h=d(y(),1),C=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.UNL2HIF2.js")))),O=C.part((e,n)=>(0,h.jsx)(e.Timeline,{...n}),{what:"The timeline"}),q=()=>C.prefetch();function H({face:e}){return M()?.open?(0,h.jsx)(x.Suspense,{fallback:null,children:(0,h.jsx)(O,{face:e})}):null}var i=d(A(),1),u=d(y(),1),v=new WeakMap,I=e=>{let n=v.get(e);return n||v.set(e,n={ask:null,doors:[],listeners:new Set}),n},k=e=>{for(let n of e.listeners)n()};function N(e,n){let o=I(e);o.ask=n,k(o)}var E=S(p(()=>(__graviewPreload(import.meta.url,["./chunk.E2YEOMPH.js","./chunk.D75KC3LL.js","./chunk.FWTIUYXH.js","./chunk.MAF7C3VM.js","./chunk.JOOQUWLT.js","./chunk.6QWV5MVH.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.H7EPE74C.js")))),B=E.part((e,n)=>{let o=e.NotifySheet;return(0,u.jsx)(o,{...n})},{what:"Notify me"}),W=E.part((e,n)=>{let o=e.NotifiedList;return(0,u.jsx)(o,{...n})},{quiet:!0}),D=e=>(e.onBehalfOf??e).id!==void 0;function L(e,n,o){let c=a=>o.tryDefinition(a)?.noun??a.replace(/[-_]+/g," "),t=e.on!==void 0?e.on:e.about.length===1?e.about[0]:void 0;if(e.act!==void 0){let a=t!==void 0&&n(t)!==void 0?t:void 0;return{label:"Notify me when someone does this\u2026",choices:[{on:"act",act:e.act,...a!==void 0?{record:a}:{}},...a!==void 0?[{on:"act",act:e.act}]:[]]}}if(t===void 0)return null;let r=n(t);if(r!==void 0)return{label:"Notify me when this changes\u2026",choices:[{on:"changed",record:t},{on:"act",record:t},{on:"reaches",kind:r,condition:"",record:t}]};let s=b(t)!==null?[b(t)]:g(t)?T(t):[];if(s.length!==1||!o.kinds.includes(s[0]))return null;let l=s[0],f=c(l);return{label:`Notify me when ${/^[aeiou]/i.test(f)?"an":"a"} ${f} is added\u2026`,choices:[{on:"created",kind:l},{on:"changed",kind:l},{on:"reaches",kind:l,condition:""}]}}function F(){let{store:e,principal:n,subscriptions:o}=m(),c=D(n);return(0,i.useMemo)(()=>c?t=>{let r=L(t,l=>e.graph.getNode(l)?.kind,e.schema);return r?{id:"notify",items:[{id:"notify-me",label:r.label,run:()=>N(o,{choices:r.choices,returnTo:t.element??null})}]}:null}:null,[c,e,o])}var z=[];function U({children:e}){let n=F(),o=(0,i.useMemo)(()=>n?[n]:z,[n]);return(0,u.jsx)(P,{sections:o,children:e})}function V(){let{subscriptions:e}=m(),n=(0,i.useId)(),o=I(e);(0,i.useEffect)(()=>(o.doors.push(n),k(o),()=>{o.doors.splice(o.doors.indexOf(n),1),k(o)}),[o,n]);let c=(0,i.useMemo)(()=>s=>(o.listeners.add(s),()=>void o.listeners.delete(s)),[o]),t=(0,i.useSyncExternalStore)(c,()=>o.ask,()=>null),r=(0,i.useSyncExternalStore)(c,()=>o.doors[0]===n,()=>!1);return!t||!r?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(B,{ask:t,close:()=>N(e,null)})})}function X({choices:e,label:n="Notify me",style:o,className:c,testId:t="notify-me"}){let{principal:r,subscriptions:s}=m();return D(r)?(0,u.jsx)("button",{type:"button","data-testid":t,className:c,onClick:l=>N(s,{choices:e,returnTo:l.currentTarget}),style:o,children:n}):null}function G(){let e=w(),n=e?.subscriptions,o=e?(e.principal.onBehalfOf??e.principal).id:void 0,[c,t]=(0,i.useState)(0);return(0,i.useEffect)(()=>{if(o===void 0||!n)return;let r=!0,s=()=>void Promise.resolve(n.list(o)).then(f=>r&&t(f.length),()=>r&&t(0));s();let l=n.onChange?.(s);return()=>{r=!1,l?.()}},[n,o]),c}function Y({style:e}){return G()===0?null:(0,u.jsx)(i.Suspense,{fallback:null,children:(0,u.jsx)(W,{...e?{style:e}:{}})})}export{q as a,H as b,F as c,U as d,V as e,X as f,G as g,Y as h};
|