vanilla-breeze 0.4.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (282) hide show
  1. package/custom-elements.json +23012 -11383
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +9 -6
  5. package/dist/cdn/components/ai-summary.js +4 -2
  6. package/dist/cdn/components/analytics-panel.js +19 -21
  7. package/dist/cdn/components/audio-player.js +17 -7
  8. package/dist/cdn/components/audio-visualizer.js +3 -3
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -11
  16. package/dist/cdn/components/chart-wc.js +32 -32
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +50 -49
  23. package/dist/cdn/components/comment-thread.js +50 -49
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +170 -54
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +6 -2
  45. package/dist/cdn/components/icon-wc.js +11 -10
  46. package/dist/cdn/components/image-gallery.js +1 -1
  47. package/dist/cdn/components/image-map.js +1 -1
  48. package/dist/cdn/components/include-file.js +1 -1
  49. package/dist/cdn/components/manifest.json +101 -101
  50. package/dist/cdn/components/markdown-editor.js +60 -1
  51. package/dist/cdn/components/markdown-viewer.js +50 -49
  52. package/dist/cdn/components/nav-bar.js +1 -1
  53. package/dist/cdn/components/note-wc.js +6 -2
  54. package/dist/cdn/components/notification-wc.js +33 -32
  55. package/dist/cdn/components/page-info.js +6 -72
  56. package/dist/cdn/components/page-stats.js +1 -1
  57. package/dist/cdn/components/page-toc.js +1 -1
  58. package/dist/cdn/components/page-tools.js +1 -1
  59. package/dist/cdn/components/page-tour.js +1 -38
  60. package/dist/cdn/components/pager-wc.js +1 -1
  61. package/dist/cdn/components/poll-wc.js +1 -1
  62. package/dist/cdn/components/pop-over.js +1 -1
  63. package/dist/cdn/components/popularity-index.js +1 -8
  64. package/dist/cdn/components/print-page.js +1 -1
  65. package/dist/cdn/components/progress-tracker.js +1 -1
  66. package/dist/cdn/components/qr-code.js +1 -1
  67. package/dist/cdn/components/reaction-bar.js +1 -1
  68. package/dist/cdn/components/reader-view.js +25 -25
  69. package/dist/cdn/components/reading-progress.js +1 -1
  70. package/dist/cdn/components/recently-visited.js +1 -26
  71. package/dist/cdn/components/score-card.js +21 -5
  72. package/dist/cdn/components/selection-menu.js +1 -1
  73. package/dist/cdn/components/settings-panel.js +88 -142
  74. package/dist/cdn/components/share-wc.js +2 -2
  75. package/dist/cdn/components/short-cuts.js +1 -1
  76. package/dist/cdn/components/site-index.js +1 -10
  77. package/dist/cdn/components/site-map.js +1 -1
  78. package/dist/cdn/components/site-search.js +1 -51
  79. package/dist/cdn/components/slide-accept.js +1 -1
  80. package/dist/cdn/components/social-embed.js +1 -1
  81. package/dist/cdn/components/split-surface.js +1 -1
  82. package/dist/cdn/components/star-rating.js +1 -1
  83. package/dist/cdn/components/status-wc.js +1 -1
  84. package/dist/cdn/components/stepper-wc.js +1 -1
  85. package/dist/cdn/components/tab-set.js +1 -1
  86. package/dist/cdn/components/text-reader.js +2 -2
  87. package/dist/cdn/components/theme-picker.js +84 -81
  88. package/dist/cdn/components/time-index.js +1 -11
  89. package/dist/cdn/components/time-picker.js +1 -1
  90. package/dist/cdn/components/toast-msg.js +6 -6
  91. package/dist/cdn/components/tool-tip.js +1 -1
  92. package/dist/cdn/components/topic-map.js +6 -3
  93. package/dist/cdn/components/trust-filter.js +1 -3
  94. package/dist/cdn/components/version-switcher.js +5 -15
  95. package/dist/cdn/components/video-player.js +67 -9
  96. package/dist/cdn/components/watch-wc.js +6 -2
  97. package/dist/cdn/components/week-view.js +1 -1
  98. package/dist/cdn/components/youtube-player.js +1 -1
  99. package/dist/cdn/emoji-extended.js +2 -0
  100. package/dist/cdn/fonts/atkinson-hyperlegible-OFL.txt +93 -0
  101. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
  103. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
  105. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/latinmodern-math-GUST-LICENSE.txt +30 -0
  110. package/dist/cdn/fonts/latinmodern-math.woff2 +0 -0
  111. package/dist/cdn/fonts/math-fonts.css +14 -0
  112. package/dist/cdn/packs/effects.full.css +1 -1
  113. package/dist/cdn/packs/effects.full.js +1 -1
  114. package/dist/cdn/packs/fonts-display.full.css +1 -1
  115. package/dist/cdn/packs/fonts-display.theme.css +1 -1
  116. package/dist/cdn/packs/icons.bundle.js +1 -1
  117. package/dist/cdn/packs/icons.full.css +1 -1
  118. package/dist/cdn/packs/icons.theme.css +1 -1
  119. package/dist/cdn/packs/journal.effects.css +1 -1
  120. package/dist/cdn/packs/journal.full.css +1 -1
  121. package/dist/cdn/packs/kawaii.effects.css +1 -1
  122. package/dist/cdn/packs/kawaii.full.css +2 -2
  123. package/dist/cdn/packs/kawaii.full.js +6 -6
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +17 -17
  126. package/dist/cdn/packs/memphis.full.css +1 -1
  127. package/dist/cdn/packs/memphis.theme.css +1 -1
  128. package/dist/cdn/packs/ui.full.css +1 -1
  129. package/dist/cdn/packs/ui.full.js +88 -85
  130. package/dist/cdn/themes/8bit.css +1 -1
  131. package/dist/cdn/themes/8bit.tokens.json +1 -1
  132. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/alpha1999.css +1 -1
  134. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  135. package/dist/cdn/themes/art-deco-dark.tokens.json +33 -1
  136. package/dist/cdn/themes/art-deco.css +1 -1
  137. package/dist/cdn/themes/art-deco.tokens.json +23 -1
  138. package/dist/cdn/themes/bauhaus-dark.tokens.json +23 -1
  139. package/dist/cdn/themes/bauhaus.css +1 -1
  140. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  141. package/dist/cdn/themes/brutalist-dark.tokens.json +33 -1
  142. package/dist/cdn/themes/brutalist.css +1 -1
  143. package/dist/cdn/themes/brutalist.tokens.json +23 -1
  144. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  145. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  146. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  148. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  149. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  150. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  151. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  152. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  153. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/classic.css +1 -1
  155. package/dist/cdn/themes/classic.tokens.json +1 -1
  156. package/dist/cdn/themes/claymorphism-dark.tokens.json +33 -1
  157. package/dist/cdn/themes/claymorphism.css +1 -1
  158. package/dist/cdn/themes/claymorphism.tokens.json +24 -1
  159. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  160. package/dist/cdn/themes/clinical.css +1 -1
  161. package/dist/cdn/themes/clinical.tokens.json +1 -1
  162. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  163. package/dist/cdn/themes/cottagecore.css +1 -1
  164. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  165. package/dist/cdn/themes/cyber.css +1 -1
  166. package/dist/cdn/themes/cyber.tokens.json +1 -1
  167. package/dist/cdn/themes/dawn-dark.tokens.json +33 -1
  168. package/dist/cdn/themes/dawn.css +1 -1
  169. package/dist/cdn/themes/dawn.tokens.json +23 -1
  170. package/dist/cdn/themes/dracula.css +1 -1
  171. package/dist/cdn/themes/dracula.tokens.json +1 -1
  172. package/dist/cdn/themes/dusk.css +1 -1
  173. package/dist/cdn/themes/dusk.tokens.json +1 -1
  174. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  175. package/dist/cdn/themes/editorial.css +1 -1
  176. package/dist/cdn/themes/editorial.tokens.json +1 -1
  177. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  178. package/dist/cdn/themes/financial.css +1 -1
  179. package/dist/cdn/themes/financial.tokens.json +1 -1
  180. package/dist/cdn/themes/genai.css +1 -1
  181. package/dist/cdn/themes/genai.tokens.json +1 -1
  182. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  183. package/dist/cdn/themes/glassmorphism.css +1 -1
  184. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  185. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  186. package/dist/cdn/themes/government.css +1 -1
  187. package/dist/cdn/themes/government.tokens.json +1 -1
  188. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  189. package/dist/cdn/themes/gruvbox.css +1 -1
  190. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  191. package/dist/cdn/themes/high-noon-dark.tokens.json +23 -1
  192. package/dist/cdn/themes/high-noon.css +1 -1
  193. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  194. package/dist/cdn/themes/journal-dark.tokens.json +36 -2
  195. package/dist/cdn/themes/journal.css +1 -1
  196. package/dist/cdn/themes/journal.tokens.json +26 -2
  197. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/kawaii.css +1 -1
  199. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  200. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  201. package/dist/cdn/themes/magna.css +1 -1
  202. package/dist/cdn/themes/magna.tokens.json +1 -1
  203. package/dist/cdn/themes/manifest.json +44 -68
  204. package/dist/cdn/themes/midnight.css +1 -1
  205. package/dist/cdn/themes/midnight.tokens.json +1 -1
  206. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  207. package/dist/cdn/themes/minimal.css +1 -1
  208. package/dist/cdn/themes/minimal.tokens.json +1 -1
  209. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/modern.css +1 -1
  211. package/dist/cdn/themes/modern.tokens.json +1 -1
  212. package/dist/cdn/themes/nes-dark.tokens.json +7 -2
  213. package/dist/cdn/themes/nes.css +1 -1
  214. package/dist/cdn/themes/nes.tokens.json +1 -1
  215. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  216. package/dist/cdn/themes/neumorphism.css +1 -1
  217. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  218. package/dist/cdn/themes/nord-dark.tokens.json +33 -1
  219. package/dist/cdn/themes/nord.css +1 -1
  220. package/dist/cdn/themes/nord.tokens.json +23 -1
  221. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  222. package/dist/cdn/themes/organic.css +1 -1
  223. package/dist/cdn/themes/organic.tokens.json +1 -1
  224. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  225. package/dist/cdn/themes/rose-pine.css +1 -1
  226. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  227. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  228. package/dist/cdn/themes/rough.css +1 -1
  229. package/dist/cdn/themes/rough.tokens.json +1 -1
  230. package/dist/cdn/themes/solarized-dark.tokens.json +23 -1
  231. package/dist/cdn/themes/solarized.css +1 -1
  232. package/dist/cdn/themes/solarized.tokens.json +23 -1
  233. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  234. package/dist/cdn/themes/startup.css +1 -1
  235. package/dist/cdn/themes/startup.tokens.json +1 -1
  236. package/dist/cdn/themes/super2026-dark.tokens.json +33 -1
  237. package/dist/cdn/themes/super2026.css +1 -1
  238. package/dist/cdn/themes/super2026.tokens.json +23 -1
  239. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  240. package/dist/cdn/themes/swiss.css +1 -1
  241. package/dist/cdn/themes/swiss.tokens.json +1 -1
  242. package/dist/cdn/themes/terminal.css +1 -1
  243. package/dist/cdn/themes/terminal.tokens.json +1 -1
  244. package/dist/cdn/themes/tokyo-night-dark.tokens.json +33 -1
  245. package/dist/cdn/themes/tokyo-night.css +1 -1
  246. package/dist/cdn/themes/tokyo-night.tokens.json +23 -1
  247. package/dist/cdn/themes/vaporwave-dark.tokens.json +33 -1
  248. package/dist/cdn/themes/vaporwave.css +1 -1
  249. package/dist/cdn/themes/vaporwave.tokens.json +23 -1
  250. package/dist/cdn/themes/win9x-dark.tokens.json +20 -5
  251. package/dist/cdn/themes/win9x.css +1 -1
  252. package/dist/cdn/themes/win9x.tokens.json +3 -1
  253. package/dist/cdn/vanilla-breeze-autoload.js +553 -0
  254. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  255. package/dist/cdn/vanilla-breeze-charts.js +32 -32
  256. package/dist/cdn/vanilla-breeze-core.css +1 -1
  257. package/dist/cdn/vanilla-breeze-core.js +183 -281
  258. package/dist/cdn/vanilla-breeze-dev.css +1 -1
  259. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  260. package/dist/cdn/vanilla-breeze-extras.js +286 -134
  261. package/dist/cdn/vanilla-breeze.css +1 -1
  262. package/dist/cdn/vanilla-breeze.js +574 -656
  263. package/dist/cdn/view-transitions.css +2 -0
  264. package/package.json +17 -9
  265. package/dist/cdn/themes/amber.css +0 -2
  266. package/dist/cdn/themes/anthropic.css +0 -2
  267. package/dist/cdn/themes/anthropic.tokens.json +0 -564
  268. package/dist/cdn/themes/coral.css +0 -2
  269. package/dist/cdn/themes/emerald.css +0 -2
  270. package/dist/cdn/themes/forest.css +0 -2
  271. package/dist/cdn/themes/ibm.css +0 -2
  272. package/dist/cdn/themes/ibm.tokens.json +0 -568
  273. package/dist/cdn/themes/indigo.css +0 -2
  274. package/dist/cdn/themes/lavender.css +0 -2
  275. package/dist/cdn/themes/mcdonalds.css +0 -2
  276. package/dist/cdn/themes/mcdonalds.tokens.json +0 -533
  277. package/dist/cdn/themes/ocean.css +0 -2
  278. package/dist/cdn/themes/rose.css +0 -2
  279. package/dist/cdn/themes/slate.css +0 -2
  280. package/dist/cdn/themes/starbucks.css +0 -2
  281. package/dist/cdn/themes/starbucks.tokens.json +0 -593
  282. package/dist/cdn/themes/sunset.css +0 -2
@@ -1,3 +1,3 @@
1
- var y=window.matchMedia("(prefers-reduced-motion: reduce)");var g=new Map;function b(o,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},r=g.get(o);if(customElements.get(o)){if(!r||r.priority>=n){r&&r.priority===n&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=n){r.priority===n&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${r.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}g.set(o,s),customElements.define(o,t)}var d=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let n=this.#e.states;try{e?n.add(t):n.delete(t)}catch{let s=`--${t}`;e?n.add(s):n.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var f=class extends d{setup(){let t=this.getAttribute("data-lens-src")||this.getAttribute("src");t?this.#t(t).catch(()=>{}):this.#r()}async#t(t){let e;try{let s=await fetch(t);if(!s.ok)throw new Error(`status ${s.status}`);e=await s.json()}catch(s){this.#n(`Could not load ${t}: ${s.message}`);return}let n=Array.isArray(e)?e:e.pages||[];this.#e(n),this.#r()}#e(t){let e=new Map;for(let c of t){let a=c.author?.trim()||"Unknown";e.has(a)||e.set(a,[]),e.get(a).push(c)}let n=this.getAttribute("sort")||"alpha",s=[...e.entries()].sort(([c,a],[u,p])=>n==="count"?p.length-a.length:c.localeCompare(u)),r=[`<h2 class="author-index-heading">Authors <small>(${s.length})</small></h2>`];for(let[c,a]of s){let u=a[0],p=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");r.push(`<details data-author-group id="author-${p}">`),r.push(`<summary><span class="author-name">${l(c)}</span><span class="author-count" aria-label="${a.length} ${a.length===1?"page":"pages"}">(${a.length})</span></summary>`),u.authorUrl&&r.push(`<p class="author-link"><a href="${h(u.authorUrl)}" rel="author">View ${l(c)}'s profile</a></p>`),r.push('<ul class="author-pages">');for(let i of a){let m=[i.modified?`<time datetime="${h(i.modified)}">${l(i.modified)}</time>`:"",i.provenance?`<span class="author-prov" data-provenance="${h(i.provenance)}">${l(i.provenance)}</span>`:"",i.signed?'<span class="author-signed" title="Cryptographically signed">signed</span>':""].filter(Boolean).join(" \xB7 ");r.push(`<li><a href="${h(i.url)}">${l(i.title||i.url)}</a>${m?`<small>${m}</small>`:""}</li>`)}r.push("</ul></details>")}this.innerHTML=r.join(`
2
- `)}#n(t){if(this.children.length>0)return;let e=document.createElement("p");e.setAttribute("data-author-index-error",""),e.textContent=t,this.append(e)}#r(){if(!this.querySelector("[data-author-index-search]")){let t=this.getAttribute("placeholder")||"Filter authors\u2026",e=document.createElement("input");e.type="search",e.placeholder=t,e.setAttribute("data-author-index-search",""),e.setAttribute("aria-label",t),e.addEventListener("input",()=>this.#s(e.value)),this.prepend(e)}}#s(t){let e=t.trim().toLowerCase();for(let n of this.querySelectorAll("[data-author-group]")){let s=n,r=(s.textContent||"").toLowerCase();s.hidden=!!e&&!r.includes(e)}}};function l(o){return String(o??"").replace(/[&<>]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[t])}function h(o){return String(o??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}b("author-index",f);export{f as AuthorIndex};
1
+ var T=window.matchMedia("(prefers-reduced-motion: reduce)");var A=new Map;function x(o,t,e={}){let s=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:s},n=A.get(o);if(customElements.get(o)){if(!n||n.priority>=s){n&&n.priority===s&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=s){n.priority===s&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}A.set(o,r),customElements.define(o,t)}var m=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,s,r){t.addEventListener(e,s,r),this.#t.push(()=>t.removeEventListener(e,s,r))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let s=this.#e.states;try{e?s.add(t):s.delete(t)}catch{let r=`--${t}`;e?s.add(r):s.delete(r)}}_adoptInternals(t){this.#e||(this.#e=t)}#r(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};function b(o){return String(o??"").normalize("NFKD").replace(/\p{M}+/gu,"").toLowerCase()}function C(o){return b(o).replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"")||"author"}function N(o,t,e=()=>!1){let s=C(o),r=s;for(let n=2;t.has(r)||e(r);n++)r=`${s}-${n}`;return t.add(r),r}function S(o){let t=String(o??"").trim();if(!t)return null;try{let{protocol:e}=new URL(t,"https://author-index.invalid/");return e==="http:"||e==="https:"?t:null}catch{return null}}function q(o){let t=Number.parseInt(o??"",10);return Number.isInteger(t)?Math.min(6,Math.max(1,t)):2}function L(o){let t=o.cloneNode(!0);return t.querySelectorAll('.visually-hidden, [aria-hidden="true"]').forEach(e=>e.remove()),b(t.textContent||"")}var y=class extends m{#t=null;setup(){if(this.querySelector(":scope > [data-author-index-search]")){this.#n();return}let t=this.getAttribute("data-lens-src")||this.getAttribute("src");t?(this.#t=new AbortController,this.#e(t,this.#t.signal)):this.#n()}teardown(){this.#t?.abort(),this.#t=null}async#e(t,e){let s;try{let r=await fetch(t,{signal:e});if(!r.ok)throw new Error(`status ${r.status}`);let n=await r.json();if(s=Array.isArray(n)?n:n?.pages||[],!Array.isArray(s))throw new Error("no pages array")}catch(r){if(e.aborted)return;this.children.length>0?this.#n():this.#s(`Could not load ${t}: ${r instanceof Error?r.message:r}`);return}e.aborted||(this.#r(s),this.#n())}#r(t){let e=new Map;for(let l of t){if(!l||typeof l!="object")continue;let i=typeof l.author=="string"&&l.author.trim()||"Unknown";e.has(i)||e.set(i,[]),e.get(i).push(l)}let s=this.getAttribute("sort")==="count"?"count":"alpha",r=[...e.entries()].sort(([l,i],[g,f])=>s==="count"&&f.length!==i.length?f.length-i.length:l.localeCompare(g)),n=q(this.getAttribute("heading-level")),u=new Set,p=l=>{let i=document.getElementById(`author-${l}`);return!!i&&!this.contains(i)},a=[`<h${n} class="author-index-heading">Authors <small>(${r.length})</small></h${n}>`];for(let[l,i]of r){let g=i[0],f=N(l,u,p),M=`${i.length} ${i.length===1?"page":"pages"}`;a.push(`<details data-author-group id="author-${h(f)}">`),a.push(`<summary><span class="author-name">${d(l)}</span><span class="author-count"><span aria-hidden="true">(${i.length})</span><span class="visually-hidden">, ${M}</span></span></summary>`);let $=S(g.authorUrl);$&&a.push(`<p class="author-link"><a href="${h($)}" rel="author">View ${d(l)}'s profile</a></p>`),a.push('<ul class="author-pages">');for(let c of i){let w=[c.modified?`<time datetime="${h(c.modified)}">${d(c.modified)}</time>`:"",c.provenance?`<span class="author-prov" data-provenance="${h(c.provenance)}">${d(c.provenance)}</span>`:"",c.signed?'<span class="author-signed" title="Cryptographically signed">signed</span>':""].filter(Boolean).join(" \xB7 "),v=S(c.url),E=d(c.title||c.url||"Untitled"),k=v?`<a href="${h(v)}">${E}</a>`:`<span>${E}</span>`;a.push(`<li>${k}${w?`<small>${w}</small>`:""}</li>`)}a.push("</ul></details>")}this.innerHTML=a.join(`
2
+ `)}#s(t){let e=document.createElement("p");e.setAttribute("data-author-index-error",""),e.textContent=t,this.append(e)}#n(){let t=this.querySelector(":scope > [data-author-index-search]");if(!t){let r=this.getAttribute("placeholder")||"Filter authors\u2026";t=document.createElement("input"),t.type="search",t.placeholder=r,t.setAttribute("data-author-index-search",""),t.setAttribute("aria-label",r),this.prepend(t)}let e=this.querySelector(":scope > [data-author-index-status]");e||(e=document.createElement("p"),e.setAttribute("data-author-index-status",""),e.setAttribute("role","status"),e.className="visually-hidden",t.after(e));let s=t;this.listen(s,"input",()=>this.#o(s.value))}#o(t){let e=b(t.trim()),s=[...this.querySelectorAll("[data-author-group]")],r=0;for(let a of s)a.hidden=!!e&&!L(a).includes(e),a.hidden||r++;let n=this.querySelector(":scope > [data-author-index-status]");if(!n)return;let u=s.length,p=a=>a===1?"author":"authors";e?r===0?n.textContent=`No authors match \u201C${t.trim()}\u201D`:n.textContent=`${r} of ${u} ${p(u)} match \u201C${t.trim()}\u201D`:n.textContent=`Showing all ${u} ${p(u)}`,n.classList.toggle("visually-hidden",!(e&&r===0)),n.toggleAttribute("data-empty",!!e&&r===0)}};function d(o){return String(o??"").replace(/[&<>]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[t])}function h(o){return String(o??"").replace(/[&<>"]/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[t])}x("author-index",y);export{y as AuthorIndex,S as safeHref,C as slugify,N as uniqueSlug};
3
3
  //# sourceMappingURL=author-index.js.map
@@ -1,2 +1,2 @@
1
- var c=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,r,s){t.addEventListener(e,r,s),this.#t.push(()=>t.removeEventListener(e,r,s))}setup(){}teardown(){}setState(t,e){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{e?r.add(t):r.delete(t)}catch{let s=`--${t}`;e?r.add(s):r.delete(s)}}_adoptInternals(t){this.#e||(this.#e=t)}};var p=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(n,t,e={}){let r=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:r},i=u.get(n);if(customElements.get(n)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}u.set(n,s),customElements.define(n,t)}var h=class extends c{static observedAttributes=["src","src-dark","src-compact","alt","wordmark","height"];#t="";#e=null;#i=null;#s=!1;setup(){this.#t=this.#c(),this.hasAttribute("src-dark")&&this.#o(),this.#n()}teardown(){this.#e?.removeEventListener("change",this.#r),this.#e=null,this.#i?.disconnect(),this.#i=null,this.#s&&(window.removeEventListener("vb:theme-change",this.#r),this.#s=!1)}attributeChangedCallback(t,e,r){e!==r&&(!this.isConnected||!this.hasAttribute("data-upgraded")||(t==="src-dark"&&(r?this.#o():(this.#e?.removeEventListener("change",this.#r),this.#i?.disconnect(),this.#s&&(window.removeEventListener("vb:theme-change",this.#r),this.#s=!1))),this.#n()))}#a(){let t=document.documentElement.getAttribute("data-mode");if(t==="dark")return!0;if(t==="light")return!1;let e=getComputedStyle(this).colorScheme||"";return/\bdark\b/.test(e)&&!/\blight\b/.test(e)?!0:/\blight\b/.test(e)&&!/\bdark\b/.test(e)?!1:this.#e?.matches??!1}#o(){this.#e||(this.#e=matchMedia("(prefers-color-scheme: dark)"),this.#e.addEventListener("change",this.#r)),this.#i||(this.#i=new MutationObserver(()=>this.#r(void 0)),this.#i.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode","data-theme"]})),this.#s||(window.addEventListener("vb:theme-change",this.#r),this.#s=!0)}#r=()=>{this.isConnected&&this.#n()};#n(){let t=this.getAttribute("src"),e=this.getAttribute("src-dark"),r=e&&this.#a()?e:t;if(!r){this.#t&&this.querySelector("img")&&(this.replaceChildren(document.createTextNode(this.#t)),this.removeAttribute("aria-label"));return}let s=this.#t||this.getAttribute("alt")||"",i=this.hasAttribute("wordmark"),l=this.getAttribute("height");if(this.querySelector("img")?.getAttribute("src")===r){let o=this.querySelector(".brand-mark-wordmark");if(i&&!o){let d=document.createElement("span");d.className="brand-mark-wordmark",d.textContent=s,this.appendChild(d)}else!i&&o&&o.remove();return}let a=document.createElement("img");if(a.src=r,a.alt=i?"":s,a.decoding="async",l&&(a.height=parseInt(l,10)),i){let o=document.createElement("span");o.className="brand-mark-wordmark",o.textContent=s,this.replaceChildren(a,o)}else this.replaceChildren(a),this.getAttribute("alt")||this.setAttribute("aria-label",s)}#c(){let t="";for(let e of this.childNodes)(e.nodeType===Node.TEXT_NODE||e.nodeType===Node.ELEMENT_NODE&&e.tagName!=="IMG")&&(t+=e.textContent);return t.trim()}};f("brand-mark",h);
1
+ var a=class extends HTMLElement{#r=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#r)t();this.#r=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,r,i){t.addEventListener(e,r,i),this.#r.push(()=>t.removeEventListener(e,r,i))}_reinit(){for(let t of this.#r)t();this.#r=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{e?r.add(t):r.delete(t)}catch{let i=`--${t}`;e?r.add(i):r.delete(i)}}_adoptInternals(t){this.#t||(this.#t=t)}#e(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#e()?.validity}get validationMessage(){return this.#e()?.validationMessage??""}get willValidate(){return this.#e()?.willValidate??!1}get form(){return this.#e()?.form??null}checkValidity(){return this.#e()?.checkValidity()??!0}reportValidity(){return this.#e()?.reportValidity()??!0}};var p=window.matchMedia("(prefers-reduced-motion: reduce)");var h=new Map;function f(n,t,e={}){let r=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:r},s=h.get(n);if(customElements.get(n)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}h.set(n,i),customElements.define(n,t)}var u="data-brand-mark-img",m="(width < 48rem)",l=class extends a{static observedAttributes=["src","src-dark","src-compact","compact-media","alt","wordmark","height"];#r=null;#t=null;#e=null;#i=!1;setup(){this.#c(),this.hasAttribute("src-dark")&&this.#o(),this.#n(),this.#t=new MutationObserver(()=>this.#d()),this.#t.observe(this,{childList:!0,characterData:!0,subtree:!0})}teardown(){this.#r?.disconnect(),this.#r=null,this.#t?.disconnect(),this.#t=null,this.#e=null,this.#i=!1}attributeChangedCallback(t,e,r){if(e!==r&&!(!this.isConnected||!this.hasAttribute("data-upgraded"))){if(t==="height"){this.#c();return}t==="src-dark"&&r!==null&&this.#o(),this.#n()}}#u(){let t=document.documentElement.getAttribute("data-mode");if(t==="dark")return!0;if(t==="light")return!1;let e=getComputedStyle(this).colorScheme||"";return/\bdark\b/.test(e)&&!/\blight\b/.test(e)?!0:/\blight\b/.test(e)&&!/\bdark\b/.test(e)?!1:(this.#e??matchMedia("(prefers-color-scheme: dark)")).matches}#o(){this.#i||(this.#i=!0,this.#e=matchMedia("(prefers-color-scheme: dark)"),this.listen(this.#e,"change",this.#s),this.listen(window,"vb:theme-change",this.#s),this.#r=new MutationObserver(this.#s),this.#r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-mode","data-theme"]}))}#s=()=>{this.isConnected&&this.#n()};#c(){let t=this.getAttribute("height")?.trim();if(!t){this.style.removeProperty("--brand-mark-height"),this.getAttribute("style")||this.removeAttribute("style");return}this.style.setProperty("--brand-mark-height",/^\d+(\.\d+)?$/.test(t)?`${t}px`:t)}#a(){return this.querySelector(`:scope > [${u}]`)}#n(){let t=this.getAttribute("src"),e=this.#a();if(!t){e?.remove();return}let r=this.getAttribute("src-dark"),i=r&&this.#u()?r:t;if(!(e instanceof HTMLPictureElement)||!e.querySelector(":scope > img")){e?.remove(),e=document.createElement("picture"),e.setAttribute(u,"");let c=document.createElement("img");c.decoding="async",e.append(c),this.prepend(e)}let s=e.querySelector(":scope > img");s.getAttribute("src")!==i&&s.setAttribute("src",i);let d=this.getAttribute("src-compact"),o=e.querySelector(":scope > source");if(d){o||(o=document.createElement("source"),e.prepend(o));let c=this.getAttribute("compact-media")||m;o.getAttribute("media")!==c&&o.setAttribute("media",c),o.getAttribute("srcset")!==d&&o.setAttribute("srcset",d)}else o?.remove();this.#d()}#d(){let t=this.#a()?.querySelector(":scope > img");if(!t)return;let e=this.getAttribute("alt"),r=!this.hasAttribute("wordmark"),i;r&&e?i=e:this.#l()?i="":i=e??"",t.getAttribute("alt")!==i&&t.setAttribute("alt",i)}#l(){for(let t of this.childNodes)if(!(t instanceof Element&&t.hasAttribute(u))&&t.textContent?.trim())return!0;return!1}};f("brand-mark",l);
2
2
  //# sourceMappingURL=brand-mark.js.map
@@ -1,2 +1,2 @@
1
- var w=window.matchMedia("(prefers-reduced-motion: reduce)");var y=new Map;function E(i,e,r={}){let t=r.priority??10,o={impl:e,bundle:r.bundle,contract:r.contract,priority:t},n=y.get(i);if(customElements.get(i)){if(!n||n.priority>=t){n&&n.priority===t&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=t){n.priority===t&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}y.set(i,o),customElements.define(i,e)}var h=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,r,t,o){e.addEventListener(r,t,o),this.#e.push(()=>e.removeEventListener(r,t,o))}setup(){}teardown(){}setState(e,r){this.#t||(this.#t=this.attachInternals());let t=this.#t.states;try{r?t.add(e):t.delete(e)}catch{let o=`--${e}`;r?t.add(o):t.delete(o)}}_adoptInternals(e){this.#t||(this.#t=e)}};var g="Home",f=class extends h{#e={};setup(){this.hasAttribute("role")||this.setAttribute("role","navigation"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Breadcrumb"),this.hasAttribute("data-from-pathname")?this.#t():this.#i(),this.#n(),this.#r()}get labels(){return{...this.#e}}set labels(e){!e||typeof e!="object"||(this.#e={...e},this.hasAttribute("data-from-pathname")&&(this.#t(),this.#n(),this.#r()))}#t(){let r=window.location.pathname.split("/").filter(Boolean),t=document.createElement("ol"),o=document.createElement("li"),n=document.createElement("a");n.href="/",n.textContent=this.#e["/"]||this.#e.home||g,o.appendChild(n),t.appendChild(o);let c="";r.forEach((l,u)=>{c+=`/${l}`;let d=u===r.length-1,p=document.createElement("li"),m=`${c}/`,b=this.#e[m]||this.#e[c]||this.#e[l]||d&&this.dataset.currentLabel||this.#o(l);if(d){let s=document.createElement("span");s.setAttribute("aria-current","page"),s.textContent=b,p.appendChild(s)}else{let s=document.createElement("a");s.href=m,s.textContent=b,p.appendChild(s)}t.appendChild(p)});let a=this.querySelector(":scope > ol");a?a.replaceWith(t):this.prepend(t)}#o(e){return e.replace(/[-_]+/g," ").replace(/\w\S*/g,r=>r[0].toUpperCase()+r.slice(1))}#i(){if(this.querySelector(":scope > ol"))return;let r=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(r.length===0)return;let t=document.createElement("ol");r.forEach(o=>{let n=document.createElement("li");n.appendChild(o),t.appendChild(n)}),this.prepend(t)}#n(){let e=this.querySelectorAll(":scope > ol > li");e.length!==0&&e.forEach((r,t)=>{let o=t===e.length-1,n=r.querySelector("a, span");n&&(o?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"))})}#r(){if(this.dataset.jsonld==="off")return;let e=Array.from(this.querySelectorAll(":scope > ol > li"));if(e.length===0)return;let t={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:e.map((n,c)=>{let a=n.querySelector("a, span"),l=a?.textContent?.trim()||"",u=a?.getAttribute("href"),d=u?new URL(u,window.location.origin).href:void 0;return{"@type":"ListItem",position:c+1,name:l,...d?{item:d}:{}}})},o=this.querySelector(':scope > script[type="application/ld+json"]');o||(o=document.createElement("script"),o.type="application/ld+json",this.appendChild(o)),o.textContent=JSON.stringify(t)}};E("bread-crumb",f);
1
+ var k=window.matchMedia("(prefers-reduced-motion: reduce)");var E=new Map;function A(s,t,n={}){let e=n.priority??10,i={impl:t,bundle:n.bundle,contract:n.contract,priority:e},r=E.get(s);if(customElements.get(s)){if(!r||r.priority>=e){r&&r.priority===e&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${n.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${n.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=e){r.priority===e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${n.bundle}" (first wins at equal priority).`);return}E.set(s,i),customElements.define(s,t)}var u=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,n,e,i){t.addEventListener(n,e,i),this.#t.push(()=>t.removeEventListener(n,e,i))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,n){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{n?e.add(t):e.delete(t)}catch{let i=`--${t}`;n?e.add(i):e.delete(i)}}_adoptInternals(t){this.#e||(this.#e=t)}#n(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#n()?.validity}get validationMessage(){return this.#n()?.validationMessage??""}get willValidate(){return this.#n()?.willValidate??!1}get form(){return this.#n()?.form??null}checkValidity(){return this.#n()?.checkValidity()??!0}reportValidity(){return this.#n()?.reportValidity()??!0}};var S="Home",w="Show full path",p=":scope > ol > li:not([data-crumb-toggle])",L=4;function C(s){try{return decodeURIComponent(s)}catch{return s}}var m=class extends u{#t={};#e=!1;#n=!1;static get observedAttributes(){return["data-collapsed"]}setup(){this.#a(),this.hasAttribute("data-from-pathname")?this.#i():this.#l(),this.#s(),this.#r(),this.#o(),this.listen(this,"click",t=>{let e=(t.target instanceof Element?t.target:null)?.closest("[data-crumb-toggle] > button");if(!e||!this.contains(e))return;let i=e.getAttribute("aria-expanded")!=="true";e.setAttribute("aria-expanded",String(i)),this.dispatchEvent(new CustomEvent("bread-crumb:toggle",{bubbles:!0,detail:{expanded:i}}))})}attributeChangedCallback(t,n,e){n===e||!this.hasAttribute("data-upgraded")||t==="data-collapsed"&&this.#r()}get labels(){return{...this.#t}}set labels(t){!t||typeof t!="object"||(this.#t={...t},this.isConnected&&this.hasAttribute("data-from-pathname")&&(this.#i(),this.#s(),this.#r(),this.#o()))}#a(){if(!!this.parentElement?.closest('nav, [role="navigation"]')){this.#e&&this.removeAttribute("role"),this.#n&&this.removeAttribute("aria-label"),this.#e=!1,this.#n=!1;return}this.hasAttribute("role")||(this.setAttribute("role","navigation"),this.#e=!0),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&(this.setAttribute("aria-label","Breadcrumb"),this.#n=!0)}#i(){let n=window.location.pathname.split("/").filter(Boolean),e=document.createElement("ol"),i=document.createElement("li"),r=document.createElement("a");r.href="/",r.textContent=this.#t["/"]||this.#t.home||S,i.appendChild(r),e.appendChild(i);let o=this.dataset.currentLabel,a="";n.forEach((l,v)=>{a+=`/${l}`;let b=v===n.length-1,h=document.createElement("li"),f=`${a}/`,y=C(l),g=b&&o||this.#t[f]||this.#t[a]||this.#t[C(f)]||this.#t[y]||this.#t[l]||this.#c(y);if(b){let c=document.createElement("span");c.setAttribute("aria-current","page"),c.textContent=g,h.appendChild(c)}else{let c=document.createElement("a");c.href=f,c.textContent=g,h.appendChild(c)}e.appendChild(h)});let d=this.querySelector(":scope > ol");d?d.replaceWith(e):this.prepend(e)}#c(t){return t.replace(/[-_]+/g," ").replace(/\S+/g,n=>n[0].toUpperCase()+n.slice(1))}#l(){if(this.querySelector(":scope > ol"))return;let n=Array.from(this.querySelectorAll(":scope > a, :scope > span"));if(n.length===0)return;let e=document.createElement("ol");n.forEach(i=>{let r=document.createElement("li");r.appendChild(i),e.appendChild(r)}),this.prepend(e)}#s(){let t=this.querySelectorAll(p);t.length!==0&&t.forEach((n,e)=>{let i=e===t.length-1,r=n.querySelector("a, span");r&&(i?r.setAttribute("aria-current","page"):r.removeAttribute("aria-current"))})}#r(){let t=this.querySelector(":scope > ol"),n=t?.querySelector(":scope > li[data-crumb-toggle]"),e=this.querySelectorAll(p);if(!(!!t&&this.hasAttribute("data-collapsed")&&e.length>=L)){n?.remove();return}let r=n||document.createElement("li");if(!n){r.setAttribute("data-crumb-toggle","");let o=document.createElement("button");o.type="button",o.setAttribute("aria-expanded","false"),o.setAttribute("aria-label",w),o.textContent="\u2026",r.appendChild(o)}e[0].nextElementSibling!==r&&e[0].after(r)}#o(){if(this.dataset.jsonld==="off")return;let t=Array.from(this.querySelectorAll(p));if(t.length===0)return;let e={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((r,o)=>{let a=r.querySelector("a, span"),d=a?.textContent?.trim()||"",l=a instanceof HTMLAnchorElement&&a.hasAttribute("href")?a.href:void 0;return{"@type":"ListItem",position:o+1,name:d,...l?{item:l}:{}}})},i=this.querySelector(':scope > script[type="application/ld+json"]');i||(i=document.createElement("script"),i.type="application/ld+json",this.appendChild(i)),i.textContent=JSON.stringify(e)}};A("bread-crumb",m);
2
2
  //# sourceMappingURL=bread-crumb.js.map
@@ -1,3 +1,3 @@
1
- var tt=window.matchMedia("(prefers-reduced-motion: reduce)");var j=new Map;function z(a,t,e={}){let s=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:s},i=j.get(a);if(customElements.get(a)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${a}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${a}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}j.set(a,n),customElements.define(a,t)}var Y=class extends HTMLElement{#c=[];#a;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#c)t();this.#c=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,n){t.addEventListener(e,s,n),this.#c.push(()=>t.removeEventListener(e,s,n))}setup(){}teardown(){}setState(t,e){this.#a||(this.#a=this.attachInternals());let s=this.#a.states;try{e?s.add(t):s.delete(t)}catch{let n=`--${t}`;e?s.add(n):s.delete(n)}}_adoptInternals(t){this.#a||(this.#a=t)}};function I(a){let t=a.getFullYear(),e=String(a.getMonth()+1).padStart(2,"0"),s=String(a.getDate()).padStart(2,"0");return`${t}-${e}-${s}`}function $(a){if(!a)return null;let[t,e,s]=a.split("-").map(Number);return new Date(t,e-1,s)}function V(a,t){return new Date(a,t+1,0).getDate()}function M(a,t){return a&&t&&a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()}function G(a,t){let e=new Date(a);return e.setDate(e.getDate()+t),e}function Q(a,t){if(!t)return null;let e=$(t);if(!e)return null;let s=e;if(typeof a=="object"&&a)if(typeof a.end=="string"){let n=$(a.end);n&&n>=e&&(s=n)}else typeof a.days=="number"&&Number.isFinite(a.days)&&a.days>=1&&(s=G(e,Math.floor(a.days)-1));return{start:e,end:s,startISO:t,endISO:I(s),days:Math.round((s.getTime()-e.getTime())/864e5)+1}}function X(){try{let a=new Intl.Locale(navigator.language);if(a.weekInfo)return a.weekInfo.firstDay%7}catch{}return 0}function Z(a){return a?typeof a=="string"?[{label:a}]:Array.isArray(a)?a:typeof a=="object"?[a]:[]:[]}var P=new Map;function H(a,t="short"){let e=`${a}:${t}`;if(P.has(e))return P.get(e);let s=new Intl.DateTimeFormat(a,{weekday:t}),n=Array.from({length:7},(i,o)=>s.format(new Date(2026,0,4+o)));return P.set(e,n),n}var B=class extends Y{static formAssociated=!0;#c;#a="en-US";#e=new Date().getMonth();#t=new Date().getFullYear();#M=0;#g={};#o=null;#l=null;#k=new Set;#I=new Map;#y=null;#d=new Set;#n=null;#r=null;#w=null;#s="none";#T="default";#$=1;#L=null;get isDateDisallowed(){return this.#L}set isDateDisallowed(t){this.#L=t,this.#E&&this.#m()}#Y=null;get getDayParts(){return this.#Y}set getDayParts(t){this.#Y=t,this.#E&&this.#m()}get events(){return this.#g}set events(t){let e=this._normalizeEventsInput(t);this.#g!==e&&(this.#g=e,this.#E&&this.#m(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:e,source:"property"},bubbles:!0})))}_normalizeEventsInput(t){if(!t)return{};if(Array.isArray(t)){let e={};for(let s of t){let n=s?.date;n&&(e[n]||(e[n]=[]),e[n].push(s))}return e}return typeof t=="object"?t:{}}#E=!1;#N;#A;#f;#h;#u;#B;#i;#p;#b;#v=null;_detailCleanup=null;#D={dayToEvents:new Map,spans:[]};constructor(){super(),typeof this.attachInternals=="function"&&(this.#c=this.attachInternals(),this._adoptInternals(this.#c))}setup(){this.#a=this.closest("[lang]")?.lang||navigator.language;let t=new Date;this.#e=parseInt(this.getAttribute("data-month")??"",10)-1,isNaN(this.#e)&&(this.#e=t.getMonth()),this.#t=parseInt(this.getAttribute("data-year")??"",10),isNaN(this.#t)&&(this.#t=t.getFullYear()),this.#M=X(),this.#s=this.getAttribute("data-selection")||"none",this.#T=this.getAttribute("data-size")||"default",this.#$=Math.max(1,Math.min(12,parseInt(this.dataset.months??"",10)||1));let e=this.getAttribute("data-events");if(e)try{this.#g=JSON.parse(e)}catch{}this.#o=$(this.dataset.minDate),this.#l=$(this.dataset.maxDate);let s=this.getAttribute("data-disabled-dates");s&&s.split(",").forEach(i=>this.#k.add(i.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(i=>{let[o,l]=i.trim().split(":");this.#I.set(o,l||"")}),this.#_(),this.#m(),this.#E=!0}refresh(){this.#E&&this.#m()}#_(){this.#N=document.createElement("header"),this.#p=document.createElement("button"),this.#p.type="button",this.#p.setAttribute("aria-label","Previous month"),this.#p.textContent="\u2039",this.listen(this.#p,"click",()=>this.#O(-1)),this.#A=document.createElement("span"),this.#A.className="calendar-title",this.#A.setAttribute("aria-live","polite"),this.#f=document.createElement("span"),this.#f.className="calendar-month",this.#h=document.createElement("select"),this.#h.className="calendar-year",this.#h.setAttribute("aria-label","Year"),this.listen(this.#h,"change",()=>{this.#t=parseInt(this.#h.value,10),this.#m(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}),this.#u=document.createElement("span"),this.#u.className="calendar-year-wrap",this.#u.appendChild(this.#h),this.#A.append(this.#f," ",this.#u),this.#b=document.createElement("button"),this.#b.type="button",this.#b.setAttribute("aria-label","Next month"),this.#b.textContent="\u203A",this.listen(this.#b,"click",()=>this.#O(1)),this.#N.append(this.#p,this.#A,this.#b),this.appendChild(this.#N);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#i=document.createElement("div"),this.#i.className="cal-months",this.appendChild(this.#i),this.listen(this.#i,"click",e=>{let n=e.target?.closest("button[data-date]");if(!n||n.disabled)return;let i=n.getAttribute("data-date");if(i)if(this.#s!=="none")this.#q(i);else{let o=this.#D.dayToEvents.get(i)||[];o.length&&this.#H(i,o.map(l=>l.evt))}}),this.listen(this.#i,"keydown",e=>this.#R(e)),this.#s==="range"&&this.listen(this.#i,"mouseover",e=>{let n=e.target?.closest("button[data-date]");n&&this.#n&&!this.#r&&(this.#w=$(n.getAttribute("data-date")),this.#S())})}#j(){this.#h.innerHTML="";let t=new Date().getFullYear(),e=this.#o?this.#o.getFullYear():t-10,s=this.#l?this.#l.getFullYear():t+10;for(let n=e;n<=s;n++){let i=document.createElement("option");i.value=String(n),i.textContent=String(n),n===this.#t&&(i.selected=!0),this.#h.appendChild(i)}}#O(t){this.#e+=t,this.#e<0&&(this.#e=11,this.#t--),this.#e>11&&(this.#e=0,this.#t++),this.#m(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#t,month:this.#e+1}}))}#q(t){if(this.#s==="none")return;let e=$(t);if(e){if(this.#s==="single")this.#y=e,this.#S(),this.#F(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#n||this.#r)this.#n=e,this.#r=null,this.#w=null,this.dataset.tentative=I(this.#n);else{this.#r=e,this.#n&&this.#n>this.#r&&([this.#n,this.#r]=[this.#r,this.#n]),this.#w=null,delete this.dataset.tentative;let s=I(this.#n),n=I(this.#r);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${s}/${n}`,start:s,end:n,startDate:this.#n,endDate:this.#r}}))}this.#S(),this.#F()}else if(this.#s==="multi"){this.#d.has(t)?this.#d.delete(t):this.#d.add(t),this.#S(),this.#F();let s=[...this.#d].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:s,dates:s.map($)}}))}}}#F(){this.#c&&this.getAttribute("name")&&this.#c.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#y?I(this.#y):null;case"range":return this.#n&&this.#r?`${I(this.#n)}/${I(this.#r)}`:this.#n?I(this.#n):null;case"multi":return this.#d.size?[...this.#d].sort().join(" "):null;default:return null}}#S(){if(!this.#i)return;let t=this.#n,e=this.#r||this.#w;for(let s of this.#i.querySelectorAll("td")){let n=s.querySelector("button[data-date]");if(!n)continue;let i=n.getAttribute("data-date"),o=$(i);if(!(!o||!i)&&(s.removeAttribute("data-selected"),s.removeAttribute("data-range-start"),s.removeAttribute("data-range-end"),s.removeAttribute("data-in-range"),n.removeAttribute("aria-selected"),this.#s==="single"&&M(o,this.#y)&&(s.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="multi"&&this.#d.has(i)&&(s.setAttribute("data-selected",""),n.setAttribute("aria-selected","true")),this.#s==="range"&&t))if(e){let l=t<e?t:e,f=t<e?e:t;M(o,l)&&s.setAttribute("data-range-start",""),M(o,f)&&s.setAttribute("data-range-end",""),o>=l&&o<=f&&s.setAttribute("data-in-range","")}else M(o,t)&&s.setAttribute("data-range-start","")}}#x(t){let e=new Date(this.#t,this.#e+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#z(){let t=new Map,e=[];for(let[s,n]of Object.entries(this.#g||{})){let i=Z(n);for(let o of i){let l=Q(o,s);if(!l)continue;let f=l.days>1;f&&e.push({evt:o,range:l});let E=864e5;for(let C=l.start.getTime();C<=l.end.getTime();C+=E){let c=I(new Date(C)),y={evt:o,range:l,isSpan:f,isStart:c===l.startISO,isEnd:c===l.endISO};t.has(c)||t.set(c,[]),t.get(c).push(y)}}}return{dayToEvents:t,spans:e}}#m(){let t=this.#$;this.#D=this.#z();let e=new Intl.DateTimeFormat(this.#a,{month:"long"}),s=new Intl.DateTimeFormat(this.#a,{month:"long",year:"numeric"});try{let i=new Date(this.#t,this.#e,1);if(t===1)this.#f.textContent=e.format(i),this.#u&&(this.#u.style.display="");else{let o=this.#x(t-1);i.getFullYear()===o.year?this.#f.textContent=String(this.#t):this.#f.textContent=`${i.getFullYear()} \u2013 ${o.year}`,this.#u&&(this.#u.style.display="none")}}catch{this.#f.textContent=String(this.#e+1)}this.#j(),this.#p.disabled=!!(this.#o&&(this.#t<this.#o.getFullYear()||this.#t===this.#o.getFullYear()&&this.#e<=this.#o.getMonth()));let n=this.#x(t-1);this.#b.disabled=!!(this.#l&&(n.year>this.#l.getFullYear()||n.year===this.#l.getFullYear()&&n.month>=this.#l.getMonth())),this.setAttribute("data-month",String(this.#e+1)),this.setAttribute("data-year",String(this.#t)),this.#i.innerHTML="";for(let i=0;i<t;i++){let{year:o,month:l}=this.#x(i);if(t>1){let f=document.createElement("div");f.className="cal-month-column";let E=document.createElement("h4");E.className="cal-month-title",E.textContent=s.format(new Date(o,l,1)),f.appendChild(E);let C=this.#P(o,l);f.appendChild(C),this.#i.appendChild(f)}else{let f=this.#P(o,l);this.#i.appendChild(f)}}this.#B=this.#i.querySelector("table")}#P(t,e){let s=new Date,n=V(t,e),i=this.#T==="large",o=document.createElement("table");o.setAttribute("role","grid");try{let b=new Date(t,e,1),u=new Intl.DateTimeFormat(void 0,{month:"long"}).format(b);o.setAttribute("aria-label",`${u} ${t}`)}catch{}let l=document.createElement("thead"),f=document.createElement("tr"),E=H(this.#a,"short"),C=H(this.#a,"long");for(let b=0;b<7;b++){let u=(this.#M+b)%7,g=document.createElement("th");g.setAttribute("scope","col"),g.setAttribute("abbr",C[u]),g.textContent=E[u],f.appendChild(g)}l.appendChild(f),o.appendChild(l);let c=document.createElement("tbody"),y=1,h=document.createElement("tr");h.setAttribute("data-week",String(y));let r=(new Date(t,e,1).getDay()-this.#M+7)%7,d=V(t,e-1);for(let b=0;b<r;b++){let u=d-r+1+b,g=document.createElement("td");g.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(u));let A=document.createElement("span");A.className="day-number",A.textContent=String(u),m.appendChild(A),g.appendChild(m),h.appendChild(g)}let w=this.#n,p=this.#r||this.#w;for(let b=1;b<=n;b++){let u=new Date(t,e,b),g=I(u),m=document.createElement("td"),A=document.createElement("button");A.type="button",A.setAttribute("data-date",g);let O=document.createElement("span");if(O.className="day-number",O.textContent=String(b),A.appendChild(O),A.setAttribute("data-day",String(b)),M(u,s)&&(A.setAttribute("aria-current","date"),m.setAttribute("data-today","")),this.#s==="single"&&M(u,this.#y)&&(A.setAttribute("aria-selected","true"),m.setAttribute("data-selected","")),this.#s==="multi"&&this.#d.has(g)&&(A.setAttribute("aria-selected","true"),m.setAttribute("data-selected","")),this.#s==="range"&&w&&p){let x=w<p?w:p,L=w<p?p:w;M(u,x)&&m.setAttribute("data-range-start",""),M(u,L)&&m.setAttribute("data-range-end",""),u>=x&&u<=L&&m.setAttribute("data-in-range","")}else this.#s==="range"&&w&&M(u,w)&&m.setAttribute("data-range-start","");let R=this.#o&&u<this.#o,U=this.#l&&u>this.#l,W=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(u);if((this.#k.has(g)||R||U||W)&&(A.setAttribute("aria-disabled","true"),A.disabled=!0),this.#I.has(g)&&A.setAttribute("data-highlight",this.#I.get(g)||""),typeof this.getDayParts=="function"){let x=this.getDayParts(u);x!=null&&(m.dataset.dayPart=Array.isArray(x)?x.join(" "):x)}let k=this.#D.dayToEvents.get(g)||[];if(k.length){m.setAttribute("data-events",""),m.setAttribute("data-event-count",String(k.length));let x=i?k.filter(D=>!D.isSpan):k,L=k.map(D=>D.evt);if(i){if(x.length){let D=document.createElement("span");D.className="event-list";let T=2;if(x.slice(0,T).forEach(({evt:v})=>{let F=document.createElement("span");if(F.className="event-item",v.color&&F.style.setProperty("--event-color",v.color),v.icon){let q=document.createElement("icon-wc");q.setAttribute("name",v.icon),q.setAttribute("size","xs"),F.appendChild(q)}let _=document.createElement("span");_.textContent=v.time?`${v.time} ${v.label}`:v.label,F.appendChild(_),D.appendChild(F)}),x.length>T){let v=document.createElement("span");v.className="event-more",v.textContent=`+${x.length-T} more`,D.appendChild(v)}A.appendChild(D)}}else{let D=document.createElement("span");D.className="event-dots",D.setAttribute("aria-hidden","true");let T=Math.min(k.length,3);for(let v=0;v<T;v++){let F=document.createElement("span");F.setAttribute("data-event-dot",""),k[v].evt.color&&F.style.setProperty("--event-color",k[v].evt.color),D.appendChild(F)}m.appendChild(D)}let J=L.map(D=>D.time?`${D.time} \u2014 ${D.label}`:D.label);A.setAttribute("title",J.join(`
2
- `))}let K=b===1||M(u,s);A.setAttribute("tabindex",K?"0":"-1"),m.insertBefore(A,m.firstChild),h.appendChild(m),(r+b)%7===0&&(c.appendChild(h),y++,h=document.createElement("tr"),h.setAttribute("data-week",String(y)))}let N=(r+n)%7;if(N>0){for(let b=1;b<=7-N;b++){let u=document.createElement("td");u.setAttribute("data-outside-month","");let g=document.createElement("button");g.type="button",g.disabled=!0,g.setAttribute("tabindex","-1"),g.setAttribute("data-day",String(b));let m=document.createElement("span");m.className="day-number",m.textContent=String(b),g.appendChild(m),u.appendChild(g),h.appendChild(u)}c.appendChild(h)}return o.appendChild(c),i&&this.#D.spans.length&&this.#V(c,t,e),o}#V(t,e,s){let n=[...t.querySelectorAll("tr")],i=new Intl.DateTimeFormat(this.#a,{month:"short",day:"numeric"});for(let o of n){let l=[...o.querySelectorAll("td")];if(!l.length)continue;let f=l.findIndex(r=>r.querySelector("button[data-date]")),E=l.map((r,d)=>{let w=r.querySelector("button"),p=w?.getAttribute("data-date");if(p)return $(p);let N=parseInt(w?.getAttribute("data-day")||"0",10);return f>=0&&d<f?new Date(e,s-1,N):new Date(e,s+1,N)}),C=E[0],c=E[E.length-1];if(!C||!c)continue;let y=[];for(let{evt:r,range:d}of this.#D.spans){if(d.end<C||d.start>c)continue;let w=d.start<C?0:E.findIndex(N=>M(N,d.start)),p=d.end>c?E.length-1:E.findIndex(N=>M(N,d.end));w<0||p<0||y.push({evt:r,range:d,startCol:w,endCol:p,continuesLeft:d.start<C,continuesRight:d.end>c})}if(!y.length)continue;y.sort((r,d)=>r.startCol-d.startCol||d.endCol-d.startCol-(r.endCol-r.startCol));let h=[];for(let r of y){let d=0;for(;d<h.length&&h[d]>=r.startCol;)d++;r.lane=d,h[d]=r.endCol}let S=h.length;o.style.setProperty("--cal-row-lanes",String(S)),o.setAttribute("data-row-lanes",String(S));for(let r of y){let d=l[r.startCol],w=r.endCol-r.startCol+1,p=document.createElement("span");p.className="event-span",p.style.setProperty("--span-cells",String(w)),p.style.setProperty("--span-lane",String(r.lane)),r.evt.color&&p.style.setProperty("--event-color",r.evt.color),r.continuesLeft&&p.setAttribute("data-continues-start",""),r.continuesRight&&p.setAttribute("data-continues-end",""),p.textContent=r.evt.label||"",p.setAttribute("title",`${r.evt.label} \u2014 ${i.format(r.range.start)} to ${i.format(r.range.end)}`),d.appendChild(p)}}}#H(t,e){this.#C();let s=$(t)??new Date,n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog"),n.setAttribute("aria-label",`Events for ${t}`);let i=document.createElement("header"),o=document.createElement("h3");try{o.textContent=new Intl.DateTimeFormat(void 0,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(s)}catch{o.textContent=t}let l=document.createElement("button");if(l.type="button",l.setAttribute("aria-label","Close"),l.textContent="\xD7",l.addEventListener("click",()=>this.#C()),i.append(o,l),n.appendChild(i),e.some(c=>c.time)){let c=document.createElement("day-view");c.dataset.date=t,c.dataset.startHour="auto",c.dataset.compact="";let y=new Intl.DateTimeFormat(this.#a,{hour:"numeric",minute:"2-digit"});e.forEach(h=>{let S=document.createElement("calendar-event");if(h.color&&S.style.setProperty("--event-color",h.color),h.icon){let r=document.createElement("icon-wc");r.setAttribute("name",h.icon),r.setAttribute("size","sm"),S.appendChild(r)}if(h.time){let r=document.createElement("time");r.setAttribute("datetime",h.time);try{let[d,w]=h.time.split(":"),p=new Date(2026,0,1,parseInt(d,10),parseInt(w,10));r.textContent=y.format(p)}catch{r.textContent=h.time}S.appendChild(r)}S.append(h.label||""),c.appendChild(S)}),n.appendChild(c)}else{let c=document.createElement("ul");c.className="detail-list",e.forEach(y=>{let h=document.createElement("li");y.color&&h.style.setProperty("--event-color",y.color);let S=document.createElement("span");S.className="detail-dot";let r=document.createElement("span");if(r.className="detail-content",y.icon){let w=document.createElement("icon-wc");w.setAttribute("name",y.icon),w.setAttribute("size","sm"),r.appendChild(w)}let d=document.createElement("span");d.className="detail-label",d.textContent=y.label||"",r.append(d),h.append(S,r),c.appendChild(h)}),n.appendChild(c)}this.appendChild(n),this.#v=n;let E=c=>{c.key==="Escape"&&this.#C()},C=c=>{n.contains(c.target)||this.#C()};this._detailCleanup=()=>{document.removeEventListener("keydown",E),document.removeEventListener("mousedown",C)},document.addEventListener("keydown",E),requestAnimationFrame(()=>{document.addEventListener("mousedown",C)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#C(){this.#v&&(this._detailCleanup?.(),this._detailCleanup=null,this.#v.remove(),this.#v=null)}teardown(){delete this.dataset.tentative,this.#C()}#R(t){let e=this.#i.querySelector('button[tabindex="0"]');if(!e)return;let s=e.getAttribute("data-date"),n=$(s);if(!n)return;let i;switch(t.key){case"ArrowRight":i=new Date(n),i.setDate(n.getDate()+1);break;case"ArrowLeft":i=new Date(n),i.setDate(n.getDate()-1);break;case"ArrowDown":i=new Date(n),i.setDate(n.getDate()+7);break;case"ArrowUp":i=new Date(n),i.setDate(n.getDate()-7);break;case"Enter":case" ":t.preventDefault(),e.disabled||this.#q(s);return;default:return}if(t.preventDefault(),this.#o&&i<this.#o||this.#l&&i>this.#l)return;let o=i.getMonth(),l=i.getFullYear(),f=this.#x(this.#$-1);(l>this.#t||l===this.#t&&o>=this.#e)&&(l<f.year||l===f.year&&o<=f.month)||(this.#e=o,this.#t=l,this.#m());let C=I(i),c=this.#i.querySelector(`button[data-date="${C}"]`);c&&(this.#i.querySelectorAll('button[tabindex="0"]').forEach(y=>y.setAttribute("tabindex","-1")),c.setAttribute("tabindex","0"),c.focus())}};z("calendar-wc",B);export{B as CalendarWc};
1
+ var et=window.matchMedia("(prefers-reduced-motion: reduce)");var j=new Map;function z(r,t,e={}){let s=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:s},i=j.get(r);if(customElements.get(r)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}j.set(r,n),customElements.define(r,t)}var O=class extends HTMLElement{#c=[];#i;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let t of this.#c)t();this.#c=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(t,e,s,n){t.addEventListener(e,s,n),this.#c.push(()=>t.removeEventListener(e,s,n))}_reinit(){for(let t of this.#c)t();this.#c=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#i||(this.#i=this.attachInternals());let s=this.#i.states;try{e?s.add(t):s.delete(t)}catch{let n=`--${t}`;e?s.add(n):s.delete(n)}}_adoptInternals(t){this.#i||(this.#i=t)}#t(){return this.constructor.formAssociated&&this.#i?this.#i:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}};function R(r,t="en-US"){try{if(r)return Intl.getCanonicalLocales(r),r}catch{}try{return Intl.getCanonicalLocales(t),t}catch{return"en-US"}}function x(r){let t=r.getFullYear(),e=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return`${t}-${e}-${s}`}function $(r){if(!r)return null;let[t,e,s]=r.split("-").map(Number);return new Date(t,e-1,s)}function U(r,t){return new Date(r,t+1,0).getDate()}function N(r,t){return r&&t&&r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function Y(r,t){let e=new Date(r);return e.setDate(e.getDate()+t),e}function X(r,t){if(!t)return null;let e=$(t);if(!e)return null;let s=e;if(typeof r=="object"&&r)if(typeof r.end=="string"){let n=$(r.end);n&&n>=e&&(s=n)}else typeof r.days=="number"&&Number.isFinite(r.days)&&r.days>=1&&(s=Y(e,Math.floor(r.days)-1));return{start:e,end:s,startISO:t,endISO:x(s),days:Math.round((s.getTime()-e.getTime())/864e5)+1}}function Q(r){try{let t=new Intl.Locale(r),e=t.getWeekInfo?.()??t.weekInfo;if(e)return e.firstDay%7}catch{}return 0}var Z=0;function tt(r){return r?typeof r=="string"?[{label:r}]:Array.isArray(r)?r:typeof r=="object"?[r]:[]:[]}var _=new Map;function H(r,t="short"){let e=`${r}:${t}`;if(_.has(e))return _.get(e);let s=new Intl.DateTimeFormat(r,{weekday:t}),n=Array.from({length:7},(i,a)=>s.format(new Date(2026,0,4+a)));return _.set(e,n),n}var B=class extends O{static formAssociated=!0;#c;#i="en-US";#t=new Date().getMonth();#e=new Date().getFullYear();#F=0;#A={};#o=null;#l=null;#k=new Set;#M=new Map;#f=null;#h=new Set;#a=null;#r=null;#w=null;#s="none";#B="default";#L=1;#I=null;#T=!1;#O=!1;static get observedAttributes(){return["data-month","data-year","data-events"]}attributeChangedCallback(t,e,s){if(!this.#p||this.#O||e===s)return;if(t==="data-events"){let h={};if(s)try{h=JSON.parse(s)}catch{return}this.#T=!1,this.#A=h,this.#d(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:h,source:"attribute"},bubbles:!0}));return}let n=parseInt(this.getAttribute("data-month")??"",10)-1,i=parseInt(this.getAttribute("data-year")??"",10),a=n>=0&&n<=11?n:this.#t,o=Number.isFinite(i)?i:this.#e;a===this.#t&&o===this.#e||(this.#t=a,this.#e=o,this.#d())}#V=null;get isDateDisallowed(){return this.#V}set isDateDisallowed(t){this.#V=t,this.#p&&this.#d()}#j=null;get getDayParts(){return this.#j}set getDayParts(t){this.#j=t,this.#p&&this.#d()}get events(){return this.#A}set events(t){let e=this._normalizeEventsInput(t);this.#A!==e&&(this.#A=e,this.#T=!0,this.#p&&this.#d(),this.dispatchEvent(new CustomEvent("calendar-wc:events-changed",{detail:{events:e,source:"property"},bubbles:!0})))}_normalizeEventsInput(t){if(!t)return{};if(Array.isArray(t)){let e={};for(let s of t){let n=s?.date;n&&(e[n]||(e[n]=[]),e[n].push(s))}return e}return typeof t=="object"?t:{}}#p=!1;#E;#C;#b;#u;#m;#H;#n;#g;#y;#Y=null;#P=null;#v=null;_detailCleanup=null;#D={dayToEvents:new Map,spans:[]};constructor(){super(),typeof this.attachInternals=="function"&&(this.#c=this.attachInternals(),this._adoptInternals(this.#c))}setup(){this.#i=R(this.closest("[lang]")?.lang||navigator.language);let t=new Date;this.#t=parseInt(this.getAttribute("data-month")??"",10)-1,isNaN(this.#t)&&(this.#t=t.getMonth()),this.#e=parseInt(this.getAttribute("data-year")??"",10),isNaN(this.#e)&&(this.#e=t.getFullYear()),this.#F=Q(this.#i),this.#s=this.getAttribute("data-selection")||"none",this.#B=this.getAttribute("data-size")||"default",this.#L=Math.max(1,Math.min(12,parseInt(this.dataset.months??"",10)||1));let e=this.getAttribute("data-events");if(e&&!this.#T)try{this.#A=JSON.parse(e)}catch{}this.#o=$(this.dataset.minDate),this.#l=$(this.dataset.maxDate),this.#k.clear(),this.#M.clear();let s=this.getAttribute("data-disabled-dates");s&&s.split(",").forEach(i=>this.#k.add(i.trim()));let n=this.getAttribute("data-highlight-dates");n&&n.split(",").forEach(i=>{let[a,o]=i.trim().split(":");this.#M.set(a,o||"")}),this.#G(),this.#d(),this.#p=!0}refresh(){this.#p&&this.#d()}#S(t,e){return this.dataset[`label${t}`]||e}#G(){this.#E=document.createElement("header"),this.#g=document.createElement("button"),this.#g.type="button",this.#g.setAttribute("aria-label",this.#S("Prev","Previous month")),this.#g.textContent="\u2039",this.listen(this.#g,"click",()=>this.#z(-1)),this.#C=document.createElement("span"),this.#C.className="calendar-title",this.#C.setAttribute("aria-live","polite"),this.#b=document.createElement("span"),this.#b.className="calendar-month",this.#u=document.createElement("select"),this.#u.className="calendar-year",this.#u.setAttribute("aria-label",this.#S("Year","Year")),this.listen(this.#u,"change",()=>{this.#e=parseInt(this.#u.value,10),this.#d(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#e,month:this.#t+1}}))}),this.#m=document.createElement("span"),this.#m.className="calendar-year-wrap",this.#m.appendChild(this.#u),this.#C.append(this.#b," ",this.#m),this.#y=document.createElement("button"),this.#y.type="button",this.#y.setAttribute("aria-label",this.#S("Next","Next month")),this.#y.textContent="\u203A",this.listen(this.#y,"click",()=>this.#z(1)),this.#E.append(this.#g,this.#C,this.#y),this.appendChild(this.#E);let t=document.createElement("div");t.className="calendar-banner",t.setAttribute("aria-hidden","true"),this.appendChild(t),this.#Y=t,this.#n=document.createElement("div"),this.#n.className="cal-months",this.appendChild(this.#n),this.listen(this.#n,"click",e=>{let n=e.target?.closest("button[data-date]");if(!n||n.disabled)return;let i=n.getAttribute("data-date");if(i)if(this.#s!=="none")this.#K(i);else{let a=this.#D.dayToEvents.get(i)||[];a.length&&this.#Z(i,a.map(o=>o.evt))}}),this.listen(this.#n,"keydown",e=>this.#tt(e)),this.listen(this.#n,"focusin",e=>{let n=e.target?.closest?.("button[data-date]");n&&(this.#I=n.getAttribute("data-date"),this.#_())}),this.listen(this,"keydown",e=>{e.key==="Escape"&&this.#v&&(e.stopPropagation(),this.#x(!0))}),this.#s==="range"&&this.listen(this.#n,"mouseover",e=>{let n=e.target?.closest("button[data-date]");n&&this.#a&&!this.#r&&(this.#w=$(n.getAttribute("data-date")),this.#N())})}#W(){let t=parseInt(this.getAttribute("data-year-range")??"",10);return Number.isFinite(t)&&t>=0?Math.min(t,200):10}#J(){this.#u.innerHTML="";let t=new Date().getFullYear(),e=this.#W(),s=Math.min(this.#e,this.#o?this.#o.getFullYear():t-e),n=Math.max(this.#e,this.#l?this.#l.getFullYear():t+e);for(let i=s;i<=n;i++){let a=document.createElement("option");a.value=String(i),a.textContent=String(i),i===this.#e&&(a.selected=!0),this.#u.appendChild(a)}}#z(t){this.#t+=t,this.#t<0&&(this.#t=11,this.#e--),this.#t>11&&(this.#t=0,this.#e++),this.#d(),this.dispatchEvent(new CustomEvent("calendar:navigate",{bubbles:!0,detail:{year:this.#e,month:this.#t+1}}))}#K(t){if(this.#s==="none")return;let e=$(t);if(e){if(this.#s==="single")this.#f=e,this.#N(),this.#q(),this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:t,date:e}}));else if(this.#s==="range"){if(!this.#a||this.#r)this.#a=e,this.#r=null,this.#w=null,this.setAttribute("data-tentative",x(this.#a));else{this.#r=e,this.#a&&this.#a>this.#r&&([this.#a,this.#r]=[this.#r,this.#a]),this.#w=null,this.removeAttribute("data-tentative");let s=x(this.#a),n=x(this.#r);this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{value:`${s}/${n}`,start:s,end:n,startDate:this.#a,endDate:this.#r}}))}this.#N(),this.#q()}else if(this.#s==="multi"){this.#h.has(t)?this.#h.delete(t):this.#h.add(t),this.#N(),this.#q();let s=[...this.#h].sort();this.dispatchEvent(new CustomEvent("calendar:select",{bubbles:!0,detail:{values:s,dates:s.map($)}}))}}}#q(){this.#c&&this.getAttribute("name")&&this.#c.setFormValue(this.value)}get value(){switch(this.#s){case"single":return this.#f?x(this.#f):null;case"range":return this.#a&&this.#r?`${x(this.#a)}/${x(this.#r)}`:this.#a?x(this.#a):null;case"multi":return this.#h.size?[...this.#h].sort().join(" "):null;default:return null}}#N(){if(!this.#n)return;let t=this.#a,e=this.#r||this.#w;for(let s of this.#n.querySelectorAll("td")){let n=s.querySelector("button[data-date]");if(!n)continue;let i=n.getAttribute("data-date"),a=$(i);if(!(!a||!i)){if(s.removeAttribute("data-selected"),s.removeAttribute("data-range-start"),s.removeAttribute("data-range-end"),s.removeAttribute("data-in-range"),this.#s==="single"&&N(a,this.#f)&&s.setAttribute("data-selected",""),this.#s==="multi"&&this.#h.has(i)&&s.setAttribute("data-selected",""),this.#s==="range"&&t)if(e){let o=t<e?t:e,h=t<e?e:t;N(a,o)&&s.setAttribute("data-range-start",""),N(a,h)&&s.setAttribute("data-range-end",""),a>=o&&a<=h&&s.setAttribute("data-in-range","")}else N(a,t)&&s.setAttribute("data-range-start","");this.#R(s)}}}#R(t){if(this.#s==="none"){t.removeAttribute("aria-selected");return}let e=t.hasAttribute("data-selected")||t.hasAttribute("data-in-range")||t.hasAttribute("data-range-start")||t.hasAttribute("data-range-end");t.setAttribute("aria-selected",String(e))}#_(){if(!this.#n)return;let t=[...this.#n.querySelectorAll("button[data-date]")],e=t.filter(a=>!a.disabled),s=a=>a?e.find(o=>o.getAttribute("data-date")===a):void 0,n=null;this.#s==="single"&&this.#f?n=x(this.#f):this.#s==="range"&&this.#a?n=x(this.#a):this.#s==="multi"&&this.#h.size&&(n=[...this.#h].sort()[0]);let i=s(this.#I)||s(n)||e.find(a=>a.getAttribute("aria-current")==="date")||e[0];for(let a of t)a.setAttribute("tabindex",a===i?"0":"-1")}#$(t){let e=new Date(this.#e,this.#t+t,1);return{year:e.getFullYear(),month:e.getMonth()}}#X(){let t=new Map,e=[];for(let[s,n]of Object.entries(this.#A||{})){let i=tt(n);for(let a of i){let o=X(a,s);if(!o)continue;let h=o.days>1;h&&e.push({evt:a,range:o});for(let w=new Date(o.start),b=0;b<o.days;w=Y(w,1),b++){let p=x(w),d={evt:a,range:o,isSpan:h,isStart:p===o.startISO,isEnd:p===o.endISO};t.has(p)||t.set(p,[]),t.get(p).push(d)}}}return{dayToEvents:t,spans:e}}#d(){let t=this.#L;this.#D=this.#X();let e=new Intl.DateTimeFormat(this.#i,{month:"long"}),s=new Intl.DateTimeFormat(this.#i,{month:"long",year:"numeric"});try{let i=new Date(this.#e,this.#t,1);if(t===1)this.#b.textContent=e.format(i),this.#m&&(this.#m.style.display="");else{let a=this.#$(t-1);i.getFullYear()===a.year?this.#b.textContent=String(this.#e):this.#b.textContent=`${i.getFullYear()} \u2013 ${a.year}`,this.#m&&(this.#m.style.display="none")}}catch{this.#b.textContent=String(this.#t+1)}this.#J(),this.#g.disabled=!!(this.#o&&(this.#e<this.#o.getFullYear()||this.#e===this.#o.getFullYear()&&this.#t<=this.#o.getMonth()));let n=this.#$(t-1);this.#y.disabled=!!(this.#l&&(n.year>this.#l.getFullYear()||n.year===this.#l.getFullYear()&&n.month>=this.#l.getMonth())),this.#O=!0,this.setAttribute("data-month",String(this.#t+1)),this.setAttribute("data-year",String(this.#e)),this.#O=!1,this.#n.innerHTML="";for(let i=0;i<t;i++){let{year:a,month:o}=this.#$(i);if(t>1){let h=document.createElement("div");h.className="cal-month-column";let w=parseInt(this.getAttribute("data-heading-level")??"",10),b=document.createElement(w>=1&&w<=6?`h${w}`:"span");b.className="cal-month-title",b.textContent=s.format(new Date(a,o,1)),h.appendChild(b);let p=this.#U(a,o);h.appendChild(p),this.#n.appendChild(h)}else{let h=this.#U(a,o);this.#n.appendChild(h)}}this.#H=this.#n.querySelector("table"),this.#_()}#U(t,e){let s=new Date,n=U(t,e),i=this.#B==="large",a=document.createElement("table");a.setAttribute("role","grid"),(this.#s==="multi"||this.#s==="range")&&a.setAttribute("aria-multiselectable","true");try{let g=new Date(t,e,1);a.setAttribute("aria-label",new Intl.DateTimeFormat(this.#i,{month:"long",year:"numeric"}).format(g))}catch{}let o=document.createElement("thead"),h=document.createElement("tr"),w=H(this.#i,"short"),b=H(this.#i,"long");for(let g=0;g<7;g++){let y=(this.#F+g)%7,A=document.createElement("th");A.setAttribute("scope","col"),A.setAttribute("abbr",b[y]),A.textContent=w[y],h.appendChild(A)}o.appendChild(h),a.appendChild(o);let p=document.createElement("tbody"),d=1,f=document.createElement("tr");f.setAttribute("data-week",String(d));let l=(new Date(t,e,1).getDay()-this.#F+7)%7,c=U(t,e-1);for(let g=0;g<l;g++){let y=c-l+1+g,A=document.createElement("td");A.setAttribute("data-outside-month","");let m=document.createElement("button");m.type="button",m.disabled=!0,m.setAttribute("tabindex","-1"),m.setAttribute("data-day",String(y));let S=document.createElement("span");S.className="day-number",S.textContent=String(y),m.appendChild(S),A.appendChild(m),f.appendChild(A)}let C=this.#a,u=this.#r||this.#w;for(let g=1;g<=n;g++){let y=new Date(t,e,g),A=x(y),m=document.createElement("td"),S=document.createElement("button");S.type="button",S.setAttribute("data-date",A);let P=document.createElement("span");if(P.className="day-number",P.textContent=String(g),S.appendChild(P),S.setAttribute("data-day",String(g)),N(y,s)&&(S.setAttribute("aria-current","date"),m.setAttribute("data-today","")),this.#s==="single"&&N(y,this.#f)&&m.setAttribute("data-selected",""),this.#s==="multi"&&this.#h.has(A)&&m.setAttribute("data-selected",""),this.#s==="range"&&C&&u){let M=C<u?C:u,T=C<u?u:C;N(y,M)&&m.setAttribute("data-range-start",""),N(y,T)&&m.setAttribute("data-range-end",""),y>=M&&y<=T&&m.setAttribute("data-in-range","")}else this.#s==="range"&&C&&N(y,C)&&m.setAttribute("data-range-start","");this.#R(m);let G=this.#o&&y<this.#o,W=this.#l&&y>this.#l,J=typeof this.isDateDisallowed=="function"&&this.isDateDisallowed(y);if((this.#k.has(A)||G||W||J)&&(S.setAttribute("aria-disabled","true"),S.disabled=!0),this.#M.has(A)&&S.setAttribute("data-highlight",this.#M.get(A)||""),typeof this.getDayParts=="function"){let M=this.getDayParts(y);M!=null&&(m.dataset.dayPart=Array.isArray(M)?M.join(" "):M)}let k=this.#D.dayToEvents.get(A)||[];if(k.length){m.setAttribute("data-events",""),m.setAttribute("data-event-count",String(k.length));let M=i?k.filter(v=>!v.isSpan):k,T=k.map(v=>v.evt);if(i){if(M.length){let v=document.createElement("span");v.className="event-list";let L=2;if(M.slice(0,L).forEach(({evt:D})=>{let F=document.createElement("span");if(F.className="event-item",D.color&&F.style.setProperty("--event-color",D.color),D.icon){let q=document.createElement("icon-wc");q.setAttribute("name",D.icon),q.setAttribute("size","xs"),F.appendChild(q)}let V=document.createElement("span");V.textContent=D.time?`${D.time} ${D.label}`:D.label,F.appendChild(V),v.appendChild(F)}),M.length>L){let D=document.createElement("span");D.className="event-more",D.textContent=this.#S("More","+{n} more").replace("{n}",String(M.length-L)),v.appendChild(D)}S.appendChild(v)}}else{let v=document.createElement("span");v.className="event-dots",v.setAttribute("aria-hidden","true");let L=Math.min(k.length,3);for(let D=0;D<L;D++){let F=document.createElement("span");F.setAttribute("data-event-dot",""),k[D].evt.color&&F.style.setProperty("--event-color",k[D].evt.color),v.appendChild(F)}m.appendChild(v)}let K=T.map(v=>v.time?`${v.time} \u2014 ${v.label}`:v.label);S.setAttribute("title",K.join(`
2
+ `))}S.setAttribute("tabindex","-1"),m.insertBefore(S,m.firstChild),f.appendChild(m),(l+g)%7===0&&(p.appendChild(f),d++,f=document.createElement("tr"),f.setAttribute("data-week",String(d)))}let I=(l+n)%7;if(I>0){for(let g=1;g<=7-I;g++){let y=document.createElement("td");y.setAttribute("data-outside-month","");let A=document.createElement("button");A.type="button",A.disabled=!0,A.setAttribute("tabindex","-1"),A.setAttribute("data-day",String(g));let m=document.createElement("span");m.className="day-number",m.textContent=String(g),A.appendChild(m),y.appendChild(A),f.appendChild(y)}p.appendChild(f)}return a.appendChild(p),i&&this.#D.spans.length&&this.#Q(p,t,e),a}#Q(t,e,s){let n=[...t.querySelectorAll("tr")],i=new Intl.DateTimeFormat(this.#i,{month:"short",day:"numeric"});for(let a of n){let o=[...a.querySelectorAll("td")];if(!o.length)continue;let h=o.findIndex(l=>l.querySelector("button[data-date]")),w=o.map((l,c)=>{let C=l.querySelector("button"),u=C?.getAttribute("data-date");if(u)return $(u);let I=parseInt(C?.getAttribute("data-day")||"0",10);return h>=0&&c<h?new Date(e,s-1,I):new Date(e,s+1,I)}),b=w[0],p=w[w.length-1];if(!b||!p)continue;let d=[];for(let{evt:l,range:c}of this.#D.spans){if(c.end<b||c.start>p)continue;let C=c.start<b?0:w.findIndex(I=>N(I,c.start)),u=c.end>p?w.length-1:w.findIndex(I=>N(I,c.end));C<0||u<0||d.push({evt:l,range:c,startCol:C,endCol:u,continuesLeft:c.start<b,continuesRight:c.end>p})}if(!d.length)continue;d.sort((l,c)=>l.startCol-c.startCol||c.endCol-c.startCol-(l.endCol-l.startCol));let f=[];for(let l of d){let c=0;for(;c<f.length&&f[c]>=l.startCol;)c++;l.lane=c,f[c]=l.endCol}let E=f.length;a.style.setProperty("--cal-row-lanes",String(E)),a.setAttribute("data-row-lanes",String(E));for(let l of d){let c=o[l.startCol],C=l.endCol-l.startCol+1,u=document.createElement("span");u.className="event-span",u.style.setProperty("--span-cells",String(C)),u.style.setProperty("--span-lane",String(l.lane)),l.evt.color&&u.style.setProperty("--event-color",l.evt.color),l.continuesLeft&&u.setAttribute("data-continues-start",""),l.continuesRight&&u.setAttribute("data-continues-end",""),u.textContent=l.evt.label||"",u.setAttribute("title",`${l.evt.label} \u2014 ${i.format(l.range.start)} to ${i.format(l.range.end)}`),c.appendChild(u)}}}#Z(t,e){this.#x();let s=$(t)??new Date,n=document.createElement("div");n.className="day-detail",n.setAttribute("role","dialog");let i=`calendar-wc-detail-${++Z}`;n.setAttribute("aria-labelledby",i);let a=document.createElement("header"),o=document.createElement("h3");o.id=i;try{o.textContent=new Intl.DateTimeFormat(this.#i,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(s)}catch{o.textContent=t}let h=document.createElement("button");if(h.type="button",h.setAttribute("aria-label",this.#S("Close","Close")),h.textContent="\xD7",h.addEventListener("click",()=>this.#x(!0)),a.append(o,h),n.appendChild(a),e.some(d=>d.time)){let d=document.createElement("day-view");d.dataset.date=t,d.dataset.startHour="auto",d.dataset.compact="";let f=new Intl.DateTimeFormat(this.#i,{hour:"numeric",minute:"2-digit"});e.forEach(E=>{let l=document.createElement("calendar-event");if(E.color&&l.style.setProperty("--event-color",E.color),E.icon){let c=document.createElement("icon-wc");c.setAttribute("name",E.icon),c.setAttribute("size","sm"),l.appendChild(c)}if(E.time){let c=document.createElement("time");c.setAttribute("datetime",E.time);try{let[C,u]=E.time.split(":"),I=new Date(2026,0,1,parseInt(C,10),parseInt(u,10));c.textContent=f.format(I)}catch{c.textContent=E.time}l.appendChild(c)}l.append(E.label||""),d.appendChild(l)}),n.appendChild(d)}else{let d=document.createElement("ul");d.className="detail-list",e.forEach(f=>{let E=document.createElement("li");f.color&&E.style.setProperty("--event-color",f.color);let l=document.createElement("span");l.className="detail-dot";let c=document.createElement("span");if(c.className="detail-content",f.icon){let u=document.createElement("icon-wc");u.setAttribute("name",f.icon),u.setAttribute("size","sm"),c.appendChild(u)}let C=document.createElement("span");C.className="detail-label",C.textContent=f.label||"",c.append(C),E.append(l,c),d.appendChild(E)}),n.appendChild(d)}this.#P=this.#n.querySelector(`button[data-date="${t}"]`),this.appendChild(n),this.#v=n,h.focus();let b=d=>{n.contains(d.target)||this.#x(!1)},p=0;this._detailCleanup=()=>{cancelAnimationFrame(p),document.removeEventListener("mousedown",b)},p=requestAnimationFrame(()=>{document.addEventListener("mousedown",b)}),this.dispatchEvent(new CustomEvent("calendar:day-open",{bubbles:!0,detail:{date:t,events:e}}))}#x(t=!1){if(this.#v){this._detailCleanup?.(),this._detailCleanup=null,this.#v.remove(),this.#v=null;let e=this.#P;this.#P=null,t&&e?.isConnected&&e.focus()}}teardown(){this.removeAttribute("data-tentative"),this.#x(),this.#E?.remove(),this.#Y?.remove(),this.#n?.remove(),this.#E=this.#Y=this.#n=null,this.#p=!1}#tt(t){let s={ArrowRight:1,ArrowLeft:-1,ArrowDown:7,ArrowUp:-7}[t.key];if(!s)return;let i=t.target?.closest?.("button[data-date]");if(!i||!this.#n.contains(i))return;let a=$(i.getAttribute("data-date"));if(!a)return;t.preventDefault(),Math.abs(s)===1&&getComputedStyle(this).direction==="rtl"&&(s=-s);let o=Y(a,s);for(let h=0;h<366;h++,o=Y(o,s)){if(this.#o&&o<this.#o||this.#l&&o>this.#l)return;let w=o.getMonth(),b=o.getFullYear(),p=this.#$(this.#L-1),d=(b>this.#e||b===this.#e&&w>=this.#t)&&(b<p.year||b===p.year&&w<=p.month),f=x(o);d||(this.#t=w,this.#e=b,this.#I=f,this.#d());let E=this.#n.querySelector(`button[data-date="${f}"]`);if(E&&!E.disabled){this.#I=f,this.#_(),E.focus();return}}}};z("calendar-wc",B);export{B as CalendarWc};
3
3
  //# sourceMappingURL=calendar-wc.js.map
@@ -1,2 +1,2 @@
1
- function y(s){if(!s||typeof s!="string")return"";let t=document.createElement("template");return t.innerHTML=s,t.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(n=>n.remove()),t.content.querySelectorAll("*").forEach(n=>{for(let r of[...n.attributes]){if(r.name.startsWith("on")){n.removeAttribute(r.name);continue}if(["href","src","action","formaction","xlink:href"].includes(r.name)){let o=r.value.trim().toLowerCase();(o.startsWith("javascript:")||o.startsWith("data:text/html"))&&n.removeAttribute(r.name);continue}(r.name==="srcdoc"||r.name==="data"&&n.tagName==="OBJECT")&&n.removeAttribute(r.name)}}),t.innerHTML}var T=window.matchMedia("(prefers-reduced-motion: reduce)");var A=new Map;function w(s,t,i={}){let e=i.priority??10,n={impl:t,bundle:i.bundle,contract:i.contract,priority:e},r=A.get(s);if(customElements.get(s)){if(!r||r.priority>=e){r&&r.priority===e&&r.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=e){r.priority===e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}A.set(s,n),customElements.define(s,t)}var b=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,i,e,n){t.addEventListener(i,e,n),this.#e.push(()=>t.removeEventListener(i,e,n))}setup(){}teardown(){}setState(t,i){this.#t||(this.#t=this.attachInternals());let e=this.#t.states;try{i?e.add(t):e.delete(t)}catch{let n=`--${t}`;i?e.add(n):e.delete(n)}}_adoptInternals(t){this.#t||(this.#t=t)}};function S({newItems:s,nodes:t,keyOf:i,renderItem:e,containerFor:n}){let r=[],o=[],c=[],E=new Set;for(let a of s)E.add(i(a));for(let[a,d]of[...t])E.has(a)||(d.remove(),t.delete(a),c.push(a));let m=new Map;for(let a of s){let d=i(a),l=t.get(d)||null,f=n(a,l);m.has(f)||m.set(f,[]),m.get(f)?.push({item:a,key:d,existing:l})}for(let[a,d]of m)for(let l=0;l<d.length;l++){let{item:f,key:p,existing:k}=d[l],u=k;u?(u.parentElement!==a||a.children[l]!==u)&&o.push(p):(u=e(f),t.set(p,u),r.push(p));let v=a.children[l];v!==u&&a.insertBefore(u,v||null)}return{added:r,moved:o,removed:c}}var M=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function $(s){return!s||typeof s!="string"?!1:M.test(s.trim())}function h(s,t){if(!$(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let e=t.replace(/\[(\d+)\]/g,".$1").split("."),n=s;for(let r of e){if(n==null)return;n=n[r]}return n}function x(s){return s?s.split(",").map(t=>{let[i,e]=t.split(":").map(n=>n.trim());return{attr:i,path:e}}).filter(({attr:t,path:i})=>t&&i):[]}var g=class extends b{#e=null;#t=[];#n="id";#i=new Map;static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;this.#n=this.getAttribute("data-key")||"id";let t=this.getAttribute("data-items");if(t){try{this.#t=JSON.parse(t),this.#r()}catch(e){console.error("[card-list] Invalid JSON in data-items:",e)}return}let i=this.getAttribute("src");return i&&this.#o(i),!0}attributeChangedCallback(t,i,e){if(i!==e)if(t==="data-items"&&e)try{this.#t=JSON.parse(e),this.#r()}catch(n){console.error("[card-list] Invalid JSON in data-items:",n)}else t==="src"&&e?this.#o(e):t==="data-key"&&(this.#n=e||"id",this.#r())}async#o(t){try{this.setAttribute("data-loading","");let i=await fetch(t);if(!i.ok)throw new Error(`HTTP ${i.status}`);let e=await i.json();this.#t=Array.isArray(e)?e:e.items||e.data||[],this.#r()}catch(i){console.error("[card-list] Fetch error:",i),this.setAttribute("data-error",i.message)}finally{this.removeAttribute("data-loading")}}#r(t="internal"){if(!this.#e)return;if([...this.#e.content.children].length!==1){this.querySelectorAll(":scope > :not(template)").forEach(r=>r.remove()),this.#i.clear();let n=document.createDocumentFragment();for(let r of this.#t){let o=this.#e.content.cloneNode(!0);this.#s(o,r),n.appendChild(o)}this.appendChild(n)}else{let e=S({newItems:this.#t,nodes:this.#i,keyOf:r=>r?.[this.#n],renderItem:r=>{if(!this.#e)throw new Error("card-list: missing template");let c=this.#e.content.cloneNode(!0).firstElementChild;return this.#s(c,r),c},containerFor:()=>this}),n=new Set(e.added);for(let r of this.#t){let o=r?.[this.#n];if(n.has(o))continue;let c=this.#i.get(o);c&&this.#s(c,r)}}this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0})),this.dispatchEvent(new CustomEvent("card-list:items-changed",{detail:{items:this.#t,source:t},bubbles:!0}))}#s(t,i){t.querySelectorAll("[data-field]").forEach(e=>{let n=e.getAttribute("data-field"),r=h(i,n);e.textContent=r??""}),t.querySelectorAll("[data-field-attr]").forEach(e=>{let n=x(e.getAttribute("data-field-attr"));for(let{attr:r,path:o}of n){if(!$(o))continue;let c=h(i,o);c!=null&&e.setAttribute(r,c)}}),t.querySelectorAll("[data-field-html]").forEach(e=>{let n=e.getAttribute("data-field-html"),r=h(i,n);e.innerHTML=y(r)}),t.querySelectorAll("[data-field-if]").forEach(e=>{let n=e.getAttribute("data-field-if");h(i,n)||e.remove()}),t.querySelectorAll("[data-field-unless]").forEach(e=>{let n=e.getAttribute("data-field-unless");h(i,n)&&e.remove()})}get items(){return this.#t}set items(t){this.#t=Array.isArray(t)?t:[],this.#r("api")}setItems(t){this.items=t}getItems(){return[...this.#t]}};w("card-list",g);export{g as CardList,h as getValueByPath,$ as isValidPath,y as sanitizeHTML};
1
+ var D="http://www.w3.org/1999/xhtml",A="http://www.w3.org/2000/svg",F="http://www.w3.org/1998/Math/MathML",U=new Set([D,A,F]),S="user-content-",q=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),k=new Set(["title","desc"]),B=new Set(["animate","set","animatemotion","animatetransform"]),H=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),j=new Set(["src","poster","srcset"]),P=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),W=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),V=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),G={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},K=new Set(["social-embed","youtube-player","geo-map"]),Z=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],J=new Set(["audio-player","video-player","image-map","brand-mark"]);function X(r){return String(r).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function v(r,t=!1){let e=X(r);return t?/(^|,)(javascript|vbscript|livescript):/.test(e)?!0:/(^|,)data:/.test(e)?e.split(/(?=data:)/).filter(i=>i.startsWith("data:")).some(i=>!/^data:(image|audio|video|font)\//.test(i)):!1:/^(javascript|vbscript|livescript|data):/.test(e)}function M(r){let t=String(r).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(t)}var Y=r=>String(r.localName||r.tagName||"").toLowerCase(),Q=r=>r.startsWith(S)?r:S+r;function tt(r,t){if(q.has(t))return!0;let e=r.namespaceURI;return!!(e&&!U.has(e)||t==="title"&&e!==A||k.has(t)&&e===A&&r.children?.length||B.has(t)&&(r.getAttribute("attributeName")||r.getAttribute("attributename")||"").toLowerCase().includes("href"))}function et(r,t){for(let e of[...r.attributes]){let n=e.name.toLowerCase();if(n.startsWith("on")||P.has(n)||!t.keepIds&&W.has(n)){r.removeAttribute(e.name);continue}if(n==="style"){(!t.keepStyle||M(e.value))&&r.removeAttribute(e.name);continue}if((n==="id"||n==="name")&&!t.keepIds){let i=Q(e.value);n==="id"?t.ids.set(e.value,i):t.ids.set(`name:${e.value}`,i),r.setAttribute(e.name,i);continue}if(H.has(n)||n.endsWith(":href")){v(e.value,!1)&&r.removeAttribute(e.name);continue}j.has(n)&&v(e.value,!0)&&r.removeAttribute(e.name)}}function rt(r,t){let e=(r.getAttribute("type")||"").toLowerCase();t==="button"&&e!=="button"&&r.setAttribute("type","button"),t==="input"&&/^(submit|reset|image)$/.test(e)&&r.setAttribute("type","button")}function nt(r,t){for(let e of r)for(let n of[...e.attributes]){let i=n.name.toLowerCase(),s=n.value;if((i==="href"||i.endsWith(":href"))&&s.startsWith("#")){let o=it(s.slice(1));t.has(o)&&e.setAttribute(n.name,`#${t.get(o)}`)}else if(i==="usemap"&&s.startsWith("#")){let o=t.get(`name:${s.slice(1)}`);o?e.setAttribute(n.name,`#${o}`):e.removeAttribute(n.name)}else if(V.has(i)){let o=s.split(/\s+/).filter(Boolean).map(a=>t.get(a)||(a.startsWith(S)?a:null)).filter(Boolean);o.length?e.setAttribute(n.name,o.join(" ")):e.removeAttribute(n.name)}else s.includes("url(#")&&e.setAttribute(n.name,s.replace(/url\(#([^)]+)\)/g,(o,a)=>t.has(a)?`url(#${t.get(a)})`:o))}}function it(r){try{return decodeURIComponent(r)}catch{return r}}function $(r){let t=r.childNodes;if(t)for(let e of[...t])e.nodeType===8?e.remove():(e.nodeType===1||e.nodeType===11)&&$(e)}function L(r,t){$(r);let e=[...r.querySelectorAll("*")];t.includeRoot&&e.unshift(r);let n=new Map,i=[],s={...t,ids:n};for(let o of e){if(!ot(o,r))continue;let a=Y(o);if(t.svgOnly&&(k.has(a)||a==="style")){if(a==="style"&&M(o.textContent||"")){o.remove();continue}}else if(tt(o,a)){o.remove();continue}if(!t.keepIds&&!t.svgOnly&&K.has(a)){st(o);continue}if(a==="template"){let l=o.content;l&&L(l,{...t,includeRoot:!1})}et(o,s),t.keepIds||rt(o,a);let u=G[a];if(u)for(let l of u)o.removeAttribute(l);if(a==="include-file"&&!t.allowIncludeFile&&o.removeAttribute("src"),!t.keepIds&&!t.svgOnly&&a.includes("-")&&a!=="include-file"&&!J.has(a))for(let l of Z)o.removeAttribute(l);i.push(o)}!t.keepIds&&n.size&&nt(i,n)}function st(r){let t=r.parentNode;if(t){for(let e of[...r.childNodes])t.insertBefore(e,r);r.remove()}}function ot(r,t){let e=r;for(;e;){if(e===t)return!0;e=e.parentNode??e.parent??null}return!1}function g(r,t={}){let e=document.createElement("template");return r&&typeof r=="string"&&(e.innerHTML=r,L(e.content,{allowIncludeFile:!!t.allowIncludeFile,keepIds:!!t.keepIds,keepStyle:!!t.keepStyle})),e.content}function T(r){let t=document.createElement("template");return t.content.append(r),t.innerHTML}function at(r,t={}){if(!r||typeof r!="string")return"";let e=T(g(r,t));for(let n=0;n<4;n++){let i=T(g(e,t));if(i===e)return e;e=i}return""}var bt=window.matchMedia("(prefers-reduced-motion: reduce)");var _=new Map;function C(r,t,e={}){let n=e.priority??10,i={impl:t,bundle:e.bundle,contract:e.contract,priority:n},s=_.get(r);if(customElements.get(r)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> 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 <${r}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}_.set(r,i),customElements.define(r,t)}var y=class extends HTMLElement{#e=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,n,i){t.addEventListener(e,n,i),this.#e.push(()=>t.removeEventListener(e,n,i))}_reinit(){for(let t of this.#e)t();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let n=this.#t.states;try{e?n.add(t):n.delete(t)}catch{let i=`--${t}`;e?n.add(i):n.delete(i)}}_adoptInternals(t){this.#t||(this.#t=t)}#r(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#r()?.validity}get validationMessage(){return this.#r()?.validationMessage??""}get willValidate(){return this.#r()?.willValidate??!1}get form(){return this.#r()?.form??null}checkValidity(){return this.#r()?.checkValidity()??!0}reportValidity(){return this.#r()?.reportValidity()??!0}};function N({newItems:r,nodes:t,keyOf:e,renderItem:n,containerFor:i}){let s=[],o=[],a=[],u=new Set;for(let c of r)u.add(e(c));for(let[c,d]of[...t])u.has(c)||(d.remove(),t.delete(c),a.push(c));let l=new Map;for(let c of r){let d=e(c),f=t.get(d)||null,m=i(c,f);l.has(m)||l.set(m,[]),l.get(m)?.push({item:c,key:d,existing:f})}for(let[c,d]of l)for(let f=0;f<d.length;f++){let{item:m,key:b,existing:z}=d[f],h=z;h?(h.parentElement!==c||c.children[f]!==h)&&o.push(b):(h=n(m),t.set(b,h),s.push(b));let E=c.children[f];E!==h&&c.insertBefore(h,E||null)}return{added:s,moved:o,removed:a}}var ct=/^[a-zA-Z_$][a-zA-Z0-9_$]*(\.[a-zA-Z_$][a-zA-Z0-9_$]*|\[\d+\])*$/;function R(r){return!r||typeof r!="string"?!1:ct.test(r.trim())}function p(r,t){if(!R(t)){console.warn(`[card-list] Unsafe property path rejected: "${t}"`);return}let n=String(t).replace(/\[(\d+)\]/g,".$1").split("."),i=r;for(let s of n){if(i==null)return;i=i[s]}return i}function lt(r){return r?r.split(",").map(t=>{let[e,n]=t.split(":").map(i=>i.trim());return{attr:(e||"").toLowerCase(),path:n}}).filter(({attr:t,path:e})=>t&&e):[]}var ut=new Set(["href","src","action","formaction","xlink:href","poster","cite","background","ping","data","manifest","longdesc","codebase"]),I=new Set(["srcdoc","style","is"]),ft=new Set(["http:","https:","mailto:","tel:"]);function O(r){let t=String(r).replace(/[\u0000-\u0020\u007f]+/g,"");if(!t)return!0;let e=/^([a-z][a-z0-9+.-]*):/i.exec(t);return e?ft.has(`${e[1].toLowerCase()}:`):!0}function dt(r){return String(r).split(",").every(t=>O(t.trim().split(/\s+/)[0]||""))}function ht(r,t){return r.startsWith("on")||I.has(r)||!/^[a-z_][a-z0-9_.:-]*$/.test(r)?!1:r==="srcset"||r==="imagesrcset"?dt(t):ut.has(r)?O(t):!0}function mt(r,t){let e=new Set;return r.map((n,i)=>{let s=n!=null&&typeof n=="object"?n[t]:void 0,o=s==null?null:`k:${String(s)}`;return o==null||e.has(o)?`i:${i}`:(e.add(o),o)})}var x=":scope > [data-card-list-status]",w=class extends y{#e=null;#t=[];#r="id";#c=new Map;#o=!1;#a=null;#n=null;static get observedAttributes(){return["src","data-items","data-key"]}setup(){if(this.#e=this.querySelector(":scope > template")||this.querySelector("template"),!this.#e)return console.warn("[card-list] No template found"),!1;if(this.#r=this.getAttribute("data-key")||"id",this.#o)return this.#a&&this.#s(this.#a),this.#a=null,!0;let t=this.getAttribute("data-items");if(t)return this.#f(t),!0;let e=this.getAttribute("src");return e&&this.#h(e),!0}teardown(){this.#i()}attributeChangedCallback(t,e,n){e!==n&&this.hasAttribute("data-upgraded")&&(t==="data-items"?n&&this.#f(n):t==="src"?n?this.#h(n):this.#i():t==="data-key"&&(this.#r=n||"id",this.#s("attribute")))}#f(t){this.#i();try{let e=JSON.parse(t);this.#t=Array.isArray(e)?e:[],this.#o=!0,this.#s("attribute")}catch(e){console.error("[card-list] Invalid JSON in data-items:",e)}}#i(){this.#n&&(this.#n.abort(),this.#n=null,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"),this.#l(""))}#d(){let t=this.querySelector(x);return t||(t=document.createElement("p"),t.setAttribute("role","status"),t.setAttribute("data-card-list-status",""),this.append(t)),t}#l(t){let e=this.querySelector(x);!e&&!t||((e||this.#d()).textContent=t)}async#h(t){this.#i();let e=new AbortController;this.#n=e,this.removeAttribute("data-error"),this.setAttribute("data-loading",""),this.setAttribute("aria-busy","true"),this.#d().textContent="Loading\u2026";try{let n=await fetch(t,{signal:e.signal});if(!n.ok)throw new Error(`HTTP ${n.status}`);let i=await n.json();if(e.signal.aborted)return;this.#t=Array.isArray(i)?i:i?.items||i?.data||[],this.#o=!0,this.#l(""),this.#s("attribute")}catch(n){if(e.signal.aborted)return;let i=n instanceof Error?n.message:String(n);console.error("[card-list] Fetch error:",n),this.setAttribute("data-error",i),this.#l(`Error: ${i}`)}finally{this.#n===e&&(this.#n=null,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"))}}#s(t){if(!this.#e)return;this.querySelectorAll(":scope > [data-fallback]").forEach(i=>i.remove());let e=this.#e;if([...e.content.children].length!==1){this.querySelectorAll(":scope > :not(template, [data-card-list-status])").forEach(s=>s.remove()),this.#c.clear();let i=document.createDocumentFragment();for(let s of this.#t){let o=e.content.cloneNode(!0);this.#u(o,s),i.appendChild(o)}this.prepend(i)}else{let i=mt(this.#t,this.#r),s=this.#t.map((u,l)=>({item:u,key:i[l]})),o=N({newItems:s,nodes:this.#c,keyOf:u=>u.key,renderItem:u=>{let c=e.content.cloneNode(!0).firstElementChild;return this.#u(c,u.item),c},containerFor:()=>this}),a=new Set(o.added);for(let{item:u,key:l}of s){if(a.has(l))continue;let c=this.#c.get(l);c&&this.#u(c,u)}}this.dispatchEvent(new CustomEvent("card-list:rendered",{detail:{count:this.#t.length},bubbles:!0})),this.dispatchEvent(new CustomEvent("card-list:items-changed",{detail:{items:this.#t,source:t},bubbles:!0}))}#u(t,e){let n=i=>{let s=[...t.querySelectorAll(i)];return t instanceof Element&&t.matches(i)&&s.unshift(t),s};n("[data-field]").forEach(i=>{let s=p(e,i.getAttribute("data-field"));i.textContent=s??""}),n("[data-field-attr]").forEach(i=>{for(let{attr:s,path:o}of lt(i.getAttribute("data-field-attr"))){if(!R(o))continue;let a=p(e,o);if(s.startsWith("on")||I.has(s)){console.warn(`[card-list] Refusing to bind "${s}" from data`);continue}let u=s.startsWith("aria-");a==null||a===!1&&!u?i.removeAttribute(s):ht(s,a)?i.setAttribute(s,a===!0&&!u?"":String(a)):(console.warn(`[card-list] Unsafe value refused for "${s}"`),i.removeAttribute(s))}}),n("[data-field-html]").forEach(i=>{i.replaceChildren(g(p(e,i.getAttribute("data-field-html"))))}),n("[data-field-if]").forEach(i=>{i.hidden=!p(e,i.getAttribute("data-field-if"))}),n("[data-field-unless]").forEach(i=>{i.hidden=!!p(e,i.getAttribute("data-field-unless"))})}get items(){return this.#t}set items(t){this.#i(),this.#t=Array.isArray(t)?t:[],this.#o=!0,this.#e&&this.hasAttribute("data-upgraded")?this.#s("api"):this.#a="api"}};C("card-list",w);export{w as CardList,p as getValueByPath,ht as isSafeAttrBinding,O as isSafeUrl,R as isValidPath,at as sanitizeHTML};
2
2
  //# sourceMappingURL=card-list.js.map
@@ -1,2 +1,2 @@
1
- var F=Object.defineProperty;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var O=(t,e)=>{for(var s in e)F(t,s,{get:e[s],enumerable:!0})};var Y={};O(Y,{addDialogDismiss:()=>I,addFlickListener:()=>$,addLongPress:()=>S,addPullToRefresh:()=>H,addSwipeListener:()=>T,haptic:()=>L,initGestures:()=>N,makeSwipeable:()=>P});function T(t,e={}){let s=e.threshold??50,r=e.restraint??100,n=e.timeout??300,i=e.velocity??.5,o=e.minFlickDistance??10,a,l,d;function p(u){u.isPrimary&&(a=u.clientX,l=u.clientY,d=Date.now())}function f(u){if(!u.isPrimary)return;let v=u.clientX-a,m=u.clientY-l,c=Date.now()-d;if(c>n)return;let h=Math.abs(v),b=Math.abs(m),E=Math.max(h,b),y=c>0?E/c:0,g=y>=i&&E>=o,w;if((h>=s||g&&h>b)&&b<=r?w=v<0?"left":"right":(b>=s||g&&b>h)&&h<=r&&(w=m<0?"up":"down"),w){let B=w==="left"||w==="right"?h:b;t.dispatchEvent(new CustomEvent(`swipe-${w}`,{bubbles:!0,detail:{distance:B,duration:c,velocity:y,flick:g}}))}}return t.addEventListener("pointerdown",p,{passive:!0}),t.addEventListener("pointerup",f,{passive:!0}),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointerup",f)}}function $(t,e={}){let s=e.minDistance??10,r=e.velocity??.6,n=e.timeout??250,i=e.restraint??80,o,a,l;function d(f){f.isPrimary&&(o=f.clientX,a=f.clientY,l=Date.now())}function p(f){if(!f.isPrimary)return;let u=f.clientX-o,v=f.clientY-a,m=Date.now()-l;if(m===0||m>n)return;let c=Math.abs(u),h=Math.abs(v),b=Math.max(c,h);if(b<s)return;let E=b/m;if(E<r)return;let y;if(c>h&&h<=i?y=u<0?"left":"right":h>c&&c<=i&&(y=v<0?"up":"down"),y){let g=y==="left"||y==="right"?c:h;t.dispatchEvent(new CustomEvent(`swipe-${y}`,{bubbles:!0,detail:{distance:g,duration:m,velocity:E,flick:!0}}))}}return t.addEventListener("pointerdown",d,{passive:!0}),t.addEventListener("pointerup",p,{passive:!0}),()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointerup",p)}}function P(t,e={}){let s=e.threshold??100,r=e.direction??"horizontal",n=e.removeOnDismiss??!0,i=r==="horizontal",o=0,a=0,l=!1;function d(c){!c.isPrimary||t.hasAttribute("data-dismissed")||(c.preventDefault(),l=!0,o=i?c.clientX:c.clientY,a=0,t.setPointerCapture(c.pointerId),t.setAttribute("data-swiping",""))}function p(c){if(!l||!c.isPrimary)return;a=(i?c.clientX:c.clientY)-o;let b=1-Math.min(Math.abs(a)/s,1)*.5;i?t.style.transform=`translateX(${a}px)`:t.style.transform=`translateY(${a}px)`,t.style.opacity=String(b)}function f(c){!l||!c.isPrimary||(l=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),Math.abs(a)>=s?v(a>0?"right":"left"):m())}function u(c){!l||!c.isPrimary||(l=!1,t.releasePointerCapture(c.pointerId),t.removeAttribute("data-swiping"),m())}function v(c){let h=c==="right"?"100%":"-100%";t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform=i?`translateX(${h})`:`translateY(${h})`,t.style.opacity="0",t.setAttribute("data-dismissed",""),L.dismiss(),t.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:c,distance:Math.abs(a)}})),n&&t.addEventListener("transitionend",()=>t.remove(),{once:!0})}function m(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",d),t.addEventListener("pointermove",p),t.addEventListener("pointerup",f),t.addEventListener("pointercancel",u),()=>{t.removeEventListener("pointerdown",d),t.removeEventListener("pointermove",p),t.removeEventListener("pointerup",f),t.removeEventListener("pointercancel",u)}}function H(t,e,s={}){let r=s.threshold??70,n=s.maxPull??120,i=document.createElement("div");i.setAttribute("data-pull-indicator",""),i.setAttribute("aria-hidden","true");let o=document.createElement("div");o.setAttribute("data-pull-spinner",""),i.appendChild(o),t.prepend(i);let a=0,l=!1,d=!1;function p(h){!h.isPrimary||d||t.scrollTop<=0&&(a=h.clientY,l=!0)}function f(h){if(!l||!h.isPrimary||d)return;let b=h.clientY-a;if(b<=0){i.style.transform="",i.style.opacity="";return}let E=Math.min(b,n),y=E/r;i.style.transform=`translateY(${E}px)`,i.style.opacity=String(Math.min(y,1)),y>=1?i.setAttribute("data-pull-ready",""):i.removeAttribute("data-pull-ready")}function u(h){!l||!h.isPrimary||(l=!1,i.hasAttribute("data-pull-ready")&&!d?m():c())}function v(h){!l||!h.isPrimary||(l=!1,c())}async function m(){d=!0,i.removeAttribute("data-pull-ready"),i.setAttribute("data-pull-loading",""),i.style.transform=`translateY(${r}px)`,i.style.opacity="1";try{await e()}finally{d=!1,i.removeAttribute("data-pull-loading"),c()}}function c(){i.style.transition="transform 0.3s ease, opacity 0.3s ease",i.style.transform="",i.style.opacity="",i.removeAttribute("data-pull-ready"),i.addEventListener("transitionend",()=>{i.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",p,{passive:!0}),t.addEventListener("pointermove",f,{passive:!0}),t.addEventListener("pointerup",u,{passive:!0}),t.addEventListener("pointercancel",v,{passive:!0}),()=>{t.removeEventListener("pointerdown",p),t.removeEventListener("pointermove",f),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",v),i.remove()}}function S(t,e,s={}){let r=s.duration??500,n=s.hapticFeedback??!0,i=s.blockContextMenu??!0,o=null;function a(p){p.isPrimary&&(o=setTimeout(()=>{n&&L.tap(),e(p),o=null},r))}function l(){o&&(clearTimeout(o),o=null)}function d(p){i&&p.preventDefault()}return t.addEventListener("pointerdown",a,{passive:!0}),t.addEventListener("pointermove",l,{passive:!0}),t.addEventListener("pointerup",l,{passive:!0}),t.addEventListener("pointercancel",l,{passive:!0}),t.addEventListener("contextmenu",d),()=>{l(),t.removeEventListener("pointerdown",a),t.removeEventListener("pointermove",l),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",l),t.removeEventListener("contextmenu",d)}}function I(t,e={}){let s=e.threshold??80,r=0,n=0,i=!1;function o(u){if(!u.isPrimary||!t.open)return;let v=u.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(i=!0,r=u.clientY,n=0,t.setPointerCapture(u.pointerId),t.style.transition="none")}function a(u){if(!i||!u.isPrimary)return;if(n=u.clientY-r,n<=0){t.style.transform="",t.style.opacity="";return}let m=1-Math.min(n/s,1)*.4;t.style.transform=`translateY(${n}px)`,t.style.opacity=String(m)}function l(u){!i||!u.isPrimary||(i=!1,t.releasePointerCapture(u.pointerId),n>=s?p():f())}function d(u){!i||!u.isPrimary||(i=!1,t.releasePointerCapture(u.pointerId),f())}function p(){t.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",t.style.transform="translateY(100%)",t.style.opacity="0",L.dismiss(),t.addEventListener("transitionend",()=>{t.style.transition="",t.style.transform="",t.style.opacity="",t.close("dismiss")},{once:!0})}function f(){t.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",t.style.transform="",t.style.opacity="",t.addEventListener("transitionend",()=>{t.style.transition=""},{once:!0})}return t.addEventListener("pointerdown",o),t.addEventListener("pointermove",a),t.addEventListener("pointerup",l),t.addEventListener("pointercancel",d),()=>{t.removeEventListener("pointerdown",o),t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",l),t.removeEventListener("pointercancel",d)}}function N(t=document){let e=[];for(let s of t.querySelectorAll('[data-gesture="swipe"]'))e.push(T(s));for(let s of t.querySelectorAll('[data-gesture="flick"]'))e.push($(s));for(let s of t.querySelectorAll('[data-gesture="dismiss"]'))e.push(P(s));for(let s of t.querySelectorAll('[data-gesture="long-press"]'))e.push(S(s,()=>{s.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let s of t.querySelectorAll('dialog[data-gesture="dismiss-down"]'))e.push(I(s));return()=>e.forEach(s=>s())}var L,x,q=X(()=>{L={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};x=typeof document<"u"?document.documentElement:null;(!x||!x.hasAttribute("data-vb-gestures-init"))&&(x?.setAttribute("data-vb-gestures-init",""),N())});var U=window.matchMedia("(prefers-reduced-motion: reduce)");var C=new Map;function M(t,e,s={}){let r=s.priority??10,n={impl:e,bundle:s.bundle,contract:s.contract,priority:r},i=C.get(t);if(customElements.get(t)){if(!i||i.priority>=r){i&&i.priority===r&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${s.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${s.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=r){i.priority===r&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${i.bundle}". Skipping "${s.bundle}" (first wins at equal priority).`);return}C.set(t,n),customElements.define(t,e)}var A=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,s,r,n){e.addEventListener(s,r,n),this.#e.push(()=>e.removeEventListener(s,r,n))}setup(){}teardown(){}setState(e,s){this.#t||(this.#t=this.attachInternals());let r=this.#t.states;try{s?r.add(e):r.delete(e)}catch{let n=`--${e}`;s?r.add(n):r.delete(n)}}_adoptInternals(e){this.#t||(this.#t=e)}};function D(t){return document.startViewTransition?document.startViewTransition(t):t()}var z=0,k=class extends A{#e;#t=[];#s;#r;#n;#o;#l;#c=null;#i=0;#f=0;#u=!1;#h=!1;#a=!1;#d=null;get currentIndex(){return this.#i}get slideCount(){return this.#t.length}get playing(){return this.#c!==null}setup(){let e=[...this.children];if(e.length===0)return!1;if(this.#h=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#a=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#a&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Carousel"),this.#e=document.createElement("div"),this.#e.className="carousel-track",this.#e.setAttribute("tabindex","0"),this.#e.setAttribute("aria-label","Slides"),e.forEach((i,o)=>{i.setAttribute("role","group"),i.setAttribute("aria-roledescription","slide"),i.setAttribute("aria-label",`${o+1} of ${e.length}`),this.#e.appendChild(i)}),this.#t=[...this.#e.children],this.#s=document.createElement("button"),this.#s.className="carousel-prev",this.#s.setAttribute("aria-label","Previous slide"),this.#s.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#r=document.createElement("button"),this.#r.className="carousel-next",this.#r.setAttribute("aria-label","Next slide"),this.#r.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#n=document.createElement("div"),this.#n.className="carousel-indicators",this.#n.setAttribute("aria-label","Slide indicators"),this.#t.forEach((i,o)=>{let a=document.createElement("button");a.className="carousel-dot",a.setAttribute("aria-label",`Go to slide ${o+1}`),a.setAttribute("aria-current",o===0?"true":"false"),this.listen(a,"click",()=>this.goTo(o)),this.#n.appendChild(a)})),this.#o=document.createElement("div"),this.#o.className="carousel-live",this.#o.setAttribute("aria-live","polite"),this.#o.setAttribute("aria-atomic","true"),this.appendChild(this.#s),this.appendChild(this.#e),this.appendChild(this.#r),this.#n&&this.appendChild(this.#n),this.appendChild(this.#o),this.listen(this.#s,"click",()=>this.prev()),this.listen(this.#r,"click",()=>this.next()),this.listen(this.#e,"keydown",this.#E),this.#a){let i=++z,o=this.getAttribute("transition")||"fade",a=o==="slide"?"vt-carousel-slide":o==="scale"?"vt-carousel-scale":"vt-carousel";this.#e.style.viewTransitionName=`carousel-${i}`,this.#e.style.viewTransitionClass=a}this.#a&&Promise.resolve().then(()=>(q(),Y)).then(({addSwipeListener:i})=>{this.#d=i(this.#e,{threshold:40}),this.listen(this.#e,"swipe-left",()=>this.next()),this.listen(this.#e,"swipe-right",()=>this.prev())}),this.#a||(this.#l=new IntersectionObserver(this.#y,{root:this.#e,threshold:.5}),this.#t.forEach(i=>this.#l.observe(i)),"onscrollend"in window&&this.listen(this.#e,"scrollend",()=>{this.#u=!1,this.#m()}));let n=this.#g()??(Number(this.getAttribute("start"))||0);if(this.#a){let i=n>0&&n<this.#t.length?n:0;this.#t.forEach((o,a)=>{o.hidden=a!==i}),this.#p(i)}else n>0&&n<this.#t.length&&this.goTo(n,!1);return this.#b(),this.hasAttribute("autoplay")&&!this.#h&&this.#w(),!0}teardown(){this.pause(),this.#l&&(this.#l.disconnect(),this.#l=null),this.#d&&(this.#d(),this.#d=null),this.#e?.parentElement===this&&[...this.#e.children].forEach(e=>this.appendChild(e)),this.#e?.remove(),this.#s?.remove(),this.#r?.remove(),this.#n?.remove(),this.#o?.remove(),this.#e=this.#s=this.#r=this.#n=this.#o=null,this.#t=[],this.#a=!1,this.#i=0,this.#f=0,this.#u=!1}get slides(){return this.#t.map((e,s)=>({id:e.id||void 0,html:e.innerHTML,label:e.getAttribute("aria-label")||`${s+1} of ${this.#t.length}`}))}set slides(e){let s=Array.isArray(e)?e:[];for(;this.firstChild;)this.firstChild.remove();for(let r of s){let n=document.createElement("div");r.id&&(n.id=r.id),r.label&&n.setAttribute("aria-label",r.label),n.innerHTML=r.html||"",this.appendChild(n)}this.teardown(),this.removeAttribute("data-upgraded"),this.setup(),this.dispatchEvent(new CustomEvent("carousel-wc:slides-changed",{detail:{slides:s,source:"property"},bubbles:!0}))}next(){let e=this.hasAttribute("loop");this.#i<this.#t.length-1?this.goTo(this.#i+1):e&&this.goTo(0)}prev(){let e=this.hasAttribute("loop");this.#i>0?this.goTo(this.#i-1):e&&this.goTo(this.#t.length-1)}goTo(e,s=!0){if(!(e<0||e>=this.#t.length)){if(this.#a)if(s&&e!==this.#i){let r=e>this.#i?"forward":"backward";document.documentElement.dataset.vtDirection=r,D(()=>{this.#v(e)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#v(e);else{let r=this.#t[e].offsetLeft-this.#e.offsetLeft,n=s&&!this.#h?"smooth":"instant";this.#e.scrollTo({left:r,behavior:n})}this.#p(e)}}#v(e){this.#t.forEach((s,r)=>{s.hidden=r!==e})}play(){if(this.#c||this.#h)return;let e=Number(this.getAttribute("autoplay-delay"))||5e3;this.#c=setInterval(()=>this.next(),e),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}pause(){this.#c&&(clearInterval(this.#c),this.#c=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}reset(){let e=Number(this.getAttribute("start"))||0;this.goTo(e,!1),this.#L()}#p(e){this.#i=e,this.#b(),this.#A(),this.#o&&(this.#o.textContent=`Slide ${e+1} of ${this.#t.length}`),!this.#u&&(this.#m(),!this.#a&&"onscrollend"in window&&(this.#u=!0))}#m(){this.#i!==this.#f&&(this.#f=this.#i,this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:this.#i,slide:this.#t[this.#i]},bubbles:!0})))}#b(){let e=this.hasAttribute("loop"),s=this.#i===0,r=this.#i===this.#t.length-1;if(this.#s&&(this.#s.disabled=!e&&s),this.#r&&(this.#r.disabled=!e&&r),this.#n){let n=this.#n.children;for(let i=0;i<n.length;i++){let o=i===this.#i;n[i].setAttribute("aria-current",o?"true":"false"),o?n[i].setAttribute("data-active",""):n[i].removeAttribute("data-active")}}}#y=e=>{for(let s of e)if(s.isIntersecting){let r=this.#t.indexOf(s.target);r!==-1&&r!==this.#i&&this.#p(r)}};#E=e=>{switch(e.key){case"ArrowLeft":e.preventDefault(),this.prev();break;case"ArrowRight":e.preventDefault(),this.next();break;case"Home":e.preventDefault(),this.goTo(0);break;case"End":e.preventDefault(),this.goTo(this.#t.length-1);break}};#w(){this.play(),this.listen(this,"mouseenter",()=>this.pause()),this.listen(this,"mouseleave",()=>{this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"focusin",()=>this.pause()),this.listen(this,"focusout",e=>{!this.contains(e.relatedTarget)&&this.hasAttribute("autoplay")&&this.play()}),this.listen(this,"touchstart",()=>this.pause(),{passive:!0})}#g(){let e=this.getAttribute("persist");if(!e)return null;try{let s=localStorage.getItem(`carousel:${e}`);return s!==null?Number(s):null}catch{return null}}#A(){let e=this.getAttribute("persist");if(e)try{localStorage.setItem(`carousel:${e}`,String(this.#i))}catch{}}#L(){let e=this.getAttribute("persist");if(e)try{localStorage.removeItem(`carousel:${e}`)}catch{}}};M("carousel-wc",k);export{k as CarouselWc};
1
+ var q=Object.defineProperty;var R=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>{for(var i in t)q(e,i,{get:t[i],enumerable:!0})};var Y={};F(Y,{addDialogDismiss:()=>I,addFlickListener:()=>D,addLongPress:()=>S,addPullToRefresh:()=>X,addSwipeListener:()=>$,haptic:()=>L,initGestures:()=>N,makeSwipeable:()=>P});function $(e,t={}){let i=t.threshold??50,r=t.restraint??100,a=t.timeout??300,s=t.velocity??.5,n=t.minFlickDistance??10,c,o,d;function p(u){u.isPrimary&&(c=u.clientX,o=u.clientY,d=Date.now())}function f(u){if(!u.isPrimary)return;let v=u.clientX-c,m=u.clientY-o,l=Date.now()-d;if(l>a)return;let h=Math.abs(v),b=Math.abs(m),E=Math.max(h,b),y=l>0?E/l:0,g=y>=s&&E>=n,w;if((h>=i||g&&h>b)&&b<=r?w=v<0?"left":"right":(b>=i||g&&b>h)&&h<=r&&(w=m<0?"up":"down"),w){let V=w==="left"||w==="right"?h:b;e.dispatchEvent(new CustomEvent(`swipe-${w}`,{bubbles:!0,detail:{distance:V,duration:l,velocity:y,flick:g}}))}}return e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("pointerup",f,{passive:!0}),()=>{e.removeEventListener("pointerdown",p),e.removeEventListener("pointerup",f)}}function D(e,t={}){let i=t.minDistance??10,r=t.velocity??.6,a=t.timeout??250,s=t.restraint??80,n,c,o;function d(f){f.isPrimary&&(n=f.clientX,c=f.clientY,o=Date.now())}function p(f){if(!f.isPrimary)return;let u=f.clientX-n,v=f.clientY-c,m=Date.now()-o;if(m===0||m>a)return;let l=Math.abs(u),h=Math.abs(v),b=Math.max(l,h);if(b<i)return;let E=b/m;if(E<r)return;let y;if(l>h&&h<=s?y=u<0?"left":"right":h>l&&l<=s&&(y=v<0?"up":"down"),y){let g=y==="left"||y==="right"?l:h;e.dispatchEvent(new CustomEvent(`swipe-${y}`,{bubbles:!0,detail:{distance:g,duration:m,velocity:E,flick:!0}}))}}return e.addEventListener("pointerdown",d,{passive:!0}),e.addEventListener("pointerup",p,{passive:!0}),()=>{e.removeEventListener("pointerdown",d),e.removeEventListener("pointerup",p)}}function P(e,t={}){let i=t.threshold??100,r=t.direction??"horizontal",a=t.removeOnDismiss??!0,s=r==="horizontal",n=0,c=0,o=!1;function d(l){!l.isPrimary||e.hasAttribute("data-dismissed")||(l.preventDefault(),o=!0,n=s?l.clientX:l.clientY,c=0,e.setPointerCapture(l.pointerId),e.setAttribute("data-swiping",""))}function p(l){if(!o||!l.isPrimary)return;c=(s?l.clientX:l.clientY)-n;let b=1-Math.min(Math.abs(c)/i,1)*.5;s?e.style.transform=`translateX(${c}px)`:e.style.transform=`translateY(${c}px)`,e.style.opacity=String(b)}function f(l){!o||!l.isPrimary||(o=!1,e.releasePointerCapture(l.pointerId),e.removeAttribute("data-swiping"),Math.abs(c)>=i?v(c>0?"right":"left"):m())}function u(l){!o||!l.isPrimary||(o=!1,e.releasePointerCapture(l.pointerId),e.removeAttribute("data-swiping"),m())}function v(l){let h=l==="right"?"100%":"-100%";e.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",e.style.transform=s?`translateX(${h})`:`translateY(${h})`,e.style.opacity="0",e.setAttribute("data-dismissed",""),L.dismiss(),e.dispatchEvent(new CustomEvent("swipe-dismiss",{bubbles:!0,detail:{direction:l,distance:Math.abs(c)}})),a&&e.addEventListener("transitionend",()=>e.remove(),{once:!0})}function m(){e.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",e.style.transform="",e.style.opacity="",e.addEventListener("transitionend",()=>{e.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",d),e.addEventListener("pointermove",p),e.addEventListener("pointerup",f),e.addEventListener("pointercancel",u),()=>{e.removeEventListener("pointerdown",d),e.removeEventListener("pointermove",p),e.removeEventListener("pointerup",f),e.removeEventListener("pointercancel",u)}}function X(e,t,i={}){let r=i.threshold??70,a=i.maxPull??120,s=document.createElement("div");s.setAttribute("data-pull-indicator",""),s.setAttribute("aria-hidden","true");let n=document.createElement("div");n.setAttribute("data-pull-spinner",""),s.appendChild(n),e.prepend(s);let c=0,o=!1,d=!1;function p(h){!h.isPrimary||d||e.scrollTop<=0&&(c=h.clientY,o=!0)}function f(h){if(!o||!h.isPrimary||d)return;let b=h.clientY-c;if(b<=0){s.style.transform="",s.style.opacity="";return}let E=Math.min(b,a),y=E/r;s.style.transform=`translateY(${E}px)`,s.style.opacity=String(Math.min(y,1)),y>=1?s.setAttribute("data-pull-ready",""):s.removeAttribute("data-pull-ready")}function u(h){!o||!h.isPrimary||(o=!1,s.hasAttribute("data-pull-ready")&&!d?m():l())}function v(h){!o||!h.isPrimary||(o=!1,l())}async function m(){d=!0,s.removeAttribute("data-pull-ready"),s.setAttribute("data-pull-loading",""),s.style.transform=`translateY(${r}px)`,s.style.opacity="1";try{await t()}finally{d=!1,s.removeAttribute("data-pull-loading"),l()}}function l(){s.style.transition="transform 0.3s ease, opacity 0.3s ease",s.style.transform="",s.style.opacity="",s.removeAttribute("data-pull-ready"),s.addEventListener("transitionend",()=>{s.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",p,{passive:!0}),e.addEventListener("pointermove",f,{passive:!0}),e.addEventListener("pointerup",u,{passive:!0}),e.addEventListener("pointercancel",v,{passive:!0}),()=>{e.removeEventListener("pointerdown",p),e.removeEventListener("pointermove",f),e.removeEventListener("pointerup",u),e.removeEventListener("pointercancel",v),s.remove()}}function S(e,t,i={}){let r=i.duration??500,a=i.hapticFeedback??!0,s=i.blockContextMenu??!0,n=null;function c(p){p.isPrimary&&(n=setTimeout(()=>{a&&L.tap(),t(p),n=null},r))}function o(){n&&(clearTimeout(n),n=null)}function d(p){s&&p.preventDefault()}return e.addEventListener("pointerdown",c,{passive:!0}),e.addEventListener("pointermove",o,{passive:!0}),e.addEventListener("pointerup",o,{passive:!0}),e.addEventListener("pointercancel",o,{passive:!0}),e.addEventListener("contextmenu",d),()=>{o(),e.removeEventListener("pointerdown",c),e.removeEventListener("pointermove",o),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",o),e.removeEventListener("contextmenu",d)}}function I(e,t={}){let i=t.threshold??80,r=0,a=0,s=!1;function n(u){if(!u.isPrimary||!e.open)return;let v=u.target;v.closest("a, button, input, select, textarea, [contenteditable]")&&!v.closest("header")||(s=!0,r=u.clientY,a=0,e.setPointerCapture(u.pointerId),e.style.transition="none")}function c(u){if(!s||!u.isPrimary)return;if(a=u.clientY-r,a<=0){e.style.transform="",e.style.opacity="";return}let m=1-Math.min(a/i,1)*.4;e.style.transform=`translateY(${a}px)`,e.style.opacity=String(m)}function o(u){!s||!u.isPrimary||(s=!1,e.releasePointerCapture(u.pointerId),a>=i?p():f())}function d(u){!s||!u.isPrimary||(s=!1,e.releasePointerCapture(u.pointerId),f())}function p(){e.style.transition="transform 0.2s ease-out, opacity 0.2s ease-out",e.style.transform="translateY(100%)",e.style.opacity="0",L.dismiss(),e.addEventListener("transitionend",()=>{e.style.transition="",e.style.transform="",e.style.opacity="",e.close("dismiss")},{once:!0})}function f(){e.style.transition="transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease",e.style.transform="",e.style.opacity="",e.addEventListener("transitionend",()=>{e.style.transition=""},{once:!0})}return e.addEventListener("pointerdown",n),e.addEventListener("pointermove",c),e.addEventListener("pointerup",o),e.addEventListener("pointercancel",d),()=>{e.removeEventListener("pointerdown",n),e.removeEventListener("pointermove",c),e.removeEventListener("pointerup",o),e.removeEventListener("pointercancel",d)}}function N(e=document){let t=[];for(let i of e.querySelectorAll('[data-gesture="swipe"]'))t.push($(i));for(let i of e.querySelectorAll('[data-gesture="flick"]'))t.push(D(i));for(let i of e.querySelectorAll('[data-gesture="dismiss"]'))t.push(P(i));for(let i of e.querySelectorAll('[data-gesture="long-press"]'))t.push(S(i,()=>{i.dispatchEvent(new CustomEvent("long-press",{bubbles:!0}))}));for(let i of e.querySelectorAll('dialog[data-gesture="dismiss-down"]'))t.push(I(i));return()=>t.forEach(i=>i())}var L,x,B=R(()=>{L={tap:()=>navigator.vibrate?.(8),confirm:()=>navigator.vibrate?.([8,40,8]),error:()=>navigator.vibrate?.([30,60,30]),dismiss:()=>navigator.vibrate?.(15)};x=typeof document<"u"?document.documentElement:null;(!x||!x.hasAttribute("data-vb-gestures-init"))&&(x?.setAttribute("data-vb-gestures-init",""),N())});var O=window.matchMedia("(prefers-reduced-motion: reduce)");var k=new Map;function M(e,t,i={}){let r=i.priority??10,a={impl:t,bundle:i.bundle,contract:i.contract,priority:r},s=k.get(e);if(customElements.get(e)){if(!s||s.priority>=r){s&&s.priority===r&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${i.bundle}".`);return}console.warn(`[VB Bundle] Tag <${e}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${i.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=r){s.priority===r&&console.warn(`[VB Bundle] Tag <${e}> already registered by "${s.bundle}". Skipping "${i.bundle}" (first wins at equal priority).`);return}k.set(e,a),customElements.define(e,t)}var A=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,i,r,a){t.addEventListener(i,r,a),this.#t.push(()=>t.removeEventListener(i,r,a))}_reinit(){for(let t of this.#t)t();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,i){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{i?r.add(t):r.delete(t)}catch{let a=`--${t}`;i?r.add(a):r.delete(a)}}_adoptInternals(t){this.#e||(this.#e=t)}#s(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#s()?.validity}get validationMessage(){return this.#s()?.validationMessage??""}get willValidate(){return this.#s()?.willValidate??!1}get form(){return this.#s()?.form??null}checkValidity(){return this.#s()?.checkValidity()??!0}reportValidity(){return this.#s()?.reportValidity()??!0}};function T(e){return document.startViewTransition?document.startViewTransition(e):e()}var z=0,C=class extends A{#t;#e=[];#s;#o;#a;#r;#n;#p;#h=null;#i=0;#E=0;#m=!1;#d=!1;#c=!1;#b=null;#l=!1;#w=!1;#f=!1;#v=!1;#A=new WeakSet;get currentIndex(){return this.#i}get slideCount(){return this.#e.length}get playing(){return this.#h!==null}setup(){let t=[...this.children];if(t.length===0)return!1;this.#d=window.matchMedia("(prefers-reduced-motion: reduce)").matches||document.documentElement.hasAttribute("data-motion-reduced"),this.#c=this.hasAttribute("transition")&&!!document.startViewTransition,this.hasAttribute("transition")&&!this.#c&&this.removeAttribute("transition"),this.setAttribute("role","region"),this.setAttribute("aria-roledescription","carousel"),!this.hasAttribute("aria-label")&&!this.hasAttribute("aria-labelledby")&&this.setAttribute("aria-label","Carousel"),this.#t=document.createElement("div"),this.#t.className="carousel-track",this.#t.setAttribute("tabindex","0");let i=this.getAttribute("item-width");if(i&&i!=="auto"&&i!=="full"&&CSS.supports("inline-size",i)&&this.#t.style.setProperty("--_item-width",i),t.forEach((n,c)=>{n.setAttribute("role","group"),n.setAttribute("aria-roledescription","slide"),n.hasAttribute("aria-label")||(n.setAttribute("aria-label",`${c+1} of ${t.length}`),this.#A.add(n)),this.#t.appendChild(n)}),this.#e=[...this.#t.children],this.hasAttribute("autoplay")&&!this.#d&&this.#x(),this.#o=document.createElement("button"),this.#o.className="carousel-prev",this.#o.setAttribute("aria-label","Previous slide"),this.#o.innerHTML='<icon-wc name="chevron-left" size="sm"></icon-wc>',this.#a=document.createElement("button"),this.#a.className="carousel-next",this.#a.setAttribute("aria-label","Next slide"),this.#a.innerHTML='<icon-wc name="chevron-right" size="sm"></icon-wc>',this.getAttribute("indicators")!=="false"&&(this.#r=document.createElement("div"),this.#r.className="carousel-indicators",this.#r.setAttribute("role","group"),this.#r.setAttribute("aria-label","Slide indicators"),this.#e.forEach((n,c)=>{let o=document.createElement("button");o.className="carousel-dot",o.setAttribute("aria-label",`Go to slide ${c+1}`),o.setAttribute("aria-current",c===0?"true":"false"),this.listen(o,"click",()=>this.goTo(c)),this.#r.appendChild(o)})),this.#n=document.createElement("div"),this.#n.className="carousel-live",this.#n.setAttribute("aria-live","polite"),this.#n.setAttribute("aria-atomic","true"),this.#s&&this.appendChild(this.#s),this.appendChild(this.#o),this.appendChild(this.#t),this.appendChild(this.#a),this.#r&&this.appendChild(this.#r),this.appendChild(this.#n),this.listen(this.#o,"click",()=>this.prev()),this.listen(this.#a,"click",()=>this.next()),this.listen(this.#t,"keydown",this.#P),this.listen(this,"mouseenter",()=>{this.#f=!0,this.#u()}),this.listen(this,"mouseleave",()=>{this.#f=!1,this.#u()}),this.listen(this,"touchstart",()=>{this.#f=!0,this.#u()},{passive:!0}),this.listen(this,"focusin",()=>{this.#v=!0,this.#u()}),this.listen(this,"focusout",n=>{this.contains(n.relatedTarget)||(this.#v=!1,this.#u())}),this.#c){let n=++z,c=this.getAttribute("transition")||"fade",o=c==="slide"?"vt-carousel-slide":c==="scale"?"vt-carousel-scale":"vt-carousel";this.#t.style.viewTransitionName=`carousel-${n}`,this.#t.style.viewTransitionClass=o}if(this.#c){let n=this.#t;Promise.resolve().then(()=>(B(),Y)).then(({addSwipeListener:c})=>{!this.isConnected||this.#t!==n||(this.#b=c(n,{threshold:40}),this.listen(n,"swipe-left",()=>this.#y()?this.prev():this.next()),this.listen(n,"swipe-right",()=>this.#y()?this.next():this.prev()))})}this.#c||(this.#p=new IntersectionObserver(this.#D,{root:this.#t,threshold:.5}),this.#e.forEach(n=>this.#p.observe(n)),"onscrollend"in window&&this.listen(this.#t,"scrollend",()=>{this.#m=!1,this.#M()}));let s=this.#S()??(Number(this.getAttribute("start"))||0);if(this.#c){let n=s>0&&s<this.#e.length?s:0;this.#e.forEach((c,o)=>{c.hidden=o!==n}),this.#g(n)}else s>0&&s<this.#e.length&&this.goTo(s,!1);return this.#T(),this.#f=this.#v=!1,this.#l=this.hasAttribute("autoplay")&&!this.#d&&!this.#w,this.#u(),!0}teardown(){this.#l=!1,this.#k(),this.#p&&(this.#p.disconnect(),this.#p=null),this.#b&&(this.#b(),this.#b=null),this.#t?.parentElement===this&&[...this.#t.children].forEach(t=>this.appendChild(t)),this.#e.forEach(t=>{this.#A.has(t)&&t.removeAttribute("aria-label")}),this.#t?.remove(),this.#s?.remove(),this.#o?.remove(),this.#a?.remove(),this.#r?.remove(),this.#n?.remove(),this.#t=this.#s=this.#o=this.#a=this.#r=this.#n=null,this.#e=[],this.#c=!1,this.#i=0,this.#E=0,this.#m=!1}get slides(){return this.#e.map((t,i)=>({id:t.id||void 0,html:t.innerHTML,label:t.getAttribute("aria-label")||`${i+1} of ${this.#e.length}`}))}set slides(t){let i=Array.isArray(t)?t:[];for(;this.firstChild;)this.firstChild.remove();for(let r of i){let a=document.createElement("div");r.id&&(a.id=r.id),r.label&&a.setAttribute("aria-label",r.label),a.innerHTML=r.html||"",this.appendChild(a)}this._reinit(),this.dispatchEvent(new CustomEvent("carousel-wc:slides-changed",{detail:{slides:i,source:"property"},bubbles:!0}))}next(){let t=this.hasAttribute("loop");this.#i<this.#e.length-1?this.goTo(this.#i+1):t&&this.goTo(0)}prev(){let t=this.hasAttribute("loop");this.#i>0?this.goTo(this.#i-1):t&&this.goTo(this.#e.length-1)}goTo(t,i=!0){if(!(t<0||t>=this.#e.length)){if(this.#c)if(i&&t!==this.#i){let r=t>this.#i?"forward":"backward";document.documentElement.dataset.vtDirection=r,T(()=>{this.#L(t)}).finished?.then(()=>{delete document.documentElement.dataset.vtDirection})}else this.#L(t);else{let r=this.#e[t].getBoundingClientRect(),a=this.#t.getBoundingClientRect(),s=this.#y()?r.right-a.right:r.left-a.left,n=i&&!this.#d?"smooth":"instant";this.#t.scrollTo({left:this.#t.scrollLeft+s,behavior:n})}this.#g(t)}}#L(t){this.#e.forEach((i,r)=>{i.hidden=r!==t})}play(){this.#d||!this.#t||(this.#w=!1,this.#l=!0,this.#f=this.#v=!1,this.#s||(this.#x(),this.insertBefore(this.#s,this.firstChild)),this.#u())}pause(){this.#w=!0,this.#l=!1,this.#u()}#x(){let t=document.createElement("button");t.type="button",t.className="carousel-rotate",this.listen(t,"click",()=>{this.#l?this.pause():this.play()}),this.#s=t,this.#C()}#C(){let t=this.#s;if(!t)return;let i=this.#l?"Pause automatic slide show":"Start automatic slide show";t.getAttribute("aria-label")!==i&&(t.setAttribute("aria-label",i),t.innerHTML=`<icon-wc name="${this.#l?"pause":"play"}" size="sm"></icon-wc>`)}#u(){this.#l&&!this.#f&&!this.#v&&!this.#d&&this.isConnected&&!!this.#t?this.#$():this.#k(),this.#C()}#$(){if(this.#h)return;let t=Number(this.getAttribute("autoplay-delay"))||5e3;this.#h=setInterval(()=>this.next(),t),this.#n?.setAttribute("aria-live","off"),this.dispatchEvent(new CustomEvent("carousel-wc:play",{bubbles:!0}))}#k(){this.#n?.setAttribute("aria-live","polite"),this.#h&&(clearInterval(this.#h),this.#h=null,this.dispatchEvent(new CustomEvent("carousel-wc:pause",{bubbles:!0})))}#y(){return getComputedStyle(this).direction==="rtl"}reset(){let t=Number(this.getAttribute("start"))||0;this.goTo(t,!1),this.#N()}#g(t){this.#i=t,this.#T(),this.#I(),this.#n&&(this.#n.textContent=`Slide ${t+1} of ${this.#e.length}`),!this.#m&&(this.#M(),!this.#c&&"onscrollend"in window&&(this.#m=!0))}#M(){this.#i!==this.#E&&(this.#E=this.#i,this.dispatchEvent(new CustomEvent("carousel-wc:change",{detail:{index:this.#i,slide:this.#e[this.#i]},bubbles:!0})))}#T(){let t=this.hasAttribute("loop"),i=this.#i===0,r=this.#i===this.#e.length-1;if(this.#o&&(this.#o.disabled=!t&&i),this.#a&&(this.#a.disabled=!t&&r),this.#r){let a=this.#r.children;for(let s=0;s<a.length;s++){let n=s===this.#i;a[s].setAttribute("aria-current",n?"true":"false"),n?a[s].setAttribute("data-active",""):a[s].removeAttribute("data-active")}}}#D=t=>{for(let i of t)if(i.isIntersecting){let r=this.#e.indexOf(i.target);r!==-1&&r!==this.#i&&this.#g(r)}};#P=t=>{let i=(t.key==="ArrowLeft"||t.key==="ArrowRight")&&this.#y();switch(t.key){case"ArrowLeft":t.preventDefault(),i?this.next():this.prev();break;case"ArrowRight":t.preventDefault(),i?this.prev():this.next();break;case"Home":t.preventDefault(),this.goTo(0);break;case"End":t.preventDefault(),this.goTo(this.#e.length-1);break}};#S(){let t=this.getAttribute("persist");if(!t)return null;try{let i=localStorage.getItem(`carousel:${t}`);return i!==null?Number(i):null}catch{return null}}#I(){let t=this.getAttribute("persist");if(t)try{localStorage.setItem(`carousel:${t}`,String(this.#i))}catch{}}#N(){let t=this.getAttribute("persist");if(t)try{localStorage.removeItem(`carousel:${t}`)}catch{}}};M("carousel-wc",C);export{C as CarouselWc};
2
2
  //# sourceMappingURL=carousel-wc.js.map
@@ -1,12 +1,2 @@
1
- var l=window.matchMedia("(prefers-reduced-motion: reduce)");var c=new Map;function d(o,t,r={}){let e=r.priority??10,n={impl:t,bundle:r.bundle,contract:r.contract,priority:e},i=c.get(o);if(customElements.get(o)){if(!i||i.priority>=e){i&&i.priority===e&&i.impl!==t&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${r.bundle}".`);return}console.warn(`[VB Bundle] Tag <${o}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${r.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=e){i.priority===e&&console.warn(`[VB Bundle] Tag <${o}> already registered by "${i.bundle}". Skipping "${r.bundle}" (first wins at equal priority).`);return}c.set(o,n),customElements.define(o,t)}var s=class extends HTMLElement{#t=[];#e;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,r,e,n){t.addEventListener(r,e,n),this.#t.push(()=>t.removeEventListener(r,e,n))}setup(){}teardown(){}setState(t,r){this.#e||(this.#e=this.attachInternals());let e=this.#e.states;try{r?e.add(t):e.delete(t)}catch{let n=`--${t}`;r?e.add(n):e.delete(n)}}_adoptInternals(t){this.#e||(this.#e=t)}};var a=class extends s{setup(){this.querySelector("[data-controls]")||this.#t()}#t(){let t=document.createElement("nav");t.setAttribute("data-controls",""),t.setAttribute("aria-label","Change view controls"),t.innerHTML=`
2
- <button type="button" data-action="tracking" aria-pressed="true">
3
- Tracking
4
- </button>
5
- <button type="button" data-action="final" aria-pressed="false">
6
- Final
7
- </button>
8
- <button type="button" data-action="original" aria-pressed="false">
9
- Original
10
- </button>
11
- `,this.prepend(t),t.addEventListener("click",r=>{let n=r.target.closest("[data-action]")?.dataset.action;if(n){n==="tracking"?this.removeAttribute("view"):this.setAttribute("view",n);for(let i of t.querySelectorAll("button"))i.setAttribute("aria-pressed",String(i.dataset.action===n));this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:n},bubbles:!0}))}})}get view(){return this.getAttribute("view")??"tracking"}set view(t){if(this.view===t)return;t==="tracking"?this.removeAttribute("view"):this.setAttribute("view",t);let e=this.querySelector("[data-controls]");if(e)for(let n of e.querySelectorAll("button"))n.setAttribute("aria-pressed",String(n.dataset.action===t));this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:t,source:"api"},bubbles:!0}))}};d("change-set",a);export{a as ChangeSet};
1
+ var h=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(s,t,e={}){let i=e.priority??10,r={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=d.get(s);if(customElements.get(s)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> 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 <${s}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}d.set(s,r),customElements.define(s,t)}var o=class extends HTMLElement{#e=[];#t;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{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,r){t.addEventListener(e,i,r),this.#e.push(()=>t.removeEventListener(e,i,r))}_reinit(){for(let t of this.#e)t();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(t,e){this.#t||(this.#t=this.attachInternals());let i=this.#t.states;try{e?i.add(t):i.delete(t)}catch{let r=`--${t}`;e?i.add(r):i.delete(r)}}_adoptInternals(t){this.#t||(this.#t=t)}#i(){return this.constructor.formAssociated&&this.#t?this.#t:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var a=["tracking","final","original"],u={tracking:"Tracking",final:"Final",original:"Original"},c=class extends o{static observedAttributes=["view","author","datetime","controls"];setup(){this.#e(),this.listen(this,"click",this.#o)}attributeChangedCallback(t,e,i){!this.hasAttribute("data-upgraded")||e===i||(t==="view"?this.#n():this.#e())}#e(){this.querySelector(":scope > [data-change-caption]")?.remove(),this.querySelector(":scope > [data-controls]")?.remove();let t=this.#t(),e=[];t&&e.push(t),this.getAttribute("controls")!=="none"&&e.push(this.#i(t)),this.prepend(...e),this.#n()}#t(){let t=this.getAttribute("author"),e=this.getAttribute("datetime");if(!t&&!e)return null;let i=document.createElement("p");if(i.setAttribute("data-change-caption",""),i.append(t?`Changes by ${t}`:"Changes"),e){i.append(t?", ":" from ");let r=document.createElement("time");r.setAttribute("datetime",e),r.textContent=this.#s(e),i.append(r)}return i}#i(t){let e=document.createElement("div");e.setAttribute("data-controls",""),e.setAttribute("role","group");let i=t?`, ${t.textContent}`:"";e.setAttribute("aria-label",`Change view${i}`);for(let r of a){let n=document.createElement("button");n.type="button",n.dataset.action=r,n.textContent=u[r],e.append(n)}return e}#s(t){let e=new Date(t);if(Number.isNaN(e.getTime()))return t;let i=this.closest("[lang]")?.lang||void 0,r=/^\d{4}-\d{2}-\d{2}$/.test(t);return new Intl.DateTimeFormat(i,{dateStyle:"medium",...r?{timeZone:"UTC"}:{timeStyle:"short"}}).format(e)}#n(){let t=this.view;for(let e of this.querySelectorAll(":scope > [data-controls] > button[data-action]"))e.setAttribute("aria-pressed",String(e.dataset.action===t))}#o=t=>{let e=t.target.closest?.("[data-action]");if(!e||e.parentElement?.parentElement!==this||!e.parentElement.hasAttribute("data-controls"))return;let i=e.dataset.action;!i||!a.includes(i)||i!==this.view&&(this.#r(i),this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:i},bubbles:!0})))};#r(t){t==="tracking"?this.removeAttribute("view"):this.setAttribute("view",t),this.#n()}get view(){let t=this.getAttribute("view");return t==="final"||t==="original"?t:"tracking"}set view(t){!a.includes(t)||this.view===t||(this.#r(t),this.dispatchEvent(new CustomEvent("change-set:view",{detail:{view:t,source:"api"},bubbles:!0})))}};l("change-set",c);export{c as ChangeSet};
12
2
  //# sourceMappingURL=change-set.js.map