graview 0.1.44 → 0.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/{chunk.2O2THM2R.js → chunk.2EFH63WS.js} +1 -1
- package/dist/preview/{chunk.RVQYXPCM.js → chunk.2JJYGYT2.js} +1 -1
- package/dist/preview/chunk.2LKMNEWZ.js +1 -0
- package/dist/preview/{chunk.P5K7EYDK.js → chunk.2YABX3SC.js} +1 -1
- package/dist/preview/{chunk.5WEEZ7WD.js → chunk.3HSPWSAI.js} +1 -1
- package/dist/preview/chunk.3NMINX5Z.js +1 -0
- package/dist/preview/{chunk.ZN77U6SU.js → chunk.4HYJHGI4.js} +1 -1
- package/dist/preview/{chunk.BA4KQR5H.js → chunk.4KNEBLB7.js} +1 -1
- package/dist/preview/{chunk.UXLJZIYX.js → chunk.4RJZVTW7.js} +1 -1
- package/dist/preview/{chunk.GAN77YDU.js → chunk.4XOWRYRU.js} +1 -1
- package/dist/preview/{chunk.F4DWRBO7.js → chunk.55D33E5A.js} +1 -1
- package/dist/preview/{chunk.YTXEPWVW.js → chunk.5B2LH2SR.js} +1 -1
- package/dist/preview/chunk.5EDA3JHU.js +1 -0
- package/dist/preview/{chunk.V4DR25S4.js → chunk.5O5IJVLN.js} +1 -1
- package/dist/preview/chunk.5R2R364Q.js +1 -0
- package/dist/preview/{chunk.ALFW4ZJQ.js → chunk.63JLXGYX.js} +1 -1
- package/dist/preview/{chunk.7PUFYK3B.js → chunk.64WM4IBI.js} +1 -1
- package/dist/preview/chunk.66JF3UMG.js +1 -0
- package/dist/preview/{chunk.FNXW46U4.js → chunk.6BJBPDF3.js} +72 -72
- package/dist/preview/{chunk.YTZDCIX2.js → chunk.6KWFTSK4.js} +1 -1
- package/dist/preview/{chunk.ATKKTPJS.js → chunk.6MADC6DM.js} +1 -1
- package/dist/preview/{chunk.N5ULWKR4.js → chunk.6RY6OSE6.js} +1 -1
- package/dist/preview/{chunk.HP72LB3B.js → chunk.6SJA4FSW.js} +1 -1
- package/dist/preview/chunk.6SWW6KEV.js +1 -0
- package/dist/preview/chunk.6UIW664O.js +6 -0
- package/dist/preview/chunk.6USUVORO.js +1 -0
- package/dist/preview/{chunk.O4VSQ2ER.js → chunk.6X3G3PWL.js} +1 -1
- package/dist/preview/chunk.7KVWV577.js +1 -0
- package/dist/preview/{chunk.FVHECT47.js → chunk.7ZRFXI73.js} +1 -1
- package/dist/preview/{chunk.AW2T3KFV.js → chunk.AS4CQBOQ.js} +1 -1
- package/dist/preview/{chunk.OAWAUB4P.js → chunk.B6KT6BTG.js} +4 -4
- package/dist/preview/{chunk.7B5BZZBG.js → chunk.BGYY55VO.js} +1 -1
- package/dist/preview/{chunk.B7FZLIAO.js → chunk.BNPQUI3F.js} +1 -1
- package/dist/preview/chunk.BRDAO2OF.js +4 -0
- package/dist/preview/{chunk.EW364363.js → chunk.BS2SJC2P.js} +2 -2
- package/dist/preview/{chunk.HKD5SR45.js → chunk.C2UFMFJ3.js} +2 -2
- package/dist/preview/{chunk.RNUGQRJI.js → chunk.CBUSFM3E.js} +1 -1
- package/dist/preview/chunk.CSDERNQV.js +1 -0
- package/dist/preview/{chunk.JGYGSNQY.js → chunk.DLFWBG33.js} +1 -1
- package/dist/preview/{chunk.LKF4BBCW.js → chunk.DQHPEKWK.js} +1 -1
- package/dist/preview/{chunk.7AEE3VHC.js → chunk.DQOCBKC3.js} +1 -1
- package/dist/preview/{chunk.KERLVJ6I.js → chunk.DX357TZ3.js} +1 -1
- package/dist/preview/{chunk.3M4VCAA3.js → chunk.E37V2EJM.js} +1 -1
- package/dist/preview/{chunk.DLVNW4HU.js → chunk.E4G6DXSB.js} +1 -1
- package/dist/preview/chunk.EAUVEVVO.js +1 -0
- package/dist/preview/chunk.EVW5YY3W.js +1 -0
- package/dist/preview/chunk.F6HMZL65.js +1 -0
- package/dist/preview/{chunk.EJAWDI2V.js → chunk.FCAYURB4.js} +1 -1
- package/dist/preview/{chunk.FIJNKSMQ.js → chunk.FF6DBQMB.js} +1 -1
- package/dist/preview/chunk.FHZBXMXR.js +33 -0
- package/dist/preview/{chunk.D2RK2KJD.js → chunk.FOFLD64U.js} +1 -1
- package/dist/preview/{chunk.YERDP6YF.js → chunk.FPASZ4RD.js} +1 -1
- package/dist/preview/{chunk.WPLKHIO5.js → chunk.FTM64IDI.js} +1 -1
- package/dist/preview/chunk.GEPNIMXW.js +1 -0
- package/dist/preview/{chunk.EYEIDL3T.js → chunk.GER2XRD4.js} +1 -1
- package/dist/preview/chunk.GFLAGZSB.js +1 -0
- package/dist/preview/{chunk.IQWKEGWG.js → chunk.GIYFEGAP.js} +1 -1
- package/dist/preview/chunk.GVY5UQTJ.js +1 -0
- package/dist/preview/{chunk.4EPT2CQG.js → chunk.H7KCWCB4.js} +1 -1
- package/dist/preview/{chunk.MZOIPCDA.js → chunk.HDRD33II.js} +1 -1
- package/dist/preview/{chunk.5JPELFMA.js → chunk.HGTPTRMM.js} +1 -1
- package/dist/preview/chunk.HWCHFQ7O.js +6 -0
- package/dist/preview/{chunk.LUPBT6YM.js → chunk.HZGVEHEN.js} +1 -1
- package/dist/preview/{chunk.VAUG5TGZ.js → chunk.ICCIZDTQ.js} +1 -1
- package/dist/preview/{chunk.REEDZSCG.js → chunk.ICGNIK3Z.js} +2 -2
- package/dist/preview/chunk.II7VTGNC.js +1 -0
- package/dist/preview/{chunk.27ZVVPRZ.js → chunk.IKX4VDTW.js} +1 -1
- package/dist/preview/chunk.IW7YFPGG.js +1 -0
- package/dist/preview/chunk.J7G3AATY.js +14 -0
- package/dist/preview/{chunk.IBWPRK2R.js → chunk.JBW3DI7E.js} +1 -1
- package/dist/preview/{chunk.QJJKITXF.js → chunk.JDMXZFSG.js} +1 -1
- package/dist/preview/{chunk.RYNCEZ6Q.js → chunk.JHIUG25Q.js} +1 -1
- package/dist/preview/{chunk.UZSZPMRC.js → chunk.JLEC3USG.js} +1 -1
- package/dist/preview/{chunk.XPIDPZKS.js → chunk.JLYNMAME.js} +1 -1
- package/dist/preview/{chunk.6BIRNR5P.js → chunk.JR7RDOEP.js} +1 -1
- package/dist/preview/{chunk.LULTKYE3.js → chunk.JSSFA3FC.js} +1 -1
- package/dist/preview/chunk.K46YRA65.js +1 -0
- package/dist/preview/chunk.K6KMLD2B.js +21 -0
- package/dist/preview/{chunk.2CPC3HQI.js → chunk.KBHU54NM.js} +1 -1
- package/dist/preview/{chunk.NBOZPPSM.js → chunk.KRGM25HF.js} +1 -1
- package/dist/preview/chunk.KUUDW7VR.js +1 -0
- package/dist/preview/{chunk.UG23RICT.js → chunk.KWQ7QOHD.js} +1 -1
- package/dist/preview/chunk.L24FCXZ7.js +1 -0
- package/dist/preview/{chunk.H4GHKBMH.js → chunk.L2PI7V4R.js} +1 -1
- package/dist/preview/{chunk.LKXYZK5H.js → chunk.L3FOLN3K.js} +1 -1
- package/dist/preview/{chunk.REOYQTFP.js → chunk.L3FQZCWI.js} +1 -1
- package/dist/preview/{chunk.ZP6PS5Z4.js → chunk.LEO2KWLZ.js} +1 -1
- package/dist/preview/{chunk.TTSNHX3F.js → chunk.LNG3CQNI.js} +1 -1
- package/dist/preview/{chunk.NPS2WN7T.js → chunk.LSLLKICK.js} +1 -1
- package/dist/preview/{chunk.FNF6XQI5.js → chunk.M5GJHVWZ.js} +1 -1
- package/dist/preview/{chunk.JQ7WY2VZ.js → chunk.MGWMGLWE.js} +1 -1
- package/dist/preview/{chunk.6NFR2LYQ.js → chunk.NIVTK2W5.js} +1 -1
- package/dist/preview/chunk.NMIXBH37.js +1 -0
- package/dist/preview/{chunk.KSXB4LDF.js → chunk.OF34OZ4V.js} +1 -1
- package/dist/preview/chunk.OMZ3LDDN.js +1 -0
- package/dist/preview/{chunk.ESU2DD3J.js → chunk.OYHQSXNC.js} +1 -1
- package/dist/preview/{chunk.IIB22IIP.js → chunk.PKUDIWIF.js} +1 -1
- package/dist/preview/{chunk.FUYMLDNJ.js → chunk.PRD3UNJX.js} +1 -1
- package/dist/preview/{chunk.TDCO7LEA.js → chunk.Q7RQC3F7.js} +1 -1
- package/dist/preview/{chunk.ZKBSEUK4.js → chunk.QGVLJTZS.js} +1 -1
- package/dist/preview/chunk.QPCSS322.js +1 -0
- package/dist/preview/{chunk.QNJYXB3U.js → chunk.R2AG4NHQ.js} +1 -1
- package/dist/preview/{chunk.IN4PKQO5.js → chunk.RNEJYIQ7.js} +1 -1
- package/dist/preview/chunk.RPX35VYU.js +1 -0
- package/dist/preview/{chunk.JLOSQ5UY.js → chunk.RYRTKIKB.js} +2 -2
- package/dist/preview/chunk.S5MQVPLF.js +1 -0
- package/dist/preview/{chunk.MFLJIFZD.js → chunk.S6WHA4CW.js} +1 -1
- package/dist/preview/{chunk.3L7OEBJH.js → chunk.SDU76JU6.js} +1 -1
- package/dist/preview/{chunk.RDGFZPKN.js → chunk.SGKPGVBB.js} +1 -1
- package/dist/preview/chunk.SZ34UAQ3.js +2 -0
- package/dist/preview/chunk.T7XH7FVJ.js +1 -0
- package/dist/preview/{chunk.3IUJ4GW7.js → chunk.TBQOSI4J.js} +1 -1
- package/dist/preview/{chunk.Y2MIG2C2.js → chunk.TBSNNOQU.js} +1 -1
- package/dist/preview/{chunk.FBIK4LTM.js → chunk.TOXWNEOQ.js} +2 -2
- package/dist/preview/{chunk.PL2P2OON.js → chunk.UHX4WTM7.js} +1 -1
- package/dist/preview/chunk.UJKT2G6M.js +5 -0
- package/dist/preview/{chunk.OGF6UORU.js → chunk.UKAPFIPJ.js} +1 -1
- package/dist/preview/{chunk.YGX2AE36.js → chunk.UM7GWXEW.js} +1 -1
- package/dist/preview/{chunk.64QDUERE.js → chunk.UNCS63AM.js} +1 -1
- package/dist/preview/{chunk.CDFVEL2Y.js → chunk.URXSZQSF.js} +1 -1
- package/dist/preview/{chunk.P546VMA5.js → chunk.UY7IOVR6.js} +1 -1
- package/dist/preview/{chunk.U3CV5CCL.js → chunk.V5FIZIX2.js} +1 -1
- package/dist/preview/{chunk.DAZEFSWI.js → chunk.VC3BX2ZF.js} +1 -1
- package/dist/preview/{chunk.4WCQWILK.js → chunk.VSAPJAT3.js} +1 -1
- package/dist/preview/{chunk.MWUP5X47.js → chunk.VW2VCPJX.js} +1 -1
- package/dist/preview/chunk.W2RCWPLK.js +1 -0
- package/dist/preview/{chunk.DGXWL4GC.js → chunk.W44VRHKS.js} +2 -2
- package/dist/preview/{chunk.3TBH2FMZ.js → chunk.WAB7UDHU.js} +1 -1
- package/dist/preview/{chunk.OK4FSBHI.js → chunk.WBHM5I3I.js} +1 -1
- package/dist/preview/chunk.WM2LWHTJ.js +1 -0
- package/dist/preview/{chunk.56DR42FA.js → chunk.WPOTEXJZ.js} +1 -1
- package/dist/preview/{chunk.T6S3CEW7.js → chunk.WSTBCWW7.js} +2 -2
- package/dist/preview/{chunk.TJO5Y2OJ.js → chunk.XMCFZD3A.js} +1 -1
- package/dist/preview/chunk.XWAMQPUM.js +25 -0
- package/dist/preview/{chunk.IQ3LUSD6.js → chunk.XXEYRHRG.js} +1 -1
- package/dist/preview/{chunk.7UV7ODXU.js → chunk.Y5ARSVH4.js} +1 -1
- package/dist/preview/{chunk.B2CIQ66N.js → chunk.Z6TMIAAB.js} +1 -1
- package/dist/preview/chunk.ZBR2QY67.js +104 -0
- package/dist/preview/chunk.ZEAH57AZ.js +1 -0
- package/dist/preview/{chunk.JEMQ66FT.js → chunk.ZJ2VS4M4.js} +1 -1
- package/dist/preview/chunk.ZTIF23VF.js +1 -0
- package/dist/preview/index.html +49 -45
- package/dist/preview/page.js +2 -34
- package/package.json +6 -6
- package/dist/preview/chunk.2EXY4AHX.js +0 -117
- package/dist/preview/chunk.3JATXDSP.js +0 -1
- package/dist/preview/chunk.3OKJ4GOA.js +0 -1
- package/dist/preview/chunk.3PNDXNX6.js +0 -1
- package/dist/preview/chunk.4B4DKCS4.js +0 -1
- package/dist/preview/chunk.4JWT6LIS.js +0 -25
- package/dist/preview/chunk.6VIZGLDK.js +0 -1
- package/dist/preview/chunk.7HL7CFXJ.js +0 -1
- package/dist/preview/chunk.7JVBVB4A.js +0 -1
- package/dist/preview/chunk.CSQNDAEK.js +0 -1
- package/dist/preview/chunk.EJOTTZWZ.js +0 -1
- package/dist/preview/chunk.EZRGGPAN.js +0 -1
- package/dist/preview/chunk.GAFYE37S.js +0 -3
- package/dist/preview/chunk.GBCWI2LF.js +0 -2
- package/dist/preview/chunk.HB34VQKQ.js +0 -1
- package/dist/preview/chunk.HKA27VJO.js +0 -1
- package/dist/preview/chunk.IPHWGBZE.js +0 -6
- package/dist/preview/chunk.JUT2VCFW.js +0 -1
- package/dist/preview/chunk.L6FWIQXS.js +0 -1
- package/dist/preview/chunk.LYSHLKAX.js +0 -1
- package/dist/preview/chunk.LYUPJ4VV.js +0 -1
- package/dist/preview/chunk.MOF2D6DV.js +0 -1
- package/dist/preview/chunk.NTFCZYOR.js +0 -1
- package/dist/preview/chunk.OG6GNGTX.js +0 -21
- package/dist/preview/chunk.PSTE3LZL.js +0 -5
- package/dist/preview/chunk.PX6VAZFJ.js +0 -1
- package/dist/preview/chunk.RLMW7DU6.js +0 -1
- package/dist/preview/chunk.URCC626R.js +0 -1
- package/dist/preview/chunk.WE5SA6TP.js +0 -1
- package/dist/preview/chunk.WNYPP52L.js +0 -1
- package/dist/preview/chunk.YE4GZVOX.js +0 -1
- package/dist/preview/chunk.YWVOACSX.js +0 -5
- package/dist/preview/chunk.YYPK7IDM.js +0 -1
- package/dist/preview/chunk.ZZ5F5I3O.js +0 -1
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{a as Je,b as nt,c as st,d as ot,e as it,f as at}from"./chunk.RYNCEZ6Q.js";import{a as rt,b as ke,c as lt}from"./chunk.IQ3LUSD6.js";import{g as Qe}from"./chunk.GAFYE37S.js";import{e as tt}from"./chunk.F4DWRBO7.js";import{c as Ze,f as et,g as ve}from"./chunk.RVQYXPCM.js";import{b as se,d as oe}from"./chunk.EJOTTZWZ.js";import{a as we,e as Ye}from"./chunk.BBLIT7S7.js";import{a as ne,f as Xe,h as qe}from"./chunk.RLMW7DU6.js";import"./chunk.PXQVXBNG.js";import{a as H}from"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var dt=["good","warn","bad","neutral","accent"],ut=["value","max","aria-label","placeholder","disabled"],ct=["click","change"],be=["_blank","_self"],pt=["section","div","span","strong","p","hr","a","button","input","progress"],ie={type:{oneOf:dt}},xe={"gv-card":{host:"section",properties:{tone:ie},events:{},children:"any"},"gv-group":{host:"div",properties:{direction:{type:{oneOf:["row","column"]}}},events:{},children:"any"},"gv-title":{host:"strong",properties:{},events:{},children:"text"},"gv-text":{host:"p",properties:{tone:ie},events:{},children:"text"},"gv-badge":{host:"span",properties:{tone:ie},events:{},children:"text"},"gv-field":{host:"div",properties:{label:{type:"string"}},events:{},children:"text"},"gv-progress":{host:"progress",properties:{value:{type:"number",as:"value"},max:{type:"number",as:"max"},label:{type:"string",as:"aria-label"}},events:{},children:"none"},"gv-divider":{host:"hr",properties:{},events:{},children:"none"},"gv-link":{host:"a",properties:{href:{type:"url"}},events:{},children:"text"},"gv-button":{host:"button",properties:{tone:ie,disabled:{type:"boolean",as:"disabled"}},events:{press:{from:"click"}},children:"text"},"gv-input":{host:"input",properties:{label:{type:"string",as:"aria-label"},value:{type:"string",as:"value"},placeholder:{type:"string",as:"placeholder"}},events:{change:{from:"change",detail:"value"}},children:"none"}},Se=1e4;var Kt=0,Rt=1,Gt=2,Wt=3,ft=1,Lt=2,_t=3,Ot=1,At=3,It=8,Te="~",Me=(s,e)=>Object.prototype.hasOwnProperty.call(s,e),Y=s=>typeof s=="object"&&s!==null&&!Array.isArray(s);function mt(s,e){return e.type==="url"?"href":e.as??`data-gv-${s.toLowerCase()}`}var Nt=2e3;function gt(s,e){if(e==null)return{ok:!0,value:null};let i=s.type;if(i==="boolean")return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,reason:"value"};if(i==="number")return typeof e=="number"&&Number.isFinite(e)?{ok:!0,value:String(e)}:{ok:!1,reason:"value"};if(typeof e!="string"||e.length>Nt)return{ok:!1,reason:i==="url"?"url":"value"};if(typeof i=="object")return i.oneOf.includes(e)?{ok:!0,value:e}:{ok:!1,reason:"value"};if(i==="url"){let f;try{f=new URL(e)}catch{return{ok:!1,reason:"url"}}return f.protocol!=="https:"||f.hostname===""||!/^https:\/\//i.test(e)?{ok:!1,reason:"url"}:{ok:!0,value:f.href}}return{ok:!0,value:e}}function Pt(s){let e=s.host==="a";return pt.includes(s.host)&&(s.target===void 0||e&&be.includes(s.target))&&Object.values(s.properties).every(i=>i.type!=="url"||e)&&Object.values(s.properties).every(i=>i.as===void 0||i.type!=="url"&&ut.includes(i.as))&&Object.values(s.events).every(i=>ct.includes(i.from))}function Ee(s,e){let i=e.kit??xe,f=e.maxNodes??2e3,o=s.ownerDocument,g=[],w=new Map,W={dom:s,name:Te,component:{host:"div",properties:{},events:{},children:"any"},children:[],listeners:new Map,id:Te};w.set(Te,W);let R=e.links?new Set(e.links.origins.flatMap(r=>{try{let d=new URL(r);return d.protocol==="https:"&&d.hostname!==""?[d.origin]:[]}catch{return[]}})):void 0,A=0,M=0,N=!1,c=r=>{g.push(r),g.length>200&&g.shift()},E=()=>({dom:o.createComment(""),children:[],refused:!0,listeners:new Map}),T=(r,d,y)=>{let a=r.component;if(!Me(a.properties,d))return c({reason:"property",element:r.name,name:d});let n=a.properties[d],m=gt(n,y),b=m.ok&&n.type==="url"&&R&&typeof m.value=="string"&&!R.has(new URL(m.value).origin)?{ok:!1,reason:"url"}:m,S=r.dom,h=mt(d,n);if(!b.ok)return S.removeAttribute(h),c({reason:b.reason,element:r.name,name:d});let L=b.value;L===null||L===!1?S.removeAttribute(h):S.setAttribute(h,L===!0?"":L),h==="value"&&"value"in S&&(S.value=typeof L=="string"?L:""),h==="disabled"&&"disabled"in S&&(S.disabled=L!==null&&L!==!1)},v=(r,d,y)=>{let a=r.component;if(!Me(a.events,d))return c({reason:"event",element:r.name,name:d});let n=r.listeners.get(d);if(n&&(n(),r.listeners.delete(d),M-=1),y==null)return;if(!Y(y)||typeof y.listener!="number")return c({reason:"value",element:r.name,name:d});let m=y.listener,b=a.events[d],S=r.dom,h=()=>e.onEvent(m,b.detail==="value"?String(S.value??""):void 0);S.addEventListener(b.from,h),r.listeners.set(d,()=>S.removeEventListener(b.from,h)),M+=1},k=r=>{if(!r.refused){A-=1,r.id!==void 0&&w.delete(r.id);for(let d of r.listeners.values())d();M-=r.listeners.size,r.listeners.clear();for(let d of r.children)k(d)}},_=(r,d)=>{if(!Y(r)||typeof r.id!="string"||w.has(r.id))return c({reason:"record"}),E();if(A>=f)return c({reason:"budget"}),N||(N=!0,e.onOverBudget?.()),E();let y=r.id,a=d.component.children;if(r.type===It)return E();if(r.type===At){if(a==="none")return c({reason:"child",element:d.name}),E();let h={dom:o.createTextNode(String(r.data??"").slice(0,Se)),children:[],text:!0,listeners:new Map,id:y};return w.set(y,h),A+=1,h}if(r.type!==Ot)return c({reason:"record"}),E();let n=String(r.element);if(!Me(i,n)||!Pt(i[n]))return c({reason:"element",element:n}),E();if(a!=="any")return c({reason:"child",element:n}),E();let m=i[n],b=o.createElement(m.host);b.setAttribute("data-gv",n.replace(/^gv-/,"")),b.className=`graview-guest-${n.replace(/^gv-/,"")}`,m.host==="a"&&(b.setAttribute("rel","noopener noreferrer"),b.setAttribute("target",m.target??"_blank"),b.setAttribute("referrerpolicy","no-referrer")),m.host==="button"&&b.setAttribute("type","button");let S={dom:b,name:n,component:m,children:[],listeners:new Map,id:y};if(w.set(y,S),A+=1,Y(r.properties))for(let[h,L]of Object.entries(r.properties))T(S,h,L);if(Y(r.attributes))for(let h of Object.keys(r.attributes))c({reason:"attribute",element:n,name:h});if(Y(r.eventListeners))for(let[h,L]of Object.entries(r.eventListeners))v(S,h,L);if(Array.isArray(r.children))for(let h of r.children){let L=_(h,S);S.children.push(L),b.appendChild(L.dom)}return S},P=r=>{if(!Array.isArray(r))return c({reason:"record"});let[d,y]=r,a=typeof y=="string"?w.get(y):void 0;if(!a)return c({reason:"record"});switch(d){case Kt:{if(a.text)return c({reason:"record"});let n=Number(r[3]),m=Number.isInteger(n)&&n>=0&&n<=a.children.length?n:a.children.length,b=_(r[2],a);a.dom.insertBefore(b.dom,a.children[m]?.dom??null),a.children.splice(m,0,b);return}case Rt:{let n=Number(r[2]),m=a.children[n];if(!m)return c({reason:"record"});a.children.splice(n,1),m.dom.parentNode?.removeChild(m.dom),k(m);return}case Gt:if(!a.text)return c({reason:"record"});a.dom.data=String(r[2]??"").slice(0,Se);return;case Wt:{if(a===W||a.text)return c({reason:"record"});let n=String(r[2]),m=r[4]??ft;return m===ft?T(a,n,r[3]):m===_t?v(a,n,r[3]):c(m===Lt?{reason:"attribute",element:a.name,name:n}:{reason:"record"})}default:return c({reason:"record"})}};return{apply(r,d){if(!Array.isArray(r))return c({reason:"record"}),!0;for(let y=0;y<r.length;y+=1){if(d&&y%32===0&&d())return!1;P(r[y])}return!0},get refused(){return g},get size(){return A},get listening(){return M},dispose(){for(let r of W.children)k(r);W.children.length=0,s.replaceChildren()}}}var Ke=`
|
|
2
|
-
.graview-guest { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--graview-ink, inherit); font: inherit; }
|
|
3
|
-
.graview-guest-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--graview-edge, #d0d0d0); border-radius: 10px; background: var(--graview-panel, transparent); }
|
|
4
|
-
.graview-guest-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
|
|
5
|
-
.graview-guest-group[data-gv-direction="row"] { flex-direction: row; flex-wrap: wrap; align-items: center; }
|
|
6
|
-
.graview-guest-title { font-weight: 600; font-size: 1rem; overflow-wrap: anywhere; }
|
|
7
|
-
.graview-guest-text { margin: 0; font-size: 0.875rem; line-height: 1.45; overflow-wrap: anywhere; }
|
|
8
|
-
.graview-guest-badge { align-self: flex-start; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; }
|
|
9
|
-
.graview-guest-field { font-size: 0.875rem; overflow-wrap: anywhere; }
|
|
10
|
-
.graview-guest-field[data-gv-label]::before { content: attr(data-gv-label) " "; color: var(--graview-ink-muted, inherit); }
|
|
11
|
-
.graview-guest-progress { width: 100%; }
|
|
12
|
-
.graview-guest-divider { width: 100%; margin: 2px 0; border: 0; border-top: 1px solid var(--graview-edge, #d0d0d0); }
|
|
13
|
-
.graview-guest-link { color: var(--graview-accent, inherit); text-decoration: underline; }
|
|
14
|
-
.graview-guest-button { align-self: flex-start; font: inherit; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--graview-edge, #d0d0d0); background: var(--graview-panel, transparent); color: inherit; cursor: pointer; }
|
|
15
|
-
.graview-guest-input { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--graview-edge, #d0d0d0); }
|
|
16
|
-
.graview-guest [data-gv-tone="good"] { color: var(--graview-good, inherit); }
|
|
17
|
-
.graview-guest [data-gv-tone="bad"] { color: var(--graview-bad, inherit); }
|
|
18
|
-
.graview-guest [data-gv-tone="warn"] { color: var(--graview-warn, inherit); }
|
|
19
|
-
.graview-guest [data-gv-tone="accent"] { color: var(--graview-accent, inherit); }
|
|
20
|
-
.graview-guest [data-gv-tone="neutral"] { color: var(--graview-ink-muted, inherit); }
|
|
21
|
-
`;var yt=new WeakSet;function Vt(s,e){if(s.startsWith("blob:"))return"blob:";try{return new URL(s,e.location.href).origin}catch{return s}}function ht(s,e,i){let f=Vt(e,s),o=`this page's Content-Security-Policy${i?` (${i})`:""} does not allow a worker from ${f}: it needs worker-src ${f}`;return yt.has(s)||(yt.add(s),s.console?.warn?.(`Graview: worker views cannot start on this page, because ${o}. A host that will not allow ${f} serves each view's whole script from its own origin and passes worker: { url } (the @graview/guest README, "What the host page allows").`)),o}function Dt(s,e){return s===""?!0:e.startsWith("blob:")?s.startsWith("blob"):e.startsWith(s)||s.startsWith(e)}function ae(s,e){let i="script"in e.source?s.URL.createObjectURL(new s.Blob([e.source.script],{type:"text/javascript"})):void 0,f="script"in e.source?i:e.source.url,o,g,w=!1,W=!1,R=0,A=0,M="",N=0,c=0,E=s.performance,T=E.now(),v,k=a=>{let n=a,m=String(n.effectiveDirective||n.violatedDirective||"").split(" ")[0];/^(worker-src|script-src|script-src-elem|child-src|default-src)$/.test(m)&&Dt(String(n.blockedURI??""),f)&&(v=m)},_=s.document;_?.addEventListener("securitypolicyviolation",k);let P=()=>_?.removeEventListener("securitypolicyviolation",k),r=()=>{W||(W=!0,g?.close(),o?.terminate(),o=void 0,s.clearTimeout(R),s.clearInterval(A),P(),i&&s.URL.revokeObjectURL(i))},d=(a,n)=>{W||(r(),e.onStop(a,n))},y=()=>{s.clearTimeout(R),P(),M=Je();let a=new s.MessageChannel;g=a.port1;let n=Math.max(1,e.silentMs),m=Math.max(10,Math.min(1e3,Math.floor(n/4)));T=E.now();let b=T;A=s.setInterval(()=>{let h=E.now();if(h-b>m*2&&(T+=h-b-m),b=h,h-T>=n)return d("silent");N+=1,a.port1.postMessage({type:"heartbeat",beat:N})},m);let S={graview:"host-hello",protocol:1,nonce:M,view:e.name};o.postMessage(S,[a.port2]),e.onReady(M,a.port1)};try{o=new s.Worker(f,{name:e.name})}catch(a){o=void 0;let n=a,m=n?.name==="SecurityError"?ht(s,f,v):`the worker could not be made: ${String(n?.message??a)}`;queueMicrotask(()=>d("start",m))}return o&&(R=s.setTimeout(()=>d("start",`it never said it was ready in ${e.readyMs.toLocaleString("en-US")} ms`),e.readyMs),o.onerror=a=>{let n=typeof a.message=="string"&&a.message!==""?a.message:void 0;if(w)return void e.onError?.(n??"an error");s.clearTimeout(R),s.setTimeout(()=>!w&&d("start",v?ht(s,f,v):n?`it failed before it said ready: ${n}`:"it failed before it said ready, and the engine gave no reason (a page policy that refuses it, or a script that does not load)"),0)},o.onmessage=a=>{if(!e.limiter.message()||w||!Ye(a.data)||a.data.protocol!==1){e.onDropped();return}w=!0,y()}),{get worker(){return o},answer(a){let n=a;return typeof n!="object"||n===null||n.type!=="heartbeat"||n.nonce!==M?!1:(typeof n.beat=="number"&&n.beat>c&&n.beat<=N&&(c=n.beat,T=E.now()),!0)},stop:r}}function le(s,e){let i=e(),f=0;return{draw(o){let g=e();g-i>=1e3&&(i=g,f=0);let w=o(()=>f+(e()-g)>=s);return f+=e()-g,w&&f<s}}}var Ct=H(()=>(__graviewPreload(import.meta.url,["./chunk.GAFYE37S.js","./chunk.AJZBJBMO.js"]),import("./chunk.YWVOACSX.js"))),Ht=H(()=>(__graviewPreload(import.meta.url,["./chunk.F4DWRBO7.js","./chunk.RVQYXPCM.js","./chunk.EJOTTZWZ.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.URCC626R.js"))),jt=H(()=>(__graviewPreload(import.meta.url,["./chunk.AJZBJBMO.js"]),import("./chunk.SHNYYBNW.js"))),Ut=H(()=>(__graviewPreload(import.meta.url,["./chunk.WVUJXDXZ.js","./chunk.ESU2DD3J.js","./chunk.PL2P2OON.js","./chunk.27ZVVPRZ.js","./chunk.IN4PKQO5.js","./chunk.3IUJ4GW7.js","./chunk.UG23RICT.js","./chunk.4EPT2CQG.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.EJAWDI2V.js"))),Bt=H(()=>(__graviewPreload(import.meta.url,["./chunk.RVQYXPCM.js","./chunk.EJOTTZWZ.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.XPIDPZKS.js"))),$t=H(()=>(__graviewPreload(import.meta.url,["./chunk.BBLIT7S7.js","./chunk.AJZBJBMO.js"]),import("./chunk.RRCPEHM4.js")));function Ft(s,e,i){switch(s){case"manifest":return i??"Its manifest names something this app does not have.";case"source":return i??`Its code is longer than the ${e.maxSourceBytes.toLocaleString("en-US")} bytes a view may be.`;case"start":return`It could not start${i?`: ${i}.`:"."}`;case"error":return`It failed before it drew anything${i?`: ${i}`:"."}`;case"silent":return`It stopped answering for ${e.silentMs.toLocaleString("en-US")} ms.`;case"nodes":return`It drew more than the ${e.maxNodes.toLocaleString("en-US")} things a view may draw.`;case"flood":return`It sent more than ${e.messages} messages in ${e.messageWindowMs.toLocaleString("en-US")} ms.`;case"slow":return`It took longer than ${e.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`}}function zt(s,e){let i=s.ownerDocument,f=i.defaultView,{manifest:o}=e,g=i.createElement("div");g.className="graview-worker-view",g.setAttribute("role","region"),g.setAttribute("aria-label",o.title??o.name),g.setAttribute("data-worker-view",o.name),g.style.cssText="display:block;position:relative;contain:layout paint style;isolation:isolate;overflow:clip;min-width:0",s.appendChild(g);let w=g.attachShadow({mode:"open"}),W=e.author?i.createElement("p"):void 0;W&&(W.className="graview-worker-view-author",W.setAttribute("data-worker-view-author",o.name),W.style.cssText="margin:4px 0 0;font-size:0.75rem;color:var(--graview-ink-muted, inherit)",W.textContent=e.author,s.appendChild(W));let R={applied:0,refused:0,dropped:0},A=se(e.limits),M={maxSourceBytes:e.limits?.maxSourceBytes??256e3,maxNodes:e.limits?.maxNodes??5e3,messages:e.limits?.messages??120,messageWindowMs:e.limits?.messageWindowMs??1e3,pushMs:e.limits?.pushMs??1e3,silentMs:e.limits?.silentMs??5e3,drawMs:e.limits?.drawMs??100},N,c,E,T,v=!1,k={applied:0,refused:0,dropped:0},_=[],P=()=>{if(!c)return;let t=c.stats;R.applied+=t.applied-k.applied,R.refused+=t.refused-k.refused,R.dropped+=t.dropped-k.dropped,k={...t}},r=()=>{},d=0,y=()=>{},a=()=>{y(),y=()=>{},P(),c?.dispose(),c=void 0,E?.stop(),r(),f.clearInterval(d)},n=(t,p)=>{if(v)return;v=!0,a(),T?.dispose();let x=Ft(t,M,p);g.removeAttribute("data-worker-view-drawn"),g.setAttribute("data-worker-view-failed",t),e.fallback!==!1&&(e.fallback??m)(g,t,x),e.onFailure?.(t,x)},m=(t,p,x)=>{let K=N??(()=>{try{return ve(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{}})}catch{return}})(),l=i.createElement("div");l.setAttribute("data-graview-fallback",p),l.style.cssText="padding:12px;display:grid;gap:6px;color:var(--graview-ink, inherit);font-family:var(--graview-font-body, inherit)";let I=i.createElement("strong");I.textContent=o.title??o.name;let O=i.createElement("ul");O.style.cssText="margin:0;padding-left:1.2em";for(let $ of[...K?.node?[K.node]:[],...K?.nodes??[]]){let q=i.createElement("li");q.textContent=$.label??$.id,O.appendChild(q)}let B=i.createElement("p");B.style.cssText="margin:0;font-size:0.8125rem;color:var(--graview-ink-muted, inherit)",B.textContent=`This view was stopped. ${x}`,l.append(I,O,B),w.replaceChildren(l)},b=et(o,e.store);if(b.length>0)return queueMicrotask(()=>n("manifest",b.join(" "))),ge();let S=t=>{if(("source"in t?new TextEncoder().encode(t.source).length:"script"in t?new TextEncoder().encode(t.script).length:0)>M.maxSourceBytes)return["source"];let x="source"in t?rt(t.source):[];return x.length>0?["source",x.join(" ")]:void 0},h=e.worker,L=typeof h=="function"?void 0:S(h);if(L)return queueMicrotask(()=>n(...L)),ge();let Re=at(f,()=>We(),"blob"),de=()=>it(()=>e.theme?.()??st(g),e.brand,Re),Ge="",ue=()=>{Ge=JSON.stringify(de()),c?.push()},We=()=>{c&&JSON.stringify(de())!==Ge&&ue()},vt=ot(i,We),j,U,Le=o.pictures?jt().then(({createGuestPictures:t})=>{v||(j=t(f,{as:"blob",view:`"${o.title??o.name}"`,pictures:o.pictures,...e.limits?{limits:e.limits}:{},...e.file?{file:e.file}:{},moved:()=>c?.push(),onLeft:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)}}))}):Promise.resolve();r=()=>{vt(),Re.dispose(),j?.dispose(),X?.dispose(),U?.dispose(),te?.dispose()};let D,J=t=>D?.postMessage(t),_e=!1,Oe=!1,Q=()=>g.toggleAttribute("data-worker-view-drawn",!v&&Oe&&T!==void 0&&_.length===0&&z.size===0&&!j?.waiting()&&!(U?.waiting??0)),F=f.performance,z=new Map,Z=F.now(),ce=Math.max(10,Math.min(250,Math.floor(M.pushMs/4))),kt=()=>{d||(Z=F.now(),d=f.setInterval(()=>{let t=F.now(),p=t-Z>ce*2?t-Z-ce:0;Z=t;for(let[x,K]of z){let l=K+p;if(z.set(x,l),t-l>=M.pushMs)return n("slow")}},ce))},bt=le(M.drawMs,()=>F.now()),Ae=()=>{},pe=t=>{if(v)return;if(!T)return void _.push(t);let p=T;if(!bt.draw(K=>t[0]==="render"?p.apply(t[1],K):(p.style(t[1]),!0)))return n("slow");t[0]==="render"&&Ae()},Ie=()=>Xe(e.store.schema,new Set([...e.store.kindsKeptFrom(e.principal),...e.store.modules.disabledKinds])),ee=qe({sees:t=>e.store.seenBy(e.principal).graph.has(t),places:()=>ne(e.places?.()??[]),lists:Ie,schema:e.store.schema,...e.onNavigate?{onNavigate:e.onNavigate}:e.goTo?{onNavigate:t=>nt(e.goTo(),t)}:{},onLost:t=>{D?.postMessage({type:"notice",text:t}),e.onProblem?.(t)}}),C=new Set,Ne=new Set,X,Pe=!1,Ve=()=>{Pe||(Pe=!0,Ut().then(({createGuestMedia:t})=>{v||(X=t(f,{view:`"${o.title??o.name}"`,pictures:o.pictures!==void 0,shown:()=>N,...e.file?{file:e.file}:{},onProblem:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)}}),X.refresh(w))},()=>e.onProblem?.(`The view "${o.title??o.name}" places a video or a full-screen viewer, and the host's player could not be loaded.`)))},De=!1,Ce=!1,fe=new Map,He=()=>{De||!o.accepts?.length||(De=!0,Bt().then(({createGuestDrops:t})=>{v||(U=t(f,{shadow:w,manifest:o,store:e.store,principal:e.principal,files:()=>e.files?.(),shown:()=>C,hears:()=>Ce,idOf:p=>T?.renderer.idOf(p),send:J,change:(p,x)=>{if(!c)return{ok:!1,reason:"refused",message:"The view has gone."};let K=c.change(p,x);return P(),K},handed:p=>fe.set(p.href,p),onProblem:p=>{D?.postMessage({type:"notice",text:p}),e.onProblem?.(p)},onBusy:()=>Q()}),U.refresh())},()=>e.onProblem?.(`The view "${o.title??o.name}" takes files, and the host's drop could not be loaded.`)))},te,je=[],Ue=!1,xt=t=>{je=t,te?.bind(t),!(Ue||t.length===0)&&(Ue=!0,$t().then(({createGuestGestures:p,unheardWords:x})=>{if(!v){if(o.gestures!==!0){let K=x(o.title??o.name);return D?.postMessage({type:"notice",text:K}),e.onProblem?.(K)}te=p(w,{root:()=>w.querySelector("[data-graview-view-root]")??void 0,idOf:K=>T?.renderer.idOf(K),send:J}),te.bind(je)}},()=>{}))},St=t=>{let p=e.store.seenBy(e.principal).graph;for(let x of C){let K=p.getNode(x);for(let l of Object.values(K??{}))for(let I of Ze(l))if(I.href===t)return I}},Be=t=>{if(t.localName==="graview-video")return Ve();t.hasAttribute("data-lightbox")&&(t.setAttribute("aria-haspopup","dialog"),Ve())};Promise.all([Ct(),Ht()]).then(([{createOpenDrawing:t},{createPressReader:p,createSaver:x,fillPrefills:K,judgePress:l,prefillOf:I}])=>{if(v)return;let O=p(),B=(u,G)=>{let V=T?.renderer.idOf(u);V!==void 0&&J({type:"dom-event",target:V,event:"acted",pressed:G})},$=x({reader:O,save:(u,G)=>{if(!c)return;let V=c.pressed(l(e.store,o,C,u));P(),B(G,{as:u.as,...V})}}),q=()=>$.flush();f.addEventListener("pagehide",q),y=()=>{f.removeEventListener("pagehide",q),$.flush()};let Tt=new WeakSet;Ae=()=>{K(w,O,Tt,u=>I(e.store,e.principal,o,C,u)),X?.refresh(w),U?.refresh()},T=t(w,{origin:e.origin??f.location.origin,...e.asset?{asset:e.asset}:{},...e.images?{imageOrigins:e.images.origins}:{},...o.pictures?{picture:u=>j?.drawn(u)}:{},onRefused:u=>{if(u.reason!=="url"||u.element!=="img"||u.address===void 0||Ne.has(u.address))return;Ne.add(u.address);let G=Qe(u.address,{...e.images?{origins:e.images.origins}:{},assets:e.asset!==void 0},u.length);D?.postMessage({type:"notice",text:G}),e.onProblem?.(G)},...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>n("nodes"),send:J,onFieldSet:u=>O.filled(u),onAttribute:(u,G)=>{u.localName==="a"&&(G==="data-record"||G==="data-place")&&ee.link(u),G==="data-lightbox"&&Be(u),G==="data-drop"&&He()},decorate:u=>{u.localName==="a"&&ee.link(u),Be(u),u.hasAttribute("data-drop")&&He()},before:(u,G,V)=>{O.heard(u,G),$.heard(u,G,V);let ye=G.closest("a[data-graview-link]");ye&&V.contains(ye)&&(u.type==="click"||u.type==="keydown"&&u.key==="Enter")&&(u.preventDefault(),u.stopPropagation(),ee.follow(ye));let re=G.closest("[data-lightbox]"),Fe=u.type==="keydown"?u.key:void 0;if(re&&V.contains(re)&&u.isTrusted&&(u.type==="click"||(Fe==="Enter"||Fe===" ")&&re.localName!=="button")&&(u.preventDefault(),u.stopPropagation(),X?.open(re)),U?.before(u,G,V))return!1;let he=O.press(u,G,V);if(!he||!c)return;u.stopPropagation();let Mt=c.pressed(l(e.store,o,C,he));P();let ze={as:he.as,...Mt},Et=G.closest("[data-act]");return queueMicrotask(()=>B(Et,ze)),{pressed:ze}}});for(let u of _.splice(0))pe(u);Q()},()=>n("start","the view's drawing could not be loaded"));let me=t=>E=ae(f,{source:t,name:o.name,limiter:A,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>R.dropped+=1,onStop:(p,x)=>n(p,x),onError:p=>{_e||n("error",p)},onReady:(p,x)=>{D=x,kt();let K=oe({store:e.store,principal:e.principal,view:o.name,nonce:p,send:l=>{l.type==="props"&&typeof l.push=="number"&&(z.set(l.push,F.now()),Q()),x.postMessage(l)},props:()=>{let l=ve(e.store,e.principal,{manifest:o,...e.input?{input:e.input()}:{},theme:de(),...e.places?{places:ne(e.places())}:{}});return C=new Set([...l.node?[l.node.id]:[],...(l.nodes??[]).map(I=>I.id)]),N=l,l},...j?{hand:j.hand}:{},judgeAct:(l,I)=>tt(e.store,o,l,I,{shown:C,file:O=>fe.get(O)??St(O),dropped:O=>fe.has(O)}),onHears:l=>{l.includes("drop")&&(Ce=!0)},onGestures:xt,onRender:l=>{_e=!0,pe(["render",l])},onPushed:(l,I)=>{if(z.delete(l),I>=M.pushMs)return n("slow");Oe=!0,Q()},onFlood:()=>n("flood"),onStyle:l=>pe(["style",l]),places:()=>[...new Set([...ne(e.places?.()??[]).map(l=>l.as),...Ie().map(l=>l.slug)])],...e.limits?{limits:e.limits}:{},limiter:A});c=K,x.onmessage=({data:l})=>{if(!E?.answer(l)&&(K.receive(l),P(),!v&&l?.nonce===p&&l.type==="navigate")){let I={...l.where!==void 0?{where:l.where}:{},...l.section!==void 0?{section:l.section}:{}},O=typeof l.place=="string"?{place:l.place,...I}:typeof l.to=="string"&&{record:l.to,...I};O&&ee.go(O)}},ue()}}),$e=t=>{"source"in t?(o.pictures?Promise.all([ke(t.source),Le]).then(([p])=>p):ke(t.source)).then(p=>{v||me({script:p})},()=>n("start","the view's runtime could not be loaded")):o.pictures?Le.then(()=>{v||me(t)},()=>n("start","the view's pictures could not be loaded")):me(t)};return typeof h=="function"?lt(h).then(t=>{if(v)return;let p=S(t);p?n(...p):$e(t)},t=>n("source",`Its code did not arrive${t instanceof Error&&t.message?`: ${t.message}`:""}.`)):$e(h),ge();function ge(){return{element:g,shadow:w,get worker(){return E?.worker},update:()=>{c&&ue()},get stats(){return P(),R},get refused(){return T?.refused??[]},dispose(){v=!0,a(),T?.dispose(),g.remove(),W?.remove()}}}}var wt="graview-guest-kit";function br(s,e){let i=s.ownerDocument,f=i.defaultView;if(!i.getElementById(wt)){let k=i.createElement("style");k.id=wt,k.textContent=Ke,i.head.appendChild(k)}let o=i.createElement("div");o.className="graview-guest",o.setAttribute("role","group"),o.setAttribute("aria-label",e.title??e.view),o.setAttribute("data-guest-view",e.view),s.appendChild(o);let g={applied:0,refused:0,dropped:0},w=se(e.limits),W=le(e.limits?.drawMs??100,()=>f.performance.now()),R,A,M,N=!1,c={applied:0,refused:0,dropped:0},E=()=>{if(!R)return;let k=R.stats;g.applied+=k.applied-c.applied,g.refused+=k.refused-c.refused,g.dropped+=k.dropped-c.dropped,c={...k}},T=()=>{E(),R?.dispose(),R=void 0,M?.stop()},v=(k,_)=>{N||(N=!0,T(),A?.dispose(),e.onFailure?.(k,_))};return M=ae(f,{source:e.worker,name:e.view,limiter:w,readyMs:e.limits?.readyMs??5e3,silentMs:e.limits?.silentMs??5e3,onDropped:()=>g.dropped+=1,onStop:(k,_)=>v(k,_),onReady:(k,_)=>{let P=Ee(o,{...e.kit?{kit:e.kit}:{},...e.links?{links:e.links}:{},onEvent:(d,y)=>_.postMessage({type:"event",listener:d,...y!==void 0?{detail:y}:{}}),...e.limits?.maxNodes!==void 0?{maxNodes:e.limits.maxNodes}:{},onOverBudget:()=>v("budget")});A=P;let r=oe({store:e.store,principal:e.principal,view:e.view,nonce:k,send:d=>_.postMessage(d),onRender:d=>{W.draw(y=>P.apply(d,y))||v("slow")},...e.input?{input:e.input}:{},...e.onNavigate?{onNavigate:e.onNavigate}:{},onSize:e.onSize??(d=>o.style.minHeight=`${d}px`),...e.limits?{limits:e.limits}:{},limiter:w});R=r,_.onmessage=d=>{M?.answer(d.data)||(r.receive(d.data),E())},r.push()}}),{element:o,get worker(){return M?.worker},update:()=>R?.push(),get stats(){return E(),g},get refused(){return A?.refused??[]},dispose(){N=!0,T(),A?.dispose(),o.remove()}}}export{xe as GUEST_KIT,Ke as GUEST_KIT_CSS,be as KIT_LINK_TARGETS,dt as KIT_TONES,Ee as createKitRenderer,mt as hostAttribute,gt as kitValue,br as mountGuestWorker,zt as mountWorkerView};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var __graviewPreload=(base,files)=>{if(typeof document>"u")return;const asked=globalThis.__graviewPreloaded??=new Set;for(const file of files){const href=new URL(file,base).href;if(asked.has(href))continue;asked.add(href);const link=document.createElement("link");link.rel="modulepreload";link.href=href;document.head.append(link)}};import{r as C}from"./chunk.FNXW46U4.js";import{G as A,J as P,R as s,_ as R,ua as L}from"./chunk.4JWT6LIS.js";import{a as b}from"./chunk.SDO3U72B.js";import{md as w,wc as v}from"./chunk.AW2T3KFV.js";import{b as i}from"./chunk.AJZBJBMO.js";var B=i(s(),1),I=C.part(e=>(0,B.jsx)(e.ActivityRail,{calls:[]}),{quiet:!0});var g=i(s(),1),T=e=>e.tabIndex>=0&&!e.disabled&&e.getClientRects().length>0;function H(e){if(!e)return!1;if(T(e))return e.focus({preventScroll:!1}),!0;let r=[...e.querySelectorAll("a[href], button, input, select, textarea, [tabindex]")].find(T);return r?(r.focus(),!0):(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus(),!0)}var F=`.graview-skips{display:contents}
|
|
2
|
-
.graview-skip{position:absolute;width:0;height:0;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
3
|
-
.graview-skip:focus{width:auto;height:auto;overflow:visible;clip-path:none;padding:6px 12px;border-radius:8px;border:1px solid var(--graview-accent);background:var(--graview-float,var(--graview-panel));color:var(--graview-ink);font:inherit;font-size:.875rem;font-weight:600;box-shadow:var(--graview-lift-high);outline:2px solid var(--graview-accent);outline-offset:1px}
|
|
4
|
-
.graview-skips[data-place=bar] .graview-skip:focus{position:fixed;left:8px;top:6px;z-index:${v("toast")}}
|
|
5
|
-
.graview-skips[data-place=here] .graview-skip:focus{position:static;justify-self:start}`;function O({to:e,place:r="bar"}){return e.length===0?null:(0,g.jsxs)("span",{className:"graview-skips","data-place":r,children:[(0,g.jsx)("style",{children:F}),e.map(o=>(0,g.jsx)("button",{type:"button",className:"graview-skip","data-graview-skip":o.testid,"data-testid":`skip-${o.testid}`,...o.opens?{"data-graview-skip-opens":""}:{},onClick:o.go,children:o.label},o.testid))]})}var l=i(A(),1),S=i(s(),1),D=L(b(()=>(__graviewPreload(import.meta.url,["./chunk.P546VMA5.js","./chunk.P5K7EYDK.js","./chunk.7PUFYK3B.js","./chunk.QJJKITXF.js","./chunk.7AEE3VHC.js","./chunk.LKF4BBCW.js","./chunk.JUT2VCFW.js","./chunk.UT6642FC.js","./chunk.IQWKEGWG.js","./chunk.QNJYXB3U.js","./chunk.TI4OSTQV.js","./chunk.GZHZLJBF.js","./chunk.ATKKTPJS.js","./chunk.OJGHDWI6.js","./chunk.UZSZPMRC.js","./chunk.MZOIPCDA.js","./chunk.KERLVJ6I.js","./chunk.4EPT2CQG.js","./chunk.FNXW46U4.js","./chunk.4JWT6LIS.js","./chunk.SDO3U72B.js","./chunk.AW2T3KFV.js","./chunk.2AZTW66C.js","./chunk.AJZBJBMO.js"]),import("./chunk.EZRGGPAN.js")))),E=D.part((e,r)=>{let o=e.RecordInteractions;return(0,S.jsx)(o,{...r})},{quiet:!0});function M(e,r,o){let t=e.target;return(t.on==="record"||t.on==="field"?t.id===r:t.on==="selection"?t.ids.includes(r):t.on==="act"?t.id===r:!1)||e.offered.some(n=>n.id===`record:${r}`||n.id.startsWith(`fill:${r}:`))||(e.batches??[]).some(n=>o(n).includes(r))}function j({id:e,style:r,headingStyle:o,className:t}){let{ai:c,aiDesk:n,store:f}=R(),{entries:y}=P(n),p=c.off===!0;(0,l.useEffect)(()=>{p||n.load()},[n,p]);let x=f.log.length,u=(0,l.useMemo)(()=>{let h=m=>f.log.all().flatMap(k=>k.batch===m?k.writes:[]);return y.filter(m=>M(m,e,h))},[y,e,f,x]);return p||u.length===0?null:(0,S.jsx)(l.Suspense,{fallback:null,children:(0,S.jsx)(E,{entries:u,...r?{style:r}:{},...o?{headingStyle:o}:{},...t?{className:t}:{}})})}var d=i(A(),1),a=i(s(),1);function So({context:e,stop:r,title:o,label:t,style:c,className:n,children:f,...y}){let p=w(e.views?.arrangement?.()),x=f??(0,a.jsxs)(a.Fragment,{children:["In ",p==="Scene"?"the scene":p.replace(/^The /,"the ")," ",(0,a.jsx)("span",{"aria-hidden":"true",children:"\u2197"})]}),u=t?{"aria-label":t}:{};if(e.overview){let h=e.overview;return(0,a.jsx)("a",{href:r,...y,...u,...o?{title:o}:{},style:c,...n?{className:n}:{},onClick:m=>{m.preventDefault(),h(r)},children:x})}return e.embedded?null:(0,a.jsx)("a",{href:`${e.sceneHref??"/"}${r}`,...y,...u,...o?{title:o}:{},style:c,...n?{className:n}:{},children:x})}function ho(){return(0,a.jsx)("a",{href:"#fresh","data-testid":"start-fresh",title:"Forget every edit made in this browser and return to the example",onClick:e=>{e.preventDefault();let r=new URL(window.location.href);r.searchParams.set("fresh","1"),window.location.assign(r.toString())},style:{color:"inherit",display:"inline-flex",alignItems:"center",minHeight:24,minWidth:24},children:"Start fresh"})}function ko(e){let r=(0,d.useRef)(0),o=(0,d.useCallback)(t=>e.subscribe(()=>{r.current+=1,t()}),[e]);return(0,d.useSyncExternalStore)(o,()=>r.current,()=>0)}function wo(e){return e===void 0?{}:e==="sm"||e==="md"?{"data-size":e}:{style:{"--graview-control-height":typeof e=="number"?`${e}px`:e}}}var bo=(e,r)=>r?`${e} ${r}`:e;export{I as a,H as b,O as c,j as d,So as e,ho as f,ko as g,wo as h,bo as i};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as l,K as p,R as k,S as y,c}from"./chunk.OAWAUB4P.js";import"./chunk.PSTE3LZL.js";import"./chunk.UGFDSE37.js";import{b as m}from"./chunk.JGYGSNQY.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.YERDP6YF.js";import"./chunk.P5K7EYDK.js";import"./chunk.7AEE3VHC.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.MB7LKKUD.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import{$ as g,G as S,H as s,I as d,R as f}from"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import{b as n}from"./chunk.AJZBJBMO.js";var u=n(S(),1);var t=n(f(),1);function D({context:a}){let r=l(),h=g(),[w]=(0,u.useState)(()=>s(null)),o=d(h?.seatTalk??w),P=()=>{(window.history.state?.idx??0)>0?r(-1):r("/")};return(0,t.jsxs)(k,{context:a,"data-testid":"draft-page",children:[(0,t.jsx)(y,{context:a,...o.draft?{"data-testid":"draft-title"}:{},children:o.draft?o.draft.title:"Nothing drawn"}),o.draft?(0,t.jsx)(m,{page:!0,go:e=>r(e.address),onPick:e=>{let i=a.store.graph.getNode(e);i&&r(c(a.store.schema,i.kind,e))},onDiscard:P}):(0,t.jsxs)("p",{style:{margin:0,color:"var(--graview-ink-muted)"},children:["Ask for a way of seeing \u2014 \u201Ca board of tasks by status\u201D \u2014 and it is drawn here."," ",(0,t.jsx)(p,{to:"/",style:{color:"var(--graview-accent)"},children:"Home \u2192"})]})]})}export{D as DraftPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk.PXQVXBNG.js";import{Xc as w}from"./chunk.AW2T3KFV.js";var P=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),b=e=>e?._zod?.def;function $(e){let n=b(e);for(;n&&(n.type==="optional"||n.type==="default"||n.type==="nullable"||n.type==="prefault");)n=b(n.innerType);return n}function v(e){if(e?.type==="boolean")return["true","false"];if(e?.type==="enum")return(e.entries?Object.values(e.entries):e.values??[]).filter(n=>typeof n=="string")}var p=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]/g," ").replace(/^./,n=>n.toUpperCase());function T(e,n,t){let r=e.tryDefinition(n);if(!r)return[];let f=new Set(r.display?.hide??[]),o=[];for(let[i,a]of Object.entries(r.fields.shape??{})){if(i==="id"||i==="kind"||i==="label"||f.has(i))continue;let s=$(a);if(s?.type==="array"||s?.type==="object"||s?.type==="record")continue;let u=v(s);o.push({key:i,label:p(i),...u?{options:u}:{}})}let d=new Map;for(let[i,a]of Object.entries(r.edges??{}))d.set(i,a.to==="*"?[]:[...a.to]);for(let i of e.definitions)if(i.kind!==n)for(let[a,s]of Object.entries(i.edges??{}))!d.has(a)&&(s.to==="*"||s.to.includes(n))&&d.set(a,[i.kind]);let c=[];for(let[i,a]of d){o.push({key:i,label:p(i)});let s=t&&a.length===1&&a[0]!==n?e.tryDefinition(a[0]):void 0;for(let[u,l]of Object.entries(s?.fields.shape??{})){let y=$(l);y?.type==="enum"&&!s?.display?.hide?.includes(u)&&c.push({key:`${i}.${u}`,label:`${p(i)} \xB7 ${p(u)}`,options:v(y)})}}return o.push(...c),o.push({key:"is",label:"Is",options:r.lifecycle?["current","past","any","flagged","clear"]:["flagged","clear"]}),o}var A=e=>e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e.at(-1)}`;function x(e,n,t,r={}){if(t==null)return{ok:!0};if(!P(t))return{ok:!1,says:'A filter is an object of a field and the value it keeps, like { where: { stage: "building" } }.'};let f=Object.entries(t);if(f.length===0)return{ok:!0};let o=[];for(let a of n)for(let s of T(e,a,r.through===!0))o.some(u=>u.key===s.key)||o.push(s);let d=n[0]?e.tryDefinition(n[0]):void 0,c=d?d.plural??`${p(d.kind)}s`:"These",i=[];for(let[a,s]of f){let u=o.find(y=>y.key===a);if(!u)return{ok:!1,says:`${c.replace(/^./,y=>y.toUpperCase())} have no field "${a}" to filter by${o.length>0?`; they filter by ${A(o.map(y=>y.key))}`:""}.`};if(typeof s!="string"&&typeof s!="number"&&typeof s!="boolean")return{ok:!1,says:`The filter on "${a}" is ${Array.isArray(s)?"a list":s===null?"null":`a ${typeof s}`}; it keeps one value: a word, a number, or true or false.`};let l=String(s);if(l.trim().length===0)return{ok:!1,says:`The filter on "${a}" keeps nothing; give it a value, or leave "${a}" out.`};if(l.includes(","))return{ok:!1,says:`The filter on "${a}" holds a comma, which an address reads as a second filter; keep one value.`};if(u.options&&u.options.length>0&&!u.options.includes(l))return{ok:!1,says:`${u.label} has no choice "${l}"; its choices are ${A(u.options.map(y=>`"${y}"`))}.`};i.push(`${a}:${l}`)}return{ok:!0,filter:i.join(",")}}var S=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");function j(e,n){let t=e.find(o=>o.as===n);if(t)return t;let r=n.trim().toLowerCase(),f=S(n);return e.find(o=>o.title!==void 0&&o.title.trim().toLowerCase()===r)??(f?e.find(o=>o.as===f||o.title!==void 0&&S(o.title)===f):void 0)}function W(e){let n=[];for(let t of e){if(typeof t!="object"||t===null)continue;let{as:r,slug:f,title:o,kind:d}=t,c=typeof r=="string"&&r.length>0?r:typeof f=="string"&&f.length>0?f:void 0;!c||n.some(i=>i.as===c)||n.push({as:c,title:typeof o=="string"?o:c,kind:typeof d=="string"?d:""})}return n}var O=e=>` Its places: ${e.map(n=>typeof n=="string"?`"${n}"`:n.title&&n.title!==n.as?`"${n.as}" (${n.title})`:`"${n.as}"`).join(", ")||"none"}.`,g=e=>`"${e.length>80?`${e.slice(0,79)}\u2026`:e}"`,h=(e,n)=>`${"place"in e?`The place ${g(e.place)}`:`${g(e.record)} is no record this viewer may see and`} is no place of this app: it goes nowhere.${O(n)}`;function k(e){let n={};for(let t of e.split(",")){let r=t.indexOf(":");r>0&&(n[t.slice(0,r).trim()]=t.slice(r+1).trim())}return n}function J(e,n=new Set){return e.kinds.filter(t=>!n.has(t)).map(t=>({slug:w(e,t).slice(1),kind:t}))}function R(e,n){let t=[...new Set(n.places.map(l=>l.as))],r=n.lists.map(l=>l.slug).filter(l=>!t.includes(l)),f;if(e.section!==void 0&&e.section!==null){if(typeof e.section!="string"||m(e.section).length===0||e.section.length>120)return{ok:!1,says:`The section ${typeof e.section=="string"?g(e.section):"asked for"} names nothing on a page: a section is a heading's words or an element's id, like "shipping-soon". It goes nowhere.`};f=e.section}let o=f!==void 0?{section:f}:{};if("record"in e&&n.sees(e.record))return e.where!==void 0&&e.where!==null?{ok:!1,says:`${g(e.record)} is one record, and a filter narrows a list or a place: it goes nowhere. Go to { place, where } for a list narrowed.`}:{ok:!0,arrival:{record:e.record,...o}};let d="place"in e?e.place:e.record,c=j(n.places,d),i=c?void 0:n.lists.find(l=>l.slug===d||l.kind===d);if(!c&&!i)return{ok:!1,says:`${h(e,n.places.filter((l,y,D)=>D.findIndex(L=>L.as===l.as)===y))}${G(r)}`};let a=c?[c.kind]:[i.kind],s;if(e.where!==void 0&&e.where!==null){if(!n.schema)return{ok:!1,says:`The place ${g(d)} cannot be narrowed here: it goes nowhere.`};let l=x(n.schema,a,e.where,{through:i!==void 0});if(!l.ok)return{ok:!1,says:`The filter on ${g(d)} goes nowhere: ${l.says}`};s=l.filter}let u=s?{filter:s}:{};return{ok:!0,arrival:c?{place:c.as,...u,...o}:{list:i.kind,...u,...o}}}var G=e=>e.length===0?"":` Its lists: ${e.slice(0,8).map(n=>`"${n}"`).join(", ")}${e.length>8?` and ${e.length-8} more`:""}.`;function q(e){let n=t=>{let r=R(t,{sees:e.sees,places:e.places(),lists:e.lists?.()??[],...e.schema?{schema:e.schema}:{}});return r.ok?e.onNavigate?.(r.arrival):e.onLost?.(r.says),r.ok};return{link(t){let r=t.hasAttribute("data-record")||t.hasAttribute("data-place");r&&!t.hasAttribute("data-graview-link")?(t.setAttribute("data-graview-link",""),t.hasAttribute("role")||t.setAttribute("role","link"),t.hasAttribute("tabindex")||t.setAttribute("tabindex","0")):!r&&t.hasAttribute("data-graview-link")&&(t.removeAttribute("data-graview-link"),t.getAttribute("role")==="link"&&t.removeAttribute("role"))},follow(t){let r=t.getAttribute("data-record"),f=t.getAttribute("data-place"),o=t.getAttribute("data-filter"),d=t.getAttribute("data-section"),c={...o?{where:k(o)}:{},...d?{section:d}:{}};r?n({record:r,...c}):f&&n({place:f,...c})},go:n}}export{W as a,O as b,g as c,h as d,k as e,J as f,R as g,q as h};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b,c as m,d as g}from"./chunk.F4DWRBO7.js";import"./chunk.RVQYXPCM.js";import"./chunk.EJOTTZWZ.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";var A=new Set(["input","select","textarea"]),y=r=>r.namespaceURI==="http://www.w3.org/1999/xhtml"&&A.has(r.localName),E=r=>r.localName==="select"||r.type==="checkbox"||r.type==="radio",v=r=>r.type==="checkbox"||r.type==="radio"?!r.checked:r.localName!=="select"&&r.value==="";function h(r){return r.type==="checkbox"||r.type==="radio"?`checked:${r.checked}`:r.localName==="select"&&r.multiple?`selected:${[...r.selectedOptions].map(d=>d.value).join("\0")}`:`value:${r.value}`}function T(r=d=>d.isTrusted){let d=new WeakMap,u=new WeakSet,s=new WeakMap,o={heard(e,t){if(!(!y(t)||!r(e))&&(e.type==="input"||e.type==="change"&&E(t))&&((E(t)||v(t))&&u.delete(t),v(t)&&s.delete(t),d.set(t,h(t)),t.type==="radio"&&t.name)){let i=t.getRootNode();for(let c of i.querySelectorAll?.('input[type="radio"]')??[])c.name===t.name&&d.set(c,h(c))}},filled(e){d.delete(e),s.delete(e),y(e)&&!v(e)?u.add(e):u.delete(e)},press(e,t,i){if(e.type!=="click"||!r(e))return;let c=t.closest("[data-act]");if(!(!c||y(c)&&c.hasAttribute("data-save")))return o.collect(c,i)},collect(e,t){if(!e.hasAttribute("data-act")||!t.contains(e))return;let i=e.closest("[data-record]"),c=e.closest("fieldset, [role='group']")??t,l=[];for(let n of c.querySelectorAll("input[name], select[name], textarea[name]")){let a=n,f=!u.has(a)&&d.get(a)===h(a);if(a.type==="radio"){if(!a.checked)continue;l.push({name:a.name,value:a.value,typed:f,empty:!1,chosen:!0});continue}if(a.localName==="select"){l.push({name:a.name,value:a.value,typed:f,empty:a.value===""&&!f,chosen:!0});continue}if(a.type==="checkbox"){l.push({name:a.name,value:a.checked,typed:f,empty:!a.checked&&!u.has(a)&&!f});continue}let k=(a.type==="number"||a.type==="range")&&a.value!==""&&Number.isFinite(a.valueAsNumber)?a.valueAsNumber:a.value,w=f?s.get(a):void 0;l.push({name:a.name,value:k,typed:f,empty:a.value===""&&!f,...w?{from:w}:{}})}return{as:e.getAttribute("data-act")??"",...i&&t.contains(i)?{record:i.getAttribute("data-record")}:{},fields:l}},prefilled(e,t){u.delete(e),s.set(e,t),d.set(e,h(e))}};return o}var M=1e3;function x(r){let d=r.getAttribute("data-debounce")?.trim(),u=d?Number(d):Number.NaN;return Number.isFinite(u)?Math.min(1e4,Math.max(250,Math.round(u))):M}function R(r){let d=r.trusted??(e=>e.isTrusted),u=r.timers??{set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)},s=new Map,o=(e,t)=>{let i=s.get(e);i&&u.clear(i.handle),s.delete(e);let c=r.reader.collect(e,t);c&&r.save(c,e)};return{heard(e,t,i){if(!y(t)||!d(e)||!t.hasAttribute("data-act"))return;let c=t.getAttribute("data-save");if(e.type==="input"&&c==="input"){let l=s.get(t);l&&u.clear(l.handle),s.set(t,{root:i,handle:u.set(()=>o(t,i),x(t))})}else e.type==="change"&&(c==="change"||c==="input"&&s.has(t))&&o(t,i)},flush(){for(let[e,{root:t}]of[...s])o(e,t)},get waiting(){return s.size}}}var N=new Set(["text","search","email","url","tel","number"]);function O(r,d,u,s){for(let o of r.querySelectorAll("input[data-prefill], textarea[data-prefill]")){let e=o;if(u.has(e))continue;let t=e.getAttribute("data-prefill")??"";if(t===""||e.getAttribute("name")!==t||e.localName==="input"&&!N.has(e.type))continue;if(e.value!==""){u.add(e);continue}let c=[...(e.closest("fieldset, [role='group']")??r).querySelectorAll("[data-act]")],l=e.closest("[data-record]"),n=new Set(c.map(p=>p.closest("[data-record]")?.getAttribute("data-record")).filter(p=>typeof p=="string")),a=l&&r.contains(l)?l.getAttribute("data-record"):n.size===1?[...n][0]:void 0;if(!a)continue;let f=s({record:a,field:t,acts:c.map(p=>p.getAttribute("data-act")??"")});if(f!==void 0){if(e.value=f,u.add(e),e.value!==f){e.value="";continue}d.prefilled(e,{record:a,field:t,value:f})}}}function L(r,d,u,s){let o=g(d,s.as);if(!o)return m("undeclared",`This view may not ask for \u201C${s.as}\u201D: its manifest does not name it.`);let e=r.allMutations().find(n=>n.name===o.act);if(!e)return m("unknown-act","There is no act by that name here.");let t={};if(s.record!==void 0){let n=o.record??e.subject?.arg;if(!n)return m("unbound",`\u201C${s.as}\u201D is not done to a record.`);if(!u.has(s.record))return m("unbound","That press is bound to a record this view was not shown.");t[n]=s.record}for(let[n,a]of Object.entries(o.constants??{})){if(n in t)return m("malformed",`\u201C${n}\u201D is both the bound record and a constant.`);t[n]=a}let i=e.input?.shape??{},c=new Set(Object.keys(i)),l=new Set;for(let n of s.fields)if(!(!c.has(n.name)||n.name in t)){if(l.has(n.name))return m("malformed",`Two fields here are called \u201C${n.name}\u201D.`);if(l.add(n.name),n.typed&&n.chosen){let a=b(i[n.name])?.find(f=>String(f)===String(n.value));if(a!==void 0)t[n.name]=a;else if(typeof n.value=="string"&&u.has(n.value))t[n.name]=n.value;else return m("untyped",`\u201C${n.name}\u201D was a choice among the view's own words, not one this app declares, so it was not sent.`)}else{if(n.typed&&n.from&&!(s.record===n.from.record&&n.name===n.from.field&&S(r,o,n.from.record,n.from.field)))return m("untyped",`\u201C${n.name}\u201D was filled in from a record for an act that writes it back there, not for this one, so it was not sent.`);if(n.typed&&n.from&&String(n.value)===n.from.value)t[n.name]=r.graph.getNode(n.from.record)?.[n.name]??n.value;else if(n.typed)t[n.name]=n.value;else if(!n.empty)return m("untyped",`\u201C${n.name}\u201D was filled in by the view, not typed by you, so it was not sent.`)}}return{ok:!0,name:o.act,args:t}}function S(r,d,u,s){let o=r.allMutations().find(c=>c.name===d.act),e=o?.subject;if(!o||!e||(d.record??e.arg)!==e.arg||s===e.arg||Object.hasOwn(d.constants??{},s)||!Object.hasOwn(o.input.shape??{},s)||Object.keys(o.writesOther??{}).length>0)return!1;let t=r.graph.getNode(u)?.kind,i=t===void 0?void 0:r.schema.tryDefinition(t);return!i||e.kinds!=="*"&&!e.kinds.includes(t)||!Object.hasOwn(i.fields.shape??{},s)?!1:o.writes?.includes(s)??!1}function j(r,d,u,s,o){if(!s.has(o.record))return;let e=r.seenBy(d).graph.getNode(o.record);if(!e||!o.acts.some(c=>{let l=g(u,c);if(!l||!S(r,l,o.record,o.field))return!1;let n=r.allMutations().find(a=>a.name===l.act).subject;return r.permits({name:l.act,args:{[n.arg]:o.record}},d).ok}))return;let i=e[o.field];return typeof i=="string"?i:typeof i=="number"&&Number.isFinite(i)?String(i):void 0}export{M as SAVE_DEBOUNCE_MS,T as createPressReader,R as createSaver,O as fillPrefills,L as judgePress,j as prefillOf,x as saveDebounceOf,S as writesBack};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as b,d as J}from"./chunk.MZOIPCDA.js";import{a as O,f as q}from"./chunk.4EPT2CQG.js";import{C as m,Ea as S,Hb as M,Nb as P,Ob as w,Pa as j,Qa as A,_a as v,kb as D,lb as L,mb as N,ua as R,xa as x,yc as Z,zc as k}from"./chunk.AW2T3KFV.js";var E=n=>n.safeParse?.(void 0).success??!1,T=n=>b(n).shape,F=n=>{let s=b(n);if(m(s)?.type!=="literal")return;let e=m(s)?.values;return e&&e.length===1&&typeof e[0]=="string"?e[0]:void 0};function g(n,s){let e=E(s),o=b(s),r=m(o)?.type,l=M(s);if(l)return{control:"node",name:n,optional:e,kinds:l};let y=S(s);if(y)return{control:"linked",name:n,optional:e,relation:y};if(A(s)){let a=j(n);return{control:"repeat",name:n,optional:e,...a?{of:a}:{}}}if(r==="boolean")return{control:"boolean",name:n,optional:e};let p=R(o);if(p)return{control:"file",name:n,optional:e,...p==="image"?{image:!0}:p==="video"?{video:!0}:{}};if(r==="object"){let a=o.shape??{};return{control:"group",name:n,optional:e,fields:Object.entries(a).map(([c,d])=>g(c,d))}}if(r==="union"){let a=m(o)?.options??[],c=a.map(t=>T(t));if(c.every(t=>t!==void 0)){let t=Object.keys(c[0]??{}).find(f=>c.every(u=>F(u?.[f])!==void 0));if(t)return{control:"variant",name:n,optional:e,tag:t,options:a.map((f,u)=>({value:F(c[u]?.[t])??"",fields:Object.entries(c[u]??{}).filter(([h])=>h!==t).map(([h,z])=>g(h,z))}))}}let d=a.map(t=>F(t));return d.every(t=>t!==void 0)?{control:"choice",name:n,optional:e,options:d}:{control:"opaque",name:n,optional:e}}if(r==="array"){let a=m(o)?.element;return a!==void 0?{control:"list",name:n,optional:e,item:g(n,a)}:{control:"opaque",name:n,optional:e}}let i=J(s);return i.type==="text"?{control:"text",name:n,optional:e,...i.long?{long:!0}:{},...x(o)?{app:!0}:{},...O(o)?{markdown:!0}:{},...i.holds?{holds:i.holds}:{}}:i.type==="number"&&i.duration?{control:"text",name:n,optional:e,holds:"duration"}:i.type==="date"?{control:"date",name:n,optional:e,...i.time?{time:!0}:{},...i.instant?{instant:!0}:{}}:i.type==="number"?{control:"number",name:n,optional:e,...i.min===void 0?{}:{min:i.min},...i.max===void 0?{}:{max:i.max},...i.step===void 0?{}:{step:i.step},...i.amount?{amount:i.amount}:{}}:i.type==="choice"?{control:"choice",name:n,optional:e,options:i.options}:{control:"opaque",name:n,optional:e}}function B(n){let s=n.shape;return s?Object.entries(s).map(([e,o])=>g(e,o)):[]}function K(n,s){let e={...s};for(let o of n){let r=s[o.name];r===void 0&&!o.optional&&(o.control==="list"||o.control==="boolean")&&(e[o.name]=o.control==="list"?[]:!1),o.control==="text"&&o.holds&&typeof r=="string"&&(e[o.name]=r.trim()===""?void 0:o.holds==="duration"?q(r)??r:r.trim()),o.control==="group"&&r!==void 0&&typeof r=="object"&&r!==null&&(e[o.name]=K(o.fields,r))}return e}function C(n,s,e){let o=n.derived?.act==="edit"&&n.subject?e[n.subject.arg]:void 0,r=typeof o=="string"?s.getNode(o):void 0;return r?Object.fromEntries((n.writes??[]).filter(l=>r[l]!==void 0&&r[l]!==null).map(l=>[l,r[l]])):{}}function I(n,s){return Object.fromEntries(Object.entries(n).filter(([e,o])=>!Object.hasOwn(s,e)||JSON.stringify(o)!==JSON.stringify(s[e])))}function _(n,s,e,o){let r=Z.keptFrom?.(n,s),l=new Set;if(!r)return l;let y=Object.keys(e.input.shape??{});for(let c of e.creates??[]){let d=r({id:"\0new",kind:c});for(let t of y)d?.(t)&&l.add(t)}let p=o===void 0?void 0:n.graph.getNode(o),i=p&&n.schema.tryDefinition(p.kind),a=p&&r(p);if(i&&a)for(let c of w(e,i))a(c)&&y.includes(c)&&l.add(c);return l}function dn(n,s,e,o){let r=new Set,l=s?.sees??[];if(L(e)||!l.some(k))return r;let y=D(e),p=(d,t)=>{let f=l.filter(u=>u.kinds.includes(d)&&N(u,y));return f.some(k)?v.has(t)||f.some(u=>!k(u)||(u.fields===void 0||u.fields.includes(t))&&!u.hide?.includes(t)):!0},i=Object.keys(o.input.shape??{}),a=new Map,c=(d,t)=>a.set(d,a.get(d)===!0||t);for(let d of o.creates??[]){let t=Object.keys(n.tryDefinition(d)?.fields.shape??{});for(let f of i)t.includes(f)&&c(f,p(d,f))}for(let d of P(n,o)){let t=n.tryDefinition(d);if(t)for(let f of w(o,t))i.includes(f)&&c(f,p(d,f))}for(let[d,t]of a)t||r.add(d);return r}export{B as a,K as b,C as c,I as d,_ as e,dn as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.REEDZSCG.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.3TBH2FMZ.js";import"./chunk.WE5SA6TP.js";import"./chunk.QNJYXB3U.js";import"./chunk.TI4OSTQV.js";import"./chunk.PL2P2OON.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f}from"./chunk.4B4DKCS4.js";import"./chunk.JQ7WY2VZ.js";import"./chunk.27ZVVPRZ.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import{ub as a}from"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{a as ActRefusal,e as compileDocumentWithoutCheck,d as effectsOf,f as inDocumentWords,c as kindShapes,b as readDocument};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as w,b as S,c as T,d as C,e as L,f as N,h as D}from"./chunk.GAFYE37S.js";import"./chunk.AJZBJBMO.js";var H=0,V=1,U=2,G=3,I=1,z=2,F=3,X=1,K=3,Y=8,M="~",k=c=>typeof c=="object"&&c!==null&&!Array.isArray(c),_=new Set(["input","select","textarea","option"]),J=new Set(["value","checked","selected"]);function j(c,r){let b=c.ownerDocument??c,R=r.maxNodes??5e3,E=[],m=new Map,g=new WeakMap,h={dom:c,name:"div",namespace:"html",children:[],id:M};m.set(M,h);let v=0,A=!1,i=e=>{E.push(e),E.length>200&&E.shift(),r.onRefused?.(e)},s=()=>({dom:b.createComment(""),children:[],refused:!0}),o=(e,a)=>{if(e.namespace==="html"&&e.name&&_.has(e.name))return e.dom;if(a?.namespace==="html"&&a.name==="textarea")return a.dom},y=(e,a,u)=>{let t=e.dom;if(u!=null&&typeof u!="string")return i({reason:"value",element:e.name,name:a});let n=D(e.namespace,e.name,a,u??null,r);if("refused"in n){let p=D(e.namespace,e.name,a,null,r);return"refused"in p||t.removeAttribute(p.name),i(n.refused)}for(let p of n.dropped??[])i(p);let d=e.namespace==="html"&&J.has(n.name)&&_.has(e.name),l=t,f=d?n.name==="value"?l.value:n.name==="checked"?l.checked:l.selected:void 0;n.value===null?t.removeAttribute(n.name):t.setAttribute(n.name,n.value),r.onAttribute?.(t,n.name),d&&(n.name==="value"&&"value"in l?(l.value=n.value??"",f!==l.value&&r.onFieldSet?.(t)):n.name==="checked"&&"checked"in l?(l.checked=n.value!==null,f!==l.checked&&r.onFieldSet?.(t)):n.name==="selected"&&"selected"in l&&(l.selected=n.value!==null,f!==l.selected&&r.onFieldSet?.(t.parentElement?.closest("select")??t)))},O=e=>{if(!e.refused){v-=1,e.id!==void 0&&m.delete(e.id);for(let a of e.children)O(a)}},x=(e,a)=>{if(!k(e)||typeof e.id!="string"||m.has(e.id))return i({reason:"record"}),s();if(v>=R)return i({reason:"budget"}),A||(A=!0,r.onOverBudget?.()),s();let u=e.id;if(e.type===Y)return s();if(e.type===K){if(N(a.namespace,a.name))return i({reason:"child",element:a.name}),s();let f=b.createTextNode(String(e.data??"").slice(0,w)),p={dom:f,children:[],text:!0,id:u,parent:a};return m.set(u,p),g.set(f,u),v+=1,p}if(e.type!==X)return i({reason:"record"}),s();let t=String(e.element);if(N(a.namespace,a.name))return i({reason:"child",element:t}),s();let n=L(t,a.namespace);if("refused"in n)return i(n.refused),s();let d=b.createElementNS(n.namespace==="svg"?T:S,n.name);n.as&&d.setAttribute("data-graview-as",n.as),n.namespace==="html"&&n.name==="img"&&d.setAttribute("referrerpolicy","no-referrer");let l={dom:d,name:n.name,namespace:n.namespace,children:[],id:u,parent:a};if(m.set(u,l),g.set(d,u),v+=1,k(e.attributes))for(let[f,p]of Object.entries(e.attributes))y(l,f,p);if(r.decorate?.(d,n.name,n.namespace),k(e.properties))for(let f of Object.keys(e.properties))i({reason:"attribute",element:n.name,name:f});if(k(e.eventListeners))for(let f of Object.keys(e.eventListeners))e.eventListeners[f]!=null&&i({reason:"attribute",element:n.name,name:`on${f}`});if(Array.isArray(e.children))for(let f of e.children){let p=x(f,l);l.children.push(p),d.appendChild(p.dom)}return l},B=e=>{if(!Array.isArray(e))return i({reason:"record"});let[a,u]=e,t=typeof u=="string"?m.get(u):void 0;if(!t)return i({reason:"record"});switch(a){case H:{if(t.text)return i({reason:"record"});let n=Number(e[3]),d=Number.isInteger(n)&&n>=0&&n<=t.children.length?n:t.children.length,l=x(e[2],t);t.dom.insertBefore(l.dom,t.children[d]?.dom??null),t.children.splice(d,0,l),t.namespace==="html"&&t.name==="textarea"&&r.onFieldSet?.(t.dom);return}case V:{let n=Number(e[2]),d=t.children[n];if(!d)return i({reason:"record"});t.children.splice(n,1),d.dom.parentNode?.removeChild(d.dom),O(d);return}case U:{if(!t.text)return i({reason:"record"});t.dom.data=String(e[2]??"").slice(0,w);let n=o(t,t.parent);n&&r.onFieldSet?.(n);return}case G:{if(t===h||t.text)return i({reason:"record"});let n=String(e[2]),d=e[4]??I;return d===z?y(t,n,e[3]):i(d===I||d===F?{reason:"attribute",element:t.name,name:d===F?`on${n}`:n}:{reason:"record"})}default:return i({reason:"record"})}};return{apply(e,a){if(!Array.isArray(e))return i({reason:"record"}),!0;for(let u=0;u<e.length;u+=1){if(a&&u%32===0&&a())return!1;B(e[u])}return!0},get refused(){return E},get size(){return v},idOf:e=>g.get(e),elementOf(e){let a=m.get(e);return a&&!a.text&&a!==h?a.dom:void 0},dispose(){for(let e of h.children)O(e);for(h.children.length=0;c.firstChild;)c.removeChild(c.firstChild)}}}var $=`
|
|
2
|
-
:host { display: block; position: relative; contain: layout paint style; isolation: isolate; overflow: clip; min-width: 0; }
|
|
3
|
-
[data-graview-view-root] { color: var(--graview-ink, CanvasText); font-family: var(--graview-font-body, system-ui, sans-serif); line-height: 1.45; }
|
|
4
|
-
[data-graview-view-root] [data-graview-link] { cursor: pointer; }
|
|
5
|
-
`,W=new Set(["Enter"," ","Escape","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),P=["click","input","change","keydown"];function te(c,r){let b=c.ownerDocument,R=b.createElement("style");R.setAttribute("data-graview-region",""),R.textContent=$;let E=b.createElement("style");E.setAttribute("data-graview-view-style","");let m=b.createElement("div");m.setAttribute("data-graview-view-root",""),c.append(R,E,m);let g=j(m,{origin:r.origin,...r.asset?{asset:r.asset}:{},...r.imageOrigins?{imageOrigins:r.imageOrigins}:{},...r.picture?{picture:r.picture}:{},...r.onRefused?{onRefused:r.onRefused}:{},...r.maxNodes!==void 0?{maxNodes:r.maxNodes}:{},...r.onOverBudget?{onOverBudget:r.onOverBudget}:{},decorate:(s,o,y)=>{y==="html"&&o==="button"&&s.setAttribute("type","button"),y==="html"&&(o==="input"||o==="textarea"||o==="select")&&s.setAttribute("autocomplete","off"),r.decorate?.(s,o,y)},...r.onFieldSet?{onFieldSet:r.onFieldSet}:{},...r.onAttribute?{onAttribute:r.onAttribute}:{}}),h=[],v="",A=s=>{for(let o=s.composedPath()[0];o&&o!==m&&o!==c;o=o.parentNode)if(o.nodeType===1&&g.idOf(o)!==void 0)return o},i=s=>{let o=A(s);if(!o||s.type==="keydown"&&!W.has(s.key))return;let y=r.before?.(s,o,m);if(y===!1)return;let O=o,x=o.namespaceURI==="http://www.w3.org/1999/xhtml"&&["input","select","textarea"].includes(o.localName);r.send({type:"dom-event",target:g.idOf(o),event:s.type,...x?{value:String(O.value??"")}:{},...x&&(O.type==="checkbox"||O.type==="radio")?{checked:O.checked}:{},...s.type==="keydown"?{key:s.key}:{},...y??{}})};for(let s of P)c.addEventListener(s,i);return c.addEventListener("toggle",i,!0),{apply:(s,o)=>g.apply(s,o),style(s){let o=C(s);for(let y of o.refused)h.push({reason:"css",name:"stylesheet",css:y}),h.length>200&&h.shift();v=o.css,E.textContent=v},renderer:g,get refused(){return[...g.refused,...h]},get css(){return v},dispose(){for(let s of P)c.removeEventListener(s,i);c.removeEventListener("toggle",i,!0),g.dispose(),c.replaceChildren()}}}export{$ as REGION_CSS,te as createOpenDrawing};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.GAN77YDU.js";import"./chunk.JLOSQ5UY.js";import"./chunk.FNF6XQI5.js";import"./chunk.T6S3CEW7.js";import"./chunk.LUPBT6YM.js";import"./chunk.IBWPRK2R.js";import"./chunk.RNUGQRJI.js";import"./chunk.6NFR2LYQ.js";import"./chunk.HJCQ6I3S.js";import"./chunk.B7FZLIAO.js";import"./chunk.N5ULWKR4.js";import"./chunk.GBCWI2LF.js";import"./chunk.U3CV5CCL.js";import"./chunk.LKF4BBCW.js";import"./chunk.NPS2WN7T.js";import"./chunk.JUT2VCFW.js";import"./chunk.HKD5SR45.js";import"./chunk.JEMQ66FT.js";import"./chunk.7UV7ODXU.js";import"./chunk.IIB22IIP.js";import"./chunk.MWUP5X47.js";import"./chunk.OK4FSBHI.js";import"./chunk.DAZEFSWI.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.TDCO7LEA.js";import"./chunk.WVUJXDXZ.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.GZHZLJBF.js";import"./chunk.ATKKTPJS.js";import"./chunk.OJGHDWI6.js";import"./chunk.UZSZPMRC.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.FNXW46U4.js";import"./chunk.4JWT6LIS.js";import"./chunk.SDO3U72B.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b}from"./chunk.6BIRNR5P.js";import"./chunk.GBCWI2LF.js";import"./chunk.DAZEFSWI.js";import"./chunk.OGF6UORU.js";import"./chunk.UT6642FC.js";import"./chunk.ESU2DD3J.js";import"./chunk.PL2P2OON.js";import"./chunk.27ZVVPRZ.js";import"./chunk.IN4PKQO5.js";import"./chunk.3IUJ4GW7.js";import"./chunk.UG23RICT.js";import"./chunk.MZOIPCDA.js";import"./chunk.KERLVJ6I.js";import"./chunk.4EPT2CQG.js";import"./chunk.AW2T3KFV.js";import"./chunk.2AZTW66C.js";import"./chunk.AJZBJBMO.js";export{b as actOnSeveral,a as actsForSeveral};
|