vanilla-breeze 0.6.2 → 0.7.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 (239) hide show
  1. package/dist/cdn/components/accordion-wc.js +1 -1
  2. package/dist/cdn/components/activity-feed.js +1 -1
  3. package/dist/cdn/components/ai-chat.js +6 -6
  4. package/dist/cdn/components/ai-summary.js +2 -2
  5. package/dist/cdn/components/analytics-panel.js +2 -2
  6. package/dist/cdn/components/audio-player.js +4 -4
  7. package/dist/cdn/components/audio-visualizer.js +2 -2
  8. package/dist/cdn/components/author-index.js +2 -2
  9. package/dist/cdn/components/brand-mark.js +1 -1
  10. package/dist/cdn/components/bread-crumb.js +1 -1
  11. package/dist/cdn/components/calendar-wc.js +2 -2
  12. package/dist/cdn/components/card-list.js +1 -1
  13. package/dist/cdn/components/carousel-wc.js +1 -1
  14. package/dist/cdn/components/change-set.js +1 -1
  15. package/dist/cdn/components/chart-wc.js +13 -13
  16. package/dist/cdn/components/chat-input.js +1 -1
  17. package/dist/cdn/components/chat-window.js +1 -1
  18. package/dist/cdn/components/color-picker.js +1 -1
  19. package/dist/cdn/components/combo-box.js +1 -1
  20. package/dist/cdn/components/command-palette.js +1 -1
  21. package/dist/cdn/components/comment-box.js +35 -35
  22. package/dist/cdn/components/comment-thread.js +38 -38
  23. package/dist/cdn/components/comment-wc.js +1 -1
  24. package/dist/cdn/components/compare-surface.js +1 -1
  25. package/dist/cdn/components/consent-banner.js +1 -1
  26. package/dist/cdn/components/content-lens.js +1 -1
  27. package/dist/cdn/components/content-swap.js +1 -1
  28. package/dist/cdn/components/context-menu.js +1 -1
  29. package/dist/cdn/components/data-table.js +1 -1
  30. package/dist/cdn/components/date-picker.js +1 -1
  31. package/dist/cdn/components/day-view.js +1 -1
  32. package/dist/cdn/components/diagram-wc.js +2 -2
  33. package/dist/cdn/components/drag-surface.js +1 -1
  34. package/dist/cdn/components/drop-down.js +1 -1
  35. package/dist/cdn/components/emoji-picker.js +1 -1
  36. package/dist/cdn/components/flow-diagram.js +1 -1
  37. package/dist/cdn/components/foot-notes.js +1 -1
  38. package/dist/cdn/components/form-field.js +1 -1
  39. package/dist/cdn/components/geo-map.js +3 -3
  40. package/dist/cdn/components/glossary-index.js +1 -1
  41. package/dist/cdn/components/glossary-wc.js +1 -1
  42. package/dist/cdn/components/heading-links.js +1 -1
  43. package/dist/cdn/components/highlight-wc.js +2 -2
  44. package/dist/cdn/components/icon-wc.js +2 -2
  45. package/dist/cdn/components/image-gallery.js +1 -1
  46. package/dist/cdn/components/image-map.js +1 -1
  47. package/dist/cdn/components/include-file.js +1 -1
  48. package/dist/cdn/components/manifest.json +58 -54
  49. package/dist/cdn/components/markdown-editor.js +25 -25
  50. package/dist/cdn/components/markdown-viewer.js +27 -27
  51. package/dist/cdn/components/nav-bar.js +1 -1
  52. package/dist/cdn/components/note-wc.js +2 -2
  53. package/dist/cdn/components/notification-wc.js +23 -23
  54. package/dist/cdn/components/page-info.js +6 -6
  55. package/dist/cdn/components/page-stats.js +1 -1
  56. package/dist/cdn/components/page-toc.js +1 -1
  57. package/dist/cdn/components/page-tools.js +1 -1
  58. package/dist/cdn/components/page-tour.js +1 -1
  59. package/dist/cdn/components/pager-wc.js +1 -1
  60. package/dist/cdn/components/poll-wc.js +1 -1
  61. package/dist/cdn/components/pop-over.js +1 -1
  62. package/dist/cdn/components/popularity-index.js +1 -1
  63. package/dist/cdn/components/print-page.js +1 -1
  64. package/dist/cdn/components/progress-tracker.js +1 -1
  65. package/dist/cdn/components/qr-code.js +1 -1
  66. package/dist/cdn/components/reaction-bar.js +1 -1
  67. package/dist/cdn/components/reading-progress.js +1 -1
  68. package/dist/cdn/components/recently-visited.js +1 -1
  69. package/dist/cdn/components/score-card.js +2 -2
  70. package/dist/cdn/components/selection-menu.js +1 -1
  71. package/dist/cdn/components/settings-panel.js +6 -6
  72. package/dist/cdn/components/share-wc.js +2 -2
  73. package/dist/cdn/components/short-cuts.js +1 -1
  74. package/dist/cdn/components/site-index.js +1 -1
  75. package/dist/cdn/components/site-map.js +1 -1
  76. package/dist/cdn/components/site-search.js +1 -1
  77. package/dist/cdn/components/slide-accept.js +1 -1
  78. package/dist/cdn/components/social-embed.js +1 -1
  79. package/dist/cdn/components/social-links.js +2 -0
  80. package/dist/cdn/components/split-surface.js +1 -1
  81. package/dist/cdn/components/star-rating.js +1 -1
  82. package/dist/cdn/components/status-wc.js +1 -1
  83. package/dist/cdn/components/stepper-wc.js +1 -1
  84. package/dist/cdn/components/tab-set.js +1 -1
  85. package/dist/cdn/components/text-reader.js +2 -2
  86. package/dist/cdn/components/theme-picker.js +20 -20
  87. package/dist/cdn/components/time-index.js +1 -1
  88. package/dist/cdn/components/time-picker.js +1 -1
  89. package/dist/cdn/components/toast-msg.js +2 -2
  90. package/dist/cdn/components/tool-tip.js +1 -1
  91. package/dist/cdn/components/topic-map.js +4 -4
  92. package/dist/cdn/components/trust-filter.js +1 -1
  93. package/dist/cdn/components/version-switcher.js +6 -6
  94. package/dist/cdn/components/video-player.js +4 -4
  95. package/dist/cdn/components/watch-wc.js +2 -2
  96. package/dist/cdn/components/week-view.js +1 -1
  97. package/dist/cdn/components/youtube-player.js +1 -1
  98. package/dist/cdn/fonts/barlow-condensed-latin-400-italic.woff2 +0 -0
  99. package/dist/cdn/fonts/barlow-condensed-latin-700-italic.woff2 +0 -0
  100. package/dist/cdn/fonts/barlow-condensed-latin-ext-400-italic.woff2 +0 -0
  101. package/dist/cdn/fonts/barlow-condensed-latin-ext-700-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
  103. package/dist/cdn/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/dm-serif-display-latin-400-italic.woff2 +0 -0
  105. package/dist/cdn/fonts/dm-serif-display-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/exo-2-latin-ext-wght-italic.woff2 +0 -0
  107. package/dist/cdn/fonts/exo-2-latin-wght-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  109. package/dist/cdn/fonts/inter-latin-wght-italic.woff2 +0 -0
  110. package/dist/cdn/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
  111. package/dist/cdn/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  112. package/dist/cdn/fonts/josefin-sans-latin-ext-wght-italic.woff2 +0 -0
  113. package/dist/cdn/fonts/josefin-sans-latin-wght-italic.woff2 +0 -0
  114. package/dist/cdn/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
  115. package/dist/cdn/fonts/lora-latin-wght-italic.woff2 +0 -0
  116. package/dist/cdn/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
  117. package/dist/cdn/fonts/merriweather-latin-wght-italic.woff2 +0 -0
  118. package/dist/cdn/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
  119. package/dist/cdn/fonts/nunito-latin-wght-italic.woff2 +0 -0
  120. package/dist/cdn/packs/effects.full.js +1 -1
  121. package/dist/cdn/packs/kawaii/fonts/nunito-latin-ext-wght-italic.woff2 +0 -0
  122. package/dist/cdn/packs/kawaii/fonts/nunito-latin-wght-italic.woff2 +0 -0
  123. package/dist/cdn/packs/kawaii.full.css +1 -1
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +4 -4
  126. package/dist/cdn/packs/prototype.full.js +1 -1
  127. package/dist/cdn/packs/ui.full.js +19 -19
  128. package/dist/cdn/themes/8bit.tokens.json +8 -37
  129. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  130. package/dist/cdn/themes/alpha1999.css +1 -1
  131. package/dist/cdn/themes/alpha1999.tokens.json +3 -6
  132. package/dist/cdn/themes/art-deco-dark.tokens.json +3 -27
  133. package/dist/cdn/themes/art-deco.css +1 -1
  134. package/dist/cdn/themes/art-deco.tokens.json +5 -11
  135. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  136. package/dist/cdn/themes/bauhaus.css +1 -1
  137. package/dist/cdn/themes/bauhaus.tokens.json +13 -7
  138. package/dist/cdn/themes/brutalist-dark.tokens.json +3 -27
  139. package/dist/cdn/themes/brutalist.tokens.json +5 -11
  140. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  141. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  142. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  143. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  144. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  145. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  146. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  148. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  149. package/dist/cdn/themes/classic-dark.tokens.json +41 -41
  150. package/dist/cdn/themes/classic.tokens.json +25 -31
  151. package/dist/cdn/themes/claymorphism-dark.tokens.json +533 -161
  152. package/dist/cdn/themes/claymorphism.css +1 -1
  153. package/dist/cdn/themes/claymorphism.tokens.json +531 -135
  154. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  155. package/dist/cdn/themes/clinical.tokens.json +1 -1
  156. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  157. package/dist/cdn/themes/cottagecore.css +1 -1
  158. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  159. package/dist/cdn/themes/cyber.css +1 -1
  160. package/dist/cdn/themes/cyber.tokens.json +5 -11
  161. package/dist/cdn/themes/dawn-dark.tokens.json +3 -27
  162. package/dist/cdn/themes/dawn.css +1 -1
  163. package/dist/cdn/themes/dawn.tokens.json +1 -1
  164. package/dist/cdn/themes/dracula.tokens.json +1 -1
  165. package/dist/cdn/themes/dusk.tokens.json +1 -1
  166. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  167. package/dist/cdn/themes/editorial.tokens.json +19 -16
  168. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  169. package/dist/cdn/themes/financial.css +1 -1
  170. package/dist/cdn/themes/financial.tokens.json +1 -1
  171. package/dist/cdn/themes/genai.css +1 -1
  172. package/dist/cdn/themes/genai.tokens.json +1 -1
  173. package/dist/cdn/themes/glassmorphism-dark.tokens.json +233 -116
  174. package/dist/cdn/themes/glassmorphism.css +1 -1
  175. package/dist/cdn/themes/glassmorphism.tokens.json +233 -116
  176. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  177. package/dist/cdn/themes/government.tokens.json +1 -1
  178. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  179. package/dist/cdn/themes/gruvbox.css +1 -1
  180. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  181. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  182. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  183. package/dist/cdn/themes/journal-dark.tokens.json +3 -27
  184. package/dist/cdn/themes/journal.css +1 -1
  185. package/dist/cdn/themes/journal.tokens.json +21 -21
  186. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  187. package/dist/cdn/themes/kawaii.css +1 -1
  188. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  189. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  190. package/dist/cdn/themes/magna.css +1 -1
  191. package/dist/cdn/themes/magna.tokens.json +2 -14
  192. package/dist/cdn/themes/manifest.json +25 -25
  193. package/dist/cdn/themes/midnight.tokens.json +1 -1
  194. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  195. package/dist/cdn/themes/minimal.tokens.json +25 -27
  196. package/dist/cdn/themes/modern-dark.tokens.json +41 -41
  197. package/dist/cdn/themes/modern.css +1 -1
  198. package/dist/cdn/themes/modern.tokens.json +21 -21
  199. package/dist/cdn/themes/nes-dark.tokens.json +3 -27
  200. package/dist/cdn/themes/nes.tokens.json +10 -39
  201. package/dist/cdn/themes/neumorphism-dark.tokens.json +266 -134
  202. package/dist/cdn/themes/neumorphism.css +1 -1
  203. package/dist/cdn/themes/neumorphism.tokens.json +266 -134
  204. package/dist/cdn/themes/nord-dark.tokens.json +3 -27
  205. package/dist/cdn/themes/nord.css +1 -1
  206. package/dist/cdn/themes/nord.tokens.json +1 -1
  207. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  208. package/dist/cdn/themes/organic.tokens.json +5 -14
  209. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/rose-pine.css +1 -1
  211. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  212. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  213. package/dist/cdn/themes/rough.tokens.json +1 -1
  214. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  215. package/dist/cdn/themes/solarized.tokens.json +1 -1
  216. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  217. package/dist/cdn/themes/startup.css +1 -1
  218. package/dist/cdn/themes/startup.tokens.json +1 -1
  219. package/dist/cdn/themes/super2026-dark.tokens.json +6 -30
  220. package/dist/cdn/themes/super2026.css +1 -1
  221. package/dist/cdn/themes/super2026.tokens.json +1 -1
  222. package/dist/cdn/themes/swiss-dark.tokens.json +4 -40
  223. package/dist/cdn/themes/swiss.tokens.json +34 -68
  224. package/dist/cdn/themes/terminal.tokens.json +286 -120
  225. package/dist/cdn/themes/tokyo-night-dark.tokens.json +3 -27
  226. package/dist/cdn/themes/tokyo-night.css +1 -1
  227. package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
  228. package/dist/cdn/themes/vaporwave-dark.tokens.json +3 -27
  229. package/dist/cdn/themes/vaporwave.tokens.json +1 -1
  230. package/dist/cdn/themes/win9x-dark.tokens.json +5 -29
  231. package/dist/cdn/themes/win9x.tokens.json +9 -9
  232. package/dist/cdn/vanilla-breeze-autoload.js +113 -108
  233. package/dist/cdn/vanilla-breeze-charts.js +13 -13
  234. package/dist/cdn/vanilla-breeze-core.css +1 -1
  235. package/dist/cdn/vanilla-breeze-core.js +80 -75
  236. package/dist/cdn/vanilla-breeze-extras.js +31 -31
  237. package/dist/cdn/vanilla-breeze.css +1 -1
  238. package/dist/cdn/vanilla-breeze.js +133 -133
  239. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- var tt=window.matchMedia("(prefers-reduced-motion: reduce)");var O=new Map;function R(r,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=O.get(r);if(customElements.get(r)){if(!i||i.priority>=n){i&&i.priority===n&&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>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}O.set(r,s),customElements.define(r,t)}var p=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,n,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}_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 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)}#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 f="vb:recently-visited",b="vb:recently-visited:paused",y="vb:recently-visited:show-anchors",N="recently-visited:change";function C(r){let t=document.querySelector(`meta[name="${r}"]`);return t?t.getAttribute("content")??"":null}function G(){return typeof document>"u"||document.documentElement.hasAttribute("data-vb-no-track")||C("vb:no-track-history")!==null?!1:(C("vb:track-history")??"").trim().toLowerCase()==="on"?!0:document.querySelector("recently-visited")!==null}function g(){try{return localStorage.getItem(b)==="1"}catch{return!1}}function T(){try{return localStorage.getItem(y)==="1"}catch{return!1}}function W(){let r=C("vb:track-history-params")||"";return new Set(r.split(/[\s,]+/).filter(Boolean))}function H(r,t=null){if(typeof r!="string")return null;let e=r.trim().replace(/^[\\/]{2,}/,"/");if(!e)return null;let n;try{n=new URL(e,location.origin)}catch{return null}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.origin!==location.origin)return null;let s=n.pathname.replace(/^\/{2,}/,"/"),i=n.search;if(t){let a=new URLSearchParams;for(let[l,o]of n.searchParams)t.has(l)&&a.append(l,o);let c=a.toString();i=c?`?${c}`:""}return s+i}function M(){return H(location.pathname+location.search,W())}function P(r,t=Date.now()){if(!Array.isArray(r))return[];let e=[];for(let n of r){if(!n||typeof n!="object")continue;let s=Number(n.ts);if(!Number.isFinite(s)||Math.abs(t-s)>2592e6)continue;let i=H(n.url);if(!i)continue;let a=typeof n.hash=="string"&&n.hash.startsWith("#")&&n.hash.length>1?n.hash:"";e.push({url:i,hash:a,title:typeof n.title=="string"?n.title:"",hashTitle:a&&typeof n.hashTitle=="string"?n.hashTitle:"",ts:s})}return e}function E(){try{let r=localStorage.getItem(f);return r?P(JSON.parse(r)):[]}catch{return[]}}function U(r){window.dispatchEvent(new CustomEvent(N,{detail:{key:r}}))}function k(r){try{localStorage.setItem(f,JSON.stringify(P(r).slice(0,100)))}catch{}U(f)}function B(r,t){try{t?localStorage.setItem(r,"1"):localStorage.removeItem(r)}catch{}U(r)}function D(r){B(b,r)}function V(r){B(y,r)}function J(r){if(!r)return"";let t=r.slice(1);try{t=decodeURIComponent(t)}catch{}if(!t)return"";let e=document.getElementById(t);return e&&(e.textContent||"").trim().slice(0,80)||t}function h(){if(!G()||g()||location.protocol!=="http:"&&location.protocol!=="https:")return!1;let r=M();if(!r)return!1;let t=location.hash.length>1?location.hash:"",e=(document.title||"").trim();if(!e)return!1;let n=E(),s=r+t,i=n[0];if(i&&i.url+i.hash===s)return!1;let a=n.filter(c=>c.url+c.hash!==s);return a.unshift({url:r,hash:t,title:e,hashTitle:J(t),ts:Date.now()}),k(a),!0}var S=typeof document<"u"?document.documentElement:null;S&&!S.hasAttribute("data-vb-recently-visited-init")&&(S.setAttribute("data-vb-recently-visited-init",""),h(),window.addEventListener("pageshow",r=>{r.persisted&&h()}),window.addEventListener("hashchange",h));var X=25,z=6e4,K={heading:"Recently visited",explainer:"Stored on this device only. Never sent to a server.",pause:"Pause tracking",anchors:"Show anchor visits",clear:"Clear history",empty:"No recently visited pages yet.","anchor-one":"anchor","anchor-other":"anchors"},Q=new Set([f,b,y]),$=class extends p{static observedAttributes=["limit","include-current","data-heading-level",...Object.keys(K).map(t=>`data-label-${t}`)];#t=null;#e;setup(){h(),this.#n(),this.#s(),this.listen(this,"click",t=>this.#u(t)),this.listen(window,"storage",t=>{let{key:e}=t;(e===null||Q.has(e))&&this.#s()}),this.listen(window,N,()=>this.#s()),this.#e=setInterval(()=>this.#l(),z)}teardown(){clearInterval(this.#e),this.#e=void 0,this.#t=null}attributeChangedCallback(t,e,n){e===n||!this.hasAttribute("data-upgraded")||(this.#n(),this.#s())}get entries(){return E()}#n(){let t=document.createElement("header");t.className="recently-visited-header";let e=this.#a();e&&t.append(e);let n=document.createElement("menu");n.className="recently-visited-actions",n.append(this.#i("pause","pause"),this.#i("anchors","hash"),this.#i("clear","trash-2")),t.append(n);let s=document.createElement("p");s.className="recently-visited-explainer";let i=document.createElement("small");i.textContent=this.#r("explainer"),s.append(i),this.#t=document.createElement("section"),this.#t.className="recently-visited-body",this.replaceChildren(t,s,this.#t)}#a(){let t=this.getAttribute("data-heading-level"),e=t==null||t===""?2:Number.parseInt(t,10);if(e===0)return null;let n=Number.isFinite(e)?Math.min(6,Math.max(1,e)):2,s=document.createElement(`h${n}`);return s.className="recently-visited-heading",s.textContent=this.#r("heading"),s}#i(t,e){let n=document.createElement("li"),s=document.createElement("button");s.type="button",s.className="icon-button",s.setAttribute(`data-recently-visited-${t}`,"");let i=this.#r(t);s.setAttribute("aria-label",i),s.title=i;let a=document.createElement("icon-wc");return a.setAttribute("name",e),a.setAttribute("size","sm"),s.append(a),n.append(s),n}#s(){if(!this.#t)return;let t=E(),e=g(),n=T();this.querySelector("[data-recently-visited-pause]")?.setAttribute("aria-pressed",String(e)),this.querySelector("[data-recently-visited-anchors]")?.setAttribute("aria-pressed",String(n)),this.querySelector("[data-recently-visited-clear]")?.setAttribute("aria-disabled",String(t.length===0));let s=document.activeElement,i=s instanceof HTMLAnchorElement&&this.#t.contains(s)?s.getAttribute("href"):null,a=new Set([...this.#t.querySelectorAll("details[open]")].map(o=>o.getAttribute("data-url"))),c=this.hasAttribute("include-current")?null:M(),l=Z(t).filter(o=>o.url!==c).slice(0,this.#d());if(l.length===0){let o=document.createElement("p");o.className="recently-visited-empty",o.textContent=this.#r("empty"),this.#t.replaceChildren(o)}else this.#t.replaceChildren(this.#c(l,n,a));i!==null&&[...this.#t.querySelectorAll("a")].find(d=>d.getAttribute("href")===i)?.focus()}#c(t,e,n){let s=this.#o(),i=new Intl.RelativeTimeFormat(s,{numeric:"auto"}),a=new Intl.PluralRules(s),c=new Intl.NumberFormat(s),l=document.createElement("ol");l.className="recently-visited-list";for(let o of t){let d=document.createElement("li"),m=document.createElement("a");if(m.href=o.url,m.textContent=o.title||o.url,e&&o.anchors.length>0){d.className="has-anchors";let u=document.createElement("details");u.setAttribute("data-url",o.url),n.has(o.url)&&(u.open=!0);let x=document.createElement("summary"),I=document.createElement("small"),L=o.anchors.length,j=this.#r(a.select(L)==="one"?"anchor-one":"anchor-other");I.append(`${c.format(L)} ${j} \xB7 `,_(o.ts,i)),x.append(m,I);let v=document.createElement("ul");v.className="recently-visited-anchors";for(let w of o.anchors){let q=document.createElement("li"),A=document.createElement("a");A.href=o.url+w.hash,A.textContent=w.hashTitle;let F=document.createElement("small");F.append(_(w.ts,i)),q.append(A,F),v.append(q)}u.append(x,v),d.append(u)}else{let u=document.createElement("small");u.append(_(o.ts,i)),d.append(m,u)}l.append(d)}return l}#l(){let t=new Intl.RelativeTimeFormat(this.#o(),{numeric:"auto"});for(let e of this.querySelectorAll("time[datetime]"))e.textContent=Y(Date.parse(e.getAttribute("datetime")||""),t)}#u(t){let n=t.target.closest?.("button");if(!(!n||!this.contains(n))){if(n.hasAttribute("data-recently-visited-clear")){if(n.getAttribute("aria-disabled")==="true")return;k([]),this.dispatchEvent(new CustomEvent("recently-visited:clear",{bubbles:!0}))}else if(n.hasAttribute("data-recently-visited-pause")){let s=!g();D(s),this.dispatchEvent(new CustomEvent("recently-visited:pause-toggle",{bubbles:!0,detail:{paused:s}}))}else if(n.hasAttribute("data-recently-visited-anchors")){let s=!T();V(s),this.dispatchEvent(new CustomEvent("recently-visited:anchors-toggle",{bubbles:!0,detail:{showAnchors:s}}))}}}#d(){let t=Number.parseInt(this.getAttribute("limit")??"",10);return Number.isFinite(t)&&t>0?t:X}#r(t){return this.getAttribute(`data-label-${t}`)||K[t]}#o(){let t=this.closest("[lang]")?.getAttribute("lang")||void 0;try{return Intl.getCanonicalLocales(t)[0]}catch{return}}};function Z(r){let t=new Map;for(let e of r){let n=t.get(e.url);n||(n={url:e.url,title:e.title,ts:e.ts,anchors:[]},t.set(e.url,n)),e.ts>n.ts?(n.ts=e.ts,e.title&&(n.title=e.title)):!n.title&&e.title&&(n.title=e.title),e.hash&&n.anchors.push({hash:e.hash,hashTitle:e.hashTitle||e.hash.slice(1),ts:e.ts})}for(let e of t.values())e.anchors.sort((n,s)=>s.ts-n.ts);return[...t.values()].sort((e,n)=>n.ts-e.ts)}function _(r,t){let e=document.createElement("time");return e.dateTime=new Date(r).toISOString(),e.textContent=Y(r,t),e}function Y(r,t){if(!Number.isFinite(r))return"";let e=Math.max(0,(Date.now()-r)/1e3);return e<60?t.format(0,"second"):e<3600?t.format(-Math.floor(e/60),"minute"):e<86400?t.format(-Math.floor(e/3600),"hour"):t.format(-Math.floor(e/86400),"day")}R("recently-visited",$);export{$ as RecentlyVisited};
1
+ var it=window.matchMedia("(prefers-reduced-motion: reduce)");var O=new Map;function R(r,t,e={}){let n=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:n},i=O.get(r);if(customElements.get(r)){if(!i||i.priority>=n){i&&i.priority===n&&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>=n){i.priority===n&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${i.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}O.set(r,s),customElements.define(r,t)}var b=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,n,s){t.addEventListener(e,n,s),this.#t.push(()=>t.removeEventListener(e,n,s))}_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 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)}#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 m="vb:recently-visited",y="vb:recently-visited:paused",E="vb:recently-visited:show-anchors",M="recently-visited:change";function $(r){let t=document.querySelector(`meta[name="${r}"]`);return t?t.getAttribute("content")??"":null}function z(){return typeof document>"u"||document.documentElement.hasAttribute("data-vb-no-track")||$("vb:no-track-history")!==null?!1:($("vb:track-history")??"").trim().toLowerCase()==="on"?!0:document.querySelector("recently-visited")!==null}function v(){try{return localStorage.getItem(y)==="1"}catch{return!1}}function x(){try{return localStorage.getItem(E)==="1"}catch{return!1}}function J(){let r=$("vb:track-history-params")||"";return new Set(r.split(/[\s,]+/).filter(Boolean))}function U(r,t=null){if(typeof r!="string")return null;let e=r.trim().replace(/^[\\/]{2,}/,"/");if(!e)return null;let n;try{n=new URL(e,location.origin)}catch{return null}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.origin!==location.origin)return null;let s=n.pathname.replace(/^\/{2,}/,"/"),i=n.search;if(t){let a=new URLSearchParams;for(let[l,o]of n.searchParams)t.has(l)&&a.append(l,o);let c=a.toString();i=c?`?${c}`:""}return s+i}function k(){return U(location.pathname+location.search,J())}function V(r,t=Date.now()){if(!Array.isArray(r))return[];let e=[];for(let n of r){if(!n||typeof n!="object")continue;let s=Number(n.ts);if(!Number.isFinite(s)||Math.abs(t-s)>2592e6)continue;let i=U(n.url);if(!i)continue;let a=typeof n.hash=="string"&&n.hash.startsWith("#")&&n.hash.length>1?n.hash:"";e.push({url:i,hash:a,title:typeof n.title=="string"?n.title:"",hashTitle:a&&typeof n.hashTitle=="string"?n.hashTitle:"",ts:s})}return e}function g(){try{let r=localStorage.getItem(m);return r?V(JSON.parse(r)):[]}catch{return[]}}function j(r){window.dispatchEvent(new CustomEvent(M,{detail:{key:r}}))}function _(r){try{localStorage.setItem(m,JSON.stringify(V(r).slice(0,100)))}catch{}j(m)}function D(r,t){try{t?localStorage.setItem(r,"1"):localStorage.removeItem(r)}catch{}j(r)}function K(r){D(y,r)}function Y(r){D(E,r)}function X(r){if(!r)return"";let t=r.slice(1);try{t=decodeURIComponent(t)}catch{}if(!t)return"";let e=document.getElementById(t);return e&&(e.textContent||"").trim().slice(0,80)||t}function f(){if(!z()||v()||location.protocol!=="http:"&&location.protocol!=="https:")return!1;let r=k();if(!r)return!1;let t=location.hash.length>1?location.hash:"",e=(document.title||"").trim();if(!e)return!1;let n=g(),s=r+t,i=n[0];if(i&&i.url+i.hash===s)return!1;let a=n.filter(c=>c.url+c.hash!==s);return a.unshift({url:r,hash:t,title:e,hashTitle:X(t),ts:Date.now()}),_(a),!0}var T=typeof document<"u"?document.documentElement:null;T&&!T.hasAttribute("data-vb-recently-visited-init")&&(T.setAttribute("data-vb-recently-visited-init",""),f(),window.addEventListener("pageshow",r=>{r.persisted&&f()}),window.addEventListener("hashchange",f));var Q=25,Z=6e4,G={heading:"Recently visited",explainer:"Stored on this device only. Never sent to a server.",pause:"Pause tracking",anchors:"Show anchor visits",clear:"Clear history",empty:"No recently visited pages yet.","anchor-one":"anchor","anchor-other":"anchors"},tt=new Set([m,y,E]),P=class extends b{static observedAttributes=["limit","include-current","data-heading-level",...Object.keys(G).map(t=>`data-label-${t}`)];#t=null;#e;setup(){f(),this.#n(),this.#s(),this.listen(this,"click",t=>this.#u(t)),this.listen(window,"storage",t=>{let{key:e}=t;(e===null||tt.has(e))&&this.#s()}),this.listen(window,M,()=>this.#s()),this.#e=setInterval(()=>this.#l(),Z)}teardown(){clearInterval(this.#e),this.#e=void 0,this.#t=null}attributeChangedCallback(t,e,n){e===n||!this.hasAttribute("data-upgraded")||(this.#n(),this.#s())}get entries(){return g()}#n(){let t=document.createElement("header");t.className="recently-visited-header";let e=this.#a();e&&t.append(e);let n=document.createElement("menu");n.className="recently-visited-actions",n.append(this.#i("pause","pause"),this.#i("anchors","hash"),this.#i("clear","trash-2")),t.append(n);let s=document.createElement("p");s.className="recently-visited-explainer";let i=document.createElement("small");i.textContent=this.#r("explainer"),s.append(i),this.#t=document.createElement("section"),this.#t.className="recently-visited-body",this.replaceChildren(t,s,this.#t)}#a(){let t=this.getAttribute("data-heading-level"),e=t==null||t===""?2:Number.parseInt(t,10);if(e===0)return null;let n=Number.isFinite(e)?Math.min(6,Math.max(1,e)):2,s=document.createElement(`h${n}`);return s.className="recently-visited-heading",s.textContent=this.#r("heading"),s}#i(t,e){let n=document.createElement("li"),s=document.createElement("button");s.type="button",s.className="icon-button",s.setAttribute(`data-recently-visited-${t}`,"");let i=this.#r(t);s.setAttribute("aria-label",i),s.title=i;let a=document.createElement("icon-wc");return a.setAttribute("name",e),a.setAttribute("size","sm"),s.append(a),n.append(s),n}#s(){if(!this.#t)return;let t=g(),e=v(),n=x();this.querySelector("[data-recently-visited-pause]")?.setAttribute("aria-pressed",String(e)),this.querySelector("[data-recently-visited-anchors]")?.setAttribute("aria-pressed",String(n)),this.querySelector("[data-recently-visited-clear]")?.setAttribute("aria-disabled",String(t.length===0));let s=document.activeElement,i=s instanceof HTMLAnchorElement&&this.#t.contains(s)?s.getAttribute("href"):null,a=new Set([...this.#t.querySelectorAll("details[open]")].map(o=>o.getAttribute("data-url"))),c=this.hasAttribute("include-current")?null:k(),l=et(t).filter(o=>o.url!==c).slice(0,this.#d());if(l.length===0){let o=document.createElement("p");o.className="recently-visited-empty",o.textContent=this.#r("empty"),this.#t.replaceChildren(o)}else this.#t.replaceChildren(this.#c(l,n,a));i!==null&&[...this.#t.querySelectorAll("a")].find(d=>d.getAttribute("href")===i)?.focus()}#c(t,e,n){let s=this.#o(),i=new Intl.RelativeTimeFormat(s,{numeric:"auto"}),a=new Intl.PluralRules(s),c=new Intl.NumberFormat(s),l=document.createElement("ol");l.className="recently-visited-list";for(let o of t){let d=document.createElement("li"),h=document.createElement("a");if(h.href=o.url,h.textContent=o.title||o.url,e&&o.anchors.length>0){d.className="has-anchors";let u=document.createElement("details");u.setAttribute("data-url",o.url),n.has(o.url)&&(u.open=!0);let I=document.createElement("summary"),H=document.createElement("small"),F=o.anchors.length,W=this.#r(a.select(F)==="one"?"anchor-one":"anchor-other");H.append(`${c.format(F)} ${W} \xB7 `,L(o.ts,i));let w=document.createElement("span");w.className="recently-visited-title",w.textContent=h.textContent,I.append(w,H);let p=document.createElement("ul");p.className="recently-visited-anchors";let A=document.createElement("li");A.className="recently-visited-page",A.append(h),p.append(A);for(let S of o.anchors){let q=document.createElement("li"),C=document.createElement("a");C.href=o.url+S.hash,C.textContent=S.hashTitle;let B=document.createElement("small");B.append(L(S.ts,i)),q.append(C,B),p.append(q)}u.append(I,p),d.append(u)}else{let u=document.createElement("small");u.append(L(o.ts,i)),d.append(h,u)}l.append(d)}return l}#l(){let t=new Intl.RelativeTimeFormat(this.#o(),{numeric:"auto"});for(let e of this.querySelectorAll("time[datetime]"))e.textContent=N(Date.parse(e.getAttribute("datetime")||""),t)}#u(t){let n=t.target.closest?.("button");if(!(!n||!this.contains(n))){if(n.hasAttribute("data-recently-visited-clear")){if(n.getAttribute("aria-disabled")==="true")return;_([]),this.dispatchEvent(new CustomEvent("recently-visited:clear",{bubbles:!0}))}else if(n.hasAttribute("data-recently-visited-pause")){let s=!v();K(s),this.dispatchEvent(new CustomEvent("recently-visited:pause-toggle",{bubbles:!0,detail:{paused:s}}))}else if(n.hasAttribute("data-recently-visited-anchors")){let s=!x();Y(s),this.dispatchEvent(new CustomEvent("recently-visited:anchors-toggle",{bubbles:!0,detail:{showAnchors:s}}))}}}#d(){let t=Number.parseInt(this.getAttribute("limit")??"",10);return Number.isFinite(t)&&t>0?t:Q}#r(t){return this.getAttribute(`data-label-${t}`)||G[t]}#o(){let t=this.closest("[lang]")?.getAttribute("lang")||void 0;try{return Intl.getCanonicalLocales(t)[0]}catch{return}}};function et(r){let t=new Map;for(let e of r){let n=t.get(e.url);n||(n={url:e.url,title:e.title,ts:e.ts,anchors:[]},t.set(e.url,n)),e.ts>n.ts?(n.ts=e.ts,e.title&&(n.title=e.title)):!n.title&&e.title&&(n.title=e.title),e.hash&&n.anchors.push({hash:e.hash,hashTitle:e.hashTitle||e.hash.slice(1),ts:e.ts})}for(let e of t.values())e.anchors.sort((n,s)=>s.ts-n.ts);return[...t.values()].sort((e,n)=>n.ts-e.ts)}function L(r,t){let e=document.createElement("time");return e.dateTime=new Date(r).toISOString(),e.textContent=N(r,t),e}function N(r,t){if(!Number.isFinite(r))return"";let e=Math.max(0,(Date.now()-r)/1e3);return e<60?t.format(0,"second"):e<3600?t.format(-Math.floor(e/60),"minute"):e<86400?t.format(-Math.floor(e/3600),"hour"):t.format(-Math.floor(e/86400),"day")}R("recently-visited",P);export{P as RecentlyVisited};
2
2
  //# sourceMappingURL=recently-visited.js.map
@@ -199,7 +199,7 @@ var c=`
199
199
  background: color-mix(in oklch, var(--_muted) 18%, transparent);
200
200
  }
201
201
  }
202
- `;var i=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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,o){e.addEventListener(t,r,o),this.#t.push(()=>e.removeEventListener(t,r,o))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let o=`--${e}`;t?r.add(o):r.delete(o)}}_adoptInternals(e){this.#e||(this.#e=e)}#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}};var g=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function d(s,e,t={}){let r=t.priority??10,o={impl:e,bundle:t.bundle,contract:t.contract,priority:r},a=l.get(s);if(customElements.get(s)){if(!a||a.priority>=r){a&&a.priority===r&&a.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}" (priority ${a.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${a.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(a&&a.priority>=r){a.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${a.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}l.set(s,o),customElements.define(s,e)}var h=new Set(["up","down","flat"]),u=["change","sparkline","description","icon"],p=`
202
+ `;var n=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 e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,a){e.addEventListener(t,r,a),this.#t.push(()=>e.removeEventListener(t,r,a))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let r=this.#e.states;try{t?r.add(e):r.delete(e)}catch{let a=`--${e}`;t?r.add(a):r.delete(a)}}_adoptInternals(e){this.#e||(this.#e=e)}#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}};var y=window.matchMedia("(prefers-reduced-motion: reduce)");var d=new Map;function l(s,e,t={}){let r=t.priority??10,a={impl:e,bundle:t.bundle,contract:t.contract,priority:r},o=d.get(s);if(customElements.get(s)){if(!o||o.priority>=r){o&&o.priority===r&&o.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${o.bundle}" (priority ${o.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${o.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(o&&o.priority>=r){o.priority===r&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${o.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}d.set(s,a),customElements.define(s,e)}var h=new Set(["up","down","flat"]),u=["change","sparkline","description","icon"],f=`
203
203
  <style>${c}</style>
204
204
  <div class="card" part="card">
205
205
  <span class="title" part="title"><slot name="title"></slot></span>
@@ -209,5 +209,5 @@ var c=`
209
209
  <span class="description" part="description"><slot name="description" data-slot="description"></slot></span>
210
210
  <span class="icon" part="icon"><slot name="icon" data-slot="icon"></slot></span>
211
211
  </div>
212
- `,n=class extends i{static get observedAttributes(){return["trend","loading"]}setup(){if(this.shadowRoot)for(let e of u){let t=this.shadowRoot.querySelector(`slot[name="${e}"]`);this.#t(e,t)}else{let e=this.attachShadow({mode:"open"});e.innerHTML=p;for(let t of u){let r=e.querySelector(`slot[name="${t}"]`);r?.addEventListener("slotchange",()=>this.#t(t,r)),this.#t(t,r)}}this.#e(),this.#r(),this.#a()}attributeChangedCallback(e){this.isConnected&&(e==="trend"?this.#e():e==="loading"&&this.#r())}#t(e,t){let r=!!t&&t.assignedNodes({flatten:!0}).some(o=>o.nodeType===Node.ELEMENT_NODE||o.nodeType===Node.TEXT_NODE&&o.textContent.trim().length>0);this.setState(`has-${e}`,r)}#e(){let e=(this.getAttribute("trend")||"").toLowerCase();for(let t of h)this.setState(`trend-${t}`,t===e)}#r(){let e=this.hasAttribute("loading");this.setState("loading",e),e?this.setAttribute("aria-busy","true"):this.getAttribute("aria-busy")==="true"&&this.removeAttribute("aria-busy")}#a(){let e=this.closest("a[href]");this.setState("interactive",!!e)}};d("score-card",n);export{n as ScoreCard};
212
+ `,i=class extends n{static get observedAttributes(){return["trend","loading"]}setup(){if(this.shadowRoot)for(let e of u){let t=this.shadowRoot.querySelector(`slot[name="${e}"]`);this.#t(e,t)}else{let e=this.attachShadow({mode:"open"});e.innerHTML=f;for(let t of u){let r=e.querySelector(`slot[name="${t}"]`);r?.addEventListener("slotchange",()=>this.#t(t,r)),this.#t(t,r)}}this.#e(),this.#r(),this.#o()}attributeChangedCallback(e){this.isConnected&&(e==="trend"?this.#e():e==="loading"&&this.#r())}#t(e,t){let r=!!t&&t.assignedNodes({flatten:!0}).some(a=>a.nodeType===Node.ELEMENT_NODE||a.nodeType===Node.TEXT_NODE&&a.textContent.trim().length>0);this.setState(`has-${e}`,r)}#e(){let e=(this.getAttribute("trend")||"").toLowerCase();for(let t of h)this.setState(`trend-${t}`,t===e)}#r(){let e=this.hasAttribute("loading");this.setState("loading",e),e?this.setAttribute("aria-busy","true"):this.getAttribute("aria-busy")==="true"&&this.removeAttribute("aria-busy")}#o(){let e=this.closest("a[href]");this.setState("interactive",!!e)}};l("score-card",i);export{i as ScoreCard};
213
213
  //# sourceMappingURL=score-card.js.map
@@ -1,2 +1,2 @@
1
- var d=class extends HTMLElement{#e=[];#s;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,n){t.addEventListener(e,i,n),this.#e.push(()=>t.removeEventListener(e,i,n))}_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.#s||(this.#s=this.attachInternals());let i=this.#s.states;try{e?i.add(t):i.delete(t)}catch{let n=`--${t}`;e?i.add(n):i.delete(n)}}_adoptInternals(t){this.#s||(this.#s=t)}#i(){return this.constructor.formAssociated&&this.#s?this.#s: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 K=window.matchMedia("(prefers-reduced-motion: reduce)");var A=new Map;function p(h,t,e={}){let i=e.priority??10,n={impl:t,bundle:e.bundle,contract:e.contract,priority:i},s=A.get(h);if(customElements.get(h)){if(!s||s.priority>=i){s&&s.priority===i&&s.impl!==t&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${h}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${e.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=i){s.priority===i&&console.warn(`[VB Bundle] Tag <${h}> already registered by "${s.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}A.set(h,n),customElements.define(h,t)}var m=CSS.supports("anchor-name","--x"),$=CSS.supports("position-area","bottom"),P=(()=>{let h=document.createElement("span");return h.setAttribute("popover","hint"),h.popover==="hint"})(),L=["auto","manual","hint"];function O(h){let t=L.includes(h||"")?h:"auto";return t==="hint"&&!P?"auto":t}var R=["top","bottom","left","right","inset-inline-start","inset-inline-end"],F=["position","top","left","right","bottom","margin"],S=8,_=0,D=0;function C(h){return!h||h==="none"?[]:h.split(",").map(t=>t.trim()).filter(Boolean)}var y=class extends d{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#e=null;#s=null;#i=`--pop-over-anchor-${++D}`;#t=!1;#r=!1;#a=!1;setup(){if(this.id||(this.id=`pop-over-${++_}`),(!this.hasAttribute("popover")||this.#t)&&this.#n(),this.#h(),this.#c(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!m&&t.newState==="open"&&this.#e&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#o()})}),!m){let t=()=>{this.matches(":popover-open")&&this.#e&&this.#o()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(R.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#a&&(F.forEach(t=>this.style.removeProperty(t)),this.#a=!1),this.#e=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#t=!0);return}if(t==="data-mode"){this.#n();return}this._reinit()}}#n(){let t=O(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#t=!0}show(){this.matches(":popover-open")||(this.showPopover(),!m&&this.#e&&this.matches(":popover-open")&&this.#o())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#h(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#e=e}else this.#e=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#c(){if(!this.#e||!m)return;let t=this.#e,e=t.style.getPropertyValue("anchor-name"),i=C(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#s=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),$||this.#u(this.dataset.position||"bottom")}#l(){if(this.#e&&this.#s){let t=C(this.#e.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#s);t.length?this.#e.style.setProperty("anchor-name",t.join(", ")):this.#e.style.removeProperty("anchor-name")}this.#s=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#u(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},n={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},s=t.split("-")[0],a=n[s]||n.bottom;Object.entries(a).forEach(([r,o])=>this.style.setProperty(r,o)),this.#r=!0}#o(){if(!this.#e)return;let t=this.#e.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#d(),n=document.documentElement.clientWidth,s=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#a=!0;let a=this.offsetWidth,r=this.offsetHeight,o=e.split("-")[0];["top","bottom","left","right"].includes(o)||(o="bottom");let c={top:t.top-i,bottom:s-t.bottom-i,left:t.left-i,right:n-t.right-i},f={top:"bottom",bottom:"top",left:"right",right:"left"},T=o==="top"||o==="bottom"?r:a;c[o]<T&&c[f[o]]>c[o]&&(o=f[o]);let l,u;switch(o){case"top":l=t.top-r-i,u=t.left;break;case"left":l=t.top,u=t.left-a-i;break;case"right":l=t.top,u=t.right+i;break;default:l=t.bottom+i,u=t.left;break}if(o==="top"||o==="bottom"){let g=getComputedStyle(this).direction==="rtl";u=e.endsWith("-end")!==g?t.right-a:t.left}else e.endsWith("-end")&&(l=t.bottom-r);let E=(g,w,M)=>Math.max(S,Math.min(g,M-w-S));u=E(u,a,n),l=E(l,r,s),this.style.top=`${Math.round(l)}px`,this.style.left=`${Math.round(u)}px`}#d(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};p("pop-over",y);var k=8,b=8,N=300,B="Text selection actions",x="F10",q='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',I='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',V=0,v=class extends d{#e=null;#s=new Set;#i=!1;#t;#r=null;#a=null;#n=null;#h=0;#c=!1;#l="mouse";#u="pointer";#o=!1;#d=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#t=t;else{this.#t=document.createElement("pop-over"),this.#t.setAttribute("data-selection-menu-host",""),this.#t.dataset.mode="manual",this.#t.id=`selection-menu-${++V}`;let e=[...this.children];for(let i of e)i!==this.#t&&this.#t.appendChild(i);this.appendChild(this.#t)}this.#t.setAttribute("role","toolbar"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("aria-label",this.dataset.label||B),this.#t.setAttribute("aria-keyshortcuts",`Alt+${x}`),this.hidden=!1,this.#b(),this.listen(document,"pointerup",this.#w),this.listen(document,"pointerdown",this.#k),this.listen(document,"keydown",this.#x),this.listen(document,"keyup",this.#A),this.listen(document,"selectionchange",this.#S),this.listen(window,"scroll",this.#y,{capture:!0,passive:!0}),this.listen(window,"resize",this.#y),this.listen(this.#t,"keydown",this.#T),this.id&&(this.#r=new MutationObserver(()=>this.#b()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#n&&clearTimeout(this.#n),this.#n=null,cancelAnimationFrame(this.#h),this.#a?.getAttribute("data-selection-menu")===this.id&&this.#a.removeAttribute("data-selection-menu"),this.#a=null;for(let t of this.#d)t.removeAttribute("tabindex");this.#d.clear(),this.#i=!1,this.#e=null,this.#c=!1}getSelection(){return this.#e?{...this.#e}:null}dismiss(){this.#i&&this.#f({restoreFocus:!0})}get actions(){return[...(this.#t||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#t||this;for(;i.firstChild;)i.firstChild.remove();this.#d.clear();for(let n of e){if(n instanceof Element){i.appendChild(n);continue}if(!n?.tag)continue;let s=document.createElement(n.tag);if(n.attrs)for(let[a,r]of Object.entries(n.attrs))r==null||r===!1||s.setAttribute(a,r===!0?"":String(r));n.html&&(s.innerHTML=n.html),i.appendChild(s)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#b(){this.#s.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#s.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#a=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#s.add(e)})}#w=t=>{this.#c=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#p()})};#A=t=>{!t.shiftKey&&t.key!=="Shift"||this.#t?.contains(document.activeElement)||(this.#l="keyboard",this.#p())};#S=()=>{this.#c||this.#o||(this.#n&&clearTimeout(this.#n),this.#n=setTimeout(()=>{if(this.#n=null,!this.isConnected||this.#c||this.#o||this.#t?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#u==="keyboard"&&this.#f({restoreFocus:!1});return}this.#u==="keyboard"&&(this.#l="keyboard"),this.#p()},N))};#p(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,n=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,s=null;for(let c of this.#s)if(c.contains(n)){s=c;break}if(!s)return!1;let a=t.toString().trim(),r=this.#e,o=this.#i&&r&&r.target===s&&r.text===a&&r.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&r.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#e={range:e.cloneRange(),text:a,target:s},o||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#e.range,text:a,target:s},bubbles:!0})),this.#C(),!0}#C(){this.#t&&(this.#t.show(),this.#i=!0,this.#v(),cancelAnimationFrame(this.#h),this.#h=requestAnimationFrame(()=>this.#g()))}#g(){if(!this.#i||!this.#e||!this.#t)return;let t=this.#e.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#f({restoreFocus:!0});return}let i=this.#t.getBoundingClientRect(),n=i.width||200,s=i.height||40,a=t.top-s-k,r=t.bottom+k,o;this.#l==="touch"?o=r+s+b<=window.innerHeight?r:a:o=a<b?r:a;let c=t.left+t.width/2-n/2,f=window.innerWidth-n-b;c=Math.max(b,Math.min(c,f)),this.#t.style.top=`${o}px`,this.#t.style.left=`${c}px`}#y=()=>{this.#i&&(cancelAnimationFrame(this.#h),this.#h=requestAnimationFrame(()=>this.#g()))};#f({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#e,n=!!this.#t?.contains(document.activeElement);if(this.#t&&this.#t.hide(),this.#i=!1,this.#e=null,cancelAnimationFrame(this.#h),this.#o=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&n&&i?.target?.isConnected){let s=i.target;if(s.hasAttribute("tabindex")||(s.setAttribute("tabindex","-1"),s.addEventListener("blur",()=>{s.getAttribute("tabindex")==="-1"&&s.removeAttribute("tabindex")},{once:!0})),s.focus({preventScroll:!0}),e){let a=window.getSelection();a&&(a.removeAllRanges(),a.addRange(i.range))}}}#k=t=>{if(this.#c=!0,this.#u="pointer",this.#o=!1,!this.#i)return;let e=t.target;this.#t?.contains(e)||this.contains(e)||this.#f()};#x=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#o=!1),this.#u="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#f({restoreFocus:!0,restoreRange:!0});return}if(t.key===x&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#p()))return;t.preventDefault(),this.#E(0)}}};#m(){return this.#t?[...this.#t.querySelectorAll(q)].filter(t=>{let e=t.closest(I);if(e&&this.#t.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#t.contains(i))}):[]}#v(){let t=this.#m(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#d.add(i)}#E(t){this.#v();let e=this.#m();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let n of e)n.setAttribute("tabindex",n===e[i]?"0":"-1");e[i].focus()}#T=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#m(),n=i.indexOf(e);if(n===-1)return;let s=getComputedStyle(this.#t).direction==="rtl",a=s?"ArrowLeft":"ArrowRight",r=s?"ArrowRight":"ArrowLeft",o=-1;if(t.key===a)o=n+1;else if(t.key===r)o=n-1;else if(t.key==="Home")o=0;else if(t.key==="End")o=i.length-1;else return;t.preventDefault(),this.#E(o)}};p("selection-menu",v);
1
+ var u=class extends HTMLElement{#e=[];#n;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,s){t.addEventListener(e,i,s),this.#e.push(()=>t.removeEventListener(e,i,s))}_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.#n||(this.#n=this.attachInternals());let i=this.#n.states;try{e?i.add(t):i.delete(t)}catch{let s=`--${t}`;e?i.add(s):i.delete(s)}}_adoptInternals(t){this.#n||(this.#n=t)}#i(){return this.constructor.formAssociated&&this.#n?this.#n: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 z=window.matchMedia("(prefers-reduced-motion: reduce)");var A=new Map;function p(c,t,e={}){let i=e.priority??10,s={impl:t,bundle:e.bundle,contract:e.contract,priority:i},n=A.get(c);if(customElements.get(c)){if(!n||n.priority>=i){n&&n.priority===i&&n.impl!==t&&console.warn(`[VB Bundle] Tag <${c}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${e.bundle}".`);return}console.warn(`[VB Bundle] Tag <${c}> 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 <${c}> already registered by "${n.bundle}". Skipping "${e.bundle}" (first wins at equal priority).`);return}A.set(c,s),customElements.define(c,t)}var m=CSS.supports("anchor-name","--x"),P=CSS.supports("position-area","bottom"),M=(()=>{let c=document.createElement("span");return c.setAttribute("popover","hint"),c.popover==="hint"})(),L=["auto","manual","hint"];function _(c){let t=L.includes(c||"")?c:"auto";return t==="hint"&&!M?"auto":t}var B=["top","bottom","left","right","inset-inline-start","inset-inline-end"],F=["position","top","left","right","bottom","margin"],S=8,O=0,R=0;function C(c){return!c||c==="none"?[]:c.split(",").map(t=>t.trim()).filter(Boolean)}var y=class extends u{static get observedAttributes(){return["data-mode","data-anchor","data-position"]}#e=null;#n=null;#i=`--pop-over-anchor-${++R}`;#t=!1;#r=!1;#a=!1;setup(){if(this.id||(this.id=`pop-over-${++O}`),(!this.hasAttribute("popover")||this.#t)&&this.#s(),this.#c(),this.#h(),this.listen(this,"beforetoggle",t=>{let e=t.newState==="open"?"show":"hide";this.dispatchEvent(new CustomEvent(`pop-over:${e}`,{detail:{state:t.newState},bubbles:!0,composed:!0})),!m&&t.newState==="open"&&this.#e&&queueMicrotask(()=>{this.matches(":popover-open")&&this.#o()})}),!m){let t=()=>{this.matches(":popover-open")&&this.#e&&this.#o()};this.listen(window,"resize",t),this.listen(window,"scroll",t,{capture:!0,passive:!0})}}teardown(){this.#l(),this.#r&&(B.forEach(t=>this.style.removeProperty(t)),this.#r=!1),this.#a&&(F.forEach(t=>this.style.removeProperty(t)),this.#a=!1),this.#e=null}attributeChangedCallback(t,e,i){if(e!==i){if(!this.hasAttribute("data-upgraded")){t==="data-mode"&&this.hasAttribute("popover")&&!this.isConnected&&(this.#t=!0);return}if(t==="data-mode"){this.#s();return}this._reinit()}}#s(){let t=_(this.dataset.mode);this.getAttribute("popover")!==t&&this.setAttribute("popover",t),this.#t=!0}show(){this.matches(":popover-open")||(this.showPopover(),!m&&this.#e&&this.matches(":popover-open")&&this.#o())}hide(){this.matches(":popover-open")&&this.hidePopover()}toggle(){this.matches(":popover-open")?this.hide():this.show()}get open(){return this.matches(":popover-open")}#c(){let t=this.dataset.anchor;if(t){let e=document.getElementById(t);if(!e)try{e=document.querySelector(t)}catch{e=null}this.#e=e}else this.#e=document.querySelector(`[popovertarget="${CSS.escape(this.id)}"]`)}#h(){if(!this.#e||!m)return;let t=this.#e,e=t.style.getPropertyValue("anchor-name"),i=C(e||getComputedStyle(t).getPropertyValue("anchor-name"));i.includes(this.#i)||i.push(this.#i),t.style.setProperty("anchor-name",i.join(", ")),this.#n=this.#i,this.style.setProperty("position-anchor",this.#i),this.setAttribute("data-anchor-name",this.#i),P||this.#d(this.dataset.position||"bottom")}#l(){if(this.#e&&this.#n){let t=C(this.#e.style.getPropertyValue("anchor-name")).filter(e=>e!==this.#n);t.length?this.#e.style.setProperty("anchor-name",t.join(", ")):this.#e.style.removeProperty("anchor-name")}this.#n=null,this.style.getPropertyValue("position-anchor")&&this.style.removeProperty("position-anchor"),this.hasAttribute("data-anchor-name")&&this.removeAttribute("data-anchor-name")}#d(t){let e="var(--_pop-over-offset, var(--size-xs))",i=t.endsWith("-end")?{"inset-inline-end":"anchor(end)"}:{"inset-inline-start":"anchor(start)"},s={top:{bottom:`calc(anchor(top) + ${e})`,...i},bottom:{top:`calc(anchor(bottom) + ${e})`,...i},left:{right:`calc(anchor(left) + ${e})`,top:"anchor(top)"},right:{left:`calc(anchor(right) + ${e})`,top:"anchor(top)"}},n=t.split("-")[0],a=s[n]||s.bottom;Object.entries(a).forEach(([r,o])=>this.style.setProperty(r,o)),this.#r=!0}#o(){if(!this.#e)return;let t=this.#e.getBoundingClientRect(),e=this.dataset.position||"bottom",i=this.#u(),s=document.documentElement.clientWidth,n=document.documentElement.clientHeight;this.style.position="fixed",this.style.margin="0",this.style.right="auto",this.style.bottom="auto",this.#a=!0;let a=this.offsetWidth,r=this.offsetHeight,o=e.split("-")[0];["top","bottom","left","right"].includes(o)||(o="bottom");let h={top:t.top-i,bottom:n-t.bottom-i,left:t.left-i,right:s-t.right-i},f={top:"bottom",bottom:"top",left:"right",right:"left"},k=o==="top"||o==="bottom"?r:a;h[o]<k&&h[f[o]]>h[o]&&(o=f[o]);let l,d;switch(o){case"top":l=t.top-r-i,d=t.left;break;case"left":l=t.top,d=t.left-a-i;break;case"right":l=t.top,d=t.right+i;break;default:l=t.bottom+i,d=t.left;break}if(o==="top"||o==="bottom"){let g=getComputedStyle(this).direction==="rtl";d=e.endsWith("-end")!==g?t.right-a:t.left}else e.endsWith("-end")&&(l=t.bottom-r);let E=(g,w,x)=>Math.max(S,Math.min(g,x-w-S));d=E(d,a,s),l=E(l,r,n),this.style.top=`${Math.round(l)}px`,this.style.left=`${Math.round(d)}px`}#u(){let t={none:0,xs:4,s:8,m:16,l:24};return t[this.dataset.offset||""]??t.xs}};p("pop-over",y);var $=8,b=8,q=300,D="Text selection actions",T="F10",H='button:not([disabled]), a[href], [role="button"]:not([aria-disabled="true"])',V='[role="group"], [role="menu"], [role="listbox"], [role="radiogroup"], dialog, [popover]:not([data-selection-menu-host])',I=0,v=class extends u{#e=null;#n=new Set;#i=!1;#t;#r=null;#a=null;#s=null;#c=0;#h=!1;#l="mouse";#d="pointer";#o=!1;#u=new Set;setup(){let t=this.querySelector(":scope > pop-over[data-selection-menu-host]");if(t)this.#t=t;else{this.#t=document.createElement("pop-over"),this.#t.setAttribute("data-selection-menu-host",""),this.#t.dataset.mode="manual",this.#t.id=`selection-menu-${++I}`;let e=[...this.children];for(let i of e)i!==this.#t&&this.#t.appendChild(i);this.appendChild(this.#t)}this.#t.setAttribute("role","toolbar"),this.#t.setAttribute("aria-orientation","horizontal"),this.#t.setAttribute("aria-label",this.dataset.label||D),this.#t.setAttribute("aria-keyshortcuts",`Alt+${T}`),this.hidden=!1,this.#b(),this.listen(document,"pointerup",this.#w),this.listen(document,"pointerdown",this.#$),this.listen(document,"keydown",this.#T),this.listen(document,"keyup",this.#A),this.listen(document,"selectionchange",this.#S),this.listen(window,"scroll",this.#y,{capture:!0,passive:!0}),this.listen(window,"resize",this.#y),this.listen(this.#t,"keydown",this.#k),this.id&&(this.#r=new MutationObserver(()=>this.#b()),this.#r.observe(document.body,{childList:!0,subtree:!0,attributeFilter:["data-selection-menu"]}))}teardown(){this.#r?.disconnect(),this.#r=null,this.#s&&clearTimeout(this.#s),this.#s=null,cancelAnimationFrame(this.#c),this.#a?.getAttribute("data-selection-menu")===this.id&&this.#a.removeAttribute("data-selection-menu"),this.#a=null;for(let t of this.#u)t.removeAttribute("tabindex");this.#u.clear(),this.#i=!1,this.#e=null,this.#h=!1}getSelection(){return this.#e?{...this.#e}:null}dismiss(){this.#i&&this.#f({restoreFocus:!0})}get actions(){return[...(this.#t||this).children].map(e=>({tag:e.tagName.toLowerCase(),attrs:Object.fromEntries([...e.attributes].map(i=>[i.name,i.value])),html:e.innerHTML||void 0}))}set actions(t){let e=Array.isArray(t)?t:[],i=this.#t||this;for(;i.firstChild;)i.firstChild.remove();this.#u.clear();for(let s of e){if(s instanceof Element){i.appendChild(s);continue}if(!s?.tag)continue;let n=document.createElement(s.tag);if(s.attrs)for(let[a,r]of Object.entries(s.attrs))r==null||r===!1||n.setAttribute(a,r===!0?"":String(r));s.html&&(n.innerHTML=s.html),i.appendChild(n)}this.dispatchEvent(new CustomEvent("selection-menu:actions-changed",{detail:{actions:this.actions,source:"property"},bubbles:!0}))}#b(){this.#n.clear();let t=this.getAttribute("for");if(t){let e=document.getElementById(t);e&&(this.#n.add(e),this.id&&!e.hasAttribute("data-selection-menu")&&(e.setAttribute("data-selection-menu",this.id),this.#a=e))}this.id&&document.querySelectorAll(`[data-selection-menu="${CSS.escape(this.id)}"]`).forEach(e=>{this.#n.add(e)})}#w=t=>{this.#h=!1,this.#l=t.pointerType||"mouse",requestAnimationFrame(()=>{this.isConnected&&this.#p()})};#A=t=>{!t.shiftKey&&t.key!=="Shift"||this.#t?.contains(document.activeElement)||(this.#l="keyboard",this.#p())};#S=()=>{this.#h||this.#o||(this.#s&&clearTimeout(this.#s),this.#s=setTimeout(()=>{if(this.#s=null,!this.isConnected||this.#h||this.#o||this.#t?.contains(document.activeElement))return;let t=window.getSelection();if(!t||t.isCollapsed||!t.toString().trim()){this.#i&&this.#d==="keyboard"&&this.#f({restoreFocus:!1});return}this.#d==="keyboard"&&(this.#l="keyboard"),this.#p()},q))};#p(){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed||!t.toString().trim())return!1;let e=t.getRangeAt(0),i=e.commonAncestorContainer,s=i.nodeType===Node.ELEMENT_NODE?i:i.parentElement,n=null;for(let h of this.#n)if(h.contains(s)){n=h;break}if(!n)return!1;let a=t.toString().trim(),r=this.#e,o=this.#i&&r&&r.target===n&&r.text===a&&r.range.compareBoundaryPoints(Range.START_TO_START,e)===0&&r.range.compareBoundaryPoints(Range.END_TO_END,e)===0;return this.#e={range:e.cloneRange(),text:a,target:n},o||this.dispatchEvent(new CustomEvent("selection-menu:select",{detail:{range:this.#e.range,text:a,target:n},bubbles:!0})),this.#C(),!0}#C(){this.#t&&(this.#t.show(),this.#i=!0,this.#v(),cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#g()))}#g(){if(!this.#i||!this.#e||!this.#t)return;let t=this.#e.range.getBoundingClientRect();if(t.bottom<0||t.top>window.innerHeight||t.width===0&&t.height===0){this.#f({restoreFocus:!0});return}let i=this.#t.getBoundingClientRect(),s=i.width||200,n=i.height||40,a=t.top-n-$,r=t.bottom+$,o;this.#l==="touch"?o=r+n+b<=window.innerHeight?r:a:o=a<b?r:a;let h=t.left+t.width/2-s/2,f=window.innerWidth-s-b;h=Math.max(b,Math.min(h,f)),this.#t.style.top=`${o}px`,this.#t.style.left=`${h}px`}#y=()=>{this.#i&&(cancelAnimationFrame(this.#c),this.#c=requestAnimationFrame(()=>this.#g()))};#f({restoreFocus:t=!1,restoreRange:e=!1}={}){let i=this.#e,s=!!this.#t?.contains(document.activeElement);if(this.#t&&this.#t.hide(),this.#i=!1,this.#e=null,cancelAnimationFrame(this.#c),this.#o=!0,this.dispatchEvent(new CustomEvent("selection-menu:dismiss",{bubbles:!0})),t&&s&&i?.target?.isConnected){let n=i.target;if(n.hasAttribute("tabindex")||(n.setAttribute("tabindex","-1"),n.addEventListener("blur",()=>{n.getAttribute("tabindex")==="-1"&&n.removeAttribute("tabindex")},{once:!0})),n.focus({preventScroll:!0}),e){let a=window.getSelection();a&&(a.removeAllRanges(),a.addRange(i.range))}}}#$=t=>{if(this.#h=!0,this.#d="pointer",this.#o=!1,!this.#i)return;let e=t.target;this.#t?.contains(e)||this.contains(e)||this.#f()};#T=t=>{if(["Shift","Alt","Control","Meta"].includes(t.key)||(this.#o=!1),this.#d="keyboard",!t.defaultPrevented){if(t.key==="Escape"&&this.#i){t.preventDefault(),this.#f({restoreFocus:!0,restoreRange:!0});return}if(t.key===T&&t.altKey&&!t.ctrlKey&&!t.metaKey){if(!this.#i&&(this.#l="keyboard",!this.#p()))return;t.preventDefault(),this.#E(0)}}};#m(){return this.#t?[...this.#t.querySelectorAll(H)].filter(t=>{let e=t.closest(V);if(e&&this.#t.contains(e))return!1;let i=t.closest("[hidden]");return!(i&&this.#t.contains(i))}):[]}#v(){let t=this.#m(),e=t.find(i=>i===document.activeElement)??t.find(i=>i.getAttribute("tabindex")==="0")??t[0];for(let i of t)i.setAttribute("tabindex",i===e?"0":"-1"),this.#u.add(i)}#E(t){this.#v();let e=this.#m();if(!e.length)return;let i=(t%e.length+e.length)%e.length;for(let s of e)s.setAttribute("tabindex",s===e[i]?"0":"-1");e[i].focus()}#k=t=>{let e=t.target;if(e.matches('input, textarea, select, [contenteditable]:not([contenteditable="false"])'))return;let i=this.#m(),s=i.indexOf(e);if(s===-1)return;let n=getComputedStyle(this.#t).direction==="rtl",a=n?"ArrowLeft":"ArrowRight",r=n?"ArrowRight":"ArrowLeft",o=-1;if(t.key===a)o=s+1;else if(t.key===r)o=s-1;else if(t.key==="Home")o=0;else if(t.key==="End")o=i.length-1;else return;t.preventDefault(),this.#E(o)}};p("selection-menu",v);
2
2
  //# sourceMappingURL=selection-menu.js.map
@@ -1,4 +1,4 @@
1
- var lt=Object.defineProperty;var ke=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ee=(t,e)=>{for(var a in e)lt(t,a,{get:e[a],enumerable:!0})};var st={};Ee(st,{destroyStickyManager:()=>Bt,findBannerHeader:()=>tt,initStickyManager:()=>Ct});function tt(){for(let t of document.querySelectorAll("header"))if(!t.parentElement?.closest(At))return t;return null}function O(){let t=document.documentElement;if(!t.hasAttribute("data-sticky"))return;let e=tt();e&&!e.hasAttribute("data-sticky")&&(e.dataset.sticky="",me.add(e)),e&&re&&!fe.has(e)&&(re.observe(e),fe.add(e));let a=e?.hasAttribute("data-sticky")&&getComputedStyle(e).position!=="static",s=e&&a?e.getBoundingClientRect().height:0;t.style.setProperty("--sticky-offset",`${s}px`)}function at(){O()}function Ct(){if(se){O();return}se=!0,re=new ResizeObserver(O),fe=new WeakSet,O(),requestAnimationFrame(O),document.fonts?.ready?.then(O),window.addEventListener("resize",O,{passive:!0}),document.addEventListener("toggle",at,!0)}function Bt(){if(se){se=!1,window.removeEventListener("resize",O),document.removeEventListener("toggle",at,!0),re?.disconnect();for(let t of me)delete t.dataset.sticky;me.clear(),document.documentElement.style.removeProperty("--sticky-offset")}}var se,re,me,fe,At,rt=ke(()=>{se=!1,me=new Set,fe=new WeakSet,At='article, aside, main, nav, section, [role="article"], [role="complementary"], [role="main"], [role="navigation"], [role="region"]'});var it={};Ee(it,{SoundManager:()=>$t});var nt,pe,$t,ot=ke(()=>{nt="vb-sound",pe={enabled:!1,volume:.5},$t={_ctx:null,_enabled:!1,_volume:.5,_initialized:!1,init(){if(this._initialized)return this;let t=this._load();return this._enabled=t.enabled,this._volume=t.volume,this._initialized=!0,this},_getContext(){return this._ctx||(this._ctx=new(window.AudioContext||window.webkitAudioContext)),this._ctx.state==="suspended"&&this._ctx.resume(),this._ctx},_load(){try{let t=localStorage.getItem(nt);return t?{...pe,...JSON.parse(t)}:{...pe}}catch{return{...pe}}},_save(t){try{let e=this._load();localStorage.setItem(nt,JSON.stringify({...e,...t}))}catch{}},_playTone(t,e,a="sine"){if(!this._enabled)return;let s=this._getContext(),r=s.createOscillator(),n=s.createGain();r.connect(n),n.connect(s.destination),r.frequency.value=t,r.type=a,n.gain.value=this._volume*.3,r.start(),n.gain.exponentialRampToValueAtTime(.01,s.currentTime+e),r.stop(s.currentTime+e)},enable(){this._enabled=!0,this._save({enabled:!0}),this.play("click")},disable(){this._enabled=!1,this._save({enabled:!1})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled},isEnabled(){return this._enabled},setVolume(t){this._volume=Math.max(0,Math.min(1,t)),this._save({volume:this._volume})},getVolume(){return this._volume},play(t){if(this._enabled)switch(t){case"click":this._playTone(800,.1);break;case"success":this._playTone(523,.1),setTimeout(()=>this._playTone(659,.1),100),setTimeout(()=>this._playTone(784,.15),200);break;case"error":this._playTone(200,.15,"sawtooth"),setTimeout(()=>this._playTone(180,.2,"sawtooth"),150);break;case"notification":this._playTone(880,.1),setTimeout(()=>this._playTone(1100,.15),100);break;case"soft":this._playTone(600,.05);break;case"tick":this._playTone(1200,.02,"square");break}},getState(){return{enabled:this._enabled,volume:this._volume}}}});var Ot=window.matchMedia("(prefers-reduced-motion: reduce)");var _e=new Map;function xe(t,e,a={}){let s=a.priority??10,r={impl:e,bundle:a.bundle,contract:a.contract,priority:s},n=_e.get(t);if(customElements.get(t)){if(!n||n.priority>=s){n&&n.priority===s&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${a.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${a.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=s){n.priority===s&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}". Skipping "${a.bundle}" (first wins at equal priority).`);return}_e.set(t,r),customElements.define(t,e)}var Y=class extends HTMLElement{#a=[];#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 e of this.#a)e();this.#a=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,a,s,r){e.addEventListener(a,s,r),this.#a.push(()=>e.removeEventListener(a,s,r))}_reinit(){for(let e of this.#a)e();this.#a=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,a){this.#t||(this.#t=this.attachInternals());let s=this.#t.states;try{a?s.add(e):s.delete(e)}catch{let r=`--${e}`;a?s.add(r):s.delete(r)}}_adoptInternals(e){this.#t||(this.#t=e)}#s(){return this.constructor.formAssociated&&this.#t?this.#t: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}};var R=new Map,ie=new Map;var Ae=null;function Ce(){if(typeof window<"u"&&window.__VB_THEME_BASE)return String(window.__VB_THEME_BASE).replace(/\/$/,"");if(Ae)return Ae;if(typeof document<"u"){let t=document.querySelectorAll('script[src*="vanilla-breeze"]');for(let e of t){let a=e.getAttribute("src");if(a){let s=a.lastIndexOf("/");if(s!==-1)return a.slice(0,s)}}}return"/cdn"}var ht=new Set(["default","a11y-high-contrast","a11y-large-text","a11y-dyslexia","modern","minimal","classic"]),ut=new Set(["kawaii","memphis"]);function Be(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):String(t).replace(/["\\]/g,"\\$&")}function $e(t){document.querySelectorAll(`link[data-vb-theme-preload="${Be(t)}"]`).forEach(e=>e.remove())}function oe(t){return ut.has(t)}function gt(t,e){return`${e}/themes/${t}.css`}function Te(t,e){if(!oe(t))return Promise.resolve();if(ie.has(t))return ie.get(t);let a=import(`${e}/packs/${t}.full.js`).catch(()=>{});return ie.set(t,a),a}function mt(t,e){let a=Ce(),s=()=>{(oe(e)||t.hasAttribute("data-vb-pack"))&&Te(e,a)};return t.getAttribute("data-vb-theme-state")==="error"?Promise.reject(new Error(`Failed to load theme: ${e}`)):t.getAttribute("data-vb-theme-state")==="ready"||t.sheet?(s(),Promise.resolve()):new Promise((r,n)=>{let i=()=>{t.setAttribute("data-vb-theme-state","ready"),w(),s(),r(void 0)},f=()=>{t.setAttribute("data-vb-theme-state","error"),R.delete(e),w(),n(new Error(`Failed to load theme: ${e}`))},w=()=>{t.removeEventListener("load",i),t.removeEventListener("error",f)};t.addEventListener("load",i,{once:!0}),t.addEventListener("error",f,{once:!0})})}async function N(t){if(!t||ht.has(t))return;if(R.has(t))return R.get(t);if(typeof document<"u"){let s=document.querySelector(`link[data-vb-theme="${Be(t)}"]`);if(s){let r=mt(s,t);return R.set(t,r),r}}let e=Ce(),a=oe(t)?pt(t,e):ft(t,e);return R.set(t,a),a}async function ft(t,e){let a=gt(t,e);return new Promise((s,r)=>{$e(t);let n=document.createElement("link");n.rel="stylesheet",n.href=a,n.setAttribute("data-vb-theme",t),n.setAttribute("data-vb-theme-state","loading"),n.onload=()=>{n.setAttribute("data-vb-theme-state","ready"),s()},n.onerror=()=>{n.setAttribute("data-vb-theme-state","error"),n.remove(),R.delete(t),r(new Error(`Failed to load theme: ${t}`))},document.head.appendChild(n)})}function pt(t,e){let a=`${e}/packs/${t}.theme.css`,s=`${e}/packs/${t}.effects.css`;return new Promise((r,n)=>{$e(t);let i=document.createElement("link");i.rel="stylesheet",i.href=a,i.setAttribute("data-vb-theme",t),i.setAttribute("data-vb-pack",t),i.setAttribute("data-vb-theme-state","loading"),i.onload=()=>{i.setAttribute("data-vb-theme-state","ready");let f=document.createElement("link");f.rel="stylesheet",f.href=s,f.setAttribute("data-vb-pack-effects",t),document.head.appendChild(f),Te(t,e),r()},i.onerror=()=>{i.setAttribute("data-vb-theme-state","error"),i.remove(),R.delete(t),n(new Error(`Failed to load pack: ${t}`))},document.head.appendChild(i)})}var Fe=[{id:"default",name:"Default",swatchBg:"#3b82f6",seeds:{}},{id:"ocean",name:"Ocean",swatchBg:"#0891b2",seeds:{"--hue-primary":200,"--hue-secondary":180,"--hue-accent":45,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"45%","--chroma-secondary":.1,"--lightness-accent":"70%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"forest",name:"Forest",swatchBg:"#059669",seeds:{"--hue-primary":145,"--hue-secondary":90,"--hue-accent":30,"--lightness-primary":"45%","--chroma-primary":.15,"--lightness-secondary":"55%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"58%","--chroma-primary":.12}},{id:"sunset",name:"Sunset",swatchBg:"#ea580c",seeds:{"--hue-primary":25,"--hue-secondary":0,"--hue-accent":280,"--lightness-primary":"57%","--chroma-primary":.2,"--lightness-secondary":"55%","--chroma-secondary":.18,"--lightness-accent":"55%","--chroma-accent":.18},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.16}},{id:"rose",name:"Rose",swatchBg:"#e11d48",seeds:{"--hue-primary":350,"--hue-secondary":330,"--hue-accent":200,"--lightness-primary":"55%","--chroma-primary":.18,"--lightness-secondary":"50%","--chroma-secondary":.14,"--lightness-accent":"60%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.14}},{id:"lavender",name:"Lavender",swatchBg:"#a855f7",seeds:{"--hue-primary":280,"--hue-secondary":300,"--hue-accent":60,"--lightness-primary":"55%","--chroma-primary":.14,"--lightness-secondary":"50%","--chroma-secondary":.12,"--lightness-accent":"70%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.12}},{id:"coral",name:"Coral",swatchBg:"#f97316",seeds:{"--hue-primary":15,"--hue-secondary":25,"--hue-accent":180,"--lightness-primary":"57%","--chroma-primary":.18,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"55%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.15}},{id:"slate",name:"Slate",swatchBg:"#64748b",seeds:{"--hue-primary":220,"--hue-secondary":210,"--hue-accent":45,"--lightness-primary":"48%","--chroma-primary":.1,"--lightness-secondary":"45%","--chroma-secondary":.06,"--lightness-accent":"68%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.08}},{id:"emerald",name:"Emerald",swatchBg:"#10b981",seeds:{"--hue-primary":160,"--hue-secondary":140,"--hue-accent":30,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"48%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"amber",name:"Amber",swatchBg:"#f59e0b",seeds:{"--hue-primary":45,"--hue-secondary":30,"--hue-accent":240,"--lightness-primary":"56%","--chroma-primary":.16,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"52%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"68%","--chroma-primary":.14}},{id:"indigo",name:"Indigo",swatchBg:"#6366f1",seeds:{"--hue-primary":250,"--hue-secondary":270,"--hue-accent":35,"--lightness-primary":"48%","--chroma-primary":.18,"--lightness-secondary":"45%","--chroma-secondary":.14,"--lightness-accent":"68%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"62%","--chroma-primary":.14}}],Me=[{id:"default",name:"Default",hue:210,shape:"balanced",character:"The default",swatchBg:"#3b82f6",tier:"core"},{id:"modern",name:"Modern",hue:270,shape:"rounded",character:"Vibrant & elevated",swatchBg:"#6366f1",tier:"core"},{id:"minimal",name:"Minimal",hue:240,shape:"sharp",character:"Clean & flat",swatchBg:"#71717a",tier:"core"},{id:"classic",name:"Classic",hue:220,shape:"subtle",character:"Serif & elegant",swatchBg:"#92400e",tier:"core"}],ce=[{id:"swiss",name:"Swiss",icon:"grid-3x3",character:"Precision grid",swatchBg:"#ff3e00",swatchFg:"white",tier:"showcase",category:"Design"},{id:"brutalist",name:"Brutalist",icon:"square",character:"Raw, industrial",swatchBg:"#1a1a1a",swatchFg:"#f5f5f5",tier:"showcase",category:"Design"},{id:"art-deco",name:"Art Deco",icon:"crown",character:"1920s luxury",swatchBg:"#1A1A1A",swatchFg:"#C9A84C",tier:"showcase",category:"Design"},{id:"editorial",name:"Editorial",icon:"newspaper",character:"Magazine elegance",swatchBg:"#1a1a1a",swatchFg:"#c9a227",tier:"showcase",category:"Content"},{id:"genai",name:"GenAI",icon:"sparkles",character:"AI aesthetic",swatchBg:"#1a0a2e",swatchFg:"#a855f7",tier:"showcase",category:"Modern"},{id:"glassmorphism",name:"Glass",icon:"glass-water",character:"Frosted surfaces",swatchBg:"#667eea",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"startup",name:"Startup",icon:"rocket",character:"SaaS energy",swatchBg:"#4f46e5",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"organic",name:"Organic",icon:"leaf",character:"Natural, handcrafted",swatchBg:"#2d5016",swatchFg:"#faf5e6",tier:"showcase",category:"Creative"},{id:"rough",name:"Rough",icon:"pencil",character:"Hand-drawn sketch",swatchBg:"#f5f0e8",swatchFg:"#3a3a3a",tier:"showcase",category:"Creative"},{id:"cyber",name:"Cyber",icon:"zap",character:"Neon futuristic",swatchBg:"#0a0a1a",swatchFg:"#00ff88",tier:"showcase",category:"Creative"},{id:"journal",name:"Journal",icon:"notebook-pen",character:"Dot-grid bullet journal",swatchBg:"#f3ecdc",swatchFg:"#27313f",tier:"showcase",category:"Creative"},{id:"vaporwave",name:"Vaporwave",icon:"radio",character:"Neon dreamy",swatchBg:"#2b0040",swatchFg:"#ff6ad5",tier:"showcase",category:"Aesthetic"},{id:"neumorphism",name:"Neumorph",icon:"circle",character:"Soft embossed",swatchBg:"#e0e0e0",swatchFg:"#a0a0a0",tier:"showcase",category:"Aesthetic"},{id:"bauhaus",name:"Bauhaus",icon:"shapes",character:"Geometric",swatchBg:"#F1FAEE",swatchFg:"#E63946",tier:"showcase",category:"Aesthetic"},{id:"claymorphism",name:"Clay",icon:"circle-dot",character:"Puffy 3D",swatchBg:"#f0f0f5",swatchFg:"#FF6B9D",tier:"showcase",category:"Aesthetic"},{id:"alpha1999",name:"Alpha1999",icon:"orbit",character:"Space retro-fi",swatchBg:"#0a0a14",swatchFg:"#d4880f",tier:"showcase",category:"Signature"},{id:"super2026",name:"Super2026",icon:"triangle",character:"Supergraphic bold",swatchBg:"#f5f0e6",swatchFg:"#c23616",tier:"showcase",category:"Signature"},{id:"magna",name:"Magna",icon:"orbit",character:"Odyssey 2 retro",swatchBg:"#0d0b14",swatchFg:"#f97316",tier:"showcase",category:"Signature"},{id:"win9x",name:"Win9x",icon:"monitor",character:"Classic desktop",swatchBg:"#008080",swatchFg:"#c0c0c0",tier:"showcase",category:"OS Styles"},{id:"nes",name:"NES",icon:"joystick",character:"Console pixels",swatchBg:"#bcbcbc",swatchFg:"#e40521",tier:"showcase",category:"OS Styles"},{id:"8bit",name:"8-Bit",icon:"gamepad-2",character:"Retro pixel art",swatchBg:"#000080",swatchFg:"#ffff00",tier:"showcase",category:"OS Styles"}],de=[{id:"nord",name:"Nord",icon:"snowflake",character:"Arctic calm",swatchBg:"#2E3440",swatchFg:"#81A1C1",tier:"community",category:"Editor Palettes"},{id:"solarized",name:"Solarized",icon:"sun-dim",character:"Engineered precision",swatchBg:"#002B36",swatchFg:"#268BD2",tier:"community",category:"Editor Palettes"},{id:"dracula",name:"Dracula",icon:"moon-star",character:"Dark elegance",swatchBg:"#282A36",swatchFg:"#BD93F9",tier:"community",category:"Editor Palettes"},{id:"catppuccin-mocha",name:"Catppuccin",icon:"coffee",character:"Warm pastels",swatchBg:"#1E1E2E",swatchFg:"#CBA6F7",tier:"community",category:"Editor Palettes"},{id:"catppuccin-latte",name:"Ctp Latte",icon:"coffee",character:"Cozy daytime",swatchBg:"#eff1f5",swatchFg:"#8839ef",tier:"community",category:"Editor Palettes"},{id:"catppuccin-frappe",name:"Ctp Frapp\xE9",icon:"coffee",character:"Cool twilight",swatchBg:"#303446",swatchFg:"#ca9ee6",tier:"community",category:"Editor Palettes"},{id:"catppuccin-macchiato",name:"Ctp Macchiato",icon:"coffee",character:"Deep blue",swatchBg:"#24273a",swatchFg:"#c6a0f6",tier:"community",category:"Editor Palettes"},{id:"gruvbox",name:"Gruvbox",icon:"palette",character:"Retro warmth",swatchBg:"#282828",swatchFg:"#ebdbb2",tier:"community",category:"Editor Palettes"},{id:"tokyo-night",name:"Tokyo Night",icon:"moon",character:"Night-owl vibes",swatchBg:"#1a1b26",swatchFg:"#7aa2f7",tier:"community",category:"Editor Palettes"},{id:"rose-pine",name:"Ros\xE9 Pine",icon:"flower-2",character:"Muted elegance",swatchBg:"#191724",swatchFg:"#ebbcba",tier:"community",category:"Editor Palettes"},{id:"cottagecore",name:"Cottagecore",icon:"flower-2",character:"Pastoral",swatchBg:"#fdf8f0",swatchFg:"#7d8c6d",tier:"community",category:"Niche"},{id:"terminal",name:"Terminal",icon:"terminal",character:"Retro CRT",swatchBg:"#0d1117",swatchFg:"#00ff00",tier:"community",category:"Niche"},{id:"clinical",name:"Clinical",icon:"heart-pulse",character:"Sterile precision",swatchBg:"#ffffff",swatchFg:"#0077b6",tier:"community",category:"Industry"},{id:"financial",name:"Financial",icon:"landmark",character:"Navy + gold",swatchBg:"#1b2a4a",swatchFg:"#c9a84c",tier:"community",category:"Industry"},{id:"government",name:"Government",icon:"shield",character:"Official",swatchBg:"#002868",swatchFg:"#bf0a30",tier:"community",category:"Industry"},{id:"dawn",name:"Dawn",icon:"sunrise",character:"Golden morning",swatchBg:"#fef3e2",swatchFg:"#d4a574",tier:"community",category:"Mood/Time"},{id:"dusk",name:"Dusk",icon:"sunset",character:"Twilight",swatchBg:"#1a1b2e",swatchFg:"#e5a858",tier:"community",category:"Mood/Time"},{id:"midnight",name:"Midnight",icon:"moon",character:"Deep night",swatchBg:"#0d1117",swatchFg:"#58a6ff",tier:"community",category:"Mood/Time"},{id:"high-noon",name:"High Noon",icon:"sun",character:"Maximum bright",swatchBg:"#ffffff",swatchFg:"#e63946",tier:"community",category:"Mood/Time"}],Pe=[{id:"kawaii",name:"Kawaii",icon:"heart",character:"Cute aesthetic",swatchBg:"#ffb7c5",swatchFg:"#ff69b4",tier:"showcase",category:"Packs"},{id:"memphis",name:"Memphis",icon:"star",character:"Bold patterns",swatchBg:"#FFF8F0",swatchFg:"#d03040",tier:"showcase",category:"Packs"}];var Vt=[...ce,...de],Ht=[...Me,...ce,...de,...Pe],L=t=>ce.filter(e=>e.category===t),Oe=[{label:"Style",themes:Me,tier:"core"},{label:"Design",themes:L("Design"),tier:"showcase"},{label:"Content",themes:L("Content"),tier:"showcase"},{label:"Modern",themes:L("Modern"),tier:"showcase"},{label:"Creative",themes:L("Creative"),tier:"showcase"},{label:"Aesthetic",themes:L("Aesthetic"),tier:"showcase"},{label:"Signature",themes:L("Signature"),tier:"showcase"},{label:"OS Styles",themes:L("OS Styles"),tier:"showcase"},{label:"Packs",themes:Pe,tier:"showcase"},{label:"More Themes",themes:de,tier:"community"}];function yt(){let t=globalThis.localStorage;if(!t)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(e){return t.getItem(e)},async setRaw(e,a){t.setItem(e,a)},async removeRaw(e){t.removeItem(e)},async keys(e){let a=[];for(let s=0;s<t.length;s++){let r=t.key(s);r&&r.startsWith(e)&&a.push(r)}return a}}}var J="__vbStoreBackend",X=globalThis;function F(){return X[J]||(X[J]=yt()),X[J]}function le(t,e){if(typeof t!="string"||!t)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof e!="string"||!e)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${t}:${e}`}function De(t){if(typeof t!="string"||!t)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${t}:`}function Re(t){try{let e=JSON.parse(t);if(e&&typeof e=="object"&&typeof e.timestamp=="number")return e}catch{}return null}var u={configure(t={}){X[J]=t.backend??null},async set(t,e,a){let s={data:a,timestamp:Date.now()};await F().setRaw(le(t,e),JSON.stringify(s))},async get(t,e,a){let s=await F().getRaw(le(t,e));if(s==null)return null;let r=Re(s);return!r||a?.maxAge!=null&&Date.now()-r.timestamp>a.maxAge?null:r.data},async remove(t,e){await F().removeRaw(le(t,e))},async list(t){let e=De(t),a=await F().keys(e),s=[];for(let r of a){let n=await F().getRaw(r);if(n==null)continue;let i=Re(n);i&&s.push({key:r.slice(e.length),data:i.data,timestamp:i.timestamp})}return s},async clear(t){let e=De(t),a=await F().keys(e);for(let s of a)await F().removeRaw(s)},async clearAll(){let t=await F().keys("vb:");for(let e of t)await F().removeRaw(e)},async setMany(t,e){for(let[a,s]of e)await u.set(t,a,s)}};if(typeof window<"u"){let t=window.VB??(window.VB={});t.store??=u}var Q="theme",Z="current",je=2,te={accent:"data-accent",borderStyle:"data-border-style",iconSet:"data-icon-set",fluid:"data-fluid",backdrop:"data-backdrop",backdropChrome:"data-backdrop-chrome"},S={mode:"auto",brand:"default",accent:null,borderStyle:null,iconSet:null,fluid:null,backdrop:null,backdropChrome:null,pageBgType:"",pageBgColor:"",pageBgGradStart:"",pageBgGradEnd:"",pageBgGradDir:""};function Le(t){if(!t||typeof t!="object")return null;let e={...t};if(!(Number(e.v)>=je))for(let a of Object.keys(te))(e[a]===""||a==="accent"&&e[a]==="default")&&(e[a]=null);return e}function M(t,e){return t??e??""}var he=null;function $(){if(he)return he;let t=document.documentElement,e=window.__vbAuthoredRoot,a=r=>{if(e&&typeof e=="object"){if(r in e)return e[r]??null;if(r==="data-mode")return null}return t.getAttribute(r)},s={theme:a("data-theme"),mode:a("data-mode"),themeSource:a("data-theme-source")};for(let[r,n]of Object.entries(te))s[r]=a(n);return he=s,s}function bt(t){try{let e=document.createElement("canvas");e.width=e.height=1;let a=e.getContext("2d",{willReadFrequently:!0});if(!a)return t;a.fillStyle=t,a.fillRect(0,0,1,1);let[s,r,n]=a.getImageData(0,0,1,1).data;return"#"+[s,r,n].map(i=>i.toString(16).padStart(2,"0")).join("")}catch{return t}}function ee(t,e){let a=(t||"").split(/\s+/).filter(Boolean);return e==="site"?a[0]&&!a[0].startsWith("a11y-")?a[0]:"":a.find(s=>!s.startsWith("a11y-"))||""}function wt(t,e,a,s=!1){let r=(t||"").split(/\s+/).filter(n=>n&&n!==e&&n!==a);return a!=="default"?[a,...r].join(" "):(s&&r.length?["default",...r]:r).join(" ")}function Ve(t){return t==="light"||t==="dark"?t:null}function He(t,e,a){return e||(t==="light"||t==="dark"?t:a?"dark":"light")}function Ie(t,e,a){let s=ee(e,a);return a==="site"&&s?s:t?.brand&&t.brand!==S.brand?t.brand:s||S.brand}var qe=["--hue-primary","--hue-secondary","--hue-accent","--lightness-primary","--chroma-primary","--lightness-secondary","--chroma-secondary","--lightness-accent","--chroma-accent"],h=null,U="",ue="",I=null,V=null,m={_initPromise:null,async init(){return this._initPromise?this._initPromise:(this._initPromise=(async()=>{let t=Le(await u.get(Q,Z));h=t?{...S,...t}:{...S},V=$().themeSource??null,U=ee($().theme??"",V),ue=ee(document.documentElement.dataset.theme||"",V),I=Ve($().mode),h.brand=Ie(t,$().theme??"",V);try{await N(h.brand)}catch{h.brand!==U&&(h.brand=U||S.brand)}return this.apply(h),this._watchSystemPreference(),this._watchRootAttributes(),this._watchCrossDocumentStorage(),h})(),this._initPromise)},_watchCrossDocumentStorage(){typeof window>"u"||window.addEventListener("storage",async t=>{if(t.key!==`vb:${Q}:${Z}`||!t.newValue)return;let e;try{let s=JSON.parse(t.newValue);e=Le(s?.data)}catch{return}if(!e)return;let a={...S,...h,...e};if(a.brand=Ie(e,$().theme??"",V),a.brand&&a.brand!==h?.brand)try{await N(a.brand)}catch{a.brand=U||S.brand}h=a,this.apply(h||{})})},load(){return h?{...h}:{...S}},save(t){let e={...h??S,...t,v:je};return h=e,u.set(Q,Z,e).catch(()=>{}),e},apply({mode:t="auto",brand:e="default",borderStyle:a=null,iconSet:s=null,fluid:r=null,backdrop:n=null,backdropChrome:i=null,pageBgType:f="",pageBgColor:w="",pageBgGradStart:E="",pageBgGradEnd:_="",pageBgGradDir:T=""}={}){let p=document.documentElement,y=$(),x=He(t,I,window.matchMedia("(prefers-color-scheme: dark)").matches);p.dataset.mode=x;let A=V==="site",b=wt(p.dataset.theme||"",ue,e,A);b?p.dataset.theme=b:delete p.dataset.theme,ue=e==="default"&&!b.startsWith("default")?"":e;let C=a||y.borderStyle||this._readCSSHint("--theme-border-style");this._setRootAttr("data-border-style",C&&C!=="clean"?C:"");let c=s||y.iconSet||this._readCSSHint("--theme-icon-set");this._setRootAttr("data-icon-set",c&&c!=="lucide"?c:"");let o=M(r,y.fluid);this._setRootAttr("data-fluid",o,!0);let B=M(n,y.backdrop);this._setRootAttr("data-backdrop",B,!0);let g=M(i,y.backdropChrome);if(this._setRootAttr("data-backdrop-chrome",g&&g!=="card"?g:""),f==="color"&&w)p.style.setProperty("--page-bg-color",w),p.style.removeProperty("--page-bg-gradient");else if(f==="gradient"&&E&&_){let d=T||"to bottom";p.style.setProperty("--page-bg-gradient",`linear-gradient(${d}, ${E}, ${_})`),p.style.removeProperty("--page-bg-color")}else p.style.removeProperty("--page-bg-color"),p.style.removeProperty("--page-bg-gradient");this._applyAccent(this.load().accent);let G=this.getState().accent;this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{mode:t,brand:e,accent:G,borderStyle:C,iconSet:c,fluid:o,backdrop:B,backdropChrome:g,pageBgType:f,effectiveMode:x}}))},_setRootAttr(t,e,a=!1){let s=document.documentElement;e?s.setAttribute(t,e):a&&this._authoredHas(t)?s.setAttribute(t,""):s.removeAttribute(t)},_authoredHas(t){let e=Object.keys(te).find(s=>te[s]===t);return e?this.load()[e]==null&&$()[e]!=null:!1},_syncThemeColor(){let t=document.querySelectorAll('meta[name="theme-color"]');if(!t.length)return;let e=r=>!r||r==="transparent"||/^rgba\(.*,\s*0\)$/.test(r),a=getComputedStyle(document.documentElement).backgroundColor;if(e(a)){let r=document.createElement("span");r.style.setProperty("position","absolute"),r.style.setProperty("background-color","var(--color-background)"),(document.body||document.documentElement).append(r),a=getComputedStyle(r).backgroundColor,r.remove()}if(e(a))return;let s=bt(a);t.forEach(r=>{r.removeAttribute("media"),r.setAttribute("content",s)})},setMode(t){I=null;let e=this.save({mode:t});this.apply(e)},async setBrand(t){try{await N(t)}catch(a){console.warn(`[VB] Theme "${t}" failed to load, using default`,a),t="default"}let e=this.save({brand:t});this.apply(e)},setAccent(t){this.save({accent:t}),this._applyAccent(t),this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}}))},setBorderStyle(t){let e=this.save({borderStyle:t});this.apply(e)},setIconSet(t){let e=this.save({iconSet:t});this.apply(e)},setFluid(t){let e=this.save({fluid:t});this.apply(e)},setBackdrop(t){let e=this.save({backdrop:t});this.apply(e)},setBackdropChrome(t){let e=this.save({backdropChrome:t});this.apply(e)},setPageBg({type:t="",color:e="",gradStart:a="",gradEnd:s="",gradDir:r=""}={}){let n=this.save({pageBgType:t,pageBgColor:e,pageBgGradStart:a,pageBgGradEnd:s,pageBgGradDir:r});this.apply(n)},getEffectiveMode(){let{mode:t}=this.load();return He(t,I,window.matchMedia("(prefers-color-scheme: dark)").matches)},getState(){let{mode:t,brand:e,accent:a,borderStyle:s,iconSet:r,fluid:n,backdrop:i,backdropChrome:f,pageBgType:w,pageBgColor:E,pageBgGradStart:_,pageBgGradEnd:T,pageBgGradDir:p}=this.load(),y=typeof document>"u"?{}:$(),x=(A,b)=>b==null&&y[A]===""?"default":M(b,y[A]);return{mode:t,brand:e,accent:M(a,y.accent)||"default",borderStyle:M(s,y.borderStyle),iconSet:M(r,y.iconSet),fluid:x("fluid",n),backdrop:x("backdrop",i),backdropChrome:M(f,y.backdropChrome),pageBgType:w,pageBgColor:E,pageBgGradStart:_,pageBgGradEnd:T,pageBgGradDir:p,effectiveMode:this.getEffectiveMode()}},toggleMode(){let e=this.getEffectiveMode()==="dark"?"light":"dark";this.setMode(e)},reset(){h={...S,brand:U||S.brand},I=Ve($().mode),u.remove(Q,Z).catch(()=>{});let t=document.documentElement;t.style.removeProperty("--page-bg-color"),t.style.removeProperty("--page-bg-gradient");for(let e of qe)t.style.removeProperty(e);this.apply(h)},_readCSSHint(t){return getComputedStyle(document.documentElement).getPropertyValue(t).trim()},_applyAccent(t){let e=document.documentElement;for(let s of qe)e.style.removeProperty(s);if(t==null){let s=$().accent;s?e.dataset.accent=s:delete e.dataset.accent;return}let a=Fe.find(s=>s.id===t);if(!a||!a.seeds||Object.keys(a.seeds).length===0){delete e.dataset.accent;return}e.dataset.accent=a.id},_watchRootAttributes(){this._rootObserver||(this._rootObserver=new MutationObserver(t=>{for(let e of t)e.attributeName==="data-theme"?this._syncFromDataTheme():e.attributeName==="data-mode"&&this._syncFromDataMode()}),this._rootObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-mode"]}))},_syncFromDataTheme(){if(!h)return;let t=document.documentElement.dataset.theme||"",e=t.split(/\s+/).filter(Boolean),a=ee(t,V)||"default";a!==h.brand&&(h.brand=a,N(a).catch(()=>{}),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_syncFromDataMode(){if(!h)return;let t=document.documentElement.dataset.mode||"auto",e=this.getEffectiveMode();t!==e&&(I=null,h.mode=t,this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_watchSystemPreference(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{let e=this.load();e.mode==="auto"&&this.apply(e)})}};if(typeof window<"u"){let t=window.VB??(window.VB={});t.themeManager??=m}var Ge="environment",We="preferences",ge={timeOfDay:!1,seasonal:!1},vt=900*1e3,P={...ge};function H(t,e,a){return t+(e-t)*Math.min(1,Math.max(0,a))}var q={_timer:null,_baseHues:null,_timeOverride:null,_monthOverride:null,async init(){let t=await u.get(Ge,We);P=t?{...ge,...t}:{...ge},(P.timeOfDay||P.seasonal)&&(this._captureBaseHues(),this._update(),this._startLoop()),window.addEventListener("vb:theme-change",()=>{this._hasActiveSource()&&requestAnimationFrame(()=>{this._captureBaseHues(),this._update()})})},load(){return{...P}},save(t){return P={...P,...t},u.set(Ge,We,P).catch(()=>{}),{...P}},setTimeOverride(t){this._timeOverride=t,this._hasActiveSource()&&this._update()},setMonthOverride(t){this._monthOverride=t,this._hasActiveSource()&&this._update()},setSource(t,e){let a=this.save({[t]:e});e?(this._captureBaseHues(),this._update(),this._startLoop()):this._hasActiveSource(a)?this._update():(this._clearModifiers(),this._stopLoop())},_hasActiveSource(t){let e=t||this.load();return e.timeOfDay||e.seasonal},_captureBaseHues(){let t=document.documentElement;t.style.removeProperty("--hue-primary"),t.style.removeProperty("--hue-secondary"),t.style.removeProperty("--hue-accent");let e=t.getAttribute("data-theme");if(e){let a=`[data-theme~="${e}"]`;for(let s of document.styleSheets)try{for(let r=0;r<s.cssRules.length;r++){let n=s.cssRules[r];if(n.selectorText?.includes(a)&&!n.selectorText.includes("dark")){let i=n.style?.getPropertyValue("--hue-primary");if(i){this._baseHues={primary:parseFloat(i)||260,secondary:parseFloat(n.style.getPropertyValue("--hue-secondary"))||200,accent:parseFloat(n.style.getPropertyValue("--hue-accent"))||30};return}}}}catch{}}this._baseHues={primary:260,secondary:200,accent:30}},_update(){let t=this.load(),e=0;t.timeOfDay&&(e+=this._getTimeOfDayOffset()),t.seasonal&&(e+=this._getSeasonalOffset());let a=document.documentElement;e!==0&&this._baseHues?(a.style.setProperty("--hue-primary",String(this._baseHues.primary+e)),a.style.setProperty("--hue-secondary",String(this._baseHues.secondary+e)),a.style.setProperty("--hue-accent",String(this._baseHues.accent+e*.5))):e===0&&this._clearModifiers()},_clearModifiers(){let t=document.documentElement;t.style.removeProperty("--hue-primary"),t.style.removeProperty("--hue-secondary"),t.style.removeProperty("--hue-accent")},_getTimeOfDayOffset(){let t=this._timeOverride??new Date().getHours()+new Date().getMinutes()/60;return t<5?-20:t<7?H(-20,20,(t-5)/2):t<10?H(20,5,(t-7)/3):t<14?H(5,0,(t-10)/4):t<17?H(0,-5,(t-14)/3):t<19?H(-5,15,(t-17)/2):t<21?H(15,-10,(t-19)/2):H(-10,-20,(t-21)/8)},_getHemisphere(){return window.__VB_ENV_LOCATION?.hemisphere||"north"},_getSeasonalOffset(){let t=this._monthOverride??new Date().getMonth(),a=this._getHemisphere()==="south"?(t+6)%12:t;return a>=2&&a<=4?5:a>=5&&a<=7?10:a>=8&&a<=10?-5:-10},_startLoop(){this._timer||(this._timer=setInterval(()=>this._update(),vt))},_stopLoop(){this._timer&&clearInterval(this._timer),this._timer=null}};var ae=null;function Ue(){return"0.6.2-ea68a9b8b"}function St(){let t=document.querySelectorAll('script[src*="vanilla-breeze"]'),e="/cdn/sw.js";for(let a of t){let s=a.getAttribute("src");if(s){let r=s.lastIndexOf("/");if(r!==-1){e=s.slice(0,r)+"/sw.js";break}}}return e}function ze(){return ae||(ae=navigator.serviceWorker?.ready??Promise.reject(new Error("SW not supported"))),ae}function Ke(t){return new Promise((e,a)=>{navigator.serviceWorker?.controller?Ne(navigator.serviceWorker.controller,t,e,a):ze().then(s=>{let r=s.active||s.waiting||s.installing;r?Ne(r,t,e,a):a(new Error("No active service worker"))}).catch(a)})}function Ne(t,e,a,s){let r=new MessageChannel;r.port1.onmessage=n=>a(n.data),r.port1.onmessageerror=()=>s(new Error("Message error")),t.postMessage({type:e},[r.port2]),setTimeout(()=>s(new Error("SW message timeout")),5e3)}async function Ye(){return Ke("GET_STATUS")}async function Je(){return Ke("CLEAR_CACHE")}async function Xe(){let t=await ze();return await t.update(),{updated:!!t.waiting}}function kt(){return typeof window>"u"||!("serviceWorker"in navigator)?!1:window.__VB_SERVICE_WORKER?!0:document.querySelector('meta[name="vb-service-worker"]')?.content==="true"}if(kt()){let t=St();window.addEventListener("load",()=>{ae=navigator.serviceWorker.register(t).catch(e=>{console.warn("[VB] Service worker registration failed:",e)})})}var z="data-char-shortcuts",Et="vb:char-shortcuts-change",_t="vb:settings:extensions";function K(){return typeof document>"u"?!0:document.documentElement.getAttribute(z)!=="off"}function Qe(t){let e=document.documentElement,a=K();t?e.removeAttribute(z):e.setAttribute(z,"off"),a!==!!t&&window.dispatchEvent(new CustomEvent(Et,{detail:{enabled:!!t}}))}function xt(){try{let t=globalThis.localStorage?.getItem(_t);if(!t)return null;let e=JSON.parse(t)?.data?.charShortcuts;return typeof e=="boolean"?e:null}catch{return null}}var Ze=!0;function et(){return Ze}if(typeof document<"u"){let t=xt();t===null&&(Ze=K()),t===!1?document.documentElement.setAttribute(z,"off"):t===!0&&document.documentElement.removeAttribute(z)}var j=null,k="settings",ne={motionFx:!0,sounds:!1,charShortcuts:!0},ye=()=>({...ne,charShortcuts:K()}),Tt=document.documentElement.hasAttribute("data-sticky"),be=null,Ft={trigger:"Site settings",dialog:"Site settings",title:"Settings",close:"Close settings",appearance:"Appearance","color-mode":"Color mode","mode-auto":"Auto","mode-light":"Light","mode-dark":"Dark",theme:"Theme",accessibility:"Accessibility","high-contrast":"High Contrast","large-text":"Large Text",dyslexia:"Dyslexia-Friendly","char-shortcuts":"Single-Key Shortcuts",layout:"Layout",fluid:"Fluid Scaling",density:"Density","density-compact":"Compact","density-default":"Default","density-spacious":"Spacious",backdrop:"Canvas Backdrop","backdrop-style":"Style","backdrop-default":"Default","backdrop-flush":"Flush","backdrop-elevated":"Elevated",chrome:"Chrome","chrome-card":"Card","chrome-stretch":"Stretch","chrome-integrated":"Integrated","fixed-header":"Fixed Header","page-bg":"Page Background","page-bg-default":"Theme Default","page-bg-color":"Solid Color","page-bg-gradient":"Gradient","bg-color":"Color","grad-start":"Start","grad-end":"End","grad-direction":"Direction","dir-to-bottom":"Top \u2192 Bottom","dir-to-right":"Left \u2192 Right","dir-135deg":"Diagonal \u2198","dir-45deg":"Diagonal \u2197",sticky:"Sticky Navigation",effects:"Effects",motion:"Motion Effects",sounds:"Sound Effects",environment:"Environment","time-of-day":"Time-of-Day Shifts",seasonal:"Seasonal Tinting",system:"System","sw-label":"Service Worker:","sw-checking":"checking\u2026","sw-unsupported":"Not supported","sw-active":"Active ({n} cached files)","sw-unregistered":"Not registered","clear-cache":"Clear Cache",clearing:"Clearing\u2026",cleared:"Cache cleared","check-update":"Check for Updates",checking:"Checking\u2026","update-available":"Update available","up-to-date":"Up to date",failed:"Failed",reset:"Reset to Defaults","reset-confirm":"Reset all settings to defaults?","reset-yes":"Reset","reset-cancel":"Cancel","reset-done":"Settings reset to defaults"},Mt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>';function D(t){return String(t).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}async function we(t){let e=document.documentElement;t?e.dataset.sticky="":delete e.dataset.sticky;try{let a=await Promise.resolve().then(()=>(rt(),st));t?a.initStickyManager():a.destroyStickyManager()}catch{}}var ve=class extends Y{#a=null;#t=null;#s=!1;#u=!1;#d=0;#f="";#l=new Set;#p=[];#r=[];#n={...ne,charShortcuts:K()};#o=document.documentElement.hasAttribute("data-sticky");setup(){let e=++this.#d;return this.#f||=crypto.randomUUID().slice(0,8),this.#H(),this.#q(),this.#c(),this.listen(window,"vb:theme-change",this.#k),this.listen(window,"vb:extensions-change",this.#k),this.listen(window,"vb:a11y-themes-change",this.#k),this.#u&&(this.#u=!1,this.open()),this.#x().then(()=>{this.#h(e)&&this.#c()}),!0}teardown(){this.#d++;for(let e of this.#p)clearTimeout(e);this.#p=[],this.#s=!1,this.removeAttribute("open"),this.#a?.setAttribute("aria-expanded","false"),this.#t?.remove(),this.#t=null}#h(e){return e===this.#d&&this.isConnected}#i(e,a={}){let s=this.getAttribute(`data-label-${e}`)??Ft[e]??e;for(let[r,n]of Object.entries(a))s=s.replaceAll(`{${r}}`,String(n));return s}#V(e){return D(this.#i(e))}get data(){return{a11yThemes:[...this.#r],extensions:{...this.#n},sticky:this.#o}}set data(e){if(!e||typeof e!="object")return;let a=[],s=[];Array.isArray(e.a11yThemes)&&(this.#r=e.a11yThemes.map(String),s.push("a11y"),a.push(u.set(k,"a11y",this.#r)),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[...this.#r]}))),e.extensions&&typeof e.extensions=="object"&&(this.#n={...ye(),...e.extensions},s.push("extensions"),a.push(u.set(k,"extensions",this.#n)),this.#_()),e.sticky!=null&&(this.#o=!!e.sticky,s.push("sticky"),a.push(u.set(k,"sticky",this.#o?"on":"off")),we(this.#o));for(let r of s)this.#l.add(r);this.#t&&this.#c(),Promise.allSettled(a).then(()=>{for(let r of s)this.#l.delete(r);this.#t&&this.#c(),this.dispatchEvent(new CustomEvent("settings-panel:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0}))})}async#x(){let[e,a,s]=await Promise.all([u.get(k,"a11y"),u.get(k,"extensions"),u.get(k,"sticky")]);be===null&&(be=Tt&&s!=="on"),this.#l.has("a11y")||(this.#r=Array.isArray(e)?e:[]),this.#l.has("extensions")||(this.#n={...ye(),...a??{}}),this.#l.has("sticky")||(this.#o=document.documentElement.hasAttribute("data-sticky"))}#A(e){return e!==""&&e!==void 0}#y(e){return e==="compact"?"compact":e==="spacious"?"spacious":"default"}#C(e,a){return e?a==="compact"?"compact":a==="spacious"?"spacious":"default":""}#B(e){return e!==""&&e!==void 0}#b(e){return e==="flush"?"flush":e==="elevated"?"elevated":"default"}#$(e,a){return e?a==="flush"?"flush":a==="elevated"?"elevated":"default":""}#w(e){if(!e)return"card";let a=e.split(/\s+/);for(let s of a)if(s==="stretch"||s==="integrated")return s;return"card"}#v(e){return e?e.split(/\s+/).includes("fixed"):!1}#T(e,a){let s=[];return e&&e!=="card"&&s.push(e),a&&s.push("fixed"),s.join(" ")||"card"}#e(e){return this.#t?.querySelector(e)??null}#H(){this.#a=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#a||(this.#a=document.createElement("button"),this.#a.setAttribute("type","button"),this.#a.setAttribute("data-trigger",""),this.#a.setAttribute("data-minted",""),this.#a.className="settings-trigger",this.#a.innerHTML=Mt,this.prepend(this.#a)),this.#a.hasAttribute("data-minted")&&this.#a.setAttribute("aria-label",this.#i("trigger")),this.#a.setAttribute("aria-haspopup","dialog"),this.#a.setAttribute("aria-expanded","false"),this.#t=document.createElement("div"),this.#t.className="settings-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label",this.#i("dialog")),this.#t.tabIndex=-1;let e=`settings-panel-${this.#f}`;this.#t.id=e,this.#a.setAttribute("aria-controls",e),this.#t.innerHTML=this.#I(),this.appendChild(this.#t)}#I(){let{mode:e,brand:a,fluid:s,backdrop:r,backdropChrome:n,pageBgType:i,pageBgColor:f,pageBgGradStart:w,pageBgGradEnd:E,pageBgGradDir:_}=m.getState(),T=[...this.#r],p={...this.#n},y=q.load(),x=this.#A(s),A=this.#y(s),b=this.#B(r),C=this.#b(r),c=this.#f,o=d=>this.#V(d),B=(d,l,v,ct,dt,Se={})=>`
1
+ var lt=Object.defineProperty;var ke=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ee=(t,e)=>{for(var a in e)lt(t,a,{get:e[a],enumerable:!0})};var st={};Ee(st,{destroyStickyManager:()=>Bt,findBannerHeader:()=>tt,initStickyManager:()=>At});function tt(){for(let t of document.querySelectorAll("header"))if(!t.parentElement?.closest(xt))return t;return null}function O(){let t=document.documentElement;if(!t.hasAttribute("data-sticky"))return;let e=tt();e&&!e.hasAttribute("data-sticky")&&(e.dataset.sticky="",me.add(e)),e&&re&&!fe.has(e)&&(re.observe(e),fe.add(e));let a=e?.hasAttribute("data-sticky")&&getComputedStyle(e).position!=="static",s=e&&a?e.getBoundingClientRect().height:0;t.style.setProperty("--sticky-offset",`${s}px`)}function at(){O()}function At(){if(se){O();return}se=!0,re=new ResizeObserver(O),fe=new WeakSet,O(),requestAnimationFrame(O),document.fonts?.ready?.then(O),window.addEventListener("resize",O,{passive:!0}),document.addEventListener("toggle",at,!0)}function Bt(){if(se){se=!1,window.removeEventListener("resize",O),document.removeEventListener("toggle",at,!0),re?.disconnect();for(let t of me)delete t.dataset.sticky;me.clear(),document.documentElement.style.removeProperty("--sticky-offset")}}var se,re,me,fe,xt,rt=ke(()=>{se=!1,me=new Set,fe=new WeakSet,xt='article, aside, main, nav, section, [role="article"], [role="complementary"], [role="main"], [role="navigation"], [role="region"]'});var it={};Ee(it,{SoundManager:()=>$t});var nt,pe,$t,ot=ke(()=>{nt="vb-sound",pe={enabled:!1,volume:.5},$t={_ctx:null,_enabled:!1,_volume:.5,_initialized:!1,init(){if(this._initialized)return this;let t=this._load();return this._enabled=t.enabled,this._volume=t.volume,this._initialized=!0,this},_getContext(){return this._ctx||(this._ctx=new(window.AudioContext||window.webkitAudioContext)),this._ctx.state==="suspended"&&this._ctx.resume(),this._ctx},_load(){try{let t=localStorage.getItem(nt);return t?{...pe,...JSON.parse(t)}:{...pe}}catch{return{...pe}}},_save(t){try{let e=this._load();localStorage.setItem(nt,JSON.stringify({...e,...t}))}catch{}},_playTone(t,e,a="sine"){if(!this._enabled)return;let s=this._getContext(),r=s.createOscillator(),n=s.createGain();r.connect(n),n.connect(s.destination),r.frequency.value=t,r.type=a,n.gain.value=this._volume*.3,r.start(),n.gain.exponentialRampToValueAtTime(.01,s.currentTime+e),r.stop(s.currentTime+e)},enable(){this._enabled=!0,this._save({enabled:!0}),this.play("click")},disable(){this._enabled=!1,this._save({enabled:!1})},toggle(){return this._enabled?this.disable():this.enable(),this._enabled},isEnabled(){return this._enabled},setVolume(t){this._volume=Math.max(0,Math.min(1,t)),this._save({volume:this._volume})},getVolume(){return this._volume},play(t){if(this._enabled)switch(t){case"click":this._playTone(800,.1);break;case"success":this._playTone(523,.1),setTimeout(()=>this._playTone(659,.1),100),setTimeout(()=>this._playTone(784,.15),200);break;case"error":this._playTone(200,.15,"sawtooth"),setTimeout(()=>this._playTone(180,.2,"sawtooth"),150);break;case"notification":this._playTone(880,.1),setTimeout(()=>this._playTone(1100,.15),100);break;case"soft":this._playTone(600,.05);break;case"tick":this._playTone(1200,.02,"square");break}},getState(){return{enabled:this._enabled,volume:this._volume}}}});var R=new Map,ie=new Map;var _e=null;function Ce(){if(typeof window<"u"&&window.__VB_THEME_BASE)return String(window.__VB_THEME_BASE).replace(/\/$/,"");if(_e)return _e;if(typeof document<"u"){let t=document.querySelectorAll('script[src*="vanilla-breeze"]');for(let e of t){let a=e.getAttribute("src");if(a){let s=a.lastIndexOf("/");if(s!==-1)return a.slice(0,s)}}}return"/cdn"}var ht=new Set(["default","a11y-high-contrast","a11y-large-text","a11y-dyslexia","modern","minimal","classic"]),ut=new Set(["kawaii","memphis"]);function xe(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):String(t).replace(/["\\]/g,"\\$&")}function Ae(t){document.querySelectorAll(`link[data-vb-theme-preload="${xe(t)}"]`).forEach(e=>e.remove())}function oe(t){return ut.has(t)}function gt(t,e){return`${e}/themes/${t}.css`}function Be(t,e){if(!oe(t))return Promise.resolve();if(ie.has(t))return ie.get(t);let a=import(`${e}/packs/${t}.full.js`).catch(()=>{});return ie.set(t,a),a}function mt(t,e){let a=Ce(),s=()=>{(oe(e)||t.hasAttribute("data-vb-pack"))&&Be(e,a)};return t.getAttribute("data-vb-theme-state")==="error"?Promise.reject(new Error(`Failed to load theme: ${e}`)):t.getAttribute("data-vb-theme-state")==="ready"||t.sheet?(s(),Promise.resolve()):new Promise((r,n)=>{let i=()=>{t.setAttribute("data-vb-theme-state","ready"),w(),s(),r(void 0)},f=()=>{t.setAttribute("data-vb-theme-state","error"),R.delete(e),w(),n(new Error(`Failed to load theme: ${e}`))},w=()=>{t.removeEventListener("load",i),t.removeEventListener("error",f)};t.addEventListener("load",i,{once:!0}),t.addEventListener("error",f,{once:!0})})}async function N(t){if(!t||ht.has(t))return;if(R.has(t))return R.get(t);if(typeof document<"u"){let s=document.querySelector(`link[data-vb-theme="${xe(t)}"]`);if(s){let r=mt(s,t);return R.set(t,r),r}}let e=Ce(),a=oe(t)?pt(t,e):ft(t,e);return R.set(t,a),a}async function ft(t,e){let a=gt(t,e);return new Promise((s,r)=>{Ae(t);let n=document.createElement("link");n.rel="stylesheet",n.href=a,n.setAttribute("data-vb-theme",t),n.setAttribute("data-vb-theme-state","loading"),n.onload=()=>{n.setAttribute("data-vb-theme-state","ready"),s()},n.onerror=()=>{n.setAttribute("data-vb-theme-state","error"),n.remove(),R.delete(t),r(new Error(`Failed to load theme: ${t}`))},document.head.appendChild(n)})}function pt(t,e){let a=`${e}/packs/${t}.theme.css`,s=`${e}/packs/${t}.effects.css`;return new Promise((r,n)=>{Ae(t);let i=document.createElement("link");i.rel="stylesheet",i.href=a,i.setAttribute("data-vb-theme",t),i.setAttribute("data-vb-pack",t),i.setAttribute("data-vb-theme-state","loading"),i.onload=()=>{i.setAttribute("data-vb-theme-state","ready");let f=document.createElement("link");f.rel="stylesheet",f.href=s,f.setAttribute("data-vb-pack-effects",t),document.head.appendChild(f),Be(t,e),r()},i.onerror=()=>{i.setAttribute("data-vb-theme-state","error"),i.remove(),R.delete(t),n(new Error(`Failed to load pack: ${t}`))},document.head.appendChild(i)})}var Lt=window.matchMedia("(prefers-reduced-motion: reduce)");var $e=new Map;function Te(t,e,a={}){let s=a.priority??10,r={impl:e,bundle:a.bundle,contract:a.contract,priority:s},n=$e.get(t);if(customElements.get(t)){if(!n||n.priority>=s){n&&n.priority===s&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${a.bundle}".`);return}console.warn(`[VB Bundle] Tag <${t}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${a.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=s){n.priority===s&&console.warn(`[VB Bundle] Tag <${t}> already registered by "${n.bundle}". Skipping "${a.bundle}" (first wins at equal priority).`);return}$e.set(t,r),customElements.define(t,e)}var Y=class extends HTMLElement{#a=[];#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 e of this.#a)e();this.#a=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,a,s,r){e.addEventListener(a,s,r),this.#a.push(()=>e.removeEventListener(a,s,r))}_reinit(){for(let e of this.#a)e();this.#a=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,a){this.#t||(this.#t=this.attachInternals());let s=this.#t.states;try{a?s.add(e):s.delete(e)}catch{let r=`--${e}`;a?s.add(r):s.delete(r)}}_adoptInternals(e){this.#t||(this.#t=e)}#s(){return this.constructor.formAssociated&&this.#t?this.#t: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}};var Fe=[{id:"default",name:"Default",swatchBg:"#3b82f6",seeds:{}},{id:"ocean",name:"Ocean",swatchBg:"#0891b2",seeds:{"--hue-primary":200,"--hue-secondary":180,"--hue-accent":45,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"45%","--chroma-secondary":.1,"--lightness-accent":"70%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"forest",name:"Forest",swatchBg:"#059669",seeds:{"--hue-primary":145,"--hue-secondary":90,"--hue-accent":30,"--lightness-primary":"45%","--chroma-primary":.15,"--lightness-secondary":"55%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"58%","--chroma-primary":.12}},{id:"sunset",name:"Sunset",swatchBg:"#ea580c",seeds:{"--hue-primary":25,"--hue-secondary":0,"--hue-accent":280,"--lightness-primary":"57%","--chroma-primary":.2,"--lightness-secondary":"55%","--chroma-secondary":.18,"--lightness-accent":"55%","--chroma-accent":.18},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.16}},{id:"rose",name:"Rose",swatchBg:"#e11d48",seeds:{"--hue-primary":350,"--hue-secondary":330,"--hue-accent":200,"--lightness-primary":"55%","--chroma-primary":.18,"--lightness-secondary":"50%","--chroma-secondary":.14,"--lightness-accent":"60%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.14}},{id:"lavender",name:"Lavender",swatchBg:"#a855f7",seeds:{"--hue-primary":280,"--hue-secondary":300,"--hue-accent":60,"--lightness-primary":"55%","--chroma-primary":.14,"--lightness-secondary":"50%","--chroma-secondary":.12,"--lightness-accent":"70%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.12}},{id:"coral",name:"Coral",swatchBg:"#f97316",seeds:{"--hue-primary":15,"--hue-secondary":25,"--hue-accent":180,"--lightness-primary":"57%","--chroma-primary":.18,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"55%","--chroma-accent":.12},seedsDark:{"--lightness-primary":"65%","--chroma-primary":.15}},{id:"slate",name:"Slate",swatchBg:"#64748b",seeds:{"--hue-primary":220,"--hue-secondary":210,"--hue-accent":45,"--lightness-primary":"48%","--chroma-primary":.1,"--lightness-secondary":"45%","--chroma-secondary":.06,"--lightness-accent":"68%","--chroma-accent":.15},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.08}},{id:"emerald",name:"Emerald",swatchBg:"#10b981",seeds:{"--hue-primary":160,"--hue-secondary":140,"--hue-accent":30,"--lightness-primary":"50%","--chroma-primary":.15,"--lightness-secondary":"48%","--chroma-secondary":.12,"--lightness-accent":"65%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"60%","--chroma-primary":.12}},{id:"amber",name:"Amber",swatchBg:"#f59e0b",seeds:{"--hue-primary":45,"--hue-secondary":30,"--hue-accent":240,"--lightness-primary":"56%","--chroma-primary":.16,"--lightness-secondary":"55%","--chroma-secondary":.15,"--lightness-accent":"52%","--chroma-accent":.14},seedsDark:{"--lightness-primary":"68%","--chroma-primary":.14}},{id:"indigo",name:"Indigo",swatchBg:"#6366f1",seeds:{"--hue-primary":250,"--hue-secondary":270,"--hue-accent":35,"--lightness-primary":"48%","--chroma-primary":.18,"--lightness-secondary":"45%","--chroma-secondary":.14,"--lightness-accent":"68%","--chroma-accent":.16},seedsDark:{"--lightness-primary":"62%","--chroma-primary":.14}}],Pe=[{id:"default",name:"Default",hue:210,shape:"balanced",character:"The default",swatchBg:"#3b82f6",tier:"core"},{id:"modern",name:"Modern",hue:270,shape:"rounded",character:"Vibrant & elevated",swatchBg:"#6366f1",tier:"core"},{id:"minimal",name:"Minimal",hue:240,shape:"sharp",character:"Clean & flat",swatchBg:"#71717a",tier:"core"},{id:"classic",name:"Classic",hue:220,shape:"subtle",character:"Serif & elegant",swatchBg:"#92400e",tier:"core"}],ce=[{id:"swiss",name:"Swiss",icon:"grid-3x3",character:"Precision grid",swatchBg:"#ff3e00",swatchFg:"white",tier:"showcase",category:"Design"},{id:"brutalist",name:"Brutalist",icon:"square",character:"Raw, industrial",swatchBg:"#1a1a1a",swatchFg:"#f5f5f5",tier:"showcase",category:"Design"},{id:"art-deco",name:"Art Deco",icon:"crown",character:"1920s luxury",swatchBg:"#1A1A1A",swatchFg:"#C9A84C",tier:"showcase",category:"Design"},{id:"editorial",name:"Editorial",icon:"newspaper",character:"Magazine elegance",swatchBg:"#1a1a1a",swatchFg:"#c9a227",tier:"showcase",category:"Content"},{id:"genai",name:"GenAI",icon:"sparkles",character:"AI aesthetic",swatchBg:"#1a0a2e",swatchFg:"#a855f7",tier:"showcase",category:"Modern"},{id:"glassmorphism",name:"Glass",icon:"glass-water",character:"Frosted surfaces",swatchBg:"#667eea",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"startup",name:"Startup",icon:"rocket",character:"SaaS energy",swatchBg:"#4f46e5",swatchFg:"#ffffff",tier:"showcase",category:"Modern"},{id:"organic",name:"Organic",icon:"leaf",character:"Natural, handcrafted",swatchBg:"#2d5016",swatchFg:"#faf5e6",tier:"showcase",category:"Creative"},{id:"rough",name:"Rough",icon:"pencil",character:"Hand-drawn sketch",swatchBg:"#f5f0e8",swatchFg:"#3a3a3a",tier:"showcase",category:"Creative"},{id:"cyber",name:"Cyber",icon:"zap",character:"Neon futuristic",swatchBg:"#0a0a1a",swatchFg:"#00ff88",tier:"showcase",category:"Creative"},{id:"journal",name:"Journal",icon:"notebook-pen",character:"Dot-grid bullet journal",swatchBg:"#f3ecdc",swatchFg:"#27313f",tier:"showcase",category:"Creative"},{id:"vaporwave",name:"Vaporwave",icon:"radio",character:"Neon dreamy",swatchBg:"#2b0040",swatchFg:"#ff6ad5",tier:"showcase",category:"Aesthetic"},{id:"neumorphism",name:"Neumorph",icon:"circle",character:"Soft embossed",swatchBg:"#e0e0e0",swatchFg:"#a0a0a0",tier:"showcase",category:"Aesthetic"},{id:"bauhaus",name:"Bauhaus",icon:"shapes",character:"Geometric",swatchBg:"#F1FAEE",swatchFg:"#E63946",tier:"showcase",category:"Aesthetic"},{id:"claymorphism",name:"Clay",icon:"circle-dot",character:"Puffy 3D",swatchBg:"#f0f0f5",swatchFg:"#FF6B9D",tier:"showcase",category:"Aesthetic"},{id:"alpha1999",name:"Alpha1999",icon:"orbit",character:"Space retro-fi",swatchBg:"#0a0a14",swatchFg:"#d4880f",tier:"showcase",category:"Signature"},{id:"super2026",name:"Super2026",icon:"triangle",character:"Supergraphic bold",swatchBg:"#f5f0e6",swatchFg:"#c23616",tier:"showcase",category:"Signature"},{id:"magna",name:"Magna",icon:"orbit",character:"Odyssey 2 retro",swatchBg:"#0d0b14",swatchFg:"#f97316",tier:"showcase",category:"Signature"},{id:"win9x",name:"Win9x",icon:"monitor",character:"Classic desktop",swatchBg:"#008080",swatchFg:"#c0c0c0",tier:"showcase",category:"OS Styles"},{id:"nes",name:"NES",icon:"joystick",character:"Console pixels",swatchBg:"#bcbcbc",swatchFg:"#e40521",tier:"showcase",category:"OS Styles"},{id:"8bit",name:"8-Bit",icon:"gamepad-2",character:"Retro pixel art",swatchBg:"#000080",swatchFg:"#ffff00",tier:"showcase",category:"OS Styles"}],de=[{id:"nord",name:"Nord",icon:"snowflake",character:"Arctic calm",swatchBg:"#2E3440",swatchFg:"#81A1C1",tier:"community",category:"Editor Palettes"},{id:"solarized",name:"Solarized",icon:"sun-dim",character:"Engineered precision",swatchBg:"#002B36",swatchFg:"#268BD2",tier:"community",category:"Editor Palettes"},{id:"dracula",name:"Dracula",icon:"moon-star",character:"Dark elegance",swatchBg:"#282A36",swatchFg:"#BD93F9",tier:"community",category:"Editor Palettes"},{id:"catppuccin-mocha",name:"Catppuccin",icon:"coffee",character:"Warm pastels",swatchBg:"#1E1E2E",swatchFg:"#CBA6F7",tier:"community",category:"Editor Palettes"},{id:"catppuccin-latte",name:"Ctp Latte",icon:"coffee",character:"Cozy daytime",swatchBg:"#eff1f5",swatchFg:"#8839ef",tier:"community",category:"Editor Palettes"},{id:"catppuccin-frappe",name:"Ctp Frapp\xE9",icon:"coffee",character:"Cool twilight",swatchBg:"#303446",swatchFg:"#ca9ee6",tier:"community",category:"Editor Palettes"},{id:"catppuccin-macchiato",name:"Ctp Macchiato",icon:"coffee",character:"Deep blue",swatchBg:"#24273a",swatchFg:"#c6a0f6",tier:"community",category:"Editor Palettes"},{id:"gruvbox",name:"Gruvbox",icon:"palette",character:"Retro warmth",swatchBg:"#282828",swatchFg:"#ebdbb2",tier:"community",category:"Editor Palettes"},{id:"tokyo-night",name:"Tokyo Night",icon:"moon",character:"Night-owl vibes",swatchBg:"#1a1b26",swatchFg:"#7aa2f7",tier:"community",category:"Editor Palettes"},{id:"rose-pine",name:"Ros\xE9 Pine",icon:"flower-2",character:"Muted elegance",swatchBg:"#191724",swatchFg:"#ebbcba",tier:"community",category:"Editor Palettes"},{id:"cottagecore",name:"Cottagecore",icon:"flower-2",character:"Pastoral",swatchBg:"#fdf8f0",swatchFg:"#7d8c6d",tier:"community",category:"Niche"},{id:"terminal",name:"Terminal",icon:"terminal",character:"Retro CRT",swatchBg:"#0d1117",swatchFg:"#00ff00",tier:"community",category:"Niche"},{id:"clinical",name:"Clinical",icon:"heart-pulse",character:"Sterile precision",swatchBg:"#ffffff",swatchFg:"#0077b6",tier:"community",category:"Industry"},{id:"financial",name:"Financial",icon:"landmark",character:"Navy + gold",swatchBg:"#1b2a4a",swatchFg:"#c9a84c",tier:"community",category:"Industry"},{id:"government",name:"Government",icon:"shield",character:"Official",swatchBg:"#002868",swatchFg:"#bf0a30",tier:"community",category:"Industry"},{id:"dawn",name:"Dawn",icon:"sunrise",character:"Golden morning",swatchBg:"#fef3e2",swatchFg:"#d4a574",tier:"community",category:"Mood/Time"},{id:"dusk",name:"Dusk",icon:"sunset",character:"Twilight",swatchBg:"#1a1b2e",swatchFg:"#e5a858",tier:"community",category:"Mood/Time"},{id:"midnight",name:"Midnight",icon:"moon",character:"Deep night",swatchBg:"#0d1117",swatchFg:"#58a6ff",tier:"community",category:"Mood/Time"},{id:"high-noon",name:"High Noon",icon:"sun",character:"Maximum bright",swatchBg:"#ffffff",swatchFg:"#e63946",tier:"community",category:"Mood/Time"}],Me=[{id:"kawaii",name:"Kawaii",icon:"heart",character:"Cute aesthetic",swatchBg:"#ffb7c5",swatchFg:"#ff69b4",tier:"showcase",category:"Packs"},{id:"memphis",name:"Memphis",icon:"star",character:"Bold patterns",swatchBg:"#FFF8F0",swatchFg:"#d03040",tier:"showcase",category:"Packs"}];var It=[...ce,...de],qt=[...Pe,...ce,...de,...Me],L=t=>ce.filter(e=>e.category===t),Oe=[{label:"Style",themes:Pe,tier:"core"},{label:"Design",themes:L("Design"),tier:"showcase"},{label:"Content",themes:L("Content"),tier:"showcase"},{label:"Modern",themes:L("Modern"),tier:"showcase"},{label:"Creative",themes:L("Creative"),tier:"showcase"},{label:"Aesthetic",themes:L("Aesthetic"),tier:"showcase"},{label:"Signature",themes:L("Signature"),tier:"showcase"},{label:"OS Styles",themes:L("OS Styles"),tier:"showcase"},{label:"Packs",themes:Me,tier:"showcase"},{label:"More Themes",themes:de,tier:"community"}];function yt(){let t=globalThis.localStorage;if(!t)throw new Error("VBStore: localStorage is not available in this environment");return{async getRaw(e){return t.getItem(e)},async setRaw(e,a){t.setItem(e,a)},async removeRaw(e){t.removeItem(e)},async keys(e){let a=[];for(let s=0;s<t.length;s++){let r=t.key(s);r&&r.startsWith(e)&&a.push(r)}return a}}}var J="__vbStoreBackend",X=globalThis;function F(){return X[J]||(X[J]=yt()),X[J]}function le(t,e){if(typeof t!="string"||!t)throw new TypeError("VBStore: namespace must be a non-empty string");if(typeof e!="string"||!e)throw new TypeError("VBStore: key must be a non-empty string");return`vb:${t}:${e}`}function De(t){if(typeof t!="string"||!t)throw new TypeError("VBStore: namespace must be a non-empty string");return`vb:${t}:`}function Re(t){try{let e=JSON.parse(t);if(e&&typeof e=="object"&&typeof e.timestamp=="number")return e}catch{}return null}var u={configure(t={}){X[J]=t.backend??null},async set(t,e,a){let s={data:a,timestamp:Date.now()};await F().setRaw(le(t,e),JSON.stringify(s))},async get(t,e,a){let s=await F().getRaw(le(t,e));if(s==null)return null;let r=Re(s);return!r||a?.maxAge!=null&&Date.now()-r.timestamp>a.maxAge?null:r.data},async remove(t,e){await F().removeRaw(le(t,e))},async list(t){let e=De(t),a=await F().keys(e),s=[];for(let r of a){let n=await F().getRaw(r);if(n==null)continue;let i=Re(n);i&&s.push({key:r.slice(e.length),data:i.data,timestamp:i.timestamp})}return s},async clear(t){let e=De(t),a=await F().keys(e);for(let s of a)await F().removeRaw(s)},async clearAll(){let t=await F().keys("vb:");for(let e of t)await F().removeRaw(e)},async setMany(t,e){for(let[a,s]of e)await u.set(t,a,s)}};if(typeof window<"u"){let t=window.VB??(window.VB={});t.store??=u}var Q="theme",Z="current",je=2,te={accent:"data-accent",borderStyle:"data-border-style",iconSet:"data-icon-set",fluid:"data-fluid",backdrop:"data-backdrop",backdropChrome:"data-backdrop-chrome"},S={mode:"auto",brand:"default",accent:null,borderStyle:null,iconSet:null,fluid:null,backdrop:null,backdropChrome:null,pageBgType:"",pageBgColor:"",pageBgGradStart:"",pageBgGradEnd:"",pageBgGradDir:""};function Le(t){if(!t||typeof t!="object")return null;let e={...t};if(!(Number(e.v)>=je))for(let a of Object.keys(te))(e[a]===""||a==="accent"&&e[a]==="default")&&(e[a]=null);return e}function P(t,e){return t??e??""}var he=null;function $(){if(he)return he;let t=document.documentElement,e=window.__vbAuthoredRoot,a=r=>{if(e&&typeof e=="object"){if(r in e)return e[r]??null;if(r==="data-mode")return null}return t.getAttribute(r)},s={theme:a("data-theme"),mode:a("data-mode"),themeSource:a("data-theme-source")};for(let[r,n]of Object.entries(te))s[r]=a(n);return he=s,s}function bt(t){try{let e=document.createElement("canvas");e.width=e.height=1;let a=e.getContext("2d",{willReadFrequently:!0});if(!a)return t;a.fillStyle=t,a.fillRect(0,0,1,1);let[s,r,n]=a.getImageData(0,0,1,1).data;return"#"+[s,r,n].map(i=>i.toString(16).padStart(2,"0")).join("")}catch{return t}}function ee(t,e){let a=(t||"").split(/\s+/).filter(Boolean);return e==="site"?a[0]&&!a[0].startsWith("a11y-")?a[0]:"":a.find(s=>!s.startsWith("a11y-"))||""}function wt(t,e,a,s=!1){let r=(t||"").split(/\s+/).filter(n=>n&&n!==e&&n!==a);return a!=="default"?[a,...r].join(" "):(s&&r.length?["default",...r]:r).join(" ")}function Ve(t){return t==="light"||t==="dark"?t:null}function He(t,e,a){return e||(t==="light"||t==="dark"?t:a?"dark":"light")}function Ie(t,e,a){let s=ee(e,a);return a==="site"&&s?s:t?.brand&&t.brand!==S.brand?t.brand:s||S.brand}var qe=["--hue-primary","--hue-secondary","--hue-accent","--lightness-primary","--chroma-primary","--lightness-secondary","--chroma-secondary","--lightness-accent","--chroma-accent"],h=null,U="",ue="",I=null,V=null,m={_initPromise:null,async init(){return this._initPromise?this._initPromise:(this._initPromise=(async()=>{let t=Le(await u.get(Q,Z));h=t?{...S,...t}:{...S},V=$().themeSource??null,U=ee($().theme??"",V),ue=ee(document.documentElement.dataset.theme||"",V),I=Ve($().mode),h.brand=Ie(t,$().theme??"",V);try{await N(h.brand)}catch{h.brand!==U&&(h.brand=U||S.brand)}return this.apply(h),this._watchSystemPreference(),this._watchRootAttributes(),this._watchCrossDocumentStorage(),h})(),this._initPromise)},_watchCrossDocumentStorage(){typeof window>"u"||window.addEventListener("storage",async t=>{if(t.key!==`vb:${Q}:${Z}`||!t.newValue)return;let e;try{let s=JSON.parse(t.newValue);e=Le(s?.data)}catch{return}if(!e)return;let a={...S,...h,...e};if(a.brand=Ie(e,$().theme??"",V),a.brand&&a.brand!==h?.brand)try{await N(a.brand)}catch{a.brand=U||S.brand}h=a,this.apply(h||{})})},load(){return h?{...h}:{...S}},save(t){let e={...h??S,...t,v:je};return h=e,u.set(Q,Z,e).catch(()=>{}),e},apply({mode:t="auto",brand:e="default",borderStyle:a=null,iconSet:s=null,fluid:r=null,backdrop:n=null,backdropChrome:i=null,pageBgType:f="",pageBgColor:w="",pageBgGradStart:E="",pageBgGradEnd:_="",pageBgGradDir:T=""}={}){let p=document.documentElement,y=$(),C=He(t,I,window.matchMedia("(prefers-color-scheme: dark)").matches);p.dataset.mode=C;let x=V==="site",b=wt(p.dataset.theme||"",ue,e,x);b?p.dataset.theme=b:delete p.dataset.theme,ue=e==="default"&&!b.startsWith("default")?"":e;let A=a||y.borderStyle||this._readCSSHint("--theme-border-style");this._setRootAttr("data-border-style",A&&A!=="clean"?A:"");let c=s||y.iconSet||this._readCSSHint("--theme-icon-set");this._setRootAttr("data-icon-set",c&&c!=="lucide"?c:"");let o=P(r,y.fluid);this._setRootAttr("data-fluid",o,!0);let B=P(n,y.backdrop);this._setRootAttr("data-backdrop",B,!0);let g=P(i,y.backdropChrome);if(this._setRootAttr("data-backdrop-chrome",g&&g!=="card"?g:""),f==="color"&&w)p.style.setProperty("--page-bg-color",w),p.style.removeProperty("--page-bg-gradient");else if(f==="gradient"&&E&&_){let d=T||"to bottom";p.style.setProperty("--page-bg-gradient",`linear-gradient(${d}, ${E}, ${_})`),p.style.removeProperty("--page-bg-color")}else p.style.removeProperty("--page-bg-color"),p.style.removeProperty("--page-bg-gradient");this._applyAccent(this.load().accent);let G=this.getState().accent;this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{mode:t,brand:e,accent:G,borderStyle:A,iconSet:c,fluid:o,backdrop:B,backdropChrome:g,pageBgType:f,effectiveMode:C}}))},_setRootAttr(t,e,a=!1){let s=document.documentElement;e?s.setAttribute(t,e):a&&this._authoredHas(t)?s.setAttribute(t,""):s.removeAttribute(t)},_authoredHas(t){let e=Object.keys(te).find(s=>te[s]===t);return e?this.load()[e]==null&&$()[e]!=null:!1},_syncThemeColor(){let t=document.querySelectorAll('meta[name="theme-color"]');if(!t.length)return;let e=r=>!r||r==="transparent"||/^rgba\(.*,\s*0\)$/.test(r),a=getComputedStyle(document.documentElement).backgroundColor;if(e(a)){let r=document.createElement("span");r.style.setProperty("position","absolute"),r.style.setProperty("background-color","var(--color-background)"),(document.body||document.documentElement).append(r),a=getComputedStyle(r).backgroundColor,r.remove()}if(e(a))return;let s=bt(a);t.forEach(r=>{r.removeAttribute("media"),r.setAttribute("content",s)})},setMode(t){I=null;let e=this.save({mode:t});this.apply(e)},async setBrand(t){try{await N(t)}catch(a){console.warn(`[VB] Theme "${t}" failed to load, using default`,a),t="default"}let e=this.save({brand:t});this.apply(e)},setAccent(t){this.save({accent:t}),this._applyAccent(t),this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}}))},setBorderStyle(t){let e=this.save({borderStyle:t});this.apply(e)},setIconSet(t){let e=this.save({iconSet:t});this.apply(e)},setFluid(t){let e=this.save({fluid:t});this.apply(e)},setBackdrop(t){let e=this.save({backdrop:t});this.apply(e)},setBackdropChrome(t){let e=this.save({backdropChrome:t});this.apply(e)},setPageBg({type:t="",color:e="",gradStart:a="",gradEnd:s="",gradDir:r=""}={}){let n=this.save({pageBgType:t,pageBgColor:e,pageBgGradStart:a,pageBgGradEnd:s,pageBgGradDir:r});this.apply(n)},getEffectiveMode(){let{mode:t}=this.load();return He(t,I,window.matchMedia("(prefers-color-scheme: dark)").matches)},getState(){let{mode:t,brand:e,accent:a,borderStyle:s,iconSet:r,fluid:n,backdrop:i,backdropChrome:f,pageBgType:w,pageBgColor:E,pageBgGradStart:_,pageBgGradEnd:T,pageBgGradDir:p}=this.load(),y=typeof document>"u"?{}:$(),C=(x,b)=>b==null&&y[x]===""?"default":P(b,y[x]);return{mode:t,brand:e,accent:P(a,y.accent)||"default",borderStyle:P(s,y.borderStyle),iconSet:P(r,y.iconSet),fluid:C("fluid",n),backdrop:C("backdrop",i),backdropChrome:P(f,y.backdropChrome),pageBgType:w,pageBgColor:E,pageBgGradStart:_,pageBgGradEnd:T,pageBgGradDir:p,effectiveMode:this.getEffectiveMode()}},toggleMode(){let e=this.getEffectiveMode()==="dark"?"light":"dark";this.setMode(e)},reset(){h={...S,brand:U||S.brand},I=Ve($().mode),u.remove(Q,Z).catch(()=>{});let t=document.documentElement;t.style.removeProperty("--page-bg-color"),t.style.removeProperty("--page-bg-gradient");for(let e of qe)t.style.removeProperty(e);this.apply(h)},_readCSSHint(t){return getComputedStyle(document.documentElement).getPropertyValue(t).trim()},_applyAccent(t){let e=document.documentElement;for(let s of qe)e.style.removeProperty(s);if(t==null){let s=$().accent;s?e.dataset.accent=s:delete e.dataset.accent;return}let a=Fe.find(s=>s.id===t);if(!a||!a.seeds||Object.keys(a.seeds).length===0){delete e.dataset.accent;return}e.dataset.accent=a.id},_watchRootAttributes(){this._rootObserver||(this._rootObserver=new MutationObserver(t=>{for(let e of t)e.attributeName==="data-theme"?this._syncFromDataTheme():e.attributeName==="data-mode"&&this._syncFromDataMode()}),this._rootObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-mode"]}))},_syncFromDataTheme(){if(!h)return;let t=document.documentElement.dataset.theme||"",e=t.split(/\s+/).filter(Boolean),a=ee(t,V)||"default";a!==h.brand&&(h.brand=a,N(a).catch(()=>{}),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_syncFromDataMode(){if(!h)return;let t=document.documentElement.dataset.mode||"auto",e=this.getEffectiveMode();t!==e&&(I=null,h.mode=t,this._syncThemeColor(),window.dispatchEvent(new CustomEvent("vb:theme-change",{detail:{...this.getState()}})))},_watchSystemPreference(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{let e=this.load();e.mode==="auto"&&this.apply(e)})}};if(typeof window<"u"){let t=window.VB??(window.VB={});t.themeManager??=m}var Ge="environment",We="preferences",ge={timeOfDay:!1,seasonal:!1},vt=900*1e3,M={...ge};function H(t,e,a){return t+(e-t)*Math.min(1,Math.max(0,a))}var q={_timer:null,_baseHues:null,_timeOverride:null,_monthOverride:null,async init(){let t=await u.get(Ge,We);M=t?{...ge,...t}:{...ge},(M.timeOfDay||M.seasonal)&&(this._captureBaseHues(),this._update(),this._startLoop()),window.addEventListener("vb:theme-change",()=>{this._hasActiveSource()&&requestAnimationFrame(()=>{this._captureBaseHues(),this._update()})})},load(){return{...M}},save(t){return M={...M,...t},u.set(Ge,We,M).catch(()=>{}),{...M}},setTimeOverride(t){this._timeOverride=t,this._hasActiveSource()&&this._update()},setMonthOverride(t){this._monthOverride=t,this._hasActiveSource()&&this._update()},setSource(t,e){let a=this.save({[t]:e});e?(this._captureBaseHues(),this._update(),this._startLoop()):this._hasActiveSource(a)?this._update():(this._clearModifiers(),this._stopLoop())},_hasActiveSource(t){let e=t||this.load();return e.timeOfDay||e.seasonal},_captureBaseHues(){let t=document.documentElement;t.style.removeProperty("--hue-primary"),t.style.removeProperty("--hue-secondary"),t.style.removeProperty("--hue-accent");let e=t.getAttribute("data-theme");if(e){let a=`[data-theme~="${e}"]`;for(let s of document.styleSheets)try{for(let r=0;r<s.cssRules.length;r++){let n=s.cssRules[r];if(n.selectorText?.includes(a)&&!n.selectorText.includes("dark")){let i=n.style?.getPropertyValue("--hue-primary");if(i){this._baseHues={primary:parseFloat(i)||260,secondary:parseFloat(n.style.getPropertyValue("--hue-secondary"))||200,accent:parseFloat(n.style.getPropertyValue("--hue-accent"))||30};return}}}}catch{}}this._baseHues={primary:260,secondary:200,accent:30}},_update(){let t=this.load(),e=0;t.timeOfDay&&(e+=this._getTimeOfDayOffset()),t.seasonal&&(e+=this._getSeasonalOffset());let a=document.documentElement;e!==0&&this._baseHues?(a.style.setProperty("--hue-primary",String(this._baseHues.primary+e)),a.style.setProperty("--hue-secondary",String(this._baseHues.secondary+e)),a.style.setProperty("--hue-accent",String(this._baseHues.accent+e*.5))):e===0&&this._clearModifiers()},_clearModifiers(){let t=document.documentElement;t.style.removeProperty("--hue-primary"),t.style.removeProperty("--hue-secondary"),t.style.removeProperty("--hue-accent")},_getTimeOfDayOffset(){let t=this._timeOverride??new Date().getHours()+new Date().getMinutes()/60;return t<5?-20:t<7?H(-20,20,(t-5)/2):t<10?H(20,5,(t-7)/3):t<14?H(5,0,(t-10)/4):t<17?H(0,-5,(t-14)/3):t<19?H(-5,15,(t-17)/2):t<21?H(15,-10,(t-19)/2):H(-10,-20,(t-21)/8)},_getHemisphere(){return window.__VB_ENV_LOCATION?.hemisphere||"north"},_getSeasonalOffset(){let t=this._monthOverride??new Date().getMonth(),a=this._getHemisphere()==="south"?(t+6)%12:t;return a>=2&&a<=4?5:a>=5&&a<=7?10:a>=8&&a<=10?-5:-10},_startLoop(){this._timer||(this._timer=setInterval(()=>this._update(),vt))},_stopLoop(){this._timer&&clearInterval(this._timer),this._timer=null}};var ae=null;function Ue(){return"0.7.0-30b3407e8"}function St(){let t=document.querySelectorAll('script[src*="vanilla-breeze"]'),e="/cdn/sw.js";for(let a of t){let s=a.getAttribute("src");if(s){let r=s.lastIndexOf("/");if(r!==-1){e=s.slice(0,r)+"/sw.js";break}}}return e}function ze(){return ae||(ae=navigator.serviceWorker?.ready??Promise.reject(new Error("SW not supported"))),ae}function Ke(t){return new Promise((e,a)=>{navigator.serviceWorker?.controller?Ne(navigator.serviceWorker.controller,t,e,a):ze().then(s=>{let r=s.active||s.waiting||s.installing;r?Ne(r,t,e,a):a(new Error("No active service worker"))}).catch(a)})}function Ne(t,e,a,s){let r=new MessageChannel;r.port1.onmessage=n=>a(n.data),r.port1.onmessageerror=()=>s(new Error("Message error")),t.postMessage({type:e},[r.port2]),setTimeout(()=>s(new Error("SW message timeout")),5e3)}async function Ye(){return Ke("GET_STATUS")}async function Je(){return Ke("CLEAR_CACHE")}async function Xe(){let t=await ze();return await t.update(),{updated:!!t.waiting}}function kt(){return typeof window>"u"||!("serviceWorker"in navigator)?!1:window.__VB_SERVICE_WORKER?!0:document.querySelector('meta[name="vb-service-worker"]')?.content==="true"}if(kt()){let t=St();window.addEventListener("load",()=>{ae=navigator.serviceWorker.register(t).catch(e=>{console.warn("[VB] Service worker registration failed:",e)})})}var z="data-char-shortcuts",Et="vb:char-shortcuts-change",_t="vb:settings:extensions";function K(){return typeof document>"u"?!0:document.documentElement.getAttribute(z)!=="off"}function Qe(t){let e=document.documentElement,a=K();t?e.removeAttribute(z):e.setAttribute(z,"off"),a!==!!t&&window.dispatchEvent(new CustomEvent(Et,{detail:{enabled:!!t}}))}function Ct(){try{let t=globalThis.localStorage?.getItem(_t);if(!t)return null;let e=JSON.parse(t)?.data?.charShortcuts;return typeof e=="boolean"?e:null}catch{return null}}var Ze=!0;function et(){return Ze}if(typeof document<"u"){let t=Ct();t===null&&(Ze=K()),t===!1?document.documentElement.setAttribute(z,"off"):t===!0&&document.documentElement.removeAttribute(z)}var j=null,k="settings",ne={motionFx:!0,sounds:!1,charShortcuts:!0},ye=()=>({...ne,charShortcuts:K()}),Tt=document.documentElement.hasAttribute("data-sticky"),be=null,Ft={trigger:"Site settings",dialog:"Site settings",title:"Settings",close:"Close settings",appearance:"Appearance","color-mode":"Color mode","mode-auto":"Auto","mode-light":"Light","mode-dark":"Dark",theme:"Theme",accessibility:"Accessibility","high-contrast":"High Contrast","large-text":"Large Text",dyslexia:"Dyslexia-Friendly","char-shortcuts":"Single-Key Shortcuts",layout:"Layout",fluid:"Fluid Scaling",density:"Density","density-compact":"Compact","density-default":"Default","density-spacious":"Spacious",backdrop:"Canvas Backdrop","backdrop-style":"Style","backdrop-default":"Default","backdrop-flush":"Flush","backdrop-elevated":"Elevated",chrome:"Chrome","chrome-card":"Card","chrome-stretch":"Stretch","chrome-integrated":"Integrated","fixed-header":"Fixed Header","page-bg":"Page Background","page-bg-default":"Theme Default","page-bg-color":"Solid Color","page-bg-gradient":"Gradient","bg-color":"Color","grad-start":"Start","grad-end":"End","grad-direction":"Direction","dir-to-bottom":"Top \u2192 Bottom","dir-to-right":"Left \u2192 Right","dir-135deg":"Diagonal \u2198","dir-45deg":"Diagonal \u2197",sticky:"Sticky Navigation",effects:"Effects",motion:"Motion Effects",sounds:"Sound Effects",environment:"Environment","time-of-day":"Time-of-Day Shifts",seasonal:"Seasonal Tinting",system:"System","sw-label":"Service Worker:","sw-checking":"checking\u2026","sw-unsupported":"Not supported","sw-active":"Active ({n} cached files)","sw-unregistered":"Not registered","clear-cache":"Clear Cache",clearing:"Clearing\u2026",cleared:"Cache cleared","check-update":"Check for Updates",checking:"Checking\u2026","update-available":"Update available","up-to-date":"Up to date",failed:"Failed",reset:"Reset to Defaults","reset-confirm":"Reset all settings to defaults?","reset-yes":"Reset","reset-cancel":"Cancel","reset-done":"Settings reset to defaults"},Pt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>';function D(t){return String(t).replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}async function we(t){let e=document.documentElement;t?e.dataset.sticky="":delete e.dataset.sticky;try{let a=await Promise.resolve().then(()=>(rt(),st));t?a.initStickyManager():a.destroyStickyManager()}catch{}}var ve=class extends Y{#a=null;#t=null;#s=!1;#u=!1;#d=0;#f="";#l=new Set;#p=[];#r=[];#n={...ne,charShortcuts:K()};#o=document.documentElement.hasAttribute("data-sticky");setup(){let e=++this.#d;return this.#f||=crypto.randomUUID().slice(0,8),this.#H(),this.#q(),this.#c(),this.listen(window,"vb:theme-change",this.#k),this.listen(window,"vb:extensions-change",this.#k),this.listen(window,"vb:a11y-themes-change",this.#k),this.#u&&(this.#u=!1,this.open()),this.#C().then(()=>{this.#h(e)&&this.#c()}),!0}teardown(){this.#d++;for(let a of this.#p)clearTimeout(a);this.#p=[],this.#s=!1,this.removeAttribute("open"),this.#a?.setAttribute("aria-expanded","false");let e=!!this.#t?.contains(document.activeElement);this.#t?.remove(),e&&this.#a?.isConnected&&this.#a.focus(),this.#t=null}#h(e){return e===this.#d&&this.isConnected}#i(e,a={}){let s=this.getAttribute(`data-label-${e}`)??Ft[e]??e;for(let[r,n]of Object.entries(a))s=s.replaceAll(`{${r}}`,String(n));return s}#V(e){return D(this.#i(e))}get data(){return{a11yThemes:[...this.#r],extensions:{...this.#n},sticky:this.#o}}set data(e){if(!e||typeof e!="object")return;let a=[],s=[];Array.isArray(e.a11yThemes)&&(this.#r=e.a11yThemes.map(String),s.push("a11y"),a.push(u.set(k,"a11y",this.#r)),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[...this.#r]}))),e.extensions&&typeof e.extensions=="object"&&(this.#n={...ye(),...e.extensions},s.push("extensions"),a.push(u.set(k,"extensions",this.#n)),this.#_()),e.sticky!=null&&(this.#o=!!e.sticky,s.push("sticky"),a.push(u.set(k,"sticky",this.#o?"on":"off")),we(this.#o));for(let r of s)this.#l.add(r);this.#t&&this.#c(),Promise.allSettled(a).then(()=>{for(let r of s)this.#l.delete(r);this.#t&&this.#c(),this.dispatchEvent(new CustomEvent("settings-panel:data-changed",{detail:{data:this.data,source:"property"},bubbles:!0}))})}async#C(){let[e,a,s]=await Promise.all([u.get(k,"a11y"),u.get(k,"extensions"),u.get(k,"sticky")]);be===null&&(be=Tt&&s!=="on"),this.#l.has("a11y")||(this.#r=Array.isArray(e)?e:[]),this.#l.has("extensions")||(this.#n={...ye(),...a??{}}),this.#l.has("sticky")||(this.#o=document.documentElement.hasAttribute("data-sticky"))}#x(e){return e!==""&&e!==void 0}#y(e){return e==="compact"?"compact":e==="spacious"?"spacious":"default"}#A(e,a){return e?a==="compact"?"compact":a==="spacious"?"spacious":"default":""}#B(e){return e!==""&&e!==void 0}#b(e){return e==="flush"?"flush":e==="elevated"?"elevated":"default"}#$(e,a){return e?a==="flush"?"flush":a==="elevated"?"elevated":"default":""}#w(e){if(!e)return"card";let a=e.split(/\s+/);for(let s of a)if(s==="stretch"||s==="integrated")return s;return"card"}#v(e){return e?e.split(/\s+/).includes("fixed"):!1}#T(e,a){let s=[];return e&&e!=="card"&&s.push(e),a&&s.push("fixed"),s.join(" ")||"card"}#e(e){return this.#t?.querySelector(e)??null}#H(){this.#a=this.querySelector(":scope > [data-trigger]")||this.querySelector(":scope > button"),this.#a||(this.#a=document.createElement("button"),this.#a.setAttribute("type","button"),this.#a.setAttribute("data-trigger",""),this.#a.setAttribute("data-minted",""),this.#a.className="settings-trigger",this.#a.innerHTML=Pt,this.prepend(this.#a)),this.#a.hasAttribute("data-minted")&&this.#a.setAttribute("aria-label",this.#i("trigger")),this.#a.setAttribute("aria-haspopup","dialog"),this.#a.setAttribute("aria-expanded","false"),this.#t=document.createElement("div"),this.#t.className="settings-panel",this.#t.setAttribute("role","dialog"),this.#t.setAttribute("aria-label",this.#i("dialog")),this.#t.tabIndex=-1;let e=`settings-panel-${this.#f}`;this.#t.id=e,this.#a.setAttribute("aria-controls",e),this.#t.innerHTML=this.#I(),this.appendChild(this.#t)}#I(){let{mode:e,brand:a,fluid:s,backdrop:r,backdropChrome:n,pageBgType:i,pageBgColor:f,pageBgGradStart:w,pageBgGradEnd:E,pageBgGradDir:_}=m.getState(),T=[...this.#r],p={...this.#n},y=q.load(),C=this.#x(s),x=this.#y(s),b=this.#B(r),A=this.#b(r),c=this.#f,o=d=>this.#V(d),B=(d,l,v,ct,dt,Se={})=>`
2
2
  <fieldset data-segmented>
3
3
  <legend class="visually-hidden">${l}</legend>
4
4
  ${v.map(W=>`
@@ -52,16 +52,16 @@ var lt=Object.defineProperty;var ke=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ee=(t,e)=>{
52
52
  <details name="settings-${c}">
53
53
  <summary>${o("layout")}</summary>
54
54
  <div class="settings-section">
55
- ${g("fluid","data-fluid-toggle",x)}
56
- <div class="density-row" ${x?"":"hidden"}>
55
+ ${g("fluid","data-fluid-toggle",C)}
56
+ <div class="density-row" ${C?"":"hidden"}>
57
57
  <span class="settings-label" aria-hidden="true">${o("density")}</span>
58
- ${B("density",o("density"),["compact","default","spacious"],A,"density")}
58
+ ${B("density",o("density"),["compact","default","spacious"],x,"density")}
59
59
  </div>
60
60
 
61
61
  ${g("backdrop","data-backdrop-toggle",b)}
62
62
  <div class="backdrop-row" ${b?"":"hidden"}>
63
63
  <span class="settings-label" aria-hidden="true">${o("backdrop-style")}</span>
64
- ${B("backdrop",o("backdrop-style"),["default","flush","elevated"],C,"backdrop")}
64
+ ${B("backdrop",o("backdrop-style"),["default","flush","elevated"],A,"backdrop")}
65
65
  </div>
66
66
  <div class="backdrop-row" ${b?"":"hidden"}>
67
67
  <span class="settings-label" aria-hidden="true">${o("chrome")}</span>
@@ -137,5 +137,5 @@ var lt=Object.defineProperty;var ke=(t,e)=>()=>(t&&(e=t(t=0)),e);var Ee=(t,e)=>{
137
137
  </p>
138
138
  </footer>
139
139
  <p class="visually-hidden" data-live role="status"></p>
140
- `}#q(){let e=this.#t;this.listen(this.#a,"click",this.#j),this.listen(document,"click",this.#G),this.listen(document,"keydown",this.#W),this.listen(this,"focusout",this.#N),e.querySelector(".settings-close")?.addEventListener("click",()=>this.close({returnFocus:!0})),e.querySelectorAll('input[data-field="mode"]').forEach(a=>a.addEventListener("change",this.#U)),this.#e('[data-field="theme"]')?.addEventListener("change",this.#z),this.#e("input[data-fluid-toggle]")?.addEventListener("change",this.#K),e.querySelectorAll('input[data-field="density"]').forEach(a=>a.addEventListener("change",this.#Y)),this.#e("input[data-backdrop-toggle]")?.addEventListener("change",this.#J),e.querySelectorAll('input[data-field="backdrop"]').forEach(a=>a.addEventListener("change",this.#X)),e.querySelectorAll('input[data-field="chrome"]').forEach(a=>a.addEventListener("change",this.#Q)),this.#e("input[data-backdrop-fixed]")?.addEventListener("change",this.#Z),this.#e("input[data-sticky-toggle]")?.addEventListener("change",this.#ee),this.#e('[data-field="page-bg"]')?.addEventListener("change",this.#te),this.#e('[data-field="page-bg-color"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-start"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-end"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-dir"]')?.addEventListener("change",this.#g),e.querySelectorAll("input[data-a11y]").forEach(a=>a.addEventListener("change",this.#ae)),e.querySelectorAll("input[data-ext]").forEach(a=>a.addEventListener("change",this.#se)),e.querySelectorAll("input[data-env]").forEach(a=>a.addEventListener("change",this.#re)),this.#e(".settings-reset")?.addEventListener("click",this.#ne),this.#e('[data-action="reset-confirm"]')?.addEventListener("click",this.#ie),this.#e('[data-action="reset-cancel"]')?.addEventListener("click",()=>this.#S(!0)),this.#e('[data-action="clear-cache"]')?.addEventListener("click",this.#oe),this.#e('[data-action="check-update"]')?.addEventListener("click",this.#ce),this.#R(this.#d)}#j=e=>{e.stopPropagation(),this.toggle()};#G=e=>{this.#s&&!this.contains(e.target)&&this.close()};#W=e=>{e.key==="Escape"&&this.#s&&(e.preventDefault(),this.close({returnFocus:!0}))};#N=e=>{if(!this.#s)return;let a=e.relatedTarget;a&&!this.contains(a)&&this.close()};#U=e=>{m.setMode(e.target.value)};#z=async e=>{let a=e.target;a.disabled=!0;try{await m.setBrand(a.value),this.#m()}catch{console.warn("[VB] Theme load failed, using default")}finally{a.disabled=!1}};#K=e=>{let a=e.target.checked,s=this.#y(m.getState().fluid)||"default";m.setFluid(this.#C(a,s)),this.#M(a)};#Y=e=>{m.setFluid(this.#C(!0,e.target.value))};#J=e=>{let a=e.target.checked,s=this.#b(m.getState().backdrop)||"default";m.setBackdrop(this.#$(a,s)),this.#P(a)};#X=e=>{m.setBackdrop(this.#$(!0,e.target.value))};#Q=e=>{let a=this.#v(m.getState().backdropChrome);m.setBackdropChrome(this.#T(e.target.value,a))};#Z=e=>{let a=this.#w(m.getState().backdropChrome);m.setBackdropChrome(this.#T(a,e.target.checked))};#ee=e=>{let a=e.target.checked;this.#o=a,u.set(k,"sticky",a?"on":"off").catch(()=>{}),we(a)};#F(){let e=this.#e('[data-field="page-bg"]')?.value||"";return e==="color"?{type:e,color:this.#e('[data-field="page-bg-color"]')?.value||"#1a1a2e"}:e==="gradient"?{type:e,gradStart:this.#e('[data-field="grad-start"]')?.value||"#1a1a2e",gradEnd:this.#e('[data-field="grad-end"]')?.value||"#16213e",gradDir:this.#e('[data-field="grad-dir"]')?.value||"to bottom"}:null}#te=e=>{this.#E(e.target.value),m.setPageBg(this.#F()??{})};#g=()=>{let e=this.#F();e&&m.setPageBg(e)};#ae=e=>{let a=e.target.dataset.a11y,s=[...this.#r];if(e.target.checked&&!s.includes(a))s.push(a);else if(!e.target.checked){let r=s.indexOf(a);r!==-1&&s.splice(r,1)}this.#O(s),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[...s]}))};#se=e=>{let a=e.target.dataset.ext;this.#n={...this.#n,[a]:e.target.checked},u.set(k,"extensions",this.#n).catch(()=>{}),this.#_()};#re=e=>{q.setSource(e.target.dataset.env,e.target.checked)};#ne=()=>{let e=this.#e(".settings-reset-confirm"),a=this.#e(".settings-reset");!e||!a||(e.hidden=!1,a.hidden=!0,this.#e('[data-action="reset-cancel"]')?.focus())};#S(e=!1){let a=this.#e(".settings-reset-confirm"),s=this.#e(".settings-reset");a&&(a.hidden=!0),s&&(s.hidden=!1,e&&s.focus())}#ie=()=>{let e=["a11y","extensions","sticky"];for(let a of e)this.#l.add(a);setTimeout(()=>{for(let a of e)this.#l.delete(a)},0),m.reset(),this.#O([]),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[]})),this.#n={...ne,charShortcuts:et()},u.remove(k,"extensions").catch(()=>{}),this.#_(),this.#o=!!be,u.remove(k,"sticky").catch(()=>{}),we(this.#o),q.setSource("timeOfDay",!1),q.setSource("seasonal",!1),this.#S(!0),this.#c(),this.#D(this.#i("reset-done"))};#k=e=>{if(e.type==="vb:a11y-themes-change"&&Array.isArray(e.detail))this.#r=e.detail.map(String);else if(e.type==="vb:extensions-change"&&e.detail&&typeof e.detail=="object")this.#n={...ye(),...e.detail};else if(e.type==="vb:theme-change"){let a=this.#d;this.#x().then(()=>{this.#h(a)&&this.#c()})}this.#c()};#c(){if(!this.#t)return;let{mode:e,brand:a,fluid:s,backdrop:r,backdropChrome:n,pageBgType:i,pageBgColor:f,pageBgGradStart:w,pageBgGradEnd:E,pageBgGradDir:_}=m.getState(),T=this.#r,p=this.#n,y=this.#A(s),x=this.#y(s),A=this.#B(r),b=this.#b(r),C=this.#t,c=(d,l)=>{let v=this.#e(d);v&&(v.checked=l)},o=(d,l)=>{let v=this.#e(d);v&&l&&(v.value=l)};c(`input[data-field="mode"][value="${e}"]`,!0);let B=this.#e('[data-field="theme"]');B&&(B.value=a||"default"),c("input[data-fluid-toggle]",y),c(`input[data-field="density"][value="${x}"]`,!0),this.#M(y),c("input[data-backdrop-toggle]",A),c(`input[data-field="backdrop"][value="${b}"]`,!0),c(`input[data-field="chrome"][value="${this.#w(n)}"]`,!0),c("input[data-backdrop-fixed]",this.#v(n)),this.#P(A);let g=this.#e('[data-field="page-bg"]');g&&(g.value=i||""),o('[data-field="page-bg-color"]',f),o('[data-field="grad-start"]',w),o('[data-field="grad-end"]',E),o('[data-field="grad-dir"]',_),A&&this.#E(i||""),C.querySelectorAll("input[data-a11y]").forEach(d=>{let l=d;l.checked=T.includes(l.dataset.a11y||"")}),C.querySelectorAll("input[data-ext]").forEach(d=>{let l=d,v=l.dataset.ext;l.checked=p[v]??ne[v]}),c("input[data-sticky-toggle]",this.#o);let G=q.load();C.querySelectorAll("input[data-env]").forEach(d=>{let l=d;l.checked=G[l.dataset.env]??!1})}#M(e){let a=this.#e(".density-row");a&&(a.hidden=!e)}#P(e){this.#t?.querySelectorAll(".backdrop-row").forEach(a=>{a.hidden=!e}),e&&this.#E(this.#e('[data-field="page-bg"]')?.value||"")}#E(e){let a=this.#e(".page-bg-color-row"),s=this.#e(".page-bg-grad-row"),r=this.#e(".page-bg-grad-dir-row");a&&(a.hidden=e!=="color"),s&&(s.hidden=e!=="gradient"),r&&(r.hidden=e!=="gradient")}#O(e){this.#r=[...e],u.set(k,"a11y",this.#r).catch(()=>{})}#m(){let e=[...this.#r],{brand:a}=m.getState(),s=document.documentElement,r=a!=="default"?[a,...e]:[...e];r.length?s.dataset.theme=r.join(" "):delete s.dataset.theme}async#_(){let e={...this.#n},a=document.documentElement;e.motionFx?delete a.dataset.motionReduced:a.dataset.motionReduced="",Qe(e.charShortcuts!==!1),e.sounds?(j||(j=(await Promise.resolve().then(()=>(ot(),it))).SoundManager),j.init(),j.enable()):j&&j.disable(),window.dispatchEvent(new CustomEvent("vb:extensions-change",{detail:e}))}#D(e){let a=this.#e("[data-live]");a&&(a.textContent="",requestAnimationFrame(()=>{a.textContent=e}))}async#R(e){let a=this.#e("[data-sw-status] span");if(a){if(!("serviceWorker"in navigator)){a.textContent=this.#i("sw-unsupported");return}try{let s=await Ye();if(!this.#h(e))return;let r=s.cachedURLs?.length??0;a.textContent=this.#i("sw-active",{n:r})}catch{this.#h(e)&&(a.textContent=this.#i("sw-unregistered"))}}}async#L(e,a,s,r){let n=this.#d;e.disabled=!0,e.textContent=this.#i(s);let i;try{i=await r()}catch{i=this.#i("failed")}this.#h(n)&&(e.textContent=i,this.#D(i),this.#p.push(setTimeout(()=>{e.textContent=this.#i(a),e.disabled=!1},2e3)))}#oe=e=>{let a=this.#d;this.#L(e.currentTarget,"clear-cache","clearing",async()=>(await Je(),this.#R(a),this.#i("cleared")))};#ce=e=>{this.#L(e.currentTarget,"check-update","checking",async()=>{let{updated:a}=await Xe();return this.#i(a?"update-available":"up-to-date")})};open(){if(!this.#t){this.#u=!0;return}this.#s||(this.#s=!0,this.setAttribute("open",""),this.#a?.setAttribute("aria-expanded","true"),this.#c(),this.#de(),this.#t.focus({preventScroll:!0}))}#de(){let e=this.getBoundingClientRect(),a=this.#t;a.style.removeProperty("top"),a.style.removeProperty("bottom"),a.style.removeProperty("left"),a.style.removeProperty("right");let s=a.getBoundingClientRect(),r=window.innerWidth,n=window.innerHeight,i=e.top,f=n-e.bottom;i<s.height&&f>i?(a.style.top="calc(100% + 8px)",a.style.bottom="auto"):(a.style.bottom="calc(100% + 8px)",a.style.top="auto");let w=r-e.right,E=e.left,_=s.width;e.right<_&&E<w?(a.style.left="0",a.style.right="auto"):(a.style.right="0",a.style.left="auto")}close({returnFocus:e=!1}={}){this.#u=!1,this.#s&&(this.#s=!1,this.removeAttribute("open"),this.#a?.setAttribute("aria-expanded","false"),this.#S(),e&&this.#a?.focus())}toggle(){this.#s?this.close():this.open()}};xe("settings-panel",ve);export{ve as SettingsPanel};
140
+ `}#q(){let e=this.#t;this.listen(this.#a,"click",this.#j),this.listen(document,"click",this.#G),this.listen(this,"keydown",this.#W),this.listen(this,"focusout",this.#N),e.querySelector(".settings-close")?.addEventListener("click",()=>this.close()),e.querySelectorAll('input[data-field="mode"]').forEach(a=>a.addEventListener("change",this.#U)),this.#e('[data-field="theme"]')?.addEventListener("change",this.#z),this.#e("input[data-fluid-toggle]")?.addEventListener("change",this.#K),e.querySelectorAll('input[data-field="density"]').forEach(a=>a.addEventListener("change",this.#Y)),this.#e("input[data-backdrop-toggle]")?.addEventListener("change",this.#J),e.querySelectorAll('input[data-field="backdrop"]').forEach(a=>a.addEventListener("change",this.#X)),e.querySelectorAll('input[data-field="chrome"]').forEach(a=>a.addEventListener("change",this.#Q)),this.#e("input[data-backdrop-fixed]")?.addEventListener("change",this.#Z),this.#e("input[data-sticky-toggle]")?.addEventListener("change",this.#ee),this.#e('[data-field="page-bg"]')?.addEventListener("change",this.#te),this.#e('[data-field="page-bg-color"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-start"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-end"]')?.addEventListener("input",this.#g),this.#e('[data-field="grad-dir"]')?.addEventListener("change",this.#g),e.querySelectorAll("input[data-a11y]").forEach(a=>a.addEventListener("change",this.#ae)),e.querySelectorAll("input[data-ext]").forEach(a=>a.addEventListener("change",this.#se)),e.querySelectorAll("input[data-env]").forEach(a=>a.addEventListener("change",this.#re)),this.#e(".settings-reset")?.addEventListener("click",this.#ne),this.#e('[data-action="reset-confirm"]')?.addEventListener("click",this.#ie),this.#e('[data-action="reset-cancel"]')?.addEventListener("click",()=>this.#S(!0)),this.#e('[data-action="clear-cache"]')?.addEventListener("click",this.#oe),this.#e('[data-action="check-update"]')?.addEventListener("click",this.#ce),this.#R(this.#d)}#j=e=>{e.stopPropagation(),this.toggle()};#G=e=>{this.#s&&!this.contains(e.target)&&this.close()};#W=e=>{e.key==="Escape"&&!e.defaultPrevented&&this.#s&&(e.preventDefault(),this.close())};#N=e=>{if(!this.#s)return;let a=e.relatedTarget;a&&!this.contains(a)&&this.close()};#U=e=>{m.setMode(e.target.value)};#z=async e=>{let a=e.target;a.disabled=!0;try{await m.setBrand(a.value),this.#m()}catch{console.warn("[VB] Theme load failed, using default")}finally{a.disabled=!1}};#K=e=>{let a=e.target.checked,s=this.#y(m.getState().fluid)||"default";m.setFluid(this.#A(a,s)),this.#P(a)};#Y=e=>{m.setFluid(this.#A(!0,e.target.value))};#J=e=>{let a=e.target.checked,s=this.#b(m.getState().backdrop)||"default";m.setBackdrop(this.#$(a,s)),this.#M(a)};#X=e=>{m.setBackdrop(this.#$(!0,e.target.value))};#Q=e=>{let a=this.#v(m.getState().backdropChrome);m.setBackdropChrome(this.#T(e.target.value,a))};#Z=e=>{let a=this.#w(m.getState().backdropChrome);m.setBackdropChrome(this.#T(a,e.target.checked))};#ee=e=>{let a=e.target.checked;this.#o=a,u.set(k,"sticky",a?"on":"off").catch(()=>{}),we(a)};#F(){let e=this.#e('[data-field="page-bg"]')?.value||"";return e==="color"?{type:e,color:this.#e('[data-field="page-bg-color"]')?.value||"#1a1a2e"}:e==="gradient"?{type:e,gradStart:this.#e('[data-field="grad-start"]')?.value||"#1a1a2e",gradEnd:this.#e('[data-field="grad-end"]')?.value||"#16213e",gradDir:this.#e('[data-field="grad-dir"]')?.value||"to bottom"}:null}#te=e=>{this.#E(e.target.value),m.setPageBg(this.#F()??{})};#g=()=>{let e=this.#F();e&&m.setPageBg(e)};#ae=e=>{let a=e.target.dataset.a11y,s=[...this.#r];if(e.target.checked&&!s.includes(a))s.push(a);else if(!e.target.checked){let r=s.indexOf(a);r!==-1&&s.splice(r,1)}this.#O(s),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[...s]}))};#se=e=>{let a=e.target.dataset.ext;this.#n={...this.#n,[a]:e.target.checked},u.set(k,"extensions",this.#n).catch(()=>{}),this.#_()};#re=e=>{q.setSource(e.target.dataset.env,e.target.checked)};#ne=()=>{let e=this.#e(".settings-reset-confirm"),a=this.#e(".settings-reset");!e||!a||(e.hidden=!1,a.hidden=!0,this.#e('[data-action="reset-cancel"]')?.focus())};#S(e=!1){let a=this.#e(".settings-reset-confirm"),s=this.#e(".settings-reset");a&&(a.hidden=!0),s&&(s.hidden=!1,e&&s.focus())}#ie=()=>{let e=["a11y","extensions","sticky"];for(let a of e)this.#l.add(a);setTimeout(()=>{for(let a of e)this.#l.delete(a)},0),m.reset(),this.#O([]),this.#m(),window.dispatchEvent(new CustomEvent("vb:a11y-themes-change",{detail:[]})),this.#n={...ne,charShortcuts:et()},u.remove(k,"extensions").catch(()=>{}),this.#_(),this.#o=!!be,u.remove(k,"sticky").catch(()=>{}),we(this.#o),q.setSource("timeOfDay",!1),q.setSource("seasonal",!1),this.#S(!0),this.#c(),this.#D(this.#i("reset-done"))};#k=e=>{if(e.type==="vb:a11y-themes-change"&&Array.isArray(e.detail))this.#r=e.detail.map(String);else if(e.type==="vb:extensions-change"&&e.detail&&typeof e.detail=="object")this.#n={...ye(),...e.detail};else if(e.type==="vb:theme-change"){let a=this.#d;this.#C().then(()=>{this.#h(a)&&this.#c()})}this.#c()};#c(){if(!this.#t)return;let{mode:e,brand:a,fluid:s,backdrop:r,backdropChrome:n,pageBgType:i,pageBgColor:f,pageBgGradStart:w,pageBgGradEnd:E,pageBgGradDir:_}=m.getState(),T=this.#r,p=this.#n,y=this.#x(s),C=this.#y(s),x=this.#B(r),b=this.#b(r),A=this.#t,c=(d,l)=>{let v=this.#e(d);v&&(v.checked=l)},o=(d,l)=>{let v=this.#e(d);v&&l&&(v.value=l)};c(`input[data-field="mode"][value="${e}"]`,!0);let B=this.#e('[data-field="theme"]');B&&(B.value=a||"default"),c("input[data-fluid-toggle]",y),c(`input[data-field="density"][value="${C}"]`,!0),this.#P(y),c("input[data-backdrop-toggle]",x),c(`input[data-field="backdrop"][value="${b}"]`,!0),c(`input[data-field="chrome"][value="${this.#w(n)}"]`,!0),c("input[data-backdrop-fixed]",this.#v(n)),this.#M(x);let g=this.#e('[data-field="page-bg"]');g&&(g.value=i||""),o('[data-field="page-bg-color"]',f),o('[data-field="grad-start"]',w),o('[data-field="grad-end"]',E),o('[data-field="grad-dir"]',_),x&&this.#E(i||""),A.querySelectorAll("input[data-a11y]").forEach(d=>{let l=d;l.checked=T.includes(l.dataset.a11y||"")}),A.querySelectorAll("input[data-ext]").forEach(d=>{let l=d,v=l.dataset.ext;l.checked=p[v]??ne[v]}),c("input[data-sticky-toggle]",this.#o);let G=q.load();A.querySelectorAll("input[data-env]").forEach(d=>{let l=d;l.checked=G[l.dataset.env]??!1})}#P(e){let a=this.#e(".density-row");a&&(a.hidden=!e)}#M(e){this.#t?.querySelectorAll(".backdrop-row").forEach(a=>{a.hidden=!e}),e&&this.#E(this.#e('[data-field="page-bg"]')?.value||"")}#E(e){let a=this.#e(".page-bg-color-row"),s=this.#e(".page-bg-grad-row"),r=this.#e(".page-bg-grad-dir-row");a&&(a.hidden=e!=="color"),s&&(s.hidden=e!=="gradient"),r&&(r.hidden=e!=="gradient")}#O(e){this.#r=[...e],u.set(k,"a11y",this.#r).catch(()=>{})}#m(){let e=[...this.#r],{brand:a}=m.getState(),s=document.documentElement,r=a!=="default"?[a,...e]:[...e];r.length?s.dataset.theme=r.join(" "):delete s.dataset.theme}async#_(){let e={...this.#n},a=document.documentElement;e.motionFx?delete a.dataset.motionReduced:a.dataset.motionReduced="",Qe(e.charShortcuts!==!1),e.sounds?(j||(j=(await Promise.resolve().then(()=>(ot(),it))).SoundManager),j.init(),j.enable()):j&&j.disable(),window.dispatchEvent(new CustomEvent("vb:extensions-change",{detail:e}))}#D(e){let a=this.#e("[data-live]");a&&(a.textContent="",requestAnimationFrame(()=>{a.textContent=e}))}async#R(e){let a=this.#e("[data-sw-status] span");if(a){if(!("serviceWorker"in navigator)){a.textContent=this.#i("sw-unsupported");return}try{let s=await Ye();if(!this.#h(e))return;let r=s.cachedURLs?.length??0;a.textContent=this.#i("sw-active",{n:r})}catch{this.#h(e)&&(a.textContent=this.#i("sw-unregistered"))}}}async#L(e,a,s,r){let n=this.#d;e.disabled=!0,e.textContent=this.#i(s);let i;try{i=await r()}catch{i=this.#i("failed")}this.#h(n)&&(e.textContent=i,this.#D(i),this.#p.push(setTimeout(()=>{e.textContent=this.#i(a),e.disabled=!1},2e3)))}#oe=e=>{let a=this.#d;this.#L(e.currentTarget,"clear-cache","clearing",async()=>(await Je(),this.#R(a),this.#i("cleared")))};#ce=e=>{this.#L(e.currentTarget,"check-update","checking",async()=>{let{updated:a}=await Xe();return this.#i(a?"update-available":"up-to-date")})};open(){if(!this.#t){this.#u=!0;return}this.#s||(this.#s=!0,this.setAttribute("open",""),this.#a?.setAttribute("aria-expanded","true"),this.#c(),this.#de(),this.#t.focus({preventScroll:!0}))}#de(){let e=this.getBoundingClientRect(),a=this.#t;a.style.removeProperty("top"),a.style.removeProperty("bottom"),a.style.removeProperty("left"),a.style.removeProperty("right");let s=a.getBoundingClientRect(),r=window.innerWidth,n=window.innerHeight,i=e.top,f=n-e.bottom;i<s.height&&f>i?(a.style.top="calc(100% + 8px)",a.style.bottom="auto"):(a.style.bottom="calc(100% + 8px)",a.style.top="auto");let w=r-e.right,E=e.left,_=s.width;e.right<_&&E<w?(a.style.left="0",a.style.right="auto"):(a.style.right="0",a.style.left="auto")}close(){if(this.#u=!1,!this.#s)return;let e=!!this.#t?.contains(document.activeElement);this.#s=!1,this.removeAttribute("open"),this.#a?.setAttribute("aria-expanded","false"),this.#S(),e&&this.#a?.isConnected&&this.#a.focus()}toggle(){this.#s?this.close():this.open()}};Te("settings-panel",ve);export{ve as SettingsPanel};
141
141
  //# sourceMappingURL=settings-panel.js.map