@bquery/bquery 1.10.0 → 1.11.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 (155) hide show
  1. package/README.md +44 -19
  2. package/dist/{a11y-DG2i4iZN.js → a11y-DgUQ8-fI.js} +1 -1
  3. package/dist/{a11y-DG2i4iZN.js.map → a11y-DgUQ8-fI.js.map} +1 -1
  4. package/dist/a11y.es.mjs +1 -1
  5. package/dist/{component-DRotf1hl.js → component-D8ydhe58.js} +2 -2
  6. package/dist/{component-DRotf1hl.js.map → component-D8ydhe58.js.map} +1 -1
  7. package/dist/component.es.mjs +1 -1
  8. package/dist/concurrency-BU1wPEsZ.js.map +1 -1
  9. package/dist/{constraints-CqjhmpZC.js → constraints-Dlbx_m1b.js} +1 -1
  10. package/dist/{constraints-CqjhmpZC.js.map → constraints-Dlbx_m1b.js.map} +1 -1
  11. package/dist/{core-EMYSLzaT.js → core-tOP6QOrY.js} +2 -2
  12. package/dist/{core-EMYSLzaT.js.map → core-tOP6QOrY.js.map} +1 -1
  13. package/dist/core.es.mjs +1 -1
  14. package/dist/{custom-directives-BjFzFhuf.js → custom-directives-5DlKqvd2.js} +1 -1
  15. package/dist/{custom-directives-BjFzFhuf.js.map → custom-directives-5DlKqvd2.js.map} +1 -1
  16. package/dist/{devtools-C5FExMwv.js → devtools-QosAqo0T.js} +2 -2
  17. package/dist/{devtools-C5FExMwv.js.map → devtools-QosAqo0T.js.map} +1 -1
  18. package/dist/devtools.es.mjs +1 -1
  19. package/dist/{dnd-BAqzPlSo.js → dnd-d2OU4len.js} +1 -1
  20. package/dist/{dnd-BAqzPlSo.js.map → dnd-d2OU4len.js.map} +1 -1
  21. package/dist/dnd.es.mjs +1 -1
  22. package/dist/{forms-Dx1Scvh0.js → forms-BLx4ZzT7.js} +1 -1
  23. package/dist/{forms-Dx1Scvh0.js.map → forms-BLx4ZzT7.js.map} +1 -1
  24. package/dist/forms.es.mjs +1 -1
  25. package/dist/full.d.ts +4 -2
  26. package/dist/full.d.ts.map +1 -1
  27. package/dist/full.es.mjs +258 -219
  28. package/dist/full.iife.js +41 -37
  29. package/dist/full.iife.js.map +1 -1
  30. package/dist/full.umd.js +41 -37
  31. package/dist/full.umd.js.map +1 -1
  32. package/dist/{i18n-Cazyk9RD.js → i18n--p7PM-9r.js} +1 -1
  33. package/dist/{i18n-Cazyk9RD.js.map → i18n--p7PM-9r.js.map} +1 -1
  34. package/dist/i18n.es.mjs +1 -1
  35. package/dist/index.d.ts +1 -0
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.es.mjs +291 -252
  38. package/dist/match-CrZRVC4z.js +174 -0
  39. package/dist/match-CrZRVC4z.js.map +1 -0
  40. package/dist/{media-dAKIGPk3.js → media-gjbWNq50.js} +1 -1
  41. package/dist/{media-dAKIGPk3.js.map → media-gjbWNq50.js.map} +1 -1
  42. package/dist/media.es.mjs +1 -1
  43. package/dist/motion-BBMso9Ir.js.map +1 -1
  44. package/dist/{mount-C8O2vXkQ.js → mount-0A9qtcRJ.js} +3 -3
  45. package/dist/{mount-C8O2vXkQ.js.map → mount-0A9qtcRJ.js.map} +1 -1
  46. package/dist/platform-BPHIXbw8.js.map +1 -1
  47. package/dist/{plugin-DjTqWg-P.js → plugin-SZEirbwq.js} +2 -2
  48. package/dist/{plugin-DjTqWg-P.js.map → plugin-SZEirbwq.js.map} +1 -1
  49. package/dist/plugin.es.mjs +1 -1
  50. package/dist/reactive-BAd2hfl8.js.map +1 -1
  51. package/dist/{registry-Cr6VH8CR.js → registry-jpUQHf4E.js} +1 -1
  52. package/dist/{registry-Cr6VH8CR.js.map → registry-jpUQHf4E.js.map} +1 -1
  53. package/dist/router-C4weu0QL.js +333 -0
  54. package/dist/router-C4weu0QL.js.map +1 -0
  55. package/dist/router.es.mjs +1 -1
  56. package/dist/{sanitize-B1V4JswB.js → sanitize-DOMkRO9G.js} +12 -7
  57. package/dist/{sanitize-B1V4JswB.js.map → sanitize-DOMkRO9G.js.map} +1 -1
  58. package/dist/security.es.mjs +1 -1
  59. package/dist/server/create-server.d.ts +25 -0
  60. package/dist/server/create-server.d.ts.map +1 -0
  61. package/dist/server/index.d.ts +11 -0
  62. package/dist/server/index.d.ts.map +1 -0
  63. package/dist/server/types.d.ts +396 -0
  64. package/dist/server/types.d.ts.map +1 -0
  65. package/dist/server-QdyKtCS1.js +349 -0
  66. package/dist/server-QdyKtCS1.js.map +1 -0
  67. package/dist/server.es.mjs +6 -0
  68. package/dist/ssr/adapters.d.ts +74 -0
  69. package/dist/ssr/adapters.d.ts.map +1 -0
  70. package/dist/ssr/async.d.ts +40 -0
  71. package/dist/ssr/async.d.ts.map +1 -0
  72. package/dist/ssr/config.d.ts +60 -0
  73. package/dist/ssr/config.d.ts.map +1 -0
  74. package/dist/ssr/context.d.ts +73 -0
  75. package/dist/ssr/context.d.ts.map +1 -0
  76. package/dist/ssr/defer-brand.d.ts +5 -0
  77. package/dist/ssr/defer-brand.d.ts.map +1 -0
  78. package/dist/ssr/escape.d.ts +17 -0
  79. package/dist/ssr/escape.d.ts.map +1 -0
  80. package/dist/ssr/expression.d.ts +44 -0
  81. package/dist/ssr/expression.d.ts.map +1 -0
  82. package/dist/ssr/hash.d.ts +39 -0
  83. package/dist/ssr/hash.d.ts.map +1 -0
  84. package/dist/ssr/head.d.ts +102 -0
  85. package/dist/ssr/head.d.ts.map +1 -0
  86. package/dist/ssr/html-parser.d.ts +58 -0
  87. package/dist/ssr/html-parser.d.ts.map +1 -0
  88. package/dist/ssr/index.d.ts +49 -43
  89. package/dist/ssr/index.d.ts.map +1 -1
  90. package/dist/ssr/mismatch.d.ts +60 -0
  91. package/dist/ssr/mismatch.d.ts.map +1 -0
  92. package/dist/ssr/render-async.d.ts +84 -0
  93. package/dist/ssr/render-async.d.ts.map +1 -0
  94. package/dist/ssr/render.d.ts.map +1 -1
  95. package/dist/ssr/renderer.d.ts +25 -0
  96. package/dist/ssr/renderer.d.ts.map +1 -0
  97. package/dist/ssr/resumability.d.ts +65 -0
  98. package/dist/ssr/resumability.d.ts.map +1 -0
  99. package/dist/ssr/router-bridge.d.ts +101 -0
  100. package/dist/ssr/router-bridge.d.ts.map +1 -0
  101. package/dist/ssr/runtime.d.ts +63 -0
  102. package/dist/ssr/runtime.d.ts.map +1 -0
  103. package/dist/ssr/serialize.d.ts.map +1 -1
  104. package/dist/ssr/store-snapshot.d.ts +87 -0
  105. package/dist/ssr/store-snapshot.d.ts.map +1 -0
  106. package/dist/ssr/strategies.d.ts +43 -0
  107. package/dist/ssr/strategies.d.ts.map +1 -0
  108. package/dist/ssr/suspense.d.ts +47 -0
  109. package/dist/ssr/suspense.d.ts.map +1 -0
  110. package/dist/ssr/types.d.ts +17 -0
  111. package/dist/ssr/types.d.ts.map +1 -1
  112. package/dist/ssr-Bt6BQA3J.js +2127 -0
  113. package/dist/ssr-Bt6BQA3J.js.map +1 -0
  114. package/dist/ssr.es.mjs +42 -7
  115. package/dist/{store-CjmEeX9-.js → store-DnXuu6Li.js} +2 -2
  116. package/dist/{store-CjmEeX9-.js.map → store-DnXuu6Li.js.map} +1 -1
  117. package/dist/store.es.mjs +2 -2
  118. package/dist/storybook.es.mjs +1 -1
  119. package/dist/{testing-TdfaL7VE.js → testing-CeMUwrRD.js} +2 -2
  120. package/dist/{testing-TdfaL7VE.js.map → testing-CeMUwrRD.js.map} +1 -1
  121. package/dist/testing.es.mjs +1 -1
  122. package/dist/view.es.mjs +1 -1
  123. package/package.json +17 -12
  124. package/src/full.ts +99 -0
  125. package/src/index.ts +3 -0
  126. package/src/server/create-server.ts +754 -0
  127. package/src/server/index.ts +33 -0
  128. package/src/server/types.ts +490 -0
  129. package/src/ssr/adapters.ts +330 -0
  130. package/src/ssr/async.ts +125 -0
  131. package/src/ssr/config.ts +86 -0
  132. package/src/ssr/context.ts +245 -0
  133. package/src/ssr/defer-brand.ts +3 -0
  134. package/src/ssr/escape.ts +25 -0
  135. package/src/ssr/expression.ts +669 -0
  136. package/src/ssr/hash.ts +71 -0
  137. package/src/ssr/head.ts +240 -0
  138. package/src/ssr/html-parser.ts +387 -0
  139. package/src/ssr/index.ts +136 -43
  140. package/src/ssr/mismatch.ts +110 -0
  141. package/src/ssr/render-async.ts +286 -0
  142. package/src/ssr/render.ts +130 -59
  143. package/src/ssr/renderer.ts +453 -0
  144. package/src/ssr/resumability.ts +142 -0
  145. package/src/ssr/router-bridge.ts +177 -0
  146. package/src/ssr/runtime.ts +131 -0
  147. package/src/ssr/serialize.ts +1 -27
  148. package/src/ssr/store-snapshot.ts +209 -0
  149. package/src/ssr/strategies.ts +245 -0
  150. package/src/ssr/suspense.ts +504 -0
  151. package/src/ssr/types.ts +18 -0
  152. package/dist/router-CCepRMpC.js +0 -493
  153. package/dist/router-CCepRMpC.js.map +0 -1
  154. package/dist/ssr-D-1IPcfw.js +0 -248
  155. package/dist/ssr-D-1IPcfw.js.map +0 -1
package/dist/full.iife.js CHANGED
@@ -1,4 +1,4 @@
1
- var bQuery=(function(g){Object.defineProperty(g,Symbol.toStringTag,{value:"Module"});var lr="bquery-sanitizer",Vs=new Set(["a","abbr","address","article","aside","b","bdi","bdo","blockquote","br","button","caption","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","input","ins","kbd","label","legend","li","main","mark","nav","ol","optgroup","option","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","var","wbr"]),cr=new Set(["script","iframe","frame","frameset","object","embed","applet","link","meta","style","base","template","math","svg","foreignobject","noscript"]),Ks=new Set(["document","window","location","top","self","parent","frames","history","navigator","screen","alert","confirm","prompt","eval","function","cookie","domain","referrer","body","head","forms","images","links","scripts","children","parentnode","firstchild","lastchild","innerhtml","outerhtml","textcontent"]),Ys=new Set(["alt","class","dir","height","hidden","href","id","lang","loading","name","rel","role","src","srcset","tabindex","target","title","type","width","aria-*"]),Gs=["on","formaction","xlink:","xmlns:"],ur=["javascript:","data:","vbscript:","file:"],Js=(e,t,r)=>{const n=e.toLowerCase();for(const s of Gs)if(n.startsWith(s))return!1;return r&&n.startsWith("data-")||n.startsWith("aria-")?!0:t.has(n)},Xs=e=>{const t=e.toLowerCase().trim();return!Ks.has(t)},Zs=e=>e.replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),fr=e=>{const t=Zs(e);for(const r of ur)if(t.startsWith(r))return!1;return!0},eo=e=>{const t=e.split(",");for(const r of t){const n=r.trim().split(/\s+/)[0];if(n&&!fr(n))return!1}return!0},to=e=>{try{const t=e.trim();if(t.startsWith("//"))return!0;const r=t.toLowerCase();return/^[a-z][a-z0-9+.-]*:/i.test(t)&&!r.startsWith("http://")&&!r.startsWith("https://")?!0:!r.startsWith("http://")&&!r.startsWith("https://")?!1:typeof window>"u"||!window.location?!0:new URL(t,window.location.href).origin!==window.location.origin}catch{return!0}},ro=e=>new DOMParser().parseFromString(e,"text/html"),dr=e=>{const t=(typeof e=="string"?e:String(e??"")).trim(),r=document.createDocumentFragment();if(t.length===0)return r;if(!(t.includes("<")||t.includes(">")))return r.appendChild(document.createTextNode(t)),r;const n=ro(t).body;if(!n)return r;for(;n.firstChild;)r.appendChild(n.firstChild);return r},et=(e,t={})=>{const{allowTags:r=[],allowAttributes:n=[],allowDataAttributes:s=!0,stripAllTags:o=!1}=t,i=new Set([...Vs,...r.map(u=>u.toLowerCase())].filter(u=>!cr.has(u))),a=new Set([...Ys,...n.map(u=>u.toLowerCase())]),l=dr(e);if(o)return l.textContent??"";const c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT),f=[];for(;c.nextNode();){const u=c.currentNode,h=u.tagName.toLowerCase();if(cr.has(h)){f.push(u);continue}if(!i.has(h)){f.push(u);continue}const v=[];for(const b of Array.from(u.attributes)){const y=b.name.toLowerCase();if(!Js(y,a,s)){v.push(b.name);continue}if((y==="id"||y==="name")&&!Xs(b.value)){v.push(b.name);continue}if((y==="href"||y==="src"||y==="action")&&!fr(b.value)){v.push(b.name);continue}y==="srcset"&&!eo(b.value)&&v.push(b.name)}for(const b of v)u.removeAttribute(b);if(h==="a"){const b=u.getAttribute("href"),y=u.getAttribute("target")?.toLowerCase()==="_blank",w=b&&to(b);if(y||w){const E=u.getAttribute("rel"),k=new Set(E?E.split(/\s+/).filter(Boolean):[]);k.add("noopener"),k.add("noreferrer"),u.setAttribute("rel",Array.from(k).join(" "))}}}for(const u of f)u.remove();const m=u=>{const h=document.createElement("div");return h.appendChild(u.cloneNode(!0)),h.innerHTML},d=m(l),p=m(dr(d));return d!==p?l.textContent??"":p},hr=Symbol("bquery.trusted-html.brand"),kt=Symbol("bquery.trusted-html"),mr=e=>e,no=e=>{const t=String(e);return Object.freeze({[hr]:!0,[kt]:t,toString:()=>t})},so=e=>typeof e=="object"&&e!==null&&hr in e&&kt in e,oo=e=>e[kt],pr=1024,vr=8192,io=(e=16)=>{if(!Number.isInteger(e)||e<1)throw new RangeError("generateNonce length must be a positive integer");if(e>pr)throw new RangeError(`generateNonce length must not exceed ${pr}`);if(typeof globalThis.crypto>"u"||typeof globalThis.crypto.getRandomValues!="function")throw new Error("generateNonce requires crypto.getRandomValues (not available in this environment)");if(typeof globalThis.btoa!="function")throw new Error("generateNonce requires btoa (not available in this environment)");const t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let n=0;n<t.length;n+=vr){const s=t.subarray(n,Math.min(n+vr,t.length));r+=String.fromCharCode(...s)}return globalThis.btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ao=e=>{if(typeof document>"u")return!1;const t=document.querySelector('meta[http-equiv="Content-Security-Policy"]');return t?(t.getAttribute("content")??"").includes(e):!1},tt=null,yr=!1,lo=()=>typeof window<"u"&&typeof window.trustedTypes<"u",gr=()=>{if(tt)return tt;if(yr||typeof window>"u")return null;const e=window;if(!e.trustedTypes)return null;yr=!0;try{return tt=e.trustedTypes.createPolicy(lr,{createHTML:t=>et(t)}),tt}catch(t){const r=t instanceof Error?t.message:String(t);return console.warn(`bQuery: Could not create Trusted Types policy "${lr}": ${r}`),null}},co=e=>{const t=gr();return t?t.createHTML(e):et(e)},X=(e,t={})=>mr(et(e,t)),br=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return e.replace(/[&<>"'`]/g,r=>t[r])},uo=e=>et(e,{stripAllTags:!0}),wr=e=>Array.isArray(e)?e:[e],z=(e,t)=>{for(const r of e)t(r)},ve=e=>{if(!e)return!1;const t=e.ownerDocument?.defaultView?.HTMLElement??globalThis.HTMLElement;return typeof t=="function"&&e instanceof t},rt=(e,t)=>ve(e)?t==="width"?e.clientWidth:e.clientHeight:0,nt=(e,t,r)=>{if(!ve(e))return 0;const n=t==="width"?e.offsetWidth:e.offsetHeight;if(!r)return n;const s=e.ownerDocument?.defaultView;if(!s||typeof s.getComputedStyle!="function")return n;const o=s.getComputedStyle(e),i=Number.parseFloat(o.getPropertyValue(t==="width"?"margin-left":"margin-top")),a=Number.parseFloat(o.getPropertyValue(t==="width"?"margin-right":"margin-bottom")),l=Number.isNaN(i)?0:i,c=Number.isNaN(a)?0:a;return n+l+c},Er=e=>X(e),fo=(e,t)=>{e.innerHTML=X(t)},Sr=e=>{const t=document.createElement("template");return t.innerHTML=X(e),t.content.firstElementChild??document.createElement("div")},Ar=(e,t,r)=>{if(typeof t=="string"){e.insertAdjacentHTML(r,X(t));return}const n=wr(t);z(r==="afterbegin"||r==="afterend"?n.slice().reverse():n,s=>{e.insertAdjacentElement(r,s)})};function ye(e){return Object.prototype.toString.call(e)==="[object Object]"}function x(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function ho(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function ge(...e){const t={};for(const r of e)for(const[n,s]of Object.entries(r))x(n)||(ye(s)&&ye(t[n])?t[n]=ge(t[n],s):t[n]=s);return t}function mo(e,t){const r={};for(const n of t)n in e&&(r[n]=e[n]);return r}function po(e,t){const r={...e};for(const n of t)delete r[n];return r}function vo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var yo=e=>{const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"},kr=e=>{const t=[],r=e.ownerDocument.defaultView?.Element??Element;for(const n of Array.from(e.elements)){if(!(n instanceof r)||!yo(n))continue;const s=n.name;if(!(!s||n.disabled||x(s))){if(n.tagName.toLowerCase()==="input"){const o=n,i=o.type.toLowerCase();if(i==="checkbox"||i==="radio"){o.checked&&t.push([s,o.value]);continue}if(i==="file"||i==="submit"||i==="button"||i==="reset"||i==="image")continue;t.push([s,o.value]);continue}if(n.tagName.toLowerCase()==="select"){const o=n;if(o.multiple)for(const i of Array.from(o.selectedOptions))t.push([s,i.value]);else t.push([s,o.value]);continue}t.push([s,n.value])}}return t},Tr=e=>{if(typeof FormData=="function")try{const t=[];for(const[r,n]of new FormData(e).entries())x(r)||typeof n!="string"||t.push([r,n]);return t.length>0?t:kr(e)}catch{}return kr(e)},be=class ar{constructor(t){this.element=t,this.delegatedHandlers=new Map}get raw(){return this.element}get node(){return this.element}addClass(...t){return this.element.classList.add(...t),this}removeClass(...t){return this.element.classList.remove(...t),this}toggleClass(t,r){return this.element.classList.toggle(t,r),this}attr(t,r){return r===void 0?this.element.getAttribute(t)??"":(this.element.setAttribute(t,r),this)}removeAttr(t){return this.element.removeAttribute(t),this}toggleAttr(t,r){const n=this.element.hasAttribute(t);return r??!n?this.element.setAttribute(t,""):this.element.removeAttribute(t),this}prop(t,r){return r===void 0?this.element[t]:(this.element[t]=r,this)}data(t,r){const n=t.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`);return r===void 0?this.element.getAttribute(`data-${n}`)??"":(this.element.setAttribute(`data-${n}`,r),this)}text(t){return t===void 0?this.element.textContent??"":(this.element.textContent=t,this)}html(t){return fo(this.element,t),this}htmlUnsafe(t){return this.element.innerHTML=t,this}css(t,r){if(typeof t=="string"){if(r!==void 0)return this.element.style.setProperty(t,r),this;const n=this.element.ownerDocument?.defaultView;return!n||typeof n.getComputedStyle!="function"?"":n.getComputedStyle(this.element).getPropertyValue(t)}for(const[n,s]of Object.entries(t))this.element.style.setProperty(n,s);return this}append(t){return this.insertContent(t,"beforeend"),this}prepend(t){return this.insertContent(t,"afterbegin"),this}before(t){return this.insertContent(t,"beforebegin"),this}after(t){return this.insertContent(t,"afterend"),this}wrap(t){const r=typeof t=="string"?document.createElement(t):t;return this.element.parentNode?.insertBefore(r,this.element),r.appendChild(this.element),this}unwrap(){const t=this.element.parentElement;return t&&t.parentNode&&(t.parentNode.insertBefore(this.element,t),t.remove()),this}replaceWith(t){const r=typeof t=="string"?Sr(t):t;return this.element.replaceWith(r),new ar(r)}detach(){return this.remove()}index(){const t=this.element.parentElement;return t?Array.from(t.children).indexOf(this.element):-1}contents(){return Array.from(this.element.childNodes)}offsetParent(){return ve(this.element)?this.element.offsetParent:null}position(){if(!ve(this.element))return{top:0,left:0};const t=this.element;return{top:t.offsetTop,left:t.offsetLeft}}innerWidth(){return rt(this.element,"width")}innerHeight(){return rt(this.element,"height")}outerWidth(t=!1){return nt(this.element,"width",t)}outerHeight(t=!1){return nt(this.element,"height",t)}scrollTo(t={behavior:"smooth"}){return this.element.scrollIntoView(t),this}remove(){return this.element.remove(),this}empty(){return this.element.innerHTML="",this}clone(t=!0){return new ar(this.element.cloneNode(t))}find(t){return Array.from(this.element.querySelectorAll(t))}findOne(t){return this.element.querySelector(t)}closest(t){return this.element.closest(t)}parent(){return this.element.parentElement}children(){return Array.from(this.element.children)}siblings(){const t=this.element.parentElement;return t?Array.from(t.children).filter(r=>r!==this.element):[]}next(){return this.element.nextElementSibling}prev(){return this.element.previousElementSibling}on(t,r){return this.element.addEventListener(t,r),this}once(t,r){return this.element.addEventListener(t,r,{once:!0}),this}off(t,r){return this.element.removeEventListener(t,r),this}trigger(t,r){return this.element.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0})),this}delegate(t,r,n){const s=`${t}:${r}`,o=i=>{const a=i.target.closest(r);a&&this.element.contains(a)&&n(i,a)};return this.delegatedHandlers.has(s)||this.delegatedHandlers.set(s,new Map),this.delegatedHandlers.get(s).set(n,o),this.element.addEventListener(t,o),this}undelegate(t,r,n){const s=`${t}:${r}`,o=this.delegatedHandlers.get(s);if(o){const i=o.get(n);i&&(this.element.removeEventListener(t,i),o.delete(n),o.size===0&&this.delegatedHandlers.delete(s))}return this}matches(t){return this.element.matches(t)}is(t){return this.matches(t)}hasClass(t){return this.element.classList.contains(t)}show(t=""){return this.element.removeAttribute("hidden"),this.element.style.display=t,this}hide(){return this.element.style.display="none",this}toggle(t){const r=this.element.style.display==="none";return t??r?this.show():this.hide()}focus(){return this.element.focus(),this}blur(){return this.element.blur(),this}val(t){const r=this.element;return t===void 0?r.value??"":(r.value=t,this)}serialize(){const t=this.element;if(t.tagName.toLowerCase()!=="form")return{};const r=Object.create(null);for(const[n,s]of Tr(t))if(Object.prototype.hasOwnProperty.call(r,n)){const o=r[n];Array.isArray(o)?o.push(s):r[n]=[o,s]}else r[n]=s;return r}serializeString(){const t=this.element;if(t.tagName.toLowerCase()!=="form")return"";const r=new URLSearchParams;for(const[n,s]of Tr(t))r.append(n,s);return r.toString()}rect(){return this.element.getBoundingClientRect()}offset(){const t=this.element;return{width:t.offsetWidth,height:t.offsetHeight,top:t.offsetTop,left:t.offsetLeft}}insertContent(t,r){Ar(this.element,t,r)}},st=class J{constructor(t){this.elements=t,this.delegatedHandlers=new WeakMap}get length(){return this.elements.length}first(){return this.elements[0]}eq(t){const r=this.elements[t];return r?new be(r):void 0}firstEl(){return this.eq(0)}lastEl(){return this.eq(this.elements.length-1)}each(t){return this.elements.forEach((r,n)=>{t(new be(r),n)}),this}map(t){return this.elements.map(t)}filter(t){return new J(this.elements.filter(t))}reduce(t,r){return this.elements.reduce(t,r)}toArray(){return this.elements.map(t=>new be(t))}addClass(...t){return z(this.elements,r=>r.classList.add(...t)),this}removeClass(...t){return z(this.elements,r=>r.classList.remove(...t)),this}toggleClass(t,r){return z(this.elements,n=>n.classList.toggle(t,r)),this}attr(t,r){return r===void 0?this.first()?.getAttribute(t)??"":(z(this.elements,n=>n.setAttribute(t,r)),this)}removeAttr(t){return z(this.elements,r=>r.removeAttribute(t)),this}toggleAttr(t,r){return z(this.elements,n=>{const s=n.hasAttribute(t);r??!s?n.setAttribute(t,""):n.removeAttribute(t)}),this}text(t){return t===void 0?this.first()?.textContent??"":(z(this.elements,r=>{r.textContent=t}),this)}html(t){if(t===void 0)return this.first()?.innerHTML??"";const r=Er(t);return z(this.elements,n=>{n.innerHTML=r}),this}htmlUnsafe(t){return z(this.elements,r=>{r.innerHTML=t}),this}append(t){return this.insertAll(t,"beforeend"),this}prepend(t){return this.insertAll(t,"afterbegin"),this}before(t){return this.insertAll(t,"beforebegin"),this}after(t){return this.insertAll(t,"afterend"),this}css(t,r){if(typeof t=="string"){if(r!==void 0)return z(this.elements,o=>{o.style.setProperty(t,r)}),this;const n=this.first();if(!n)return"";const s=n.ownerDocument?.defaultView;return!s||typeof s.getComputedStyle!="function"?"":s.getComputedStyle(n).getPropertyValue(t)}return z(this.elements,n=>{for(const[s,o]of Object.entries(t))n.style.setProperty(s,o)}),this}wrap(t){return this.elements.forEach((r,n)=>{const s=typeof t=="string"?document.createElement(t):n===0?t:t.cloneNode(!0);r.parentNode?.insertBefore(s,r),s.appendChild(r)}),this}unwrap(){const t=new Set;for(const r of this.elements)r.parentElement&&t.add(r.parentElement);return t.forEach(r=>{const n=r.parentNode;if(n){for(;r.firstChild;)n.insertBefore(r.firstChild,r);r.remove()}}),this}replaceWith(t){const r=[];return this.elements.forEach((n,s)=>{const o=typeof t=="string"?Sr(t):s===0?t:t.cloneNode(!0);n.replaceWith(o),r.push(o)}),new J(r)}detach(){return this.remove()}index(){const t=this.first();return t?.parentElement?Array.from(t.parentElement.children).indexOf(t):-1}contents(){return Array.from(this.first()?.childNodes??[])}offsetParent(){const t=this.first();return ve(t)?t.offsetParent:null}position(){const t=this.first();return ve(t)?{top:t.offsetTop,left:t.offsetLeft}:{top:0,left:0}}innerWidth(){return rt(this.first(),"width")}innerHeight(){return rt(this.first(),"height")}outerWidth(t=!1){return nt(this.first(),"width",t)}outerHeight(t=!1){return nt(this.first(),"height",t)}show(t=""){return z(this.elements,r=>{r.removeAttribute("hidden"),r.style.display=t}),this}hide(){return z(this.elements,t=>{t.style.display="none"}),this}on(t,r){return z(this.elements,n=>n.addEventListener(t,r)),this}once(t,r){return z(this.elements,n=>n.addEventListener(t,r,{once:!0})),this}off(t,r){return z(this.elements,n=>n.removeEventListener(t,r)),this}trigger(t,r){return z(this.elements,n=>{n.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}))}),this}delegate(t,r,n){const s=`${t}:${r}`;return z(this.elements,o=>{const i=l=>{const c=l.target.closest(r);c&&o.contains(c)&&n(l,c)};this.delegatedHandlers.has(o)||this.delegatedHandlers.set(o,new Map);const a=this.delegatedHandlers.get(o);a.has(s)||a.set(s,new Map),a.get(s).set(n,i),o.addEventListener(t,i)}),this}undelegate(t,r,n){const s=`${t}:${r}`;return z(this.elements,o=>{const i=this.delegatedHandlers.get(o);if(!i)return;const a=i.get(s);if(!a)return;const l=a.get(n);l&&(o.removeEventListener(t,l),a.delete(n),a.size===0&&i.delete(s),i.size===0&&this.delegatedHandlers.delete(o))}),this}find(t){const r=new Set,n=[];for(const s of this.elements){const o=s.querySelectorAll(t);for(let i=0;i<o.length;i++)r.has(o[i])||(r.add(o[i]),n.push(o[i]))}return new J(n)}closest(t){const r=new Set,n=[];for(const s of this.elements){const o=s.closest(t);o&&!r.has(o)&&(r.add(o),n.push(o))}return new J(n)}parent(){const t=new Set,r=[];for(const n of this.elements){const s=n.parentElement;s&&!t.has(s)&&(t.add(s),r.push(s))}return new J(r)}children(){const t=new Set,r=[];for(const n of this.elements)for(const s of Array.from(n.children))t.has(s)||(t.add(s),r.push(s));return new J(r)}siblings(){const t=new Set(this.elements),r=new Set,n=[];for(const s of this.elements){const o=s.parentElement;if(o)for(const i of Array.from(o.children))!t.has(i)&&!r.has(i)&&(r.add(i),n.push(i))}return new J(n)}next(){const t=new Set,r=[];for(const n of this.elements){const s=n.nextElementSibling;s&&!t.has(s)&&(t.add(s),r.push(s))}return new J(r)}prev(){const t=new Set,r=[];for(const n of this.elements){const s=n.previousElementSibling;s&&!t.has(s)&&(t.add(s),r.push(s))}return new J(r)}remove(){return z(this.elements,t=>t.remove()),this}empty(){return z(this.elements,t=>{t.innerHTML=""}),this}insertAll(t,r){if(typeof t=="string"){const s=Er(t);z(this.elements,o=>{o.insertAdjacentHTML(r,s)});return}const n=wr(t);this.elements.forEach((s,o)=>{Ar(s,o===0?n:n.map(i=>i.cloneNode(!0)),r)})}},go=e=>{if(typeof e!="string")return new be(e);const t=document.querySelector(e);if(!t)throw new Error(`bQuery: element not found for selector "${e}"`);return new be(t)},bo=e=>Array.isArray(e)?new st(e):e instanceof NodeList?new st(Array.from(e)):new st(Array.from(document.querySelectorAll(e)));function wo(e){return e==null?[]:Array.isArray(e)?e:[e]}function Eo(e){return Array.from(new Set(e))}function So(e,t){if(t<=0)return[];const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function Ao(e){return e.filter(Boolean)}function ko(e){const t=[];for(const r of e)Array.isArray(r)?t.push(...r):t.push(r);return t}function Tt(e,t){let r;return Object.assign((...n)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...n)},t)},{cancel:()=>{r!==void 0&&(clearTimeout(r),r=void 0)}})}function Cr(e,t){let r=0;return Object.assign((...n)=>{const s=Date.now();s-r>=t&&(r=s,e(...n))},{cancel:()=>{r=0}})}function To(e){let t=!1,r;return(...n)=>(t||(r=e(...n),t=!0),r)}function Co(){}function Ro(e="bQuery"){return`${e}_${Math.random().toString(36).slice(2,9)}`}function Oo(e){return new Promise(t=>setTimeout(t,e))}function Lo(e,t){try{return JSON.parse(e)}catch{return t}}function $o(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}function Po(e,t){return Math.floor(Math.random()*(t-e+1))+e}function Mo(e,t,r){return Math.min(Math.max(e,t),r)}function No(e,t,r,n=!0){return n?e>=t&&e<=r:e>t&&e<r}function Do(e,t=0){const r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?t:r}function Io(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function _o(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function qo(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^[A-Z]/,t=>t.toLowerCase())}function zo(e,t,r="…"){if(t<=0)return"";if(e.length<=t)return e;const n=Math.max(0,t-r.length);return`${e.slice(0,n)}${r}`}function xo(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\w\s-]/g,"").trim().replace(/[\s_-]+/g,"-").toLowerCase()}function jo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fo(e){return typeof Element<"u"&&e instanceof Element}function Uo(e){return!!(e&&typeof e=="object"&&"elements"in e)}function Bo(e){return typeof e=="function"}function Wo(e){return typeof e=="string"}function Ho(e){return typeof e=="number"&&!Number.isNaN(e)}function Qo(e){return typeof e=="boolean"}function Vo(e){return Array.isArray(e)}function Ko(e){return e instanceof Date}function Le(e){return!!(e&&(e instanceof Promise||typeof e=="object"&&"then"in e&&typeof e.then=="function"))}function Yo(e){return typeof e=="object"&&e!==null}var Go={clone:ho,merge:ge,pick:mo,omit:po,hasOwn:vo,debounce:Tt,throttle:Cr,once:To,noop:Co,uid:Ro,isElement:Fo,isCollection:Uo,isEmpty:$o,isPlainObject:ye,isFunction:Bo,isString:Wo,isNumber:Ho,isBoolean:Qo,isArray:Vo,isDate:Ko,isPromise:Le,isObject:Yo,parseJson:Lo,sleep:Oo,randomInt:Po,clamp:Mo,inRange:No,toNumber:Do,capitalize:Io,toKebabCase:_o,toCamelCase:qo,truncate:zo,slugify:xo,escapeRegExp:jo,ensureArray:wo,unique:Eo,chunk:So,compact:Ao,flatten:ko},we=[],$e=0,Ct=new Set,ot=new WeakMap,Rt=(e,t)=>{we.push(e);try{return t()}finally{we.pop()}},Rr=()=>we[we.length-1],Ot=e=>{we.push(void 0);try{return e()}finally{we.pop()}},Or=e=>{if($e>0){Ct.add(e);return}e()},Jo=()=>{for(const e of Array.from(Ct)){Ct.delete(e);try{e()}catch(t){console.error("bQuery reactive: Error in observer during batch flush",t)}}},Xo=()=>{$e+=1},Zo=()=>{$e<=0||($e-=1,$e===0&&Jo())},Lr=(e,t)=>{let r=ot.get(e);r||(r=new Set,ot.set(e,r)),r.add(t)},ei=(e,t)=>{const r=ot.get(e);r&&r.delete(t)},Pe=e=>{const t=ot.get(e);if(t){for(const r of t)r.unsubscribe(e);t.clear()}},ce=e=>{Xo();try{e()}finally{Zo()}},$r={fetch:{headers:{},parseAs:"json"},cookies:{path:"/",sameSite:"Lax",secure:!1},announcer:{politeness:"polite",atomic:!0,delay:16,clearDelay:1e3},pageMeta:{},transitions:{skipOnReducedMotion:!1,classes:[],types:[]},components:{prefix:"bq"}},Me=e=>{if(typeof Headers<"u"&&e instanceof Headers)return new Headers(e);if(Array.isArray(e))return e.map(t=>Me(t));if(ye(e)){const t={};for(const[r,n]of Object.entries(e))t[r]=Me(n);return t}return e},Lt=Me($r),ti=e=>(Lt=Me(ge($r,Lt,e)),Z()),Z=()=>Me(Lt),Ne=[],it=e=>typeof e=="object"&&e!==null&&"_addDisposer"in e,ri=e=>(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function",ni=e=>{const t=typeof e.constructor=="function"?e.constructor.name:void 0;return typeof e=="function"&&(Symbol.toStringTag in e&&e[Symbol.toStringTag]==="AsyncFunction"||t==="AsyncFunction")},De=()=>{for(let e=Ne.length-1;e>=0;e--)if(Ne[e].active)return Ne[e]},si=class{constructor(){this.disposers=[],this._active=!0}get active(){return this._active}_addDisposer(e){this._active&&this.disposers.push(e)}run(e){if(!this._active)throw new Error("bQuery reactive: Cannot run in a stopped effectScope");if(ni(e))throw new Error("bQuery reactive: effectScope.run() only supports synchronous callbacks");Ne.push(this);try{const t=e();if(ri(t))throw this.stop(),new Error("bQuery reactive: effectScope.run() only supports synchronous callbacks");return t}finally{Ne.pop()}}stop(){if(this._active){this._active=!1;for(let e=this.disposers.length-1;e>=0;e--)try{this.disposers[e]()}catch(t){console.error("bQuery reactive: Error in scope cleanup",t)}this.disposers.length=0}}},oi=()=>{const e=new si,t=De();return it(t)&&t._addDisposer(()=>e.stop()),e},Pr=()=>De(),Mr=e=>{const t=De();if(!t||!t.active||!it(t))throw new Error("bQuery reactive: onScopeDispose() must be called inside an active effectScope");t._addDisposer(e)},Ie=class{constructor(e){this.compute=e,this.hasCachedValue=!1,this.dirty=!0,this.disposed=!1,this.subscribers=new Set,this.markDirty=()=>{if(this.disposed)return;this.dirty=!0;const t=Array.from(this.subscribers);for(const r of t)Or(r)}}get value(){if(this.disposed)return this.hasCachedValue||(this.cachedValue=Ot(()=>this.compute()),this.hasCachedValue=!0),this.cachedValue;const e=Rr();return e&&(this.subscribers.add(e),Lr(e,this)),this.dirty&&(this.dirty=!1,Pe(this.markDirty),this.cachedValue=Rt(this.markDirty,this.compute),this.hasCachedValue=!0),this.cachedValue}peek(){return this.disposed?(this.hasCachedValue||(this.cachedValue=Ot(()=>this.compute()),this.hasCachedValue=!0),this.cachedValue):(this.dirty&&(this.dirty=!1,Pe(this.markDirty),this.cachedValue=Rt(this.markDirty,this.compute),this.hasCachedValue=!0),this.cachedValue)}unsubscribe(e){this.subscribers.delete(e)}dispose(){this.disposed=!0,this.dirty&&(this.hasCachedValue=!1),this.dirty=!1,Pe(this.markDirty),this.subscribers.clear()}},D=e=>{const t=new Ie(e),r=De();return it(r)&&r._addDisposer(()=>t.dispose()),t},j=e=>{let t,r=!1;const n=De(),s=()=>{if(t){try{t()}catch(l){console.error("bQuery reactive: Error in effect cleanup",l)}t=void 0}},o=()=>{s(),Pe(a)},i=()=>{r||(r=!0,o())};it(n)&&n._addDisposer(i);const a=()=>{if(!r){s(),Pe(a);try{t=Rt(a,e)}catch(l){console.error("bQuery reactive: Error in effect",l)}r&&o()}};return a(),i},_e=class{constructor(e){this._value=e,this.subscribers=new Set}get value(){const e=Rr();return e&&(this.subscribers.add(e),Lr(e,this)),this._value}set value(e){if(Object.is(this._value,e))return;this._value=e;const t=Array.from(this.subscribers);for(const r of t)Or(r)}peek(){return this._value}update(e){this.value=e(this._value)}dispose(){for(const e of this.subscribers)ei(e,this);this.subscribers.clear()}unsubscribe(e){this.subscribers.delete(e)}},$=e=>new _e(e),ue=e=>Ot(e),ii=e=>{if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}},ai=e=>typeof e=="function"?e():e.value,Nr=(...e)=>{const t=new Headers;for(const r of e)r&&new Headers(r).forEach((n,s)=>{t.set(s,n)});return t},li=e=>typeof e=="string"||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ReadableStream<"u"&&e instanceof ReadableStream?!0:typeof e=="object"&&e!==null&&ArrayBuffer.isView(e),ci=(e,t)=>e==null||li(e)?e:(t.has("content-type")||t.set("content-type","application/json"),JSON.stringify(e)),ui=e=>typeof e=="function"?e():e,fi=(e,t)=>{for(const[r,n]of Object.entries(t))if(n!=null){if(Array.isArray(n)){for(const s of n)s!=null&&e.searchParams.append(r,String(s));continue}e.searchParams.set(r,String(n))}},di=(e,t)=>{const r=typeof window<"u"&&/^https?:/i.test(window.location.href)?window.location.href:"http://localhost",n=t?new URL(t,r).toString():r;return e instanceof URL?new URL(e.toString(),n):new URL(e,n)},hi=async(e,t)=>{if(t==="response")return e;if(t==="text")return await e.text();if(t==="blob")return await e.blob();if(t==="arrayBuffer")return await e.arrayBuffer();if(t==="formData")return await e.formData();const r=await e.text();if(r)try{return JSON.parse(r)}catch(n){const s=e.url?` for ${e.url}`:"";throw new Error(`Failed to parse JSON response${s} (status ${e.status}): ${n instanceof Error?n.message:String(n)}`)}},$t=e=>{const t=e?.trim();return t?t.toUpperCase():void 0},mi=(e,t,r)=>{const n=t instanceof Request?$t(t.method):void 0;return e??n??(r?"POST":void 0)},pi=(e,t,r)=>e||(t instanceof Request?void 0:r),vi=e=>{const t=$t(e.method);let r;if(t!=="GET"&&t!=="HEAD"&&!e.bodyUsed)try{r=e.clone().body??void 0}catch{r=void 0}return{method:t,headers:e.headers,body:r,cache:e.cache,credentials:e.credentials,integrity:e.integrity,keepalive:e.keepalive,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,signal:e.signal}},Dr=(e,t={})=>{const r=t.immediate??!0,n=$(t.defaultValue),s=$(null),o=$("idle"),i=D(()=>o.value==="pending");let a=0,l=!1,c=()=>{};const f=()=>{a+=1,n.value=t.defaultValue,s.value=null,o.value="idle"},m=()=>{l||(l=!0,a+=1,c())},d=async()=>{if(l)return n.peek();const p=++a;o.value="pending",s.value=null;try{const u=await e(),h=t.transform?t.transform(u):u;return l||p!==a?n.peek():(n.value=h,o.value="success",t.onSuccess?.(h),h)}catch(u){const h=ii(u);return l||p!==a||(s.value=h,o.value="error",t.onError?.(h)),n.peek()}};if(t.watch?.length){let p=!1;c=j(()=>{for(const u of t.watch??[])ai(u);if(!p){p=!0,r&&ue(()=>d());return}ue(()=>d())})}else r&&d();return{data:n,error:s,status:o,pending:i,execute:d,refresh:d,abort:()=>{},clear:f,dispose:m}},yi=e=>e>=200&&e<300,Ir=(e,t)=>e instanceof DOMException&&e.name===t,at=e=>Ir(e,"TimeoutError"),_r=e=>Ir(e,"AbortError"),gi=e=>{if(_r(e)||at(e)||e.code==="ABORT"||e.code==="TIMEOUT")return!1;const t=e.status;return t===void 0||t>=500},bi=e=>{if(e!=null)return typeof e=="number"?{count:e}:e},wi=(e,t)=>e==null?Math.min(1e3*2**t,3e4):typeof e=="number"?e:e(t),Ei=(e,t)=>new Promise((r,n)=>{if(t?.aborted){n(t.reason??new DOMException("The operation was aborted.","AbortError"));return}let s=!1,o;const i=()=>{s||(s=!0,clearTimeout(o),t?.removeEventListener("abort",i),n(t?.reason??new DOMException("The operation was aborted.","AbortError")))};o=setTimeout(()=>{s||(s=!0,t?.removeEventListener("abort",i),r())},e),t?.addEventListener("abort",i,{once:!0})}),K=(e,t={})=>{const r=Z().fetch,n=t.parseAs??r?.parseAs??"json",s=t.fetcher??fetch,o=t.validateStatus??yi;let i=null;const a=(c,f)=>{const m=f||at(c)||at(i?.signal.reason);return Object.assign(new Error(m?`Request timeout of ${t.timeout}ms exceeded`:"Request aborted"),{code:m?"TIMEOUT":"ABORT"})},l=Dr(async()=>{const c=ui(e),f=typeof c=="string"||c instanceof URL?di(c,t.baseUrl??r?.baseUrl):c instanceof Request&&t.query?new URL(c.url):null;f&&t.query&&fi(f,t.query);const m=Nr(r?.headers,c instanceof Request?c.headers:void 0,t.headers),d=t.body!=null,p=$t(t.method),u=mi(p,c,d),h=u==="GET"||u==="HEAD"?u:null;if(d&&h)throw new Error(`Cannot send a request body with ${h} requests`);const v=pi(p,c,u),b=bi(t.retry),y=(b?.count??0)+1,w=new AbortController;i=w;let E,k=!1,A;t.signal&&(t.signal.aborted?w.abort(t.signal.reason):(A=()=>w.abort(t.signal?.reason),t.signal.addEventListener("abort",A,{once:!0}))),t.timeout&&t.timeout>0&&(E=setTimeout(()=>{k=!0,w.abort(new DOMException("Request timeout","TimeoutError"))},t.timeout));const S={...t,method:v,headers:m};delete S.baseUrl,delete S.query,delete S.parseAs,delete S.fetcher,delete S.defaultValue,delete S.immediate,delete S.watch,delete S.transform,delete S.onSuccess,delete S.onError,delete S.timeout,delete S.retry,delete S.validateStatus;let T=f??c;c instanceof Request&&f&&f.toString()!==c.url&&(T=new Request(f.toString(),vi(c)));const P=()=>{const O=new Headers(m);return{...S,headers:O,body:ci(t.body,O),signal:w.signal}};if(y>1&&typeof ReadableStream<"u"&&t.body instanceof ReadableStream)throw new Error("Cannot retry requests with ReadableStream bodies");if(y>1&&typeof Request<"u"&&T instanceof Request&&T.body!==null)throw new Error("Cannot retry requests with non-replayable Request bodies");let R;try{for(let O=0;O<y;O++)try{const C=await s(T,P());if(!o(C.status))throw Object.assign(new Error(`Request failed with status ${C.status}`),{response:C,status:C.status,statusText:C.statusText});return await hi(C,n)}catch(C){const L=C instanceof Error?C:new Error(String(C));if(w.signal.aborted||_r(L)||at(L))throw a(w.signal.aborted?w.signal.reason:L,k);if(R=L,!(b&&(b.retryOn??gi)(L,O))||O>=y-1)throw L;await Ei(wi(b.delay,O),w.signal)}throw R}finally{E!==void 0&&clearTimeout(E),t.signal&&A&&t.signal.removeEventListener("abort",A),i===w&&(i=null)}},t);return l.abort=()=>{i&&i.abort(new DOMException("Request aborted","AbortError"))},l};function Si(e={}){return(t,r={})=>{const n=e,s=ge({},n.query??{},r.query??{});return K(t,{...n,...r,headers:Nr(n.headers,r.headers),query:Object.keys(s).length>0?s:void 0})}}var ie=class extends Error{constructor(e,t,r,n){super(e),this.name="HttpError",this.config=t,this.code=r,this.response=n}};function qr(){const e=[];let t=0;return{use(r,n){const s=t++;return e.push({id:s,fulfilled:r,rejected:n}),s},eject(r){const n=e.findIndex(s=>s?.id===r);n!==-1&&(e[n]=null)},clear(){e.length=0},forEach(r){for(const n of e)n&&r(n)}}}var Ai=e=>e>=200&&e<300,ki=e=>{if(e.code==="PARSE")return!1;if(e.code==="TIMEOUT"||e.code==="NETWORK")return!0;const t=e.response?.status;return t!==void 0&&t>=500},Ti=e=>{if(e!=null)return typeof e=="number"?{count:e}:e},Ci=(e,t)=>e==null?Math.min(1e3*2**t,3e4):typeof e=="number"?e:e(t),Ri=(e,t)=>new Promise((r,n)=>{if(t?.aborted){n(t.reason??new DOMException("The operation was aborted.","AbortError"));return}let s;const o=()=>{clearTimeout(s),t?.removeEventListener("abort",o),n(t?.reason??new DOMException("The operation was aborted.","AbortError"))};s=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),t&&t.addEventListener("abort",o,{once:!0})}),zr=(...e)=>{const t=new Headers;for(const r of e)r&&new Headers(r).forEach((n,s)=>{t.set(s,n)});return t},Oi=e=>typeof e=="string"||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ReadableStream<"u"&&e instanceof ReadableStream?!0:typeof e=="object"&&e!==null&&ArrayBuffer.isView(e),Li=(e,t)=>e==null||Oi(e)?e:(t.has("content-type")||t.set("content-type","application/json"),JSON.stringify(e)),$i=(e,t)=>{for(const[r,n]of Object.entries(t))if(n!=null){if(Array.isArray(n)){for(const s of n)s!=null&&e.searchParams.append(r,String(s));continue}e.searchParams.set(r,String(n))}},Pi=(e,t)=>{const r=typeof window<"u"&&/^https?:/i.test(window.location.href)?window.location.href:"http://localhost",n=t?new URL(t,r).toString():r;return new URL(e,n)},Mi=async(e,t,r)=>{if(t==="response")return e;if(t==="text")return await e.text();if(t==="blob")return await e.blob();if(t==="arrayBuffer")return await e.arrayBuffer();if(t==="formData")return await e.formData();const n=await e.text();if(n)try{return JSON.parse(n)}catch(s){throw new ie(`Failed to parse JSON response${e.url?` for ${e.url}`:""} (status ${e.status}): ${s instanceof Error?s.message:String(s)}`,r,"PARSE",{data:n,status:e.status,statusText:e.statusText,headers:e.headers,config:r})}},Ni=(e,t)=>{const r=e.body;if(!r)return e;const n=parseInt(e.headers.get("content-length")??"0",10)||0;let s=0;const o=r.getReader(),i=new ReadableStream({async pull(a){const{done:l,value:c}=await o.read();if(l){a.close();return}s+=c.byteLength,t({loaded:s,total:n,percent:n>0?Math.round(s/n*100):void 0}),a.enqueue(c)},cancel(a){o.cancel(a)}});return new Response(i,{status:e.status,statusText:e.statusText,headers:e.headers})},Di=async e=>{const t=Z().fetch,r=e.parseAs??t?.parseAs??"json",n=e.fetcher??fetch,s=e.validateStatus??Ai,o=Pi(e.url??"/",e.baseUrl??t?.baseUrl);e.query&&$i(o,e.query);const i=zr(t?.headers,e.headers),a=Li(e.body,i),l={};e.method&&(l.method=e.method.toUpperCase()),l.headers=i,a!=null&&(l.body=a),e.cache&&(l.cache=e.cache),e.credentials&&(l.credentials=e.credentials),e.integrity&&(l.integrity=e.integrity),e.keepalive!==void 0&&(l.keepalive=e.keepalive),e.mode&&(l.mode=e.mode),e.redirect&&(l.redirect=e.redirect),e.referrer&&(l.referrer=e.referrer),e.referrerPolicy&&(l.referrerPolicy=e.referrerPolicy);let c,f=e.signal,m;if(e.timeout&&e.timeout>0){const d=new AbortController;e.signal&&(m=()=>d.abort(e.signal?.reason),e.signal.addEventListener("abort",m,{once:!0})),c=setTimeout(()=>{d.abort(new DOMException("Request timeout","TimeoutError"))},e.timeout),f=d.signal}f&&(l.signal=f);try{let d=await n(o.toString(),l);if(e.onDownloadProgress&&(d=Ni(d,e.onDownloadProgress)),!s(d.status))throw new ie(`Request failed with status ${d.status}`,e,"ERR_BAD_RESPONSE",{data:void 0,status:d.status,statusText:d.statusText,headers:d.headers,config:e});return{data:await Mi(d,r,e),status:d.status,statusText:d.statusText,headers:d.headers,config:e}}catch(d){if(d instanceof ie)throw d;if(d instanceof DOMException&&(d.name==="AbortError"||d.name==="TimeoutError")){const p=d.name==="TimeoutError"||d.message==="Request timeout";throw new ie(p?`Request timeout of ${e.timeout}ms exceeded`:"Request aborted",e,p?"TIMEOUT":"ABORT")}throw new ie(d instanceof Error?d.message:String(d),e,"NETWORK")}finally{c!==void 0&&clearTimeout(c),e.signal&&m&&e.signal.removeEventListener("abort",m)}};function Pt(e={}){const t=qr(),r=qr(),n=i=>{const a=ge({},e.query??{},i.query??{});return{...e,...i,headers:zr(e.headers,i.headers),query:Object.keys(a).length>0?a:void 0}},s=async i=>{let a=i;const l=[];t.forEach(d=>l.push(d));for(const{fulfilled:d,rejected:p}of l)try{d&&(a=await d(a))}catch(u){if(p){const h=await p(u);if(ye(h))a=h;else throw u}else throw u}const c=Ti(a.retry);let f;const m=(c?.count??0)+1;for(let d=0;d<m;d++)try{let p=await Di(a);const u=[];r.forEach(h=>u.push(h));for(const{fulfilled:h,rejected:v}of u)try{h&&(p=await h(p))}catch(b){if(v){const y=await v(b);if(y&&typeof y=="object"&&"data"in y)p=y;else throw b}else throw b}return p}catch(p){const u=p instanceof ie?p:new ie(p instanceof Error?p.message:String(p),a,"NETWORK");if(f=u,!(c&&(c.retryOn??ki)(u,d))||d>=m-1){const v=[];r.forEach(y=>v.push(y));let b=u;for(const{rejected:y}of v)if(y)try{const w=await y(b);if(w&&typeof w=="object"&&"data"in w)return w;w!=null&&(b=w)}catch(w){w!=null&&(b=w)}throw b instanceof Error||(b=u),b}const h=c?Ci(c.delay,d):0;c?.onRetry?.(u,d+1),await Ri(h,a.signal)}throw f},o=i=>s(n(i));return{request:o,get:(i,a={})=>o({...a,url:i,method:"GET"}),post:(i,a,l={})=>o({...l,url:i,method:"POST",body:a}),put:(i,a,l={})=>o({...l,url:i,method:"PUT",body:a}),patch:(i,a,l={})=>o({...l,url:i,method:"PATCH",body:a}),delete:(i,a={})=>o({...a,url:i,method:"DELETE"}),head:(i,a={})=>o({...a,url:i,method:"HEAD"}),options:(i,a={})=>o({...a,url:i,method:"OPTIONS"}),interceptors:{request:t,response:r},defaults:e}}var Ii=Pt();function _i(e={}){const{concurrency:t=6}=e;if(!Number.isInteger(t)||t<1)throw new Error("Request queue concurrency must be a positive integer");const r=[];let n=0;const s=()=>{for(;n<t&&r.length>0;){const o=r.shift();n++,Promise.resolve().then(o.execute).then(o.resolve,o.reject).finally(()=>{n--,s()})}};return{add(o){return new Promise((i,a)=>{r.push({execute:o,resolve:i,reject:a}),s()})},get pending(){return n},get size(){return r.length},clear(){const o=r.splice(0);for(const i of o)i.reject(new Error("Request queue cleared"))}}}var qi=(e,t)=>{const r=D(e);return{get value(){return r.value},set value(n){t(n)},peek(){return r.peek()}}},zi=(e,t={})=>{const{initialPage:r=1,...n}=t,s=$(r),o=K(()=>e(s.value),{...n,watch:n.watch});return{...o,page:s,next:async()=>(s.value=s.peek()+1,o.execute()),prev:async()=>{const c=s.peek();return c>1&&(s.value=c-1),o.execute()},goTo:async c=>(s.value=Math.max(1,c),o.execute())}},xi=(e,t)=>{const{getNextCursor:r,transform:n,initialCursor:s,immediate:o=!0,onSuccess:i,onError:a,...l}=t,c=$([]),f=$(t.defaultValue),m=$(null),d=$("idle"),p=D(()=>d.value==="pending"),u=$(s),h=D(()=>c.value.length===0||u.value!==void 0);let v=!1,b=0;const y=S=>n?n(S):S,w=async()=>{if(v)return f.peek();const S=++b;d.value="pending",m.value=null;try{const T=K(e(u.peek()),{...l,immediate:!1,watch:void 0}),P=await T.execute(),R=T.error.peek();if(T.dispose(),v||S!==b)return f.peek();if(R)return m.value=R,d.value="error",a?.(R),f.peek();if(P!==void 0){const O=P,C=[...c.peek(),O];c.value=C,u.value=r(O,C);const L=y(C);return f.value=L,d.value="success",i?.(L),L}return d.value="success",f.peek()}catch(T){if(v||S!==b)return f.peek();const P=T instanceof Error?T:new Error(String(T));return m.value=P,d.value="error",a?.(P),f.peek()}},E=async()=>(c.value=[],u.value=s,f.value=t.defaultValue,m.value=null,d.value="idle",b+=1,w()),k=()=>{b+=1,c.value=[],u.value=s,f.value=t.defaultValue,m.value=null,d.value="idle"},A=()=>{v||(v=!0,b+=1)};return o&&w(),{data:f,pages:c,error:m,status:d,pending:p,hasMore:h,fetchNextPage:w,refresh:E,clear:k,dispose:A}},ji=(e,t)=>{let r=!1,n=null;try{if(n=globalThis.localStorage,n){const i=`__bquery_test_${Math.random().toString(36).slice(2,9)}__`,a="__test__";try{n.setItem(i,a),n.getItem(i),r=!0}finally{try{n.removeItem(i)}catch{}}}}catch{r=!1}let s=t;if(r&&n)try{const i=n.getItem(e);i!==null&&(s=JSON.parse(i))}catch{}const o=$(s);return r&&n&&j(()=>{try{n.setItem(e,JSON.stringify(o.value))}catch{}}),o},Fi=(e,t)=>{const{interval:r,enabled:n=!0,pauseOnHidden:s=!0,pauseOnOffline:o=!0,immediate:i=!0,...a}=t;if(!Number.isFinite(r)||r<1)throw new Error("Polling interval must be a finite number of at least 1");const l=$(!1),c=$(!1),f=$(!1),m=typeof n=="function"?n:()=>n,d=D(()=>m()&&!l.value&&!(s&&c.value)&&!(o&&f.value)),p=K(e,{...a,immediate:i&&m()});let u,h=[];const v=()=>{b(),u=setInterval(()=>{p.execute()},r)},b=()=>{u!==void 0&&(clearInterval(u),u=void 0)},y=j(()=>{const k=d.value;ue(()=>{k?v():b()})});if(s&&typeof document<"u"){c.value=document.hidden;const k=()=>{c.value=document.hidden};document.addEventListener("visibilitychange",k),h.push(()=>document.removeEventListener("visibilitychange",k))}if(o&&typeof window<"u"){const k=()=>{f.value=!1},A=()=>{f.value=!0};window.addEventListener("online",k),window.addEventListener("offline",A),h.push(()=>{window.removeEventListener("online",k),window.removeEventListener("offline",A)}),f.value=typeof navigator<"u"&&navigator.onLine!==void 0?!navigator.onLine:!1}const w=p.dispose;return{...p,pause:()=>{l.value=!0},resume:()=>{l.value=!1},isActive:d,dispose:()=>{b(),y();for(const k of h)k();h=[],w()}}},xr=Symbol("bquery.readonlySignal"),jr=e=>typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,xr),I=e=>Object.defineProperties({},{value:{get(){return e.value},enumerable:!0},peek:{value(){return e.peek()},enumerable:!0},[xr]:{value:!0,enumerable:!1,configurable:!1,writable:!1}}),Ui=(e,t={})=>{const{optimistic:r=!1,onMutationSuccess:n,onMutationError:s,...o}=t,i=K(e,{...o}),a=$(!1),l=D(()=>a.value);let c=!1;const f=()=>{const v=typeof e=="function"?e():e;return v instanceof URL?v.toString():v},m=()=>{const{defaultValue:v,transform:b,onSuccess:y,onError:w,...E}=o;return E},d=async(v,b,y,w)=>{if(c)return i.data.peek();const E=i.data.peek();r&&w!==void 0&&(i.data.value=w),a.value=!0,i.error.value=null;try{const k=K(f(),{...m(),method:b,body:y??void 0,immediate:!1,watch:void 0}),A=await k.execute(),S=k.error.peek();return k.dispose(),c?i.data.peek():S?(r&&w!==void 0&&(i.data.value=E),i.error.value=S,i.status.value="error",a.value=!1,s?.(S,v),i.data.peek()):(b!=="DELETE"&&A!==void 0&&(i.data.value=A),a.value=!1,i.status.value="success",n?.(A,v),A)}catch(k){if(c)return i.data.peek();r&&w!==void 0&&(i.data.value=E);const A=k instanceof Error?k:new Error(String(k));return i.error.value=A,i.status.value="error",a.value=!1,s?.(A,v),i.data.peek()}},p={fetch:()=>i.execute(),create:v=>d("create","POST",v),update:v=>{const b=i.data.peek();return d("update","PUT",v,r&&b!==void 0?{...b,...v}:void 0)},patch:v=>{const b=i.data.peek();return d("patch","PATCH",v,r&&b!==void 0?{...b,...v}:void 0)},remove:async()=>{await d("remove","DELETE"),!c&&i.error.peek()==null&&(i.data.value=void 0)}},u=i.dispose,h=()=>{c||(c=!0,u())};return{data:i.data,error:i.error,status:i.status,pending:i.pending,isMutating:l,actions:p,refresh:i.execute,clear:i.clear,dispose:h}},Bi=(e,t={})=>{const{method:r="POST",...n}=t,s=$(void 0),o=$(null),i=$("idle"),a=D(()=>i.value==="pending");return{data:s,error:o,status:i,pending:a,submit:async f=>{i.value="pending",o.value=null;try{const m=K(e,{...n,method:r,body:f,immediate:!1,watch:void 0}),d=await m.execute(),p=m.error.peek();if(m.dispose(),p){o.value=p,i.value="error";return}return s.value=d,i.value="success",d}catch(m){o.value=m instanceof Error?m:new Error(String(m)),i.value="error";return}},clear:()=>{s.value=void 0,o.value=null,i.value="idle"}}},Wi=(e,t={})=>{const r=Pt({...t});let n=e;for(;n.endsWith("/");)n=n.slice(0,-1);return{list:s=>r.get(n,s),get:(s,o)=>r.get(`${n}/${encodeURIComponent(String(s))}`,o),create:(s,o)=>r.post(n,s,o),update:(s,o,i)=>r.put(`${n}/${encodeURIComponent(String(s))}`,o,i),patch:(s,o,i)=>r.patch(`${n}/${encodeURIComponent(String(s))}`,o,i),remove:(s,o)=>r.delete(`${n}/${encodeURIComponent(String(s))}`,o),http:r}},Hi=(e,t={})=>{const{getId:r=y=>y.id,optimistic:n=!1,onMutationSuccess:s,onMutationError:o,...i}=t,a=K(e,{...i}),l=$(!1),c=D(()=>l.value);let f=!1;const m=()=>{const y=typeof e=="function"?e():e;return y instanceof URL?y.toString():y},d=()=>{let y=m();for(;y.endsWith("/");)y=y.slice(0,-1);return y},p=()=>{const{defaultValue:y,transform:w,onSuccess:E,onError:k,...A}=i;return A},u=async(y,w,E,k,A,S)=>{if(!f){n&&A&&A(),l.value=!0,a.error.value=null;try{const T=K(`${d()}${E}`,{...p(),method:w,body:k??void 0,immediate:!1,watch:void 0}),P=await T.execute(),R=T.error.peek();if(T.dispose(),f)return;if(R){n&&S&&S(),a.error.value=R,a.status.value="error",l.value=!1,o?.(R,y);return}return l.value=!1,a.status.value="success",s?.(y),P}catch(T){if(f)return;n&&S&&S();const P=T instanceof Error?T:new Error(String(T));a.error.value=P,a.status.value="error",l.value=!1,o?.(P,y);return}}},h={fetch:()=>a.execute(),add:async y=>{const w=a.data.peek(),E=y,k=w?.length??0,A=await u("add","POST","",y,n?()=>{a.data.value=[...w??[],E]}:void 0,n?()=>{a.data.value=w}:void 0);if(A!==void 0&&!f){const S=a.data.peek()??[];if(n){const T=[...S];k<T.length&&T[k]===E?T[k]=A:T.push(A),a.data.value=T}else a.data.value=[...S,A]}return A},update:async(y,w)=>{const E=a.data.peek(),k=await u("update","PUT",`/${encodeURIComponent(String(y))}`,w,n&&E?()=>{a.data.value=E.map(A=>r(A)===y?{...A,...w}:A)}:void 0,n?()=>{a.data.value=E}:void 0);if(k!==void 0&&!f){const A=a.data.peek()??[];a.data.value=A.map(S=>r(S)===y?k:S)}return k},patch:async(y,w)=>{const E=a.data.peek(),k=await u("patch","PATCH",`/${encodeURIComponent(String(y))}`,w,n&&E?()=>{a.data.value=E.map(A=>r(A)===y?{...A,...w}:A)}:void 0,n?()=>{a.data.value=E}:void 0);if(k!==void 0&&!f){const A=a.data.peek()??[];a.data.value=A.map(S=>r(S)===y?k:S)}return k},remove:async y=>{const w=a.data.peek();if(await u("remove","DELETE",`/${encodeURIComponent(String(y))}`,void 0,n&&w?()=>{a.data.value=w.filter(E=>r(E)!==y)}:void 0,n?()=>{a.data.value=w}:void 0),!n&&!f&&a.error.peek()==null){const E=a.data.peek()??[];a.data.value=E.filter(k=>r(k)!==y)}}},v=a.dispose,b=()=>{f||(f=!0,v())};return{data:a.data,error:a.error,status:a.status,pending:a.pending,isMutating:c,actions:h,refresh:a.execute,clear:a.clear,dispose:b}},Mt=new Map;function Qi(e,t){const r=Mt.get(e);if(r)return r;const n=t().finally(()=>{Mt.delete(e)});return Mt.set(e,n),n}var fe=e=>e instanceof _e,qe=e=>e instanceof Ie,Vi=e=>e instanceof _e||e instanceof Ie||jr(e)?e.value:e,Nt=(e,t,r={})=>{const{immediate:n=!1,equals:s=Object.is}=r;let o,i=!0;return j(()=>{const a=e.value;if(i){i=!1,o=a,n&&t(a,void 0);return}s(a,o)||(t(a,o),o=a)})},Ki=(e,t,r,n={})=>{const{immediate:s=!1,equals:o=Object.is}=n,i=Number.isFinite(r)?Math.max(0,r):0;let a=!1,l,c;const f=()=>{m.cancel(),a=!1,c=void 0},m=Tt(()=>{if(a){try{t(l,c)}catch(p){console.error("bQuery reactive: Error in watchDebounce callback",p)}a=!1,c=void 0}},i);s&&t(e.peek(),void 0);const d=Nt(e,(p,u)=>{a||(c=u),l=p,a=!0,m()},{equals:o});return Pr()&&Mr(f),()=>{d(),f()}},Yi=(e,t,r,n={})=>{const{immediate:s=!1,equals:o=Object.is}=n,i=Cr((l,c)=>{t(l,c)},Number.isFinite(r)?Math.max(0,r):0);s&&i(e.peek(),void 0);const a=Nt(e,(l,c)=>{i(l,c)},{equals:o});return()=>{a(),i.cancel()}};function Fr(e){return e===!1?!1:e===!0||e===void 0?{}:e}var Gi=e=>e?e===!0?{}:e:!1,Ur=(e,t)=>{const r=t.delay??1e3,n=t.factor??2,s=t.maxDelay??3e4;return Math.min(r*n**e,s)},Dt=(e,t)=>{if(typeof t=="string"||t instanceof Blob||t instanceof ArrayBuffer){e.send(t);return}if(ArrayBuffer.isView(t)){e.send(t);return}if(typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer){e.send(t);return}throw new TypeError("Unsupported WebSocket payload type.")},Br=(e,t={})=>{const{protocols:r,immediate:n=!0,historySize:s=0,onOpen:o,onMessage:i,onClose:a,onError:l,onReconnect:c}=t,f=t.serialize??(N=>JSON.stringify(N)),m=t.deserialize??(N=>{const W=N.data;if(typeof W=="string")try{return JSON.parse(W)}catch{return W}return W}),d=$("CLOSED"),p=$(void 0),u=$(null),h=$([]),v=$(0),b=$(0),y=$(0),w=D(()=>d.value==="OPEN");let E=null,k=!1,A=!1,S,T,P,R=0,O=!1,C=0;const L=[],M=Fr(t.autoReconnect),_=Gi(t.heartbeat),U=()=>{if(!_)return;q();const N=_.interval??3e4,W=_.pongTimeout??1e4,V=_.message??"ping";T=setInterval(()=>{E?.readyState===WebSocket.OPEN&&(C=Date.now(),Dt(E,V),P!==void 0&&clearTimeout(P),P=setTimeout(()=>{E?.close(4e3,"Heartbeat timeout")},W))},N)},q=()=>{T!==void 0&&(clearInterval(T),T=void 0),P!==void 0&&(clearTimeout(P),P=void 0)},Q=()=>{P!==void 0&&(clearTimeout(P),P=void 0),C>0&&(b.value=Date.now()-C,C=0)},oe=N=>{if(k||A||!M)return;const W=M.maxAttempts??1/0;if(R>=W||M.shouldReconnect&&!M.shouldReconnect(N,R))return;const V=Ur(R,M);S=setTimeout(()=>{R++,v.value=R,O=!0,ir()},V)},Oe=()=>{S!==void 0&&(clearTimeout(S),S=void 0)},or=()=>{if(!E||E.readyState!==WebSocket.OPEN)return;let N=0;for(;N<L.length&&E.readyState===WebSocket.OPEN;N++)Dt(E,L[N]);N>0&&L.splice(0,N)},Ze=()=>{const N=typeof e=="function"?e():e;return N instanceof URL?N.toString():N},ir=()=>{if(!k){Oe(),E&&(q(),C=0,E.onopen=null,E.onmessage=null,E.onclose=null,E.onerror=null,(E.readyState===WebSocket.OPEN||E.readyState===WebSocket.CONNECTING)&&E.close(),E=null),A=!1,d.value="CONNECTING",u.value=null;try{E=new WebSocket(Ze(),r)}catch{d.value="CLOSED";return}E.onopen=N=>{d.value="OPEN";const W=O,V=R;R=0,v.value=0,O=!1,or(),U(),o?.(N),W&&c?.(V)},E.onmessage=N=>{if(_){const V=_.responseMessage;(V===void 0||N.data===V)&&Q()}const W=m(N);if(p.value=W,s>0){const V=[...h.peek(),W];h.value=V.length>s?V.slice(-s):V}i?.(W,N)},E.onclose=N=>{d.value="CLOSED",q(),A||(y.value=Date.now()),a?.(N),!A&&!k&&oe(N)},E.onerror=N=>{u.value=N,l?.(N)}}},Ws=(N,W)=>{A=!0,Oe(),q(),E&&(E.readyState===WebSocket.OPEN||E.readyState===WebSocket.CONNECTING)&&(d.value="CLOSING",E.close(N,W))},qf=N=>{k||Hs(f(N))},Hs=N=>{k||(E?.readyState===WebSocket.OPEN?Dt(E,N):L.push(N))},zf=()=>{k||(k=!0,Ws(),L.length=0,E=null)};return n&&ir(),{status:d,data:p,error:u,history:h,isConnected:w,reconnectAttempts:v,latency:b,lastDisconnectedAt:y,send:qf,sendRaw:Hs,open:ir,close:Ws,dispose:zf}},Ji=(e,t={},r={})=>{const n=r.getChannel??(f=>f.channel),s=r.wrap??((f,m)=>({channel:f,data:m})),o=new Map,i=new Map,a=Br(e,{...t,onMessage:(f,m)=>{const d=n(f);if(d!==void 0){const p=o.get(d);p&&(p.value=f)}t.onMessage?.(f,m)}});return{subscribe:f=>{let m=o.get(f);m||(m=$(void 0),o.set(f,m)),i.set(f,(i.get(f)??0)+1);let d=!1;return{data:m,unsubscribe:()=>{if(d)return;d=!0;const p=(i.get(f)??1)-1;p<=0?(i.delete(f),o.delete(f)):i.set(f,p)}}},publish:(f,m)=>{a.send(s(f,m))},ws:a}},Xi=(e,t={})=>{const{immediate:r=!0,events:n=[],eventSourceInit:s,onOpen:o,onMessage:i,onError:a}=t,l=t.deserialize??(O=>{try{return JSON.parse(O)}catch{return O}}),c=$("CLOSED"),f=$(void 0),m=$(void 0),d=$(null),p=D(()=>c.value==="OPEN"),u=Fr(t.autoReconnect);let h=null,v=!1,b=!1,y,w=0;const E=()=>{const O=typeof e=="function"?e():e;return O instanceof URL?O.toString():O},k=O=>C=>{const L=l(C.data);f.value=L,m.value=O,i?.(L,C)},A=()=>{y!==void 0&&(clearTimeout(y),y=void 0)},S=()=>{if(v||b||!u)return;const O=u.maxAttempts??1/0;if(w>=O)return;const C=Ur(w,u);y=setTimeout(()=>{w++,T()},C)},T=()=>{if(!v){A(),h&&(h.close(),h=null),b=!1,c.value="CONNECTING",d.value=null;try{h=new EventSource(E(),s)}catch{c.value="CLOSED";return}h.onopen=O=>{c.value="OPEN",w=0,o?.(O)},h.onerror=O=>{d.value=O,a?.(O),h?.readyState===EventSource.CLOSED&&(c.value="CLOSED",!b&&!v&&S())},h.addEventListener("message",k("message"));for(const O of n)h.addEventListener(O,k(O))}},P=()=>{b=!0,A(),h&&(h.close(),h=null),c.value="CLOSED"},R=()=>{v||(v=!0,P())};return r&&T(),{status:c,data:f,eventName:m,error:d,isConnected:p,open:T,close:P,dispose:R}},F=class extends Error{constructor(e,t,r){super(e),this.name="TaskWorkerError",this.code=t,r!==void 0&&(this.cause=r)}},It=class extends F{constructor(e="Concurrency tasks are not supported in this environment.",t){super(e,"UNSUPPORTED",t),this.name="TaskWorkerUnsupportedError"}},de=class extends F{constructor(e,t){super(e,"SERIALIZATION",t),this.name="TaskWorkerSerializationError"}},lt=class extends F{constructor(e,t){super(e,"TIMEOUT",t),this.name="TaskWorkerTimeoutError"}},ae=class extends F{constructor(e="The worker task was aborted.",t){super(e,"ABORT",t),this.name="TaskWorkerAbortError"}},Zi=new Set(["ABORT","BUSY","METHOD_NOT_FOUND","QUEUE_CLEARED","QUEUE_FULL","SERIALIZATION","TERMINATED","TIMEOUT","UNSUPPORTED","WORKER"]),ea=/\{\s*\[native code\]\s*\}$/u,ta=e=>typeof e=="string"&&Zi.has(e),ct=e=>{if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return e},ze=e=>{const t=Function.prototype.toString.call(e).trim();if(!t||ea.test(t))throw new de("Task handlers must be standalone user-defined functions or arrow functions.");try{if(typeof new Function(`return (${t});`)()!="function")throw new TypeError("Task handler did not revive as a function.")}catch(r){throw new de("Task handlers must be standalone functions that can be reconstructed in a worker context.",r)}return t},Wr=(e,t)=>{const r=new Blob([e],{type:"text/javascript"}),n=URL.createObjectURL(r);try{return new Worker(n,t?{name:t}:void 0)}finally{URL.revokeObjectURL(n)}},Hr=e=>{const t=e?.message||"Worker task failed.",r=ta(e?.code)?e.code:"WORKER",n=r==="TIMEOUT"?new lt(t):new F(t,r);return n.name=e?.name||n.name,e?.stack&&(n.stack=e.stack),n};function Qr(){const e=typeof globalThis.Worker=="function",t=typeof globalThis.Blob=="function",r=typeof globalThis.URL<"u"&&globalThis.URL!==null&&typeof globalThis.URL.createObjectURL=="function"&&typeof globalThis.URL.revokeObjectURL=="function";return{worker:e,blob:t,objectUrl:r,abortController:typeof globalThis.AbortController=="function",supported:e&&t&&r}}function _t(){return Qr().supported}var Vr="bq:rpc",ra=e=>{const t=Object.keys(e);if(t.length===0)throw new de("RPC workers require at least one standalone method handler.");return t.map(r=>{const n=e[r];if(typeof n!="function")throw new de(`RPC handler "${r}" must be a standalone function.`);return[r,ze(n)]})},na=e=>`'use strict';
1
+ var bQuery=(function(y){Object.defineProperty(y,Symbol.toStringTag,{value:"Module"});var cn="bquery-sanitizer",ln=new Set(["a","abbr","address","article","aside","b","bdi","bdo","blockquote","br","button","caption","cite","code","col","colgroup","data","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","input","ins","kbd","label","legend","li","main","mark","nav","ol","optgroup","option","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","u","ul","var","wbr"]),ar=new Set(["script","iframe","frame","frameset","object","embed","applet","link","meta","style","base","template","math","svg","foreignobject","noscript"]),un=new Set(["document","window","location","top","self","parent","frames","history","navigator","screen","alert","confirm","prompt","eval","function","cookie","domain","referrer","body","head","forms","images","links","scripts","children","parentnode","firstchild","lastchild","innerhtml","outerhtml","textcontent"]),fn=new Set(["alt","class","dir","height","hidden","href","id","lang","loading","name","rel","role","src","srcset","tabindex","target","title","type","width","aria-*"]),dn=["on","formaction","xlink:","xmlns:"],cr=["javascript:","data:","vbscript:","file:"],zi=(e,t,r)=>{const n=e.toLowerCase();for(const s of dn)if(n.startsWith(s))return!1;return r&&n.startsWith("data-")||n.startsWith("aria-")?!0:t.has(n)},Ui=e=>{const t=e.toLowerCase().trim();return!un.has(t)},ji=e=>e.replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),hn=e=>{const t=ji(e);for(const r of cr)if(t.startsWith(r))return!1;return!0},Hi=e=>{const t=e.split(",");for(const r of t){const n=r.trim().split(/\s+/)[0];if(n&&!hn(n))return!1}return!0},Wi=e=>{try{const t=e.trim();if(t.startsWith("//"))return!0;const r=t.toLowerCase();return/^[a-z][a-z0-9+.-]*:/i.test(t)&&!r.startsWith("http://")&&!r.startsWith("https://")?!0:!r.startsWith("http://")&&!r.startsWith("https://")?!1:typeof window>"u"||!window.location?!0:new URL(t,window.location.href).origin!==window.location.origin}catch{return!0}},Fi=e=>new DOMParser().parseFromString(e,"text/html"),mn=e=>{const t=(typeof e=="string"?e:String(e??"")).trim(),r=document.createDocumentFragment();if(t.length===0)return r;if(!(t.includes("<")||t.includes(">")))return r.appendChild(document.createTextNode(t)),r;const n=Fi(t).body;if(!n)return r;for(;n.firstChild;)r.appendChild(n.firstChild);return r},Et=(e,t={})=>{const{allowTags:r=[],allowAttributes:n=[],allowDataAttributes:s=!0,stripAllTags:o=!1}=t,i=new Set([...ln,...r.map(f=>f.toLowerCase())].filter(f=>!ar.has(f))),a=new Set([...fn,...n.map(f=>f.toLowerCase())]),c=mn(e);if(o)return c.textContent??"";const l=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT),u=[];for(;l.nextNode();){const f=l.currentNode,m=f.tagName.toLowerCase();if(ar.has(m)){u.push(f);continue}if(!i.has(m)){u.push(f);continue}const v=[];for(const b of Array.from(f.attributes)){const g=b.name.toLowerCase();if(!zi(g,a,s)){v.push(b.name);continue}if((g==="id"||g==="name")&&!Ui(b.value)){v.push(b.name);continue}if((g==="href"||g==="src"||g==="action")&&!hn(b.value)){v.push(b.name);continue}g==="srcset"&&!Hi(b.value)&&v.push(b.name)}for(const b of v)f.removeAttribute(b);if(m==="a"){const b=f.getAttribute("href"),g=f.getAttribute("target")?.toLowerCase()==="_blank",w=b&&Wi(b);if(g||w){const S=f.getAttribute("rel"),k=new Set(S?S.split(/\s+/).filter(Boolean):[]);k.add("noopener"),k.add("noreferrer"),f.setAttribute("rel",Array.from(k).join(" "))}}}for(const f of u)f.remove();const h=f=>{const m=document.createElement("div");return m.appendChild(f.cloneNode(!0)),m.innerHTML},d=h(c),p=h(mn(d));return d!==p?c.textContent??"":p},pn=Symbol("bquery.trusted-html.brand"),lr=Symbol("bquery.trusted-html"),vn=e=>e,Bi=e=>{const t=String(e);return Object.freeze({[pn]:!0,[lr]:t,toString:()=>t})},Qi=e=>typeof e=="object"&&e!==null&&pn in e&&lr in e,Vi=e=>e[lr],yn=1024,gn=8192,bn=(e=16)=>{if(!Number.isInteger(e)||e<1)throw new RangeError("generateNonce length must be a positive integer");if(e>yn)throw new RangeError(`generateNonce length must not exceed ${yn}`);if(typeof globalThis.crypto>"u"||typeof globalThis.crypto.getRandomValues!="function")throw new Error("generateNonce requires crypto.getRandomValues (not available in this environment)");if(typeof globalThis.btoa!="function")throw new Error("generateNonce requires btoa (not available in this environment)");const t=new Uint8Array(e);globalThis.crypto.getRandomValues(t);let r="";for(let n=0;n<t.length;n+=gn){const s=t.subarray(n,Math.min(n+gn,t.length));r+=String.fromCharCode(...s)}return globalThis.btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ki=e=>{if(typeof document>"u")return!1;const t=document.querySelector('meta[http-equiv="Content-Security-Policy"]');return t?(t.getAttribute("content")??"").includes(e):!1},At=null,wn=!1,Yi=()=>typeof window<"u"&&typeof window.trustedTypes<"u",Sn=()=>{if(At)return At;if(wn||typeof window>"u")return null;const e=window;if(!e.trustedTypes)return null;wn=!0;try{return At=e.trustedTypes.createPolicy(cn,{createHTML:t=>Et(t)}),At}catch(t){const r=t instanceof Error?t.message:String(t);return console.warn(`bQuery: Could not create Trusted Types policy "${cn}": ${r}`),null}},Ji=e=>{const t=Sn();return t?t.createHTML(e):Et(e)},ie=(e,t={})=>vn(Et(e,t)),En=e=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return e.replace(/[&<>"'`]/g,r=>t[r])},Gi=e=>Et(e,{stripAllTags:!0}),An=e=>Array.isArray(e)?e:[e],z=(e,t)=>{for(const r of e)t(r)},$e=e=>{if(!e)return!1;const t=e.ownerDocument?.defaultView?.HTMLElement??globalThis.HTMLElement;return typeof t=="function"&&e instanceof t},kt=(e,t)=>$e(e)?t==="width"?e.clientWidth:e.clientHeight:0,Tt=(e,t,r)=>{if(!$e(e))return 0;const n=t==="width"?e.offsetWidth:e.offsetHeight;if(!r)return n;const s=e.ownerDocument?.defaultView;if(!s||typeof s.getComputedStyle!="function")return n;const o=s.getComputedStyle(e),i=Number.parseFloat(o.getPropertyValue(t==="width"?"margin-left":"margin-top")),a=Number.parseFloat(o.getPropertyValue(t==="width"?"margin-right":"margin-bottom")),c=Number.isNaN(i)?0:i,l=Number.isNaN(a)?0:a;return n+c+l},kn=e=>ie(e),Xi=(e,t)=>{e.innerHTML=ie(t)},Tn=e=>{const t=document.createElement("template");return t.innerHTML=ie(e),t.content.firstElementChild??document.createElement("div")},Rn=(e,t,r)=>{if(typeof t=="string"){e.insertAdjacentHTML(r,ie(t));return}const n=An(t);z(r==="afterbegin"||r==="afterend"?n.slice().reverse():n,s=>{e.insertAdjacentElement(r,s)})};function Oe(e){return Object.prototype.toString.call(e)==="[object Object]"}function N(e){return e==="__proto__"||e==="constructor"||e==="prototype"}function Zi(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}function Le(...e){const t={};for(const r of e)for(const[n,s]of Object.entries(r))N(n)||(Oe(s)&&Oe(t[n])?t[n]=Le(t[n],s):t[n]=s);return t}function ea(e,t){const r={};for(const n of t)n in e&&(r[n]=e[n]);return r}function ta(e,t){const r={...e};for(const n of t)delete r[n];return r}function ra(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var na=e=>{const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"},Cn=e=>{const t=[],r=e.ownerDocument.defaultView?.Element??Element;for(const n of Array.from(e.elements)){if(!(n instanceof r)||!na(n))continue;const s=n.name;if(!(!s||n.disabled||N(s))){if(n.tagName.toLowerCase()==="input"){const o=n,i=o.type.toLowerCase();if(i==="checkbox"||i==="radio"){o.checked&&t.push([s,o.value]);continue}if(i==="file"||i==="submit"||i==="button"||i==="reset"||i==="image")continue;t.push([s,o.value]);continue}if(n.tagName.toLowerCase()==="select"){const o=n;if(o.multiple)for(const i of Array.from(o.selectedOptions))t.push([s,i.value]);else t.push([s,o.value]);continue}t.push([s,n.value])}}return t},$n=e=>{if(typeof FormData=="function")try{const t=[];for(const[r,n]of new FormData(e).entries())N(r)||typeof n!="string"||t.push([r,n]);return t.length>0?t:Cn(e)}catch{}return Cn(e)},Pe=class an{constructor(t){this.element=t,this.delegatedHandlers=new Map}get raw(){return this.element}get node(){return this.element}addClass(...t){return this.element.classList.add(...t),this}removeClass(...t){return this.element.classList.remove(...t),this}toggleClass(t,r){return this.element.classList.toggle(t,r),this}attr(t,r){return r===void 0?this.element.getAttribute(t)??"":(this.element.setAttribute(t,r),this)}removeAttr(t){return this.element.removeAttribute(t),this}toggleAttr(t,r){const n=this.element.hasAttribute(t);return r??!n?this.element.setAttribute(t,""):this.element.removeAttribute(t),this}prop(t,r){return r===void 0?this.element[t]:(this.element[t]=r,this)}data(t,r){const n=t.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`);return r===void 0?this.element.getAttribute(`data-${n}`)??"":(this.element.setAttribute(`data-${n}`,r),this)}text(t){return t===void 0?this.element.textContent??"":(this.element.textContent=t,this)}html(t){return Xi(this.element,t),this}htmlUnsafe(t){return this.element.innerHTML=t,this}css(t,r){if(typeof t=="string"){if(r!==void 0)return this.element.style.setProperty(t,r),this;const n=this.element.ownerDocument?.defaultView;return!n||typeof n.getComputedStyle!="function"?"":n.getComputedStyle(this.element).getPropertyValue(t)}for(const[n,s]of Object.entries(t))this.element.style.setProperty(n,s);return this}append(t){return this.insertContent(t,"beforeend"),this}prepend(t){return this.insertContent(t,"afterbegin"),this}before(t){return this.insertContent(t,"beforebegin"),this}after(t){return this.insertContent(t,"afterend"),this}wrap(t){const r=typeof t=="string"?document.createElement(t):t;return this.element.parentNode?.insertBefore(r,this.element),r.appendChild(this.element),this}unwrap(){const t=this.element.parentElement;return t&&t.parentNode&&(t.parentNode.insertBefore(this.element,t),t.remove()),this}replaceWith(t){const r=typeof t=="string"?Tn(t):t;return this.element.replaceWith(r),new an(r)}detach(){return this.remove()}index(){const t=this.element.parentElement;return t?Array.from(t.children).indexOf(this.element):-1}contents(){return Array.from(this.element.childNodes)}offsetParent(){return $e(this.element)?this.element.offsetParent:null}position(){if(!$e(this.element))return{top:0,left:0};const t=this.element;return{top:t.offsetTop,left:t.offsetLeft}}innerWidth(){return kt(this.element,"width")}innerHeight(){return kt(this.element,"height")}outerWidth(t=!1){return Tt(this.element,"width",t)}outerHeight(t=!1){return Tt(this.element,"height",t)}scrollTo(t={behavior:"smooth"}){return this.element.scrollIntoView(t),this}remove(){return this.element.remove(),this}empty(){return this.element.innerHTML="",this}clone(t=!0){return new an(this.element.cloneNode(t))}find(t){return Array.from(this.element.querySelectorAll(t))}findOne(t){return this.element.querySelector(t)}closest(t){return this.element.closest(t)}parent(){return this.element.parentElement}children(){return Array.from(this.element.children)}siblings(){const t=this.element.parentElement;return t?Array.from(t.children).filter(r=>r!==this.element):[]}next(){return this.element.nextElementSibling}prev(){return this.element.previousElementSibling}on(t,r){return this.element.addEventListener(t,r),this}once(t,r){return this.element.addEventListener(t,r,{once:!0}),this}off(t,r){return this.element.removeEventListener(t,r),this}trigger(t,r){return this.element.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0})),this}delegate(t,r,n){const s=`${t}:${r}`,o=i=>{const a=i.target.closest(r);a&&this.element.contains(a)&&n(i,a)};return this.delegatedHandlers.has(s)||this.delegatedHandlers.set(s,new Map),this.delegatedHandlers.get(s).set(n,o),this.element.addEventListener(t,o),this}undelegate(t,r,n){const s=`${t}:${r}`,o=this.delegatedHandlers.get(s);if(o){const i=o.get(n);i&&(this.element.removeEventListener(t,i),o.delete(n),o.size===0&&this.delegatedHandlers.delete(s))}return this}matches(t){return this.element.matches(t)}is(t){return this.matches(t)}hasClass(t){return this.element.classList.contains(t)}show(t=""){return this.element.removeAttribute("hidden"),this.element.style.display=t,this}hide(){return this.element.style.display="none",this}toggle(t){const r=this.element.style.display==="none";return t??r?this.show():this.hide()}focus(){return this.element.focus(),this}blur(){return this.element.blur(),this}val(t){const r=this.element;return t===void 0?r.value??"":(r.value=t,this)}serialize(){const t=this.element;if(t.tagName.toLowerCase()!=="form")return{};const r=Object.create(null);for(const[n,s]of $n(t))if(Object.prototype.hasOwnProperty.call(r,n)){const o=r[n];Array.isArray(o)?o.push(s):r[n]=[o,s]}else r[n]=s;return r}serializeString(){const t=this.element;if(t.tagName.toLowerCase()!=="form")return"";const r=new URLSearchParams;for(const[n,s]of $n(t))r.append(n,s);return r.toString()}rect(){return this.element.getBoundingClientRect()}offset(){const t=this.element;return{width:t.offsetWidth,height:t.offsetHeight,top:t.offsetTop,left:t.offsetLeft}}insertContent(t,r){Rn(this.element,t,r)}},Rt=class oe{constructor(t){this.elements=t,this.delegatedHandlers=new WeakMap}get length(){return this.elements.length}first(){return this.elements[0]}eq(t){const r=this.elements[t];return r?new Pe(r):void 0}firstEl(){return this.eq(0)}lastEl(){return this.eq(this.elements.length-1)}each(t){return this.elements.forEach((r,n)=>{t(new Pe(r),n)}),this}map(t){return this.elements.map(t)}filter(t){return new oe(this.elements.filter(t))}reduce(t,r){return this.elements.reduce(t,r)}toArray(){return this.elements.map(t=>new Pe(t))}addClass(...t){return z(this.elements,r=>r.classList.add(...t)),this}removeClass(...t){return z(this.elements,r=>r.classList.remove(...t)),this}toggleClass(t,r){return z(this.elements,n=>n.classList.toggle(t,r)),this}attr(t,r){return r===void 0?this.first()?.getAttribute(t)??"":(z(this.elements,n=>n.setAttribute(t,r)),this)}removeAttr(t){return z(this.elements,r=>r.removeAttribute(t)),this}toggleAttr(t,r){return z(this.elements,n=>{const s=n.hasAttribute(t);r??!s?n.setAttribute(t,""):n.removeAttribute(t)}),this}text(t){return t===void 0?this.first()?.textContent??"":(z(this.elements,r=>{r.textContent=t}),this)}html(t){if(t===void 0)return this.first()?.innerHTML??"";const r=kn(t);return z(this.elements,n=>{n.innerHTML=r}),this}htmlUnsafe(t){return z(this.elements,r=>{r.innerHTML=t}),this}append(t){return this.insertAll(t,"beforeend"),this}prepend(t){return this.insertAll(t,"afterbegin"),this}before(t){return this.insertAll(t,"beforebegin"),this}after(t){return this.insertAll(t,"afterend"),this}css(t,r){if(typeof t=="string"){if(r!==void 0)return z(this.elements,o=>{o.style.setProperty(t,r)}),this;const n=this.first();if(!n)return"";const s=n.ownerDocument?.defaultView;return!s||typeof s.getComputedStyle!="function"?"":s.getComputedStyle(n).getPropertyValue(t)}return z(this.elements,n=>{for(const[s,o]of Object.entries(t))n.style.setProperty(s,o)}),this}wrap(t){return this.elements.forEach((r,n)=>{const s=typeof t=="string"?document.createElement(t):n===0?t:t.cloneNode(!0);r.parentNode?.insertBefore(s,r),s.appendChild(r)}),this}unwrap(){const t=new Set;for(const r of this.elements)r.parentElement&&t.add(r.parentElement);return t.forEach(r=>{const n=r.parentNode;if(n){for(;r.firstChild;)n.insertBefore(r.firstChild,r);r.remove()}}),this}replaceWith(t){const r=[];return this.elements.forEach((n,s)=>{const o=typeof t=="string"?Tn(t):s===0?t:t.cloneNode(!0);n.replaceWith(o),r.push(o)}),new oe(r)}detach(){return this.remove()}index(){const t=this.first();return t?.parentElement?Array.from(t.parentElement.children).indexOf(t):-1}contents(){return Array.from(this.first()?.childNodes??[])}offsetParent(){const t=this.first();return $e(t)?t.offsetParent:null}position(){const t=this.first();return $e(t)?{top:t.offsetTop,left:t.offsetLeft}:{top:0,left:0}}innerWidth(){return kt(this.first(),"width")}innerHeight(){return kt(this.first(),"height")}outerWidth(t=!1){return Tt(this.first(),"width",t)}outerHeight(t=!1){return Tt(this.first(),"height",t)}show(t=""){return z(this.elements,r=>{r.removeAttribute("hidden"),r.style.display=t}),this}hide(){return z(this.elements,t=>{t.style.display="none"}),this}on(t,r){return z(this.elements,n=>n.addEventListener(t,r)),this}once(t,r){return z(this.elements,n=>n.addEventListener(t,r,{once:!0})),this}off(t,r){return z(this.elements,n=>n.removeEventListener(t,r)),this}trigger(t,r){return z(this.elements,n=>{n.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,cancelable:!0}))}),this}delegate(t,r,n){const s=`${t}:${r}`;return z(this.elements,o=>{const i=c=>{const l=c.target.closest(r);l&&o.contains(l)&&n(c,l)};this.delegatedHandlers.has(o)||this.delegatedHandlers.set(o,new Map);const a=this.delegatedHandlers.get(o);a.has(s)||a.set(s,new Map),a.get(s).set(n,i),o.addEventListener(t,i)}),this}undelegate(t,r,n){const s=`${t}:${r}`;return z(this.elements,o=>{const i=this.delegatedHandlers.get(o);if(!i)return;const a=i.get(s);if(!a)return;const c=a.get(n);c&&(o.removeEventListener(t,c),a.delete(n),a.size===0&&i.delete(s),i.size===0&&this.delegatedHandlers.delete(o))}),this}find(t){const r=new Set,n=[];for(const s of this.elements){const o=s.querySelectorAll(t);for(let i=0;i<o.length;i++)r.has(o[i])||(r.add(o[i]),n.push(o[i]))}return new oe(n)}closest(t){const r=new Set,n=[];for(const s of this.elements){const o=s.closest(t);o&&!r.has(o)&&(r.add(o),n.push(o))}return new oe(n)}parent(){const t=new Set,r=[];for(const n of this.elements){const s=n.parentElement;s&&!t.has(s)&&(t.add(s),r.push(s))}return new oe(r)}children(){const t=new Set,r=[];for(const n of this.elements)for(const s of Array.from(n.children))t.has(s)||(t.add(s),r.push(s));return new oe(r)}siblings(){const t=new Set(this.elements),r=new Set,n=[];for(const s of this.elements){const o=s.parentElement;if(o)for(const i of Array.from(o.children))!t.has(i)&&!r.has(i)&&(r.add(i),n.push(i))}return new oe(n)}next(){const t=new Set,r=[];for(const n of this.elements){const s=n.nextElementSibling;s&&!t.has(s)&&(t.add(s),r.push(s))}return new oe(r)}prev(){const t=new Set,r=[];for(const n of this.elements){const s=n.previousElementSibling;s&&!t.has(s)&&(t.add(s),r.push(s))}return new oe(r)}remove(){return z(this.elements,t=>t.remove()),this}empty(){return z(this.elements,t=>{t.innerHTML=""}),this}insertAll(t,r){if(typeof t=="string"){const s=kn(t);z(this.elements,o=>{o.insertAdjacentHTML(r,s)});return}const n=An(t);this.elements.forEach((s,o)=>{Rn(s,o===0?n:n.map(i=>i.cloneNode(!0)),r)})}},sa=e=>{if(typeof e!="string")return new Pe(e);const t=document.querySelector(e);if(!t)throw new Error(`bQuery: element not found for selector "${e}"`);return new Pe(t)},oa=e=>Array.isArray(e)?new Rt(e):e instanceof NodeList?new Rt(Array.from(e)):new Rt(Array.from(document.querySelectorAll(e)));function ia(e){return e==null?[]:Array.isArray(e)?e:[e]}function aa(e){return Array.from(new Set(e))}function ca(e,t){if(t<=0)return[];const r=[];for(let n=0;n<e.length;n+=t)r.push(e.slice(n,n+t));return r}function la(e){return e.filter(Boolean)}function ua(e){const t=[];for(const r of e)Array.isArray(r)?t.push(...r):t.push(r);return t}function ur(e,t){let r;return Object.assign((...n)=>{r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,e(...n)},t)},{cancel:()=>{r!==void 0&&(clearTimeout(r),r=void 0)}})}function On(e,t){let r=0;return Object.assign((...n)=>{const s=Date.now();s-r>=t&&(r=s,e(...n))},{cancel:()=>{r=0}})}function fa(e){let t=!1,r;return(...n)=>(t||(r=e(...n),t=!0),r)}function da(){}function ha(e="bQuery"){return`${e}_${Math.random().toString(36).slice(2,9)}`}function ma(e){return new Promise(t=>setTimeout(t,e))}function pa(e,t){try{return JSON.parse(e)}catch{return t}}function va(e){return e==null?!0:typeof e=="string"?e.trim().length===0:Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}function ya(e,t){return Math.floor(Math.random()*(t-e+1))+e}function ga(e,t,r){return Math.min(Math.max(e,t),r)}function ba(e,t,r,n=!0){return n?e>=t&&e<=r:e>t&&e<r}function wa(e,t=0){const r=typeof e=="number"?e:Number(e);return Number.isNaN(r)?t:r}function Sa(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Ea(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Aa(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^[A-Z]/,t=>t.toLowerCase())}function ka(e,t,r="…"){if(t<=0)return"";if(e.length<=t)return e;const n=Math.max(0,t-r.length);return`${e.slice(0,n)}${r}`}function Ta(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^\w\s-]/g,"").trim().replace(/[\s_-]+/g,"-").toLowerCase()}function Ra(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ca(e){return typeof Element<"u"&&e instanceof Element}function $a(e){return!!(e&&typeof e=="object"&&"elements"in e)}function Oa(e){return typeof e=="function"}function La(e){return typeof e=="string"}function Pa(e){return typeof e=="number"&&!Number.isNaN(e)}function Na(e){return typeof e=="boolean"}function Ia(e){return Array.isArray(e)}function Ma(e){return e instanceof Date}function We(e){return!!(e&&(e instanceof Promise||typeof e=="object"&&"then"in e&&typeof e.then=="function"))}function Da(e){return typeof e=="object"&&e!==null}var _a={clone:Zi,merge:Le,pick:ea,omit:ta,hasOwn:ra,debounce:ur,throttle:On,once:fa,noop:da,uid:ha,isElement:Ca,isCollection:$a,isEmpty:va,isPlainObject:Oe,isFunction:Oa,isString:La,isNumber:Pa,isBoolean:Na,isArray:Ia,isDate:Ma,isPromise:We,isObject:Da,parseJson:pa,sleep:ma,randomInt:ya,clamp:ga,inRange:ba,toNumber:wa,capitalize:Sa,toKebabCase:Ea,toCamelCase:Aa,truncate:ka,slugify:Ta,escapeRegExp:Ra,ensureArray:ia,unique:aa,chunk:ca,compact:la,flatten:ua},Ne=[],Fe=0,fr=new Set,Ct=new WeakMap,dr=(e,t)=>{Ne.push(e);try{return t()}finally{Ne.pop()}},Ln=()=>Ne[Ne.length-1],hr=e=>{Ne.push(void 0);try{return e()}finally{Ne.pop()}},Pn=e=>{if(Fe>0){fr.add(e);return}e()},xa=()=>{for(const e of Array.from(fr)){fr.delete(e);try{e()}catch(t){console.error("bQuery reactive: Error in observer during batch flush",t)}}},qa=()=>{Fe+=1},za=()=>{Fe<=0||(Fe-=1,Fe===0&&xa())},Nn=(e,t)=>{let r=Ct.get(e);r||(r=new Set,Ct.set(e,r)),r.add(t)},Ua=(e,t)=>{const r=Ct.get(e);r&&r.delete(t)},Be=e=>{const t=Ct.get(e);if(t){for(const r of t)r.unsubscribe(e);t.clear()}},Se=e=>{qa();try{e()}finally{za()}},In={fetch:{headers:{},parseAs:"json"},cookies:{path:"/",sameSite:"Lax",secure:!1},announcer:{politeness:"polite",atomic:!0,delay:16,clearDelay:1e3},pageMeta:{},transitions:{skipOnReducedMotion:!1,classes:[],types:[]},components:{prefix:"bq"}},Qe=e=>{if(typeof Headers<"u"&&e instanceof Headers)return new Headers(e);if(Array.isArray(e))return e.map(t=>Qe(t));if(Oe(e)){const t={};for(const[r,n]of Object.entries(e))t[r]=Qe(n);return t}return e},mr=Qe(In),ja=e=>(mr=Qe(Le(In,mr,e)),ae()),ae=()=>Qe(mr),Ve=[],$t=e=>typeof e=="object"&&e!==null&&"_addDisposer"in e,Ha=e=>(typeof e=="object"||typeof e=="function")&&e!==null&&typeof e.then=="function",Wa=e=>{const t=typeof e.constructor=="function"?e.constructor.name:void 0;return typeof e=="function"&&(Symbol.toStringTag in e&&e[Symbol.toStringTag]==="AsyncFunction"||t==="AsyncFunction")},Ke=()=>{for(let e=Ve.length-1;e>=0;e--)if(Ve[e].active)return Ve[e]},Fa=class{constructor(){this.disposers=[],this._active=!0}get active(){return this._active}_addDisposer(e){this._active&&this.disposers.push(e)}run(e){if(!this._active)throw new Error("bQuery reactive: Cannot run in a stopped effectScope");if(Wa(e))throw new Error("bQuery reactive: effectScope.run() only supports synchronous callbacks");Ve.push(this);try{const t=e();if(Ha(t))throw this.stop(),new Error("bQuery reactive: effectScope.run() only supports synchronous callbacks");return t}finally{Ve.pop()}}stop(){if(this._active){this._active=!1;for(let e=this.disposers.length-1;e>=0;e--)try{this.disposers[e]()}catch(t){console.error("bQuery reactive: Error in scope cleanup",t)}this.disposers.length=0}}},Ba=()=>{const e=new Fa,t=Ke();return $t(t)&&t._addDisposer(()=>e.stop()),e},Mn=()=>Ke(),Dn=e=>{const t=Ke();if(!t||!t.active||!$t(t))throw new Error("bQuery reactive: onScopeDispose() must be called inside an active effectScope");t._addDisposer(e)},Ye=class{constructor(e){this.compute=e,this.hasCachedValue=!1,this.dirty=!0,this.disposed=!1,this.subscribers=new Set,this.markDirty=()=>{if(this.disposed)return;this.dirty=!0;const t=Array.from(this.subscribers);for(const r of t)Pn(r)}}get value(){if(this.disposed)return this.hasCachedValue||(this.cachedValue=hr(()=>this.compute()),this.hasCachedValue=!0),this.cachedValue;const e=Ln();return e&&(this.subscribers.add(e),Nn(e,this)),this.dirty&&(this.dirty=!1,Be(this.markDirty),this.cachedValue=dr(this.markDirty,this.compute),this.hasCachedValue=!0),this.cachedValue}peek(){return this.disposed?(this.hasCachedValue||(this.cachedValue=hr(()=>this.compute()),this.hasCachedValue=!0),this.cachedValue):(this.dirty&&(this.dirty=!1,Be(this.markDirty),this.cachedValue=dr(this.markDirty,this.compute),this.hasCachedValue=!0),this.cachedValue)}unsubscribe(e){this.subscribers.delete(e)}dispose(){this.disposed=!0,this.dirty&&(this.hasCachedValue=!1),this.dirty=!1,Be(this.markDirty),this.subscribers.clear()}},D=e=>{const t=new Ye(e),r=Ke();return $t(r)&&r._addDisposer(()=>t.dispose()),t},U=e=>{let t,r=!1;const n=Ke(),s=()=>{if(t){try{t()}catch(c){console.error("bQuery reactive: Error in effect cleanup",c)}t=void 0}},o=()=>{s(),Be(a)},i=()=>{r||(r=!0,o())};$t(n)&&n._addDisposer(i);const a=()=>{if(!r){s(),Be(a);try{t=dr(a,e)}catch(c){console.error("bQuery reactive: Error in effect",c)}r&&o()}};return a(),i},Je=class{constructor(e){this._value=e,this.subscribers=new Set}get value(){const e=Ln();return e&&(this.subscribers.add(e),Nn(e,this)),this._value}set value(e){if(Object.is(this._value,e))return;this._value=e;const t=Array.from(this.subscribers);for(const r of t)Pn(r)}peek(){return this._value}update(e){this.value=e(this._value)}dispose(){for(const e of this.subscribers)Ua(e,this);this.subscribers.clear()}unsubscribe(e){this.subscribers.delete(e)}},L=e=>new Je(e),Ee=e=>hr(e),Qa=e=>{if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}},Va=e=>typeof e=="function"?e():e.value,_n=(...e)=>{const t=new Headers;for(const r of e)r&&new Headers(r).forEach((n,s)=>{t.set(s,n)});return t},Ka=e=>typeof e=="string"||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ReadableStream<"u"&&e instanceof ReadableStream?!0:typeof e=="object"&&e!==null&&ArrayBuffer.isView(e),Ya=(e,t)=>e==null||Ka(e)?e:(t.has("content-type")||t.set("content-type","application/json"),JSON.stringify(e)),Ja=e=>typeof e=="function"?e():e,Ga=(e,t)=>{for(const[r,n]of Object.entries(t))if(n!=null){if(Array.isArray(n)){for(const s of n)s!=null&&e.searchParams.append(r,String(s));continue}e.searchParams.set(r,String(n))}},Xa=(e,t)=>{const r=typeof window<"u"&&/^https?:/i.test(window.location.href)?window.location.href:"http://localhost",n=t?new URL(t,r).toString():r;return e instanceof URL?new URL(e.toString(),n):new URL(e,n)},Za=async(e,t)=>{if(t==="response")return e;if(t==="text")return await e.text();if(t==="blob")return await e.blob();if(t==="arrayBuffer")return await e.arrayBuffer();if(t==="formData")return await e.formData();const r=await e.text();if(r)try{return JSON.parse(r)}catch(n){const s=e.url?` for ${e.url}`:"";throw new Error(`Failed to parse JSON response${s} (status ${e.status}): ${n instanceof Error?n.message:String(n)}`)}},pr=e=>{const t=e?.trim();return t?t.toUpperCase():void 0},ec=(e,t,r)=>{const n=t instanceof Request?pr(t.method):void 0;return e??n??(r?"POST":void 0)},tc=(e,t,r)=>e||(t instanceof Request?void 0:r),rc=e=>{const t=pr(e.method);let r;if(t!=="GET"&&t!=="HEAD"&&!e.bodyUsed)try{r=e.clone().body??void 0}catch{r=void 0}return{method:t,headers:e.headers,body:r,cache:e.cache,credentials:e.credentials,integrity:e.integrity,keepalive:e.keepalive,mode:e.mode,redirect:e.redirect,referrer:e.referrer,referrerPolicy:e.referrerPolicy,signal:e.signal}},xn=(e,t={})=>{const r=t.immediate??!0,n=L(t.defaultValue),s=L(null),o=L("idle"),i=D(()=>o.value==="pending");let a=0,c=!1,l=()=>{};const u=()=>{a+=1,n.value=t.defaultValue,s.value=null,o.value="idle"},h=()=>{c||(c=!0,a+=1,l())},d=async()=>{if(c)return n.peek();const p=++a;o.value="pending",s.value=null;try{const f=await e(),m=t.transform?t.transform(f):f;return c||p!==a?n.peek():(n.value=m,o.value="success",t.onSuccess?.(m),m)}catch(f){const m=Qa(f);return c||p!==a||(s.value=m,o.value="error",t.onError?.(m)),n.peek()}};if(t.watch?.length){let p=!1;l=U(()=>{for(const f of t.watch??[])Va(f);if(!p){p=!0,r&&Ee(()=>d());return}Ee(()=>d())})}else r&&d();return{data:n,error:s,status:o,pending:i,execute:d,refresh:d,abort:()=>{},clear:u,dispose:h}},nc=e=>e>=200&&e<300,qn=(e,t)=>e instanceof DOMException&&e.name===t,Ot=e=>qn(e,"TimeoutError"),zn=e=>qn(e,"AbortError"),sc=e=>{if(zn(e)||Ot(e)||e.code==="ABORT"||e.code==="TIMEOUT")return!1;const t=e.status;return t===void 0||t>=500},oc=e=>{if(e!=null)return typeof e=="number"?{count:e}:e},ic=(e,t)=>e==null?Math.min(1e3*2**t,3e4):typeof e=="number"?e:e(t),ac=(e,t)=>new Promise((r,n)=>{if(t?.aborted){n(t.reason??new DOMException("The operation was aborted.","AbortError"));return}let s=!1,o;const i=()=>{s||(s=!0,clearTimeout(o),t?.removeEventListener("abort",i),n(t?.reason??new DOMException("The operation was aborted.","AbortError")))};o=setTimeout(()=>{s||(s=!0,t?.removeEventListener("abort",i),r())},e),t?.addEventListener("abort",i,{once:!0})}),re=(e,t={})=>{const r=ae().fetch,n=t.parseAs??r?.parseAs??"json",s=t.fetcher??fetch,o=t.validateStatus??nc;let i=null;const a=(l,u)=>{const h=u||Ot(l)||Ot(i?.signal.reason);return Object.assign(new Error(h?`Request timeout of ${t.timeout}ms exceeded`:"Request aborted"),{code:h?"TIMEOUT":"ABORT"})},c=xn(async()=>{const l=Ja(e),u=typeof l=="string"||l instanceof URL?Xa(l,t.baseUrl??r?.baseUrl):l instanceof Request&&t.query?new URL(l.url):null;u&&t.query&&Ga(u,t.query);const h=_n(r?.headers,l instanceof Request?l.headers:void 0,t.headers),d=t.body!=null,p=pr(t.method),f=ec(p,l,d),m=f==="GET"||f==="HEAD"?f:null;if(d&&m)throw new Error(`Cannot send a request body with ${m} requests`);const v=tc(p,l,f),b=oc(t.retry),g=(b?.count??0)+1,w=new AbortController;i=w;let S,k=!1,A;t.signal&&(t.signal.aborted?w.abort(t.signal.reason):(A=()=>w.abort(t.signal?.reason),t.signal.addEventListener("abort",A,{once:!0}))),t.timeout&&t.timeout>0&&(S=setTimeout(()=>{k=!0,w.abort(new DOMException("Request timeout","TimeoutError"))},t.timeout));const E={...t,method:v,headers:h};delete E.baseUrl,delete E.query,delete E.parseAs,delete E.fetcher,delete E.defaultValue,delete E.immediate,delete E.watch,delete E.transform,delete E.onSuccess,delete E.onError,delete E.timeout,delete E.retry,delete E.validateStatus;let T=u??l;l instanceof Request&&u&&u.toString()!==l.url&&(T=new Request(u.toString(),rc(l)));const P=()=>{const $=new Headers(h);return{...E,headers:$,body:Ya(t.body,$),signal:w.signal}};if(g>1&&typeof ReadableStream<"u"&&t.body instanceof ReadableStream)throw new Error("Cannot retry requests with ReadableStream bodies");if(g>1&&typeof Request<"u"&&T instanceof Request&&T.body!==null)throw new Error("Cannot retry requests with non-replayable Request bodies");let C;try{for(let $=0;$<g;$++)try{const R=await s(T,P());if(!o(R.status))throw Object.assign(new Error(`Request failed with status ${R.status}`),{response:R,status:R.status,statusText:R.statusText});return await Za(R,n)}catch(R){const O=R instanceof Error?R:new Error(String(R));if(w.signal.aborted||zn(O)||Ot(O))throw a(w.signal.aborted?w.signal.reason:O,k);if(C=O,!(b&&(b.retryOn??sc)(O,$))||$>=g-1)throw O;await ac(ic(b.delay,$),w.signal)}throw C}finally{S!==void 0&&clearTimeout(S),t.signal&&A&&t.signal.removeEventListener("abort",A),i===w&&(i=null)}},t);return c.abort=()=>{i&&i.abort(new DOMException("Request aborted","AbortError"))},c};function cc(e={}){return(t,r={})=>{const n=e,s=Le({},n.query??{},r.query??{});return re(t,{...n,...r,headers:_n(n.headers,r.headers),query:Object.keys(s).length>0?s:void 0})}}var ye=class extends Error{constructor(e,t,r,n){super(e),this.name="HttpError",this.config=t,this.code=r,this.response=n}};function Un(){const e=[];let t=0;return{use(r,n){const s=t++;return e.push({id:s,fulfilled:r,rejected:n}),s},eject(r){const n=e.findIndex(s=>s?.id===r);n!==-1&&(e[n]=null)},clear(){e.length=0},forEach(r){for(const n of e)n&&r(n)}}}var lc=e=>e>=200&&e<300,uc=e=>{if(e.code==="PARSE")return!1;if(e.code==="TIMEOUT"||e.code==="NETWORK")return!0;const t=e.response?.status;return t!==void 0&&t>=500},fc=e=>{if(e!=null)return typeof e=="number"?{count:e}:e},dc=(e,t)=>e==null?Math.min(1e3*2**t,3e4):typeof e=="number"?e:e(t),hc=(e,t)=>new Promise((r,n)=>{if(t?.aborted){n(t.reason??new DOMException("The operation was aborted.","AbortError"));return}let s;const o=()=>{clearTimeout(s),t?.removeEventListener("abort",o),n(t?.reason??new DOMException("The operation was aborted.","AbortError"))};s=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),t&&t.addEventListener("abort",o,{once:!0})}),jn=(...e)=>{const t=new Headers;for(const r of e)r&&new Headers(r).forEach((n,s)=>{t.set(s,n)});return t},mc=e=>typeof e=="string"||e instanceof Blob||e instanceof FormData||e instanceof URLSearchParams||typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer||typeof ReadableStream<"u"&&e instanceof ReadableStream?!0:typeof e=="object"&&e!==null&&ArrayBuffer.isView(e),pc=(e,t)=>e==null||mc(e)?e:(t.has("content-type")||t.set("content-type","application/json"),JSON.stringify(e)),vc=(e,t)=>{for(const[r,n]of Object.entries(t))if(n!=null){if(Array.isArray(n)){for(const s of n)s!=null&&e.searchParams.append(r,String(s));continue}e.searchParams.set(r,String(n))}},yc=(e,t)=>{const r=typeof window<"u"&&/^https?:/i.test(window.location.href)?window.location.href:"http://localhost",n=t?new URL(t,r).toString():r;return new URL(e,n)},gc=async(e,t,r)=>{if(t==="response")return e;if(t==="text")return await e.text();if(t==="blob")return await e.blob();if(t==="arrayBuffer")return await e.arrayBuffer();if(t==="formData")return await e.formData();const n=await e.text();if(n)try{return JSON.parse(n)}catch(s){throw new ye(`Failed to parse JSON response${e.url?` for ${e.url}`:""} (status ${e.status}): ${s instanceof Error?s.message:String(s)}`,r,"PARSE",{data:n,status:e.status,statusText:e.statusText,headers:e.headers,config:r})}},bc=(e,t)=>{const r=e.body;if(!r)return e;const n=parseInt(e.headers.get("content-length")??"0",10)||0;let s=0;const o=r.getReader(),i=new ReadableStream({async pull(a){const{done:c,value:l}=await o.read();if(c){a.close();return}s+=l.byteLength,t({loaded:s,total:n,percent:n>0?Math.round(s/n*100):void 0}),a.enqueue(l)},cancel(a){o.cancel(a)}});return new Response(i,{status:e.status,statusText:e.statusText,headers:e.headers})},wc=async e=>{const t=ae().fetch,r=e.parseAs??t?.parseAs??"json",n=e.fetcher??fetch,s=e.validateStatus??lc,o=yc(e.url??"/",e.baseUrl??t?.baseUrl);e.query&&vc(o,e.query);const i=jn(t?.headers,e.headers),a=pc(e.body,i),c={};e.method&&(c.method=e.method.toUpperCase()),c.headers=i,a!=null&&(c.body=a),e.cache&&(c.cache=e.cache),e.credentials&&(c.credentials=e.credentials),e.integrity&&(c.integrity=e.integrity),e.keepalive!==void 0&&(c.keepalive=e.keepalive),e.mode&&(c.mode=e.mode),e.redirect&&(c.redirect=e.redirect),e.referrer&&(c.referrer=e.referrer),e.referrerPolicy&&(c.referrerPolicy=e.referrerPolicy);let l,u=e.signal,h;if(e.timeout&&e.timeout>0){const d=new AbortController;e.signal&&(h=()=>d.abort(e.signal?.reason),e.signal.addEventListener("abort",h,{once:!0})),l=setTimeout(()=>{d.abort(new DOMException("Request timeout","TimeoutError"))},e.timeout),u=d.signal}u&&(c.signal=u);try{let d=await n(o.toString(),c);if(e.onDownloadProgress&&(d=bc(d,e.onDownloadProgress)),!s(d.status))throw new ye(`Request failed with status ${d.status}`,e,"ERR_BAD_RESPONSE",{data:void 0,status:d.status,statusText:d.statusText,headers:d.headers,config:e});return{data:await gc(d,r,e),status:d.status,statusText:d.statusText,headers:d.headers,config:e}}catch(d){if(d instanceof ye)throw d;if(d instanceof DOMException&&(d.name==="AbortError"||d.name==="TimeoutError")){const p=d.name==="TimeoutError"||d.message==="Request timeout";throw new ye(p?`Request timeout of ${e.timeout}ms exceeded`:"Request aborted",e,p?"TIMEOUT":"ABORT")}throw new ye(d instanceof Error?d.message:String(d),e,"NETWORK")}finally{l!==void 0&&clearTimeout(l),e.signal&&h&&e.signal.removeEventListener("abort",h)}};function vr(e={}){const t=Un(),r=Un(),n=i=>{const a=Le({},e.query??{},i.query??{});return{...e,...i,headers:jn(e.headers,i.headers),query:Object.keys(a).length>0?a:void 0}},s=async i=>{let a=i;const c=[];t.forEach(d=>c.push(d));for(const{fulfilled:d,rejected:p}of c)try{d&&(a=await d(a))}catch(f){if(p){const m=await p(f);if(Oe(m))a=m;else throw f}else throw f}const l=fc(a.retry);let u;const h=(l?.count??0)+1;for(let d=0;d<h;d++)try{let p=await wc(a);const f=[];r.forEach(m=>f.push(m));for(const{fulfilled:m,rejected:v}of f)try{m&&(p=await m(p))}catch(b){if(v){const g=await v(b);if(g&&typeof g=="object"&&"data"in g)p=g;else throw b}else throw b}return p}catch(p){const f=p instanceof ye?p:new ye(p instanceof Error?p.message:String(p),a,"NETWORK");if(u=f,!(l&&(l.retryOn??uc)(f,d))||d>=h-1){const v=[];r.forEach(g=>v.push(g));let b=f;for(const{rejected:g}of v)if(g)try{const w=await g(b);if(w&&typeof w=="object"&&"data"in w)return w;w!=null&&(b=w)}catch(w){w!=null&&(b=w)}throw b instanceof Error||(b=f),b}const m=l?dc(l.delay,d):0;l?.onRetry?.(f,d+1),await hc(m,a.signal)}throw u},o=i=>s(n(i));return{request:o,get:(i,a={})=>o({...a,url:i,method:"GET"}),post:(i,a,c={})=>o({...c,url:i,method:"POST",body:a}),put:(i,a,c={})=>o({...c,url:i,method:"PUT",body:a}),patch:(i,a,c={})=>o({...c,url:i,method:"PATCH",body:a}),delete:(i,a={})=>o({...a,url:i,method:"DELETE"}),head:(i,a={})=>o({...a,url:i,method:"HEAD"}),options:(i,a={})=>o({...a,url:i,method:"OPTIONS"}),interceptors:{request:t,response:r},defaults:e}}var Sc=vr();function Ec(e={}){const{concurrency:t=6}=e;if(!Number.isInteger(t)||t<1)throw new Error("Request queue concurrency must be a positive integer");const r=[];let n=0;const s=()=>{for(;n<t&&r.length>0;){const o=r.shift();n++,Promise.resolve().then(o.execute).then(o.resolve,o.reject).finally(()=>{n--,s()})}};return{add(o){return new Promise((i,a)=>{r.push({execute:o,resolve:i,reject:a}),s()})},get pending(){return n},get size(){return r.length},clear(){const o=r.splice(0);for(const i of o)i.reject(new Error("Request queue cleared"))}}}var Ac=(e,t)=>{const r=D(e);return{get value(){return r.value},set value(n){t(n)},peek(){return r.peek()}}},kc=(e,t={})=>{const{initialPage:r=1,...n}=t,s=L(r),o=re(()=>e(s.value),{...n,watch:n.watch});return{...o,page:s,next:async()=>(s.value=s.peek()+1,o.execute()),prev:async()=>{const l=s.peek();return l>1&&(s.value=l-1),o.execute()},goTo:async l=>(s.value=Math.max(1,l),o.execute())}},Tc=(e,t)=>{const{getNextCursor:r,transform:n,initialCursor:s,immediate:o=!0,onSuccess:i,onError:a,...c}=t,l=L([]),u=L(t.defaultValue),h=L(null),d=L("idle"),p=D(()=>d.value==="pending"),f=L(s),m=D(()=>l.value.length===0||f.value!==void 0);let v=!1,b=0;const g=E=>n?n(E):E,w=async()=>{if(v)return u.peek();const E=++b;d.value="pending",h.value=null;try{const T=re(e(f.peek()),{...c,immediate:!1,watch:void 0}),P=await T.execute(),C=T.error.peek();if(T.dispose(),v||E!==b)return u.peek();if(C)return h.value=C,d.value="error",a?.(C),u.peek();if(P!==void 0){const $=P,R=[...l.peek(),$];l.value=R,f.value=r($,R);const O=g(R);return u.value=O,d.value="success",i?.(O),O}return d.value="success",u.peek()}catch(T){if(v||E!==b)return u.peek();const P=T instanceof Error?T:new Error(String(T));return h.value=P,d.value="error",a?.(P),u.peek()}},S=async()=>(l.value=[],f.value=s,u.value=t.defaultValue,h.value=null,d.value="idle",b+=1,w()),k=()=>{b+=1,l.value=[],f.value=s,u.value=t.defaultValue,h.value=null,d.value="idle"},A=()=>{v||(v=!0,b+=1)};return o&&w(),{data:u,pages:l,error:h,status:d,pending:p,hasMore:m,fetchNextPage:w,refresh:S,clear:k,dispose:A}},Rc=(e,t)=>{let r=!1,n=null;try{if(n=globalThis.localStorage,n){const i=`__bquery_test_${Math.random().toString(36).slice(2,9)}__`,a="__test__";try{n.setItem(i,a),n.getItem(i),r=!0}finally{try{n.removeItem(i)}catch{}}}}catch{r=!1}let s=t;if(r&&n)try{const i=n.getItem(e);i!==null&&(s=JSON.parse(i))}catch{}const o=L(s);return r&&n&&U(()=>{try{n.setItem(e,JSON.stringify(o.value))}catch{}}),o},Cc=(e,t)=>{const{interval:r,enabled:n=!0,pauseOnHidden:s=!0,pauseOnOffline:o=!0,immediate:i=!0,...a}=t;if(!Number.isFinite(r)||r<1)throw new Error("Polling interval must be a finite number of at least 1");const c=L(!1),l=L(!1),u=L(!1),h=typeof n=="function"?n:()=>n,d=D(()=>h()&&!c.value&&!(s&&l.value)&&!(o&&u.value)),p=re(e,{...a,immediate:i&&h()});let f,m=[];const v=()=>{b(),f=setInterval(()=>{p.execute()},r)},b=()=>{f!==void 0&&(clearInterval(f),f=void 0)},g=U(()=>{const k=d.value;Ee(()=>{k?v():b()})});if(s&&typeof document<"u"){l.value=document.hidden;const k=()=>{l.value=document.hidden};document.addEventListener("visibilitychange",k),m.push(()=>document.removeEventListener("visibilitychange",k))}if(o&&typeof window<"u"){const k=()=>{u.value=!1},A=()=>{u.value=!0};window.addEventListener("online",k),window.addEventListener("offline",A),m.push(()=>{window.removeEventListener("online",k),window.removeEventListener("offline",A)}),u.value=typeof navigator<"u"&&navigator.onLine!==void 0?!navigator.onLine:!1}const w=p.dispose;return{...p,pause:()=>{c.value=!0},resume:()=>{c.value=!1},isActive:d,dispose:()=>{b(),g();for(const k of m)k();m=[],w()}}},Hn=Symbol("bquery.readonlySignal"),Wn=e=>typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(e,Hn),_=e=>Object.defineProperties({},{value:{get(){return e.value},enumerable:!0},peek:{value(){return e.peek()},enumerable:!0},[Hn]:{value:!0,enumerable:!1,configurable:!1,writable:!1}}),$c=(e,t={})=>{const{optimistic:r=!1,onMutationSuccess:n,onMutationError:s,...o}=t,i=re(e,{...o}),a=L(!1),c=D(()=>a.value);let l=!1;const u=()=>{const v=typeof e=="function"?e():e;return v instanceof URL?v.toString():v},h=()=>{const{defaultValue:v,transform:b,onSuccess:g,onError:w,...S}=o;return S},d=async(v,b,g,w)=>{if(l)return i.data.peek();const S=i.data.peek();r&&w!==void 0&&(i.data.value=w),a.value=!0,i.error.value=null;try{const k=re(u(),{...h(),method:b,body:g??void 0,immediate:!1,watch:void 0}),A=await k.execute(),E=k.error.peek();return k.dispose(),l?i.data.peek():E?(r&&w!==void 0&&(i.data.value=S),i.error.value=E,i.status.value="error",a.value=!1,s?.(E,v),i.data.peek()):(b!=="DELETE"&&A!==void 0&&(i.data.value=A),a.value=!1,i.status.value="success",n?.(A,v),A)}catch(k){if(l)return i.data.peek();r&&w!==void 0&&(i.data.value=S);const A=k instanceof Error?k:new Error(String(k));return i.error.value=A,i.status.value="error",a.value=!1,s?.(A,v),i.data.peek()}},p={fetch:()=>i.execute(),create:v=>d("create","POST",v),update:v=>{const b=i.data.peek();return d("update","PUT",v,r&&b!==void 0?{...b,...v}:void 0)},patch:v=>{const b=i.data.peek();return d("patch","PATCH",v,r&&b!==void 0?{...b,...v}:void 0)},remove:async()=>{await d("remove","DELETE"),!l&&i.error.peek()==null&&(i.data.value=void 0)}},f=i.dispose,m=()=>{l||(l=!0,f())};return{data:i.data,error:i.error,status:i.status,pending:i.pending,isMutating:c,actions:p,refresh:i.execute,clear:i.clear,dispose:m}},Oc=(e,t={})=>{const{method:r="POST",...n}=t,s=L(void 0),o=L(null),i=L("idle"),a=D(()=>i.value==="pending");return{data:s,error:o,status:i,pending:a,submit:async u=>{i.value="pending",o.value=null;try{const h=re(e,{...n,method:r,body:u,immediate:!1,watch:void 0}),d=await h.execute(),p=h.error.peek();if(h.dispose(),p){o.value=p,i.value="error";return}return s.value=d,i.value="success",d}catch(h){o.value=h instanceof Error?h:new Error(String(h)),i.value="error";return}},clear:()=>{s.value=void 0,o.value=null,i.value="idle"}}},Lc=(e,t={})=>{const r=vr({...t});let n=e;for(;n.endsWith("/");)n=n.slice(0,-1);return{list:s=>r.get(n,s),get:(s,o)=>r.get(`${n}/${encodeURIComponent(String(s))}`,o),create:(s,o)=>r.post(n,s,o),update:(s,o,i)=>r.put(`${n}/${encodeURIComponent(String(s))}`,o,i),patch:(s,o,i)=>r.patch(`${n}/${encodeURIComponent(String(s))}`,o,i),remove:(s,o)=>r.delete(`${n}/${encodeURIComponent(String(s))}`,o),http:r}},Pc=(e,t={})=>{const{getId:r=g=>g.id,optimistic:n=!1,onMutationSuccess:s,onMutationError:o,...i}=t,a=re(e,{...i}),c=L(!1),l=D(()=>c.value);let u=!1;const h=()=>{const g=typeof e=="function"?e():e;return g instanceof URL?g.toString():g},d=()=>{let g=h();for(;g.endsWith("/");)g=g.slice(0,-1);return g},p=()=>{const{defaultValue:g,transform:w,onSuccess:S,onError:k,...A}=i;return A},f=async(g,w,S,k,A,E)=>{if(!u){n&&A&&A(),c.value=!0,a.error.value=null;try{const T=re(`${d()}${S}`,{...p(),method:w,body:k??void 0,immediate:!1,watch:void 0}),P=await T.execute(),C=T.error.peek();if(T.dispose(),u)return;if(C){n&&E&&E(),a.error.value=C,a.status.value="error",c.value=!1,o?.(C,g);return}return c.value=!1,a.status.value="success",s?.(g),P}catch(T){if(u)return;n&&E&&E();const P=T instanceof Error?T:new Error(String(T));a.error.value=P,a.status.value="error",c.value=!1,o?.(P,g);return}}},m={fetch:()=>a.execute(),add:async g=>{const w=a.data.peek(),S=g,k=w?.length??0,A=await f("add","POST","",g,n?()=>{a.data.value=[...w??[],S]}:void 0,n?()=>{a.data.value=w}:void 0);if(A!==void 0&&!u){const E=a.data.peek()??[];if(n){const T=[...E];k<T.length&&T[k]===S?T[k]=A:T.push(A),a.data.value=T}else a.data.value=[...E,A]}return A},update:async(g,w)=>{const S=a.data.peek(),k=await f("update","PUT",`/${encodeURIComponent(String(g))}`,w,n&&S?()=>{a.data.value=S.map(A=>r(A)===g?{...A,...w}:A)}:void 0,n?()=>{a.data.value=S}:void 0);if(k!==void 0&&!u){const A=a.data.peek()??[];a.data.value=A.map(E=>r(E)===g?k:E)}return k},patch:async(g,w)=>{const S=a.data.peek(),k=await f("patch","PATCH",`/${encodeURIComponent(String(g))}`,w,n&&S?()=>{a.data.value=S.map(A=>r(A)===g?{...A,...w}:A)}:void 0,n?()=>{a.data.value=S}:void 0);if(k!==void 0&&!u){const A=a.data.peek()??[];a.data.value=A.map(E=>r(E)===g?k:E)}return k},remove:async g=>{const w=a.data.peek();if(await f("remove","DELETE",`/${encodeURIComponent(String(g))}`,void 0,n&&w?()=>{a.data.value=w.filter(S=>r(S)!==g)}:void 0,n?()=>{a.data.value=w}:void 0),!n&&!u&&a.error.peek()==null){const S=a.data.peek()??[];a.data.value=S.filter(k=>r(k)!==g)}}},v=a.dispose,b=()=>{u||(u=!0,v())};return{data:a.data,error:a.error,status:a.status,pending:a.pending,isMutating:l,actions:m,refresh:a.execute,clear:a.clear,dispose:b}},yr=new Map;function Nc(e,t){const r=yr.get(e);if(r)return r;const n=t().finally(()=>{yr.delete(e)});return yr.set(e,n),n}var G=e=>e instanceof Je,ce=e=>e instanceof Ye,Ic=e=>e instanceof Je||e instanceof Ye||Wn(e)?e.value:e,gr=(e,t,r={})=>{const{immediate:n=!1,equals:s=Object.is}=r;let o,i=!0;return U(()=>{const a=e.value;if(i){i=!1,o=a,n&&t(a,void 0);return}s(a,o)||(t(a,o),o=a)})},Mc=(e,t,r,n={})=>{const{immediate:s=!1,equals:o=Object.is}=n,i=Number.isFinite(r)?Math.max(0,r):0;let a=!1,c,l;const u=()=>{h.cancel(),a=!1,l=void 0},h=ur(()=>{if(a){try{t(c,l)}catch(p){console.error("bQuery reactive: Error in watchDebounce callback",p)}a=!1,l=void 0}},i);s&&t(e.peek(),void 0);const d=gr(e,(p,f)=>{a||(l=f),c=p,a=!0,h()},{equals:o});return Mn()&&Dn(u),()=>{d(),u()}},Dc=(e,t,r,n={})=>{const{immediate:s=!1,equals:o=Object.is}=n,i=On((c,l)=>{t(c,l)},Number.isFinite(r)?Math.max(0,r):0);s&&i(e.peek(),void 0);const a=gr(e,(c,l)=>{i(c,l)},{equals:o});return()=>{a(),i.cancel()}};function Fn(e){return e===!1?!1:e===!0||e===void 0?{}:e}var _c=e=>e?e===!0?{}:e:!1,Bn=(e,t)=>{const r=t.delay??1e3,n=t.factor??2,s=t.maxDelay??3e4;return Math.min(r*n**e,s)},br=(e,t)=>{if(typeof t=="string"||t instanceof Blob||t instanceof ArrayBuffer){e.send(t);return}if(ArrayBuffer.isView(t)){e.send(t);return}if(typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer){e.send(t);return}throw new TypeError("Unsupported WebSocket payload type.")},Qn=(e,t={})=>{const{protocols:r,immediate:n=!0,historySize:s=0,onOpen:o,onMessage:i,onClose:a,onError:c,onReconnect:l}=t,u=t.serialize??(M=>JSON.stringify(M)),h=t.deserialize??(M=>{const B=M.data;if(typeof B=="string")try{return JSON.parse(B)}catch{return B}return B}),d=L("CLOSED"),p=L(void 0),f=L(null),m=L([]),v=L(0),b=L(0),g=L(0),w=D(()=>d.value==="OPEN");let S=null,k=!1,A=!1,E,T,P,C=0,$=!1,R=0;const O=[],I=Fn(t.autoReconnect),x=_c(t.heartbeat),W=()=>{if(!x)return;q();const M=x.interval??3e4,B=x.pongTimeout??1e4,J=x.message??"ping";T=setInterval(()=>{S?.readyState===WebSocket.OPEN&&(R=Date.now(),br(S,J),P!==void 0&&clearTimeout(P),P=setTimeout(()=>{S?.close(4e3,"Heartbeat timeout")},B))},M)},q=()=>{T!==void 0&&(clearInterval(T),T=void 0),P!==void 0&&(clearTimeout(P),P=void 0)},V=()=>{P!==void 0&&(clearTimeout(P),P=void 0),R>0&&(b.value=Date.now()-R,R=0)},ve=M=>{if(k||A||!I)return;const B=I.maxAttempts??1/0;if(C>=B||I.shouldReconnect&&!I.shouldReconnect(M,C))return;const J=Bn(C,I);E=setTimeout(()=>{C++,v.value=C,$=!0,on()},J)},He=()=>{E!==void 0&&(clearTimeout(E),E=void 0)},sn=()=>{if(!S||S.readyState!==WebSocket.OPEN)return;let M=0;for(;M<O.length&&S.readyState===WebSocket.OPEN;M++)br(S,O[M]);M>0&&O.splice(0,M)},St=()=>{const M=typeof e=="function"?e():e;return M instanceof URL?M.toString():M},on=()=>{if(!k){He(),S&&(q(),R=0,S.onopen=null,S.onmessage=null,S.onclose=null,S.onerror=null,(S.readyState===WebSocket.OPEN||S.readyState===WebSocket.CONNECTING)&&S.close(),S=null),A=!1,d.value="CONNECTING",f.value=null;try{S=new WebSocket(St(),r)}catch{d.value="CLOSED";return}S.onopen=M=>{d.value="OPEN";const B=$,J=C;C=0,v.value=0,$=!1,sn(),W(),o?.(M),B&&l?.(J)},S.onmessage=M=>{if(x){const J=x.responseMessage;(J===void 0||M.data===J)&&V()}const B=h(M);if(p.value=B,s>0){const J=[...m.peek(),B];m.value=J.length>s?J.slice(-s):J}i?.(B,M)},S.onclose=M=>{d.value="CLOSED",q(),A||(g.value=Date.now()),a?.(M),!A&&!k&&ve(M)},S.onerror=M=>{f.value=M,c?.(M)}}},_i=(M,B)=>{A=!0,He(),q(),S&&(S.readyState===WebSocket.OPEN||S.readyState===WebSocket.CONNECTING)&&(d.value="CLOSING",S.close(M,B))},Np=M=>{k||xi(u(M))},xi=M=>{k||(S?.readyState===WebSocket.OPEN?br(S,M):O.push(M))},Ip=()=>{k||(k=!0,_i(),O.length=0,S=null)};return n&&on(),{status:d,data:p,error:f,history:m,isConnected:w,reconnectAttempts:v,latency:b,lastDisconnectedAt:g,send:Np,sendRaw:xi,open:on,close:_i,dispose:Ip}},xc=(e,t={},r={})=>{const n=r.getChannel??(u=>u.channel),s=r.wrap??((u,h)=>({channel:u,data:h})),o=new Map,i=new Map,a=Qn(e,{...t,onMessage:(u,h)=>{const d=n(u);if(d!==void 0){const p=o.get(d);p&&(p.value=u)}t.onMessage?.(u,h)}});return{subscribe:u=>{let h=o.get(u);h||(h=L(void 0),o.set(u,h)),i.set(u,(i.get(u)??0)+1);let d=!1;return{data:h,unsubscribe:()=>{if(d)return;d=!0;const p=(i.get(u)??1)-1;p<=0?(i.delete(u),o.delete(u)):i.set(u,p)}}},publish:(u,h)=>{a.send(s(u,h))},ws:a}},qc=(e,t={})=>{const{immediate:r=!0,events:n=[],eventSourceInit:s,onOpen:o,onMessage:i,onError:a}=t,c=t.deserialize??($=>{try{return JSON.parse($)}catch{return $}}),l=L("CLOSED"),u=L(void 0),h=L(void 0),d=L(null),p=D(()=>l.value==="OPEN"),f=Fn(t.autoReconnect);let m=null,v=!1,b=!1,g,w=0;const S=()=>{const $=typeof e=="function"?e():e;return $ instanceof URL?$.toString():$},k=$=>R=>{const O=c(R.data);u.value=O,h.value=$,i?.(O,R)},A=()=>{g!==void 0&&(clearTimeout(g),g=void 0)},E=()=>{if(v||b||!f)return;const $=f.maxAttempts??1/0;if(w>=$)return;const R=Bn(w,f);g=setTimeout(()=>{w++,T()},R)},T=()=>{if(!v){A(),m&&(m.close(),m=null),b=!1,l.value="CONNECTING",d.value=null;try{m=new EventSource(S(),s)}catch{l.value="CLOSED";return}m.onopen=$=>{l.value="OPEN",w=0,o?.($)},m.onerror=$=>{d.value=$,a?.($),m?.readyState===EventSource.CLOSED&&(l.value="CLOSED",!b&&!v&&E())},m.addEventListener("message",k("message"));for(const $ of n)m.addEventListener($,k($))}},P=()=>{b=!0,A(),m&&(m.close(),m=null),l.value="CLOSED"},C=()=>{v||(v=!0,P())};return r&&T(),{status:l,data:u,eventName:h,error:d,isConnected:p,open:T,close:P,dispose:C}},H=class extends Error{constructor(e,t,r){super(e),this.name="TaskWorkerError",this.code=t,r!==void 0&&(this.cause=r)}},wr=class extends H{constructor(e="Concurrency tasks are not supported in this environment.",t){super(e,"UNSUPPORTED",t),this.name="TaskWorkerUnsupportedError"}},Ae=class extends H{constructor(e,t){super(e,"SERIALIZATION",t),this.name="TaskWorkerSerializationError"}},Lt=class extends H{constructor(e,t){super(e,"TIMEOUT",t),this.name="TaskWorkerTimeoutError"}},ge=class extends H{constructor(e="The worker task was aborted.",t){super(e,"ABORT",t),this.name="TaskWorkerAbortError"}},zc=new Set(["ABORT","BUSY","METHOD_NOT_FOUND","QUEUE_CLEARED","QUEUE_FULL","SERIALIZATION","TERMINATED","TIMEOUT","UNSUPPORTED","WORKER"]),Uc=/\{\s*\[native code\]\s*\}$/u,jc=e=>typeof e=="string"&&zc.has(e),Pt=e=>{if(!(typeof e!="number"||!Number.isFinite(e)||e<=0))return e},Ge=e=>{const t=Function.prototype.toString.call(e).trim();if(!t||Uc.test(t))throw new Ae("Task handlers must be standalone user-defined functions or arrow functions.");try{if(typeof new Function(`return (${t});`)()!="function")throw new TypeError("Task handler did not revive as a function.")}catch(r){throw new Ae("Task handlers must be standalone functions that can be reconstructed in a worker context.",r)}return t},Vn=(e,t)=>{const r=new Blob([e],{type:"text/javascript"}),n=URL.createObjectURL(r);try{return new Worker(n,t?{name:t}:void 0)}finally{URL.revokeObjectURL(n)}},Kn=e=>{const t=e?.message||"Worker task failed.",r=jc(e?.code)?e.code:"WORKER",n=r==="TIMEOUT"?new Lt(t):new H(t,r);return n.name=e?.name||n.name,e?.stack&&(n.stack=e.stack),n};function Yn(){const e=typeof globalThis.Worker=="function",t=typeof globalThis.Blob=="function",r=typeof globalThis.URL<"u"&&globalThis.URL!==null&&typeof globalThis.URL.createObjectURL=="function"&&typeof globalThis.URL.revokeObjectURL=="function";return{worker:e,blob:t,objectUrl:r,abortController:typeof globalThis.AbortController=="function",supported:e&&t&&r}}function Sr(){return Yn().supported}var Jn="bq:rpc",Hc=e=>{const t=Object.keys(e);if(t.length===0)throw new Ae("RPC workers require at least one standalone method handler.");return t.map(r=>{const n=e[r];if(typeof n!="function")throw new Ae(`RPC handler "${r}" must be a standalone function.`);return[r,Ge(n)]})},Wc=e=>`'use strict';
2
2
  const serializeError = (error) => {
3
3
  if (error && typeof error === 'object') {
4
4
  return {
@@ -23,7 +23,7 @@ const hasOwn = Object.prototype.hasOwnProperty;
23
23
 
24
24
  self.onmessage = async (event) => {
25
25
  const message = event.data;
26
- if (!message || message.type !== '${Vr}') {
26
+ if (!message || message.type !== '${Jn}') {
27
27
  return;
28
28
  }
29
29
 
@@ -47,7 +47,7 @@ self.onmessage = async (event) => {
47
47
  } catch (error) {
48
48
  self.postMessage({ error: serializeError(error), id: message.id, type: 'bq:error' });
49
49
  }
50
- };`;function ut(e,t={}){if(!_t())throw new It;const r=na(ra(e)),n=ct(t.timeout);let s=!1,o=null,i=null,a=0,l;const c=()=>{i&&(i.timeoutId!==void 0&&clearTimeout(i.timeoutId),i.abortHandler&&l?.removeEventListener("abort",i.abortHandler),i=null,l=void 0)},f=()=>{o&&(o.onmessage=null,o.onerror=null,o.terminate(),o=null)},m=u=>{if(!i)return;const h=i;c(),h.reject(u)},d=()=>{if(s)throw new F("The RPC worker has already been terminated.","TERMINATED");if(o)return o;const u=Wr(r,t.name);return u.onmessage=h=>{const v=i;if(!v)return;const b=h.data;if(!(!b||b.id!==v.id)){if(c(),b.type==="bq:error"){v.reject(Hr(b.error));return}v.resolve(b.result)}},u.onerror=h=>{const v=new F(h.message||"Worker RPC execution failed.","WORKER");f(),m(v)},o=u,u},p=u=>{f(),m(u)};return{get busy(){return i!==null},get state(){return s?"terminated":i?"running":"idle"},call(u,h,v={}){if(s)return Promise.reject(new F("The RPC worker has already been terminated.","TERMINATED"));if(i)return Promise.reject(new F("This RPC worker is already processing a request. Wait for the current call to finish or create another worker.","BUSY"));if(v.signal?.aborted)return Promise.reject(new ae);const b=d(),y=ct(v.timeout)??n,w=a++;return new Promise((E,k)=>{const A={id:w,reject:k,resolve:E};v.signal&&(A.abortHandler=()=>{p(new ae)},l=v.signal,v.signal.addEventListener("abort",A.abortHandler,{once:!0})),y!==void 0&&(A.timeoutId=setTimeout(()=>{p(new lt(`Worker RPC call exceeded the timeout of ${y}ms.`))},y)),i=A;try{b.postMessage({id:w,method:u,payload:h,type:Vr},v.transfer??[])}catch(S){f(),m(new de("Failed to serialize the RPC payload or transfer list for worker execution.",S))}})},terminate(){s||(s=!0,f(),m(new F("The RPC worker was terminated.","TERMINATED")))}}}async function sa(e,t,r,n={}){const s=ut(e,n);try{return await s.call(t,r,n)}finally{s.terminate()}}var Kr="bq:run",oa=e=>`'use strict';
50
+ };`;function Nt(e,t={}){if(!Sr())throw new wr;const r=Wc(Hc(e)),n=Pt(t.timeout);let s=!1,o=null,i=null,a=0,c;const l=()=>{i&&(i.timeoutId!==void 0&&clearTimeout(i.timeoutId),i.abortHandler&&c?.removeEventListener("abort",i.abortHandler),i=null,c=void 0)},u=()=>{o&&(o.onmessage=null,o.onerror=null,o.terminate(),o=null)},h=f=>{if(!i)return;const m=i;l(),m.reject(f)},d=()=>{if(s)throw new H("The RPC worker has already been terminated.","TERMINATED");if(o)return o;const f=Vn(r,t.name);return f.onmessage=m=>{const v=i;if(!v)return;const b=m.data;if(!(!b||b.id!==v.id)){if(l(),b.type==="bq:error"){v.reject(Kn(b.error));return}v.resolve(b.result)}},f.onerror=m=>{const v=new H(m.message||"Worker RPC execution failed.","WORKER");u(),h(v)},o=f,f},p=f=>{u(),h(f)};return{get busy(){return i!==null},get state(){return s?"terminated":i?"running":"idle"},call(f,m,v={}){if(s)return Promise.reject(new H("The RPC worker has already been terminated.","TERMINATED"));if(i)return Promise.reject(new H("This RPC worker is already processing a request. Wait for the current call to finish or create another worker.","BUSY"));if(v.signal?.aborted)return Promise.reject(new ge);const b=d(),g=Pt(v.timeout)??n,w=a++;return new Promise((S,k)=>{const A={id:w,reject:k,resolve:S};v.signal&&(A.abortHandler=()=>{p(new ge)},c=v.signal,v.signal.addEventListener("abort",A.abortHandler,{once:!0})),g!==void 0&&(A.timeoutId=setTimeout(()=>{p(new Lt(`Worker RPC call exceeded the timeout of ${g}ms.`))},g)),i=A;try{b.postMessage({id:w,method:f,payload:m,type:Jn},v.transfer??[])}catch(E){u(),h(new Ae("Failed to serialize the RPC payload or transfer list for worker execution.",E))}})},terminate(){s||(s=!0,u(),h(new H("The RPC worker was terminated.","TERMINATED")))}}}async function Fc(e,t,r,n={}){const s=Nt(e,n);try{return await s.call(t,r,n)}finally{s.terminate()}}var Gn="bq:run",Bc=e=>`'use strict';
51
51
  const serializeError = (error) => {
52
52
  if (error && typeof error === 'object') {
53
53
  return {
@@ -72,7 +72,7 @@ if (typeof handler !== 'function') {
72
72
 
73
73
  self.onmessage = async (event) => {
74
74
  const message = event.data;
75
- if (!message || message.type !== '${Kr}') {
75
+ if (!message || message.type !== '${Gn}') {
76
76
  return;
77
77
  }
78
78
 
@@ -82,13 +82,13 @@ self.onmessage = async (event) => {
82
82
  } catch (error) {
83
83
  self.postMessage({ error: serializeError(error), id: message.id, type: 'bq:error' });
84
84
  }
85
- };`;function ft(e,t={}){if(!_t())throw new It;const r=oa(ze(e)),n=ct(t.timeout);let s=!1,o=null,i=null,a=0;const l=()=>{i&&(i.timeoutId!==void 0&&clearTimeout(i.timeoutId),i.abortHandler&&c?.removeEventListener("abort",i.abortHandler),i=null,c=void 0)};let c;const f=()=>{o&&(o.onmessage=null,o.onerror=null,o.terminate(),o=null)},m=u=>{if(!i)return;const h=i;l(),h.reject(u)},d=()=>{if(s)throw new F("The task worker has already been terminated.","TERMINATED");if(o)return o;const u=Wr(r,t.name);return u.onmessage=h=>{const v=i;if(!v)return;const b=h.data;if(!(!b||b.id!==v.id)){if(l(),b.type==="bq:error"){v.reject(Hr(b.error));return}v.resolve(b.result)}},u.onerror=h=>{const v=new F(h.message||"Worker execution failed.","WORKER");f(),m(v)},o=u,u},p=u=>{f(),m(u)};return{get busy(){return i!==null},get state(){return s?"terminated":i?"running":"idle"},run(u,h={}){if(s)return Promise.reject(new F("The task worker has already been terminated.","TERMINATED"));if(i)return Promise.reject(new F("This task worker is already running a task. Create another worker or wait for the current task to finish.","BUSY"));if(h.signal?.aborted)return Promise.reject(new ae);const v=d(),b=ct(h.timeout)??n,y=a++;return new Promise((w,E)=>{const k={id:y,reject:E,resolve:w};h.signal&&(k.abortHandler=()=>{p(new ae)},c=h.signal,h.signal.addEventListener("abort",k.abortHandler,{once:!0})),b!==void 0&&(k.timeoutId=setTimeout(()=>{p(new lt(`Worker task exceeded the timeout of ${b}ms.`))},b)),i=k;try{v.postMessage({id:y,payload:u,type:Kr},h.transfer??[])}catch(A){f(),m(new de("Failed to serialize the task input or transfer list for worker execution.",A))}})},terminate(){s||(s=!0,f(),m(new F("The task worker was terminated.","TERMINATED")))}}}async function Yr(e,t,r={}){const n=ft(e,r);try{return await n.run(t,r)}finally{n.terminate()}}var ia=4,Gr=(e,t)=>{if(e===void 0)return ia;if(!Number.isInteger(e)||e<1)throw new RangeError(`${t} concurrency must be a positive integer.`);return e},Jr=(e,t)=>{if(e===void 0)return Number.POSITIVE_INFINITY;if(e===Number.POSITIVE_INFINITY)return e;if(!Number.isInteger(e)||e<0)throw new RangeError(`${t} maxQueue must be a non-negative integer or Infinity.`);return e},dt=e=>{e.abortHandler&&e.signal&&e.signal.removeEventListener("abort",e.abortHandler),e.abortHandler=void 0,e.signal=void 0},Xr=({abortedWhileQueuedMessage:e,clearMessage:t,concurrency:r,createWorkers:n,queueFullMessage:s,terminatedMessage:o,workerTerminatedMessage:i,runWorker:a,maxQueue:l})=>{const c=[],f=n(r);let m=!1,d=0;const p=()=>{if(!(m||c.length===0))for(const h of f){if(c.length===0)return;if(h.busy)continue;const v=c.shift();if(v.signal?.aborted){dt(v),v.reject(new ae(e));continue}dt(v),d++,a(h,v.job,v.options).then(v.resolve,v.reject).finally(()=>{d--,p()})}},u=h=>{const v=c.splice(0);for(const b of v)dt(b),b.reject(h)};return{get state(){return m?"terminated":d>0||c.length>0?"running":"idle"},get busy(){return d>0||c.length>0},concurrency:r,get pending(){return d},get size(){return c.length},enqueue(h,v={}){return m?Promise.reject(new F(i,"TERMINATED")):v.signal?.aborted?Promise.reject(new ae):new Promise((b,y)=>{const w={job:h,options:v,reject:y,resolve:b},E=f.find(k=>!k.busy);if(E){d++,a(E,h,v).then(b,y).finally(()=>{d--,p()});return}if(c.length>=l){y(new F(s,"QUEUE_FULL"));return}v.signal&&(w.signal=v.signal,w.abortHandler=()=>{const k=c.indexOf(w);k!==-1&&(c.splice(k,1),dt(w),y(new ae(e)))},v.signal.addEventListener("abort",w.abortHandler,{once:!0})),c.push(w)})},clear(){m||c.length===0||u(new F(t,"QUEUE_CLEARED"))},terminate(){if(!m){m=!0,u(new F(o,"TERMINATED"));for(const h of f)"terminate"in h&&typeof h.terminate=="function"&&h.terminate()}}}},Zr=(e,t)=>e?t===1?[e]:Array.from({length:t},(r,n)=>`${e}-${n+1}`):Array.from({length:t},()=>{});function ht(e,t={}){const{concurrency:r,maxQueue:n,...s}=t,o=Xr({abortedWhileQueuedMessage:"The queued task was aborted before execution started.",clearMessage:"The task pool queue was cleared.",concurrency:Gr(r,"Task pool"),createWorkers(i){const a=[],l=Zr(s.name,i);try{for(let c=0;c<i;c++)a.push(ft(e,{...s,name:l[c]}))}catch(c){for(const f of a)f.terminate();throw c}return a},queueFullMessage:"The task pool queue is full. Increase maxQueue, wait for pending tasks, or raise pool concurrency.",terminatedMessage:"The task pool was terminated.",workerTerminatedMessage:"The task pool has already been terminated.",runWorker(i,a,l){return i.run(a,l)},maxQueue:Jr(n,"Task pool")});return{get state(){return o.state},get busy(){return o.busy},get concurrency(){return o.concurrency},get pending(){return o.pending},get size(){return o.size},run(i,a){return o.enqueue(i,a)},clear(){o.clear()},terminate(){o.terminate()}}}function en(e,t={}){const{concurrency:r,maxQueue:n,...s}=t,o=Xr({abortedWhileQueuedMessage:"The queued RPC call was aborted before execution started.",clearMessage:"The RPC pool queue was cleared.",concurrency:Gr(r,"RPC pool"),createWorkers(i){const a=[],l=Zr(s.name,i);try{for(let c=0;c<i;c++)a.push(ut(e,{...s,name:l[c]}))}catch(c){for(const f of a)f.terminate();throw c}return a},queueFullMessage:"The RPC pool queue is full. Increase maxQueue, wait for pending calls, or raise pool concurrency.",terminatedMessage:"The RPC pool was terminated.",workerTerminatedMessage:"The RPC pool has already been terminated.",runWorker(i,a,l){return i.call(a.method,a.input,l)},maxQueue:Jr(n,"RPC pool")});return{get state(){return o.state},get busy(){return o.busy},get concurrency(){return o.concurrency},get pending(){return o.pending},get size(){return o.size},call(i,a,l){return o.enqueue({input:a,method:i},l)},clear(){o.clear()},terminate(){o.terminate()}}}var aa=async e=>{const t=new Function(`return (${e.handlerSource});`)();if(typeof t!="function")throw new TypeError("The serialized task handler did not revive as a function.");return await t(e.input)},la=async e=>{const t=new Function(`return (${e.handlerSource});`)();if(typeof t!="function")throw new TypeError("The serialized collection handler did not revive as a function.");const r=[];for(const n of e.items)r.push({index:n.index,value:await t(n.value,n.index)});return r},ca=async e=>{const t=new Function(`return (${e.reducerSource});`)();if(typeof t!="function")throw new TypeError("The serialized reducer did not revive as a function.");let r=e.initialValue;for(let n=0;n<e.values.length;n++)r=await t(r,e.values[n],n);return r},tn=(e,t)=>{if(e===void 0)return 1;if(!Number.isInteger(e)||e<1)throw new RangeError(`${t} batchSize must be a positive integer.`);return e},rn=e=>ht(aa,e),nn=e=>({handlerSource:ze(e.handler),input:e.input}),xe=async(e,t,r={},n)=>{if(e.length===0)return[];const s=ze(t),{batchSize:o,signal:i,...a}=r,l=tn(o,n),c=ht(la,a),f=[];for(let m=0;m<e.length;m+=l){const d=Math.min(m+l,e.length),p=[];for(let u=m;u<d;u+=1)p.push({index:u,value:e[u]});f.push({items:p,handlerSource:s})}try{const m=await Promise.all(f.map(p=>c.run(p,i?{signal:i}:void 0))),d=new Array(e.length);for(const p of m)for(const u of p)d[u.index]=u.value;return d}finally{c.terminate()}};async function ua(e,t={}){if(e.length===0)return[];const r=rn(t);try{return await Promise.all(e.map(n=>r.run(nn(n),n.options)))}finally{r.terminate()}}async function fa(e,t,r={}){if(e.length===0)return[];const n=tn(t,"batchTasks"),s=rn(r),o=[];try{for(let i=0;i<e.length;i+=n){const a=e.slice(i,i+n),l=await Promise.all(a.map(c=>s.run(nn(c),c.options)));o.push(...l)}return o}finally{s.terminate()}}async function sn(e,t,r={}){return xe(e,t,r,"map")}async function on(e,t,r={}){const n=await xe(e,t,r,"filter"),s=[];for(let o=0;o<e.length;o+=1)n[o]&&(o in e?s.push(e[o]):s.length+=1);return s}async function an(e,t,r={}){return e.length===0?!1:(await xe(e,t,r,"some")).some(Boolean)}async function ln(e,t,r={}){return e.length===0?!0:(await xe(e,t,r,"every")).every(Boolean)}async function cn(e,t,r={}){if(e.length===0)return;const n=(await xe(e,t,r,"find")).findIndex(Boolean);return n===-1?void 0:e[n]}async function un(e,t,r,n={}){return e.length===0?r:Yr(ca,{initialValue:r,reducerSource:ze(t),values:e},n)}var je=(e,t={})=>({...e,...t}),da=(e,t={})=>({signal:"signal"in t?t.signal:e.signal,timeout:"timeout"in t?t.timeout:e.timeout,transfer:t.transfer}),ha=class Qs{constructor(t,r){this.valuesPromise=t,this.defaults=r}createNext(t){return new Qs(this.valuesPromise.then(r=>t(r)),this.defaults)}map(t,r){const n=je(this.defaults,r);return this.createNext(s=>sn(s,t,n))}filter(t,r){const n=je(this.defaults,r);return this.createNext(s=>on(s,t,n))}toArray(){return this.valuesPromise.then(t=>t.slice())}some(t,r){const n=je(this.defaults,r);return this.valuesPromise.then(s=>an(s,t,n))}every(t,r){const n=je(this.defaults,r);return this.valuesPromise.then(s=>ln(s,t,n))}find(t,r){const n=je(this.defaults,r);return this.valuesPromise.then(s=>cn(s,t,n))}reduce(t,r,n){const s=da(this.defaults,n);return this.valuesPromise.then(o=>un(o,t,r,s))}};function ma(e,t={}){return new ha(Promise.resolve(e.slice()),t)}var fn=(e,t)=>{ce(()=>{t.state.value=e.state,t.busy.value=e.busy})},dn=(e,t)=>{ce(()=>{t.state.value=e.state,t.busy.value=e.busy,t.concurrency.value=e.concurrency,t.pending.value=e.pending,t.size.value=e.size})},hn=e=>({busy:$(e.busy),state:$(e.state)}),mn=e=>({busy:$(e.busy),concurrency:$(e.concurrency),pending:$(e.pending),size:$(e.size),state:$(e.state)}),mt=(e,t)=>(t(),e.finally(()=>{t(),queueMicrotask(t)}));function pa(e,t={}){const r=ft(e,t),n=hn(r),s=()=>{fn(r,n)};return{get busy(){return r.busy},get state(){return r.state},busy$:I(n.busy),state$:I(n.state),run(o,i={}){return mt(r.run(o,i),s)},terminate(){r.terminate(),s()}}}function va(e,t={}){const r=ut(e,t),n=hn(r),s=()=>{fn(r,n)};return{get busy(){return r.busy},get state(){return r.state},busy$:I(n.busy),state$:I(n.state),call(o,i,a={}){return mt(r.call(o,i,a),s)},terminate(){r.terminate(),s()}}}function ya(e,t={}){const r=ht(e,t),n=mn(r),s=()=>{dn(r,n)};return{get busy(){return r.busy},get concurrency(){return r.concurrency},get pending(){return r.pending},get size(){return r.size},get state(){return r.state},busy$:I(n.busy),concurrency$:I(n.concurrency),pending$:I(n.pending),size$:I(n.size),state$:I(n.state),run(o,i={}){return mt(r.run(o,i),s)},clear(){r.clear(),s()},terminate(){r.terminate(),s()}}}function ga(e,t={}){const r=en(e,t),n=mn(r),s=()=>{dn(r,n)};return{get busy(){return r.busy},get concurrency(){return r.concurrency},get pending(){return r.pending},get size(){return r.size},get state(){return r.state},busy$:I(n.busy),concurrency$:I(n.concurrency),pending$:I(n.pending),size$:I(n.size),state$:I(n.state),call(o,i,a={}){return mt(r.call(o,i,a),s)},clear(){r.clear(),s()},terminate(){r.terminate(),s()}}}var ba=(e,t)=>{const{type:r}=t;if(r===String)return e;if(r===Number)return Number(e);if(r===Boolean){const n=e.trim().toLowerCase();return n===""||n==="true"||n==="1"?!0:n==="false"||n==="0"?!1:!!e}if(r===Object||r===Array)try{return JSON.parse(e)}catch{return e}if(typeof r=="function"){const n=r,s=r;if(t.construct===!0)return Reflect.construct(s,[e]);if(t.construct===!1)return n(e);const o=r.prototype!==void 0&&r.prototype!==null,i=(o?Object.getOwnPropertyNames(r.prototype):[]).length>1,a=o&&r.prototype.constructor!==r,l=/^class\s/.test(Function.prototype.toString.call(r));if(i||a||l)try{return Reflect.construct(s,[e])}catch{return n(e)}try{const c=n(e);if(c===void 0&&o)try{return Reflect.construct(s,[e])}catch{return c}return c}catch(c){if(c instanceof TypeError&&/cannot be invoked without 'new'|is not a function/i.test(c.message))return Reflect.construct(s,[e]);throw c}}return e},qt=()=>{try{const e=globalThis;if(typeof e.__BQUERY_DEV__=="boolean")return e.__BQUERY_DEV__;const t=e.process?.env?.NODE_ENV;if(typeof t=="string")return t!=="production";const r=e.process?.versions?.node;if(typeof r=="string"&&r.length>0)return!0;const n=e.process?.release?.name;return n==="node"||n==="io.js"}catch{return!1}},Fe;function le(e){const t=Fe;return Fe=e,t}function pn(){const e=[];return{addDisposer(t){e.push(t)},dispose(){for(const t of e)try{t()}catch(r){qt()&&typeof console<"u"&&typeof console.error=="function"&&console.error("bQuery component: Error disposing scoped resource",r)}e.length=0}}}function wa(e){const t=Fe;if(!t)throw new Error("bQuery component: useSignal() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=$(e);return t.addDisposer(()=>r.dispose()),r}function Ea(e){const t=Fe;if(!t)throw new Error("bQuery component: useComputed() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=D(e);return t.addDisposer(()=>r.dispose()),r}function Sa(e){const t=Fe;if(!t)throw new Error("bQuery component: useEffect() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=j(e);return t.addDisposer(r),r}var Aa=["slot"],ka=["part","disabled","checked","placeholder","value","rows","cols","readonly","required","maxlength","minlength","max","min","step","pattern","autocomplete","autofocus","for","multiple","selected","wrap"],vn=(e,t)=>{const r=[...Aa,...t.sanitize?.allowTags??[]],n=[...ka,...t.sanitize?.allowAttributes??[]],s=Object.values(t.signals??{}),i=(c=>c===!1?!1:c==="closed"?"closed":"open")(t.shadow),a=Array.from(new Set([...Object.keys(t.props??{}),...t.observeAttributes??[]]));class l extends HTMLElement{constructor(){super(),this.state={...t.state??{}},this.props={},this.missingRequiredProps=new Set,this.hasMounted=!1,i!==!1?this.renderRootNode=this.attachShadow({mode:i}):this.renderRootNode=this,this.syncProps()}static get observedAttributes(){return a}connectedCallback(){try{if(!this.hasMounted&&this.missingRequiredProps.size>0)return;if(this.hasMounted){this.scope=pn();const f=le(this.scope);try{t.connected?.call(this)}catch(m){this.handleError(m)}finally{le(f)}this.setupSignalSubscriptions(!0);return}this.mount()}catch(f){this.handleError(f)}}mount(){if(this.hasMounted)return;const f=le(this.ensureScope());let m=!1;try{t.beforeMount?.call(this),t.connected?.call(this)}catch(d){m=!0,this.handleError(d)}finally{le(f)}if(m){this.scope?.dispose(),this.scope=void 0;return}this.render(),this.setupSignalSubscriptions(),this.hasMounted=!0}disconnectedCallback(){try{this.signalEffectCleanup?.(),this.signalEffectCleanup=void 0,this.scope?.dispose(),this.scope=void 0,t.disconnected?.call(this)}catch(f){this.handleError(f)}}attributeChangedCallback(f,m,d){try{const p=this.cloneProps();if(this.syncProps(),t.onAttributeChanged){const u=le(this.ensureScope());try{t.onAttributeChanged.call(this,f,m,d)}finally{le(u)}}this.hasMounted?this.render(!0,p,{name:f,oldValue:m,newValue:d}):this.isConnected&&this.missingRequiredProps.size===0&&this.mount()}catch(p){this.handleError(p)}}adoptedCallback(){if(!t.onAdopted)return;const f=le(this.ensureScope());try{t.onAdopted.call(this)}catch(m){this.handleError(m)}finally{le(f)}}handleError(f){t.onError?t.onError.call(this,f):console.error(`bQuery component error in <${e}>:`,f)}ensureScope(){return this.scope??(this.scope=pn())}setState(f,m){this.state[f]=m,this.render(!0,this.cloneProps(),void 0,!1)}getState(f){return this.state[f]}setupSignalSubscriptions(f=!1){if(this.signalEffectCleanup||s.length===0)return;let m=!0;this.signalEffectCleanup=j(()=>{try{for(const p of s)p.value;if(m){if(m=!1,f&&this.hasMounted&&this.isConnected){const p=this.cloneProps();ue(()=>{this.render(!0,p,void 0,!1)})}return}if(!this.hasMounted||!this.isConnected)return;const d=this.cloneProps();ue(()=>{this.render(!0,d,void 0,!1)})}catch(d){this.handleError(d)}})}syncProps(){const f=t.props??{};for(const[m,d]of Object.entries(f)){const p=this.getAttribute(m);let u;if(p==null?d.required&&d.default===void 0?(this.missingRequiredProps.add(m),u=void 0):u=d.default??void 0:(this.missingRequiredProps.has(m)&&this.missingRequiredProps.delete(m),u=ba(p,d)),d.validator&&u!==void 0&&!d.validator(u))throw new Error(`bQuery component: validation failed for prop "${m}" with value ${JSON.stringify(u)}`);this.props[m]=u}}cloneProps(){return{...this.props}}render(f=!1,m,d,p=!0){try{if(f&&p&&t.beforeUpdate){if(!m)throw new Error("bQuery component: previous props are required for update renders");if(t.beforeUpdate.call(this,this.props,m)===!1)return}const u=(y,w)=>{this.dispatchEvent(new CustomEvent(y,{detail:w,bubbles:!0,composed:!0}))},h=this.renderRootNode,v=X(t.render({props:this.props,state:this.state,signals:t.signals??{},emit:u}),{allowTags:r,allowAttributes:n});let b=null;if(t.styles&&(b=h.querySelector("style[data-bquery-component-style]")),h.innerHTML=v,t.styles){const y=b??document.createElement("style");b||y.setAttribute("data-bquery-component-style",""),y.textContent=t.styles,h.prepend(y)}f&&t.updated?.call(this,d)}catch(u){this.handleError(u)}}}return l};function Ta(e,t){return vn(e,t)}function Ee(e,t){const r=vn(e,t);customElements.get(e)||customElements.define(e,r)}var yn=Symbol("bquery.booleanAttribute"),Ca=/^[^\0-\x20"'/>=]+$/,gn=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return t[yn]===!0&&typeof t.enabled=="boolean"&&typeof t.name=="string"},bn=e=>gn(e)?e.enabled?e.name:"":String(e??""),Ra={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},Oa=e=>gn(e)?e.enabled?e.name:"":bn(e).replace(/[&<>"'`]/g,t=>Ra[t]),La=(e,t)=>{if(!Ca.test(e))throw new TypeError(`Invalid boolean attribute name: ${e}`);return Object.freeze({[yn]:!0,enabled:!!t,name:e})},Se=(e,...t)=>e.reduce((r,n,s)=>`${r}${n}${bn(t[s])}`,""),$a=(e,...t)=>{const r=n=>so(n)?oo(n):Oa(n);return mr(e.reduce((n,s,o)=>`${n}${s}${o<t.length?r(t[o]):""}`,""))},pt=`
85
+ };`;function It(e,t={}){if(!Sr())throw new wr;const r=Bc(Ge(e)),n=Pt(t.timeout);let s=!1,o=null,i=null,a=0;const c=()=>{i&&(i.timeoutId!==void 0&&clearTimeout(i.timeoutId),i.abortHandler&&l?.removeEventListener("abort",i.abortHandler),i=null,l=void 0)};let l;const u=()=>{o&&(o.onmessage=null,o.onerror=null,o.terminate(),o=null)},h=f=>{if(!i)return;const m=i;c(),m.reject(f)},d=()=>{if(s)throw new H("The task worker has already been terminated.","TERMINATED");if(o)return o;const f=Vn(r,t.name);return f.onmessage=m=>{const v=i;if(!v)return;const b=m.data;if(!(!b||b.id!==v.id)){if(c(),b.type==="bq:error"){v.reject(Kn(b.error));return}v.resolve(b.result)}},f.onerror=m=>{const v=new H(m.message||"Worker execution failed.","WORKER");u(),h(v)},o=f,f},p=f=>{u(),h(f)};return{get busy(){return i!==null},get state(){return s?"terminated":i?"running":"idle"},run(f,m={}){if(s)return Promise.reject(new H("The task worker has already been terminated.","TERMINATED"));if(i)return Promise.reject(new H("This task worker is already running a task. Create another worker or wait for the current task to finish.","BUSY"));if(m.signal?.aborted)return Promise.reject(new ge);const v=d(),b=Pt(m.timeout)??n,g=a++;return new Promise((w,S)=>{const k={id:g,reject:S,resolve:w};m.signal&&(k.abortHandler=()=>{p(new ge)},l=m.signal,m.signal.addEventListener("abort",k.abortHandler,{once:!0})),b!==void 0&&(k.timeoutId=setTimeout(()=>{p(new Lt(`Worker task exceeded the timeout of ${b}ms.`))},b)),i=k;try{v.postMessage({id:g,payload:f,type:Gn},m.transfer??[])}catch(A){u(),h(new Ae("Failed to serialize the task input or transfer list for worker execution.",A))}})},terminate(){s||(s=!0,u(),h(new H("The task worker was terminated.","TERMINATED")))}}}async function Xn(e,t,r={}){const n=It(e,r);try{return await n.run(t,r)}finally{n.terminate()}}var Qc=4,Zn=(e,t)=>{if(e===void 0)return Qc;if(!Number.isInteger(e)||e<1)throw new RangeError(`${t} concurrency must be a positive integer.`);return e},es=(e,t)=>{if(e===void 0)return Number.POSITIVE_INFINITY;if(e===Number.POSITIVE_INFINITY)return e;if(!Number.isInteger(e)||e<0)throw new RangeError(`${t} maxQueue must be a non-negative integer or Infinity.`);return e},Mt=e=>{e.abortHandler&&e.signal&&e.signal.removeEventListener("abort",e.abortHandler),e.abortHandler=void 0,e.signal=void 0},ts=({abortedWhileQueuedMessage:e,clearMessage:t,concurrency:r,createWorkers:n,queueFullMessage:s,terminatedMessage:o,workerTerminatedMessage:i,runWorker:a,maxQueue:c})=>{const l=[],u=n(r);let h=!1,d=0;const p=()=>{if(!(h||l.length===0))for(const m of u){if(l.length===0)return;if(m.busy)continue;const v=l.shift();if(v.signal?.aborted){Mt(v),v.reject(new ge(e));continue}Mt(v),d++,a(m,v.job,v.options).then(v.resolve,v.reject).finally(()=>{d--,p()})}},f=m=>{const v=l.splice(0);for(const b of v)Mt(b),b.reject(m)};return{get state(){return h?"terminated":d>0||l.length>0?"running":"idle"},get busy(){return d>0||l.length>0},concurrency:r,get pending(){return d},get size(){return l.length},enqueue(m,v={}){return h?Promise.reject(new H(i,"TERMINATED")):v.signal?.aborted?Promise.reject(new ge):new Promise((b,g)=>{const w={job:m,options:v,reject:g,resolve:b},S=u.find(k=>!k.busy);if(S){d++,a(S,m,v).then(b,g).finally(()=>{d--,p()});return}if(l.length>=c){g(new H(s,"QUEUE_FULL"));return}v.signal&&(w.signal=v.signal,w.abortHandler=()=>{const k=l.indexOf(w);k!==-1&&(l.splice(k,1),Mt(w),g(new ge(e)))},v.signal.addEventListener("abort",w.abortHandler,{once:!0})),l.push(w)})},clear(){h||l.length===0||f(new H(t,"QUEUE_CLEARED"))},terminate(){if(!h){h=!0,f(new H(o,"TERMINATED"));for(const m of u)"terminate"in m&&typeof m.terminate=="function"&&m.terminate()}}}},rs=(e,t)=>e?t===1?[e]:Array.from({length:t},(r,n)=>`${e}-${n+1}`):Array.from({length:t},()=>{});function Dt(e,t={}){const{concurrency:r,maxQueue:n,...s}=t,o=ts({abortedWhileQueuedMessage:"The queued task was aborted before execution started.",clearMessage:"The task pool queue was cleared.",concurrency:Zn(r,"Task pool"),createWorkers(i){const a=[],c=rs(s.name,i);try{for(let l=0;l<i;l++)a.push(It(e,{...s,name:c[l]}))}catch(l){for(const u of a)u.terminate();throw l}return a},queueFullMessage:"The task pool queue is full. Increase maxQueue, wait for pending tasks, or raise pool concurrency.",terminatedMessage:"The task pool was terminated.",workerTerminatedMessage:"The task pool has already been terminated.",runWorker(i,a,c){return i.run(a,c)},maxQueue:es(n,"Task pool")});return{get state(){return o.state},get busy(){return o.busy},get concurrency(){return o.concurrency},get pending(){return o.pending},get size(){return o.size},run(i,a){return o.enqueue(i,a)},clear(){o.clear()},terminate(){o.terminate()}}}function ns(e,t={}){const{concurrency:r,maxQueue:n,...s}=t,o=ts({abortedWhileQueuedMessage:"The queued RPC call was aborted before execution started.",clearMessage:"The RPC pool queue was cleared.",concurrency:Zn(r,"RPC pool"),createWorkers(i){const a=[],c=rs(s.name,i);try{for(let l=0;l<i;l++)a.push(Nt(e,{...s,name:c[l]}))}catch(l){for(const u of a)u.terminate();throw l}return a},queueFullMessage:"The RPC pool queue is full. Increase maxQueue, wait for pending calls, or raise pool concurrency.",terminatedMessage:"The RPC pool was terminated.",workerTerminatedMessage:"The RPC pool has already been terminated.",runWorker(i,a,c){return i.call(a.method,a.input,c)},maxQueue:es(n,"RPC pool")});return{get state(){return o.state},get busy(){return o.busy},get concurrency(){return o.concurrency},get pending(){return o.pending},get size(){return o.size},call(i,a,c){return o.enqueue({input:a,method:i},c)},clear(){o.clear()},terminate(){o.terminate()}}}var Vc=async e=>{const t=new Function(`return (${e.handlerSource});`)();if(typeof t!="function")throw new TypeError("The serialized task handler did not revive as a function.");return await t(e.input)},Kc=async e=>{const t=new Function(`return (${e.handlerSource});`)();if(typeof t!="function")throw new TypeError("The serialized collection handler did not revive as a function.");const r=[];for(const n of e.items)r.push({index:n.index,value:await t(n.value,n.index)});return r},Yc=async e=>{const t=new Function(`return (${e.reducerSource});`)();if(typeof t!="function")throw new TypeError("The serialized reducer did not revive as a function.");let r=e.initialValue;for(let n=0;n<e.values.length;n++)r=await t(r,e.values[n],n);return r},ss=(e,t)=>{if(e===void 0)return 1;if(!Number.isInteger(e)||e<1)throw new RangeError(`${t} batchSize must be a positive integer.`);return e},os=e=>Dt(Vc,e),is=e=>({handlerSource:Ge(e.handler),input:e.input}),Xe=async(e,t,r={},n)=>{if(e.length===0)return[];const s=Ge(t),{batchSize:o,signal:i,...a}=r,c=ss(o,n),l=Dt(Kc,a),u=[];for(let h=0;h<e.length;h+=c){const d=Math.min(h+c,e.length),p=[];for(let f=h;f<d;f+=1)p.push({index:f,value:e[f]});u.push({items:p,handlerSource:s})}try{const h=await Promise.all(u.map(p=>l.run(p,i?{signal:i}:void 0))),d=new Array(e.length);for(const p of h)for(const f of p)d[f.index]=f.value;return d}finally{l.terminate()}};async function Jc(e,t={}){if(e.length===0)return[];const r=os(t);try{return await Promise.all(e.map(n=>r.run(is(n),n.options)))}finally{r.terminate()}}async function Gc(e,t,r={}){if(e.length===0)return[];const n=ss(t,"batchTasks"),s=os(r),o=[];try{for(let i=0;i<e.length;i+=n){const a=e.slice(i,i+n),c=await Promise.all(a.map(l=>s.run(is(l),l.options)));o.push(...c)}return o}finally{s.terminate()}}async function as(e,t,r={}){return Xe(e,t,r,"map")}async function cs(e,t,r={}){const n=await Xe(e,t,r,"filter"),s=[];for(let o=0;o<e.length;o+=1)n[o]&&(o in e?s.push(e[o]):s.length+=1);return s}async function ls(e,t,r={}){return e.length===0?!1:(await Xe(e,t,r,"some")).some(Boolean)}async function us(e,t,r={}){return e.length===0?!0:(await Xe(e,t,r,"every")).every(Boolean)}async function fs(e,t,r={}){if(e.length===0)return;const n=(await Xe(e,t,r,"find")).findIndex(Boolean);return n===-1?void 0:e[n]}async function ds(e,t,r,n={}){return e.length===0?r:Xn(Yc,{initialValue:r,reducerSource:Ge(t),values:e},n)}var Ze=(e,t={})=>({...e,...t}),Xc=(e,t={})=>({signal:"signal"in t?t.signal:e.signal,timeout:"timeout"in t?t.timeout:e.timeout,transfer:t.transfer}),Zc=class qi{constructor(t,r){this.valuesPromise=t,this.defaults=r}createNext(t){return new qi(this.valuesPromise.then(r=>t(r)),this.defaults)}map(t,r){const n=Ze(this.defaults,r);return this.createNext(s=>as(s,t,n))}filter(t,r){const n=Ze(this.defaults,r);return this.createNext(s=>cs(s,t,n))}toArray(){return this.valuesPromise.then(t=>t.slice())}some(t,r){const n=Ze(this.defaults,r);return this.valuesPromise.then(s=>ls(s,t,n))}every(t,r){const n=Ze(this.defaults,r);return this.valuesPromise.then(s=>us(s,t,n))}find(t,r){const n=Ze(this.defaults,r);return this.valuesPromise.then(s=>fs(s,t,n))}reduce(t,r,n){const s=Xc(this.defaults,n);return this.valuesPromise.then(o=>ds(o,t,r,s))}};function el(e,t={}){return new Zc(Promise.resolve(e.slice()),t)}var hs=(e,t)=>{Se(()=>{t.state.value=e.state,t.busy.value=e.busy})},ms=(e,t)=>{Se(()=>{t.state.value=e.state,t.busy.value=e.busy,t.concurrency.value=e.concurrency,t.pending.value=e.pending,t.size.value=e.size})},ps=e=>({busy:L(e.busy),state:L(e.state)}),vs=e=>({busy:L(e.busy),concurrency:L(e.concurrency),pending:L(e.pending),size:L(e.size),state:L(e.state)}),_t=(e,t)=>(t(),e.finally(()=>{t(),queueMicrotask(t)}));function tl(e,t={}){const r=It(e,t),n=ps(r),s=()=>{hs(r,n)};return{get busy(){return r.busy},get state(){return r.state},busy$:_(n.busy),state$:_(n.state),run(o,i={}){return _t(r.run(o,i),s)},terminate(){r.terminate(),s()}}}function rl(e,t={}){const r=Nt(e,t),n=ps(r),s=()=>{hs(r,n)};return{get busy(){return r.busy},get state(){return r.state},busy$:_(n.busy),state$:_(n.state),call(o,i,a={}){return _t(r.call(o,i,a),s)},terminate(){r.terminate(),s()}}}function nl(e,t={}){const r=Dt(e,t),n=vs(r),s=()=>{ms(r,n)};return{get busy(){return r.busy},get concurrency(){return r.concurrency},get pending(){return r.pending},get size(){return r.size},get state(){return r.state},busy$:_(n.busy),concurrency$:_(n.concurrency),pending$:_(n.pending),size$:_(n.size),state$:_(n.state),run(o,i={}){return _t(r.run(o,i),s)},clear(){r.clear(),s()},terminate(){r.terminate(),s()}}}function sl(e,t={}){const r=ns(e,t),n=vs(r),s=()=>{ms(r,n)};return{get busy(){return r.busy},get concurrency(){return r.concurrency},get pending(){return r.pending},get size(){return r.size},get state(){return r.state},busy$:_(n.busy),concurrency$:_(n.concurrency),pending$:_(n.pending),size$:_(n.size),state$:_(n.state),call(o,i,a={}){return _t(r.call(o,i,a),s)},clear(){r.clear(),s()},terminate(){r.terminate(),s()}}}var ol=(e,t)=>{const{type:r}=t;if(r===String)return e;if(r===Number)return Number(e);if(r===Boolean){const n=e.trim().toLowerCase();return n===""||n==="true"||n==="1"?!0:n==="false"||n==="0"?!1:!!e}if(r===Object||r===Array)try{return JSON.parse(e)}catch{return e}if(typeof r=="function"){const n=r,s=r;if(t.construct===!0)return Reflect.construct(s,[e]);if(t.construct===!1)return n(e);const o=r.prototype!==void 0&&r.prototype!==null,i=(o?Object.getOwnPropertyNames(r.prototype):[]).length>1,a=o&&r.prototype.constructor!==r,c=/^class\s/.test(Function.prototype.toString.call(r));if(i||a||c)try{return Reflect.construct(s,[e])}catch{return n(e)}try{const l=n(e);if(l===void 0&&o)try{return Reflect.construct(s,[e])}catch{return l}return l}catch(l){if(l instanceof TypeError&&/cannot be invoked without 'new'|is not a function/i.test(l.message))return Reflect.construct(s,[e]);throw l}}return e},xt=()=>{try{const e=globalThis;if(typeof e.__BQUERY_DEV__=="boolean")return e.__BQUERY_DEV__;const t=e.process?.env?.NODE_ENV;if(typeof t=="string")return t!=="production";const r=e.process?.versions?.node;if(typeof r=="string"&&r.length>0)return!0;const n=e.process?.release?.name;return n==="node"||n==="io.js"}catch{return!1}},et;function be(e){const t=et;return et=e,t}function ys(){const e=[];return{addDisposer(t){e.push(t)},dispose(){for(const t of e)try{t()}catch(r){xt()&&typeof console<"u"&&typeof console.error=="function"&&console.error("bQuery component: Error disposing scoped resource",r)}e.length=0}}}function il(e){const t=et;if(!t)throw new Error("bQuery component: useSignal() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=L(e);return t.addDisposer(()=>r.dispose()),r}function al(e){const t=et;if(!t)throw new Error("bQuery component: useComputed() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=D(e);return t.addDisposer(()=>r.dispose()),r}function cl(e){const t=et;if(!t)throw new Error("bQuery component: useEffect() must be called inside a component lifecycle hook. Avoid calling it directly from render()");const r=U(e);return t.addDisposer(r),r}var ll=["slot"],ul=["part","disabled","checked","placeholder","value","rows","cols","readonly","required","maxlength","minlength","max","min","step","pattern","autocomplete","autofocus","for","multiple","selected","wrap"],gs=(e,t)=>{const r=[...ll,...t.sanitize?.allowTags??[]],n=[...ul,...t.sanitize?.allowAttributes??[]],s=Object.values(t.signals??{}),i=(l=>l===!1?!1:l==="closed"?"closed":"open")(t.shadow),a=Array.from(new Set([...Object.keys(t.props??{}),...t.observeAttributes??[]]));class c extends HTMLElement{constructor(){super(),this.state={...t.state??{}},this.props={},this.missingRequiredProps=new Set,this.hasMounted=!1,i!==!1?this.renderRootNode=this.attachShadow({mode:i}):this.renderRootNode=this,this.syncProps()}static get observedAttributes(){return a}connectedCallback(){try{if(!this.hasMounted&&this.missingRequiredProps.size>0)return;if(this.hasMounted){this.scope=ys();const u=be(this.scope);try{t.connected?.call(this)}catch(h){this.handleError(h)}finally{be(u)}this.setupSignalSubscriptions(!0);return}this.mount()}catch(u){this.handleError(u)}}mount(){if(this.hasMounted)return;const u=be(this.ensureScope());let h=!1;try{t.beforeMount?.call(this),t.connected?.call(this)}catch(d){h=!0,this.handleError(d)}finally{be(u)}if(h){this.scope?.dispose(),this.scope=void 0;return}this.render(),this.setupSignalSubscriptions(),this.hasMounted=!0}disconnectedCallback(){try{this.signalEffectCleanup?.(),this.signalEffectCleanup=void 0,this.scope?.dispose(),this.scope=void 0,t.disconnected?.call(this)}catch(u){this.handleError(u)}}attributeChangedCallback(u,h,d){try{const p=this.cloneProps();if(this.syncProps(),t.onAttributeChanged){const f=be(this.ensureScope());try{t.onAttributeChanged.call(this,u,h,d)}finally{be(f)}}this.hasMounted?this.render(!0,p,{name:u,oldValue:h,newValue:d}):this.isConnected&&this.missingRequiredProps.size===0&&this.mount()}catch(p){this.handleError(p)}}adoptedCallback(){if(!t.onAdopted)return;const u=be(this.ensureScope());try{t.onAdopted.call(this)}catch(h){this.handleError(h)}finally{be(u)}}handleError(u){t.onError?t.onError.call(this,u):console.error(`bQuery component error in <${e}>:`,u)}ensureScope(){return this.scope??(this.scope=ys())}setState(u,h){this.state[u]=h,this.render(!0,this.cloneProps(),void 0,!1)}getState(u){return this.state[u]}setupSignalSubscriptions(u=!1){if(this.signalEffectCleanup||s.length===0)return;let h=!0;this.signalEffectCleanup=U(()=>{try{for(const p of s)p.value;if(h){if(h=!1,u&&this.hasMounted&&this.isConnected){const p=this.cloneProps();Ee(()=>{this.render(!0,p,void 0,!1)})}return}if(!this.hasMounted||!this.isConnected)return;const d=this.cloneProps();Ee(()=>{this.render(!0,d,void 0,!1)})}catch(d){this.handleError(d)}})}syncProps(){const u=t.props??{};for(const[h,d]of Object.entries(u)){const p=this.getAttribute(h);let f;if(p==null?d.required&&d.default===void 0?(this.missingRequiredProps.add(h),f=void 0):f=d.default??void 0:(this.missingRequiredProps.has(h)&&this.missingRequiredProps.delete(h),f=ol(p,d)),d.validator&&f!==void 0&&!d.validator(f))throw new Error(`bQuery component: validation failed for prop "${h}" with value ${JSON.stringify(f)}`);this.props[h]=f}}cloneProps(){return{...this.props}}render(u=!1,h,d,p=!0){try{if(u&&p&&t.beforeUpdate){if(!h)throw new Error("bQuery component: previous props are required for update renders");if(t.beforeUpdate.call(this,this.props,h)===!1)return}const f=(g,w)=>{this.dispatchEvent(new CustomEvent(g,{detail:w,bubbles:!0,composed:!0}))},m=this.renderRootNode,v=ie(t.render({props:this.props,state:this.state,signals:t.signals??{},emit:f}),{allowTags:r,allowAttributes:n});let b=null;if(t.styles&&(b=m.querySelector("style[data-bquery-component-style]")),m.innerHTML=v,t.styles){const g=b??document.createElement("style");b||g.setAttribute("data-bquery-component-style",""),g.textContent=t.styles,m.prepend(g)}u&&t.updated?.call(this,d)}catch(f){this.handleError(f)}}}return c};function fl(e,t){return gs(e,t)}function Ie(e,t){const r=gs(e,t);customElements.get(e)||customElements.define(e,r)}var bs=Symbol("bquery.booleanAttribute"),dl=/^[^\0-\x20"'/>=]+$/,ws=e=>{if(typeof e!="object"||e===null)return!1;const t=e;return t[bs]===!0&&typeof t.enabled=="boolean"&&typeof t.name=="string"},Ss=e=>ws(e)?e.enabled?e.name:"":String(e??""),hl={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},ml=e=>ws(e)?e.enabled?e.name:"":Ss(e).replace(/[&<>"'`]/g,t=>hl[t]),pl=(e,t)=>{if(!dl.test(e))throw new TypeError(`Invalid boolean attribute name: ${e}`);return Object.freeze({[bs]:!0,enabled:!!t,name:e})},Me=(e,...t)=>e.reduce((r,n,s)=>`${r}${n}${Ss(t[s])}`,""),vl=(e,...t)=>{const r=n=>Qi(n)?Vi(n):ml(n);return vn(e.reduce((n,s,o)=>`${n}${s}${o<t.length?r(t[o]):""}`,""))},qt=`
86
86
  :host {
87
87
  color: inherit;
88
88
  font: inherit;
89
89
  }
90
- `,wn=`
91
- ${pt}
90
+ `,Es=`
91
+ ${qt}
92
92
  .field {
93
93
  display: inline-flex;
94
94
  flex-direction: column;
@@ -122,8 +122,8 @@ self.onmessage = async (event) => {
122
122
  color: #94a3b8;
123
123
  cursor: not-allowed;
124
124
  }
125
- `,B=e=>br(e),zt=new WeakMap,xt=(e,t)=>zt.get(e)?.[t],jt=(e,t,r)=>{const n=zt.get(e)??{};n[t]=r,zt.set(e,n)},Pa=(e,t,r)=>{if(r.label!==t.label||r.type!==t.type||r.placeholder!==t.placeholder||r.name!==t.name||r.disabled!==t.disabled)return!1;const n=e.shadowRoot;if(!n||(n.querySelector(".label")?.textContent??"")!==t.label)return!1;const s=n.querySelector("input.control");return!s||s.type!==t.type||s.placeholder!==t.placeholder||s.name!==t.name||s.disabled!==t.disabled?!1:(s.value!==t.value&&(s.value=t.value),!0)},Ma=(e,t,r)=>{if(r.label!==t.label||r.placeholder!==t.placeholder||r.name!==t.name||r.rows!==t.rows||r.disabled!==t.disabled)return!1;const n=e.shadowRoot;if(!n||(n.querySelector(".label")?.textContent??"")!==t.label)return!1;const s=n.querySelector("textarea.control");return!s||s.placeholder!==t.placeholder||s.name!==t.name||Number(s.rows)!==t.rows||s.disabled!==t.disabled?!1:(s.value!==t.value&&(s.value=t.value),!0)},Na=e=>["<textarea",' part="control"',' class="control"',` placeholder="${B(e.placeholder)}"`,` name="${B(e.name)}"`,` rows="${e.rows}"`,e.disabled?" disabled":"",`>${B(e.value)}</textarea>`].join(""),Da=(e={})=>{const t=e.prefix??Z().components?.prefix??"bq",r={button:`${t}-button`,card:`${t}-card`,input:`${t}-input`,textarea:`${t}-textarea`,checkbox:`${t}-checkbox`};return Ee(r.button,{props:{label:{type:String,default:""},variant:{type:String,default:"primary"},size:{type:String,default:"md"},type:{type:String,default:"button"},disabled:{type:Boolean,default:!1}},styles:`
126
- ${pt}
125
+ `,F=e=>En(e),Er=new WeakMap,Ar=(e,t)=>Er.get(e)?.[t],kr=(e,t,r)=>{const n=Er.get(e)??{};n[t]=r,Er.set(e,n)},yl=(e,t,r)=>{if(r.label!==t.label||r.type!==t.type||r.placeholder!==t.placeholder||r.name!==t.name||r.disabled!==t.disabled)return!1;const n=e.shadowRoot;if(!n||(n.querySelector(".label")?.textContent??"")!==t.label)return!1;const s=n.querySelector("input.control");return!s||s.type!==t.type||s.placeholder!==t.placeholder||s.name!==t.name||s.disabled!==t.disabled?!1:(s.value!==t.value&&(s.value=t.value),!0)},gl=(e,t,r)=>{if(r.label!==t.label||r.placeholder!==t.placeholder||r.name!==t.name||r.rows!==t.rows||r.disabled!==t.disabled)return!1;const n=e.shadowRoot;if(!n||(n.querySelector(".label")?.textContent??"")!==t.label)return!1;const s=n.querySelector("textarea.control");return!s||s.placeholder!==t.placeholder||s.name!==t.name||Number(s.rows)!==t.rows||s.disabled!==t.disabled?!1:(s.value!==t.value&&(s.value=t.value),!0)},bl=e=>["<textarea",' part="control"',' class="control"',` placeholder="${F(e.placeholder)}"`,` name="${F(e.name)}"`,` rows="${e.rows}"`,e.disabled?" disabled":"",`>${F(e.value)}</textarea>`].join(""),wl=(e={})=>{const t=e.prefix??ae().components?.prefix??"bq",r={button:`${t}-button`,card:`${t}-card`,input:`${t}-input`,textarea:`${t}-textarea`,checkbox:`${t}-checkbox`};return Ie(r.button,{props:{label:{type:String,default:""},variant:{type:String,default:"primary"},size:{type:String,default:"md"},type:{type:String,default:"button"},disabled:{type:Boolean,default:!1}},styles:`
126
+ ${qt}
127
127
  button {
128
128
  appearance: none;
129
129
  border: 0;
@@ -160,18 +160,18 @@ self.onmessage = async (event) => {
160
160
  cursor: not-allowed;
161
161
  opacity: 0.6;
162
162
  }
163
- `,render:({props:n})=>Se`
163
+ `,render:({props:n})=>Me`
164
164
  <button
165
165
  part="button"
166
- type="${B(n.type)}"
167
- data-variant="${B(n.variant)}"
168
- data-size="${B(n.size)}"
166
+ type="${F(n.type)}"
167
+ data-variant="${F(n.variant)}"
168
+ data-size="${F(n.size)}"
169
169
  ${n.disabled?"disabled":""}
170
170
  >
171
- <slot>${B(n.label)}</slot>
171
+ <slot>${F(n.label)}</slot>
172
172
  </button>
173
- `}),Ee(r.card,{props:{title:{type:String,default:""},footer:{type:String,default:""},elevated:{type:Boolean,default:!0}},styles:`
174
- ${pt}
173
+ `}),Ie(r.card,{props:{title:{type:String,default:""},footer:{type:String,default:""},elevated:{type:Boolean,default:!0}},styles:`
174
+ ${qt}
175
175
  article {
176
176
  background: #fff;
177
177
  border: 1px solid #e2e8f0;
@@ -195,37 +195,37 @@ self.onmessage = async (event) => {
195
195
  footer {
196
196
  margin-top: 0.75rem;
197
197
  }
198
- `,render:({props:n})=>Se`
198
+ `,render:({props:n})=>Me`
199
199
  <article part="card" data-elevated="${String(n.elevated)}">
200
- ${n.title?`<header part="header">${B(n.title)}</header>`:""}
200
+ ${n.title?`<header part="header">${F(n.title)}</header>`:""}
201
201
  <section part="body"><slot></slot></section>
202
- ${n.footer?`<footer part="footer">${B(n.footer)}</footer>`:""}
202
+ ${n.footer?`<footer part="footer">${F(n.footer)}</footer>`:""}
203
203
  </article>
204
- `}),Ee(r.input,{props:{label:{type:String,default:""},type:{type:String,default:"text"},value:{type:String,default:""},placeholder:{type:String,default:""},name:{type:String,default:""},disabled:{type:Boolean,default:!1}},styles:wn,beforeUpdate(n,s){return!Pa(this,n,s)},connected(){const n=s=>{const o=s.target;o?.matches("input")&&(s.stopPropagation(),this.setAttribute("value",o.value),this.dispatchEvent(new CustomEvent("input",{detail:{value:o.value},bubbles:!0,composed:!0})))};jt(this,"__bqueryInputHandler",n),this.shadowRoot?.addEventListener("input",n)},disconnected(){const n=xt(this,"__bqueryInputHandler");n&&this.shadowRoot?.removeEventListener("input",n)},render:({props:n})=>Se`
204
+ `}),Ie(r.input,{props:{label:{type:String,default:""},type:{type:String,default:"text"},value:{type:String,default:""},placeholder:{type:String,default:""},name:{type:String,default:""},disabled:{type:Boolean,default:!1}},styles:Es,beforeUpdate(n,s){return!yl(this,n,s)},connected(){const n=s=>{const o=s.target;o?.matches("input")&&(s.stopPropagation(),this.setAttribute("value",o.value),this.dispatchEvent(new CustomEvent("input",{detail:{value:o.value},bubbles:!0,composed:!0})))};kr(this,"__bqueryInputHandler",n),this.shadowRoot?.addEventListener("input",n)},disconnected(){const n=Ar(this,"__bqueryInputHandler");n&&this.shadowRoot?.removeEventListener("input",n)},render:({props:n})=>Me`
205
205
  <label part="field" class="field">
206
- ${n.label?`<span part="label" class="label">${B(n.label)}</span>`:""}
206
+ ${n.label?`<span part="label" class="label">${F(n.label)}</span>`:""}
207
207
  <input
208
208
  part="control"
209
209
  class="control"
210
- type="${B(n.type)}"
211
- value="${B(n.value)}"
212
- placeholder="${B(n.placeholder)}"
213
- name="${B(n.name)}"
210
+ type="${F(n.type)}"
211
+ value="${F(n.value)}"
212
+ placeholder="${F(n.placeholder)}"
213
+ name="${F(n.name)}"
214
214
  ${n.disabled?"disabled":""}
215
215
  />
216
216
  </label>
217
- `}),Ee(r.textarea,{props:{label:{type:String,default:""},value:{type:String,default:""},placeholder:{type:String,default:""},name:{type:String,default:""},rows:{type:Number,default:4},disabled:{type:Boolean,default:!1}},styles:`${wn}
217
+ `}),Ie(r.textarea,{props:{label:{type:String,default:""},value:{type:String,default:""},placeholder:{type:String,default:""},name:{type:String,default:""},rows:{type:Number,default:4},disabled:{type:Boolean,default:!1}},styles:`${Es}
218
218
  textarea.control {
219
219
  min-height: 6rem;
220
220
  resize: vertical;
221
221
  }
222
- `,beforeUpdate(n,s){return!Ma(this,n,s)},connected(){const n=s=>{const o=s.target;o?.matches("textarea")&&(s.stopPropagation(),this.setAttribute("value",o.value),this.dispatchEvent(new CustomEvent("input",{detail:{value:o.value},bubbles:!0,composed:!0})))};jt(this,"__bqueryTextareaHandler",n),this.shadowRoot?.addEventListener("input",n)},disconnected(){const n=xt(this,"__bqueryTextareaHandler");n&&this.shadowRoot?.removeEventListener("input",n)},render:({props:n})=>Se`
222
+ `,beforeUpdate(n,s){return!gl(this,n,s)},connected(){const n=s=>{const o=s.target;o?.matches("textarea")&&(s.stopPropagation(),this.setAttribute("value",o.value),this.dispatchEvent(new CustomEvent("input",{detail:{value:o.value},bubbles:!0,composed:!0})))};kr(this,"__bqueryTextareaHandler",n),this.shadowRoot?.addEventListener("input",n)},disconnected(){const n=Ar(this,"__bqueryTextareaHandler");n&&this.shadowRoot?.removeEventListener("input",n)},render:({props:n})=>Me`
223
223
  <label part="field" class="field">
224
- ${n.label?`<span part="label" class="label">${B(n.label)}</span>`:""}
225
- ${Na(n)}
224
+ ${n.label?`<span part="label" class="label">${F(n.label)}</span>`:""}
225
+ ${bl(n)}
226
226
  </label>
227
- `}),Ee(r.checkbox,{props:{label:{type:String,default:""},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},styles:`
228
- ${pt}
227
+ `}),Ie(r.checkbox,{props:{label:{type:String,default:""},checked:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},styles:`
228
+ ${qt}
229
229
  label {
230
230
  align-items: center;
231
231
  color: #0f172a;
@@ -241,7 +241,7 @@ self.onmessage = async (event) => {
241
241
  input:disabled {
242
242
  cursor: not-allowed;
243
243
  }
244
- `,connected(){const n=s=>{const o=s.target;o?.matches('input[type="checkbox"]')&&(s.stopPropagation(),o.checked?this.setAttribute("checked","true"):this.removeAttribute("checked"),this.dispatchEvent(new CustomEvent("change",{detail:{checked:o.checked},bubbles:!0,composed:!0})))};jt(this,"__bqueryCheckboxHandler",n),this.shadowRoot?.addEventListener("change",n)},disconnected(){const n=xt(this,"__bqueryCheckboxHandler");n&&this.shadowRoot?.removeEventListener("change",n)},render:({props:n})=>Se`
244
+ `,connected(){const n=s=>{const o=s.target;o?.matches('input[type="checkbox"]')&&(s.stopPropagation(),o.checked?this.setAttribute("checked","true"):this.removeAttribute("checked"),this.dispatchEvent(new CustomEvent("change",{detail:{checked:o.checked},bubbles:!0,composed:!0})))};kr(this,"__bqueryCheckboxHandler",n),this.shadowRoot?.addEventListener("change",n)},disconnected(){const n=Ar(this,"__bqueryCheckboxHandler");n&&this.shadowRoot?.removeEventListener("change",n)},render:({props:n})=>Me`
245
245
  <label part="label">
246
246
  <input
247
247
  part="control"
@@ -249,14 +249,14 @@ self.onmessage = async (event) => {
249
249
  ${n.checked?"checked":""}
250
250
  ${n.disabled?"disabled":""}
251
251
  />
252
- <span part="text"><slot>${B(n.label)}</slot></span>
252
+ <span part="text"><slot>${F(n.label)}</slot></span>
253
253
  </label>
254
- `}),r},Ft=null,ee=()=>Ft!==null?Ft:typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ia=e=>{Ft=e},En=e=>typeof e=="string"||typeof e=="number",Sn=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ae=(e,t)=>{const r=e.style;if(Array.isArray(t)){const n=t[t.length-1];if(!n)return;for(const[s,o]of Object.entries(n))if(!(s==="offset"||s==="easing"||s==="composite")&&En(o)){const i=s.startsWith("--")?s:Sn(s);r.setProperty(i,String(o))}return}for(const[n,s]of Object.entries(t)){if(n==="offset"||n==="easing"||n==="composite")continue;const o=Array.isArray(s)?s[s.length-1]:s;if(En(o)){const i=n.startsWith("--")?n:Sn(n);r.setProperty(i,String(o))}}},vt=(e,t)=>{const{keyframes:r,options:n,commitStyles:s=!0,respectReducedMotion:o=!0,onFinish:i}=t;if(o&&ee())return s&&Ae(e,r),i?.(),Promise.resolve();const a=e;return typeof a.animate!="function"?(s&&Ae(e,r),i?.(),Promise.resolve()):new Promise(l=>{const c=a.animate(r,n);let f=!1;const m=()=>{f||(f=!0,s&&(typeof c.commitStyles=="function"?c.commitStyles():Ae(e,r)),c.cancel(),i?.(),l())};c.onfinish=m,c.finished&&c.finished.then(m).catch(m)})},te=e=>Math.min(1,Math.max(0,e)),An=e=>te(e),kn=e=>te(e*e),Tn=e=>te(1-(1-e)*(1-e)),Cn=e=>te(e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2),Rn=e=>te(e*e*e),On=e=>te(1-Math.pow(1-e,3)),Ln=e=>te(e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2),$n=e=>te(1+(1.70158+1)*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)),Pn=e=>te(e===1?1:1-Math.pow(2,-10*e)),_a={linear:An,easeInQuad:kn,easeOutQuad:Tn,easeInOutQuad:Cn,easeInCubic:Rn,easeOutCubic:On,easeInOutCubic:Ln,easeOutBack:$n,easeOutExpo:Pn},Ut=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},Bt=(e,t,r={})=>{const{duration:n=300,easing:s="ease-out",onComplete:o}=r,i=Ut(e);if(i.width===0||i.height===0)return o?.(),Promise.resolve();const a=t.left-i.left,l=t.top-i.top,c=t.width/i.width,f=t.height/i.height;if(a===0&&l===0&&c===1&&f===1)return o?.(),Promise.resolve();const m=e;return typeof m.animate!="function"?(o?.(),Promise.resolve()):(m.style.transform=`translate(${a}px, ${l}px) scale(${c}, ${f})`,m.style.transformOrigin="top left",m.offsetHeight,new Promise(d=>{const p=m.animate([{transform:`translate(${a}px, ${l}px) scale(${c}, ${f})`},{transform:"translate(0, 0) scale(1, 1)"}],{duration:n,easing:s,fill:"forwards"});let u=!1;const h=()=>{u||(u=!0,m.style.transform="",m.style.transformOrigin="",o?.(),d())};p.onfinish=h,p.finished&&p.finished.then(h).catch(h)}))},qa=async(e,t,r={})=>{await Mn(e,t,r)},Mn=async(e,t,r={})=>{const{stagger:n,...s}=r,o=new Map;for(const l of e)o.set(l,Ut(l));t();const i=e.length,a=e.map((l,c)=>{const f=o.get(l);if(!f)return Promise.resolve();const m=n?n(c,i):0;return m>0?new Promise(d=>setTimeout(d,m)).then(()=>Bt(l,f,s)):Bt(l,f,s)});await Promise.all(a)},za={fadeIn:(e=0,t=1)=>[{opacity:e},{opacity:t}],fadeOut:(e=1,t=0)=>[{opacity:e},{opacity:t}],slideInUp:(e=16)=>[{opacity:0,transform:`translateY(${e}px)`},{opacity:1,transform:"translateY(0)"}],slideInDown:(e=16)=>[{opacity:0,transform:`translateY(-${e}px)`},{opacity:1,transform:"translateY(0)"}],slideInLeft:(e=16)=>[{opacity:0,transform:`translateX(${e}px)`},{opacity:1,transform:"translateX(0)"}],slideInRight:(e=16)=>[{opacity:0,transform:`translateX(-${e}px)`},{opacity:1,transform:"translateX(0)"}],scaleIn:(e=.95,t=1)=>[{opacity:0,transform:`scale(${e})`},{opacity:1,transform:`scale(${t})`}],scaleOut:(e=1,t=.95)=>[{opacity:1,transform:`scale(${e})`},{opacity:0,transform:`scale(${t})`}],pop:(e=.9,t=1.02,r=1)=>[{opacity:0,transform:`scale(${e})`},{opacity:1,transform:`scale(${t})`,offset:.6},{opacity:1,transform:`scale(${r})`}],rotateIn:(e=6)=>[{opacity:0,transform:`rotate(${e}deg) scale(0.98)`},{opacity:1,transform:"rotate(0deg) scale(1)"}]},xa=(e,t,r={})=>{const{duration:n=300,easing:s="ease",respectReducedMotion:o=!0,onComplete:i}=r,a=e,l=t;if(typeof window>"u"||typeof document>"u"||typeof a.getBoundingClientRect!="function"||typeof l.getBoundingClientRect!="function"||typeof a.style>"u"||typeof l.style>"u")return i?.(),Promise.resolve();const c=e.getBoundingClientRect(),f=l.style.display,m=l.style.visibility,d=l.style.transform,p=l.style.opacity,u=typeof getComputedStyle=="function"?getComputedStyle(l).display:f||"block",h=u==="none"?"block":f||u||"block",v=()=>{l.style.transform=d,l.style.opacity=p};l.style.visibility="hidden",l.style.display=h;const b=t.getBoundingClientRect();if(l.style.visibility=m,a.style.display="none",u==="none"?l.style.display=h:f==="none"?l.style.display="":l.style.display=f,o&&ee())return v(),i?.(),Promise.resolve();const y=c.left-b.left,w=c.top-b.top,E=c.width/(b.width||1),k=c.height/(b.height||1);if(y===0&&w===0&&E===1&&k===1)return v(),i?.(),Promise.resolve();const A=[{transform:`translate(${y}px, ${w}px) scale(${E}, ${k})`,opacity:"0.5"},{transform:"translate(0, 0) scale(1, 1)",opacity:"1"}];return typeof l.animate!="function"?(v(),i?.(),Promise.resolve()):new Promise(S=>{const T=l.animate(A,{duration:n,easing:s,fill:"forwards"});let P=!1;const R=()=>{P||(P=!0,v(),T.cancel(),i?.(),S())};T.onfinish=R,T.finished&&T.finished.then(R).catch(R)})},ja=(e,t={})=>{if(typeof window>"u"||typeof window.addEventListener!="function"||typeof window.removeEventListener!="function"||typeof requestAnimationFrame!="function"||typeof cancelAnimationFrame!="function")return()=>{};const{speed:r=.5,direction:n="vertical",respectReducedMotion:s=!0}=t,o=e,i=o.style.transform;if(s&&ee())return()=>{};let a=!1,l=!1,c=null;const f=()=>{l||(l=!0,window.removeEventListener("scroll",d),c!==null&&(cancelAnimationFrame(c),c=null),a=!1,o.style.transform=i)},m=()=>{if(l)return;if(s&&ee()){f();return}const p=window.scrollY,u=window.scrollX;let h=0,v=0;(n==="vertical"||n==="both")&&(v=p*r),(n==="horizontal"||n==="both")&&(h=u*r);const b=`translate3d(${h}px, ${v}px, 0)`;o.style.transform=i?`${i} ${b}`:b},d=()=>{if(!l){if(s&&ee()){f();return}a||(a=!0,c=requestAnimationFrame(()=>{c=null,m(),a=!1}))}};return m(),window.addEventListener("scroll",d,{passive:!0}),f},Fa=e=>typeof Element<"u"&&e instanceof Element?[e]:Array.from(e),Ua=(e,t)=>{const r=Fa(e);if(!r.length)return()=>{};const{root:n=null,rootMargin:s,threshold:o,once:i=!0,onEnter:a,...l}=t;if(typeof IntersectionObserver>"u")return r.forEach(f=>{a?.(f),vt(f,l)}),()=>{};const c=new IntersectionObserver(f=>{f.forEach(m=>{if(!m.isIntersecting)return;const d=m.target;a?.(d),vt(d,l),i&&c.unobserve(d)})},{root:n,rootMargin:s,threshold:o});return r.forEach(f=>c.observe(f)),()=>c.disconnect()},Ba={stiffness:100,damping:10,mass:1,precision:.01},Wa=(e,t={})=>{const{stiffness:r,damping:n,mass:s,precision:o}={...Ba,...t};let i=e,a=0,l=e,c=null,f=null,m=null;const d=new Set,p=()=>{for(const h of d)h(i)},u=h=>{const v=m!==null?(h-m)/1e3:.016666666666666666,b=Math.min(v,1/30);m=h;const y=i-l,w=(-r*y+-n*a)/s;if(a+=w*b,i+=a*b,p(),Math.abs(a)<o&&Math.abs(y)<o){i=l,a=0,c=null,p(),f?.(),f=null;return}c=requestAnimationFrame(u)};return{to(h){return l=h,c!==null&&cancelAnimationFrame(c),f?.(),m=null,new Promise(v=>{f=v,c=requestAnimationFrame(u)})},current(){return i},stop(){c!==null&&(cancelAnimationFrame(c),c=null),a=0,m=null,f?.(),f=null},onChange(h){return d.add(h),()=>d.delete(h)}}},Ha={gentle:{stiffness:80,damping:15},snappy:{stiffness:200,damping:20},bouncy:{stiffness:300,damping:8},stiff:{stiffness:400,damping:30}},Qa=(e,t={})=>{const{start:r=0,from:n="start",easing:s}=t;return(o,i=0)=>{const a=typeof n=="number"?n:n==="center"?(i-1)/2:n==="end"?i-1:0,l=Math.abs(o-a),c=i>1?Math.max(a,i-1-a):1,f=c===0?0:l/c;return r+(s?s(f)*c:l)*e}},Wt=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=e.trim();if(t.endsWith("ms")){const n=Number.parseFloat(t.slice(0,-2));return Number.isFinite(n)?n:0}if(t.endsWith("s")){const n=Number.parseFloat(t.slice(0,-1));return Number.isFinite(n)?n*1e3:0}const r=Number.parseFloat(t);return Number.isFinite(r)?r:0}return 0},Va=(e,t)=>{if(typeof e=="number")return e;if(typeof e=="string"){const r=/^([+-])=(\d+(?:\.\d+)?)$/.exec(e);if(r){const n=Number.parseFloat(r[2]);return Number.isFinite(n)?r[1]==="+"?t+n:t-n:t}}return t},Ka=e=>{const t=Wt(e?.duration),r=Wt(e?.endDelay),n=e?.iterations??1;return n===1/0?Number.MAX_SAFE_INTEGER:t*Math.max(0,n)+r},Nn=e=>{let t=0;return e.map(r=>{const n=Va(r.at,t),s=Wt(r.options?.delay),o=Math.max(0,n+s),i=Ka(r.options),a=o+i;return t=Math.max(t,a),{step:r,start:o,end:a,duration:i}})},Ya=async(e,t={})=>{const{stagger:r,onFinish:n}=t,s=e.length;for(let o=0;o<e.length;o+=1){const i=e[o],a=r?r(o,s):0;a>0&&await new Promise(l=>setTimeout(l,a)),await vt(i.target,i)}n?.()},Ga=(e=[],t={})=>{const r=[...e],n=new Set;let s=[],o=0,i=!1,a=!1;const{commitStyles:l=!0,respectReducedMotion:c=!0,onFinish:f}=t,m=()=>{if(!a){if(a=!0,l)for(const p of s){const{animation:u,step:h}=p;typeof u.commitStyles=="function"?u.commitStyles():Ae(h.target,h.keyframes),u.cancel()}n.forEach(p=>p()),f?.()}},d=()=>{s.forEach(({animation:u})=>u.cancel()),s=[],a=!1;const p=Nn(r);if(o=p.length?Math.max(...p.map(u=>u.end)):0,c&&ee()){l&&p.forEach(({step:u})=>Ae(u.target,u.keyframes)),i=!0;return}if(p.some(({step:u})=>typeof u.target.animate!="function")){l&&p.forEach(({step:u})=>Ae(u.target,u.keyframes)),i=!0;return}i=!1,s=p.map(({step:u,start:h})=>{const{delay:v,...b}=u.options??{};return{animation:u.target.animate(u.keyframes,{...b,delay:h,fill:b.fill??"both"}),step:u,start:h}})};return{add(p){r.push(p)},duration(){if(!r.length)return 0;if(!s.length){const p=Nn(r);return Math.max(...p.map(u=>u.end))}return o},async play(){if(d(),i||s.length===0){m();return}const p=s.map(u=>u.animation.finished.catch(()=>{}));await Promise.all(p),m()},pause(){i||s.forEach(({animation:p})=>p.pause())},resume(){i||s.forEach(({animation:p})=>p.play())},stop(){s.forEach(({animation:p})=>p.cancel()),s=[],i=!1},seek(p){i||s.forEach(({animation:u})=>{u.currentTime=p})},onFinish(p){return n.add(p),()=>n.delete(p)}}},Dn=e=>(e??[]).map(t=>t.trim()).filter(t=>t.length>0),Ja=async e=>{const t=Z().transitions,r=typeof e=="function"?{update:e,classes:t?.classes,types:t?.types,skipOnReducedMotion:t?.skipOnReducedMotion}:{...e,classes:e.classes??t?.classes,types:e.types??t?.types,skipOnReducedMotion:e.skipOnReducedMotion??t?.skipOnReducedMotion},n=r.update;if(typeof document>"u"){await n();return}const s=document,o=document.documentElement,i=Dn(r.classes),a=Dn(r.types);if(!s.startViewTransition||r.skipOnReducedMotion&&ee()){await n(),r.onFinish?.();return}i.forEach(l=>o.classList.add(l));try{const l=s.startViewTransition(()=>n()),c=l.types;if(c)for(const f of a)c.add(f);await l.ready,r.onReady?.(),await l.finished,r.onFinish?.()}finally{i.forEach(l=>o.classList.remove(l))}},Xa=(e,t,r={})=>{const{speed:n=50,delay:s=0,cursor:o=!1,cursorChar:i="|",loop:a=!1,loopDelay:l=1e3,respectReducedMotion:c=!0,onComplete:f}=r;if(typeof document>"u")return{stop:()=>{},done:Promise.resolve()};const m=e;let d=!1,p=null,u=null,h=null,v=null;const b=()=>{if(!o)return;u=document.createElement("span"),u.setAttribute("aria-hidden","true"),u.textContent=i,m.appendChild(u);let E=!0;h=setInterval(()=>{u&&(E=!E,u.style.opacity=E?"1":"0")},530)},y=()=>{h!==null&&(clearInterval(h),h=null),u&&u.parentNode&&(u.parentNode.removeChild(u),u=null)},w=()=>{d||(d=!0,p!==null&&(clearTimeout(p),p=null),y(),v?.(),v=null)};return c&&ee()?(m.textContent=t,f?.(),{stop:()=>{},done:Promise.resolve()}):{stop:w,done:new Promise(E=>{v=E;const k=()=>{let A=0;m.textContent="",b();const S=document.createTextNode("");u?m.insertBefore(S,u):m.appendChild(S);const T=()=>{d||(A<t.length?(S.data=t.slice(0,A+1),A++,p=setTimeout(T,n)):(f?.(),a&&!d?p=setTimeout(()=>{d||(y(),k())},l):(y(),E(),v=null)))};p=setTimeout(T,s)};k()})}},Za=class{constructor(e){this.bucketName=e,this.dbPromise=null,this.storeName="blobs"}openDB(){if(this.dbPromise)return this.dbPromise;const e=`bquery-bucket-${this.bucketName}`;return this.dbPromise=new Promise((t,r)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName)},n.onsuccess=()=>t(n.result),n.onerror=()=>r(n.error)}),this.dbPromise}async withStore(e,t){const r=await this.openDB();return new Promise((n,s)=>{const o=t(r.transaction(this.storeName,e).objectStore(this.storeName));o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)})}async put(e,t){await this.withStore("readwrite",r=>r.put(t,e))}async get(e){return await this.withStore("readonly",t=>t.get(e))??null}async remove(e){await this.withStore("readwrite",t=>t.delete(e))}async keys(){return(await this.withStore("readonly",e=>e.getAllKeys())).map(e=>String(e))}},el={async open(e){return new Za(e)}},tl=class{constructor(e){this.cache=e}async add(e){await this.cache.add(e)}async addAll(e){await this.cache.addAll(e)}async put(e,t){await this.cache.put(e,t)}async match(e){return this.cache.match(e)}async remove(e){return this.cache.delete(e)}async keys(){return(await this.cache.keys()).map(e=>e.url)}},rl={isSupported(){return"caches"in window},async open(e){if(!this.isSupported())throw new Error("bQuery: Cache Storage API not supported");return new tl(await caches.open(e))},async delete(e){return this.isSupported()?caches.delete(e):!1},async keys(){return this.isSupported()?caches.keys():[]}},nl=e=>{if(typeof document>"u")return null;const t=`${encodeURIComponent(e)}=`,r=document.cookie?document.cookie.split(";"):[];for(const n of r){const s=n.trim();if(s.startsWith(t)){const o=s.slice(t.length);try{return decodeURIComponent(o)}catch{return o}}}return null},sl=e=>{const t=e.trim();return t.startsWith("{")||t.startsWith("[")||t.startsWith('"')},ol=(e,t)=>{if(typeof document>"u")return;const r=[`${encodeURIComponent(e)}=`,"Expires=Thu, 01 Jan 1970 00:00:00 GMT"];t.path&&r.push(`Path=${t.path}`),t.domain&&r.push(`Domain=${t.domain}`),t.sameSite&&r.push(`SameSite=${t.sameSite}`),t.secure&&r.push("Secure"),document.cookie=r.join("; ")},il=(e,t,r)=>{if(typeof document>"u")return;const n=r.serialize?r.serialize(t):typeof t=="string"?t:JSON.stringify(t),s=[`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];r.path&&s.push(`Path=${r.path}`),r.domain&&s.push(`Domain=${r.domain}`),typeof r.maxAge=="number"&&s.push(`Max-Age=${r.maxAge}`),r.expires&&s.push(`Expires=${r.expires.toUTCString()}`),r.sameSite&&s.push(`SameSite=${r.sameSite}`),r.secure&&s.push("Secure"),document.cookie=s.join("; ")},al=(e,t={})=>{const r=Z().cookies,n={path:r?.path??"/",sameSite:r?.sameSite??"Lax",secure:r?.secure??!1,watch:!0,...t};n.sameSite==="None"&&(n.secure=!0);const s=nl(e);let o=n.defaultValue??null;if(s!==null)try{o=n.deserialize?n.deserialize(s):sl(s)?JSON.parse(s):s??o}catch(l){console.warn(`bQuery: Failed to deserialize cookie "${e}", using raw string value`,l),o=s??o}const i=$(o);if(typeof document>"u"||n.watch===!1)return i;let a=!1;return j(()=>{const l=i.value;if(!a){a=!0;return}if(l==null){ol(e,n);return}il(e,l,n)}),i},ll={isSupported(){return"Notification"in window},getPermission(){return this.isSupported()?Notification.permission:"denied"},async requestPermission(){return this.isSupported()?Notification.permission==="granted"?"granted":Notification.permission==="denied"?"denied":Notification.requestPermission():"denied"},send(e,t){return this.isSupported()?Notification.permission!=="granted"?(console.warn("bQuery: Notification permission not granted"),null):new Notification(e,t):(console.warn("bQuery: Notifications not supported in this browser"),null)}},cl=["position:absolute","width:1px","height:1px","padding:0","margin:-1px","overflow:hidden","clip:rect(0, 0, 0, 0)","white-space:nowrap","border:0"].join(";"),ul=(e={})=>{const t=Z().announcer,r={politeness:t?.politeness??"polite",atomic:t?.atomic??!0,delay:t?.delay??16,clearDelay:t?.clearDelay??1e3,...e},n=$("");if(typeof document>"u")return{element:null,message:n,announce(h){n.value=h},clear(){n.value=""},destroy(){n.value=""}};const s=r.id?document.getElementById(r.id):null,o=s??document.createElement("div"),i=!s;if(r.id&&(o.id=r.id),r.className&&(o.className=r.className),o.setAttribute("aria-live",r.politeness),o.setAttribute("aria-atomic",String(r.atomic)),o.setAttribute("role",r.politeness==="assertive"?"alert":"status"),o.setAttribute("data-bquery-announcer","true"),o.getAttribute("style")||o.setAttribute("style",cl),i){const h=r.container??document.body??document.documentElement;if(!h)return{element:null,message:n,announce(v){n.value=v},clear(){n.value=""},destroy(){n.value=""}};h.appendChild(o)}const a=j(()=>{o.textContent=n.value});let l,c,f=!1;const m=()=>{l&&(clearTimeout(l),l=void 0),c&&(clearTimeout(c),c=void 0)};return{element:o,message:n,announce:(h,v={})=>{if(f)return;const b=v.politeness??r.politeness,y=v.delay??r.delay,w=v.clearDelay??r.clearDelay;m(),o.setAttribute("aria-live",b),o.setAttribute("role",b==="assertive"?"alert":"status"),n.value="",l=setTimeout(()=>{f||(n.value=h,w>0&&(c=setTimeout(()=>{f||(n.value="")},w)))},y)},clear:()=>{f||(m(),n.value="")},destroy:()=>{f||(f=!0,m(),n.value="",a(),i&&o.remove())}}},In=(e,t)=>{const r=new Map;for(const[n,s]of Object.entries(t))r.set(n,e.getAttribute(n)),e.setAttribute(n,s);return()=>{for(const[n,s]of r.entries())s==null?e.removeAttribute(n):e.setAttribute(n,s)}},_n=(e,t)=>{const r=document.createElement(e);r.setAttribute("data-bquery-page-meta","true");for(const[n,s]of Object.entries(t))s!==void 0&&r.setAttribute(n,s);return r},fl=e=>{if(typeof document>"u")return()=>{};const t=Z().pageMeta,r=e.title?t?.titleTemplate?t.titleTemplate(e.title):e.title:void 0,n=[],s=[],o=document.title;r!==void 0&&(document.title=r);const i=[...e.meta??[]];e.description&&i.unshift({name:"description",content:e.description});for(const a of i){const l=_n("meta",{name:a.name,property:a.property,"http-equiv":a.httpEquiv,content:a.content});document.head.appendChild(l),n.push(l)}for(const a of e.link??[]){const l=_n("link",{rel:a.rel,href:a.href,type:a.type,media:a.media,crossorigin:a.crossOrigin});document.head.appendChild(l),n.push(l)}return e.htmlAttributes&&s.push(In(document.documentElement,e.htmlAttributes)),e.bodyAttributes&&document.body&&s.push(In(document.body,e.bodyAttributes)),()=>{document.title=o;for(const a of s.reverse())a();for(const a of n)a.remove()}},qn=class{constructor(e){this.storage=e}async get(e){const t=this.storage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch{return t}}async set(e,t){const r=typeof t=="string"?t:JSON.stringify(t);this.storage.setItem(e,r)}async remove(e){this.storage.removeItem(e)}async clear(){this.storage.clear()}async keys(){const e=[];for(let t=0;t<this.storage.length;t++){const r=this.storage.key(t);r!==null&&e.push(r)}return e}},dl=class extends qn{constructor(){super(localStorage)}},hl=class extends qn{constructor(){super(sessionStorage)}},ml=class{constructor(e){this.options=e,this.dbPromise=null}openDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((e,t)=>{const r=indexedDB.open(this.options.name,this.options.version??1);r.onupgradeneeded=()=>{const n=r.result;n.objectStoreNames.contains(this.options.store)||n.createObjectStore(this.options.store)},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)}),this.dbPromise)}async withStore(e,t){const r=await this.openDB();return new Promise((n,s)=>{const o=t(r.transaction(this.options.store,e).objectStore(this.options.store));o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)})}async get(e){return await this.withStore("readonly",t=>t.get(e))??null}async set(e,t){await this.withStore("readwrite",r=>r.put(t,e))}async remove(e){await this.withStore("readwrite",t=>t.delete(e))}async clear(){await this.withStore("readwrite",e=>e.clear())}async keys(){return(await this.withStore("readonly",e=>e.getAllKeys())).map(e=>String(e))}},pl={local(){return new dl},session(){return new hl},indexedDB(e){return new ml(e)}},zn=null,re=$({path:"",params:{},query:{},matched:null,hash:""}),xn=D(()=>re.value),Ue=$(0),yt=$(!1),vl=I(yt),jn=()=>{Ue.value===0&&(yt.value=!0),Ue.value+=1},Fn=()=>{const e=Math.max(0,Ue.value-1);Ue.value=e,e===0&&(yt.value=!1)},yl=()=>{Ue.value=0,yt.value=!1},he=()=>zn,Un=e=>{zn=e},Be=async(e,t={})=>{const r=he();if(!r)throw new Error("bQuery router: No router initialized. Call createRouter() first.");await r[t.replace?"replace":"push"](e)},gl=()=>{const e=he();e?e.back():history.back()},bl=()=>{const e=he();e?e.forward():history.forward()},wl="active",El=e=>e.split(/\s+/).map(t=>t.trim()).filter(t=>t.length>0),Sl=typeof HTMLElement<"u"?HTMLElement:class{},Bn=class extends Sl{constructor(...e){super(...e),this._cleanup=null,this._trackedActiveClasses=new Map,this._handleClick=t=>{t instanceof MouseEvent&&(t.defaultPrevented||t.button===0&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||(t.preventDefault(),this._navigate())))},this._handleKeydown=t=>{t instanceof KeyboardEvent&&t.key==="Enter"&&(t.preventDefault(),this._navigate())}}static get observedAttributes(){return["to","replace","exact","active-class"]}get to(){const e=this.getAttribute("to");return e==null||e.trim()===""?"/":e}set to(e){this.setAttribute("to",e)}get replace(){return this.hasAttribute("replace")}set replace(e){e?this.setAttribute("replace",""):this.removeAttribute("replace")}get exact(){return this.hasAttribute("exact")}set exact(e){e?this.setAttribute("exact",""):this.removeAttribute("exact")}get activeClass(){return this.getAttribute("active-class")??wl}set activeClass(e){this.setAttribute("active-class",e)}connectedCallback(){this.getAttribute("role")||this.setAttribute("role","link"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this._handleClick),this.addEventListener("keydown",this._handleKeydown),this._setupActiveTracking()}disconnectedCallback(){this.removeEventListener("click",this._handleClick),this.removeEventListener("keydown",this._handleKeydown),this._cleanup&&(this._cleanup(),this._cleanup=null),this._clearTrackedActiveClasses()}attributeChangedCallback(e,t,r){(e==="to"||e==="exact"||e==="active-class")&&this.isConnected&&this._setupActiveTracking()}_setupActiveTracking(){this._cleanup&&(this._cleanup(),this._cleanup=null),this._clearTrackedActiveClasses();const e=this.to,t=this.exact,r=El(this.activeClass);this._trackedActiveClasses=new Map(r.map(n=>[n,this.classList.contains(n)])),this._cleanup=j(()=>{const n=re.value.path,s=t?n===e:e==="/"?n==="/":n===e||n.startsWith(e.endsWith("/")?e:e+"/");for(const o of r){const i=this._trackedActiveClasses.get(o)??!1;this.classList.toggle(o,s||i)}s?this.setAttribute("aria-current","page"):this.removeAttribute("aria-current")})}_clearTrackedActiveClasses(){for(const[e,t]of this._trackedActiveClasses)this.classList.toggle(e,t);this._trackedActiveClasses.clear()}_navigate(){const e=this.to;e&&he()&&Be(e,{replace:this.replace}).catch(t=>{console.error("bq-link: Navigation failed:",t)})}},Al=()=>{typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("bq-link")&&customElements.define("bq-link",Bn)},kl=(e,t={})=>r=>{r.preventDefault(),Be(e,t).catch(n=>{console.error("Navigation failed:",n)})},Tl=e=>{const t=e??(typeof document<"u"?document.body:null);if(!t)return()=>{};const r=n=>{if(!(n instanceof MouseEvent)||n.defaultPrevented||n.button!==0||n.ctrlKey||n.metaKey||n.shiftKey||n.altKey||typeof Element>"u"||!(n.target instanceof Element))return;const s=n.target.closest("a");if(!s||!(s instanceof(s.ownerDocument.defaultView?.HTMLAnchorElement??HTMLAnchorElement))||s.target||s.hasAttribute("download")||typeof window>"u"||s.origin!==window.location.origin)return;const o=he();if(!o){n.preventDefault(),Be(s.pathname+s.search+s.hash).catch(c=>{console.error("Navigation failed:",c)});return}const i=o.base,a=o.hash;let l;if(a&&s.hash&&s.hash.startsWith("#/"))l=s.hash.slice(1);else{let c=s.pathname;i&&i!=="/"&&c.startsWith(i)&&(c=c.slice(i.length)||"/"),l=c+s.search+s.hash}n.preventDefault(),Be(l).catch(c=>{console.error("Navigation failed:",c)})};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},Cl=e=>{const t={};return new URLSearchParams(e).forEach((r,n)=>{if(x(n))return;const s=t[n];s===void 0?t[n]=r:Array.isArray(s)?s.push(r):t[n]=[s,r]}),t},Rl=128,Wn=new Map,Hn=new Map,Qn=(e,t,r)=>{if(e.has(t)&&e.delete(t),e.set(t,r),e.size<=Rl)return;const n=e.keys().next().value;n!==void 0&&e.delete(n)},Ol=e=>{const t=[];let r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s==="\\"&&n+1<e.length){n++;continue}if(s==="["&&!r){r=!0;continue}if(s==="]"&&r){r=!1;continue}if(!r){if(s==="("){t.push(!1);continue}if(s===")"){const o=t.pop()??!1,i=e[n+1];if(o&&(i==="+"||i==="*"||i==="?"||i==="{"))return!0;o&&t.length>0&&(t[t.length-1]=!0);continue}if(t.length>0){if(s==="?"&&n>0&&e[n-1]==="(")continue;(s==="+"||s==="*"||s==="?"||s==="{")&&(t[t.length-1]=!0)}}}return!1},Ll=e=>{let t="",r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s==="\\"&&n+1<e.length){if(!r&&e[n+1]>="1"&&e[n+1]<="9")throw new Error(`bQuery router: Route constraints cannot use backreferences: "${e}".`);if(!r&&e[n+1]==="k"&&e[n+2]==="<")throw new Error(`bQuery router: Route constraints cannot use backreferences: "${e}".`);t+=s+e[n+1],n++;continue}if(s==="["&&!r){r=!0,t+=s;continue}if(s==="]"&&r){r=!1,t+=s;continue}if(!r&&s==="("){if(n+1<e.length&&e[n+1]==="?"){if(e[n+2]==="<"){if(e[n+3]==="="||e[n+3]==="!"){t+="(";continue}const o=e.indexOf(">",n+3);if(o===-1)throw new Error(`bQuery router: Invalid route constraint named capture group: "${e}".`);t+="(?:",n=o;continue}t+="(";continue}t+="(?:";continue}t+=s}return t},Ht=e=>{const t=Wn.get(e);if(t!==void 0)return t;const r=Ll(e);return Qn(Wn,e,r),r},Vn=e=>{const t=Ht(e),r=Hn.get(t);if(r)return r;if(Ol(t))throw new Error(`bQuery router: Route constraint contains a potentially catastrophic (ReDoS) pattern. Nested quantifiers are not allowed: "${e}".`);try{const n=new RegExp(`^(?:${t})$`);return Qn(Hn,t,n),n}catch(n){throw n instanceof SyntaxError?new Error(`bQuery router: Invalid route constraint regex "${e}": ${n.message}`):n}},We=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"),Kn=e=>We(e)||e!==void 0&&e>="0"&&e<="9",Yn=(e,t)=>{let r=1,n="",s=t+1,o=!1;for(;s<e.length;){const i=e[s];if(i==="\\"&&s+1<e.length){n+=i+e[s+1],s+=2;continue}if(i==="["&&!o)o=!0;else if(i==="]"&&o)o=!1;else if(!o&&i==="(")r++;else if(!o&&i===")"&&(r--,r===0))return{constraint:n,endIndex:s+1};n+=i,s++}return null},$l=(e,t)=>{const r=Yn(e,t);if(!r)throw new Error(`bQuery router: Invalid route param constraint syntax in path "${e}" at index ${t}.`);return r},Gn=new Set,Jn=(e,t)=>{if(e[t]!==":"||!We(e[t+1]))return null;let r=t+2;for(;r<e.length&&Kn(e[r]);)r++;let n=r,s;if(e[r]==="("){const o=$l(e,r);s=o.constraint,n=o.endIndex}return{name:e.slice(t+1,r),constraint:s,nextIndex:n}},Pl=e=>{if(!Gn.has(e)){for(let t=0;t<e.length;){if(e[t]===":"&&We(e[t+1])){const r=Jn(e,t);r?.constraint&&Ht(r.constraint),t=r?.nextIndex??t+1;continue}t++}Gn.add(e)}},Ml=(e,t)=>{const r=e.indexOf("/",t);return r===-1?e.length:r},Xn=(e,t)=>{let r=t;for(;r<e.length&&!(e[r]==="*"||e[r]===":"&&We(e[r+1]));)r++;return e.slice(t,r)},Zn=(e,t,r,n)=>{const s=[];let o=t;for(;o<=r;){const i=e.indexOf(n,o);if(i===-1||i>r)break;s.push(i),o=i+1}return s.reverse()},Nl=(e,t)=>{const r=new Map,n=(s,o)=>{const i=`${s}:${o}`;if(r.has(i))return r.get(i)??null;if(s===e.length){const f=o===t.length?{}:null;return r.set(i,f),f}const a=e[s];if(a==="*"){if(s===e.length-1){const p={};return r.set(i,p),p}const f=Xn(e,s+1),m=f.length>0?Zn(t,o,t.length,f):null,d=(m?p=>{for(const u of m){const h=p(u);if(h)return h}return null}:p=>{for(let u=t.length;u>=o;u--){const h=p(u);if(h)return h}return null})(p=>{const u=n(s+1,p);return u?(r.set(i,u),u):null});return d||(r.set(i,null),null)}const l=Jn(e,s);if(l){const f=l.constraint?Vn(l.constraint):void 0,m=l.constraint?t.length:Ml(t,o),d=Xn(e,l.nextIndex),p=d.length>0?Zn(t,o,m,d):null,u=(p?h=>{for(const v of p){if(v<=o)continue;const b=h(v);if(b)return b}return null}:h=>{for(let v=m;v>o;v--){const b=h(v);if(b)return b}return null})(h=>{const v=t.slice(o,h);if(f&&!f.test(v))return null;const b=n(l.nextIndex,h);if(b){const y={[l.name]:v,...b};return r.set(i,y),y}return null});return u||(r.set(i,null),null)}if(o>=t.length||a!==t[o])return r.set(i,null),null;const c=n(s+1,o+1);return r.set(i,c),c};return n(0,0)},Dl=(e,t)=>{for(const r of t){Pl(r.path);const n=Nl(r.path,e);if(n)return{matched:r,params:n}}return null},gt=(e,t,r,n)=>{const s=Dl(e,n);return{path:e,params:s?.params??{},query:Cl(t),matched:s?.matched??null,hash:r.replace(/^#/,"")}},es=(e,t="")=>{const r=[];for(const n of e){const s=n.path==="*"?"*":`${t}${n.path}`.replace(/\/+/g,"/");r.push({...n,path:s}),n.children&&r.push(...es(n.children,s))}return r},Il=(e,t={})=>{const r=he();if(!r)throw new Error("bQuery router: No router initialized.");const n=r.routes.find(o=>o.name===e);if(!n)throw new Error(`bQuery router: Route "${e}" not found.`);let s="";for(let o=0;o<n.path.length;){if(n.path[o]===":"&&We(n.path[o+1])){let i=o+2;for(;i<n.path.length&&Kn(n.path[i]);)i++;let a=i,l=null;if(n.path[i]==="("){const m=Yn(n.path,i);if(!m)throw new Error(`bQuery router: Invalid constraint syntax in path "${n.path}" for route "${e}".`);l=m.constraint,a=m.endIndex}const c=n.path.slice(o+1,i),f=t[c];if(f===void 0)throw new Error(`bQuery router: Missing required param "${c}" for route "${e}".`);if(l&&!Vn(l).test(f))throw new Error(`bQuery router: Param "${c}" with value "${f}" does not satisfy the route constraint "${l}" for route "${e}".`);s+=encodeURIComponent(f),o=a;continue}s+=n.path[o],o++}return s},_l=(e,t=!1)=>{const r=re.value.path;return t?r===e:r.startsWith(e)},ql=(e,t=!1)=>D(()=>{const r=re.value.path;return t?r===e:r.startsWith(e)}),zl=100,xl=e=>{const t={};for(const[r,n]of Object.entries(e))x(r)||(t[r]=n);return t},jl=e=>{const t=he();t&&t.destroy();const{routes:r,base:n="",hash:s=!1,scrollRestoration:o=!1}=e,i=[],a=[],l=es(r),c=new Map;let f="0",m=0,d=null;if(o&&typeof history<"u"&&"scrollRestoration"in history){d=history.scrollRestoration,history.scrollRestoration!=="manual"&&(history.scrollRestoration="manual");const S=history.state&&typeof history.state=="object"?history.state:{};if(typeof S.__bqScrollKey!="string"){const T=s?window.location.hash||"#/":`${window.location.pathname}${window.location.search}${window.location.hash}`;history.replaceState({...S,__bqScrollKey:f},"",T)}}const p=()=>history.state&&history.state.__bqScrollKey||f,u=()=>`${Date.now()}-${m++}`,h=(S=p())=>{if(o)for(c.has(S)&&c.delete(S),c.set(S,{x:window.scrollX,y:window.scrollY});c.size>zl;){const T=c.keys().next().value;if(T===void 0)break;c.delete(T)}},v=(S=p())=>{if(!o)return;const T=c.get(S);T?window.scrollTo(T.x,T.y):window.scrollTo(0,0)},b=()=>{const S=history.state&&typeof history.state=="object"?{...history.state}:{};return o&&(S.__bqScrollKey=f),S},y=()=>{if(s){const[T,P=""]=(window.location.hash.slice(1)||"/").split("#"),[R,O=""]=T.split("?");return{pathname:R,search:O?`?${O}`:"",hash:P?`#${P}`:""}}let S=window.location.pathname;return n&&(S===n||S.startsWith(n+"/"))&&(S=S.slice(n.length)||"/"),{pathname:S,search:window.location.search,hash:window.location.hash}},w=()=>{const{pathname:S,search:T,hash:P}=y();re.value=gt(S,T,P,l)},E=async(S,T,P=new Set)=>{jn();try{const{pathname:R,search:O,hash:C}=y(),L=gt(R,O,C,l),M=new URL(S,window.location.origin),_=`${M.pathname}${M.search}${M.hash}`;if(P.has(_))throw new Error(`bQuery router: redirect loop detected for path "${_}"`);P.add(_);const U=gt(M.pathname,M.search,M.hash,l);if(U.matched?.redirectTo){await E(U.matched.redirectTo,T,P);return}if(U.matched?.beforeEnter&&await U.matched.beforeEnter(U,L)===!1)return;for(const Ze of i)if(await Ze(U,L)===!1)return;h();const q=o?p():void 0,Q=T==="replaceState"&&q?q:u(),oe=s?`#${S}`:`${n}${S}`,Oe=o&&history.state&&typeof history.state=="object"?xl(history.state):{},or=o?{...Oe,__bqScrollKey:Q}:{};history[T](or,"",oe),f=Q,w(),o&&T==="pushState"&&window.scrollTo(0,0);for(const Ze of a)Ze(re.value,L)}finally{Fn()}},k=async S=>{jn();try{const{pathname:T,search:P,hash:R}=y(),O=re.value,C=gt(T,P,R,l);if(C.matched?.redirectTo){await E(C.matched.redirectTo,"replaceState");return}if(C.matched?.beforeEnter&&await C.matched.beforeEnter(C,O)===!1){const L=new URLSearchParams(Object.entries(O.query).flatMap(([q,Q])=>Array.isArray(Q)?Q.map(oe=>[q,oe]):[[q,Q]])).toString(),M=L?`?${L}`:"",_=O.hash?`#${O.hash}`:"",U=s?`#${O.path}${M}${_}`:`${n}${O.path}${M}${_}`;history.replaceState(b(),"",U);return}for(const L of i)if(await L(C,O)===!1){const M=new URLSearchParams(Object.entries(O.query).flatMap(([Q,oe])=>Array.isArray(oe)?oe.map(Oe=>[Q,Oe]):[[Q,oe]])).toString(),_=M?`?${M}`:"",U=O.hash?`#${O.hash}`:"",q=s?`#${O.path}${_}${U}`:`${n}${O.path}${_}${U}`;history.replaceState(b(),"",q);return}h(f),f=S.state?.__bqScrollKey??p(),w(),v(f);for(const L of a)L(re.value,O)}finally{Fn()}};window.addEventListener("popstate",k),w();const A={push:S=>E(S,"pushState"),replace:S=>E(S,"replaceState"),back:()=>history.back(),forward:()=>history.forward(),go:S=>history.go(S),beforeEach:S=>(i.push(S),()=>{const T=i.indexOf(S);T>-1&&i.splice(T,1)}),afterEach:S=>(a.push(S),()=>{const T=a.indexOf(S);T>-1&&a.splice(T,1)}),currentRoute:xn,routes:l,base:n,hash:s,destroy:()=>{window.removeEventListener("popstate",k),i.length=0,a.length=0,c.clear(),d!==null&&typeof history<"u"&&"scrollRestoration"in history&&(history.scrollRestoration=d),yl(),Un(null)}};return Un(A),A},ke=D(()=>re.value),Fl={route:ke,path:D(()=>ke.value.path),params:D(()=>ke.value.params),query:D(()=>ke.value.query),hash:D(()=>ke.value.hash),matched:D(()=>ke.value.matched)},Ul=()=>Fl,Bl=()=>{if(!(typeof window>"u"))return window.__BQUERY_DEVTOOLS__||(window.__BQUERY_DEVTOOLS__={stores:new Map}),window.__BQUERY_DEVTOOLS__},Wl=(e,t)=>{const r=Bl();r&&(r.stores.set(e,t),r.onStoreCreated?.(e,t))},Hl=e=>{typeof window>"u"||!window.__BQUERY_DEVTOOLS__||window.__BQUERY_DEVTOOLS__.stores.delete(e)},Ql=(e,t)=>{typeof window>"u"||window.__BQUERY_DEVTOOLS__?.onStateChange?.(e,t)},ts=[],Vl=e=>{ts.push(e)},Kl=(e,t)=>{for(const r of ts){const n=r({store:e,options:t});n&&Object.assign(e,n)}},He=new Map,rs=e=>He.has(e),Yl=(e,t)=>{He.set(e,t)},Te=e=>He.get(e),Qt=()=>Array.from(He.keys()),Gl=e=>{He.delete(e),Hl(e)},ns=e=>e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype,me=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(me);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Map)return new Map(Array.from(e.entries()).map(([r,n])=>[r,me(n)]));if(e instanceof Set)return new Set(Array.from(e).map(me));const t={};for(const r of Object.keys(e))t[r]=me(e[r]);return t},Ce=(e,t)=>{if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e.entries())if(!t.has(s)||!Ce(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.values()){let o=!1;for(const i of t.values())if(Ce(s,i)){o=!0;break}if(!o)return!1}return!0}if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>Ce(s,t[o]));if(Array.isArray(e)!==Array.isArray(t))return!1;const r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(s=>Ce(e[s],t[s]))},Jl=(e,t,r)=>{const n=[];for(const s of Object.keys(t)){const o=e[s],i=t[s];r.get(s)===i&&ns(o)&&ns(i)&&!Ce(o,i)&&n.push(s)}return n},Qe=()=>qt(),Vt=e=>{const{id:t,state:r,getters:n={},actions:s={}}=e;if(rs(t))return console.warn(`bQuery store: Store "${t}" already exists. Returning existing instance.`),Te(t);const o=r(),i=new Map;for(const y of Object.keys(o))i.set(y,$(o[y]));const a=[],l=[],c=(y,w,E)=>{!Qe()||typeof console>"u"||typeof console.error!="function"||console.error(`[bQuery store "${t}"] Error in $onAction ${y} for action "${w}"`,E)},f=new WeakSet,m=(y,w)=>{!Qe()||typeof console>"u"||typeof console.warn!="function"||f.has(y)||(f.add(y),console.warn(`[bQuery store "${t}"] Async $onAction listener detected for action "${w}". If it awaits, register after()/onError() before the first await; late registrations will not affect the current action.`))},d=(y,w,E,k)=>{try{const A=E();Le(A)&&(y==="listener"&&k&&m(k,w),A.catch(S=>{c(y,w,S)}))}catch(A){c(y,w,A)}},p=()=>ue(()=>({...h})),u=()=>{const y=typeof window<"u"&&typeof window.__BQUERY_DEVTOOLS__?.onStateChange=="function";if(a.length===0&&!y)return;const w=p();for(const E of a)E(w);Ql(t,w)},h=new Proxy({},{get:(y,w)=>{const E=w;if(i.has(E))return i.get(E).value},ownKeys:()=>Array.from(i.keys()),getOwnPropertyDescriptor:(y,w)=>{if(i.has(w))return{enumerable:!0,configurable:!0}},has:(y,w)=>i.has(w)}),v=new Map,b={};for(const y of Object.keys(o))Object.defineProperty(b,y,{get:()=>i.get(y).value,set:w=>{i.get(y).value=w,u()},enumerable:!0,configurable:!1});for(const y of Object.keys(n)){const w=n[y],E=D(()=>w(h,new Proxy({},{get:(k,A)=>{const S=A;if(v.has(S))return v.get(S).value}})));v.set(y,E),Object.defineProperty(b,y,{get:()=>E.value,enumerable:!0,configurable:!1})}for(const y of Object.keys(s)){const w=s[y],E=y;b[E]=function(...k){const A=new Proxy(b,{get:(C,L)=>typeof L=="string"&&i.has(L)?i.get(L).value:C[L],set:(C,L,M)=>typeof L=="string"&&i.has(L)?(i.get(L).value=M,u(),!0):Reflect.set(C,L,M)});if(l.length===0)return w.apply(A,k);const S=[],T=[],P=[...l],R={name:E,store:b,args:k,after:C=>{S.push(L=>C(L))},onError:C=>{T.push(C)}};for(const C of P)d("listener",E,()=>C(R),C);let O;try{O=w.apply(A,k)}catch(C){for(const L of T)d("onError",E,()=>L(C));throw C}if(Le(O))return O.then(C=>{for(const L of S)d("after",E,()=>L(C));return C},C=>{for(const L of T)d("onError",E,()=>L(C));throw C});for(const C of S)d("after",E,()=>C(O));return O}}return Object.defineProperties(b,{$id:{value:t,writable:!1,enumerable:!1},$reset:{value:()=>{const y=r();ce(()=>{for(const[w,E]of i)E.value=y[w]}),u()},writable:!1,enumerable:!1},$subscribe:{value:y=>(a.push(y),()=>{const w=a.indexOf(y);w>-1&&a.splice(w,1)}),writable:!1,enumerable:!1},$onAction:{value:y=>(l.push(y),()=>{const w=l.indexOf(y);w>-1&&l.splice(w,1)}),writable:!1,enumerable:!1},$patch:{value:y=>{ce(()=>{if(typeof y=="function"){const w=Qe(),E=w?me(p()):null,k=w?new Map(Array.from(i.entries()).map(([S,T])=>[S,T.value])):null,A=p();if(y(A),w&&E&&k){const S=Jl(E,A,k);S.length>0&&console.warn(`[bQuery store "${t}"] Nested mutation detected in $patch() for keys: ${S.map(String).join(", ")}.
254
+ `}),r},Tr=null,le=()=>Tr!==null?Tr:typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches,Sl=e=>{Tr=e},As=e=>typeof e=="string"||typeof e=="number",ks=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),De=(e,t)=>{const r=e.style;if(Array.isArray(t)){const n=t[t.length-1];if(!n)return;for(const[s,o]of Object.entries(n))if(!(s==="offset"||s==="easing"||s==="composite")&&As(o)){const i=s.startsWith("--")?s:ks(s);r.setProperty(i,String(o))}return}for(const[n,s]of Object.entries(t)){if(n==="offset"||n==="easing"||n==="composite")continue;const o=Array.isArray(s)?s[s.length-1]:s;if(As(o)){const i=n.startsWith("--")?n:ks(n);r.setProperty(i,String(o))}}},zt=(e,t)=>{const{keyframes:r,options:n,commitStyles:s=!0,respectReducedMotion:o=!0,onFinish:i}=t;if(o&&le())return s&&De(e,r),i?.(),Promise.resolve();const a=e;return typeof a.animate!="function"?(s&&De(e,r),i?.(),Promise.resolve()):new Promise(c=>{const l=a.animate(r,n);let u=!1;const h=()=>{u||(u=!0,s&&(typeof l.commitStyles=="function"?l.commitStyles():De(e,r)),l.cancel(),i?.(),c())};l.onfinish=h,l.finished&&l.finished.then(h).catch(h)})},ue=e=>Math.min(1,Math.max(0,e)),Ts=e=>ue(e),Rs=e=>ue(e*e),Cs=e=>ue(1-(1-e)*(1-e)),$s=e=>ue(e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2),Os=e=>ue(e*e*e),Ls=e=>ue(1-Math.pow(1-e,3)),Ps=e=>ue(e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2),Ns=e=>ue(1+(1.70158+1)*Math.pow(e-1,3)+1.70158*Math.pow(e-1,2)),Is=e=>ue(e===1?1:1-Math.pow(2,-10*e)),El={linear:Ts,easeInQuad:Rs,easeOutQuad:Cs,easeInOutQuad:$s,easeInCubic:Os,easeOutCubic:Ls,easeInOutCubic:Ps,easeOutBack:Ns,easeOutExpo:Is},Rr=e=>{const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width,height:t.height}},Cr=(e,t,r={})=>{const{duration:n=300,easing:s="ease-out",onComplete:o}=r,i=Rr(e);if(i.width===0||i.height===0)return o?.(),Promise.resolve();const a=t.left-i.left,c=t.top-i.top,l=t.width/i.width,u=t.height/i.height;if(a===0&&c===0&&l===1&&u===1)return o?.(),Promise.resolve();const h=e;return typeof h.animate!="function"?(o?.(),Promise.resolve()):(h.style.transform=`translate(${a}px, ${c}px) scale(${l}, ${u})`,h.style.transformOrigin="top left",h.offsetHeight,new Promise(d=>{const p=h.animate([{transform:`translate(${a}px, ${c}px) scale(${l}, ${u})`},{transform:"translate(0, 0) scale(1, 1)"}],{duration:n,easing:s,fill:"forwards"});let f=!1;const m=()=>{f||(f=!0,h.style.transform="",h.style.transformOrigin="",o?.(),d())};p.onfinish=m,p.finished&&p.finished.then(m).catch(m)}))},Al=async(e,t,r={})=>{await Ms(e,t,r)},Ms=async(e,t,r={})=>{const{stagger:n,...s}=r,o=new Map;for(const c of e)o.set(c,Rr(c));t();const i=e.length,a=e.map((c,l)=>{const u=o.get(c);if(!u)return Promise.resolve();const h=n?n(l,i):0;return h>0?new Promise(d=>setTimeout(d,h)).then(()=>Cr(c,u,s)):Cr(c,u,s)});await Promise.all(a)},kl={fadeIn:(e=0,t=1)=>[{opacity:e},{opacity:t}],fadeOut:(e=1,t=0)=>[{opacity:e},{opacity:t}],slideInUp:(e=16)=>[{opacity:0,transform:`translateY(${e}px)`},{opacity:1,transform:"translateY(0)"}],slideInDown:(e=16)=>[{opacity:0,transform:`translateY(-${e}px)`},{opacity:1,transform:"translateY(0)"}],slideInLeft:(e=16)=>[{opacity:0,transform:`translateX(${e}px)`},{opacity:1,transform:"translateX(0)"}],slideInRight:(e=16)=>[{opacity:0,transform:`translateX(-${e}px)`},{opacity:1,transform:"translateX(0)"}],scaleIn:(e=.95,t=1)=>[{opacity:0,transform:`scale(${e})`},{opacity:1,transform:`scale(${t})`}],scaleOut:(e=1,t=.95)=>[{opacity:1,transform:`scale(${e})`},{opacity:0,transform:`scale(${t})`}],pop:(e=.9,t=1.02,r=1)=>[{opacity:0,transform:`scale(${e})`},{opacity:1,transform:`scale(${t})`,offset:.6},{opacity:1,transform:`scale(${r})`}],rotateIn:(e=6)=>[{opacity:0,transform:`rotate(${e}deg) scale(0.98)`},{opacity:1,transform:"rotate(0deg) scale(1)"}]},Tl=(e,t,r={})=>{const{duration:n=300,easing:s="ease",respectReducedMotion:o=!0,onComplete:i}=r,a=e,c=t;if(typeof window>"u"||typeof document>"u"||typeof a.getBoundingClientRect!="function"||typeof c.getBoundingClientRect!="function"||typeof a.style>"u"||typeof c.style>"u")return i?.(),Promise.resolve();const l=e.getBoundingClientRect(),u=c.style.display,h=c.style.visibility,d=c.style.transform,p=c.style.opacity,f=typeof getComputedStyle=="function"?getComputedStyle(c).display:u||"block",m=f==="none"?"block":u||f||"block",v=()=>{c.style.transform=d,c.style.opacity=p};c.style.visibility="hidden",c.style.display=m;const b=t.getBoundingClientRect();if(c.style.visibility=h,a.style.display="none",f==="none"?c.style.display=m:u==="none"?c.style.display="":c.style.display=u,o&&le())return v(),i?.(),Promise.resolve();const g=l.left-b.left,w=l.top-b.top,S=l.width/(b.width||1),k=l.height/(b.height||1);if(g===0&&w===0&&S===1&&k===1)return v(),i?.(),Promise.resolve();const A=[{transform:`translate(${g}px, ${w}px) scale(${S}, ${k})`,opacity:"0.5"},{transform:"translate(0, 0) scale(1, 1)",opacity:"1"}];return typeof c.animate!="function"?(v(),i?.(),Promise.resolve()):new Promise(E=>{const T=c.animate(A,{duration:n,easing:s,fill:"forwards"});let P=!1;const C=()=>{P||(P=!0,v(),T.cancel(),i?.(),E())};T.onfinish=C,T.finished&&T.finished.then(C).catch(C)})},Rl=(e,t={})=>{if(typeof window>"u"||typeof window.addEventListener!="function"||typeof window.removeEventListener!="function"||typeof requestAnimationFrame!="function"||typeof cancelAnimationFrame!="function")return()=>{};const{speed:r=.5,direction:n="vertical",respectReducedMotion:s=!0}=t,o=e,i=o.style.transform;if(s&&le())return()=>{};let a=!1,c=!1,l=null;const u=()=>{c||(c=!0,window.removeEventListener("scroll",d),l!==null&&(cancelAnimationFrame(l),l=null),a=!1,o.style.transform=i)},h=()=>{if(c)return;if(s&&le()){u();return}const p=window.scrollY,f=window.scrollX;let m=0,v=0;(n==="vertical"||n==="both")&&(v=p*r),(n==="horizontal"||n==="both")&&(m=f*r);const b=`translate3d(${m}px, ${v}px, 0)`;o.style.transform=i?`${i} ${b}`:b},d=()=>{if(!c){if(s&&le()){u();return}a||(a=!0,l=requestAnimationFrame(()=>{l=null,h(),a=!1}))}};return h(),window.addEventListener("scroll",d,{passive:!0}),u},Cl=e=>typeof Element<"u"&&e instanceof Element?[e]:Array.from(e),$l=(e,t)=>{const r=Cl(e);if(!r.length)return()=>{};const{root:n=null,rootMargin:s,threshold:o,once:i=!0,onEnter:a,...c}=t;if(typeof IntersectionObserver>"u")return r.forEach(u=>{a?.(u),zt(u,c)}),()=>{};const l=new IntersectionObserver(u=>{u.forEach(h=>{if(!h.isIntersecting)return;const d=h.target;a?.(d),zt(d,c),i&&l.unobserve(d)})},{root:n,rootMargin:s,threshold:o});return r.forEach(u=>l.observe(u)),()=>l.disconnect()},Ol={stiffness:100,damping:10,mass:1,precision:.01},Ll=(e,t={})=>{const{stiffness:r,damping:n,mass:s,precision:o}={...Ol,...t};let i=e,a=0,c=e,l=null,u=null,h=null;const d=new Set,p=()=>{for(const m of d)m(i)},f=m=>{const v=h!==null?(m-h)/1e3:.016666666666666666,b=Math.min(v,1/30);h=m;const g=i-c,w=(-r*g+-n*a)/s;if(a+=w*b,i+=a*b,p(),Math.abs(a)<o&&Math.abs(g)<o){i=c,a=0,l=null,p(),u?.(),u=null;return}l=requestAnimationFrame(f)};return{to(m){return c=m,l!==null&&cancelAnimationFrame(l),u?.(),h=null,new Promise(v=>{u=v,l=requestAnimationFrame(f)})},current(){return i},stop(){l!==null&&(cancelAnimationFrame(l),l=null),a=0,h=null,u?.(),u=null},onChange(m){return d.add(m),()=>d.delete(m)}}},Pl={gentle:{stiffness:80,damping:15},snappy:{stiffness:200,damping:20},bouncy:{stiffness:300,damping:8},stiff:{stiffness:400,damping:30}},Nl=(e,t={})=>{const{start:r=0,from:n="start",easing:s}=t;return(o,i=0)=>{const a=typeof n=="number"?n:n==="center"?(i-1)/2:n==="end"?i-1:0,c=Math.abs(o-a),l=i>1?Math.max(a,i-1-a):1,u=l===0?0:c/l;return r+(s?s(u)*l:c)*e}},$r=e=>{if(typeof e=="number")return e;if(typeof e=="string"){const t=e.trim();if(t.endsWith("ms")){const n=Number.parseFloat(t.slice(0,-2));return Number.isFinite(n)?n:0}if(t.endsWith("s")){const n=Number.parseFloat(t.slice(0,-1));return Number.isFinite(n)?n*1e3:0}const r=Number.parseFloat(t);return Number.isFinite(r)?r:0}return 0},Il=(e,t)=>{if(typeof e=="number")return e;if(typeof e=="string"){const r=/^([+-])=(\d+(?:\.\d+)?)$/.exec(e);if(r){const n=Number.parseFloat(r[2]);return Number.isFinite(n)?r[1]==="+"?t+n:t-n:t}}return t},Ml=e=>{const t=$r(e?.duration),r=$r(e?.endDelay),n=e?.iterations??1;return n===1/0?Number.MAX_SAFE_INTEGER:t*Math.max(0,n)+r},Ds=e=>{let t=0;return e.map(r=>{const n=Il(r.at,t),s=$r(r.options?.delay),o=Math.max(0,n+s),i=Ml(r.options),a=o+i;return t=Math.max(t,a),{step:r,start:o,end:a,duration:i}})},Dl=async(e,t={})=>{const{stagger:r,onFinish:n}=t,s=e.length;for(let o=0;o<e.length;o+=1){const i=e[o],a=r?r(o,s):0;a>0&&await new Promise(c=>setTimeout(c,a)),await zt(i.target,i)}n?.()},_l=(e=[],t={})=>{const r=[...e],n=new Set;let s=[],o=0,i=!1,a=!1;const{commitStyles:c=!0,respectReducedMotion:l=!0,onFinish:u}=t,h=()=>{if(!a){if(a=!0,c)for(const p of s){const{animation:f,step:m}=p;typeof f.commitStyles=="function"?f.commitStyles():De(m.target,m.keyframes),f.cancel()}n.forEach(p=>p()),u?.()}},d=()=>{s.forEach(({animation:f})=>f.cancel()),s=[],a=!1;const p=Ds(r);if(o=p.length?Math.max(...p.map(f=>f.end)):0,l&&le()){c&&p.forEach(({step:f})=>De(f.target,f.keyframes)),i=!0;return}if(p.some(({step:f})=>typeof f.target.animate!="function")){c&&p.forEach(({step:f})=>De(f.target,f.keyframes)),i=!0;return}i=!1,s=p.map(({step:f,start:m})=>{const{delay:v,...b}=f.options??{};return{animation:f.target.animate(f.keyframes,{...b,delay:m,fill:b.fill??"both"}),step:f,start:m}})};return{add(p){r.push(p)},duration(){if(!r.length)return 0;if(!s.length){const p=Ds(r);return Math.max(...p.map(f=>f.end))}return o},async play(){if(d(),i||s.length===0){h();return}const p=s.map(f=>f.animation.finished.catch(()=>{}));await Promise.all(p),h()},pause(){i||s.forEach(({animation:p})=>p.pause())},resume(){i||s.forEach(({animation:p})=>p.play())},stop(){s.forEach(({animation:p})=>p.cancel()),s=[],i=!1},seek(p){i||s.forEach(({animation:f})=>{f.currentTime=p})},onFinish(p){return n.add(p),()=>n.delete(p)}}},_s=e=>(e??[]).map(t=>t.trim()).filter(t=>t.length>0),xl=async e=>{const t=ae().transitions,r=typeof e=="function"?{update:e,classes:t?.classes,types:t?.types,skipOnReducedMotion:t?.skipOnReducedMotion}:{...e,classes:e.classes??t?.classes,types:e.types??t?.types,skipOnReducedMotion:e.skipOnReducedMotion??t?.skipOnReducedMotion},n=r.update;if(typeof document>"u"){await n();return}const s=document,o=document.documentElement,i=_s(r.classes),a=_s(r.types);if(!s.startViewTransition||r.skipOnReducedMotion&&le()){await n(),r.onFinish?.();return}i.forEach(c=>o.classList.add(c));try{const c=s.startViewTransition(()=>n()),l=c.types;if(l)for(const u of a)l.add(u);await c.ready,r.onReady?.(),await c.finished,r.onFinish?.()}finally{i.forEach(c=>o.classList.remove(c))}},ql=(e,t,r={})=>{const{speed:n=50,delay:s=0,cursor:o=!1,cursorChar:i="|",loop:a=!1,loopDelay:c=1e3,respectReducedMotion:l=!0,onComplete:u}=r;if(typeof document>"u")return{stop:()=>{},done:Promise.resolve()};const h=e;let d=!1,p=null,f=null,m=null,v=null;const b=()=>{if(!o)return;f=document.createElement("span"),f.setAttribute("aria-hidden","true"),f.textContent=i,h.appendChild(f);let S=!0;m=setInterval(()=>{f&&(S=!S,f.style.opacity=S?"1":"0")},530)},g=()=>{m!==null&&(clearInterval(m),m=null),f&&f.parentNode&&(f.parentNode.removeChild(f),f=null)},w=()=>{d||(d=!0,p!==null&&(clearTimeout(p),p=null),g(),v?.(),v=null)};return l&&le()?(h.textContent=t,u?.(),{stop:()=>{},done:Promise.resolve()}):{stop:w,done:new Promise(S=>{v=S;const k=()=>{let A=0;h.textContent="",b();const E=document.createTextNode("");f?h.insertBefore(E,f):h.appendChild(E);const T=()=>{d||(A<t.length?(E.data=t.slice(0,A+1),A++,p=setTimeout(T,n)):(u?.(),a&&!d?p=setTimeout(()=>{d||(g(),k())},c):(g(),S(),v=null)))};p=setTimeout(T,s)};k()})}},zl=class{constructor(e){this.bucketName=e,this.dbPromise=null,this.storeName="blobs"}openDB(){if(this.dbPromise)return this.dbPromise;const e=`bquery-bucket-${this.bucketName}`;return this.dbPromise=new Promise((t,r)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const s=n.result;s.objectStoreNames.contains(this.storeName)||s.createObjectStore(this.storeName)},n.onsuccess=()=>t(n.result),n.onerror=()=>r(n.error)}),this.dbPromise}async withStore(e,t){const r=await this.openDB();return new Promise((n,s)=>{const o=t(r.transaction(this.storeName,e).objectStore(this.storeName));o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)})}async put(e,t){await this.withStore("readwrite",r=>r.put(t,e))}async get(e){return await this.withStore("readonly",t=>t.get(e))??null}async remove(e){await this.withStore("readwrite",t=>t.delete(e))}async keys(){return(await this.withStore("readonly",e=>e.getAllKeys())).map(e=>String(e))}},Ul={async open(e){return new zl(e)}},jl=class{constructor(e){this.cache=e}async add(e){await this.cache.add(e)}async addAll(e){await this.cache.addAll(e)}async put(e,t){await this.cache.put(e,t)}async match(e){return this.cache.match(e)}async remove(e){return this.cache.delete(e)}async keys(){return(await this.cache.keys()).map(e=>e.url)}},Hl={isSupported(){return"caches"in window},async open(e){if(!this.isSupported())throw new Error("bQuery: Cache Storage API not supported");return new jl(await caches.open(e))},async delete(e){return this.isSupported()?caches.delete(e):!1},async keys(){return this.isSupported()?caches.keys():[]}},Wl=e=>{if(typeof document>"u")return null;const t=`${encodeURIComponent(e)}=`,r=document.cookie?document.cookie.split(";"):[];for(const n of r){const s=n.trim();if(s.startsWith(t)){const o=s.slice(t.length);try{return decodeURIComponent(o)}catch{return o}}}return null},Fl=e=>{const t=e.trim();return t.startsWith("{")||t.startsWith("[")||t.startsWith('"')},Bl=(e,t)=>{if(typeof document>"u")return;const r=[`${encodeURIComponent(e)}=`,"Expires=Thu, 01 Jan 1970 00:00:00 GMT"];t.path&&r.push(`Path=${t.path}`),t.domain&&r.push(`Domain=${t.domain}`),t.sameSite&&r.push(`SameSite=${t.sameSite}`),t.secure&&r.push("Secure"),document.cookie=r.join("; ")},Ql=(e,t,r)=>{if(typeof document>"u")return;const n=r.serialize?r.serialize(t):typeof t=="string"?t:JSON.stringify(t),s=[`${encodeURIComponent(e)}=${encodeURIComponent(n)}`];r.path&&s.push(`Path=${r.path}`),r.domain&&s.push(`Domain=${r.domain}`),typeof r.maxAge=="number"&&s.push(`Max-Age=${r.maxAge}`),r.expires&&s.push(`Expires=${r.expires.toUTCString()}`),r.sameSite&&s.push(`SameSite=${r.sameSite}`),r.secure&&s.push("Secure"),document.cookie=s.join("; ")},Vl=(e,t={})=>{const r=ae().cookies,n={path:r?.path??"/",sameSite:r?.sameSite??"Lax",secure:r?.secure??!1,watch:!0,...t};n.sameSite==="None"&&(n.secure=!0);const s=Wl(e);let o=n.defaultValue??null;if(s!==null)try{o=n.deserialize?n.deserialize(s):Fl(s)?JSON.parse(s):s??o}catch(c){console.warn(`bQuery: Failed to deserialize cookie "${e}", using raw string value`,c),o=s??o}const i=L(o);if(typeof document>"u"||n.watch===!1)return i;let a=!1;return U(()=>{const c=i.value;if(!a){a=!0;return}if(c==null){Bl(e,n);return}Ql(e,c,n)}),i},Kl={isSupported(){return"Notification"in window},getPermission(){return this.isSupported()?Notification.permission:"denied"},async requestPermission(){return this.isSupported()?Notification.permission==="granted"?"granted":Notification.permission==="denied"?"denied":Notification.requestPermission():"denied"},send(e,t){return this.isSupported()?Notification.permission!=="granted"?(console.warn("bQuery: Notification permission not granted"),null):new Notification(e,t):(console.warn("bQuery: Notifications not supported in this browser"),null)}},Yl=["position:absolute","width:1px","height:1px","padding:0","margin:-1px","overflow:hidden","clip:rect(0, 0, 0, 0)","white-space:nowrap","border:0"].join(";"),Jl=(e={})=>{const t=ae().announcer,r={politeness:t?.politeness??"polite",atomic:t?.atomic??!0,delay:t?.delay??16,clearDelay:t?.clearDelay??1e3,...e},n=L("");if(typeof document>"u")return{element:null,message:n,announce(m){n.value=m},clear(){n.value=""},destroy(){n.value=""}};const s=r.id?document.getElementById(r.id):null,o=s??document.createElement("div"),i=!s;if(r.id&&(o.id=r.id),r.className&&(o.className=r.className),o.setAttribute("aria-live",r.politeness),o.setAttribute("aria-atomic",String(r.atomic)),o.setAttribute("role",r.politeness==="assertive"?"alert":"status"),o.setAttribute("data-bquery-announcer","true"),o.getAttribute("style")||o.setAttribute("style",Yl),i){const m=r.container??document.body??document.documentElement;if(!m)return{element:null,message:n,announce(v){n.value=v},clear(){n.value=""},destroy(){n.value=""}};m.appendChild(o)}const a=U(()=>{o.textContent=n.value});let c,l,u=!1;const h=()=>{c&&(clearTimeout(c),c=void 0),l&&(clearTimeout(l),l=void 0)};return{element:o,message:n,announce:(m,v={})=>{if(u)return;const b=v.politeness??r.politeness,g=v.delay??r.delay,w=v.clearDelay??r.clearDelay;h(),o.setAttribute("aria-live",b),o.setAttribute("role",b==="assertive"?"alert":"status"),n.value="",c=setTimeout(()=>{u||(n.value=m,w>0&&(l=setTimeout(()=>{u||(n.value="")},w)))},g)},clear:()=>{u||(h(),n.value="")},destroy:()=>{u||(u=!0,h(),n.value="",a(),i&&o.remove())}}},xs=(e,t)=>{const r=new Map;for(const[n,s]of Object.entries(t))r.set(n,e.getAttribute(n)),e.setAttribute(n,s);return()=>{for(const[n,s]of r.entries())s==null?e.removeAttribute(n):e.setAttribute(n,s)}},qs=(e,t)=>{const r=document.createElement(e);r.setAttribute("data-bquery-page-meta","true");for(const[n,s]of Object.entries(t))s!==void 0&&r.setAttribute(n,s);return r},Gl=e=>{if(typeof document>"u")return()=>{};const t=ae().pageMeta,r=e.title?t?.titleTemplate?t.titleTemplate(e.title):e.title:void 0,n=[],s=[],o=document.title;r!==void 0&&(document.title=r);const i=[...e.meta??[]];e.description&&i.unshift({name:"description",content:e.description});for(const a of i){const c=qs("meta",{name:a.name,property:a.property,"http-equiv":a.httpEquiv,content:a.content});document.head.appendChild(c),n.push(c)}for(const a of e.link??[]){const c=qs("link",{rel:a.rel,href:a.href,type:a.type,media:a.media,crossorigin:a.crossOrigin});document.head.appendChild(c),n.push(c)}return e.htmlAttributes&&s.push(xs(document.documentElement,e.htmlAttributes)),e.bodyAttributes&&document.body&&s.push(xs(document.body,e.bodyAttributes)),()=>{document.title=o;for(const a of s.reverse())a();for(const a of n)a.remove()}},zs=class{constructor(e){this.storage=e}async get(e){const t=this.storage.getItem(e);if(t===null)return null;try{return JSON.parse(t)}catch{return t}}async set(e,t){const r=typeof t=="string"?t:JSON.stringify(t);this.storage.setItem(e,r)}async remove(e){this.storage.removeItem(e)}async clear(){this.storage.clear()}async keys(){const e=[];for(let t=0;t<this.storage.length;t++){const r=this.storage.key(t);r!==null&&e.push(r)}return e}},Xl=class extends zs{constructor(){super(localStorage)}},Zl=class extends zs{constructor(){super(sessionStorage)}},eu=class{constructor(e){this.options=e,this.dbPromise=null}openDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((e,t)=>{const r=indexedDB.open(this.options.name,this.options.version??1);r.onupgradeneeded=()=>{const n=r.result;n.objectStoreNames.contains(this.options.store)||n.createObjectStore(this.options.store)},r.onsuccess=()=>e(r.result),r.onerror=()=>t(r.error)}),this.dbPromise)}async withStore(e,t){const r=await this.openDB();return new Promise((n,s)=>{const o=t(r.transaction(this.options.store,e).objectStore(this.options.store));o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)})}async get(e){return await this.withStore("readonly",t=>t.get(e))??null}async set(e,t){await this.withStore("readwrite",r=>r.put(t,e))}async remove(e){await this.withStore("readwrite",t=>t.delete(e))}async clear(){await this.withStore("readwrite",e=>e.clear())}async keys(){return(await this.withStore("readonly",e=>e.getAllKeys())).map(e=>String(e))}},tu={local(){return new Xl},session(){return new Zl},indexedDB(e){return new eu(e)}},Us=null,fe=L({path:"",params:{},query:{},matched:null,hash:""}),js=D(()=>fe.value),tt=L(0),Ut=L(!1),ru=_(Ut),Hs=()=>{tt.value===0&&(Ut.value=!0),tt.value+=1},Ws=()=>{const e=Math.max(0,tt.value-1);tt.value=e,e===0&&(Ut.value=!1)},nu=()=>{tt.value=0,Ut.value=!1},ke=()=>Us,Fs=e=>{Us=e},rt=async(e,t={})=>{const r=ke();if(!r)throw new Error("bQuery router: No router initialized. Call createRouter() first.");await r[t.replace?"replace":"push"](e)},su=()=>{const e=ke();e?e.back():history.back()},ou=()=>{const e=ke();e?e.forward():history.forward()},iu="active",au=e=>e.split(/\s+/).map(t=>t.trim()).filter(t=>t.length>0),cu=typeof HTMLElement<"u"?HTMLElement:class{},Bs=class extends cu{constructor(...e){super(...e),this._cleanup=null,this._trackedActiveClasses=new Map,this._handleClick=t=>{t instanceof MouseEvent&&(t.defaultPrevented||t.button===0&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||(t.preventDefault(),this._navigate())))},this._handleKeydown=t=>{t instanceof KeyboardEvent&&t.key==="Enter"&&(t.preventDefault(),this._navigate())}}static get observedAttributes(){return["to","replace","exact","active-class"]}get to(){const e=this.getAttribute("to");return e==null||e.trim()===""?"/":e}set to(e){this.setAttribute("to",e)}get replace(){return this.hasAttribute("replace")}set replace(e){e?this.setAttribute("replace",""):this.removeAttribute("replace")}get exact(){return this.hasAttribute("exact")}set exact(e){e?this.setAttribute("exact",""):this.removeAttribute("exact")}get activeClass(){return this.getAttribute("active-class")??iu}set activeClass(e){this.setAttribute("active-class",e)}connectedCallback(){this.getAttribute("role")||this.setAttribute("role","link"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.addEventListener("click",this._handleClick),this.addEventListener("keydown",this._handleKeydown),this._setupActiveTracking()}disconnectedCallback(){this.removeEventListener("click",this._handleClick),this.removeEventListener("keydown",this._handleKeydown),this._cleanup&&(this._cleanup(),this._cleanup=null),this._clearTrackedActiveClasses()}attributeChangedCallback(e,t,r){(e==="to"||e==="exact"||e==="active-class")&&this.isConnected&&this._setupActiveTracking()}_setupActiveTracking(){this._cleanup&&(this._cleanup(),this._cleanup=null),this._clearTrackedActiveClasses();const e=this.to,t=this.exact,r=au(this.activeClass);this._trackedActiveClasses=new Map(r.map(n=>[n,this.classList.contains(n)])),this._cleanup=U(()=>{const n=fe.value.path,s=t?n===e:e==="/"?n==="/":n===e||n.startsWith(e.endsWith("/")?e:e+"/");for(const o of r){const i=this._trackedActiveClasses.get(o)??!1;this.classList.toggle(o,s||i)}s?this.setAttribute("aria-current","page"):this.removeAttribute("aria-current")})}_clearTrackedActiveClasses(){for(const[e,t]of this._trackedActiveClasses)this.classList.toggle(e,t);this._trackedActiveClasses.clear()}_navigate(){const e=this.to;e&&ke()&&rt(e,{replace:this.replace}).catch(t=>{console.error("bq-link: Navigation failed:",t)})}},lu=()=>{typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("bq-link")&&customElements.define("bq-link",Bs)},uu=(e,t={})=>r=>{r.preventDefault(),rt(e,t).catch(n=>{console.error("Navigation failed:",n)})},fu=e=>{const t=e??(typeof document<"u"?document.body:null);if(!t)return()=>{};const r=n=>{if(!(n instanceof MouseEvent)||n.defaultPrevented||n.button!==0||n.ctrlKey||n.metaKey||n.shiftKey||n.altKey||typeof Element>"u"||!(n.target instanceof Element))return;const s=n.target.closest("a");if(!s||!(s instanceof(s.ownerDocument.defaultView?.HTMLAnchorElement??HTMLAnchorElement))||s.target||s.hasAttribute("download")||typeof window>"u"||s.origin!==window.location.origin)return;const o=ke();if(!o){n.preventDefault(),rt(s.pathname+s.search+s.hash).catch(l=>{console.error("Navigation failed:",l)});return}const i=o.base,a=o.hash;let c;if(a&&s.hash&&s.hash.startsWith("#/"))c=s.hash.slice(1);else{let l=s.pathname;i&&i!=="/"&&l.startsWith(i)&&(l=l.slice(i.length)||"/"),c=l+s.search+s.hash}n.preventDefault(),rt(c).catch(l=>{console.error("Navigation failed:",l)})};return t.addEventListener("click",r),()=>t.removeEventListener("click",r)},Qs=e=>{const t={};return new URLSearchParams(e).forEach((r,n)=>{if(N(n))return;const s=t[n];s===void 0?t[n]=r:Array.isArray(s)?s.push(r):t[n]=[s,r]}),t},du=128,Vs=new Map,Ks=new Map,Ys=(e,t,r)=>{if(e.has(t)&&e.delete(t),e.set(t,r),e.size<=du)return;const n=e.keys().next().value;n!==void 0&&e.delete(n)},hu=e=>{const t=[];let r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s==="\\"&&n+1<e.length){n++;continue}if(s==="["&&!r){r=!0;continue}if(s==="]"&&r){r=!1;continue}if(!r){if(s==="("){t.push(!1);continue}if(s===")"){const o=t.pop()??!1,i=e[n+1];if(o&&(i==="+"||i==="*"||i==="?"||i==="{"))return!0;o&&t.length>0&&(t[t.length-1]=!0);continue}if(t.length>0){if(s==="?"&&n>0&&e[n-1]==="(")continue;(s==="+"||s==="*"||s==="?"||s==="{")&&(t[t.length-1]=!0)}}}return!1},mu=e=>{let t="",r=!1;for(let n=0;n<e.length;n++){const s=e[n];if(s==="\\"&&n+1<e.length){if(!r&&e[n+1]>="1"&&e[n+1]<="9")throw new Error(`bQuery router: Route constraints cannot use backreferences: "${e}".`);if(!r&&e[n+1]==="k"&&e[n+2]==="<")throw new Error(`bQuery router: Route constraints cannot use backreferences: "${e}".`);t+=s+e[n+1],n++;continue}if(s==="["&&!r){r=!0,t+=s;continue}if(s==="]"&&r){r=!1,t+=s;continue}if(!r&&s==="("){if(n+1<e.length&&e[n+1]==="?"){if(e[n+2]==="<"){if(e[n+3]==="="||e[n+3]==="!"){t+="(";continue}const o=e.indexOf(">",n+3);if(o===-1)throw new Error(`bQuery router: Invalid route constraint named capture group: "${e}".`);t+="(?:",n=o;continue}t+="(";continue}t+="(?:";continue}t+=s}return t},Or=e=>{const t=Vs.get(e);if(t!==void 0)return t;const r=mu(e);return Ys(Vs,e,r),r},Js=e=>{const t=Or(e),r=Ks.get(t);if(r)return r;if(hu(t))throw new Error(`bQuery router: Route constraint contains a potentially catastrophic (ReDoS) pattern. Nested quantifiers are not allowed: "${e}".`);try{const n=new RegExp(`^(?:${t})$`);return Ys(Ks,t,n),n}catch(n){throw n instanceof SyntaxError?new Error(`bQuery router: Invalid route constraint regex "${e}": ${n.message}`):n}},nt=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"),Gs=e=>nt(e)||e!==void 0&&e>="0"&&e<="9",Xs=(e,t)=>{let r=1,n="",s=t+1,o=!1;for(;s<e.length;){const i=e[s];if(i==="\\"&&s+1<e.length){n+=i+e[s+1],s+=2;continue}if(i==="["&&!o)o=!0;else if(i==="]"&&o)o=!1;else if(!o&&i==="(")r++;else if(!o&&i===")"&&(r--,r===0))return{constraint:n,endIndex:s+1};n+=i,s++}return null},pu=(e,t)=>{const r=Xs(e,t);if(!r)throw new Error(`bQuery router: Invalid route param constraint syntax in path "${e}" at index ${t}.`);return r},Zs=new Set,eo=(e,t)=>{if(e[t]!==":"||!nt(e[t+1]))return null;let r=t+2;for(;r<e.length&&Gs(e[r]);)r++;let n=r,s;if(e[r]==="("){const o=pu(e,r);s=o.constraint,n=o.endIndex}return{name:e.slice(t+1,r),constraint:s,nextIndex:n}},vu=e=>{if(!Zs.has(e)){for(let t=0;t<e.length;){if(e[t]===":"&&nt(e[t+1])){const r=eo(e,t);r?.constraint&&Or(r.constraint),t=r?.nextIndex??t+1;continue}t++}Zs.add(e)}},yu=(e,t)=>{const r=e.indexOf("/",t);return r===-1?e.length:r},to=(e,t)=>{let r=t;for(;r<e.length&&!(e[r]==="*"||e[r]===":"&&nt(e[r+1]));)r++;return e.slice(t,r)},ro=(e,t,r,n)=>{const s=[];let o=t;for(;o<=r;){const i=e.indexOf(n,o);if(i===-1||i>r)break;s.push(i),o=i+1}return s.reverse()},gu=(e,t)=>{const r=new Map,n=(s,o)=>{const i=`${s}:${o}`;if(r.has(i))return r.get(i)??null;if(s===e.length){const u=o===t.length?{}:null;return r.set(i,u),u}const a=e[s];if(a==="*"){if(s===e.length-1){const p={};return r.set(i,p),p}const u=to(e,s+1),h=u.length>0?ro(t,o,t.length,u):null,d=(h?p=>{for(const f of h){const m=p(f);if(m)return m}return null}:p=>{for(let f=t.length;f>=o;f--){const m=p(f);if(m)return m}return null})(p=>{const f=n(s+1,p);return f?(r.set(i,f),f):null});return d||(r.set(i,null),null)}const c=eo(e,s);if(c){const u=c.constraint?Js(c.constraint):void 0,h=c.constraint?t.length:yu(t,o),d=to(e,c.nextIndex),p=d.length>0?ro(t,o,h,d):null,f=(p?m=>{for(const v of p){if(v<=o)continue;const b=m(v);if(b)return b}return null}:m=>{for(let v=h;v>o;v--){const b=m(v);if(b)return b}return null})(m=>{const v=t.slice(o,m);if(u&&!u.test(v))return null;const b=n(c.nextIndex,m);if(b){const g={[c.name]:v,...b};return r.set(i,g),g}return null});return f||(r.set(i,null),null)}if(o>=t.length||a!==t[o])return r.set(i,null),null;const l=n(s+1,o+1);return r.set(i,l),l};return n(0,0)},no=(e,t)=>{for(const r of t){vu(r.path);const n=gu(r.path,e);if(n)return{matched:r,params:n}}return null},jt=(e,t,r,n)=>{const s=no(e,n);return{path:e,params:s?.params??{},query:Qs(t),matched:s?.matched??null,hash:r.replace(/^#/,"")}},so=(e,t="")=>{const r=[];for(const n of e){const s=n.path==="*"?"*":`${t}${n.path}`.replace(/\/+/g,"/");r.push({...n,path:s}),n.children&&r.push(...so(n.children,s))}return r},bu=(e,t={})=>{const r=ke();if(!r)throw new Error("bQuery router: No router initialized.");const n=r.routes.find(o=>o.name===e);if(!n)throw new Error(`bQuery router: Route "${e}" not found.`);let s="";for(let o=0;o<n.path.length;){if(n.path[o]===":"&&nt(n.path[o+1])){let i=o+2;for(;i<n.path.length&&Gs(n.path[i]);)i++;let a=i,c=null;if(n.path[i]==="("){const h=Xs(n.path,i);if(!h)throw new Error(`bQuery router: Invalid constraint syntax in path "${n.path}" for route "${e}".`);c=h.constraint,a=h.endIndex}const l=n.path.slice(o+1,i),u=t[l];if(u===void 0)throw new Error(`bQuery router: Missing required param "${l}" for route "${e}".`);if(c&&!Js(c).test(u))throw new Error(`bQuery router: Param "${l}" with value "${u}" does not satisfy the route constraint "${c}" for route "${e}".`);s+=encodeURIComponent(u),o=a;continue}s+=n.path[o],o++}return s},wu=(e,t=!1)=>{const r=fe.value.path;return t?r===e:r.startsWith(e)},Su=(e,t=!1)=>D(()=>{const r=fe.value.path;return t?r===e:r.startsWith(e)}),Eu=100,Au=e=>{const t={};for(const[r,n]of Object.entries(e))N(r)||(t[r]=n);return t},ku=e=>{const t=ke();t&&t.destroy();const{routes:r,base:n="",hash:s=!1,scrollRestoration:o=!1}=e,i=[],a=[],c=so(r),l=new Map;let u="0",h=0,d=null;if(o&&typeof history<"u"&&"scrollRestoration"in history){d=history.scrollRestoration,history.scrollRestoration!=="manual"&&(history.scrollRestoration="manual");const E=history.state&&typeof history.state=="object"?history.state:{};if(typeof E.__bqScrollKey!="string"){const T=s?window.location.hash||"#/":`${window.location.pathname}${window.location.search}${window.location.hash}`;history.replaceState({...E,__bqScrollKey:u},"",T)}}const p=()=>history.state&&history.state.__bqScrollKey||u,f=()=>`${Date.now()}-${h++}`,m=(E=p())=>{if(o)for(l.has(E)&&l.delete(E),l.set(E,{x:window.scrollX,y:window.scrollY});l.size>Eu;){const T=l.keys().next().value;if(T===void 0)break;l.delete(T)}},v=(E=p())=>{if(!o)return;const T=l.get(E);T?window.scrollTo(T.x,T.y):window.scrollTo(0,0)},b=()=>{const E=history.state&&typeof history.state=="object"?{...history.state}:{};return o&&(E.__bqScrollKey=u),E},g=()=>{if(s){const[T,P=""]=(window.location.hash.slice(1)||"/").split("#"),[C,$=""]=T.split("?");return{pathname:C,search:$?`?${$}`:"",hash:P?`#${P}`:""}}let E=window.location.pathname;return n&&(E===n||E.startsWith(n+"/"))&&(E=E.slice(n.length)||"/"),{pathname:E,search:window.location.search,hash:window.location.hash}},w=()=>{const{pathname:E,search:T,hash:P}=g();fe.value=jt(E,T,P,c)},S=async(E,T,P=new Set)=>{Hs();try{const{pathname:C,search:$,hash:R}=g(),O=jt(C,$,R,c),I=new URL(E,window.location.origin),x=`${I.pathname}${I.search}${I.hash}`;if(P.has(x))throw new Error(`bQuery router: redirect loop detected for path "${x}"`);P.add(x);const W=jt(I.pathname,I.search,I.hash,c);if(W.matched?.redirectTo){await S(W.matched.redirectTo,T,P);return}if(W.matched?.beforeEnter&&await W.matched.beforeEnter(W,O)===!1)return;for(const St of i)if(await St(W,O)===!1)return;m();const q=o?p():void 0,V=T==="replaceState"&&q?q:f(),ve=s?`#${E}`:`${n}${E}`,He=o&&history.state&&typeof history.state=="object"?Au(history.state):{},sn=o?{...He,__bqScrollKey:V}:{};history[T](sn,"",ve),u=V,w(),o&&T==="pushState"&&window.scrollTo(0,0);for(const St of a)St(fe.value,O)}finally{Ws()}},k=async E=>{Hs();try{const{pathname:T,search:P,hash:C}=g(),$=fe.value,R=jt(T,P,C,c);if(R.matched?.redirectTo){await S(R.matched.redirectTo,"replaceState");return}if(R.matched?.beforeEnter&&await R.matched.beforeEnter(R,$)===!1){const O=new URLSearchParams(Object.entries($.query).flatMap(([q,V])=>Array.isArray(V)?V.map(ve=>[q,ve]):[[q,V]])).toString(),I=O?`?${O}`:"",x=$.hash?`#${$.hash}`:"",W=s?`#${$.path}${I}${x}`:`${n}${$.path}${I}${x}`;history.replaceState(b(),"",W);return}for(const O of i)if(await O(R,$)===!1){const I=new URLSearchParams(Object.entries($.query).flatMap(([V,ve])=>Array.isArray(ve)?ve.map(He=>[V,He]):[[V,ve]])).toString(),x=I?`?${I}`:"",W=$.hash?`#${$.hash}`:"",q=s?`#${$.path}${x}${W}`:`${n}${$.path}${x}${W}`;history.replaceState(b(),"",q);return}m(u),u=E.state?.__bqScrollKey??p(),w(),v(u);for(const O of a)O(fe.value,$)}finally{Ws()}};window.addEventListener("popstate",k),w();const A={push:E=>S(E,"pushState"),replace:E=>S(E,"replaceState"),back:()=>history.back(),forward:()=>history.forward(),go:E=>history.go(E),beforeEach:E=>(i.push(E),()=>{const T=i.indexOf(E);T>-1&&i.splice(T,1)}),afterEach:E=>(a.push(E),()=>{const T=a.indexOf(E);T>-1&&a.splice(T,1)}),currentRoute:js,routes:c,base:n,hash:s,destroy:()=>{window.removeEventListener("popstate",k),i.length=0,a.length=0,l.clear(),d!==null&&typeof history<"u"&&"scrollRestoration"in history&&(history.scrollRestoration=d),nu(),Fs(null)}};return Fs(A),A},_e=D(()=>fe.value),Tu={route:_e,path:D(()=>_e.value.path),params:D(()=>_e.value.params),query:D(()=>_e.value.query),hash:D(()=>_e.value.hash),matched:D(()=>_e.value.matched)},Ru=()=>Tu,Cu=()=>{if(!(typeof window>"u"))return window.__BQUERY_DEVTOOLS__||(window.__BQUERY_DEVTOOLS__={stores:new Map}),window.__BQUERY_DEVTOOLS__},$u=(e,t)=>{const r=Cu();r&&(r.stores.set(e,t),r.onStoreCreated?.(e,t))},Ou=e=>{typeof window>"u"||!window.__BQUERY_DEVTOOLS__||window.__BQUERY_DEVTOOLS__.stores.delete(e)},Lu=(e,t)=>{typeof window>"u"||window.__BQUERY_DEVTOOLS__?.onStateChange?.(e,t)},oo=[],Pu=e=>{oo.push(e)},Nu=(e,t)=>{for(const r of oo){const n=r({store:e,options:t});n&&Object.assign(e,n)}},st=new Map,io=e=>st.has(e),Iu=(e,t)=>{st.set(e,t)},we=e=>st.get(e),Ht=()=>Array.from(st.keys()),Mu=e=>{st.delete(e),Ou(e)},ao=e=>e!==null&&typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype,Te=e=>{if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Te);if(e instanceof Date)return new Date(e.getTime());if(e instanceof Map)return new Map(Array.from(e.entries()).map(([r,n])=>[r,Te(n)]));if(e instanceof Set)return new Set(Array.from(e).map(Te));const t={};for(const r of Object.keys(e))t[r]=Te(e[r]);return t},xe=(e,t)=>{if(e===t)return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,o]of e.entries())if(!t.has(s)||!xe(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e.values()){let o=!1;for(const i of t.values())if(xe(s,i)){o=!0;break}if(!o)return!1}return!0}if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((s,o)=>xe(s,t[o]));if(Array.isArray(e)!==Array.isArray(t))return!1;const r=Object.keys(e),n=Object.keys(t);return r.length!==n.length?!1:r.every(s=>xe(e[s],t[s]))},Du=(e,t,r)=>{const n=[];for(const s of Object.keys(t)){const o=e[s],i=t[s];r.get(s)===i&&ao(o)&&ao(i)&&!xe(o,i)&&n.push(s)}return n},ot=()=>xt(),Lr=e=>{const{id:t,state:r,getters:n={},actions:s={}}=e;if(io(t))return console.warn(`bQuery store: Store "${t}" already exists. Returning existing instance.`),we(t);const o=r(),i=new Map;for(const g of Object.keys(o))i.set(g,L(o[g]));const a=[],c=[],l=(g,w,S)=>{!ot()||typeof console>"u"||typeof console.error!="function"||console.error(`[bQuery store "${t}"] Error in $onAction ${g} for action "${w}"`,S)},u=new WeakSet,h=(g,w)=>{!ot()||typeof console>"u"||typeof console.warn!="function"||u.has(g)||(u.add(g),console.warn(`[bQuery store "${t}"] Async $onAction listener detected for action "${w}". If it awaits, register after()/onError() before the first await; late registrations will not affect the current action.`))},d=(g,w,S,k)=>{try{const A=S();We(A)&&(g==="listener"&&k&&h(k,w),A.catch(E=>{l(g,w,E)}))}catch(A){l(g,w,A)}},p=()=>Ee(()=>({...m})),f=()=>{const g=typeof window<"u"&&typeof window.__BQUERY_DEVTOOLS__?.onStateChange=="function";if(a.length===0&&!g)return;const w=p();for(const S of a)S(w);Lu(t,w)},m=new Proxy({},{get:(g,w)=>{const S=w;if(i.has(S))return i.get(S).value},ownKeys:()=>Array.from(i.keys()),getOwnPropertyDescriptor:(g,w)=>{if(i.has(w))return{enumerable:!0,configurable:!0}},has:(g,w)=>i.has(w)}),v=new Map,b={};for(const g of Object.keys(o))Object.defineProperty(b,g,{get:()=>i.get(g).value,set:w=>{i.get(g).value=w,f()},enumerable:!0,configurable:!1});for(const g of Object.keys(n)){const w=n[g],S=D(()=>w(m,new Proxy({},{get:(k,A)=>{const E=A;if(v.has(E))return v.get(E).value}})));v.set(g,S),Object.defineProperty(b,g,{get:()=>S.value,enumerable:!0,configurable:!1})}for(const g of Object.keys(s)){const w=s[g],S=g;b[S]=function(...k){const A=new Proxy(b,{get:(R,O)=>typeof O=="string"&&i.has(O)?i.get(O).value:R[O],set:(R,O,I)=>typeof O=="string"&&i.has(O)?(i.get(O).value=I,f(),!0):Reflect.set(R,O,I)});if(c.length===0)return w.apply(A,k);const E=[],T=[],P=[...c],C={name:S,store:b,args:k,after:R=>{E.push(O=>R(O))},onError:R=>{T.push(R)}};for(const R of P)d("listener",S,()=>R(C),R);let $;try{$=w.apply(A,k)}catch(R){for(const O of T)d("onError",S,()=>O(R));throw R}if(We($))return $.then(R=>{for(const O of E)d("after",S,()=>O(R));return R},R=>{for(const O of T)d("onError",S,()=>O(R));throw R});for(const R of E)d("after",S,()=>R($));return $}}return Object.defineProperties(b,{$id:{value:t,writable:!1,enumerable:!1},$reset:{value:()=>{const g=r();Se(()=>{for(const[w,S]of i)S.value=g[w]}),f()},writable:!1,enumerable:!1},$subscribe:{value:g=>(a.push(g),()=>{const w=a.indexOf(g);w>-1&&a.splice(w,1)}),writable:!1,enumerable:!1},$onAction:{value:g=>(c.push(g),()=>{const w=c.indexOf(g);w>-1&&c.splice(w,1)}),writable:!1,enumerable:!1},$patch:{value:g=>{Se(()=>{if(typeof g=="function"){const w=ot(),S=w?Te(p()):null,k=w?new Map(Array.from(i.entries()).map(([E,T])=>[E,T.value])):null,A=p();if(g(A),w&&S&&k){const E=Du(S,A,k);E.length>0&&console.warn(`[bQuery store "${t}"] Nested mutation detected in $patch() for keys: ${E.map(String).join(", ")}.
255
255
  Nested object mutations do not trigger reactive updates because the store uses shallow reactivity.
256
256
  To fix this, either:
257
257
  1. Replace the entire object: state.user = { ...state.user, name: "New" }
258
258
  2. Use $patchDeep() for automatic deep cloning
259
- See: https://bquery.dev/guide/store#deep-reactivity`)}for(const[S,T]of Object.entries(A))i.has(S)&&(i.get(S).value=T)}else for(const[w,E]of Object.entries(y))i.has(w)&&(i.get(w).value=E)}),u()},writable:!1,enumerable:!1},$patchDeep:{value:y=>{ce(()=>{if(typeof y=="function"){const w=me(p());y(w);for(const[E,k]of Object.entries(w))i.has(E)&&(i.get(E).value=k)}else for(const[w,E]of Object.entries(y))i.has(w)&&(i.get(w).value=me(E))}),u()},writable:!1,enumerable:!1},$state:{get:()=>p(),enumerable:!1}}),Yl(t,b),Kl(b,e),Wl(t,b),b},Xl=(e,t)=>()=>rs(e)?Te(e):Vt({id:e,...t}),Zl=(e,t)=>{const r={};for(const n of t)Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0});return r},ec=(e,t)=>{const r={};for(const n of t)Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0});return r},tc=(e,t)=>{const r={};for(const n of t)r[n]=(...s)=>e[n](...s);return r},rc="__version",nc={serialize:e=>JSON.stringify(e),deserialize:e=>JSON.parse(e)},ss=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null},sc=(e,t)=>{const r={...e};for(const[n,s]of Object.entries(t))x(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=s);return r},oc=()=>{try{return globalThis.localStorage}catch{return}},ic=(e,t)=>{const r=typeof t=="string"?{key:t}:t??{},n=r.key??`bquery-store-${e.id}`,s=r.storage??oc(),o=r.serializer??nc,i=r.version,a=r.migrate,l=n+rc;let c=s!==void 0&&i!==void 0,f=!1,m=!1;const d=h=>{if(!s||i===void 0)return!1;try{return s.setItem(l,String(i)),!0}catch(v){return h&&Qe()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(h,v),!1}},p=e.state,u=Vt({...e,state:()=>{const h=p();if(!s)return h;try{const v=s.getItem(n);if(!v)return h;const b=o.deserialize(v);if(!ss(b))return h;let y=b;if(i!==void 0&&a){const w=s.getItem(l),E=w!==null?Number(w):0,k=Number.isFinite(E)?E:0;if(k!==i){c=!1,f=!0;const A=a(y,k);if(!ss(A))return h;y=A;let S=!1;try{s.setItem(n,o.serialize(y)),S=!0,m=!0}catch(T){Qe()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery store "${e.id}"] Failed to persist migrated state:`,T)}S&&d(`[bQuery store "${e.id}"] Failed to persist migrated version:`)&&(f=!1)}else c=!1}return sc(h,y)}catch{return h}}});return c&&s?d():f&&m&&d(`[bQuery store "${e.id}"] Failed to persist migrated version after store creation:`)&&(f=!1),u.$subscribe(h=>{if(s)try{s.setItem(n,o.serialize(h)),f&&d(`[bQuery store "${e.id}"] Failed to persist migrated version after a successful state write:`)&&(f=!1)}catch{}}),u},ac=(e,t,r,n={})=>{const s=n.equals??(n.deep?Ce:Object.is);let o=t(e.$state);return n.immediate&&r(o,void 0),e.$subscribe(i=>{const a=t(i);if(!s(a,o)){const l=o;o=a,r(a,l)}})},os=500,is=class{constructor(e){this.cache=new Map,this.maxSize=e}get(e){const t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){const r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}get size(){return this.cache.size}},as=new is(os),ls=new is(os),lc=e=>new Proxy(e,{get(t,r){if(typeof r!="string")return Reflect.get(t,r);const n=t[r];return fe(n)||qe(n)?n.value:n},has(t,r){return typeof r!="string"?Reflect.has(t,r):r in t}}),H=(e,t)=>{try{const r=lc(t);let n=as.get(e);return n||(n=new Function("$ctx",`with($ctx) { return (${e}); }`),as.set(e,n)),n(r)}catch(r){console.error(`bQuery view: Error evaluating "${e}"`,r);return}},bt=(e,t)=>{try{let r=ls.get(e);return r||(r=new Function("$ctx",`with($ctx) { return (${e}); }`),ls.set(e,r)),r(t)}catch(r){console.error(`bQuery view: Error evaluating "${e}"`,r);return}},Kt=e=>{const t={},r=e.trim().replace(/^\{|\}$/g,"").trim();if(!r)return t;const n=[];let s="",o=0,i=null;for(let a=0;a<r.length;a++){const l=r[a];if(l==='"'||l==="'"||l==="`"){let c=0,f=a-1;for(;f>=0&&r[f]==="\\";)c++,f--;c%2===0&&(i===null?i=l:i===l&&(i=null)),s+=l;continue}if(i!==null){s+=l;continue}l==="("||l==="["||l==="{"?(o++,s+=l):l===")"||l==="]"||l==="}"?(o--,s+=l):l===","&&o===0?(n.push(s.trim()),s=""):s+=l}s.trim()&&n.push(s.trim());for(const a of n){let l=-1,c=0,f=null;for(let m=0;m<a.length;m++){const d=a[m];if(d==='"'||d==="'"||d==="`"){let p=0,u=m-1;for(;u>=0&&a[u]==="\\";)p++,u--;p%2===0&&(f===null?f=d:f===d&&(f=null));continue}if(f===null){if(d==="("||d==="["||d==="{")c++;else if(d===")"||d==="]"||d==="}")c--;else if(d===":"&&c===0){l=m;break}}}if(l>-1){const m=a.slice(0,l).trim().replace(/^['"]|['"]$/g,"");if(x(m))continue;t[m]=a.slice(l+1).trim()}}return t},cc=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase(),uc=e=>{const t=e.trim(),r=t.toLowerCase();return r.startsWith("aria-")?r:`aria-${cc(/^aria[A-Z]/.test(t)?t.slice(4):t).replace(/^-/,"")}`},fc=e=>e==null||e==="",dc=(e,t,r,n)=>{let s=new Set;const o=j(()=>{const i=new Set,a=Object.create(null);if(t.trimStart().startsWith("{")){const l=Kt(t);for(const[c,f]of Object.entries(l))a[c]=H(f,r)}else{const l=H(t,r);if(l&&typeof l=="object"&&!Array.isArray(l))for(const[c,f]of Object.entries(l))x(c)||(a[c]=f)}for(const[l,c]of Object.entries(a)){const f=uc(l);if(fc(c)){e.removeAttribute(f);continue}e.setAttribute(f,c===!0?"true":String(c)),i.add(f)}for(const l of s)i.has(l)||e.removeAttribute(l);s=i});n.push(o)},hc=e=>(t,r,n,s)=>{const o=j(()=>{const i=H(r,n);i==null||i===!1?t.removeAttribute(e):i===!0?t.setAttribute(e,""):t.setAttribute(e,String(i))});s.push(o)},mc=(e,t,r,n)=>{let s=new Set;const o=j(()=>{const i=new Set;if(t.trimStart().startsWith("{")){const a=Kt(t);for(const[l,c]of Object.entries(a)){const f=H(c,r);e.classList.toggle(l,!!f),i.add(l)}}else if(/^\s*\[/.test(t)){const a=H(t,r);if(Array.isArray(a))for(const l of a)l&&(e.classList.add(l),i.add(l))}else{const a=H(t,r);typeof a=="string"?a.split(/\s+/).forEach(l=>{l&&(e.classList.add(l),i.add(l))}):Array.isArray(a)&&a.forEach(l=>{l&&(e.classList.add(l),i.add(l))})}for(const a of s)i.has(a)||e.classList.remove(a);s=i});n.push(o)},pc=e=>{if(fe(e)||qe(e))return String(e.value??"");if(e&&typeof e=="object"&&"error"in e){const t=e.error;return fe(t)||qe(t)?String(t.value??""):String(t??"")}return String(e??"")},vc=(e,t,r,n)=>{const s=e,o=!s.hasAttribute("aria-hidden");s.hasAttribute("role")||s.setAttribute("role","alert"),s.hasAttribute("aria-live")||s.setAttribute("aria-live","assertive");const i=j(()=>{const a=pc(H(t,r)).trim(),l=a.length>0;s.textContent=a,s.hidden=!l,o&&(l?s.removeAttribute("aria-hidden"):s.setAttribute("aria-hidden","true"))});n.push(i)},yc=(e,t,r,n,s,o)=>{if(!r)return t;const i={...o,[n]:e};return s&&(i[s]=t),H(r,i)},gc=e=>{const{prefix:t,processElement:r,processChildren:n}=e;return(s,o,i,a)=>{const l=s.parentNode;if(!l)return;const c=o.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);if(!c){console.error(`bQuery view: Invalid bq-for expression "${o}"`);return}const[,f,m,d]=c,p=s.getAttribute(":key")||s.getAttribute(`${t}-key`),u=s.cloneNode(!0);u.removeAttribute(`${t}-for`),u.removeAttribute(":key"),u.removeAttribute(`${t}-key`);const h=document.createComment(`bq-for: ${o}`);l.replaceChild(h,s);let v=new Map,b=[];const y=(A,S,T)=>{const P=u.cloneNode(!0),R=[],O=$(A),C=m?$(S):null,L={...i,[f]:O};return m&&C&&(L[m]=C),r(P,L,t,R),n(P,L,t,R),{key:T,element:P,cleanups:R,item:A,index:S,itemSignal:O,indexSignal:C}},w=A=>{for(const S of A.cleanups)S();A.element.remove()},E=(A,S,T)=>{Object.is(A.item,S)||(A.item=S,A.itemSignal.value=S),A.index!==T&&(A.index=T,A.indexSignal&&(A.indexSignal.value=T))},k=j(()=>{const A=H(d,i);if(!Array.isArray(A)){for(const L of v.values())w(L);v.clear(),b=[];return}const S=[],T=new Map,P=new Set;A.forEach((L,M)=>{let _=yc(L,M,p,f,m,i);P.has(_)&&(console.warn(`bq-for: Duplicate key "${String(_)}" detected at index ${M}. Falling back to index-based key for this item. Ensure :key expressions produce unique values for each item.`),_={__bqDuplicateKey:_,__bqIndex:M}),P.add(_),S.push(_),T.set(_,{item:L,index:M})});const R=[];for(const L of b)T.has(L)||R.push(L);for(const L of R){const M=v.get(L);M&&(w(M),v.delete(L))}const O=new Map;let C=h;for(let L=0;L<S.length;L++){const M=S[L],{item:_,index:U}=T.get(M);let q=v.get(M);q?(E(q,_,U),O.set(M,q),C.nextSibling!==q.element&&C.after(q.element),C=q.element):(q=y(_,U,M),O.set(M,q),C.after(q.element),C=q.element)}v=O,b=S});a.push(()=>{k();for(const A of v.values())for(const S of A.cleanups)S();v.clear()})}},bc=e=>(t,r,n,s)=>{const o=j(()=>{const i=H(r,n),a=String(i??"");t.innerHTML=e?X(a):a});s.push(o)},wc=(e,t,r,n)=>{const s=document.createComment(`bq-if: ${t}`);let o=!0;const i=j(()=>{const a=H(t,r);a&&!o?(s.replaceWith(e),o=!0):!a&&o&&(e.replaceWith(s),o=!1)});n.push(i)},Ec=(e,t,r,n)=>{const s=e,o=bt(t,r);if(!fe(o)){console.warn(`bQuery view: bq-model requires a signal, got "${t}"`);return}const i=o,a=s.type==="checkbox",l=s.type==="radio",c=()=>{a?s.checked=!!i.value:l?s.checked=i.value===s.value:s.value=String(i.value??"")},f=j(()=>{c()});n.push(f);const m=s.tagName==="SELECT"?"change":"input",d=()=>{a?i.value=s.checked:l?s.checked&&(i.value=s.value):i.value=s.value};s.addEventListener(m,d),n.push(()=>s.removeEventListener(m,d))},Sc=e=>(t,r,n,s)=>{const o=i=>{const a={...n,$event:i,$el:t};if(!r.includes("(")){const l=bt(r,a);if(typeof l=="function"){l(i);return}return}bt(r,a)};t.addEventListener(e,o),s.push(()=>t.removeEventListener(e,o))};function Ac(e){const t=Object.getOwnPropertyDescriptor(e,"value");return t?"value"in t?t.writable===!0:typeof t.set=="function":!1}var kc=(e,t,r,n)=>{const s=bt(t,r);fe(s)?(s.value=e,n.push(()=>{s.value=null})):typeof s=="object"&&s!==null&&Ac(s)&&(s.value=e,n.push(()=>{s.value=null}))},Tc=(e,t,r,n)=>{const s=e;let o=s.style.display;if(!o||o==="none"){const a=s.ownerDocument.defaultView?.getComputedStyle(s).display??"";o=a!=="none"?a:""}const i=j(()=>{const a=H(t,r);s.style.display=a?o:"none"});n.push(i)},Cc=(e,t,r,n)=>{const s=e;let o=new Set;const i=j(()=>{const a=new Set;if(t.trimStart().startsWith("{")){const l=Kt(t);for(const[c,f]of Object.entries(l)){const m=H(f,r),d=c.replace(/([A-Z])/g,"-$1").toLowerCase();s.style.setProperty(d,String(m??"")),a.add(d)}}else{const l=H(t,r);if(l&&typeof l=="object")for(const[c,f]of Object.entries(l)){const m=c.replace(/([A-Z])/g,"-$1").toLowerCase();s.style.setProperty(m,String(f??"")),a.add(m)}}for(const l of o)a.has(l)||s.style.removeProperty(l);o=a});n.push(i)},Rc=(e,t,r,n)=>{const s=j(()=>{const o=H(t,r);e.textContent=String(o??"")});n.push(s)},Yt=null,Oc=e=>{Yt=e},Lc=e=>Yt?Yt(e):void 0,wt=(e,t,r,n,s)=>{const o=Array.from(e.attributes);for(const i of o){const{name:a,value:l}=i;if(!a.startsWith(`${r}-`))continue;const c=a.slice(r.length+1);if(c==="for"){s.for(e,l,t,n);return}if(c==="text")s.text(e,l,t,n);else if(c==="error")s.error(e,l,t,n);else if(c==="aria")s.aria(e,l,t,n);else if(c==="html")s.html(e,l,t,n);else if(c==="if")s.if(e,l,t,n);else if(c==="show")s.show(e,l,t,n);else if(c==="class")s.class(e,l,t,n);else if(c==="style")s.style(e,l,t,n);else if(c==="model")s.model(e,l,t,n);else if(c==="ref")s.ref(e,l,t,n);else if(c.startsWith("bind:")){const f=c.slice(5);s.bind(f)(e,l,t,n)}else if(c.startsWith("on:")){const f=c.slice(3);s.on(f)(e,l,t,n)}else{const f=Lc(c);f?f(e,l,t,n):qt()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery][view] Unknown directive "${a}" (parsed as "${c}") on <${e.tagName.toLowerCase()}>. This may be a typo or a missing custom directive registration.`)}}},Gt=(e,t,r,n,s)=>{const o=Array.from(e.children);for(const i of o)i.hasAttribute(`${r}-for`)?wt(i,t,r,n,s):(wt(i,t,r,n,s),Gt(i,t,r,n,s))},Jt=(e,t,r={})=>{const{prefix:n="bq",sanitize:s=!0}=r,o=typeof e=="string"?document.querySelector(e):e;if(!o)throw new Error(`bQuery view: Element "${e}" not found.`);if(o.hasAttribute(`${n}-for`))throw new Error(`bQuery view: Cannot mount on element with ${n}-for directive. Wrap the ${n}-for element in a container instead.`);const i=[],a={text:Rc,error:vc,aria:dc,html:bc(s),if:wc,show:Tc,class:mc,style:Cc,model:Ec,ref:kc,for:gc({prefix:n,processElement:(c,f,m,d)=>wt(c,f,m,d,a),processChildren:(c,f,m,d)=>Gt(c,f,m,d,a)}),bind:hc,on:Sc};return((c,f,m)=>{const d=c.hasAttribute(`${n}-for`);wt(c,f,n,m,a),d||Gt(c,f,n,m,a)})(o,t,i),{el:o,context:t,update:c=>{Object.assign(t,c)},destroy:()=>{for(const c of i)c();i.length=0}}},$c=(e,t={})=>r=>{const n=document.createElement("div");n.innerHTML=e.trim();const s=n.firstElementChild;if(!s)throw new Error("bQuery view: Template must contain a single root element.");if(n.childElementCount>1)throw new Error(`bQuery view: Template must contain exactly one root element, found ${n.childElementCount}.`);const{prefix:o="bq"}=t;if(s.hasAttribute(`${o}-for`)||s.hasAttribute(`${o}-if`)){const i=s.hasAttribute(`${o}-for`)?"for":"if";throw new Error(`bQuery view: Template root element cannot have ${o}-${i} directive. Wrap the ${o}-${i} element in a container instead.`)}return Jt(s,r,t)},Pc=e=>e===!0||e===void 0,Mc=async(e,t)=>{const r=e(t),n=Le(r)?await r:r;return Pc(n)?void 0:n},Nc=e=>{const t=e.initialValue,r=$(t),n=$(""),s=$(!1),o=D(()=>!Object.is(r.value,t));return{value:r,error:n,isDirty:o,isTouched:s,isPristine:D(()=>!o.value),touch:()=>{s.value=!0},reset:()=>{r.value=t,n.value="",s.value=!1}}},cs=async(e,t)=>{if(!t||t.length===0)return e.error.value="","";for(const r of t){const n=await Mc(r,e.value.value);if(n)return e.error.value=n,n}return e.error.value="",""},Dc=e=>{const t=Object.entries(e.fields),r={},n={};for(const[u,h]of t){const v=Nc(h);r[u]=v,n[u]=v.error}const s=$(!1),o=D(()=>{for(const u of Object.keys(r))if(r[u].error.value!=="")return!1;return!0}),i=D(()=>{for(const u of Object.keys(r))if(r[u].isDirty.value)return!0;return!1}),a=async u=>{const h=r[u],v=e.fields[u];!h||!v||await cs(h,v.validators)},l=async()=>{let u=!1;for(const[h,v]of t){const b=r[h];await cs(b,v.validators)&&(u=!0)}if(e.crossValidators&&e.crossValidators.length>0){const h=m();for(const v of e.crossValidators){const b=await v(h);if(b){for(const[y,w]of Object.entries(b))if(w){const E=r[y];E&&(E.error.value===""&&(E.error.value=w),u=!0)}}}}return!u},c=async()=>{if(!s.value){s.value=!0;try{if(!await l())return;e.onSubmit&&await e.onSubmit(m())}finally{s.value=!1}}},f=()=>{for(const u of Object.keys(r))r[u].reset()},m=()=>{const u={};for(const h of Object.keys(r))u[h]=r[h].value.value;return u};return{fields:r,errors:n,isValid:o,isDirty:i,isSubmitting:s,handleSubmit:c,validateField:a,validate:l,reset:f,getValues:m,setValues:u=>{for(const[h,v]of Object.entries(u)){if(x(h)||!Object.prototype.hasOwnProperty.call(r,h))continue;const b=r[h];b&&(b.value.value=v)}},setErrors:u=>{for(const[h,v]of Object.entries(u)){if(x(h)||!Object.prototype.hasOwnProperty.call(r,h))continue;const b=r[h];b&&(b.error.value=v??"")}}}},Ic=e=>e===!0||e===void 0,_c=async(e,t)=>{const r=e(t),n=Le(r)?await r:r;return Ic(n)?void 0:n},qc=(e,t={})=>{let r;zc(e)?r=e:r=$(jr(e)||xc(e)?e.peek():e);const n=r.peek(),s=$(t.initialError??""),o=$(!1),i=$(!1),a=D(()=>!Object.is(r.value,n)),l=D(()=>!a.value),c=D(()=>s.value===""),f=t.validateOn??"manual",m=Math.max(0,t.debounceMs??0);let d=0,p=!1,u=!1,h=!1,v;const b=A=>{console.error("bQuery forms: Error in scheduled field validation",A)},y=async()=>{const A=++d,S=t.validators;if(!S||S.length===0)return s.value="",i.value=!1,!0;i.value=!0;try{const T=r.peek();for(const P of S){const R=await _c(P,T);if(A!==d)return s.peek()==="";if(R)return s.value=R,!1}return A===d&&(s.value=""),!0}finally{A===d&&(i.value=!1)}},w=Tt(()=>{y().catch(b)},m),E=()=>{if(!h){if(m>0){w();return}y().catch(b)}};return(f==="change"||f==="both")&&(v=j(()=>{if(r.value,!p){p=!0;return}if(u){u=!1;return}E()})),{value:r,error:s,isDirty:a,isTouched:o,isPristine:l,isValid:c,isValidating:i,touch:()=>{o.value=!0,(f==="blur"||f==="both")&&E()},reset:()=>{d+=1,w.cancel(),Object.is(r.peek(),n)||(u=!0),r.value=n,s.value=t.initialError??"",o.value=!1,i.value=!1},validate:async()=>(w.cancel(),y()),destroy:()=>{h||(h=!0,d+=1,w.cancel(),v?.(),v=void 0,a.dispose(),l.dispose(),c.dispose(),i.value=!1)}}},zc=e=>e instanceof _e,xc=e=>e instanceof Ie,jc=(e="This field is required")=>t=>t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0?e:!0,Fc=(e,t)=>{const r=t??`Must be at least ${e} characters`;return n=>(typeof n=="string"?n:String(n??"")).length>=e?!0:r},Uc=(e,t)=>{const r=t??`Must be at most ${e} characters`;return n=>(typeof n=="string"?n:String(n??"")).length<=e?!0:r},Bc=(e,t="Invalid format")=>{const r=e.global||e.sticky?new RegExp(e.source,e.flags.replace(/[gy]/g,"")):e;return n=>{const s=typeof n=="string"?n:String(n??"");return r.lastIndex=0,r.test(s)?!0:t}},Wc=(e="Invalid email address")=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return r=>{const n=typeof r=="string"?r:String(r??"");return n===""||t.test(n)?!0:e}},Hc=(e="Invalid URL")=>t=>{const r=typeof t=="string"?t:String(t??"");if(r==="")return!0;try{return new URL(r),!0}catch{return e}},Qc=(e,t)=>{const r=t??`Must be at least ${e}`;return n=>n==null||typeof n=="string"&&n.trim()===""||(typeof n=="number"?n:Number(n))>=e?!0:r},Vc=(e,t)=>{const r=t??`Must be at most ${e}`;return n=>n==null||typeof n=="string"&&n.trim()===""||(typeof n=="number"?n:Number(n))<=e?!0:r},Kc=(e,t)=>r=>e(r)?!0:t,Yc=(e,t)=>async r=>await e(r)?!0:t,Gc=(e,t="Fields do not match")=>r=>Object.is(r,e.value)?!0:t,us=(e,t,r)=>{const{locale:n,...s}=r??{};try{return new Intl.NumberFormat(t,s).format(e)}catch{return String(e)}},fs=(e,t,r)=>{const{locale:n,...s}=r??{},o=typeof e=="number"?new Date(e):e;try{return new Intl.DateTimeFormat(t,s).format(o)}catch{return o.toLocaleString()}},ds=(e,t)=>{const r=t.split(".");let n=e;for(const s of r){if(typeof n=="string"||n[s]===void 0)return;n=n[s]}return typeof n=="string"?n:void 0},Jc=(e,t)=>e.replace(/\{(\w+)\}/g,(r,n)=>n in t?String(t[n]):r),Xc=(e,t)=>{if(!e.includes("|")||!("count"in t))return e;const r=Number(t.count),n=e.split("|").map(s=>s.trim());return n.length===3?r===0?n[0]:r===1?n[1]:n[2]:n.length===2?r===1?n[0]:n[1]:r===0&&n.length>0?n[0]:r===1&&n.length>1?n[1]:n[n.length-1]},hs=(e,t,r,n)=>{let s;return e&&(s=ds(e,t)),s===void 0&&n&&(s=ds(n,t)),s===void 0?t:Jc(Xc(s,r),r)},ms=(e,t)=>{const r=ge(e,t),n=s=>{if(Array.isArray(s))return s.map(i=>n(i));if(!ye(s))return s;const o=Object.create(null);for(const[i,a]of Object.entries(s))x(i)||(o[i]=n(a));return o};return n(r)},Zc=e=>{const{locale:t,messages:r,fallbackLocale:n}=e,s=y=>ms(Object.create(null),y),o=Object.create(null);for(const[y,w]of Object.entries(r))x(y)||(o[y]=s(w));const i=$(t),a=new Map,l=new Set(Object.keys(o));return{$locale:i,t:(y,w={})=>{const E=o[i.value];return hs(E,y,w,n?o[n]:void 0)},tc:(y,w={})=>D(()=>{const E=o[i.value];return hs(E,y,w,n?o[n]:void 0)}),loadLocale:(y,w)=>{x(y)||a.set(y,w)},ensureLocale:async y=>{if(x(y)||l.has(y))return;const w=a.get(y);if(!w)throw new Error(`bQuery i18n: No messages or loader registered for locale "${y}".`);const E=await w();o[y]=s(E.default??E),l.add(y)},n:(y,w)=>us(y,w?.locale??i.value,w),d:(y,w)=>fs(y,w?.locale??i.value,w),getMessages:y=>{if(!x(y))return o[y]},mergeMessages:(y,w)=>{x(y)||(o[y]||(o[y]=Object.create(null),l.add(y)),o[y]=ms(o[y],s(w)))},availableLocales:()=>{const y=new Set([...l,...a.keys()]);return Array.from(y).sort()}}},Et=new Map,Ve=new Map,eu=50,tu=e=>{const t=Et.get(e);if(t&&t.isConnected)return t;const r=document.createElement("div");return r.setAttribute("aria-live",e),r.setAttribute("aria-atomic","true"),r.setAttribute("role",e==="assertive"?"alert":"status"),Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(r),Et.set(e,r),r},ru=(e,t="polite")=>{if(!e||typeof document>"u"||!document.body)return;const r=tu(t),n=Ve.get(t);n!==void 0&&clearTimeout(n),r.textContent="";const s=setTimeout(()=>{Ve.delete(t),r.isConnected&&(r.textContent=e)},eu);Ve.set(t,s)},nu=()=>{for(const e of Ve.values())clearTimeout(e);Ve.clear();for(const[,e]of Et)e.remove();Et.clear()},Y=(e,t,r,n)=>({severity:e,message:t,element:r,rule:n}),su=e=>{const t=[],r=e.querySelectorAll("img");for(const n of r)n.hasAttribute("alt")?n.getAttribute("alt")===""&&!n.hasAttribute("role")&&t.push(Y("info",'Image has empty alt text. Consider adding role="presentation" if decorative.',n,"img-decorative")):t.push(Y("error",'Image is missing an alt attribute. Add alt="" for decorative images or a descriptive alt text.',n,"img-alt"));return t},ou=e=>{const t=[],r=e.querySelectorAll("input, select, textarea");for(const n of r){const s=n.getAttribute("type");if(s==="hidden"||s==="submit"||s==="button"||s==="reset")continue;const o=n.getAttribute("id"),i=o?!!e.querySelector(`label[for="${o}"]`):!1,a=n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby"),l=n.hasAttribute("title"),c=n.closest("label")!==null;!i&&!a&&!l&&!c&&t.push(Y("error",'Form input is missing a label. Add a <label for="id">, aria-label, or aria-labelledby attribute.',n,"input-label"))}return t},iu=e=>{const t=[],r=e.querySelectorAll("button");for(const s of r){const o=(s.textContent??"").trim().length>0,i=s.hasAttribute("aria-label")||s.hasAttribute("aria-labelledby"),a=s.hasAttribute("title");!o&&!i&&!a&&t.push(Y("error","Button has no accessible name. Add text content, aria-label, or title.",s,"button-name"))}const n=e.querySelectorAll("a[href]");for(const s of n){const o=(s.textContent??"").trim().length>0,i=s.hasAttribute("aria-label")||s.hasAttribute("aria-labelledby"),a=s.hasAttribute("title"),l=s.querySelector("img[alt]")!==null;!o&&!i&&!a&&!l&&t.push(Y("error","Link has no accessible name. Add text content, aria-label, or title.",s,"link-name"))}return t},au=e=>{const t=[],r=e.querySelectorAll("h1, h2, h3, h4, h5, h6");let n=0;for(const s of r){const o=parseInt(s.tagName.charAt(1),10);n>0&&o>n+1&&t.push(Y("warning",`Heading level skipped: <${s.tagName.toLowerCase()}> follows <h${n}>. Don't skip heading levels.`,s,"heading-order")),(s.textContent??"").trim().length===0&&t.push(Y("warning","Heading element is empty.",s,"heading-empty")),n=o}return t},lu=e=>{const t=[],r=e.querySelectorAll("[aria-labelledby]");for(const s of r){const o=(s.getAttribute("aria-labelledby")??"").split(/\s+/);for(const i of o)i&&!document.getElementById(i)&&t.push(Y("error",`aria-labelledby references "${i}" which does not exist in the document.`,s,"aria-labelledby-ref"))}const n=e.querySelectorAll("[aria-describedby]");for(const s of n){const o=(s.getAttribute("aria-describedby")??"").split(/\s+/);for(const i of o)i&&!document.getElementById(i)&&t.push(Y("error",`aria-describedby references "${i}" which does not exist in the document.`,s,"aria-describedby-ref"))}return t},cu=e=>{const t=[];return(e===document.body||e===document.documentElement)&&(e.querySelector("main")||e.querySelector('[role="main"]')||t.push(Y("warning",'Page is missing a <main> landmark. Add <main> or role="main" to the primary content area.',e,"landmark-main"))),t},uu=e=>{if(typeof document>"u"||!document.body)return{findings:[],errors:0,warnings:0,passed:!0};const t=e??document.body,r=[...su(t),...ou(t),...iu(t),...au(t),...lu(t),...cu(t)],n=r.filter(s=>s.severity==="error").length;return{findings:r,errors:n,warnings:r.filter(s=>s.severity==="warning").length,passed:n===0}},ps=(e,t)=>{if(typeof e.addEventListener=="function")return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)};const r=e;if(typeof r.addListener=="function")return r.addListener(t),()=>{r.removeListener?.(t)}},vs=(e,t)=>{let r=t;const n=e;return Object.defineProperty(n,"destroy",{configurable:!0,enumerable:!1,value:()=>{const s=r;r=()=>{},s()}}),n},fu=()=>{const e=$("light");let t=()=>{e.dispose()};if(typeof window<"u"&&typeof window.matchMedia=="function")try{const r=window.matchMedia("(prefers-color-scheme: dark)");e.value=r.matches?"dark":"light";const s=ps(r,o=>{e.value=o.matches?"dark":"light"});s&&(t=()=>{s(),e.dispose()})}catch{}return vs(I(e),t)},du=()=>{const e=$("no-preference");let t=()=>{e.dispose()};if(typeof window<"u"&&typeof window.matchMedia=="function"){let r,n,s;const o=()=>{!r||!n||!s||(r.matches?e.value="more":n.matches?e.value="less":s.matches?e.value="custom":e.value="no-preference")};try{r=window.matchMedia("(prefers-contrast: more)"),n=window.matchMedia("(prefers-contrast: less)"),s=window.matchMedia("(prefers-contrast: custom)"),o();const i=[r,n,s].map(a=>ps(a,()=>{o()})).filter(a=>a!==void 0);i.length>0&&(t=()=>{for(const a of i)a();e.dispose()})}catch{}}return vs(I(e),t)},hu=(e,t,r={})=>{const{wrap:n=!0,orientation:s="vertical",onActivate:o}=r;let i=0;const a=new Map,l=()=>Array.from(e.querySelectorAll(t)),c=u=>{for(const h of u)a.has(h)||a.set(h,h.getAttribute("tabindex"))},f=u=>{const h=l();if(h.length===0)return;c(h);const v=Math.max(0,Math.min(u,h.length-1));for(let b=0;b<h.length;b++)h[b].setAttribute("tabindex",b===v?"0":"-1");i=v,h[v].focus(),o?.(h[v],v)},m=u=>{if(u==="Home"||u==="End")return!0;switch(s){case"horizontal":return u==="ArrowLeft"||u==="ArrowRight";case"vertical":return u==="ArrowUp"||u==="ArrowDown";case"both":return u==="ArrowLeft"||u==="ArrowRight"||u==="ArrowUp"||u==="ArrowDown";default:return!1}},d=u=>{if(!m(u.key))return;const h=l();if(h.length===0)return;u.preventDefault();let v=i;switch(u.key){case"ArrowDown":case"ArrowRight":v=i+1,v>=h.length&&(v=n?0:h.length-1);break;case"ArrowUp":case"ArrowLeft":v=i-1,v<0&&(v=n?h.length-1:0);break;case"Home":v=0;break;case"End":v=h.length-1;break}f(v)},p=l();c(p);for(let u=0;u<p.length;u++)p[u].setAttribute("tabindex",u===0?"0":"-1");return e.addEventListener("keydown",d),{destroy:()=>{e.removeEventListener("keydown",d);for(const[u,h]of a)h===null?u.removeAttribute("tabindex"):u.setAttribute("tabindex",h);a.clear()},focusItem:u=>{f(u)},activeIndex:()=>i}},Xt=`
259
+ See: https://bquery.dev/guide/store#deep-reactivity`)}for(const[E,T]of Object.entries(A))i.has(E)&&(i.get(E).value=T)}else for(const[w,S]of Object.entries(g))i.has(w)&&(i.get(w).value=S)}),f()},writable:!1,enumerable:!1},$patchDeep:{value:g=>{Se(()=>{if(typeof g=="function"){const w=Te(p());g(w);for(const[S,k]of Object.entries(w))i.has(S)&&(i.get(S).value=k)}else for(const[w,S]of Object.entries(g))i.has(w)&&(i.get(w).value=Te(S))}),f()},writable:!1,enumerable:!1},$state:{get:()=>p(),enumerable:!1}}),Iu(t,b),Nu(b,e),$u(t,b),b},_u=(e,t)=>()=>io(e)?we(e):Lr({id:e,...t}),xu=(e,t)=>{const r={};for(const n of t)Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0});return r},qu=(e,t)=>{const r={};for(const n of t)Object.defineProperty(r,n,{get:()=>e[n],enumerable:!0});return r},zu=(e,t)=>{const r={};for(const n of t)r[n]=(...s)=>e[n](...s);return r},Uu="__version",ju={serialize:e=>JSON.stringify(e),deserialize:e=>JSON.parse(e)},co=e=>{if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null},Hu=(e,t)=>{const r={...e};for(const[n,s]of Object.entries(t))N(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=s);return r},Wu=()=>{try{return globalThis.localStorage}catch{return}},Fu=(e,t)=>{const r=typeof t=="string"?{key:t}:t??{},n=r.key??`bquery-store-${e.id}`,s=r.storage??Wu(),o=r.serializer??ju,i=r.version,a=r.migrate,c=n+Uu;let l=s!==void 0&&i!==void 0,u=!1,h=!1;const d=m=>{if(!s||i===void 0)return!1;try{return s.setItem(c,String(i)),!0}catch(v){return m&&ot()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(m,v),!1}},p=e.state,f=Lr({...e,state:()=>{const m=p();if(!s)return m;try{const v=s.getItem(n);if(!v)return m;const b=o.deserialize(v);if(!co(b))return m;let g=b;if(i!==void 0&&a){const w=s.getItem(c),S=w!==null?Number(w):0,k=Number.isFinite(S)?S:0;if(k!==i){l=!1,u=!0;const A=a(g,k);if(!co(A))return m;g=A;let E=!1;try{s.setItem(n,o.serialize(g)),E=!0,h=!0}catch(T){ot()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery store "${e.id}"] Failed to persist migrated state:`,T)}E&&d(`[bQuery store "${e.id}"] Failed to persist migrated version:`)&&(u=!1)}else l=!1}return Hu(m,g)}catch{return m}}});return l&&s?d():u&&h&&d(`[bQuery store "${e.id}"] Failed to persist migrated version after store creation:`)&&(u=!1),f.$subscribe(m=>{if(s)try{s.setItem(n,o.serialize(m)),u&&d(`[bQuery store "${e.id}"] Failed to persist migrated version after a successful state write:`)&&(u=!1)}catch{}}),f},Bu=(e,t,r,n={})=>{const s=n.equals??(n.deep?xe:Object.is);let o=t(e.$state);return n.immediate&&r(o,void 0),e.$subscribe(i=>{const a=t(i);if(!s(a,o)){const c=o;o=a,r(a,c)}})},lo=500,uo=class{constructor(e){this.cache=new Map,this.maxSize=e}get(e){const t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){const r=this.cache.keys().next().value;r!==void 0&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}get size(){return this.cache.size}},fo=new uo(lo),ho=new uo(lo),Qu=e=>new Proxy(e,{get(t,r){if(typeof r!="string")return Reflect.get(t,r);const n=t[r];return G(n)||ce(n)?n.value:n},has(t,r){return typeof r!="string"?Reflect.has(t,r):r in t}}),Q=(e,t)=>{try{const r=Qu(t);let n=fo.get(e);return n||(n=new Function("$ctx",`with($ctx) { return (${e}); }`),fo.set(e,n)),n(r)}catch(r){console.error(`bQuery view: Error evaluating "${e}"`,r);return}},Wt=(e,t)=>{try{let r=ho.get(e);return r||(r=new Function("$ctx",`with($ctx) { return (${e}); }`),ho.set(e,r)),r(t)}catch(r){console.error(`bQuery view: Error evaluating "${e}"`,r);return}},Pr=e=>{const t={},r=e.trim().replace(/^\{|\}$/g,"").trim();if(!r)return t;const n=[];let s="",o=0,i=null;for(let a=0;a<r.length;a++){const c=r[a];if(c==='"'||c==="'"||c==="`"){let l=0,u=a-1;for(;u>=0&&r[u]==="\\";)l++,u--;l%2===0&&(i===null?i=c:i===c&&(i=null)),s+=c;continue}if(i!==null){s+=c;continue}c==="("||c==="["||c==="{"?(o++,s+=c):c===")"||c==="]"||c==="}"?(o--,s+=c):c===","&&o===0?(n.push(s.trim()),s=""):s+=c}s.trim()&&n.push(s.trim());for(const a of n){let c=-1,l=0,u=null;for(let h=0;h<a.length;h++){const d=a[h];if(d==='"'||d==="'"||d==="`"){let p=0,f=h-1;for(;f>=0&&a[f]==="\\";)p++,f--;p%2===0&&(u===null?u=d:u===d&&(u=null));continue}if(u===null){if(d==="("||d==="["||d==="{")l++;else if(d===")"||d==="]"||d==="}")l--;else if(d===":"&&l===0){c=h;break}}}if(c>-1){const h=a.slice(0,c).trim().replace(/^['"]|['"]$/g,"");if(N(h))continue;t[h]=a.slice(c+1).trim()}}return t},Vu=e=>e.replace(/([A-Z])/g,"-$1").toLowerCase(),Ku=e=>{const t=e.trim(),r=t.toLowerCase();return r.startsWith("aria-")?r:`aria-${Vu(/^aria[A-Z]/.test(t)?t.slice(4):t).replace(/^-/,"")}`},Yu=e=>e==null||e==="",Ju=(e,t,r,n)=>{let s=new Set;const o=U(()=>{const i=new Set,a=Object.create(null);if(t.trimStart().startsWith("{")){const c=Pr(t);for(const[l,u]of Object.entries(c))a[l]=Q(u,r)}else{const c=Q(t,r);if(c&&typeof c=="object"&&!Array.isArray(c))for(const[l,u]of Object.entries(c))N(l)||(a[l]=u)}for(const[c,l]of Object.entries(a)){const u=Ku(c);if(Yu(l)){e.removeAttribute(u);continue}e.setAttribute(u,l===!0?"true":String(l)),i.add(u)}for(const c of s)i.has(c)||e.removeAttribute(c);s=i});n.push(o)},Gu=e=>(t,r,n,s)=>{const o=U(()=>{const i=Q(r,n);i==null||i===!1?t.removeAttribute(e):i===!0?t.setAttribute(e,""):t.setAttribute(e,String(i))});s.push(o)},Xu=(e,t,r,n)=>{let s=new Set;const o=U(()=>{const i=new Set;if(t.trimStart().startsWith("{")){const a=Pr(t);for(const[c,l]of Object.entries(a)){const u=Q(l,r);e.classList.toggle(c,!!u),i.add(c)}}else if(/^\s*\[/.test(t)){const a=Q(t,r);if(Array.isArray(a))for(const c of a)c&&(e.classList.add(c),i.add(c))}else{const a=Q(t,r);typeof a=="string"?a.split(/\s+/).forEach(c=>{c&&(e.classList.add(c),i.add(c))}):Array.isArray(a)&&a.forEach(c=>{c&&(e.classList.add(c),i.add(c))})}for(const a of s)i.has(a)||e.classList.remove(a);s=i});n.push(o)},Zu=e=>{if(G(e)||ce(e))return String(e.value??"");if(e&&typeof e=="object"&&"error"in e){const t=e.error;return G(t)||ce(t)?String(t.value??""):String(t??"")}return String(e??"")},ef=(e,t,r,n)=>{const s=e,o=!s.hasAttribute("aria-hidden");s.hasAttribute("role")||s.setAttribute("role","alert"),s.hasAttribute("aria-live")||s.setAttribute("aria-live","assertive");const i=U(()=>{const a=Zu(Q(t,r)).trim(),c=a.length>0;s.textContent=a,s.hidden=!c,o&&(c?s.removeAttribute("aria-hidden"):s.setAttribute("aria-hidden","true"))});n.push(i)},tf=(e,t,r,n,s,o)=>{if(!r)return t;const i={...o,[n]:e};return s&&(i[s]=t),Q(r,i)},rf=e=>{const{prefix:t,processElement:r,processChildren:n}=e;return(s,o,i,a)=>{const c=s.parentNode;if(!c)return;const l=o.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);if(!l){console.error(`bQuery view: Invalid bq-for expression "${o}"`);return}const[,u,h,d]=l,p=s.getAttribute(":key")||s.getAttribute(`${t}-key`),f=s.cloneNode(!0);f.removeAttribute(`${t}-for`),f.removeAttribute(":key"),f.removeAttribute(`${t}-key`);const m=document.createComment(`bq-for: ${o}`);c.replaceChild(m,s);let v=new Map,b=[];const g=(A,E,T)=>{const P=f.cloneNode(!0),C=[],$=L(A),R=h?L(E):null,O={...i,[u]:$};return h&&R&&(O[h]=R),r(P,O,t,C),n(P,O,t,C),{key:T,element:P,cleanups:C,item:A,index:E,itemSignal:$,indexSignal:R}},w=A=>{for(const E of A.cleanups)E();A.element.remove()},S=(A,E,T)=>{Object.is(A.item,E)||(A.item=E,A.itemSignal.value=E),A.index!==T&&(A.index=T,A.indexSignal&&(A.indexSignal.value=T))},k=U(()=>{const A=Q(d,i);if(!Array.isArray(A)){for(const O of v.values())w(O);v.clear(),b=[];return}const E=[],T=new Map,P=new Set;A.forEach((O,I)=>{let x=tf(O,I,p,u,h,i);P.has(x)&&(console.warn(`bq-for: Duplicate key "${String(x)}" detected at index ${I}. Falling back to index-based key for this item. Ensure :key expressions produce unique values for each item.`),x={__bqDuplicateKey:x,__bqIndex:I}),P.add(x),E.push(x),T.set(x,{item:O,index:I})});const C=[];for(const O of b)T.has(O)||C.push(O);for(const O of C){const I=v.get(O);I&&(w(I),v.delete(O))}const $=new Map;let R=m;for(let O=0;O<E.length;O++){const I=E[O],{item:x,index:W}=T.get(I);let q=v.get(I);q?(S(q,x,W),$.set(I,q),R.nextSibling!==q.element&&R.after(q.element),R=q.element):(q=g(x,W,I),$.set(I,q),R.after(q.element),R=q.element)}v=$,b=E});a.push(()=>{k();for(const A of v.values())for(const E of A.cleanups)E();v.clear()})}},nf=e=>(t,r,n,s)=>{const o=U(()=>{const i=Q(r,n),a=String(i??"");t.innerHTML=e?ie(a):a});s.push(o)},sf=(e,t,r,n)=>{const s=document.createComment(`bq-if: ${t}`);let o=!0;const i=U(()=>{const a=Q(t,r);a&&!o?(s.replaceWith(e),o=!0):!a&&o&&(e.replaceWith(s),o=!1)});n.push(i)},of=(e,t,r,n)=>{const s=e,o=Wt(t,r);if(!G(o)){console.warn(`bQuery view: bq-model requires a signal, got "${t}"`);return}const i=o,a=s.type==="checkbox",c=s.type==="radio",l=()=>{a?s.checked=!!i.value:c?s.checked=i.value===s.value:s.value=String(i.value??"")},u=U(()=>{l()});n.push(u);const h=s.tagName==="SELECT"?"change":"input",d=()=>{a?i.value=s.checked:c?s.checked&&(i.value=s.value):i.value=s.value};s.addEventListener(h,d),n.push(()=>s.removeEventListener(h,d))},af=e=>(t,r,n,s)=>{const o=i=>{const a={...n,$event:i,$el:t};if(!r.includes("(")){const c=Wt(r,a);if(typeof c=="function"){c(i);return}return}Wt(r,a)};t.addEventListener(e,o),s.push(()=>t.removeEventListener(e,o))};function cf(e){const t=Object.getOwnPropertyDescriptor(e,"value");return t?"value"in t?t.writable===!0:typeof t.set=="function":!1}var lf=(e,t,r,n)=>{const s=Wt(t,r);G(s)?(s.value=e,n.push(()=>{s.value=null})):typeof s=="object"&&s!==null&&cf(s)&&(s.value=e,n.push(()=>{s.value=null}))},uf=(e,t,r,n)=>{const s=e;let o=s.style.display;if(!o||o==="none"){const a=s.ownerDocument.defaultView?.getComputedStyle(s).display??"";o=a!=="none"?a:""}const i=U(()=>{const a=Q(t,r);s.style.display=a?o:"none"});n.push(i)},ff=(e,t,r,n)=>{const s=e;let o=new Set;const i=U(()=>{const a=new Set;if(t.trimStart().startsWith("{")){const c=Pr(t);for(const[l,u]of Object.entries(c)){const h=Q(u,r),d=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.style.setProperty(d,String(h??"")),a.add(d)}}else{const c=Q(t,r);if(c&&typeof c=="object")for(const[l,u]of Object.entries(c)){const h=l.replace(/([A-Z])/g,"-$1").toLowerCase();s.style.setProperty(h,String(u??"")),a.add(h)}}for(const c of o)a.has(c)||s.style.removeProperty(c);o=a});n.push(i)},df=(e,t,r,n)=>{const s=U(()=>{const o=Q(t,r);e.textContent=String(o??"")});n.push(s)},Nr=null,hf=e=>{Nr=e},mf=e=>Nr?Nr(e):void 0,Ft=(e,t,r,n,s)=>{const o=Array.from(e.attributes);for(const i of o){const{name:a,value:c}=i;if(!a.startsWith(`${r}-`))continue;const l=a.slice(r.length+1);if(l==="for"){s.for(e,c,t,n);return}if(l==="text")s.text(e,c,t,n);else if(l==="error")s.error(e,c,t,n);else if(l==="aria")s.aria(e,c,t,n);else if(l==="html")s.html(e,c,t,n);else if(l==="if")s.if(e,c,t,n);else if(l==="show")s.show(e,c,t,n);else if(l==="class")s.class(e,c,t,n);else if(l==="style")s.style(e,c,t,n);else if(l==="model")s.model(e,c,t,n);else if(l==="ref")s.ref(e,c,t,n);else if(l.startsWith("bind:")){const u=l.slice(5);s.bind(u)(e,c,t,n)}else if(l.startsWith("on:")){const u=l.slice(3);s.on(u)(e,c,t,n)}else{const u=mf(l);u?u(e,c,t,n):xt()&&typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery][view] Unknown directive "${a}" (parsed as "${l}") on <${e.tagName.toLowerCase()}>. This may be a typo or a missing custom directive registration.`)}}},Ir=(e,t,r,n,s)=>{const o=Array.from(e.children);for(const i of o)i.hasAttribute(`${r}-for`)?Ft(i,t,r,n,s):(Ft(i,t,r,n,s),Ir(i,t,r,n,s))},Mr=(e,t,r={})=>{const{prefix:n="bq",sanitize:s=!0}=r,o=typeof e=="string"?document.querySelector(e):e;if(!o)throw new Error(`bQuery view: Element "${e}" not found.`);if(o.hasAttribute(`${n}-for`))throw new Error(`bQuery view: Cannot mount on element with ${n}-for directive. Wrap the ${n}-for element in a container instead.`);const i=[],a={text:df,error:ef,aria:Ju,html:nf(s),if:sf,show:uf,class:Xu,style:ff,model:of,ref:lf,for:rf({prefix:n,processElement:(l,u,h,d)=>Ft(l,u,h,d,a),processChildren:(l,u,h,d)=>Ir(l,u,h,d,a)}),bind:Gu,on:af};return((l,u,h)=>{const d=l.hasAttribute(`${n}-for`);Ft(l,u,n,h,a),d||Ir(l,u,n,h,a)})(o,t,i),{el:o,context:t,update:l=>{Object.assign(t,l)},destroy:()=>{for(const l of i)l();i.length=0}}},pf=(e,t={})=>r=>{const n=document.createElement("div");n.innerHTML=e.trim();const s=n.firstElementChild;if(!s)throw new Error("bQuery view: Template must contain a single root element.");if(n.childElementCount>1)throw new Error(`bQuery view: Template must contain exactly one root element, found ${n.childElementCount}.`);const{prefix:o="bq"}=t;if(s.hasAttribute(`${o}-for`)||s.hasAttribute(`${o}-if`)){const i=s.hasAttribute(`${o}-for`)?"for":"if";throw new Error(`bQuery view: Template root element cannot have ${o}-${i} directive. Wrap the ${o}-${i} element in a container instead.`)}return Mr(s,r,t)},vf=e=>e===!0||e===void 0,yf=async(e,t)=>{const r=e(t),n=We(r)?await r:r;return vf(n)?void 0:n},gf=e=>{const t=e.initialValue,r=L(t),n=L(""),s=L(!1),o=D(()=>!Object.is(r.value,t));return{value:r,error:n,isDirty:o,isTouched:s,isPristine:D(()=>!o.value),touch:()=>{s.value=!0},reset:()=>{r.value=t,n.value="",s.value=!1}}},mo=async(e,t)=>{if(!t||t.length===0)return e.error.value="","";for(const r of t){const n=await yf(r,e.value.value);if(n)return e.error.value=n,n}return e.error.value="",""},bf=e=>{const t=Object.entries(e.fields),r={},n={};for(const[f,m]of t){const v=gf(m);r[f]=v,n[f]=v.error}const s=L(!1),o=D(()=>{for(const f of Object.keys(r))if(r[f].error.value!=="")return!1;return!0}),i=D(()=>{for(const f of Object.keys(r))if(r[f].isDirty.value)return!0;return!1}),a=async f=>{const m=r[f],v=e.fields[f];!m||!v||await mo(m,v.validators)},c=async()=>{let f=!1;for(const[m,v]of t){const b=r[m];await mo(b,v.validators)&&(f=!0)}if(e.crossValidators&&e.crossValidators.length>0){const m=h();for(const v of e.crossValidators){const b=await v(m);if(b){for(const[g,w]of Object.entries(b))if(w){const S=r[g];S&&(S.error.value===""&&(S.error.value=w),f=!0)}}}}return!f},l=async()=>{if(!s.value){s.value=!0;try{if(!await c())return;e.onSubmit&&await e.onSubmit(h())}finally{s.value=!1}}},u=()=>{for(const f of Object.keys(r))r[f].reset()},h=()=>{const f={};for(const m of Object.keys(r))f[m]=r[m].value.value;return f};return{fields:r,errors:n,isValid:o,isDirty:i,isSubmitting:s,handleSubmit:l,validateField:a,validate:c,reset:u,getValues:h,setValues:f=>{for(const[m,v]of Object.entries(f)){if(N(m)||!Object.prototype.hasOwnProperty.call(r,m))continue;const b=r[m];b&&(b.value.value=v)}},setErrors:f=>{for(const[m,v]of Object.entries(f)){if(N(m)||!Object.prototype.hasOwnProperty.call(r,m))continue;const b=r[m];b&&(b.error.value=v??"")}}}},wf=e=>e===!0||e===void 0,Sf=async(e,t)=>{const r=e(t),n=We(r)?await r:r;return wf(n)?void 0:n},Ef=(e,t={})=>{let r;Af(e)?r=e:r=L(Wn(e)||kf(e)?e.peek():e);const n=r.peek(),s=L(t.initialError??""),o=L(!1),i=L(!1),a=D(()=>!Object.is(r.value,n)),c=D(()=>!a.value),l=D(()=>s.value===""),u=t.validateOn??"manual",h=Math.max(0,t.debounceMs??0);let d=0,p=!1,f=!1,m=!1,v;const b=A=>{console.error("bQuery forms: Error in scheduled field validation",A)},g=async()=>{const A=++d,E=t.validators;if(!E||E.length===0)return s.value="",i.value=!1,!0;i.value=!0;try{const T=r.peek();for(const P of E){const C=await Sf(P,T);if(A!==d)return s.peek()==="";if(C)return s.value=C,!1}return A===d&&(s.value=""),!0}finally{A===d&&(i.value=!1)}},w=ur(()=>{g().catch(b)},h),S=()=>{if(!m){if(h>0){w();return}g().catch(b)}};return(u==="change"||u==="both")&&(v=U(()=>{if(r.value,!p){p=!0;return}if(f){f=!1;return}S()})),{value:r,error:s,isDirty:a,isTouched:o,isPristine:c,isValid:l,isValidating:i,touch:()=>{o.value=!0,(u==="blur"||u==="both")&&S()},reset:()=>{d+=1,w.cancel(),Object.is(r.peek(),n)||(f=!0),r.value=n,s.value=t.initialError??"",o.value=!1,i.value=!1},validate:async()=>(w.cancel(),g()),destroy:()=>{m||(m=!0,d+=1,w.cancel(),v?.(),v=void 0,a.dispose(),c.dispose(),l.dispose(),i.value=!1)}}},Af=e=>e instanceof Je,kf=e=>e instanceof Ye,Tf=(e="This field is required")=>t=>t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0?e:!0,Rf=(e,t)=>{const r=t??`Must be at least ${e} characters`;return n=>(typeof n=="string"?n:String(n??"")).length>=e?!0:r},Cf=(e,t)=>{const r=t??`Must be at most ${e} characters`;return n=>(typeof n=="string"?n:String(n??"")).length<=e?!0:r},$f=(e,t="Invalid format")=>{const r=e.global||e.sticky?new RegExp(e.source,e.flags.replace(/[gy]/g,"")):e;return n=>{const s=typeof n=="string"?n:String(n??"");return r.lastIndex=0,r.test(s)?!0:t}},Of=(e="Invalid email address")=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return r=>{const n=typeof r=="string"?r:String(r??"");return n===""||t.test(n)?!0:e}},Lf=(e="Invalid URL")=>t=>{const r=typeof t=="string"?t:String(t??"");if(r==="")return!0;try{return new URL(r),!0}catch{return e}},Pf=(e,t)=>{const r=t??`Must be at least ${e}`;return n=>n==null||typeof n=="string"&&n.trim()===""||(typeof n=="number"?n:Number(n))>=e?!0:r},Nf=(e,t)=>{const r=t??`Must be at most ${e}`;return n=>n==null||typeof n=="string"&&n.trim()===""||(typeof n=="number"?n:Number(n))<=e?!0:r},If=(e,t)=>r=>e(r)?!0:t,Mf=(e,t)=>async r=>await e(r)?!0:t,Df=(e,t="Fields do not match")=>r=>Object.is(r,e.value)?!0:t,po=(e,t,r)=>{const{locale:n,...s}=r??{};try{return new Intl.NumberFormat(t,s).format(e)}catch{return String(e)}},vo=(e,t,r)=>{const{locale:n,...s}=r??{},o=typeof e=="number"?new Date(e):e;try{return new Intl.DateTimeFormat(t,s).format(o)}catch{return o.toLocaleString()}},yo=(e,t)=>{const r=t.split(".");let n=e;for(const s of r){if(typeof n=="string"||n[s]===void 0)return;n=n[s]}return typeof n=="string"?n:void 0},_f=(e,t)=>e.replace(/\{(\w+)\}/g,(r,n)=>n in t?String(t[n]):r),xf=(e,t)=>{if(!e.includes("|")||!("count"in t))return e;const r=Number(t.count),n=e.split("|").map(s=>s.trim());return n.length===3?r===0?n[0]:r===1?n[1]:n[2]:n.length===2?r===1?n[0]:n[1]:r===0&&n.length>0?n[0]:r===1&&n.length>1?n[1]:n[n.length-1]},go=(e,t,r,n)=>{let s;return e&&(s=yo(e,t)),s===void 0&&n&&(s=yo(n,t)),s===void 0?t:_f(xf(s,r),r)},bo=(e,t)=>{const r=Le(e,t),n=s=>{if(Array.isArray(s))return s.map(i=>n(i));if(!Oe(s))return s;const o=Object.create(null);for(const[i,a]of Object.entries(s))N(i)||(o[i]=n(a));return o};return n(r)},qf=e=>{const{locale:t,messages:r,fallbackLocale:n}=e,s=g=>bo(Object.create(null),g),o=Object.create(null);for(const[g,w]of Object.entries(r))N(g)||(o[g]=s(w));const i=L(t),a=new Map,c=new Set(Object.keys(o));return{$locale:i,t:(g,w={})=>{const S=o[i.value];return go(S,g,w,n?o[n]:void 0)},tc:(g,w={})=>D(()=>{const S=o[i.value];return go(S,g,w,n?o[n]:void 0)}),loadLocale:(g,w)=>{N(g)||a.set(g,w)},ensureLocale:async g=>{if(N(g)||c.has(g))return;const w=a.get(g);if(!w)throw new Error(`bQuery i18n: No messages or loader registered for locale "${g}".`);const S=await w();o[g]=s(S.default??S),c.add(g)},n:(g,w)=>po(g,w?.locale??i.value,w),d:(g,w)=>vo(g,w?.locale??i.value,w),getMessages:g=>{if(!N(g))return o[g]},mergeMessages:(g,w)=>{N(g)||(o[g]||(o[g]=Object.create(null),c.add(g)),o[g]=bo(o[g],s(w)))},availableLocales:()=>{const g=new Set([...c,...a.keys()]);return Array.from(g).sort()}}},Bt=new Map,it=new Map,zf=50,Uf=e=>{const t=Bt.get(e);if(t&&t.isConnected)return t;const r=document.createElement("div");return r.setAttribute("aria-live",e),r.setAttribute("aria-atomic","true"),r.setAttribute("role",e==="assertive"?"alert":"status"),Object.assign(r.style,{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:"0"}),document.body.appendChild(r),Bt.set(e,r),r},jf=(e,t="polite")=>{if(!e||typeof document>"u"||!document.body)return;const r=Uf(t),n=it.get(t);n!==void 0&&clearTimeout(n),r.textContent="";const s=setTimeout(()=>{it.delete(t),r.isConnected&&(r.textContent=e)},zf);it.set(t,s)},Hf=()=>{for(const e of it.values())clearTimeout(e);it.clear();for(const[,e]of Bt)e.remove();Bt.clear()},ne=(e,t,r,n)=>({severity:e,message:t,element:r,rule:n}),Wf=e=>{const t=[],r=e.querySelectorAll("img");for(const n of r)n.hasAttribute("alt")?n.getAttribute("alt")===""&&!n.hasAttribute("role")&&t.push(ne("info",'Image has empty alt text. Consider adding role="presentation" if decorative.',n,"img-decorative")):t.push(ne("error",'Image is missing an alt attribute. Add alt="" for decorative images or a descriptive alt text.',n,"img-alt"));return t},Ff=e=>{const t=[],r=e.querySelectorAll("input, select, textarea");for(const n of r){const s=n.getAttribute("type");if(s==="hidden"||s==="submit"||s==="button"||s==="reset")continue;const o=n.getAttribute("id"),i=o?!!e.querySelector(`label[for="${o}"]`):!1,a=n.hasAttribute("aria-label")||n.hasAttribute("aria-labelledby"),c=n.hasAttribute("title"),l=n.closest("label")!==null;!i&&!a&&!c&&!l&&t.push(ne("error",'Form input is missing a label. Add a <label for="id">, aria-label, or aria-labelledby attribute.',n,"input-label"))}return t},Bf=e=>{const t=[],r=e.querySelectorAll("button");for(const s of r){const o=(s.textContent??"").trim().length>0,i=s.hasAttribute("aria-label")||s.hasAttribute("aria-labelledby"),a=s.hasAttribute("title");!o&&!i&&!a&&t.push(ne("error","Button has no accessible name. Add text content, aria-label, or title.",s,"button-name"))}const n=e.querySelectorAll("a[href]");for(const s of n){const o=(s.textContent??"").trim().length>0,i=s.hasAttribute("aria-label")||s.hasAttribute("aria-labelledby"),a=s.hasAttribute("title"),c=s.querySelector("img[alt]")!==null;!o&&!i&&!a&&!c&&t.push(ne("error","Link has no accessible name. Add text content, aria-label, or title.",s,"link-name"))}return t},Qf=e=>{const t=[],r=e.querySelectorAll("h1, h2, h3, h4, h5, h6");let n=0;for(const s of r){const o=parseInt(s.tagName.charAt(1),10);n>0&&o>n+1&&t.push(ne("warning",`Heading level skipped: <${s.tagName.toLowerCase()}> follows <h${n}>. Don't skip heading levels.`,s,"heading-order")),(s.textContent??"").trim().length===0&&t.push(ne("warning","Heading element is empty.",s,"heading-empty")),n=o}return t},Vf=e=>{const t=[],r=e.querySelectorAll("[aria-labelledby]");for(const s of r){const o=(s.getAttribute("aria-labelledby")??"").split(/\s+/);for(const i of o)i&&!document.getElementById(i)&&t.push(ne("error",`aria-labelledby references "${i}" which does not exist in the document.`,s,"aria-labelledby-ref"))}const n=e.querySelectorAll("[aria-describedby]");for(const s of n){const o=(s.getAttribute("aria-describedby")??"").split(/\s+/);for(const i of o)i&&!document.getElementById(i)&&t.push(ne("error",`aria-describedby references "${i}" which does not exist in the document.`,s,"aria-describedby-ref"))}return t},Kf=e=>{const t=[];return(e===document.body||e===document.documentElement)&&(e.querySelector("main")||e.querySelector('[role="main"]')||t.push(ne("warning",'Page is missing a <main> landmark. Add <main> or role="main" to the primary content area.',e,"landmark-main"))),t},Yf=e=>{if(typeof document>"u"||!document.body)return{findings:[],errors:0,warnings:0,passed:!0};const t=e??document.body,r=[...Wf(t),...Ff(t),...Bf(t),...Qf(t),...Vf(t),...Kf(t)],n=r.filter(s=>s.severity==="error").length;return{findings:r,errors:n,warnings:r.filter(s=>s.severity==="warning").length,passed:n===0}},wo=(e,t)=>{if(typeof e.addEventListener=="function")return e.addEventListener("change",t),()=>{e.removeEventListener("change",t)};const r=e;if(typeof r.addListener=="function")return r.addListener(t),()=>{r.removeListener?.(t)}},So=(e,t)=>{let r=t;const n=e;return Object.defineProperty(n,"destroy",{configurable:!0,enumerable:!1,value:()=>{const s=r;r=()=>{},s()}}),n},Jf=()=>{const e=L("light");let t=()=>{e.dispose()};if(typeof window<"u"&&typeof window.matchMedia=="function")try{const r=window.matchMedia("(prefers-color-scheme: dark)");e.value=r.matches?"dark":"light";const s=wo(r,o=>{e.value=o.matches?"dark":"light"});s&&(t=()=>{s(),e.dispose()})}catch{}return So(_(e),t)},Gf=()=>{const e=L("no-preference");let t=()=>{e.dispose()};if(typeof window<"u"&&typeof window.matchMedia=="function"){let r,n,s;const o=()=>{!r||!n||!s||(r.matches?e.value="more":n.matches?e.value="less":s.matches?e.value="custom":e.value="no-preference")};try{r=window.matchMedia("(prefers-contrast: more)"),n=window.matchMedia("(prefers-contrast: less)"),s=window.matchMedia("(prefers-contrast: custom)"),o();const i=[r,n,s].map(a=>wo(a,()=>{o()})).filter(a=>a!==void 0);i.length>0&&(t=()=>{for(const a of i)a();e.dispose()})}catch{}}return So(_(e),t)},Xf=(e,t,r={})=>{const{wrap:n=!0,orientation:s="vertical",onActivate:o}=r;let i=0;const a=new Map,c=()=>Array.from(e.querySelectorAll(t)),l=f=>{for(const m of f)a.has(m)||a.set(m,m.getAttribute("tabindex"))},u=f=>{const m=c();if(m.length===0)return;l(m);const v=Math.max(0,Math.min(f,m.length-1));for(let b=0;b<m.length;b++)m[b].setAttribute("tabindex",b===v?"0":"-1");i=v,m[v].focus(),o?.(m[v],v)},h=f=>{if(f==="Home"||f==="End")return!0;switch(s){case"horizontal":return f==="ArrowLeft"||f==="ArrowRight";case"vertical":return f==="ArrowUp"||f==="ArrowDown";case"both":return f==="ArrowLeft"||f==="ArrowRight"||f==="ArrowUp"||f==="ArrowDown";default:return!1}},d=f=>{if(!h(f.key))return;const m=c();if(m.length===0)return;f.preventDefault();let v=i;switch(f.key){case"ArrowDown":case"ArrowRight":v=i+1,v>=m.length&&(v=n?0:m.length-1);break;case"ArrowUp":case"ArrowLeft":v=i-1,v<0&&(v=n?m.length-1:0);break;case"Home":v=0;break;case"End":v=m.length-1;break}u(v)},p=c();l(p);for(let f=0;f<p.length;f++)p[f].setAttribute("tabindex",f===0?"0":"-1");return e.addEventListener("keydown",d),{destroy:()=>{e.removeEventListener("keydown",d);for(const[f,m]of a)m===null?f.removeAttribute("tabindex"):f.setAttribute("tabindex",m);a.clear()},focusItem:f=>{u(f)},activeIndex:()=>i}},Dr=`
260
260
  position: absolute;
261
261
  top: -9999px;
262
262
  left: -9999px;
@@ -269,9 +269,13 @@ See: https://bquery.dev/guide/store#deep-reactivity`)}for(const[S,T]of Object.en
269
269
  border-radius: 0 0 4px 0;
270
270
  outline: 2px solid #4A90D9;
271
271
  outline-offset: 2px;
272
- `,mu=`
272
+ `,Zf=`
273
273
  top: 0;
274
274
  left: 0;
275
- `,ys=0,Re=new Map,pu=()=>typeof document>"u"?!1:typeof document.createElement=="function"&&typeof document.querySelector=="function"&&typeof document.getElementById=="function"&&document.body!==null&&document.body!==void 0,vu=()=>({destroy:()=>{},element:null}),yu=(e,t={})=>{if(!pu())return vu();const{text:r="Skip to main content",className:n="bq-skip-link"}=t;let s,o;const i=h=>{try{return document.querySelector(h)}catch{return null}},a=()=>{if(!s)return;const h=Re.get(s),v=(h?.count??0)-1;v<=0?(Re.delete(s),h?.target.isConnected&&h.target.id===s&&h.target.removeAttribute("id")):Re.set(s,{count:v,target:h.target}),s=void 0},l=()=>{if(!o)return;const{target:h,hadTabIndex:v,previousTabIndex:b}=o;h.isConnected&&(v?h.setAttribute("tabindex",b??""):h.removeAttribute("tabindex")),o=void 0},c=h=>{if(o?.target!==h){if(l(),h.hasAttribute("tabindex")){o={target:h,hadTabIndex:!0,previousTabIndex:h.getAttribute("tabindex")};return}h.tabIndex===-1&&(o={target:h,hadTabIndex:!1,previousTabIndex:null},h.setAttribute("tabindex","-1"))}},f=(h,v)=>{if(s===v)return;a();const b=Re.get(v);Re.set(v,{count:(b?.count??0)+1,target:h}),s=v},m=()=>{if(e.startsWith("#")){const v=e.slice(1),b=v?document.getElementById(v):null;return b||i(e)}const h=document.getElementById(e);return h||i(e)},d=h=>{if(h.id)return Re.get(h.id)?.target===h&&f(h,h.id),h.id;let v;do ys+=1,v=`bq-skip-target-${ys}`;while(document.getElementById(v)!==null);return h.id=v,f(h,v),v},p=document.createElement("a"),u=m();return p.href=e.startsWith("#")?e:u?`#${d(u)}`:`#${e}`,p.textContent=r,p.className=n,p.setAttribute("style",Xt),p.addEventListener("focus",()=>{p.setAttribute("style",Xt+mu)}),p.addEventListener("blur",()=>{p.setAttribute("style",Xt)}),p.addEventListener("click",h=>{h.preventDefault();const v=m();v&&(p.href=`#${d(v)}`,c(v),v.focus())}),document.body.firstChild?document.body.insertBefore(p,document.body.firstChild):document.body.appendChild(p),{destroy:()=>{l(),a(),p.remove()},element:p}},gu=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"details > summary","audio[controls]","video[controls]"].join(", "),Zt=e=>Array.from(e.querySelectorAll(gu)).filter(t=>!t.hasAttribute("disabled")&&t.tabIndex!==-1&&t.getClientRects().length>0),gs=(e,t)=>e?typeof e=="string"?t.querySelector(e):e:null,bu=(e,t={})=>{const{escapeDeactivates:r=!0,onEscape:n,initialFocus:s,returnFocus:o}=t;if(typeof document>"u"||typeof document.addEventListener!="function"||typeof document.removeEventListener!="function"){let m=!1;return{get active(){return m},release:()=>{m=!1}}}const i=document.activeElement;let a=!0;const l=m=>{if(!a)return;if(m.key==="Escape"&&r){m.preventDefault(),f.release(),n?.();return}if(m.key!=="Tab")return;const d=Zt(e);if(d.length===0){m.preventDefault();return}const p=d[0],u=d[d.length-1];m.shiftKey?(document.activeElement===p||!e.contains(document.activeElement))&&(m.preventDefault(),u.focus()):(document.activeElement===u||!e.contains(document.activeElement))&&(m.preventDefault(),p.focus())};document.addEventListener("keydown",l,!0);const c=gs(s,e);if(c)c.focus();else{const m=Zt(e);m.length>0&&m[0].focus()}const f={get active(){return a},release:()=>{if(!a)return;a=!1,document.removeEventListener("keydown",l,!0);const m=gs(o,document.body);m?m.focus():i&&i.focus&&i.focus()}};return f},wu=e=>{e.release()},Ke=new Map,bs=()=>{const e=Array.from(Ke.values());return e[e.length-1]},Eu=(e,t)=>{if(typeof t=="object")return t;let r=null;if(t==="parent"?r=e.parentElement:r=document.querySelector(t),!r)return null;const n=r.getBoundingClientRect(),s=e.getBoundingClientRect(),o=parseFloat(e.style.left||"0"),i=parseFloat(e.style.top||"0"),a=Number.isNaN(o)?0:o,l=Number.isNaN(i)?0:i;return{left:n.left-s.left+a,top:n.top-s.top+l,right:n.right-s.right+a+(n.width-s.width),bottom:n.bottom-s.bottom+l+(n.height-s.height)}},Su=(e,t)=>t?{x:Math.max(t.left,Math.min(t.right,e.x)),y:Math.max(t.top,Math.min(t.bottom,e.y))}:e,Au=(e,t={})=>{const{axis:r="both",bounds:n,handle:s,ghost:o=!1,ghostClass:i="bq-drag-ghost",draggingClass:a="bq-dragging",onDragStart:l,onDrag:c,onDragEnd:f}=t;let m=!t.disabled,d=!1,p={x:0,y:0},u={x:0,y:0},h={x:0,y:0},v=null,b=null;const y=e.style.touchAction,w=e.style.userSelect,E=R=>({element:e,position:{...u},delta:{x:u.x-h.x,y:u.y-h.y},event:R}),k=()=>{const R=e.cloneNode(!0),O=e.getBoundingClientRect();return R.classList.add(i),R.style.position="fixed",R.style.left=`${O.left}px`,R.style.top=`${O.top}px`,R.style.width=`${O.width}px`,R.style.height=`${O.height}px`,R.style.pointerEvents="none",R.style.zIndex="999999",R.style.opacity="0.7",R.style.margin="0",document.body.appendChild(R),R},A=()=>{v&&(v.remove(),v=null),b=null},S=R=>{if(m&&!(s&&!R.target.closest(s))){if(R.preventDefault(),d=!0,p={x:R.clientX,y:R.clientY},h={...u},e.classList.add(a),e.setPointerCapture(R.pointerId),o){const O=e.getBoundingClientRect();b={x:O.left,y:O.top},v=k()}Ke.set(e,{element:e,position:u}),l?.(E(R))}},T=R=>{if(!d)return;R.preventDefault(),h={...u};let O=u.x+(R.clientX-p.x),C=u.y+(R.clientY-p.y);p={x:R.clientX,y:R.clientY},r==="x"&&(C=u.y),r==="y"&&(O=u.x);let L={x:O,y:C};if(n){const M=Eu(e,n);L=Su(L,M)}if(u=L,Ke.set(e,{element:e,position:u}),o&&v){const M=b??{x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().top};v.style.left=`${M.x+u.x}px`,v.style.top=`${M.y+u.y}px`}else e.style.transform=`translate(${u.x}px, ${u.y}px)`;c?.(E(R))},P=R=>{if(d){d=!1,e.classList.remove(a);try{typeof e.releasePointerCapture=="function"&&(typeof e.hasPointerCapture!="function"||e.hasPointerCapture(R.pointerId))&&e.releasePointerCapture(R.pointerId)}catch{}finally{A(),Ke.delete(e),f?.(E(R))}}};return e.addEventListener("pointerdown",S),e.addEventListener("pointermove",T),e.addEventListener("pointerup",P),e.addEventListener("pointercancel",P),e.style.touchAction="none",e.style.userSelect="none",{destroy:()=>{e.removeEventListener("pointerdown",S),e.removeEventListener("pointermove",T),e.removeEventListener("pointerup",P),e.removeEventListener("pointercancel",P),A(),Ke.delete(e),e.style.touchAction=y,e.style.userSelect=w,e.classList.remove(a)},disable:()=>{m=!1},enable:()=>{m=!0},get enabled(){return m}}},ku={passive:!0},Ye=new Set,Ge=null,ne=null,ws=()=>Array.from(Ye),Tu=()=>typeof document<"u"&&typeof document.addEventListener=="function"&&typeof document.removeEventListener=="function"&&typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function",Cu=e=>{for(const t of ws())t.handlePointerMove(e)},Ru=()=>{ne=null;const e=Ge;Ge=null,e&&Cu(e)},Es=e=>{Ge=e,ne===null&&(ne=requestAnimationFrame(Ru))},Ss=e=>{ne!==null&&(cancelAnimationFrame(ne),ne=null,Ge=null);for(const t of ws())t.handlePointerUp(e)},Ou=e=>{Ye.size===0&&(document.addEventListener("pointermove",Es,ku),document.addEventListener("pointerup",Ss)),Ye.add(e)},Lu=e=>{Ye.delete(e),Ye.size===0&&(document.removeEventListener("pointermove",Es),document.removeEventListener("pointerup",Ss),ne!==null&&(cancelAnimationFrame(ne),ne=null),Ge=null)},As=(e,t)=>t?typeof t=="string"?e.matches(t):t(e):!0,$u=(e,t={})=>{const{overClass:r="bq-drop-over",accept:n,onDragEnter:s,onDragOver:o,onDragLeave:i,onDrop:a}=t;if(!Tu())return{destroy:()=>{}};let l=!1,c=null;const f=(b,y)=>({zone:e,dragged:b,event:y}),m=b=>{const y=e.getBoundingClientRect();return b.clientX>=y.left&&b.clientX<=y.right&&b.clientY>=y.top&&b.clientY<=y.bottom},d=()=>bs()?.element??c,p=(b,y=c)=>{l&&(l=!1,e.classList.remove(r),y&&i?.(f(y,b)),c=null)},v={handlePointerMove:b=>{const y=bs()?.element??null,w=m(b);if(!(y!==null&&y!==e&&As(y,n))||!w){p(b,y??c);return}l?o?.(f(y,b)):(l=!0,c=y,e.classList.add(r),s?.(f(y,b)))},handlePointerUp:b=>{const y=d(),w=m(b),E=y!==null&&y!==e&&As(y,n);w&&E&&y&&a?.(f(y,b)),l&&(l=!1,e.classList.remove(r)),c=null}};return Ou(v),{destroy:()=>{Lu(v),e.classList.remove(r),c=null}}},ks=(e,t)=>Array.from(e.querySelectorAll(t)),Pu=(e,t,r,n)=>{let s=null;for(let o=0;o<e.length;o++){const i=e[o];if(i===n)continue;const a=i.getBoundingClientRect(),l=t-(r==="y"?a.top+a.height/2:a.left+a.width/2);(s===null||l<0&&l>s.distance||s.distance>=0&&l<0&&Math.abs(l)<Math.abs(s.distance))&&l<0&&(s={element:i,index:o,distance:l})}return s?{element:s.element,index:s.index}:null},Mu=(e,t={})=>{const{items:r=":scope > *",axis:n="y",handle:s,placeholderClass:o="bq-sort-placeholder",sortingClass:i="bq-sorting",animationDuration:a=200,onSortStart:l,onSortMove:c,onSortEnd:f}=t;let m=!t.disabled,d=!1,p=null,u=null,h=-1,v=0,b=0,y=0,w=0;const E=(P,R,O)=>({container:e,item:P,oldIndex:R,newIndex:O}),k=P=>{if(!m)return;const R=P.target,O=ks(e,r);let C=null;for(const M of O)if(M.contains(R)){C=M;break}if(!C||s&&!R.closest(s))return;P.preventDefault(),d=!0,p=C,h=O.indexOf(C),v=P.clientY,b=P.clientX;const L=C.getBoundingClientRect();y=L.top,w=L.left,u=document.createElement("div"),u.classList.add(o),u.style.width=`${L.width}px`,u.style.height=`${L.height}px`,u.style.boxSizing="border-box",C.classList.add(i),C.style.position="fixed",C.style.width=`${L.width}px`,C.style.height=`${L.height}px`,C.style.left=`${L.left}px`,C.style.top=`${L.top}px`,C.style.zIndex="999999",C.style.pointerEvents="none",C.style.margin="0",C.parentNode?.insertBefore(u,C),e.setPointerCapture(P.pointerId),l?.(E(C,h,h))},A=P=>{if(!d||!p||!u)return;P.preventDefault();const R=P.clientX-b,O=P.clientY-v;n==="y"?p.style.top=`${y+O}px`:p.style.left=`${w+R}px`;const C=Pu(ks(e,r),n==="y"?P.clientY:P.clientX,n,p);C?e.insertBefore(u,C.element):e.appendChild(u);const L=Array.from(e.children).indexOf(u);c?.(E(p,h,L))},S=P=>{if(!d||!p||!u)return;d=!1;const R=p,O=Array.from(e.children).indexOf(u),C=u.getBoundingClientRect(),L=R.getBoundingClientRect();if(a>0){const M=C.left-L.left,_=C.top-L.top;R.style.transition=`transform ${a}ms ease`,R.style.transform=`translate(${M}px, ${_}px)`;let U=!1,q=null;const Q=()=>{U||(U=!0,q!==null&&(window.clearTimeout(q),q=null),T(),f?.(E(R,h,O)))};q=window.setTimeout(()=>{Q()},a+50),R.addEventListener("transitionend",Q,{once:!0})}else T(),f?.(E(R,h,O));e.releasePointerCapture(P.pointerId)},T=()=>{!p||!u||(u.parentNode?.insertBefore(p,u),u.remove(),u=null,p.classList.remove(i),p.style.position="",p.style.width="",p.style.height="",p.style.left="",p.style.top="",p.style.zIndex="",p.style.pointerEvents="",p.style.margin="",p.style.transition="",p.style.transform="",p=null)};return e.addEventListener("pointerdown",k),e.addEventListener("pointermove",A),e.addEventListener("pointerup",S),e.addEventListener("pointercancel",S),e.style.touchAction="none",{destroy:()=>{e.removeEventListener("pointerdown",k),e.removeEventListener("pointermove",A),e.removeEventListener("pointerup",S),e.removeEventListener("pointercancel",S),e.style.touchAction="",d&&T()},disable:()=>{m=!1},enable:()=>{m=!0},get enabled(){return m}}},Nu=e=>{const t=$(!1);let r;if(typeof window<"u"&&typeof window.matchMedia=="function")try{const o=window.matchMedia(e);t.value=o.matches;const i=a=>{t.value=a.matches};if(typeof o.addEventListener=="function")o.addEventListener("change",i),r=()=>{o.removeEventListener("change",i)};else if(typeof o.addListener=="function"){const a=o;a.addListener(i),r=()=>{a.removeListener(i)}}}catch{}const n=I(t);let s=!1;return Object.defineProperty(n,"destroy",{enumerable:!1,configurable:!0,value(){s||(s=!0,r?.(),t.dispose())}}),n},Du=e=>{const t={},r=[];for(const o of Object.keys(e)){const i=e[o],a=$(!1);let l;if(typeof window<"u"&&typeof window.matchMedia=="function")try{const m=window.matchMedia(`(min-width: ${i}px)`);a.value=m.matches;const d=p=>{a.value=p.matches};if(typeof m.addEventListener=="function")m.addEventListener("change",d),l=()=>{m.removeEventListener("change",d)};else{const p=m;typeof p.addListener=="function"&&(p.addListener(d),l=()=>{p.removeListener?.(d)})}}catch{}const c=I(a);let f=!1;Object.defineProperty(c,"destroy",{enumerable:!1,configurable:!0,value(){f||(f=!0,l?.(),a.dispose())}}),r.push(c.destroy),t[o]=c}let n=!1;const s=Object.defineProperty(t,"destroyAll",{enumerable:!1,configurable:!0,value(){n||(n=!0,r.forEach(o=>{o()}))}});return Object.prototype.hasOwnProperty.call(t,"destroy")||Object.defineProperty(s,"destroy",{enumerable:!1,configurable:!0,value:s.destroyAll}),s},Ts=(e,t)=>t>=e?"portrait":"landscape",Iu=()=>{const e=$({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0,orientation:typeof window<"u"?Ts(window.innerWidth,window.innerHeight):"portrait"});let t;if(typeof window<"u"){const s=()=>{e.value={width:window.innerWidth,height:window.innerHeight,orientation:Ts(window.innerWidth,window.innerHeight)}};window.addEventListener("resize",s),t=()=>{window.removeEventListener("resize",s)}}const r=I(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value:()=>{n||(n=!0,t?.(),e.dispose())}}),r},Cs=()=>{const e=typeof navigator<"u"&&navigator.onLine!==void 0?navigator.onLine:!0,t=(typeof navigator<"u"?navigator:void 0)?.connection;return{online:e,effectiveType:t?.effectiveType??"unknown",downlink:t?.downlink??0,rtt:t?.rtt??0}},_u=()=>{const e=$(Cs());let t;if(typeof window<"u"){const s=()=>{e.value=Cs()};window.addEventListener("online",s),window.addEventListener("offline",s);const o=typeof navigator<"u"?navigator:void 0;o?.connection&&typeof o.connection.addEventListener=="function"&&o.connection.addEventListener("change",s),t=()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s),o?.connection&&typeof o.connection.removeEventListener=="function"&&o.connection.removeEventListener("change",s)}}const r=I(e);let n=!1;return Object.defineProperty(r,"destroy",{value(){n||(n=!0,t?.(),e.dispose())},enumerable:!1,configurable:!0}),r},qu={supported:!1,charging:!1,chargingTime:0,dischargingTime:0,level:1},zu=()=>{const e=$({...qu});let t,r=!1;typeof navigator<"u"&&"getBattery"in navigator&&typeof navigator.getBattery=="function"&&navigator.getBattery().then(s=>{if(r)return;const o=()=>{e.value={supported:!0,charging:s.charging,chargingTime:s.chargingTime,dischargingTime:s.dischargingTime,level:s.level}};o(),s.addEventListener("chargingchange",o),s.addEventListener("chargingtimechange",o),s.addEventListener("dischargingtimechange",o),s.addEventListener("levelchange",o),t=()=>{s.removeEventListener("chargingchange",o),s.removeEventListener("chargingtimechange",o),s.removeEventListener("dischargingtimechange",o),s.removeEventListener("levelchange",o)}}).catch(()=>{});const n=I(e);return Object.defineProperty(n,"destroy",{enumerable:!1,configurable:!0,value(){r||(r=!0,t?.(),e.dispose())}}),n},Rs={supported:!1,loading:!1,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null,error:null},xu=(e={})=>{const{enableHighAccuracy:t=!1,maximumAge:r=0,timeout:n=1/0,watch:s=!1}=e,o=$({...Rs});let i;if(typeof navigator<"u"&&"geolocation"in navigator){o.value={...Rs,supported:!0,loading:!0};const c={enableHighAccuracy:t,maximumAge:r,timeout:n===1/0?void 0:n},f=d=>{o.value={supported:!0,loading:!1,latitude:d.coords.latitude,longitude:d.coords.longitude,accuracy:d.coords.accuracy,altitude:d.coords.altitude,altitudeAccuracy:d.coords.altitudeAccuracy,heading:d.coords.heading,speed:d.coords.speed,timestamp:d.timestamp,error:null}},m=d=>{o.value={...o.value,loading:!1,error:d.message}};if(s){const d=navigator.geolocation.watchPosition(f,m,c);i=()=>{navigator.geolocation.clearWatch(d)}}else navigator.geolocation.getCurrentPosition(f,m,c)}const a=I(o);let l=!1;return Object.defineProperty(a,"destroy",{enumerable:!1,configurable:!0,value(){l||(l=!0,i?.(),o.dispose())}}),a},ju={acceleration:{x:null,y:null,z:null},accelerationIncludingGravity:{x:null,y:null,z:null},rotationRate:{alpha:null,beta:null,gamma:null},interval:0},Fu={alpha:null,beta:null,gamma:null,absolute:!1},Uu=()=>{const e=$({...ju});let t;if(typeof window<"u"){const s=o=>{e.value={acceleration:{x:o.acceleration?.x??null,y:o.acceleration?.y??null,z:o.acceleration?.z??null},accelerationIncludingGravity:{x:o.accelerationIncludingGravity?.x??null,y:o.accelerationIncludingGravity?.y??null,z:o.accelerationIncludingGravity?.z??null},rotationRate:{alpha:o.rotationRate?.alpha??null,beta:o.rotationRate?.beta??null,gamma:o.rotationRate?.gamma??null},interval:o.interval??0}};window.addEventListener("devicemotion",s),t=()=>{window.removeEventListener("devicemotion",s)}}const r=I(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value(){n||(n=!0,t?.(),e.dispose())}}),r},Bu=()=>{const e=$({...Fu});let t;if(typeof window<"u"){const s=o=>{e.value={alpha:o.alpha??null,beta:o.beta??null,gamma:o.gamma??null,absolute:o.absolute??!1}};window.addEventListener("deviceorientation",s),t=()=>{window.removeEventListener("deviceorientation",s)}}const r=I(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value(){n||(n=!0,t?.(),e.dispose())}}),r},Os="bQuery media: Clipboard API is unavailable. Use a secure context (HTTPS or localhost) and ensure clipboard permissions or user-activation requirements are met.",Wu={read:async()=>{if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")throw new Error(Os);return navigator.clipboard.readText()},write:async e=>{if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error(Os);return navigator.clipboard.writeText(e)}},Hu=(e,t)=>{let r;t==="border-box"?r=e.borderBoxSize:t==="device-pixel-content-box"?r=e.devicePixelContentBoxSize:r=e.contentBoxSize;const n=Array.isArray(r)?r[0]:r;return n&&typeof n.inlineSize=="number"&&typeof n.blockSize=="number"?{width:n.inlineSize,height:n.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}},Qu=(e,t)=>{const r=$({isIntersecting:!1,intersectionRatio:0,entry:null});let n,s=!1;if(typeof window<"u"&&typeof IntersectionObserver<"u")try{if(n=new IntersectionObserver(i=>{if(s)return;const a=i[i.length-1];a&&(r.value={isIntersecting:a.isIntersecting,intersectionRatio:a.intersectionRatio,entry:a})},{root:t?.root??null,rootMargin:t?.rootMargin??"0px",threshold:t?.threshold??0}),e){const i=Array.isArray(e)?e:[e];for(const a of i)n.observe(a)}}catch{n&&n.disconnect(),n=void 0}const o=I(r);return Object.defineProperties(o,{observe:{enumerable:!1,configurable:!0,value(i){if(!s)try{n?.observe(i)}catch{}}},unobserve:{enumerable:!1,configurable:!0,value(i){s||n?.unobserve(i)}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),o},Vu=(e,t)=>{const r=$({width:0,height:0,entry:null});let n,s=!1;const o=t?.box??"content-box",i=t?.box?{box:t.box}:void 0;if(typeof window<"u"&&typeof ResizeObserver<"u")try{if(n=new ResizeObserver(l=>{if(s)return;const c=l[l.length-1];if(c){const{width:f,height:m}=Hu(c,o);r.value={width:f,height:m,entry:c}}}),e){const l=Array.isArray(e)?e:[e];for(const c of l)n.observe(c,i)}}catch{n&&n.disconnect(),n=void 0}const a=I(r);return Object.defineProperties(a,{observe:{enumerable:!1,configurable:!0,value(l){if(!s)try{n?.observe(l,i)}catch{}}},unobserve:{enumerable:!1,configurable:!0,value(l){s||n?.unobserve(l)}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),a},Ku=(e,t)=>{const r=$({mutations:[],count:0});let n,s=!1,o=0;const i={attributes:t?.attributes??!0,childList:t?.childList??!1,characterData:t?.characterData??!1,subtree:t?.subtree??!1,attributeOldValue:t?.attributeOldValue??!1,characterDataOldValue:t?.characterDataOldValue??!1,...t&&t.attributeFilter!==void 0?{attributeFilter:t.attributeFilter}:{}};if(!i.attributes&&!i.childList&&!i.characterData&&(i.attributes=!0),i.attributes||(i.attributeOldValue=!1,delete i.attributeFilter),i.characterData||(i.characterDataOldValue=!1),typeof window<"u"&&typeof MutationObserver<"u")try{n=new MutationObserver(l=>{s||(o+=1,r.value={mutations:l,count:o})}),e&&n.observe(e,i)}catch{n&&n.disconnect(),n=void 0}const a=I(r);return Object.defineProperties(a,{observe:{enumerable:!1,configurable:!0,value(l){if(!s)try{n?.observe(l,i)}catch{}}},takeRecords:{enumerable:!1,configurable:!0,value(){return n?.takeRecords()??[]}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),a},Je=new Set,se=new Map,er=()=>{Oc(e=>se.get(e))};er();var Ls=e=>{se.clear();for(const[t,r]of e)se.set(t,r)},Yu=e=>({directive(t,r){if(typeof t!="string"||t.length===0)throw new Error("bQuery plugin directive: name must be a non-empty string");if(t.startsWith("bq-")){const n=t.slice(3);throw new Error(`bQuery plugin directive: name "${t}" must be provided without the "bq-" prefix`+(n?` (use "${n}")`:""))}if(typeof r!="function")throw new Error(`bQuery plugin directive: handler for "${t}" must be a function`);if(se.has(t))throw new Error(`bQuery plugin directive: a directive named "${t}" is already registered`);se.set(t,r)},component(t,r,n){if(typeof t!="string"||t.length===0)throw new Error("bQuery plugin component: tagName must be a non-empty string");if(!t.includes("-"))throw new Error(`bQuery plugin component: tagName "${t}" must be a valid custom element name containing a hyphen`);if(typeof r!="function")throw new Error(`bQuery plugin component: constructor for "${t}" must be a function`);if(typeof customElements>"u"){typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery] plugin component "${t}" was not registered because customElements is not available in this environment.`);return}!customElements.get(t)&&!e.some(s=>s.tagName===t)&&e.push({tagName:t,constructor:r,options:n})}}),Gu=(e,t)=>{if(er(),!e||typeof e!="object")throw new Error("bQuery plugin: use() expects a plugin object with { name, install }");if(typeof e.name!="string"||e.name.length===0)throw new Error('bQuery plugin: plugin must have a non-empty "name" property');if(typeof e.install!="function")throw new Error(`bQuery plugin: plugin "${e.name}" must have an "install" function`);if(Je.has(e.name))return;const r=[],n=Yu(r),s=new Map(se);try{e.install(n,t)}catch(o){throw Ls(s),o}try{for(const o of r)customElements.get(o.tagName)||customElements.define(o.tagName,o.constructor,o.options)}catch(o){throw Ls(s),o}Je.add(e.name)},Ju=e=>Je.has(e),Xu=()=>[...Je],Zu=e=>se.get(e),ef=()=>[...se.entries()].map(([e,t])=>({name:e,handler:t})),tf=()=>{Je.clear(),se.clear(),er()},Xe=!1,tr={},pe=[],St=new Map,$s=0,rf=(e,t)=>{Xe=e,tr=t??{},e||(pe.length=0,St.clear(),$s=0)},nf=()=>Xe,sf=(e,t,r)=>{if(Xe){if(typeof e!="string"||e.length===0)throw new Error("bQuery devtools: trackSignal() requires a non-empty label");St.set(e,{peek:t,subscriberCount:r})}},of=e=>{St.delete(e)},af=()=>`signal_${$s++}`,Ps=()=>{const e=[];for(const[t,r]of St)e.push({label:t,value:r.peek(),subscriberCount:r.subscriberCount()});return e},Ms=()=>{try{return Qt().map(e=>{const t=Te(e),r={};if(t&&typeof t=="object"&&"$state"in t){const n=t.$state;n&&typeof n=="object"&&Object.assign(r,n)}return{id:e,state:r}})}catch{return[]}},Ns=()=>{if(typeof document>"u")return[];const e=[],t=new Set,r=document.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n].tagName.toLowerCase();if(s.includes("-")&&!t.has(s)&&typeof customElements<"u"&&customElements.get(s)){t.add(s);const o=document.querySelectorAll(s);e.push({tagName:s,instanceCount:o.length})}}return e},lf=(e,t)=>{if(!Xe)return;const r={timestamp:Date.now(),type:e,detail:t};pe.push(r),tr.logToConsole&&console.log(`[bq:devtools] ${e} — ${t}`)},cf=()=>pe,uf=()=>{pe.length=0},ff=()=>({enabled:Xe,options:{...tr},timeline:[...pe]}),df=()=>{const e=Ps();if(e.length===0){console.log("[bq:devtools] No tracked signals.");return}console.table(e)},hf=()=>{const e=Ms();if(e.length===0){console.log("[bq:devtools] No stores registered.");return}console.table(e.map(t=>({id:t.id,state:JSON.stringify(t.state)})))},mf=()=>{const e=Ns();if(e.length===0){console.log("[bq:devtools] No custom elements found.");return}console.table(e)},pf=e=>{const t=typeof e=="number"&&e>0?pe.slice(-e):pe;if(t.length===0){console.log("[bq:devtools] Timeline is empty.");return}console.table(t.map(r=>({time:new Date(r.timestamp).toISOString(),type:r.type,detail:r.detail})))},Ds=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="_"),vf=(e,t)=>{let r=1,n="",s=t+1;for(;s<e.length;){const o=e[s];if(o==="\\"&&s+1<e.length){n+=o+e[s+1],s+=2;continue}if(o==="(")r++;else if(o===")"&&(r--,r===0))return{constraint:n,endIndex:s+1};n+=o,s++}return null},Is=new Map,yf=e=>{const t=Ht(e),r=Is.get(t);if(r)return r;const n=new RegExp(`^(?:${t})$`);return Is.set(t,n),n};function gf(e,t={}){if(!e||!e.includes("-"))throw new Error(`bQuery testing: "${e}" is not a valid custom element tag name (must contain a hyphen)`);const{props:r,slots:n,container:s=document.body}=t,o=document.createElement(e);if(r)for(const[a,l]of Object.entries(r))l!=null&&o.setAttribute(a,String(l));if(n)if(typeof n=="string")o.innerHTML=n;else{const a=[];for(const[l,c]of Object.entries(n))if(l==="default")a.push(c);else{const f=l.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(`<div slot="${f}">${c}</div>`)}o.innerHTML=a.join("")}return s.appendChild(o),{el:o,unmount:()=>{o.parentNode&&o.parentNode.removeChild(o)}}}function _s(){ce(()=>{})}function bf(e){const t=$(e);return Object.defineProperty(t,"initialValue",{value:e,writable:!1,enumerable:!0}),t.set=function(r){t.value=r},t.reset=function(){t.value=e},t}function wf(e,t){let r=e;t&&r.startsWith(t)&&(r=r.slice(t.length)||"/");let n="";const s=r.indexOf("#");s>=0&&(n=r.slice(s+1),r=r.slice(0,s));const o={},i=r.indexOf("?");if(i>=0){const a=r.slice(i+1);r=r.slice(0,i);for(const l of a.split("&")){const c=l.indexOf("="),f=c>=0?decodeURIComponent(l.slice(0,c)):decodeURIComponent(l),m=c>=0?decodeURIComponent(l.slice(c+1)):"",d=o[f];d!==void 0?Array.isArray(d)?d.push(m):o[f]=[d,m]:o[f]=m}}return{path:r||"/",query:o,hash:n}}function Ef(e,t){for(const r of t){const n=Sf(r.path,e);if(n)return{matched:r,params:n}}return{matched:null,params:{}}}function Sf(e,t){if(e==="*")return{};const r=new Map,n=(o,i)=>{const a=o.indexOf("/",i);return a===-1?o.length:a},s=(o,i)=>{const a=`${o}:${i}`;if(r.has(a))return r.get(a)??null;if(o===e.length){const f=i===t.length?{}:null;return r.set(a,f),f}const l=e[o];if(l==="*"){for(let f=t.length;f>=i;f--){const m=s(o+1,f);if(m)return r.set(a,m),m}return r.set(a,null),null}if(l===":"&&Ds(e[o+1])){let f=o+2;for(;f<e.length&&Ds(e[f]);)f++;const m=e.slice(o+1,f);let d=f,p,u=!1;if(e[f]==="("){const v=vf(e,f);v&&(p=v.constraint,d=v.endIndex)}e[d]==="*"&&(u=!0,d++);const h=u||p?t.length:n(t,i);for(let v=h;v>i;v--){const b=t.slice(i,v);if(p&&!yf(p).test(b))continue;const y=s(d,v);if(y){const w={[m]:b,...y};return r.set(a,w),w}}return r.set(a,null),null}if(i>=t.length||l!==t[i])return r.set(a,null),null;const c=s(o+1,i+1);return r.set(a,c),c};return s(0,0)}function Af(e={}){const t=e.routes??[{path:"*",component:()=>null}],r=e.base??"",n=e.initialPath??"/",s=i=>{const{path:a,query:l,hash:c}=wf(i,r),{matched:f,params:m}=Ef(a,t);return{path:a,params:m,query:l,matched:f,hash:c}},o=$(s(n));return{push(i){o.value=s(i)},replace(i){o.value=s(i)},get currentRoute(){return o},get routes(){return t},destroy(){o.dispose()}}}function kf(e,t,r={}){if(!e)throw new Error("bQuery testing: fireEvent requires a valid element");if(!t)throw new Error("bQuery testing: fireEvent requires an event name");const{bubbles:n=!0,cancelable:s=!0,composed:o=!0,detail:i}=r;let a;i!==void 0?a=new CustomEvent(t,{bubbles:n,cancelable:s,composed:o,detail:i}):a=new Event(t,{bubbles:n,cancelable:s,composed:o});const l=e.dispatchEvent(a);return _s(),l}async function Tf(e,t={}){if(typeof e!="function")throw new Error("bQuery testing: waitFor requires a predicate function");const{timeout:r=1e3,interval:n=10}=t,s=Date.now();for(;;){try{if(await e())return}catch{}if(Date.now()-s>=r)throw new Error(`bQuery testing: waitFor timed out after ${r}ms — predicate never returned true`);await new Promise(o=>setTimeout(o,n))}}var Cf=(e,t,r={})=>{const{hydrate:n=!0,...s}=r;if(!n)throw new Error("bQuery ssr: hydrateMount() requires { hydrate: true } when options are provided.");return Jt(e,t,s)},At=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),rr=e=>{const t={};for(const[r,n]of Object.entries(e))x(r)||(t[r]=n);return t},qs=e=>e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\//g,"\\u002f").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),Rf=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),zs=(e={})=>{const{scriptId:t="__BQUERY_STORE_STATE__",globalKey:r="__BQUERY_INITIAL_STATE__",storeIds:n,serialize:s=JSON.stringify}=e;if(x(r))throw new Error(`serializeStoreState: invalid globalKey "${r}" - prototype-pollution keys are not allowed.`);if(x(t))throw new Error(`serializeStoreState: invalid scriptId "${t}" - prototype-pollution keys are not allowed.`);const o=n??Qt(),i=Object.create(null);for(const f of o){if(x(f))continue;const m=Te(f);m&&(i[f]=rr(m.$state))}const a=s(i);if(typeof a!="string")throw new Error("serializeStoreState: custom serialize function must return a string.");if(s!==JSON.stringify){let f;try{f=JSON.parse(a)}catch{throw new Error("serializeStoreState: custom serialize function returned invalid JSON.")}if(!At(f))throw new Error("serializeStoreState: custom serialize function must return a JSON object string.")}const l=qs(a),c=qs(JSON.stringify(r));return{stateJson:a,scriptTag:`<script id="${Rf(t)}">window[${c}]=${l}<\/script>`}},Of=(e="__BQUERY_INITIAL_STATE__",t="__BQUERY_STORE_STATE__")=>{if(x(e))throw new Error(`deserializeStoreState: invalid globalKey "${e}" - prototype-pollution keys are not allowed.`);if(x(t))throw new Error(`deserializeStoreState: invalid scriptId "${t}" - prototype-pollution keys are not allowed.`);if(typeof window>"u")return{};const r=window[e];if(!r)return{};try{delete window[e]}catch{window[e]=void 0}if(typeof document<"u"&&typeof document.getElementById=="function"){const s=document.getElementById(t);s&&s.remove()}if(!At(r))return{};for(const s of Object.values(r))if(!At(s))return{};const n=Object.create(null);for(const[s,o]of Object.entries(r))x(s)||!At(o)||(n[s]=rr(o));return n},xs=(e,t)=>{const r=Te(e);r&&typeof r.$patch=="function"&&r.$patch(rr(t))},Lf=e=>{for(const[t,r]of Object.entries(e))xs(t,r)},$f=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),js=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Pf=e=>js(e).replace(/"/g,"&quot;"),Mf=e=>{const t=e.toLowerCase();return t==="href"||t==="src"||t==="xlink:href"||t==="formaction"||t==="action"||t==="poster"||t==="background"||t==="cite"||t==="data"},Nf=e=>e.trim().replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),Df=e=>{const t=Nf(e);return ur.some(r=>t.startsWith(r))},Fs=e=>{if(e.nodeType===Node.TEXT_NODE)return js(e.textContent??"");if(e.nodeType!==Node.ELEMENT_NODE)return"";const t=e,r=t.tagName.toLowerCase();if(r==="script")return"";let n="";for(const o of t.attributes){const i=o.name.toLowerCase();i.startsWith("on")||Mf(i)&&Df(o.value)||(n+=` ${o.name}="${Pf(o.value)}"`)}if($f.has(r))return`<${r}${n}>`;let s="";for(const o of t.childNodes)s+=Fs(o);return`<${r}${n}>${s}</${r}>`},Us=e=>fe(e)||qe(e)?e.value:e,G=(e,t)=>{const r=e.trim();if(r.startsWith("!"))return!G(r.slice(1).trim(),t);if(r.startsWith("'")&&r.endsWith("'")||r.startsWith('"')&&r.endsWith('"'))return r.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;if(r!=="undefined"){if(/^[\w$]+(?:\.[\w$]+)*$/.test(r)){const n=r.split(".");let s=t;for(const o of n){if(s==null)return;s===t?s=Us(s[o]):s=s[o]}return s}try{const n=Object.keys(t),s=n.map(o=>Us(t[o]));return new Function(...n,`return (${r});`)(...s)}catch{return}}},If=e=>{const t=e.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);return t?{itemName:t[1],indexName:t[2]||void 0,listExpr:t[3].trim()}:null},nr=(e,t,r,n)=>{const s=e.getAttribute(`${r}-if`);if(s!==null&&!G(s,t))return!1;const o=e.getAttribute(`${r}-show`);if(o!==null&&!G(o,t)){const d=e;d.style?d.style.display="none":e.setAttribute("style","display: none;")}const i=e.getAttribute(`${r}-text`);if(i!==null){const d=G(i,t);e.textContent=String(d??"")}const a=e.getAttribute(`${r}-html`);if(a!==null){const d=G(a,t);e.innerHTML=String(X(String(d??"")))}const l=e.getAttribute(`${r}-class`);if(l!==null){const d=l.trim();if(d.startsWith("{")){const p=d.slice(1,-1).trim().split(",");for(const u of p){const h=u.indexOf(":");if(h>-1){const v=u.slice(0,h).trim().replace(/^['"]|['"]$/g,"");G(u.slice(h+1).trim(),t)&&e.classList.add(v)}}}else{const p=G(l,t);typeof p=="string"?p.split(/\s+/).filter(Boolean).forEach(u=>e.classList.add(u)):Array.isArray(p)&&p.filter(Boolean).forEach(u=>e.classList.add(u))}}const c=e.getAttribute(`${r}-style`);if(c!==null){const d=G(c,t);if(d&&typeof d=="object"){const p=e;for(const[u,h]of Object.entries(d)){const v=u.replace(/([A-Z])/g,"-$1").toLowerCase();p.style.setProperty(v,String(h))}}}const f=Array.from(e.attributes);for(const d of f)if(d.name.startsWith(`${r}-bind:`)){const p=d.name.slice(`${r}-bind:`.length),u=G(d.value,t);u===!1||u===null||u===void 0?e.removeAttribute(p):u===!0?e.setAttribute(p,""):e.setAttribute(p,String(u))}const m=e.getAttribute(`${r}-for`);if(m!==null){const d=If(m);if(d){const p=G(d.listExpr,t);if(Array.isArray(p)&&e.parentNode){const u=e.parentNode;for(let h=0;h<p.length;h++){const v=p[h],b=e.cloneNode(!0);b.removeAttribute(`${r}-for`),b.removeAttribute(":key"),b.removeAttribute(`${r}-key`);const y={...t,[d.itemName]:v};d.indexName&&(y[d.indexName]=h),nr(b,y,r,n),sr(b,y,r,n),u.insertBefore(b,e)}return u.removeChild(e),!0}}}return!0},sr=(e,t,r,n)=>{const s=Array.from(e.children);for(const o of s){if(o.hasAttribute(`${r}-for`)){nr(o,t,r,n)||o.remove();continue}if(!nr(o,t,r,n)){o.remove();continue}sr(o,t,r,n)}},Bs=(e,t)=>{const r=Array.from(e.attributes);for(const n of r)(n.name.startsWith(`${t}-`)||n.name.startsWith(":")||n.name===":key")&&e.removeAttribute(n.name);for(const n of Array.from(e.children))Bs(n,t)},_f=(e,t,r={})=>{const{prefix:n="bq",stripDirectives:s=!1,includeStoreState:o=!1}=r;if(!e||typeof e!="string")throw new Error("bQuery SSR: template must be a non-empty string.");if(typeof DOMParser>"u")throw new Error("bQuery SSR: DOMParser is not available in this environment. Provide a DOMParser-compatible implementation before calling renderToString().");const i=new DOMParser().parseFromString(e.trim(),"text/html"),a=i.body||i.documentElement;if(!a)throw new Error("bQuery SSR: Failed to parse template.");if(sr(a,t,n,i),s)for(const f of Array.from(a.children))Bs(f,n);let l="";for(const f of a.childNodes)l+=Fs(f);let c;return o&&(c=zs({storeIds:Array.isArray(o)?o:void 0}).stateJson),{html:l,storeState:c}};return g.$=go,g.$$=bo,g.BQueryCollection=st,g.BQueryElement=be,g.BqLinkElement=Bn,g.Computed=Ie,g.HttpError=ie,g.Signal=_e,g.TaskWorkerAbortError=ae,g.TaskWorkerError=F,g.TaskWorkerSerializationError=de,g.TaskWorkerTimeoutError=lt,g.TaskWorkerUnsupportedError=It,g.animate=vt,g.announceToScreenReader=ru,g.auditA11y=uu,g.back=gl,g.batch=ce,g.batchTasks=fa,g.bool=La,g.breakpoints=Du,g.buckets=el,g.cache=rl,g.callWorkerMethod=sa,g.capturePosition=Ut,g.clearAnnouncements=nu,g.clearTimeline=uf,g.clipboard=Wu,g.component=Ee,g.computed=D,g.createForm=Dc,g.createHttp=Pt,g.createI18n=Zc,g.createPersistedStore=ic,g.createReactiveRpcPool=ga,g.createReactiveRpcWorker=va,g.createReactiveTaskPool=ya,g.createReactiveTaskWorker=pa,g.createRequestQueue=_i,g.createRestClient=Wi,g.createRouter=jl,g.createRpcPool=en,g.createRpcWorker=ut,g.createStore=Vt,g.createTaskPool=ht,g.createTaskWorker=ft,g.createTemplate=$c,g.createTrustedHtml=co,g.createUseFetch=Si,g.currentRoute=xn,g.custom=Kc,g.customAsync=Yc,g.deduplicateRequest=Qi,g.defineBqueryConfig=ti,g.defineComponent=Ta,g.definePageMeta=fl,g.defineStore=Xl,g.deserializeStoreState=Of,g.destroyStore=Gl,g.draggable=Au,g.droppable=$u,g.easeInCubic=Rn,g.easeInOutCubic=Ln,g.easeInOutQuad=Cn,g.easeInQuad=kn,g.easeOutBack=$n,g.easeOutCubic=On,g.easeOutExpo=Pn,g.easeOutQuad=Tn,g.easingPresets=_a,g.effect=j,g.effectScope=oi,g.email=Wc,g.enableDevtools=rf,g.escapeHtml=br,g.every=ln,g.filter=on,g.find=cn,g.fireEvent=kf,g.flip=Bt,g.flipElements=Mn,g.flipList=qa,g.flushEffects=_s,g.formatDate=fs,g.formatNumber=us,g.forward=bl,g.generateNonce=io,g.generateSignalLabel=af,g.getBqueryConfig=Z,g.getConcurrencySupport=Qr,g.getCurrentScope=Pr,g.getCustomDirective=Zu,g.getCustomDirectives=ef,g.getDevtoolsState=ff,g.getFocusableElements=Zt,g.getInstalledPlugins=Xu,g.getStore=Te,g.getTimeline=cf,g.getTrustedTypesPolicy=gr,g.hasCSPDirective=ao,g.html=Se,g.http=Ii,g.hydrateMount=Cf,g.hydrateStore=xs,g.hydrateStores=Lf,g.inspectComponents=Ns,g.inspectSignals=Ps,g.inspectStores=Ms,g.interceptLinks=Tl,g.isActive=_l,g.isActiveSignal=ql,g.isComputed=qe,g.isConcurrencySupported=_t,g.isDevtoolsEnabled=nf,g.isInstalled=Ju,g.isNavigating=vl,g.isSignal=fe,g.isTrustedTypesSupported=lo,g.keyframePresets=za,g.linear=An,g.link=kl,g.linkedSignal=qi,g.listStores=Qt,g.logComponents=mf,g.logSignals=df,g.logStores=hf,g.logTimeline=pf,g.map=sn,g.mapActions=tc,g.mapGetters=ec,g.mapState=Zl,g.matchField=Gc,g.max=Vc,g.maxLength=Uc,g.mediaQuery=Nu,g.min=Qc,g.minLength=Fc,g.mockRouter=Af,g.mockSignal=bf,g.morphElement=xa,g.mount=Jt,g.navigate=Be,g.notifications=ll,g.onScopeDispose=Mr,g.parallax=ja,g.parallel=ua,g.pattern=Bc,g.persistedSignal=ji,g.pipeline=ma,g.prefersColorScheme=fu,g.prefersContrast=du,g.prefersReducedMotion=ee,g.readonly=I,g.recordEvent=lf,g.reduce=un,g.registerBqLink=Al,g.registerDefaultComponents=Da,g.registerPlugin=Vl,g.releaseFocus=wu,g.renderComponent=gf,g.renderToString=_f,g.required=jc,g.resetPlugins=tf,g.resolve=Il,g.rovingTabIndex=hu,g.runTask=Yr,g.safeHtml=$a,g.sanitize=X,g.sanitizeHtml=X,g.scrollAnimate=Ua,g.sequence=Ya,g.serializeStoreState=zs,g.setReducedMotion=Ia,g.signal=$,g.skipLink=yu,g.some=an,g.sortable=Mu,g.spring=Wa,g.springPresets=Ha,g.stagger=Qa,g.storage=pl,g.stripTags=uo,g.timeline=Ga,g.toValue=Vi,g.trackSignal=sf,g.transition=Ja,g.trapFocus=bu,g.trusted=no,g.typewriter=Xa,g.untrack=ue,g.untrackSignal=of,g.url=Hc,g.use=Gu,g.useAnnouncer=ul,g.useAsyncData=Dr,g.useBattery=zu,g.useComputed=Ea,g.useCookie=al,g.useDeviceMotion=Uu,g.useDeviceOrientation=Bu,g.useEffect=Sa,g.useEventSource=Xi,g.useFetch=K,g.useFormField=qc,g.useGeolocation=xu,g.useInfiniteFetch=xi,g.useIntersectionObserver=Qu,g.useMutationObserver=Ku,g.useNetworkStatus=_u,g.usePaginatedFetch=zi,g.usePolling=Fi,g.useResizeObserver=Vu,g.useResource=Ui,g.useResourceList=Hi,g.useRoute=Ul,g.useSignal=wa,g.useSubmit=Bi,g.useViewport=Iu,g.useWebSocket=Br,g.useWebSocketChannel=Ji,g.utils=Go,g.waitFor=Tf,g.watch=Nt,g.watchDebounce=Ki,g.watchStore=ac,g.watchThrottle=Yi,g})({});
275
+ `,Eo=0,qe=new Map,ed=()=>typeof document>"u"?!1:typeof document.createElement=="function"&&typeof document.querySelector=="function"&&typeof document.getElementById=="function"&&document.body!==null&&document.body!==void 0,td=()=>({destroy:()=>{},element:null}),rd=(e,t={})=>{if(!ed())return td();const{text:r="Skip to main content",className:n="bq-skip-link"}=t;let s,o;const i=m=>{try{return document.querySelector(m)}catch{return null}},a=()=>{if(!s)return;const m=qe.get(s),v=(m?.count??0)-1;v<=0?(qe.delete(s),m?.target.isConnected&&m.target.id===s&&m.target.removeAttribute("id")):qe.set(s,{count:v,target:m.target}),s=void 0},c=()=>{if(!o)return;const{target:m,hadTabIndex:v,previousTabIndex:b}=o;m.isConnected&&(v?m.setAttribute("tabindex",b??""):m.removeAttribute("tabindex")),o=void 0},l=m=>{if(o?.target!==m){if(c(),m.hasAttribute("tabindex")){o={target:m,hadTabIndex:!0,previousTabIndex:m.getAttribute("tabindex")};return}m.tabIndex===-1&&(o={target:m,hadTabIndex:!1,previousTabIndex:null},m.setAttribute("tabindex","-1"))}},u=(m,v)=>{if(s===v)return;a();const b=qe.get(v);qe.set(v,{count:(b?.count??0)+1,target:m}),s=v},h=()=>{if(e.startsWith("#")){const v=e.slice(1),b=v?document.getElementById(v):null;return b||i(e)}const m=document.getElementById(e);return m||i(e)},d=m=>{if(m.id)return qe.get(m.id)?.target===m&&u(m,m.id),m.id;let v;do Eo+=1,v=`bq-skip-target-${Eo}`;while(document.getElementById(v)!==null);return m.id=v,u(m,v),v},p=document.createElement("a"),f=h();return p.href=e.startsWith("#")?e:f?`#${d(f)}`:`#${e}`,p.textContent=r,p.className=n,p.setAttribute("style",Dr),p.addEventListener("focus",()=>{p.setAttribute("style",Dr+Zf)}),p.addEventListener("blur",()=>{p.setAttribute("style",Dr)}),p.addEventListener("click",m=>{m.preventDefault();const v=h();v&&(p.href=`#${d(v)}`,l(v),v.focus())}),document.body.firstChild?document.body.insertBefore(p,document.body.firstChild):document.body.appendChild(p),{destroy:()=>{c(),a(),p.remove()},element:p}},nd=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]',"details > summary","audio[controls]","video[controls]"].join(", "),_r=e=>Array.from(e.querySelectorAll(nd)).filter(t=>!t.hasAttribute("disabled")&&t.tabIndex!==-1&&t.getClientRects().length>0),Ao=(e,t)=>e?typeof e=="string"?t.querySelector(e):e:null,sd=(e,t={})=>{const{escapeDeactivates:r=!0,onEscape:n,initialFocus:s,returnFocus:o}=t;if(typeof document>"u"||typeof document.addEventListener!="function"||typeof document.removeEventListener!="function"){let h=!1;return{get active(){return h},release:()=>{h=!1}}}const i=document.activeElement;let a=!0;const c=h=>{if(!a)return;if(h.key==="Escape"&&r){h.preventDefault(),u.release(),n?.();return}if(h.key!=="Tab")return;const d=_r(e);if(d.length===0){h.preventDefault();return}const p=d[0],f=d[d.length-1];h.shiftKey?(document.activeElement===p||!e.contains(document.activeElement))&&(h.preventDefault(),f.focus()):(document.activeElement===f||!e.contains(document.activeElement))&&(h.preventDefault(),p.focus())};document.addEventListener("keydown",c,!0);const l=Ao(s,e);if(l)l.focus();else{const h=_r(e);h.length>0&&h[0].focus()}const u={get active(){return a},release:()=>{if(!a)return;a=!1,document.removeEventListener("keydown",c,!0);const h=Ao(o,document.body);h?h.focus():i&&i.focus&&i.focus()}};return u},od=e=>{e.release()},at=new Map,ko=()=>{const e=Array.from(at.values());return e[e.length-1]},id=(e,t)=>{if(typeof t=="object")return t;let r=null;if(t==="parent"?r=e.parentElement:r=document.querySelector(t),!r)return null;const n=r.getBoundingClientRect(),s=e.getBoundingClientRect(),o=parseFloat(e.style.left||"0"),i=parseFloat(e.style.top||"0"),a=Number.isNaN(o)?0:o,c=Number.isNaN(i)?0:i;return{left:n.left-s.left+a,top:n.top-s.top+c,right:n.right-s.right+a+(n.width-s.width),bottom:n.bottom-s.bottom+c+(n.height-s.height)}},ad=(e,t)=>t?{x:Math.max(t.left,Math.min(t.right,e.x)),y:Math.max(t.top,Math.min(t.bottom,e.y))}:e,cd=(e,t={})=>{const{axis:r="both",bounds:n,handle:s,ghost:o=!1,ghostClass:i="bq-drag-ghost",draggingClass:a="bq-dragging",onDragStart:c,onDrag:l,onDragEnd:u}=t;let h=!t.disabled,d=!1,p={x:0,y:0},f={x:0,y:0},m={x:0,y:0},v=null,b=null;const g=e.style.touchAction,w=e.style.userSelect,S=C=>({element:e,position:{...f},delta:{x:f.x-m.x,y:f.y-m.y},event:C}),k=()=>{const C=e.cloneNode(!0),$=e.getBoundingClientRect();return C.classList.add(i),C.style.position="fixed",C.style.left=`${$.left}px`,C.style.top=`${$.top}px`,C.style.width=`${$.width}px`,C.style.height=`${$.height}px`,C.style.pointerEvents="none",C.style.zIndex="999999",C.style.opacity="0.7",C.style.margin="0",document.body.appendChild(C),C},A=()=>{v&&(v.remove(),v=null),b=null},E=C=>{if(h&&!(s&&!C.target.closest(s))){if(C.preventDefault(),d=!0,p={x:C.clientX,y:C.clientY},m={...f},e.classList.add(a),e.setPointerCapture(C.pointerId),o){const $=e.getBoundingClientRect();b={x:$.left,y:$.top},v=k()}at.set(e,{element:e,position:f}),c?.(S(C))}},T=C=>{if(!d)return;C.preventDefault(),m={...f};let $=f.x+(C.clientX-p.x),R=f.y+(C.clientY-p.y);p={x:C.clientX,y:C.clientY},r==="x"&&(R=f.y),r==="y"&&($=f.x);let O={x:$,y:R};if(n){const I=id(e,n);O=ad(O,I)}if(f=O,at.set(e,{element:e,position:f}),o&&v){const I=b??{x:e.getBoundingClientRect().left,y:e.getBoundingClientRect().top};v.style.left=`${I.x+f.x}px`,v.style.top=`${I.y+f.y}px`}else e.style.transform=`translate(${f.x}px, ${f.y}px)`;l?.(S(C))},P=C=>{if(d){d=!1,e.classList.remove(a);try{typeof e.releasePointerCapture=="function"&&(typeof e.hasPointerCapture!="function"||e.hasPointerCapture(C.pointerId))&&e.releasePointerCapture(C.pointerId)}catch{}finally{A(),at.delete(e),u?.(S(C))}}};return e.addEventListener("pointerdown",E),e.addEventListener("pointermove",T),e.addEventListener("pointerup",P),e.addEventListener("pointercancel",P),e.style.touchAction="none",e.style.userSelect="none",{destroy:()=>{e.removeEventListener("pointerdown",E),e.removeEventListener("pointermove",T),e.removeEventListener("pointerup",P),e.removeEventListener("pointercancel",P),A(),at.delete(e),e.style.touchAction=g,e.style.userSelect=w,e.classList.remove(a)},disable:()=>{h=!1},enable:()=>{h=!0},get enabled(){return h}}},ld={passive:!0},ct=new Set,lt=null,de=null,To=()=>Array.from(ct),ud=()=>typeof document<"u"&&typeof document.addEventListener=="function"&&typeof document.removeEventListener=="function"&&typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function",fd=e=>{for(const t of To())t.handlePointerMove(e)},dd=()=>{de=null;const e=lt;lt=null,e&&fd(e)},Ro=e=>{lt=e,de===null&&(de=requestAnimationFrame(dd))},Co=e=>{de!==null&&(cancelAnimationFrame(de),de=null,lt=null);for(const t of To())t.handlePointerUp(e)},hd=e=>{ct.size===0&&(document.addEventListener("pointermove",Ro,ld),document.addEventListener("pointerup",Co)),ct.add(e)},md=e=>{ct.delete(e),ct.size===0&&(document.removeEventListener("pointermove",Ro),document.removeEventListener("pointerup",Co),de!==null&&(cancelAnimationFrame(de),de=null),lt=null)},$o=(e,t)=>t?typeof t=="string"?e.matches(t):t(e):!0,pd=(e,t={})=>{const{overClass:r="bq-drop-over",accept:n,onDragEnter:s,onDragOver:o,onDragLeave:i,onDrop:a}=t;if(!ud())return{destroy:()=>{}};let c=!1,l=null;const u=(b,g)=>({zone:e,dragged:b,event:g}),h=b=>{const g=e.getBoundingClientRect();return b.clientX>=g.left&&b.clientX<=g.right&&b.clientY>=g.top&&b.clientY<=g.bottom},d=()=>ko()?.element??l,p=(b,g=l)=>{c&&(c=!1,e.classList.remove(r),g&&i?.(u(g,b)),l=null)},v={handlePointerMove:b=>{const g=ko()?.element??null,w=h(b);if(!(g!==null&&g!==e&&$o(g,n))||!w){p(b,g??l);return}c?o?.(u(g,b)):(c=!0,l=g,e.classList.add(r),s?.(u(g,b)))},handlePointerUp:b=>{const g=d(),w=h(b),S=g!==null&&g!==e&&$o(g,n);w&&S&&g&&a?.(u(g,b)),c&&(c=!1,e.classList.remove(r)),l=null}};return hd(v),{destroy:()=>{md(v),e.classList.remove(r),l=null}}},Oo=(e,t)=>Array.from(e.querySelectorAll(t)),vd=(e,t,r,n)=>{let s=null;for(let o=0;o<e.length;o++){const i=e[o];if(i===n)continue;const a=i.getBoundingClientRect(),c=t-(r==="y"?a.top+a.height/2:a.left+a.width/2);(s===null||c<0&&c>s.distance||s.distance>=0&&c<0&&Math.abs(c)<Math.abs(s.distance))&&c<0&&(s={element:i,index:o,distance:c})}return s?{element:s.element,index:s.index}:null},yd=(e,t={})=>{const{items:r=":scope > *",axis:n="y",handle:s,placeholderClass:o="bq-sort-placeholder",sortingClass:i="bq-sorting",animationDuration:a=200,onSortStart:c,onSortMove:l,onSortEnd:u}=t;let h=!t.disabled,d=!1,p=null,f=null,m=-1,v=0,b=0,g=0,w=0;const S=(P,C,$)=>({container:e,item:P,oldIndex:C,newIndex:$}),k=P=>{if(!h)return;const C=P.target,$=Oo(e,r);let R=null;for(const I of $)if(I.contains(C)){R=I;break}if(!R||s&&!C.closest(s))return;P.preventDefault(),d=!0,p=R,m=$.indexOf(R),v=P.clientY,b=P.clientX;const O=R.getBoundingClientRect();g=O.top,w=O.left,f=document.createElement("div"),f.classList.add(o),f.style.width=`${O.width}px`,f.style.height=`${O.height}px`,f.style.boxSizing="border-box",R.classList.add(i),R.style.position="fixed",R.style.width=`${O.width}px`,R.style.height=`${O.height}px`,R.style.left=`${O.left}px`,R.style.top=`${O.top}px`,R.style.zIndex="999999",R.style.pointerEvents="none",R.style.margin="0",R.parentNode?.insertBefore(f,R),e.setPointerCapture(P.pointerId),c?.(S(R,m,m))},A=P=>{if(!d||!p||!f)return;P.preventDefault();const C=P.clientX-b,$=P.clientY-v;n==="y"?p.style.top=`${g+$}px`:p.style.left=`${w+C}px`;const R=vd(Oo(e,r),n==="y"?P.clientY:P.clientX,n,p);R?e.insertBefore(f,R.element):e.appendChild(f);const O=Array.from(e.children).indexOf(f);l?.(S(p,m,O))},E=P=>{if(!d||!p||!f)return;d=!1;const C=p,$=Array.from(e.children).indexOf(f),R=f.getBoundingClientRect(),O=C.getBoundingClientRect();if(a>0){const I=R.left-O.left,x=R.top-O.top;C.style.transition=`transform ${a}ms ease`,C.style.transform=`translate(${I}px, ${x}px)`;let W=!1,q=null;const V=()=>{W||(W=!0,q!==null&&(window.clearTimeout(q),q=null),T(),u?.(S(C,m,$)))};q=window.setTimeout(()=>{V()},a+50),C.addEventListener("transitionend",V,{once:!0})}else T(),u?.(S(C,m,$));e.releasePointerCapture(P.pointerId)},T=()=>{!p||!f||(f.parentNode?.insertBefore(p,f),f.remove(),f=null,p.classList.remove(i),p.style.position="",p.style.width="",p.style.height="",p.style.left="",p.style.top="",p.style.zIndex="",p.style.pointerEvents="",p.style.margin="",p.style.transition="",p.style.transform="",p=null)};return e.addEventListener("pointerdown",k),e.addEventListener("pointermove",A),e.addEventListener("pointerup",E),e.addEventListener("pointercancel",E),e.style.touchAction="none",{destroy:()=>{e.removeEventListener("pointerdown",k),e.removeEventListener("pointermove",A),e.removeEventListener("pointerup",E),e.removeEventListener("pointercancel",E),e.style.touchAction="",d&&T()},disable:()=>{h=!1},enable:()=>{h=!0},get enabled(){return h}}},gd=e=>{const t=L(!1);let r;if(typeof window<"u"&&typeof window.matchMedia=="function")try{const o=window.matchMedia(e);t.value=o.matches;const i=a=>{t.value=a.matches};if(typeof o.addEventListener=="function")o.addEventListener("change",i),r=()=>{o.removeEventListener("change",i)};else if(typeof o.addListener=="function"){const a=o;a.addListener(i),r=()=>{a.removeListener(i)}}}catch{}const n=_(t);let s=!1;return Object.defineProperty(n,"destroy",{enumerable:!1,configurable:!0,value(){s||(s=!0,r?.(),t.dispose())}}),n},bd=e=>{const t={},r=[];for(const o of Object.keys(e)){const i=e[o],a=L(!1);let c;if(typeof window<"u"&&typeof window.matchMedia=="function")try{const h=window.matchMedia(`(min-width: ${i}px)`);a.value=h.matches;const d=p=>{a.value=p.matches};if(typeof h.addEventListener=="function")h.addEventListener("change",d),c=()=>{h.removeEventListener("change",d)};else{const p=h;typeof p.addListener=="function"&&(p.addListener(d),c=()=>{p.removeListener?.(d)})}}catch{}const l=_(a);let u=!1;Object.defineProperty(l,"destroy",{enumerable:!1,configurable:!0,value(){u||(u=!0,c?.(),a.dispose())}}),r.push(l.destroy),t[o]=l}let n=!1;const s=Object.defineProperty(t,"destroyAll",{enumerable:!1,configurable:!0,value(){n||(n=!0,r.forEach(o=>{o()}))}});return Object.prototype.hasOwnProperty.call(t,"destroy")||Object.defineProperty(s,"destroy",{enumerable:!1,configurable:!0,value:s.destroyAll}),s},Lo=(e,t)=>t>=e?"portrait":"landscape",wd=()=>{const e=L({width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0,orientation:typeof window<"u"?Lo(window.innerWidth,window.innerHeight):"portrait"});let t;if(typeof window<"u"){const s=()=>{e.value={width:window.innerWidth,height:window.innerHeight,orientation:Lo(window.innerWidth,window.innerHeight)}};window.addEventListener("resize",s),t=()=>{window.removeEventListener("resize",s)}}const r=_(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value:()=>{n||(n=!0,t?.(),e.dispose())}}),r},Po=()=>{const e=typeof navigator<"u"&&navigator.onLine!==void 0?navigator.onLine:!0,t=(typeof navigator<"u"?navigator:void 0)?.connection;return{online:e,effectiveType:t?.effectiveType??"unknown",downlink:t?.downlink??0,rtt:t?.rtt??0}},Sd=()=>{const e=L(Po());let t;if(typeof window<"u"){const s=()=>{e.value=Po()};window.addEventListener("online",s),window.addEventListener("offline",s);const o=typeof navigator<"u"?navigator:void 0;o?.connection&&typeof o.connection.addEventListener=="function"&&o.connection.addEventListener("change",s),t=()=>{window.removeEventListener("online",s),window.removeEventListener("offline",s),o?.connection&&typeof o.connection.removeEventListener=="function"&&o.connection.removeEventListener("change",s)}}const r=_(e);let n=!1;return Object.defineProperty(r,"destroy",{value(){n||(n=!0,t?.(),e.dispose())},enumerable:!1,configurable:!0}),r},Ed={supported:!1,charging:!1,chargingTime:0,dischargingTime:0,level:1},Ad=()=>{const e=L({...Ed});let t,r=!1;typeof navigator<"u"&&"getBattery"in navigator&&typeof navigator.getBattery=="function"&&navigator.getBattery().then(s=>{if(r)return;const o=()=>{e.value={supported:!0,charging:s.charging,chargingTime:s.chargingTime,dischargingTime:s.dischargingTime,level:s.level}};o(),s.addEventListener("chargingchange",o),s.addEventListener("chargingtimechange",o),s.addEventListener("dischargingtimechange",o),s.addEventListener("levelchange",o),t=()=>{s.removeEventListener("chargingchange",o),s.removeEventListener("chargingtimechange",o),s.removeEventListener("dischargingtimechange",o),s.removeEventListener("levelchange",o)}}).catch(()=>{});const n=_(e);return Object.defineProperty(n,"destroy",{enumerable:!1,configurable:!0,value(){r||(r=!0,t?.(),e.dispose())}}),n},No={supported:!1,loading:!1,latitude:null,longitude:null,accuracy:null,altitude:null,altitudeAccuracy:null,heading:null,speed:null,timestamp:null,error:null},kd=(e={})=>{const{enableHighAccuracy:t=!1,maximumAge:r=0,timeout:n=1/0,watch:s=!1}=e,o=L({...No});let i;if(typeof navigator<"u"&&"geolocation"in navigator){o.value={...No,supported:!0,loading:!0};const l={enableHighAccuracy:t,maximumAge:r,timeout:n===1/0?void 0:n},u=d=>{o.value={supported:!0,loading:!1,latitude:d.coords.latitude,longitude:d.coords.longitude,accuracy:d.coords.accuracy,altitude:d.coords.altitude,altitudeAccuracy:d.coords.altitudeAccuracy,heading:d.coords.heading,speed:d.coords.speed,timestamp:d.timestamp,error:null}},h=d=>{o.value={...o.value,loading:!1,error:d.message}};if(s){const d=navigator.geolocation.watchPosition(u,h,l);i=()=>{navigator.geolocation.clearWatch(d)}}else navigator.geolocation.getCurrentPosition(u,h,l)}const a=_(o);let c=!1;return Object.defineProperty(a,"destroy",{enumerable:!1,configurable:!0,value(){c||(c=!0,i?.(),o.dispose())}}),a},Td={acceleration:{x:null,y:null,z:null},accelerationIncludingGravity:{x:null,y:null,z:null},rotationRate:{alpha:null,beta:null,gamma:null},interval:0},Rd={alpha:null,beta:null,gamma:null,absolute:!1},Cd=()=>{const e=L({...Td});let t;if(typeof window<"u"){const s=o=>{e.value={acceleration:{x:o.acceleration?.x??null,y:o.acceleration?.y??null,z:o.acceleration?.z??null},accelerationIncludingGravity:{x:o.accelerationIncludingGravity?.x??null,y:o.accelerationIncludingGravity?.y??null,z:o.accelerationIncludingGravity?.z??null},rotationRate:{alpha:o.rotationRate?.alpha??null,beta:o.rotationRate?.beta??null,gamma:o.rotationRate?.gamma??null},interval:o.interval??0}};window.addEventListener("devicemotion",s),t=()=>{window.removeEventListener("devicemotion",s)}}const r=_(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value(){n||(n=!0,t?.(),e.dispose())}}),r},$d=()=>{const e=L({...Rd});let t;if(typeof window<"u"){const s=o=>{e.value={alpha:o.alpha??null,beta:o.beta??null,gamma:o.gamma??null,absolute:o.absolute??!1}};window.addEventListener("deviceorientation",s),t=()=>{window.removeEventListener("deviceorientation",s)}}const r=_(e);let n=!1;return Object.defineProperty(r,"destroy",{enumerable:!1,configurable:!0,value(){n||(n=!0,t?.(),e.dispose())}}),r},Io="bQuery media: Clipboard API is unavailable. Use a secure context (HTTPS or localhost) and ensure clipboard permissions or user-activation requirements are met.",Od={read:async()=>{if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.readText!="function")throw new Error(Io);return navigator.clipboard.readText()},write:async e=>{if(typeof navigator>"u"||!navigator.clipboard||typeof navigator.clipboard.writeText!="function")throw new Error(Io);return navigator.clipboard.writeText(e)}},Ld=(e,t)=>{let r;t==="border-box"?r=e.borderBoxSize:t==="device-pixel-content-box"?r=e.devicePixelContentBoxSize:r=e.contentBoxSize;const n=Array.isArray(r)?r[0]:r;return n&&typeof n.inlineSize=="number"&&typeof n.blockSize=="number"?{width:n.inlineSize,height:n.blockSize}:{width:e.contentRect.width,height:e.contentRect.height}},Pd=(e,t)=>{const r=L({isIntersecting:!1,intersectionRatio:0,entry:null});let n,s=!1;if(typeof window<"u"&&typeof IntersectionObserver<"u")try{if(n=new IntersectionObserver(i=>{if(s)return;const a=i[i.length-1];a&&(r.value={isIntersecting:a.isIntersecting,intersectionRatio:a.intersectionRatio,entry:a})},{root:t?.root??null,rootMargin:t?.rootMargin??"0px",threshold:t?.threshold??0}),e){const i=Array.isArray(e)?e:[e];for(const a of i)n.observe(a)}}catch{n&&n.disconnect(),n=void 0}const o=_(r);return Object.defineProperties(o,{observe:{enumerable:!1,configurable:!0,value(i){if(!s)try{n?.observe(i)}catch{}}},unobserve:{enumerable:!1,configurable:!0,value(i){s||n?.unobserve(i)}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),o},Nd=(e,t)=>{const r=L({width:0,height:0,entry:null});let n,s=!1;const o=t?.box??"content-box",i=t?.box?{box:t.box}:void 0;if(typeof window<"u"&&typeof ResizeObserver<"u")try{if(n=new ResizeObserver(c=>{if(s)return;const l=c[c.length-1];if(l){const{width:u,height:h}=Ld(l,o);r.value={width:u,height:h,entry:l}}}),e){const c=Array.isArray(e)?e:[e];for(const l of c)n.observe(l,i)}}catch{n&&n.disconnect(),n=void 0}const a=_(r);return Object.defineProperties(a,{observe:{enumerable:!1,configurable:!0,value(c){if(!s)try{n?.observe(c,i)}catch{}}},unobserve:{enumerable:!1,configurable:!0,value(c){s||n?.unobserve(c)}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),a},Id=(e,t)=>{const r=L({mutations:[],count:0});let n,s=!1,o=0;const i={attributes:t?.attributes??!0,childList:t?.childList??!1,characterData:t?.characterData??!1,subtree:t?.subtree??!1,attributeOldValue:t?.attributeOldValue??!1,characterDataOldValue:t?.characterDataOldValue??!1,...t&&t.attributeFilter!==void 0?{attributeFilter:t.attributeFilter}:{}};if(!i.attributes&&!i.childList&&!i.characterData&&(i.attributes=!0),i.attributes||(i.attributeOldValue=!1,delete i.attributeFilter),i.characterData||(i.characterDataOldValue=!1),typeof window<"u"&&typeof MutationObserver<"u")try{n=new MutationObserver(c=>{s||(o+=1,r.value={mutations:c,count:o})}),e&&n.observe(e,i)}catch{n&&n.disconnect(),n=void 0}const a=_(r);return Object.defineProperties(a,{observe:{enumerable:!1,configurable:!0,value(c){if(!s)try{n?.observe(c,i)}catch{}}},takeRecords:{enumerable:!1,configurable:!0,value(){return n?.takeRecords()??[]}},destroy:{enumerable:!1,configurable:!0,value(){s||(s=!0,n?.disconnect(),n=void 0,r.dispose())}}}),a},ut=new Set,he=new Map,xr=()=>{hf(e=>he.get(e))};xr();var Mo=e=>{he.clear();for(const[t,r]of e)he.set(t,r)},Md=e=>({directive(t,r){if(typeof t!="string"||t.length===0)throw new Error("bQuery plugin directive: name must be a non-empty string");if(t.startsWith("bq-")){const n=t.slice(3);throw new Error(`bQuery plugin directive: name "${t}" must be provided without the "bq-" prefix`+(n?` (use "${n}")`:""))}if(typeof r!="function")throw new Error(`bQuery plugin directive: handler for "${t}" must be a function`);if(he.has(t))throw new Error(`bQuery plugin directive: a directive named "${t}" is already registered`);he.set(t,r)},component(t,r,n){if(typeof t!="string"||t.length===0)throw new Error("bQuery plugin component: tagName must be a non-empty string");if(!t.includes("-"))throw new Error(`bQuery plugin component: tagName "${t}" must be a valid custom element name containing a hyphen`);if(typeof r!="function")throw new Error(`bQuery plugin component: constructor for "${t}" must be a function`);if(typeof customElements>"u"){typeof console<"u"&&typeof console.warn=="function"&&console.warn(`[bQuery] plugin component "${t}" was not registered because customElements is not available in this environment.`);return}!customElements.get(t)&&!e.some(s=>s.tagName===t)&&e.push({tagName:t,constructor:r,options:n})}}),Dd=(e,t)=>{if(xr(),!e||typeof e!="object")throw new Error("bQuery plugin: use() expects a plugin object with { name, install }");if(typeof e.name!="string"||e.name.length===0)throw new Error('bQuery plugin: plugin must have a non-empty "name" property');if(typeof e.install!="function")throw new Error(`bQuery plugin: plugin "${e.name}" must have an "install" function`);if(ut.has(e.name))return;const r=[],n=Md(r),s=new Map(he);try{e.install(n,t)}catch(o){throw Mo(s),o}try{for(const o of r)customElements.get(o.tagName)||customElements.define(o.tagName,o.constructor,o.options)}catch(o){throw Mo(s),o}ut.add(e.name)},_d=e=>ut.has(e),xd=()=>[...ut],qd=e=>he.get(e),zd=()=>[...he.entries()].map(([e,t])=>({name:e,handler:t})),Ud=()=>{ut.clear(),he.clear(),xr()},ft=!1,qr={},Re=[],Qt=new Map,Do=0,jd=(e,t)=>{ft=e,qr=t??{},e||(Re.length=0,Qt.clear(),Do=0)},Hd=()=>ft,Wd=(e,t,r)=>{if(ft){if(typeof e!="string"||e.length===0)throw new Error("bQuery devtools: trackSignal() requires a non-empty label");Qt.set(e,{peek:t,subscriberCount:r})}},Fd=e=>{Qt.delete(e)},Bd=()=>`signal_${Do++}`,_o=()=>{const e=[];for(const[t,r]of Qt)e.push({label:t,value:r.peek(),subscriberCount:r.subscriberCount()});return e},xo=()=>{try{return Ht().map(e=>{const t=we(e),r={};if(t&&typeof t=="object"&&"$state"in t){const n=t.$state;n&&typeof n=="object"&&Object.assign(r,n)}return{id:e,state:r}})}catch{return[]}},qo=()=>{if(typeof document>"u")return[];const e=[],t=new Set,r=document.querySelectorAll("*");for(let n=0;n<r.length;n++){const s=r[n].tagName.toLowerCase();if(s.includes("-")&&!t.has(s)&&typeof customElements<"u"&&customElements.get(s)){t.add(s);const o=document.querySelectorAll(s);e.push({tagName:s,instanceCount:o.length})}}return e},Qd=(e,t)=>{if(!ft)return;const r={timestamp:Date.now(),type:e,detail:t};Re.push(r),qr.logToConsole&&console.log(`[bq:devtools] ${e} — ${t}`)},Vd=()=>Re,Kd=()=>{Re.length=0},Yd=()=>({enabled:ft,options:{...qr},timeline:[...Re]}),Jd=()=>{const e=_o();if(e.length===0){console.log("[bq:devtools] No tracked signals.");return}console.table(e)},Gd=()=>{const e=xo();if(e.length===0){console.log("[bq:devtools] No stores registered.");return}console.table(e.map(t=>({id:t.id,state:JSON.stringify(t.state)})))},Xd=()=>{const e=qo();if(e.length===0){console.log("[bq:devtools] No custom elements found.");return}console.table(e)},Zd=e=>{const t=typeof e=="number"&&e>0?Re.slice(-e):Re;if(t.length===0){console.log("[bq:devtools] Timeline is empty.");return}console.table(t.map(r=>({time:new Date(r.timestamp).toISOString(),type:r.type,detail:r.detail})))},zo=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="_"),eh=(e,t)=>{let r=1,n="",s=t+1;for(;s<e.length;){const o=e[s];if(o==="\\"&&s+1<e.length){n+=o+e[s+1],s+=2;continue}if(o==="(")r++;else if(o===")"&&(r--,r===0))return{constraint:n,endIndex:s+1};n+=o,s++}return null},Uo=new Map,th=e=>{const t=Or(e),r=Uo.get(t);if(r)return r;const n=new RegExp(`^(?:${t})$`);return Uo.set(t,n),n};function rh(e,t={}){if(!e||!e.includes("-"))throw new Error(`bQuery testing: "${e}" is not a valid custom element tag name (must contain a hyphen)`);const{props:r,slots:n,container:s=document.body}=t,o=document.createElement(e);if(r)for(const[a,c]of Object.entries(r))c!=null&&o.setAttribute(a,String(c));if(n)if(typeof n=="string")o.innerHTML=n;else{const a=[];for(const[c,l]of Object.entries(n))if(c==="default")a.push(l);else{const u=c.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;");a.push(`<div slot="${u}">${l}</div>`)}o.innerHTML=a.join("")}return s.appendChild(o),{el:o,unmount:()=>{o.parentNode&&o.parentNode.removeChild(o)}}}function jo(){Se(()=>{})}function nh(e){const t=L(e);return Object.defineProperty(t,"initialValue",{value:e,writable:!1,enumerable:!0}),t.set=function(r){t.value=r},t.reset=function(){t.value=e},t}function sh(e,t){let r=e;t&&r.startsWith(t)&&(r=r.slice(t.length)||"/");let n="";const s=r.indexOf("#");s>=0&&(n=r.slice(s+1),r=r.slice(0,s));const o={},i=r.indexOf("?");if(i>=0){const a=r.slice(i+1);r=r.slice(0,i);for(const c of a.split("&")){const l=c.indexOf("="),u=l>=0?decodeURIComponent(c.slice(0,l)):decodeURIComponent(c),h=l>=0?decodeURIComponent(c.slice(l+1)):"",d=o[u];d!==void 0?Array.isArray(d)?d.push(h):o[u]=[d,h]:o[u]=h}}return{path:r||"/",query:o,hash:n}}function oh(e,t){for(const r of t){const n=ih(r.path,e);if(n)return{matched:r,params:n}}return{matched:null,params:{}}}function ih(e,t){if(e==="*")return{};const r=new Map,n=(o,i)=>{const a=o.indexOf("/",i);return a===-1?o.length:a},s=(o,i)=>{const a=`${o}:${i}`;if(r.has(a))return r.get(a)??null;if(o===e.length){const u=i===t.length?{}:null;return r.set(a,u),u}const c=e[o];if(c==="*"){for(let u=t.length;u>=i;u--){const h=s(o+1,u);if(h)return r.set(a,h),h}return r.set(a,null),null}if(c===":"&&zo(e[o+1])){let u=o+2;for(;u<e.length&&zo(e[u]);)u++;const h=e.slice(o+1,u);let d=u,p,f=!1;if(e[u]==="("){const v=eh(e,u);v&&(p=v.constraint,d=v.endIndex)}e[d]==="*"&&(f=!0,d++);const m=f||p?t.length:n(t,i);for(let v=m;v>i;v--){const b=t.slice(i,v);if(p&&!th(p).test(b))continue;const g=s(d,v);if(g){const w={[h]:b,...g};return r.set(a,w),w}}return r.set(a,null),null}if(i>=t.length||c!==t[i])return r.set(a,null),null;const l=s(o+1,i+1);return r.set(a,l),l};return s(0,0)}function ah(e={}){const t=e.routes??[{path:"*",component:()=>null}],r=e.base??"",n=e.initialPath??"/",s=i=>{const{path:a,query:c,hash:l}=sh(i,r),{matched:u,params:h}=oh(a,t);return{path:a,params:h,query:c,matched:u,hash:l}},o=L(s(n));return{push(i){o.value=s(i)},replace(i){o.value=s(i)},get currentRoute(){return o},get routes(){return t},destroy(){o.dispose()}}}function ch(e,t,r={}){if(!e)throw new Error("bQuery testing: fireEvent requires a valid element");if(!t)throw new Error("bQuery testing: fireEvent requires an event name");const{bubbles:n=!0,cancelable:s=!0,composed:o=!0,detail:i}=r;let a;i!==void 0?a=new CustomEvent(t,{bubbles:n,cancelable:s,composed:o,detail:i}):a=new Event(t,{bubbles:n,cancelable:s,composed:o});const c=e.dispatchEvent(a);return jo(),c}async function lh(e,t={}){if(typeof e!="function")throw new Error("bQuery testing: waitFor requires a predicate function");const{timeout:r=1e3,interval:n=10}=t,s=Date.now();for(;;){try{if(await e())return}catch{}if(Date.now()-s>=r)throw new Error(`bQuery testing: waitFor timed out after ${r}ms — predicate never returned true`);await new Promise(o=>setTimeout(o,n))}}var Ho=(e,t,r={})=>{const{hydrate:n=!0,...s}=r;if(!n)throw new Error("bQuery ssr: hydrateMount() requires { hydrate: true } when options are provided.");return Mr(e,t,s)},me={backend:"auto",documentImpl:null},uh=e=>{e.backend!==void 0&&(me.backend=e.backend),e.documentImpl!==void 0&&(me.documentImpl=e.documentImpl)},fh=()=>({backend:me.backend,documentImpl:me.documentImpl}),dh=()=>me.backend==="pure"?"pure":me.backend==="dom"||me.documentImpl||typeof globalThis.DOMParser=="function"?"dom":"pure",hh=()=>me.documentImpl?me.documentImpl.DOMParser:typeof globalThis.DOMParser=="function"?globalThis.DOMParser:null,zr=e=>{let t=5381;for(let r=0;r<e.length;r++)t=(t<<5)+t+e.charCodeAt(r)|0;return(t>>>0).toString(36)},Vt="data-bq-h",mh=(e,t,r)=>{const n=[];for(const s of e)s!=="data-bq-h"&&(s.startsWith(`${r}-`)||s.startsWith(":"))&&n.push(`${s}=${t[s]??""}`);return n.join("|")},Wo=(e,t)=>{const r=[];for(const n of Array.from(e.attributes))n.name!=="data-bq-h"&&(n.name.startsWith(`${t}-`)||n.name.startsWith(":"))&&r.push(`${n.name}=${n.value}`);return r.join("|")},ph=e=>G(e)||ce(e)?e.value:e,vh=["===","!==","==","!=","<=",">=","&&","||","??","?."],yh="+-*/%<>!?:,.()[]",Fo=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$",gh=e=>Fo(e)||e>="0"&&e<="9",Ur=e=>e>="0"&&e<="9",bh=e=>{const t=[],r=e.length;let n=0;for(;n<r;){const s=e[n];if(s===" "||s===" "||s===`
276
+ `||s==="\r"){n++;continue}if(s==='"'||s==="'"){const i=s,a=n;n++;let c="";for(;n<r&&e[n]!==i;){if(e[n]==="\\"&&n+1<r){const l=e[n+1];l==="n"?c+=`
277
+ `:l==="t"?c+=" ":l==="r"?c+="\r":l==="\\"?c+="\\":l===i?c+=i:c+=l,n+=2;continue}c+=e[n],n++}if(n>=r)throw new Error("Unterminated string literal in SSR expression");n++,t.push({kind:"string",value:c,start:a});continue}if(Ur(s)||s==="."&&n+1<r&&Ur(e[n+1])){const i=n;for(;n<r&&(Ur(e[n])||e[n]===".");)n++;t.push({kind:"number",value:e.slice(i,n),start:i});continue}if(Fo(s)){const i=n;for(;n<r&&gh(e[n]);)n++;t.push({kind:"ident",value:e.slice(i,n),start:i});continue}let o=!1;for(const i of vh)if(e.startsWith(i,n)){t.push({kind:"punct",value:i,start:n}),n+=i.length,o=!0;break}if(!o){if(yh.includes(s)){t.push({kind:"punct",value:s,start:n}),n++;continue}throw new Error(`Unexpected character "${s}" in SSR expression`)}}return t.push({kind:"eof",value:"",start:r}),t},Y=e=>e.tokens[e.pos],ze=e=>e.tokens[e.pos++],K=(e,t)=>{const r=Y(e);if(r.kind!=="punct"||r.value!==t)throw new Error(`Expected "${t}" in SSR expression, got "${r.value}"`);e.pos++},Kt=(e,t)=>{const r=Y(e);return r.kind==="punct"&&r.value===t?(e.pos++,!0):!1},Yt=(e,t,r)=>{K(e,t);const n=[t];for(;n.length>0;){const s=ze(e);if(!s||s.kind==="eof")throw new Error(`Unterminated "${t}${r}" group in SSR expression`);if(s.kind==="punct"){if(s.value==="("||s.value==="["){n.push(s.value);continue}if(s.value===")"||s.value==="]"){const o=n[n.length-1],i=o==="("?")":"]";if(s.value!==i)throw new Error(`Mismatched "${o}${i}" group in SSR expression`);n.pop()}}}},jr=e=>{const t=Y(e);if(t.kind==="punct"&&t.value==="["){Yt(e,"[","]");return}if(t.kind==="punct"&&t.value==="("){Yt(e,"(",")");return}if(t.kind==="ident"){e.pos++;return}throw new Error("Invalid optional chain in SSR expression")},wh=e=>{for(;;){const t=Y(e);if(t.kind!=="punct")break;if(t.value==="."){if(e.pos++,ze(e).kind!=="ident")throw new Error('Expected identifier after "."');continue}if(t.value==="["){Yt(e,"[","]");continue}if(t.value==="("){Yt(e,"(",")");continue}if(t.value==="?."){e.pos++,jr(e);continue}break}},Sh=e=>{const t=ze(e);if(!t||t.kind==="eof")throw new Error("Unexpected end of SSR expression");if(!(t.kind==="number"||t.kind==="string"||t.kind==="ident")){if(t.kind==="punct"&&t.value==="("){X(e,0),K(e,")");return}throw new Error(`Unexpected token "${t.value}" in SSR expression`)}},Eh=e=>{if(K(e,"("),!Kt(e,")")){for(;;)if(X(e,0),!Kt(e,",")){K(e,")");break}}},Ah=e=>{for(Sh(e);;){const t=Y(e);if(t.kind!=="punct")break;if(t.value==="."){if(e.pos++,ze(e).kind!=="ident")throw new Error('Expected identifier after "."');continue}if(t.value==="?."){e.pos++,jr(e);continue}if(t.value==="["){e.pos++,X(e,0),K(e,"]");continue}if(t.value==="("){Eh(e);continue}break}},Hr=e=>{const t=Y(e);if(t.kind==="punct"&&(t.value==="!"||t.value==="-"||t.value==="+")){e.pos++,Hr(e);return}if(t.kind==="ident"&&t.value==="typeof"){e.pos++,Hr(e);return}Ah(e)},X=(e,t=0)=>{for(Hr(e);;){const r=Y(e);if(r.kind!=="punct")break;if(r.value==="?"&&t<=0){e.pos++,X(e,0),K(e,":"),X(e,0);continue}const n=Bo[r.value];if(n===void 0||n<t)break;e.pos++,X(e,n+1)}},kh=(e,t)=>{if(t==="true")return!0;if(t==="false")return!1;if(t==="null")return null;if(t!=="undefined"&&!N(t))return ph(e.context[t])},Jt=(e,t)=>{if(e!=null&&!(typeof t=="string"&&N(t)))return e[t]},Bo={"||":1,"??":1,"&&":2,"==":3,"!=":3,"===":3,"!==":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6},Z=(e,t=0)=>{let r=dt(e);for(;;){const n=Y(e);if(n.kind!=="punct")break;if(n.value==="?"&&t<=0){if(e.pos++,r){const i=Z(e,0);K(e,":"),X(e,0),r=i}else X(e,0),K(e,":"),r=Z(e,0);continue}const s=Bo[n.value];if(s===void 0||s<t)break;if(e.pos++,n.value==="&&"){r?r=Z(e,s+1):X(e,s+1);continue}if(n.value==="||"){r?X(e,s+1):r=Z(e,s+1);continue}if(n.value==="??"){r!=null?X(e,s+1):r=Z(e,s+1);continue}const o=Z(e,s+1);r=Th(n.value,r,o)}return r},Th=(e,t,r)=>{switch(e){case"||":return t||r;case"&&":return t&&r;case"??":return t??r;case"==":return t==r;case"!=":return t!=r;case"===":return t===r;case"!==":return t!==r;case"<":return t<r;case"<=":return t<=r;case">":return t>r;case">=":return t>=r;case"+":return typeof t=="string"||typeof r=="string"?String(t??"")+String(r??""):t+r;case"-":return t-r;case"*":return t*r;case"/":return t/r;case"%":return t%r;default:throw new Error(`Unsupported binary operator "${e}"`)}},dt=e=>{const t=Y(e);if(t.kind==="punct"){if(t.value==="!")return e.pos++,!dt(e);if(t.value==="-")return e.pos++,-dt(e);if(t.value==="+")return e.pos++,+dt(e)}return t.kind==="ident"&&t.value==="typeof"?(e.pos++,typeof dt(e)):Rh(e)},Rh=e=>{let t=Ch(e),r;for(;;){const n=Y(e);if(n.kind!=="punct")break;if(n.value==="."){e.pos++;const s=ze(e);if(s.kind!=="ident")throw new Error('Expected identifier after "."');r=t,t=Jt(t,s.value);continue}if(n.value==="?."){if(e.pos++,t==null){jr(e),wh(e),t=void 0,r=void 0;continue}const s=Y(e);if(s.kind==="punct"&&s.value==="["){e.pos++;const o=t,i=Z(e,0);K(e,"]"),r=o,t=Jt(t,i)}else if(s.kind==="punct"&&s.value==="(")t=Qo(e,t,r),r=void 0;else if(s.kind==="ident")e.pos++,r=t,t=Jt(t,s.value);else throw new Error("Invalid optional chain in SSR expression");continue}if(n.value==="["){e.pos++;const s=t,o=Z(e,0);K(e,"]"),r=s,t=Jt(t,o);continue}if(n.value==="("){t=Qo(e,t,r),r=void 0;continue}break}return t},Qo=(e,t,r)=>{K(e,"(");const n=[];if(!Kt(e,")")){for(;;)if(n.push(Z(e,0)),!Kt(e,",")){K(e,")");break}}if(typeof t=="function")return t.apply(r,n)},Ch=e=>{const t=ze(e);if(t.kind==="number")return Number(t.value);if(t.kind==="string")return t.value;if(t.kind==="ident")return kh(e,t.value);if(t.kind==="punct"&&t.value==="("){const r=Z(e,0);return K(e,")"),r}throw new Error(`Unexpected token "${t.value}" in SSR expression`)},pe=(e,t)=>{const r=e.trim();if(r!=="")try{const n={tokens:bh(r),pos:0,context:t},s=Z(n,0);return Y(n).kind!=="eof"?void 0:s}catch{return}},$h=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Oh=new Set(["script","style","textarea","title"]),Lh={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "},Wr=e=>e.indexOf("&")===-1?e:e.replace(/&(#x?[0-9a-fA-F]+|[a-zA-Z]+);/g,(t,r)=>{if(r[0]==="#"){const n=r[1]==="x"||r[1]==="X",s=parseInt(r.slice(n?2:1),n?16:10);if(Number.isFinite(s))try{return String.fromCodePoint(s)}catch{return t}return t}return Lh[r.toLowerCase()]??t}),ht=e=>e===" "||e===" "||e===`
278
+ `||e==="\r"||e==="\f",Gt=e=>{for(;e.pos<e.src.length&&ht(e.src[e.pos]);)e.pos++},Ph=(e,t)=>{const r=e.pos,n=e.src.indexOf(t,r);return n===-1?(e.pos=e.src.length,e.src.slice(r)):(e.pos=n,e.src.slice(r,n))},Vo=e=>{const t=e.pos;for(;e.pos<e.src.length;){const r=e.src[e.pos];if(ht(r)||r===">"||r==="/")break;e.pos++}return e.src.slice(t,e.pos).toLowerCase()},Nh=e=>{const t=e.pos;for(;e.pos<e.src.length;){const r=e.src[e.pos];if(ht(r)||r==="="||r===">"||r==="/")break;e.pos++}return e.src.slice(t,e.pos)},Ih=e=>{const t=e.src[e.pos];if(t==='"'||t==="'"){const n=t;e.pos++;const s=e.pos;for(;e.pos<e.src.length&&e.src[e.pos]!==n;)e.pos++;const o=e.src.slice(s,e.pos);return e.pos<e.src.length&&e.pos++,Wr(o)}const r=e.pos;for(;e.pos<e.src.length;){const n=e.src[e.pos];if(ht(n)||n===">"||n==="/"&&e.src[e.pos+1]===">")break;e.pos++}return Wr(e.src.slice(r,e.pos))},Mh=e=>{const t=Object.create(null),r=[];let n=!1;for(;e.pos<e.src.length;){Gt(e);const s=e.src[e.pos];if(s===">"){e.pos++;break}if(s==="/"){if(e.pos++,Gt(e),e.src[e.pos]===">"){n=!0,e.pos++;break}continue}if(e.pos>=e.src.length)break;const o=Nh(e);if(!o){for(;e.pos<e.src.length;){const c=e.src[e.pos];if(ht(c)||c===">"||c==="/")break;e.pos++}continue}const i=o.toLowerCase();Gt(e);let a="";e.src[e.pos]==="="&&(e.pos++,Gt(e),a=Ih(e)),i in t||r.push(i),t[i]=a}return{attributes:t,order:r,selfClose:n}},Xt=e=>{const t={src:e,pos:0},r={type:"fragment",children:[]},n=[r],s=()=>n[n.length-1];for(;t.pos<t.src.length;){if(t.src[t.pos]==="<"){if(t.src.startsWith("<!--",t.pos)){t.pos+=4;const i=t.src.indexOf("-->",t.pos),a=i===-1?t.src.slice(t.pos):t.src.slice(t.pos,i);t.pos=i===-1?t.src.length:i+3,s().children.push({type:"comment",value:a});continue}if(t.src.startsWith("<!",t.pos)||t.src.startsWith("<?",t.pos)){const i=t.src.indexOf(">",t.pos);t.pos=i===-1?t.src.length:i+1;continue}if(t.src[t.pos+1]==="/"){t.pos+=2;const i=Vo(t),a=t.src.indexOf(">",t.pos);t.pos=a===-1?t.src.length:a+1;for(let c=n.length-1;c>0;c--){const l=n[c];if(l.type==="element"&&l.tag===i){n.length=c;break}}continue}if(t.pos+1<t.src.length&&/[a-zA-Z]/.test(t.src[t.pos+1])){t.pos++;const i=Vo(t),{attributes:a,order:c,selfClose:l}=Mh(t),u=$h.has(i),h={type:"element",tag:i,attributes:a,attributeOrder:c,children:[],void:u,raw:Oh.has(i)};if(s().children.push(h),u||l)continue;if(h.raw){const d=`</${i}`,p=t.pos,f=t.src.toLowerCase().indexOf(d,p),m=f===-1?t.src.slice(p):t.src.slice(p,f);if(m&&h.children.push({type:"text",value:m}),f===-1)t.pos=t.src.length;else{t.pos=f;const v=t.src.indexOf(">",t.pos);t.pos=v===-1?t.src.length:v+1}continue}n.push(h);continue}s().children.push({type:"text",value:"<"}),t.pos++;continue}const o=Ph(t,"<");o&&s().children.push({type:"text",value:Wr(o)})}return r},Dh=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),_h=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),mt=e=>{if(e.type==="text")return Dh(e.value);if(e.type==="comment")return`<!--${e.value}-->`;if(e.type==="fragment"){let s="";for(const o of e.children)s+=mt(o);return s}const t=e;let r="";for(const s of t.attributeOrder){const o=t.attributes[s];r+=` ${s}="${_h(o)}"`}if(t.void)return`<${t.tag}${r}>`;let n="";if(t.raw)for(const s of t.children)s.type==="text"&&(n+=s.value);else for(const s of t.children)n+=mt(s);return`<${t.tag}${r}>${n}</${t.tag}>`},Fr=e=>e.type==="element"?{type:"element",tag:e.tag,attributes:{...e.attributes},attributeOrder:[...e.attributeOrder],children:e.children.map(Fr),void:e.void,raw:e.raw}:e.type==="fragment"?{type:"fragment",children:e.children.map(Fr)}:e.type==="text"?{type:"text",value:e.value}:{type:"comment",value:e.value},xh=e=>{const t=e.toLowerCase();return t==="href"||t==="src"||t==="xlink:href"||t==="formaction"||t==="action"||t==="poster"||t==="background"||t==="cite"||t==="data"},qh=e=>e.trim().replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),Ko=e=>{const t=qh(e);return cr.some(r=>t.startsWith(r))},zh=/^[a-zA-Z][a-zA-Z0-9+.-]*:/,Uh=/\s+/,jh=e=>{const t=e.toLowerCase();for(const r of dn)if(t.startsWith(r))return!1;return t.startsWith("data-")||t.startsWith("aria-")?!0:fn.has(t)},Hh=e=>!un.has(e.toLowerCase().trim()),Wh=e=>{try{const t=e.trim();if(t.startsWith("//"))return!0;const r=t.toLowerCase();return!r.startsWith("http://")&&!r.startsWith("https://")?!!zh.test(t):typeof window>"u"||!window.location?!0:new URL(t,window.location.href).origin!==window.location.origin}catch{return!0}},Zt=(e,t)=>{if(!t)return;const r=e.attributes.class,n=r?`${r} ${t}`:t;"class"in e.attributes||e.attributeOrder.push("class"),e.attributes.class=n},Yo=(e,t)=>{let r=e.attributes.style??"";for(const[n,s]of Object.entries(t)){if(s==null||s===!1)continue;const o=n.replace(/([A-Z])/g,"-$1").toLowerCase();r&&!r.endsWith(";")&&(r+="; "),r+=`${o}: ${String(s)};`}"style"in e.attributes||e.attributeOrder.push("style"),e.attributes.style=r},ee=(e,t)=>{if(t in e.attributes){delete e.attributes[t];const r=e.attributeOrder.indexOf(t);r!==-1&&e.attributeOrder.splice(r,1)}},er=(e,t,r)=>{t in e.attributes||e.attributeOrder.push(t),e.attributes[t]=r},Fh=(e,t)=>mh(e.attributeOrder,e.attributes,t),Bh=e=>{const t=e.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);return t?{itemName:t[1],indexName:t[2]||void 0,listExpr:t[3].trim()}:null},Br=(e,t)=>{if(e.type!=="element"){if(e.type==="fragment")for(const r of e.children)Br(r,t);return}for(const r of[...e.attributeOrder])(r.startsWith(`${t}-`)||r.startsWith(":"))&&ee(e,r);for(const r of e.children)Br(r,t)},Qh=(e,t)=>{e.children=[{type:"text",value:t}]},Vh=(e,t)=>{e.children=Xt(t).children},Jo=e=>{const t=r=>{if(r.type==="fragment")return r.children=r.children.flatMap(n=>{const s=t(n);return s?[s]:[]}),r;if(r.type!=="element")return r;if(ar.has(r.tag)||!ln.has(r.tag))return null;for(const n of[...r.attributeOrder]){const s=r.attributes[n],o=n.toLowerCase();if(!jh(o)){ee(r,n);continue}if((o==="id"||o==="name")&&!Hh(s)){ee(r,n);continue}if((o==="href"||o==="src")&&Ko(s)){ee(r,n);continue}}if(r.tag==="a"){const n=r.attributes.href,s=r.attributes.target?.toLowerCase()==="_blank",o=n?Wh(n):!1;if(s||o){const i=new Set((r.attributes.rel??"").trim().split(Uh).filter(Boolean));i.add("noopener"),i.add("noreferrer"),er(r,"rel",Array.from(i).join(" "))}}return r.children=r.children.flatMap(n=>{const s=t(n);return s?[s]:[]}),r};return mt(t(Xt(e))??{type:"fragment",children:[]})},Go=(e,t,r)=>{const n=[];for(const s of e.children){if(s.type!=="element"){n.push(s);continue}const o=Xo(s,t,r);if(o!==null)if(Array.isArray(o))for(const i of o)n.push(i);else n.push(o)}e.children=n},Xo=(e,t,r)=>{const{prefix:n}=r,s=e.attributes[`${n}-for`];if(s!==void 0){const d=Bh(s);if(d||ee(e,`${n}-for`),d){const p=pe(d.listExpr,t);if(!Array.isArray(p))return null;const f=[];for(let m=0;m<p.length;m++){const v=Fr(e);ee(v,`${n}-for`),ee(v,`${n}-key`),ee(v,":key");const b={...t,[d.itemName]:p[m]};d.indexName&&(b[d.indexName]=m);const g=Xo(v,b,r);g!==null&&(Array.isArray(g)?f.push(...g):f.push(g))}return f}}const o=r.annotateHydration?Fh(e,n):"",i=e.attributes[`${n}-if`];if(i!==void 0&&!pe(i,t))return null;const a=e.attributes[`${n}-show`];a!==void 0&&(pe(a,t)||Yo(e,{display:"none"}));const c=e.attributes[`${n}-text`];if(c!==void 0){const d=pe(c,t);Qh(e,String(d??""))}const l=e.attributes[`${n}-html`];if(l!==void 0){const d=pe(l,t);Vh(e,Jo(String(d??"")))}const u=e.attributes[`${n}-class`];if(u!==void 0){const d=u.trim();if(d.startsWith("{")){const p=d.slice(1,-1).split(",");for(const f of p){const m=f.indexOf(":");if(m<0)continue;const v=f.slice(0,m).trim().replace(/^['"]|['"]$/g,"");pe(f.slice(m+1),t)&&Zt(e,v)}}else{const p=pe(u,t);if(typeof p=="string")for(const f of p.split(/\s+/).filter(Boolean))Zt(e,f);else if(Array.isArray(p))for(const f of p)typeof f=="string"&&f&&Zt(e,f);else if(p&&typeof p=="object")for(const[f,m]of Object.entries(p))m&&Zt(e,f)}}const h=e.attributes[`${n}-style`];if(h!==void 0){const d=pe(h,t);d&&typeof d=="object"&&Yo(e,d)}for(const d of[...e.attributeOrder]){if(!d.startsWith(`${n}-bind:`))continue;const p=d.slice(`${n}-bind:`.length),f=pe(e.attributes[d],t);f===!1||f==null?ee(e,p):f===!0?er(e,p,""):er(e,p,String(f))}for(const d of[...e.attributeOrder]){const p=d.toLowerCase();if(p.startsWith("on")){ee(e,d);continue}xh(p)&&Ko(e.attributes[d]??"")&&ee(e,d)}return e.tag==="script"?null:(Go(e,t,r),o&&er(e,Vt,zr(o)),e)},Kh=(e,t,r={})=>{const n={prefix:r.prefix??"bq",stripDirectives:r.stripDirectives??!1,annotateHydration:r.annotateHydration??!1},s=Xt(e);return Go(s,t,n),n.stripDirectives&&Br(s,n.prefix),mt(s)},Ue=e=>e.replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/\//g,"\\u002f").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),pt=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),tr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Qr=e=>{const t={};for(const[r,n]of Object.entries(e))N(r)||(t[r]=n);return t},vt=(e={})=>{const{scriptId:t="__BQUERY_STORE_STATE__",globalKey:r="__BQUERY_INITIAL_STATE__",storeIds:n,serialize:s=JSON.stringify}=e;if(N(r))throw new Error(`serializeStoreState: invalid globalKey "${r}" - prototype-pollution keys are not allowed.`);if(N(t))throw new Error(`serializeStoreState: invalid scriptId "${t}" - prototype-pollution keys are not allowed.`);const o=n??Ht(),i=Object.create(null);for(const u of o){if(N(u))continue;const h=we(u);h&&(i[u]=Qr(h.$state))}const a=s(i);if(typeof a!="string")throw new Error("serializeStoreState: custom serialize function must return a string.");if(s!==JSON.stringify){let u;try{u=JSON.parse(a)}catch{throw new Error("serializeStoreState: custom serialize function returned invalid JSON.")}if(!tr(u))throw new Error("serializeStoreState: custom serialize function must return a JSON object string.")}const c=Ue(a),l=Ue(JSON.stringify(r));return{stateJson:a,scriptTag:`<script id="${pt(t)}">window[${l}]=${c}<\/script>`}},Yh=(e="__BQUERY_INITIAL_STATE__",t="__BQUERY_STORE_STATE__")=>{if(N(e))throw new Error(`deserializeStoreState: invalid globalKey "${e}" - prototype-pollution keys are not allowed.`);if(N(t))throw new Error(`deserializeStoreState: invalid scriptId "${t}" - prototype-pollution keys are not allowed.`);if(typeof window>"u")return{};const r=window[e];if(!r)return{};try{delete window[e]}catch{window[e]=void 0}if(typeof document<"u"&&typeof document.getElementById=="function"){const s=document.getElementById(t);s&&s.remove()}if(!tr(r))return{};for(const s of Object.values(r))if(!tr(s))return{};const n=Object.create(null);for(const[s,o]of Object.entries(r))N(s)||!tr(o)||(n[s]=Qr(o));return n},Zo=(e,t)=>{const r=we(e);r&&typeof r.$patch=="function"&&r.$patch(Qr(t))},Jh=e=>{for(const[t,r]of Object.entries(e))Zo(t,r)},Gh=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Xh=3,Zh=1,ei=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),em=e=>ei(e).replace(/"/g,"&quot;"),tm=e=>{const t=e.toLowerCase();return t==="href"||t==="src"||t==="xlink:href"||t==="formaction"||t==="action"||t==="poster"||t==="background"||t==="cite"||t==="data"},rm=e=>e.trim().replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),nm=e=>{const t=rm(e);return cr.some(r=>t.startsWith(r))},ti=e=>{if(e.nodeType===Xh)return ei(e.textContent??"");if(e.nodeType!==Zh)return"";const t=e,r=t.tagName.toLowerCase();if(r==="script")return"";let n="";for(const o of t.attributes){const i=o.name.toLowerCase();i.startsWith("on")||tm(i)&&nm(o.value)||(n+=` ${o.name}="${em(o.value)}"`)}if(Gh.has(r))return`<${r}${n}>`;let s="";for(const o of t.childNodes)s+=ti(o);return`<${r}${n}>${s}</${r}>`},ri=e=>G(e)||ce(e)?e.value:e,se=(e,t)=>{const r=e.trim();if(r.startsWith("!"))return!se(r.slice(1).trim(),t);if(r.startsWith("'")&&r.endsWith("'")||r.startsWith('"')&&r.endsWith('"'))return r.slice(1,-1);if(/^-?\d+(\.\d+)?$/.test(r))return Number(r);if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;if(r!=="undefined"){if(/^[\w$]+(?:\.[\w$]+)*$/.test(r)){const n=r.split(".");let s=t;for(const o of n){if(s==null)return;s===t?s=ri(s[o]):s=s[o]}return s}try{const n=Object.keys(t),s=n.map(o=>ri(t[o]));return new Function(...n,`return (${r});`)(...s)}catch{return}}},sm=e=>{const t=e.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);return t?{itemName:t[1],indexName:t[2]||void 0,listExpr:t[3].trim()}:null},Vr=(e,t,r,n=!1)=>{const s=e.getAttribute(`${r}-for`),o=s!==null?sm(s):null;s!==null&&!o&&e.removeAttribute(`${r}-for`);const i=n?Wo(e,r):"";if(s!==null&&o){const f=se(o.listExpr,t);if(e.parentNode){const m=e.parentNode;if(!Array.isArray(f))return m.removeChild(e),!0;for(let v=0;v<f.length;v++){const b=f[v],g=e.cloneNode(!0);g.removeAttribute(`${r}-for`),g.removeAttribute(":key"),g.removeAttribute(`${r}-key`);const w={...t,[o.itemName]:b};o.indexName&&(w[o.indexName]=v),Vr(g,w,r,n)&&(Kr(g,w,r,n),m.insertBefore(g,e))}return m.removeChild(e),!0}}const a=e.getAttribute(`${r}-if`);if(a!==null&&!se(a,t))return!1;const c=e.getAttribute(`${r}-show`);if(c!==null&&!se(c,t)){const f=e;f.style?f.style.display="none":e.setAttribute("style","display: none;")}const l=e.getAttribute(`${r}-text`);if(l!==null){const f=se(l,t);e.textContent=String(f??"")}const u=e.getAttribute(`${r}-html`);if(u!==null){const f=se(u,t);e.innerHTML=Jo(String(f??""))}const h=e.getAttribute(`${r}-class`);if(h!==null){const f=h.trim();if(f.startsWith("{")){const m=f.slice(1,-1).trim().split(",");for(const v of m){const b=v.indexOf(":");if(b>-1){const g=v.slice(0,b).trim().replace(/^['"]|['"]$/g,"");se(v.slice(b+1).trim(),t)&&e.classList.add(g)}}}else{const m=se(h,t);typeof m=="string"?m.split(/\s+/).filter(Boolean).forEach(v=>e.classList.add(v)):Array.isArray(m)&&m.filter(Boolean).forEach(v=>e.classList.add(v))}}const d=e.getAttribute(`${r}-style`);if(d!==null){const f=se(d,t);if(f&&typeof f=="object"){const m=e;for(const[v,b]of Object.entries(f)){const g=v.replace(/([A-Z])/g,"-$1").toLowerCase();m.style.setProperty(g,String(b))}}}const p=Array.from(e.attributes);for(const f of p)if(f.name.startsWith(`${r}-bind:`)){const m=f.name.slice(`${r}-bind:`.length),v=se(f.value,t);v===!1||v===null||v===void 0?e.removeAttribute(m):v===!0?e.setAttribute(m,""):e.setAttribute(m,String(v))}return i&&e.setAttribute(Vt,zr(i)),!0},Kr=(e,t,r,n=!1)=>{const s=Array.from(e.children);for(const o of s){let i=!1;if(o.hasAttribute(`${r}-for`)){const a=Vr(o,t,r,n);if(i=!0,!a){o.remove();continue}if(o.parentNode!==e)continue}if(!i&&!Vr(o,t,r,n)){o.remove();continue}Kr(o,t,r,n)}},ni=(e,t)=>{const r=Array.from(e.attributes);for(const n of r)(n.name.startsWith(`${t}-`)||n.name.startsWith(":")||n.name===":key")&&e.removeAttribute(n.name);for(const n of Array.from(e.children))ni(n,t)},yt=(e,t,r={})=>{const{prefix:n="bq",stripDirectives:s=!1,includeStoreState:o=!1,annotateHydration:i=!1}=r;if(!e||typeof e!="string")throw new Error("bQuery SSR: template must be a non-empty string.");const a=e.trim();if(dh()==="pure"){const p=Kh(a,t,{prefix:n,stripDirectives:s,annotateHydration:i});let f;return o&&(f=vt({storeIds:Array.isArray(o)?o:void 0}).stateJson),{html:p,storeState:f}}const c=hh();if(!c)throw new Error("bQuery SSR: DOMParser is not available in this environment. Provide a DOMParser-compatible implementation before calling renderToString().");const l=new c().parseFromString(a,"text/html"),u=l.body||l.documentElement;if(!u)throw new Error("bQuery SSR: Failed to parse template.");if(Kr(u,t,n,i),s)for(const p of Array.from(u.children))ni(p,n);let h="";for(const p of u.childNodes)h+=ti(p);let d;return o&&(d=vt({storeIds:Array.isArray(o)?o:void 0}).stateJson),{html:h,storeState:d}},si=()=>typeof globalThis<"u"?globalThis:{},rr=()=>{const e=si();if(typeof e.Bun?.version=="string")return"bun";if(typeof e.Deno?.version?.deno=="string")return"deno";const t=e.navigator;return typeof t?.userAgent=="string"&&t.userAgent.toLowerCase().includes("cloudflare-workers")?"workerd":typeof e.process?.versions?.node=="string"?"node":typeof e.window<"u"&&typeof e.document<"u"?"browser":"unknown"},om=()=>{const e=rr();return e==="bun"||e==="deno"||e==="node"||e==="workerd"},im=()=>rr()==="browser",am=()=>{const e=si(),t=e.crypto;return{fetchApi:typeof e.Request=="function"&&typeof e.Response=="function"&&typeof e.fetch=="function",webStreams:typeof e.ReadableStream=="function",textEncoder:typeof e.TextEncoder=="function",subtleCrypto:typeof t?.subtle=="object"&&t?.subtle!==null,randomUuid:typeof t?.randomUUID=="function",domParser:typeof e.DOMParser=="function"}},gt=Symbol.for("bquery.ssr.defer"),cm=e=>(Object.defineProperty(e,gt,{value:!0,enumerable:!1,configurable:!0}),e),lm=(e,t)=>{const r=e instanceof Promise?e:Promise.resolve(e);return{[gt]:!0,promise:r,fallback:t}},um=e=>typeof e=="object"&&e!==null&&e[gt]===!0,fm=async(e,t)=>{const r=Object.create(null),n=Object.entries(e);await Promise.all(n.map(async([s,o])=>{if(!N(s)){if(G(o)||ce(o)){r[s]=o;return}if(um(o)){try{r[s]=await o.promise}catch(i){t.reportError(i),r[s]=o.fallback}return}if(o&&typeof o.then=="function"){try{r[s]=await o}catch(i){t.reportError(i),r[s]=void 0}return}if(typeof o=="function"&&o[gt]){try{r[s]=await Promise.resolve(o(t))}catch(i){t.reportError(i),r[s]=void 0}return}r[s]=o}}));for(const[s,o]of Object.entries(e))!N(s)&&!Object.prototype.hasOwnProperty.call(r,s)&&(G(o)||ce(o))&&(r[s]=o);return r},j=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),dm=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),hm=e=>e.replace(/<\/(script)/gi,"<\\/$1").replace(/<!--/g,"<\\!--").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),oi=()=>{const e={title:null,titleTemplate:null,meta:[],link:[],script:[]};return{add:s=>{typeof s.title=="string"&&(e.title=s.title),typeof s.titleTemplate=="string"&&(e.titleTemplate=s.titleTemplate),Array.isArray(s.meta)&&e.meta.push(...s.meta),Array.isArray(s.link)&&e.link.push(...s.link),Array.isArray(s.script)&&e.script.push(...s.script)},state:()=>({...e,meta:[...e.meta],link:[...e.link],script:[...e.script]}),render:(s={})=>{let o="";if(e.title!==null){const i=e.titleTemplate?e.titleTemplate.replace(/%s/g,e.title):e.title;o+=`<title>${dm(i)}</title>`}for(const i of e.meta){let a="";for(const[c,l]of Object.entries(i))l!=null&&(N(c)||(a+=` ${c==="httpEquiv"?"http-equiv":c}="${j(String(l))}"`));o+=`<meta${a}>`}for(const i of e.link){let a=` rel="${j(i.rel)}" href="${j(i.href)}"`;i.as&&(a+=` as="${j(i.as)}"`),i.type&&(a+=` type="${j(i.type)}"`),i.crossorigin&&(a+=` crossorigin="${j(i.crossorigin)}"`),i.media&&(a+=` media="${j(i.media)}"`),i.integrity&&(a+=` integrity="${j(i.integrity)}"`),(i.nonce??s.nonce)&&(a+=` nonce="${j(i.nonce??s.nonce)}"`),o+=`<link${a}>`}for(const i of e.script){let a="";i.src&&(a+=` src="${j(i.src)}"`),i.type?a+=` type="${j(i.type)}"`:i.module&&(a+=' type="module"'),i.defer&&(a+=" defer"),i.async&&(a+=" async"),i.crossorigin&&(a+=` crossorigin="${j(i.crossorigin)}"`),i.integrity&&(a+=` integrity="${j(i.integrity)}"`);const c=i.nonce??s.nonce;c&&(a+=` nonce="${j(c)}"`),o+=`<script${a}>${i.body?hm(i.body):""}<\/script>`}return o},reset:()=>{e.title=null,e.titleTemplate=null,e.meta=[],e.link=[],e.script=[]}}},ii=()=>{const e=[];return{preload(t,r={}){e.push({href:t,rel:"preload",...r})},module(t,r={}){e.push({href:t,rel:"modulepreload",...r})},style(t,r={}){e.push({href:t,rel:"stylesheet",...r})},list:()=>[...e],render(t={}){let r="";for(const n of e){let s=` rel="${j(n.rel)}" href="${j(n.href)}"`;n.as&&(s+=` as="${j(n.as)}"`),n.type&&(s+=` type="${j(n.type)}"`),n.crossorigin&&(s+=` crossorigin="${j(n.crossorigin)}"`),n.integrity&&(s+=` integrity="${j(n.integrity)}"`),t.nonce&&(s+=` nonce="${j(t.nonce)}"`),r+=`<link${s}>`}return r},reset(){e.length=0}}},mm=e=>{const t=Object.create(null);if(!e)return t;for(const r of e.split(/;\s*/)){const n=r.indexOf("=");if(n===-1)continue;const s=r.slice(0,n).trim(),o=r.slice(n+1).trim();if(!(!s||N(s)))try{t[s]=decodeURIComponent(o)}catch{t[s]=o}}return t},pm=e=>{if(!e)return"en";const t=e.split(",").map(r=>{const[n,...s]=r.trim().split(";"),o=s.find(a=>a.trim().startsWith("q=")),i=o?Number.parseFloat(o.split("=")[1]):1;return{tag:n.trim(),q:Number.isFinite(i)?i:0}}).filter(r=>r.tag);return t.length?(t.sort((r,n)=>n.q-r.q),t[0].tag):"en"},vm=()=>{try{return bn()}catch{return""}},ai=()=>{const e=new Map,t={append(r,n){const s=String(r).toLowerCase(),o=e.get(s);o?o.push(String(n)):e.set(s,[String(n)])},delete(r){e.delete(String(r).toLowerCase())},get(r){const n=e.get(String(r).toLowerCase());return n?n.join(", "):null},has(r){return e.has(String(r).toLowerCase())},set(r,n){e.set(String(r).toLowerCase(),[String(n)])},forEach(r,n){for(const[s,o]of e)r.call(n,o.join(", "),s,t)},*entries(){for(const[r,n]of e)yield[r,n.join(", ")]},[Symbol.iterator](){return t.entries()}};return t},ci=()=>({aborted:!1,onabort:null,reason:void 0,addEventListener(){},removeEventListener(){},dispatchEvent(){return!1},throwIfAborted(){}}),ym=e=>typeof e=="object"&&e!==null&&typeof e.get=="function",gm=e=>typeof e=="object"&&e!==null&&typeof e.aborted=="boolean",li=()=>typeof Headers=="function"?new Headers:ai(),bt=(e={})=>{const t=e.url instanceof URL?e.url.toString():typeof e.url=="string"?new URL(e.url,"http://localhost/").toString():"http://localhost/",r=e.request??(typeof Request=="function"?new Request(t):{url:t,headers:ai(),signal:ci()}),n=e.url??r.url,s=n instanceof URL?n:new URL(String(n),"http://localhost/"),o=ym(r.headers)?r.headers:li();return{request:r,url:s,headers:o,cookies:mm(o.get("cookie")??""),userAgent:e.userAgent??o.get("user-agent")??"",locale:e.locale??pm(o.get("accept-language")),signal:e.signal??(gm(r.signal)?r.signal:ci()),nonce:e.nonce??vm(),mode:e.mode??"string",head:oi(),assets:ii(),status:200,responseHeaders:li(),reportError(i){e.onError?.(i)}}},bm=e=>e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),wm=e=>e===" "||e===`
279
+ `||e===" "||e==="\r"||e==="\f",Sm=(e,t)=>{if(e.slice(0,7).toLowerCase()!=="<script")return e;const r=e[7];return r!==">"&&!wm(r)?e:`<script nonce="${bm(t)}"${e.slice(7)}`},Em=(e,t)=>{if(!t)return e;const r=e.toLowerCase().indexOf("</head>");return r===-1?e:e.slice(0,r)+t+e.slice(r)},Am=(e,t)=>{if(!t)return e;const r=e.toLowerCase().lastIndexOf("</body>");return r===-1?e:e.slice(0,r)+t+e.slice(r)},Yr=async(e,t,r={})=>{const n=r.context??bt({mode:"string"});if(n.signal.aborted)throw new DOMException("SSR render aborted","AbortError");const s=await fm(t,n);if(n.signal.aborted)throw new DOMException("SSR render aborted","AbortError");let{html:o,storeState:i}=yt(e,s,{prefix:r.prefix,stripDirectives:r.stripDirectives,includeStoreState:!1,annotateHydration:r.annotateHydration});const a=n.head.render({nonce:n.nonce}),c=n.assets.render({nonce:n.nonce});let l="";if(r.includeStoreState){const u=vt({storeIds:Array.isArray(r.includeStoreState)?r.includeStoreState:void 0,scriptId:r.storeScriptId,globalKey:r.storeGlobalKey});i=u.stateJson,l=u.scriptTag,n.nonce&&(l=Sm(l,n.nonce))}return r.injectHead!==!1&&(o=Em(o,a+c),o=Am(o,l)),{html:o,storeState:i,context:n,headHtml:a,assetsHtml:c,storeScriptTag:l}},ui=()=>{if(typeof TextEncoder>"u")throw new Error("bQuery SSR: TextEncoder is not available in this runtime.");return new TextEncoder},km=(e,t,r={})=>{if(typeof ReadableStream>"u")throw new Error("bQuery SSR: ReadableStream is not available in this runtime.");const n=ui(),s=r.context??bt({...r,mode:"stream"}),o={...r,context:s};return new ReadableStream({async start(i){const a=()=>{try{i.error(new DOMException("SSR stream aborted","AbortError"))}catch{}};if(s.signal.aborted){a();return}s.signal.addEventListener("abort",a,{once:!0});try{const c=await Yr(e,t,o);i.enqueue(n.encode(c.html)),i.close()}catch(c){s.signal.removeEventListener("abort",a);try{i.error(c)}catch{}}finally{s.signal.removeEventListener("abort",a)}}})},Tm=async e=>{const t=globalThis.crypto?.subtle;if(!t)return null;try{const r=await t.digest("SHA-1",ui().encode(e)),n=new Uint8Array(r);let s="";for(const o of n)s+=o.toString(16).padStart(2,"0");return`W/"${s.slice(0,27)}"`}catch{return null}},Rm=async(e,t,r={})=>{const n=r.context??bt({...r,mode:"string"}),s=await Yr(e,t,{...r,context:n}),o=r.status??n.status??200,i=new Headers(r.headers);for(const[a,c]of n.responseHeaders)i.append(a,c);if(i.has("content-type")||i.set("content-type",r.contentType??"text/html; charset=utf-8"),r.cacheControl&&i.set("cache-control",r.cacheControl),r.etag){const a=await Tm(s.html);if(a){i.set("etag",a);const c=n.headers.get("if-none-match");if(c&&c===a)return new Response(null,{status:304,headers:i})}}return new Response(s.html,{status:o,headers:i})},Jr=e=>{if(typeof e!="string")return e;if(typeof document>"u")return null;try{return document.querySelector(e)}catch{return null}},wt=(e,t,r)=>{const n=Jr(e);return n?Ho(n,t,r):null},te=()=>{},Cm=e=>{if(typeof window>"u")return e(),te;const t=window.requestIdleCallback;if(typeof t=="function"){const n=t(e);return()=>{const s=window.cancelIdleCallback;typeof s=="function"&&s(n)}}const r=setTimeout(e,1);return()=>clearTimeout(r)},nr=e=>{let t=!1,r=te,n=te;const s=new Promise((a,c)=>{r=a,n=c});let o=te;return{handle:{ready:s,cancel(){t||(t=!0,o(),r(null))}},arm:a=>{o=e(()=>{if(!t)try{const c=a();r(c)}catch(c){n(c)}})}}},$m=(e,t,r={})=>{const{rootMargin:n,threshold:s,...o}=r,{handle:i,arm:a}=nr(c=>{const l=Jr(e);if(!l||typeof IntersectionObserver>"u")return c(),te;const u=new IntersectionObserver(h=>{for(const d of h)if(d.isIntersecting){u.disconnect(),c();return}},{rootMargin:n??"0px",threshold:s??0});return u.observe(l),()=>u.disconnect()});return a(()=>wt(e,t,o)),i},Om=(e,t,r={})=>{const{handle:n,arm:s}=nr(o=>Cm(o));return s(()=>wt(e,t,r)),n},Lm=(e,t,r={})=>{const n=r.events??["pointerdown","click","keydown","touchstart","focusin"],{events:s,...o}=r,{handle:i,arm:a}=nr(c=>{const l=Jr(e);if(!l)return c(),te;const u=()=>{h(),c()},h=()=>{for(const d of n)l.removeEventListener(d,u,!0)};for(const d of n)l.addEventListener(d,u,{once:!0,capture:!0});return h});return a(()=>wt(e,t,o)),i},Pm=(e,t,r,n={})=>{const{handle:s,arm:o}=nr(i=>{if(typeof window>"u"||typeof window.matchMedia!="function")return i(),te;const a=window.matchMedia(r);if(a.matches)return i(),te;let c=te;const l=h=>{h.matches&&(c(),i())};if(typeof a.addEventListener=="function")return a.addEventListener("change",l),c=()=>a.removeEventListener("change",l),c;const u=a;return typeof u.addListener=="function"&&typeof u.removeListener=="function"?(u.addListener(l),c=()=>u.removeListener(l),c):(i(),te)});return o(()=>wt(e,t,n)),s},Nm=(e,t,r={})=>wt(e,t,r),Im=(e,t={})=>{const r=t.prefix??"bq",n=t.warn??xt(),s=t.onMismatch,o=[];if(!e||typeof e.querySelectorAll!="function")return o;const i=[];typeof e.getAttribute=="function"&&e.getAttribute("data-bq-h")!==null&&i.push(e);for(const a of Array.from(e.querySelectorAll(`[${Vt}]`)))i.push(a);for(const a of i){const c=a.getAttribute("data-bq-h")??"",l=Wo(a,r),u=zr(l);if(u!==c){const h={element:a,expected:c,actual:u,signature:l};o.push(h),s?.(h),n&&console.warn(`[bQuery SSR] Hydration mismatch on <${a.tagName.toLowerCase()}>: server="${c}" client="${u}" signature="${l}".`,a)}}return o},Mm=e=>typeof e=="object"&&e!==null&&e[gt]===!0,Dm=e=>G(e)||ce(e),_m=/^[A-Za-z][\w-]*$/,xm=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/,fi=(e,t)=>typeof e!="string"||!_m.test(e)?t:e,qm=(e,t)=>typeof e!="string"||!xm.test(e)?t:e,zm=e=>{const t=e.replace(/-s$/,"-r");return t===e&&e.endsWith("-r")?`${e}-template`:t===e?`${e}-r`:t},Um=(e,t)=>{const r={},n=[];let s=0;for(const[o,i]of Object.entries(e)){if(Dm(i)){r[o]=i;continue}if(Mm(i)){const a=`${t}-${s++}`;n.push({id:a,key:o,promise:i.promise}),r[o]=i.fallback;continue}if(i&&typeof i.then=="function"){const a=`${t}-${s++}`;n.push({id:a,key:o,promise:i}),r[o]=void 0;continue}r[o]=i}return{syncContext:r,slots:n}},Gr=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),sr=e=>Gr(e).replace(/"/g,"&quot;"),jm=e=>e.replace(/<\/(script)/gi,"<\\/$1").replace(/<!--/g,"<\\!--").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),Hm=jm('(()=>{var c=document.currentScript;if(!c)return;var slotId=c.getAttribute("data-bq-slot");var templateId=c.getAttribute("data-bq-template");if(!slotId||!templateId)return;var s=document.getElementById(slotId);var t=document.getElementById(templateId);if(!s||!t)return;var f=t.content?t.content.cloneNode(true):t;while(s.firstChild)s.removeChild(s.firstChild);s.appendChild(f);t.parentNode&&t.parentNode.removeChild(t);s.parentNode&&s.replaceWith(...s.childNodes);})();'),Wm=(e,t,r)=>`<script${r?` nonce="${sr(r)}"`:""} data-bq-slot="${sr(e)}" data-bq-template="${sr(t)}">${Hm}<\/script>`,Fm=(e,t,r,n,s,o)=>{const i=t[`__suspense_${n}`];return typeof i=="string"?yt(i,{...r,[n]:s},{prefix:o.prefix,stripDirectives:o.stripDirectives,annotateHydration:o.annotateHydration}).html:s==null?"":Gr(typeof s=="string"?s:String(s))},Bm=(e,t)=>{if(!(t in e.attributes))return;delete e.attributes[t];const r=e.attributeOrder.indexOf(t);r!==-1&&e.attributeOrder.splice(r,1)},di=(e,t,r=[])=>({type:"element",tag:e,attributes:{id:t},attributeOrder:["id"],children:r,void:!1,raw:!1}),hi=(e,t)=>{for(const r of e)r.type==="element"&&(t(r),hi(r.children,t))},mi=(e,t)=>{for(const r of e){if(r.type!=="element")continue;if(r.tag===t)return r;const n=mi(r.children,t);if(n)return n}return null},Qm=(e,t,r,n)=>{const s=qm(n.slotTag,"bq-slot"),o=Xt(e),i=new Map(r.map(l=>[l.key,l])),a=new Set;hi(o.children,l=>{const u=l.attributes["data-bq-defer"];if(!u)return;Bm(l,"data-bq-defer");const h=i.get(u);if(!h||a.has(h.id))return;const d=l.children;l.children=[di(s,h.id,d)],a.add(h.id)});const c=mi(o.children,"body")?.children??o.children;for(const l of r)a.has(l.id)||c.push(di(s,l.id));return mt(o)},Vm=e=>e!==void 0&&/\s/.test(e),Km=e=>e===void 0||e==="="||e===">"||e==="/"||/\s/.test(e),Ym=e=>{let t="",r=0,n=!1,s="",o=!1,i=!1,a=!0;const c="bq-defer";for(;r<e.length;){const l=e[r];if(!n){l==="<"&&(n=!0,o=!1,i=!1,a=!0),t+=l,r++;continue}if(s){t+=l,l===s&&(s=""),r++;continue}if(l==='"'||l==="'"){s=l,t+=l,r++;continue}if(l===">"){n=!1,t+=l,r++;continue}if(!o){if(t+=l,r++,!i){if(/\s/.test(l))continue;i=!0,(l==="/"||l==="!"||l==="?")&&(a=!1);continue}a&&/\s/.test(l)&&(o=!0);continue}if(a&&e.startsWith(c,r)&&Vm(e[r-1])&&Km(e[r+8])){t+="data-bq-defer",r+=8;continue}t+=l,r++}return t},Jm=()=>{if(typeof TextEncoder>"u")throw new Error("bQuery SSR: TextEncoder is not available in this runtime.");return new TextEncoder},Gm=(e,t,r={})=>{if(typeof ReadableStream>"u")throw new Error("bQuery SSR: ReadableStream is not available in this runtime.");const n=Jm(),s=r.context??bt({...r,mode:"stream"}),o=fi(r.slotIdPrefix??"bq-s","bq-s"),i=fi(zm(o),"bq-r");return new ReadableStream({async start(a){const c=()=>{try{a.error(new DOMException("SSR stream aborted","AbortError"))}catch{}};if(s.signal.aborted){c();return}s.signal.addEventListener("abort",c,{once:!0});try{const{syncContext:l,slots:u}=Um(t,o),h=yt(Ym(e),l,{prefix:r.prefix,stripDirectives:r.stripDirectives,annotateHydration:r.annotateHydration}).html,d=Qm(h,l,u,r);a.enqueue(n.encode(d));const p=[],f=[];let m=u.length;const v=g=>{const w=f.shift();if(w){w(g);return}p.push(g)};for(const[g,w]of u.entries())w.promise.then(S=>({index:g,slot:w,ok:!0,value:S}),S=>({index:g,slot:w,ok:!1,error:S})).then(v);const b=async()=>{const g=p.shift();return g||new Promise(w=>{f.push(w)})};for(;m>0;){if(s.signal.aborted)return;const g=await b();m--;const{slot:w}=g,S=`${i}-${w.id.split("-").pop()}`;let k;g.ok?k=Fm(e,t,l,w.key,g.value,r):(s.reportError(g.error),k="");const A=`<template id="${sr(S)}">${k}</template>`,E=Wm(w.id,S,s.nonce);a.enqueue(n.encode(A+E))}a.close()}catch(l){try{a.error(l)}catch{}}finally{s.signal.removeEventListener("abort",c)}}})},Xm=e=>{if(!e||!e.meta)return;const t=e.meta.loader;return typeof t=="function"?t:void 0},pi=e=>{const t=typeof e.url=="string"?new URL(e.url,"http://localhost/"):e.url,r=e.base??"";let n=t.pathname;r&&(n===r?n="/":n.startsWith(`${r}/`)&&(n=n.slice(r.length)||"/"));const s=no(n,e.routes),o={path:n,params:s?.params??{},query:Qs(t.search),matched:s?.matched??null,hash:t.hash.replace(/^#/,"")},i=s!==null,a=s?.matched??null,c=!!a&&"redirectTo"in a&&typeof a.redirectTo=="string";return{route:o,matched:i,isRedirect:c,redirectTo:c?a.redirectTo:void 0}},vi=async(e,t)=>{const r=Xm(e.matched);if(r)try{return await r({route:e,ctx:t})}catch(n){t.reportError(n);return}},Zm=async e=>{const t=pi({url:e.url,routes:e.routes,base:e.base}),r=t.matched?await vi(t.route,e.ctx):void 0;return{route:t.route,matched:t.matched,isRedirect:t.isRedirect,redirectTo:t.redirectTo,data:r,bindings:{route:t.route,params:t.route.params,query:t.route.query,data:r}}},Xr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),yi=e=>{const t={};for(const[r,n]of Object.entries(e))N(r)||(t[r]=n);return t},ep=e=>{const{version:t,storeIds:r,scriptId:n="__BQUERY_STORE_SNAPSHOT__",globalKey:s="__BQUERY_STORE_SNAPSHOT__",nonce:o}=e;if(typeof t!="string"||t.length===0)throw new Error("serializeStoreSnapshot: `version` is required and must be a non-empty string.");if(N(n)||N(s))throw new Error("serializeStoreSnapshot: invalid scriptId/globalKey.");const i=r??Ht(),a=Object.create(null);for(const d of i){if(N(d))continue;const p=we(d);p&&(a[d]=yi(p.$state))}const c={version:t,state:a},l=JSON.stringify(c),u=Ue(l),h=Ue(JSON.stringify(s));return{snapshot:c,json:l,scriptTag:`<script id="${pt(n)}"${o?` nonce="${pt(o)}"`:""}>window[${h}]=${u}<\/script>`}},gi=e=>{if(!Xr(e))return!1;const t=e.version,r=e.state;return typeof t=="string"&&Xr(r)},tp=(e,t={})=>{if(!gi(e))return t.strict&&console.warn("[bQuery SSR] hydrateStoreSnapshot: snapshot has invalid shape."),{applied:!1,reason:"invalid-shape",appliedIds:[],unknownIds:[]};if(typeof t.expectedVersion=="string"&&t.expectedVersion!==e.version)return t.strict&&console.warn(`[bQuery SSR] hydrateStoreSnapshot: version mismatch — server="${e.version}" client="${t.expectedVersion}". Skipping.`),{applied:!1,reason:"version-mismatch",appliedIds:[],unknownIds:[]};const r=[],n=[];for(const[s,o]of Object.entries(e.state)){if(N(s)||!Xr(o))continue;const i=we(s);if(!i||typeof i.$patch!="function"){n.push(s),t.strict&&console.warn(`[bQuery SSR] hydrateStoreSnapshot: store "${s}" is not registered; skipping.`);continue}i.$patch(yi(o)),r.push(s)}return{applied:r.length>0,appliedIds:r,unknownIds:n}},rp=(e="__BQUERY_STORE_SNAPSHOT__",t="__BQUERY_STORE_SNAPSHOT__")=>{if(N(e)||N(t)||typeof window>"u")return null;const r=window[e];try{delete window[e]}catch{window[e]=void 0}if(typeof document<"u"&&typeof document.getElementById=="function"){const n=document.getElementById(t);n&&n.remove()}return gi(r)?r:null},bi=e=>{const t=Object.create(null);for(const[r,n]of Object.entries(e))N(r)||(t[r]=n);return t},np=(e={})=>{const t=Object.create(null);if(e.initial)for(const[r,n]of Object.entries(e.initial))N(r)||(t[r]=n);return{set(r,n){N(r)||(t[r]=n)},get(r){return t[r]},entries(){return bi(t)},render(r={}){const n=r.scriptId??"__BQUERY_RESUME__",s=r.globalKey??"__BQUERY_RESUME__";if(N(n)||N(s))return"";const o=Ue(JSON.stringify(t)),i=Ue(JSON.stringify(s));return`<script id="${pt(n)}"${r.nonce?` nonce="${pt(r.nonce)}"`:""}>window[${i}]=${o}<\/script>`}}},sp=(e="__BQUERY_RESUME__",t="__BQUERY_RESUME__")=>{const r={get:()=>{},hasSnapshot:!1,entries:()=>({})};if(N(e)||N(t)||typeof window>"u")return r;const n=window[e];try{delete window[e]}catch{window[e]=void 0}if(typeof document<"u"&&typeof document.getElementById=="function"){const o=document.getElementById(t);o&&o.remove()}if(!n||typeof n!="object")return r;const s=n;return{hasSnapshot:!0,get(o){if(!N(o))return s[o]},entries(){return bi(s)}}},wi=e=>e,Si=e=>async t=>Promise.resolve(e(t)),Ei=e=>async t=>Promise.resolve(e(t)),op=e=>e!=="GET"&&e!=="HEAD",Zr=class extends Error{constructor(e){super(e),this.name="NodeRequestLimitError"}},or=(e,t)=>{const r=e[t];return Array.isArray(r)?r[0]:r},ip=e=>{const t=or(e.headers,"content-length");if(!t)return null;const r=Number.parseInt(t,10);return Number.isSafeInteger(r)&&r>=0?r:null},ap=(e,t)=>new Promise((r,n)=>{const s=[];let o=0,i=!1;const a=l=>{i||(i=!0,s.length=0,o=0,e.destroy?.(l instanceof Error?l:void 0),n(l))},c=ip(e);if(t!==void 0&&c!==null&&c>t){a(new Zr(`Request body exceeds ${t} bytes.`));return}e.on("data",l=>{if(i)return;const u=typeof l=="string"?new TextEncoder().encode(l):l;if(o+=u.byteLength,t!==void 0&&o>t){a(new Zr(`Request body exceeds ${t} bytes.`));return}s.push(u)}),e.on("end",()=>{if(i)return;i=!0;const l=new ArrayBuffer(o),u=new Uint8Array(l);let h=0;for(const d of s)u.set(d,h),h+=d.byteLength;r(l)}),e.on("error",a)}),cp=(e,t)=>{const r=`${t}://localhost`,n=or(e.headers,"host")||"localhost";try{return new URL(e.url??"/",`${t}://${n}`)}catch{try{return new URL(e.url??"/",r)}catch{return new URL("/",r)}}},lp=async(e,t={})=>{const r=typeof or(e.headers,"x-forwarded-proto")=="string"?or(e.headers,"x-forwarded-proto").split(",")[0].trim().toLowerCase():"",n=cp(e,r==="http"||r==="https"?r:"http"),s=new Headers;for(const[a,c]of Object.entries(e.headers))if(c!==void 0)if(Array.isArray(c))for(const l of c)s.append(a,l);else s.append(a,c);const o=(e.method??"GET").toUpperCase(),i={method:o,headers:s};return op(o)&&(i.body=await ap(e,t.maxBodyBytes)),new Request(n.toString(),i)},up=e=>{const t=e.getSetCookie?.();if(Array.isArray(t)&&t.length>0)return t;const r=e.get("set-cookie");return r?[r]:[]},fp=e=>new Promise((t,r)=>{const n=typeof e.once=="function"?e.once.bind(e):void 0,s=typeof e.on=="function"?e.on.bind(e):void 0,o=n??s;if(!o){t();return}o("drain",()=>t()),o("error",i=>{r(i instanceof Error?i:new Error("Node response stream errored while draining."))})}),Ai=async(e,t)=>{t.statusCode=e.status;const r=up(e.headers);if(r.length>0&&t.setHeader("set-cookie",r.length===1?r[0]:r),e.headers.forEach((s,o)=>{o.toLowerCase()!=="set-cookie"&&t.setHeader(o,s)}),!e.body){t.end();return}const n=e.body.getReader();for(;;){const{value:s,done:o}=await n.read();if(o)break;s&&!t.write(s)&&await fp(t)}t.end()},ki=(e,t={})=>async(r,n)=>{let s;try{s=await lp(r,t)}catch(o){if(o instanceof Zr){await Ai(new Response(o.message,{status:413}),n);return}throw o}await Ai(await Promise.resolve(e(s)),n)},dp=e=>{switch(rr()){case"node":return ki(e);case"bun":return Si(e);case"deno":return Ei(e);default:return wi(e)}},hp="http://localhost",mp={"<":"\\u003C",">":"\\u003E","&":"\\u0026","\u2028":"\\u2028","\u2029":"\\u2029"},pp=/[<>&\u2028\u2029]/g,vp=null,Ti="x-bquery-websocket-passthrough",yp=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),ir=()=>Object.create(null),en=e=>{if(!e)throw new Error(`route path must be a non-empty string; received ${String(e)}`);if(e==="*"||e==="/*")return"/*";const t=e.startsWith("/")?e:`/${e}`;return t.length>1&&t.endsWith("/")?t.slice(0,-1):t},Ri=e=>{const t=en(e);if(t==="/*")return{path:t,paramNames:[],pattern:/^\/.*$/};const r=t.split("/").filter(Boolean);if(r.length===0)return{path:t,paramNames:[],pattern:/^\/$/};const n=[];let s="^";for(const[o,i]of r.entries()){if(s+="/",i==="*"){if(o!==r.length-1)throw new Error(`invalid route path: "*" must be the final segment in "${t}"`);s+=".*";break}if(i.startsWith(":")){const a=i.slice(1);if(!/^[A-Za-z_$][\w$]*$/.test(a))throw new Error(`invalid route param name: ${a} - must start with a letter, $, or _ and contain only word characters`);if(N(a))throw new Error(`invalid route param name: ${a} - reserved for object safety`);n.push(a),s+="([^/]+)";continue}s+=yp(i)}return s+="/?$",{path:t,paramNames:n,pattern:new RegExp(s)}},gp=e=>{if(typeof e>"u")return vp;const t=Array.isArray(e)?e:[e];if(t.length===0)throw new Error("route method must be specified - received empty array");const r=new Set(t.map(n=>n.trim().toUpperCase()).filter(Boolean));if(r.size===0)throw new Error(`route method must include at least one non-empty method string; received ${JSON.stringify(e)}`);return r},Ci=e=>{const t=ir();for(const[r,n]of e.searchParams.entries()){if(N(r))continue;const s=t[r];typeof s>"u"?t[r]=n:Array.isArray(s)?s.push(n):t[r]=[s,n]}return t},$i=(e,t)=>e instanceof URL?new URL(e.toString()):new URL(e,t),Oi=(e,t)=>{if(e instanceof Request)return e;if(typeof e=="string"||e instanceof URL)return new Request($i(e,t).toString());const{url:r,method:n="GET",headers:s,body:o=null}=e;return new Request($i(r,t).toString(),{method:n,headers:s,body:o})},bp=e=>typeof e>"u"?[]:[...new Set((Array.isArray(e)?e:[e]).map(t=>t.trim()).filter(Boolean))],wp=e=>{const t=e.data;if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},Sp=e=>e.replace(pp,t=>mp[t]),je=e=>new Headers(e),tn=(e,t)=>(e.has("content-type")||e.set("content-type",t),e),Ce=(e,t={})=>{const{headers:r,...n}=t;return new Response(e,{...n,headers:je(r)})},Li=(e,t={})=>{const r=tn(je(t.headers),"text/plain; charset=utf-8");return Ce(e,{...t,headers:r})},rn=(e,t={})=>{const{trusted:r=!1,...n}=t,s=tn(je(n.headers),"text/html; charset=utf-8");return Ce(r?e:ie(e),{...n,headers:s})},Pi=(e,t={})=>{const r=tn(je(t.headers),"application/json; charset=utf-8");let n;try{n=JSON.stringify(e)??"null"}catch{n="null"}return Ce(Sp(n),{...t,headers:r})},Ni=(e,t=302)=>Ce(null,{headers:je({location:e.toString()}),status:t}),Ii=(e,t,r={})=>{const{includeStoreState:n=!1,status:s=200,headers:o,...i}=r,a=yt(e,t,{...i,includeStoreState:!1}),c=n?vt({storeIds:Array.isArray(n)?n:void 0}).scriptTag:"";return rn(`${a.html}${c}`,{headers:o,status:s,trusted:!0})},nn=e=>{if(e.method.toUpperCase()!=="GET")return!1;const t=e.headers.get("upgrade");if(typeof t!="string"||t.trim().toLowerCase()!=="websocket")return!1;const r=e.headers.get("connection");if(typeof r!="string"||!r.split(",").some(s=>s.trim().toLowerCase()==="upgrade")||e.headers.get("sec-websocket-version")?.trim()!=="13")return!1;const n=e.headers.get("sec-websocket-key")?.trim();return typeof n=="string"&&/^[A-Za-z0-9+/]{22}==$/.test(n)},Ep=e=>{if(typeof e!="object"||e===null||e instanceof Response)return!1;const t=e;return typeof t.open=="function"&&typeof t.message=="function"&&typeof t.close=="function"&&typeof t.error=="function"},Ap=()=>{const e=new WeakMap;return t=>{const r=e.get(t);if(r)return r;const n={get protocol(){return t.protocol},get readyState(){return t.readyState},get url(){return t.url},send(s){t.send(s)},sendJson(s){const o=JSON.stringify(s);if(typeof o!="string")throw new TypeError("socket.sendJson() does not support undefined values");t.send(o)},close(s,o){t.close(s,o)}};return e.set(t,n),n}},kp=(e,t)=>{const r=Ap(),n=t.deserialize??wp;return{context:e,protocols:bp(t.protocols),headers:t.headers,async open(s){t.onOpen&&await t.onOpen(r(s),e)},async message(s,o){t.onMessage&&await t.onMessage(n(o),r(s),e,o)},async close(s,o){t.onClose&&await t.onClose(o,r(s),e)},async error(s,o){t.onError&&await t.onError(o,r(s),e)}}},Tp=()=>Ce(null,{headers:je({[Ti]:"1"}),status:204}),Rp=e=>e.headers.get(Ti)==="1",Cp=(e,t,r)=>{if(e.methods&&!e.methods.has(t))return null;const n=e.pattern.exec(r);if(!n)return null;const s=ir();for(const[o,i]of e.paramNames.entries())try{s[i]=decodeURIComponent(n[o+1]??"")}catch(a){if(a instanceof URIError)return null;throw a}return s},Mi=(e,t,r,n)=>{for(const s of e){const o=Cp(s,t,r);if(o)return n.params=o,s}return null},$p=async(e,t,r)=>{const n=async s=>{const o=t[s];if(!o)return r();let i=!1;return await o(e,async()=>{if(i)throw new Error("middleware next() called multiple times - if a middleware calls next(), it may only do so once");return i=!0,await n(s+1)})};return await n(0)},Op=async(e,t,r)=>{const n=async s=>{const o=t[s];if(!o)return r();let i=!1;return await o(e,async()=>{if(i)throw new Error("middleware next() called multiple times - if a middleware calls next(), it may only do so once");return i=!0,await n(s+1)})};return await n(0)},Lp=e=>async(t,r)=>{let n=null,s=null;const o=await e(t,async()=>(n=await r(),n instanceof Response?(s=n,n):Tp()));return s?o:o instanceof Response&&Rp(o)?n:o},Di=e=>{const t=Ri(e.path);return{handler:e.handler,methods:gp(e.method),middlewares:e.middlewares??[],paramNames:t.paramNames,path:t.path,pattern:t.pattern}},Pp=(e={})=>{const t=e.baseUrl??hp,r=[...e.middlewares??[]],n=[],s=[],o=e.notFound??(u=>u.text("Not Found",{status:404})),i=e.onError??((u,h)=>u instanceof Response?u:h.text("Internal Server Error",{status:500})),a=(u,h,d,p)=>(n.push(Di({handler:d,method:u,middlewares:p,path:h})),l),c=(u,h,d)=>{const p=Ri(u);return s.push({handler:h,methods:new Set(["GET"]),middlewares:d??[],paramNames:p.paramNames,path:p.path,pattern:p.pattern}),l},l={use(u){return r.push(u),l},add(u){return n.push(Di(u)),l},get(u,h,d){return a("GET",u,h,d)},post(u,h,d){return a("POST",u,h,d)},put(u,h,d){return a("PUT",u,h,d)},patch(u,h,d){return a("PATCH",u,h,d)},delete(u,h,d){return a("DELETE",u,h,d)},all(u,h,d){return a(void 0,u,h,d)},ws(u,h,d){return c(u,h,d)},async handle(u){const h=Oi(u,t),d=new URL(h.url),p=h.method.toUpperCase(),f=en(d.pathname||"/"),m=Ci(d),v={request:h,url:d,method:p,path:f,params:ir(),query:m,state:{},response:Ce,text:Li,html:rn,json:Pi,redirect:Ni,render:Ii,isWebSocketRequest:nn(h)};try{const b=Mi(n,p,f,v);return b?await $p(v,[...r,...b.middlewares,async g=>await b.handler(g)],async()=>await o(v)):await o(v)}catch(b){return await i(b,v)}},async handleWebSocket(u){const h=Oi(u,t),d=new URL(h.url),p=h.method.toUpperCase(),f=en(d.pathname||"/"),m=Ci(d),v={request:h,url:d,method:p,path:f,params:ir(),query:m,state:{},response:Ce,text:Li,html:rn,json:Pi,redirect:Ni,render:Ii,isWebSocketRequest:nn(h)};if(!v.isWebSocketRequest)return null;try{const b=Mi(s,p,f,v);return b?await Op(v,[...r.map(Lp),...b.middlewares],async()=>kp(v,typeof b.handler=="function"?await b.handler(v):b.handler)):null}catch(b){return await i(b,v)}}};return l};return y.$=sa,y.$$=oa,y.BQueryCollection=Rt,y.BQueryElement=Pe,y.BqLinkElement=Bs,y.Computed=Ye,y.HYDRATION_HASH_ATTR=Vt,y.HttpError=ye,y.Signal=Je,y.TaskWorkerAbortError=ge,y.TaskWorkerError=H,y.TaskWorkerSerializationError=Ae,y.TaskWorkerTimeoutError=Lt,y.TaskWorkerUnsupportedError=wr,y.animate=zt,y.announceToScreenReader=jf,y.auditA11y=Yf,y.back=su,y.batch=Se,y.batchTasks=Gc,y.bool=pl,y.breakpoints=bd,y.buckets=Ul,y.cache=Hl,y.callWorkerMethod=Fc,y.capturePosition=Rr,y.clearAnnouncements=Hf,y.clearTimeline=Kd,y.clipboard=Od,y.component=Ie,y.computed=D,y.configureSSR=uh,y.createAssetManager=ii,y.createBunHandler=Si,y.createDenoHandler=Ei,y.createForm=bf,y.createHeadManager=oi,y.createHttp=vr,y.createI18n=qf,y.createNodeHandler=ki,y.createPersistedStore=Fu,y.createReactiveRpcPool=sl,y.createReactiveRpcWorker=rl,y.createReactiveTaskPool=nl,y.createReactiveTaskWorker=tl,y.createRequestQueue=Ec,y.createRestClient=Lc,y.createResumableState=np,y.createRouter=ku,y.createRpcPool=ns,y.createRpcWorker=Nt,y.createSSRContext=bt,y.createSSRHandler=dp,y.createSSRRouterContext=Zm,y.createServer=Pp,y.createStore=Lr,y.createTaskPool=Dt,y.createTaskWorker=It,y.createTemplate=pf,y.createTrustedHtml=Ji,y.createUseFetch=cc,y.createWebHandler=wi,y.currentRoute=js,y.custom=If,y.customAsync=Mf,y.deduplicateRequest=Nc,y.defer=lm,y.defineBqueryConfig=ja,y.defineComponent=fl,y.defineLoader=cm,y.definePageMeta=Gl,y.defineStore=_u,y.deserializeStoreState=Yh,y.destroyStore=Mu,y.detectRuntime=rr,y.draggable=cd,y.droppable=pd,y.easeInCubic=Os,y.easeInOutCubic=Ps,y.easeInOutQuad=$s,y.easeInQuad=Rs,y.easeOutBack=Ns,y.easeOutCubic=Ls,y.easeOutExpo=Is,y.easeOutQuad=Cs,y.easingPresets=El,y.effect=U,y.effectScope=Ba,y.email=Of,y.enableDevtools=jd,y.escapeHtml=En,y.every=us,y.filter=cs,y.find=fs,y.fireEvent=ch,y.flip=Cr,y.flipElements=Ms,y.flipList=Al,y.flushEffects=jo,y.formatDate=vo,y.formatNumber=po,y.forward=ou,y.generateNonce=bn,y.generateSignalLabel=Bd,y.getBqueryConfig=ae,y.getConcurrencySupport=Yn,y.getCurrentScope=Mn,y.getCustomDirective=qd,y.getCustomDirectives=zd,y.getDevtoolsState=Yd,y.getFocusableElements=_r,y.getInstalledPlugins=xd,y.getSSRConfig=fh,y.getSSRRuntimeFeatures=am,y.getStore=we,y.getTimeline=Vd,y.getTrustedTypesPolicy=Sn,y.hasCSPDirective=Ki,y.html=Me,y.http=Sc,y.hydrateIsland=Nm,y.hydrateMount=Ho,y.hydrateOnIdle=Om,y.hydrateOnInteraction=Lm,y.hydrateOnMedia=Pm,y.hydrateOnVisible=$m,y.hydrateStore=Zo,y.hydrateStoreSnapshot=tp,y.hydrateStores=Jh,y.inspectComponents=qo,y.inspectSignals=_o,y.inspectStores=xo,y.interceptLinks=fu,y.isActive=wu,y.isActiveSignal=Su,y.isBrowserRuntime=im,y.isComputed=ce,y.isConcurrencySupported=Sr,y.isDevtoolsEnabled=Hd,y.isInstalled=_d,y.isNavigating=ru,y.isServerRuntime=om,y.isServerWebSocketSession=Ep,y.isSignal=G,y.isTrustedTypesSupported=Yi,y.isWebSocketRequest=nn,y.keyframePresets=kl,y.linear=Ts,y.link=uu,y.linkedSignal=Ac,y.listStores=Ht,y.logComponents=Xd,y.logSignals=Jd,y.logStores=Gd,y.logTimeline=Zd,y.map=as,y.mapActions=zu,y.mapGetters=qu,y.mapState=xu,y.matchField=Df,y.max=Nf,y.maxLength=Cf,y.mediaQuery=gd,y.min=Pf,y.minLength=Rf,y.mockRouter=ah,y.mockSignal=nh,y.morphElement=Tl,y.mount=Mr,y.navigate=rt,y.notifications=Kl,y.onScopeDispose=Dn,y.parallax=Rl,y.parallel=Jc,y.pattern=$f,y.persistedSignal=Rc,y.pipeline=el,y.prefersColorScheme=Jf,y.prefersContrast=Gf,y.prefersReducedMotion=le,y.readStoreSnapshot=rp,y.readonly=_,y.recordEvent=Qd,y.reduce=ds,y.registerBqLink=lu,y.registerDefaultComponents=wl,y.registerPlugin=Pu,y.releaseFocus=od,y.renderComponent=rh,y.renderToResponse=Rm,y.renderToStream=km,y.renderToStreamSuspense=Gm,y.renderToString=yt,y.renderToStringAsync=Yr,y.required=Tf,y.resetPlugins=Ud,y.resolve=bu,y.resolveSSRRoute=pi,y.resumeState=sp,y.rovingTabIndex=Xf,y.runRouteLoaders=vi,y.runTask=Xn,y.safeHtml=vl,y.sanitize=ie,y.sanitizeHtml=ie,y.scrollAnimate=$l,y.sequence=Dl,y.serializeStoreSnapshot=ep,y.serializeStoreState=vt,y.setReducedMotion=Sl,y.signal=L,y.skipLink=rd,y.some=ls,y.sortable=yd,y.spring=Ll,y.springPresets=Pl,y.stagger=Nl,y.storage=tu,y.stripTags=Gi,y.timeline=_l,y.toValue=Ic,y.trackSignal=Wd,y.transition=xl,y.trapFocus=sd,y.trusted=Bi,y.typewriter=ql,y.untrack=Ee,y.untrackSignal=Fd,y.url=Lf,y.use=Dd,y.useAnnouncer=Jl,y.useAsyncData=xn,y.useBattery=Ad,y.useComputed=al,y.useCookie=Vl,y.useDeviceMotion=Cd,y.useDeviceOrientation=$d,y.useEffect=cl,y.useEventSource=qc,y.useFetch=re,y.useFormField=Ef,y.useGeolocation=kd,y.useInfiniteFetch=Tc,y.useIntersectionObserver=Pd,y.useMutationObserver=Id,y.useNetworkStatus=Sd,y.usePaginatedFetch=kc,y.usePolling=Cc,y.useResizeObserver=Nd,y.useResource=$c,y.useResourceList=Pc,y.useRoute=Ru,y.useSignal=il,y.useSubmit=Oc,y.useViewport=wd,y.useWebSocket=Qn,y.useWebSocketChannel=xc,y.utils=_a,y.verifyHydration=Im,y.waitFor=lh,y.watch=gr,y.watchDebounce=Mc,y.watchStore=Bu,y.watchThrottle=Dc,y})({});
276
280
 
277
281
  //# sourceMappingURL=full.iife.js.map