vanilla-breeze 0.1.2 → 0.1.3

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.
Files changed (110) hide show
  1. package/dist/cdn/components/accordion-wc.js +1 -1
  2. package/dist/cdn/components/analytics-panel.js +1 -1
  3. package/dist/cdn/components/audio-player.js +1 -1
  4. package/dist/cdn/components/audio-visualizer.js +2 -2
  5. package/dist/cdn/components/author-index.js +1 -1
  6. package/dist/cdn/components/brand-mark.js +1 -1
  7. package/dist/cdn/components/calendar-wc.js +2 -2
  8. package/dist/cdn/components/card-list.js +1 -1
  9. package/dist/cdn/components/carousel-wc.js +1 -1
  10. package/dist/cdn/components/change-set.js +1 -1
  11. package/dist/cdn/components/chart-wc.js +11 -11
  12. package/dist/cdn/components/chat-input.js +1 -1
  13. package/dist/cdn/components/chat-window.js +1 -1
  14. package/dist/cdn/components/color-palette.js +4 -4
  15. package/dist/cdn/components/color-picker.js +1 -1
  16. package/dist/cdn/components/combo-box.js +1 -1
  17. package/dist/cdn/components/command-palette.js +1 -1
  18. package/dist/cdn/components/comment-wc.js +1 -1
  19. package/dist/cdn/components/compare-surface.js +1 -1
  20. package/dist/cdn/components/component-sampler.js +4 -4
  21. package/dist/cdn/components/consent-banner.js +1 -1
  22. package/dist/cdn/components/content-lens.js +1 -1
  23. package/dist/cdn/components/content-swap.js +1 -1
  24. package/dist/cdn/components/context-menu.js +1 -1
  25. package/dist/cdn/components/data-table.js +1 -1
  26. package/dist/cdn/components/date-picker.js +1 -1
  27. package/dist/cdn/components/day-view.js +1 -1
  28. package/dist/cdn/components/drag-surface.js +1 -1
  29. package/dist/cdn/components/drop-down.js +1 -1
  30. package/dist/cdn/components/emoji-picker.js +1 -1
  31. package/dist/cdn/components/flow-diagram.js +1 -1
  32. package/dist/cdn/components/font-pairer.js +1 -1
  33. package/dist/cdn/components/foot-notes.js +1 -1
  34. package/dist/cdn/components/form-field.js +1 -1
  35. package/dist/cdn/components/gantt-chart.js +1 -1
  36. package/dist/cdn/components/geo-map.js +3 -3
  37. package/dist/cdn/components/glossary-index.js +1 -1
  38. package/dist/cdn/components/glossary-wc.js +1 -1
  39. package/dist/cdn/components/gradient-builder.js +1 -1
  40. package/dist/cdn/components/heading-links.js +1 -1
  41. package/dist/cdn/components/highlight-wc.js +2 -2
  42. package/dist/cdn/components/image-gallery.js +1 -1
  43. package/dist/cdn/components/image-map.js +1 -1
  44. package/dist/cdn/components/impact-effort.js +1 -1
  45. package/dist/cdn/components/include-file.js +1 -1
  46. package/dist/cdn/components/kanban-board.js +1 -1
  47. package/dist/cdn/components/manifest.json +95 -95
  48. package/dist/cdn/components/markdown-editor.js +1 -1
  49. package/dist/cdn/components/markdown-viewer.js +1 -1
  50. package/dist/cdn/components/motion-specimen.js +3 -3
  51. package/dist/cdn/components/note-wc.js +1 -1
  52. package/dist/cdn/components/notification-wc.js +4 -4
  53. package/dist/cdn/components/page-info.js +20 -20
  54. package/dist/cdn/components/page-stats.js +1 -1
  55. package/dist/cdn/components/page-toc.js +1 -1
  56. package/dist/cdn/components/page-tools.js +1 -1
  57. package/dist/cdn/components/page-tour.js +2 -2
  58. package/dist/cdn/components/palette-generator.js +1 -1
  59. package/dist/cdn/components/popularity-index.js +1 -1
  60. package/dist/cdn/components/print-page.js +1 -1
  61. package/dist/cdn/components/qr-code.js +1 -1
  62. package/dist/cdn/components/reader-view.js +2 -2
  63. package/dist/cdn/components/recently-visited.js +26 -2
  64. package/dist/cdn/components/selection-menu.js +1 -1
  65. package/dist/cdn/components/semantic-palette.js +1 -1
  66. package/dist/cdn/components/settings-panel.js +2 -2
  67. package/dist/cdn/components/share-wc.js +1 -1
  68. package/dist/cdn/components/short-cuts.js +1 -1
  69. package/dist/cdn/components/site-index.js +1 -1
  70. package/dist/cdn/components/site-map-wc.js +1 -1
  71. package/dist/cdn/components/site-map.js +1 -1
  72. package/dist/cdn/components/site-search.js +3 -3
  73. package/dist/cdn/components/slide-accept.js +1 -1
  74. package/dist/cdn/components/social-embed.js +1 -1
  75. package/dist/cdn/components/spacing-specimen.js +2 -2
  76. package/dist/cdn/components/split-surface.js +1 -1
  77. package/dist/cdn/components/star-rating.js +1 -1
  78. package/dist/cdn/components/story-map.js +1 -1
  79. package/dist/cdn/components/tab-set.js +1 -1
  80. package/dist/cdn/components/text-reader.js +2 -2
  81. package/dist/cdn/components/theme-export.js +1 -1
  82. package/dist/cdn/components/theme-picker.js +3 -3
  83. package/dist/cdn/components/time-index.js +1 -1
  84. package/dist/cdn/components/time-picker.js +1 -1
  85. package/dist/cdn/components/toast-msg.js +1 -1
  86. package/dist/cdn/components/token-specimen.js +6 -6
  87. package/dist/cdn/components/tool-tip.js +1 -1
  88. package/dist/cdn/components/topic-map.js +3 -2
  89. package/dist/cdn/components/trust-filter.js +3 -3
  90. package/dist/cdn/components/type-specimen.js +1 -1
  91. package/dist/cdn/components/user-story.js +8 -8
  92. package/dist/cdn/components/video-player.js +4 -4
  93. package/dist/cdn/components/watch-wc.js +2 -2
  94. package/dist/cdn/components/week-view.js +1 -1
  95. package/dist/cdn/components/work-item.js +14 -14
  96. package/dist/cdn/components/youtube-player.js +1 -1
  97. package/dist/cdn/packs/design-system.full.js +15 -15
  98. package/dist/cdn/packs/effects.full.js +1 -1
  99. package/dist/cdn/packs/manifest.json +5 -5
  100. package/dist/cdn/packs/ui.full.css +1 -1
  101. package/dist/cdn/packs/ui.full.js +5 -5
  102. package/dist/cdn/packs/ux-planning.full.js +119 -119
  103. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  104. package/dist/cdn/vanilla-breeze-charts.js +11 -11
  105. package/dist/cdn/vanilla-breeze-core.css +1 -1
  106. package/dist/cdn/vanilla-breeze-core.js +21 -21
  107. package/dist/cdn/vanilla-breeze-extras.js +3 -3
  108. package/dist/cdn/vanilla-breeze.css +1 -1
  109. package/dist/cdn/vanilla-breeze.js +210 -185
  110. package/package.json +5 -2
@@ -1,3 +1,3 @@
1
- var S=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,i){t.addEventListener(e,n,i),this.#t.push(()=>t.removeEventListener(e,n,i))}setup(){}teardown(){}};var it=window.matchMedia("(prefers-reduced-motion: reduce)");var P=new Map;function F(o,t,e={}){let n=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:n},s=P.get(o);if(customElements.get(o)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}P.set(o,i),customElements.define(o,t)}function j(){let o=globalThis.localStorage;if(!o)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return o.getItem(t)},async setRaw(t,e){o.setItem(t,e)},async removeRaw(t){o.removeItem(t)},async keys(t){let e=[];for(let n=0;n<o.length;n++){let i=o.key(n);i&&i.startsWith(t)&&e.push(i)}return e}}}var k=null;function g(){return k||(k=j()),k}function O(o,t){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${o}:${t}`}function I(o){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${o}:`}function q(o){try{let t=JSON.parse(o);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var x={configure(o={}){k=o.backend??null},async set(o,t,e){let n={data:e,timestamp:Date.now()};await g().setRaw(O(o,t),JSON.stringify(n))},async get(o,t,e){let n=await g().getRaw(O(o,t));if(n==null)return null;let i=q(n);return!i||e?.maxAge!=null&&Date.now()-i.timestamp>e.maxAge?null:i.data},async remove(o,t){await g().removeRaw(O(o,t))},async list(o){let t=I(o),e=await g().keys(t),n=[];for(let i of e){let s=await g().getRaw(i);if(s==null)continue;let r=q(s);r&&n.push({key:i.slice(t.length),data:r.data,timestamp:r.timestamp})}return n},async clear(o){let t=I(o),e=await g().keys(t);for(let n of e)await g().removeRaw(n)},async clearAll(){let o=await g().keys("vb:");for(let t of o)await g().removeRaw(t)},async setMany(o,t){for(let[e,n]of t)await x.set(o,e,n)}};var M="[data-highlights]",D="highlights",J=["yellow","green","blue","pink"],_=8,L=8,K=typeof CSS<"u"&&"highlights"in CSS;function V(o){let t=2166136261;for(let e=0;e<o.length;e++)t^=o.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function z(){return"hn-"+crypto.randomUUID().slice(0,8)}function U(o,t){return getComputedStyle(o).getPropertyValue(`--highlight-${t}`).trim()}var v=null,A=0;function Y(o){if(v){A++;return}v=new CSSStyleSheet;let t=o.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
1
+ var S=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,n,i){t.addEventListener(e,n,i),this.#t.push(()=>t.removeEventListener(e,n,i))}setup(){}teardown(){}};var it=window.matchMedia("(prefers-reduced-motion: reduce)");var P=new Map;function F(o,t,e={}){let n=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:n},s=P.get(o);if(customElements.get(o)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}P.set(o,i),customElements.define(o,t)}function j(){let o=globalThis.localStorage;if(!o)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return o.getItem(t)},async setRaw(t,e){o.setItem(t,e)},async removeRaw(t){o.removeItem(t)},async keys(t){let e=[];for(let n=0;n<o.length;n++){let i=o.key(n);i&&i.startsWith(t)&&e.push(i)}return e}}}var k=null;function g(){return k||(k=j()),k}function O(o,t){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${o}:${t}`}function I(o){if(typeof o!="string"||!o)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${o}:`}function q(o){try{let t=JSON.parse(o);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var x={configure(o={}){k=o.backend??null},async set(o,t,e){let n={data:e,timestamp:Date.now()};await g().setRaw(O(o,t),JSON.stringify(n))},async get(o,t,e){let n=await g().getRaw(O(o,t));if(n==null)return null;let i=q(n);return!i||e?.maxAge!=null&&Date.now()-i.timestamp>e.maxAge?null:i.data},async remove(o,t){await g().removeRaw(O(o,t))},async list(o){let t=I(o),e=await g().keys(t),n=[];for(let i of e){let s=await g().getRaw(i);if(s==null)continue;let r=q(s);r&&n.push({key:i.slice(t.length),data:r.data,timestamp:r.timestamp})}return n},async clear(o){let t=I(o),e=await g().keys(t);for(let n of e)await g().removeRaw(n)},async clearAll(){let o=await g().keys("vb:");for(let t of o)await g().removeRaw(t)},async setMany(o,t){for(let[e,n]of t)await x.set(o,e,n)}};var M="[data-highlights]",D="highlights",J=["yellow","green","blue","pink"],_=8,L=8,K=typeof CSS<"u"&&"highlights"in CSS;function V(o){let t=2166136261;for(let e=0;e<o.length;e++)t^=o.charCodeAt(e),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function z(){return"hn-"+crypto.randomUUID().slice(0,8)}function U(o,t){return getComputedStyle(o).getPropertyValue(`--highlight-${t}`).trim()}var v=null,A=0;function Y(o){if(v){A++;return}v=new CSSStyleSheet;let t=o.map(e=>`::highlight(hn-${e}) { background-color: var(--highlight-${e}); text-decoration-line: underline; text-decoration-color: var(--highlight-${e}); text-underline-offset: 2px; }`).join(`
2
2
  `);v.replaceSync(t),document.adoptedStyleSheets=[...document.adoptedStyleSheets,v],A=1}function Q(){A--,A<=0&&v&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(o=>o!==v),v=null,A=0)}var d=null,N=null;function Z(){return d||(d=document.createElement("div"),d.className="hn-toolbar",d.setAttribute("role","toolbar"),d.setAttribute("aria-label","Highlight tools"),d.setAttribute("popover","auto"),d.hidden=!0,document.body.appendChild(d),d.addEventListener("toggle",o=>{o.newState==="closed"&&(d.hidden=!0,N=null)}),d)}function R(o,t,e){let n=Z();n.innerHTML="",N=t;let i=t.colors,s=t.element,r=e?.color,l=document.createElement("div");if(l.className="hn-swatches",l.setAttribute("role","group"),l.setAttribute("aria-label","Highlight colors"),i.forEach((a,c)=>{let h=document.createElement("button");h.type="button",h.className="hn-swatch",h.dataset.color=a,h.setAttribute("aria-label",`Highlight ${a}${r===a?" (current)":""}`),h.setAttribute("tabindex",c===0?"0":"-1");let f=U(s,a);f&&(h.style.backgroundColor=f),r===a&&h.setAttribute("aria-pressed","true"),h.addEventListener("click",()=>{e?t._changeColor(e.id,a):t._createFromSelection(a),C()}),l.appendChild(h)}),n.appendChild(l),e){let a=document.createElement("span");a.className="hn-separator",a.setAttribute("aria-hidden","true"),n.appendChild(a);let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent=e.note?"Edit Note":"Add Note",c.addEventListener("click",()=>{w(t,e),C()}),n.appendChild(c);let h=document.createElement("button");h.type="button",h.className="hn-action hn-action-remove",h.textContent="Remove",h.addEventListener("click",()=>{t.removeHighlight(e.id),C()}),n.appendChild(h)}l.addEventListener("keydown",a=>{let c=[...l.querySelectorAll("button")],h=c.indexOf(document.activeElement);if(h<0)return;let f=-1;if(a.key==="ArrowRight"||a.key==="ArrowDown")a.preventDefault(),f=(h+1)%c.length;else if(a.key==="ArrowLeft"||a.key==="ArrowUp")a.preventDefault(),f=(h-1+c.length)%c.length;else if(a.key==="Escape"){C();return}f>=0&&(c[h].setAttribute("tabindex","-1"),c[f].setAttribute("tabindex","0"),c[f].focus())}),n.hidden=!1;try{n.showPopover()}catch{}tt(o),requestAnimationFrame(()=>{let a=n.querySelector(".hn-swatch");a&&a.focus()})}var u=null;function w(o,t){y();let e=o.element,n=b(e,t.startOffset,t.endOffset);if(!n)return;u=document.createElement("div"),u.className="hn-note-panel",u.setAttribute("role","dialog"),u.setAttribute("aria-label","Private note");let i=document.createElement("header");i.className="hn-note-header",i.innerHTML="<small>PRIVATE NOTE</small>",u.appendChild(i);let s=document.createElement("blockquote");s.className="hn-note-quote",s.textContent=t.text.length>80?t.text.slice(0,80)+"\u2026":t.text,u.appendChild(s);let r=document.createElement("textarea");r.className="hn-note-textarea",r.placeholder="Add a note\u2026",r.value=t.note||"",r.rows=3,r.setAttribute("aria-label","Note for highlighted text"),u.appendChild(r);let l=document.createElement("footer");l.className="hn-note-actions";let a=document.createElement("button");a.type="button",a.className="hn-action hn-action-save",a.textContent="Save",a.addEventListener("click",()=>{o._updateNote(t.id,r.value.trim()),y()});let c=document.createElement("button");c.type="button",c.className="hn-action",c.textContent="Cancel",c.addEventListener("click",()=>y()),l.append(a,c),u.appendChild(l),r.addEventListener("keydown",m=>{m.key==="Escape"&&(m.preventDefault(),y()),m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&(m.preventDefault(),o._updateNote(t.id,r.value.trim()),y())}),e.style.position="relative",e.appendChild(u);let h=n.getClientRects()[0],f=e.getBoundingClientRect();if(h){let m=h.top-f.top;u.style.top=`${m}px`}requestAnimationFrame(()=>{r.focus(),document.addEventListener("pointerdown",G)})}function G(o){u&&!u.contains(o.target)&&y()}function y(){u&&(document.removeEventListener("pointerdown",G),u.remove(),u=null)}function tt(o){d&&requestAnimationFrame(()=>{let t=d.getBoundingClientRect(),e=t.width||200,n=t.height||40,i=o.top-n-_,s=o.left+o.width/2-e/2;i<L&&(i=o.bottom+_);let r=window.innerWidth-e-L;s=Math.max(L,Math.min(s,r)),d.style.top=`${i}px`,d.style.left=`${s}px`})}function C(){if(d){try{d.hidePopover()}catch{}d.hidden=!0,N=null}}var p=null;function T(o){p||(p=document.createElement("div"),p.setAttribute("aria-live","polite"),p.setAttribute("aria-atomic","true"),p.className="hn-sr-only",document.body.appendChild(p)),p.textContent="",requestAnimationFrame(()=>{p.textContent=o})}function W(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0;for(;n.nextNode();){if(n.currentNode===t)return i+e;i+=(n.currentNode.textContent??"").length}return-1}function b(o,t,e){let n=document.createTreeWalker(o,NodeFilter.SHOW_TEXT),i=0,s=null,r=0,l=null,a=0;for(;n.nextNode();){let c=n.currentNode,h=(c.textContent??"").length;if(!s&&i+h>t&&(s=c,r=t-i),i+h>=e){l=c,a=e-i;break}i+=h}if(!s||!l)return null;try{let c=document.createRange();return c.setStart(s,Math.min(r,(s.textContent??"").length)),c.setEnd(l,Math.min(a,(l.textContent??"").length)),c}catch{return null}}var B=class{#t;#s;#n;#u;#e=[];#a=!K;#c;#l;#h=!1;#d=[];constructor(t){this.#t=t,this.#u=t.hasAttribute("data-highlights-readonly");let e=t.dataset.highlights;this.#s=e&&e!==""?e:location.pathname;let n=t.dataset.highlightsColors;this.#n=n?n.split(",").map(i=>i.trim()).filter(Boolean):[...J],this.#a||Y(this.#n),this.#o(),this.#u||(this.#c=this.#m.bind(this),this.#l=this.#p.bind(this),t.addEventListener("pointerup",this.#c),t.addEventListener("click",this.#l)),t.setAttribute("data-highlights-init",""),this.#y().then(()=>{this.#h||this.#o()})}get colors(){return[...this.#n]}get element(){return this.#t}getHighlights(){return this.#e.map(t=>({...t}))}removeHighlight(t){let e=this.#e.findIndex(n=>n.id===t);e<0||(this.#e.splice(e,1),this.#i(),this.#o(),this.#r("highlights:removed",{id:t}),T("Highlight removed"))}clearAll(){this.#e=[],this.#i(),this.#o()}exportHighlights(){return JSON.stringify({version:1,highlights:this.#e})}importHighlights(t){try{let e=typeof t=="string"?JSON.parse(t):t;if(!e.highlights||!Array.isArray(e.highlights))return;this.#e=e.highlights,this.#i(),this.#o()}catch{}}destroy(){if(!this.#h){if(this.#h=!0,this.#c&&this.#t.removeEventListener("pointerup",this.#c),this.#l&&this.#t.removeEventListener("click",this.#l),this.#a)this.#t.querySelectorAll("mark[data-hn-id]").forEach(t=>{let e=t.parentNode;for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()});else{for(let t of this.#n)CSS.highlights.delete(`hn-${t}`);Q()}this.#f(),this.#t.removeAttribute("data-highlights-init"),N===this&&C(),y()}}#m(){requestAnimationFrame(()=>{if(this.#h||this.#t.hasAttribute("data-selection-menu"))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim())return;let e=t.getRangeAt(0);if(!this.#t.contains(e.commonAncestorContainer))return;let n=e.getBoundingClientRect();R(n,this,null)})}#p(t){if(this.#t.hasAttribute("data-selection-menu"))return;let e=t.target.closest?.(".hn-margin-annotation");if(e){let i=e.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){w(this,s);return}}let n=t.target.closest?.("mark[data-hn-id]");if(n){let i=n.dataset.hnId,s=this.#e.find(r=>r.id===i);if(s){this.#r("highlights:clicked",{id:i});let r=n.getBoundingClientRect();R(r,this,s);return}}if(!this.#a){let i=this.#b(t.clientX,t.clientY);if(i){this.#r("highlights:clicked",{id:i.id});let s=b(this.#t,i.startOffset,i.endOffset);s&&R(s.getBoundingClientRect(),this,i)}}}#b(t,e){for(let n of this.#e){let i=b(this.#t,n.startOffset,n.endOffset);if(!i)continue;let s=i.getClientRects();for(let r of s)if(t>=r.left&&t<=r.right&&e>=r.top&&e<=r.bottom)return n}return null}_createFromSelection(t){let e=window.getSelection();if(!e||e.isCollapsed)return;let n=e.getRangeAt(0);if(!this.#t.contains(n.commonAncestorContainer))return;let i=W(this.#t,n.startContainer,n.startOffset),s=W(this.#t,n.endContainer,n.endOffset);if(i<0||s<0||i>=s)return;let r=e.toString().trim(),l={id:z(),startOffset:i,endOffset:s,text:r,color:t,note:"",created:Date.now()};this.#e.push(l),this.#i(),this.#o(),e.removeAllRanges(),this.#r("highlights:added",{id:l.id,text:r,color:t,note:""}),T("Highlight added")}_changeColor(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.color=e,this.#i(),this.#o())}_updateNote(t,e){let n=this.#e.find(i=>i.id===t);n&&(n.note=e,this.#i(),this.#g(),this.#r("highlights:note-changed",{id:t,note:e}),T("Note saved"))}async#y(){let t=await x.get(D,this.#s);if(!t||!Array.isArray(t.highlights))return;let e=V(this.#t.textContent);t.contentHash&&t.contentHash!==e?(this.#e=t.highlights.filter(n=>{let i=b(this.#t,n.startOffset,n.endOffset);return i?i.toString().trim()===n.text:!1}),this.#i()):this.#e=t.highlights}#i(){let t={version:1,contentHash:V(this.#t.textContent),highlights:this.#e};x.set(D,this.#s,t).catch(()=>{})}#o(){this.#a?this.#E():this.#v(),this.#g()}#v(){let t=new Map;for(let e of this.#n)t.set(e,[]);for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);n&&t.has(e.color)&&t.get(e.color).push(n)}for(let[e,n]of t){let i=`hn-${e}`;n.length===0?CSS.highlights.delete(i):CSS.highlights.set(i,new Highlight(...n))}}#E(){this.#t.querySelectorAll("mark[data-hn-id]").forEach(e=>{let n=e.parentNode;for(;e.firstChild;)n.insertBefore(e.firstChild,e);n.removeChild(e)}),this.#t.normalize();let t=[...this.#e].sort((e,n)=>n.startOffset-e.startOffset);for(let e of t){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=U(this.#t,e.color),s=document.createElement("mark");s.dataset.hnId=e.id,s.dataset.hnColor=e.color,i&&(s.style.backgroundColor=i,s.style.textDecorationColor=i);try{n.surroundContents(s)}catch{let r=n.extractContents();s.appendChild(r),n.insertNode(s)}}}#f(){for(let t of this.#d)t.remove();this.#d=[]}#g(){if(this.#f(),this.#e.length===0)return;getComputedStyle(this.#t).position==="static"&&(this.#t.style.position="relative");for(let e of this.#e){let n=b(this.#t,e.startOffset,e.endOffset);if(!n)continue;let i=n.getClientRects();if(i.length===0)continue;let s=i[0],r=this.#t.getBoundingClientRect(),l=s.top-r.top,a=document.createElement("span");a.className="hn-margin-annotation",a.dataset.hnId=e.id,a.setAttribute("aria-hidden","true"),a.style.top=`${l}px`,e.note?(a.innerHTML='<span class="hn-note-indicator">*</span> You highlighted',a.classList.add("hn-has-note")):a.textContent="You highlighted",this.#t.appendChild(a),this.#d.push(a)}}#r(t,e={}){this.#t.dispatchEvent(new CustomEvent(t,{detail:e,bubbles:!0}))}},$=new WeakMap;function E(o){if($.has(o))return $.get(o);let t=new B(o);return $.set(o,t),t}function X(o=document){o.querySelectorAll(M).forEach(t=>{t.hasAttribute("data-highlights-init")||E(t)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>X()):X();var et=new MutationObserver(o=>{for(let t of o)for(let e of t.addedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=e;n.matches(M)&&E(n),n.querySelectorAll(M).forEach(i=>{i.hasAttribute("data-highlights-init")||E(i)})}});et.observe(document.documentElement,{childList:!0,subtree:!0});var H=class extends S{#t=!1;setup(){this.#t=!!this.closest("selection-menu");let t=document.createElement("button");t.type="button",t.setAttribute("aria-label",this.#t?"Add private note":"View notes");let e=document.createElement("icon-wc");e.setAttribute("name","sticky-note"),e.setAttribute("size","sm"),e.setAttribute("aria-hidden","true"),t.appendChild(e),this.#t?t.addEventListener("click",()=>this.#s()):t.addEventListener("click",()=>this.#n()),this.appendChild(t)}#s(){let t=this.closest("selection-menu");if(!t)return;let e=t.getSelection();if(!e)return;let n=e.target;n.hasAttribute("data-highlights-init")||n.setAttribute("data-highlights","");let i=E(n),s=i.getHighlights(),r=null;for(let l of s)if(e.text&&l.text&&e.text.includes(l.text.slice(0,20))){r=l;break}if(!r){i._createFromSelection("yellow");let l=i.getHighlights();r=l[l.length-1]}r&&w(i,r),t.dismiss()}#n(){let t=this.getAttribute("for"),e=t?document.getElementById(t):null;if(!e)return;e.hasAttribute("data-highlights-init")||e.setAttribute("data-highlights","");let n=E(e),i=n.getHighlights(),s=i.filter(r=>r.note);s.length>0?w(n,s[0]):i.length>0&&w(n,i[0])}};F("note-wc",H);
3
3
  //# sourceMappingURL=note-wc.js.map
@@ -1,4 +1,4 @@
1
- var B=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function E(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},a=k.get(s);if(customElements.get(s)){if(!a||a.priority>=i){a&&a.priority===i&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=i){a.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}k.set(s,n),customElements.define(s,t)}var y=class extends HTMLElement{#i=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#i)t();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#i.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function q(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var m=null;function u(){return m||(m=q()),m}function g(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function A(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function $(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var h={configure(s={}){m=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await u().setRaw(g(s,t),JSON.stringify(i))},async get(s,t,e){let i=await u().getRaw(g(s,t));if(i==null)return null;let n=$(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await u().removeRaw(g(s,t))},async list(s){let t=A(s),e=await u().keys(t),i=[];for(let n of e){let a=await u().getRaw(n);if(a==null)continue;let r=$(a);r&&i.push({key:n.slice(t.length),data:r.data,timestamp:r.timestamp})}return i},async clear(s){let t=A(s),e=await u().keys(t);for(let i of e)await u().removeRaw(i)},async clearAll(){let s=await u().keys("vb:");for(let t of s)await u().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await h.set(s,e,i)}};var d={baseUrl:"/go",headers:{},services:{}},b=class extends Error{constructor(t,e,i,n){super(`VBService(${i}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=i,this.path=n}};function C(s,t){if(!t)return s;let e=s??new URLSearchParams;for(let[i,n]of Object.entries(t))n!=null&&e.set(i,String(n));return e}async function x(s){if((s.headers.get("content-type")??"").includes("application/json"))try{return await s.json()}catch{return null}try{return await s.text()}catch{return null}}var w=class s{static configure(t={}){d={baseUrl:t.baseUrl??d.baseUrl,headers:{...d.headers,...t.headers??{}},services:{...d.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return d.services[t]?T(d.services[t]):d.baseUrl?`${T(d.baseUrl)}/${t}`:`/go/${t}`}static _reset(){d={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#i("GET",t,{params:e})}async post(t,e){return this.#i("POST",t,{body:e})}async patch(t,e){return this.#i("PATCH",t,{body:e})}async delete(t){return this.#i("DELETE",t,{})}async#i(t,e,i){let n=s.resolve(this.role),a=e?e.startsWith("/")?e:`/${e}`:"",r=new URL(`${n}${a}`,globalThis.location?.origin??"http://localhost"),l=C(r.searchParams,i.params);l&&(r.search=l.toString());let o={method:t,headers:{...d.headers}};i.body!==void 0&&(o.body=JSON.stringify(i.body),o.headers["content-type"]="application/json");let p=r.toString(),f=await fetch(p,o),S=await x(f);if(!f.ok)throw new b(f.status,S,this.role,`${a||"/"}`);return S}};function T(s){return s.endsWith("/")?s.slice(0,-1):s}var N={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function c(s){return String(s??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}var v=class extends y{#i="panel";#w=null;#e=null;#t=null;#a=null;#s=new Set;#f=[];#o=!1;#r=null;#g=new Set;#p="all";#n=[];setup(){return this.#i=this.getAttribute("mode")==="banner"?"banner":"panel",this.#i==="banner"?this.#v():this.#k()}teardown(){this.#r!=null&&(clearInterval(this.#r),this.#r=null)}async#v(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let i=Number(this.getAttribute("expires")??""),n=Number.isFinite(i)&&i>0?i*864e5:void 0,a=await h.get("notifications",t,n?{maxAge:n}:void 0);if(a&&a.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#w=e,this.listen(e,"click",this.#S))}#S=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await h.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#k(){if(this.dataset.mode="panel",await this.#E(),this.#A(),this.#$(),await this.#c(),this.#u(),this.listen(document,"click",this.#B),this.listen(document,"keydown",this.#L),this.listen(document,"page-watch:add",()=>this.#c()),this.listen(document,"page-watch:remove",()=>this.#c()),this.getAttribute("src")){await this.#m();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#r=setInterval(()=>this.#m(),t))}}async#E(){let t=this.getAttribute("storage-key")||"notifications",e=await h.get(t,"read-ids");Array.isArray(e)&&(this.#s=new Set(e.filter(i=>typeof i=="string")))}async#b(){let t=this.getAttribute("storage-key")||"notifications";await h.set(t,"read-ids",Array.from(this.#s))}#A(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e){let t=this.#e.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#e.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#e=t,this.prepend(t)}this.#a=this.#e.querySelector(".notification-badge"),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.listen(this.#e,"click",this.#N)}#$(){this.#t=document.createElement("div"),this.#t.className="notification-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Notifications"),this.#t.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e?.setAttribute("aria-controls",t),this.#t.innerHTML=`
1
+ var B=window.matchMedia("(prefers-reduced-motion: reduce)");var E=new Map;function k(s,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},a=E.get(s);if(customElements.get(s)){if(!a||a.priority>=i){a&&a.priority===i&&a.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=i){a.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}E.set(s,n),customElements.define(s,t)}var m=class extends HTMLElement{#i=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#i)t();this.#i=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#i.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};function T(){let s=globalThis.localStorage;if(!s)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(t){return s.getItem(t)},async setRaw(t,e){s.setItem(t,e)},async removeRaw(t){s.removeItem(t)},async keys(t){let e=[];for(let i=0;i<s.length;i++){let n=s.key(i);n&&n.startsWith(t)&&e.push(n)}return e}}}var y=null;function u(){return y||(y=T()),y}function g(s,t){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof t!="string"||!t)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${s}:${t}`}function A(s){if(typeof s!="string"||!s)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${s}:`}function $(s){try{let t=JSON.parse(s);if(t&&typeof t=="object"&&typeof t.timestamp=="number")return t}catch{}return null}var h={configure(s={}){y=s.backend??null},async set(s,t,e){let i={data:e,timestamp:Date.now()};await u().setRaw(g(s,t),JSON.stringify(i))},async get(s,t,e){let i=await u().getRaw(g(s,t));if(i==null)return null;let n=$(i);return!n||e?.maxAge!=null&&Date.now()-n.timestamp>e.maxAge?null:n.data},async remove(s,t){await u().removeRaw(g(s,t))},async list(s){let t=A(s),e=await u().keys(t),i=[];for(let n of e){let a=await u().getRaw(n);if(a==null)continue;let r=$(a);r&&i.push({key:n.slice(t.length),data:r.data,timestamp:r.timestamp})}return i},async clear(s){let t=A(s),e=await u().keys(t);for(let i of e)await u().removeRaw(i)},async clearAll(){let s=await u().keys("vb:");for(let t of s)await u().removeRaw(t)},async setMany(s,t){for(let[e,i]of t)await h.set(s,e,i)}};var d={baseUrl:"/go",headers:{},services:{}},b=class extends Error{constructor(t,e,i,n){super(`VBService(${i}): ${t} ${n}`),this.name="VBServiceError",this.status=t,this.body=e,this.role=i,this.path=n}};function q(s,t){if(!t)return s;let e=s??new URLSearchParams;for(let[i,n]of Object.entries(t))n!=null&&e.set(i,String(n));return e}async function x(s){if((s.headers.get("content-type")??"").includes("application/json"))try{return await s.json()}catch{return null}try{return await s.text()}catch{return null}}var w=class s{static configure(t={}){d={baseUrl:t.baseUrl??d.baseUrl,headers:{...d.headers,...t.headers??{}},services:{...d.services,...t.services??{}}}}static resolve(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");return d.services[t]?C(d.services[t]):d.baseUrl?`${C(d.baseUrl)}/${t}`:`/go/${t}`}static _reset(){d={baseUrl:"/go",headers:{},services:{}}}constructor(t){if(!t||typeof t!="string")throw new TypeError("VBService: role must be a non-empty string");this.role=t}async get(t,e){return this.#i("GET",t,{params:e})}async post(t,e){return this.#i("POST",t,{body:e})}async patch(t,e){return this.#i("PATCH",t,{body:e})}async delete(t){return this.#i("DELETE",t,{})}async#i(t,e,i){let n=s.resolve(this.role),a=e?e.startsWith("/")?e:`/${e}`:"",r=new URL(`${n}${a}`,globalThis.location?.origin??"http://localhost"),l=q(r.searchParams,i.params);l&&(r.search=l.toString());let o={method:t,headers:{...d.headers}};i.body!==void 0&&(o.body=JSON.stringify(i.body),o.headers["content-type"]="application/json");let p=r.toString(),f=await fetch(p,o),S=await x(f);if(!f.ok)throw new b(f.status,S,this.role,`${a||"/"}`);return S}};function C(s){return s.endsWith("/")?s.slice(0,-1):s}var N={update:"package",alert:"alert-triangle",watch:"eye",system:"settings",message:"mail",stewardship:"shield"};function c(s){return String(s??"").replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}var v=class extends m{#i="panel";#w=null;#e=null;#t=null;#a=null;#s=new Set;#f=[];#o=!1;#r=null;#g=new Set;#p="all";#n=[];setup(){return this.#i=this.getAttribute("mode")==="banner"?"banner":"panel",this.#i==="banner"?this.#v():this.#E()}teardown(){this.#r!=null&&(clearInterval(this.#r),this.#r=null)}async#v(){let t=this.getAttribute("persist");if(t||console.warn("[notification-wc] banner mode requires a persist attribute"),this.dataset.mode="banner",this.dataset.variant=this.getAttribute("variant")||"info",this.dataset.position=this.getAttribute("position")||"top",t){let i=Number(this.getAttribute("expires")??""),n=Number.isFinite(i)&&i>0?i*864e5:void 0,a=await h.get("notifications",t,n?{maxAge:n}:void 0);if(a&&a.dismissed){this.hidden=!0;return}}let e=this.querySelector('[value="dismiss"], [data-dismiss]');e&&(this.#w=e,this.listen(e,"click",this.#S))}#S=async t=>{t.preventDefault();let e=this.getAttribute("persist");e&&await h.set("notifications",e,{dismissed:!0}),this.dispatchEvent(new CustomEvent("notification-wc:dismiss",{bubbles:!0,composed:!0,detail:{id:e}})),this.hidden=!0};async#E(){if(this.dataset.mode="panel",await this.#k(),this.#A(),this.#$(),await this.#c(),this.#u(),this.listen(document,"click",this.#B),this.listen(document,"keydown",this.#L),this.listen(document,"page-watch:add",()=>this.#c()),this.listen(document,"page-watch:remove",()=>this.#c()),this.getAttribute("src")){await this.#y();let t=Number(this.getAttribute("poll"));Number.isFinite(t)&&t>0&&(this.#r=setInterval(()=>this.#y(),t))}}async#k(){let t=this.getAttribute("storage-key")||"notifications",e=await h.get(t,"read-ids");Array.isArray(e)&&(this.#s=new Set(e.filter(i=>typeof i=="string")))}async#b(){let t=this.getAttribute("storage-key")||"notifications";await h.set(t,"read-ids",Array.from(this.#s))}#A(){if(this.#e=this.querySelector(":scope > [data-trigger]"),this.#e){let t=this.#e.querySelector(".notification-badge");t||(t=document.createElement("span"),t.className="notification-badge",t.hidden=!0,this.#e.appendChild(t))}else{let t=document.createElement("button");t.type="button",t.setAttribute("data-trigger",""),t.className="notification-trigger",t.setAttribute("aria-label","Notifications"),t.innerHTML='<icon-wc name="bell" size="sm"></icon-wc><span class="notification-badge" hidden>0</span>',this.#e=t,this.prepend(t)}this.#a=this.#e.querySelector(".notification-badge"),this.#e.setAttribute("aria-haspopup","dialog"),this.#e.setAttribute("aria-expanded","false"),this.listen(this.#e,"click",this.#N)}#$(){this.#t=document.createElement("div"),this.#t.className="notification-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label","Notifications"),this.#t.hidden=!0;let t=`notification-panel-${crypto.randomUUID().slice(0,8)}`;this.#t.id=t,this.#e?.setAttribute("aria-controls",t),this.#t.innerHTML=`
2
2
  <header class="notification-header">
3
3
  <strong>Notifications</strong>
4
4
  <button type="button" class="notification-mark-all">Mark all read</button>
@@ -12,7 +12,7 @@ var B=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;functi
12
12
  <footer class="notification-footer" hidden>
13
13
  <em>No notifications</em>
14
14
  </footer>
15
- `,this.appendChild(this.#t);let e=this.#t.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#R);for(let i of this.#t.querySelectorAll('[role="tab"]'))this.listen(i,"click",this.#C);this.#d()}#l(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let i of t){let n=i.getAttribute("data-id")||i.id||`static-${e.size}`,a=i.getAttribute("data-type")||"update",r=i.getAttribute("data-date")||"",l=i.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,p=i.querySelector("p")?.textContent?.trim()||"",f=i.querySelector("a");e.set(n,{id:n,type:a,date:r,title:l,body:p,url:f?.getAttribute("href")||null,source:"static"})}for(let i of this.#f)if(!(!i||typeof i.id!="string")){if(i.dismissed){e.delete(i.id);continue}e.set(i.id,{...e.get(i.id),...i,source:"dynamic"})}return Array.from(e.values()).sort((i,n)=>{let a=i.date?Date.parse(i.date):0;return(n.date?Date.parse(n.date):0)-a})}#d(){if(!this.#t)return;let t=this.#t.querySelector(".notification-list"),e=this.#t.querySelector(".notification-footer");if(!t)return;let i=this.#l();t.innerHTML=i.map(n=>this.#T(n)).join(""),e&&(e.hidden=i.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#M);this.#u()}#T(t){let e=N[t.type]||"bell",i=this.#s.has(t.id),n=t.date?new Date(t.date).toLocaleString():"",a=`
15
+ `,this.appendChild(this.#t);let e=this.#t.querySelector(".notification-mark-all");e&&this.listen(e,"click",this.#R);for(let i of this.#t.querySelectorAll('[role="tab"]'))this.listen(i,"click",this.#q);this.#d()}#l(){let t=Array.from(this.querySelectorAll(":scope > article")),e=new Map;for(let i of t){let n=i.getAttribute("data-id")||i.id||`static-${e.size}`,a=i.getAttribute("data-type")||"update",r=i.getAttribute("data-date")||"",l=i.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim()||n,p=i.querySelector("p")?.textContent?.trim()||"",f=i.querySelector("a");e.set(n,{id:n,type:a,date:r,title:l,body:p,url:f?.getAttribute("href")||null,source:"static"})}for(let i of this.#f)if(!(!i||typeof i.id!="string")){if(i.dismissed){e.delete(i.id);continue}e.set(i.id,{...e.get(i.id),...i,source:"dynamic"})}return Array.from(e.values()).sort((i,n)=>{let a=i.date?Date.parse(i.date):0;return(n.date?Date.parse(n.date):0)-a})}#d(){if(!this.#t)return;let t=this.#t.querySelector(".notification-list"),e=this.#t.querySelector(".notification-footer");if(!t)return;let i=this.#l();t.innerHTML=i.map(n=>this.#C(n)).join(""),e&&(e.hidden=i.length>0);for(let n of t.querySelectorAll("[data-notification-id]"))this.listen(n,"click",this.#M);this.#u()}#C(t){let e=N[t.type]||"bell",i=this.#s.has(t.id),n=t.date?new Date(t.date).toLocaleString():"",a=`
16
16
  <icon-wc class="notification-type-icon" name="${c(e)}" size="sm"></icon-wc>
17
17
  <div class="notification-body">
18
18
  <h4>${c(t.title)}</h4>
@@ -21,7 +21,7 @@ var B=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;functi
21
21
  </div>
22
22
  `,r=t.url?"a":"button",l=t.url?`href="${c(t.url)}"`:'type="button"';return`<li role="listitem" data-notification-id="${c(t.id)}" data-type="${c(t.type||"update")}"${i?" data-read":""}>
23
23
  <${r} class="notification-row" ${l}>${a}</${r}>
24
- </li>`}#u(){if(!this.#a)return;let e=this.#l().filter(i=>!this.#s.has(i.id)).length;e>0?(this.#a.textContent=String(e),this.#a.hidden=!1,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell-dot")):(this.#a.hidden=!0,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell"))}async#c(){try{this.#n=await h.list("watches")}catch{this.#n=[]}this.#y()}#y(){if(!this.#t)return;let t=this.#t.querySelector(".notification-watch-list"),e=this.#t.querySelector(".notification-tab-count");if(t){if(t.innerHTML=this.#n.map(i=>this.#q(i)).join("")||`<li class="notification-empty"><em>You aren't watching any pages yet. Use the &ldquo;Watch&rdquo; button on a page to start.</em></li>`,e){let i=this.#n.length;i>0?(e.textContent=String(i),e.hidden=!1):e.hidden=!0}for(let i of t.querySelectorAll("[data-watch-unwatch]"))this.listen(i,"click",this.#x)}}#q(t){let e=t.data||{},i=e.url||t.key,n=e.title||i,a=e.lastChecked?new Date(e.lastChecked).toLocaleString():"\u2014",r=!!e.lastChanged;return`<li class="notification-watch-item"${r?" data-changed":""}>
24
+ </li>`}#u(){if(!this.#a)return;let e=this.#l().filter(i=>!this.#s.has(i.id)).length;e>0?(this.#a.textContent=String(e),this.#a.hidden=!1,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell-dot")):(this.#a.hidden=!0,this.#e?.querySelector("icon-wc")?.setAttribute("name","bell"))}async#c(){try{this.#n=await h.list("watches")}catch{this.#n=[]}this.#m()}#m(){if(!this.#t)return;let t=this.#t.querySelector(".notification-watch-list"),e=this.#t.querySelector(".notification-tab-count");if(t){if(t.innerHTML=this.#n.map(i=>this.#T(i)).join("")||`<li class="notification-empty"><em>You aren't watching any pages yet. Use the &ldquo;Watch&rdquo; button on a page to start.</em></li>`,e){let i=this.#n.length;i>0?(e.textContent=String(i),e.hidden=!1):e.hidden=!0}for(let i of t.querySelectorAll("[data-watch-unwatch]"))this.listen(i,"click",this.#x)}}#T(t){let e=t.data||{},i=e.url||t.key,n=e.title||i,a=e.lastChecked?new Date(e.lastChecked).toLocaleString():"\u2014",r=!!e.lastChanged;return`<li class="notification-watch-item"${r?" data-changed":""}>
25
25
  <a class="notification-watch-row" href="${c(i)}">
26
26
  <icon-wc class="notification-type-icon" name="eye" size="sm"></icon-wc>
27
27
  <div class="notification-body">
@@ -33,5 +33,5 @@ var B=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;functi
33
33
  <button type="button" class="notification-unwatch" data-watch-unwatch data-watch-key="${c(t.key)}" aria-label="Unwatch ${c(n)}">
34
34
  <icon-wc name="x" size="xs"></icon-wc>
35
35
  </button>
36
- </li>`}#C=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#p||(this.#p=e,!this.#t))return;for(let n of this.#t.querySelectorAll('[role="tab"]')){let a=n.dataset.tab===e;n.setAttribute("aria-selected",a?"true":"false")}for(let n of this.#t.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let i=this.#t.querySelector(".notification-footer");i&&(i.hidden=!0)};#x=async t=>{t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getAttribute("data-watch-key");if(!i)return;let n=this.#n.find(a=>a.key===i);await h.remove("watches",i),this.#n=this.#n.filter(a=>a.key!==i),this.#y(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||i,subscriptionId:n?.data?.subscriptionId||null}}))};#N=t=>{t.stopPropagation(),this.#o?this.#h():this.#I()};#B=t=>{this.#o&&!this.contains(t.target)&&this.#h()};#L=t=>{t.key==="Escape"&&this.#o&&(t.preventDefault(),this.#h(),this.#e?.focus())};#M=async t=>{let e=t.currentTarget.closest("[data-notification-id]");if(!e)return;let i=e.getAttribute("data-notification-id");i&&(this.#s.has(i)||(this.#s.add(i),e.setAttribute("data-read",""),await this.#b(),this.#u(),this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:i}}))))};#R=async()=>{let t=this.#l();for(let e of t)this.#s.add(e.id);await this.#b(),this.#d();for(let e of t)this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:e.id}}))};#I(){this.#t&&(this.#o=!0,this.#t.hidden=!1,this.#e?.setAttribute("aria-expanded","true"),this.#c(),this.dispatchEvent(new CustomEvent("notification-wc:open",{bubbles:!0,composed:!0})))}#h(){this.#t&&(this.#o=!1,this.#t.hidden=!0,this.#e?.setAttribute("aria-expanded","false"),this.dispatchEvent(new CustomEvent("notification-wc:close",{bubbles:!0,composed:!0})))}async#m(){let t=this.getAttribute("src");if(!t)return;let e,i=0;try{if(t.startsWith("http")||t.startsWith("/")){let o=await fetch(t,{headers:{accept:"application/json"}});if(i=o.status,!o.ok)throw new Error(`${o.status}`);e=await o.json()}else e=await new w(t).get("/")}catch(o){let p=o instanceof b?o.status:i;if(p===404||p===503)return;let f=o instanceof b?`${o.status}`:String(o);console.warn("[notification-wc] failed to fetch",t,f);return}let n=Array.isArray(e)?e:Array.isArray(e?.notifications)?e.notifications:[],a=this.#g,r=a.size===0,l=this.hasAttribute("toast-new")?document.querySelector("toast-msg"):null;for(let o of n)o?.id&&(a.has(o.id)||(this.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:o}})),!r&&l&&typeof l.show=="function"&&l.show({message:o.title||o.body||"New notification",variant:o.type==="alert"||o.type==="stewardship"?"warning":"info",duration:5e3})),a.add(o.id));this.#f=n,this.#d()}};E("notification-wc",v);export{v as NotificationWc};
36
+ </li>`}#q=t=>{let e=t.currentTarget.dataset.tab;if(!e||e===this.#p||(this.#p=e,!this.#t))return;for(let n of this.#t.querySelectorAll('[role="tab"]')){let a=n.dataset.tab===e;n.setAttribute("aria-selected",a?"true":"false")}for(let n of this.#t.querySelectorAll("[data-tab-panel]"))n.hidden=n.dataset.tabPanel!==e;let i=this.#t.querySelector(".notification-footer");i&&(i.hidden=!0)};#x=async t=>{t.preventDefault(),t.stopPropagation();let i=t.currentTarget.getAttribute("data-watch-key");if(!i)return;let n=this.#n.find(a=>a.key===i);await h.remove("watches",i),this.#n=this.#n.filter(a=>a.key!==i),this.#m(),this.dispatchEvent(new CustomEvent("page-watch:remove",{bubbles:!0,composed:!0,detail:{url:n?.data?.url||i,subscriptionId:n?.data?.subscriptionId||null}}))};#N=t=>{t.stopPropagation(),this.#o?this.#h():this.#I()};#B=t=>{this.#o&&!this.contains(t.target)&&this.#h()};#L=t=>{t.key==="Escape"&&this.#o&&(t.preventDefault(),this.#h(),this.#e?.focus())};#M=async t=>{let e=t.currentTarget.closest("[data-notification-id]");if(!e)return;let i=e.getAttribute("data-notification-id");i&&(this.#s.has(i)||(this.#s.add(i),e.setAttribute("data-read",""),await this.#b(),this.#u(),this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:i}}))))};#R=async()=>{let t=this.#l();for(let e of t)this.#s.add(e.id);await this.#b(),this.#d();for(let e of t)this.dispatchEvent(new CustomEvent("notification-wc:read",{bubbles:!0,composed:!0,detail:{id:e.id}}))};#I(){this.#t&&(this.#o=!0,this.#t.hidden=!1,this.#e?.setAttribute("aria-expanded","true"),this.#c(),this.dispatchEvent(new CustomEvent("notification-wc:open",{bubbles:!0,composed:!0})))}#h(){this.#t&&(this.#o=!1,this.#t.hidden=!0,this.#e?.setAttribute("aria-expanded","false"),this.dispatchEvent(new CustomEvent("notification-wc:close",{bubbles:!0,composed:!0})))}async#y(){let t=this.getAttribute("src");if(!t)return;let e,i=0;try{if(t.startsWith("http")||t.startsWith("/")){let o=await fetch(t,{headers:{accept:"application/json"}});if(i=o.status,!o.ok)throw new Error(`${o.status}`);e=await o.json()}else e=await new w(t).get("/")}catch(o){let p=o instanceof b?o.status:i;if(p===404||p===503)return;let f=o instanceof b?`${o.status}`:String(o);console.warn("[notification-wc] failed to fetch",t,f);return}let n=Array.isArray(e)?e:Array.isArray(e?.notifications)?e.notifications:[],a=this.#g,r=a.size===0,l=this.hasAttribute("toast-new")?document.querySelector("toast-msg"):null;for(let o of n)o?.id&&(a.has(o.id)||(this.dispatchEvent(new CustomEvent("notification-wc:new",{bubbles:!0,composed:!0,detail:{notification:o}})),!r&&l&&typeof l.show=="function"&&l.show({message:o.title||o.body||"New notification",variant:o.type==="alert"||o.type==="stewardship"?"warning":"info",duration:5e3})),a.add(o.id));this.#f=n,this.#d()}};k("notification-wc",v);export{v as NotificationWc};
37
37
  //# sourceMappingURL=notification-wc.js.map
@@ -1,10 +1,10 @@
1
- var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;function x(t,e,r={}){let i=r.priority??10,o={impl:e,bundle:r.bundle,contract:r.contract,priority:i},n=M.get(t);if(customElements.get(t)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}M.set(t,o),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,r,i,o){e.addEventListener(r,i,o),this.#t.push(()=>e.removeEventListener(r,i,o))}setup(){}teardown(){}};var B="https://vanilla-breeze.com/specs/canonical-document-v1",F=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT","NAV","ASIDE","HEADER","FOOTER","FIGCAPTION","PAGE-INFO","CHANGE-SET","PAGE-TOC","PAGE-TOOLS","PAGE-STATS","CONTENT-LENS","BUTTON","DIALOG","MENU","FORM","DEL"]),U=new Set(["ARTICLE","SECTION","ASIDE","NAV","HEADER","FOOTER","DIV","MAIN","HGROUP","H1","H2","H3","H4","H5","H6","P","BLOCKQUOTE","PRE","HR","OL","UL","LI","DL","DT","DD","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","CAPTION","FIGURE","DETAILS","SUMMARY","ADDRESS","FORM","FIELDSET","LEGEND"]),V=new Set(["PRE","TEXTAREA"]);function _(t){return!t||t.nodeType!==1?!1:!!(F.has(t.tagName)||t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true"||t.getAttribute("data-signable")==="false")}function D(t,e,r){if(_(t))return;let i=U.has(t.tagName),o=r||V.has(t.tagName);for(let n of t.childNodes)if(n.nodeType===3){let s=n.nodeValue||"";if(!s)continue;if(o)N(e,s.normalize("NFC"));else{let a=s.normalize("NFC").replace(/\s+/g," ");if(a===""||a===" "&&(e.text===""||e.text.endsWith(" ")||e.text.endsWith(`
2
- `)))continue;N(e,a)}}else if(n.nodeType===1){if(n.tagName==="BR"){w(e,`
3
- `);continue}D(n,e,o)}i&&w(e,`
1
+ var J=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;function N(t,e,n={}){let i=n.priority??10,o={impl:e,bundle:n.bundle,contract:n.contract,priority:i},r=M.get(t);if(customElements.get(t)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${r.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}M.set(t,o),customElements.define(t,e)}var y=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,i,o){e.addEventListener(n,i,o),this.#t.push(()=>e.removeEventListener(n,i,o))}setup(){}teardown(){}};var B="https://vanilla-breeze.com/specs/canonical-document-v1",F=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT","NAV","ASIDE","HEADER","FOOTER","FIGCAPTION","PAGE-INFO","CHANGE-SET","PAGE-TOC","PAGE-TOOLS","PAGE-STATS","CONTENT-LENS","BUTTON","DIALOG","MENU","FORM","DEL"]),U=new Set(["ARTICLE","SECTION","ASIDE","NAV","HEADER","FOOTER","DIV","MAIN","HGROUP","H1","H2","H3","H4","H5","H6","P","BLOCKQUOTE","PRE","HR","OL","UL","LI","DL","DT","DD","TABLE","THEAD","TBODY","TFOOT","TR","TD","TH","CAPTION","FIGURE","DETAILS","SUMMARY","ADDRESS","FORM","FIELDSET","LEGEND"]),V=new Set(["PRE","TEXTAREA"]);function _(t){return!t||t.nodeType!==1?!1:!!(F.has(t.tagName)||t.hasAttribute("hidden")||t.getAttribute("aria-hidden")==="true"||t.getAttribute("data-signable")==="false")}function D(t,e,n){if(_(t))return;let i=U.has(t.tagName),o=n||V.has(t.tagName);for(let r of t.childNodes)if(r.nodeType===3){let s=r.nodeValue||"";if(!s)continue;if(o)x(e,s.normalize("NFC"));else{let a=s.normalize("NFC").replace(/\s+/g," ");if(a===""||a===" "&&(e.text===""||e.text.endsWith(" ")||e.text.endsWith(`
2
+ `)))continue;x(e,a)}}else if(r.nodeType===1){if(r.tagName==="BR"){w(e,`
3
+ `);continue}D(r,e,o)}i&&w(e,`
4
4
 
5
5
  `),t.tagName==="HR"&&w(e,`
6
6
 
7
- `)}function N(t,e){t.text+=e}function w(t,e){if(!t.text.endsWith(e)){if(e===`
7
+ `)}function x(t,e){t.text+=e}function w(t,e){if(!t.text.endsWith(e)){if(e===`
8
8
 
9
9
  `&&t.text.endsWith(`
10
10
  `)){t.text=t.text.replace(/\n+$/,"")+`
@@ -12,12 +12,12 @@ var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;functi
12
12
  `;return}e===`
13
13
  `&&t.text.endsWith(`
14
14
 
15
- `)||(t.text+=e)}}function G(t){let e=[...t.querySelectorAll("[data-signable]")],r=e.filter(o=>!e.some(n=>n!==o&&n.contains(o))),i={text:""};for(let o of r)D(o,i,!1);return i.text.replace(/^\s+/,"").replace(/\s+$/,"")}function u(t,e){return t.querySelector(`meta[name="${$(e)}"]`)?.getAttribute("content")||""}function E(t,e){return t.querySelector(`meta[property="${$(e)}"]`)?.getAttribute("content")||""}function z(t,e){return t.querySelector(`meta[itemprop="${$(e)}"]`)?.getAttribute("content")||""}function R(t,e){return t.querySelector(`link[rel="${$(e)}"]`)?.getAttribute("href")||""}function $(t){return String(t).replace(/[^a-zA-Z0-9:_\-/]/g,"")}function j(t){if(!t)return"";try{let e=new URL(t);e.search="",e.hash="";let r=`${e.protocol}//${e.hostname.toLowerCase()}`;return e.port&&(r+=`:${e.port}`),r+=e.pathname,r}catch{return t}}function O(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:""}function K(t){return E(t,"og:title")||t.title||""}function W(t){let e=u(t,"keywords");return e?e.split(",").map(r=>r.trim()).filter(Boolean):[]}function X(t){return R(t,"license")||u(t,"license")}function H(t,e={}){let r=e.url??t?.location?.href??"",i=O(E(t,"article:published_time")),o=O(u(t,"last-modified")||E(t,"article:modified_time"));return{"@context":B,"@version":1,url:j(r),title:K(t),author:u(t,"author"),authorUrl:E(t,"article:author")||R(t,"author"),published:i,modified:o,version:z(t,"version"),keywords:W(t),topic:u(t,"vb:topic"),provenance:u(t,"vb:provenance"),review:u(t,"vb:review"),status:u(t,"vb:status"),license:X(t),content:G(t)}}function P(t){return JSON.stringify(t)}var C=class t extends y{setup(){this.hasAttribute("auto")&&this.#l(),this.#t(),this.#r(),this.#i(),this.#o()}#t(){for(let e of this.querySelectorAll("time[data-relative]")){let r=e.getAttribute("datetime");if(!r)continue;let i=t.#n(new Date(r));i&&(e.textContent=i)}}static#n(e){let i=Date.now()-e.getTime();if(i<0)return null;let o=Math.floor(i/1e3),n=Math.floor(o/60),s=Math.floor(n/60),a=Math.floor(s/24);return a>365?`${Math.floor(a/365)} year${Math.floor(a/365)!==1?"s":""} ago`:a>30?`${Math.floor(a/30)} month${Math.floor(a/30)!==1?"s":""} ago`:a>0?`${a} day${a!==1?"s":""} ago`:s>0?`${s} hour${s!==1?"s":""} ago`:n>0?`${n} minute${n!==1?"s":""} ago`:"just now"}#r(){let e=this.querySelector("[data-reading-time]");if(!e)return;let r=document.querySelectorAll("[data-signable]");if(!r.length)return;let i=0;for(let n of r){let s=n.textContent?.trim()||"";i+=s.split(/\s+/).filter(Boolean).length}let o=Math.max(1,Math.ceil(i/200));e.textContent=`~${o} min`}#i(){let e=!!document.querySelector('meta[name="vb:provenance"], meta[name="author"]'),r=e?"declared":"undeclared",i=this.querySelector(".page-info-badge");i&&i.setAttribute("data-trust",r),this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:r,tier:e?1:0},bubbles:!0}))}async#o(){let r=document.querySelector('meta[name="vb:signature"]')?.content;if(!r)return;let i=document.querySelector('meta[name="vb:signature-algorithm"]')?.content;if(i&&i!=="ECDSA-P256-SHA256"){this.#e("failed",{reason:`unsupported-algorithm:${i}`});return}let o=document.querySelector('link[rel="author-key"]')?.getAttribute("href");if(!o){this.#e("failed",{reason:"missing-author-key"});return}let n;try{let c=new URL(o,document.baseURI),l=await fetch(c,{credentials:"omit"});if(!l.ok)throw new Error(`status ${l.status}`);let d=await l.json(),h={kty:d.kty,crv:d.crv,x:d.x,y:d.y,use:d.use||"sig",key_ops:["verify"]};n=await crypto.subtle.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch(c){this.#e("key-unavailable",{reason:c.message});return}let s;try{let c=document.querySelector('link[rel="canonical"]')?.href||document.location.href;s=P(H(document,{url:c}))}catch(c){this.#e("failed",{reason:`canonicalize:${c.message}`});return}let a;try{let c=new TextEncoder().encode(s),l=Uint8Array.from(atob(r),d=>d.charCodeAt(0));a=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},n,l,c)}catch(c){this.#e("failed",{reason:`verify:${c.message}`});return}this.#e(a?"verified":"failed",{reason:a?"ok":"mismatch"})}#e(e,r={}){let o={undeclared:0,declared:1,"domain-anchored":2,verified:3,failed:-1,"key-unavailable":-2}[e]??0,n=this.querySelector(".page-info-badge");if(n){n.setAttribute("data-trust",e);let s=n.getAttribute("aria-label")||"";e==="verified"&&!s.includes("verified")?n.setAttribute("aria-label",`${s} \u2014 verified`.trim()):e==="failed"?n.setAttribute("aria-label",`${s} \u2014 verification failed`.trim()):e==="key-unavailable"&&n.setAttribute("aria-label",`${s} \u2014 author key unavailable`.trim())}this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:e,tier:o,...r},bubbles:!0}))}static#a={human:"Human written","ai-assisted":"Human-written, AI-assisted","ai-generated":"AI-generated",translated:"Translated",synthesized:"Synthesized from sources",migrated:"Migrated content"};static#s={unreviewed:"Unreviewed","fact-checked":"Fact-checked","editor-reviewed":"Editor-reviewed"};static#c={draft:"Draft",published:"Published",archived:"Archived"};static#d(e){if(!e)return"";let r=String(e).trim().split(/\s+/).filter(Boolean);return r.length?r.map(o=>t.#a[o]||o).join(" \xB7 "):""}#l(){let e=f=>document.querySelector(`meta[name="${f}"]`)?.content,r=f=>document.querySelector(`meta[property="${f}"]`)?.content,i=f=>document.querySelector(`meta[itemprop="${f}"]`)?.content,o=f=>document.querySelector(`link[rel="${f}"]`)?.href,n=e("author"),s=r("article:author")||o("author"),a=e("last-modified")||r("article:modified_time"),c=r("article:published_time"),l=e("keywords"),d=e("license"),h=o("license"),p=i("version"),b=e("vb:provenance"),v=e("vb:review"),m=e("vb:status"),S=e("vb:ai-tools"),A=e("vb:topic"),L=e("vb:version-url"),g=t.#d(b),k=t.#s[v]||v||"",T=t.#c[m]||m||"",q=b||S||v||d,I=a||c||p;this.innerHTML=`
15
+ `)||(t.text+=e)}}function G(t){let e=[...t.querySelectorAll("[data-signable]")],n=e.filter(o=>!e.some(r=>r!==o&&r.contains(o))),i={text:""};for(let o of n)D(o,i,!1);return i.text.replace(/^\s+/,"").replace(/\s+$/,"")}function f(t,e){return t.querySelector(`meta[name="${$(e)}"]`)?.getAttribute("content")||""}function E(t,e){return t.querySelector(`meta[property="${$(e)}"]`)?.getAttribute("content")||""}function z(t,e){return t.querySelector(`meta[itemprop="${$(e)}"]`)?.getAttribute("content")||""}function R(t,e){return t.querySelector(`link[rel="${$(e)}"]`)?.getAttribute("href")||""}function $(t){return String(t).replace(/[^a-zA-Z0-9:_\-/]/g,"")}function j(t){if(!t)return"";try{let e=new URL(t);e.search="",e.hash="";let n=`${e.protocol}//${e.hostname.toLowerCase()}`;return e.port&&(n+=`:${e.port}`),n+=e.pathname,n}catch{return t}}function O(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:""}function K(t){return E(t,"og:title")||t.title||""}function W(t){let e=f(t,"keywords");return e?e.split(",").map(n=>n.trim()).filter(Boolean):[]}function X(t){let e=new Set;for(let n of t.querySelectorAll('meta[name="concept"]')){let i=(n.getAttribute("content")||"").trim();i&&e.add(i)}return[...e].sort()}function Y(t){return R(t,"license")||f(t,"license")}function H(t,e={}){let n=e.url??t?.location?.href??"",i=O(E(t,"article:published_time")),o=O(f(t,"last-modified")||E(t,"article:modified_time"));return{"@context":B,"@version":1,url:j(n),title:K(t),author:f(t,"author"),authorUrl:E(t,"article:author")||R(t,"author"),published:i,modified:o,version:z(t,"version"),keywords:W(t),concepts:X(t),provenance:f(t,"vb:provenance"),review:f(t,"vb:review"),status:f(t,"vb:status"),license:Y(t),content:G(t)}}function q(t){return JSON.stringify(t)}var C=class t extends y{setup(){this.hasAttribute("auto")&&this.#l(),this.#t(),this.#r(),this.#i(),this.#o()}#t(){for(let e of this.querySelectorAll("time[data-relative]")){let n=e.getAttribute("datetime");if(!n)continue;let i=t.#n(new Date(n));i&&(e.textContent=i)}}static#n(e){let i=Date.now()-e.getTime();if(i<0)return null;let o=Math.floor(i/1e3),r=Math.floor(o/60),s=Math.floor(r/60),a=Math.floor(s/24);return a>365?`${Math.floor(a/365)} year${Math.floor(a/365)!==1?"s":""} ago`:a>30?`${Math.floor(a/30)} month${Math.floor(a/30)!==1?"s":""} ago`:a>0?`${a} day${a!==1?"s":""} ago`:s>0?`${s} hour${s!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}#r(){let e=this.querySelector("[data-reading-time]");if(!e)return;let n=document.querySelectorAll("[data-signable]");if(!n.length)return;let i=0;for(let r of n){let s=r.textContent?.trim()||"";i+=s.split(/\s+/).filter(Boolean).length}let o=Math.max(1,Math.ceil(i/200));e.textContent=`~${o} min`}#i(){let e=!!document.querySelector('meta[name="vb:provenance"], meta[name="author"]'),n=e?"declared":"undeclared",i=this.querySelector(".page-info-badge");i&&i.setAttribute("data-trust",n),this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:n,tier:e?1:0},bubbles:!0}))}async#o(){let n=document.querySelector('meta[name="vb:signature"]')?.content;if(!n)return;let i=document.querySelector('meta[name="vb:signature-algorithm"]')?.content;if(i&&i!=="ECDSA-P256-SHA256"){this.#e("failed",{reason:`unsupported-algorithm:${i}`});return}let o=document.querySelector('link[rel="author-key"]')?.getAttribute("href");if(!o){this.#e("failed",{reason:"missing-author-key"});return}let r;try{let c=new URL(o,document.baseURI),u=await fetch(c,{credentials:"omit"});if(!u.ok)throw new Error(`status ${u.status}`);let l=await u.json(),h={kty:l.kty,crv:l.crv,x:l.x,y:l.y,use:l.use||"sig",key_ops:["verify"]};r=await crypto.subtle.importKey("jwk",h,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])}catch(c){this.#e("key-unavailable",{reason:c.message});return}let s;try{let c=document.querySelector('link[rel="canonical"]')?.href||document.location.href;s=q(H(document,{url:c}))}catch(c){this.#e("failed",{reason:`canonicalize:${c.message}`});return}let a;try{let c=new TextEncoder().encode(s),u=Uint8Array.from(atob(n),l=>l.charCodeAt(0));a=await crypto.subtle.verify({name:"ECDSA",hash:"SHA-256"},r,u,c)}catch(c){this.#e("failed",{reason:`verify:${c.message}`});return}this.#e(a?"verified":"failed",{reason:a?"ok":"mismatch"})}#e(e,n={}){let o={undeclared:0,declared:1,"domain-anchored":2,verified:3,failed:-1,"key-unavailable":-2}[e]??0,r=this.querySelector(".page-info-badge");if(r){r.setAttribute("data-trust",e);let s=r.getAttribute("aria-label")||"";e==="verified"&&!s.includes("verified")?r.setAttribute("aria-label",`${s} \u2014 verified`.trim()):e==="failed"?r.setAttribute("aria-label",`${s} \u2014 verification failed`.trim()):e==="key-unavailable"&&r.setAttribute("aria-label",`${s} \u2014 author key unavailable`.trim())}this.dispatchEvent(new CustomEvent("page-info:verified",{detail:{status:e,tier:o,...n},bubbles:!0}))}static#a={human:"Human written","ai-assisted":"Human-written, AI-assisted","ai-generated":"AI-generated",translated:"Translated",synthesized:"Synthesized from sources",migrated:"Migrated content"};static#s={unreviewed:"Unreviewed","fact-checked":"Fact-checked","editor-reviewed":"Editor-reviewed"};static#c={draft:"Draft",published:"Published",archived:"Archived"};static#d(e){if(!e)return"";let n=String(e).trim().split(/\s+/).filter(Boolean);return n.length?n.map(o=>t.#a[o]||o).join(" \xB7 "):""}#l(){let e=d=>document.querySelector(`meta[name="${d}"]`)?.content,n=d=>document.querySelector(`meta[property="${d}"]`)?.content,i=d=>document.querySelector(`meta[itemprop="${d}"]`)?.content,o=d=>document.querySelector(`link[rel="${d}"]`)?.href,r=e("author"),s=n("article:author")||o("author"),a=e("last-modified")||n("article:modified_time"),c=n("article:published_time"),u=e("keywords"),l=e("license"),h=o("license"),p=i("version"),g=e("vb:provenance"),v=e("vb:review"),m=e("vb:status"),S=e("vb:ai-tools"),L=e("vb:version-url"),A=Array.from(document.querySelectorAll('meta[name="concept"]')).map(d=>d.getAttribute("content")?.trim()).filter(Boolean),b=t.#d(g),k=t.#s[v]||v||"",T=t.#c[m]||m||"",P=g||S||v||l,I=a||c||p;this.innerHTML=`
16
16
  <details>
17
17
  <summary>
18
- ${n?`
18
+ ${r?`
19
19
  <span class="page-info-author">
20
- ${s?`<a href="${s}" rel="author">${n}</a>`:n}
20
+ ${s?`<a href="${s}" rel="author">${r}</a>`:r}
21
21
  </span>
22
22
  <span class="page-info-sep" aria-hidden="true">&middot;</span>
23
23
  `:""}
@@ -25,12 +25,12 @@ var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;functi
25
25
  <time datetime="${a}" data-relative>${a}</time>
26
26
  <span class="page-info-sep" aria-hidden="true">&middot;</span>
27
27
  `:""}
28
- ${g?`
28
+ ${b?`
29
29
  <span class="page-info-badge"
30
- data-provenance="${b||""}"
30
+ data-provenance="${g||""}"
31
31
  data-trust="declared"
32
- aria-label="Content provenance: ${g}">
33
- ${g}
32
+ aria-label="Content provenance: ${b}">
33
+ ${b}
34
34
  </span>
35
35
  `:""}
36
36
  ${m&&m!=="published"?`
@@ -39,10 +39,10 @@ var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;functi
39
39
  `:""}
40
40
  </summary>
41
41
  <div class="page-info-panel">
42
- ${n?`
42
+ ${r?`
43
43
  <section>
44
44
  <h2 class="page-info-section-heading">Author</h2>
45
- <p>${s?`<a href="${s}" rel="author">${n}</a>`:n}</p>
45
+ <p>${s?`<a href="${s}" rel="author">${r}</a>`:r}</p>
46
46
  </section>
47
47
  `:""}
48
48
  ${I?`
@@ -55,28 +55,28 @@ var Y=window.matchMedia("(prefers-reduced-motion: reduce)");var M=new Map;functi
55
55
  </dl>
56
56
  </section>
57
57
  `:""}
58
- ${q?`
58
+ ${P?`
59
59
  <section>
60
60
  <h2 class="page-info-section-heading">How this was made</h2>
61
61
  <dl>
62
- ${b?`<dl-item><dt>Authorship</dt><dd>${g}</dd></dl-item>`:""}
62
+ ${g?`<dl-item><dt>Authorship</dt><dd>${b}</dd></dl-item>`:""}
63
63
  ${S?`<dl-item><dt>AI tools used</dt><dd>${S}</dd></dl-item>`:""}
64
64
  ${k?`<dl-item><dt>Review</dt><dd>${k}</dd></dl-item>`:""}
65
65
  ${T?`<dl-item><dt>Status</dt><dd>${T}</dd></dl-item>`:""}
66
- ${d?`<dl-item><dt>License</dt><dd>${h?`<a href="${h}" rel="license">${d}</a>`:d}</dd></dl-item>`:""}
66
+ ${l?`<dl-item><dt>License</dt><dd>${h?`<a href="${h}" rel="license">${l}</a>`:l}</dd></dl-item>`:""}
67
67
  </dl>
68
68
  </section>
69
69
  `:""}
70
- ${l||A?`
70
+ ${u||A.length?`
71
71
  <section>
72
72
  <h2 class="page-info-section-heading">Topic</h2>
73
73
  <dl>
74
- ${A?`<dl-item><dt>Subject</dt><dd>${A}</dd></dl-item>`:""}
75
- ${l?`<dl-item><dt>Keywords</dt><dd>${l}</dd></dl-item>`:""}
74
+ ${A.length?`<dl-item><dt>Concepts</dt><dd>${A.map(d=>`<a href="/topics/${d}/" rel="tag" data-concept="${d}">${d}</a>`).join(", ")}</dd></dl-item>`:""}
75
+ ${u?`<dl-item><dt>Keywords</dt><dd>${u}</dd></dl-item>`:""}
76
76
  </dl>
77
77
  </section>
78
78
  `:""}
79
79
  </div>
80
80
  </details>
81
- `}};x("page-info",C);export{C as PageInfo};
81
+ `}};N("page-info",C);export{C as PageInfo};
82
82
  //# sourceMappingURL=page-info.js.map
@@ -1,2 +1,2 @@
1
- var b=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function h(i,n,t={}){let o=t.priority??10,r={impl:n,bundle:t.bundle,contract:t.contract,priority:o},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=o){e&&e.priority===o&&e.impl!==n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=o){e.priority===o&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,n)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let n of this.#e)n();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,t,o,r){n.addEventListener(t,o,r),this.#e.push(()=>n.removeEventListener(t,o,r))}setup(){}teardown(){}};var l=class i extends c{setup(){if(this.querySelector("dl"))return;let n=this.dataset.for;if(!n)return;let t=document.getElementById(n);if(!t)return;let o=parseInt(this.dataset.wpm,10)||238,r=(this.dataset.show||"reading-time").split(",").map(a=>a.trim()),u=(t.textContent?.trim()||"").split(/\s+/).filter(Boolean).length,f=Math.max(1,Math.ceil(u/o)),d=document.createElement("dl");if(d.className="page-stats-list",r.includes("reading-time")&&d.appendChild(this.#e("Reading time",`<time datetime="PT${f}M">${f} min read</time>`)),r.includes("word-count")&&d.appendChild(this.#e("Word count",`${u.toLocaleString()} words`)),r.includes("last-modified")){let a=this.#t();if(a){let p=a.toISOString().split("T")[0],y=i.#n(a);d.appendChild(this.#e("Last updated",`<time datetime="${p}" data-relative>${y}</time>`))}}this.appendChild(d)}#e(n,t){let o=document.createElement("dl-item"),r=document.createElement("dt");r.className="sr-only",r.textContent=n;let e=document.createElement("dd");return e.innerHTML=t,o.appendChild(r),o.appendChild(e),o}#t(){let n=document.querySelector('meta[name="last-modified"]');if(n?.content){let o=new Date(n.content);if(!isNaN(o))return o}let t=new Date(document.lastModified);return isNaN(t)?null:t}static#n(n){let t=Date.now()-n.getTime();if(t<0)return n.toLocaleDateString();let o=Math.floor(t/1e3),r=Math.floor(o/60),e=Math.floor(r/60),s=Math.floor(e/24);return s>365?`${Math.floor(s/365)} year${Math.floor(s/365)!==1?"s":""} ago`:s>30?`${Math.floor(s/30)} month${Math.floor(s/30)!==1?"s":""} ago`:s>0?`${s} day${s!==1?"s":""} ago`:e>0?`${e} hour${e!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}};h("page-stats",l);export{l as PageStats};
1
+ var y=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function h(i,n,t={}){let o=t.priority??10,r={impl:n,bundle:t.bundle,contract:t.contract,priority:o},e=m.get(i);if(customElements.get(i)){if(!e||e.priority>=o){e&&e.priority===o&&e.impl!==n&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}" (priority ${e.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${e.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(e&&e.priority>=o){e.priority===o&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${e.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}m.set(i,r),customElements.define(i,n)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let n of this.#e)n();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(n,t,o,r){n.addEventListener(t,o,r),this.#e.push(()=>n.removeEventListener(t,o,r))}setup(){}teardown(){}};var l=class i extends c{setup(){if(this.querySelector("dl"))return;let n=this.dataset.for;if(!n)return;let t=document.getElementById(n);if(!t)return;let o=parseInt(this.dataset.wpm,10)||238,r=(this.dataset.show||"reading-time").split(",").map(a=>a.trim()),u=(t.textContent?.trim()||"").split(/\s+/).filter(Boolean).length,f=Math.max(1,Math.ceil(u/o)),d=document.createElement("dl");if(d.className="page-stats-list",r.includes("reading-time")&&d.appendChild(this.#e("Reading time",`<time datetime="PT${f}M">${f} min read</time>`)),r.includes("word-count")&&d.appendChild(this.#e("Word count",`${u.toLocaleString()} words`)),r.includes("last-modified")){let a=this.#t();if(a){let p=a.toISOString().split("T")[0],b=i.#n(a);d.appendChild(this.#e("Last updated",`<time datetime="${p}" data-relative>${b}</time>`))}}this.appendChild(d)}#e(n,t){let o=document.createElement("dl-item"),r=document.createElement("dt");r.className="visually-hidden",r.textContent=n;let e=document.createElement("dd");return e.innerHTML=t,o.appendChild(r),o.appendChild(e),o}#t(){let n=document.querySelector('meta[name="last-modified"]');if(n?.content){let o=new Date(n.content);if(!isNaN(o))return o}let t=new Date(document.lastModified);return isNaN(t)?null:t}static#n(n){let t=Date.now()-n.getTime();if(t<0)return n.toLocaleDateString();let o=Math.floor(t/1e3),r=Math.floor(o/60),e=Math.floor(r/60),s=Math.floor(e/24);return s>365?`${Math.floor(s/365)} year${Math.floor(s/365)!==1?"s":""} ago`:s>30?`${Math.floor(s/30)} month${Math.floor(s/30)!==1?"s":""} ago`:s>0?`${s} day${s!==1?"s":""} ago`:e>0?`${e} hour${e!==1?"s":""} ago`:r>0?`${r} minute${r!==1?"s":""} ago`:"just now"}};h("page-stats",l);export{l as PageStats};
2
2
  //# sourceMappingURL=page-stats.js.map
@@ -1,2 +1,2 @@
1
- var w=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function y(c,e,t={}){let i=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:i},n=g.get(c);if(customElements.get(c)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}g.set(c,s),customElements.define(c,e)}var f=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,s){e.addEventListener(t,i,s),this.#t.push(()=>e.removeEventListener(t,i,s))}setup(){}teardown(){}};var p=class extends f{#t;#i=[];#n=new Map;#c;#e;#r;#o=!1;setup(){requestAnimationFrame(()=>this.#a())}teardown(){this.#t?.disconnect(),clearTimeout(this.#r)}#a(){this.#o=this.#h(),this.#o?this.#u():this.#y(),this.#w(),this.#f(),this.#b()}#h(){return this.querySelector("nav, details")!==null}#u(){this.#e=this.querySelector("details");let e=this.querySelectorAll('a[href^="#"]');for(let t of e){let i=t.getAttribute("href");if(!i)continue;let s=i.slice(1);if(s){let n=document.getElementById(s);n&&(this.#i.push(n),this.#n.set(s,t),t.classList.contains("link")||t.classList.add("link"),t.addEventListener("click",a=>{a.preventDefault(),this.#d(n)}))}}}#f(){this.#c=window.matchMedia("(min-width: 64rem)"),this.listen(this.#c,"change",this.#m),this.listen(window,"resize",this.#p)}#m=e=>{e.matches&&this.#e&&(this.#e.open=!0)};#p=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#s(),150)};#b(){this.listen(window,"hashchange",this.#g),this.#s()}#g=()=>{this.#s()};#s(){let e=window.location.hash.slice(1);e&&this.#n.has(e)&&this.#l(e)}#l(e){for(let i of this.#n.values())i.classList.remove("active"),i.removeAttribute("aria-current");let t=this.#n.get(e);t&&(t.classList.add("active"),t.setAttribute("aria-current","true"))}#y(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(r=>r.trim().toLowerCase()),t=this.getAttribute("scope")||"main",i=this.getAttribute("title")||"On this page",s=document.querySelector(t);if(!s||(this.#i=Array.from(s.querySelectorAll(e.join(","))).filter(r=>r.id).filter(r=>!r.hasAttribute("data-toc-ignore")&&!r.closest("[data-toc-ignore]")),this.#i.length===0))return;let n={depth:-1,children:[]},a=[n];for(let r of this.#i){let l=e.indexOf(r.tagName.toLowerCase());for(;a[a.length-1].depth>=l;)a.pop();let o={heading:r,depth:l,children:[]};a[a.length-1].children.push(o),a.push(o)}let b=r=>{let l=document.createElement("ul");l.className="list";for(let o of r){let h=document.createElement("li");h.className="item",h.dataset.level=String(o.depth);let d=document.createElement("a");d.href=`#${o.heading.id}`,d.className="link",d.textContent=this.#v(o.heading),d.addEventListener("click",v=>{v.preventDefault(),this.#d(o.heading)}),h.appendChild(d),o.children.length&&h.appendChild(b(o.children)),l.appendChild(h),this.#n.set(o.heading.id,d)}return l};this.#e=document.createElement("details"),this.#e.className="details",this.#e.open=!0;let m=document.createElement("summary");m.className="summary",m.textContent=i,this.#e.appendChild(m);let u=document.createElement("nav");u.className="nav",u.setAttribute("aria-label",i),u.appendChild(b(n.children)),this.#e.appendChild(u),this.appendChild(this.#e)}#v(e){let t=e.cloneNode(!0);return t.querySelectorAll(".heading-anchor").forEach(s=>s.remove()),t.textContent.trim()}#d(e){let t=new URL(window.location.href);t.hash=e.id,window.history.pushState(null,"",t),e.scrollIntoView({behavior:"smooth",block:"start"}),e.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:e.id}}))}#w(){if(this.#i.length===0)return;let e=new Set;this.#t=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?e.add(i.target.id):e.delete(i.target.id);this.#E(e)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let t of this.#i)this.#t.observe(t)}#E(e){for(let t of this.#i)if(e.has(t.id)){this.#l(t.id);return}this.#s()}refresh(){this.#o||(this.innerHTML=""),this.#n.clear(),this.#i=[],this.#t?.disconnect(),this.#a()}};y("page-toc",p);export{p as PageToc};
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function y(a,e,t={}){let i=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:i},n=g.get(a);if(customElements.get(a)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}g.set(a,s),customElements.define(a,e)}var f=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,s){e.addEventListener(t,i,s),this.#t.push(()=>e.removeEventListener(t,i,s))}setup(){}teardown(){}};var p=class extends f{#t;#i=[];#n=new Map;#a;#e;#r;#o=!1;setup(){requestAnimationFrame(()=>this.#c())}teardown(){this.#t?.disconnect(),clearTimeout(this.#r)}#c(){this.#o=this.#h(),this.#o?this.#u():this.#y(),this.#w(),this.#f(),this.#b()}#h(){return this.querySelector("nav, details")!==null}#u(){this.#e=this.querySelector("details");let e=this.querySelectorAll('a[href^="#"]');for(let t of e){let i=t.getAttribute("href");if(!i)continue;let s=i.slice(1);if(s){let n=document.getElementById(s);n&&(this.#i.push(n),this.#n.set(s,t),t.classList.contains("link")||t.classList.add("link"),t.addEventListener("click",c=>{c.preventDefault(),this.#d(n)}))}}}#f(){this.#a=window.matchMedia("(min-width: 64rem)"),this.listen(this.#a,"change",this.#m),this.listen(window,"resize",this.#p)}#m=e=>{e.matches&&this.#e&&(this.#e.open=!0)};#p=()=>{clearTimeout(this.#r),this.#r=setTimeout(()=>this.#s(),150)};#b(){this.listen(window,"hashchange",this.#g),this.#s()}#g=()=>{this.#s()};#s(){let e=window.location.hash.slice(1);e&&this.#n.has(e)&&this.#l(e)}#l(e){for(let i of this.#n.values())i.classList.remove("active"),i.removeAttribute("aria-current");let t=this.#n.get(e);t&&(t.classList.add("active"),t.setAttribute("aria-current","true"))}#y(){let e=(this.getAttribute("levels")||"h2,h3").split(",").map(r=>r.trim().toLowerCase()),t=this.getAttribute("scope")||"main",i=this.getAttribute("title")||"On this page",s=document.querySelector(t);if(!s||(this.#i=Array.from(s.querySelectorAll(e.join(","))).filter(r=>r.id).filter(r=>!r.hasAttribute("data-toc-ignore")&&!r.closest("[data-toc-ignore]")),this.#i.length===0))return;let n={depth:-1,children:[]},c=[n];for(let r of this.#i){let l=e.indexOf(r.tagName.toLowerCase());for(;c[c.length-1].depth>=l;)c.pop();let o={heading:r,depth:l,children:[]};c[c.length-1].children.push(o),c.push(o)}let b=r=>{let l=document.createElement("ul");l.className="list";for(let o of r){let h=document.createElement("li");h.className="item",h.dataset.level=String(o.depth);let d=document.createElement("a");d.href=`#${o.heading.id}`,d.className="link",d.textContent=this.#v(o.heading),d.addEventListener("click",v=>{v.preventDefault(),this.#d(o.heading)}),h.appendChild(d),o.children.length&&h.appendChild(b(o.children)),l.appendChild(h),this.#n.set(o.heading.id,d)}return l};this.#e=document.createElement("details"),this.#e.className="details",this.#e.open=!0;let m=document.createElement("summary");m.className="summary",m.textContent=i,this.#e.appendChild(m);let u=document.createElement("nav");u.className="nav",u.setAttribute("aria-label",i),u.appendChild(b(n.children)),this.#e.appendChild(u),this.appendChild(this.#e)}#v(e){let t=e.cloneNode(!0);return t.querySelectorAll(".heading-anchor").forEach(s=>s.remove()),t.textContent.trim()}#d(e){let t=new URL(window.location.href);t.hash=e.id,window.history.pushState(null,"",t),e.scrollIntoView({behavior:"smooth",block:"start"}),e.focus(),this.dispatchEvent(new CustomEvent("page-toc:navigate",{bubbles:!0,detail:{id:e.id}}))}#w(){if(this.#i.length===0)return;let e=new Set;this.#t=new IntersectionObserver(t=>{for(let i of t)i.isIntersecting?e.add(i.target.id):e.delete(i.target.id);this.#E(e)},{rootMargin:"-80px 0px -70% 0px",threshold:0});for(let t of this.#i)this.#t.observe(t)}#E(e){for(let t of this.#i)if(e.has(t.id)){this.#l(t.id);return}this.#s()}refresh(){this.#o||(this.innerHTML=""),this.#n.clear(),this.#i=[],this.#t?.disconnect(),this.#c()}};y("page-toc",p);export{p as PageToc};
2
2
  //# sourceMappingURL=page-toc.js.map
@@ -1,2 +1,2 @@
1
- var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function c(o,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=l.get(o);if(customElements.get(o)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(o,n),customElements.define(o,t)}var r=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};var d=0,a=class extends r{#t=null;#e=null;#o=null;#i=!1;#s=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#a(),this.#l();let t=this.dataset.breakpoint||"48rem";this.#o=matchMedia(`(max-width: ${t})`),this.#n(this.#o),this.listen(this.#o,"change",e=>this.#n(e)),this.#s=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#i&&this.#d()}),this.#s.observe(this,{childList:!0})}teardown(){this.#s?.disconnect(),this.#s=null,this.#i&&this.#r(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#a(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#l(){let t=`pt-${++d}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",n=>{n.newState==="closed"&&this.#t.focus()})}#n(t){t.matches??t?this.#c():this.#r()}#c(){if(this.#i)return;this.#i=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#r(){if(!this.#i)return;this.#i=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#d(){let t=this.tools;for(let e of t)this.#e.appendChild(e)}};c("page-tools",a);export{a as PageTools};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function c(o,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=l.get(o);if(customElements.get(o)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(o,n),customElements.define(o,t)}var r=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,n){t.addEventListener(e,i,n),this.#t.push(()=>t.removeEventListener(e,i,n))}setup(){}teardown(){}};var d=0,a=class extends r{#t=null;#e=null;#o=null;#i=!1;#s=null;setup(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.getAttribute("aria-label")||this.setAttribute("aria-label","Page tools"),this.#a(),this.#l();let t=this.dataset.breakpoint||"48rem";this.#o=matchMedia(`(max-width: ${t})`),this.#n(this.#o),this.listen(this.#o,"change",e=>this.#n(e)),this.#s=new MutationObserver(e=>{for(let i of e)i.type==="childList"&&this.#i&&this.#d()}),this.#s.observe(this,{childList:!0})}teardown(){this.#s?.disconnect(),this.#s=null,this.#i&&this.#r(),this.#t?.remove(),this.#e?.remove(),this.#t=null,this.#e=null}get tools(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-page-tools-internal"))}#a(){if((this.dataset.orientation||"auto")!=="auto")return;let i=(this.dataset.position||"sticky")==="inline"?"horizontal":"vertical";this.dataset.resolvedOrientation=i}#l(){let t=`pt-${++d}`,e=this.dataset.fabIcon||"ellipsis-vertical",i=this.dataset.fabLabel||"Page tools";this.#t=document.createElement("button"),this.#t.className="page-tools-fab",this.#t.setAttribute("data-page-tools-internal",""),this.#t.setAttribute("popovertarget",t),this.#t.setAttribute("aria-label",i),this.#t.hidden=!0,this.#t.innerHTML=`<icon-wc name="${e}" size="md"></icon-wc>`,this.#e=document.createElement("section"),this.#e.className="page-tools-popover",this.#e.setAttribute("data-page-tools-internal",""),this.#e.id=t,this.#e.setAttribute("popover",""),this.#e.setAttribute("aria-label",i),this.#e.hidden=!0,this.appendChild(this.#t),this.appendChild(this.#e),this.listen(this.#e,"toggle",n=>{n.newState==="closed"&&this.#t.focus()})}#n(t){t.matches??t?this.#c():this.#r()}#c(){if(this.#i)return;this.#i=!0;let t=this.tools;for(let e of t)this.#e.appendChild(e);this.#t.hidden=!1,this.#e.hidden=!1,this.dataset.collapsed=""}#r(){if(!this.#i)return;this.#i=!1,this.#e.matches(":popover-open")&&this.#e.hidePopover();let t=Array.from(this.#e.children);for(let e of t)this.insertBefore(e,this.#t);this.#t.hidden=!0,this.#e.hidden=!0,delete this.dataset.collapsed}#d(){let t=this.tools;for(let e of t)this.#e.appendChild(e)}};c("page-tools",a);export{a as PageTools};
2
2
  //# sourceMappingURL=page-tools.js.map
@@ -1,4 +1,4 @@
1
- var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function p(h,t,e={}){let s=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:s},o=m.get(h);if(customElements.get(h)){if(!o||o.priority>=s){o&&o.priority===s&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${h}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=s){o.priority===s&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${o.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}m.set(h,i),customElements.define(h,t)}var u=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,i){t.addEventListener(e,s,i),this.#e.push(()=>t.removeEventListener(e,s,i))}setup(){}teardown(){}};var d=CSS.supports("anchor-name","--x"),v=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,f=class extends HTMLElement{get target(){return this.dataset.target}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},g=class h extends u{#e=[];#s=0;#o=!1;#n=null;#r=null;#t=null;#i=null;#l=null;#u=null;#d=null;#c=null;static#h=null;static observedAttributes=["data-step"];setup(){if(this.#e=[...this.querySelectorAll("tour-step")],this.#e.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target.closest(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#F();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}}teardown(){this.#o&&this.stop()}attributeChangedCallback(t,e,s){if(t==="data-step"&&this.#o&&e!==null){let i=parseInt(s,10);!Number.isNaN(i)&&i!==this.#s&&this.#a(i)}}start(t=0){h.#h&&h.#h!==this&&h.#h.stop(),this.#l=document.activeElement,this.#o=!0,h.#h=this,this.#A(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#p("tour:start",{step:t}),this.#a(t)}stop(){this.#L(),this.#o=!1,this.removeAttribute("data-active"),h.#h===this&&(h.#h=null)}next(){!this.#o||this.#t?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#s<this.#e.length-1?this.#a(this.#s+1,"next"):this.#B())}prev(){this.#o&&this.#s>0&&this.#a(this.#s-1,"prev")}goto(t){this.#o&&t>=0&&t<this.#e.length&&this.#a(t)}skip(){!this.#o||(this.dataset.mode??"passive")==="forced"||(this.#p("tour:skip",{step:this.#s}),this.#b({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#D(),this.removeAttribute("data-complete"),this.dataset.step="0"}#A(){this.#n=document.createElement("div"),this.#n.className="page-tour-backdrop",this.#n.setAttribute("aria-hidden","true"),this.#n.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#r=document.createElement("div"),this.#r.className="page-tour-spotlight",this.#r.setAttribute("aria-hidden","true"),this.#t=document.createElement("div"),this.#t.className="page-tour-card",this.#t.setAttribute("popover","manual"),this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-modal","true"),this.#t.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#t.addEventListener("keydown",t=>this.#q(t)),this.#t.addEventListener("click",t=>this.#M(t)),this.#i=document.createElement("div"),this.#i.setAttribute("aria-live","polite"),this.#i.setAttribute("aria-atomic","true"),this.#i.className="sr-only",this.#i.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#n,this.#r,this.#t,this.#i),this.#t.showPopover(),requestAnimationFrame(()=>{this.#n?.setAttribute("data-visible","")})}#m(t){let e=parseInt(this.dataset.spotlightPadding,10)||8,s=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${s.top-e}px`,left:`${s.left-e}px`,width:`${s.width+e*2}px`,height:`${s.height+e*2}px`})}#S(t,e){if(this.#t){if(d){this.#$(t,e);return}this.#v(t,e)}}#$(t,e){let s="--tour-target";t.style.anchorName=s,this.#t.style.positionAnchor=s,this.#t.style.position="fixed",this.#t.style.top="",this.#t.style.left="",this.#t.style.bottom="",this.#t.style.right="";let i="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#y(t):e){case"bottom":this.#t.style.top="anchor(bottom)",this.#t.style.left="anchor(center)",this.#t.style.translate="0 calc("+i+")";break;case"top":this.#t.style.bottom="anchor(top)",this.#t.style.left="anchor(center)",this.#t.style.translate="0 calc(-1 * "+i+")";break;case"right":this.#t.style.left="anchor(right)",this.#t.style.top="anchor(center)",this.#t.style.translate=i+" 0";break;case"left":this.#t.style.right="anchor(left)",this.#t.style.top="anchor(center)",this.#t.style.translate="calc(-1 * "+i+") 0";break}}#v(t,e){let s=t.getBoundingClientRect(),i=12,o=8,a=e==="auto"?this.#y(t):e;this.#t.style.position="fixed",this.#t.style.visibility="hidden",this.#t.style.top="0",this.#t.style.left="0",this.#t.style.translate="";let c=this.#t.getBoundingClientRect();this.#t.style.visibility="";let r,n,l=parseInt(this.dataset.spotlightPadding,10)||8;switch(a){case"bottom":r=s.bottom+l+i,n=s.left+(s.width-c.width)/2;break;case"top":r=s.top-l-i-c.height,n=s.left+(s.width-c.width)/2;break;case"right":r=s.top+(s.height-c.height)/2,n=s.right+l+i;break;case"left":r=s.top+(s.height-c.height)/2,n=s.left-l-i-c.width;break}n=Math.max(o,Math.min(n,window.innerWidth-c.width-o)),r=Math.max(o,Math.min(r,window.innerHeight-c.height-o)),Object.assign(this.#t.style,{top:`${r}px`,left:`${n}px`,translate:""})}#y(t){let e=t.getBoundingClientRect(),s=window.innerWidth,o=window.innerHeight-e.bottom,a=e.top,c=s-e.right,r=e.left,n=Math.max(o,a,c,r);return n===o?"bottom":n===a?"top":n===c?"right":"left"}#x(t,e){let s=this.#e.length,i=e===s-1,o=e===0,c=(this.dataset.mode??"passive")!=="forced",r=t.action!=="none";this.#t.innerHTML=`
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function p(h,t,e={}){let s=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:s},o=m.get(h);if(customElements.get(h)){if(!o||o.priority>=s){o&&o.priority===s&&o.impl!==t&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${h}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=s){o.priority===s&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${o.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}m.set(h,i),customElements.define(h,t)}var u=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,i){t.addEventListener(e,s,i),this.#e.push(()=>t.removeEventListener(e,s,i))}setup(){}teardown(){}};var d=CSS.supports("anchor-name","--x"),v=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,f=class extends HTMLElement{get target(){return this.dataset.target}get placement(){return this.dataset.placement??"auto"}get action(){return this.dataset.action??"none"}get actionHint(){return this.dataset.actionHint??null}get skippable(){return this.dataset.skippable!=="false"}get scrollBehavior(){return this.dataset.scroll??"smooth"}},g=class h extends u{#e=[];#s=0;#o=!1;#n=null;#r=null;#t=null;#i=null;#l=null;#u=null;#d=null;#c=null;static#h=null;static observedAttributes=["data-step"];setup(){if(this.#e=[...this.querySelectorAll("tour-step")],this.#e.length===0)return!1;let t=this.querySelector(".page-tour-start-btn");if(t&&this.listen(t,"click",e=>{e.preventDefault(),this.start()}),this.id&&this.listen(document,"click",e=>{e.target.closest(`[data-tour="${this.id}"]`)&&(e.preventDefault(),this.start())}),this.dataset.trigger==="auto"){let e=this.#F();e?.complete||e?.skipped?this.setAttribute("data-complete",""):setTimeout(()=>this.start(e?.step??0),400)}}teardown(){this.#o&&this.stop()}attributeChangedCallback(t,e,s){if(t==="data-step"&&this.#o&&e!==null){let i=parseInt(s,10);!Number.isNaN(i)&&i!==this.#s&&this.#a(i)}}start(t=0){h.#h&&h.#h!==this&&h.#h.stop(),this.#l=document.activeElement,this.#o=!0,h.#h=this,this.#A(),this.setAttribute("data-active",""),this.removeAttribute("data-complete"),this.#p("tour:start",{step:t}),this.#a(t)}stop(){this.#L(),this.#o=!1,this.removeAttribute("data-active"),h.#h===this&&(h.#h=null)}next(){!this.#o||this.#t?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting")||(this.#s<this.#e.length-1?this.#a(this.#s+1,"next"):this.#B())}prev(){this.#o&&this.#s>0&&this.#a(this.#s-1,"prev")}goto(t){this.#o&&t>=0&&t<this.#e.length&&this.#a(t)}skip(){!this.#o||(this.dataset.mode??"passive")==="forced"||(this.#p("tour:skip",{step:this.#s}),this.#b({skipped:!0}),this.stop(),this.setAttribute("data-complete",""))}reset(){this.#D(),this.removeAttribute("data-complete"),this.dataset.step="0"}#A(){this.#n=document.createElement("div"),this.#n.className="page-tour-backdrop",this.#n.setAttribute("aria-hidden","true"),this.#n.addEventListener("click",()=>{(this.dataset.mode??"passive")!=="forced"&&this.skip()}),this.#r=document.createElement("div"),this.#r.className="page-tour-spotlight",this.#r.setAttribute("aria-hidden","true"),this.#t=document.createElement("div"),this.#t.className="page-tour-card",this.#t.setAttribute("popover","manual"),this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-modal","true"),this.#t.setAttribute("aria-label",this.dataset.title??"Page Tour"),this.#t.addEventListener("keydown",t=>this.#C(t)),this.#t.addEventListener("click",t=>this.#M(t)),this.#i=document.createElement("div"),this.#i.setAttribute("aria-live","polite"),this.#i.setAttribute("aria-atomic","true"),this.#i.className="visually-hidden",this.#i.id=`page-tour-announcer-${crypto.randomUUID().slice(0,8)}`,this.append(this.#n,this.#r,this.#t,this.#i),this.#t.showPopover(),requestAnimationFrame(()=>{this.#n?.setAttribute("data-visible","")})}#m(t){let e=parseInt(this.dataset.spotlightPadding,10)||8,s=t.getBoundingClientRect();Object.assign(this.#r.style,{top:`${s.top-e}px`,left:`${s.left-e}px`,width:`${s.width+e*2}px`,height:`${s.height+e*2}px`})}#S(t,e){if(this.#t){if(d){this.#$(t,e);return}this.#v(t,e)}}#$(t,e){let s="--tour-target";t.style.anchorName=s,this.#t.style.positionAnchor=s,this.#t.style.position="fixed",this.#t.style.top="",this.#t.style.left="",this.#t.style.bottom="",this.#t.style.right="";let i="var(--tour-card-offset, 0.75rem)";switch(e==="auto"?this.#y(t):e){case"bottom":this.#t.style.top="anchor(bottom)",this.#t.style.left="anchor(center)",this.#t.style.translate="0 calc("+i+")";break;case"top":this.#t.style.bottom="anchor(top)",this.#t.style.left="anchor(center)",this.#t.style.translate="0 calc(-1 * "+i+")";break;case"right":this.#t.style.left="anchor(right)",this.#t.style.top="anchor(center)",this.#t.style.translate=i+" 0";break;case"left":this.#t.style.right="anchor(left)",this.#t.style.top="anchor(center)",this.#t.style.translate="calc(-1 * "+i+") 0";break}}#v(t,e){let s=t.getBoundingClientRect(),i=12,o=8,a=e==="auto"?this.#y(t):e;this.#t.style.position="fixed",this.#t.style.visibility="hidden",this.#t.style.top="0",this.#t.style.left="0",this.#t.style.translate="";let c=this.#t.getBoundingClientRect();this.#t.style.visibility="";let r,n,l=parseInt(this.dataset.spotlightPadding,10)||8;switch(a){case"bottom":r=s.bottom+l+i,n=s.left+(s.width-c.width)/2;break;case"top":r=s.top-l-i-c.height,n=s.left+(s.width-c.width)/2;break;case"right":r=s.top+(s.height-c.height)/2,n=s.right+l+i;break;case"left":r=s.top+(s.height-c.height)/2,n=s.left-l-i-c.width;break}n=Math.max(o,Math.min(n,window.innerWidth-c.width-o)),r=Math.max(o,Math.min(r,window.innerHeight-c.height-o)),Object.assign(this.#t.style,{top:`${r}px`,left:`${n}px`,translate:""})}#y(t){let e=t.getBoundingClientRect(),s=window.innerWidth,o=window.innerHeight-e.bottom,a=e.top,c=s-e.right,r=e.left,n=Math.max(o,a,c,r);return n===o?"bottom":n===a?"top":n===c?"right":"left"}#x(t,e){let s=this.#e.length,i=e===s-1,o=e===0,c=(this.dataset.mode??"passive")!=="forced",r=t.action!=="none";this.#t.innerHTML=`
2
2
  <div class="page-tour-progress" aria-hidden="true">
3
3
  ${this.#e.map((n,l)=>`
4
4
  <span class="page-tour-pip" ${l===e?"data-active":""} ${l<e?"data-visited":""}></span>
@@ -35,5 +35,5 @@ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;functi
35
35
  </button>
36
36
  </nav>
37
37
  </footer>
38
- `}#a(t,e="next"){if(this.#d?.abort(),this.#d=null,this.#s!==t){let n=this.#e[this.#s],l=n?document.querySelector(n.target):null;l&&(d&&(l.style.anchorName=""),l.removeAttribute("data-tour-target"))}this.#w(),this.#s=t;let s=this.#e[t],i=document.querySelector(s.target);if(!i){console.warn(`[page-tour] Target "${s.target}" not found, skipping step ${t}`),e==="next"&&t<this.#e.length-1?this.#a(t+1,"next"):e==="prev"&&t>0&&this.#a(t-1,"prev");return}i.setAttribute("data-tour-target","");let o=v()?"instant":s.scrollBehavior;s.scrollBehavior!=="none"&&i.scrollIntoView({block:"nearest",behavior:o});let a=()=>{this.#m(i),this.#S(i,s.placement)};a(),setTimeout(a,v()?0:300),this.#x(s,t),this.#t.hasAttribute("tabindex")||this.#t.setAttribute("tabindex","-1"),this.#t.focus(),requestAnimationFrame(()=>{let n=this.#t?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4");n?(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus()):this.#t?.querySelector('[data-action="next"]')?.focus()});let r=s.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#T(`Step ${t+1} of ${this.#e.length}: ${r}`),this.dataset.step=String(t),s.action!=="none"&&this.#E(s),this.#N(i),this.#b({step:t}),this.#o&&this.#p("tour:step",{step:t,target:i,direction:e})}#E(t){let e=document.querySelector(t.target);if(!e)return;let s=this.#t?.querySelector('[data-action="next"]'),i=new AbortController;this.#d=i;let a={click:"click",focus:"focus",input:"input",change:"change"}[t.action];a?e.addEventListener(a,()=>{s?.removeAttribute("data-waiting"),this.#t?.querySelector(".page-tour-action-hint")?.remove(),s?.focus(),this.#p("tour:action",{step:this.#s,action:t.action}),i.abort()},{signal:i.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{s?.removeAttribute("data-waiting"),this.#t?.querySelector(".page-tour-action-hint")?.remove(),s?.focus(),i.abort()},{signal:i.signal,once:!0})}#q(t){let e=this.dataset.mode??"passive",i=this.#e[this.#s]?.action!=="none",a=this.#t?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),i&&a||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#e.length-1);break;case"Tab":this.#C(t,i&&a);break}}#C(t,e){let s=[...this.#t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(n=>!n.disabled&&n.offsetParent!==null),i=[];if(e){let n=this.#e[this.#s],l=document.querySelector(n.target);l&&(i=(l.matches("input, select, textarea, button, [href], [tabindex]")?[l]:[...l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(b=>!b.disabled&&b.offsetParent!==null))}let o=[...s,...i];if(o.length===0)return;let a=o[0],c=o[o.length-1],r=document.activeElement;t.shiftKey?(r===a||!o.includes(r))&&(t.preventDefault(),c.focus()):(r===c||!o.includes(r))&&(t.preventDefault(),a.focus())}#M(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#N(t){this.#u=new ResizeObserver(()=>{this.#k(t)}),this.#u.observe(t),this.listen(window,"scroll",()=>this.#k(t),{passive:!0})}#w(){this.#u&&(this.#u.disconnect(),this.#u=null),this.#c&&(cancelAnimationFrame(this.#c),this.#c=null)}#k(t){this.#c||(this.#c=requestAnimationFrame(()=>{if(this.#c=null,!this.#o)return;this.#m(t);let e=this.#e[this.#s];d||this.#v(t,e.placement)}))}#B(){this.#p("tour:complete",{steps:this.#e.length}),this.#b({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#L(){this.#d?.abort(),this.#d=null,this.#w();let t=this.#e[this.#s],e=t?document.querySelector(t.target):null;e&&(d&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#n?.remove(),this.#r?.remove(),this.#t?.hidePopover?.(),this.#t?.remove(),this.#i?.remove(),this.#n=null,this.#r=null,this.#t=null,this.#i=null,this.#l&&typeof this.#l.focus=="function"&&(this.#l.focus(),this.#l=null)}#T(t){this.#i&&(this.#i.textContent="",requestAnimationFrame(()=>{this.#i&&(this.#i.textContent=t)}))}#p(t,e){let s=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:s,detail:e}))}#f(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#g(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#b(t){let e=this.#f();if(!e)return;let s=this.#g(),i={};try{i=JSON.parse(e.getItem(s))??{}}catch{}e.setItem(s,JSON.stringify({...i,...t}))}#F(){let t=this.#f();if(!t)return null;try{return JSON.parse(t.getItem(this.#g()))}catch{return null}}#D(){let t=this.#f();t&&t.removeItem(this.#g())}};p("page-tour",g);p("tour-step",f);export{g as PageTour,f as TourStep};
38
+ `}#a(t,e="next"){if(this.#d?.abort(),this.#d=null,this.#s!==t){let n=this.#e[this.#s],l=n?document.querySelector(n.target):null;l&&(d&&(l.style.anchorName=""),l.removeAttribute("data-tour-target"))}this.#w(),this.#s=t;let s=this.#e[t],i=document.querySelector(s.target);if(!i){console.warn(`[page-tour] Target "${s.target}" not found, skipping step ${t}`),e==="next"&&t<this.#e.length-1?this.#a(t+1,"next"):e==="prev"&&t>0&&this.#a(t-1,"prev");return}i.setAttribute("data-tour-target","");let o=v()?"instant":s.scrollBehavior;s.scrollBehavior!=="none"&&i.scrollIntoView({block:"nearest",behavior:o});let a=()=>{this.#m(i),this.#S(i,s.placement)};a(),setTimeout(a,v()?0:300),this.#x(s,t),this.#t.hasAttribute("tabindex")||this.#t.setAttribute("tabindex","-1"),this.#t.focus(),requestAnimationFrame(()=>{let n=this.#t?.querySelector(".page-tour-content h3, .page-tour-content h2, .page-tour-content h4");n?(n.hasAttribute("tabindex")||n.setAttribute("tabindex","-1"),n.focus()):this.#t?.querySelector('[data-action="next"]')?.focus()});let r=s.querySelector("h3, h2, h4")?.textContent??`Step ${t+1}`;this.#T(`Step ${t+1} of ${this.#e.length}: ${r}`),this.dataset.step=String(t),s.action!=="none"&&this.#E(s),this.#N(i),this.#b({step:t}),this.#o&&this.#p("tour:step",{step:t,target:i,direction:e})}#E(t){let e=document.querySelector(t.target);if(!e)return;let s=this.#t?.querySelector('[data-action="next"]'),i=new AbortController;this.#d=i;let a={click:"click",focus:"focus",input:"input",change:"change"}[t.action];a?e.addEventListener(a,()=>{s?.removeAttribute("data-waiting"),this.#t?.querySelector(".page-tour-action-hint")?.remove(),s?.focus(),this.#p("tour:action",{step:this.#s,action:t.action}),i.abort()},{signal:i.signal,once:!0}):t.action==="custom"&&this.addEventListener("tour:action",()=>{s?.removeAttribute("data-waiting"),this.#t?.querySelector(".page-tour-action-hint")?.remove(),s?.focus(),i.abort()},{signal:i.signal,once:!0})}#C(t){let e=this.dataset.mode??"passive",i=this.#e[this.#s]?.action!=="none",a=this.#t?.querySelector('[data-action="next"]')?.hasAttribute("data-waiting");switch(t.key){case"Escape":e!=="forced"&&(t.preventDefault(),this.skip());break;case"ArrowRight":case"ArrowDown":t.preventDefault(),i&&a||this.next();break;case"ArrowLeft":case"ArrowUp":t.preventDefault(),this.prev();break;case"Home":t.preventDefault(),this.goto(0);break;case"End":t.preventDefault(),this.goto(this.#e.length-1);break;case"Tab":this.#q(t,i&&a);break}}#q(t,e){let s=[...this.#t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(n=>!n.disabled&&n.offsetParent!==null),i=[];if(e){let n=this.#e[this.#s],l=document.querySelector(n.target);l&&(i=(l.matches("input, select, textarea, button, [href], [tabindex]")?[l]:[...l.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')]).filter(b=>!b.disabled&&b.offsetParent!==null))}let o=[...s,...i];if(o.length===0)return;let a=o[0],c=o[o.length-1],r=document.activeElement;t.shiftKey?(r===a||!o.includes(r))&&(t.preventDefault(),c.focus()):(r===c||!o.includes(r))&&(t.preventDefault(),a.focus())}#M(t){let e=t.target.closest("[data-action]");if(!e)return;switch(e.dataset.action){case"next":this.next();break;case"prev":this.prev();break;case"skip":this.skip();break}}#N(t){this.#u=new ResizeObserver(()=>{this.#k(t)}),this.#u.observe(t),this.listen(window,"scroll",()=>this.#k(t),{passive:!0})}#w(){this.#u&&(this.#u.disconnect(),this.#u=null),this.#c&&(cancelAnimationFrame(this.#c),this.#c=null)}#k(t){this.#c||(this.#c=requestAnimationFrame(()=>{if(this.#c=null,!this.#o)return;this.#m(t);let e=this.#e[this.#s];d||this.#v(t,e.placement)}))}#B(){this.#p("tour:complete",{steps:this.#e.length}),this.#b({complete:!0}),this.stop(),this.setAttribute("data-complete","")}#L(){this.#d?.abort(),this.#d=null,this.#w();let t=this.#e[this.#s],e=t?document.querySelector(t.target):null;e&&(d&&(e.style.anchorName=""),e.removeAttribute("data-tour-target")),this.#n?.remove(),this.#r?.remove(),this.#t?.hidePopover?.(),this.#t?.remove(),this.#i?.remove(),this.#n=null,this.#r=null,this.#t=null,this.#i=null,this.#l&&typeof this.#l.focus=="function"&&(this.#l.focus(),this.#l=null)}#T(t){this.#i&&(this.#i.textContent="",requestAnimationFrame(()=>{this.#i&&(this.#i.textContent=t)}))}#p(t,e){let s=t!=="tour:skip";this.dispatchEvent(new CustomEvent(t,{bubbles:!0,cancelable:s,detail:e}))}#f(){let t=this.dataset.persist??"session";return t==="session"?sessionStorage:t==="local"?localStorage:null}#g(){return`vb-tour-${this.dataset.persistKey??window.location.pathname}`}#b(t){let e=this.#f();if(!e)return;let s=this.#g(),i={};try{i=JSON.parse(e.getItem(s))??{}}catch{}e.setItem(s,JSON.stringify({...i,...t}))}#F(){let t=this.#f();if(!t)return null;try{return JSON.parse(t.getItem(this.#g()))}catch{return null}}#D(){let t=this.#f();t&&t.removeItem(this.#g())}};p("page-tour",g);p("tour-step",f);export{g as PageTour,f as TourStep};
39
39
  //# sourceMappingURL=page-tour.js.map
@@ -1,4 +1,4 @@
1
- var V=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function S(o,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=C.get(o);if(customElements.get(o)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}C.set(o,s),customElements.define(o,e)}var h=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}setup(){}teardown(){}};function B(o,e,t){e/=100,t/=100;let r=i=>(i+o/30)%12,s=e*Math.min(t,1-t),n=i=>t-s*Math.max(-1,Math.min(r(i)-3,9-r(i),1));return{r:Math.round(n(0)*255),g:Math.round(n(8)*255),b:Math.round(n(4)*255)}}function q(o,e,t){o/=255,e/=255,t/=255;let r=Math.max(o,e,t),s=Math.min(o,e,t),n=(r+s)/2,i=0,d=0;if(r!==s){let c=r-s;switch(d=n>.5?c/(2-r-s):c/(r+s),r){case o:i=((e-t)/c+(e<t?6:0))/6;break;case e:i=((t-o)/c+2)/6;break;case t:i=((o-e)/c+4)/6;break}}return{h:Math.round(i*360),s:Math.round(d*100),l:Math.round(n*100)}}function v(o){o=o.replace(/^#/,""),o.length===3&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]);let e=parseInt(o,16);return{r:e>>16&255,g:e>>8&255,b:e&255}}function N(o,e,t){return"#"+[o,e,t].map(r=>Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0")).join("")}function $(o){let{r:e,g:t,b:r}=v(o);return q(e,t,r)}function l(o,e,t){let{r,g:s,b:n}=B(o,e,t);return N(r,s,n)}var u=o=>(o%360+360)%360;function H(o,e,t){return{colors:[l(o,e,t),l(u(o+180),e,t)],names:["Base","Complement"]}}function O(o,e,t){return{colors:[l(u(o-30),e,t),l(o,e,t),l(u(o+30),e,t)],names:["Analog A","Base","Analog B"]}}function j(o,e,t){return{colors:[l(o,e,t),l(u(o+120),e,t),l(u(o+240),e,t)],names:["Base","Triad A","Triad B"]}}function R(o,e,t){return{colors:[l(o,e,t),l(u(o+150),e,t),l(u(o+210),e,t)],names:["Base","Split A","Split B"]}}function F(o,e,t){return{colors:[l(o,e,t),l(u(o+90),e,t),l(u(o+180),e,t),l(u(o+270),e,t)],names:["Base","Tetrad A","Tetrad B","Tetrad C"]}}var P=[{label:"50",l:96},{label:"100",l:90},{label:"200",l:80},{label:"300",l:70},{label:"400",l:60},{label:"500",l:50},{label:"600",l:40},{label:"700",l:30},{label:"800",l:22},{label:"900",l:15},{label:"950",l:10}];function D(o,e,t){let r=[],s=[];for(let n of P){let i=n.l>85||n.l<20?Math.max(e*.6,5):e;r.push(l(o,Math.round(i),n.l)),s.push(n.label)}return{colors:r,names:s}}var M={complementary:H,analogous:O,triadic:j,"split-complementary":R,tetradic:F,monochromatic:D};function k(o,e){let{h:t,s:r,l:s}=$(o);return(M[e]||M.complementary)(t,r,s)}var w=class extends h{static observedAttributes=["seed","harmony","include-seed","show-export","layout","size","show-values","show-names"];#e=null;#t="";#o=[];#r=[];setup(){this.#e=this.querySelector("color-picker")||this.querySelector('input[type="color"]'),this.#t=this.#i(),this.#t&&(this.#n(),this.#c(),this.#s())}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&(this.#t=this.#i(),this.#t&&this.#n())}#i(){if(this.#e){let e=this.#e;if(e.tagName==="COLOR-PICKER"){let t=e.value;return t&&t!=="#000000"?t:e.querySelector('input[type="color"]')?.value||t||""}return e.value||""}return this.getAttribute("seed")||""}#n(){let e=this.getAttribute("harmony")||"complementary",t=this.getAttribute("layout")||"inline",r=this.getAttribute("size")||"md",s=this.hasAttribute("show-values"),n=this.hasAttribute("show-names"),i=this.hasAttribute("show-export"),{colors:d,names:c}=k(this.#t,e);this.#o=d,this.#r=c;let b={sm:48,md:80,lg:120}[r]||80,y="display:flex;flex-wrap:wrap;gap:var(--size-xs,0.5rem)";t==="grid"?y=`display:grid;grid-template-columns:repeat(auto-fill,minmax(${b}px,1fr));gap:var(--size-xs,0.5rem)`:t==="list"&&(y="display:flex;flex-direction:column;gap:var(--size-xs,0.5rem)");let T=d.map((a,g)=>{let f=c[g]||"",A=this.#d(a),L=t==="list"?"display:flex;flex-direction:row;align-items:center;gap:0.75rem":`display:flex;flex-direction:column;align-items:center;gap:0.25rem;max-inline-size:${b}px`,E=t==="list"?36:b,z=a.length>12?a.slice(0,12)+"\u2026":a;return`<div class="swatch-wrap" role="listitem" style="${L}">
1
+ var V=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function S(o,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=C.get(o);if(customElements.get(o)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}C.set(o,s),customElements.define(o,e)}var h=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}setup(){}teardown(){}};function B(o,e,t){e/=100,t/=100;let r=i=>(i+o/30)%12,s=e*Math.min(t,1-t),n=i=>t-s*Math.max(-1,Math.min(r(i)-3,9-r(i),1));return{r:Math.round(n(0)*255),g:Math.round(n(8)*255),b:Math.round(n(4)*255)}}function q(o,e,t){o/=255,e/=255,t/=255;let r=Math.max(o,e,t),s=Math.min(o,e,t),n=(r+s)/2,i=0,d=0;if(r!==s){let c=r-s;switch(d=n>.5?c/(2-r-s):c/(r+s),r){case o:i=((e-t)/c+(e<t?6:0))/6;break;case e:i=((t-o)/c+2)/6;break;case t:i=((o-e)/c+4)/6;break}}return{h:Math.round(i*360),s:Math.round(d*100),l:Math.round(n*100)}}function v(o){o=o.replace(/^#/,""),o.length===3&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]);let e=parseInt(o,16);return{r:e>>16&255,g:e>>8&255,b:e&255}}function N(o,e,t){return"#"+[o,e,t].map(r=>Math.max(0,Math.min(255,Math.round(r))).toString(16).padStart(2,"0")).join("")}function $(o){let{r:e,g:t,b:r}=v(o);return q(e,t,r)}function l(o,e,t){let{r,g:s,b:n}=B(o,e,t);return N(r,s,n)}var u=o=>(o%360+360)%360;function H(o,e,t){return{colors:[l(o,e,t),l(u(o+180),e,t)],names:["Base","Complement"]}}function O(o,e,t){return{colors:[l(u(o-30),e,t),l(o,e,t),l(u(o+30),e,t)],names:["Analog A","Base","Analog B"]}}function j(o,e,t){return{colors:[l(o,e,t),l(u(o+120),e,t),l(u(o+240),e,t)],names:["Base","Triad A","Triad B"]}}function R(o,e,t){return{colors:[l(o,e,t),l(u(o+150),e,t),l(u(o+210),e,t)],names:["Base","Split A","Split B"]}}function F(o,e,t){return{colors:[l(o,e,t),l(u(o+90),e,t),l(u(o+180),e,t),l(u(o+270),e,t)],names:["Base","Tetrad A","Tetrad B","Tetrad C"]}}var P=[{label:"50",l:96},{label:"100",l:90},{label:"200",l:80},{label:"300",l:70},{label:"400",l:60},{label:"500",l:50},{label:"600",l:40},{label:"700",l:30},{label:"800",l:22},{label:"900",l:15},{label:"950",l:10}];function D(o,e,t){let r=[],s=[];for(let n of P){let i=n.l>85||n.l<20?Math.max(e*.6,5):e;r.push(l(o,Math.round(i),n.l)),s.push(n.label)}return{colors:r,names:s}}var M={complementary:H,analogous:O,triadic:j,"split-complementary":R,tetradic:F,monochromatic:D};function k(o,e){let{h:t,s:r,l:s}=$(o);return(M[e]||M.complementary)(t,r,s)}var w=class extends h{static observedAttributes=["seed","harmony","include-seed","show-export","layout","size","show-values","show-names"];#e=null;#t="";#o=[];#r=[];setup(){this.#e=this.querySelector("color-picker")||this.querySelector('input[type="color"]'),this.#t=this.#i(),this.#t&&(this.#n(),this.#c(),this.#s())}attributeChangedCallback(){this.isConnected&&this.hasAttribute("data-upgraded")&&(this.#t=this.#i(),this.#t&&this.#n())}#i(){if(this.#e){let e=this.#e;if(e.tagName==="COLOR-PICKER"){let t=e.value;return t&&t!=="#000000"?t:e.querySelector('input[type="color"]')?.value||t||""}return e.value||""}return this.getAttribute("seed")||""}#n(){let e=this.getAttribute("harmony")||"complementary",t=this.getAttribute("layout")||"inline",r=this.getAttribute("size")||"md",s=this.hasAttribute("show-values"),n=this.hasAttribute("show-names"),i=this.hasAttribute("show-export"),{colors:d,names:c}=k(this.#t,e);this.#o=d,this.#r=c;let b={sm:48,md:80,lg:120}[r]||80,y="display:flex;flex-wrap:wrap;gap:var(--size-xs,0.5rem)";t==="grid"?y=`display:grid;grid-template-columns:repeat(auto-fill,minmax(${b}px,1fr));gap:var(--size-xs,0.5rem)`:t==="list"&&(y="display:flex;flex-direction:column;gap:var(--size-xs,0.5rem)");let T=d.map((a,g)=>{let f=c[g]||"",A=this.#d(a),L=t==="list"?"display:flex;flex-direction:row;align-items:center;gap:0.75rem":`display:flex;flex-direction:column;align-items:center;gap:0.25rem;max-inline-size:${b}px`,E=t==="list"?36:b,z=a.length>12?a.slice(0,12)+"\u2026":a;return`<div class="swatch-wrap" role="listitem" style="${L}">
2
2
  <button type="button" class="color-box" data-index="${g}"
3
3
  style="background:${a};color:${A};width:${E}px;height:${E}px;border:1px solid oklch(0% 0 0/0.15);border-radius:var(--radius-s,0.25rem);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;font-family:var(--font-mono,monospace);position:relative;overflow:hidden;flex-shrink:0"
4
4
  title="Click to copy${f?": "+f:""}"
@@ -1,4 +1,4 @@
1
- var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(r,e,n={}){let o=n.priority??10,s={impl:e,bundle:n.bundle,contract:n.contract,priority:o},t=m.get(r);if(customElements.get(r)){if(!t||t.priority>=o){t&&t.priority===o&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=o){t.priority===o&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}m.set(r,s),customElements.define(r,e)}var d=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,o,s){e.addEventListener(n,o,s),this.#e.push(()=>e.removeEventListener(n,o,s))}setup(){}teardown(){}};var f=class extends d{setup(){this.#e().catch(()=>{})}async#e(){let e=this.getAttribute("data-lens-src")||"/api/analytics/popular",n=this.getAttribute("window"),o=new URL(e,document.baseURI);n&&o.searchParams.set("window",n);let s=null;try{let i=await fetch(o,{credentials:"omit"});if(!i.ok)throw new Error(`status ${i.status}`);s=await i.json()}catch(i){this.#r(i.message);return}let t=Array.isArray(s?.pages)?s.pages:Array.isArray(s)?s:[];if(!t.length){this.#n();return}let a=this.getAttribute("data-meta-src"),c=null;if(a)try{let i=await fetch(a,{credentials:"omit"});if(i.ok){let l=await i.json(),u=Array.isArray(l)?l:l?.pages||[];c=new Map(u.map(h=>[h.url,h]))}}catch{}this.#t(t,c)}#t(e,n){let o=parseInt(this.getAttribute("limit")||"10",10)||10,s=e.slice(0,o),t=['<h2 class="popularity-heading">Most visited</h2>'];t.push('<ol class="popularity-list">');for(let a of s){let c=n?.get(a.url)||{},i=a.title||c.title||a.url,l=g(a.views??a.count??0),u=c.provenance?`<span class="popularity-prov" data-provenance="${b(c.provenance)}">${p(c.provenance)}</span>`:"";t.push(`<li><a href="${b(a.url)}">${p(i)}</a><small>${l} views${u?` \xB7 ${u}`:""}</small></li>`)}t.push("</ol>"),this.innerHTML=t.join(`
1
+ var w=window.matchMedia("(prefers-reduced-motion: reduce)");var m=new Map;function y(r,e,n={}){let s=n.priority??10,o={impl:e,bundle:n.bundle,contract:n.contract,priority:s},t=m.get(r);if(customElements.get(r)){if(!t||t.priority>=s){t&&t.priority===s&&t.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}" (priority ${t.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${t.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(t&&t.priority>=s){t.priority===s&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${t.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}m.set(r,o),customElements.define(r,e)}var d=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,n,s,o){e.addEventListener(n,s,o),this.#e.push(()=>e.removeEventListener(n,s,o))}setup(){}teardown(){}};var f=class extends d{setup(){this.#e().catch(()=>{})}async#e(){let e=this.getAttribute("data-lens-src")||"/api/analytics/popular",n=this.getAttribute("window"),s=new URL(e,document.baseURI);n&&s.searchParams.set("window",n);let o=null;try{let i=await fetch(s,{credentials:"omit"});if(!i.ok)throw new Error(`status ${i.status}`);o=await i.json()}catch(i){this.#r(i.message);return}let t=Array.isArray(o?.pages)?o.pages:Array.isArray(o)?o:[];if(!t.length){this.#n();return}let a=this.getAttribute("data-meta-src"),c=null;if(a)try{let i=await fetch(a,{credentials:"omit"});if(i.ok){let l=await i.json(),u=Array.isArray(l)?l:l?.pages||[];c=new Map(u.map(h=>[h.url,h]))}}catch{}this.#t(t,c)}#t(e,n){let s=parseInt(this.getAttribute("limit")||"10",10)||10,o=e.slice(0,s),t=['<h2 class="popularity-heading">Most visited</h2>'];t.push('<ol class="popularity-list">');for(let a of o){let c=n?.get(a.url)||{},i=a.title||c.title||a.url,l=g(a.views??a.count??0),u=c.provenance?`<span class="popularity-prov" data-provenance="${b(c.provenance)}">${p(c.provenance)}</span>`:"";t.push(`<li><a href="${b(a.url)}">${p(i)}</a><small>${l} views${u?` \xB7 ${u}`:""}</small></li>`)}t.push("</ol>"),this.innerHTML=t.join(`
2
2
  `)}#r(e){this.innerHTML=`
3
3
  <h2 class="popularity-heading">Most visited</h2>
4
4
  <p class="popularity-empty">Popularity data is unavailable right now${e?` (${p(e)})`:""}.</p>
@@ -1,2 +1,2 @@
1
- var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=l.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(r,s),customElements.define(r,t)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#e.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}};var a=class extends c{#e;#t;#n=null;setup(){this.#n===null&&(this.#n=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#n,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#e=document.createElement("button"),this.#e.type="button",this.#e.className="print-trigger",this.#e.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#e.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#e.appendChild(o)}if(this.listen(this.#e,"click",this.#i),this.append(this.#e),e){let o=document.createElement("label");this.#t=document.createElement("input"),this.#t.type="checkbox";let d=document.createElement("span");d.textContent="Print without VB styles",o.append(this.#t,d),this.append(o)}}teardown(){this.#e=null,this.#t=null}#i=()=>{let t=this.#t?.checked;if(t&&document.documentElement.setAttribute("data-print-raw",""),window.print(),t){let e=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",e),clearTimeout(i)};window.addEventListener("afterprint",e,{once:!0});let i=setTimeout(e,5e3)}}};u("print-page",a);export{a as PrintPage};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function u(r,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=l.get(r);if(customElements.get(r)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=i){n.priority===i&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}l.set(r,s),customElements.define(r,t)}var c=class extends HTMLElement{#e=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#e)t();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,i,s){t.addEventListener(e,i,s),this.#e.push(()=>t.removeEventListener(e,i,s))}setup(){}teardown(){}};var a=class extends c{#e;#t;#n=null;setup(){this.#n===null&&(this.#n=this.getAttribute("label")||this.textContent.trim()||"Print this page");let t=this.#n,e=this.hasAttribute("raw-toggle");this.innerHTML="",e&&this.setAttribute("role","group");let i=this.getAttribute("variant")||"icon";this.#e=document.createElement("button"),this.#e.type="button",this.#e.className="print-trigger",this.#e.setAttribute("aria-label",t);let s=i!=="label",n=i!=="icon";if(s){let o=document.createElement("icon-wc");o.setAttribute("name","printer"),o.setAttribute("size","sm"),o.setAttribute("aria-hidden","true"),this.#e.appendChild(o)}if(n){let o=document.createElement("span");o.textContent=t,this.#e.appendChild(o)}if(this.listen(this.#e,"click",this.#i),this.append(this.#e),e){let o=document.createElement("label");this.#t=document.createElement("input"),this.#t.type="checkbox";let d=document.createElement("span");d.textContent="Print without VB styles",o.append(this.#t,d),this.append(o)}}teardown(){this.#e=null,this.#t=null}#i=()=>{let t=this.#t?.checked;if(t&&document.documentElement.setAttribute("data-print-raw",""),window.print(),t){let e=()=>{document.documentElement.removeAttribute("data-print-raw"),window.removeEventListener("afterprint",e),clearTimeout(i)};window.addEventListener("afterprint",e,{once:!0});let i=setTimeout(e,5e3)}}};u("print-page",a);export{a as PrintPage};
2
2
  //# sourceMappingURL=print-page.js.map
@@ -1,2 +1,2 @@
1
- var U=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function A(n,t,e={}){let o=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:o},r=y.get(n);if(customElements.get(n)){if(!r||r.priority>=o){r&&r.priority===o&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=o){r.priority===o&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}y.set(n,i),customElements.define(n,t)}var b=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&this.setAttribute("data-upgraded","")}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,o,i){t.addEventListener(e,o,i),this.#t.push(()=>t.removeEventListener(e,o,i))}setup(){}teardown(){}};var x=class extends b{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#o(t,e,o)}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,o){if(!this.#t||!this.isConnected)return;t==="value"&&o&&(this.#e=o);let i=this.#e||this.getAttribute("value")||"";if(!i)return;let r=parseInt(this.getAttribute("size")??"200",10)||200,c=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=r,this.#t.height=r,this.#t.setAttribute("aria-label",`QR code: ${i}`),this.#o(i,r,c)}#o(t,e,o){let i=w(t,o),r=this.#t.getContext("2d"),c=i.length,s=e/c,a=getComputedStyle(this),l=this.getAttribute("color")||a.color||"#000",f=this.getAttribute("background")||"transparent";r.clearRect(0,0,e,e),f!=="transparent"&&(r.fillStyle=f,r.fillRect(0,0,e,e)),r.fillStyle=l;for(let h=0;h<c;h++)for(let d=0;d<c;d++)i[h][d]&&r.fillRect(Math.round(d*s),Math.round(h*s),Math.ceil(s),Math.ceil(s));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="sr-only",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}},g=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function w(n,t=1){let e=new TextEncoder().encode(n),o=M(e.length,t),i=g[t][o-1][0],r=g[t][o-1][1],c=i-r,s=C(e,o,c),a=v(s,c,r),l=o*4+17,f=Array.from({length:l},()=>new Uint8Array(l)),u=Array.from({length:l},()=>new Uint8Array(l));return F(f,u,l),S(f,u,o),$(f,u,l),B(u,l),D(f,u,a,l),O(f,u,l,t)}function M(n,t){for(let e=1;e<=10;e++){let o=g[t][e-1][0],i=g[t][e-1][1],r=o-i,c=e<=9?8:16,s=Math.ceil((4+c)/8);if(n<=r-s)return e}return 10}function C(n,t,e){let o=[],i=(u,h)=>{for(let d=h-1;d>=0;d--)o.push(u>>d&1)};i(4,4);let r=t<=9?8:16;i(n.length,r);for(let u of n)i(u,8);let c=e*8,s=Math.min(4,c-o.length);for(i(0,s);o.length%8!==0;)o.push(0);let a=[236,17],l=0;for(;o.length<c;)i(a[l%2],8),l++;let f=[];for(let u=0;u<o.length;u+=8){let h=0;for(let d=0;d<8;d++)h=h<<1|(o[u+d]||0);f.push(h)}return f}function v(n,t,e){let o=k(e),i=new Uint8Array(t+e);for(let c=0;c<t;c++)i[c]=n[c];for(let c=0;c<t;c++){let s=i[c];if(s===0)continue;let a=m[s];for(let l=0;l<o.length;l++)i[c+l]^=p[(a+m[o[l]])%255]}let r=[...n.slice(0,t)];for(let c=0;c<e;c++)r.push(i[t+c]);return r}var p=new Uint8Array(512),m=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)p[e]=t,m[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)p[e]=p[e-255]})();function k(n){let t=new Uint8Array([1]);for(let e=0;e<n;e++){let o=new Uint8Array(t.length+1),i=e;for(let r=0;r<t.length;r++)o[r]^=t[r],o[r+1]^=p[(m[t[r]]+i)%255];t=o}return t}function F(n,t,e){let o=[[0,0],[e-7,0],[0,e-7]];for(let[i,r]of o){for(let c=0;c<7;c++)for(let s=0;s<7;s++){let a=c===0||c===6||s===0||s===6||c>=2&&c<=4&&s>=2&&s<=4;n[i+c][r+s]=a?1:0,t[i+c][r+s]=1}for(let c=-1;c<=7;c++)for(let[s,a]of[[c,-1],[c,7],[-1,c],[7,c]]){let l=i+s,f=r+a;l>=0&&l<e&&f>=0&&f<e&&(n[l][f]=0,t[l][f]=1)}}}function S(n,t,e){if(e<2)return;let o=E[e-1];for(let i of o)for(let r of o)if(!t[i][r])for(let c=-2;c<=2;c++)for(let s=-2;s<=2;s++){let a=Math.abs(c)===2||Math.abs(s)===2||c===0&&s===0;n[i+c][r+s]=a?1:0,t[i+c][r+s]=1}}function $(n,t,e){for(let o=8;o<e-8;o++){let i=o%2===0?1:0;t[6][o]||(n[6][o]=i,t[6][o]=1),t[o][6]||(n[o][6]=i,t[o][6]=1)}}function B(n,t){for(let e=0;e<=8;e++)e<t&&(n[8][e]=1),e<t&&(n[e][8]=1);for(let e=0;e<=7;e++)n[8][t-1-e]=1,n[t-1-e][8]=1;n[t-8][8]=1}function D(n,t,e,o){let i=[];for(let s of e)for(let a=7;a>=0;a--)i.push(s>>a&1);let r=0,c=!0;for(let s=o-1;s>=1;s-=2){s===6&&(s=5);let a=c?Array.from({length:o},(l,f)=>o-1-f):Array.from({length:o},(l,f)=>f);for(let l of a)for(let f of[s,s-1])f<0||f>=o||t[l][f]||(n[l][f]=r<i.length?i[r]:0,r++);c=!c}}var L=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function T(n,t){let o=[1,0,3,2][n]*8+t;return L[o]}var N=[(n,t)=>(n+t)%2===0,n=>n%2===0,(n,t)=>t%3===0,(n,t)=>(n+t)%3===0,(n,t)=>(Math.floor(n/2)+Math.floor(t/3))%2===0,(n,t)=>n*t%2+n*t%3===0,(n,t)=>(n*t%2+n*t%3)%2===0,(n,t)=>((n+t)%2+n*t%3)%2===0];function R(n,t,e,o){let i=n.map(c=>new Uint8Array(c)),r=N[o];for(let c=0;c<e;c++)for(let s=0;s<e;s++)!t[c][s]&&r(c,s)&&(i[c][s]^=1);return i}function I(n,t,e,o){let i=T(e,o),r=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let s=0;s<15;s++){let[a,l]=r[s];n[a][l]=i>>14-s&1}let c=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let s=0;s<15;s++){let[a,l]=c[s];n[a][l]=i>>14-s&1}n[t-8][8]=1}function _(n,t){let e=0;for(let o=0;o<t;o++){let i=1;for(let r=1;r<t;r++)n[o][r]===n[o][r-1]?(i++,i===5?e+=3:i>5&&(e+=1)):i=1}for(let o=0;o<t;o++){let i=1;for(let r=1;r<t;r++)n[r][o]===n[r-1][o]?(i++,i===5?e+=3:i>5&&(e+=1)):i=1}for(let o=0;o<t-1;o++)for(let i=0;i<t-1;i++){let r=n[o][i];r===n[o][i+1]&&r===n[o+1][i]&&r===n[o+1][i+1]&&(e+=3)}return e}function O(n,t,e,o){let i=1/0,r=null;for(let c=0;c<8;c++){let s=R(n,t,e,c);I(s,e,o,c);let a=_(s,e);a<i&&(i=a,r=s)}return r}A("qr-code",x);export{x as QrCodeWc};
1
+ var U=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function A(n,t,e={}){let o=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:o},r=y.get(n);if(customElements.get(n)){if(!r||r.priority>=o){r&&r.priority===o&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=o){r.priority===o&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}y.set(n,i),customElements.define(n,t)}var b=class extends HTMLElement{#t=[];connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0})))}disconnectedCallback(){for(let t of this.#t)t();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,o,i){t.addEventListener(e,o,i),this.#t.push(()=>t.removeEventListener(e,o,i))}setup(){}teardown(){}};var x=class extends b{#t;#e=null;setup(){this.#e===null&&(this.#e=this.getAttribute("value")||this.textContent.trim());let t=this.#e;if(!t)return!1;let e=parseInt(this.getAttribute("size")??"200",10)||200,o=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t=document.createElement("canvas"),this.#t.width=e,this.#t.height=e,this.#t.setAttribute("role","img"),this.#t.setAttribute("aria-label",`QR code: ${t}`),this.#o(t,e,o)}static get observedAttributes(){return["value","size"]}attributeChangedCallback(t,e,o){if(!this.#t||!this.isConnected)return;t==="value"&&o&&(this.#e=o);let i=this.#e||this.getAttribute("value")||"";if(!i)return;let r=parseInt(this.getAttribute("size")??"200",10)||200,s=parseInt(this.getAttribute("error-correction")??"1",10)||1;this.#t.width=r,this.#t.height=r,this.#t.setAttribute("aria-label",`QR code: ${i}`),this.#o(i,r,s)}#o(t,e,o){let i=w(t,o),r=this.#t.getContext("2d"),s=i.length,c=e/s,a=getComputedStyle(this),l=this.getAttribute("color")||a.color||"#000",f=this.getAttribute("background")||"transparent";r.clearRect(0,0,e,e),f!=="transparent"&&(r.fillStyle=f,r.fillRect(0,0,e,e)),r.fillStyle=l;for(let h=0;h<s;h++)for(let d=0;d<s;d++)i[h][d]&&r.fillRect(Math.round(d*c),Math.round(h*c),Math.ceil(c),Math.ceil(c));this.textContent="",this.appendChild(this.#t);let u=document.createElement("span");u.className="visually-hidden",u.textContent=t,this.appendChild(u)}toDataURL(t="image/png"){return this.#t?.toDataURL(t)??""}},g=[[[26,7],[44,10],[70,15],[100,20],[134,26],[172,18],[196,20],[242,24],[292,30],[346,18]],[[26,10],[44,16],[70,26],[100,18],[134,24],[172,16],[196,18],[242,22],[292,22],[346,26]],[[26,13],[44,22],[70,18],[100,26],[134,18],[172,24],[196,18],[242,22],[292,20],[346,28]],[[26,17],[44,28],[70,22],[100,16],[134,22],[172,28],[196,26],[242,26],[292,24],[346,28]]],E=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,52]];function w(n,t=1){let e=new TextEncoder().encode(n),o=M(e.length,t),i=g[t][o-1][0],r=g[t][o-1][1],s=i-r,c=C(e,o,s),a=v(c,s,r),l=o*4+17,f=Array.from({length:l},()=>new Uint8Array(l)),u=Array.from({length:l},()=>new Uint8Array(l));return F(f,u,l),S(f,u,o),$(f,u,l),B(u,l),D(f,u,a,l),O(f,u,l,t)}function M(n,t){for(let e=1;e<=10;e++){let o=g[t][e-1][0],i=g[t][e-1][1],r=o-i,s=e<=9?8:16,c=Math.ceil((4+s)/8);if(n<=r-c)return e}return 10}function C(n,t,e){let o=[],i=(u,h)=>{for(let d=h-1;d>=0;d--)o.push(u>>d&1)};i(4,4);let r=t<=9?8:16;i(n.length,r);for(let u of n)i(u,8);let s=e*8,c=Math.min(4,s-o.length);for(i(0,c);o.length%8!==0;)o.push(0);let a=[236,17],l=0;for(;o.length<s;)i(a[l%2],8),l++;let f=[];for(let u=0;u<o.length;u+=8){let h=0;for(let d=0;d<8;d++)h=h<<1|(o[u+d]||0);f.push(h)}return f}function v(n,t,e){let o=k(e),i=new Uint8Array(t+e);for(let s=0;s<t;s++)i[s]=n[s];for(let s=0;s<t;s++){let c=i[s];if(c===0)continue;let a=m[c];for(let l=0;l<o.length;l++)i[s+l]^=p[(a+m[o[l]])%255]}let r=[...n.slice(0,t)];for(let s=0;s<e;s++)r.push(i[t+s]);return r}var p=new Uint8Array(512),m=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)p[e]=t,m[t]=e,t<<=1,t>=256&&(t^=285);for(let e=255;e<512;e++)p[e]=p[e-255]})();function k(n){let t=new Uint8Array([1]);for(let e=0;e<n;e++){let o=new Uint8Array(t.length+1),i=e;for(let r=0;r<t.length;r++)o[r]^=t[r],o[r+1]^=p[(m[t[r]]+i)%255];t=o}return t}function F(n,t,e){let o=[[0,0],[e-7,0],[0,e-7]];for(let[i,r]of o){for(let s=0;s<7;s++)for(let c=0;c<7;c++){let a=s===0||s===6||c===0||c===6||s>=2&&s<=4&&c>=2&&c<=4;n[i+s][r+c]=a?1:0,t[i+s][r+c]=1}for(let s=-1;s<=7;s++)for(let[c,a]of[[s,-1],[s,7],[-1,s],[7,s]]){let l=i+c,f=r+a;l>=0&&l<e&&f>=0&&f<e&&(n[l][f]=0,t[l][f]=1)}}}function S(n,t,e){if(e<2)return;let o=E[e-1];for(let i of o)for(let r of o)if(!t[i][r])for(let s=-2;s<=2;s++)for(let c=-2;c<=2;c++){let a=Math.abs(s)===2||Math.abs(c)===2||s===0&&c===0;n[i+s][r+c]=a?1:0,t[i+s][r+c]=1}}function $(n,t,e){for(let o=8;o<e-8;o++){let i=o%2===0?1:0;t[6][o]||(n[6][o]=i,t[6][o]=1),t[o][6]||(n[o][6]=i,t[o][6]=1)}}function B(n,t){for(let e=0;e<=8;e++)e<t&&(n[8][e]=1),e<t&&(n[e][8]=1);for(let e=0;e<=7;e++)n[8][t-1-e]=1,n[t-1-e][8]=1;n[t-8][8]=1}function D(n,t,e,o){let i=[];for(let c of e)for(let a=7;a>=0;a--)i.push(c>>a&1);let r=0,s=!0;for(let c=o-1;c>=1;c-=2){c===6&&(c=5);let a=s?Array.from({length:o},(l,f)=>o-1-f):Array.from({length:o},(l,f)=>f);for(let l of a)for(let f of[c,c-1])f<0||f>=o||t[l][f]||(n[l][f]=r<i.length?i[r]:0,r++);s=!s}}var L=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107];function N(n,t){let o=[1,0,3,2][n]*8+t;return L[o]}var T=[(n,t)=>(n+t)%2===0,n=>n%2===0,(n,t)=>t%3===0,(n,t)=>(n+t)%3===0,(n,t)=>(Math.floor(n/2)+Math.floor(t/3))%2===0,(n,t)=>n*t%2+n*t%3===0,(n,t)=>(n*t%2+n*t%3)%2===0,(n,t)=>((n+t)%2+n*t%3)%2===0];function R(n,t,e,o){let i=n.map(s=>new Uint8Array(s)),r=T[o];for(let s=0;s<e;s++)for(let c=0;c<e;c++)!t[s][c]&&r(s,c)&&(i[s][c]^=1);return i}function I(n,t,e,o){let i=N(e,o),r=[[0,8],[1,8],[2,8],[3,8],[4,8],[5,8],[7,8],[8,8],[8,7],[8,5],[8,4],[8,3],[8,2],[8,1],[8,0]];for(let c=0;c<15;c++){let[a,l]=r[c];n[a][l]=i>>14-c&1}let s=[[8,t-1],[8,t-2],[8,t-3],[8,t-4],[8,t-5],[8,t-6],[8,t-7],[8,t-8],[t-7,8],[t-6,8],[t-5,8],[t-4,8],[t-3,8],[t-2,8],[t-1,8]];for(let c=0;c<15;c++){let[a,l]=s[c];n[a][l]=i>>14-c&1}n[t-8][8]=1}function _(n,t){let e=0;for(let o=0;o<t;o++){let i=1;for(let r=1;r<t;r++)n[o][r]===n[o][r-1]?(i++,i===5?e+=3:i>5&&(e+=1)):i=1}for(let o=0;o<t;o++){let i=1;for(let r=1;r<t;r++)n[r][o]===n[r-1][o]?(i++,i===5?e+=3:i>5&&(e+=1)):i=1}for(let o=0;o<t-1;o++)for(let i=0;i<t-1;i++){let r=n[o][i];r===n[o][i+1]&&r===n[o+1][i]&&r===n[o+1][i+1]&&(e+=3)}return e}function O(n,t,e,o){let i=1/0,r=null;for(let s=0;s<8;s++){let c=R(n,t,e,s);I(c,e,o,s);let a=_(c,e);a<i&&(i=a,r=c)}return r}A("qr-code",x);export{x as QrCodeWc};
2
2
  //# sourceMappingURL=qr-code.js.map