graview 0.1.26 → 0.1.28
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.QFJRXAU3.js → chunk.22H4JXTH.js} +2 -2
- package/dist/preview/{chunk.BK2MJOUN.js → chunk.25OYH6MY.js} +1 -1
- package/dist/preview/{chunk.UUMXYMOX.js → chunk.2GBQJXJH.js} +1 -1
- package/dist/preview/chunk.2VUG6EAN.js +1 -0
- package/dist/preview/chunk.337WDTG3.js +2 -0
- package/dist/preview/chunk.3HLLQ5CJ.js +1 -0
- package/dist/preview/chunk.46KUPBQC.js +1 -0
- package/dist/preview/{chunk.564EIRAT.js → chunk.4H7CQE56.js} +1 -1
- package/dist/preview/chunk.4RO5DA22.js +1 -0
- package/dist/preview/{chunk.LHIYFAN5.js → chunk.4TUNX4WM.js} +1 -1
- package/dist/preview/chunk.5BGA2VUS.js +20 -0
- package/dist/preview/{chunk.ECRZZ3U4.js → chunk.7S22MBNN.js} +1 -1
- package/dist/preview/{chunk.I5U42VDK.js → chunk.A73BXXE4.js} +2 -2
- package/dist/preview/chunk.ARE3MEDN.js +1 -0
- package/dist/preview/chunk.ASFZTYFO.js +1 -0
- package/dist/preview/chunk.BBJZ6O7J.js +1 -0
- package/dist/preview/{chunk.XOC5BRPU.js → chunk.BCBH6WJF.js} +1 -1
- package/dist/preview/{chunk.CL7GGNEK.js → chunk.CAZAB352.js} +1 -1
- package/dist/preview/chunk.CY7MDLRS.js +1 -0
- package/dist/preview/chunk.DAVRLRGB.js +1 -0
- package/dist/preview/{chunk.ZOWWWRYA.js → chunk.DCIC3YHX.js} +1 -1
- package/dist/preview/{chunk.XD4Q4FI2.js → chunk.EW4JFOJY.js} +1 -1
- package/dist/preview/{chunk.PKFL2AR4.js → chunk.EYF6ONTA.js} +1 -1
- package/dist/preview/{chunk.ECG7RM6L.js → chunk.FP27W5MU.js} +1 -1
- package/dist/preview/{chunk.AAVCTGAE.js → chunk.G2OOBROL.js} +1 -1
- package/dist/preview/{chunk.2GFB5FOK.js → chunk.GCKSQ52O.js} +1 -1
- package/dist/preview/{chunk.KSEKVHJJ.js → chunk.GE5EAN36.js} +1 -1
- package/dist/preview/chunk.HOPIZMJR.js +2 -0
- package/dist/preview/chunk.IBGO4BUF.js +1 -0
- package/dist/preview/{chunk.OBGG4SYF.js → chunk.IDI2BQ7Y.js} +1 -1
- package/dist/preview/chunk.IH42QTOM.js +1 -0
- package/dist/preview/{chunk.NQP3DWME.js → chunk.ISRS7GOT.js} +1 -1
- package/dist/preview/{chunk.YXQCEXZX.js → chunk.J6CBMLGR.js} +1 -1
- package/dist/preview/{chunk.OBQ4DIFO.js → chunk.JRCV6HVV.js} +1 -1
- package/dist/preview/{chunk.4INXWGIT.js → chunk.KWW3YHQ4.js} +1 -1
- package/dist/preview/chunk.MKNXV4TM.js +8 -0
- package/dist/preview/{chunk.MLQQR57X.js → chunk.MVNIKZIC.js} +1 -1
- package/dist/preview/{chunk.YOMW4MKD.js → chunk.N2WTNKEV.js} +1 -1
- package/dist/preview/{chunk.4MAYBFPU.js → chunk.N7HCALRK.js} +1 -1
- package/dist/preview/{chunk.SVL6I37U.js → chunk.NRRUGG22.js} +1 -1
- package/dist/preview/{chunk.3RT463XY.js → chunk.OGL4PHTY.js} +1 -1
- package/dist/preview/{chunk.5CXMUC6R.js → chunk.PFQFPJ5L.js} +1 -1
- package/dist/preview/{chunk.NIEQZOHX.js → chunk.PN2H6X7O.js} +1 -1
- package/dist/preview/{chunk.KXWRS6LY.js → chunk.PWHJHFC4.js} +1 -1
- package/dist/preview/{chunk.XNYBOKLW.js → chunk.Q3HVA6L4.js} +1 -1
- package/dist/preview/{chunk.HFFEOCYY.js → chunk.RZLNDVGN.js} +2 -2
- package/dist/preview/{chunk.DRIWJRQW.js → chunk.SBHVVJY7.js} +1 -1
- package/dist/preview/{chunk.NLFLFIDS.js → chunk.SNBIZ3B6.js} +1 -1
- package/dist/preview/chunk.TBG2QBOS.js +1 -0
- package/dist/preview/chunk.VR735ZQL.js +1 -0
- package/dist/preview/{chunk.AKWBAWQF.js → chunk.VSXCXPK2.js} +1 -1
- package/dist/preview/chunk.W3LDQ6B2.js +1 -0
- package/dist/preview/{chunk.24X6LFD3.js → chunk.WCNONCTL.js} +1 -1
- package/dist/preview/{chunk.LEVR7WLB.js → chunk.WHTNSETN.js} +1 -1
- package/dist/preview/{chunk.XXNC2AFL.js → chunk.XG67BWH6.js} +1 -1
- package/dist/preview/{chunk.VW7U4CT5.js → chunk.XRM6WXPW.js} +1 -1
- package/dist/preview/chunk.Y5LPZLDE.js +1 -0
- package/dist/preview/chunk.YETBY2LM.js +1 -0
- package/dist/preview/chunk.ZEUBAAVQ.js +1 -0
- package/dist/preview/{chunk.D3XF643V.js → chunk.ZJDRD6PO.js} +1 -1
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.4YY54TMR.js +0 -1
- package/dist/preview/chunk.6GJF3F7L.js +0 -2
- package/dist/preview/chunk.6MZBFEXW.js +0 -1
- package/dist/preview/chunk.7OOKA2DK.js +0 -1
- package/dist/preview/chunk.7ZJPJARU.js +0 -1
- package/dist/preview/chunk.IQLDOIWD.js +0 -1
- package/dist/preview/chunk.JIWB6VGT.js +0 -2
- package/dist/preview/chunk.LCFCU3I3.js +0 -1
- package/dist/preview/chunk.LLUZMOBZ.js +0 -1
- package/dist/preview/chunk.LUUT2ZWF.js +0 -20
- package/dist/preview/chunk.P7YN4Z3K.js +0 -8
- package/dist/preview/chunk.PQ2IIC27.js +0 -1
- package/dist/preview/chunk.REODVRPZ.js +0 -1
- package/dist/preview/chunk.RH6VRP76.js +0 -1
- package/dist/preview/chunk.TAW67PZU.js +0 -1
- package/dist/preview/chunk.TUYKH4FG.js +0 -1
- package/dist/preview/chunk.UEEXBS2U.js +0 -1
- package/dist/preview/chunk.WWWZZAHE.js +0 -1
- package/dist/preview/chunk.YIZ3DJO3.js +0 -1
- package/dist/preview/chunk.ZLPA5BAW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as x,b as k,c as b,d as E,e as V}from"./chunk.KSEKVHJJ.js";import{g as d}from"./chunk.JIWB6VGT.js";var S=["card","row","page"],O=["good","warn","bad","neutral","accent"],M=["money","percent","date","relative","count"],R=4,w=40,A=["number","money","percent"],N=["card","row"],F=100,$={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label"]},W=Object.keys($),T=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,D=n=>/^(image|file)$/.test(n?.of??n?.type??"");function tn(n){return Object.fromEntries(Object.entries(n.views??{}).filter(([,e])=>!Array.isArray(e)))}function sn(n){let e=n.views?.home;return Array.isArray(e)?e:void 0}var G={field:()=>!1,relation:()=>!1,figure:!1},z=n=>n.kind??"the home",h=(n,e)=>n!==void 0&&Object.hasOwn(n,e),y=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function I(n,e,s){let o=x(n);for(let a of o.unknownFunctions)s.findings.push(d("unknown-function",e,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(s.kind===null){s.findings.push(d("view-name",e,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||s.spec.field(a)||s.spec.relation(a)||s.findings.push(d("view-name",e,`${s.kind} has no field or relation called "${a}"`))}for(let a of o.edges)s.edges.has(a)||s.findings.push(d("view-edge",e,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)s.kinds.has(a)||s.findings.push(d("view-kind",e,`"${a}" is not a kind this document declares`))}function m(n,e,s){if(typeof n!="string"||n.length===0||n.length>2e3){s.findings.push(d("view-expression",e,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{I(b(n),e,s)}catch(o){if(!(o instanceof k))throw o;s.findings.push(d("expression",e,`${o.sentence} (at character ${o.at+1})`))}}function j(n,e,s){if(typeof n!="string"||n.length===0||n.length>300){s.findings.push(d("view-template",e,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let o;try{o=V(n)}catch(a){if(a instanceof E||a instanceof k){s.findings.push(d("template",e,a.sentence));return}throw a}for(let a of o)a.expr&&I(a.expr,e,s)}function C(n,e,s){if(typeof n=="string"){O.includes(n)||s.findings.push(d("view-tone",e,`"${n}" is not a tone`,`use one of ${O.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(y(n)&&Object.keys(n).length===1&&"expr"in n){m(n.expr,`${e}.expr`,s);return}s.findings.push(d("view-tone",e,'a tone is a word or {"expr": \u2026}',`one of ${O.join(", ")}`))}function v(n,e,s,o){if(!Array.isArray(n)){o.findings.push(d("view-shape",e,"a view is a list of blocks"));return}if(s>R){o.findings.push(d("view-depth",e,`blocks nest at most ${R} deep`,"flatten a group or a condition"));return}n.forEach((a,l)=>H(a,`${e}.${l}`,s,o))}function H(n,e,s,o){if(o.count++,!y(n)){o.findings.push(d("view-block",e,"a block is an object naming what it shows",`one of ${T}`));return}let a=Object.keys(n),l=a.filter(t=>W.includes(t)&&!(t==="group"&&a.includes("list")));if(l.length===0){o.findings.push(d("view-block",e,`${a.length>0?a.map(t=>`"${t}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${T}`));return}if(l.length>1){o.findings.push(d("view-block",e,`a block is one thing, and this says ${l.map(t=>`"${t}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let t of a)t!==r&&t!="key"&&!$[r].includes(t)&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" is not part of a ${r} block`,$[r].length>0?`a ${r} block may also say ${$[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=n[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${e}.${r}`,o),"tone"in n&&C(n.tone,`${e}.tone`,o);return;case"image":case"field":{let t=r==="image";if(typeof i!="string"||!(t?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(d(`view-${r}`,`${e}.${r}`,`${o.kind} has no ${t?"image or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=t?["thumb","gallery"]:M;"as"in n&&!f.includes(n.as)&&o.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to show ${t?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),t||L(n,e,o,"field"),"label"in n&&Y(n.label,`${e}.label`,o);return}case"progress":{!y(i)||Object.keys(i).some(t=>t!=="value"&&t!=="max")||!("value"in i)||!("max"in i)?o.findings.push(d("view-progress",`${e}.progress`,'progress is {"value": expression, "max": expression}')):(m(i.value,`${e}.progress.value`,o),m(i.max,`${e}.progress.max`,o)),"label"in n&&j(n.label,`${e}.label`,o);return}case"group":"direction"in n&&n.direction!=="row"&&n.direction!=="column"&&o.findings.push(d("view-direction",`${e}.direction`,`a group runs "row" or "column", not "${String(n.direction)}"`)),v(i,`${e}.group`,s+1,o);return;case"when":m(i,`${e}.when`,o),"show"in n?v(n.show,`${e}.show`,s+1,o):o.findings.push(d("view-when",e,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return P(n,e,o);for(let t of["as","currency","label"])t in n&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(d("view-block",`${e}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(d("view-figure",`${e}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return X(n,e,o);case"divider":i!==!0&&o.findings.push(d("view-block",`${e}.${r}`,`write {"${r}": true}`));return}}function P(n,e,s){m(n.figure,`${e}.figure`,s),"as"in n&&!A.includes(n.as)&&s.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to say a figure`,`use one of ${A.join(", ")}`)),L(n,e,s,"figure"),"label"in n&&j(n.label,`${e}.label`,s)}function L(n,e,s,o){"currency"in n&&(typeof n.currency!="string"||!/^[A-Z]{3}$/.test(n.currency)?s.findings.push(d("view-currency",`${e}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):n.as!=="money"&&s.findings.push(d("view-currency",`${e}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function U(n,e){let s=[...e.kinds],o=(l,r)=>{let i=new Set;for(let t of l){let f=e.vocabulary.namesOf(t)?.targets?.(r);if(f==="*")return s;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return e.kind!==null&&e.spec.relation(l.name)?o([e.kind],l.name):void 0;case"member":{let r=a(l.object);return r?o(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&e.kinds.has(i)?[i]:void 0;let t=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&t!==void 0){let f=a(r);return f?o(f,t):void 0}if(l.fn==="out")return i!==void 0&&e.kind!==null?o([e.kind],i):void 0;if(l.fn==="in"){let f=t??i,u=t!==void 0?a(r):e.kind!==null?[e.kind]:void 0,c=f!==void 0?e.vocabulary.sources(f).filter(g=>{let p=e.vocabulary.namesOf(g)?.targets?.(f);return!u||p==="*"||u.some(K=>p?.includes(K))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(n)}function _(n,e,s,o){let a;try{a=b(n)}catch(r){if(!(r instanceof k))throw r;o.findings.push(d("expression",e,`${r.sentence} (at character ${r.at+1})`));return}let l=x(a);for(let r of l.unknownFunctions)o.findings.push(d("unknown-function",e,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)o.edges.has(r)||o.findings.push(d("view-edge",e,`"${r}" is not a relation any kind declares`));if(s)for(let r of l.names)r==="id"||s.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(d("view-name",e,`${s.join(" and ")} ${s.length===1?"has":"have"} no field or relation called "${r}"`))}function X(n,e,s){let o=n.list;m(o,`${e}.list`,s);let a;if(typeof o=="string")try{a=U(b(o),s)}catch{a=void 0}let l=i=>{if(!a)return[...s.kinds].map(f=>s.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let t=a.map(f=>s.vocabulary.namesOf(f)?.choices?.(i));return t.every(f=>f!==void 0)?[...new Set(t.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in n){let i=n.sort;if(typeof i=="string")_(i,`${e}.sort`,a,s);else if(y(i)&&typeof i.by=="string"&&Object.keys(i).every(t=>t==="by"||t==="direction")){let t=i.direction;t!==void 0&&t!=="asc"&&t!=="desc"&&t!=="choices"?s.findings.push(d("list-sort",`${e}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(t)}"`,'"choices" puts a choice field in the order its choices are declared')):t==="choices"?l(i.by)===void 0&&s.findings.push(d("list-sort",`${e}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):_(i.by,`${e}.sort.by`,a,s)}else s.findings.push(d("list-sort",`${e}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in n){let i=n.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>F)&&s.findings.push(d("list-limit",`${e}.limit`,`a limit is a whole number from 1 to ${F}`))}if("group"in n){let i=n.group,t=typeof i=="string"?i:y(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||y(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||t===void 0)s.findings.push(d("list-group",`${e}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}}'));else{let u=l(t);if(u===void 0&&s.findings.push(d("list-group",`${e}.group`,`"${t}" is not a choice field of ${r}, so it has no choices to group by`,"group by a field whose type is enum")),y(i)&&"headings"in i){let c=i.headings;if(!y(c)||Object.values(c).some(g=>typeof g!="string"||g.length===0||g.length>80))s.findings.push(d("list-group",`${e}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let g of Object.keys(c))u.includes(g)||s.findings.push(d("list-group",`${e}.group.headings.${g}`,`"${g}" is not one of ${t}'s choices`,`use ${u.join(", ")}`))}}}"empty"in n&&(typeof n.empty!="string"||n.empty.length===0||n.empty.length>200)&&s.findings.push(d("list-empty",`${e}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in n&&!N.includes(n.as)&&s.findings.push(d("list-as",`${e}.as`,`a list draws each record as its "card" or its "row", not "${String(n.as)}"`))}function Y(n,e,s){(typeof n!="string"||n.length===0||n.length>60)&&s.findings.push(d("view-label",e,"a label is a few words, at most 60 characters"))}function B(n,e,s,o,a,l,r){let i={kind:null,spec:G,kinds:o,edges:a,vocabulary:s,findings:l,count:0};Array.isArray(n)&&n.length===0&&l.push(d("view-shape",e,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),v(n,e,1,i),i.count>w&&l.push(d("view-size",e,`${r} has ${i.count} blocks; a view has at most ${w}`,"show less"))}function q(n,e,s,o,a){Array.isArray(n)&&n.forEach((l,r)=>{if(!y(l)||l.name!=="blocks"||!y(l.options)||!("blocks"in l.options))return;let i=[];B(l.options.blocks,`lenses.${r}.options.blocks`,e,s,o,i,`the lens "${String(l.title??r)}"`);for(let t of i)a.push({...t,severity:"warning"})})}function Z(n,e,s,o,a,l,r){let i=[];if(n===void 0)return i;if(!y(n))return i.push(d("view-shape",e,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[t,f]of Object.entries(n)){if(t==="home"&&Array.isArray(f)){B(f,`${e}.home`,r,o,a,i,"the home");continue}let u=s(t);if(!u){i.push(d("view-kind",`${e}.${t}`,`"${t}" is not a kind this ${l} declares`));continue}if(!y(f)){i.push(d("view-shape",`${e}.${t}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))S.includes(c)||i.push(d("view-slot",`${e}.${t}.${c}`,`"${c}" is not a place a view is drawn`,`use ${S.map(g=>`"${g}"`).join(", ")}`));for(let c of S){let g=f[c];if(g===void 0)continue;let p={kind:t,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0};v(g,`${e}.${t}.${c}`,1,p),p.count>w&&i.push(d("view-size",`${e}.${t}.${c}`,`this ${c} has ${p.count} blocks; a view has at most ${w}`,"show less, or move detail to the page"))}}return i}function rn(n){let e=new Set(Object.keys(n.kinds)),s=new Set(Object.values(n.kinds).flatMap(r=>Object.keys(r.edges??{}))),o=r=>{let i=h(n.kinds,r)?n.kinds[r]:void 0;return i?{field:t=>h(i.fields,t)||h(i.computed,t),relation:t=>h(i.edges,t),figure:i.figure!==void 0,files:t=>h(i.fields,t)&&D(i.fields[t]),choices:t=>h(i.fields,t)&&i.fields[t].type==="enum"?i.fields[t].options:void 0,targets:t=>h(i.edges,t)?i.edges[t].to:void 0}:void 0},a={namesOf:o,sources:r=>Object.keys(n.kinds).filter(i=>h(n.kinds[i].edges,r))},l=Z(n.views,"views",o,e,s,"document",a);return q(n.lenses,a,e,s,l),l}export{O as a,M as b,A as c,F as d,tn as e,sn as f,rn as g};
|
|
1
|
+
import{a as x,b as k,c as b,d as E,e as V}from"./chunk.GE5EAN36.js";import{g as d}from"./chunk.337WDTG3.js";var S=["card","row","page"],O=["good","warn","bad","neutral","accent"],M=["money","percent","date","relative","count"],R=4,w=40,A=["number","money","percent"],N=["card","row"],F=100,$={title:[],headline:[],list:["sort","limit","group","empty","as"],text:["tone"],badge:["tone"],field:["as","currency","label"],image:["as","label"],progress:["label"],group:["direction"],when:["show"],divider:[],figure:["as","currency","label"]},W=Object.keys($),T=`{"title": "{name}"}, {"headline": "{count(all('offer'))} offers"}, {"figure": expr, "as"?: "number"|"money"|"percent", "currency"?, "label"?}, {"list": expr, "sort"?, "limit"?, "group"?, "empty"?, "as"?: "card"|"row"}, {"text": "\u2026", "tone"?}, {"badge": "{status}", "tone"?}, {"field": "quote", "as"?, "currency"?, "label"?}, {"image": "photos", "as"?: "thumb"|"gallery"}, {"progress": {"value": expr, "max": expr}, "label"?}, {"group": [blocks], "direction"?: "row"|"column"}, {"when": expr, "show": [blocks]}, {"divider": true}, {"figure": true}`,D=n=>/^(image|file)$/.test(n?.of??n?.type??"");function tn(n){return Object.fromEntries(Object.entries(n.views??{}).filter(([,e])=>!Array.isArray(e)))}function sn(n){let e=n.views?.home;return Array.isArray(e)?e:void 0}var G={field:()=>!1,relation:()=>!1,figure:!1},z=n=>n.kind??"the home",h=(n,e)=>n!==void 0&&Object.hasOwn(n,e),y=n=>typeof n=="object"&&n!==null&&!Array.isArray(n);function I(n,e,s){let o=x(n);for(let a of o.unknownFunctions)s.findings.push(d("unknown-function",e,`"${a}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let a of o.names){if(s.kind===null){s.findings.push(d("view-name",e,`"${a}" names nothing here: these blocks are about no one record`,"reach records with all('<kind>'), like count(all('offer')) or first(all('party') where role == 'client').name"));continue}a==="id"||s.spec.field(a)||s.spec.relation(a)||s.findings.push(d("view-name",e,`${s.kind} has no field or relation called "${a}"`))}for(let a of o.edges)s.edges.has(a)||s.findings.push(d("view-edge",e,`"${a}" is not a relation any kind declares`));for(let a of o.sweeps)s.kinds.has(a)||s.findings.push(d("view-kind",e,`"${a}" is not a kind this document declares`))}function m(n,e,s){if(typeof n!="string"||n.length===0||n.length>2e3){s.findings.push(d("view-expression",e,`an expression is a line of the rule language, like "status == 'booked'"`));return}try{I(b(n),e,s)}catch(o){if(!(o instanceof k))throw o;s.findings.push(d("expression",e,`${o.sentence} (at character ${o.at+1})`))}}function j(n,e,s){if(typeof n!="string"||n.length===0||n.length>300){s.findings.push(d("view-template",e,'a template is words with {field} in braces, like "{name}" or "{quote|money}", at most 300 characters'));return}let o;try{o=V(n)}catch(a){if(a instanceof E||a instanceof k){s.findings.push(d("template",e,a.sentence));return}throw a}for(let a of o)a.expr&&I(a.expr,e,s)}function C(n,e,s){if(typeof n=="string"){O.includes(n)||s.findings.push(d("view-tone",e,`"${n}" is not a tone`,`use one of ${O.join(", ")}, or {"expr": "if(status == 'booked', 'good', 'neutral')"}`));return}if(y(n)&&Object.keys(n).length===1&&"expr"in n){m(n.expr,`${e}.expr`,s);return}s.findings.push(d("view-tone",e,'a tone is a word or {"expr": \u2026}',`one of ${O.join(", ")}`))}function v(n,e,s,o){if(!Array.isArray(n)){o.findings.push(d("view-shape",e,"a view is a list of blocks"));return}if(s>R){o.findings.push(d("view-depth",e,`blocks nest at most ${R} deep`,"flatten a group or a condition"));return}n.forEach((a,l)=>H(a,`${e}.${l}`,s,o))}function H(n,e,s,o){if(o.count++,!y(n)){o.findings.push(d("view-block",e,"a block is an object naming what it shows",`one of ${T}`));return}let a=Object.keys(n),l=a.filter(t=>W.includes(t)&&!(t==="group"&&a.includes("list")));if(l.length===0){o.findings.push(d("view-block",e,`${a.length>0?a.map(t=>`"${t}"`).join(", "):"an empty object"} is not a block Graview knows`,`one of ${T}`));return}if(l.length>1){o.findings.push(d("view-block",e,`a block is one thing, and this says ${l.map(t=>`"${t}"`).join(" and ")}`,"split it into two blocks"));return}let r=l[0];for(let t of a)t!==r&&t!="key"&&!$[r].includes(t)&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" is not part of a ${r} block`,$[r].length>0?`a ${r} block may also say ${$[r].map(f=>`"${f}"`).join(", ")}`:`a ${r} block says nothing else`));let i=n[r];switch(r){case"title":case"headline":case"text":case"badge":j(i,`${e}.${r}`,o),"tone"in n&&C(n.tone,`${e}.tone`,o);return;case"image":case"field":{let t=r==="image";if(typeof i!="string"||!(t?o.spec.files?.(i):o.spec.field(i))){let u=typeof i=="string"&&o.spec.relation(i);o.findings.push(d(`view-${r}`,`${e}.${r}`,`${o.kind} has no ${t?"image or file ":""}field ${typeof i=="string"?`"${i}"`:"by that name"}`,u?`"${i}" is a relation; show it with {"text": "{${i}.name}"}`:void 0))}let f=t?["thumb","gallery"]:M;"as"in n&&!f.includes(n.as)&&o.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to show ${t?"pictures":"a field"}`,`use one of ${f.join(", ")}`)),t||L(n,e,o,"field"),"label"in n&&Y(n.label,`${e}.label`,o);return}case"progress":{!y(i)||Object.keys(i).some(t=>t!=="value"&&t!=="max")||!("value"in i)||!("max"in i)?o.findings.push(d("view-progress",`${e}.progress`,'progress is {"value": expression, "max": expression}')):(m(i.value,`${e}.progress.value`,o),m(i.max,`${e}.progress.max`,o)),"label"in n&&j(n.label,`${e}.label`,o);return}case"group":"direction"in n&&n.direction!=="row"&&n.direction!=="column"&&o.findings.push(d("view-direction",`${e}.direction`,`a group runs "row" or "column", not "${String(n.direction)}"`)),v(i,`${e}.group`,s+1,o);return;case"when":m(i,`${e}.when`,o),"show"in n?v(n.show,`${e}.show`,s+1,o):o.findings.push(d("view-when",e,'a condition says what it shows: {"when": expr, "show": [blocks]}'));return;case"figure":if(typeof i=="string")return P(n,e,o);for(let t of["as","currency","label"])t in n&&o.findings.push(d("unknown-key",`${e}.${t}`,`"${t}" belongs to a figure that works a number out; {"figure": true} is the kind's picture`,`write {"figure": "count(all('offer'))", "as": "number"}`));i!==!0?o.findings.push(d("view-block",`${e}.figure`,`a figure is a number worked out, {"figure": "sum(all('offer'), net)", "as": "money"}, or the kind's picture, {"figure": true}`)):o.spec.figure||o.findings.push(d("view-figure",`${e}.figure`,`${z(o)} has no figure to show`,o.kind===null?`work a number out: {"figure": "count(all('offer'))"}`:'give the kind a "figure", or leave this block out'));return;case"list":return X(n,e,o);case"divider":i!==!0&&o.findings.push(d("view-block",`${e}.${r}`,`write {"${r}": true}`));return}}function P(n,e,s){m(n.figure,`${e}.figure`,s),"as"in n&&!A.includes(n.as)&&s.findings.push(d("view-format",`${e}.as`,`"${String(n.as)}" is not a way to say a figure`,`use one of ${A.join(", ")}`)),L(n,e,s,"figure"),"label"in n&&j(n.label,`${e}.label`,s)}function L(n,e,s,o){"currency"in n&&(typeof n.currency!="string"||!/^[A-Z]{3}$/.test(n.currency)?s.findings.push(d("view-currency",`${e}.currency`,'a currency is its three-letter code, like "USD" or "EUR"')):n.as!=="money"&&s.findings.push(d("view-currency",`${e}.currency`,`a currency belongs on a ${o} shown as money`,'add "as": "money"')))}function U(n,e){let s=[...e.kinds],o=(l,r)=>{let i=new Set;for(let t of l){let f=e.vocabulary.namesOf(t)?.targets?.(r);if(f==="*")return s;for(let u of f??[])i.add(u)}return i.size>0?[...i]:void 0},a=l=>{switch(l.t){case"ident":return e.kind!==null&&e.spec.relation(l.name)?o([e.kind],l.name):void 0;case"member":{let r=a(l.object);return r?o(r,l.name):void 0}case"where":return a(l.set);case"call":{let r=l.args[0],i=r?.t==="lit"&&typeof r.value=="string"?r.value:void 0;if(l.fn==="all")return i!==void 0&&e.kinds.has(i)?[i]:void 0;let t=l.args.length===2&&l.args[1]?.t==="lit"&&typeof l.args[1].value=="string"?l.args[1].value:void 0;if(l.fn==="out"&&t!==void 0){let f=a(r);return f?o(f,t):void 0}if(l.fn==="out")return i!==void 0&&e.kind!==null?o([e.kind],i):void 0;if(l.fn==="in"){let f=t??i,u=t!==void 0?a(r):e.kind!==null?[e.kind]:void 0,c=f!==void 0?e.vocabulary.sources(f).filter(g=>{let p=e.vocabulary.namesOf(g)?.targets?.(f);return!u||p==="*"||u.some(K=>p?.includes(K))}):[];return c.length>0?c:void 0}if((l.fn==="sort"||l.fn==="first")&&r)return a(r);if(l.fn==="either"){let f=l.args.map(a);return f.every(u=>u!==void 0)?[...new Set(f.flatMap(u=>u??[]))]:void 0}return}default:return}};return a(n)}function _(n,e,s,o){let a;try{a=b(n)}catch(r){if(!(r instanceof k))throw r;o.findings.push(d("expression",e,`${r.sentence} (at character ${r.at+1})`));return}let l=x(a);for(let r of l.unknownFunctions)o.findings.push(d("unknown-function",e,`"${r}" is not a function the rule language knows`,"see docs/declaration-document.md#expression-language"));for(let r of l.edges)o.edges.has(r)||o.findings.push(d("view-edge",e,`"${r}" is not a relation any kind declares`));if(s)for(let r of l.names)r==="id"||s.some(i=>o.vocabulary.namesOf(i)?.field(r)||o.vocabulary.namesOf(i)?.relation(r))||o.findings.push(d("view-name",e,`${s.join(" and ")} ${s.length===1?"has":"have"} no field or relation called "${r}"`))}function X(n,e,s){let o=n.list;m(o,`${e}.list`,s);let a;if(typeof o=="string")try{a=U(b(o),s)}catch{a=void 0}let l=i=>{if(!a)return[...s.kinds].map(f=>s.vocabulary.namesOf(f)?.choices?.(i)).find(f=>f!==void 0);let t=a.map(f=>s.vocabulary.namesOf(f)?.choices?.(i));return t.every(f=>f!==void 0)?[...new Set(t.flatMap(f=>f??[]))]:void 0},r=a?a.join(" and "):"any kind";if("sort"in n){let i=n.sort;if(typeof i=="string")_(i,`${e}.sort`,a,s);else if(y(i)&&typeof i.by=="string"&&Object.keys(i).every(t=>t==="by"||t==="direction")){let t=i.direction;t!==void 0&&t!=="asc"&&t!=="desc"&&t!=="choices"?s.findings.push(d("list-sort",`${e}.sort.direction`,`a list is sorted "asc", "desc" or "choices", not "${String(t)}"`,'"choices" puts a choice field in the order its choices are declared')):t==="choices"?l(i.by)===void 0&&s.findings.push(d("list-sort",`${e}.sort.by`,`"${i.by}" is not a choice field of ${r}, so it has no declared order`,'sort by a choice field, or say "asc" or "desc"')):_(i.by,`${e}.sort.by`,a,s)}else s.findings.push(d("list-sort",`${e}.sort`,'a sort is a key, like "net", or {"by": key, "direction": "asc" | "desc" | "choices"}'))}if("limit"in n){let i=n.limit;(typeof i!="number"||!Number.isInteger(i)||i<1||i>F)&&s.findings.push(d("list-limit",`${e}.limit`,`a limit is a whole number from 1 to ${F}`))}if("group"in n){let i=n.group,t=typeof i=="string"?i:y(i)&&typeof i.by=="string"?i.by:void 0;if(!(typeof i=="string"||y(i)&&Object.keys(i).every(u=>u==="by"||u==="headings"))||t===void 0)s.findings.push(d("list-group",`${e}.group`,'a group is a choice field, like "type", or {"by": "type", "headings": {"pain": "What hurts"}}'));else{let u=l(t);if(u===void 0&&s.findings.push(d("list-group",`${e}.group`,`"${t}" is not a choice field of ${r}, so it has no choices to group by`,"group by a field whose type is enum")),y(i)&&"headings"in i){let c=i.headings;if(!y(c)||Object.values(c).some(g=>typeof g!="string"||g.length===0||g.length>80))s.findings.push(d("list-group",`${e}.group.headings`,'headings are words per choice, like {"pain": "What hurts"}, at most 80 characters each'));else if(u)for(let g of Object.keys(c))u.includes(g)||s.findings.push(d("list-group",`${e}.group.headings.${g}`,`"${g}" is not one of ${t}'s choices`,`use ${u.join(", ")}`))}}}"empty"in n&&(typeof n.empty!="string"||n.empty.length===0||n.empty.length>200)&&s.findings.push(d("list-empty",`${e}.empty`,"what an empty list says is a sentence, at most 200 characters")),"as"in n&&!N.includes(n.as)&&s.findings.push(d("list-as",`${e}.as`,`a list draws each record as its "card" or its "row", not "${String(n.as)}"`))}function Y(n,e,s){(typeof n!="string"||n.length===0||n.length>60)&&s.findings.push(d("view-label",e,"a label is a few words, at most 60 characters"))}function B(n,e,s,o,a,l,r){let i={kind:null,spec:G,kinds:o,edges:a,vocabulary:s,findings:l,count:0};Array.isArray(n)&&n.length===0&&l.push(d("view-shape",e,`${r} has no blocks`,'give it one: {"headline": "\u2026"}')),v(n,e,1,i),i.count>w&&l.push(d("view-size",e,`${r} has ${i.count} blocks; a view has at most ${w}`,"show less"))}function q(n,e,s,o,a){Array.isArray(n)&&n.forEach((l,r)=>{if(!y(l)||l.name!=="blocks"||!y(l.options)||!("blocks"in l.options))return;let i=[];B(l.options.blocks,`lenses.${r}.options.blocks`,e,s,o,i,`the lens "${String(l.title??r)}"`);for(let t of i)a.push({...t,severity:"warning"})})}function Z(n,e,s,o,a,l,r){let i=[];if(n===void 0)return i;if(!y(n))return i.push(d("view-shape",e,'views are an object of kinds, each with a "card", a "row" or a "page"')),i;for(let[t,f]of Object.entries(n)){if(t==="home"&&Array.isArray(f)){B(f,`${e}.home`,r,o,a,i,"the home");continue}let u=s(t);if(!u){i.push(d("view-kind",`${e}.${t}`,`"${t}" is not a kind this ${l} declares`));continue}if(!y(f)){i.push(d("view-shape",`${e}.${t}`,`a kind's views are {"card": [blocks], "row": [blocks], "page": [blocks]}`));continue}for(let c of Object.keys(f))S.includes(c)||i.push(d("view-slot",`${e}.${t}.${c}`,`"${c}" is not a place a view is drawn`,`use ${S.map(g=>`"${g}"`).join(", ")}`));for(let c of S){let g=f[c];if(g===void 0)continue;let p={kind:t,spec:u,kinds:o,edges:a,vocabulary:r,findings:i,count:0};v(g,`${e}.${t}.${c}`,1,p),p.count>w&&i.push(d("view-size",`${e}.${t}.${c}`,`this ${c} has ${p.count} blocks; a view has at most ${w}`,"show less, or move detail to the page"))}}return i}function rn(n){let e=new Set(Object.keys(n.kinds)),s=new Set(Object.values(n.kinds).flatMap(r=>Object.keys(r.edges??{}))),o=r=>{let i=h(n.kinds,r)?n.kinds[r]:void 0;return i?{field:t=>h(i.fields,t)||h(i.computed,t),relation:t=>h(i.edges,t),figure:i.figure!==void 0,files:t=>h(i.fields,t)&&D(i.fields[t]),choices:t=>h(i.fields,t)&&i.fields[t].type==="enum"?i.fields[t].options:void 0,targets:t=>h(i.edges,t)?i.edges[t].to:void 0}:void 0},a={namesOf:o,sources:r=>Object.keys(n.kinds).filter(i=>h(n.kinds[i].edges,r))},l=Z(n.views,"views",o,e,s,"document",a);return q(n.lenses,a,e,s,l),l}export{O as a,M as b,A as c,F as d,tn as e,sn as f,rn as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gb as e}from"./chunk.MKNXV4TM.js";var a=`
|
|
2
2
|
.graview-spec { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--graview-ink); }
|
|
3
3
|
|
|
4
4
|
.graview-spec-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 10px; box-sizing: border-box; max-width: 100%; padding: 5px 10px; border: 1px solid var(--graview-edge); border-radius: var(--graview-radius-sm, 8px); background: var(--graview-panel); font-size: 0.875rem; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fb as zt,Ib as qt,Jb as Ut,Lb as $t,Ta as Gt,Xa as Kt,Ya as Bt,_b as Yt,aa as Ft,dc as Se,ec as Ke,lb as jt}from"./chunk.P7YN4Z3K.js";import{a as F,b as ve}from"./chunk.MRK6QJV5.js";import{b as C}from"./chunk.AJZBJBMO.js";var te={focusId:null,relation:null,expanded:[],pins:{}},be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function U(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${xe(r.x)},${xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${xe(e.pan.x)},${xe(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function $n(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ee(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[g,p]of n){if(!g.startsWith("pin."))continue;let[m,S]=p.split(","),k=m===void 0?null:be(m),h=S===void 0?null:be(S);k===null||h===null||(o[g.slice(4)]={x:k,y:h})}let r=Object.create(null);for(let[g,p]of n)!g.startsWith("in.")||p.length===0||(r[g.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],u=a[0]===void 0?null:be(a[0]),l=a[1]===void 0?null:be(a[1]),c=(n.get("sel")??"").split(",").filter(g=>g.length>0).sort(),f=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...u!==null&&l!==null?{pan:{x:u,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:$n(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(g=>g.length>0&&(f||!g.startsWith("kind:"))).sort(),pins:o}}function rr(e){let t=Ee(e);return U(t)==="#"?{...t,overview:!0}:t}function ir(e){let t=U(e);return t==="#overview=1"?"":t}function xe(e){return Math.round(e*100)/100}function Qt(e,t){return U(e)===U(t)}var Be="edge:";function ar(e,t,n){let o=r=>encodeURIComponent(r);return`${Be}${o(e)}:${o(t)}:${o(n)}`}function Xt(e){if(!e.startsWith(Be))return null;let t=e.slice(Be.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Re(e){let{pan:t,...n}=e;return{...n,pins:{}}}function $(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Re(e);return{...n.within?.q!==void 0?ge(n,"q",null):n,focusId:t}}function Jt(e,t){return{...e,relation:t}}function ge(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function je(e,t){if(t!==e.overview&&(e=Re(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function sr(e,t,n){let o=new Set(e.shown??[]);if(n?o.add(t):o.delete(t),o.size===0){let{shown:r,...i}=e;return i}return{...e,shown:[...o].sort()}}function Yn(e,t){if(t===null||t.trim().length===0){let{q:n,...o}=e;return o}return{...e,q:t}}function lr(e){let t=e.q!==void 0&&e.within?.q===e.q;return Yn(t?ge(e,"q",null):e,null)}function dr(e,t){if(!t){let{past:n,...o}=e;return o}return{...e,past:!0}}function Pe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function me(e,t){if(t!==(e.zoom===!0)&&(e=Re(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Me(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}function cr(e,t){if(t===null||t.x===0&&t.y===0){let{pan:n,...o}=e;return o}return{...e,pan:t}}function ur(e){return Re(e)}function pr(e,t,n){let o={...e.pins};return n===null?delete o[t]:o[t]=n,{...e,pins:o}}var ke="aggregate:",Ae="kind:";function ze(e){return`${Ae}${e}`}function ne(e){return e.startsWith(Ae)?e.slice(Ae.length):null}var gr="kinds:beyond";function Qn(e){let t=ne(e);return t?[t]:X(e)}function oe(...e){return`${ke}${[...e].sort().join("+")}`}function Zt(e){return e.startsWith(ke)}function X(e){return!Zt(e)||e.includes("|")?[]:e.slice(ke.length).split("+").filter(Boolean)}function en(e,t,n={}){let o=ne(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Me(e,t);let r=o!==null?oe(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return me(e,!1);if(o!==null&&n.carry){let i=je({...$(e,r),relation:null},!1);return ge(me(i,!0),"q",n.carry)}return me({...$(e,r),relation:null},!0)}function Xn(e,t,n){return ge(je($(e,oe(t)),!1),"view",n)}function mr(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var tn="aggregate:";function qe(e){return e.startsWith(tn)&&e.includes("|")}function Jn(e,t){let n=0,o=138;for(let r of e.split(" ")){let i=t(r),a=o+t(" ")+i;if(a<=138)o=a;else{let u=Math.ceil(i/138)||1;n+=u,o=i-(u-1)*138}}return n}var Zn=16.25,Ue=27,eo=(e,t)=>{let n=Math.ceil(e.length*7.1/138);return t?Math.max(Ue,Math.ceil(Math.max(n,Jn(e,t))*Zn)+6):Math.max(Ue,n*16+6)};function to(e,t,n){return e.length===0?0:10+e.reduce((o,r)=>o+eo(r,n),0)+(e.length-1)*2}var nn=27,on=8,no=4,rn=64,oo=e=>Math.max(1,Math.min(on,e)),ro=e=>e*nn+rn;var io=(e,t)=>e.length*t*.58;var $e=C(F(),1),ao={turns:[],outcomes:new Map,busy:!1,open:!1,side:"left",pending:null,drawn:0,draft:null,draftNote:null},an=e=>`graview:seat:${e}`;function so(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...typeof n.open=="boolean"?{open:n.open}:{},...n.side==="left"||n.side==="right"?{side:n.side}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function lo(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],open:t.open,side:t.side,draft:t.draft}))}catch{}}function Ye(e){let t=e===null?null:an(e),n={...ao,...so(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&lo(t,n);for(let u of[...o])u()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),setOpen:i=>{n.open!==i&&r({...n,open:i})},setSide:i=>{n.side!==i&&r({...n,side:i})},ask:i=>r({...n,open:!0,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},drawn(){return r({...n,drawn:n.drawn+1},!1),()=>r({...n,drawn:Math.max(0,n.drawn-1)},!1)},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function co(e){let t=()=>e.get().drawn>0;return(0,$e.useSyncExternalStore)(e.subscribe,t,t)}function uo(e){return(0,$e.useSyncExternalStore)(e.subscribe,e.get,e.get)}var Te=C(F(),1),Oe=(0,Te.createContext)(void 0),po=()=>(0,Te.useContext)(Oe);var Qe={};var fo="I can answer about what's in this app. Open questions need AI, which isn't on here.",yo="Answered with AI";var sn=e=>`graview:setting:${e}`;function ln(){return localStorage}function dn(e,t){try{let n=(t??ln()).getItem(sn(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function cn(e,t,n){try{(n??ln()).setItem(sn(e.name),t)}catch{}}function un(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var O=C(F(),1);function pn(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}function Xe(e){return Se(e)}var go=12,mo=4;function ho(e,t,n){let o=Xe(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ve=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-go);function fn(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=mo)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?ze([...o][0]):n[0]}function Je(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,u]of e)u.mode!=="asking"&&u.mode!=="docked"&&t.at-u.since>=t.holdMs&&o.set(a,{...u,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=ho(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=fn(t.ids,n);return i({at:a,mode:"reading",trail:Ve(r.trail,a)}),o}case"about-to-write":case"write":{let a=fn(t.ids,n);return i({at:a,mode:"writing",trail:Ve(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Ve(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Ve(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var yn="graview:session";function gn(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(yn);if(o)return o;let r=t();return n.setItem(yn,r),r}catch{return t()}}var Ze={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},et={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},mn=[Ze,et],So=800;function hn(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:u,settingValues:l,setView:c,ttlMs:f=1e4,people:g,seats:p}=e,[m,S]=(0,O.useState)(()=>new Map),[k,h]=(0,O.useState)(null),[v,w]=(0,O.useState)(null),[x,R]=(0,O.useState)(null),N=typeof r.id=="string"&&r.id.length>0,V=N&&(l[Ze.name]??Ze.initial)==="shared",W=V&&(l[et.name]??et.initial)==="shared",M=Xe({kind:r.kind,...r.id?{id:r.id}:{},session:i}),b=N?Ft(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...g?{people:g}:{}}):"",A=u?a.get(`agent:${u}:${i}`):void 0,L=(0,O.useMemo)(()=>!t||!V?null:{participant:M,kind:r.kind,name:b,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:jt(r.id??"nobody"),stop:x??U(o),...W?{over:k}:{},...A?{robot:{at:A.at,mode:A.mode}}:{},at:new Date().toISOString()},[t,V,W,M,b,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,k,A?.at,A?.mode]);(0,O.useEffect)(()=>{if(!t||!L)return;t.here(L);let T=setInterval(()=>t.here({...L,at:new Date().toISOString()}),So);return()=>clearInterval(T)},[t,L]),(0,O.useEffect)(()=>t?t.onWho(D=>S(Ke(new Map,D,Date.now(),f))):void 0,[t,f]);let we=m.size>0;(0,O.useEffect)(()=>{if(!we)return;let T=setInterval(()=>{S(D=>{let K=Ke(D,[],Date.now(),f);return K.size===D.size?D:K})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(T)},[we,f]),(0,O.useEffect)(()=>{if(!t||typeof window>"u")return;let T=()=>t.leave();return window.addEventListener("pagehide",T),()=>window.removeEventListener("pagehide",T)},[t]),(0,O.useEffect)(()=>{if(!W||typeof document>"u")return;let T=null,D=K=>{let Z=pn(K.target);Z!==T&&(T=Z,h(Z))};return document.addEventListener("pointermove",D,{passive:!0}),()=>document.removeEventListener("pointermove",D)},[W]);let Q=(0,O.useRef)(null),H=v?m.get(v)??null:null,J=(0,O.useCallback)(T=>{Q.current=null,w(T)},[]);return(0,O.useEffect)(()=>{if(v){if(!H){w(null);return}H.stop!==Q.current?.stop&&(Q.current={stop:H.stop,at:Date.now()},c(Ee(H.stop)))}},[v,H,c]),(0,O.useEffect)(()=>{let T=Q.current;!v||T===null||Date.now()-T.at<400||Qt(o,Ee(T.stop))||w(null)},[o,v]),(0,O.useEffect)(()=>{if(!v||typeof document>"u")return;let T=D=>{D.key==="Escape"&&w(null)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[v]),(0,O.useMemo)(()=>({who:m,sharing:L?{participant:M,name:b}:null,following:H,follow:J,sayWhere:R}),[m,L,M,b,H,J])}var B=C(F(),1);function wn(e){return Se(e.author)}function vo(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Sn(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),u=(l,c,f)=>{let g=i.get(l),p=g?.participants.includes(wn(c))?g.participants:[...g?.participants??[],wn(c)];i.set(l,{at:o,manner:vo(p,c.author.kind),intent:c.intent,wrote:(g?.wrote??!1)||(f.wrote??!1),read:(g?.read??!1)||(f.read??!1),broke:(g?.broke??!1)||a.has(l),participants:p})};for(let l of t){for(let c of l.writes)u(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||u(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let f=i.get(c);i.set(c,{at:o,manner:f?.manner??"rule",intent:f?.intent??l.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var bo=2600;function vn(e,t=bo){let[n,o]=(0,B.useState)(()=>new Map),r=(0,B.useRef)(n);r.current=n;let i=(0,B.useRef)(null),a=(0,B.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,B.useEffect)(()=>{let l=e.violations(),c=e.subscribe((f,g)=>{let p=e.violations(),m=$t(e.allInvariants(),l,p).introduces;l=p,a(Sn(r.current,g,m.map(S=>({nodeIds:S.nodeIds,message:S.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let u=(0,B.useCallback)(l=>{l.reads.length!==0&&a(Sn(r.current,[xo(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:u}}function xo(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var s=C(F(),1);function bn(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}function xn(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var re=C(ve(),1),Ie=(0,s.createContext)(null),Pn=(0,s.createContext)("scene");function Eo({mode:e,children:t}){return(0,re.jsx)(Pn.Provider,{value:e,children:t})}function Ro(){return(0,s.useContext)(Pn)}var Mn={kind:"human"},Po=[],Mo=[],Ao=[],tt=[];function An(e,t){let n=(0,s.useId)();(0,s.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Mn,r=()=>{qt(e,o,n),Ut(e)};r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}function ko({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=Po,onSeat:u,people:l=Mo,memory:c,presenceTtlMs:f,app:g,settings:p=g?.settings??Ao,presence:m,brand:S,onKeepLens:k,providers:h,ai:v=Qe,files:w,view:x,onViewChange:R,children:N}){let[V,W]=(0,s.useState)(null),M=V??i??a[0]?.principal??Mn,b=(0,s.useMemo)(()=>e.seenBy(M),[e,M]);An(e,M);let[A]=(0,s.useState)(()=>gn(c)),[L,we]=(0,s.useState)(!1),Q=(0,s.useCallback)(()=>we(!0),[]),H=(0,s.useMemo)(()=>m?[...p,...mn]:p,[p,m]),[J]=(0,s.useState)(()=>n??ot(t,e.schema)),[T,D]=(0,s.useState)(()=>Pe(J??te,r??J?.selection??[])),K=(0,s.useRef)(J??te).current,[Z,Fn]=(0,s.useState)(null),[ft,Gn]=(0,s.useState)(null),De=(0,s.useContext)(Ie),[yt]=(0,s.useState)(()=>De?.seatTalk??Ye(S?.name??e.schema.kinds.join(","))),We=k??De?.onKeepLens,gt=g??De?.app,mt=(0,s.useRef)(null),ht=(0,s.useCallback)(d=>{mt.current=d},[]),wt=(0,s.useCallback)(d=>mt.current?.whereIs(d)??null,[]),[St]=(0,s.useState)(()=>bn()),[vt]=(0,s.useState)(()=>xn()),[Fe,Kn]=(0,s.useState)(null),[de,bt]=(0,s.useState)(()=>new Map),ce=(0,s.useRef)(de);ce.current=de;let ue=(0,s.useRef)(null),Ge=(0,s.useCallback)(d=>b.graph.getNode(d)?.kind,[b]),q=(0,s.useCallback)(d=>{let y=Je(ce.current,d,Ge);ce.current=y,bt(y),ue.current&&clearTimeout(ue.current),[...y.values()].some(P=>P.mode!=="docked"&&P.mode!=="asking")&&(ue.current=setTimeout(()=>{let P=Je(ce.current,{type:"rest",at:Date.now(),holdMs:nt},Ge);ce.current=P,bt(P)},nt+20))},[Ge]),xt=(0,s.useCallback)(d=>q({...d,at:d.at??Date.now()}),[q]),Et=(0,s.useCallback)(d=>{Kn(d),d&&q({type:"home",author:{kind:"agent",id:d,session:A},at:Date.now()})},[q,A]);(0,s.useEffect)(()=>b.subscribe((d,y)=>{for(let E of y)E.author.kind==="agent"&&q({type:"write",author:E.author,ids:E.writes,at:Date.now()})}),[b,q]),(0,s.useEffect)(()=>()=>{ue.current&&clearTimeout(ue.current)},[]);let z=(0,s.useMemo)(()=>({...M,session:A}),[M,A]),Rt=(0,s.useCallback)(d=>{W(d),u?.(d)},[u]),[pe,Bn]=(0,s.useState)(()=>Object.fromEntries(H.map(d=>[d.name,dn(d,c)])));(0,s.useEffect)(()=>{for(let d of H)un(d,pe[d.name]??d.initial)},[H,pe]);let Pt=(0,s.useCallback)((d,y)=>{let E=H.find(P=>P.name===d);!E||!E.options.some(P=>P.value===y)||(cn(E,y,c),Bn(P=>({...P,[d]:y})))},[H,c]),[Mt,jn]=(0,s.useState)(null),{activity:At,noteAttention:kt}=vn(b),Tt=(0,s.useCallback)(d=>{kt(d),q({type:"read",author:d.author,ids:d.reads,at:Date.now()})},[kt,q]),ee=(0,s.useCallback)(d=>{if(ne(d)!==null||X(d).length>0||qe(d))return!0;let y=Xt(d);return y?b.graph.allEdges().some(E=>E.kind===y.kind&&E.from===y.from&&E.to===y.to):b.graph.getNode(d)!==void 0},[b]),Ot=(0,s.useCallback)(d=>{let y=d.selection??tt,E=y.filter(ee),P=E.length===y.length?d:Pe(d,E);return P.focusId!==null&&!ee(P.focusId)&&(P=$(P,null)),P},[ee]),fe=(0,s.useCallback)(d=>{let y=Ot(d),E=Rn(b,z,y.shown);if(y.focusId!==null&&E.size>0){let P=X(y.focusId),Wt=b.graph.getNode(y.focusId);(P.length>0?P.every(Un=>E.has(Un)):Wt?E.has(Wt.kind):!1)&&(y={...y,focusId:null})}if(!y.overview&&y.focusId===null){let P=K.focusId!==null&&!ee(K.focusId)?ot(t,e.schema)??{...te,overview:!0}:K;P.focusId!==null&&ee(P.focusId)?y={...y,focusId:P.focusId}:P.overview===!0&&(y={...y,overview:!0})}return y},[Ot,ee,b,K,z,t,e.schema]),G=fe(x??T),Vt=(0,s.useMemo)(()=>Rn(b,z,G.shown),[b,z,G.shown]),It=(0,s.useMemo)(()=>[...b.modules.administered.entries()].map(([d,y])=>{let E=b.mayAdminister(d,z);return{name:d,...y.description?{description:y.description}:{},kinds:y.kinds??[],canShow:E,shown:E&&(G.shown??[]).includes(d)}}),[b,z,G.shown]),ye=(0,s.useCallback)(d=>{let y=E=>fe(typeof d=="function"?d(E):d);if(x!==void 0){R?.(y(x));return}R&&R(y(G)),D(E=>y(E))},[G,R,x,fe]);(0,s.useEffect)(()=>{x===void 0&&D(d=>{let y=fe(d);return y===d?d:y})},[G,x,fe]);let Lt=G.selection??tt,Ct=(0,s.useCallback)(d=>{ye(y=>Pe(y,typeof d=="function"?d(y.selection??tt):d))},[ye]),{who:_t,following:Nt,follow:Ht,sayWhere:zn,sharing:Dt}=hn({channel:m,store:b,view:G,principal:z,session:A,robots:de,seatWho:Fe,settingValues:pe,setView:ye,seats:a,people:l,...f!==void 0?{ttlMs:f}:{}}),qn=(0,s.useMemo)(()=>({store:b,scheme:o,views:t,view:G,setView:ye,homeView:K,selection:Lt,setSelection:Ct,menuAt:Z,setMenuAt:Fn,whereIs:wt,pointer:St,motion:vt,registerScene:ht,robots:de,noteSeat:xt,seatWho:Fe,registerSeatWho:Et,actsDoor:ft,registerActsDoor:Gn,seatTalk:yt,...c?{memory:c}:{},who:_t,following:Nt,follow:Ht,sayWhere:zn,sharing:Dt,session:A,ai:v,movedByHand:L,noteMoved:Q,emphasis:Mt,setEmphasis:jn,activity:At,noteAttention:Tt,principal:z,seats:a,people:l,takeSeat:Rt,settings:H,settingValues:pe,chooseSetting:Pt,hiddenKinds:Vt,administered:It,...h?{providers:h}:{},...S?{brand:S}:{},...We?{onKeepLens:We}:{},app:gt}),[b,o,t,G,ye,Lt,Ct,Z,wt,St,vt,ht,de,xt,Fe,Et,ft,yt,c,_t,Nt,Ht,Dt,A,v,L,Q,Mt,At,Tt,z,a,l,Rt,H,pe,Pt,Vt,It,h,S,We,gt]);return(0,re.jsx)(Ie.Provider,{value:qn,children:(0,re.jsx)(To,{children:w?(0,re.jsx)(Oe.Provider,{value:w,children:N}):N})})}var kn=(0,s.createContext)(null);function To({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a}=Y(),u=Le(),l=n.q,c=n.focusId,f=!!(l&&l.trim().length>0),g=(0,s.useMemo)(()=>f?{flagged:new Set(t.violations().flatMap(S=>S.nodeIds)),touched:Kt(t.log.all())}:null,[t,u,f]),p=c?t.graph.getNode(c)?.kind??ne(c)??(X(c).length===1?X(c)[0]:void 0):void 0,m=(0,s.useMemo)(()=>!l||!g?null:Bt(t,l,{...p?{inKind:p}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(S=>!i.has(S)),from:[...a,...c&&t.graph.has(c)?[c]:[]],flagged:g.flagged,touched:g.touched,limit:200}),[t,l,r,o,i,a,c,p,g]);return(0,re.jsx)(kn.Provider,{value:m,children:e})}var En=new WeakMap;function ri(e){let t=En.get(e);return t||En.set(e,t=new Set(e.matched)),t}function Oo(){return(0,s.useContext)(kn)}function Y(){let e=(0,s.useContext)(Ie);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Vo(){return(0,s.useContext)(Ie)??null}function Le(){let{store:e}=Y(),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,s.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,s.useSyncExternalStore)(r,o,o)}function Io(e){let{store:t}=Y(),n=(0,s.useCallback)(r=>t.subscribe(r),[t]),o=(0,s.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,s.useSyncExternalStore)(n,o,o)}function Rn(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var nt=2600;function ot(e,t){let n=Yt(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...te,focusId:oe(n.place.kind),within:{view:n.place.as}}:{...te,focusId:oe(n.kind)}}var Ce=Symbol.for("graview.default-view");function Tn(e){return Object.defineProperty(e,Ce,{value:!0,enumerable:!1}),e}function On(e){return typeof e=="function"&&e[Ce]===!0}var rt=Symbol.for("graview.replaces-page");function Vn(e){return typeof e=="function"&&e[rt]===!0}function Co(e){return Gt(e)}function _o(e,t){if(t===e)return e;for(let r of t.registrations()){let i={...r.title?{title:r.title}:{},...r.across?{across:r.across}:{},...r.beside?{beside:!0}:{}};e.register(r.kind,{cardinality:r.cardinality,fidelity:r.fidelity},r.view,i)}let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var ae=C(F(),1);function No(){let{selection:e,setSelection:t}=Y();return(0,ae.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Ho(){let{store:e}=Y(),t=Le();return(0,ae.useMemo)(()=>Do(e),[e,t])}var In=new WeakMap;function Do(e){let t=In.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),In.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Wo(){let{view:e,setView:t}=Y();return(0,ae.useMemo)(()=>({view:e,url:U(e),focus:n=>t(o=>$(o,n)),show:n=>t(o=>Jt(o,n)),toggle:n=>t(o=>Me(o,n)),go:n=>t(n)}),[e,t])}var ie={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;ie.at=typeof t?.graview=="number"?t.graview:0,ie.at>ie.depth&&(ie.depth=ie.at),ie.tell()});var I=C(F(),1),at={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Fo={position:"fixed",inset:"auto",margin:0,zIndex:zt("popover"),boxSizing:"border-box"},_e=6,se=8,Go=e=>typeof e.showPopover=="function";function Ne(e){try{return e.matches(":popover-open")}catch{return!1}}function Ko(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function st(e,t,n={}){let o=Ko(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),u=r.height-o.bottom-_e-se,l=o.top-_e-se,c=a.height<=u||u>=l,f=Math.max(96,Math.floor(c?u:l)),g=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,m=n.align==="start"?o.left:o.right-p,S=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();S&&p<=S.right-S.left&&(m<S.left?m=o.left+p<=S.right?o.left:S.left:m+p>S.right&&(m=o.right-p>=S.left?o.right-p:S.right-p));let k=p>=r.width-2*se?Math.max(0,(r.width-p)/2):Math.max(se,Math.min(m,r.width-se-p)),h=c?o.bottom+_e:Math.max(se,o.top-_e-g);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(h)}px`}function Ln(e,t,n,o={}){let r=o.align??"end";(0,I.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Go(i)&&!Ne(i))try{i.showPopover(),jo()}catch{}let a=0,u=c=>{c?.target instanceof Node&&i.contains(c.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>st(i,n,{align:r})))};st(i,n,{align:r}),addEventListener("resize",u),addEventListener("scroll",u,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>u());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",u),removeEventListener("scroll",u,!0),l?.disconnect(),i.isConnected&&Ne(i))try{i.hidePopover()}catch{}}},[t,e,r])}var lt=new Set;function Bo(e){return lt.add(e),()=>lt.delete(e)}function jo(){for(let e of lt)if(!(!e.isConnected||!Ne(e)))try{e.hidePopover(),e.showPopover()}catch{}}var le=null,zo='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function qo(e){for(let t of e.querySelectorAll(zo))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var it=()=>{let e=document.activeElement;return e===null||e===document.body};function Uo(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,u]=(0,I.useState)(!1),l=t.open??a,c=(0,I.useRef)(null),f=(0,I.useRef)(null),g=(0,I.useCallback)(w=>{c.current=w},[]),p=(0,I.useCallback)(w=>{f.current=w},[]),m=`graview-popover-${(0,I.useId)().replace(/:/g,"")}`,S=(0,I.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});S.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,I.useCallback)(w=>{S.current.controlled||u(w),S.current.onOpenChange?.(w)},[]),h=(0,I.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??S.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),v=(0,I.useCallback)(w=>{let x=f.current,R=typeof document>"u"?null:document.activeElement,N=R===null||R===document.body||x!==null&&x.contains(R);k(!1),!(!w||!N)&&(h(),requestAnimationFrame(()=>{it()&&h()}))},[k,h]);return Ln(f,i&&l,n??c,t.align?{align:t.align}:{}),(0,I.useEffect)(()=>{if(!i||!l)return;let w={name:e,close:()=>v(!1)};if(le&&le.close!==w.close&&le.close(),le=w,at[e].focus==="into"){let M=f.current;M&&!M.contains(document.activeElement)&&qo(M).focus({preventScroll:!0})}let x=M=>{M.key==="Escape"&&v(!0)},R=M=>{let b=M.target;if(!(b instanceof Node))return;let A=f.current;if(A?.contains(b)||c.current?.contains(b))return;let L=b instanceof Element?b.closest('[role="dialog"], [role="alertdialog"]'):null;L&&!(A&&L.contains(A))||(v(!1),at[e].focus==="into"&&requestAnimationFrame(()=>{(it()||A!==null&&A.contains(document.activeElement))&&h()}))},N=null,V=null,W=M=>{let b=M.target;if(!(b instanceof Element))return;let A=f.current,L=b.closest('[role="dialog"], [role="alertdialog"]');!L||A&&(A.contains(L)||L.contains(A))||(N=L,v(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",R,!0),document.addEventListener("focusin",W),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",R,!0),document.removeEventListener("focusin",W);let M=N;M&&typeof MutationObserver<"u"&&(V?.disconnect(),V=new MutationObserver(()=>{M.isConnected||(V?.disconnect(),requestAnimationFrame(()=>{(it()||document.activeElement.closest("[hidden]")!==null)&&h()}))}),V.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>V?.disconnect(),10*6e4)),le?.close===w.close&&(le=null)}},[i,l,e,v,h]),{open:l,setOpen:w=>w?k(!0):v(!0),toggle:()=>l?v(!0):k(!0),trigger:{ref:g,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:p,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var _=C(F(),1),j=C(ve(),1),dt=new Set,Cn=!1;function ct(){for(let e of[...dt])e()}function $o(){Cn||typeof window>"u"||(Cn=!0,window.addEventListener("online",ct))}function Yo(e){let t,n=!1,o=!1,r,i=0,a=new Set,u=()=>{i+=1;for(let p of[...a])p()},l=p=>(a.add(p),()=>void a.delete(p)),c=()=>i,f=()=>void g().catch(()=>{});function g(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(m=>(t=m,n=!0,o=!1,r=void 0,dt.delete(f),u(),m),m=>{throw r=void 0,o=!0,dt.add(f),$o(),u(),m});return p.catch(()=>{}),r=p,p}return{load:g,prefetch:f,get current(){return t},get failed(){return o},part(p,m={}){let S=m.what??"This part";function k(w){(0,_.useSyncExternalStore)(l,c,c);let x=(0,_.useRef)(null),R=(0,_.useRef)(null),N=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(N.current=!0),(0,_.useLayoutEffect)(()=>{if(!(!n||!N.current)){N.current=!1;for(let V=R.current?.nextElementSibling??null;V!==null;V=V.nextElementSibling){let W=V.matches(_n)?V:V.querySelector(_n);if(W instanceof HTMLElement){W.focus();return}}}}),n?(0,j.jsxs)(j.Fragment,{children:[N.current?(0,j.jsx)("span",{ref:R,hidden:!0}):null,p(t,w)]}):m.quiet?null:(0,j.jsx)(Qo,{what:S,button:x,...m.as?{as:m.as}:{}})}let h=(0,_.lazy)(()=>g().then(()=>({default:k}),()=>({default:k})));function v(w){let[x]=(0,_.useState)(()=>n||o);return(0,_.createElement)(x?k:h,w)}return v}}}var _n="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Qo({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,j.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,j.jsx)("span",{role:"status",children:r})," ",(0,j.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:ct,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var He=C(F(),1);var Xo=(0,He.createContext)(null);var Nn=C(F(),1),Jo=(0,Nn.createContext)(!1);var Hn=C(F(),1),Zo=(0,Hn.createContext)(null);var Dn=C(F(),1),ut='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',pt=e=>e instanceof HTMLElement&&(e.matches(ut)||e.hasAttribute("tabindex")),he=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function er(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let u=e.querySelector(a);return u&&pt(u)&&he(u)?u:null}var tr=e=>e.isConnected&&pt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&he(e);function Wn(e,t){let n=t?er(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&he(o))return o;for(let r of e.querySelectorAll(ut))if(he(r))return r;return pt(e)&&he(e)?e:null}function nr(e){(0,Dn.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=h=>{let v=h.target;if(v instanceof Element){n=[];for(let w=v;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,u=()=>!i&&a.defaultView!==null,l=(h,v)=>void setTimeout(()=>u()&&v(),h),c=h=>void requestAnimationFrame(()=>u()&&h()),f=h=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(tr(n[0])){h&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let R=Wn(x,n[0]);if(R){R.focus({preventScroll:!0}),n=[];return}}}},g=(h,v=Date.now()+2500)=>{l(100,()=>{f(h);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<v&&g(h,v)})},p=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{f(!1),g(!1)})))},m=h=>{if(!(h instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(h.key))){if(!(h instanceof KeyboardEvent)){let v=h.target instanceof Element?h.target.closest(ut):null,w=a.activeElement,x=w===null||w===a.body||w===a.documentElement;if(v&&x&&t.contains(v)){n=[];for(let R=v;R&&R!==t.parentElement;R=R.parentElement)n.push(R);l(150,()=>c(()=>{f(!1),g(!1)}));return}}!(h instanceof KeyboardEvent)&&!(h.target instanceof Node&&n[0]?.contains(h.target))||l(150,()=>c(()=>{f(!0),g(!0)}))}},S=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=h=>{h.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",m),t.addEventListener("keydown",m),S.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",m),t.removeEventListener("keydown",m),S.disconnect()}},[e])}export{te as a,U as b,Ee as c,rr as d,ir as e,Qt as f,ar as g,Xt as h,$ as i,Jt as j,ge as k,je as l,sr as m,Yn as n,lr as o,dr as p,Pe as q,me as r,Me as s,cr as t,ur as u,pr as v,ke as w,ze as x,ne as y,gr as z,Qn as A,oe as B,Zt as C,X as D,en as E,Xn as F,mr as G,tn as H,qe as I,Ue as J,to as K,nn as L,no as M,rn as N,oo as O,ro as P,io as Q,fo as R,yo as S,Ye as T,co as U,uo as V,pn as W,Oe as X,po as Y,Eo as Z,Ro as _,An as $,ko as aa,ri as ba,Oo as ca,Y as da,Vo as ea,Le as fa,Io as ga,ot as ha,Xo as ia,Tn as ja,On as ka,Vn as la,Co as ma,_o as na,Jo as oa,Zo as pa,No as qa,Ho as ra,Wo as sa,ie as ta,nr as ua,Fo as va,Ne as wa,Bo as xa,Uo as ya,Yo as za};
|
|
1
|
+
import{Hb as zt,Kb as qt,Lb as Ut,Nb as $t,Va as Gt,Za as Kt,_a as Bt,ac as Yt,ca as Ft,fc as Se,gc as Ke,nb as jt}from"./chunk.MKNXV4TM.js";import{a as F,b as ve}from"./chunk.MRK6QJV5.js";import{b as C}from"./chunk.AJZBJBMO.js";var te={focusId:null,relation:null,expanded:[],pins:{}},be=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function U(e){let t=new URLSearchParams;e.focusId&&t.set("focus",e.focusId),e.relation&&t.set("relation",e.relation),e.overview&&t.set("overview","1"),e.zoom&&t.set("zoom","1"),e.past&&t.set("past","1"),e.shown&&e.shown.length>0&&t.set("show",[...e.shown].sort().join(",")),e.selection!==void 0&&e.selection.length>0&&t.set("sel",[...e.selection].sort().join(",")),e.expanded.length>0&&t.set("expand",[...e.expanded].sort().join(","));for(let o of Object.keys(e.pins).sort()){let r=e.pins[o];t.set(`pin.${o}`,`${xe(r.x)},${xe(r.y)}`)}e.pan&&(e.pan.x!==0||e.pan.y!==0)&&t.set("pan",`${xe(e.pan.x)},${xe(e.pan.y)}`);for(let o of Object.keys(e.within??{}).sort()){let r=e.within[o];r.length>0&&t.set(`in.${o}`,r)}e.q&&e.q.trim().length>0&&t.set("q",e.q);let n=t.toString();return n?`#${n}`:"#"}function $n(e){return e&&e.startsWith("agg:")?`aggregate:${e.slice(4)}`:e}function Ee(e){let t=e.includes("#")?e.slice(e.indexOf("#")+1):e,n=new URLSearchParams(t),o=Object.create(null);for(let[g,p]of n){if(!g.startsWith("pin."))continue;let[m,S]=p.split(","),k=m===void 0?null:be(m),h=S===void 0?null:be(S);k===null||h===null||(o[g.slice(4)]={x:k,y:h})}let r=Object.create(null);for(let[g,p]of n)!g.startsWith("in.")||p.length===0||(r[g.slice(3)]=p);let i=n.get("view");i&&i.length>0&&r.view===void 0&&(r.view=i);let a=n.get("pan")?.split(",")??[],u=a[0]===void 0?null:be(a[0]),l=a[1]===void 0?null:be(a[1]),c=(n.get("sel")??"").split(",").filter(g=>g.length>0).sort(),f=n.get("overview")==="1";return{...c.length>0?{selection:c}:{},...f?{overview:!0}:{},...n.get("zoom")==="1"?{zoom:!0}:{},...n.get("past")==="1"?{past:!0}:{},...n.get("show")?{shown:[...new Set(n.get("show").split(",").filter(Boolean))].sort()}:{},...u!==null&&l!==null?{pan:{x:u,y:l}}:{},...Object.keys(r).length>0?{within:r}:{},...n.get("q")?.trim()?{q:n.get("q")}:{},focusId:$n(n.get("focus")),relation:n.get("relation"),expanded:(n.get("expand")??"").split(",").filter(g=>g.length>0&&(f||!g.startsWith("kind:"))).sort(),pins:o}}function rr(e){let t=Ee(e);return U(t)==="#"?{...t,overview:!0}:t}function ir(e){let t=U(e);return t==="#overview=1"?"":t}function xe(e){return Math.round(e*100)/100}function Qt(e,t){return U(e)===U(t)}var Be="edge:";function ar(e,t,n){let o=r=>encodeURIComponent(r);return`${Be}${o(e)}:${o(t)}:${o(n)}`}function Xt(e){if(!e.startsWith(Be))return null;let t=e.slice(Be.length).split(":");if(t.length!==3)return null;let[n,o,r]=t;if(!n||!o||!r)return null;try{return{kind:decodeURIComponent(n),from:decodeURIComponent(o),to:decodeURIComponent(r)}}catch{return null}}function Re(e){let{pan:t,...n}=e;return{...n,pins:{}}}function $(e,t){if(t===e.focusId)return{...e,focusId:t};let n=Re(e);return{...n.within?.q!==void 0?ge(n,"q",null):n,focusId:t}}function Jt(e,t){return{...e,relation:t}}function ge(e,t,n){let o={...e.within??{}};if(n===null?delete o[t]:o[t]=n,Object.keys(o).length===0){let{within:r,...i}=e;return i}return{...e,within:o}}function je(e,t){if(t!==e.overview&&(e=Re(e)),!t){let n=e.expanded.filter(o=>!o.startsWith("kind:"));return{...e,overview:!1,expanded:n}}return{...e,overview:t}}function sr(e,t,n){let o=new Set(e.shown??[]);if(n?o.add(t):o.delete(t),o.size===0){let{shown:r,...i}=e;return i}return{...e,shown:[...o].sort()}}function Yn(e,t){if(t===null||t.trim().length===0){let{q:n,...o}=e;return o}return{...e,q:t}}function lr(e){let t=e.q!==void 0&&e.within?.q===e.q;return Yn(t?ge(e,"q",null):e,null)}function dr(e,t){if(!t){let{past:n,...o}=e;return o}return{...e,past:!0}}function Pe(e,t){if(t.length===0){let{selection:n,...o}=e;return o}return{...e,selection:[...t]}}function me(e,t){if(t!==(e.zoom===!0)&&(e=Re(e)),!t){let{zoom:n,...o}=e;return o}return{...e,zoom:!0}}function Me(e,t){let n=new Set(e.expanded);return n.has(t)?n.delete(t):n.add(t),{...e,expanded:[...n].sort()}}function cr(e,t){if(t===null||t.x===0&&t.y===0){let{pan:n,...o}=e;return o}return{...e,pan:t}}function ur(e){return Re(e)}function pr(e,t,n){let o={...e.pins};return n===null?delete o[t]:o[t]=n,{...e,pins:o}}var ke="aggregate:",Ae="kind:";function ze(e){return`${Ae}${e}`}function ne(e){return e.startsWith(Ae)?e.slice(Ae.length):null}var gr="kinds:beyond";function Qn(e){let t=ne(e);return t?[t]:X(e)}function oe(...e){return`${ke}${[...e].sort().join("+")}`}function Zt(e){return e.startsWith(ke)}function X(e){return!Zt(e)||e.includes("|")?[]:e.slice(ke.length).split("+").filter(Boolean)}function en(e,t,n={}){let o=ne(t);if(o!==null&&e.overview&&n.ownPicture!==!0)return Me(e,t);let r=o!==null?oe(o):t;if(e.zoom&&e.focusId===r&&!(o!==null&&n.carry))return me(e,!1);if(o!==null&&n.carry){let i=je({...$(e,r),relation:null},!1);return ge(me(i,!0),"q",n.carry)}return me({...$(e,r),relation:null},!0)}function Xn(e,t,n){return ge(je($(e,oe(t)),!1),"view",n)}function mr(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var tn="aggregate:";function qe(e){return e.startsWith(tn)&&e.includes("|")}function Jn(e,t){let n=0,o=138;for(let r of e.split(" ")){let i=t(r),a=o+t(" ")+i;if(a<=138)o=a;else{let u=Math.ceil(i/138)||1;n+=u,o=i-(u-1)*138}}return n}var Zn=16.25,Ue=27,eo=(e,t)=>{let n=Math.ceil(e.length*7.1/138);return t?Math.max(Ue,Math.ceil(Math.max(n,Jn(e,t))*Zn)+6):Math.max(Ue,n*16+6)};function to(e,t,n){return e.length===0?0:10+e.reduce((o,r)=>o+eo(r,n),0)+(e.length-1)*2}var nn=27,on=8,no=4,rn=64,oo=e=>Math.max(1,Math.min(on,e)),ro=e=>e*nn+rn;var io=(e,t)=>e.length*t*.58;var $e=C(F(),1),ao={turns:[],outcomes:new Map,busy:!1,open:!1,side:"left",pending:null,drawn:0,draft:null,draftNote:null},an=e=>`graview:seat:${e}`;function so(e){if(!e)return{};try{let t=sessionStorage.getItem(e);if(!t)return{};let n=JSON.parse(t);return{...Array.isArray(n.turns)?{turns:n.turns}:{},...Array.isArray(n.outcomes)?{outcomes:new Map(n.outcomes)}:{},...typeof n.open=="boolean"?{open:n.open}:{},...n.side==="left"||n.side==="right"?{side:n.side}:{},...n.draft?.drawn?{draft:n.draft}:{}}}catch{return{}}}function lo(e,t){if(e)try{sessionStorage.setItem(e,JSON.stringify({turns:t.turns.slice(-40),outcomes:[...t.outcomes],open:t.open,side:t.side,draft:t.draft}))}catch{}}function Ye(e){let t=e===null?null:an(e),n={...ao,...so(t)},o=new Set,r=(i,a=!0)=>{n=i,a&&lo(t,n);for(let u of[...o])u()};return{get:()=>n,subscribe(i){return o.add(i),()=>void o.delete(i)},setTurns:i=>r({...n,turns:i(n.turns)}),settle:(i,a)=>r({...n,outcomes:new Map(n.outcomes).set(i,a)}),setBusy:i=>r({...n,busy:i},!1),setOpen:i=>{n.open!==i&&r({...n,open:i})},setSide:i=>{n.side!==i&&r({...n,side:i})},ask:i=>r({...n,open:!0,pending:i.trim()||null}),takePending(){let i=n.pending;return i!==null&&r({...n,pending:null},!1),i},drawn(){return r({...n,drawn:n.drawn+1},!1),()=>r({...n,drawn:Math.max(0,n.drawn-1)},!1)},setDraft:(i,a=null)=>r({...n,draft:i,draftNote:a})}}function co(e){let t=()=>e.get().drawn>0;return(0,$e.useSyncExternalStore)(e.subscribe,t,t)}function uo(e){return(0,$e.useSyncExternalStore)(e.subscribe,e.get,e.get)}var Te=C(F(),1),Oe=(0,Te.createContext)(void 0),po=()=>(0,Te.useContext)(Oe);var Qe={};var fo="I can answer about what's in this app. Open questions need AI, which isn't on here.",yo="Answered with AI";var sn=e=>`graview:setting:${e}`;function ln(){return localStorage}function dn(e,t){try{let n=(t??ln()).getItem(sn(e.name));if(n!==null&&e.options.some(o=>o.value===n))return n}catch{}return e.initial}function cn(e,t,n){try{(n??ln()).setItem(sn(e.name),t)}catch{}}function un(e,t){if(typeof document>"u")return;let n=document.documentElement;if(e.honored==="root-font-size"){n.style.fontSize=t===e.initial?"":t;return}let o=`graview${e.name.replace(/-([a-z0-9])/g,(r,i)=>i.toUpperCase()).replace(/^[a-z]/,r=>r.toUpperCase())}`;t===e.initial?delete n.dataset[o]:n.dataset[o]=t}var O=C(F(),1);function pn(e){return e?.closest?.("[data-graview-pick]")?.getAttribute("data-graview-pick")??null}function Xe(e){return Se(e)}var go=12,mo=4;function ho(e,t,n){let o=Xe(t);return e.get(o)??{participant:o,who:t.id??t.kind,at:null,mode:"docked",since:n,trail:[]}}var Ve=(e,t)=>t===null||e[e.length-1]===t?e:[...e,t].slice(-go);function fn(e,t){let n=e.filter(r=>r.length>0);if(n.length===0)return null;if(n.length<=mo)return n[0];let o=new Set(n.map(r=>t(r)).filter(r=>r!==void 0));return o.size===1?ze([...o][0]):n[0]}function Je(e,t,n){let o=new Map(e);if(t.type==="rest"){for(let[a,u]of e)u.mode!=="asking"&&u.mode!=="docked"&&t.at-u.since>=t.holdMs&&o.set(a,{...u,mode:"docked",at:null,trail:[],say:void 0,confidence:void 0});return o}if(t.author.kind!=="agent")return o;let r=ho(e,t.author,t.at),i=a=>o.set(r.participant,{...r,...a,since:t.at});switch(t.type){case"read":{let a=fn(t.ids,n);return i({at:a,mode:"reading",trail:Ve(r.trail,a)}),o}case"about-to-write":case"write":{let a=fn(t.ids,n);return i({at:a,mode:"writing",trail:Ve(r.trail,a),say:void 0,confidence:void 0}),o}case"refused":return i({at:t.where,mode:"refused",say:t.say,confidence:void 0,trail:Ve(r.trail,t.where)}),o;case"asking":return i({at:t.where??r.at,mode:"asking",say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},trail:Ve(r.trail,t.where)}),o;case"said":return i({say:t.say,...t.confidence!==void 0?{confidence:t.confidence}:{confidence:void 0},...t.caption?{caption:t.caption}:{}}),o;case"over":return i({over:t.over}),o;case"home":return i({at:null,mode:"docked",trail:[],say:void 0,confidence:void 0,over:null}),o;default:return o}}var yn="graview:session";function gn(e){let t=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10);try{let n=e??sessionStorage,o=n.getItem(yn);if(o)return o;let r=t();return n.setItem(yn,r),r}catch{return t()}}var Ze={name:"share-where",title:"Where you are",description:"Whether the others here see which stop you are on.",honored:"root-attribute",options:[{value:"shared",label:"Shown"},{value:"private",label:"Hidden"}],initial:"shared"},et={name:"share-over",title:"What you point at",description:"Whether the others see the thing under your pointer, outlined in your color.",honored:"root-attribute",options:[{value:"private",label:"Kept to yourself"},{value:"shared",label:"Outlined for others"}],initial:"private"},mn=[Ze,et],So=800;function hn(e){let{channel:t,store:n,view:o,principal:r,session:i,robots:a,seatWho:u,settingValues:l,setView:c,ttlMs:f=1e4,people:g,seats:p}=e,[m,S]=(0,O.useState)(()=>new Map),[k,h]=(0,O.useState)(null),[v,w]=(0,O.useState)(null),[x,R]=(0,O.useState)(null),N=typeof r.id=="string"&&r.id.length>0,V=N&&(l[Ze.name]??Ze.initial)==="shared",W=V&&(l[et.name]??et.initial)==="shared",M=Xe({kind:r.kind,...r.id?{id:r.id}:{},session:i}),b=N?Ft(r,{graph:n.graph,schema:n.schema,...p?{seats:p}:{},...g?{people:g}:{}}):"",A=u?a.get(`agent:${u}:${i}`):void 0,L=(0,O.useMemo)(()=>!t||!V?null:{participant:M,kind:r.kind,name:b,...r.onBehalfOf?.id?{onBehalfOf:r.onBehalfOf.id,...r.onBehalfOf.name?{onBehalfOfName:r.onBehalfOf.name}:{}}:{},hue:jt(r.id??"nobody"),stop:x??U(o),...W?{over:k}:{},...A?{robot:{at:A.at,mode:A.mode}}:{},at:new Date().toISOString()},[t,V,W,M,b,r.id,r.kind,r.onBehalfOf?.id,r.onBehalfOf?.name,o,x,k,A?.at,A?.mode]);(0,O.useEffect)(()=>{if(!t||!L)return;t.here(L);let T=setInterval(()=>t.here({...L,at:new Date().toISOString()}),So);return()=>clearInterval(T)},[t,L]),(0,O.useEffect)(()=>t?t.onWho(D=>S(Ke(new Map,D,Date.now(),f))):void 0,[t,f]);let we=m.size>0;(0,O.useEffect)(()=>{if(!we)return;let T=setInterval(()=>{S(D=>{let K=Ke(D,[],Date.now(),f);return K.size===D.size?D:K})},Math.max(250,Math.min(1e3,f/4)));return()=>clearInterval(T)},[we,f]),(0,O.useEffect)(()=>{if(!t||typeof window>"u")return;let T=()=>t.leave();return window.addEventListener("pagehide",T),()=>window.removeEventListener("pagehide",T)},[t]),(0,O.useEffect)(()=>{if(!W||typeof document>"u")return;let T=null,D=K=>{let Z=pn(K.target);Z!==T&&(T=Z,h(Z))};return document.addEventListener("pointermove",D,{passive:!0}),()=>document.removeEventListener("pointermove",D)},[W]);let Q=(0,O.useRef)(null),H=v?m.get(v)??null:null,J=(0,O.useCallback)(T=>{Q.current=null,w(T)},[]);return(0,O.useEffect)(()=>{if(v){if(!H){w(null);return}H.stop!==Q.current?.stop&&(Q.current={stop:H.stop,at:Date.now()},c(Ee(H.stop)))}},[v,H,c]),(0,O.useEffect)(()=>{let T=Q.current;!v||T===null||Date.now()-T.at<400||Qt(o,Ee(T.stop))||w(null)},[o,v]),(0,O.useEffect)(()=>{if(!v||typeof document>"u")return;let T=D=>{D.key==="Escape"&&w(null)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[v]),(0,O.useMemo)(()=>({who:m,sharing:L?{participant:M,name:b}:null,following:H,follow:J,sayWhere:R}),[m,L,M,b,H,J])}var B=C(F(),1);function wn(e){return Se(e.author)}function vo(e,t){return e.length>1?"co-edited":t==="rule"?"rule":t==="agent"?"autonomous":"directed"}function Sn(e,t,n,o,r){let i=new Map;for(let[l,c]of e)o-c.at<r&&i.set(l,c);let a=new Set(n.flatMap(l=>l.nodeIds)),u=(l,c,f)=>{let g=i.get(l),p=g?.participants.includes(wn(c))?g.participants:[...g?.participants??[],wn(c)];i.set(l,{at:o,manner:vo(p,c.author.kind),intent:c.intent,wrote:(g?.wrote??!1)||(f.wrote??!1),read:(g?.read??!1)||(f.read??!1),broke:(g?.broke??!1)||a.has(l),participants:p})};for(let l of t){for(let c of l.writes)u(c,l,{wrote:!0});for(let c of l.reads)l.writes.includes(c)||u(c,l,{read:!0})}for(let l of n)for(let c of l.nodeIds){let f=i.get(c);i.set(c,{at:o,manner:f?.manner??"rule",intent:f?.intent??l.message,wrote:f?.wrote??!1,read:f?.read??!1,broke:!0,participants:f?.participants??["rule::"]})}return i}var bo=2600;function vn(e,t=bo){let[n,o]=(0,B.useState)(()=>new Map),r=(0,B.useRef)(n);r.current=n;let i=(0,B.useRef)(null),a=(0,B.useCallback)(l=>{r.current=l,o(l),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current=new Map,o(new Map)},t)},[t]);(0,B.useEffect)(()=>{let l=e.violations(),c=e.subscribe((f,g)=>{let p=e.violations(),m=$t(e.allInvariants(),l,p).introduces;l=p,a(Sn(r.current,g,m.map(S=>({nodeIds:S.nodeIds,message:S.message})),Date.now(),t))});return()=>{c(),i.current&&clearTimeout(i.current)}},[e,t,a]);let u=(0,B.useCallback)(l=>{l.reads.length!==0&&a(Sn(r.current,[xo(l)],[],Date.now(),t))},[t,a]);return{activity:n,noteAttention:u}}function xo(e){return{id:`attention:${e.intent}`,seq:-1,batch:"attention",author:e.author,intent:e.intent,mutation:null,primitives:[],inverse:[],reads:e.reads,writes:[],at:new Date().toISOString()}}var s=C(F(),1);function bn(){let e=null,t=new Set,n=new Set,o=r=>{for(let i of n)i(r)};return{subscribe(r){return t.add(r),t.size===1&&o(!0),()=>{t.delete(r),t.size===0&&(e=null,o(!1))}},snapshot:()=>e,set(r){if(!(e===r||e&&r&&e.x===r.x&&e.y===r.y)){e=r;for(let i of t)i()}},get listeners(){return t.size},onActive(r){return n.add(r),()=>void n.delete(r)}}}function xn(){let e=!1,t=new Set;return{moving:()=>e,set(n){if(n!==e){e=n;for(let o of t)o()}},subscribe(n){return t.add(n),()=>t.delete(n)}}}var re=C(ve(),1),Ie=(0,s.createContext)(null),Pn=(0,s.createContext)("scene");function Eo({mode:e,children:t}){return(0,re.jsx)(Pn.Provider,{value:e,children:t})}function Ro(){return(0,s.useContext)(Pn)}var Mn={kind:"human"},Po=[],Mo=[],Ao=[],tt=[];function An(e,t){let n=(0,s.useId)();(0,s.useEffect)(()=>{if(!globalThis.__graviewWatch)return;let o=t??Mn,r=()=>{qt(e,o,n),Ut(e)};r();let i,a=e.subscribe(()=>{clearTimeout(i),i=setTimeout(r,250)});return()=>{clearTimeout(i),a(),globalThis.__graviewWatch?.unseen?.({words:[],from:n,gone:!0})}},[e,t,n])}function ko({store:e,views:t,initialView:n,scheme:o="dark",initialSelection:r,principal:i,seats:a=Po,onSeat:u,people:l=Mo,memory:c,presenceTtlMs:f,app:g,settings:p=g?.settings??Ao,presence:m,brand:S,onKeepLens:k,providers:h,ai:v=Qe,files:w,view:x,onViewChange:R,children:N}){let[V,W]=(0,s.useState)(null),M=V??i??a[0]?.principal??Mn,b=(0,s.useMemo)(()=>e.seenBy(M),[e,M]);An(e,M);let[A]=(0,s.useState)(()=>gn(c)),[L,we]=(0,s.useState)(!1),Q=(0,s.useCallback)(()=>we(!0),[]),H=(0,s.useMemo)(()=>m?[...p,...mn]:p,[p,m]),[J]=(0,s.useState)(()=>n??ot(t,e.schema)),[T,D]=(0,s.useState)(()=>Pe(J??te,r??J?.selection??[])),K=(0,s.useRef)(J??te).current,[Z,Fn]=(0,s.useState)(null),[ft,Gn]=(0,s.useState)(null),De=(0,s.useContext)(Ie),[yt]=(0,s.useState)(()=>De?.seatTalk??Ye(S?.name??e.schema.kinds.join(","))),We=k??De?.onKeepLens,gt=g??De?.app,mt=(0,s.useRef)(null),ht=(0,s.useCallback)(d=>{mt.current=d},[]),wt=(0,s.useCallback)(d=>mt.current?.whereIs(d)??null,[]),[St]=(0,s.useState)(()=>bn()),[vt]=(0,s.useState)(()=>xn()),[Fe,Kn]=(0,s.useState)(null),[de,bt]=(0,s.useState)(()=>new Map),ce=(0,s.useRef)(de);ce.current=de;let ue=(0,s.useRef)(null),Ge=(0,s.useCallback)(d=>b.graph.getNode(d)?.kind,[b]),q=(0,s.useCallback)(d=>{let y=Je(ce.current,d,Ge);ce.current=y,bt(y),ue.current&&clearTimeout(ue.current),[...y.values()].some(P=>P.mode!=="docked"&&P.mode!=="asking")&&(ue.current=setTimeout(()=>{let P=Je(ce.current,{type:"rest",at:Date.now(),holdMs:nt},Ge);ce.current=P,bt(P)},nt+20))},[Ge]),xt=(0,s.useCallback)(d=>q({...d,at:d.at??Date.now()}),[q]),Et=(0,s.useCallback)(d=>{Kn(d),d&&q({type:"home",author:{kind:"agent",id:d,session:A},at:Date.now()})},[q,A]);(0,s.useEffect)(()=>b.subscribe((d,y)=>{for(let E of y)E.author.kind==="agent"&&q({type:"write",author:E.author,ids:E.writes,at:Date.now()})}),[b,q]),(0,s.useEffect)(()=>()=>{ue.current&&clearTimeout(ue.current)},[]);let z=(0,s.useMemo)(()=>({...M,session:A}),[M,A]),Rt=(0,s.useCallback)(d=>{W(d),u?.(d)},[u]),[pe,Bn]=(0,s.useState)(()=>Object.fromEntries(H.map(d=>[d.name,dn(d,c)])));(0,s.useEffect)(()=>{for(let d of H)un(d,pe[d.name]??d.initial)},[H,pe]);let Pt=(0,s.useCallback)((d,y)=>{let E=H.find(P=>P.name===d);!E||!E.options.some(P=>P.value===y)||(cn(E,y,c),Bn(P=>({...P,[d]:y})))},[H,c]),[Mt,jn]=(0,s.useState)(null),{activity:At,noteAttention:kt}=vn(b),Tt=(0,s.useCallback)(d=>{kt(d),q({type:"read",author:d.author,ids:d.reads,at:Date.now()})},[kt,q]),ee=(0,s.useCallback)(d=>{if(ne(d)!==null||X(d).length>0||qe(d))return!0;let y=Xt(d);return y?b.graph.allEdges().some(E=>E.kind===y.kind&&E.from===y.from&&E.to===y.to):b.graph.getNode(d)!==void 0},[b]),Ot=(0,s.useCallback)(d=>{let y=d.selection??tt,E=y.filter(ee),P=E.length===y.length?d:Pe(d,E);return P.focusId!==null&&!ee(P.focusId)&&(P=$(P,null)),P},[ee]),fe=(0,s.useCallback)(d=>{let y=Ot(d),E=Rn(b,z,y.shown);if(y.focusId!==null&&E.size>0){let P=X(y.focusId),Wt=b.graph.getNode(y.focusId);(P.length>0?P.every(Un=>E.has(Un)):Wt?E.has(Wt.kind):!1)&&(y={...y,focusId:null})}if(!y.overview&&y.focusId===null){let P=K.focusId!==null&&!ee(K.focusId)?ot(t,e.schema)??{...te,overview:!0}:K;P.focusId!==null&&ee(P.focusId)?y={...y,focusId:P.focusId}:P.overview===!0&&(y={...y,overview:!0})}return y},[Ot,ee,b,K,z,t,e.schema]),G=fe(x??T),Vt=(0,s.useMemo)(()=>Rn(b,z,G.shown),[b,z,G.shown]),It=(0,s.useMemo)(()=>[...b.modules.administered.entries()].map(([d,y])=>{let E=b.mayAdminister(d,z);return{name:d,...y.description?{description:y.description}:{},kinds:y.kinds??[],canShow:E,shown:E&&(G.shown??[]).includes(d)}}),[b,z,G.shown]),ye=(0,s.useCallback)(d=>{let y=E=>fe(typeof d=="function"?d(E):d);if(x!==void 0){R?.(y(x));return}R&&R(y(G)),D(E=>y(E))},[G,R,x,fe]);(0,s.useEffect)(()=>{x===void 0&&D(d=>{let y=fe(d);return y===d?d:y})},[G,x,fe]);let Lt=G.selection??tt,Ct=(0,s.useCallback)(d=>{ye(y=>Pe(y,typeof d=="function"?d(y.selection??tt):d))},[ye]),{who:_t,following:Nt,follow:Ht,sayWhere:zn,sharing:Dt}=hn({channel:m,store:b,view:G,principal:z,session:A,robots:de,seatWho:Fe,settingValues:pe,setView:ye,seats:a,people:l,...f!==void 0?{ttlMs:f}:{}}),qn=(0,s.useMemo)(()=>({store:b,scheme:o,views:t,view:G,setView:ye,homeView:K,selection:Lt,setSelection:Ct,menuAt:Z,setMenuAt:Fn,whereIs:wt,pointer:St,motion:vt,registerScene:ht,robots:de,noteSeat:xt,seatWho:Fe,registerSeatWho:Et,actsDoor:ft,registerActsDoor:Gn,seatTalk:yt,...c?{memory:c}:{},who:_t,following:Nt,follow:Ht,sayWhere:zn,sharing:Dt,session:A,ai:v,movedByHand:L,noteMoved:Q,emphasis:Mt,setEmphasis:jn,activity:At,noteAttention:Tt,principal:z,seats:a,people:l,takeSeat:Rt,settings:H,settingValues:pe,chooseSetting:Pt,hiddenKinds:Vt,administered:It,...h?{providers:h}:{},...S?{brand:S}:{},...We?{onKeepLens:We}:{},app:gt}),[b,o,t,G,ye,Lt,Ct,Z,wt,St,vt,ht,de,xt,Fe,Et,ft,yt,c,_t,Nt,Ht,Dt,A,v,L,Q,Mt,At,Tt,z,a,l,Rt,H,pe,Pt,Vt,It,h,S,We,gt]);return(0,re.jsx)(Ie.Provider,{value:qn,children:(0,re.jsx)(To,{children:w?(0,re.jsx)(Oe.Provider,{value:w,children:N}):N})})}var kn=(0,s.createContext)(null);function To({children:e}){let{store:t,view:n,views:o,principal:r,hiddenKinds:i,selection:a}=Y(),u=Le(),l=n.q,c=n.focusId,f=!!(l&&l.trim().length>0),g=(0,s.useMemo)(()=>f?{flagged:new Set(t.violations().flatMap(S=>S.nodeIds)),touched:Kt(t.log.all())}:null,[t,u,f]),p=c?t.graph.getNode(c)?.kind??ne(c)??(X(c).length===1?X(c)[0]:void 0):void 0,m=(0,s.useMemo)(()=>!l||!g?null:Bt(t,l,{...p?{inKind:p}:{},principal:r,places:o.places(),kinds:t.schema.kinds.filter(S=>!i.has(S)),from:[...a,...c&&t.graph.has(c)?[c]:[]],flagged:g.flagged,touched:g.touched,limit:200}),[t,l,r,o,i,a,c,p,g]);return(0,re.jsx)(kn.Provider,{value:m,children:e})}var En=new WeakMap;function ri(e){let t=En.get(e);return t||En.set(e,t=new Set(e.matched)),t}function Oo(){return(0,s.useContext)(kn)}function Y(){let e=(0,s.useContext)(Ie);if(!e)throw new Error("useGraview must be used inside a <GraviewProvider>.");return e}function Vo(){return(0,s.useContext)(Ie)??null}function Le(){let{store:e}=Y(),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useCallback)(()=>(n.current!==e&&(n.current=e,t.current=null),t.current??=e.graph.allNodes(),t.current),[e]),r=(0,s.useCallback)(i=>e.subscribe(()=>{t.current=null,i()}),[e]);return(0,s.useSyncExternalStore)(r,o,o)}function Io(e){let{store:t}=Y(),n=(0,s.useCallback)(r=>t.subscribe(r),[t]),o=(0,s.useCallback)(()=>e===null?void 0:t.graph.getNode(e),[t,e]);return(0,s.useSyncExternalStore)(n,o,o)}function Rn(e,t,n){let o=new Set(e.modules.disabledKinds);for(let r of e.kindsKeptFrom(t))o.add(r);for(let[r,i]of e.modules.administered)if(!(e.mayAdminister(r,t)&&(n??[]).includes(r)))for(let a of i.kinds??[])o.add(a);return o}var nt=2600;function ot(e,t){let n=Yt(e.arrangement?.()?.first,t,e.places());if(!(!n||n.to==="home"))return n.to==="place"?{...te,focusId:oe(n.place.kind),within:{view:n.place.as}}:{...te,focusId:oe(n.kind)}}var Ce=Symbol.for("graview.default-view");function Tn(e){return Object.defineProperty(e,Ce,{value:!0,enumerable:!1}),e}function On(e){return typeof e=="function"&&e[Ce]===!0}var rt=Symbol.for("graview.replaces-page");function Vn(e){return typeof e=="function"&&e[rt]===!0}function Co(e){return Gt(e)}function _o(e,t){if(t===e)return e;for(let r of t.registrations()){let i={...r.title?{title:r.title}:{},...r.across?{across:r.across}:{},...r.beside?{beside:!0}:{}};e.register(r.kind,{cardinality:r.cardinality,fidelity:r.fidelity},r.view,i)}let n=t.arrangement?.();n&&e.arrange?.(n);let o=t.homeView?.();return o&&e.home?.(o),e}var ae=C(F(),1);function No(){let{selection:e,setSelection:t}=Y();return(0,ae.useMemo)(()=>({selection:e,set:n=>t(n),clear:()=>t([]),toggle:n=>t(o=>o.includes(n)?o.filter(r=>r!==n):[...o,n]),isSelected:n=>e.includes(n)}),[e,t])}function Ho(){let{store:e}=Y(),t=Le();return(0,ae.useMemo)(()=>Do(e),[e,t])}var In=new WeakMap;function Do(e){let t=In.get(e);if(!t){let n={violations:null};e.subscribe(()=>{n.violations=null}),In.set(e,n),t=n}return t.violations??=e.violations(),t.violations}function Wo(){let{view:e,setView:t}=Y();return(0,ae.useMemo)(()=>({view:e,url:U(e),focus:n=>t(o=>$(o,n)),show:n=>t(o=>Jt(o,n)),toggle:n=>t(o=>Me(o,n)),go:n=>t(n)}),[e,t])}var ie={at:0,depth:0,listeners:new Set,tell(){for(let e of this.listeners)e()}};typeof window<"u"&&window.addEventListener("popstate",e=>{let t=e.state;ie.at=typeof t?.graview=="number"?t.graview:0,ie.at>ie.depth&&(ie.depth=ie.at),ie.tell()});var I=C(F(),1),at={profile:{trigger:"profile-button",pane:"profile",opens:"press",focus:"into",drawn:["shell","embed"]},problems:{trigger:"standing",pane:"problems",opens:"press",focus:"into",drawn:["shell","embed"]},places:{trigger:"app-places-open",pane:"app-places",opens:"press",focus:"into",drawn:["embed"]},here:{trigger:"here-open",pane:"here-list",opens:"press",focus:"into",drawn:["shell","embed","pages"]},activity:{trigger:"activity-button",pane:"activity",opens:"press",focus:"into",drawn:["shell","embed","pages"]},find:{trigger:"find-box",pane:"find-strip",opens:"typing",focus:"stays",drawn:["shell"]},districts:{trigger:"beyond-more",pane:"beyond-list",opens:"press",focus:"into",drawn:["shell","embed"]},acts:{trigger:null,pane:"context-menu",opens:"context-menu",focus:"into",drawn:["shell","embed"]},arrange:{trigger:"arrange-add",pane:"arrange-list",opens:"press",focus:"into",drawn:["pages"]},"studio-ask":{trigger:"studio-agent",pane:"studio-agent-panel",opens:"press",focus:"into",drawn:["studio"]}},Fo={position:"fixed",inset:"auto",margin:0,zIndex:zt("popover"),boxSizing:"border-box"},_e=6,se=8,Go=e=>typeof e.showPopover=="function";function Ne(e){try{return e.matches(":popover-open")}catch{return!1}}function Ko(e){if(typeof e=="function"){let o=e();return o?{left:o.x,right:o.x,top:o.y,bottom:o.y}:null}let t=e.current;if(!t||!t.isConnected)return null;let n=t.getBoundingClientRect();return{left:n.left,right:n.right,top:n.top,bottom:n.bottom}}function st(e,t,n={}){let o=Ko(t);if(!o)return;let r={width:document.documentElement.clientWidth||innerWidth,height:innerHeight},i=e.dataset.graviewDesignedHeight??=e.style.maxHeight;e.style.maxHeight=i;let a=e.getBoundingClientRect(),u=r.height-o.bottom-_e-se,l=o.top-_e-se,c=a.height<=u||u>=l,f=Math.max(96,Math.floor(c?u:l)),g=Math.min(a.height,f);a.height>f&&(e.style.maxHeight=i?`min(${i}, ${f}px)`:`${f}px`);let p=a.width,m=n.align==="start"?o.left:o.right-p,S=typeof t=="function"?null:t.current?.closest("[data-graview-embed]")?.getBoundingClientRect();S&&p<=S.right-S.left&&(m<S.left?m=o.left+p<=S.right?o.left:S.left:m+p>S.right&&(m=o.right-p>=S.left?o.right-p:S.right-p));let k=p>=r.width-2*se?Math.max(0,(r.width-p)/2):Math.max(se,Math.min(m,r.width-se-p)),h=c?o.bottom+_e:Math.max(se,o.top-_e-g);e.style.left=`${Math.round(k)}px`,e.style.top=`${Math.round(h)}px`}function Ln(e,t,n,o={}){let r=o.align??"end";(0,I.useLayoutEffect)(()=>{let i=e.current;if(!t||!i)return;if(Go(i)&&!Ne(i))try{i.showPopover(),jo()}catch{}let a=0,u=c=>{c?.target instanceof Node&&i.contains(c.target)||(cancelAnimationFrame(a),a=requestAnimationFrame(()=>st(i,n,{align:r})))};st(i,n,{align:r}),addEventListener("resize",u),addEventListener("scroll",u,!0);let l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>u());return l?.observe(i),()=>{if(cancelAnimationFrame(a),removeEventListener("resize",u),removeEventListener("scroll",u,!0),l?.disconnect(),i.isConnected&&Ne(i))try{i.hidePopover()}catch{}}},[t,e,r])}var lt=new Set;function Bo(e){return lt.add(e),()=>lt.delete(e)}function jo(){for(let e of lt)if(!(!e.isConnected||!Ne(e)))try{e.hidePopover(),e.showPopover()}catch{}}var le=null,zo='button:not([disabled]), [href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])';function qo(e){for(let t of e.querySelectorAll(zo))if(t.closest("[hidden]")===null&&getComputedStyle(t).visibility!=="hidden")return t;return e}var it=()=>{let e=document.activeElement;return e===null||e===document.body};function Uo(e,t={}){let{at:n,returnTo:o,onOpenChange:r}=t,i=t.popover!==!1,[a,u]=(0,I.useState)(!1),l=t.open??a,c=(0,I.useRef)(null),f=(0,I.useRef)(null),g=(0,I.useCallback)(w=>{c.current=w},[]),p=(0,I.useCallback)(w=>{f.current=w},[]),m=`graview-popover-${(0,I.useId)().replace(/:/g,"")}`,S=(0,I.useRef)({onOpenChange:r,returnTo:o,controlled:t.open!==void 0});S.current={onOpenChange:r,returnTo:o,controlled:t.open!==void 0};let k=(0,I.useCallback)(w=>{S.current.controlled||u(w),S.current.onOpenChange?.(w)},[]),h=(0,I.useCallback)(()=>{(document.querySelector(`[aria-controls="${m}"]`)??c.current??S.current.returnTo?.()??null)?.focus({preventScroll:!0})},[m]),v=(0,I.useCallback)(w=>{let x=f.current,R=typeof document>"u"?null:document.activeElement,N=R===null||R===document.body||x!==null&&x.contains(R);k(!1),!(!w||!N)&&(h(),requestAnimationFrame(()=>{it()&&h()}))},[k,h]);return Ln(f,i&&l,n??c,t.align?{align:t.align}:{}),(0,I.useEffect)(()=>{if(!i||!l)return;let w={name:e,close:()=>v(!1)};if(le&&le.close!==w.close&&le.close(),le=w,at[e].focus==="into"){let M=f.current;M&&!M.contains(document.activeElement)&&qo(M).focus({preventScroll:!0})}let x=M=>{M.key==="Escape"&&v(!0)},R=M=>{let b=M.target;if(!(b instanceof Node))return;let A=f.current;if(A?.contains(b)||c.current?.contains(b))return;let L=b instanceof Element?b.closest('[role="dialog"], [role="alertdialog"]'):null;L&&!(A&&L.contains(A))||(v(!1),at[e].focus==="into"&&requestAnimationFrame(()=>{(it()||A!==null&&A.contains(document.activeElement))&&h()}))},N=null,V=null,W=M=>{let b=M.target;if(!(b instanceof Element))return;let A=f.current,L=b.closest('[role="dialog"], [role="alertdialog"]');!L||A&&(A.contains(L)||L.contains(A))||(N=L,v(!1))};return document.addEventListener("keydown",x),document.addEventListener("pointerdown",R,!0),document.addEventListener("focusin",W),()=>{document.removeEventListener("keydown",x),document.removeEventListener("pointerdown",R,!0),document.removeEventListener("focusin",W);let M=N;M&&typeof MutationObserver<"u"&&(V?.disconnect(),V=new MutationObserver(()=>{M.isConnected||(V?.disconnect(),requestAnimationFrame(()=>{(it()||document.activeElement.closest("[hidden]")!==null)&&h()}))}),V.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>V?.disconnect(),10*6e4)),le?.close===w.close&&(le=null)}},[i,l,e,v,h]),{open:l,setOpen:w=>w?k(!0):v(!0),toggle:()=>l?v(!0):k(!0),trigger:{ref:g,"aria-expanded":l,"aria-controls":m,"data-graview-popover-trigger":e},pane:{ref:p,id:m,popover:"manual",tabIndex:-1,"data-graview-popover":e,"data-graview-overlay":""}}}var _=C(F(),1),j=C(ve(),1),dt=new Set,Cn=!1;function ct(){for(let e of[...dt])e()}function $o(){Cn||typeof window>"u"||(Cn=!0,window.addEventListener("online",ct))}function Yo(e){let t,n=!1,o=!1,r,i=0,a=new Set,u=()=>{i+=1;for(let p of[...a])p()},l=p=>(a.add(p),()=>void a.delete(p)),c=()=>i,f=()=>void g().catch(()=>{});function g(){if(n)return Promise.resolve(t);if(r)return r;let p=e().then(m=>(t=m,n=!0,o=!1,r=void 0,dt.delete(f),u(),m),m=>{throw r=void 0,o=!0,dt.add(f),$o(),u(),m});return p.catch(()=>{}),r=p,p}return{load:g,prefetch:f,get current(){return t},get failed(){return o},part(p,m={}){let S=m.what??"This part";function k(w){(0,_.useSyncExternalStore)(l,c,c);let x=(0,_.useRef)(null),R=(0,_.useRef)(null),N=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{o&&r===void 0&&f()},[]),n&&typeof document<"u"&&x.current!==null&&document.activeElement===x.current&&(N.current=!0),(0,_.useLayoutEffect)(()=>{if(!(!n||!N.current)){N.current=!1;for(let V=R.current?.nextElementSibling??null;V!==null;V=V.nextElementSibling){let W=V.matches(_n)?V:V.querySelector(_n);if(W instanceof HTMLElement){W.focus();return}}}}),n?(0,j.jsxs)(j.Fragment,{children:[N.current?(0,j.jsx)("span",{ref:R,hidden:!0}):null,p(t,w)]}):m.quiet?null:(0,j.jsx)(Qo,{what:S,button:x,...m.as?{as:m.as}:{}})}let h=(0,_.lazy)(()=>g().then(()=>({default:k}),()=>({default:k})));function v(w){let[x]=(0,_.useState)(()=>n||o);return(0,_.createElement)(x?k:h,w)}return v}}}var _n="button,a[href],input,select,textarea,[tabindex]:not([tabindex='-1'])";function Qo({what:e,button:t,as:n="p"}){let r=typeof navigator<"u"&&navigator.onLine===!1?`${e} will load when you're back online.`:`${e} didn't load.`;return(0,j.jsxs)(n,{"data-testid":"lazy-part-missing",style:{margin:0,fontSize:"0.875rem",color:"var(--graview-ink-muted)"},children:[(0,j.jsx)("span",{role:"status",children:r})," ",(0,j.jsx)("button",{ref:t,type:"button","data-testid":"lazy-part-retry",onClick:ct,style:{font:"inherit",fontWeight:600,color:"var(--graview-ink)",background:"none",border:"1px solid var(--graview-edge)",borderRadius:6,padding:"2px 10px"},children:"Try again"})]})}var He=C(F(),1);var Xo=(0,He.createContext)(null);var Nn=C(F(),1),Jo=(0,Nn.createContext)(!1);var Hn=C(F(),1),Zo=(0,Hn.createContext)(null);var Dn=C(F(),1),ut='button:not([disabled]), a[href], input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])',pt=e=>e instanceof HTMLElement&&(e.matches(ut)||e.hasAttribute("tabindex")),he=e=>typeof e.checkVisibility=="function"?e.checkVisibility():e.getClientRects().length>0;function er(e,t){let n=l=>l.replace(/["\\]/g,"\\$&"),o=t.getAttribute("data-testid"),r=t.getAttribute("data-graview-pick"),i=t.getAttribute("aria-label"),a=o?`[data-testid="${n(o)}"]`:r?`[data-graview-pick="${n(r)}"]`:i?`${t.tagName.toLowerCase()}[aria-label="${n(i)}"]`:null;if(!a)return null;let u=e.querySelector(a);return u&&pt(u)&&he(u)?u:null}var tr=e=>e.isConnected&&pt(e)&&!e.matches(":disabled")&&e instanceof HTMLElement&&he(e);function Wn(e,t){let n=t?er(e,t):null;if(n)return n;let o=e.querySelector("[data-graview-view][tabindex]");if(o&&he(o))return o;for(let r of e.querySelectorAll(ut))if(he(r))return r;return pt(e)&&he(e)?e:null}function nr(e){(0,Dn.useEffect)(()=>{let t=e.current;if(!t||typeof MutationObserver>"u")return;let n=[],o=h=>{let v=h.target;if(v instanceof Element){n=[];for(let w=v;w&&w!==t.parentElement;w=w.parentElement)n.push(w)}},r=!1,i=!1,a=t.ownerDocument,u=()=>!i&&a.defaultView!==null,l=(h,v)=>void setTimeout(()=>u()&&v(),h),c=h=>void requestAnimationFrame(()=>u()&&h()),f=h=>{if(r=!1,i)return;let v=a.activeElement;if(!(!(v===null||v===a.body||v===a.documentElement)||n.length===0)){if(tr(n[0])){h&&n[0]instanceof HTMLElement&&n[0].focus({preventScroll:!0});return}for(let x of n.slice(1)){if(!x.isConnected)continue;let R=Wn(x,n[0]);if(R){R.focus({preventScroll:!0}),n=[];return}}}},g=(h,v=Date.now()+2500)=>{l(100,()=>{f(h);let w=a.activeElement;(w===null||w===a.body||w===a.documentElement)&&n.length>0&&Date.now()<v&&g(h,v)})},p=()=>{r||n.length===0||(r=!0,l(60,()=>c(()=>{f(!1),g(!1)})))},m=h=>{if(!(h instanceof KeyboardEvent&&!["Enter"," ","Escape"].includes(h.key))){if(!(h instanceof KeyboardEvent)){let v=h.target instanceof Element?h.target.closest(ut):null,w=a.activeElement,x=w===null||w===a.body||w===a.documentElement;if(v&&x&&t.contains(v)){n=[];for(let R=v;R&&R!==t.parentElement;R=R.parentElement)n.push(R);l(150,()=>c(()=>{f(!1),g(!1)}));return}}!(h instanceof KeyboardEvent)&&!(h.target instanceof Node&&n[0]?.contains(h.target))||l(150,()=>c(()=>{f(!0),g(!0)}))}},S=new MutationObserver(()=>{n.length>0&&!n[0].isConnected&&p()}),k=h=>{h.relatedTarget===null&&p()};return t.addEventListener("focusin",o),t.addEventListener("focusout",k),t.addEventListener("click",m),t.addEventListener("keydown",m),S.observe(t,{childList:!0,subtree:!0}),()=>{i=!0,t.removeEventListener("focusin",o),t.removeEventListener("focusout",k),t.removeEventListener("click",m),t.removeEventListener("keydown",m),S.disconnect()}},[e])}export{te as a,U as b,Ee as c,rr as d,ir as e,Qt as f,ar as g,Xt as h,$ as i,Jt as j,ge as k,je as l,sr as m,Yn as n,lr as o,dr as p,Pe as q,me as r,Me as s,cr as t,ur as u,pr as v,ke as w,ze as x,ne as y,gr as z,Qn as A,oe as B,Zt as C,X as D,en as E,Xn as F,mr as G,tn as H,qe as I,Ue as J,to as K,nn as L,no as M,rn as N,oo as O,ro as P,io as Q,fo as R,yo as S,Ye as T,co as U,uo as V,pn as W,Oe as X,po as Y,Eo as Z,Ro as _,An as $,ko as aa,ri as ba,Oo as ca,Y as da,Vo as ea,Le as fa,Io as ga,ot as ha,Xo as ia,Tn as ja,On as ka,Vn as la,Co as ma,_o as na,Jo as oa,Zo as pa,No as qa,Ho as ra,Wo as sa,ie as ta,nr as ua,Fo as va,Ne as wa,Bo as xa,Uo as ya,Yo as za};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as N,c as S}from"./chunk.
|
|
1
|
+
import{a as b,b as N,c as S}from"./chunk.DCIC3YHX.js";import{d as y}from"./chunk.6LJ66MB7.js";import{wa as m,xa as w}from"./chunk.NRRUGG22.js";import{Hb as x}from"./chunk.MKNXV4TM.js";import{a as C,b as h}from"./chunk.MRK6QJV5.js";import{b as g}from"./chunk.AJZBJBMO.js";var c=g(C(),1);var i=g(h(),1),P=6e3;function M(){let t=[],n=0,s=new Set,a=new Map,p,r=()=>{for(let e of[...s])e()},o=e=>{if(clearTimeout(a.get(e.id)),a.delete(e.id),e.kind!=="toast")return;let l=(e.actions?.length??0)+(e.action?1:0),f=e.timeout??(l>0?!1:P);f!==!1&&a.set(e.id,setTimeout(()=>p?.()?o(e):d(e.id),f))},d=e=>{clearTimeout(a.get(e)),a.delete(e),t.some(l=>l.id===e)&&(t=t.filter(l=>l.id!==e),r())},u=e=>{t=t.some(l=>l.id===e.id)?t.map(l=>l.id===e.id?e:l):[...t,e],o(e),r()};return{notify(e){let l=e.id??`notice-${++n}`;return u({...e,id:l,said:++n}),{id:l,dismiss:()=>d(l),update:f=>{let v=t.find(L=>L.id===l);v&&u({...v,...f,id:l,kind:v.kind,said:f.sentence!==void 0&&f.sentence!==v.sentence?++n:v.said})}}},dismiss:d,hold(e){p=e},list:()=>t,subscribe(e){return s.add(e),()=>s.delete(e)}}}var k={info:"var(--graview-accent)",good:"var(--graview-good)",warn:"var(--graview-warn)",bad:"var(--graview-bad)"};function T({notices:t,at:n,anchor:s,board:a}){let p=(0,c.useRef)(null),r=t.length>0;return(0,c.useLayoutEffect)(()=>{let o=p.current;if(!r||!o)return;if(typeof o.showPopover=="function"&&!m(o))try{o.showPopover()}catch{}let d=()=>(n==="top"?S:N)(o,s());d(),n==="foot"&&a.hold?.(()=>o.matches(":hover, :focus-within"));let u=w(o);addEventListener("resize",d),addEventListener("scroll",d,!0),n==="foot"&&addEventListener(b,d);let e=typeof ResizeObserver=="function"?new ResizeObserver(d):null;return e?.observe(o),()=>{if(u(),e?.disconnect(),removeEventListener("resize",d),removeEventListener("scroll",d,!0),removeEventListener(b,d),o.isConnected&&m(o))try{o.hidePopover()}catch{}}},[r,n,s,a]),r?(0,i.jsx)("div",{ref:p,popover:"manual",role:"region","aria-label":n==="top"?"Notices":"Messages","data-testid":n==="top"?"notices-banners":"notices-toasts","data-graview-offstage":"",style:{position:"fixed",inset:"auto",margin:0,padding:0,border:"none",background:"none",overflow:"visible",zIndex:x("toast"),width:"max-content",height:"auto",maxWidth:"min(560px, calc(100vw - 32px))",display:"grid",gap:8,color:"var(--graview-ink)"},children:t.map(o=>(0,i.jsx)(R,{notice:o,board:a},o.id))}):null}function R({notice:t,board:n}){let s=t.tone??"info",a=[...t.action?[t.action]:[],...t.actions??[]],p=()=>n.dismiss(t.id);return(0,i.jsxs)("div",{"data-testid":"notice","data-kind":t.kind,"data-tone":s,style:{boxSizing:"border-box",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"8px 12px",padding:t.kind==="banner"?"8px 10px 8px 14px":"10px 12px 10px 14px",borderRadius:"var(--graview-radius, 12px)",borderTop:"1px solid var(--graview-edge)",borderRight:"1px solid var(--graview-edge)",borderBottom:"1px solid var(--graview-edge)",borderLeft:`3px solid ${k[s]}`,background:"var(--graview-float)",boxShadow:"var(--graview-lift-high)",fontSize:"0.875rem",lineHeight:1.45},children:[(0,i.jsx)("span",{"aria-hidden":"true",style:{width:7,height:7,borderRadius:999,flex:"0 0 auto",background:k[s]}}),(0,i.jsx)("span",{style:{flex:"1 1 16rem",minWidth:0},children:t.sentence}),a.length>0?(0,i.jsx)("span",{style:{display:"flex",flexWrap:"wrap",gap:6},children:a.map((r,o)=>r.href!==void 0?(0,i.jsx)("a",{href:r.href,...r.target?{target:r.target,rel:"noopener"}:{},"data-testid":"notice-action",onClick:()=>{r.onSelect?.(),p()},style:{...H,...o===0?E:{}},children:r.label},r.label):(0,i.jsx)("button",{type:"button","data-testid":"notice-action",onClick:()=>{p(),r.onSelect?.()},style:{...H,...o===0?E:{}},children:r.label},r.label))}):null,(0,i.jsx)("button",{type:"button","data-testid":"notice-dismiss","aria-label":`Dismiss: ${t.sentence}`,title:"Dismiss",onClick:p,style:A,children:"\xD7"})]})}var H={display:"inline-flex",alignItems:"center",minHeight:28,padding:"2px 12px",borderRadius:9,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",font:"inherit",fontWeight:500,textDecoration:"none",cursor:"pointer"},E={background:"var(--graview-accent)",borderColor:"var(--graview-accent)",color:"var(--graview-accent-ink)"},A={minWidth:28,minHeight:28,padding:0,border:"none",background:"none",boxShadow:"none",color:"var(--graview-ink-muted)",fontSize:"1rem",cursor:"pointer"};function B({notices:t}){let n=t.reduce((d,u)=>!d||u.said>d.said?u:d,void 0),[s,a]=(0,c.useState)(""),[p,r]=(0,c.useState)(""),o=(0,c.useRef)(0);return(0,c.useEffect)(()=>{if(!n||n.said===o.current)return;o.current=n.said;let d=n.tone==="bad";(d?r:a)("");let u=setTimeout(()=>(d?r:a)(n.sentence),50);return()=>clearTimeout(u)},[n]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{role:"status","aria-live":"polite","data-testid":"notices-said",style:y,children:s}),(0,i.jsx)("div",{role:"alert","data-testid":"notices-alarm",style:y,children:p})]})}var W=(0,c.createContext)(null);function F({board:t,anchor:n}){let s=(0,c.useSyncExternalStore)(t.subscribe,t.list,t.list);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(T,{notices:s.filter(a=>a.kind==="banner"),at:"top",anchor:n,board:t}),(0,i.jsx)(T,{notices:s.filter(a=>a.kind==="toast"),at:"foot",anchor:n,board:t}),(0,i.jsx)(B,{notices:s})]})}export{M as a,W as b,F as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as E,d as I}from"./chunk.
|
|
1
|
+
import{c as E,d as I}from"./chunk.2GBQJXJH.js";import"./chunk.ZJDRD6PO.js";import"./chunk.SNBIZ3B6.js";import"./chunk.6LJ66MB7.js";import"./chunk.NRRUGG22.js";import{Q as A,U as k}from"./chunk.MKNXV4TM.js";import{a as F,b as S}from"./chunk.MRK6QJV5.js";import{b as f}from"./chunk.AJZBJBMO.js";var v=f(F(),1);var a=f(S(),1),C=40,O=60;function D(l,i,p){return l.allNodes().filter(o=>o.kind===i).map(o=>o[p])}function G(l){if(l.length<2)return[];let i=[...l].sort((n,d)=>n-d),p=i[i.length-1]-i[0];if(p<=0)return[];let o=Math.max(1,10**Math.floor(Math.log10(p/4))),e=p/4>=o*5?o*5:o,r=n=>Math.round(n/e)*e;return[...new Set([.2,.4,.6,.8].map(n=>r(i[Math.floor(n*(i.length-1))])))].filter(n=>n>0)}function T(l,i,p){let o=p.far??[],e=new Map,r=new Set(o);for(let t of i.allNodes())r.has(t.kind)&&e.set(t.id,A(l.tryDefinition(t.kind),t));let n=[...e.entries()].map(([t,g])=>({id:t,label:g}));return(n.length<=C?n:n.map(t=>({end:t,ties:i.out(t.id).length+i.in(t.id).length})).sort((t,g)=>g.ties-t.ties||t.end.label.localeCompare(g.end.label)).slice(0,C).map(t=>t.end)).sort((t,g)=>t.label.localeCompare(g.label))}function R(l,i,p){let o=[];for(let e of p.filters)if(e.about==="is")for(let r of e.options??[])o.push({value:`is:${r}`,label:r,group:e.label,condition:{key:"is",value:r}});else if(e.about==="edge"){o.push({value:`${e.key}:*`,label:"anything",group:e.label,condition:{key:e.key,value:"*"}}),o.push({value:`${e.key}:none`,label:"nothing",group:e.label,condition:{key:e.key,value:"none"}});for(let r of T(l,i,e))o.push({value:`${e.key}:${r.id}`,label:r.label,group:e.label,condition:{key:e.key,value:r.id}})}else if(e.type==="date")for(let r of["before","after","on"])o.push({value:`${e.key}:${r}`,label:`${r}\u2026`,group:e.label,ask:{key:e.key,op:r,label:e.label}});else if(e.type==="number"){let r=l.tryDefinition(p.kind),n=G(D(i,p.kind,e.key).filter(d=>typeof d=="number"));for(let d of["at-most","at-least"])for(let t of d==="at-most"?n:[...n].reverse())o.push({value:`${e.key}:${d}:${t}`,label:`${d==="at-most"?"at most":"at least"} ${k(r,e.key,t)}`,group:e.label,condition:{key:e.key,value:`${d}:${t}`}})}else if(e.type==="text"){let r=[...new Set(D(i,p.kind,e.key).filter(n=>typeof n=="string"&&n.length>0&&!n.includes(",")))].sort((n,d)=>n.localeCompare(d));if(r.length>=2&&r.length<=O)for(let n of r)o.push({value:`${e.key}:${n}`,label:n,group:e.label,condition:{key:e.key,value:n}})}else if(e.type==="boolean")o.push({value:`${e.key}:true`,label:"yes",group:e.label,condition:{key:e.key,value:"true"}}),o.push({value:`${e.key}:false`,label:"no",group:e.label,condition:{key:e.key,value:"false"}});else for(let r of e.options??[])o.push({value:`${e.key}:${r}`,label:k(l.tryDefinition(p.kind),e.key,r),group:e.label,condition:{key:e.key,value:r}});return o}var H=["day","week","month","year","decade"];function K(l){let{which:i,schema:p,graph:o,offers:e,arrangement:r,set:n,toggle:d,has:t,done:g}=l,y=l.testId,h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let u=h.current?.closest("[data-graview-popover]");!u||document.activeElement!==u||(u.querySelector('[aria-pressed="true"]')??u.querySelector("button, input"))?.focus({preventScroll:!0})},[]);let L=r.sort?e.sorts.find(u=>u.key===r.sort.by):void 0,P=r.group?e.groups.find(u=>u.key===r.group.by):void 0,M=I(L),m=e.natural?e.sorts.find(u=>u.key===e.natural.by):void 0,N=i==="filter"||i==="all"&&l.parts?.filter?R(p,o,e):[],w=u=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"Sort by"}),(0,a.jsx)(c,{testId:`${y}-sort-default`,value:"",on:!r.sort,onPress:()=>(n({sort:void 0}),u()),children:m?`As declared (${E(m.label)})`:"As they were added"}),e.sorts.map(s=>(0,a.jsx)(c,{value:s.key,on:r.sort?.by===s.key,onPress:()=>(n({sort:{by:s.key,direction:r.sort?.direction??"asc"}}),u()),children:s.label},s.key)),r.sort?(0,a.jsxs)("div",{role:"group","aria-label":"Order","data-testid":`${y}-direction`,children:[(0,a.jsx)("p",{"aria-hidden":"true",children:"Order"}),["asc","desc"].map(s=>(0,a.jsx)(c,{testId:`${y}-direction-${s}`,value:s,on:r.sort.direction===s,onPress:()=>(n({sort:{by:r.sort.by,direction:s}}),u()),children:M[s]},s))]}):null]}),x=u=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{children:"Group by"}),(0,a.jsx)(c,{testId:`${y}-group-none`,value:"",on:!r.group,onPress:()=>(n({group:void 0}),u()),children:"Not grouped"}),e.groups.map(s=>(0,a.jsx)(c,{value:s.key,on:r.group?.by===s.key,onPress:()=>(n({group:{by:s.key}}),u()),children:s.label},s.key)),r.group&&P?.buckets?(0,a.jsxs)("div",{role:"group","aria-label":"How wide a group is","data-testid":`${y}-bucket`,children:[(0,a.jsx)("p",{"aria-hidden":"true",children:"Each group"}),H.map(s=>(0,a.jsx)(c,{testId:`${y}-bucket-${s}`,value:s,on:(r.group.bucket??"day")===s,onPress:()=>(n({group:{by:r.group.by,bucket:s}}),u()),children:`A ${s}`},s))]}):null]}),$=u=>(0,a.jsx)(z,{entries:N,has:t,testId:y,onToggle:s=>(d(s),u())}),b=l.parts??{sort:!0,group:!0,filter:!0};return(0,a.jsxs)("div",{ref:h,style:{display:"contents"},children:[(0,a.jsx)("style",{children:W}),i==="sort"?w(g):i==="group"?x(g):i==="filter"?$(g):(0,a.jsxs)(a.Fragment,{children:[b.sort?(0,a.jsx)("div",{role:"group","aria-label":"Sort",children:w(g)}):null,b.group?(0,a.jsx)("div",{role:"group","aria-label":"Group",children:x(g)}):null,b.filter?(0,a.jsx)("div",{role:"group","aria-label":"Filter",children:$(g)}):null]})]})}function c({value:l,on:i,onPress:p,testId:o,children:e}){return(0,a.jsx)("button",{type:"button",className:"graview-arrange-item",value:l,"data-value":l,"aria-pressed":i,onClick:p,...o?{"data-testid":o}:{},children:e})}function z({entries:l,has:i,testId:p,onToggle:o}){let[e,r]=(0,v.useState)(null);if(e)return(0,a.jsx)(B,{ask:e,testId:p,onDay:d=>o({key:e.key,value:`${e.op}:${d}`}),onCancel:()=>r(null)});let n=[...new Set(l.map(d=>d.group))];return(0,a.jsx)(a.Fragment,{children:n.map(d=>(0,a.jsxs)("div",{role:"group","aria-label":d,children:[(0,a.jsx)("p",{"aria-hidden":"true",children:d}),l.filter(t=>t.group===d).map(t=>(0,a.jsx)(c,{value:t.value,on:t.condition?i(t.condition):!1,onPress:()=>t.condition?o(t.condition):r(t.ask),children:t.label},t.value))]},d))})}function B({ask:l,testId:i,onDay:p,onCancel:o}){let[e,r]=(0,v.useState)(""),n=/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number(e.slice(0,4))>=1e3,d=()=>{n&&p(e)};return(0,a.jsxs)("div",{role:"group","aria-label":`${l.label} ${l.op} which day`,"data-testid":`${i}-ask-day`,className:"graview-arrange-ask",children:[(0,a.jsx)("p",{"aria-hidden":"true",children:`${l.label} ${l.op}`}),(0,a.jsx)("input",{type:"date","data-testid":`${i}-day`,"aria-label":`${l.label} ${l.op} which day`,autoFocus:!0,value:e,onChange:t=>r(t.target.value),onKeyDown:t=>{t.key==="Enter"?(t.preventDefault(),d()):t.key==="Escape"&&(t.preventDefault(),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),o())}}),(0,a.jsxs)("span",{children:[(0,a.jsx)("button",{type:"button","data-testid":`${i}-day-add`,disabled:!n,onClick:d,children:"Add"}),(0,a.jsx)("button",{type:"button",onClick:o,children:"Never mind"})]})]})}var W=`
|
|
2
2
|
.graview-arrange-list{display:grid;align-content:start;width:min(300px,calc(100vw - 24px));height:auto;max-height:min(70vh,520px);overflow:auto;margin:0;padding:6px;border-radius:10px;border:1px solid var(--graview-edge);background:var(--graview-float);box-shadow:var(--graview-lift-high);color:var(--graview-ink);font-size:.875rem;line-height:1.3}
|
|
3
3
|
.graview-arrange-list [role=group]{display:grid}
|
|
4
4
|
.graview-arrange-list p{margin:8px 8px 2px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--graview-ink-muted)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk.
|
|
1
|
+
import{a as y}from"./chunk.BCBH6WJF.js";import{B as f,Ca as p,Q as d,za as m}from"./chunk.MKNXV4TM.js";function P(n){let e=n.indexOf("{"),t=n.indexOf("["),a=t!==-1&&(e===-1||t<e)?t:e;if(a===-1)return;let r=n[a],i=r==="["?"]":"}",o=0,l=!1,s=!1;for(let u=a;u<n.length;u++){let c=n[u];if(l){s?s=!1:c==="\\"?s=!0:c==='"'&&(l=!1);continue}if(c==='"')l=!0;else if(c===r)o+=1;else if(c===i&&(o-=1,o===0))try{return JSON.parse(n.slice(a,u+1))}catch{return}}}function g(n,e){let t;try{t=n.mutation(e.mutation)}catch{return e}let a={...e.args},r=!1;for(let i of y(t.input)){if(i.control!=="node")continue;let o=a[i.name];if(typeof o!="string"||o.length===0||n.graph.getNode(o))continue;let l=o.trim().toLowerCase(),s=[...n.graph.allNodes()].filter(u=>(i.kinds.includes("*")||i.kinds.includes(u.kind))&&d(n.schema.tryDefinition(u.kind),u).trim().toLowerCase()===l);s.length===1&&(a[i.name]=s[0].id,r=!0)}return r?{...e,args:a}:e}function x(n,e,t){let a=t===void 0?null:new Set(t),r=[];for(let i of e){if(typeof i.mutation!="string")continue;let o=!0;try{n.mutation(i.mutation)}catch{o=!1}o?a&&!a.has(i.mutation)&&r.push({proposal:i,why:"not-allowed"}):r.push({proposal:i,why:"unknown"})}return r}function C(n,e,t){let a=t===void 0?null:new Set(t);return e.filter(r=>{if(typeof r.mutation!="string"||a&&!a.has(r.mutation))return!1;try{n.mutation(r.mutation)}catch{return!1}return r.args!==null&&typeof r.args=="object"})}function b(n,e){let t=n.allMutations().find(l=>l.name===e.mutation);if(t?.describe){let l=g(n,e),s=t.input.safeParse?.(l.args);if(s?.success)try{return t.describe(s.data,n.graph)}catch{}}let a=t?.subject?.arg,r=a?e.args[a]:void 0,i=typeof r=="string"?n.graph.getNode(r):void 0,o=t?.title??e.mutation;return i?`${o} \u2014 ${d(n.schema.tryDefinition(i.kind),i)}`:o}function A(n,e){let t=n.allMutations().find(o=>o.name===e.mutation);if(!t)return[];e=g(n,e);let a=t.input.shape??{},r=m(t.input),i=[];for(let o of Object.keys(a)){if(k(a[o]))continue;let l=e.args[o],s=r.find(c=>c.name===o);l!=null&&l!==""&&(!s||typeof l!="string"||n.graph.getNode(l)!==void 0)||i.push({name:o,...s?{kinds:s.kinds}:{},...s?{candidates:s.kinds.includes("*")?n.graph.allNodes().map(c=>c.id):s.kinds.flatMap(c=>n.graph.nodesOfKind(c).map(h=>h.id))}:{},shape:p(t.input,o)})}return i}function k(n){let e=f(n)?.type;return e==="optional"||e==="default"||e==="nullable"}export{P as a,g as b,x as c,C as d,b as e,A as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as y}from"./chunk.
|
|
1
|
+
import{a as y}from"./chunk.EYF6ONTA.js";import{a as f,d as g}from"./chunk.6LJ66MB7.js";import{za as m}from"./chunk.NRRUGG22.js";import{$ as p}from"./chunk.MKNXV4TM.js";import{a as R,b as c}from"./chunk.MRK6QJV5.js";import{b as u}from"./chunk.AJZBJBMO.js";var s=u(R(),1);var r=u(c(),1),S,h=()=>S??=m(f(()=>import("./chunk.IBGO4BUF.js")));function L(e){let[n,t]=(0,s.useState)(()=>h().current);return(0,s.useEffect)(()=>{if(!e||n)return;let i=!0;return h().load().then(a=>i&&t(a),()=>{}),()=>{i=!1}},[e,n]),n}function D(e,n){let t=L(n.length>0);return(0,s.useMemo)(()=>t?t.withLines(e,n):n,[t,e,n])}function I(e,n){let t=L(n.some(i=>i.shape));return(0,s.useMemo)(()=>{let i=new Map;if(!t)return i;for(let a of n){let l=t.ruleLine(a,e);l&&i.set(a.name,l)}return i},[t,e,n])}function M(e){let n=e.line;if(!(!n||e.message.endsWith(` \u2014 ${n.text}`)||e.message===b(e)))return e.message}function b(e){let n=e.line;return n?n.record!==void 0?`${n.record} \u2014 ${n.text}`:n.text:e.message}var P={name:{},op:{color:"var(--graview-ink-muted)",fontWeight:500},value:{fontWeight:600,fontVariantNumeric:"tabular-nums"},word:{color:"var(--graview-ink-muted)"},open:{color:"var(--graview-ink-faint)"},close:{color:"var(--graview-ink-faint)"}};function w({parts:e}){return(0,r.jsx)(r.Fragment,{children:e.map((n,t)=>(0,r.jsxs)("span",{children:[n.space?" ":"",(0,r.jsx)("span",{"data-graview-rule-part":n.as,style:P[n.as],children:n.text})]},t))})}function x(e,n){let t=p(e?.tryDefinition(n),n);return t.charAt(0).toUpperCase()+t.slice(1)}function C({line:e,schema:n,brand:t,lead:i=e.record===void 0?"kind":"record",stacked:a=!1,style:l}){let d=e.kind,o=i==="kind"?d?x(n,d):void 0:i==="record"?e.record:void 0,k=i==="kind"&&o?`${o}: ${e.said}`:i==="record"&&o?`${o} \u2014 ${e.said}`:e.said;return(0,r.jsxs)("span",{"data-graview-rule-line":"",style:{overflowWrap:"anywhere",...l},children:[(0,r.jsx)("span",{style:g,children:k}),(0,r.jsxs)("span",{"aria-hidden":"true",children:[i!=="none"&&d?(0,r.jsx)("span",{style:{display:"inline-flex",verticalAlign:"-0.1em",marginRight:"0.4em"},children:(0,r.jsx)(y,{kind:d,...n?{schema:n}:{},...t?{brand:t}:{},size:13})}):null,o?(0,r.jsxs)("span",{"data-graview-rule-head":"",style:{fontWeight:600,marginRight:i==="record"||a?0:"0.6em"},children:[o,i==="record"&&!a?(0,r.jsx)("span",{style:{color:"var(--graview-ink-faint)",fontWeight:400},children:" \u2014 "}):null]}):null,a&&o?(0,r.jsx)("br",{}):null,(0,r.jsx)(w,{parts:e.parts}),e.when&&e.when.length>0?(0,r.jsxs)("span",{"data-graview-rule-when":"",style:{color:"var(--graview-ink-faint)"},children:[", when ",(0,r.jsx)(w,{parts:e.when})]}):null]})]})}function z(e){return e.line?e.label&&e.label.trim().length>0?e.label:void 0:e.label&&e.label!==e.message?e.label:void 0}export{D as a,I as b,M as c,b as d,C as e,z as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,d as y}from"./chunk.6LJ66MB7.js";import{_ as m,za as h}from"./chunk.
|
|
1
|
+
import{a as f,d as y}from"./chunk.6LJ66MB7.js";import{_ as m,za as h}from"./chunk.NRRUGG22.js";import{a as k,b as u}from"./chunk.MRK6QJV5.js";import{b as g}from"./chunk.AJZBJBMO.js";var p=g(k(),1);var n=g(u(),1);var w={default:{background:"var(--graview-panel, #ffffff)",color:"var(--graview-ink, #1a1a1a)"},muted:{background:"var(--graview-panel-muted, #f7f5f1)",color:"var(--graview-ink, #1a1a1a)"},warning:{background:"var(--graview-panel-warning, #fdf3ec)",color:"var(--graview-ink, #1a1a1a)"}},R={color:"var(--graview-ink-muted, #55514a)"},N={color:"var(--graview-ink-faint, #625d55)"};function z(e){let[i,t]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{let a=e.current;if(!a||typeof ResizeObserver>"u")return;let o=()=>t(a.scrollHeight>a.clientHeight+1||a.scrollWidth>a.clientWidth+1);o();let d=new ResizeObserver(o);d.observe(a);for(let l of a.children)d.observe(l);return()=>d.disconnect()}),i}function C({level:e,style:i,children:t}){if(e===void 0)return(0,n.jsx)("strong",{style:i,children:t});let a=`h${e}`;return(0,n.jsx)(a,{style:{margin:0,...i},children:t})}function T({title:e,subtitle:i,meta:t,selected:a,tone:o="default",children:d,style:l,fit:s=!1,variant:b,heading:S}){let c=(0,p.useRef)(null),v=z(c),P=m(),r=(b??(P==="fullscreen"?"page":"card"))==="page";return(0,n.jsxs)("div",{"data-graview-primitive":"panel","data-graview-variant":r?"page":"card","data-selected":a||void 0,style:{display:"flex",flexDirection:"column",gap:r?12:"var(--graview-gap, 7px)",height:r||s?"auto":"100%",maxHeight:r?"none":"100%",padding:r?0:"var(--graview-pad, 15px)",boxSizing:"border-box",borderRadius:r?0:"var(--graview-radius, 12px)",border:r?"none":`1px solid ${a?"var(--graview-accent, #2f6f5e)":"var(--graview-edge, #e4e0d8)"}`,boxShadow:r?"none":a?"0 0 0 1px var(--graview-accent-dim), var(--graview-lift-low)":"var(--graview-lift-low)",overflow:r?"visible":"hidden",...w[o],...r?{background:"transparent"}:{},"--graview-panel-bg":w[o].background,...l},children:[o==="warning"?(0,n.jsx)("span",{"data-graview-broken":"",style:y,children:"Implicated in a problem."}):null,e===void 0?null:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:8,minWidth:0},children:[o==="warning"?(0,n.jsx)("span",{"aria-hidden":"true",title:"Implicated in a problem",style:{color:"var(--graview-warn)",flex:"0 0 auto"},children:"\u26A0"}):null,(0,n.jsx)(C,{level:S,style:{fontFamily:"var(--graview-font-display, inherit)",fontSize:r?"1.5625rem":"0.9375rem",lineHeight:r?1.15:1.25,fontWeight:r?600:560,letterSpacing:r?"-0.012em":"0.005em",minWidth:0,overflowWrap:"anywhere"},children:e}),t===void 0?null:(0,n.jsx)("span",{style:{marginLeft:"auto",fontSize:"0.75rem",letterSpacing:"0.08em",textTransform:"uppercase",minWidth:0,overflowWrap:"anywhere",...N},children:t})]}),i===void 0?null:(0,n.jsx)("div",{style:{fontSize:r?"0.90625rem":"0.8125rem",lineHeight:1.5,...R},children:i}),(0,n.jsx)("div",{ref:c,className:r?void 0:"graview-scroll",...v&&!r?{tabIndex:0,role:"region",...typeof e=="string"?{"aria-label":e}:{}}:{},style:{display:"flex",flexDirection:"column",gap:r?22:"var(--graview-gap, 7px)",flex:"1 1 auto",...r?{overflow:"visible"}:{}},"data-graview-overflowing":v&&!r?"":void 0,children:d})]})}function x({label:e,hue:i,selected:t,title:a,pickId:o,emphasis:d}){let l=typeof e=="string"?e:void 0,s=i===void 0?void 0:Math.round(i);return(0,n.jsxs)("span",{"data-graview-primitive":"chip","data-selected":t||void 0,"data-graview-pick":o,"data-graview-emphasis":d,title:a??l,style:{cursor:o?"pointer":void 0,display:"inline-flex",alignItems:"center",alignSelf:"flex-start",minHeight:24,boxSizing:"border-box",padding:"3px 9px",borderRadius:6,fontSize:"0.8125rem",lineHeight:1.5,whiteSpace:"nowrap",maxWidth:"min(28ch, 100%)",overflow:"hidden",letterSpacing:"0.01em",border:`1px solid ${t?"var(--graview-accent)":s===void 0?"var(--graview-edge)":`hsl(${s} 55% var(--graview-tint-lightness) / 0.45)`}`,background:s===void 0?"var(--graview-panel-muted)":`hsl(${s} 55% var(--graview-tint-lightness) / calc(var(--graview-tint-alpha) * 0.65))`,color:"var(--graview-ink, #1a1a1a)",boxShadow:t?"0 0 14px -4px var(--graview-accent)":void 0},children:[s===void 0?null:(0,n.jsx)("span",{"aria-hidden":"true",style:{width:9,height:6,clipPath:"polygon(50% 0, 100% 50%, 50% 100%, 0 50%)",flex:"0 0 auto",marginRight:6,background:`hsl(${s} 55% var(--graview-tint-lightness) / 0.9)`}}),(0,n.jsx)("span",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function H({items:e,max:i=8,selectedIds:t=[],pick:a=!1}){let o=e.slice(0,i),d=e.length-o.length;return(0,n.jsxs)("div",{"data-graview-primitive":"roster",style:{display:"flex",flexWrap:"wrap",gap:6,alignContent:"flex-start"},children:[o.map(l=>(0,n.jsx)(x,{label:l.label,...l.hue===void 0?{}:{hue:l.hue},...a?{pickId:l.id}:{},...l.emphasis===void 0?{}:{emphasis:l.emphasis},selected:t.includes(l.id)},l.id)),d>0?(0,n.jsx)(x,{label:`+${d} more`}):null]})}function L({label:e,count:i,items:t,onExpand:a,flagged:o}){return(0,n.jsx)(T,{title:e,meta:o?`\u26A0 ${i}`:i,tone:o?"warning":"muted",style:a?{cursor:"zoom-in"}:void 0,children:t&&t.length>0?(0,n.jsx)(H,{items:t,max:6,pick:!0}):null})}var W=h(f(()=>import("./chunk.FP27W5MU.js"))),O=W.part((e,i)=>e.drawFiles(i),{quiet:!0});export{T as a,x as b,H as c,L as d,O as e};
|