@kanonak-protocol/sdk 3.46.0 → 3.47.0

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.
@@ -1,20 +1,20 @@
1
- import{a as he}from"./chunk-NIGFQYVA.js";import{a as ae,c as Me}from"./chunk-FMYLEPMC.js";import{c as ee,d as P,g as J,h as de,i as pe,j as V,k as ne,l as B}from"./chunk-W6T7MOKY.js";function De(f){let e=f.replace(/\r\n/g,`
1
+ import{a as he}from"./chunk-NIGFQYVA.js";import{a as ae,c as De}from"./chunk-FMYLEPMC.js";import{c as ee,d as P,g as J,h as de,i as pe,j as M,k as ne,l as B}from"./chunk-W6T7MOKY.js";import{a as we,e as Me}from"./chunk-FQHALFRR.js";function He(f){let e=f.replace(/\r\n/g,`
2
2
  `).split(`
3
- `),t=[],n=0;for(;n<e.length;){let s=e[n];if(s.trim()===""){n++;continue}let r=/^(\s*)```(\S*)\s*$/.exec(s);if(r){let i=r[2],c=[];for(n++;n<e.length&&!/^(\s*)```\s*$/.test(e[n]);)c.push(e[n]),n++;n++;let l=Be(c.join(`
4
- `)),p=i?` class="language-${He(i)}"`:"";t.push(`<pre><code${p}>${l}</code></pre>`);continue}let a=/^(#{1,6})\s+(.*)$/.exec(s);if(a){let i=a[1].length,c=me(a[2].trim());t.push(`<h${i}>${c}</h${i}>`),n++;continue}if(s.includes("|")&&n+1<e.length&&Ve(e[n+1])){let i=we(s),c=cn(e[n+1]);n+=2;let l=[];for(;n<e.length&&e[n].trim()!==""&&e[n].includes("|");)l.push(we(e[n])),n++;t.push(ln(i,c,l));continue}if(/^\s*[-*]\s+/.test(s)){let i=[];for(;n<e.length&&/^\s*[-*]\s+/.test(e[n]);){let c=[e[n].replace(/^\s*[-*]\s+/,"")];for(n++;n<e.length&&e[n].trim()!==""&&!/^\s*[-*]\s+/.test(e[n])&&!/^\s*\d+\.\s+/.test(e[n]);)c.push(e[n]),n++;n<e.length&&e[n].trim()===""&&n++,i.push(`<li>${me(c.join(" ").trim())}</li>`)}t.push(`<ul>
3
+ `),t=[],n=0;for(;n<e.length;){let s=e[n];if(s.trim()===""){n++;continue}let r=/^(\s*)```(\S*)\s*$/.exec(s);if(r){let i=r[2],c=[];for(n++;n<e.length&&!/^(\s*)```\s*$/.test(e[n]);)c.push(e[n]),n++;n++;let l=Ge(c.join(`
4
+ `)),p=i?` class="language-${We(i)}"`:"";t.push(`<pre><code${p}>${l}</code></pre>`);continue}let a=/^(#{1,6})\s+(.*)$/.exec(s);if(a){let i=a[1].length,c=me(a[2].trim());t.push(`<h${i}>${c}</h${i}>`),n++;continue}if(s.includes("|")&&n+1<e.length&&Be(e[n+1])){let i=Ue(s),c=un(e[n+1]);n+=2;let l=[];for(;n<e.length&&e[n].trim()!==""&&e[n].includes("|");)l.push(Ue(e[n])),n++;t.push(dn(i,c,l));continue}if(/^\s*[-*]\s+/.test(s)){let i=[];for(;n<e.length&&/^\s*[-*]\s+/.test(e[n]);){let c=[e[n].replace(/^\s*[-*]\s+/,"")];for(n++;n<e.length&&e[n].trim()!==""&&!/^\s*[-*]\s+/.test(e[n])&&!/^\s*\d+\.\s+/.test(e[n]);)c.push(e[n]),n++;n<e.length&&e[n].trim()===""&&n++,i.push(`<li>${me(c.join(" ").trim())}</li>`)}t.push(`<ul>
5
5
  ${i.join(`
6
6
  `)}
7
7
  </ul>`);continue}if(/^\s*\d+\.\s+/.test(s)){let i=[];for(;n<e.length&&/^\s*\d+\.\s+/.test(e[n]);){let c=[e[n].replace(/^\s*\d+\.\s+/,"")];for(n++;n<e.length&&e[n].trim()!==""&&!/^\s*\d+\.\s+/.test(e[n])&&!/^\s*[-*]\s+/.test(e[n]);)c.push(e[n]),n++;n<e.length&&e[n].trim()===""&&n++,i.push(`<li>${me(c.join(" ").trim())}</li>`)}t.push(`<ol>
8
8
  ${i.join(`
9
9
  `)}
10
- </ol>`);continue}let o=[s];for(n++;n<e.length&&e[n].trim()!==""&&!/^(#{1,6})\s+/.test(e[n])&&!/^(\s*)```/.test(e[n])&&!/^\s*[-*]\s+/.test(e[n])&&!/^\s*\d+\.\s+/.test(e[n])&&!(e[n].includes("|")&&n+1<e.length&&Ve(e[n+1]));)o.push(e[n]),n++;t.push(`<p>${me(o.join(" "))}</p>`)}return t.join(`
11
- `)}function Ve(f){return f.includes("-")?/^[\s|:-]+$/.test(f):!1}function we(f){let e=f.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|").map(t=>t.trim())}function cn(f){return we(f).map(e=>{let t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function ln(f,e,t){let n=a=>{let o=e[a];return o?` style="text-align:${o}"`:""},s=f.map((a,o)=>`<th${n(o)}>${me(a)}</th>`).join(""),r=t.map(a=>`<tr>${a.map((i,c)=>`<td${n(c)}>${me(i)}</td>`).join("")}</tr>`).join(`
10
+ </ol>`);continue}let o=[s];for(n++;n<e.length&&e[n].trim()!==""&&!/^(#{1,6})\s+/.test(e[n])&&!/^(\s*)```/.test(e[n])&&!/^\s*[-*]\s+/.test(e[n])&&!/^\s*\d+\.\s+/.test(e[n])&&!(e[n].includes("|")&&n+1<e.length&&Be(e[n+1]));)o.push(e[n]),n++;t.push(`<p>${me(o.join(" "))}</p>`)}return t.join(`
11
+ `)}function Be(f){return f.includes("-")?/^[\s|:-]+$/.test(f):!1}function Ue(f){let e=f.trim();return e.startsWith("|")&&(e=e.slice(1)),e.endsWith("|")&&(e=e.slice(0,-1)),e.split("|").map(t=>t.trim())}function un(f){return Ue(f).map(e=>{let t=e.startsWith(":"),n=e.endsWith(":");return t&&n?"center":n?"right":t?"left":null})}function dn(f,e,t){let n=a=>{let o=e[a];return o?` style="text-align:${o}"`:""},s=f.map((a,o)=>`<th${n(o)}>${me(a)}</th>`).join(""),r=t.map(a=>`<tr>${a.map((i,c)=>`<td${n(c)}>${me(i)}</td>`).join("")}</tr>`).join(`
12
12
  `);return`<table>
13
13
  <thead><tr>${s}</tr></thead>
14
14
  <tbody>
15
15
  ${r}
16
16
  </tbody>
17
- </table>`}function me(f){let e=Be(f);return e=e.replace(/`([^`\n]+)`/g,(t,n)=>`<code>${n}</code>`),e=e.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(t,n,s)=>`<a href="${He(s)}">${n}</a>`),e=e.replace(/\*\*([^*\n]+)\*\*/g,(t,n)=>`<strong>${n}</strong>`),e=e.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,(t,n,s)=>`${n}<em>${s}</em>`),e=e.replace(/(^|[\s(])_([^_\n]+)_(?=[\s).,;:!?]|$)/g,(t,n,s)=>`${n}<em>${s}</em>`),e}function Be(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function He(f){return f.replace(/"/g,"&quot;").replace(/&/g,"&amp;")}var ye={publisher:"kanonak.org",package_:"derivation",name:"look"},xe={publisher:"kanonak.org",package_:"derivation",name:"tokens"},re={publisher:"kanonak.org",package_:"core-rdf",name:"Resource"},N={publisher:"kanonak.org",package_:"core-rdf",name:"label"},be={publisher:"kanonak.org",package_:"core-rdf",name:"comment"},un={publisher:"kanonak.org",package_:"look",name:"Hero"},dn={publisher:"kanonak.org",package_:"look",name:"PropertyList"},pn={publisher:"kanonak.org",package_:"look",name:"BadgeRow"},fn={publisher:"kanonak.org",package_:"look",name:"ChipRow"},kn={publisher:"kanonak.org",package_:"look",name:"ReferenceList"},gn={publisher:"kanonak.org",package_:"look",name:"ReferencedBy"},Ge={publisher:"kanonak.org",package_:"look",name:"Markdown"},ve={publisher:"kanonak.org",package_:"look",name:"NavGroup"},Ue={publisher:"kanonak.org",package_:"look",name:"NavLink"},We={publisher:"kanonak.org",package_:"look",name:"target"},hn={publisher:"kanonak.org",package_:"look",name:"ResourceGrid"},mn={publisher:"kanonak.org",package_:"look",name:"Timeline"},bn={publisher:"kanonak.org",package_:"look",name:"VersionDiff"},$n={publisher:"kanonak.org",package_:"look",name:"Figure"},jn={publisher:"kanonak.org",package_:"look",name:"StatRow"},vn={publisher:"kanonak.org",package_:"look",name:"Horizon"},_n={publisher:"kanonak.org",package_:"look",name:"PackageContents"},Le={publisher:"kanonak.org",package_:"core-kanonak",name:"Package"},Rn={publisher:"kanonak.org",package_:"look",name:"FeaturedResource"},Sn={publisher:"kanonak.org",package_:"look",name:"PublisherPackages"},Kn={publisher:"kanonak.org",package_:"look",name:"PublisherView"},yn={publisher:"kanonak.org",package_:"look",name:"Distribution"},xn={publisher:"kanonak.org",package_:"look",name:"alphaPath"},Ln={publisher:"kanonak.org",package_:"look",name:"betaPath"},ze={publisher:"kanonak.org",package_:"look",name:"SectionHeading"},On={publisher:"kanonak.org",package_:"look",name:"SectionNav"},Ye={publisher:"kanonak.org",package_:"look",name:"heading"},wn={publisher:"kanonak.org",package_:"look",name:"note"},Un={publisher:"kanonak.org",package_:"look",name:"VersionDelta"},Fn={publisher:"kanonak.org",package_:"look",name:"TimePlot"},In={publisher:"kanonak.org",package_:"look",name:"Details"},En={publisher:"kanonak.org",package_:"look",name:"skip"},Tn={publisher:"kanonak.org",package_:"derivation",name:"derivations"},Pn={publisher:"kanonak.org",package_:"look",name:"laneBy"},Cn={publisher:"kanonak.org",package_:"look",name:"stats"},An={publisher:"kanonak.org",package_:"look",name:"statPath"},Nn={publisher:"kanonak.org",package_:"look",name:"statLabel"},qe={publisher:"kanonak.org",package_:"look",name:"labelPath"},Mn={publisher:"kanonak.org",package_:"look",name:"badgePath"},Fe={publisher:"kanonak.org",package_:"look",name:"orderBy"},Je={publisher:"kanonak.org",package_:"look",name:"track"},_e={publisher:"kanonak.org",package_:"look",name:"metricPath"},Ie={publisher:"kanonak.org",package_:"look",name:"hueBy"},Ze={publisher:"kanonak.org",package_:"look",name:"lowerPath"},Xe={publisher:"kanonak.org",package_:"look",name:"upperPath"},Vn={publisher:"kanonak.org",package_:"look",name:"axisMin"},Dn={publisher:"kanonak.org",package_:"look",name:"axisMax"},Bn={publisher:"kanonak.org",package_:"look",name:"valueLabel"};var Qe={publisher:"kanonak.org",package_:"look",name:"semanticSvg"},Hn={publisher:"kanonak.org",package_:"look",name:"tierChip"},Gn={publisher:"kanonak.org",package_:"look",name:"tierIcon"},Wn={publisher:"kanonak.org",package_:"look",name:"tierCard"},zn={publisher:"kanonak.org",package_:"look",name:"tierFull"},Yn={publisher:"kanonak.org",package_:"core-rdf",name:"type"},en=6,Ee={publisher:"kanonak.org",package_:"look",name:"bands"},qn={publisher:"kanonak.org",package_:"look",name:"title"},Jn={publisher:"kanonak.org",package_:"look",name:"eyebrow"},Zn={publisher:"kanonak.org",package_:"look",name:"subtitle"},nn={publisher:"kanonak.org",package_:"look",name:"badges"},Z={publisher:"kanonak.org",package_:"look",name:"source"},Xn={publisher:"kanonak.org",package_:"look",name:"via"},Qn={publisher:"kanonak.org",package_:"look",name:"size"},et={publisher:"kanonak.org",package_:"look",name:"icon"},nt={publisher:"kanonak.org",package_:"look",name:"chips"},Te={publisher:"kanonak.org",package_:"look",name:"entries"},tt={publisher:"kanonak.org",package_:"look",name:"urlForm"},Ne=class{constructor(e){this.catalog=e}catalog;findCascadedLook(e){let t=Re(e);if(t)return{declaration:t,sourceClass:{publisher:C(e),package_:(e.namespace||"").split("/")[1]?.split("@")[0]??"",name:e.name}};let n=new Set,s=fe(e);for(;s.length>0;){let r=s.shift(),a=st(r.subject),o=Q(a);if(n.has(o))continue;n.add(o);let i=oe(this.catalog,a);for(let c of i){let l=Re(c);if(l)return{declaration:l,sourceClass:{publisher:a.publisher,package_:a.package_,name:a.name}}}for(let c of i)for(let l of Se(c))s.push(l)}if(!n.has(Q(re)))for(let r of oe(this.catalog,re)){let a=Re(r);if(a)return{declaration:a,sourceClass:{...re}}}}findCascadedTokens(e){let t=new Map;for(let[r,a]of Pe(e))t.has(r)||t.set(r,a);let n=new Set,s=fe(e);for(;s.length>0;){let r=s.shift(),a=Q(r.subject);if(n.has(a))continue;n.add(a);let o=oe(this.catalog,r.subject);if(o.length!==0)for(let i of o){for(let[c,l]of Pe(i))t.has(c)||t.set(c,l);for(let c of Se(i))s.push(c)}}if(!n.has(Q(re))){let r=oe(this.catalog,re);for(let a of r)for(let[o,i]of Pe(a))t.has(o)||t.set(o,i)}return t}renderSvg(e){let t=b(e,N)??e.name,n=(t.trim().charAt(0)||"?").toUpperCase(),s=`${e.namespace??""}/${e.name}`,r={label:t,firstLetter:n,uri:s},a=this.collectCascadedSvgTiers(e),o=h=>this.applyPlaceholders(h,e,r),i=o(a.tierChip??""),c=o(a.tierIcon??""),l=o(a.tierCard??""),p=o(a.tierFull??""),k=[...this.findCascadedTokens(e)].map(([h,g])=>`--kan-${h}: ${g};`).join(" ");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" style="${ie(k)}">
17
+ </table>`}function me(f){let e=Ge(f);return e=e.replace(/`([^`\n]+)`/g,(t,n)=>`<code>${n}</code>`),e=e.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(t,n,s)=>`<a href="${We(s)}">${n}</a>`),e=e.replace(/\*\*([^*\n]+)\*\*/g,(t,n)=>`<strong>${n}</strong>`),e=e.replace(/(^|[^*])\*([^*\n]+)\*(?!\*)/g,(t,n,s)=>`${n}<em>${s}</em>`),e=e.replace(/(^|[\s(])_([^_\n]+)_(?=[\s).,;:!?]|$)/g,(t,n,s)=>`${n}<em>${s}</em>`),e}function Ge(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function We(f){return f.replace(/"/g,"&quot;").replace(/&/g,"&amp;")}var ye={publisher:"kanonak.org",package_:"derivation",name:"look"},xe={publisher:"kanonak.org",package_:"derivation",name:"tokens"},re={publisher:"kanonak.org",package_:"core-rdf",name:"Resource"},N={publisher:"kanonak.org",package_:"core-rdf",name:"label"},be={publisher:"kanonak.org",package_:"core-rdf",name:"comment"},pn={publisher:"kanonak.org",package_:"look",name:"Hero"},fn={publisher:"kanonak.org",package_:"look",name:"PropertyList"},kn={publisher:"kanonak.org",package_:"look",name:"BadgeRow"},gn={publisher:"kanonak.org",package_:"look",name:"ChipRow"},hn={publisher:"kanonak.org",package_:"look",name:"ReferenceList"},mn={publisher:"kanonak.org",package_:"look",name:"ReferencedBy"},ze={publisher:"kanonak.org",package_:"look",name:"Markdown"},ve={publisher:"kanonak.org",package_:"look",name:"NavGroup"},Fe={publisher:"kanonak.org",package_:"look",name:"NavLink"},Ye={publisher:"kanonak.org",package_:"look",name:"target"},bn={publisher:"kanonak.org",package_:"look",name:"ResourceGrid"},$n={publisher:"kanonak.org",package_:"look",name:"Timeline"},jn={publisher:"kanonak.org",package_:"look",name:"VersionDiff"},vn={publisher:"kanonak.org",package_:"look",name:"Figure"},_n={publisher:"kanonak.org",package_:"look",name:"StatRow"},Sn={publisher:"kanonak.org",package_:"look",name:"Horizon"},Rn={publisher:"kanonak.org",package_:"look",name:"PackageContents"},Le={publisher:"kanonak.org",package_:"core-kanonak",name:"Package"},Kn={publisher:"kanonak.org",package_:"look",name:"FeaturedResource"},yn={publisher:"kanonak.org",package_:"look",name:"PublisherPackages"},xn={publisher:"kanonak.org",package_:"look",name:"PublisherView"},Ln={publisher:"kanonak.org",package_:"look",name:"Distribution"},On={publisher:"kanonak.org",package_:"look",name:"alphaPath"},wn={publisher:"kanonak.org",package_:"look",name:"betaPath"},qe={publisher:"kanonak.org",package_:"look",name:"SectionHeading"},Un={publisher:"kanonak.org",package_:"look",name:"SectionNav"},Je={publisher:"kanonak.org",package_:"look",name:"heading"},Fn={publisher:"kanonak.org",package_:"look",name:"note"},In={publisher:"kanonak.org",package_:"look",name:"VersionDelta"},En={publisher:"kanonak.org",package_:"look",name:"TimePlot"},Tn={publisher:"kanonak.org",package_:"look",name:"Details"},Pn={publisher:"kanonak.org",package_:"look",name:"skip"},Cn={publisher:"kanonak.org",package_:"derivation",name:"derivations"},An={publisher:"kanonak.org",package_:"look",name:"laneBy"},Nn={publisher:"kanonak.org",package_:"look",name:"stats"},Vn={publisher:"kanonak.org",package_:"look",name:"statPath"},Mn={publisher:"kanonak.org",package_:"look",name:"statLabel"},Ze={publisher:"kanonak.org",package_:"look",name:"labelPath"},Dn={publisher:"kanonak.org",package_:"look",name:"badgePath"},Ie={publisher:"kanonak.org",package_:"look",name:"orderBy"},Xe={publisher:"kanonak.org",package_:"look",name:"track"},_e={publisher:"kanonak.org",package_:"look",name:"metricPath"},Ee={publisher:"kanonak.org",package_:"look",name:"hueBy"},Qe={publisher:"kanonak.org",package_:"look",name:"lowerPath"},en={publisher:"kanonak.org",package_:"look",name:"upperPath"},Bn={publisher:"kanonak.org",package_:"look",name:"axisMin"},Hn={publisher:"kanonak.org",package_:"look",name:"axisMax"},Gn={publisher:"kanonak.org",package_:"look",name:"valueLabel"};var nn={publisher:"kanonak.org",package_:"look",name:"semanticSvg"},Wn={publisher:"kanonak.org",package_:"look",name:"tierChip"},zn={publisher:"kanonak.org",package_:"look",name:"tierIcon"},Yn={publisher:"kanonak.org",package_:"look",name:"tierCard"},qn={publisher:"kanonak.org",package_:"look",name:"tierFull"},Jn={publisher:"kanonak.org",package_:"core-rdf",name:"type"},tn=6,Te={publisher:"kanonak.org",package_:"look",name:"bands"},Zn={publisher:"kanonak.org",package_:"look",name:"title"},Xn={publisher:"kanonak.org",package_:"look",name:"eyebrow"},Qn={publisher:"kanonak.org",package_:"look",name:"subtitle"},sn={publisher:"kanonak.org",package_:"look",name:"badges"},Z={publisher:"kanonak.org",package_:"look",name:"source"},et={publisher:"kanonak.org",package_:"look",name:"via"},nt={publisher:"kanonak.org",package_:"look",name:"size"},tt={publisher:"kanonak.org",package_:"look",name:"icon"},st={publisher:"kanonak.org",package_:"look",name:"chips"},Pe={publisher:"kanonak.org",package_:"look",name:"entries"},at={publisher:"kanonak.org",package_:"look",name:"urlForm"},Ve=class{constructor(e){this.catalog=e}catalog;findCascadedLook(e){let t=Se(e);if(t)return{declaration:t,sourceClass:{publisher:C(e),package_:(e.namespace||"").split("/")[1]?.split("@")[0]??"",name:e.name}};let n=new Set,s=fe(e);for(;s.length>0;){let r=s.shift(),a=rt(r.subject),o=Q(a);if(n.has(o))continue;n.add(o);let i=oe(this.catalog,a);for(let c of i){let l=Se(c);if(l)return{declaration:l,sourceClass:{publisher:a.publisher,package_:a.package_,name:a.name}}}for(let c of i)for(let l of Re(c))s.push(l)}if(!n.has(Q(re)))for(let r of oe(this.catalog,re)){let a=Se(r);if(a)return{declaration:a,sourceClass:{...re}}}}findCascadedTokens(e){let t=new Map;for(let[r,a]of Ce(e))t.has(r)||t.set(r,a);let n=new Set,s=fe(e);for(;s.length>0;){let r=s.shift(),a=Q(r.subject);if(n.has(a))continue;n.add(a);let o=oe(this.catalog,r.subject);if(o.length!==0)for(let i of o){for(let[c,l]of Ce(i))t.has(c)||t.set(c,l);for(let c of Re(i))s.push(c)}}if(!n.has(Q(re))){let r=oe(this.catalog,re);for(let a of r)for(let[o,i]of Ce(a))t.has(o)||t.set(o,i)}return t}renderSvg(e){let t=b(e,N)??e.name,n=(t.trim().charAt(0)||"?").toUpperCase(),s=`${e.namespace??""}/${e.name}`,r={label:t,firstLetter:n,uri:s},a=this.collectCascadedSvgTiers(e),o=h=>this.applyPlaceholders(h,e,r),i=o(a.tierChip??""),c=o(a.tierIcon??""),l=o(a.tierCard??""),p=o(a.tierFull??""),k=[...this.findCascadedTokens(e)].map(([h,g])=>`--kan-${h}: ${g};`).join(" ");return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400" style="${ie(k)}">
18
18
  <style>
19
19
  .tier-chip,.tier-icon,.tier-card{display:none}
20
20
  .tier-full{display:block}
@@ -26,12 +26,12 @@ ${r}
26
26
  <g class="tier-icon">${c}</g>
27
27
  <g class="tier-card">${l}</g>
28
28
  <g class="tier-full">${p}</g>
29
- </svg>`}applyPlaceholders(e,t,n){return e.replace(/\{\{([^}]+)\}\}/g,(s,r)=>{let a=r.trim();if(n[a]!==void 0)return ie(n[a]);let o=a.indexOf(":");if(o>0){let c=a.slice(0,o),l=a.slice(o+1).trim();if(c==="delta"||c==="deltaArrow"||c==="deltaColor"||c==="deltaDir"){let p=this.metricDelta(t,l);return c==="deltaColor"?p?p.dir==="up"?"#34d399":p.dir==="down"?"#f87171":"#9aa5b8":"#9aa5b8":c==="deltaDir"?p?p.dir:"new":p?c==="deltaArrow"?p.dir==="up"?"\u25B2":p.dir==="down"?"\u25BC":"\u2014":ie(`${p.delta>0?"+":""}${p.delta.toFixed(2)}`):""}if(c==="svg")return this.resolvePath(t,l)??""}let i=this.resolvePath(t,a);return i===void 0?`{{${a}}}`:ie(i)})}metricDelta(e,t){let n=k=>{let h=this.resolvePath(k,t),g=h===void 0?NaN:parseFloat(h);return Number.isFinite(g)?g:void 0},s=n(e);if(s===void 0)return;let r=k=>this.parseVersion((k.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},a=(k,h)=>k.major-h.major||k.minor-h.minor||k.patch-h.patch,o={publisher:C(e),package_:(e.namespace||"").split("/")[1]?.split("@")[0]??"",name:e.name},i=r(e),c,l;for(let k of oe(this.catalog,o)){let h=r(k);a(h,i)<0&&(!l||a(h,l)>0)&&(c=k,l=h)}if(!c)return;let p=n(c);if(p===void 0)return;let u=s-p;return{delta:u,dir:Math.abs(u)<.005?"flat":u>0?"up":"down"}}resolvePath(e,t){let n=t.split("/").map(s=>s.trim()).filter(s=>s.length>0);if(n.length!==0)return this.resolvePathSteps(e,n)}resolvePathSteps(e,t){let n=at(t[0]),s=rt(e,n);if(!s)return;let r=t.length===1;if(s instanceof ne)return r?void 0:this.resolvePathSteps(s.object,t.slice(1));if(s instanceof V&&s.object instanceof P){let a=s.object.subject,o=oe(this.catalog,a);if(o.length===0){let c=H(this.catalog,a);c&&o.push(c)}if(r){for(let c of o){let l=b(c,N);if(l!==void 0)return l}return a.name}let i=t.slice(1);for(let c of o){let l=this.resolvePathSteps(c,i);if(l!==void 0)return l}return}if(r&&(s instanceof J||s instanceof de||s instanceof pe))return String(s.object)}collectCascadedSvgTiers(e){let t={},n=a=>{let o=te(a,Qe);if(!(o instanceof ne))return;let i=o.object,c=b(i,Hn),l=b(i,Gn),p=b(i,Wn),u=b(i,zn);t.tierChip===void 0&&c!==void 0&&(t.tierChip=c),t.tierIcon===void 0&&l!==void 0&&(t.tierIcon=l),t.tierCard===void 0&&p!==void 0&&(t.tierCard=p),t.tierFull===void 0&&u!==void 0&&(t.tierFull=u)};n(e);let s=new Set,r=fe(e);for(;r.length>0;){let a=r.shift(),o=Q(a.subject);if(s.has(o))continue;s.add(o);let i=oe(this.catalog,a.subject);for(let c of i){n(c);for(let l of Se(c))r.push(l)}}if(!s.has(Q(re)))for(let a of oe(this.catalog,re))n(a);return t}renderStylesheet(e){let t=this.findCascadedTokens(e),n=[];for(let[a,o]of t)n.push(` --kan-${a}: ${o};`);let s=n.length>0?`:root {
29
+ </svg>`}applyPlaceholders(e,t,n){return e.replace(/\{\{([^}]+)\}\}/g,(s,r)=>{let a=r.trim();if(n[a]!==void 0)return ie(n[a]);let o=a.indexOf(":");if(o>0){let c=a.slice(0,o),l=a.slice(o+1).trim();if(c==="delta"||c==="deltaArrow"||c==="deltaColor"||c==="deltaDir"){let p=this.metricDelta(t,l);return c==="deltaColor"?p?p.dir==="up"?"#34d399":p.dir==="down"?"#f87171":"#9aa5b8":"#9aa5b8":c==="deltaDir"?p?p.dir:"new":p?c==="deltaArrow"?p.dir==="up"?"\u25B2":p.dir==="down"?"\u25BC":"\u2014":ie(`${p.delta>0?"+":""}${p.delta.toFixed(2)}`):""}if(c==="svg")return this.resolvePath(t,l)??""}let i=this.resolvePath(t,a);return i===void 0?`{{${a}}}`:ie(i)})}metricDelta(e,t){let n=k=>{let h=this.resolvePath(k,t),g=h===void 0?NaN:parseFloat(h);return Number.isFinite(g)?g:void 0},s=n(e);if(s===void 0)return;let r=k=>this.parseVersion((k.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},a=(k,h)=>k.major-h.major||k.minor-h.minor||k.patch-h.patch,o={publisher:C(e),package_:(e.namespace||"").split("/")[1]?.split("@")[0]??"",name:e.name},i=r(e),c,l;for(let k of oe(this.catalog,o)){let h=r(k);a(h,i)<0&&(!l||a(h,l)>0)&&(c=k,l=h)}if(!c)return;let p=n(c);if(p===void 0)return;let u=s-p;return{delta:u,dir:Math.abs(u)<.005?"flat":u>0?"up":"down"}}resolvePath(e,t){let n=t.split("/").map(s=>s.trim()).filter(s=>s.length>0);if(n.length!==0)return this.resolvePathSteps(e,n)}resolvePathSteps(e,t){let n=ot(t[0]),s=it(e,n);if(!s)return;let r=t.length===1;if(s instanceof ne)return r?void 0:this.resolvePathSteps(s.object,t.slice(1));if(s instanceof M&&s.object instanceof P){let a=s.object.subject,o=oe(this.catalog,a);if(o.length===0){let c=H(this.catalog,a);c&&o.push(c)}if(r){for(let c of o){let l=b(c,N);if(l!==void 0)return l}return a.name}let i=t.slice(1);for(let c of o){let l=this.resolvePathSteps(c,i);if(l!==void 0)return l}return}if(r&&(s instanceof J||s instanceof de||s instanceof pe))return String(s.object)}collectCascadedSvgTiers(e){let t={},n=a=>{let o=te(a,nn);if(!(o instanceof ne))return;let i=o.object,c=b(i,Wn),l=b(i,zn),p=b(i,Yn),u=b(i,qn);t.tierChip===void 0&&c!==void 0&&(t.tierChip=c),t.tierIcon===void 0&&l!==void 0&&(t.tierIcon=l),t.tierCard===void 0&&p!==void 0&&(t.tierCard=p),t.tierFull===void 0&&u!==void 0&&(t.tierFull=u)};n(e);let s=new Set,r=fe(e);for(;r.length>0;){let a=r.shift(),o=Q(a.subject);if(s.has(o))continue;s.add(o);let i=oe(this.catalog,a.subject);for(let c of i){n(c);for(let l of Re(c))r.push(l)}}if(!s.has(Q(re)))for(let a of oe(this.catalog,re))n(a);return t}renderStylesheet(e){let t=this.findCascadedTokens(e),n=[];for(let[a,o]of t)n.push(` --kan-${a}: ${o};`);let s=n.length>0?`:root {
30
30
  ${n.join(`
31
31
  `)}
32
32
  }`:":root { /* no tokens resolved */ }",r=this.findBaseStylesheet(C(e))??"";return`${s}
33
- ${r}`}findBaseStylesheet(e){let t="kanonak.org/site/content",n,s;for(let a of this.catalog){if(!(a instanceof ee)||a.name!=="base-stylesheet")continue;let o=a.namespace||"";o.startsWith(`${e}/look-styles@`)?n=a:o.startsWith("kanonak.org/look-styles@")&&(s=a)}let r=n??s;if(r)for(let a of r.statement){let o=a.predicate?.subject;if(!o)continue;if(`${o.publisher}/${o.package_}/${o.name}`===t&&a instanceof J)return a.object}}renderHtml(e){let t=this.findCascadedLook(e);if(!t)return`<!-- LookRenderer: no derivation.look found for ${e.namespace}/${e.name} -->`;let n=tn(t.declaration);if(n.length===0)return"<!-- LookRenderer: look declaration has no bands -->";let s=C(e),r=this.collectSectionHeadings(n),a=[];for(let o of n)a.push(this.renderBand(o,e,s,r));return a.join(`
34
- `)}collectSectionHeadings(e){let t=[];for(let n of e){let s=$e(n);if(!s||!R(s,ze))continue;let r=b(n,Ye);r&&t.push({slug:an(r),label:r})}return t}renderPublisherIndex(e,t,n){let s=n?this.renderNavGroup(n,e):"",r=t.map(o=>{let i=o.comment?`<p class="kan-resource-card-subtitle">${d(o.comment)}</p>`:"";return`<a class="kan-resource-card" href="${d(o.href)}"><h3 class="kan-resource-card-title">${d(o.label)}</h3>${i}</a>`}).join(`
33
+ ${r}`}findBaseStylesheet(e){let t="kanonak.org/site/content",n=c=>Me((c.namespace||"").split("@")[1]??""),s,r,a,o;for(let c of this.catalog){if(!(c instanceof ee)||c.name!=="base-stylesheet")continue;let l=c.namespace||"";if(l.startsWith(`${e}/look-styles@`)){let p=n(c);p&&(!r||we(p,r)>0)&&(s=c,r=p)}else if(l.startsWith("kanonak.org/look-styles@")){let p=n(c);p&&(!o||we(p,o)>0)&&(a=c,o=p)}}let i=s??a;if(i)for(let c of i.statement){let l=c.predicate?.subject;if(!l)continue;if(`${l.publisher}/${l.package_}/${l.name}`===t&&c instanceof J)return c.object}}renderHtml(e){let t=this.findCascadedLook(e);if(!t)return`<!-- LookRenderer: no derivation.look found for ${e.namespace}/${e.name} -->`;let n=an(t.declaration);if(n.length===0)return"<!-- LookRenderer: look declaration has no bands -->";let s=C(e),r=this.collectSectionHeadings(n),a=[];for(let o of n)a.push(this.renderBand(o,e,s,r));return a.join(`
34
+ `)}collectSectionHeadings(e){let t=[];for(let n of e){let s=$e(n);if(!s||!S(s,qe))continue;let r=b(n,Je);r&&t.push({slug:on(r),label:r})}return t}renderPublisherIndex(e,t,n){let s=n?this.renderNavGroup(n,e):"",r=t.map(o=>{let i=o.comment?`<p class="kan-resource-card-subtitle">${d(o.comment)}</p>`:"";return`<a class="kan-resource-card" href="${d(o.href)}"><h3 class="kan-resource-card-title">${d(o.label)}</h3>${i}</a>`}).join(`
35
35
  `),a=`<header class="kan-hero">
36
36
  <h1 class="kan-hero-title">${d(e)}</h1>
37
37
  </header>
@@ -92,10 +92,10 @@ ${a}${n}
92
92
  </main>
93
93
  </body>
94
94
  </html>
95
- `}hasSvgDerivation(e){let t=new Set,n=fe(e);for(;n.length>0;){let s=n.shift(),r=Q(s.subject);if(t.has(r))continue;t.add(r);let a=H(this.catalog,s.subject);if(a){for(let o of a.statement)if(o instanceof B&&ce(o,"kanonak.org","derivation","derivations")){for(let i of o.object??[])if(i instanceof ae)for(let c of i.statement){if(!(c instanceof V)||!ce(c,"kanonak.org","derivation","format")||!(c.object instanceof P))continue;let l=c.object.subject;if(l.publisher==="kanonak.org"&&l.package_==="formats"&&l.name==="svg")return!0}}for(let o of Se(a))n.push(o)}}return!1}renderBand(e,t,n,s=[]){let r=$e(e);return r?R(r,On)?this.renderSectionNav(s):R(r,un)?this.renderHero(e,t,n):R(r,dn)?this.renderPropertyList(e,t,n):R(r,pn)?this.renderBadgeRow(e,t,n):R(r,fn)?this.renderChipRow(e,t,n):R(r,kn)?this.renderReferenceList(e,t,n):R(r,gn)?this.renderReferencedBy(e,t,n):R(r,Ge)?this.renderMarkdown(e,t,n):R(r,ve)?this.renderNavGroup(t,n):R(r,hn)?this.renderResourceGrid(e,n,t):R(r,mn)?this.renderTimeline(e,n):R(r,bn)?this.renderVersionDiff(e,n):R(r,$n)?this.renderFigure(e,t,n):R(r,jn)?this.renderStatRow(e,t):R(r,vn)?this.renderHorizon(e,t,n):R(r,_n)?this.renderPackageContents(t,n):R(r,Rn)?this.renderFeaturedResource(e,n):R(r,Sn)?this.renderPublisherPackages(n):R(r,yn)?this.renderDistribution(e,t):R(r,ze)?this.renderSectionHeading(e):R(r,Un)?this.renderVersionDelta(e,t):R(r,Fn)?this.renderTimePlot(e,t,n):R(r,In)?this.renderDetails(e,t,n):`<!-- LookRenderer: unsupported band ${r.publisher}/${r.package_}/${r.name} -->`:"<!-- LookRenderer: band has no rdf:type -->"}collectTrackedSeries(e,t,n,s){let{hueBy:r,lowerPath:a,upperPath:o}=s??{},i=new Map,c=e.length,l=(p,u)=>{let k=this.resolvePath(p,u);return k===void 0?NaN:parseFloat(k)};return e.forEach((p,u)=>{let k=this.readPropertyValueReferences(p,t);for(let h of k){let g=H(this.catalog,{publisher:h.subject.publisher,package_:h.subject.package_,name:h.subject.name,...h.subject.version?{version:h.subject.version}:{}});if(!g)continue;let m=h.subject.name,v=i.get(m);v||(v={key:m,label:b(g,N)??m,points:new Array(c).fill(null),...a?{lower:new Array(c).fill(null)}:{},...o?{upper:new Array(c).fill(null)}:{}},i.set(m,v));let K=l(g,n);if(Number.isFinite(K)&&(v.points[u]=K),a&&v.lower){let _=l(g,a);Number.isFinite(_)&&(v.lower[u]=_)}if(o&&v.upper){let _=l(g,o);Number.isFinite(_)&&(v.upper[u]=_)}if(r){let _=l(g,r);Number.isFinite(_)&&(v.hue=_)}v.lastSubject=g}}),[...i.values()]}hrefForSubject(e,t,n="="){let s=e.namespace||"",r=s.split("/")[1]?.split("@")[0]??"",a=s.split("@")[1]??"",o=a?this.parseVersion(a):void 0;return he.formatResourceUrl({publisher:C(e),package_:r,name:e.name,...o?{version:o}:{}},n,{contextPublisher:t})}renderVersionDiff(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.VersionDiff: no look.source -->";let s=b(e,_e),r=E(e,Je);if(!r||!s)return"<!-- LookRenderer.VersionDiff: needs look.track + look.metricPath -->";let a=E(e,Fe),o=b(e,Ie),i=this.findInstancesOfClass(n);if(i.length===0)return"<!-- LookRenderer.VersionDiff: no instances -->";let c=k=>a?this.readPropertyValueText(k,a)??"":"",l=i.slice().sort((k,h)=>c(k).localeCompare(c(h))),p=this.collectTrackedSeries(l,r,s,{hueBy:o});return p.length===0?"<!-- LookRenderer.VersionDiff: no tracked series -->":`<section class="kan-vdiff">${p.map((k,h)=>{let g=k.hue!==void 0?k.hue:Math.round(h*360/p.length),m=k.points.filter(x=>x!==null);if(m.length===0)return"";let v=m[0],K=m[m.length-1],_=K-v,U;if(Math.abs(_)>=.005){let x=_>0?"up":"down",F=_>0?"\u25B2":"\u25BC";U=`<span class="kan-vdiff-delta ${x}">${_>0?"+":""}${_.toFixed(2)} ${F}</span>`}else U='<span class="kan-vdiff-delta flat">\u2014</span>';let T=k.lastSubject&&this.isLinkable(C(k.lastSubject),t)?`<a href="${d(this.hrefForSubject(k.lastSubject,t))}">${d(k.label)}</a>`:d(k.label);return`<div class="kan-vdiff-row" style="--kan-vdiff-hue:${g}"><span class="kan-vdiff-label">${T}</span><span class="kan-vdiff-start">${v.toFixed(2)}</span>`+this.sparkline(k.points,g)+`<span class="kan-vdiff-end">${K.toFixed(2)}</span>`+U+"</div>"}).join("")}</section>`}sparkline(e,t){let a=`hsl(${t},65%,60%)`,o=e.filter(m=>m!==null);if(o.length===0)return'<svg class="kan-vdiff-spark" viewBox="0 0 132 30" xmlns="http://www.w3.org/2000/svg"></svg>';let i=Math.min(...o),l=Math.max(...o)-i,p=e.length,u=m=>p<=1?132/2:4+m/(p-1)*124,k=m=>l<1e-9?30/2:26-(m-i)/l*22,h=[],g=[];return e.forEach((m,v)=>{if(m===null)return;let K=u(v),_=k(m);h.push(`${K.toFixed(1)},${_.toFixed(1)}`),g.push(`<circle cx="${K.toFixed(1)}" cy="${_.toFixed(1)}" r="2" fill="${a}"/>`)}),`<svg class="kan-vdiff-spark" viewBox="0 0 132 30" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" role="img"><polyline points="${h.join(" ")}" fill="none" stroke="${a}" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>`+g.join("")+"</svg>"}svgUrlForSubject(e,t,n="="){return`${this.hrefForSubject(e,t,n)}.svg`}renderFigure(e,t,n){let s=t,r=E(e,Z);if(r){let l=H(this.catalog,r);l&&(s=l)}let a=this.svgUrlForSubject(s,n),o=b(s,N)??s.name,i=b(e,Qn);return`<figure class="kan-figure${i==="small"||i==="medium"||i==="large"?` kan-figure-${i}`:""}"><img class="kan-figure-img" src="${d(a)}" alt="${d(o)}" loading="lazy"/></figure>`}renderStatRow(e,t){let n=te(e,Cn),s=this.gatherValueItems(n).filter(a=>a instanceof ae);if(s.length===0)return"<!-- LookRenderer.StatRow: no look.stats -->";let r=[];for(let a of s){let o=b(a,An);if(!o)continue;let i=this.resolvePath(t,o);if(i===void 0)continue;let c=b(a,Nn)??"";r.push('<div class="kan-stat">'+(c?`<span class="kan-stat-label">${d(c)}</span>`:"")+`<span class="kan-stat-val">${d(i)}</span></div>`)}return r.length===0?"":`<div class="kan-stat-row">${r.join("")}</div>`}renderHorizon(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.Horizon: no look.source -->";let r=this.gatherValueItems(te(t,s)).filter(o=>o instanceof ae);return r.length===0?"":`<section class="kan-horizon">${r.map(o=>this.renderConditionNode(o,n,0)).join("")}</section>`}renderConditionNode(e,t,n){let s=$e(e),r=s?this.readLabelForUri({publisher:s.publisher,package_:s.package_,name:s.name})??s.name:"Condition",a=[],o=[];for(let u of e.statement){let k=u.predicate?.subject;if(!k||k.name==="type")continue;let h=this.readLabelForUri({publisher:k.publisher,package_:k.package_,name:k.name})??k.name;if(u instanceof J||u instanceof de||u instanceof pe)a.push(`<div class="kan-cond-field"><span class="kan-cond-key">${d(h)}</span><span class="kan-cond-v">${d(String(u.object))}</span></div>`);else if(u instanceof V&&u.object instanceof P){let g=u.object.subject,m=this.readLabelForUri({publisher:g.publisher,package_:g.package_,name:g.name})??g.name;a.push(`<div class="kan-cond-field"><span class="kan-cond-key">${d(h)}</span><span class="kan-cond-v">${d(m)}</span></div>`)}else if(u instanceof ne)o.push(this.renderConditionNode(u.object,t,n+1));else if(u instanceof B)for(let g of u.object??[])g instanceof ae&&o.push(this.renderConditionNode(g,t,n+1))}let i=a.length?`<div class="kan-cond-fields">${a.join("")}</div>`:"",c=o.length?`<div class="kan-cond-children">${o.join("")}</div>`:"",l=o.length>0,p=l?`<span class="kan-cond-op">${d(r)}</span>`:`<div class="kan-cond-type">${d(r)}</div>`;return`<div class="kan-cond ${l?"kan-cond-branch":"kan-cond-leaf"}">${p}${i}${c}</div>`}renderSectionHeading(e){let t=e,n=b(t,Ye);if(!n)return"<!-- LookRenderer.SectionHeading: no look.heading -->";let s=b(t,wn);return`<div class="kan-section" id="${an(n)}"><h2 class="kan-section-title">${d(n)}</h2>`+(s?`<p class="kan-section-note">${d(s)}</p>`:"")+"</div>"}renderSectionNav(e){return e.length===0?"<!-- LookRenderer.SectionNav: no section headings in this view -->":`<nav class="kan-section-nav" aria-label="On this page">${e.map(n=>`<a class="kan-section-nav-link" href="#${d(n.slug)}">${d(n.label)}</a>`).join("")}</nav>`}renderVersionDelta(e,t){let s=b(e,_e);if(!s)return"<!-- LookRenderer.VersionDelta: no look.metricPath -->";let r=O=>{let I=this.resolvePath(O,s),G=I===void 0?NaN:parseFloat(I);return Number.isFinite(G)?G:void 0},a=r(t);if(a===void 0)return"";let o=O=>this.parseVersion((O.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},i=(O,I)=>O.major-I.major||O.minor-I.minor||O.patch-I.patch,c={publisher:C(t),package_:(t.namespace||"").split("/")[1]?.split("@")[0]??"",name:t.name},l=o(t),p,u;for(let O of oe(this.catalog,c)){let I=o(O);i(I,l)<0&&(!u||i(I,u)>0)&&(p=O,u=I)}if(!p||!u)return'<div class="kan-delta kan-delta-first">First tracked in this version</div>';let k=r(p);if(k===void 0)return"";let h=a-k,g=Math.abs(h)<.005?"flat":h>0?"up":"down",m=g==="up"?"\u25B2":g==="down"?"\u25BC":"\u2014",v=g==="up"?"#34d399":g==="down"?"#f87171":"var(--kan-text-faint)",K=`${u.major}.${u.minor}.${u.patch}`,_=320,U=46,T=14,x=30,F=O=>T+Math.min(1,Math.max(0,O))*(_-2*T),L=F(k),A=F(a),le=`<svg class="kan-delta-track" viewBox="0 0 ${_} ${U}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img"><line x1="${T}" y1="${x}" x2="${_-T}" y2="${x}" class="kan-delta-base"/><line x1="${L.toFixed(1)}" y1="${x}" x2="${A.toFixed(1)}" y2="${x}" stroke="${v}" stroke-width="3"/><circle cx="${L.toFixed(1)}" cy="${x}" r="4" class="kan-delta-prev"/><circle cx="${A.toFixed(1)}" cy="${x}" r="5.5" fill="${v}"/><text x="${L.toFixed(1)}" y="${x-9}" text-anchor="middle" class="kan-delta-tick kan-delta-tick-prev">${k.toFixed(2)}</text><text x="${A.toFixed(1)}" y="${x+17}" text-anchor="middle" class="kan-delta-tick">${a.toFixed(2)}</text></svg>`;return`<div class="kan-delta"><div class="kan-delta-head"><span class="kan-delta-vs">vs ${d(K)}</span><span class="kan-delta-badge ${g}">${h>0?"+":""}${h.toFixed(2)} ${m}</span></div>`+le+"</div>"}renderTimePlot(e,t,n){let s=E(e,Z),r=E(e,Fe);if(!s||!r)return"<!-- LookRenderer.TimePlot: needs look.source + look.orderBy -->";let a=e,o=b(a,Pn),i=b(a,qe),c=[];for(let j of this.readPropertyValueReferences(t,s)){let M=H(this.catalog,{publisher:j.subject.publisher,package_:j.subject.package_,name:j.subject.name,...j.subject.version?{version:j.subject.version}:{}});if(!M)continue;let S=this.readPropertyValueText(M,r)??"",y=Date.parse(S);if(!Number.isFinite(y))continue;let X=o?this.resolvePath(M,o)??"":"",$=(i?this.resolvePath(M,i):void 0)??b(M,N)??M.name;c.push({t:y,dateStr:S,lane:X,label:$,href:this.hrefForSubject(M,n),linkable:this.isLinkable(C(M),n)})}if(c.length===0)return"<!-- LookRenderer.TimePlot: no dated points -->";let l=[];for(let j of c)l.includes(j.lane)||l.push(j.lane);let p=Math.min(...c.map(j=>j.t)),u=Math.max(...c.map(j=>j.t));u===p&&(u=p+1);let k=l.some(j=>j),h=720,g=k?96:16,m=18,v=12,K=24,_=36,U=v+l.length*_+K,T=g,x=h-m,F=x-T,L=j=>T+(j-p)/(u-p)*F,A=j=>v+j*_+_/2,le=j=>Math.round(j*360/Math.max(1,l.length)),O=[];l.forEach((j,M)=>{let S=A(M);O.push(`<line x1="${T}" y1="${S.toFixed(1)}" x2="${x}" y2="${S.toFixed(1)}" class="kan-plot-guide"/>`),j&&O.push(`<text x="${(g-8).toFixed(1)}" y="${(S+4).toFixed(1)}" text-anchor="end" class="kan-plot-lane">${ie(j)}</text>`)});let I={},G=[];for(let j of c){let M=l.indexOf(j.lane),y=((I[j.lane]=(I[j.lane]??0)+1)%3-1)*7,X=L(j.t),$=A(M)+y,w=`${Ke(j.dateStr)} \xB7 ${j.label}`,W=`<circle cx="${X.toFixed(1)}" cy="${$.toFixed(1)}" r="5" fill="hsl(${le(M)},65%,60%)" class="kan-plot-pt"><title>${ie(w)}</title></circle>`;G.push(j.linkable?`<a href="${d(j.href)}" class="kan-plot-link">${W}</a>`:W)}let ke=`<text x="${T}" y="${(U-6).toFixed(1)}" text-anchor="start" class="kan-plot-axis">${ie(Ke(new Date(p).toISOString()))}</text><text x="${x}" y="${(U-6).toFixed(1)}" text-anchor="end" class="kan-plot-axis">${ie(Ke(new Date(u).toISOString()))}</text>`;return`<section class="kan-plot">${`<svg class="kan-plot-svg" viewBox="0 0 ${h} ${U}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img">`+O.join("")+G.join("")+ke+"</svg>"}</section>`}renderDetails(e,t,n){let s=Ce(e,En),r=this.detailRows(t,n,s);return r?`<dl class="kan-details">${r}</dl>`:"<!-- LookRenderer.Details: no properties -->"}detailRows(e,t,n){let s=[];for(let r of e.statement){let a=r.predicate?.subject;if(!a||this.isMetaPredicate(a)||n.some(c=>R(c,a)))continue;let o=this.readLabelForUri({publisher:a.publisher,package_:a.package_,name:a.name})??a.name,i=this.detailValue(r,t,n);i&&s.push(`<dt class="kan-details-key">${d(o)}</dt><dd class="kan-details-val">${i}</dd>`)}return s.join("")}detailValue(e,t,n){if(e instanceof J)return it(e.object);if(e instanceof de||e instanceof pe)return d(String(e.object));if(e instanceof V&&e.object instanceof P)return this.detailReferenceLink(e.object,t);if(e instanceof ne)return this.detailEmbedded(e.object,t,n);if(e instanceof B){let s=e.object??[];return s.length>0&&s.every(r=>r instanceof ae)?s.map(r=>this.detailEmbedded(r,t,n)).join(""):s.map(r=>r instanceof P?this.detailReferenceLink(r,t):r instanceof ae?this.detailEmbedded(r,t,n):d(String(r))).filter(r=>r).join(", ")}return""}detailReferenceLink(e,t){let n=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name;if(!this.isLinkable(e.subject.publisher,t))return`<span class="kan-link-plain">${d(n)}</span>`;let s=this.urlForReference(e,void 0,t);return`<img class="kan-md-chip" src="${d(`${s}.svg`)}" alt="" loading="lazy"><a class="kan-link" href="${d(s)}">${d(n)}</a>`}detailEmbedded(e,t,n){let s=$e(e),r=s?this.readLabelForUri({publisher:s.publisher,package_:s.package_,name:s.name})??s.name:"",a=this.detailRows(e,t,n);return'<div class="kan-details-embed">'+(r?`<span class="kan-details-type">${d(r)}</span>`:"")+(a?`<dl class="kan-details">${a}</dl>`:"")+"</div>"}isMetaPredicate(e){return R(e,Yn)||R(e,N)||R(e,be)||R(e,ye)||R(e,xe)||R(e,Tn)||R(e,Qe)}renderPackageContents(e,t){let n=e.namespace||"";if(!n)return"";let s=this.catalog.filter(a=>a instanceof ee&&a.namespace===n&&a.name!==e.name);return s.length===0?`<!-- LookRenderer.PackageContents: no members in ${n} -->`:(s.sort((a,o)=>{let i=b(a,N)??a.name,c=b(o,N)??o.name;return i.localeCompare(c)}),`<section class="kan-pkg-grid">${s.map(a=>{let o=b(a,N)??a.name,i=b(a,be),c=i?Ae(i,160):"",l=this.hrefForSubject(a,t),p=this.svgUrlForSubject(a,t);return`<a class="kan-pkg-card" href="${d(l)}"><img class="kan-pkg-card-svg" src="${d(p)}" alt="" loading="lazy"/><span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(o)}</span>`+(c?`<span class="kan-pkg-card-comment">${d(c)}</span>`:"")+"</span></a>"}).join("")}</section>`)}renderReferencedBy(e,t,n){let s=E(e,Xn),r={publisher:C(t),package_:(t.namespace||"").split("/")[1]?.split("@")[0]??"",name:t.name},a=Q(r),o=u=>this.parseVersion((u.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},i=(u,k)=>u.major-k.major||u.minor-k.minor||u.patch-k.patch,c=new Map;for(let u of this.catalog){if(!(u instanceof ee))continue;let k=Q({publisher:C(u),package_:(u.namespace||"").split("/")[1]?.split("@")[0]??"",name:u.name});if(k===a||!this.referencesTarget(u,a,s))continue;let h=c.get(k);(!h||i(o(u),o(h))>0)&&c.set(k,u)}let l=[...c.values()];return l.length===0?"<!-- LookRenderer.ReferencedBy: no incoming references -->":(l.sort((u,k)=>{let h=b(u,N)??u.name,g=b(k,N)??k.name;return h.localeCompare(g)}),`<section class="kan-pkg-grid">${l.map(u=>{let k=b(u,N)??u.name,h=b(u,be),g=h?Ae(h,160):"",m=`<span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(k)}</span>`+(g?`<span class="kan-pkg-card-comment">${d(g)}</span>`:"")+"</span>";if(!this.isLinkable(C(u),n))return`<span class="kan-pkg-card">${m}</span>`;let v=this.hrefForSubject(u,n),K=this.svgUrlForSubject(u,n);return`<a class="kan-pkg-card" href="${d(v)}"><img class="kan-pkg-card-svg" src="${d(K)}" alt="" loading="lazy"/>`+m+"</a>"}).join("")}</section>`)}referencesTarget(e,t,n){for(let s of e.statement){let r=s.predicate?.subject;if(r?.name==="type"||n&&!(r&&Q(r)===Q(n)))continue;let a=[];if(s instanceof V&&s.object instanceof P)a.push(s.object);else if(s instanceof B)for(let o of s.object??[])o instanceof P&&a.push(o);for(let o of a)if(Q(o.subject)===t)return!0}return!1}renderFeaturedResource(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.FeaturedResource: no look.source -->";let s=oe(this.catalog,n),r=c=>this.parseVersion((c.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},a=s.length>0?s.slice().sort((c,l)=>{let p=r(c),u=r(l);return u.major-p.major||u.minor-p.minor||u.patch-p.patch})[0]:H(this.catalog,n);if(!a)return`<!-- LookRenderer.FeaturedResource: ${n.publisher}/${n.package_}/${n.name} not found -->`;let o=this.renderHtml(a),i=this.hrefForSubject(a,t);return`<section class="kan-featured"><a class="kan-featured-permalink" href="${d(i)}">View full resource \u2192</a>`+o+"</section>"}renderDistribution(e,t){let n=e,s=S=>{let y=b(n,S);if(!y)return;let X=this.resolvePath(t,y),$=X===void 0?NaN:parseFloat(X);return Number.isFinite($)?$:void 0},r=s(xn),a=s(Ln);if(r===void 0||a===void 0||r<=0||a<=0)return"<!-- LookRenderer.Distribution: needs resolvable alphaPath + betaPath (> 0) -->";let o=s(_e)??r/(r+a),i=s(Ze),c=s(Xe),l=s(Ie),p=l!==void 0?`hsl(${l},65%,60%)`:"var(--kan-accent)",u=S=>Number.isInteger(S)?String(S):S.toFixed(1),k=280,h=168,g={top:14,right:14,bottom:24,left:14},m=k-g.left-g.right,v=h-g.top-g.bottom,K=120,_=1e-4,U=[],T=[],x=0;for(let S=0;S<=K;S++){let y=S/K;y<_?y=_:y>1-_&&(y=1-_);let X=Math.exp((r-1)*Math.log(y)+(a-1)*Math.log(1-y));U.push(y),T.push(X),X>x&&(x=X)}let F=S=>g.left+Math.min(1,Math.max(0,S))*m,L=S=>g.top+(1-(x>0?S/x:0))*v,A=g.top+v,le=U.map((S,y)=>`${F(S).toFixed(1)},${L(T[y]).toFixed(1)}`),O=`M${F(0).toFixed(1)},${A.toFixed(1)} L${le.join(" L")} L${F(1).toFixed(1)},${A.toFixed(1)} Z`,I="";if(i!==void 0&&c!==void 0&&c>i){let S=[`${F(i).toFixed(1)},${A.toFixed(1)}`];for(let y=0;y<=K;y++)U[y]>=i&&U[y]<=c&&S.push(`${F(U[y]).toFixed(1)},${L(T[y]).toFixed(1)}`);S.push(`${F(c).toFixed(1)},${A.toFixed(1)}`),I=`<path d="M${S.join(" L")} Z" fill="${p}" fill-opacity="0.3"/>`}let G=F(o),ke=`<line x1="${G.toFixed(1)}" y1="${g.top.toFixed(1)}" x2="${G.toFixed(1)}" y2="${A.toFixed(1)}" stroke="${p}" stroke-width="1.5" stroke-dasharray="3 3"/><text x="${G.toFixed(1)}" y="${(g.top-3).toFixed(1)}" text-anchor="middle" class="kan-dist-mean">\u03BC ${o.toFixed(2)}</text>`,je=`<text x="${F(0).toFixed(1)}" y="${(A+15).toFixed(1)}" text-anchor="start" class="kan-dist-axis">0</text><text x="${F(1).toFixed(1)}" y="${(A+15).toFixed(1)}" text-anchor="end" class="kan-dist-axis">1</text>`,j=`<svg class="kan-dist-svg" viewBox="0 0 ${k} ${h}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img"><line x1="${g.left}" y1="${A.toFixed(1)}" x2="${(k-g.right).toFixed(1)}" y2="${A.toFixed(1)}" class="kan-dist-base"/><path d="${O}" fill="${p}" fill-opacity="0.12"/>`+I+`<polyline points="${le.join(" ")}" fill="none" stroke="${p}" stroke-width="2"/>`+ke+je+"</svg>",M=i!==void 0&&c!==void 0?` \xB7 95% CI [${i.toFixed(2)}\u2013${c.toFixed(2)}]`:"";return`<figure class="kan-dist">${j}<figcaption class="kan-dist-caption">Beta(${u(r)}, ${u(a)})${M}</figcaption></figure>`}renderPublisherPackages(e){let t=new Map,n=o=>this.parseVersion((o.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},s=(o,i)=>o.major>i.major||o.major===i.major&&(o.minor>i.minor||o.minor===i.minor&&o.patch>i.patch);for(let o of this.catalog){if(!(o instanceof ee)||C(o)!==e)continue;let i=(o.namespace||"").split("/")[1]?.split("@")[0]??"";if(!i||o.name!==i)continue;let c=t.get(i);(!c||s(n(o),n(c)))&&t.set(i,o)}let r=[...t.entries()].sort((o,i)=>o[0].localeCompare(i[0]));return r.length===0?"":`<section class="kan-pkg-grid">${r.map(([o,i])=>{let c=b(i,N)??o,l=b(i,be),p=l?Ae(l,160):"",u=this.svgUrlForSubject(i,e);return`<a class="kan-pkg-card" href="/${d(o)}"><img class="kan-pkg-card-svg" src="${d(u)}" alt="" loading="lazy"/><span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(c)}</span>`+(p?`<span class="kan-pkg-card-comment">${d(p)}</span>`:"")+"</span></a>"}).join("")}</section>`}findPublisherRootView(e){for(let t of this.catalog){if(!(t instanceof ee)||C(t)!==e)continue;let n=Re(t);if(!n)continue;let s=$e(n);if(s&&R(s,Kn))return t}}renderTimeline(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.Timeline: no look.source -->";let s=E(e,Fe),r=this.findInstancesOfClass(n);if(r.length===0)return"<!-- LookRenderer.Timeline: no instances -->";let a=p=>s?this.readPropertyValueText(p,s)??"":"",o=r.slice().sort((p,u)=>a(p).localeCompare(a(u))),i=E(e,Je),c=b(e,_e);return i&&c?this.renderTrajectoryChart(o,i,c,e,t,a):`<section class="kan-timeline"><ol>
95
+ `}hasSvgDerivation(e){let t=new Set,n=fe(e);for(;n.length>0;){let s=n.shift(),r=Q(s.subject);if(t.has(r))continue;t.add(r);let a=H(this.catalog,s.subject);if(a){for(let o of a.statement)if(o instanceof B&&ce(o,"kanonak.org","derivation","derivations")){for(let i of o.object??[])if(i instanceof ae)for(let c of i.statement){if(!(c instanceof M)||!ce(c,"kanonak.org","derivation","format")||!(c.object instanceof P))continue;let l=c.object.subject;if(l.publisher==="kanonak.org"&&l.package_==="formats"&&l.name==="svg")return!0}}for(let o of Re(a))n.push(o)}}return!1}renderBand(e,t,n,s=[]){let r=$e(e);return r?S(r,Un)?this.renderSectionNav(s):S(r,pn)?this.renderHero(e,t,n):S(r,fn)?this.renderPropertyList(e,t,n):S(r,kn)?this.renderBadgeRow(e,t,n):S(r,gn)?this.renderChipRow(e,t,n):S(r,hn)?this.renderReferenceList(e,t,n):S(r,mn)?this.renderReferencedBy(e,t,n):S(r,ze)?this.renderMarkdown(e,t,n):S(r,ve)?this.renderNavGroup(t,n):S(r,bn)?this.renderResourceGrid(e,n,t):S(r,$n)?this.renderTimeline(e,n):S(r,jn)?this.renderVersionDiff(e,n):S(r,vn)?this.renderFigure(e,t,n):S(r,_n)?this.renderStatRow(e,t):S(r,Sn)?this.renderHorizon(e,t,n):S(r,Rn)?this.renderPackageContents(t,n):S(r,Kn)?this.renderFeaturedResource(e,n):S(r,yn)?this.renderPublisherPackages(n):S(r,Ln)?this.renderDistribution(e,t):S(r,qe)?this.renderSectionHeading(e):S(r,In)?this.renderVersionDelta(e,t):S(r,En)?this.renderTimePlot(e,t,n):S(r,Tn)?this.renderDetails(e,t,n):`<!-- LookRenderer: unsupported band ${r.publisher}/${r.package_}/${r.name} -->`:"<!-- LookRenderer: band has no rdf:type -->"}collectTrackedSeries(e,t,n,s){let{hueBy:r,lowerPath:a,upperPath:o}=s??{},i=new Map,c=e.length,l=(p,u)=>{let k=this.resolvePath(p,u);return k===void 0?NaN:parseFloat(k)};return e.forEach((p,u)=>{let k=this.readPropertyValueReferences(p,t);for(let h of k){let g=H(this.catalog,{publisher:h.subject.publisher,package_:h.subject.package_,name:h.subject.name,...h.subject.version?{version:h.subject.version}:{}});if(!g)continue;let m=h.subject.name,v=i.get(m);v||(v={key:m,label:b(g,N)??m,points:new Array(c).fill(null),...a?{lower:new Array(c).fill(null)}:{},...o?{upper:new Array(c).fill(null)}:{}},i.set(m,v));let K=l(g,n);if(Number.isFinite(K)&&(v.points[u]=K),a&&v.lower){let _=l(g,a);Number.isFinite(_)&&(v.lower[u]=_)}if(o&&v.upper){let _=l(g,o);Number.isFinite(_)&&(v.upper[u]=_)}if(r){let _=l(g,r);Number.isFinite(_)&&(v.hue=_)}v.lastSubject=g}}),[...i.values()]}hrefForSubject(e,t,n="="){let s=e.namespace||"",r=s.split("/")[1]?.split("@")[0]??"",a=s.split("@")[1]??"",o=a?this.parseVersion(a):void 0;return he.formatResourceUrl({publisher:C(e),package_:r,name:e.name,...o?{version:o}:{}},n,{contextPublisher:t})}renderVersionDiff(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.VersionDiff: no look.source -->";let s=b(e,_e),r=E(e,Xe);if(!r||!s)return"<!-- LookRenderer.VersionDiff: needs look.track + look.metricPath -->";let a=E(e,Ie),o=b(e,Ee),i=this.findInstancesOfClass(n);if(i.length===0)return"<!-- LookRenderer.VersionDiff: no instances -->";let c=k=>a?this.readPropertyValueText(k,a)??"":"",l=i.slice().sort((k,h)=>c(k).localeCompare(c(h))),p=this.collectTrackedSeries(l,r,s,{hueBy:o});return p.length===0?"<!-- LookRenderer.VersionDiff: no tracked series -->":`<section class="kan-vdiff">${p.map((k,h)=>{let g=k.hue!==void 0?k.hue:Math.round(h*360/p.length),m=k.points.filter(x=>x!==null);if(m.length===0)return"";let v=m[0],K=m[m.length-1],_=K-v,U;if(Math.abs(_)>=.005){let x=_>0?"up":"down",F=_>0?"\u25B2":"\u25BC";U=`<span class="kan-vdiff-delta ${x}">${_>0?"+":""}${_.toFixed(2)} ${F}</span>`}else U='<span class="kan-vdiff-delta flat">\u2014</span>';let T=k.lastSubject&&this.isLinkable(C(k.lastSubject),t)?`<a href="${d(this.hrefForSubject(k.lastSubject,t))}">${d(k.label)}</a>`:d(k.label);return`<div class="kan-vdiff-row" style="--kan-vdiff-hue:${g}"><span class="kan-vdiff-label">${T}</span><span class="kan-vdiff-start">${v.toFixed(2)}</span>`+this.sparkline(k.points,g)+`<span class="kan-vdiff-end">${K.toFixed(2)}</span>`+U+"</div>"}).join("")}</section>`}sparkline(e,t){let a=`hsl(${t},65%,60%)`,o=e.filter(m=>m!==null);if(o.length===0)return'<svg class="kan-vdiff-spark" viewBox="0 0 132 30" xmlns="http://www.w3.org/2000/svg"></svg>';let i=Math.min(...o),l=Math.max(...o)-i,p=e.length,u=m=>p<=1?132/2:4+m/(p-1)*124,k=m=>l<1e-9?30/2:26-(m-i)/l*22,h=[],g=[];return e.forEach((m,v)=>{if(m===null)return;let K=u(v),_=k(m);h.push(`${K.toFixed(1)},${_.toFixed(1)}`),g.push(`<circle cx="${K.toFixed(1)}" cy="${_.toFixed(1)}" r="2" fill="${a}"/>`)}),`<svg class="kan-vdiff-spark" viewBox="0 0 132 30" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" role="img"><polyline points="${h.join(" ")}" fill="none" stroke="${a}" stroke-width="1.5" stroke-linejoin="round" stroke-linecap="round"/>`+g.join("")+"</svg>"}svgUrlForSubject(e,t,n="="){return`${this.hrefForSubject(e,t,n)}.svg`}renderFigure(e,t,n){let s=t,r=E(e,Z);if(r){let l=H(this.catalog,r);l&&(s=l)}let a=this.svgUrlForSubject(s,n),o=b(s,N)??s.name,i=b(e,nt);return`<figure class="kan-figure${i==="small"||i==="medium"||i==="large"?` kan-figure-${i}`:""}"><img class="kan-figure-img" src="${d(a)}" alt="${d(o)}" loading="lazy"/></figure>`}renderStatRow(e,t){let n=te(e,Nn),s=this.gatherValueItems(n).filter(a=>a instanceof ae);if(s.length===0)return"<!-- LookRenderer.StatRow: no look.stats -->";let r=[];for(let a of s){let o=b(a,Vn);if(!o)continue;let i=this.resolvePath(t,o);if(i===void 0)continue;let c=b(a,Mn)??"";r.push('<div class="kan-stat">'+(c?`<span class="kan-stat-label">${d(c)}</span>`:"")+`<span class="kan-stat-val">${d(i)}</span></div>`)}return r.length===0?"":`<div class="kan-stat-row">${r.join("")}</div>`}renderHorizon(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.Horizon: no look.source -->";let r=this.gatherValueItems(te(t,s)).filter(o=>o instanceof ae);return r.length===0?"":`<section class="kan-horizon">${r.map(o=>this.renderConditionNode(o,n,0)).join("")}</section>`}renderConditionNode(e,t,n){let s=$e(e),r=s?this.readLabelForUri({publisher:s.publisher,package_:s.package_,name:s.name})??s.name:"Condition",a=[],o=[];for(let u of e.statement){let k=u.predicate?.subject;if(!k||k.name==="type")continue;let h=this.readLabelForUri({publisher:k.publisher,package_:k.package_,name:k.name})??k.name;if(u instanceof J||u instanceof de||u instanceof pe)a.push(`<div class="kan-cond-field"><span class="kan-cond-key">${d(h)}</span><span class="kan-cond-v">${d(String(u.object))}</span></div>`);else if(u instanceof M&&u.object instanceof P){let g=u.object.subject,m=this.readLabelForUri({publisher:g.publisher,package_:g.package_,name:g.name})??g.name;a.push(`<div class="kan-cond-field"><span class="kan-cond-key">${d(h)}</span><span class="kan-cond-v">${d(m)}</span></div>`)}else if(u instanceof ne)o.push(this.renderConditionNode(u.object,t,n+1));else if(u instanceof B)for(let g of u.object??[])g instanceof ae&&o.push(this.renderConditionNode(g,t,n+1))}let i=a.length?`<div class="kan-cond-fields">${a.join("")}</div>`:"",c=o.length?`<div class="kan-cond-children">${o.join("")}</div>`:"",l=o.length>0,p=l?`<span class="kan-cond-op">${d(r)}</span>`:`<div class="kan-cond-type">${d(r)}</div>`;return`<div class="kan-cond ${l?"kan-cond-branch":"kan-cond-leaf"}">${p}${i}${c}</div>`}renderSectionHeading(e){let t=e,n=b(t,Je);if(!n)return"<!-- LookRenderer.SectionHeading: no look.heading -->";let s=b(t,Fn);return`<div class="kan-section" id="${on(n)}"><h2 class="kan-section-title">${d(n)}</h2>`+(s?`<p class="kan-section-note">${d(s)}</p>`:"")+"</div>"}renderSectionNav(e){return e.length===0?"<!-- LookRenderer.SectionNav: no section headings in this view -->":`<nav class="kan-section-nav" aria-label="On this page">${e.map(n=>`<a class="kan-section-nav-link" href="#${d(n.slug)}">${d(n.label)}</a>`).join("")}</nav>`}renderVersionDelta(e,t){let s=b(e,_e);if(!s)return"<!-- LookRenderer.VersionDelta: no look.metricPath -->";let r=O=>{let I=this.resolvePath(O,s),G=I===void 0?NaN:parseFloat(I);return Number.isFinite(G)?G:void 0},a=r(t);if(a===void 0)return"";let o=O=>this.parseVersion((O.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},i=(O,I)=>O.major-I.major||O.minor-I.minor||O.patch-I.patch,c={publisher:C(t),package_:(t.namespace||"").split("/")[1]?.split("@")[0]??"",name:t.name},l=o(t),p,u;for(let O of oe(this.catalog,c)){let I=o(O);i(I,l)<0&&(!u||i(I,u)>0)&&(p=O,u=I)}if(!p||!u)return'<div class="kan-delta kan-delta-first">First tracked in this version</div>';let k=r(p);if(k===void 0)return"";let h=a-k,g=Math.abs(h)<.005?"flat":h>0?"up":"down",m=g==="up"?"\u25B2":g==="down"?"\u25BC":"\u2014",v=g==="up"?"#34d399":g==="down"?"#f87171":"var(--kan-text-faint)",K=`${u.major}.${u.minor}.${u.patch}`,_=320,U=46,T=14,x=30,F=O=>T+Math.min(1,Math.max(0,O))*(_-2*T),L=F(k),A=F(a),le=`<svg class="kan-delta-track" viewBox="0 0 ${_} ${U}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img"><line x1="${T}" y1="${x}" x2="${_-T}" y2="${x}" class="kan-delta-base"/><line x1="${L.toFixed(1)}" y1="${x}" x2="${A.toFixed(1)}" y2="${x}" stroke="${v}" stroke-width="3"/><circle cx="${L.toFixed(1)}" cy="${x}" r="4" class="kan-delta-prev"/><circle cx="${A.toFixed(1)}" cy="${x}" r="5.5" fill="${v}"/><text x="${L.toFixed(1)}" y="${x-9}" text-anchor="middle" class="kan-delta-tick kan-delta-tick-prev">${k.toFixed(2)}</text><text x="${A.toFixed(1)}" y="${x+17}" text-anchor="middle" class="kan-delta-tick">${a.toFixed(2)}</text></svg>`;return`<div class="kan-delta"><div class="kan-delta-head"><span class="kan-delta-vs">vs ${d(K)}</span><span class="kan-delta-badge ${g}">${h>0?"+":""}${h.toFixed(2)} ${m}</span></div>`+le+"</div>"}renderTimePlot(e,t,n){let s=E(e,Z),r=E(e,Ie);if(!s||!r)return"<!-- LookRenderer.TimePlot: needs look.source + look.orderBy -->";let a=e,o=b(a,An),i=b(a,Ze),c=[];for(let j of this.readPropertyValueReferences(t,s)){let V=H(this.catalog,{publisher:j.subject.publisher,package_:j.subject.package_,name:j.subject.name,...j.subject.version?{version:j.subject.version}:{}});if(!V)continue;let R=this.readPropertyValueText(V,r)??"",y=Date.parse(R);if(!Number.isFinite(y))continue;let X=o?this.resolvePath(V,o)??"":"",$=(i?this.resolvePath(V,i):void 0)??b(V,N)??V.name;c.push({t:y,dateStr:R,lane:X,label:$,href:this.hrefForSubject(V,n),linkable:this.isLinkable(C(V),n)})}if(c.length===0)return"<!-- LookRenderer.TimePlot: no dated points -->";let l=[];for(let j of c)l.includes(j.lane)||l.push(j.lane);let p=Math.min(...c.map(j=>j.t)),u=Math.max(...c.map(j=>j.t));u===p&&(u=p+1);let k=l.some(j=>j),h=720,g=k?96:16,m=18,v=12,K=24,_=36,U=v+l.length*_+K,T=g,x=h-m,F=x-T,L=j=>T+(j-p)/(u-p)*F,A=j=>v+j*_+_/2,le=j=>Math.round(j*360/Math.max(1,l.length)),O=[];l.forEach((j,V)=>{let R=A(V);O.push(`<line x1="${T}" y1="${R.toFixed(1)}" x2="${x}" y2="${R.toFixed(1)}" class="kan-plot-guide"/>`),j&&O.push(`<text x="${(g-8).toFixed(1)}" y="${(R+4).toFixed(1)}" text-anchor="end" class="kan-plot-lane">${ie(j)}</text>`)});let I={},G=[];for(let j of c){let V=l.indexOf(j.lane),y=((I[j.lane]=(I[j.lane]??0)+1)%3-1)*7,X=L(j.t),$=A(V)+y,w=`${Ke(j.dateStr)} \xB7 ${j.label}`,W=`<circle cx="${X.toFixed(1)}" cy="${$.toFixed(1)}" r="5" fill="hsl(${le(V)},65%,60%)" class="kan-plot-pt"><title>${ie(w)}</title></circle>`;G.push(j.linkable?`<a href="${d(j.href)}" class="kan-plot-link">${W}</a>`:W)}let ke=`<text x="${T}" y="${(U-6).toFixed(1)}" text-anchor="start" class="kan-plot-axis">${ie(Ke(new Date(p).toISOString()))}</text><text x="${x}" y="${(U-6).toFixed(1)}" text-anchor="end" class="kan-plot-axis">${ie(Ke(new Date(u).toISOString()))}</text>`;return`<section class="kan-plot">${`<svg class="kan-plot-svg" viewBox="0 0 ${h} ${U}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img">`+O.join("")+G.join("")+ke+"</svg>"}</section>`}renderDetails(e,t,n){let s=Ae(e,Pn),r=this.detailRows(t,n,s);return r?`<dl class="kan-details">${r}</dl>`:"<!-- LookRenderer.Details: no properties -->"}detailRows(e,t,n){let s=[];for(let r of e.statement){let a=r.predicate?.subject;if(!a||this.isMetaPredicate(a)||n.some(c=>S(c,a)))continue;let o=this.readLabelForUri({publisher:a.publisher,package_:a.package_,name:a.name})??a.name,i=this.detailValue(r,t,n);i&&s.push(`<dt class="kan-details-key">${d(o)}</dt><dd class="kan-details-val">${i}</dd>`)}return s.join("")}detailValue(e,t,n){if(e instanceof J)return lt(e.object);if(e instanceof de||e instanceof pe)return d(String(e.object));if(e instanceof M&&e.object instanceof P)return this.detailReferenceLink(e.object,t);if(e instanceof ne)return this.detailEmbedded(e.object,t,n);if(e instanceof B){let s=e.object??[];return s.length>0&&s.every(r=>r instanceof ae)?s.map(r=>this.detailEmbedded(r,t,n)).join(""):s.map(r=>r instanceof P?this.detailReferenceLink(r,t):r instanceof ae?this.detailEmbedded(r,t,n):d(String(r))).filter(r=>r).join(", ")}return""}detailReferenceLink(e,t){let n=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name;if(!this.isLinkable(e.subject.publisher,t))return`<span class="kan-link-plain">${d(n)}</span>`;let s=this.urlForReference(e,void 0,t);return`<img class="kan-md-chip" src="${d(`${s}.svg`)}" alt="" loading="lazy"><a class="kan-link" href="${d(s)}">${d(n)}</a>`}detailEmbedded(e,t,n){let s=$e(e),r=s?this.readLabelForUri({publisher:s.publisher,package_:s.package_,name:s.name})??s.name:"",a=this.detailRows(e,t,n);return'<div class="kan-details-embed">'+(r?`<span class="kan-details-type">${d(r)}</span>`:"")+(a?`<dl class="kan-details">${a}</dl>`:"")+"</div>"}isMetaPredicate(e){return S(e,Jn)||S(e,N)||S(e,be)||S(e,ye)||S(e,xe)||S(e,Cn)||S(e,nn)}renderPackageContents(e,t){let n=e.namespace||"";if(!n)return"";let s=this.catalog.filter(a=>a instanceof ee&&a.namespace===n&&a.name!==e.name);return s.length===0?`<!-- LookRenderer.PackageContents: no members in ${n} -->`:(s.sort((a,o)=>{let i=b(a,N)??a.name,c=b(o,N)??o.name;return i.localeCompare(c)}),`<section class="kan-pkg-grid">${s.map(a=>{let o=b(a,N)??a.name,i=b(a,be),c=i?Ne(i,160):"",l=this.hrefForSubject(a,t),p=this.svgUrlForSubject(a,t);return`<a class="kan-pkg-card" href="${d(l)}"><img class="kan-pkg-card-svg" src="${d(p)}" alt="" loading="lazy"/><span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(o)}</span>`+(c?`<span class="kan-pkg-card-comment">${d(c)}</span>`:"")+"</span></a>"}).join("")}</section>`)}renderReferencedBy(e,t,n){let s=E(e,et),r={publisher:C(t),package_:(t.namespace||"").split("/")[1]?.split("@")[0]??"",name:t.name},a=Q(r),o=u=>this.parseVersion((u.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},i=(u,k)=>u.major-k.major||u.minor-k.minor||u.patch-k.patch,c=new Map;for(let u of this.catalog){if(!(u instanceof ee))continue;let k=Q({publisher:C(u),package_:(u.namespace||"").split("/")[1]?.split("@")[0]??"",name:u.name});if(k===a||!this.referencesTarget(u,a,s))continue;let h=c.get(k);(!h||i(o(u),o(h))>0)&&c.set(k,u)}let l=[...c.values()];return l.length===0?"<!-- LookRenderer.ReferencedBy: no incoming references -->":(l.sort((u,k)=>{let h=b(u,N)??u.name,g=b(k,N)??k.name;return h.localeCompare(g)}),`<section class="kan-pkg-grid">${l.map(u=>{let k=b(u,N)??u.name,h=b(u,be),g=h?Ne(h,160):"",m=`<span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(k)}</span>`+(g?`<span class="kan-pkg-card-comment">${d(g)}</span>`:"")+"</span>";if(!this.isLinkable(C(u),n))return`<span class="kan-pkg-card">${m}</span>`;let v=this.hrefForSubject(u,n),K=this.svgUrlForSubject(u,n);return`<a class="kan-pkg-card" href="${d(v)}"><img class="kan-pkg-card-svg" src="${d(K)}" alt="" loading="lazy"/>`+m+"</a>"}).join("")}</section>`)}referencesTarget(e,t,n){for(let s of e.statement){let r=s.predicate?.subject;if(r?.name==="type"||n&&!(r&&Q(r)===Q(n)))continue;let a=[];if(s instanceof M&&s.object instanceof P)a.push(s.object);else if(s instanceof B)for(let o of s.object??[])o instanceof P&&a.push(o);for(let o of a)if(Q(o.subject)===t)return!0}return!1}renderFeaturedResource(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.FeaturedResource: no look.source -->";let s=oe(this.catalog,n),r=c=>this.parseVersion((c.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},a=s.length>0?s.slice().sort((c,l)=>{let p=r(c),u=r(l);return u.major-p.major||u.minor-p.minor||u.patch-p.patch})[0]:H(this.catalog,n);if(!a)return`<!-- LookRenderer.FeaturedResource: ${n.publisher}/${n.package_}/${n.name} not found -->`;let o=this.renderHtml(a),i=this.hrefForSubject(a,t);return`<section class="kan-featured"><a class="kan-featured-permalink" href="${d(i)}">View full resource \u2192</a>`+o+"</section>"}renderDistribution(e,t){let n=e,s=R=>{let y=b(n,R);if(!y)return;let X=this.resolvePath(t,y),$=X===void 0?NaN:parseFloat(X);return Number.isFinite($)?$:void 0},r=s(On),a=s(wn);if(r===void 0||a===void 0||r<=0||a<=0)return"<!-- LookRenderer.Distribution: needs resolvable alphaPath + betaPath (> 0) -->";let o=s(_e)??r/(r+a),i=s(Qe),c=s(en),l=s(Ee),p=l!==void 0?`hsl(${l},65%,60%)`:"var(--kan-accent)",u=R=>Number.isInteger(R)?String(R):R.toFixed(1),k=280,h=168,g={top:14,right:14,bottom:24,left:14},m=k-g.left-g.right,v=h-g.top-g.bottom,K=120,_=1e-4,U=[],T=[],x=0;for(let R=0;R<=K;R++){let y=R/K;y<_?y=_:y>1-_&&(y=1-_);let X=Math.exp((r-1)*Math.log(y)+(a-1)*Math.log(1-y));U.push(y),T.push(X),X>x&&(x=X)}let F=R=>g.left+Math.min(1,Math.max(0,R))*m,L=R=>g.top+(1-(x>0?R/x:0))*v,A=g.top+v,le=U.map((R,y)=>`${F(R).toFixed(1)},${L(T[y]).toFixed(1)}`),O=`M${F(0).toFixed(1)},${A.toFixed(1)} L${le.join(" L")} L${F(1).toFixed(1)},${A.toFixed(1)} Z`,I="";if(i!==void 0&&c!==void 0&&c>i){let R=[`${F(i).toFixed(1)},${A.toFixed(1)}`];for(let y=0;y<=K;y++)U[y]>=i&&U[y]<=c&&R.push(`${F(U[y]).toFixed(1)},${L(T[y]).toFixed(1)}`);R.push(`${F(c).toFixed(1)},${A.toFixed(1)}`),I=`<path d="M${R.join(" L")} Z" fill="${p}" fill-opacity="0.3"/>`}let G=F(o),ke=`<line x1="${G.toFixed(1)}" y1="${g.top.toFixed(1)}" x2="${G.toFixed(1)}" y2="${A.toFixed(1)}" stroke="${p}" stroke-width="1.5" stroke-dasharray="3 3"/><text x="${G.toFixed(1)}" y="${(g.top-3).toFixed(1)}" text-anchor="middle" class="kan-dist-mean">\u03BC ${o.toFixed(2)}</text>`,je=`<text x="${F(0).toFixed(1)}" y="${(A+15).toFixed(1)}" text-anchor="start" class="kan-dist-axis">0</text><text x="${F(1).toFixed(1)}" y="${(A+15).toFixed(1)}" text-anchor="end" class="kan-dist-axis">1</text>`,j=`<svg class="kan-dist-svg" viewBox="0 0 ${k} ${h}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img"><line x1="${g.left}" y1="${A.toFixed(1)}" x2="${(k-g.right).toFixed(1)}" y2="${A.toFixed(1)}" class="kan-dist-base"/><path d="${O}" fill="${p}" fill-opacity="0.12"/>`+I+`<polyline points="${le.join(" ")}" fill="none" stroke="${p}" stroke-width="2"/>`+ke+je+"</svg>",V=i!==void 0&&c!==void 0?` \xB7 95% CI [${i.toFixed(2)}\u2013${c.toFixed(2)}]`:"";return`<figure class="kan-dist">${j}<figcaption class="kan-dist-caption">Beta(${u(r)}, ${u(a)})${V}</figcaption></figure>`}renderPublisherPackages(e){let t=new Map,n=o=>this.parseVersion((o.namespace||"").split("@")[1]??"")??{major:0,minor:0,patch:0},s=(o,i)=>o.major>i.major||o.major===i.major&&(o.minor>i.minor||o.minor===i.minor&&o.patch>i.patch);for(let o of this.catalog){if(!(o instanceof ee)||C(o)!==e)continue;let i=(o.namespace||"").split("/")[1]?.split("@")[0]??"";if(!i||o.name!==i)continue;let c=t.get(i);(!c||s(n(o),n(c)))&&t.set(i,o)}let r=[...t.entries()].sort((o,i)=>o[0].localeCompare(i[0]));return r.length===0?"":`<section class="kan-pkg-grid">${r.map(([o,i])=>{let c=b(i,N)??o,l=b(i,be),p=l?Ne(l,160):"",u=this.svgUrlForSubject(i,e);return`<a class="kan-pkg-card" href="/${d(o)}"><img class="kan-pkg-card-svg" src="${d(u)}" alt="" loading="lazy"/><span class="kan-pkg-card-body"><span class="kan-pkg-card-title">${d(c)}</span>`+(p?`<span class="kan-pkg-card-comment">${d(p)}</span>`:"")+"</span></a>"}).join("")}</section>`}findPublisherRootView(e){for(let t of this.catalog){if(!(t instanceof ee)||C(t)!==e)continue;let n=Se(t);if(!n)continue;let s=$e(n);if(s&&S(s,xn))return t}}renderTimeline(e,t){let n=E(e,Z);if(!n)return"<!-- LookRenderer.Timeline: no look.source -->";let s=E(e,Ie),r=this.findInstancesOfClass(n);if(r.length===0)return"<!-- LookRenderer.Timeline: no instances -->";let a=p=>s?this.readPropertyValueText(p,s)??"":"",o=r.slice().sort((p,u)=>a(p).localeCompare(a(u))),i=E(e,Xe),c=b(e,_e);return i&&c?this.renderTrajectoryChart(o,i,c,e,t,a):`<section class="kan-timeline"><ol>
96
96
  ${o.map(p=>{let u=p.namespace||"",k=u.split("/")[1]?.split("@")[0]??"",h=u.split("@")[1]??"",g=h?this.parseVersion(h):void 0,m=he.formatResourceUrl({publisher:C(p),package_:k,name:p.name,...g?{version:g}:{}},"=",{contextPublisher:t}),v=a(p),K=v?`<span class="kan-timeline-date">${d(v)}</span>`:"",_=h||p.name;return`<li class="kan-timeline-node"><a href="${d(m)}"><span class="kan-timeline-key">${d(_)}</span>${K}</a></li>`}).join(`
97
97
  `)}
98
- </ol></section>`}renderTrajectoryChart(e,t,n,s,r,a){let o=s,i=b(o,Ie),c=b(o,Ze),l=b(o,Xe),p=b(o,Bn),u=sn(o,Vn),k=sn(o,Dn),h=e.length,g=this.collectTrackedSeries(e,t,n,{hueBy:i,lowerPath:c,upperPath:l});if(g.length===0)return"<!-- LookRenderer.Timeline: no tracked series -->";let m=[];for(let $ of g){for(let w of $.points)w!==null&&m.push(w);for(let w of $.lower??[])w!==null&&m.push(w);for(let w of $.upper??[])w!==null&&m.push(w)}if(m.length===0)return"<!-- LookRenderer.Timeline: no metric values -->";let v=Math.min(...m),K=Math.max(...m);K-v<1e-9&&(v-=.5,K+=.5);let _=(K-v)*.08,U=u!==void 0?u:v-_,T=k!==void 0?k:K+_;T-U<1e-9&&(T=U+1);let x=1e3,F=440,L={top:28,right:24,bottom:56,left:52},A=x-L.left-L.right,le=F-L.top-L.bottom,O=$=>h<=1?L.left+A/2:L.left+$/(h-1)*A,I=$=>L.top+(1-($-U)/(T-U))*le,G=($,w)=>$.hue!==void 0?$.hue:Math.round(w*360/g.length),ke=[];for(let $=0;$<5;$++){let w=U+$*(T-U)/4,W=I(w);ke.push(`<line x1="${L.left}" y1="${W.toFixed(1)}" x2="${(x-L.right).toFixed(1)}" y2="${W.toFixed(1)}" class="kan-fan-grid"/>`),ke.push(`<text x="${(L.left-8).toFixed(1)}" y="${(W+4).toFixed(1)}" class="kan-fan-axis" text-anchor="end">${w.toFixed(2)}</text>`)}let je=[];e.forEach(($,w)=>{let W=this.hrefForSubject($,r),z=($.namespace||"").split("@")[1]??"",D=O(w),Y=Ke(a($));je.push(`<a href="${d(W)}" class="kan-fan-xtick"><line x1="${D.toFixed(1)}" y1="${L.top}" x2="${D.toFixed(1)}" y2="${(F-L.bottom).toFixed(1)}" class="kan-fan-vline"/><text x="${D.toFixed(1)}" y="${(F-L.bottom+20).toFixed(1)}" class="kan-fan-xlabel" text-anchor="middle">${ie(z||$.name)}</text>`+(Y?`<text x="${D.toFixed(1)}" y="${(F-L.bottom+36).toFixed(1)}" class="kan-fan-xdate" text-anchor="middle">${ie(Y)}</text>`:"")+"</a>")});let j=[];g.forEach(($,w)=>{if(!$.lower||!$.upper)return;let W=G($,w),z=[],D=[];for(let q=0;q<h;q++){let ge=$.upper[q],ue=$.lower[q];ge==null||ue===null||ue===void 0||(z.push(`${O(q).toFixed(1)},${I(ge).toFixed(1)}`),D.unshift(`${O(q).toFixed(1)},${I(ue).toFixed(1)}`))}let Y=z.concat(D);Y.length<3||j.push(`<polygon class="kan-fan-band" points="${Y.join(" ")}" fill="hsl(${W},65%,60%)"/>`)});let M=[];g.forEach(($,w)=>{let z=`hsl(${G($,w)},65%,60%)`,D=[],Y=[];$.points.forEach((q,ge)=>{if(q===null)return;let ue=O(ge),se=I(q);D.push(`${ue.toFixed(1)},${se.toFixed(1)}`),Y.push(`<circle cx="${ue.toFixed(1)}" cy="${se.toFixed(1)}" r="3.5" fill="${z}"/>`)}),D.length!==0&&M.push(`<g class="kan-fan-series" data-series="${d($.key)}"><polyline points="${D.join(" ")}" fill="none" stroke="${z}" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/>`+Y.join("")+"</g>")});let S=`<svg class="kan-fan-svg" viewBox="0 0 ${x} ${F}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img">`+ke.join("")+je.join("")+j.join("")+M.join("")+"</svg>",y=p?`${d(p)}=`:"",X=g.map(($,w)=>{let W=G($,w),z=$.points.filter(se=>se!==null),D=z.length?z[0]:void 0,Y=z.length?z[z.length-1]:void 0,q="";if(Y!==void 0&&D!==void 0){let se=Y-D;if(Math.abs(se)>=.005){let rn=se>0?"up":"down",on=se>0?"\u25B2":"\u25BC";q=` <span class="kan-fan-delta ${rn}">${se>0?"+":""}${se.toFixed(2)} ${on}</span>`}else q=' <span class="kan-fan-delta flat">\u2014</span>'}let ge=Y!==void 0?`${y}${Y.toFixed(2)}`:"\u2014",ue=$.lastSubject&&this.isLinkable(C($.lastSubject),r)?`<a href="${d(this.hrefForSubject($.lastSubject,r))}">${d($.label)}</a>`:d($.label);return`<div class="kan-fan-legend-item" style="--kan-fan-hue:${W}"><span class="kan-fan-swatch"></span><span class="kan-fan-legend-label">${ue}</span><span class="kan-fan-legend-cur">${ge}${q}</span></div>`});return`<section class="kan-fan"><div class="kan-fan-chart">${S}</div><div class="kan-fan-legend">${X.join("")}</div></section>`}renderResourceGrid(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.ResourceGrid: no look.source -->";let r=H(this.catalog,s),a=r?fe(r).some(c=>{let l=c.subject.name;return l==="ObjectProperty"||l==="DatatypeProperty"||l==="Property"}):!1,o=[];if(a&&n){let c=this.readPropertyValueReferences(n,s);for(let l of c){let p=H(this.catalog,{publisher:l.subject.publisher,package_:l.subject.package_,name:l.subject.name,...l.subject.version?{version:l.subject.version}:{}});p&&o.push(p)}}else o=this.findInstancesOfClass(s);if(o.length===0)return`<!-- LookRenderer.ResourceGrid: no resources for ${s.publisher}/${s.package_}/${s.name} -->`;let i=[];for(let c of o){let l=b(c,N)??c.name,p=b(c,be),u=c.namespace||"",k=u.split("/")[1]?.split("@")[0]??"",h=u.split("@")[1]??"",g=h?this.parseVersion(h):void 0,m=he.formatResourceUrl({publisher:C(c),package_:k,name:c.name,...g?{version:g}:{}},"=",{contextPublisher:t}),v=p?`<p class="kan-resource-card-subtitle">${d(p)}</p>`:"",K=`<h3 class="kan-resource-card-title">${d(l)}</h3>${v}`;i.push(this.isLinkable(C(c),t)?`<a class="kan-resource-card" href="${d(m)}">${K}</a>`:`<span class="kan-resource-card">${K}</span>`)}return`<section class="kan-resource-grid">
98
+ </ol></section>`}renderTrajectoryChart(e,t,n,s,r,a){let o=s,i=b(o,Ee),c=b(o,Qe),l=b(o,en),p=b(o,Gn),u=rn(o,Bn),k=rn(o,Hn),h=e.length,g=this.collectTrackedSeries(e,t,n,{hueBy:i,lowerPath:c,upperPath:l});if(g.length===0)return"<!-- LookRenderer.Timeline: no tracked series -->";let m=[];for(let $ of g){for(let w of $.points)w!==null&&m.push(w);for(let w of $.lower??[])w!==null&&m.push(w);for(let w of $.upper??[])w!==null&&m.push(w)}if(m.length===0)return"<!-- LookRenderer.Timeline: no metric values -->";let v=Math.min(...m),K=Math.max(...m);K-v<1e-9&&(v-=.5,K+=.5);let _=(K-v)*.08,U=u!==void 0?u:v-_,T=k!==void 0?k:K+_;T-U<1e-9&&(T=U+1);let x=1e3,F=440,L={top:28,right:24,bottom:56,left:52},A=x-L.left-L.right,le=F-L.top-L.bottom,O=$=>h<=1?L.left+A/2:L.left+$/(h-1)*A,I=$=>L.top+(1-($-U)/(T-U))*le,G=($,w)=>$.hue!==void 0?$.hue:Math.round(w*360/g.length),ke=[];for(let $=0;$<5;$++){let w=U+$*(T-U)/4,W=I(w);ke.push(`<line x1="${L.left}" y1="${W.toFixed(1)}" x2="${(x-L.right).toFixed(1)}" y2="${W.toFixed(1)}" class="kan-fan-grid"/>`),ke.push(`<text x="${(L.left-8).toFixed(1)}" y="${(W+4).toFixed(1)}" class="kan-fan-axis" text-anchor="end">${w.toFixed(2)}</text>`)}let je=[];e.forEach(($,w)=>{let W=this.hrefForSubject($,r),z=($.namespace||"").split("@")[1]??"",D=O(w),Y=Ke(a($));je.push(`<a href="${d(W)}" class="kan-fan-xtick"><line x1="${D.toFixed(1)}" y1="${L.top}" x2="${D.toFixed(1)}" y2="${(F-L.bottom).toFixed(1)}" class="kan-fan-vline"/><text x="${D.toFixed(1)}" y="${(F-L.bottom+20).toFixed(1)}" class="kan-fan-xlabel" text-anchor="middle">${ie(z||$.name)}</text>`+(Y?`<text x="${D.toFixed(1)}" y="${(F-L.bottom+36).toFixed(1)}" class="kan-fan-xdate" text-anchor="middle">${ie(Y)}</text>`:"")+"</a>")});let j=[];g.forEach(($,w)=>{if(!$.lower||!$.upper)return;let W=G($,w),z=[],D=[];for(let q=0;q<h;q++){let ge=$.upper[q],ue=$.lower[q];ge==null||ue===null||ue===void 0||(z.push(`${O(q).toFixed(1)},${I(ge).toFixed(1)}`),D.unshift(`${O(q).toFixed(1)},${I(ue).toFixed(1)}`))}let Y=z.concat(D);Y.length<3||j.push(`<polygon class="kan-fan-band" points="${Y.join(" ")}" fill="hsl(${W},65%,60%)"/>`)});let V=[];g.forEach(($,w)=>{let z=`hsl(${G($,w)},65%,60%)`,D=[],Y=[];$.points.forEach((q,ge)=>{if(q===null)return;let ue=O(ge),se=I(q);D.push(`${ue.toFixed(1)},${se.toFixed(1)}`),Y.push(`<circle cx="${ue.toFixed(1)}" cy="${se.toFixed(1)}" r="3.5" fill="${z}"/>`)}),D.length!==0&&V.push(`<g class="kan-fan-series" data-series="${d($.key)}"><polyline points="${D.join(" ")}" fill="none" stroke="${z}" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/>`+Y.join("")+"</g>")});let R=`<svg class="kan-fan-svg" viewBox="0 0 ${x} ${F}" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" role="img">`+ke.join("")+je.join("")+j.join("")+V.join("")+"</svg>",y=p?`${d(p)}=`:"",X=g.map(($,w)=>{let W=G($,w),z=$.points.filter(se=>se!==null),D=z.length?z[0]:void 0,Y=z.length?z[z.length-1]:void 0,q="";if(Y!==void 0&&D!==void 0){let se=Y-D;if(Math.abs(se)>=.005){let cn=se>0?"up":"down",ln=se>0?"\u25B2":"\u25BC";q=` <span class="kan-fan-delta ${cn}">${se>0?"+":""}${se.toFixed(2)} ${ln}</span>`}else q=' <span class="kan-fan-delta flat">\u2014</span>'}let ge=Y!==void 0?`${y}${Y.toFixed(2)}`:"\u2014",ue=$.lastSubject&&this.isLinkable(C($.lastSubject),r)?`<a href="${d(this.hrefForSubject($.lastSubject,r))}">${d($.label)}</a>`:d($.label);return`<div class="kan-fan-legend-item" style="--kan-fan-hue:${W}"><span class="kan-fan-swatch"></span><span class="kan-fan-legend-label">${ue}</span><span class="kan-fan-legend-cur">${ge}${q}</span></div>`});return`<section class="kan-fan"><div class="kan-fan-chart">${R}</div><div class="kan-fan-legend">${X.join("")}</div></section>`}renderResourceGrid(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.ResourceGrid: no look.source -->";let r=H(this.catalog,s),a=r?fe(r).some(c=>{let l=c.subject.name;return l==="ObjectProperty"||l==="DatatypeProperty"||l==="Property"}):!1,o=[];if(a&&n){let c=this.readPropertyValueReferences(n,s);for(let l of c){let p=H(this.catalog,{publisher:l.subject.publisher,package_:l.subject.package_,name:l.subject.name,...l.subject.version?{version:l.subject.version}:{}});p&&o.push(p)}}else o=this.findInstancesOfClass(s);if(o.length===0)return`<!-- LookRenderer.ResourceGrid: no resources for ${s.publisher}/${s.package_}/${s.name} -->`;let i=[];for(let c of o){let l=b(c,N)??c.name,p=b(c,be),u=c.namespace||"",k=u.split("/")[1]?.split("@")[0]??"",h=u.split("@")[1]??"",g=h?this.parseVersion(h):void 0,m=he.formatResourceUrl({publisher:C(c),package_:k,name:c.name,...g?{version:g}:{}},"=",{contextPublisher:t}),v=p?`<p class="kan-resource-card-subtitle">${d(p)}</p>`:"",K=`<h3 class="kan-resource-card-title">${d(l)}</h3>${v}`;i.push(this.isLinkable(C(c),t)?`<a class="kan-resource-card" href="${d(m)}">${K}</a>`:`<span class="kan-resource-card">${K}</span>`)}return`<section class="kan-resource-grid">
99
99
  ${i.join(`
100
100
  `)}
101
101
  </section>`}parseVersion(e){let t=e.split(".").map(Number);if(!(t.length!==3||t.some(n=>Number.isNaN(n))))return{major:t[0],minor:t[1],patch:t[2]}}findInstancesOfClass(e){let t=[];for(let n of this.catalog){if(!(n instanceof ee))continue;fe(n).map(a=>a.subject).some(a=>a.publisher===e.publisher&&a.package_===e.package_&&a.name===e.name)&&t.push(n)}return t}renderBreadcrumb(e,t,n){let r=(e.namespace||"").split("/");if(r.length<2)return"";let a=r[0],o=r[1]??"",i=o.split("@")[0]??"",c=o.split("@")[1]??"";if(!a||!i)return"";if(n?.bareOverview)return`<nav class="kan-breadcrumb"><ol>
@@ -104,13 +104,13 @@ ${i.join(`
104
104
  </ol></nav>`;let l=e.name,u=!!H(this.catalog,{publisher:a,package_:i,name:i}),k=c?`${i}@${c}`:i,h=c?`/${i}/${c}/${i}`:`/${i}/${i}`,g=e.name===i,m=[];return m.push(`<li><a href="/">${d(a)}</a></li>`),g?m.push(`<li aria-current="page">${d(k)}</li>`):(m.push(u?`<li><a href="${d(h)}">${d(k)}</a></li>`:`<li>${d(k)}</li>`),m.push(`<li aria-current="page">${d(l)}</li>`)),`<nav class="kan-breadcrumb"><ol>
105
105
  ${m.join(`
106
106
  `)}
107
- </ol></nav>`}renderNavGroup(e,t){let n=this.findNavGroupForPublisher(t);if(!n)return"";let s=te(n,Te);if(!(s instanceof B))return"";let r=s.object??[];if(r.length===0)return"";let a=[];for(let o of r){if(!(o instanceof P))continue;let i=H(this.catalog,{publisher:o.subject.publisher,package_:o.subject.package_,name:o.subject.name}),{href:c,label:l}=this.resolveNavEntry(o,i,t),p=`/${e.namespace?.split("/")[1]?.split("@")[0]}/${(e.namespace||"").split("@")[1]}/${e.name}`,u=c===p?' aria-current="page"':"";a.push(`<li><a class="kan-nav-link" href="${d(c)}"${u}>${d(l)}</a></li>`)}return`<nav class="kan-site-nav"><ul>
107
+ </ol></nav>`}renderNavGroup(e,t){let n=this.findNavGroupForPublisher(t);if(!n)return"";let s=te(n,Pe);if(!(s instanceof B))return"";let r=s.object??[];if(r.length===0)return"";let a=[];for(let o of r){if(!(o instanceof P))continue;let i=H(this.catalog,{publisher:o.subject.publisher,package_:o.subject.package_,name:o.subject.name}),{href:c,label:l}=this.resolveNavEntry(o,i,t),p=`/${e.namespace?.split("/")[1]?.split("@")[0]}/${(e.namespace||"").split("@")[1]}/${e.name}`,u=c===p?' aria-current="page"':"";a.push(`<li><a class="kan-nav-link" href="${d(c)}"${u}>${d(l)}</a></li>`)}return`<nav class="kan-site-nav"><ul>
108
108
  ${a.join(`
109
109
  `)}
110
- </ul></nav>`}resolveNavEntry(e,t,n){if(t&&fe(t).map(i=>i.subject).some(i=>i.publisher===Ue.publisher&&i.package_===Ue.package_&&i.name===Ue.name)){let i=b(t,N),c=te(t,We);if(c instanceof V&&c.object instanceof P){let l=c.object,p=this.readLabelForUri({publisher:l.subject.publisher,package_:l.subject.package_,name:l.subject.name});return{href:this.urlForReference(l,We,n),label:i??p??l.subject.name}}}let s=he.formatResourceUrl({publisher:e.subject.publisher,package_:e.subject.package_,...e.subject.version?{version:e.subject.version}:{},name:e.subject.name},"*",{contextPublisher:n}),r=t?b(t,N)??e.subject.name:e.subject.name;return{href:s,label:r}}findNavGroupForPublisher(e){for(let t of this.catalog){if(!(t instanceof ee)||!(t.namespace||"").startsWith(`${e}/`))continue;if(fe(t).map(a=>a.subject).some(a=>a.publisher===ve.publisher&&a.package_===ve.package_&&a.name===ve.name))return t}}renderMarkdown(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.Markdown: no look.source -->";let r=te(t,s),a=new Map,o;if(r instanceof Me?o=this.resolveMarkdownLinks(r,n,a):r instanceof J?o=r.object:o=this.readPropertyValueText(t,s),!o)return"";let i=De(o);for(let[c,l]of a){let p=new RegExp('(<a href="'+ot(c)+'">)([^<]*)(</a>)',"g");i=i.replace(p,`$1<img class="kan-md-chip" src="${d(l)}" alt="" loading="lazy">$2$3`)}return`<section class="kan-markdown">
110
+ </ul></nav>`}resolveNavEntry(e,t,n){if(t&&fe(t).map(i=>i.subject).some(i=>i.publisher===Fe.publisher&&i.package_===Fe.package_&&i.name===Fe.name)){let i=b(t,N),c=te(t,Ye);if(c instanceof M&&c.object instanceof P){let l=c.object,p=this.readLabelForUri({publisher:l.subject.publisher,package_:l.subject.package_,name:l.subject.name});return{href:this.urlForReference(l,Ye,n),label:i??p??l.subject.name}}}let s=he.formatResourceUrl({publisher:e.subject.publisher,package_:e.subject.package_,...e.subject.version?{version:e.subject.version}:{},name:e.subject.name},"*",{contextPublisher:n}),r=t?b(t,N)??e.subject.name:e.subject.name;return{href:s,label:r}}findNavGroupForPublisher(e){for(let t of this.catalog){if(!(t instanceof ee)||!(t.namespace||"").startsWith(`${e}/`))continue;if(fe(t).map(a=>a.subject).some(a=>a.publisher===ve.publisher&&a.package_===ve.package_&&a.name===ve.name))return t}}renderMarkdown(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer.Markdown: no look.source -->";let r=te(t,s),a=new Map,o;if(r instanceof De?o=this.resolveMarkdownLinks(r,n,a):r instanceof J?o=r.object:o=this.readPropertyValueText(t,s),!o)return"";let i=He(o);for(let[c,l]of a){let p=new RegExp('(<a href="'+ct(c)+'">)([^<]*)(</a>)',"g");i=i.replace(p,`$1<img class="kan-md-chip" src="${d(l)}" alt="" loading="lazy">$2$3`)}return`<section class="kan-markdown">
111
111
  ${i}
112
- </section>`}resolveMarkdownLinks(e,t,n){let s=e.object,r=[...e.links].sort((a,o)=>o.startOffset-a.startOffset);for(let a of r){let o;if(a.target&&this.isLinkable(a.target.subject.publisher,t)){let i=a.target.subject,c=(a.displayText??this.readLabelForUri({publisher:i.publisher,package_:i.package_,name:i.name})??a.reference).replace(/[[\]]/g,""),l=he.formatResourceUrl({publisher:i.publisher,package_:i.package_,name:i.name,...i.version?{version:i.version}:{}},"=",{contextPublisher:t});n&&n.set(l,`${l}.svg`),o=`[${c}](${l})`}else if(a.target){let i=a.target.subject;o=(a.displayText??this.readLabelForUri({publisher:i.publisher,package_:i.package_,name:i.name})??a.reference).replace(/[[\]]/g,"")}else o=a.displayText??a.reference;s=s.slice(0,a.startOffset)+o+s.slice(a.endOffset)}return s}renderRawMarkdown(e){let t=this.findCascadedLook(e);if(!t)return;let n=tn(t.declaration),s=[];for(let r of n){let a=$e(r);if(!a||!R(a,Ge))continue;let o=E(r,Z);if(!o)continue;let i=this.readPropertyValueText(e,o);i&&s.push(i)}return s.length>0?s.join(`
112
+ </section>`}resolveMarkdownLinks(e,t,n){let s=e.object,r=[...e.links].sort((a,o)=>o.startOffset-a.startOffset);for(let a of r){let o;if(a.target&&this.isLinkable(a.target.subject.publisher,t)){let i=a.target.subject,c=(a.displayText??this.readLabelForUri({publisher:i.publisher,package_:i.package_,name:i.name})??a.reference).replace(/[[\]]/g,""),l=he.formatResourceUrl({publisher:i.publisher,package_:i.package_,name:i.name,...i.version?{version:i.version}:{}},"=",{contextPublisher:t});n&&n.set(l,`${l}.svg`),o=`[${c}](${l})`}else if(a.target){let i=a.target.subject;o=(a.displayText??this.readLabelForUri({publisher:i.publisher,package_:i.package_,name:i.name})??a.reference).replace(/[[\]]/g,"")}else o=a.displayText??a.reference;s=s.slice(0,a.startOffset)+o+s.slice(a.endOffset)}return s}renderRawMarkdown(e){let t=this.findCascadedLook(e);if(!t)return;let n=an(t.declaration),s=[];for(let r of n){let a=$e(r);if(!a||!S(a,ze))continue;let o=E(r,Z);if(!o)continue;let i=this.readPropertyValueText(e,o);i&&s.push(i)}return s.length>0?s.join(`
113
113
 
114
- `):void 0}renderHero(e,t,n){let s=te(e,et),r=s instanceof pe?s.object===!0:s instanceof J&&s.object==="true",a=[r?'<header class="kan-hero kan-hero-has-icon">':'<header class="kan-hero">'];if(r){let u=this.svgUrlForSubject(t,n);a.push(`<img class="kan-hero-icon" src="${d(u)}" alt="" loading="lazy"/>`)}r&&a.push('<div class="kan-hero-text">');let o=E(e,Jn);if(o){let u=this.readPropertyValueText(t,o);u&&a.push(`<span class="kan-hero-eyebrow">${d(Oe(u)??u)}</span>`)}let i=E(e,qn),c="";i&&(c=this.readPropertyValueText(t,i)??""),c||(c=t.name),a.push(`<h1 class="kan-hero-title">${d(Oe(c)??c)}</h1>`);let l=E(e,Zn);if(l){let u=this.readPropertyValueText(t,l);u&&a.push(`<p class="kan-hero-subtitle">${d(Oe(u)??u)}</p>`)}let p=E(e,nn);if(p){let u=this.readPropertyValueReferences(t,p);if(u.length>0){let k=u.map(h=>this.renderBadge(h,nn,n)).join("");a.push(`<div class="kan-hero-badges">${k}</div>`)}}return r&&a.push("</div>"),a.push("</header>"),a.join(`
114
+ `):void 0}renderHero(e,t,n){let s=te(e,tt),r=s instanceof pe?s.object===!0:s instanceof J&&s.object==="true",a=[r?'<header class="kan-hero kan-hero-has-icon">':'<header class="kan-hero">'];if(r){let u=this.svgUrlForSubject(t,n);a.push(`<img class="kan-hero-icon" src="${d(u)}" alt="" loading="lazy"/>`)}r&&a.push('<div class="kan-hero-text">');let o=E(e,Xn);if(o){let u=this.readPropertyValueText(t,o);u&&a.push(`<span class="kan-hero-eyebrow">${d(Oe(u)??u)}</span>`)}let i=E(e,Zn),c="";i&&(c=this.readPropertyValueText(t,i)??""),c||(c=t.name),a.push(`<h1 class="kan-hero-title">${d(Oe(c)??c)}</h1>`);let l=E(e,Qn);if(l){let u=this.readPropertyValueText(t,l);u&&a.push(`<p class="kan-hero-subtitle">${d(Oe(u)??u)}</p>`)}let p=E(e,sn);if(p){let u=this.readPropertyValueReferences(t,p);if(u.length>0){let k=u.map(h=>this.renderBadge(h,sn,n)).join("");a.push(`<div class="kan-hero-badges">${k}</div>`)}}return r&&a.push("</div>"),a.push("</header>"),a.join(`
115
115
  `)}renderPropertyList(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer: PropertyList missing look.source -->";let r=this.readLabelForUri(s)??s.name,a=te(t,s),o=this.gatherValueItems(a),i=o.length>0?o.map(c=>`<li>${this.renderInlineValue(c,Z,n)}</li>`).join(""):'<li class="kan-empty">(no values)</li>';return['<section class="kan-property-list">',`<h3 class="kan-property-list-title">${d(r)}</h3>`,`<ul class="kan-property-list-items">${i}</ul>`,"</section>"].join(`
116
- `)}renderBadgeRow(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer: BadgeRow missing look.source -->";let r=this.readPropertyValueReferences(t,s);return r.length===0?"":`<div class="kan-badge-row">${r.map(o=>this.renderBadge(o,Z,n)).join("")}</div>`}renderChipRow(e,t,n){let s=Ce(e,nt);if(s.length===0)return"<!-- LookRenderer: ChipRow has no look.chips -->";let r=[];for(let a of s){let o=te(t,a);if(!o)continue;let i=this.readLabelForUri(a)??a.name,c=this.renderStatementInlineValue(o,a,n);c&&r.push(`<span class="kan-chip"><span class="kan-chip-key">${d(i)}</span> <span class="kan-chip-val">${c}</span></span>`)}return r.length===0?"":`<div class="kan-chip-row">${r.join("")}</div>`}renderReferenceList(e,t,n){let s=Ce(e,Te);if(s.length===0)return"<!-- LookRenderer: ReferenceList has no look.entries -->";let r=b(e,qe),a=b(e,Mn),o=[];for(let i of s){let c=this.readPropertyValueReferences(t,i);if(c.length===0)continue;let l=this.readLabelForUri(i)??i.name;if(r){let p=c.map(u=>this.renderDetailRow(u,r,a,n)).filter(u=>u).join("");p&&o.push(`<dt>${d(l)}</dt><dd><ul class="kan-ref-rows">${p}</ul></dd>`)}else{let p=c.map(u=>this.renderReferenceLink(u,Te,n)).join(", ");o.push(`<dt>${d(l)}</dt><dd>${p}</dd>`)}}return o.length===0?"":`<dl class="kan-reference-list">${o.join("")}</dl>`}renderDetailRow(e,t,n,s){let r=H(this.catalog,{publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name,...e.subject.version?{version:e.subject.version}:{}});if(!r)return"";let a=this.resolvePath(r,t)??b(r,N)??r.name,o="";if(n){let p=this.resolvePath(r,n);p&&(o=`<span class="kan-ref-badge">${d(p)}</span>`)}let i=`<span class="kan-ref-text">${d(a)}</span>${o}`;if(!this.isLinkable(C(r),s))return`<li class="kan-ref-row"><span class="kan-ref-rowlink">${i}</span></li>`;let c=this.hrefForSubject(r,s),l=this.svgUrlForSubject(r,s);return`<li class="kan-ref-row"><a class="kan-ref-rowlink" href="${d(c)}"><img class="kan-ref-icon" src="${d(l)}" alt="" loading="lazy"/>`+i+"</a></li>"}readPropertyValueText(e,t){let n=te(e,t);if(n){if(n instanceof J)return n.object;if(n instanceof V){let s=n.object;return this.readLabelForUri({publisher:s.subject.publisher,package_:s.subject.package_,name:s.subject.name})??s.subject.name}if(n instanceof ne)return this.readEmbeddedText(n.object,0)||void 0;if(n instanceof B)return(n.object??[]).map(r=>r instanceof P?this.readLabelForUri({publisher:r.subject.publisher,package_:r.subject.package_,name:r.subject.name})??r.subject.name:r instanceof ae?this.readEmbeddedText(r,0):String(r)).filter(r=>r).join(", ")}}readEmbeddedText(e,t){if(t>=en)return"\u2026";let n=[];for(let s of e.statement)if(s.predicate?.subject?.name!=="type")if(s instanceof J)n.push(s.object);else if(s instanceof de||s instanceof pe)n.push(String(s.object));else if(s instanceof V){let a=s.object;n.push(this.readLabelForUri({publisher:a.subject.publisher,package_:a.subject.package_,name:a.subject.name})??a.subject.name)}else s instanceof ne&&n.push(this.readEmbeddedText(s.object,t+1));return n.filter(s=>s).join(", ")}readPropertyValueReferences(e,t){let n=te(e,t);if(!n)return[];if(n instanceof V)return[n.object];if(n instanceof B){let s=[];for(let r of n.object??[])r instanceof P&&s.push(r);return s}return[]}gatherValueItems(e){return e?e instanceof B?e.object??[]:e instanceof V?[e.object]:e instanceof ne?[e.object]:e instanceof J?[e.object]:e instanceof de||e instanceof pe?[e.object]:[]:[]}renderInlineValue(e,t,n,s=0){return e instanceof P?this.renderReferenceLink(e,t,n):e instanceof ae?this.renderEmbeddedInline(e,n,s):typeof e=="string"?d(e):typeof e=="number"||typeof e=="boolean"?d(String(e)):""}renderStatementInlineValue(e,t,n,s=0){return e instanceof J?d(e.object):e instanceof de||e instanceof pe?d(String(e.object)):e instanceof V?this.renderReferenceLink(e.object,t,n):e instanceof ne?this.renderEmbeddedInline(e.object,n,s):e instanceof B?(e.object??[]).map(a=>this.renderInlineValue(a,t,n,s)).filter(a=>a).join(", "):""}renderEmbeddedInline(e,t,n=0){if(n>=en)return"\u2026";let s=[];for(let r of e.statement){let a=r.predicate?.subject;if(!a||a.name==="type")continue;let o=this.readLabelForUri({publisher:a.publisher,package_:a.package_,name:a.name})??a.name,i=this.renderStatementInlineValue(r,a,t,n+1);i&&s.push(`<dt>${d(o)}</dt><dd>${i}</dd>`)}return s.length?`<dl class="kan-embedded">${s.join("")}</dl>`:""}renderReferenceLink(e,t,n){let s=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name;if(!this.isLinkable(e.subject.publisher,n))return`<span class="kan-link-plain">${d(s)}</span>`;let r=this.urlForReference(e,t,n);return`<a class="kan-link" href="${d(r)}">${d(s)}</a>`}isLinkable(e,t){return e===t}renderBadge(e,t,n){let s=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name,r=this.readCommentForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name}),a=r?` title="${d(r)}"`:"";if(!this.isLinkable(e.subject.publisher,n))return`<span class="kan-badge"${a}>${d(s)}</span>`;let o=this.urlForReference(e,t,n);return`<a class="kan-badge" href="${d(o)}"${a}>${d(s)}</a>`}urlForReference(e,t,n){let s=t?this.getUrlFormForProperty(t):"=";return he.formatResourceUrl({publisher:e.subject.publisher,package_:e.subject.package_,...e.subject.version?{version:e.subject.version}:{},name:e.subject.name},s,{contextPublisher:n})}getUrlFormForProperty(e){let t=H(this.catalog,e);if(!t)return"=";let n=b(t,tt);return n==="*"||n==="^"||n==="~"||n==="="?n:"="}readLabelForUri(e){let t=H(this.catalog,e);if(t)return b(t,N)}readCommentForUri(e){let t=H(this.catalog,e);if(t)return b(t,be)}};function Pe(f){let e=new Map;for(let t of f.statement){if(!(t instanceof ne)||!ce(t,xe.publisher,xe.package_,xe.name))continue;let n=t.object;for(let s of n.statement){if(!(s instanceof J))continue;let r=s.predicate?.subject?.name;if(!r)continue;let a=s.object;e.has(r)||e.set(r,a)}}return e}function Re(f){for(let e of f.statement)if(e instanceof ne&&ce(e,ye.publisher,ye.package_,ye.name))return e.object}function tn(f){for(let e of f.statement){if(!(e instanceof B)||!ce(e,Ee.publisher,Ee.package_,Ee.name))continue;let t=[];for(let n of e.object??[])n instanceof ae&&t.push(n);return t}return[]}function $e(f){for(let e of f.statement)if(e instanceof V&&e.predicate?.subject?.name==="type"&&e.object instanceof P){let t=e.object.subject;return{publisher:t.publisher,package_:t.package_,name:t.name}}}function E(f,e){for(let t of f.statement)if(t instanceof V&&ce(t,e.publisher,e.package_,e.name)&&t.object instanceof P){let n=t.object.subject;return{publisher:n.publisher,package_:n.package_,name:n.name}}}function Ce(f,e){for(let t of f.statement){if(!(t instanceof B)||!ce(t,e.publisher,e.package_,e.name))continue;let n=[];for(let s of t.object??[])s instanceof P&&n.push({publisher:s.subject.publisher,package_:s.subject.package_,name:s.subject.name});return n}return[]}function te(f,e){for(let t of f.statement)if(ce(t,e.publisher,e.package_,e.name))return t}function b(f,e){for(let t of f.statement)if(t instanceof J&&ce(t,e.publisher,e.package_,e.name))return t.object}function sn(f,e){for(let t of f.statement)if(t instanceof de&&ce(t,e.publisher,e.package_,e.name))return t.object}function fe(f){let e=[];for(let t of f.statement)if(t instanceof V){if(t.predicate?.subject?.name!=="type")continue;t.object instanceof P&&e.push(t.object)}else if(t instanceof B){if(t.predicate?.subject?.name!=="type")continue;for(let n of t.object??[])n instanceof P&&e.push(n)}return e}function Se(f){let e=[];for(let t of f.statement)if(t instanceof V){if(t.predicate?.subject?.name!=="subClassOf")continue;t.object instanceof P&&e.push(t.object)}else if(t instanceof B){if(t.predicate?.subject?.name!=="subClassOf")continue;for(let n of t.object??[])n instanceof P&&e.push(n)}return e}function oe(f,e){let t=[];for(let n of f){if(!(n instanceof ee)||n.name!==e.name)continue;(n.namespace||"").startsWith(`${e.publisher}/${e.package_}@`)&&t.push(n)}return t}function H(f,e){let t="version"in e?e.version:void 0;if(t){let n=`${e.publisher}/${e.package_}@${t.major}.${t.minor}.${t.patch}`;for(let s of f)if(s instanceof ee&&s.name===e.name&&s.namespace===n)return s}for(let n of f){if(!(n instanceof ee)||n.name!==e.name)continue;if((n.namespace||"").startsWith(`${e.publisher}/${e.package_}@`))return n}}function ce(f,e,t,n){let s=f.predicate?.subject;return s?s.publisher===e&&s.package_===t&&s.name===n:!1}function R(f,e){return f.publisher===e.publisher&&f.package_===e.package_&&f.name===e.name}function Q(f){return`${f.publisher}/${f.package_}/${f.name}`}function st(f){return f.name==="Package"?{...Le}:f}function C(f){let e=f.namespace||"",t=e.indexOf("/");return t>=0?e.substring(0,t):e}function d(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function at(f){let e=f.lastIndexOf(".");return e>=0?f.substring(e+1):f}function rt(f,e){for(let t of f.statement)if(t.predicate?.subject?.name===e)return t}function ie(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ae(f,e){return f.length<=e?f:f.slice(0,e).replace(/\s+\S*$/,"")+"\u2026"}function an(f){return f.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ot(f){return f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function it(f){let e=Oe(f);if(e)return d(e);if(/^https?:\/\//i.test(f)){let t=f;try{t=new URL(f).hostname.replace(/^www\./,"")}catch{}return`<a class="kan-link" href="${d(f)}" target="_blank" rel="noopener">${d(t)} \u2197</a>`}return d(f)}function Oe(f){let e=/^(\d{4})-(\d{2})-(\d{2})([T ]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/.exec(f.trim());if(!e)return;let t=Date.parse(f);if(!Number.isFinite(t))return;let n=new Date(t),r=`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`;if(!e[4])return r;let a=n.getUTCHours(),o=(a+11)%12+1,i=a>=12?"PM":"AM";return`${r} \xB7 ${o}:${String(n.getUTCMinutes()).padStart(2,"0")} ${i} UTC`}function Ke(f){if(!f)return"";let e=/^(\d{4})-(\d{2})-(\d{2})/.exec(f);return e?`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][parseInt(e[2],10)-1]??e[2]} ${parseInt(e[3],10)}`:f}export{De as a,Ne as b};
116
+ `)}renderBadgeRow(e,t,n){let s=E(e,Z);if(!s)return"<!-- LookRenderer: BadgeRow missing look.source -->";let r=this.readPropertyValueReferences(t,s);return r.length===0?"":`<div class="kan-badge-row">${r.map(o=>this.renderBadge(o,Z,n)).join("")}</div>`}renderChipRow(e,t,n){let s=Ae(e,st);if(s.length===0)return"<!-- LookRenderer: ChipRow has no look.chips -->";let r=[];for(let a of s){let o=te(t,a);if(!o)continue;let i=this.readLabelForUri(a)??a.name,c=this.renderStatementInlineValue(o,a,n);c&&r.push(`<span class="kan-chip"><span class="kan-chip-key">${d(i)}</span> <span class="kan-chip-val">${c}</span></span>`)}return r.length===0?"":`<div class="kan-chip-row">${r.join("")}</div>`}renderReferenceList(e,t,n){let s=Ae(e,Pe);if(s.length===0)return"<!-- LookRenderer: ReferenceList has no look.entries -->";let r=b(e,Ze),a=b(e,Dn),o=[];for(let i of s){let c=this.readPropertyValueReferences(t,i);if(c.length===0)continue;let l=this.readLabelForUri(i)??i.name;if(r){let p=c.map(u=>this.renderDetailRow(u,r,a,n)).filter(u=>u).join("");p&&o.push(`<dt>${d(l)}</dt><dd><ul class="kan-ref-rows">${p}</ul></dd>`)}else{let p=c.map(u=>this.renderReferenceLink(u,Pe,n)).join(", ");o.push(`<dt>${d(l)}</dt><dd>${p}</dd>`)}}return o.length===0?"":`<dl class="kan-reference-list">${o.join("")}</dl>`}renderDetailRow(e,t,n,s){let r=H(this.catalog,{publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name,...e.subject.version?{version:e.subject.version}:{}});if(!r)return"";let a=this.resolvePath(r,t)??b(r,N)??r.name,o="";if(n){let p=this.resolvePath(r,n);p&&(o=`<span class="kan-ref-badge">${d(p)}</span>`)}let i=`<span class="kan-ref-text">${d(a)}</span>${o}`;if(!this.isLinkable(C(r),s))return`<li class="kan-ref-row"><span class="kan-ref-rowlink">${i}</span></li>`;let c=this.hrefForSubject(r,s),l=this.svgUrlForSubject(r,s);return`<li class="kan-ref-row"><a class="kan-ref-rowlink" href="${d(c)}"><img class="kan-ref-icon" src="${d(l)}" alt="" loading="lazy"/>`+i+"</a></li>"}readPropertyValueText(e,t){let n=te(e,t);if(n){if(n instanceof J)return n.object;if(n instanceof M){let s=n.object;return this.readLabelForUri({publisher:s.subject.publisher,package_:s.subject.package_,name:s.subject.name})??s.subject.name}if(n instanceof ne)return this.readEmbeddedText(n.object,0)||void 0;if(n instanceof B)return(n.object??[]).map(r=>r instanceof P?this.readLabelForUri({publisher:r.subject.publisher,package_:r.subject.package_,name:r.subject.name})??r.subject.name:r instanceof ae?this.readEmbeddedText(r,0):String(r)).filter(r=>r).join(", ")}}readEmbeddedText(e,t){if(t>=tn)return"\u2026";let n=[];for(let s of e.statement)if(s.predicate?.subject?.name!=="type")if(s instanceof J)n.push(s.object);else if(s instanceof de||s instanceof pe)n.push(String(s.object));else if(s instanceof M){let a=s.object;n.push(this.readLabelForUri({publisher:a.subject.publisher,package_:a.subject.package_,name:a.subject.name})??a.subject.name)}else s instanceof ne&&n.push(this.readEmbeddedText(s.object,t+1));return n.filter(s=>s).join(", ")}readPropertyValueReferences(e,t){let n=te(e,t);if(!n)return[];if(n instanceof M)return[n.object];if(n instanceof B){let s=[];for(let r of n.object??[])r instanceof P&&s.push(r);return s}return[]}gatherValueItems(e){return e?e instanceof B?e.object??[]:e instanceof M?[e.object]:e instanceof ne?[e.object]:e instanceof J?[e.object]:e instanceof de||e instanceof pe?[e.object]:[]:[]}renderInlineValue(e,t,n,s=0){return e instanceof P?this.renderReferenceLink(e,t,n):e instanceof ae?this.renderEmbeddedInline(e,n,s):typeof e=="string"?d(e):typeof e=="number"||typeof e=="boolean"?d(String(e)):""}renderStatementInlineValue(e,t,n,s=0){return e instanceof J?d(e.object):e instanceof de||e instanceof pe?d(String(e.object)):e instanceof M?this.renderReferenceLink(e.object,t,n):e instanceof ne?this.renderEmbeddedInline(e.object,n,s):e instanceof B?(e.object??[]).map(a=>this.renderInlineValue(a,t,n,s)).filter(a=>a).join(", "):""}renderEmbeddedInline(e,t,n=0){if(n>=tn)return"\u2026";let s=[];for(let r of e.statement){let a=r.predicate?.subject;if(!a||a.name==="type")continue;let o=this.readLabelForUri({publisher:a.publisher,package_:a.package_,name:a.name})??a.name,i=this.renderStatementInlineValue(r,a,t,n+1);i&&s.push(`<dt>${d(o)}</dt><dd>${i}</dd>`)}return s.length?`<dl class="kan-embedded">${s.join("")}</dl>`:""}renderReferenceLink(e,t,n){let s=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name;if(!this.isLinkable(e.subject.publisher,n))return`<span class="kan-link-plain">${d(s)}</span>`;let r=this.urlForReference(e,t,n);return`<a class="kan-link" href="${d(r)}">${d(s)}</a>`}isLinkable(e,t){return e===t}renderBadge(e,t,n){let s=this.readLabelForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name})??e.subject.name,r=this.readCommentForUri({publisher:e.subject.publisher,package_:e.subject.package_,name:e.subject.name}),a=r?` title="${d(r)}"`:"";if(!this.isLinkable(e.subject.publisher,n))return`<span class="kan-badge"${a}>${d(s)}</span>`;let o=this.urlForReference(e,t,n);return`<a class="kan-badge" href="${d(o)}"${a}>${d(s)}</a>`}urlForReference(e,t,n){let s=t?this.getUrlFormForProperty(t):"=";return he.formatResourceUrl({publisher:e.subject.publisher,package_:e.subject.package_,...e.subject.version?{version:e.subject.version}:{},name:e.subject.name},s,{contextPublisher:n})}getUrlFormForProperty(e){let t=H(this.catalog,e);if(!t)return"=";let n=b(t,at);return n==="*"||n==="^"||n==="~"||n==="="?n:"="}readLabelForUri(e){let t=H(this.catalog,e);if(t)return b(t,N)}readCommentForUri(e){let t=H(this.catalog,e);if(t)return b(t,be)}};function Ce(f){let e=new Map;for(let t of f.statement){if(!(t instanceof ne)||!ce(t,xe.publisher,xe.package_,xe.name))continue;let n=t.object;for(let s of n.statement){if(!(s instanceof J))continue;let r=s.predicate?.subject?.name;if(!r)continue;let a=s.object;e.has(r)||e.set(r,a)}}return e}function Se(f){for(let e of f.statement)if(e instanceof ne&&ce(e,ye.publisher,ye.package_,ye.name))return e.object}function an(f){for(let e of f.statement){if(!(e instanceof B)||!ce(e,Te.publisher,Te.package_,Te.name))continue;let t=[];for(let n of e.object??[])n instanceof ae&&t.push(n);return t}return[]}function $e(f){for(let e of f.statement)if(e instanceof M&&e.predicate?.subject?.name==="type"&&e.object instanceof P){let t=e.object.subject;return{publisher:t.publisher,package_:t.package_,name:t.name}}}function E(f,e){for(let t of f.statement)if(t instanceof M&&ce(t,e.publisher,e.package_,e.name)&&t.object instanceof P){let n=t.object.subject;return{publisher:n.publisher,package_:n.package_,name:n.name}}}function Ae(f,e){for(let t of f.statement){if(!(t instanceof B)||!ce(t,e.publisher,e.package_,e.name))continue;let n=[];for(let s of t.object??[])s instanceof P&&n.push({publisher:s.subject.publisher,package_:s.subject.package_,name:s.subject.name});return n}return[]}function te(f,e){for(let t of f.statement)if(ce(t,e.publisher,e.package_,e.name))return t}function b(f,e){for(let t of f.statement)if(t instanceof J&&ce(t,e.publisher,e.package_,e.name))return t.object}function rn(f,e){for(let t of f.statement)if(t instanceof de&&ce(t,e.publisher,e.package_,e.name))return t.object}function fe(f){let e=[];for(let t of f.statement)if(t instanceof M){if(t.predicate?.subject?.name!=="type")continue;t.object instanceof P&&e.push(t.object)}else if(t instanceof B){if(t.predicate?.subject?.name!=="type")continue;for(let n of t.object??[])n instanceof P&&e.push(n)}return e}function Re(f){let e=[];for(let t of f.statement)if(t instanceof M){if(t.predicate?.subject?.name!=="subClassOf")continue;t.object instanceof P&&e.push(t.object)}else if(t instanceof B){if(t.predicate?.subject?.name!=="subClassOf")continue;for(let n of t.object??[])n instanceof P&&e.push(n)}return e}function oe(f,e){let t=[];for(let n of f){if(!(n instanceof ee)||n.name!==e.name)continue;(n.namespace||"").startsWith(`${e.publisher}/${e.package_}@`)&&t.push(n)}return t}function H(f,e){let t="version"in e?e.version:void 0;if(t){let n=`${e.publisher}/${e.package_}@${t.major}.${t.minor}.${t.patch}`;for(let s of f)if(s instanceof ee&&s.name===e.name&&s.namespace===n)return s}for(let n of f){if(!(n instanceof ee)||n.name!==e.name)continue;if((n.namespace||"").startsWith(`${e.publisher}/${e.package_}@`))return n}}function ce(f,e,t,n){let s=f.predicate?.subject;return s?s.publisher===e&&s.package_===t&&s.name===n:!1}function S(f,e){return f.publisher===e.publisher&&f.package_===e.package_&&f.name===e.name}function Q(f){return`${f.publisher}/${f.package_}/${f.name}`}function rt(f){return f.name==="Package"?{...Le}:f}function C(f){let e=f.namespace||"",t=e.indexOf("/");return t>=0?e.substring(0,t):e}function d(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ot(f){let e=f.lastIndexOf(".");return e>=0?f.substring(e+1):f}function it(f,e){for(let t of f.statement)if(t.predicate?.subject?.name===e)return t}function ie(f){return f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Ne(f,e){return f.length<=e?f:f.slice(0,e).replace(/\s+\S*$/,"")+"\u2026"}function on(f){return f.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function ct(f){return f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lt(f){let e=Oe(f);if(e)return d(e);if(/^https?:\/\//i.test(f)){let t=f;try{t=new URL(f).hostname.replace(/^www\./,"")}catch{}return`<a class="kan-link" href="${d(f)}" target="_blank" rel="noopener">${d(t)} \u2197</a>`}return d(f)}function Oe(f){let e=/^(\d{4})-(\d{2})-(\d{2})([T ]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)?$/.exec(f.trim());if(!e)return;let t=Date.parse(f);if(!Number.isFinite(t))return;let n=new Date(t),r=`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][n.getUTCMonth()]} ${n.getUTCDate()}, ${n.getUTCFullYear()}`;if(!e[4])return r;let a=n.getUTCHours(),o=(a+11)%12+1,i=a>=12?"PM":"AM";return`${r} \xB7 ${o}:${String(n.getUTCMinutes()).padStart(2,"0")} ${i} UTC`}function Ke(f){if(!f)return"";let e=/^(\d{4})-(\d{2})-(\d{2})/.exec(f);return e?`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][parseInt(e[2],10)-1]??e[2]} ${parseInt(e[3],10)}`:f}export{He as a,Ve as b};
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as et,b as tt,c as rt,d as nt,e as ot,f as at,g as it,h as st,i as ct,j as lt}from"./chunk-IOJMTW4T.js";import{b as Xt}from"./chunk-VBTBY53W.js";import{a as Xe,b as Ze,c as Qe,d as b,e as S,f as i}from"./chunk-RCI34BYO.js";import{a as Yt}from"./chunk-JGVDV6PM.js";import{a as Te,b as je,c as Le,d as Fe,e as Ne}from"./chunk-5AH6GIPO.js";import{a as Be,b as De,c as Oe,d as Ae}from"./chunk-VHUJSHH7.js";import{a as ut,b as pt,c as mt,d as ft}from"./chunk-NIJV5UYW.js";import{a as Ye,b as yt,c as gt,d as ht,e as bt}from"./chunk-4TJZIM7A.js";import{a as kt}from"./chunk-NIGFQYVA.js";import{A as Gt,B as Wt,C as Jt,D as qt,a as St,b as Ct,c as Pt,d as Rt,e as wt,f as xt,g as $t,h as vt,i as Et,j as Kt,k as Bt,l as It,m as Tt,n as jt,o as Lt,p as Ft,q as Nt,r as Dt,s as Ot,t as At,u as Ut,v as Mt,w as Vt,x as Ht,y as _t,z as zt}from"./chunk-SKTXJV4T.js";import"./chunk-FJ35VIV6.js";import{a as F,b as D,c as _e,d as We,e as Je,f as qe}from"./chunk-FMYLEPMC.js";import{a as Ue,b as j,c as L,d as N,e as Ve,f as He,g as O,h as A,i as U,j as M,k as V,l as H}from"./chunk-W6T7MOKY.js";import{a as Ie}from"./chunk-7CUTGGH3.js";import{a as Pe,b as Re,c as we,d as xe,e as $e,f as ve,g as Ee,h as Ke}from"./chunk-FQHALFRR.js";import{b as ze,c as Ge}from"./chunk-HEMBMX7T.js";import{a as Me}from"./chunk-FUUTGGJS.js";import{a as dt}from"./chunk-ODIECDN7.js";import{VersionOperator as io}from"@kanonak-protocol/types/document/models/enums";import{existsSync as yr,readFileSync as gr}from"fs";import{homedir as hr}from"os";import{join as kr}from"path";import{execFile as Zt}from"child_process";import{promisify as Qt}from"util";var C=Qt(Zt),P="kanonak",R="/usr/bin/security",p=class{async get(e){let r=i(e);try{let{stdout:n}=await C(R,["find-generic-password","-s",P,"-a",r,"-w"],{timeout:1e4});try{return JSON.parse(n.trim())}catch{throw new Error(`Stored credential for '${r}' is corrupted (not valid JSON).
1
+ import{a as et,b as tt,c as rt,d as nt,e as ot,f as at,g as it,h as st,i as ct,j as lt}from"./chunk-IOJMTW4T.js";import{b as Xt}from"./chunk-KPLFNUIL.js";import{a as Xe,b as Ze,c as Qe,d as b,e as S,f as i}from"./chunk-RCI34BYO.js";import{a as Yt}from"./chunk-JGVDV6PM.js";import{a as Te,b as je,c as Le,d as Fe,e as Ne}from"./chunk-5AH6GIPO.js";import{a as Be,b as De,c as Oe,d as Ae}from"./chunk-VHUJSHH7.js";import{a as ut,b as pt,c as mt,d as ft}from"./chunk-NIJV5UYW.js";import{a as Ye,b as yt,c as gt,d as ht,e as bt}from"./chunk-4TJZIM7A.js";import{a as kt}from"./chunk-NIGFQYVA.js";import{A as Gt,B as Wt,C as Jt,D as qt,a as St,b as Ct,c as Pt,d as Rt,e as wt,f as xt,g as $t,h as vt,i as Et,j as Kt,k as Bt,l as It,m as Tt,n as jt,o as Lt,p as Ft,q as Nt,r as Dt,s as Ot,t as At,u as Ut,v as Mt,w as Vt,x as Ht,y as _t,z as zt}from"./chunk-SKTXJV4T.js";import"./chunk-FJ35VIV6.js";import{a as F,b as D,c as _e,d as We,e as Je,f as qe}from"./chunk-FMYLEPMC.js";import{a as Ue,b as j,c as L,d as N,e as Ve,f as He,g as O,h as A,i as U,j as M,k as V,l as H}from"./chunk-W6T7MOKY.js";import{a as Ie}from"./chunk-7CUTGGH3.js";import{a as Pe,b as Re,c as we,d as xe,e as $e,f as ve,g as Ee,h as Ke}from"./chunk-FQHALFRR.js";import{b as ze,c as Ge}from"./chunk-HEMBMX7T.js";import{a as Me}from"./chunk-FUUTGGJS.js";import{a as dt}from"./chunk-ODIECDN7.js";import{VersionOperator as io}from"@kanonak-protocol/types/document/models/enums";import{existsSync as yr,readFileSync as gr}from"fs";import{homedir as hr}from"os";import{join as kr}from"path";import{execFile as Zt}from"child_process";import{promisify as Qt}from"util";var C=Qt(Zt),P="kanonak",R="/usr/bin/security",p=class{async get(e){let r=i(e);try{let{stdout:n}=await C(R,["find-generic-password","-s",P,"-a",r,"-w"],{timeout:1e4});try{return JSON.parse(n.trim())}catch{throw new Error(`Stored credential for '${r}' is corrupted (not valid JSON).
2
2
  Run 'kanonak logout ${r}' then 'kanonak login ${r}' to fix.`)}}catch(n){if(X(n,44))return null;throw new Error(`macOS Keychain read failed for '${r}': ${w(n)}
3
3
  The Keychain may be locked or inaccessible.
4
4
  Try unlocking it via Keychain Access.app or running 'security unlock-keychain'.`)}}async store(e,r){let n=i(e),o=JSON.stringify(r);try{await C(R,["add-generic-password","-s",P,"-a",n,"-U","-w",o],{timeout:1e4})}catch(a){throw new Error(`macOS Keychain write failed for '${n}': ${w(a)}
@@ -1,4 +1,4 @@
1
- import{b as E,c as F,d as f,f as M}from"../chunk-2JQMUZWN.js";import{a as X,b as ye}from"../chunk-VBTBY53W.js";import{a as Ne}from"../chunk-JGVDV6PM.js";import"../chunk-NIJV5UYW.js";import"../chunk-NIGFQYVA.js";import{a as Oe}from"../chunk-FJ35VIV6.js";import{a as C,c as Ce,f as Ue}from"../chunk-FMYLEPMC.js";import{b as K,c as w,d as b,g as L,h as U,i as O,j,k as T,l as S}from"../chunk-W6T7MOKY.js";import{a as Re}from"../chunk-7CUTGGH3.js";import{e as Le}from"../chunk-FQHALFRR.js";import"../chunk-HEMBMX7T.js";import"../chunk-FUUTGGJS.js";var yt="kanonak.org",kt="document-ast",m=t=>({publisher:yt,package_:kt,name:t}),k={Document:m("Document"),Block:m("Block"),Inline:m("Inline"),StructuredValue:m("StructuredValue"),Heading:m("Heading"),Paragraph:m("Paragraph"),RawBlock:m("RawBlock"),Text:m("Text"),StructuredMap:m("StructuredMap"),StructuredEntry:m("StructuredEntry"),StructuredList:m("StructuredList"),StringScalar:m("StringScalar"),IntegerScalar:m("IntegerScalar"),EscapeHint:m("EscapeHint"),MediaType:m("MediaType"),metadata:m("metadata"),children:m("children"),level:m("level"),inlines:m("inlines"),text:m("text"),entries:m("entries"),key:m("key"),value:m("value"),escapeHint:m("escapeHint"),items:m("items"),stringValue:m("stringValue"),integerValue:m("integerValue"),rawContent:m("rawContent"),mediaType:m("mediaType"),mimeType:m("mimeType"),ESC_RAW:m("esc-raw"),ESC_YAML_SAFE:m("esc-yaml-safe"),ESC_TOML_STRING:m("esc-toml-string"),ESC_TOML_MULTILINE:m("esc-toml-multiline"),ESC_JSON:m("esc-json"),ESC_DYNAMODB_BOOL:m("esc-dynamodb-bool"),ESC_DYNAMODB_NUMBER:m("esc-dynamodb-number"),ESC_DYNAMODB_NULL:m("esc-dynamodb-null"),TEXT_PLAIN:m("text-plain"),TEXT_MARKDOWN:m("text-markdown"),TEXT_HTML:m("text-html"),TEXT_CSS:m("text-css"),APPLICATION_JSON:m("application-json"),TEXT_YAML:m("text-yaml"),IMAGE_SVG_XML:m("image-svg-xml"),ResourceLink:m("ResourceLink"),target:m("target"),linkLabel:m("linkLabel"),PropertyList:m("PropertyList"),propertyEntries:m("propertyEntries"),PropertyEntry:m("PropertyEntry"),propertyKey:m("propertyKey"),propertyValue:m("propertyValue"),Table:m("Table"),tableColumnLabels:m("tableColumnLabels"),tableRows:m("tableRows"),TableRow:m("TableRow"),tableCells:m("tableCells")};function Ie(t,e){return t.publisher===e.publisher&&t.package_===e.package_&&t.name===e.name}var Y=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(e,n){let r=ht(e.metadata,n),a=St(e.children),u=["---",...r,"---","",a].join(`
1
+ import{b as E,c as F,d as f,f as M}from"../chunk-2JQMUZWN.js";import{a as X,b as ye}from"../chunk-KPLFNUIL.js";import{a as Ne}from"../chunk-JGVDV6PM.js";import"../chunk-NIJV5UYW.js";import"../chunk-NIGFQYVA.js";import{a as Oe}from"../chunk-FJ35VIV6.js";import{a as C,c as Ce,f as Ue}from"../chunk-FMYLEPMC.js";import{b as K,c as w,d as b,g as L,h as U,i as O,j,k as T,l as S}from"../chunk-W6T7MOKY.js";import{a as Re}from"../chunk-7CUTGGH3.js";import{e as Le}from"../chunk-FQHALFRR.js";import"../chunk-HEMBMX7T.js";import"../chunk-FUUTGGJS.js";var yt="kanonak.org",kt="document-ast",m=t=>({publisher:yt,package_:kt,name:t}),k={Document:m("Document"),Block:m("Block"),Inline:m("Inline"),StructuredValue:m("StructuredValue"),Heading:m("Heading"),Paragraph:m("Paragraph"),RawBlock:m("RawBlock"),Text:m("Text"),StructuredMap:m("StructuredMap"),StructuredEntry:m("StructuredEntry"),StructuredList:m("StructuredList"),StringScalar:m("StringScalar"),IntegerScalar:m("IntegerScalar"),EscapeHint:m("EscapeHint"),MediaType:m("MediaType"),metadata:m("metadata"),children:m("children"),level:m("level"),inlines:m("inlines"),text:m("text"),entries:m("entries"),key:m("key"),value:m("value"),escapeHint:m("escapeHint"),items:m("items"),stringValue:m("stringValue"),integerValue:m("integerValue"),rawContent:m("rawContent"),mediaType:m("mediaType"),mimeType:m("mimeType"),ESC_RAW:m("esc-raw"),ESC_YAML_SAFE:m("esc-yaml-safe"),ESC_TOML_STRING:m("esc-toml-string"),ESC_TOML_MULTILINE:m("esc-toml-multiline"),ESC_JSON:m("esc-json"),ESC_DYNAMODB_BOOL:m("esc-dynamodb-bool"),ESC_DYNAMODB_NUMBER:m("esc-dynamodb-number"),ESC_DYNAMODB_NULL:m("esc-dynamodb-null"),TEXT_PLAIN:m("text-plain"),TEXT_MARKDOWN:m("text-markdown"),TEXT_HTML:m("text-html"),TEXT_CSS:m("text-css"),APPLICATION_JSON:m("application-json"),TEXT_YAML:m("text-yaml"),IMAGE_SVG_XML:m("image-svg-xml"),ResourceLink:m("ResourceLink"),target:m("target"),linkLabel:m("linkLabel"),PropertyList:m("PropertyList"),propertyEntries:m("propertyEntries"),PropertyEntry:m("PropertyEntry"),propertyKey:m("propertyKey"),propertyValue:m("propertyValue"),Table:m("Table"),tableColumnLabels:m("tableColumnLabels"),tableRows:m("tableRows"),TableRow:m("TableRow"),tableCells:m("tableCells")};function Ie(t,e){return t.publisher===e.publisher&&t.package_===e.package_&&t.name===e.name}var Y=class{backendUri="kanonak.org/transformations/markdown-with-frontmatter";render(e,n){let r=ht(e.metadata,n),a=St(e.children),u=["---",...r,"---","",a].join(`
2
2
  `);return n?.trailingNewline&&(u.endsWith(`
3
3
  `)||(u+=`
4
4
  `)),u}};function ht(t,e){if(!t)return[];let n=new Map;for(let c of t.entries)n.set(ue(c.key),c);let r=new Map;if(e?.metadataRenames)for(let[c,l]of e.metadataRenames)r.set(ue(c),l);let i=(e?.metadataKeys??t.entries.map(c=>c.key)).map(ue),u=[];for(let c of i){let l=n.get(c);if(!l)continue;let p=r.get(c),y=ue(p??c),h=Me(l.value,l.escapeHint);h!==void 0&&u.push(`${y}: ${h}`)}return u}function ue(t){let e=t.lastIndexOf(".");return e===-1?t:t.substring(e+1)||t}function Me(t,e){switch(t.kind){case"StringScalar":return bt(t.stringValue,e);case"IntegerScalar":return String(t.integerValue);case"StructuredList":{let n=[];for(let r of t.items){let a=Me(r,e);a!==void 0&&n.push(a)}return n.join(", ")}case"StructuredMap":return;default:return}}function bt(t,e){return!e||Ie(e,k.ESC_RAW)?t:Ie(e,k.ESC_YAML_SAFE)?wt(t):t}function wt(t){return t.includes(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanonak-protocol/sdk",
3
- "version": "3.46.0",
3
+ "version": "3.47.0",
4
4
  "description": "Kanonak Protocol SDK - Document repository and parsing implementations for TypeScript",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -113,7 +113,7 @@
113
113
  "yaml-parser"
114
114
  ],
115
115
  "dependencies": {
116
- "@kanonak-protocol/types": "^3.46.0",
116
+ "@kanonak-protocol/types": "^3.47.0",
117
117
  "ignore": "^7.0.5",
118
118
  "js-yaml": "^4.1.0",
119
119
  "yaml": "^2.7.0"