graview 0.1.32 → 0.1.33
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.K7PMDSOL.js → chunk.26LLZN3C.js} +1 -1
- package/dist/preview/{chunk.CJJLJ3KW.js → chunk.2WPZXIRP.js} +1 -1
- package/dist/preview/{chunk.NM6MZYFN.js → chunk.3NDH3EDN.js} +1 -1
- package/dist/preview/{chunk.JFAOHHJJ.js → chunk.4HNG4UXT.js} +1 -1
- package/dist/preview/{chunk.FSTCX2AI.js → chunk.67TPUXAY.js} +1 -1
- package/dist/preview/{chunk.LLLZEGRK.js → chunk.AR3DCDHU.js} +1 -1
- package/dist/preview/{chunk.TCNBCTWO.js → chunk.BHXGM3PV.js} +1 -1
- package/dist/preview/{chunk.5TVB6BUY.js → chunk.GBRRGTIH.js} +1 -1
- package/dist/preview/{chunk.F6ZK7RMB.js → chunk.IWQCOGHW.js} +1 -1
- package/dist/preview/{chunk.OF34OZ4V.js → chunk.KSXB4LDF.js} +1 -1
- package/dist/preview/{chunk.DHIUSUCL.js → chunk.TMVCTBAD.js} +1 -1
- package/dist/preview/{chunk.F6EH7HI2.js → chunk.UVR2Z5ZC.js} +1 -1
- package/dist/preview/{chunk.QGTSHKJL.js → chunk.XBJYQNVE.js} +1 -1
- package/dist/preview/{chunk.BOO6WVM4.js → chunk.Y2SFUALD.js} +3 -3
- package/dist/preview/index.html +5 -5
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as c}from"./chunk.Y2SFUALD.js";import"./chunk.3NDH3EDN.js";import"./chunk.63GXY2ME.js";import"./chunk.UGFDSE37.js";import{j as m}from"./chunk.67TPUXAY.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 S,Q as g}from"./chunk.6QWV5MVH.js";import{Uc as n}from"./chunk.MNP4JI33.js";import{b as t}from"./chunk.AJZBJBMO.js";var y=t(S(),1),a=t(g(),1);function R({store:h,auto:f,brand:i,views:u,presence:r,steering:o,overview:s,scope:d,titleLevel:v=2,quickAsk:l,props:e}){let b=(0,y.useMemo)(()=>m({scope:`.${d}`}),[d]);return(0,a.jsxs)("div",{"data-embed-content":"",style:f?{flex:"0 0 auto",background:"var(--graview-ground)"}:{flex:"1 1 auto",minHeight:0,overflow:"auto",background:"var(--graview-ground)"},children:[(0,a.jsx)("style",{children:b}),(0,a.jsx)("div",{"data-embed-measure":"",style:{display:"flow-root"},children:(0,a.jsx)(c,{context:{store:h,embedded:!0,...e.bar!==!1?{barAbove:!0}:{},...s?{overview:s}:{},titleLevel:v,views:u,settings:e.app.settings??[],...r?{presence:r}:{},...i?{brand:i}:{},...e.locale?{locale:e.locale}:{},...e.principal?{principal:e.principal}:{},...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{},...e.subscriptions?{subscriptions:e.subscriptions}:{},...l!==void 0?{quickAsk:l}:{}},...e.pages?{registry:e.pages}:{},...o?{steering:o}:{},...e.routing==="address"?n(e.basePath)===""?{}:{basename:n(e.basePath)}:{initialPath:e.path??"/"},...e.path!==void 0?{path:e.path}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{}})})]})}export{R as PagesContent};
|
|
@@ -15,6 +15,6 @@ Keep it, correct it, or split it into several \u2014 one proposal per distinct c
|
|
|
15
15
|
${o}`:"Nothing is broken.",u?`Selected right now (what "this" means): ${u}`:"Nothing is selected.",N.length>0?`Places in the app: ${N.join(", ")}.`:"",!$&&y?`Conversation so far:
|
|
16
16
|
${y}`:"",$?"":`Person: ${f}`,`To take the person somewhere, put a place's title or a thing's exact name in "go".`,`Answer ONLY JSON${$?" (your last message, after any reading)":""}: {"say": string, "proposals": [{"mutation": string, "args": object, "why": string}], "go"?: [string]}.`].filter(Boolean).join(`
|
|
17
17
|
|
|
18
|
-
`),C=r.turn?await r.turn(Z(d,m,Y,f,a)):await r.complete(Y),v=_(C),c=Array.isArray(v)?{proposals:v}:v;if(!c||typeof c!="object"){let e=C.trim(),n=e.startsWith("{")||e.startsWith("["),h=e.length===0||n;return{say:[h?"The answer came back in a shape I could not read. Ask again in other words.":e,g?K:""].filter(Boolean).join(" "),proposals:[],...h?{unsure:!0}:{}}}let b=(c.proposals??[]).map(e=>H(t,e)),M=q(t,b,r.may),T=W(t,b,r.may),D=T.filter(e=>e.why==="unknown").map(e=>e.proposal.mutation),O=T.filter(e=>e.why==="not-allowed").map(e=>e.proposal.mutation),I=[g?K:"",D.length>0?`It also suggested ${D.map(e=>`"${e}"`).join(", ")}, which this app has no act for.`:"",O.length>0?`${O.map(e=>`"${e}"`).join(", ")} is not something this seat may run.`:"",M.length===0&&b.length>0?"Nothing it suggested can be applied here.":""].filter(Boolean).join(" "),L=typeof c.say=="string"&&c.say.length>0?c.say:"",P=[c.go,c.moves].flatMap(e=>Array.isArray(e)?e:typeof e=="string"?[e]:[]),A=P.length>0?(await (__graviewPreload(import.meta.url,["./chunk.
|
|
18
|
+
`),C=r.turn?await r.turn(Z(d,m,Y,f,a)):await r.complete(Y),v=_(C),c=Array.isArray(v)?{proposals:v}:v;if(!c||typeof c!="object"){let e=C.trim(),n=e.startsWith("{")||e.startsWith("["),h=e.length===0||n;return{say:[h?"The answer came back in a shape I could not read. Ask again in other words.":e,g?K:""].filter(Boolean).join(" "),proposals:[],...h?{unsure:!0}:{}}}let b=(c.proposals??[]).map(e=>H(t,e)),M=q(t,b,r.may),T=W(t,b,r.may),D=T.filter(e=>e.why==="unknown").map(e=>e.proposal.mutation),O=T.filter(e=>e.why==="not-allowed").map(e=>e.proposal.mutation),I=[g?K:"",D.length>0?`It also suggested ${D.map(e=>`"${e}"`).join(", ")}, which this app has no act for.`:"",O.length>0?`${O.map(e=>`"${e}"`).join(", ")} is not something this seat may run.`:"",M.length===0&&b.length>0?"Nothing it suggested can be applied here.":""].filter(Boolean).join(" "),L=typeof c.say=="string"&&c.say.length>0?c.say:"",P=[c.go,c.moves].flatMap(e=>Array.isArray(e)?e:typeof e=="string"?[e]:[]),A=P.length>0?(await (__graviewPreload(import.meta.url,["./chunk.KSXB4LDF.js","./chunk.EBGAYL32.js","./chunk.DAZ2VSRD.js","./chunk.G4JJXA63.js","./chunk.HAIG6NVX.js","./chunk.UZGRRDHD.js","./chunk.OKRNJXTV.js","./chunk.CAVBSL27.js","./chunk.G5NZVPJU.js","./chunk.B2GLDIAS.js","./chunk.6YCBYL2Y.js","./chunk.UGFJKSHU.js","./chunk.MNP4JI33.js","./chunk.AJZBJBMO.js"]),import("./chunk.4HNG4UXT.js"))).movesFromNames(t,P,a):[],R=[L||A.map(e=>e.said).join(" "),I].filter(Boolean).join(" ");return{say:R||"\u2026",proposals:M,...A.length>0?{moves:A}:{},...!R&&b.length===0?{unsure:!0}:{}}}function Z(r,d,f,a,m){let t=B(r,{author:d,readOnly:!0,...m.app?{app:m.app}:{}}),g=t.definitions,k=0,w=new Map,l=[];for(let s of[...(m.history??[]).slice(-8),{role:"person",text:a}]){let i=s.role==="person"?"user":"assistant",p=l[l.length-1];p?.role===i?l[l.length-1]={role:i,content:`${p.content}
|
|
19
19
|
|
|
20
20
|
${s.text}`}:(p||i==="user")&&l.push({role:i,content:s.text})}return{system:f,messages:l,tools:g,call:async(s,i)=>{if(!g.some(o=>o.name===s))return{error:`"${s}" is not one of this turn's tools, which only read: ${g.map(o=>o.name).join(", ")}.`};let p=++k;if(p>J)return{error:`This turn has read ${J} times; answer from what you have read.`};let u=`${s}\0${E(i??{})}`,y=w.get(u);if(y!==void 0)return{already:Q(y)};w.set(u,p);try{let o=await t.call(s,i??{});return o.ok?o.data:{error:o.error}}catch(o){return{error:o instanceof Error?o.message:String(o)}}}}}export{K as READ_AS_ANY_AGENT,J as TURN_CALLS,Q as alreadyRead,se as answerWithModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"])
|
|
1
|
+
var o=new Set(["tell","me","about","what","how","show","describe","the","a","an","and","please"]),$=new Set([...o,"where","is","are","was","find","any","anything","something","things","called","named","which","who","of","for","with","to","in","on","i","my","do","does","have","has","can","you","it","that","this","there","we","our","got","be"]);function k(t){return t.flatMap(e=>{let n=e.repairs.find(s=>!s.missing?.length);return n?[{mutation:n.mutation,args:{...n.args},why:e.message}]:[]})}export{k as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
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 ye,b as ke,c as Se,d as ya,e as ka,h as $e,i as ze,j as Ee,k as Sa}from"./chunk.
|
|
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 ye,b as ke,c as Se,d as ya,e as ka,h as $e,i as ze,j as Ee,k as Sa}from"./chunk.67TPUXAY.js";import{g as ha,h as xa}from"./chunk.BNV77BQZ.js";import"./chunk.TAQ764IQ.js";import{b as va,c as wa,d as be,e as ua}from"./chunk.YIR7PPF3.js";import"./chunk.EBGAYL32.js";import{p as pa,q as ga,r as ca}from"./chunk.DAZ2VSRD.js";import{a as fa}from"./chunk.HJCQ6I3S.js";import"./chunk.MWGGV7DE.js";import{b as ma}from"./chunk.JQU5GEU3.js";import"./chunk.HAIG6NVX.js";import"./chunk.UZGRRDHD.js";import"./chunk.XANVHJQ4.js";import{b as oa}from"./chunk.JDUJDAGA.js";import{b as me,d as he,e as xe}from"./chunk.LR3VDXPI.js";import"./chunk.COQKECUH.js";import{b as fe}from"./chunk.EJPI3ST6.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import"./chunk.UT6642FC.js";import{e as ba}from"./chunk.AR3DCDHU.js";import"./chunk.TI4OSTQV.js";import"./chunk.G5NZVPJU.js";import"./chunk.GZHZLJBF.js";import{c as ta,d as ia,e as Z,o as na}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{H as la,b as Qe,e as ea,f as aa,j as Oa,m as ra,r as da,y as sa}from"./chunk.JOOQUWLT.js";import{A as Ue,F as O,Q as f,V as je,X as Ye,Y as S,_ as le,a as Q,fa as Ve,j as we,k as ne,n as j,o as oe,oa as Xe,p as ue,pa as K,s as de,sa as Je,wa as Ze,xa as pe,y as _e,z as se}from"./chunk.6QWV5MVH.js";import{Kb as Ge,N as qe,_ as Fe,aa as ie,cc as H,ec as D}from"./chunk.MNP4JI33.js";import{b as p}from"./chunk.AJZBJBMO.js";function Ka(e){return`
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
.graview-altitude-control {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as n}from"./chunk.
|
|
1
|
+
import{a as n}from"./chunk.Y2SFUALD.js";import"./chunk.3NDH3EDN.js";import"./chunk.63GXY2ME.js";import"./chunk.UGFDSE37.js";import{j as s}from"./chunk.67TPUXAY.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 +1 @@
|
|
|
1
|
-
import{e as L}from"./chunk.63GXY2ME.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.
|
|
1
|
+
import{e as L}from"./chunk.63GXY2ME.js";import{a as R,b as O,c as v,d as P}from"./chunk.UGFDSE37.js";import"./chunk.67TPUXAY.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.J25KOSNW.js";import"./chunk.LR3VDXPI.js";import"./chunk.CWHRDBOF.js";import"./chunk.3K6YSVHC.js";import"./chunk.SHTJZ6UX.js";import{a as E,b as T}from"./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 D,Q as C,ta as x}from"./chunk.6QWV5MVH.js";import{ec as k}from"./chunk.MNP4JI33.js";import{b as S}from"./chunk.AJZBJBMO.js";var o=S(D(),1);var i=S(C(),1);function W(c){let e=document.activeElement;if(e!==null&&e!==document.body&&e!==document.documentElement&&e.isConnected)return;let r=c??document,a=r.querySelector("main")??r.querySelector("[data-graview-page]")??null,n=r.querySelector("[data-graview-page-title]")??a?.querySelector("h1, h2")??a;n instanceof HTMLElement&&(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus({preventScroll:!0}))}var H=1500;function z(c,e,r){let{store:a,principal:n}=c,u=L(a),l=(0,o.useMemo)(()=>R(a,n),[a,n,u]),b=(0,o.useRef)(r),[p,m]=(0,o.useState)(),[s,f]=(0,o.useState)("");(0,o.useEffect)(()=>{let t=O(a,n,b.current);b.current=a.batches().length,t&&(m({batch:t.batch,at:e,when:Date.now()}),f(""))},[a,n,u]),(0,o.useEffect)(()=>{m(t=>!t||t.at===e?t:Date.now()-t.when<H?{...t,at:e}:void 0)},[e]);let[g,h]=(0,o.useState)(null),y=(0,o.useCallback)(()=>{m(void 0),h(null)},[]),w=(0,o.useCallback)(()=>{h(null);try{let t=P(a,n);t&&f(`Took back \u201C${t.intent}\u201D`)}catch(t){h(t instanceof Error?t.message:String(t))}},[a,n]),d=l&&p?.batch===l.batch&&p.at===e?l:void 0;return{change:l,offered:d,close:y,takeBack:w,refused:g,said:s}}function Y({context:c,docked:e,at:r,since:a}){let{change:n,offered:u,close:l,takeBack:b,refused:p,said:m}=z(c,r,a),s=e?u:n,f=(0,o.useRef)(null),g=e&&(s!==void 0||p!==null);B(f,g),(0,o.useEffect)(()=>{if(!g)return;let d,t=()=>d=setTimeout(()=>f.current?.matches(":hover, :focus-within")?t():l(),1e4);return t(),()=>clearTimeout(d)},[g,s?.batch,p,l]);let h=m||(e&&s?v(s):""),y=e?{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:k("toast"),width:"max-content",height:"auto",bottom:"calc(16px + env(safe-area-inset-bottom, 0px))",left:16,justifyItems:"start",color:"var(--graview-ink)",...g?{}:{display:"none"}}:{},w=s?(0,i.jsxs)("button",{type:"button","data-testid":"page-undo",title:`${v(s)} \u2014 \u2318Z or Ctrl+Z`,"aria-keyshortcuts":"Meta+Z Control+Z",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");b(),requestAnimationFrame(()=>W(t))},style:e?I:A,children:[(0,i.jsx)("span",{"aria-hidden":"true",children:"\u21B6"}),(0,i.jsx)("span",{style:e?j:F,children:v(s)})]}):null;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{role:"status","aria-live":"polite",style:N,children:h}),(0,i.jsxs)("div",{ref:f,...e?{popover:"manual","data-graview-foot":"","data-graview-offstage":""}:{},"data-testid":e?"face-undo-dock":"page-undo-place",style:{display:"grid",justifyItems:"end",gap:4,maxWidth:"100%",minWidth:0,...y},children:[e&&s?(0,i.jsxs)("div",{"data-testid":"page-undo-notice",style:_,children:[w,(0,i.jsx)("button",{type:"button","data-testid":"page-undo-dismiss","aria-label":`Dismiss: ${v(s)}`,title:"Dismiss",onClick:d=>{let t=d.currentTarget.closest("[data-graview-face]");l(),requestAnimationFrame(()=>W(t))},style:q,children:"\xD7"})]}):w,p?(0,i.jsx)("span",{"data-testid":"page-undo-refused",role:"alert",style:{fontSize:"0.8125rem",lineHeight:1.4,color:"var(--graview-warn)",background:e?"var(--graview-float)":void 0,padding:e?"4px 8px":void 0,borderRadius:6},children:p}):null]})]})}function B(c,e){(0,o.useLayoutEffect)(()=>{let r=c.current;if(!r||!e)return;if(typeof r.showPopover=="function"&&!x(r))try{r.showPopover()}catch{}let a=()=>r.parentElement?.closest("[data-embed-content]")??null,n=()=>{T(r,a()),dispatchEvent(new Event(E))};n(),addEventListener("resize",n),addEventListener("scroll",n,!0);let u=typeof ResizeObserver=="function"?new ResizeObserver(n):null;return u?.observe(r),()=>{if(u?.disconnect(),removeEventListener("resize",n),removeEventListener("scroll",n,!0),r.isConnected&&x(r))try{r.hidePopover()}catch{}dispatchEvent(new Event(E))}},[c,e])}var A={display:"inline-flex",alignItems:"center",gap:6,minHeight:36,maxWidth:"100%",minWidth:0,padding:"0 14px",borderRadius:999,border:"1px solid var(--graview-edge)",background:"var(--graview-float)",color:"var(--graview-ink)",font:"inherit",fontSize:"0.875rem",cursor:"pointer"},I={...A,textAlign:"start",lineHeight:1.4,padding:"8px 4px 8px 14px",border:"none",background:"none",color:"inherit"},_={display:"flex",alignItems:"center",gap:2,maxWidth:"100%",minWidth:0,paddingRight:6,borderRadius:"var(--graview-radius, 12px)",border:"1px solid var(--graview-edge)",background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)"},q={flex:"0 0 auto",minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",font:"inherit",fontSize:"1rem",cursor:"pointer"},F={minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},j={minWidth:0,overflow:"hidden",overflowWrap:"anywhere",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:4},N={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};export{Y as TakeBack};
|
|
@@ -1,4 +1,4 @@
|
|
|
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.
|
|
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.3NDH3EDN.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.67TPUXAY.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
2
|
form:where([data-graview-part="form"]) {
|
|
3
3
|
/* A grid item of the section above it and a grid container for the
|
|
4
4
|
fields below: both halves are allowed to be narrower than what is in
|
|
@@ -105,7 +105,7 @@ p:where([data-graview-part="refused"]) {
|
|
|
105
105
|
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
106
106
|
.graview-gallery-card:hover > span:first-child,
|
|
107
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(`
|
|
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.67TPUXAY.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.XBJYQNVE.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
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
110
|
.graview-list[data-graview-choosable]{outline:none}
|
|
111
111
|
.graview-list [data-graview-choose]{position:relative;padding-left:34px}
|
|
@@ -114,4 +114,4 @@ p:where([data-graview-part="refused"]) {
|
|
|
114
114
|
.graview-list:not([data-graview-choosing]) [data-graview-choose]{padding-left:0}
|
|
115
115
|
.graview-list:not([data-graview-choosing]) .graview-choose-at{display:none}
|
|
116
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};
|
|
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.3NDH3EDN.js","./chunk.63GXY2ME.js","./chunk.UGFDSE37.js","./chunk.67TPUXAY.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.BHXGM3PV.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};
|
package/dist/preview/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Graview preview</title>
|
|
7
7
|
<link rel="preload" href="/graview/document" as="fetch" crossorigin="anonymous">
|
|
8
8
|
<link rel="modulepreload" href="/chunk.7T7NZZTC.js">
|
|
9
|
-
<link rel="modulepreload" href="/chunk.
|
|
9
|
+
<link rel="modulepreload" href="/chunk.AR3DCDHU.js">
|
|
10
10
|
<link rel="modulepreload" href="/chunk.Q5WEOX3Q.js">
|
|
11
11
|
<link rel="modulepreload" href="/chunk.4HZ7QTXZ.js">
|
|
12
12
|
<link rel="modulepreload" href="/chunk.MAF7C3VM.js">
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
<link rel="modulepreload" href="/chunk.6QWV5MVH.js">
|
|
15
15
|
<link rel="modulepreload" href="/chunk.MNP4JI33.js">
|
|
16
16
|
<link rel="modulepreload" href="/chunk.AJZBJBMO.js">
|
|
17
|
-
<link rel="modulepreload" href="/chunk.
|
|
18
|
-
<link rel="modulepreload" href="/chunk.
|
|
19
|
-
<link rel="modulepreload" href="/chunk.
|
|
17
|
+
<link rel="modulepreload" href="/chunk.GBRRGTIH.js">
|
|
18
|
+
<link rel="modulepreload" href="/chunk.Y2SFUALD.js">
|
|
19
|
+
<link rel="modulepreload" href="/chunk.3NDH3EDN.js">
|
|
20
20
|
<link rel="modulepreload" href="/chunk.63GXY2ME.js">
|
|
21
21
|
<link rel="modulepreload" href="/chunk.UGFDSE37.js">
|
|
22
|
-
<link rel="modulepreload" href="/chunk.
|
|
22
|
+
<link rel="modulepreload" href="/chunk.67TPUXAY.js">
|
|
23
23
|
<link rel="modulepreload" href="/chunk.Y6ZNFQK3.js">
|
|
24
24
|
<link rel="modulepreload" href="/chunk.NRAYZY3X.js">
|
|
25
25
|
<link rel="modulepreload" href="/chunk.RIJUCHP4.js">
|