graview 0.1.22 → 0.1.24
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.2STFOAXA.js +1 -0
- package/dist/preview/chunk.2VX6H2LL.js +1 -0
- package/dist/preview/chunk.33C6VZAD.js +1 -0
- package/dist/preview/{chunk.L5G5DTFX.js → chunk.3O2QU7LU.js} +1 -1
- package/dist/preview/chunk.3TNQPFIK.js +1 -0
- package/dist/preview/{chunk.SQD7ZPEJ.js → chunk.42U4UBDE.js} +1 -1
- package/dist/preview/{chunk.Q7WQ5UIE.js → chunk.47GRZWQN.js} +1 -1
- package/dist/preview/{chunk.HCK6IHGP.js → chunk.53RZI5PM.js} +1 -1
- package/dist/preview/{chunk.DO4P2UK4.js → chunk.54NSG7BX.js} +1 -1
- package/dist/preview/{chunk.6C7SJJQO.js → chunk.6MCK7K3M.js} +1 -1
- package/dist/preview/{chunk.DAKED3WK.js → chunk.6O67NOZR.js} +1 -1
- package/dist/preview/{chunk.ENMNLR73.js → chunk.6XBLDV4A.js} +1 -1
- package/dist/preview/chunk.7EN53F4Q.js +9 -0
- package/dist/preview/chunk.7Q7S7YCA.js +1 -0
- package/dist/preview/{chunk.BQV62QEL.js → chunk.7U7Q3HIS.js} +1 -1
- package/dist/preview/{chunk.6CLHFNDM.js → chunk.AKOC43TV.js} +14 -14
- package/dist/preview/{chunk.7YCQZJGB.js → chunk.AXACXB4D.js} +1 -1
- package/dist/preview/{chunk.ZKUXPS44.js → chunk.BLAODPYJ.js} +1 -1
- package/dist/preview/chunk.BNSY25SG.js +1 -0
- package/dist/preview/{chunk.XYZ7KAMZ.js → chunk.C7KLA2MW.js} +1 -1
- package/dist/preview/{chunk.WGNF4E67.js → chunk.D3CYTXNZ.js} +1 -1
- package/dist/preview/chunk.DQL3WKR3.js +1 -0
- package/dist/preview/chunk.EUCXNNCZ.js +107 -0
- package/dist/preview/{chunk.VVZ2Z7OS.js → chunk.FKQTQ3FV.js} +1 -1
- package/dist/preview/{chunk.DJ26NOOW.js → chunk.FRNIWOKD.js} +1 -1
- package/dist/preview/chunk.GDIRDJF3.js +1 -0
- package/dist/preview/chunk.H3HRTEW7.js +1 -0
- package/dist/preview/{chunk.SCLIBKLS.js → chunk.HAQ4KHRY.js} +1 -1
- package/dist/preview/{chunk.JE4VH767.js → chunk.HDEQXJWX.js} +1 -1
- package/dist/preview/chunk.HH6WIUK3.js +8 -0
- package/dist/preview/{chunk.ZFUQA3KT.js → chunk.ISAMJ7AK.js} +1 -1
- package/dist/preview/{chunk.FLDFRFDH.js → chunk.KKTHQJ6F.js} +2 -2
- package/dist/preview/chunk.KWSXL3A2.js +1 -0
- package/dist/preview/{chunk.LGUV2J6Q.js → chunk.LW7KV5SL.js} +1 -1
- package/dist/preview/{chunk.R5K7NK4U.js → chunk.MYCTNK6D.js} +1 -1
- package/dist/preview/chunk.NRWJ6PLU.js +1 -0
- package/dist/preview/{chunk.M4XNUM2A.js → chunk.OXODTBOP.js} +1 -1
- package/dist/preview/{chunk.ACZGK7LQ.js → chunk.PRXKRG6O.js} +1 -1
- package/dist/preview/{chunk.EQOU4POV.js → chunk.RGXNZ7PN.js} +1 -1
- package/dist/preview/chunk.RT3XFR6E.js +20 -0
- package/dist/preview/{chunk.ELEHYYCN.js → chunk.S4FO7Y2Q.js} +1 -1
- package/dist/preview/{chunk.3MLQ3Q5X.js → chunk.TDW6QEG4.js} +1 -1
- package/dist/preview/{chunk.VNC6H6IM.js → chunk.TWFYXD3P.js} +1 -1
- package/dist/preview/{chunk.AZG6V3PF.js → chunk.TWGB347L.js} +1 -1
- package/dist/preview/chunk.UEBBASQW.js +1 -0
- package/dist/preview/chunk.UIZWVBJ7.js +1 -0
- package/dist/preview/{chunk.FLJP3BGP.js → chunk.UM5IPM22.js} +1 -1
- package/dist/preview/{chunk.NOXC454O.js → chunk.VLNI5U6H.js} +1 -1
- package/dist/preview/{chunk.CJQL7AHT.js → chunk.VTBAKTFP.js} +2 -2
- package/dist/preview/{chunk.UNRYIETM.js → chunk.WEGBBWWK.js} +1 -1
- package/dist/preview/{chunk.LZQZP2PD.js → chunk.WOTNMTIY.js} +1 -1
- package/dist/preview/{chunk.THBP5EES.js → chunk.XCOPECOJ.js} +1 -1
- package/dist/preview/chunk.XDPRWUCJ.js +1 -0
- package/dist/preview/{chunk.3HEJZPJM.js → chunk.XDVKD6VX.js} +1 -1
- package/dist/preview/{chunk.YAONM74M.js → chunk.XJNXSQT4.js} +1 -1
- package/dist/preview/{chunk.ZQZ557VR.js → chunk.XUXCDUKC.js} +1 -1
- package/dist/preview/chunk.Y4R77MKX.js +1 -0
- package/dist/preview/chunk.ZQ4HFIIS.js +8 -0
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2F7OKRDK.js +0 -9
- package/dist/preview/chunk.4CDEIDKB.js +0 -1
- package/dist/preview/chunk.4JSMCNF7.js +0 -1
- package/dist/preview/chunk.4UQLZ7VW.js +0 -1
- package/dist/preview/chunk.5MAMCKVU.js +0 -1
- package/dist/preview/chunk.75WDSWXL.js +0 -20
- package/dist/preview/chunk.7YC34AIK.js +0 -1
- package/dist/preview/chunk.AZYJTNSM.js +0 -107
- package/dist/preview/chunk.DN4D4HGX.js +0 -1
- package/dist/preview/chunk.K7UJG5II.js +0 -1
- package/dist/preview/chunk.KFLY4MAT.js +0 -1
- package/dist/preview/chunk.KWYU5NPM.js +0 -1
- package/dist/preview/chunk.LSLFKW4M.js +0 -1
- package/dist/preview/chunk.OR6ZWN76.js +0 -1
- package/dist/preview/chunk.PC6FAJF5.js +0 -1
- package/dist/preview/chunk.VRXWNUDR.js +0 -1
- package/dist/preview/chunk.WTF3CP76.js +0 -1
- package/dist/preview/chunk.XEJS2VS5.js +0 -8
- package/dist/preview/chunk.Y235YZSZ.js +0 -8
- package/dist/preview/chunk.YU64JSAL.js +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import{A as he,B as ke,C as Yn,D as Ct,E as pe,F as Jn,G as Qn,H as A,I as We,J as Rt,K as Xn,L as At,M as rt,N as Zn,O as U,P as Y,Q as Lt,a as G,b as fe,c as q,d as Vn,e as xe,f as Fe,g as D,h as se,i as _,j as k,k as j,l as $,m as J,n as et,o as ee,p as Un,q as tt,r as nt,s as I,t as Pe,u as jn,v as at,w as le,x as _n,y as de,z as Pt}from"./chunk.FKQTQ3FV.js";import{a as Ze,c as V}from"./chunk.RGXNZ7PN.js";import{a as Bn,d as Gn,e as qn}from"./chunk.ONDILMIX.js";import{a as Hn,e as zn}from"./chunk.VLNI5U6H.js";import{a as xt}from"./chunk.FRNIWOKD.js";import{a as Ma}from"./chunk.IKT7JQUW.js";import{h as Ln,i as Tn}from"./chunk.AKOC43TV.js";import{e as Mn,i as Kn}from"./chunk.MYCTNK6D.js";import{a as Qe,b as Cn,c as Rn,e as vt,f as An}from"./chunk.53RZI5PM.js";import{f as Fn}from"./chunk.XJNXSQT4.js";import{a as bt,b as On,d as Wn,f as Nn,g as Dn,h as In,k as Xe}from"./chunk.VTBAKTFP.js";import{o as St}from"./chunk.6O67NOZR.js";import{f as Oe}from"./chunk.ISAMJ7AK.js";import{b as $n,c as kt,d as En}from"./chunk.LW7KV5SL.js";import{$ as Sn,C as Ie,W as vn,_ as kn,a as hn,da as oe,ha as bn,ja as Ee,ka as xn,ta as Pn,y as wn}from"./chunk.2VX6H2LL.js";import{Da as sn,Ea as ln,G as $e,Ga as dn,H as je,I as ae,J as Qt,L as re,N as Xt,Nb as wt,Ob as mn,P as Zt,S as en,Sb as yn,T as be,U as tn,Ua as pn,V as nn,Va as cn,Vb as Je,Wb as fn,Xa as gn,Za as Ye,aa as an,ca as _e,oa as ht,pa as rn,ua as on,xb as un}from"./chunk.ZQ4HFIIS.js";import{a as ve,b as z}from"./chunk.MRK6QJV5.js";import{b as O}from"./chunk.AJZBJBMO.js";function ea(e,t,n={}){let a=e.graph.getNode(t);if(!a)return;let i=e.schema.tryDefinition(a.kind),r=s=>ae(e.schema.tryDefinition(s.kind),s),d=new Map;for(let s of e.graph.allEdges()){let l=s.from===t?"out":s.to===t?"in":null;if(!l)continue;let o=l==="out"?s.to:s.from,u=e.graph.getNode(o);if(!u)continue;let g=(l==="out"?i:e.schema.tryDefinition(u.kind))?.edges?.[s.kind],c=l==="in"?g?.inverse??g?.description:g?.description,y=`${s.kind}|${l}|${c??""}`;(d.get(y)??(()=>{let F={edgeKind:s.kind,direction:l,...c?{description:c}:{},targets:[]};return d.set(y,F),F})()).targets.push({id:u.id,kind:u.kind,label:r(u)})}return{id:t,kind:a.kind,label:r(a),fields:tn(Oe(e.schema,e.graph,a),i),violations:ht(e.violations(n.context),[t]),actions:xt(e,[t],{focus:t,...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}}),links:[...d.values()].map(s=>{let l=je(s.targets.flatMap(o=>{let u=e.graph.getNode(o.id);return u?[u]:[]}),o=>e.schema.tryDefinition(o));return{...s,targets:[...s.targets].map(o=>l.has(o.id)?{...o,apart:l.get(o.id)}:o).sort((o,u)=>o.label.localeCompare(u.label))}})}}function Ce(e,t,n={}){return{kind:t,members:e.graph.nodesOfKind(t),actions:xt(e,[],{kindSelection:[t],...n.principal?{principal:n.principal}:{},...n.context?{context:n.context}:{}})}}function ta(e,t){let n=(r,d)=>`${r}|${JSON.stringify(d)}`,a=new Map;for(let r of[...e.affordances,...e.withheld]){if(r.provider!=="invariant")continue;let d=n(r.mutation,r.args);a.has(d)||a.set(d,r.rank??Number.MAX_SAFE_INTEGER)}let i=Number.MAX_SAFE_INTEGER;return[...t].map((r,d)=>({repair:r,declared:d})).sort((r,d)=>(a.get(n(r.repair.mutation,r.repair.args??{}))??i)-(a.get(n(d.repair.mutation,d.repair.args??{}))??i)||r.declared-d.declared).map(r=>r.repair)}function Re(e){let t=e.schema.kinds.map(i=>({kind:i,plural:Zt(e.schema,i),count:e.graph.nodesOfKind(i).length})),n=new Map;for(let i of e.graph.allEdges()){let r=e.graph.getNode(i.from),d=e.graph.getNode(i.to);if(!r||!d)continue;let s=`${i.kind}|${r.kind}|${d.kind}`;n.set(s,(n.get(s)??0)+1)}let a=[];for(let{kind:i}of t){let r=e.schema.tryDefinition(i)?.edges??{};for(let[d,s]of Object.entries(r)){let l=s.to==="*"||s.to===void 0?(()=>{let o=[...n.keys()].filter(u=>u.startsWith(`${d}|${i}|`)).map(u=>u.split("|")[2]);return o.length>0?o:["*"]})():s.to;for(let o of l)a.push({edgeKind:d,from:i,to:o,...s.description?{description:s.description}:{},...s.inverse?{inverse:s.inverse}:{},count:n.get(`${d}|${i}|${o}`)??0})}}return{kinds:t,relations:a}}var Le=O(ve(),1);var Tt=O(ve(),1),S=O(z(),1),$a=`
|
|
2
|
+
form:where([data-graview-part="form"]) {
|
|
3
|
+
/* A grid item of the section above it and a grid container for the
|
|
4
|
+
fields below: both halves are allowed to be narrower than what is in
|
|
5
|
+
them, or a big enough text size pushes the page sideways. See the note
|
|
6
|
+
on \`column\` in pages.tsx. */
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: minmax(0, 1fr);
|
|
9
|
+
min-width: 0;
|
|
10
|
+
gap: 12px;
|
|
11
|
+
}
|
|
12
|
+
label:where([data-graview-part="field"]) {
|
|
13
|
+
display: grid;
|
|
14
|
+
/* A track the width it was given: see the note on \`column\` in pages.tsx. */
|
|
15
|
+
grid-template-columns: minmax(0, 1fr);
|
|
16
|
+
min-width: 0;
|
|
17
|
+
gap: 4px;
|
|
18
|
+
}
|
|
19
|
+
label:where([data-graview-part="field"][data-graview-field="boolean"]) {
|
|
20
|
+
grid-auto-flow: column;
|
|
21
|
+
justify-content: start;
|
|
22
|
+
align-items: center;
|
|
23
|
+
}
|
|
24
|
+
span:where([data-graview-part="label"]),
|
|
25
|
+
legend:where([data-graview-part="label"]),
|
|
26
|
+
p:where([data-graview-part="unasked"]) {
|
|
27
|
+
font-size: 0.8125rem;
|
|
28
|
+
color: var(--graview-ink-muted);
|
|
29
|
+
}
|
|
30
|
+
p:where([data-graview-part="unasked"]) { margin: 0; }
|
|
31
|
+
input:where([data-graview-part="control"]:not([type="checkbox"])),
|
|
32
|
+
select:where([data-graview-part="control"]) {
|
|
33
|
+
font: inherit;
|
|
34
|
+
/* A TARGET IN EVERY ENGINE, not only in the one it was measured in.
|
|
35
|
+
Padding and line height alone came to 24 in Chromium and to 22 in
|
|
36
|
+
WebKit, which has its own intrinsic metrics for a \`select\` and rounds
|
|
37
|
+
nothing up for anybody. So every picker on the routed face was under
|
|
38
|
+
the WCAG 2.2 minimum in the browser iOS ships, and the check that says
|
|
39
|
+
so (\`verify-pages\`' \`bigEnoughToHit\`) only ever ran there through
|
|
40
|
+
\`pnpm engines\`. */
|
|
41
|
+
min-height: 24px;
|
|
42
|
+
/* NEVER WIDER THAN ITS FIELD. A select is as wide as its longest option,
|
|
43
|
+
and a picker over 320 vehicles ("2027 Mercedes-Benz GLE AMG 53 4MATIC+
|
|
44
|
+
Coupe") was 618 pixels on a 390 phone, and the whole page scrolled
|
|
45
|
+
sideways. It shrinks to its track and cuts the option inside its box. */
|
|
46
|
+
min-width: 0;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
text-overflow: ellipsis;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
padding: 7px 10px;
|
|
51
|
+
border-radius: 8px;
|
|
52
|
+
border: 1px solid var(--graview-edge);
|
|
53
|
+
background: var(--graview-panel);
|
|
54
|
+
color: var(--graview-ink);
|
|
55
|
+
}
|
|
56
|
+
/* A PICKER THAT STILL LOOKS LIKE ONE.
|
|
57
|
+
WebKit ignores an author's padding and minimum height on a \`select\`
|
|
58
|
+
while the native appearance is on \u2014 so every picker on the routed face
|
|
59
|
+
came out 22 pixels tall in the browser iOS ships, under the 24 WCAG 2.2
|
|
60
|
+
asks for, while the same element measured 35 in Chromium. Turning the
|
|
61
|
+
appearance off is what makes the box the size it was asked to be, and it
|
|
62
|
+
takes the platform's chevron with it; the chevron is put back, in the ink
|
|
63
|
+
the scheme is already using. */
|
|
64
|
+
span:where([data-graview-part="picker"]) {
|
|
65
|
+
position: relative;
|
|
66
|
+
display: grid;
|
|
67
|
+
min-width: 0;
|
|
68
|
+
}
|
|
69
|
+
span:where([data-graview-part="picker"]) > select:where([data-graview-part="control"]) {
|
|
70
|
+
appearance: none;
|
|
71
|
+
padding-right: 28px;
|
|
72
|
+
}
|
|
73
|
+
span:where([data-graview-part="chevron"]) {
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: 10px;
|
|
76
|
+
top: 50%;
|
|
77
|
+
transform: translateY(-50%);
|
|
78
|
+
font-size: 0.75rem;
|
|
79
|
+
line-height: 1;
|
|
80
|
+
color: var(--graview-ink-muted);
|
|
81
|
+
pointer-events: none;
|
|
82
|
+
}
|
|
83
|
+
fieldset:where([data-graview-part="group"]) {
|
|
84
|
+
display: grid;
|
|
85
|
+
gap: 10px;
|
|
86
|
+
border: 1px solid var(--graview-edge);
|
|
87
|
+
border-radius: 10px;
|
|
88
|
+
padding: 12px;
|
|
89
|
+
}
|
|
90
|
+
fieldset:where([data-graview-part="group"][data-graview-field="list"]) { gap: 8px; }
|
|
91
|
+
div:where([data-graview-part="item"]) {
|
|
92
|
+
display: flex;
|
|
93
|
+
gap: 8px;
|
|
94
|
+
align-items: end;
|
|
95
|
+
}
|
|
96
|
+
button:where([data-graview-part="add"]),
|
|
97
|
+
button:where([data-graview-part="submit"]) { justify-self: start; }
|
|
98
|
+
p:where([data-graview-part="refused"]) {
|
|
99
|
+
margin: 0;
|
|
100
|
+
color: var(--graview-warn);
|
|
101
|
+
font-size: 0.875rem;
|
|
102
|
+
}
|
|
103
|
+
`;function na({children:e}){return(0,S.jsxs)("span",{"data-graview-part":"picker",children:[e,(0,S.jsx)("span",{"aria-hidden":"true","data-graview-part":"chevron",children:"\u25BE"})]})}var Ea=e=>({label:re(e),option:t=>t});function it({store:e,spec:t,value:n,onChange:a,prefilled:i,open:r,words:d=Ea}){if(t.name in i&&t.control!=="group"&&t.control!=="variant")return null;let l=(t.control==="node"&&!t.kinds.includes("*")?t.kinds.map(o=>re(be(e.schema.tryDefinition(o),o))).join(" or "):d(t.name).label)+(t.optional||t.control==="boolean"?"":" *");switch(t.control){case"text":case"date":return t.control==="text"&&t.long?(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"text",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:l}),(0,S.jsx)("textarea",{name:t.name,required:!t.optional,rows:6,value:typeof n=="string"?n:"",onChange:o=>a(o.target.value),"data-graview-part":"control",style:{fieldSizing:"content",minHeight:"7.5em",resize:"vertical",font:"inherit",lineHeight:1.5}})]}):(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":t.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:l}),(0,S.jsx)("input",{type:t.control==="date"?t.time?"datetime-local":"date":"text",name:t.name,required:!t.optional,value:typeof n=="string"?n:"",onChange:o=>a(o.target.value),"data-graview-part":"control"})]});case"number":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":t.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:l}),(0,S.jsx)("input",{type:"number",name:t.name,required:!t.optional,...t.min===void 0?{}:{min:t.min},...t.max===void 0?{}:{max:t.max},...t.step===void 0?{}:{step:t.step},value:typeof n=="number"?n:"",onChange:o=>a(o.target.value===""?void 0:Number(o.target.value)),"data-graview-part":"control"})]});case"boolean":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"boolean",children:[(0,S.jsx)("input",{type:"checkbox",name:t.name,checked:n===!0,onChange:o=>a(o.target.checked),"data-graview-part":"control"}),(0,S.jsx)("span",{"data-graview-part":"label",children:l})]});case"choice":return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":t.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:l}),(0,S.jsx)(na,{children:(0,S.jsxs)("select",{name:t.name,required:!t.optional,value:typeof n=="string"?n:"",onChange:o=>a(o.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),(t.options??[]).map(o=>(0,S.jsx)("option",{value:o,children:d(t.name).option(o)},o))]})})]});case"node":{let o=r.find(y=>y.name===t.name)?.candidates,u=new Set(Object.values(i).filter(y=>typeof y=="string")),m=(t.kinds.includes("*")?[...e.graph.allNodes()]:t.kinds.flatMap(y=>e.graph.nodesOfKind(y))).filter(y=>!u.has(y.id)),g=o?o.map(y=>e.graph.getNode(y)).filter(y=>y!==void 0):m,c=je(g,y=>e.schema.tryDefinition(y));return(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":t.control,children:[(0,S.jsx)("span",{"data-graview-part":"label",children:l}),(0,S.jsx)(na,{children:(0,S.jsxs)("select",{name:t.name,required:!t.optional,value:typeof n=="string"?n:"",onChange:y=>a(y.target.value||void 0),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),g.map(y=>{let P=c.get(y.id);return(0,S.jsxs)("option",{value:y.id,children:[ae(e.schema.tryDefinition(y.kind),y),P?` \xB7 ${P}`:""]},y.id)})]})})]})}case"group":{let o=n??{};return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":t.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:l}),t.fields.map(u=>(0,S.jsx)(it,{store:e,spec:u,value:o[u.name],onChange:m=>a({...o,[u.name]:m}),prefilled:i,open:r,words:d},u.name))]})}case"variant":{let o=n??{},u=typeof o[t.tag]=="string"?o[t.tag]:"",m=t.options.find(g=>g.value===u);return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":t.control,children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:l}),(0,S.jsxs)("label",{"data-graview-part":"field","data-graview-field":"choice",children:[(0,S.jsx)("span",{"data-graview-part":"label",children:re(t.tag)}),(0,S.jsxs)("select",{value:u,onChange:g=>a({[t.tag]:g.target.value}),"data-graview-part":"control",children:[(0,S.jsx)("option",{value:"",children:"\u2014"}),t.options.map(g=>(0,S.jsx)("option",{value:g.value,children:re(g.value)},g.value))]})]}),m?.fields.map(g=>(0,S.jsx)(it,{store:e,spec:g,value:o[g.name],onChange:c=>a({...o,[g.name]:c}),prefilled:i,open:r,words:d},g.name))]})}case"list":{let o=Array.isArray(n)?n:[];return(0,S.jsxs)("fieldset",{"data-graview-part":"group","data-graview-field":"list",children:[(0,S.jsx)("legend",{"data-graview-part":"label",children:l}),o.map((u,m)=>(0,S.jsxs)("div",{"data-graview-part":"item",children:[(0,S.jsx)("div",{style:{flex:1},children:(0,S.jsx)(it,{store:e,spec:{...t.item,optional:!1},value:u,onChange:g=>a(o.map((c,y)=>y===m?g:c)),prefilled:i,open:r,words:d})}),(0,S.jsx)("button",{type:"button","data-graview-part":"remove",onClick:()=>a(o.filter((g,c)=>c!==m)),children:"remove"})]},m)),(0,S.jsx)("button",{type:"button","data-graview-part":"add",onClick:()=>a([...o,void 0]),children:"add another"})]})}case"opaque":return(0,S.jsxs)("p",{"data-graview-part":"unasked",children:["\u201C",re(t.name),"\u201D needs a structured answer this form cannot ask for yet."]})}}function ye({store:e,mutation:t,prefilled:n={},open:a=[],onDone:i,principal:r,initial:d,label:s,only:l}){let[o,u]=(0,Tt.useState)(()=>({...d})),[m,g]=(0,Tt.useState)(null),c=Je(t.input).filter(P=>l===void 0||l.includes(P.name)),y=P=>an(e.schema,t,P);return(0,S.jsxs)("form",{"data-testid":`form-${t.name}`,onSubmit:P=>{P.preventDefault();try{e.apply({name:t.name,args:{...fn(c,o),...n}},r?{author:r}:{}),g(null),u({}),i?.()}catch(F){g(_e(e.schema,e.allMutations(),F))}},"data-graview-part":"form",children:[(0,S.jsx)("style",{children:$a}),c.map(P=>(0,S.jsx)(it,{store:e,spec:P,value:o[P.name],onChange:F=>u(C=>({...C,[P.name]:F})),prefilled:n,open:a,words:y},P.name)),m?(0,S.jsx)("p",{"data-testid":"refused","data-graview-part":"refused",role:"alert",children:m}):null,(0,S.jsx)("button",{type:"submit","data-graview-part":"submit",children:s??t.title??t.name})]})}var b=O(z(),1);function ce(e){let t=e.views;if(!t)return[];let n=new Set(Pe(e.store,e.principal));return t.places().filter(a=>n.has(a.kind))}var Ae=e=>`place:${e.kind}:${e.as}`;function ge(e,t){let n=(e.views?.places()??[]).some(a=>a.as===t.as&&a.kind!==t.kind);return Vn(t.as,n?G(e.store.schema,t.kind):void 0)}function Ke(e,t){let n=e.schema.tryDefinition(t);return e.graph.nodesOfKind(t).filter(a=>$e(n,a))}function Mt(e,t,n){let a=(r,d)=>Xt(e.schema,d,r),i=a(Ke(e,t).length,t);return n?`${i} across ${a(Ke(e,n).length,n)}`:i}function $t({context:e,place:t,chosen:n}){let{store:a,views:i,invariantContext:r}=e,s=i?.resolve(t.kind,{cardinality:"many",fidelity:"full"},t.as)?.view;if(!s)return null;let l=Ke(a,t.kind),o=[...new Set(a.violations(r).flatMap(u=>u.nodeIds))];return(0,b.jsx)(St,{kind:t.kind,view:t.title,children:(0,b.jsx)(s,{nodes:l,label:t.title,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...n&&n.length>0?{implicated:n}:{},...o.length>0?{flagged:o}:{}})})}function Oa({store:e,views:t,as:n,invariantContext:a}){V(e);let i={store:e,views:t,...a?{invariantContext:a}:{}},r=t.places().find(d=>d.as===n);return r?(0,b.jsx)($t,{context:i,place:r}):null}function Fa({context:e,kind:t}){let{store:n,views:a,invariantContext:i}=e,r=Ke(n,t),d=n.schema.tryDefinition(t),s=I(n,t),o=a?.resolve(t,{cardinality:"many",fidelity:"full"})?.view,u=[...new Set(n.violations(i).flatMap(y=>y.nodeIds))];if(o&&!Ee(o))return(0,b.jsx)(St,{kind:t,children:(0,b.jsx)(o,{nodes:r,label:s,fidelity:"full",cardinality:"many",mode:"fullscreen",selected:!1,...u.length>0?{flagged:u}:{}})});let m=a?.resolve(t,{cardinality:"one",fidelity:"summary"})?.view,g=8,c=r.slice(0,g);return(0,b.jsxs)("div",{"data-testid":"kind-sheet",style:m?{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gridAutoRows:"max-content",alignContent:"center",gap:12,padding:24}:{display:"flex",flexWrap:"wrap",alignContent:"center",justifyContent:"center",gap:10,padding:24},children:[c.map(y=>m?(0,b.jsx)(m,{node:y,fidelity:"summary",cardinality:"one",mode:"fullscreen",selected:!1,...u.includes(y.id)?{flagged:[y.id]}:{}},y.id):(0,b.jsx)("span",{style:{fontSize:"1.0625rem",padding:"8px 14px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:ae(d,y)},y.id)),r.length>g?(0,b.jsxs)("span",{style:{...k,alignSelf:"center",padding:"0 6px"},children:["+",r.length-g," more ",s.toLowerCase()]}):null]})}function Et(e){let{store:t}=e,n=jn(e),a=[...ce(e)].sort((r,d)=>n.indexOf(r.kind)-n.indexOf(d.kind)),i=new Set(a.map(r=>r.kind));return[...a.map(r=>({key:Ae(r),kind:r.kind,title:r.title,to:ge(e,r),place:r})),...at(e).filter(r=>!i.has(r)).map(r=>({key:`kind:${r}`,kind:r,title:I(t,r),to:`/${G(t.schema,r)}`}))]}var aa=.72,Wa=540,ra=16/10;function Na(e){let t=(0,Le.useRef)(null),[n,a]=(0,Le.useState)(e);return(0,Le.useLayoutEffect)(()=>{let i=t.current;if(!i||typeof ResizeObserver>"u")return;let r=()=>{let s=i.getBoundingClientRect().width;s>0&&a(l=>Math.abs(l-s)<.5?l:s)};r();let d=new ResizeObserver(r);return d.observe(i),()=>d.disconnect()},[]),{ref:t,width:n}}function Ot({context:e,entry:t}){let{store:n,brand:a,principal:i}=e,{ref:r,width:d}=Na(Wa),s=d/aa,l=Ke(n,t.kind),o=n.schema.tryDefinition(t.kind),u=l.length===0?Ce(n,t.kind,{...i?{principal:i}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances[0]:void 0,m=t.place!==void 0;return(0,b.jsxs)(A,{to:t.to,"data-testid":m?"place-card":"kind-card",className:"graview-gallery-card",style:{...J,display:"grid",gap:10,alignContent:"start",minWidth:0},children:[(0,b.jsxs)("span",{ref:r,"data-testid":m?"place-picture":"kind-picture","aria-hidden":"true",inert:!0,style:{display:"block",position:"relative",width:"100%",aspectRatio:`${ra}`,overflow:"hidden",borderRadius:12,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",pointerEvents:"none"},children:[(0,b.jsx)("span",{style:{position:"absolute",left:0,top:0,width:s,height:s/ra,display:"grid",gridTemplateRows:"minmax(0, 1fr)",transform:`scale(${aa})`,transformOrigin:"0 0"},children:t.place?(0,b.jsx)($t,{context:e,place:t.place}):(0,b.jsx)(Fa,{context:e,kind:t.kind})}),l.length===0?(0,b.jsx)("span",{"data-testid":"picture-empty",style:{position:"absolute",inset:0,display:"grid",placeContent:"center",justifyItems:"center",gap:2,padding:20,textAlign:"center"},children:(0,b.jsxs)("span",{style:{display:"grid",gap:2,padding:"10px 16px",borderRadius:10,border:"1px solid var(--graview-edge)",background:"var(--graview-ground)",color:"var(--graview-ink)"},children:[(0,b.jsxs)("span",{style:{fontFamily:xe,fontWeight:600,fontSize:"1.0625rem"},children:["No ",I(n,t.kind).toLowerCase()," yet"]}),u?(0,b.jsxs)("span",{style:k,children:["Begin with \u201C",u.label,"\u201D"]}):null]})}):null]}),(0,b.jsxs)("span",{style:{display:"grid",gap:2,minWidth:0},children:[(0,b.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[m?null:(0,b.jsx)(ee,{kind:t.kind,brand:a,schema:n.schema,size:8}),(0,b.jsx)("span",{style:{fontFamily:xe,fontSize:"1.25rem",fontWeight:600,lineHeight:1.3,overflowWrap:"anywhere"},children:t.title})]}),(0,b.jsxs)("span",{style:k,children:[t.place?Mt(n,t.place.kind,t.place.across):Mt(n,t.kind),!m&&o?.description?` \xB7 ${o.description}`:null]})]})]})}var ia={display:"grid",gap:"32px 28px",gridTemplateColumns:"repeat(auto-fill, minmax(min(420px, 100%), 1fr))"},Da=`
|
|
104
|
+
.graview-gallery-card > span:first-child { transition: border-color 160ms ease, box-shadow 160ms ease; }
|
|
105
|
+
.graview-gallery-card:hover > span:first-child,
|
|
106
|
+
.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); }
|
|
107
|
+
`;function Ft({context:e}){V(e.store);let t=Et(e);return t.length===0?null:(0,b.jsxs)("section",{style:ia,"data-testid":"gallery",children:[(0,b.jsx)("style",{children:Da}),t.map(n=>(0,b.jsx)(Ot,{context:e,entry:n},n.key))]})}function Wt({context:e}){let{store:t}=e;V(t);let n=ce(e),a=Et(e);return(0,b.jsxs)(U,{context:e,style:Fe,children:[(0,b.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,b.jsx)("p",{style:se,children:n.length===0?"None of its own yet":`${n.length} ${n.length===1?"picture":"pictures"}`}),(0,b.jsx)(Y,{context:e,children:"Pictures"}),(0,b.jsx)("p",{style:_,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,b.jsx)("div",{style:ia,"data-testid":"places",children:a.map(i=>(0,b.jsx)(Ot,{context:e,entry:i},i.key))}):null]})}function Nt({context:e}){let{store:t,principal:n}=e;V(t);let a=ke(),i=he(),[r]=We(),d=decodeURIComponent(a.as??""),[s,l]=(0,Le.useState)(null),o=r.get("of"),m=ce(e).find(P=>P.as===d&&(!o||G(t.schema,P.kind)===o));if(!m)return(0,b.jsxs)(U,{context:e,children:[(0,b.jsx)(Y,{context:e,children:"No picture is called that."}),(0,b.jsx)("p",{style:_,children:(0,b.jsx)(A,{to:"/places",style:$,children:"The pictures there are \u2192"})})]});let g=I(t,m.kind),y=Ce(t,m.kind,{...n?{principal:n}:{},...e.invariantContext?{context:e.invariantContext}:{}}).actions.affordances.map(P=>({affordance:P,mutation:t.allMutations().find(F=>F.name===P.mutation)})).filter(P=>P.mutation!==void 0);return(0,b.jsxs)(U,{context:e,style:Fe,children:[(0,b.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,b.jsx)(Y,{context:e,children:m.title}),(0,b.jsxs)("p",{style:_,"data-testid":"place-lede",children:[Mt(t,m.kind,m.across),"."]}),(0,b.jsx)("p",{style:{...k,margin:0},children:(0,b.jsxs)(A,{to:`/${G(t.schema,m.kind)}`,style:{...$,...k},"data-testid":"place-as-list",children:["All ",g.toLowerCase()," as a list \u2192"]})})]}),(0,b.jsx)("div",{"data-testid":"place-lens",style:{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:P=>{let F=P.target?.closest("[data-graview-pick]"),C=F?.getAttribute("data-graview-pick"),K=F?.getAttribute("data-graview-joins");if(K)try{let X=JSON.parse(K);if(Array.isArray(X)&&X.every(we=>typeof we=="string")){P.preventDefault(),l({at:Ae(m),ids:X});return}}catch{}if(!C)return;let ue=t.graph.getNode(C);ue&&(P.preventDefault(),i(q(t.schema,ue.kind,C)))},children:(0,b.jsx)($t,{context:e,place:m,...s?.at===Ae(m)?{chosen:s.ids}:{}})}),(0,b.jsx)("div",{style:{maxWidth:760,display:"grid",gap:40},children:y.map(({affordance:P,mutation:F})=>(0,b.jsxs)("section",{style:{...j,display:"grid",gap:14},children:[(0,b.jsx)("h2",{style:D,children:F.title??F.name}),F.description?(0,b.jsx)("p",{style:{...k,margin:0,maxWidth:"58ch"},children:F.description}):null,(0,b.jsx)(ye,{store:t,mutation:F,prefilled:P.args,open:P.open,label:P.label,...n?{principal:n}:{}})]},P.id))})]})}var W=O(ve(),1);var Te=O(ve(),1);function oa(e,t,n){let a=Math.max(0,e.left),i=Math.min(t.width,e.right),r=Math.max(0,e.top),d=Math.min(t.height,e.bottom);return{shown:d-r>=n.height+2*16&&i-a>=n.width+2*16,left:Math.round(a),top:Math.round(r),width:Math.round(Math.max(0,i-a)),height:Math.round(Math.max(0,d-r))}}function sa(e,t,n){let a=e.style;a.left=`${t.left}px`,a.top=`${t.top}px`,a.right="auto",a.bottom="auto",a.visibility=n?"":"hidden";let i=e.getBoundingClientRect();i.width!==0&&(a.left=`${Math.round(2*t.left-i.left)}px`,a.top=`${Math.round(2*t.top-i.top)}px`)}var Se=O(z(),1);function la({context:e}){let t=he(),n=oe(),{pathname:a}=de(),[,i,r]=a.split("/"),d=i==="places"&&r?decodeURIComponent(r):void 0,s=(0,Te.useRef)(null);return Ka(s,n!==null),n?(0,Se.jsxs)(Se.Fragment,{children:[(0,Se.jsx)(Ha,{context:e}),(0,Se.jsx)("div",{ref:s,"data-testid":"page-seat",style:{position:"fixed",left:0,top:0,width:"100vw",height:"100dvh",pointerEvents:"none",zIndex:un("rail"),containerType:"size"},children:(0,Se.jsx)(Hn,{onPick:l=>{let o=e.store.graph.getNode(l);o&&t(q(e.store.schema,o.kind,l))},onMove:l=>{if(n.seatTalk.get().draft&&n.seatTalk.setDraft(null),l.to==="place"&&(l.face==="scene"||l.slug==="overview")){e.overview?e.overview("#"):e.embedded||window.location.assign(e.sceneHref??"/");return}t(l.address)},...d?{place:d}:{},onDraft:()=>{a!=="/~draft"&&t("/~draft")}})})]}):null}var Ia={width:160,height:40};function Ka(e,t){let{pathname:n}=de();(0,Te.useLayoutEffect)(()=>{let a=e.current;if(!a)return;let i=a.parentElement?.closest("[data-embed-content]")??null,r=()=>i??document.querySelector("main")??null,d=()=>{let u=r(),m={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},g=u?.getBoundingClientRect()??{left:0,top:0,right:m.width,bottom:m.height},c=oa(i?g:{left:g.left,right:g.right,top:g.top,bottom:Math.max(g.bottom,m.height)},m,Ia);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`,sa(a,c,c.shown)};d(),addEventListener("resize",d),addEventListener("scroll",d,!0);let s=0,l=typeof ResizeObserver=="function"?new ResizeObserver(()=>{cancelAnimationFrame(s),s=requestAnimationFrame(d)}):null,o=r();return o&&l?.observe(o),()=>{cancelAnimationFrame(s),l?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0)}},[e,t,n])}function Ha({context:e}){let{store:t}=e,n=oe(),{pathname:a}=de(),i=(0,Te.useRef)(n?.setSelection);return i.current=n?.setSelection,(0,Te.useEffect)(()=>{let r=i.current;if(!r)return;let[,d,s]=a.split("/"),l=(()=>{if(d==="places"){let u=e.views?.places().find(m=>m.as===decodeURIComponent(s??""));return u?[Ie(u.kind)]:[]}let o=d?fe(t.schema,d):void 0;return o&&s?[decodeURIComponent(s)]:o?[wn(o)]:[]})();r(o=>o.length===l.length&&o.every((u,m)=>u===l[m])?o:l)},[a]),null}var te=O(ve(),1);var pa=O(Ma(),1);var Q=O(z(),1);var za=(0,te.lazy)(hn(()=>import("./chunk.XUXCDUKC.js").then(e=>({default:e.TakeBack}))));function Ba({context:e,docked:t,at:n}){let{store:a}=e,i=V(a),[r]=(0,te.useState)(()=>a.batches().length),d=(0,te.useRef)(!1);return d.current||=i>0||!t&&r>0,d.current?(0,Q.jsx)(te.Suspense,{fallback:null,children:(0,Q.jsx)(za,{context:e,docked:t,at:n,since:r})}):null}function Ga(e,t,n){let{store:a,principal:i,embedded:r}=e;(0,te.useEffect)(()=>{if(!n)return;let d=s=>{if(!qn(s))return;let l=s.target,o=l instanceof Node&&t.current?.contains(l),u=l===document.body||l===document.documentElement||l===document;if(!(!o&&!(u&&!r))&&Bn(a,i)){s.preventDefault();try{Gn(a,i)}catch{}}};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[a,i,r,t,n])}function ca({context:e,registry:t,root:n,children:a}){let i=(0,te.useMemo)(Xn,[]),r=t?.without()??new Set;return Ga(e,n,!r.has("undo")),(0,Q.jsxs)(Rt.Provider,{value:i,children:[(0,Q.jsx)(qa,{context:e,placed:i,without:r}),a]})}function qa({context:e,placed:t,without:n}){let[a,i]=(0,te.useState)(!1);(0,te.useLayoutEffect)(()=>i(!0),[]);let r=At(t,"find"),d=At(t,"undo"),s=de(),l=Tn();if(!a)return null;let o=s.pathname.split("/").filter(Boolean),m=(o.length===1?fe(e.store.schema,o[0]):void 0)!==void 0;return(0,Q.jsxs)(Q.Fragment,{children:[!r&&!n.has("find")&&l?(0,pa.createPortal)((0,Q.jsx)(da,{context:e,narrowsLists:m}),l.slot):null,!r&&!n.has("find")&&!l?(0,Q.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,Q.jsx)(da,{context:e,narrowsLists:m})}):null,!d&&!n.has("undo")?(0,Q.jsx)(Ba,{context:e,docked:!0,at:s.pathname+s.search}):null,l?.own&&!n.has("undo")?(0,Q.jsx)(_n,{context:e,own:l.own}):null]})}function da({context:e,narrowsLists:t}){return(0,Q.jsx)(Rt.Provider,{value:null,children:(0,Q.jsx)(Lt,{context:e,narrowsLists:t})})}var T=O(z(),1);function ga(e,t){return t==="*"?{label:"anything",path:null}:{label:I(e,t),path:`/${G(e.schema,t)}`}}function Va({context:e,relation:t}){let{store:n}=e,a=ga(n,t.from),i=ga(n,t.to),r=d=>d.path?(0,T.jsx)(A,{to:d.path,style:{...J,fontWeight:550},children:d.label}):(0,T.jsx)("span",{children:d.label});return(0,T.jsxs)("li",{"data-testid":"relation","data-relation":t.edgeKind,style:{display:"grid",gridTemplateColumns:"30px minmax(0, 1fr) auto",gap:12,alignItems:"baseline"},children:[(0,T.jsx)(zn,{edgeKind:t.edgeKind,...e.brand?.kit?{kit:e.brand.kit}:{}}),(0,T.jsxs)("span",{style:{display:"grid",gap:1},children:[(0,T.jsxs)("span",{children:[r(a)," ",(0,T.jsxs)("span",{style:k,"data-graview-speaks-ids":"",children:[re(t.edgeKind)," \u2192"]})," ",r(i)]}),t.description||t.inverse?(0,T.jsxs)("span",{style:{...k,fontSize:"0.9375rem"},children:[t.description?le(t.description):null,t.description&&t.inverse?" \xB7 ":null,t.inverse?`from the other end, ${t.inverse}`:null]}):null]}),i.path?(0,T.jsx)(A,{to:`${i.path}?with=${encodeURIComponent(t.edgeKind)}`,style:{...$,...k,fontVariantNumeric:"tabular-nums",display:"inline-block",minWidth:24,minHeight:24,textAlign:"center"},title:`The ${i.label.toLowerCase()} that have this`,children:t.count}):(0,T.jsx)("span",{style:{...k,fontVariantNumeric:"tabular-nums"},children:t.count})]})}function ua({context:e,heading:t=!0}){let{store:n}=e,a=new Set(Pe(n,e.principal)),i=Re(n).relations.filter(r=>a.has(r.from)&&(r.to==="*"||a.has(r.to)));return i.length===0?null:(0,T.jsxs)("section",{style:{...j,display:"grid",gap:12},"data-testid":"kind-map",children:[t?(0,T.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,T.jsx)("h2",{style:D,children:(0,T.jsx)(A,{to:"/map",style:J,children:"Connections"})}),(0,T.jsx)("span",{style:k,children:i.length===1?"1 relation":`${i.length} relations`})]}):null,(0,T.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:i.map(r=>(0,T.jsx)(Va,{context:e,relation:r},`${r.edgeKind}|${r.from}|${r.to}`))})]})}function Dt({context:e}){let{store:t}=e;V(t);let n=new Set(Pe(t,e.principal)),a=Re(t),i=a.relations.filter(r=>n.has(r.from));return(0,T.jsxs)(U,{context:e,children:[(0,T.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,T.jsx)("p",{style:se,children:i.length===0?"No relations":`${i.length} ${i.length===1?"relation":"relations"}`}),(0,T.jsx)(Y,{context:e,children:"Connections"}),(0,T.jsx)("p",{style:_,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,T.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,T.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,T.jsx)(ee,{kind:r.kind,brand:e.brand,schema:t.schema,size:7}),(0,T.jsx)(A,{to:`/${G(t.schema,r.kind)}`,style:$,children:r.plural}),(0,T.jsx)("span",{style:k,children:r.count})]},r.kind))}),(0,T.jsx)(ua,{context:e,heading:!1})]})}function ma({context:e}){let n=[...oe()?.robots.values()??[]].filter(i=>i.mode==="asking"&&i.say);if(n.length===0)return null;let{store:a}=e;return(0,T.jsxs)("section",{style:{...j,display:"grid",gap:10},"data-testid":"seat-questions",children:[(0,T.jsx)("h2",{style:D,children:n.length===1?"The seat asked something":`The seat asked ${n.length} things`}),(0,T.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,T.jsxs)("li",{style:{display:"grid",gap:2},children:[(0,T.jsx)("span",{children:i.say}),r?(0,T.jsxs)(A,{to:q(a.schema,r.kind,r.id),style:{...$,...k},children:[ae(a.schema.tryDefinition(r.kind),r)," \u2192"]}):null]},i.participant)})})]})}var E=O(z(),1);function It({context:e}){let{principal:t}=e,{store:n,brand:a,invariantContext:i}=e;V(n);let r=n.violations(i),d=`${r.length===1?"A rule is broken":"Rules are broken"} \u2014 see what, and what would fix it`,s=[...n.log.all()].slice(-5).reverse(),o=at(e).map(C=>({kind:C,members:n.graph.nodesOfKind(C).filter(K=>$e(n.schema.tryDefinition(C),K))})),u=o.filter(C=>C.members.length>0),m=o.map(C=>({entry:C,creator:n.allMutations().find(K=>(K.creates??[]).includes(C.kind)&&n.permits({name:K.name,args:{}},e.principal).ok)})).find(C=>C.creator!==void 0),g=u.length===0?"Nothing here yet.":`${u.map(C=>`${C.members.length} ${C.members.length===1?C.kind:I(n,C.kind).toLowerCase()}`).join(", ").replace(/, ([^,]*)$/," and $1")}.`,c=e.views?.homeView?.(),y=n.schema.kinds.some(C=>n.graph.nodesOfKind(C).length>0);if(c&&y){let C=a?.subtitle?(0,E.jsx)("p",{style:{...k,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,K=c[Symbol.for("graview.home-blocks")]===!0;return(0,E.jsx)(U,{context:e,style:Fe,children:(0,E.jsxs)("div",{style:{display:"grid",gap:12},"data-testid":"home-view",children:[K?null:C,r.length>0?(0,E.jsx)(A,{to:"/problems",style:{...$,color:"var(--graview-warn)"},children:d}):null,(0,E.jsx)(In.Provider,{value:K?C:null,children:(0,E.jsx)(c,{cardinality:"many",fidelity:"full",mode:"fullscreen",selected:!1})})]})})}let P=new Set(Pe(n,e.principal)),F=Re(n).relations.filter(C=>P.has(C.from)&&(C.to==="*"||P.has(C.to)));return(0,E.jsxs)(U,{context:e,style:Fe,children:[(0,E.jsxs)("header",{style:{display:"grid",gap:12},children:[a?.subtitle?(0,E.jsx)("p",{style:{...k,margin:0},"data-testid":"app-subtitle",children:a.subtitle}):null,(0,E.jsx)(Y,{context:e,"data-testid":"standing",children:g}),(0,E.jsxs)("p",{style:{..._,display:"grid",gap:4},"data-testid":"standing-card",children:[u.length===0&&m?(0,E.jsxs)("span",{children:["Begin with \u201C",m.creator?.title??m.creator?.name,"\u201D, under"," ",(0,E.jsx)(A,{to:`/${G(n.schema,m.entry.kind)}`,style:$,children:I(n,m.entry.kind)}),"."]}):null,r.length===0?(0,E.jsx)("span",{children:"All rules hold."}):(0,E.jsx)(A,{to:"/problems",style:{...$,color:"var(--graview-warn)"},children:d})]})]}),(0,E.jsx)(Ft,{context:e}),(0,E.jsxs)("section",{style:{...j,display:"grid",gap:14},"data-testid":"kinds",children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:10,flexWrap:"wrap"},children:[(0,E.jsx)("h2",{style:D,children:"What is here"}),F.length>0?(0,E.jsxs)(A,{to:"/map",style:{...$,...k,marginLeft:"auto"},"data-testid":"map-link",children:["Connections \xB7 ",F.length===1?"1 relation":`${F.length} relations`," \u2192"]}):null]}),(0,E.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"8px 10px"},children:o.map(({kind:C,members:K})=>(0,E.jsx)("li",{style:{maxWidth:"100%"},children:(0,E.jsxs)(A,{to:`/${G(n.schema,C)}`,style:{...J,flexWrap:"wrap",gap:8,padding:"6px 14px 6px 10px",borderRadius:8,border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)"},children:[(0,E.jsx)(ee,{kind:C,brand:a,schema:n.schema,size:7}),(0,E.jsx)("span",{style:{fontWeight:550,overflowWrap:"anywhere"},children:I(n,C)}),(0,E.jsx)("span",{style:{...k,fontVariantNumeric:"tabular-nums"},children:K.length===0?"none yet":K.length})]})},C))})]}),s.length>0?(0,E.jsxs)("section",{style:{...j,display:"grid",gap:10},children:[(0,E.jsx)("h2",{style:D,children:"Recently"}),(0,E.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:s.map(C=>(0,E.jsxs)("li",{style:k,children:[(0,E.jsx)("span",{style:{color:"var(--graview-ink)"},children:C.intent})," \u2014 ",tt(C,t,{graph:n.graph,schema:n.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},C.id))})]}):null]})}var Me=O(ve(),1);var R=O(z(),1);function Kt({context:e}){let{store:t,brand:n,principal:a,invariantContext:i}=e;V(t);let[r]=We(),d=r.get("q")??"",s=typeof i?.today=="string"?i.today:void 0,l=gn(t,d,{...a?{principal:a}:{},places:ce(e),flagged:new Set(t.violations(i).flatMap(c=>c.nodeIds)),...s?{today:s}:{},limit:200}),o=l.hits.filter(c=>c.about==="node"),u=l.hits.filter(c=>c.about==="kind"||c.about==="place"||c.about==="rule"),m=[...new Set(o.map(c=>c.kind))],g=d.trim();return(0,R.jsxs)(U,{context:e,children:[(0,R.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,R.jsx)("p",{style:se,children:"Search"}),(0,R.jsx)(Y,{context:e,"data-testid":"search-heading",children:g.length===0?"Find anything by its name":l.hits.length===0?(0,R.jsxs)(R.Fragment,{children:["Nothing here is called \u201C",g,"\u201D."]}):(0,R.jsxs)(R.Fragment,{children:[Ua(t,l.byKind)," for \u201C",g,"\u201D"]})}),g.length>0?(0,R.jsxs)("p",{style:{...k,margin:0},"data-testid":"search-searched",children:[Ye(t.schema,l.searched),l.conditions.filter(c=>c.key!=="is"&&c.admittedBy.length<l.searched.kinds.length).map(c=>(0,R.jsxs)("span",{children:[" ",c.key,":",c.value," narrows"," ",c.admittedBy.length===0?"nothing here":c.admittedBy.map(y=>I(t,y).toLowerCase()).join(" and "),"."]},`${c.key}:${c.value}`))]}):(0,R.jsxs)("p",{style:_,children:["Type in the box above. Words find the start of words in names and in what each record says;"," ",(0,R.jsx)("code",{children:"done:false"})," and the like narrow as a list does, and ",(0,R.jsx)("code",{children:"is:any"})," includes what is past."]})]}),u.length>0?(0,R.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},"data-testid":"search-named",children:u.map(c=>(0,R.jsx)("li",{"data-testid":"search-hit","data-about":c.about,children:c.about==="kind"?(0,R.jsxs)(A,{to:`/${G(t.schema,c.kind)}`,style:$,children:[c.label,c.count>0?(0,R.jsxs)("span",{style:k,children:[" \xB7 ",c.count," match"]}):null]}):c.about==="place"?(0,R.jsxs)(A,{to:ge(e,c),style:$,children:["Go to ",c.title]}):c.about==="rule"?(0,R.jsxs)(A,{to:"/problems",style:$,children:["The rule \u201C",c.label,"\u201D"]}):null},`${c.about}:${c.about==="rule"?c.name:c.about==="place"?c.as:c.kind}`))}):null,m.map(c=>(0,R.jsxs)("section",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:0,minWidth:0},"data-testid":"search-group","data-kind":c,children:[(0,R.jsxs)("h2",{style:{...D,fontSize:"1.0625rem",marginBottom:4,display:"flex",alignItems:"center",gap:8},children:[(0,R.jsx)(ee,{kind:c,brand:n,schema:t.schema,size:8}),(0,R.jsx)(A,{to:`/${G(t.schema,c)}?${new URLSearchParams({q:g}).toString()}`,style:$,"data-testid":"search-kind-link",children:I(t,c)}),(0,R.jsx)("span",{style:k,children:l.byKind[c]})]}),(0,R.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:0},children:o.filter(y=>y.kind===c).map(y=>(0,R.jsxs)("li",{"data-testid":"search-hit","data-about":"node",style:{display:"grid",gap:2,padding:"12px 0",minWidth:0,borderTop:"1px solid var(--graview-edge)"},children:[(0,R.jsxs)(A,{to:q(t.schema,c,y.id),style:{...J,fontFamily:xe,fontSize:"1.1875rem",fontWeight:600,lineHeight:1.3,overflowWrap:"anywhere"},children:[y.flagged?(0,R.jsx)("span",{style:{color:"var(--graview-warn)"},children:"\u26A0 "}):null,y.label,y.apart?(0,R.jsxs)("span",{style:k,children:[" \xB7 ",y.apart]}):null,y.current?null:(0,R.jsx)("span",{style:k,children:" \xB7 past"})]}),(0,R.jsx)(ot,{why:y.why})]},y.id))})]},c)),g.length>0?(0,R.jsx)(ja,{asked:g}):null,g.length>0&&l.hits.length===0?(0,R.jsx)(fa,{store:t,kinds:l.searched.kinds,words:l.words,...a?{principal:a}:{},...i?{invariantContext:i}:{}}):null]})}function ot({why:e}){return e.field==="label"?null:(0,R.jsxs)("span",{style:k,"data-testid":"search-why",children:[e.reading,": ",e.fragment]})}function Ua(e,t){let n=Object.entries(t).map(([a,i])=>`${i} ${i===1?be(e.schema.tryDefinition(a),a):I(e,a).toLowerCase()}`);return n.length===0?"Found":n.length===1?le(n[0]):le(`${n.slice(0,-1).join(", ")} and ${n[n.length-1]}`)}function ya(e,t,n={}){let a=[];for(let i of t){let r=Ce(e,i,{...n.principal?{principal:n.principal}:{},...n.invariantContext?{context:n.invariantContext}:{}});for(let d of st(e,i,r.actions.affordances))a.some(s=>s.mutation.name===d.mutation.name)||a.push(d)}return a}function st(e,t,n){let a=e.schema.tryDefinition(t)?.fieldRoles?.label,i=[];for(let r of n){let d=e.allMutations().find(o=>o.name===r.mutation);if(!d||!d.creates?.includes(t)||i.some(o=>o.mutation.name===d.name))continue;let s=Je(d.input).map(o=>o.name),l=s.includes("label")?"label":a&&s.includes(a)?a:void 0;!l||r.args[l]!==void 0||i.push({kind:t,affordance:r,mutation:d,arg:l})}return i}function fa({store:e,kinds:t,words:n,principal:a,invariantContext:i}){let r=ya(e,t,{...a?{principal:a}:{},...i?{invariantContext:i}:{}});return r.length===0||n.trim().length===0?null:(0,R.jsx)("div",{style:{display:"grid",gap:24},"data-testid":"search-to-create",children:r.map(({kind:d,affordance:s,mutation:l,arg:o})=>(0,R.jsxs)("section",{style:{...j,display:"grid",gap:14},children:[(0,R.jsxs)("h2",{style:D,children:[le(en(be(e.schema.tryDefinition(d),d)))," called \u201C",n,"\u201D"]}),(0,R.jsx)(ye,{store:e,mutation:l,prefilled:s.args,open:s.open,initial:{[o]:n},...a?{principal:a}:{}})]},`${s.id}|${n}`))})}function ja({asked:e}){let t=oe();return t?(0,R.jsx)(_a,{asked:e,talk:t.seatTalk}):null}function _a({asked:e,talk:t}){let{drawn:n}=vn(t);return n===0?null:(0,R.jsx)("p",{style:{margin:0},children:(0,R.jsxs)("button",{type:"button","data-testid":"search-ask",onClick:()=>t.ask(e),style:{...$,font:"inherit",padding:0,border:0,background:"transparent",cursor:"pointer",textAlign:"start"},children:["Ask: \u2018",e,"\u2019"]})})}var h=O(z(),1),ha=8,wa=40;function Ht({context:e}){let t=ke(),n=fe(e.store.schema,t.slug??"");return n?(0,h.jsx)(va,{context:e,kind:n}):(0,h.jsx)(U,{context:e,children:(0,h.jsx)(Y,{context:e,children:"No such kind of thing here."})})}function va({context:e,kind:t,opening:n,row:a,layout:i="list",description:r,bare:d}){let{store:s,brand:l,invariantContext:o}=e;V(s);let[u,m]=We(),g=s.schema.tryDefinition(t),c=s.graph.nodesOfKind(t),y=Re(s).relations.filter(p=>p.from===t||p.to===t),P=new Set(s.violations(o).flatMap(p=>p.nodeIds)),F=ln(s.schema,t),C=y.map(p=>p.edgeKind),K=Qa(u,F,C),ue=["sort","filter","group","q","by","with","past",...C].some(p=>u.has(p)),X=c.length>=wa,we=g?.fieldRoles?.when,N=ue?K.arrangement:kt(n??Ja(X,we),F).arrangement,ne=pn(N.query??""),f=[...N.filter??[],...ne.conditions].some(p=>p.key==="is"&&(p.value==="past"||p.value==="any"))||sn(g,[...N.filter??[],...ne.conditions]),L=f||!g?.lifecycle?N:{...N,filter:[...N.filter??[],{key:"is",value:"current"}]},Z=En(c,L,{schema:s.schema,graph:s.graph,flagged:P,...typeof o?.today=="string"?{today:o.today}:{}}),B=Z.nodes,ze=g?.lifecycle&&!f?c.filter(p=>$e(g,p)):c,Gt=c.length-ze.length,qt=N.group?.by??null,ba=p=>{let x=new URLSearchParams(u);for(let ie of["sort","filter","group","q","by","with","past",...y.map(Ue=>Ue.edgeKind)])x.delete(ie);let H=$n(p);for(let ie of["sort","filter","group","q"])H[ie]&&x.set(ie,H[ie]);![...x.keys()].some(ie=>["sort","filter","group","q"].includes(ie))&&(n||X||we)&&x.set("sort",""),m(x)},{principal:Vt}=e,ct=Ce(s,t,{...Vt?{principal:Vt}:{},...e.invariantContext?{context:e.invariantContext}:{}}),Ne=ct.actions.affordances.map(p=>({affordance:p,mutation:s.allMutations().find(x=>x.name===p.mutation)})).filter(p=>p.mutation!==void 0),Ut=ct.actions.withheld,jt=ne.words&&B.length===0?Object.fromEntries(st(s,t,ct.actions.affordances).map(p=>[p.mutation.name,p.arg])):{},gt=I(s,t),Be=e.views?.lookup(t,{cardinality:"one",fidelity:"glyph"}),_t=Be!==void 0&&!Ee(Be)?Be:void 0,ut=p=>{let x=ae(g,p);if(a){let De=g?.computed?Oe(s.schema,s.graph,p):p;return(0,h.jsx)("li",{"data-testid":"record-row",style:{minWidth:0},children:a(p,{label:x,href:q(s.schema,t,p.id),flagged:P.has(p.id),glance:nt(De,g,x)})},p.id)}if(_t){let De=Xe(Be,p,s.graph),Aa=g?.computed?Oe(s.schema,s.graph,p):p,La=Object.fromEntries(Object.entries(Aa).filter(([Ta])=>!De?.fields.has(Ta))),Jt=De?nt(La,g,De.title??x):"";return(0,h.jsxs)("li",{"data-testid":"record-row",style:{position:"relative",display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:2,padding:"10px 0",borderTop:"1px solid var(--graview-edge)"},children:[(0,h.jsx)("div",{style:{flex:"1 1 14rem",minWidth:0},children:(0,h.jsx)(_t,{node:p,cardinality:"one",fidelity:"glyph",mode:"fullscreen",selected:!1,...P.has(p.id)?{flagged:[p.id]}:{}})}),Jt?(0,h.jsx)("span",{style:{...k,flex:"0 1 auto",minWidth:0,overflowWrap:"anywhere"},"data-testid":"record-glance",children:Jt}):null,(0,h.jsx)(A,{to:q(s.schema,t,p.id),"aria-label":P.has(p.id)?`${x} \u2014 implicated in a problem`:x,style:{position:"absolute",inset:0,borderRadius:6}})]},p.id)}let H=g?.computed?Oe(s.schema,s.graph,p):p,ie=nt(H,g,x),Ue=ne.words?cn(g,p,ne.words):void 0;return(0,h.jsxs)("li",{style:X?{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:16,rowGap:0,padding:"5px 0",borderTop:"1px solid var(--graview-edge)",overflowWrap:"anywhere"}:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:2,padding:"14px 0",borderTop:"1px solid var(--graview-edge)",overflowWrap:"anywhere"},children:[(0,h.jsxs)(A,{to:q(s.schema,t,p.id),style:X?{...J,flex:"1 1 14rem",minWidth:0,fontSize:"1rem",fontWeight:600,lineHeight:1.35}:{...J,fontFamily:xe,fontSize:"1.25rem",fontWeight:600,lineHeight:1.3},children:[P.has(p.id)?(0,h.jsx)("span",{style:{color:"var(--graview-warn)"},children:"\u26A0 "}):null,x]}),ie?(0,h.jsx)("span",{style:X?{...k,flex:"0 1 auto",minWidth:0,fontSize:"0.875rem"}:k,children:ie}):null,Ue?(0,h.jsx)(ot,{why:Ue}):null]},p.id)},mt=ce(e).filter(p=>p.kind===t),xa=(N.filter??[]).some(p=>p.key!=="is"||p.value!=="any"),Pa=!!(N.sort||N.group||N.query||xa),Ca=ze.length>=ha||ue&&Pa,me=N.sort?F.sorts.find(p=>p.key===N.sort.by):void 0,yt=me?.type==="date"||me!==void 0&&me.key===we,Yt=X&&!Z.grouped&&me&&(me.about==="label"||me.type==="text"||yt)?p=>{let x=me.about==="label"?ae(g,p):p[me.key];if(typeof x!="string"||x.length===0)return yt?"No date":"#";if(yt)return x.slice(0,4);let H=x.trim().charAt(0).toLocaleUpperCase();return/\p{L}/u.test(H)?H:"#"}:void 0,Ge=Yt?B.reduce((p,x)=>{let H=Yt(x);return p.at(-1)?.key===H?p.at(-1).nodes.push(x):p.push({key:H,nodes:[x]}),p},[]):void 0,ft=i==="grid"?{margin:0,padding:0,listStyle:"none",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 15rem), 1fr))",gap:12}:{margin:0,padding:0,listStyle:"none",display:"grid",gap:a&&i==="list"?6:0},qe=p=>`list-at-${p.replace(/[^\p{L}\p{N}]/gu,"_")}`,Ve=y.map(p=>{let x=p.from===t?p.to:p.from,H=p.from===t?p.description:p.inverse??p.description;return{relation:p,far:x,words:H}}),Ra=new Set(Ve.map(p=>(p.words??"").toLowerCase()).filter((p,x,H)=>p&&H.indexOf(p)!==x));return(0,h.jsxs)(d?Ya:U,{context:e,children:[(0,h.jsxs)("div",{style:{display:"grid",gap:12},children:[(0,h.jsxs)("header",{style:{display:"grid",gap:4},children:[(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[(0,h.jsx)(ee,{kind:t,brand:l,schema:s.schema,size:8}),(0,h.jsx)(Y,{context:e,children:gt})]}),r??g?.description?(0,h.jsx)("p",{style:{..._,fontSize:"1.0625rem",lineHeight:1.4},children:r??g?.description}):null,Ve.length>0||mt.length>0?(0,h.jsxs)("p",{style:{...k,margin:0,display:"flex",flexWrap:"wrap",columnGap:18,rowGap:2},"data-testid":"kind-related",children:[Ve.length>0?(0,h.jsxs)("span",{"data-testid":"kind-relations",children:["Related:"," ",Ve.map(({relation:p,far:x,words:H},ie)=>(0,h.jsxs)("span",{"data-relation":p.edgeKind,children:[ie>0?" \xB7 ":null,x==="*"?le(H??re(p.edgeKind)):(0,h.jsx)(A,{to:`/${G(s.schema,x)}`,style:$,title:I(s,x),children:H&&Ra.has(H.toLowerCase())?`${le(H)}: ${I(s,x).toLowerCase()}`:le(H??I(s,x))})]},`${p.edgeKind}|${p.from}|${p.to}`))]}):null,mt.length>0?(0,h.jsxs)("span",{"data-testid":"kind-pictures",children:["Also as:"," ",mt.map((p,x)=>(0,h.jsxs)("span",{children:[x>0?" \xB7 ":null,(0,h.jsx)(A,{to:ge(e,p),style:$,children:p.title})]},Ae(p)))]}):null]}):null]}),K.dropped.length>0?(0,h.jsxs)("p",{style:{...k,margin:0},"data-testid":"list-dropped",children:["This link asked for ",K.dropped.join(", "),", which ",gt.toLowerCase()," cannot be arranged by; the rest is shown."]}):null,ze.length>0?(0,h.jsx)(Fn,{schema:s.schema,graph:s.graph,kind:t,arrangement:N,onChange:ba,kept:{shown:B.length,of:ze.length},noun:{one:be(g,t),many:gt.toLowerCase()},...Ca?{}:{allow:!1},query:e.framed===!0&&e.barAbove!==!0}):null,B.length===0&&ne.words?(0,h.jsxs)("p",{style:{..._,fontSize:"1.0625rem"},"data-testid":"none-yet",children:["Nothing here is called \u201C",ne.words,"\u201D."," ",(0,h.jsx)("span",{style:k,"data-testid":"list-searched",children:Ye(s.schema,{kinds:[t],past:f})})," ",(0,h.jsx)(A,{to:"?",style:$,children:"Show every one"})]}):B.length===0?(0,h.jsxs)("p",{style:{..._,fontSize:"1.0625rem"},"data-testid":"none-yet",children:[N.filter?.length||N.query?"None of them.":"None yet",!N.filter?.length&&!N.query&&Ne.length>0?` \u2014 the first one starts below, with \u201C${Ne[0]?.mutation.title??Ne[0]?.mutation.name}\u201D.`:!N.filter?.length&&!N.query?".":"",N.filter?.length||N.query?(0,h.jsxs)(h.Fragment,{children:[" ",(0,h.jsx)(A,{to:"?",style:$,children:"Show every one"})]}):null]}):Z.grouped&&qt?(0,h.jsx)("div",{style:{display:"grid",gap:18},"data-testid":"records","data-grouped":qt,children:Z.groups.map(p=>(0,h.jsxs)("section",{style:{display:"grid",gap:0},"data-testid":"list-group",children:[(0,h.jsxs)("h2",{style:{...D,fontSize:"1.0625rem",marginBottom:4},children:[p.label," ",(0,h.jsx)("span",{style:k,children:p.nodes.length})]}),(0,h.jsx)("ul",{style:ft,"data-graview-rows":"",children:p.nodes.map(ut)})]},p.key||"-"))}):Ge&&Ge.length>1?(0,h.jsxs)("div",{style:{display:"grid",gap:14},"data-testid":"records","data-sectioned":me?.type==="date"?"year":"letter",children:[(0,h.jsx)("nav",{"aria-label":"Jump to","data-testid":"list-index",style:{...k,display:"flex",flexWrap:"wrap",gap:me?.type==="date"?"0 10px":"0 4px",fontSize:"0.8125rem",lineHeight:1.3},children:Ge.map(p=>(0,h.jsx)("a",{href:`#${qe(p.key)}`,onClick:x=>{x.preventDefault(),document.getElementById(qe(p.key))?.scrollIntoView({block:"start"})},style:{...$,flex:"0 0 auto",minWidth:24,justifyContent:"center",textDecoration:"none"},children:p.key},p.key))}),Ge.map(p=>(0,h.jsxs)("section",{"data-testid":"list-section","aria-labelledby":qe(p.key),style:{display:"grid",gap:0},children:[(0,h.jsx)("h2",{id:qe(p.key),style:{...D,fontSize:"0.9375rem",color:"var(--graview-ink-muted)",marginBottom:2,scrollMarginTop:64},children:p.key}),(0,h.jsx)("ul",{style:ft,"data-graview-rows":"",children:p.nodes.map(ut)})]},p.key))]}):(0,h.jsx)("ul",{style:ft,"data-testid":"records","data-graview-rows":"",children:B.map(ut)}),Gt>0?(0,h.jsxs)(A,{to:Xa(u,"filter","is:any"),style:{...$,...k,justifySelf:"start"},"data-testid":"past-link",children:["+",Gt," past"]}):null,Ne.length>0?(0,h.jsx)("div",{style:{display:"grid",gap:6},"data-testid":"beginnings",children:Ne.map(({affordance:p,mutation:x})=>{let H=!!(jt[x.name]&&B.length===0);return(0,h.jsx)(Za,{name:x.name,title:x.title??x.name,description:x.description,open:B.length===0,children:(0,h.jsx)(ye,{store:s,mutation:x,prefilled:p.args,open:p.open,...H?{initial:{[jt[x.name]]:ne.words}}:{},...e.principal?{principal:e.principal}:{}},H?`${x.name}|${ne.words}`:x.name)},p.id)})}):null]}),Ut.length>0?(0,h.jsx)("ul",{style:{...j,margin:0,padding:0,listStyle:"none",display:"grid",gap:4},"data-testid":"withheld",children:Ut.map(p=>(0,h.jsxs)("li",{style:k,children:[(0,h.jsx)("s",{children:p.label})," \u2014 ",p.refusal.message]},p.id))}):null]})}function Ya({children:e}){return(0,h.jsx)("div",{style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40,minWidth:0},children:e})}var Ja=(e,t)=>t?{sort:{by:t,direction:"desc"}}:e?{sort:{by:"label",direction:"asc"}}:{};function Qa(e,t,n){let a=dn({...e.get("sort")?{sort:e.get("sort")}:{},...e.get("filter")?{filter:e.get("filter")}:{},...e.get("group")?{group:e.get("group")}:{},...e.get("q")?{q:e.get("q")}:{}}),i=[...a.filter??[]],r=e.get("by"),d=a.group??(r?{by:r}:void 0);for(let l of n){let o=e.get(l);o&&i.push({key:l,value:o})}let s=e.get("with");return s&&i.push({key:s,value:"*"}),e.get("past")==="1"&&!i.some(l=>l.key==="is")&&i.push({key:"is",value:"any"}),kt({...a.sort?{sort:a.sort}:{},...a.query?{query:a.query}:{},...i.length>0?{filter:i}:{},...d?{group:d}:{}},t)}function Xa(e,t,n){let a=new URLSearchParams(e);return a.set(t,n),a.delete("past"),`?${a.toString()}`}function Za({name:e,title:t,description:n,open:a,children:i}){let[r,d]=(0,Me.useState)(a),s=(0,Me.useRef)(null),l=(0,Me.useRef)(null),o=`begin-${(0,Me.useId)().replace(/:/g,"")}`;return(0,h.jsxs)("div",{"data-testid":`act-${e}`,style:{display:"grid",gap:10},children:[(0,h.jsxs)("button",{ref:s,type:"button","data-testid":`act-open-${e}`,"aria-expanded":r,"aria-controls":o,onClick:()=>{d(!r),r||requestAnimationFrame(()=>l.current?.querySelector("input, select, textarea, button")?.focus())},style:{...J,justifySelf:"start",minHeight:32,padding:"0 2px",border:0,background:"none",font:"inherit",fontSize:"0.9375rem",fontWeight:600,color:"var(--graview-ink)",cursor:"pointer"},children:[(0,h.jsx)("span",{"aria-hidden":"true",style:{marginRight:6},children:r?"\u2212":"+"}),t]}),(0,h.jsxs)("div",{ref:l,id:o,hidden:!r,onKeyDown:u=>{u.key==="Escape"&&(u.preventDefault(),d(!1),s.current?.focus())},style:r?{display:"grid",gap:12,padding:"4px 0 12px"}:void 0,children:[n?(0,h.jsx)("p",{style:{...k,margin:0,maxWidth:"58ch"},children:n}):null,i]})]})}var pt=O(ve(),1);var He=O(ve(),1);var M=O(z(),1);function zt({context:e}){let{store:t,brand:n,invariantContext:a,principal:i}=e;V(t);let r=t.violations(a),d=t.allInvariants(),s=Qe(t,r),l=Cn(t.schema,d);return(0,M.jsxs)(U,{context:e,children:[(0,M.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,M.jsx)(Y,{context:e,children:r.length===0?"All rules hold":"What is broken"}),(0,M.jsx)("p",{style:_,"data-testid":"problems-count",children:r.length===0?"Every declared rule is satisfied by what is here.":rn(r)})]}),(0,M.jsx)(ma,{context:e}),s.map((o,u)=>{let m=o.nodeIds[0],g=m?t.graph.getNode(m):void 0;return(0,M.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:[o.line?null:(0,M.jsx)(lt,{violation:o,schema:t.schema,...n?{brand:n}:{}}),g?(0,M.jsxs)("p",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[(0,M.jsx)(ee,{kind:g.kind,brand:n,schema:t.schema,size:7}),(0,M.jsx)(A,{to:q(t.schema,g.kind,g.id),style:$,children:ae(t.schema.tryDefinition(g.kind),g)})]}):null,o.line?(0,M.jsx)(lt,{violation:o,schema:t.schema,...n?{brand:n}:{}}):null,(0,M.jsx)(dt,{store:t,repairs:o.repairs,...i?{principal:i}:{}})]},u)}),d.length>0?(0,M.jsxs)("section",{style:{...j,display:"grid",gap:12},"data-testid":"rules",children:[(0,M.jsx)("h2",{style:D,children:"The rules"}),(0,M.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:10},children:d.map(o=>{let u=r.filter(c=>c.invariant===o.name).length,m=l.get(o.name),g=o.label??o.name;return(0,M.jsxs)("li",{"data-graview-rule":o.name,style:{display:"grid",gap:2},children:[(0,M.jsxs)("span",{style:{display:"flex",flexWrap:"wrap",alignItems:"baseline",columnGap:12,rowGap:2},children:[m?(0,M.jsx)(vt,{line:m,schema:t.schema,...n?{brand:n}:{},style:{flex:"1 1 18rem"}}):(0,M.jsx)("span",{style:{flex:"1 1 18rem",fontWeight:550},children:g}),(0,M.jsx)("span",{style:{...k,fontSize:"0.875rem",color:u>0?"var(--graview-warn)":"var(--graview-ink-faint)"},children:u===0?"holds":`broken in ${u} ${u===1?"place":"places"}`})]}),m&&g.trim().length>0?(0,M.jsx)("span",{style:{...k,fontSize:"0.875rem"},children:g}):null]},o.name)})})]}):null]})}function lt({violation:e,schema:t,brand:n}){if(!e.line)return(0,M.jsx)("p",{style:{margin:0,color:"var(--graview-warn)",fontWeight:550},children:e.message});let a=An(e);return(0,M.jsxs)("div",{style:{display:"grid",gap:2},"data-testid":"problem-line",title:Rn(e),children:[(0,M.jsx)(vt,{line:e.line,schema:t,...n?{brand:n}:{},lead:"none",style:{color:"var(--graview-warn)",fontSize:"1.0625rem"}}),a?(0,M.jsx)("span",{style:{...k,fontSize:"0.875rem"},children:a}):null]})}function dt({store:e,repairs:t,principal:n}){let[a,i]=(0,He.useState)(null),[r,d]=(0,He.useState)(null),s=(0,He.useRef)([]);if(t.length===0)return null;let l=a===null?null:t[a],o=l&&(l.missing??[]).length>0?e.allMutations().find(u=>u.name===l.mutation):void 0;return(0,M.jsxs)("div",{style:{display:"grid",gap:10},"data-testid":"repairs",children:[(0,M.jsx)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:t.map((u,m)=>{let g=(u.missing??[]).length>0,c=e.permits({name:u.mutation,args:{...u.args}},n);return c.ok?(0,M.jsx)("button",{ref:y=>{s.current[m]=y},type:"button","data-graview-repair":u.mutation,"data-graview-asks":g||void 0,"aria-expanded":g?a===m:void 0,onClick:()=>{if(d(null),g){i(a===m?null:m);return}i(null);try{e.apply({name:u.mutation,args:{...u.args}},n?{author:n}:{})}catch(y){d(_e(e.schema,e.allMutations(),y))}},style:et,children:g?`${u.label} \u2026`:u.label},m):(0,M.jsxs)("p",{"data-testid":"withheld","data-withheld":c.refusal.wouldNeed.join(",")||"nobody",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,M.jsx)("s",{children:u.label})," \u2014 ",c.refusal.message]},m)})}),o&&l?(0,M.jsx)(ye,{store:e,mutation:o,prefilled:{...l.args},only:l.missing??[],label:l.label,onDone:()=>{let u=a;i(null),requestAnimationFrame(()=>{let m=u===null?null:s.current[u];if(m?.isConnected){m.focus();return}let g=document.querySelector("[data-graview-page-title]")??document.querySelector("main h1, main h2");g&&(g.hasAttribute("tabindex")||(g.tabIndex=-1),g.focus())})},...n?{principal:n}:{}}):null,l&&!o&&(l.missing??[]).length>0?(0,M.jsxs)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:"0.875rem"},children:["\u201C",l.label,"\u201D names ",l.mutation,", which this app does not declare."]}):null,r?(0,M.jsx)("p",{"data-testid":"refused",role:"alert",style:{margin:0,color:"var(--graview-warn)",fontSize:"0.875rem"},children:r}):null]})}var w=O(z(),1),er=[];function Bt({context:e}){let{store:t,brand:n,principal:a,invariantContext:i}=e;V(t);let r=oe()!==null,d=ke(),s=decodeURIComponent(d.id??""),l=ea(t,s,{...a?{principal:a}:{},...i?{context:i}:{}}),o=Qe(t,l?.violations??er),[u,m]=(0,pt.useState)(null),g=(0,pt.useRef)(null);if(!l)return(0,w.jsx)(U,{context:e,children:(0,w.jsx)(Y,{context:e,children:"Nothing lives at this address."})});let c=t.graph.getNode(s),y=t.schema.tryDefinition(l.kind),P=y?.describe&&c?Qt(y,c):null,F=[...t.log.all()].filter(f=>!on(f)&&(f.writes.includes(s)||f.reads.includes(s))).slice(-8).reverse(),C=l.actions.affordances.filter(f=>f.provider!=="invariant"),K=e.views?.lookup(l.kind,{cardinality:"one",fidelity:"full"}),ue=K!==void 0&&!Ee(K)?K:void 0,X=ue&&c?Xe(K,c,t.graph):void 0,we=X?l.fields.filter(f=>!X.fields.has(f.key)):l.fields,N=X?l.links.flatMap(f=>{let L=f.targets.filter(Z=>!X.records.has(Z.id));return L.length>0?[{...f,targets:L}]:[]}):l.links,ne=ue!==void 0&&xn(K);return(0,w.jsxs)(U,{context:e,children:[(0,w.jsxs)("header",{style:{display:"grid",gap:12},children:[(0,w.jsxs)("p",{style:{...se,display:"flex",alignItems:"center",gap:8},children:[(0,w.jsx)(ee,{kind:l.kind,brand:n,schema:t.schema,size:8}),(0,w.jsx)(A,{to:`/${G(t.schema,l.kind)}`,style:J,children:I(t,l.kind)})]}),(0,w.jsx)(Y,{context:e,children:r&&c?.label===l.label?(0,w.jsx)(bt,{nodeId:s,field:"label",value:l.label}):l.label}),P&&P!==l.label?(0,w.jsx)("p",{style:_,children:P}):null,(0,w.jsx)(Ze,{context:e,stop:`#focus=${encodeURIComponent(s)}`,style:{...$,...k},"data-testid":"spatial-link"}),ce(e).some(f=>f.kind===l.kind||f.across===l.kind)?(0,w.jsxs)("p",{style:{...k,margin:0},"data-testid":"seen-in",children:["Seen in:"," ",ce(e).filter(f=>f.kind===l.kind||f.across===l.kind).map((f,L)=>(0,w.jsxs)("span",{children:[L>0?" \xB7 ":null,(0,w.jsx)(A,{to:ge(e,f),style:$,children:f.title})," ",(0,w.jsx)(Ze,{context:e,stop:`#view=${encodeURIComponent(f.as)}`,style:{...$,...k,display:"inline-block",minWidth:24,textAlign:"center"},title:`${f.title}, in the scene`,children:"\u2197"})]},Ae(f)))]}):null]}),ue&&c?(0,w.jsx)("section",{"data-testid":"record-view",style:{display:"grid",minWidth:0},children:(0,w.jsx)(Wn,{children:(0,w.jsx)(ue,{node:c,cardinality:"one",fidelity:"full",mode:"fullscreen",selected:!1,...l.violations.length>0?{flagged:[s]}:{}})})}):null,l.violations.length>0?(0,w.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:o.map((f,L)=>(0,w.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,w.jsx)(lt,{violation:f,schema:t.schema,...n?{brand:n}:{}}),(0,w.jsx)(dt,{store:t,repairs:ta(l.actions,f.repairs),...a?{principal:a}:{}})]},L))}):null,!ne&&we.length>0?(0,w.jsxs)("section",{style:{...j,display:"grid",gap:14},"data-testid":"record-fields",children:[(0,w.jsx)("h2",{style:D,children:"The facts"}),nn(y,we).map((f,L)=>{let Z=(0,w.jsx)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"14px 24px"},children:f.fields.map(B=>B.long?(0,w.jsx)(On,{nodeId:s,field:B.key,label:B.label,value:B.value,style:{gridColumn:"1 / -1",gap:4},labelStyle:{...se,fontSize:"0.75rem"},valueStyle:{fontSize:"1.0625rem",lineHeight:1.6}},B.key):(0,w.jsxs)("div",{style:{display:"grid",gap:2,minWidth:0,alignContent:"start"},children:[(0,w.jsx)("dt",{style:{...se,fontSize:"0.75rem"},children:B.label}),(0,w.jsx)("dd",{style:{margin:0,fontSize:"1.125rem",overflowWrap:"anywhere",minWidth:0},children:r?(0,w.jsx)(bt,{nodeId:s,field:B.key,value:B.value,stored:B.stored}):B.value})]},B.key))});return f.title?(0,w.jsxs)("section",{style:{display:"grid",gap:10,minWidth:0},children:[(0,w.jsx)("h3",{"data-graview-field-group":f.title,style:{...D,fontSize:"1.0625rem"},children:f.title}),Z]},L):(0,w.jsx)("div",{children:Z},L)})]}):null,(ne?[]:N).map(f=>(0,w.jsxs)("section",{style:{...j,display:"grid",gap:10},children:[(0,w.jsx)("p",{style:se,children:Un(t,f)}),f.description?(0,w.jsx)("h2",{style:D,children:le(f.description)}):(0,w.jsxs)("h2",{style:D,"aria-label":re(f.edgeKind),children:[f.direction==="in"?"\u2190 ":"\u2192 ",re(f.edgeKind)]}),(0,w.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexWrap:"wrap",gap:"6px 18px"},children:f.targets.map(L=>(0,w.jsxs)("li",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,w.jsx)(ee,{kind:L.kind,brand:n,schema:t.schema,size:7}),(0,w.jsxs)(A,{to:q(t.schema,L.kind,L.id),style:{...$,fontSize:"1.125rem"},children:[L.label,L.apart?(0,w.jsxs)("span",{style:k,children:[" \xB7 ",L.apart]}):null]})]},L.id))}),(f.direction==="out"&&t.schema.edge(f.edgeKind)?.cardinality==="one"?[]:[...new Set(f.targets.map(L=>L.kind))]).map(L=>(0,w.jsxs)(A,{to:`/${G(t.schema,L)}?${encodeURIComponent(f.edgeKind)}=${encodeURIComponent(s)}`,style:{...$,...k},"data-testid":"related-all",children:["Sort and filter ",f.description??`these ${I(t,L).toLowerCase()}`,f.targets.some(Z=>Z.kind!==L)?` (${I(t,L).toLowerCase()})`:""," \u2192"]},L))]},`${f.edgeKind}|${f.direction}|${f.description??""}`)),!ne&&(C.length>0||l.actions.withheld.length>0)?(0,w.jsxs)("section",{style:{...j,display:"grid",gap:14},"data-testid":"record-actions",children:[(0,w.jsx)("h2",{style:D,ref:g,tabIndex:-1,children:"What can be done"}),(0,w.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:C.map(f=>{let L=u===f.id;return(0,w.jsx)("button",{type:"button","data-affordance":f.id,"data-rank":f.rank,"aria-expanded":L,onClick:()=>m(L?null:f.id),style:{...et,...L?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},children:f.label},f.id)})}),C.map(f=>{if(u!==f.id)return null;let L=t.allMutations().find(Z=>Z.name===f.mutation);return L?(0,w.jsxs)("div",{style:{display:"grid",gap:10,padding:18,border:"1px solid var(--graview-edge)",borderRadius:"var(--graview-radius, 12px)",background:"var(--graview-panel)"},children:[(0,w.jsx)("h3",{style:{...D,fontSize:"1.1875rem"},children:f.label}),L.description?(0,w.jsx)("p",{style:{...k,margin:0},children:L.description}):null,(0,w.jsx)(ye,{store:t,mutation:L,prefilled:f.args,open:f.open,label:f.label,onDone:()=>{m(null);let Z=f.id;requestAnimationFrame(()=>{(g.current?.parentElement?.querySelector(`[data-affordance="${Z.replace(/["\\]/g,"\\$&")}"]`)??g.current)?.focus()})},...a?{principal:a}:{}})]},f.id):null}),l.actions.withheld.length>0?(0,w.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:4},children:l.actions.withheld.map(f=>(0,w.jsxs)("li",{style:k,children:[(0,w.jsx)("s",{children:f.label})," \u2014 ",f.refusal.message]},f.id))}):null]}):null,F.length>0?(0,w.jsxs)("section",{style:{...j,display:"grid",gap:10},"data-testid":"record-history",children:[(0,w.jsx)("h2",{style:D,children:"What has happened"}),(0,w.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"grid",gap:6},children:F.map(f=>(0,w.jsxs)("li",{style:k,children:[(0,w.jsx)("span",{style:{color:"var(--graview-ink)"},children:f.intent})," \u2014 ",tt(f,a,{graph:t.graph,schema:t.schema,...e.seats?{seats:e.seats}:{},...e.people?{people:e.people}:{}})]},f.id))})]}):null]})}var v=O(z(),1),tr=(0,W.lazy)(()=>import("./chunk.TWFYXD3P.js").then(e=>({default:e.DraftPage})));function nr({context:e,children:t}){let n=he(),a=e.store.schema,i=(0,W.useMemo)(()=>({href:r=>q(a,r.kind,r.id),go:r=>n(q(a,r.kind,r.id))}),[a,n]);return(0,v.jsx)(Nn.Provider,{value:i,children:(0,v.jsx)(Dn.Provider,{value:(e.titleLevel??(e.framed&&!e.barAbove?1:2))-1,children:t})})}function ar({steering:e}){let t=de(),n=he(),a=`${t.pathname}${t.search}`;return(0,W.useLayoutEffect)(()=>e.at(a),[a,e]),(0,W.useLayoutEffect)(()=>{let i=d=>{d!==a&&n(d)};e.go.current=i;let r=e.pending?.current;return r!==void 0&&(e.pending.current=void 0,i(r)),()=>{e.go.current===i&&(e.go.current=void 0)}},[a,n,e]),null}function rr({context:e,to:t}){let{pathname:n}=de(),a=oe(),i=(t??a)?.sayWhere,r=ir(e,n);return(0,W.useEffect)(()=>(i?.(r),()=>i?.(null)),[i,r]),null}function ir(e,t){let[n="",a,i]=t.split("/").filter(Boolean).map(d=>{try{return decodeURIComponent(d)}catch{return d}});if(i!==void 0)return"#";if(n==="places"&&a!==void 0){if(a===wt)return"#overview=1";let d=e.views?.places().find(s=>s.as===a);return d?`#focus=${encodeURIComponent(Ie(d.kind))}&view=${encodeURIComponent(d.as)}`:"#"}let r=fe(e.store.schema,n);return r?`#focus=${encodeURIComponent(a??Ie(r))}`:"#"}function or({onNavigate:e,path:t}){let n=de(),a=Pt(),i=he(),r=`${n.pathname}${n.search}`,d=(0,W.useRef)(e);d.current=e;let s=(0,W.useRef)(null);(0,W.useEffect)(()=>{let o=s.current;s.current=r,o!==null&&(r===o&&a!=="PUSH"||d.current?.(r,a==="POP"?"pop":a==="REPLACE"?"replace":"push"))},[n.key]);let l=(0,W.useRef)(t);return(0,W.useEffect)(()=>{t===void 0||t===l.current||(l.current=t,t!==r&&i(t))},[t]),null}function ka({context:e,registry:t,page:n}){let a=ke(),i=fe(e.store.schema,a.slug??""),r=n==="list"?Ht:Bt,s=(i?t?.lookup(i,n):void 0)??r;return(0,v.jsx)(s,{context:e})}function sr({context:e,registry:t,children:n}){let a=(0,W.useRef)(null);return Pn(a),(0,v.jsx)("div",{ref:a,"data-graview-face":"pages",style:{display:"contents"},children:(0,v.jsx)(ca,{context:e,registry:t,root:a,children:n})})}function lr(){let{pathname:e}=de(),t=Pt(),n=(0,W.useRef)(null);(0,W.useLayoutEffect)(()=>{if(t!=="POP"){for(let r=n.current?.parentElement;r;r=r.parentElement){let{overflowY:d}=getComputedStyle(r);if((d==="auto"||d==="scroll")&&r.scrollHeight>r.clientHeight){r.scrollTop=0;return}}window.scrollTo(0,0)}},[e]);let a=(0,W.useRef)(e),i=(0,W.useRef)(!1);return(0,W.useEffect)(()=>{if(!i.current&&e===a.current)return;i.current=!0;let r=document.activeElement;if(r!==null&&r!==document.body&&r!==document.documentElement)return;let d=n.current?.closest("main")??document.querySelector("main"),l=n.current?.closest("[data-graview-face]")?.querySelector("[data-graview-page-title]")??d?.querySelector("h1, h2")??null??d??null;l&&(l.hasAttribute("tabindex")||l.setAttribute("tabindex","-1"),l.focus({preventScroll:!0}))},[e]),(0,v.jsx)("span",{ref:n,hidden:!0,"data-graview-scroll-reset":""})}function dr({context:e,children:t}){let n=he(),a=(0,W.useMemo)(()=>({record:i=>{let r=e.store.graph.getNode(i);r&&n(q(e.store.schema,r.kind,i))},place:i=>{let r=e.views?.places().find(d=>d.as===i);r&&n(ge(e,r))}}),[e,n]);return(0,v.jsx)(bn.Provider,{value:a,children:t})}function pr({context:e,Home:t}){let i=de().key==="default"?yn(e.views?.arrangement?.()?.first,e.store.schema,e.views?.places()??[]):void 0,r=i?.to==="place"?ge(e,i.place):i?.to==="kind"?`/${G(e.store.schema,i.kind)}`:void 0;return r?(0,v.jsx)(Ct,{to:r,replace:!0}):(0,v.jsx)(t,{context:e})}function Sa({context:e,registry:t}){let n=t?.lookupSurface("shell"),a=n!==void 0,i=a&&(t?.without().has("bar")??!1),r=a&&!i&&!e.embedded?{...e,barAbove:!0}:e,d=y=>n===void 0?(0,v.jsx)(rt,{context:e,children:y}):i?(0,v.jsx)(n,{context:e,children:y}):(0,v.jsx)(rt,{context:e,children:(0,v.jsx)(n,{context:r,children:y})}),s=t?.lookupSurface("home")??It,l=t?.lookupSurface("problems")??zt,o=a?{...r,framed:!0}:e,[u,m]=(0,W.useState)(null),g=(0,W.useMemo)(()=>({onFind:m,find:!(t?.without().has("find")??!1),places:!(t?.without().has("places")??!1)}),[t]),c=(0,v.jsx)(sr,{context:e,registry:t,children:(0,v.jsx)(dr,{context:e,children:d((0,v.jsx)(v.Fragment,{children:(0,v.jsxs)(nr,{context:o,children:[(0,v.jsx)(lr,{}),(0,v.jsxs)(Jn,{children:[(t?.routes()??[]).map(({path:y,component:P})=>(0,v.jsx)(pe,{path:y,element:(0,v.jsx)(P,{context:o})},y)),(0,v.jsx)(pe,{path:"/",element:(0,v.jsx)(pr,{context:o,Home:s})}),(0,v.jsx)(pe,{path:"/problems",element:(0,v.jsx)(l,{context:o})}),(0,v.jsx)(pe,{path:"/~draft",element:(0,v.jsx)(W.Suspense,{fallback:null,children:(0,v.jsx)(tr,{context:o})})}),(0,v.jsx)(pe,{path:"/search",element:(0,v.jsx)(Kt,{context:o})}),(0,v.jsx)(pe,{path:"/map",element:(0,v.jsx)(Dt,{context:o})}),(0,v.jsx)(pe,{path:"/places",element:(0,v.jsx)(Wt,{context:o})}),ce(o).some(y=>y.as===wt)?null:(0,v.jsx)(pe,{path:mn,element:(0,v.jsx)(Ct,{to:"/",replace:!0})}),(0,v.jsx)(pe,{path:"/places/:as",element:(0,v.jsx)(Nt,{context:o})}),(0,v.jsx)(pe,{path:"/:slug",element:(0,v.jsx)(ka,{context:o,registry:t,page:"list"})}),(0,v.jsx)(pe,{path:"/:slug/:id",element:(0,v.jsx)(ka,{context:o,registry:t,page:"record"})})]})]})}))})});return e.embedded||!a||i?c:(0,v.jsx)(Zn.Provider,{value:g,children:(0,v.jsx)(Ln.Provider,{value:u,children:c})})}function cr({context:e,registry:t,basename:n,initialPath:a,onNavigate:i,path:r,steering:d}){(0,W.useState)(()=>e.views?Kn(e.views,e.store.schema,Mn(e.brand,e.store.schema)):void 0);let s=oe(),l=e.store.seenBy(e.principal??{kind:"human"}),o=l===e.store?e:{...e,store:l};kn(e.store,e.principal);let u=(0,v.jsxs)(v.Fragment,{children:[i||r!==void 0?(0,v.jsx)(or,{onNavigate:i,path:r}):null,d?(0,v.jsx)(ar,{steering:d}):null,o.presence||s?(0,v.jsx)(rr,{context:o,to:s}):null,(0,v.jsx)(Sa,{context:o,...t?{registry:t}:{}})]}),m=o.views?(0,v.jsxs)(Sn,{store:o.store,views:o.views,...o.principal?{principal:o.principal}:{},...o.brand?{brand:o.brand}:{},...o.settings?{settings:o.settings}:{},...o.presence&&!s?{presence:o.presence}:{},...o.people?{people:o.people}:{},...o.onKeepLens?{onKeepLens:o.onKeepLens}:{},...o.ai?{ai:o.ai}:{},...o.app?{app:o.app}:{},children:[u,(0,v.jsx)(la,{context:o})]}):u;if(a!==void 0){let g=n===void 0?a:`${n.replace(/\/$/,"")}${a}`;return(0,v.jsx)(Yn,{initialEntries:[g],...n===void 0?{}:{basename:n},children:m})}return(0,v.jsx)(Qn,{...n===void 0?{}:{basename:n},children:m})}export{Oa as a,cr as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as pt,c as oe,d as yt}from"./chunk.EQOU4POV.js";import{a as Sr}from"./chunk.IKT7JQUW.js";import{c as it,f as st,g as ut,j as ct,k as dt,l as ft,n as ht,o as mt}from"./chunk.6CLHFNDM.js";import{a as lt}from"./chunk.SCLIBKLS.js";import{da as ot}from"./chunk.4JSMCNF7.js";import{L as Se,La as Ze,Ma as qe,Mb as rt,Na as et,Nb as at,Ob as nt,P as ne,U as Xe,W as Qe,lb as tt}from"./chunk.Y235YZSZ.js";import{a as O,b as G}from"./chunk.MRK6QJV5.js";import{b as D}from"./chunk.AJZBJBMO.js";function Er(e,t){return Ze(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Er(e,r)===t)}function hn(e,t,r){return qe(e,t,r)}function mn(e,t){return et(e,t)}var A=D(O(),1),g=D(O(),1),b=D(O(),1),je=D(O(),1),Zt=D(O(),1),E=D(O(),1),Wa=D(O(),1),Va=D(O(),1),Ya=D(O(),1),v=D(O(),1),cr=D(O(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pt=/^[\\/]{2}/;function br(e,t){return t+e.replace(/\\/g,"/")}var gt="popstate";function ce(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ct(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=de(n?u().pathname:"/",f,y,m,h);return N(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:U(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?z(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=ce(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=ce(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function Lt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return de("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:U(n)}return Pr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xr(){return Math.random().toString(36).substring(2,10)}function vt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function de(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?z(t):t,state:r,key:t&&t.key||a||xr(),mask:n}}function U({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function z(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Pr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c()+1;let w=vt(R,u),x=m.createHref(R.mask||R);try{i.pushState(w,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(x)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c();let w=vt(R,u),x=m.createHref(R.mask||R);i.replaceState(w,"",x),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Cr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(gt,d),s=h,()=>{n.removeEventListener(gt,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Cr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:U(t);return n=n.replace(/ $/,"%20"),!r&&Pt.test(n)&&(n=a+n),new URL(n,a)}var Lr;Lr=new WeakMap;function Te(e,t,r="/"){return Dr(e,t,r,!1)}function Dr(e,t,r,a,n){let o=typeof t=="string"?z(t):t,i=H(o.pathname||"/",r);if(i==null)return null;let l=n??kr(e),s=null,u=jr(i);for(let c=0;s==null&&c<l.length;++c)s=Ur(l[c],u,a);return s}function Fr(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function kr(e){let t=Dt(e);return Tr(t),t}function Dt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;P(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=$([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Dt(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Ir(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Tt(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Ft(i.path))o(i,l,!0,s)}),t}function Ft(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Ft(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Tr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Nr=/^:[\w-]+$/,Mr=3,Or=2,Ar=1,_r=10,$r=-2,Rt=e=>e==="*";function Ir(e,t){let r=e.split("/"),a=r.length;return r.some(Rt)&&(a+=$r),t&&(a+=Or),r.filter(n=>!Rt(n)).reduce((n,o)=>n+(Nr.test(o)?Mr:o===""?Ar:_r),a)}function Hr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Ur(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},p=s.matcher&&s.compiledParams?kt(d,c,s.matcher,s.compiledParams):te(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=te({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:$([o,p.pathname]),pathnameBase:Br($([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=$([o,p.pathnameBase]))}return i}function te(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Tt(e.path,e.caseSensitive,e.end);return kt(e,t,r,a)}function kt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=X(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=X(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Tt(e,t=!1,r=!0){N(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function jr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return N(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Nt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?z(e):e,o;return r?(r=Mt(r),r.startsWith("/")||r.startsWith("\\")?o=wt(r.substring(1),"/"):o=wt(r,t)):o=t,{pathname:o,search:Wr(a),hash:Vr(n)}}function wt(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function be(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function me(e,t,r,a=!1){let n;typeof e=="string"?n=z(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),be("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),be("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),be("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=Nt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Mt=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>Mt(e.join("/"));function X(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var Br=e=>X(e).replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Ot=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var _t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(e,t){let r=e;if(typeof r!="string"||!ke.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(_t)try{let o=new URL(window.location.href),i=Pt.test(r)?new URL(br(r,o.protocol)):new URL(r),l=H(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{N(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var yn=Symbol("Uninstrumented");var gn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var St=new URL("http://localhost");function Me(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),St)}catch{return St}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Jr(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Oe(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!xe(n,r),l=!xe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!Jr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var It=["POST","PUT","PATCH","DELETE"],vn=new Set(It),Kr=["GET",...It],Rn=new Set(Kr);var wn=Symbol("ResetLoaderData"),Gr,Xr,Qr,Zr;Gr=new WeakMap;Xr=new WeakMap;Qr=new WeakMap;Zr=new WeakMap;var qr=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ea(e){try{return qr.includes(new URL(e).protocol)}catch{return!1}}var W=A.createContext(null);W.displayName="DataRouter";var Q=A.createContext(null);Q.displayName="DataRouterState";var Ht=A.createContext(!1);function ta(){return A.useContext(Ht)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Ut=A.createContext(new Map);Ut.displayName="Fetchers";var ra=A.createContext(null);ra.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var V=A.createContext(null);V.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,jt="REACT_ROUTER_ERROR",aa="REDIRECT",na="ROUTE_ERROR_RESPONSE";function oa(e){if(e.startsWith(`${jt}:${aa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ia(e){if(e.startsWith(`${jt}:${na}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ot(t.status,t.statusText,t.data)}catch{}}function pe(e,{relative:t}={}){P(Y(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(T),{hash:n,pathname:o,search:i}=Z(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:$([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Y(){return g.useContext(V)!=null}function k(){return P(Y(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(V).location}function la(){return g.useContext(V).navigationType}var zt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bt(e){g.useContext(T).static||g.useLayoutEffect(e)}function J(){let{isDataRoute:e}=g.useContext(_);return e?va():sa()}function sa(){P(Y(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(W),{basename:t,navigator:r}=g.useContext(T),{matches:a}=g.useContext(_),{pathname:n}=k(),o=JSON.stringify(Ne(a)),i=g.useRef(!1);return Bt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,zt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=me(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$([t,c.pathname])),Oe(typeof s=="string"?s:U(s),r.createHref(c),Me(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Sn=g.createContext(null);function ua(){let{matches:e}=g.useContext(_);return e[e.length-1]?.params??{}}function Z(e,{relative:t}={}){let{matches:r}=g.useContext(_),{pathname:a}=k(),n=JSON.stringify(Ne(r));return g.useMemo(()=>me(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Wt(e,t){return Vt(e,t)}function Vt(e,t,r){P(Y(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(T),{matches:n}=g.useContext(_),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Le){let h=u&&u.path||"";Gt(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
1
|
+
import{b as pt,c as oe,d as yt}from"./chunk.RGXNZ7PN.js";import{a as Sr}from"./chunk.IKT7JQUW.js";import{c as it,f as st,g as ut,j as ct,k as dt,l as ft,n as ht,o as mt}from"./chunk.AKOC43TV.js";import{a as lt}from"./chunk.HAQ4KHRY.js";import{da as ot}from"./chunk.2VX6H2LL.js";import{L as Se,Oa as Ze,P as ne,Pa as qe,Pb as rt,Qa as et,Qb as at,Rb as nt,U as Xe,W as Qe,ob as tt}from"./chunk.ZQ4HFIIS.js";import{a as O,b as G}from"./chunk.MRK6QJV5.js";import{b as D}from"./chunk.AJZBJBMO.js";function Er(e,t){return Ze(e,t).slice(1)}function Ee(e,t){return e.kinds.find(r=>Er(e,r)===t)}function hn(e,t,r){return qe(e,t,r)}function mn(e,t){return et(e,t)}var A=D(O(),1),g=D(O(),1),b=D(O(),1),je=D(O(),1),Zt=D(O(),1),E=D(O(),1),Wa=D(O(),1),Va=D(O(),1),Ya=D(O(),1),v=D(O(),1),cr=D(O(),1);var ke=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Pt=/^[\\/]{2}/;function br(e,t){return t+e.replace(/\\/g,"/")}var gt="popstate";function ce(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Ct(e={}){let{initialEntries:t=["/"],initialIndex:r,v5Compat:a=!1}=e,n;n=t.map((f,y)=>c(f,typeof f=="string"?null:f.state,y===0?"default":void 0,typeof f=="string"?void 0:f.mask));let o=s(r??n.length-1),i="POP",l=null;function s(f){return Math.min(Math.max(f,0),n.length-1)}function u(){return n[o]}function c(f,y=null,m,h){let S=de(n?u().pathname:"/",f,y,m,h);return N(S.pathname.charAt(0)==="/",`relative pathnames are not supported in memory history: ${JSON.stringify(f)}`),S}function d(f){return typeof f=="string"?f:U(f)}return{get index(){return o},get action(){return i},get location(){return u()},createHref:d,createURL(f){return new URL(d(f),"http://localhost")},encodeLocation(f){let y=typeof f=="string"?z(f):f;return{pathname:y.pathname||"",search:y.search||"",hash:y.hash||""}},push(f,y){i="PUSH";let m=ce(f)?f:c(f,y);o+=1,n.splice(o,n.length,m),a&&l&&l({action:i,location:m,delta:1})},replace(f,y){i="REPLACE";let m=ce(f)?f:c(f,y);n[o]=m,a&&l&&l({action:i,location:m,delta:0})},go(f){i="POP";let y=s(o+f),m=n[y];o=y,l&&l({action:i,location:m,delta:f})},listen(f){return l=f,()=>{l=null}}}}function Lt(e={}){function t(a,n){let o=n.state?.masked,{pathname:i,search:l,hash:s}=o||a.location;return de("",{pathname:i,search:l,hash:s},n.state&&n.state.usr||null,n.state&&n.state.key||"default",o?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,n){return typeof n=="string"?n:U(n)}return Pr(t,r,null,e)}function P(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function N(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xr(){return Math.random().toString(36).substring(2,10)}function vt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function de(e,t,r=null,a,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?z(t):t,state:r,key:t&&t.key||a||xr(),mask:n}}function U({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function z(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function Pr(e,t,r,a={}){let{window:n=document.defaultView,v5Compat:o=!1}=a,i=n.history,l="POP",s=null,u=c();u==null&&(u=0,i.replaceState({...i.state,idx:u},""));function c(){return(i.state||{idx:null}).idx}function d(){l="POP";let h=c(),S=h==null?null:h-u;u=h,s&&s({action:l,location:m.location,delta:S})}function p(h,S){l="PUSH";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c()+1;let w=vt(R,u),x=m.createHref(R.mask||R);try{i.pushState(w,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;n.location.assign(x)}o&&s&&s({action:l,location:m.location,delta:1})}function f(h,S){l="REPLACE";let R=ce(h)?h:de(m.location,h,S);r&&r(R,h),u=c();let w=vt(R,u),x=m.createHref(R.mask||R);i.replaceState(w,"",x),o&&s&&s({action:l,location:m.location,delta:0})}function y(h){return Cr(n,h)}let m={get action(){return l},get location(){return e(n,i)},listen(h){if(s)throw new Error("A history only accepts one active listener");return n.addEventListener(gt,d),s=h,()=>{n.removeEventListener(gt,d),s=null}},createHref(h){return t(n,h)},createURL:y,encodeLocation(h){let S=y(h);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:f,go(h){return i.go(h)}};return m}function Cr(e,t,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),P(a,"No window.location.(origin|href) available to create URL");let n=typeof t=="string"?t:U(t);return n=n.replace(/ $/,"%20"),!r&&Pt.test(n)&&(n=a+n),new URL(n,a)}var Lr;Lr=new WeakMap;function Te(e,t,r="/"){return Dr(e,t,r,!1)}function Dr(e,t,r,a,n){let o=typeof t=="string"?z(t):t,i=H(o.pathname||"/",r);if(i==null)return null;let l=n??kr(e),s=null,u=jr(i);for(let c=0;s==null&&c<l.length;++c)s=Ur(l[c],u,a);return s}function Fr(e,t){let{route:r,pathname:a,params:n}=e;return{id:r.id,pathname:a,params:n,data:t[r.id],loaderData:t[r.id],handle:r.handle}}function kr(e){let t=Dt(e);return Tr(t),t}function Dt(e,t=[],r=[],a="",n=!1){let o=(i,l,s=n,u)=>{let c={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};if(c.relativePath.startsWith("/")){if(!c.relativePath.startsWith(a)&&s)return;P(c.relativePath.startsWith(a),`Absolute route path "${c.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(a.length)}let d=$([a,c.relativePath]),p=r.concat(c);i.children&&i.children.length>0&&(P(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),Dt(i.children,t,p,d,s)),!(i.path==null&&!i.index)&&t.push({path:d,score:Ir(d,i.index),routesMeta:p.map((f,y)=>{let[m,h]=Tt(f.relativePath,f.caseSensitive,y===p.length-1);return{...f,matcher:m,compiledParams:h}})})};return e.forEach((i,l)=>{if(i.path===""||!i.path?.includes("?"))o(i,l);else for(let s of Ft(i.path))o(i,l,!0,s)}),t}function Ft(e){let t=e.split("/");if(t.length===0)return[];let[r,...a]=t,n=r.endsWith("?"),o=r.replace(/\?$/,"");if(a.length===0)return n?[o,""]:[o];let i=Ft(a.join("/")),l=[];return l.push(...i.map(s=>s===""?o:[o,s].join("/"))),n&&l.push(...i),l.map(s=>e.startsWith("/")&&s===""?"/":s)}function Tr(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Hr(t.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Nr=/^:[\w-]+$/,Mr=3,Or=2,Ar=1,_r=10,$r=-2,Rt=e=>e==="*";function Ir(e,t){let r=e.split("/"),a=r.length;return r.some(Rt)&&(a+=$r),t&&(a+=Or),r.filter(n=>!Rt(n)).reduce((n,o)=>n+(Nr.test(o)?Mr:o===""?Ar:_r),a)}function Hr(e,t){return e.length===t.length&&e.slice(0,-1).every((a,n)=>a===t[n])?e[e.length-1]-t[t.length-1]:0}function Ur(e,t,r=!1){let{routesMeta:a}=e,n={},o="/",i=[];for(let l=0;l<a.length;++l){let s=a[l],u=l===a.length-1,c=o==="/"?t:t.slice(o.length)||"/",d={path:s.relativePath,caseSensitive:s.caseSensitive,end:u},p=s.matcher&&s.compiledParams?kt(d,c,s.matcher,s.compiledParams):te(d,c),f=s.route;if(!p&&u&&r&&!a[a.length-1].route.index&&(p=te({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},c)),!p)return null;Object.assign(n,p.params),i.push({params:n,pathname:$([o,p.pathname]),pathnameBase:Br($([o,p.pathnameBase])),route:f}),p.pathnameBase!=="/"&&(o=$([o,p.pathnameBase]))}return i}function te(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=Tt(e.path,e.caseSensitive,e.end);return kt(e,t,r,a)}function kt(e,t,r,a){let n=t.match(r);if(!n)return null;let o=n[0],i=X(o,1),l=n.slice(1);return{params:a.reduce((u,{paramName:c,isOptional:d},p)=>{if(c==="*"){let y=l[p]||"";i=X(o.slice(0,o.length-y.length),1)}let f=l[p];return d&&!f?u[c]=void 0:u[c]=(f||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:i,pattern:e}}function Tt(e,t=!1,r=!0){N(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],n="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,l,s,u,c)=>{if(a.push({paramName:l,isOptional:s!=null}),s){let d=c.charAt(u+i.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),n+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?n+="\\/*$":e!==""&&e!=="/"&&(n+="(?:(?=\\/|$))"),[new RegExp(n,t?void 0:"i"),a]}function jr(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return N(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function H(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}function Nt(e,t="/"){let{pathname:r,search:a="",hash:n=""}=typeof e=="string"?z(e):e,o;return r?(r=Mt(r),r.startsWith("/")||r.startsWith("\\")?o=wt(r.substring(1),"/"):o=wt(r,t)):o=t,{pathname:o,search:Wr(a),hash:Vr(n)}}function wt(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}function be(e,t,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function zr(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Ne(e){let t=zr(e);return t.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase)}function me(e,t,r,a=!1){let n;typeof e=="string"?n=z(e):(n={...e},P(!n.pathname||!n.pathname.includes("?"),be("?","pathname","search",n)),P(!n.pathname||!n.pathname.includes("#"),be("#","pathname","hash",n)),P(!n.search||!n.search.includes("#"),be("#","search","hash",n)));let o=e===""||n.pathname==="",i=o?"/":n.pathname,l;if(i==null)l=r;else{let d=t.length-1;if(!a&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),d-=1;n.pathname=p.join("/")}l=d>=0?t[d]:"/"}let s=Nt(n,l),u=i&&i!=="/"&&i.endsWith("/"),c=(o||i===".")&&r.endsWith("/");return!s.pathname.endsWith("/")&&(u||c)&&(s.pathname+="/"),s}var Mt=e=>e.replace(/[\\/]{2,}/g,"/"),$=e=>Mt(e.join("/"));function X(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}var Br=e=>X(e).replace(/^\/*/,"/"),Wr=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Vr=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;var Ot=class{constructor(e,t,r,a=!1){this.status=e,this.statusText=t||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function At(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Yr(e){let t=e.map(r=>r.route.path).filter(Boolean);return $(t)||"/"}var _t=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(e,t){let r=e;if(typeof r!="string"||!ke.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,n=!1;if(_t)try{let o=new URL(window.location.href),i=Pt.test(r)?new URL(br(r,o.protocol)):new URL(r),l=H(i.pathname,t);i.origin===o.origin&&l!=null?r=l+i.search+i.hash:n=!0}catch{N(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:n,to:r}}var yn=Symbol("Uninstrumented");var gn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var St=new URL("http://localhost");function Me(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),St)}catch{return St}}function xe(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}function Jr(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}function Oe(e,t,r,a){let n=null;try{n=e==null?null:new URL(e,r)}catch{}let o=new URL(t,r),i=n!=null&&!xe(n,r),l=!xe(o,r);if(a==="reject"){if(i||l)throw new Error("External navigation is not allowed")}else if(l&&(n==null||!Jr(e,n)||!xe(n,o)))throw new Error("External navigation is not allowed")}var It=["POST","PUT","PATCH","DELETE"],vn=new Set(It),Kr=["GET",...It],Rn=new Set(Kr);var wn=Symbol("ResetLoaderData"),Gr,Xr,Qr,Zr;Gr=new WeakMap;Xr=new WeakMap;Qr=new WeakMap;Zr=new WeakMap;var qr=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ea(e){try{return qr.includes(new URL(e).protocol)}catch{return!1}}var W=A.createContext(null);W.displayName="DataRouter";var Q=A.createContext(null);Q.displayName="DataRouterState";var Ht=A.createContext(!1);function ta(){return A.useContext(Ht)}var Ae=A.createContext({isTransitioning:!1});Ae.displayName="ViewTransition";var Ut=A.createContext(new Map);Ut.displayName="Fetchers";var ra=A.createContext(null);ra.displayName="Await";var T=A.createContext(null);T.displayName="Navigation";var V=A.createContext(null);V.displayName="Location";var _=A.createContext({outlet:null,matches:[],isDataRoute:!1});_.displayName="Route";var _e=A.createContext(null);_e.displayName="RouteError";var Le=!0,jt="REACT_ROUTER_ERROR",aa="REDIRECT",na="ROUTE_ERROR_RESPONSE";function oa(e){if(e.startsWith(`${jt}:${aa}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function ia(e){if(e.startsWith(`${jt}:${na}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ot(t.status,t.statusText,t.data)}catch{}}function pe(e,{relative:t}={}){P(Y(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=g.useContext(T),{hash:n,pathname:o,search:i}=Z(e,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:$([r,o])),a.createHref({pathname:l,search:i,hash:n})}function Y(){return g.useContext(V)!=null}function k(){return P(Y(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(V).location}function la(){return g.useContext(V).navigationType}var zt="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Bt(e){g.useContext(T).static||g.useLayoutEffect(e)}function J(){let{isDataRoute:e}=g.useContext(_);return e?va():sa()}function sa(){P(Y(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(W),{basename:t,navigator:r}=g.useContext(T),{matches:a}=g.useContext(_),{pathname:n}=k(),o=JSON.stringify(Ne(a)),i=g.useRef(!1);return Bt(()=>{i.current=!0}),g.useCallback((s,u={})=>{if(N(i.current,zt),!i.current)return;if(typeof s=="number"){r.go(s);return}let c=me(s,JSON.parse(o),n,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$([t,c.pathname])),Oe(typeof s=="string"?s:U(s),r.createHref(c),Me(r),"reject"),(u.replace?r.replace:r.push)(c,u.state,u)},[t,r,o,n,e])}var Sn=g.createContext(null);function ua(){let{matches:e}=g.useContext(_);return e[e.length-1]?.params??{}}function Z(e,{relative:t}={}){let{matches:r}=g.useContext(_),{pathname:a}=k(),n=JSON.stringify(Ne(r));return g.useMemo(()=>me(e,JSON.parse(n),a,t==="path"),[e,n,a,t])}function Wt(e,t){return Vt(e,t)}function Vt(e,t,r){P(Y(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=g.useContext(T),{matches:n}=g.useContext(_),o=n[n.length-1],i=o?o.params:{},l=o?o.pathname:"/",s=o?o.pathnameBase:"/",u=o&&o.route;if(Le){let h=u&&u.path||"";Gt(l,!u||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
2
2
|
|
|
3
3
|
Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let c=k(),d;if(t){let h=typeof t=="string"?z(t):t;P(s==="/"||h.pathname?.startsWith(s),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${s}" but pathname "${h.pathname}" was given in the \`location\` prop.`),d=h}else d=c;let p=d.pathname||"/",f=p;if(s!=="/"){let h=s.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(h.length).join("/")}let y=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):Te(e,{pathname:f});Le&&(N(u||y!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),N(y==null||y[y.length-1].route.element!==void 0||y[y.length-1].route.Component!==void 0||y[y.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`));let m=ma(y&&y.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:$([s,a.encodeLocation?a.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?s:$([s,a.encodeLocation?a.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),n,r);return t&&m?g.createElement(V.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...d},navigationType:"POP"}},m):m}function ca(){let e=Kt(),t=At(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",n={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},i=null;return Le&&(console.error("Error handled by React Router default ErrorBoundary:",e),i=g.createElement(g.Fragment,null,g.createElement("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:o},"ErrorBoundary")," or"," ",g.createElement("code",{style:o},"errorElement")," prop on your route."))),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),r?g.createElement("pre",{style:n},r):null,i)}var da=g.createElement(ca,null),Yt=class extends g.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=ia(e.digest);r&&(e=r)}let t=e!==void 0?g.createElement(_.Provider,{value:this.props.routeContext},g.createElement(_e.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?g.createElement(fa,{error:e},t):t}};Yt.contextType=Ht;var Pe=new WeakMap;function fa({children:e,error:t}){let{basename:r,navigator:a}=g.useContext(T);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let n=oa(t.digest);if(n){let o=Pe.get(t);if(o)throw o;let i=$t(n.location,r),l=i.absoluteURL||i.to;if(Oe(n.location,l,Me(a),"allow-explicit"),ea(l))throw new Error("Invalid redirect location");if(_t&&!Pe.get(t))if(i.isExternal||n.reloadDocument)window.location.href=l;else{let s=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:n.replace}));throw Pe.set(t,s),s}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l}`})}}return e}function ha({routeContext:e,match:t,children:r}){let a=g.useContext(W);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(_.Provider,{value:e},r)}function ma(e,t=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let n=e,o=a?.errors;if(o!=null){let c=n.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);P(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),n=n.slice(0,Math.min(n.length,c+1))}let i=!1,l=-1;if(r&&a){i=a.renderFallback;for(let c=0;c<n.length;c++){let d=n[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=c),d.route.id){let{loaderData:p,errors:f}=a,y=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!f||f[d.route.id]===void 0);if(d.route.lazy||y){r.isStatic&&(i=!0),l>=0?n=n.slice(0,l+1):n=[n[0]];break}}}}let s=r?.onError,u=a&&s?(c,d)=>{s(c,{location:a.location,params:a.matches?.[0]?.params??{},pattern:Yr(a.matches),errorInfo:d})}:void 0;return n.reduceRight((c,d,p)=>{let f,y=!1,m=null,h=null;a&&(f=o&&d.route.id?o[d.route.id]:void 0,m=d.route.errorElement||da,i&&(l<0&&p===0?(Gt("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),y=!0,h=null):l===p&&(y=!0,h=d.route.hydrateFallbackElement||null)));let S=t.concat(n.slice(0,p+1)),R=()=>{let w;return f?w=m:y?w=h:d.route.Component?w=g.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,g.createElement(ha,{match:d,routeContext:{outlet:c,matches:S,isDataRoute:a!=null},children:w})};return a&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?g.createElement(Yt,{location:a.location,revalidation:a.revalidation,component:m,error:f,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:u}):R()},null)}function $e(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pa(e){let t=g.useContext(W);return P(t,$e(e)),t}function Ie(e){let t=g.useContext(Q);return P(t,$e(e)),t}function ya(e){let t=g.useContext(_);return P(t,$e(e)),t}function He(e){let t=ya(e),r=t.matches[t.matches.length-1];return P(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function ga(){return He("useRouteId")}function Jt(){let e=Ie("useNavigation");return g.useMemo(()=>{let{matches:t,historyAction:r,...a}=e.navigation;return a},[e.navigation])}function Ue(){let{matches:e,loaderData:t}=Ie("useMatches");return g.useMemo(()=>e.map(r=>Fr(r,t)),[e,t])}function Kt(){let e=g.useContext(_e),t=Ie("useRouteError"),r=He("useRouteError");return e!==void 0?e:t.errors?.[r]}function va(){let{router:e}=pa("useNavigate"),t=He("useNavigate"),r=g.useRef(!1);return Bt(()=>{r.current=!0}),g.useCallback(async(n,o={})=>{N(r.current,zt),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}var Et={};function Gt(e,t,r){!t&&!Et[e]&&(Et[e]=!0,N(!1,r))}var Ra="useOptimistic",En=b[Ra];var bn=b.memo(wa);function wa({routes:e,manifest:t,future:r,state:a,isStatic:n,onError:o}){return Vt(e,void 0,{manifest:t,state:a,isStatic:n,onError:o,future:r})}function Sa({basename:e,children:t,initialEntries:r,initialIndex:a,useTransitions:n}){let o=b.useRef();o.current==null&&(o.current=Ct({initialEntries:r,initialIndex:a,v5Compat:!0}));let i=o.current,[l,s]=b.useState({action:i.action,location:i.location}),u=b.useCallback(c=>{n===!1?s(c):b.startTransition(()=>s(c))},[n]);return b.useLayoutEffect(()=>i.listen(u),[i,u]),b.createElement(ye,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:i,useTransitions:n})}function Ea({to:e,replace:t,state:r,relative:a}){P(Y(),"<Navigate> may be used only in the context of a <Router> component.");let{static:n,navigator:o}=b.useContext(T);N(!n,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=b.useContext(_),{pathname:l}=k(),s=J(),u=me(e,Ne(i),l,a==="path");Oe(typeof e=="string"?e:U(e),o.createHref(u),Me(o),"reject");let c=JSON.stringify(u);return b.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:a})},[s,c,a,t,r]),null}function Xt(e){P(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ye({basename:e="/",children:t=null,location:r,navigationType:a="POP",navigator:n,static:o=!1,useTransitions:i}){P(!Y(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),s=b.useMemo(()=>({basename:l,navigator:n,static:o,useTransitions:i,future:{}}),[l,n,o,i]);typeof r=="string"&&(r=z(r));let{pathname:u="/",search:c="",hash:d="",state:p=null,key:f="default",mask:y}=r,m=b.useMemo(()=>{let h=H(u,l);return h==null?null:{location:{pathname:h,search:c,hash:d,state:p,key:f,mask:y},navigationType:a}},[l,u,c,d,p,f,a,y]);return N(m!=null,`<Router basename="${l}"> is not able to match the URL "${u}${c}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:b.createElement(T.Provider,{value:s},b.createElement(V.Provider,{children:t,value:m}))}function ba({children:e,location:t}){return Wt(fe(e),t)}function fe(e,t=[]){let r=[];return b.Children.forEach(e,(a,n)=>{if(!b.isValidElement(a))return;let o=[...t,n];if(a.type===b.Fragment){r.push.apply(r,fe(a.props.children,o));return}P(a.type===Xt,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),P(!a.props.index||!a.props.children,"An index route cannot have child routes.");let i={id:a.props.id||o.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(i.children=fe(a.props.children,o)),r.push(i)}),r}var se="get",ue="application/x-www-form-urlencoded";function ge(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function xa(e){return ge(e)&&e.tagName.toLowerCase()==="button"}function Pa(e){return ge(e)&&e.tagName.toLowerCase()==="form"}function Ca(e){return ge(e)&&e.tagName.toLowerCase()==="input"}function La(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Da(e,t){return e.button===0&&(!t||t==="_self")&&!La(e)}function he(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let a=e[r];return t.concat(Array.isArray(a)?a.map(n=>[r,n]):[[r,a]])},[]))}function Fa(e,t){let r=he(e);return t&&t.forEach((a,n)=>{r.has(n)||t.getAll(n).forEach(o=>{r.append(n,o)})}),r}var ie=null;function ka(){if(ie===null)try{new FormData(document.createElement("form"),0),ie=!1}catch{ie=!0}return ie}var Ta=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ce(e){return e!=null&&!Ta.has(e)?(N(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null):e}function Na(e,t){let r,a,n,o,i;if(Pa(e)){let l=e.getAttribute("action");a=l?H(l,t):null,r=e.getAttribute("method")||se,n=Ce(e.getAttribute("enctype"))||ue,o=new FormData(e)}else if(xa(e)||Ca(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||l.getAttribute("action");if(a=s?H(s,t):null,r=e.getAttribute("formmethod")||l.getAttribute("method")||se,n=Ce(e.getAttribute("formenctype"))||Ce(l.getAttribute("enctype"))||ue,o=new FormData(l,e),!ka()){let{name:u,type:c,value:d}=e;if(c==="image"){let p=u?`${u}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else u&&o.append(u,d)}}else{if(ge(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=se,a=null,n=ue,i=e}return o&&n==="text/plain"&&(i=o,o=void 0),{action:a,method:r.toLowerCase(),encType:n,formData:o,body:i}}var xn=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ma={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},Oa=/[&><\u2028\u2029]/g;function bt(e){return e.replace(Oa,t=>Ma[t])}function ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}var Aa=Symbol("SingleFetchRedirect");function Qt(e,t,r,a){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?n.pathname.endsWith("/")?n.pathname=`${n.pathname}_.${a}`:n.pathname=`${n.pathname}.${a}`:n.pathname==="/"?n.pathname=`_root.${a}`:t&&H(n.pathname,t)==="/"?n.pathname=`${X(t)}/_root.${a}`:n.pathname=`${X(n.pathname)}.${a}`,n}async function _a(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw r;return window.location.reload(),new Promise(()=>{})}}function $a(e){return e!=null&&typeof e.page=="string"}function Ia(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ha(e,t,r){let a=await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let i=await _a(o,r);return i.links?i.links():[]}return[]}));return Ba(a.flat(1).filter(Ia).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}function xt(e,t,r,a,n,o){let i=(s,u)=>r[u]?s.route.id!==r[u].route.id:!0,l=(s,u)=>r[u].pathname!==s.pathname||r[u].route.path?.endsWith("*")&&r[u].params["*"]!==s.params["*"];return o==="assets"?t.filter((s,u)=>i(s,u)||l(s,u)):o==="data"?t.filter((s,u)=>{let c=a.routes[s.route.id];if(!c||!c.hasLoader)return!1;if(i(s,u)||l(s,u))return!0;if(s.route.shouldRevalidate){let d=s.route.shouldRevalidate({currentUrl:new URL(n.pathname+n.search+n.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:s.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Ua(e,t,{includeHydrateFallback:r}={}){return ja(e.map(a=>{let n=t.routes[a.route.id];if(!n)return[];let o=[n.module];return n.clientActionModule&&(o=o.concat(n.clientActionModule)),n.clientLoaderModule&&(o=o.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(o=o.concat(n.hydrateFallbackModule)),n.imports&&(o=o.concat(n.imports)),o}).flat(1))}function ja(e){return[...new Set(e)]}function za(e){let t={},r=Object.keys(e).sort();for(let a of r)t[a]=e[a];return t}function Ba(e,t){let r=new Set,a=new Set(t);return e.reduce((n,o)=>{if(t&&!$a(o)&&o.as==="script"&&o.href&&a.has(o.href))return n;let l=JSON.stringify(za(o));return r.has(l)||(r.add(l),n.push({key:l,link:o})),n},[])}function Be(){let e=E.useContext(W);return ze(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ja(){let e=E.useContext(Q);return ze(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var re=E.createContext(void 0);re.displayName="FrameworkContext";function ve(){let e=E.useContext(re);return ze(e,"You must render this element inside a <HydratedRouter> element"),e}function Ka(e,t){let r=E.useContext(re),[a,n]=E.useState(!1),[o,i]=E.useState(!1),{onFocus:l,onBlur:s,onMouseEnter:u,onMouseLeave:c,onTouchStart:d}=t,p=E.useRef(null);E.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=S=>{S.forEach(R=>{i(R.isIntersecting)})},h=new IntersectionObserver(m,{threshold:.5});return p.current&&h.observe(p.current),()=>{h.disconnect()}}},[e]),E.useEffect(()=>{if(a){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[a]);let f=()=>{n(!0)},y=()=>{n(!1),i(!1)};return r?e!=="intent"?[o,p,{}]:[o,p,{onFocus:ee(l,f),onBlur:ee(s,y),onMouseEnter:ee(u,f),onMouseLeave:ee(c,y),onTouchStart:ee(d,f)}]:[!1,p,{}]}function ee(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function qt({page:e,...t}){let r=ta(),{nonce:a}=ve(),{router:n}=Be(),o=E.useMemo(()=>Te(n.routes,e,n.basename),[n.routes,e,n.basename]);return o?(t.nonce==null&&a&&(t={...t,nonce:a}),r?E.createElement(Xa,{page:e,matches:o,...t}):E.createElement(Qa,{page:e,matches:o,...t})):null}function Ga(e){let{manifest:t,routeModules:r}=ve(),[a,n]=E.useState([]);return E.useEffect(()=>{let o=!1;return Ha(e,t,r).then(i=>{o||n(i)}),()=>{o=!0}},[e,t,r]),a}function Xa({page:e,matches:t,...r}){let a=k(),{future:n}=ve(),{basename:o}=Be(),i=E.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let l=Qt(e,o,n.v8_trailingSlashAwareDataRequests,"rsc"),s=!1,u=[];for(let c of t)typeof c.route.shouldRevalidate=="function"?s=!0:u.push(c.route.id);return s&&u.length>0&&l.searchParams.set("_routes",u.join(",")),[l.pathname+l.search]},[o,n.v8_trailingSlashAwareDataRequests,e,a,t]);return E.createElement(E.Fragment,null,i.map(l=>E.createElement("link",{key:l,rel:"prefetch",as:"fetch",href:l,...r})))}function Qa({page:e,matches:t,...r}){let a=k(),{future:n,manifest:o,routeModules:i}=ve(),{basename:l}=Be(),{loaderData:s,matches:u}=Ja(),c=E.useMemo(()=>xt(e,t,u,o,a,"data"),[e,t,u,o,a]),d=E.useMemo(()=>xt(e,t,u,o,a,"assets"),[e,t,u,o,a]),p=E.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let m=new Set,h=!1;if(t.forEach(R=>{let w=o.routes[R.route.id];!w||!w.hasLoader||(!c.some(x=>x.route.id===R.route.id)&&R.route.id in s&&i[R.route.id]?.shouldRevalidate||w.hasClientLoader?h=!0:m.add(R.route.id))}),m.size===0)return[];let S=Qt(e,l,n.v8_trailingSlashAwareDataRequests,"data");return h&&m.size>0&&S.searchParams.set("_routes",t.filter(R=>m.has(R.route.id)).map(R=>R.route.id).join(",")),[S.pathname+S.search]},[l,n.v8_trailingSlashAwareDataRequests,s,a,o,c,t,e,i]),f=E.useMemo(()=>Ua(d,o),[d,o]),y=Ga(d);return E.createElement(E.Fragment,null,p.map(m=>E.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),f.map(m=>E.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),y.map(({key:m,link:h})=>E.createElement("link",{key:m,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}function Za(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var qa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{qa&&(window.__reactRouterVersion="7.18.3")}catch{}function en({basename:e,children:t,useTransitions:r,window:a}){let n=v.useRef();n.current==null&&(n.current=Lt({window:a,v5Compat:!0}));let o=n.current,[i,l]=v.useState({action:o.action,location:o.location}),s=v.useCallback(u=>{r===!1?l(u):v.startTransition(()=>l(u))},[r]);return v.useLayoutEffect(()=>o.listen(s),[o,s]),v.createElement(ye,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:o,useTransitions:r})}function er({basename:e,children:t,history:r,useTransitions:a}){let[n,o]=v.useState({action:r.action,location:r.location}),i=v.useCallback(l=>{a===!1?o(l):v.startTransition(()=>o(l))},[a]);return v.useLayoutEffect(()=>r.listen(i),[r,i]),v.createElement(ye,{basename:e,children:t,location:n.location,navigationType:n.action,navigator:r,useTransitions:a})}er.displayName="unstable_HistoryRouter";var ae=v.forwardRef(function({onClick:t,discover:r="render",prefetch:a="none",relative:n,reloadDocument:o,replace:i,mask:l,state:s,target:u,to:c,preventScrollReset:d,viewTransition:p,defaultShouldRevalidate:f,...y},m){let{basename:h,navigator:S,useTransitions:R}=v.useContext(T),w=typeof c=="string"&&ke.test(c),x=$t(c,h);c=x.to;let C=pe(c,{relative:n}),F=k(),I=null;if(l){let j=me(l,[],F.mask?F.mask.pathname:"/",!0);h!=="/"&&(j.pathname=j.pathname==="/"?h:$([h,j.pathname])),I=S.createHref(j)}let[K,q,we]=Ka(a,y),Rr=or(c,{replace:i,mask:l,state:s,target:u,preventScrollReset:d,relative:n,viewTransition:p,defaultShouldRevalidate:f,useTransitions:R});function wr(j){t&&t(j),j.defaultPrevented||Rr(j)}let Ke=!(x.isExternal||o),Ge=v.createElement("a",{...y,...we,href:(Ke?I:void 0)||x.absoluteURL||C,onClick:Ke?wr:t,ref:Za(m,q),target:u,"data-discover":!w&&r==="render"?"true":void 0});return K&&!w?v.createElement(v.Fragment,null,Ge,v.createElement(qt,{page:C})):Ge});ae.displayName="Link";var tr=v.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:a="",end:n=!1,style:o,to:i,viewTransition:l,children:s,...u},c){let d=Z(i,{relative:u.relative}),p=k(),f=v.useContext(Q),{navigator:y,basename:m}=v.useContext(T),h=f!=null&&ur(d)&&l===!0,S=y.encodeLocation?y.encodeLocation(d).pathname:d.pathname,R=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(R=R.toLowerCase(),w=w?w.toLowerCase():null,S=S.toLowerCase()),w&&m&&(w=H(w,m)||w);let x=S!=="/"&&S.endsWith("/")?S.length-1:S.length,C=R===S||!n&&R.startsWith(S)&&R.charAt(x)==="/",F=w!=null&&(w===S||!n&&w.startsWith(S)&&w.charAt(S.length)==="/"),I={isActive:C,isPending:F,isTransitioning:h},K=C?t:void 0,q;typeof a=="function"?q=a(I):q=[a,C?"active":null,F?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let we=typeof o=="function"?o(I):o;return v.createElement(ae,{...u,"aria-current":K,className:q,ref:c,style:we,to:i,viewTransition:l},typeof s=="function"?s(I):s)});tr.displayName="NavLink";var rr=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:a,replace:n,state:o,method:i=se,action:l,onSubmit:s,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p,...f},y)=>{let{useTransitions:m}=v.useContext(T),h=ir(),S=lr(l,{relative:u}),R=i.toLowerCase()==="get"?"get":"post",w=typeof l=="string"&&ke.test(l);return v.createElement("form",{ref:y,method:R,action:S,onSubmit:a?s:C=>{if(s&&s(C),C.defaultPrevented)return;C.preventDefault();let F=C.nativeEvent.submitter,I=F?.getAttribute("formmethod")||i,K=()=>h(F||C.currentTarget,{fetcherKey:t,method:I,navigate:r,replace:n,state:o,relative:u,preventScrollReset:c,viewTransition:d,defaultShouldRevalidate:p});m&&r!==!1?v.startTransition(()=>K()):K()},...f,"data-discover":!w&&e==="render"?"true":void 0})});rr.displayName="Form";function ar({getKey:e,storageKey:t,...r}){let a=v.useContext(re),{basename:n}=v.useContext(T),o=k(),i=Ue();sr({getKey:e,storageKey:t});let l=v.useMemo(()=>{if(!a||!e)return null;let u=Fe(o,i,n,e);return u!==o.key?u:null},[]);if(!a||a.isSpaMode)return null;let s=((u,c)=>{if(!window.history.state||!window.history.state.key){let d=Math.random().toString(32).slice(2);window.history.replaceState({key:d},"")}try{let p=JSON.parse(sessionStorage.getItem(u)||"{}")[c||window.history.state.key];typeof p=="number"&&window.scrollTo(0,p)}catch(d){console.error(d),sessionStorage.removeItem(u)}}).toString();return r.nonce==null&&a?.nonce&&(r.nonce=a.nonce),v.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s})(${bt(JSON.stringify(t||De))}, ${bt(JSON.stringify(l))})`}})}ar.displayName="ScrollRestoration";function nr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function We(e){let t=v.useContext(W);return P(t,nr(e)),t}function tn(e){let t=v.useContext(Q);return P(t,nr(e)),t}function or(e,{target:t,replace:r,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s,useTransitions:u}={}){let c=J(),d=k(),p=Z(e,{relative:i});return v.useCallback(f=>{if(Da(f,t)){f.preventDefault();let y=r!==void 0?r:U(d)===U(p),m=()=>c(e,{replace:y,mask:a,state:n,preventScrollReset:o,relative:i,viewTransition:l,defaultShouldRevalidate:s});u?v.startTransition(()=>m()):m()}},[d,c,p,r,a,n,t,e,o,i,l,s,u])}function Ve(e){N(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(he(e)),r=v.useRef(!1),a=k(),n=v.useMemo(()=>Fa(a.search,r.current?null:t.current),[a.search]),o=J(),i=v.useCallback((l,s)=>{let u=he(typeof l=="function"?l(new URLSearchParams(n)):l);r.current=!0,o("?"+u,s)},[o,n]);return[n,i]}var rn=0,an=()=>`__${String(++rn)}__`;function ir(){let{router:e}=We("useSubmit"),{basename:t}=v.useContext(T),r=ga(),a=e.fetch,n=e.navigate;return v.useCallback(async(o,i={})=>{let{action:l,method:s,encType:u,formData:c,body:d}=Na(o,t);if(i.navigate===!1){let p=i.fetcherKey||an();await a(p,r,i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,flushSync:i.flushSync})}else await n(i.action||l,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:c,body:d,formMethod:i.method||s,formEncType:i.encType||u,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[a,n,t,r])}function lr(e,{relative:t}={}){let{basename:r}=v.useContext(T),a=v.useContext(_);P(a,"useFormAction must be used inside a RouteContext");let[n]=a.matches.slice(-1),o={...Z(e||".",{relative:t})},i=k();if(e==null){o.search=i.search;let l=new URLSearchParams(o.search),s=l.getAll("index");if(s.some(c=>c==="")){l.delete("index"),s.filter(d=>d).forEach(d=>l.append("index",d));let c=l.toString();o.search=c?`?${c}`:""}}return(!e||e===".")&&n.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(o.pathname=o.pathname==="/"?r:$([r,o.pathname])),U(o)}var De="react-router-scroll-positions",le={};function Fe(e,t,r,a){let n=null;return a&&(r!=="/"?n=a({...e,pathname:H(e.pathname,r)||e.pathname},t):n=a(e,t)),n==null&&(n=e.key),n}function sr({getKey:e,storageKey:t}={}){let{router:r}=We("useScrollRestoration"),{restoreScrollPosition:a,preventScrollReset:n}=tn("useScrollRestoration"),{basename:o}=v.useContext(T),i=k(),l=Ue(),s=Jt();v.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),nn(v.useCallback(()=>{if(s.state==="idle"){let u=Fe(i,l,o,e);le[u]=window.scrollY}try{sessionStorage.setItem(t||De,JSON.stringify(le))}catch(u){N(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${u}).`)}window.history.scrollRestoration="auto"},[s.state,e,o,i,l,t])),typeof document<"u"&&(v.useLayoutEffect(()=>{try{let u=sessionStorage.getItem(t||De);u&&(le=JSON.parse(u))}catch{}},[t]),v.useLayoutEffect(()=>{let u=r?.enableScrollRestoration(le,()=>window.scrollY,e?(c,d)=>Fe(c,d,o,e):void 0);return()=>u&&u()},[r,o,e]),v.useLayoutEffect(()=>{if(a!==!1){if(typeof a=="number"){window.scrollTo(0,a);return}try{if(i.hash){let u=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(u){u.scrollIntoView();return}}}catch{N(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}n!==!0&&window.scrollTo(0,0)}},[i,a,n]))}function nn(e,t){let{capture:r}=t||{};v.useEffect(()=>{let a=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,a),()=>{window.removeEventListener("pagehide",e,a)}},[e,r])}function ur(e,{relative:t}={}){let r=v.useContext(Ae);P(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=We("useViewTransitionState"),n=Z(e,{relative:t});if(!r.isTransitioning)return!1;let o=H(r.currentLocation.pathname,a)||r.currentLocation.pathname,i=H(r.nextLocation.pathname,a)||r.nextLocation.pathname;return te(n.pathname,i)!=null||te(n.pathname,o)!=null}var dr=D(O(),1),fr=D(Sr(),1);var Re=D(G(),1);function hr({context:e,own:t}){if(oe(e.store),!ot()||e.store.batches().length===0)return null;let a=(0,Re.jsx)(dr.Suspense,{fallback:null,children:(0,Re.jsx)(yt,{})});return t?(0,fr.createPortal)(a,t):(0,Re.jsx)("div",{className:"graview-bar-own",children:a})}var M=D(O(),1);var B=D(O(),1),on=(0,B.createContext)(null);function Bo(){let e=new Map,t=new Set,r=()=>{for(let a of t)a()};return{count:a=>e.get(a)??0,place(a){return e.set(a,(e.get(a)??0)+1),r(),()=>{e.set(a,(e.get(a)??1)-1),r()}},subscribe(a){return t.add(a),()=>t.delete(a)}}}function mr(e){let t=(0,B.useContext)(on);(0,B.useLayoutEffect)(()=>t?.place(e),[t,e])}function Wo(e,t){return(0,B.useSyncExternalStore)(e.subscribe,()=>e.count(t)>0,()=>!1)}var vr=D(G(),1),pr="var(--graview-font-display, var(--graview-font-body, system-ui))",Ye={maxWidth:760,margin:"0 auto",padding:"40px 20px max(96px, var(--graview-foot-room, 0px))",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:40},Je=1160,Go={...Ye,maxWidth:Je},yr={margin:0,fontFamily:pr,fontSize:"clamp(30px, 4.6vw, 40px)",lineHeight:1.12,fontWeight:600,letterSpacing:"-0.012em",overflowWrap:"anywhere"},Xo={margin:0,fontFamily:pr,fontSize:"1.4375rem",lineHeight:1.25,fontWeight:600,letterSpacing:"-0.006em"},Qo={margin:0,fontSize:"0.8125rem",letterSpacing:"0.14em",textTransform:"uppercase",color:"var(--graview-ink-muted)"},Zo={margin:0,fontSize:"1.1875rem",lineHeight:1.5,color:"var(--graview-ink-muted)",maxWidth:"58ch"},gr={color:"var(--graview-ink-muted)",fontSize:"0.9375rem"},qo={borderTop:"1px solid var(--graview-edge)",paddingTop:24},ei={color:"inherit",textDecorationColor:"var(--graview-edge-bright)",textUnderlineOffset:3,display:"inline-flex",alignItems:"center",minHeight:24},ti={color:"inherit",textDecoration:"none",display:"inline-flex",alignItems:"center",minHeight:24},ri={font:"inherit",fontSize:"0.9375rem",padding:"8px 14px",borderRadius:"var(--graview-radius-sm, 8px)",border:"1px solid var(--graview-edge-bright)",background:"var(--graview-panel)",color:"var(--graview-ink)",cursor:"pointer"};function ai({kind:e,brand:t,size:r=10,schema:a}){return(0,vr.jsx)(lt,{kind:e,...a?{schema:a}:{},...t?{brand:t}:{},size:Math.round(r*1.6)})}function ni(e,t){let a=[...new Set(t.targets.map(n=>n.kind))].map(n=>e.schema.tryDefinition(n)?.plural??Se(n));return a.length>0?a.join(" and "):Se(t.edgeKind)}function oi(e,t,r){return e.author.kind==="human"&&(e.author.id===void 0||t?.id===void 0||e.author.id===t.id)?"you":r?Qe(e.author,r):e.author.kind==="agent"?e.author.id??"an agent":e.author.id??e.author.kind}function ii(e,t,r){return Xe(e,t,{limit:3,said:[r],glance:!0}).map(a=>a.alone).join(" \xB7 ")}var li=(e,t)=>ne(e.schema,t),ln=(e,t)=>{let r=e.kindsKeptFrom(t);return e.schema.kinds.filter(a=>!e.modules.disabledKinds.has(a)&&!r.has(a))},sn=e=>nt(ln(e.store,e.principal),e.views?.arrangement?.()?.order),si=e=>{let t=new Set(e.views?.arrangement?.()?.hide??[]);return sn(e).filter(r=>!t.has(r))},ui=e=>e.charAt(0).toUpperCase()+e.slice(1);var L=D(G(),1);function Ri({context:e,children:t}){let{store:r,brand:a}=e;return oe(r),it(e.embedded?void 0:tt(a)),(0,L.jsxs)("div",{style:{...e.embedded?{}:{minHeight:"100vh"},display:"flex",flexDirection:"column",background:"var(--graview-ground)",color:"var(--graview-ink)",fontFamily:"var(--graview-font-body, system-ui)",fontSize:"1.0625rem",lineHeight:1.6},children:[e.embedded?null:(0,L.jsx)(cn,{context:e}),(0,L.jsx)("div",{style:{flex:1},children:t}),e.remembers?(0,L.jsx)("footer",{style:{borderTop:"1px solid var(--graview-edge)",padding:"14px 20px 20px",...gr,fontSize:"0.875rem"},children:(0,L.jsx)("div",{style:{maxWidth:Je,margin:"0 auto",display:"flex",gap:14,flexWrap:"wrap",alignItems:"center",justifyContent:"flex-end"},children:(0,L.jsxs)("span",{"data-testid":"remembered",children:["Remembered in this browser \xB7 ",(0,L.jsx)(pt,{})]})})}):null]})}var un=(0,M.createContext)(null);function cn({context:e}){let{store:t,brand:r,sceneHref:a="/",invariantContext:n}=e,o=k(),i=J(),l=pe("/").replace(/\/$/,""),s=(0,M.useContext)(un),u=s?.places===!1?[]:st({store:t,principal:e.principal,views:e.views}),c=e.views?.arrangement?.(),d=`${o.pathname}${o.search}`,p=t.violations(n),f=p.length,y=ht(p,"All rules hold");return(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(dt,{brand:r,name:r?.name??"Graview",description:r?.subtitle,home:{href:`${l}/`,go:()=>i("/"),current:o.pathname==="/"},faces:{scene:{label:rt(c),current:!1,go:()=>window.location.assign(a)},pages:{label:at(c),current:!0,go:()=>{}}},places:u,current:ut(u,d),reach:{href:m=>`${l}${m}`,go:m=>i(m.path)},...s?{onFind:s.onFind,find:s.find}:{findBox:(0,L.jsx)(dn,{context:e})},tools:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(ae,{to:"/problems","data-testid":"standing-link","aria-label":y,title:y,style:{...ct,padding:f===0?0:"0 8px",textDecoration:"none",fontWeight:600,fontVariantNumeric:"tabular-nums",color:f===0?"var(--graview-ink-muted)":"var(--graview-warn)"},children:[(0,L.jsx)(mt,{tone:f===0?"var(--graview-good)":"var(--graview-warn)"}),f>0?(0,L.jsx)("span",{"aria-hidden":"true",children:f}):null]}),(0,L.jsx)(hr,{context:e}),e.views?(0,L.jsx)(ft,{...e.signature?{signature:!0}:{}}):null]})})})}function wi({context:e,style:t,children:r,...a}){let n=e.embedded||e.framed?"section":"main";return(0,L.jsx)(n,{style:{...Ye,...t},...a,children:r})}function Si({context:e,children:t,...r}){let a=`h${e.titleLevel??(e.framed&&!e.barAbove?1:2)}`;return(0,L.jsx)(a,{style:yr,"data-graview-page-title":"",...r,children:t})}function dn({context:e,narrowsLists:t=!0}){mr("find");let r=k(),a=J(),[n,o]=Ve(),i=r.pathname.split("/").filter(Boolean),l=t&&i.length===1&&Ee(e.store.schema,i[0])!==void 0,s=r.pathname==="/search",u=l||s?n.get("q")??"":"",c=l?`Narrow ${ne(e.store.schema,Ee(e.store.schema,i[0])).toLowerCase()}\u2026`:"",[d,p]=(0,M.useState)(!0);(0,M.useLayoutEffect)(()=>{let R=m.current;if(!R||!c||typeof ResizeObserver>"u")return;let w=()=>{let C=getComputedStyle(R),F=document.createElement("canvas").getContext("2d");F&&(F.font=`${C.fontWeight} ${C.fontSize} ${C.fontFamily}`,p(F.measureText(c).width<=R.clientWidth-parseFloat(C.paddingLeft)-parseFloat(C.paddingRight)))};w();let x=new ResizeObserver(w);return x.observe(R),()=>x.disconnect()},[c]);let[f,y]=(0,M.useState)(u),m=(0,M.useRef)(null);(0,M.useEffect)(()=>{let R=w=>{if(w.defaultPrevented||w.altKey||w.shiftKey||!(w.metaKey||w.ctrlKey)||w.key.toLowerCase()!=="k")return;let x=m.current,C=x?.closest("[data-graview-embed]"),F=w.target,I=F===document.body||F===document.documentElement;!x||!(I||!C||F instanceof Node&&C.contains(F))||(w.preventDefault(),x.closest("[data-graview-app-bar]")?.querySelector('[data-testid="app-find-open"]')?.click(),requestAnimationFrame(()=>{x.focus(),x.select()}))};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[]);let h=(0,M.useRef)(new Set([u]));(0,M.useEffect)(()=>{h.current.has(u)||(h.current=new Set([u]),y(u))},[u]);let S=R=>{if(y(R),h.current.add(R),l){let x=new URLSearchParams(n);R.trim()?x.set("q",R):x.delete("q"),o(x,{replace:!0});return}let w=R.trim()?`/search?${new URLSearchParams({q:R}).toString()}`:"/search";a(w,{replace:s})};return(0,L.jsx)("form",{role:"search","aria-label":l?"Narrow this list":"Find anything",style:{display:"flex",minWidth:0,flex:"1 1 auto"},onSubmit:R=>{R.preventDefault(),l&&f.trim()&&a(`/search?${new URLSearchParams({q:f}).toString()}`)},children:(0,L.jsx)("input",{ref:m,type:"search","data-testid":"nav-find",value:f,onChange:R=>S(R.target.value),placeholder:l?d?c:"Narrow\u2026":"Find\u2026","aria-keyshortcuts":"Meta+K Control+K","aria-label":l?"Narrow this list":"Find anything",style:{width:"100%",minWidth:0,height:30,padding:"0 var(--graview-bar-find-end, 10px) 0 10px",font:"inherit",fontSize:"0.875rem",color:"var(--graview-ink)",background:"var(--graview-ground)",border:"1px solid var(--graview-edge)",borderRadius:8}})})}export{Er as a,Ee as b,hn as c,mn as d,pr as e,Go as f,Xo as g,Qo as h,Zo as i,gr as j,qo as k,ei as l,ti as m,ri as n,ai as o,ni as p,oi as q,ii as r,li as s,ln as t,sn as u,si as v,ui as w,hr as x,k as y,la as z,J as A,ua as B,Sa as C,Ea as D,Xt as E,ba as F,en as G,ae as H,Ve as I,on as J,Bo as K,Wo as L,Ri as M,un as N,wi as O,Si as P,dn as Q};
|
|
4
4
|
/*! Bundled license information:
|