@bquery/bquery 1.1.2 → 1.2.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.
package/dist/full.umd.js CHANGED
@@ -1,2 +1,7 @@
1
- (function(a,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(a=typeof globalThis<"u"?globalThis:a||self,S(a.bQuery={}))})(this,function(a){"use strict";const S="bquery-sanitizer";let E=null;const W=()=>typeof window.trustedTypes<"u",q=()=>{if(E)return E;const r=window;if(!r.trustedTypes)return null;try{return E=r.trustedTypes.createPolicy(S,{createHTML:e=>N(e)}),E}catch{return console.warn(`bQuery: Could not create Trusted Types policy "${S}"`),null}},Q=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"]),_=new Set(["script","iframe","frame","frameset","object","embed","applet","link","meta","style","base","template","slot","math","svg","foreignobject","noscript"]),J=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"]),G=new Set(["alt","class","dir","height","hidden","href","id","lang","loading","name","rel","role","src","srcset","style","tabindex","target","title","type","width","aria-*"]),K=["on","formaction","xlink:","xmlns:"],x=["javascript:","data:","vbscript:","file:"],V=(r,e,t)=>{const s=r.toLowerCase();for(const n of K)if(s.startsWith(n))return!1;return t&&s.startsWith("data-")||s.startsWith("aria-")?!0:e.has(s)},Z=r=>{const e=r.toLowerCase().trim();return!J.has(e)},X=r=>r.replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),Y=r=>{const e=X(r);for(const t of x)if(e.startsWith(t))return!1;return!0},ee=r=>{try{const e=r.trim();if(e.startsWith("//"))return!0;const t=e.toLowerCase();return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!t.startsWith("http://")&&!t.startsWith("https://")?!0:!t.startsWith("http://")&&!t.startsWith("https://")?!1:typeof window>"u"||!window.location?!0:new URL(e,window.location.href).origin!==window.location.origin}catch{return!0}},N=(r,e={})=>{const{allowTags:t=[],allowAttributes:s=[],allowDataAttributes:n=!0,stripAllTags:i=!1}=e,o=new Set([...Q,...t.map(u=>u.toLowerCase())].filter(u=>!_.has(u))),c=new Set([...G,...s.map(u=>u.toLowerCase())]),l=document.createElement("template");if(l.innerHTML=r,i)return l.content.textContent??"";const h=document.createTreeWalker(l.content,NodeFilter.SHOW_ELEMENT),f=[];for(;h.nextNode();){const u=h.currentNode,b=u.tagName.toLowerCase();if(_.has(b)){f.push(u);continue}if(!o.has(b)){f.push(u);continue}const y=[];for(const m of Array.from(u.attributes)){const p=m.name.toLowerCase();if(!V(p,c,n)){y.push(m.name);continue}if((p==="id"||p==="name")&&!Z(m.value)){y.push(m.name);continue}(p==="href"||p==="src"||p==="srcset")&&!Y(m.value)&&y.push(m.name)}for(const m of y)u.removeAttribute(m);if(b==="a"){const m=u.getAttribute("href"),M=u.getAttribute("target")?.toLowerCase()==="_blank",j=m&&ee(m);if(M||j){const I=u.getAttribute("rel"),D=new Set(I?I.split(/\s+/).filter(Boolean):[]);D.add("noopener"),D.add("noreferrer"),u.setAttribute("rel",Array.from(D).join(" "))}}}for(const u of f)u.remove();return l.innerHTML},w=(r,e={})=>N(r,e),te=r=>{const e=q();return e?e.createHTML(r):w(r)},re=r=>{const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return r.replace(/[&<>"'`]/g,t=>e[t])},se=r=>N(r,{stripAllTags:!0}),ne=(r=16)=>{const e=new Uint8Array(r);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ie=r=>{const e=document.querySelector('meta[http-equiv="Content-Security-Policy"]');return e?(e.getAttribute("content")??"").includes(r):!1},oe=r=>Array.isArray(r)?r:[r],d=(r,e)=>{for(const t of r)e(t)};class g{constructor(e){this.element=e,this.delegatedHandlers=new Map}get raw(){return this.element}get node(){return this.element}addClass(...e){return this.element.classList.add(...e),this}removeClass(...e){return this.element.classList.remove(...e),this}toggleClass(e,t){return this.element.classList.toggle(e,t),this}attr(e,t){return t===void 0?this.element.getAttribute(e)??"":(this.element.setAttribute(e,t),this)}prop(e,t){return t===void 0?this.element[e]:(this.element[e]=t,this)}data(e,t){const s=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t===void 0?this.element.getAttribute(`data-${s}`)??"":(this.element.setAttribute(`data-${s}`,t),this)}text(e){return e===void 0?this.element.textContent??"":(this.element.textContent=e,this)}html(e){return this.element.innerHTML=w(e),this}htmlUnsafe(e){return this.element.innerHTML=e,this}css(e,t){if(typeof e=="string")return t!==void 0&&this.element.style.setProperty(e,t),this;for(const[s,n]of Object.entries(e))this.element.style.setProperty(s,n);return this}append(e){return this.insertContent(e,"beforeend"),this}prepend(e){return this.insertContent(e,"afterbegin"),this}before(e){return this.insertContent(e,"beforebegin"),this}after(e){return this.insertContent(e,"afterend"),this}wrap(e){const t=typeof e=="string"?document.createElement(e):e;return this.element.parentNode?.insertBefore(t,this.element),t.appendChild(this.element),this}unwrap(){const e=this.element.parentElement;return e&&e.parentNode&&(e.parentNode.insertBefore(this.element,e),e.remove()),this}replaceWith(e){let t;if(typeof e=="string"){const s=document.createElement("template");s.innerHTML=w(e),t=s.content.firstElementChild??document.createElement("div")}else t=e;return this.element.replaceWith(t),new g(t)}scrollTo(e={behavior:"smooth"}){return this.element.scrollIntoView(e),this}remove(){return this.element.remove(),this}empty(){return this.element.innerHTML="",this}clone(e=!0){return new g(this.element.cloneNode(e))}find(e){return Array.from(this.element.querySelectorAll(e))}findOne(e){return this.element.querySelector(e)}closest(e){return this.element.closest(e)}parent(){return this.element.parentElement}children(){return Array.from(this.element.children)}siblings(){const e=this.element.parentElement;return e?Array.from(e.children).filter(t=>t!==this.element):[]}next(){return this.element.nextElementSibling}prev(){return this.element.previousElementSibling}on(e,t){return this.element.addEventListener(e,t),this}once(e,t){return this.element.addEventListener(e,t,{once:!0}),this}off(e,t){return this.element.removeEventListener(e,t),this}trigger(e,t){return this.element.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0})),this}delegate(e,t,s){const n=`${e}:${t}`,i=o=>{const c=o.target.closest(t);c&&this.element.contains(c)&&s(o,c)};return this.delegatedHandlers.has(n)||this.delegatedHandlers.set(n,new Map),this.delegatedHandlers.get(n).set(s,i),this.element.addEventListener(e,i),this}undelegate(e,t,s){const n=`${e}:${t}`,i=this.delegatedHandlers.get(n);if(i){const o=i.get(s);o&&(this.element.removeEventListener(e,o),i.delete(s),i.size===0&&this.delegatedHandlers.delete(n))}return this}matches(e){return this.element.matches(e)}hasClass(e){return this.element.classList.contains(e)}show(e=""){return this.element.removeAttribute("hidden"),this.element.style.display=e,this}hide(){return this.element.style.display="none",this}toggle(e){const t=this.element.style.display==="none";return e??t?this.show():this.hide()}focus(){return this.element.focus(),this}blur(){return this.element.blur(),this}val(e){const t=this.element;return e===void 0?t.value??"":(t.value=e,this)}serialize(){const e=this.element;if(e.tagName.toLowerCase()!=="form")return{};const t={},s=new FormData(e);for(const[n,i]of s.entries())if(typeof i=="string")if(n in t){const o=t[n];Array.isArray(o)?o.push(i):t[n]=[o,i]}else t[n]=i;return t}serializeString(){const e=this.element;if(e.tagName.toLowerCase()!=="form")return"";const t=new FormData(e),s=new URLSearchParams;for(const[n,i]of t.entries())typeof i=="string"&&s.append(n,i);return s.toString()}rect(){return this.element.getBoundingClientRect()}offset(){const e=this.element;return{width:e.offsetWidth,height:e.offsetHeight,top:e.offsetTop,left:e.offsetLeft}}insertContent(e,t){if(typeof e=="string"){this.element.insertAdjacentHTML(t,w(e));return}const s=oe(e);d(s,n=>{this.element.insertAdjacentElement(t,n)})}}class v{constructor(e){this.elements=e,this.delegatedHandlers=new WeakMap}get length(){return this.elements.length}first(){return this.elements[0]}eq(e){const t=this.elements[e];return t?new g(t):void 0}firstEl(){return this.eq(0)}lastEl(){return this.eq(this.elements.length-1)}each(e){return this.elements.forEach((t,s)=>{e(new g(t),s)}),this}map(e){return this.elements.map(e)}filter(e){return new v(this.elements.filter(e))}reduce(e,t){return this.elements.reduce(e,t)}toArray(){return this.elements.map(e=>new g(e))}addClass(...e){return d(this.elements,t=>t.classList.add(...e)),this}removeClass(...e){return d(this.elements,t=>t.classList.remove(...e)),this}toggleClass(e,t){return d(this.elements,s=>s.classList.toggle(e,t)),this}attr(e,t){return t===void 0?this.first()?.getAttribute(e)??"":(d(this.elements,s=>s.setAttribute(e,t)),this)}removeAttr(e){return d(this.elements,t=>t.removeAttribute(e)),this}text(e){return e===void 0?this.first()?.textContent??"":(d(this.elements,t=>{t.textContent=e}),this)}html(e){if(e===void 0)return this.first()?.innerHTML??"";const t=w(e);return d(this.elements,s=>{s.innerHTML=t}),this}htmlUnsafe(e){return d(this.elements,t=>{t.innerHTML=e}),this}css(e,t){return typeof e=="string"?(t!==void 0&&d(this.elements,s=>{s.style.setProperty(e,t)}),this):(d(this.elements,s=>{for(const[n,i]of Object.entries(e))s.style.setProperty(n,i)}),this)}show(e=""){return d(this.elements,t=>{t.removeAttribute("hidden"),t.style.display=e}),this}hide(){return d(this.elements,e=>{e.style.display="none"}),this}on(e,t){return d(this.elements,s=>s.addEventListener(e,t)),this}once(e,t){return d(this.elements,s=>s.addEventListener(e,t,{once:!0})),this}off(e,t){return d(this.elements,s=>s.removeEventListener(e,t)),this}trigger(e,t){return d(this.elements,s=>{s.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}))}),this}delegate(e,t,s){const n=`${e}:${t}`;return d(this.elements,i=>{const o=l=>{const h=l.target.closest(t);h&&i.contains(h)&&s(l,h)};this.delegatedHandlers.has(i)||this.delegatedHandlers.set(i,new Map);const c=this.delegatedHandlers.get(i);c.has(n)||c.set(n,new Map),c.get(n).set(s,o),i.addEventListener(e,o)}),this}undelegate(e,t,s){const n=`${e}:${t}`;return d(this.elements,i=>{const o=this.delegatedHandlers.get(i);if(!o)return;const c=o.get(n);if(!c)return;const l=c.get(s);l&&(i.removeEventListener(e,l),c.delete(s),c.size===0&&o.delete(n),o.size===0&&this.delegatedHandlers.delete(i))}),this}remove(){return d(this.elements,e=>e.remove()),this}empty(){return d(this.elements,e=>{e.innerHTML=""}),this}}const ae=r=>{if(typeof r!="string")return new g(r);const e=document.querySelector(r);if(!e)throw new Error(`bQuery: element not found for selector "${r}"`);return new g(e)},le=r=>Array.isArray(r)?new v(r):r instanceof NodeList?new v(Array.from(r)):new v(Array.from(document.querySelectorAll(r))),C={clone(r){return typeof structuredClone=="function"?structuredClone(r):JSON.parse(JSON.stringify(r))},merge(...r){const e={};for(const t of r)for(const[s,n]of Object.entries(t))C.isPrototypePollutionKey(s)||(C.isPlainObject(n)&&C.isPlainObject(e[s])?e[s]=C.merge(e[s],n):e[s]=n);return e},isPrototypePollutionKey(r){return r==="__proto__"||r==="constructor"||r==="prototype"},debounce(r,e){let t;return(...s)=>{t&&clearTimeout(t),t=setTimeout(()=>r(...s),e)}},throttle(r,e){let t=0;return(...s)=>{const n=Date.now();n-t>=e&&(t=n,r(...s))}},uid(r="bQuery"){return`${r}_${Math.random().toString(36).slice(2,9)}`},isElement(r){return r instanceof Element},isCollection(r){return!!(r&&typeof r=="object"&&"elements"in r)},isEmpty(r){return r==null?!0:typeof r=="string"?r.trim().length===0:Array.isArray(r)?r.length===0:typeof r=="object"?Object.keys(r).length===0:!1},isPlainObject(r){return Object.prototype.toString.call(r)==="[object Object]"},isFunction(r){return typeof r=="function"},isString(r){return typeof r=="string"},isNumber(r){return typeof r=="number"&&!Number.isNaN(r)},isBoolean(r){return typeof r=="boolean"},isArray(r){return Array.isArray(r)},parseJson(r,e){try{return JSON.parse(r)}catch{return e}},pick(r,e){const t={};for(const s of e)s in r&&(t[s]=r[s]);return t},omit(r,e){const t={...r};for(const s of e)delete t[s];return t},sleep(r){return new Promise(e=>setTimeout(e,r))},randomInt(r,e){return Math.floor(Math.random()*(e-r+1))+r},clamp(r,e,t){return Math.min(Math.max(r,e),t)},capitalize(r){return r&&r.charAt(0).toUpperCase()+r.slice(1)},toKebabCase(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()},toCamelCase(r){return r.replace(/[-_\s]+(.)?/g,(e,t)=>t?t.toUpperCase():"").replace(/^[A-Z]/,e=>e.toLowerCase())}},A=[];let L=0;const P=new Set;let T=!0;const F=(r,e)=>{A.push(r);try{return e()}finally{A.pop()}},B=r=>{if(L>0){P.add(r);return}r()},ce=()=>{for(const r of Array.from(P))P.delete(r),r()};class k{constructor(e){this._value=e,this.subscribers=new Set}get value(){if(T){const e=A[A.length-1];e&&this.subscribers.add(e)}return this._value}set value(e){if(!Object.is(this._value,e)){this._value=e;for(const t of this.subscribers)B(t)}}peek(){return this._value}update(e){this.value=e(this._value)}}class H{constructor(e){this.compute=e,this.dirty=!0,this.subscribers=new Set,this.markDirty=()=>{this.dirty=!0;for(const t of this.subscribers)B(t)}}get value(){const e=A[A.length-1];return e&&this.subscribers.add(e),this.dirty&&(this.dirty=!1,this.cachedValue=F(this.markDirty,this.compute)),this.cachedValue}}const U=r=>new k(r),ue=r=>new H(r),$=r=>{let e,t=!1;const s=()=>{t||(e&&e(),e=F(s,r))};return s(),()=>{t=!0,e&&e()}},he=r=>{L+=1;try{r()}finally{L-=1,L===0&&ce()}},de=(r,e)=>{let t=e;try{const n=localStorage.getItem(r);n!==null&&(t=JSON.parse(n))}catch{}const s=U(t);return $(()=>{try{localStorage.setItem(r,JSON.stringify(s.value))}catch{}}),s},me=r=>({get value(){return r.value},peek(){return r.peek()}}),fe=(r,e,t={})=>{let s,n=!0;return $(()=>{const i=r.value;if(n){n=!1,s=i,t.immediate&&e(i,void 0);return}e(i,s),s=i})},pe=r=>{const e=T;T=!1;try{return r()}finally{T=e}},ge=r=>r instanceof k,ye=r=>r instanceof H,be=(r,e)=>{const{type:t}=e;if(t===String)return r;if(t===Number){const s=Number(r);return Number.isNaN(s)?r:s}if(t===Boolean){const s=r.trim().toLowerCase();return s===""||s==="true"||s==="1"?!0:s==="false"||s==="0"?!1:!!r}if(t===Object||t===Array)try{return JSON.parse(r)}catch{return r}if(typeof t=="function"){const s=t,n=t;try{return s(r)}catch{return new n(r)}}return r},we=(r,...e)=>r.reduce((t,s,n)=>`${t}${s}${e[n]??""}`,""),Se=(r,...e)=>{const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},s=n=>String(n??"").replace(/[&<>"'`]/g,o=>t[o]);return r.reduce((n,i,o)=>`${n}${i}${s(e[o])}`,"")},ve=(r,e)=>{class t extends HTMLElement{constructor(){super(),this.state={...e.state??{}},this.props={},this.attachShadow({mode:"open"}),this.syncProps()}static get observedAttributes(){return Object.keys(e.props??{})}connectedCallback(){try{e.beforeMount?.call(this),e.connected?.call(this),this.render()}catch(n){this.handleError(n)}}disconnectedCallback(){try{e.disconnected?.call(this)}catch(n){this.handleError(n)}}attributeChangedCallback(){try{this.syncProps(),this.render(!0)}catch(n){this.handleError(n)}}handleError(n){e.onError?e.onError.call(this,n):console.error(`bQuery component error in <${r}>:`,n)}setState(n,i){this.state[n]=i,this.render(!0)}getState(n){return this.state[n]}syncProps(){const n=e.props??{};for(const[i,o]of Object.entries(n)){const c=this.getAttribute(i);let l;if(c==null){if(o.required&&o.default===void 0)throw new Error(`bQuery component: missing required prop "${i}"`);l=o.default??void 0}else l=be(c,o);if(o.validator&&l!==void 0&&!o.validator(l))throw new Error(`bQuery component: validation failed for prop "${i}" with value ${JSON.stringify(l)}`);this.props[i]=l}}render(n=!1){try{if(n&&e.beforeUpdate&&e.beforeUpdate.call(this,this.props)===!1)return;const i=(l,h)=>{this.dispatchEvent(new CustomEvent(l,{detail:h,bubbles:!0,composed:!0}))};if(!this.shadowRoot)return;const o=e.render({props:this.props,state:this.state,emit:i}),c=e.styles?`<style>${e.styles}</style>`:"";this.shadowRoot.innerHTML=`${c}${o}`,n&&e.updated?.call(this)}catch(i){this.handleError(i)}}}customElements.get(r)||customElements.define(r,t)},Ae=async r=>{const e=typeof r=="function"?r:r.update,t=document;if(t.startViewTransition){await t.startViewTransition(()=>e()).finished;return}e()},O=r=>{const e=r.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}},R=(r,e,t={})=>{const{duration:s=300,easing:n="ease-out",onComplete:i}=t,o=O(r);if(o.width===0||o.height===0)return Promise.resolve();const c=e.left-o.left,l=e.top-o.top,h=e.width/o.width,f=e.height/o.height;if(c===0&&l===0&&h===1&&f===1)return Promise.resolve();const u=r;return u.style.transform=`translate(${c}px, ${l}px) scale(${h}, ${f})`,u.style.transformOrigin="top left",u.offsetHeight,new Promise(b=>{const y=u.animate([{transform:`translate(${c}px, ${l}px) scale(${h}, ${f})`},{transform:"translate(0, 0) scale(1, 1)"}],{duration:s,easing:n,fill:"forwards"});y.onfinish=()=>{u.style.transform="",u.style.transformOrigin="",i?.(),b()}})},Ce=async(r,e,t={})=>{const s=new Map;for(const i of r)s.set(i,O(i));e();const n=r.map(i=>{const o=s.get(i);return o?R(i,o,t):Promise.resolve()});await Promise.all(n)},Ee={stiffness:100,damping:10,mass:1,precision:.01},Le=(r,e={})=>{const{stiffness:t,damping:s,mass:n,precision:i}={...Ee,...e};let o=r,c=0,l=r,h=null,f=null;const u=new Set,b=()=>{for(const m of u)m(o)},y=()=>{const m=o-l,p=-t*m,M=-s*c,j=(p+M)/n;if(c+=j*(1/60),o+=c*(1/60),b(),Math.abs(c)<i&&Math.abs(m)<i){o=l,c=0,h=null,b(),f?.(),f=null;return}h=requestAnimationFrame(y)};return{to(m){return l=m,h!==null&&cancelAnimationFrame(h),new Promise(p=>{f=p,h=requestAnimationFrame(y)})},current(){return o},stop(){h!==null&&(cancelAnimationFrame(h),h=null),c=0,f?.(),f=null},onChange(m){return u.add(m),()=>u.delete(m)}}},Te={gentle:{stiffness:80,damping:15},snappy:{stiffness:200,damping:20},bouncy:{stiffness:300,damping:8},stiff:{stiffness:400,damping:30}};class Ne{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,s)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const i=n.result;i.objectStoreNames.contains(this.storeName)||i.createObjectStore(this.storeName)},n.onsuccess=()=>t(n.result),n.onerror=()=>s(n.error)}),this.dbPromise}async withStore(e,t){const s=await this.openDB();return new Promise((n,i)=>{const c=s.transaction(this.storeName,e).objectStore(this.storeName),l=t(c);l.onsuccess=()=>n(l.result),l.onerror=()=>i(l.error)})}async put(e,t){await this.withStore("readwrite",s=>s.put(t,e))}async get(e){return await this.withStore("readonly",s=>s.get(e))??null}async remove(e){await this.withStore("readwrite",t=>t.delete(e))}async keys(){return(await this.withStore("readonly",t=>t.getAllKeys())).map(t=>String(t))}}const Pe={async open(r){return new Ne(r)}};class ke{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(t=>t.url)}}const He={isSupported(){return"caches"in window},async open(r){if(!this.isSupported())throw new Error("bQuery: Cache Storage API not supported");const e=await caches.open(r);return new ke(e)},async delete(r){return this.isSupported()?caches.delete(r):!1},async keys(){return this.isSupported()?caches.keys():[]}},$e={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(r,e){return this.isSupported()?Notification.permission!=="granted"?(console.warn("bQuery: Notification permission not granted"),null):new Notification(r,e):(console.warn("bQuery: Notifications not supported in this browser"),null)}};class z{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 s=typeof t=="string"?t:JSON.stringify(t);this.storage.setItem(e,s)}async remove(e){this.storage.removeItem(e)}async clear(){this.storage.clear()}async keys(){return Object.keys(this.storage)}}class Oe extends z{constructor(){super(localStorage)}}class Me extends z{constructor(){super(sessionStorage)}}class je{constructor(e){this.options=e,this.dbPromise=null}openDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((e,t)=>{const s=indexedDB.open(this.options.name,this.options.version??1);s.onupgradeneeded=()=>{const n=s.result;n.objectStoreNames.contains(this.options.store)||n.createObjectStore(this.options.store)},s.onsuccess=()=>e(s.result),s.onerror=()=>t(s.error)}),this.dbPromise)}async withStore(e,t){const s=await this.openDB();return new Promise((n,i)=>{const c=s.transaction(this.options.store,e).objectStore(this.options.store),l=t(c);l.onsuccess=()=>n(l.result),l.onerror=()=>i(l.error)})}async get(e){return await this.withStore("readonly",s=>s.get(e))??null}async set(e,t){await this.withStore("readwrite",s=>s.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",t=>t.getAllKeys())).map(t=>String(t))}}const De={local(){return new Oe},session(){return new Me},indexedDB(r){return new je(r)}};a.$=ae,a.$$=le,a.BQueryCollection=v,a.BQueryElement=g,a.Computed=H,a.Signal=k,a.batch=he,a.buckets=Pe,a.cache=He,a.capturePosition=O,a.component=ve,a.computed=ue,a.createTrustedHtml=te,a.effect=$,a.escapeHtml=re,a.flip=R,a.flipList=Ce,a.generateNonce=ne,a.getTrustedTypesPolicy=q,a.hasCSPDirective=ie,a.html=we,a.isComputed=ye,a.isSignal=ge,a.isTrustedTypesSupported=W,a.notifications=$e,a.persistedSignal=de,a.readonly=me,a.safeHtml=Se,a.sanitize=w,a.sanitizeHtml=w,a.signal=U,a.spring=Le,a.springPresets=Te,a.storage=De,a.stripTags=se,a.transition=Ae,a.untrack=pe,a.utils=C,a.watch=fe,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
1
+ (function(h,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(h=typeof globalThis<"u"?globalThis:h||self,q(h.bQuery={}))})(this,function(h){"use strict";const q="bquery-sanitizer";let Q=null;const ke=()=>typeof window.trustedTypes<"u",ue=()=>{if(Q)return Q;const t=window;if(!t.trustedTypes)return null;try{return Q=t.trustedTypes.createPolicy(q,{createHTML:e=>x(e)}),Q}catch{return console.warn(`bQuery: Could not create Trusted Types policy "${q}"`),null}},Ce=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"]),he=new Set(["script","iframe","frame","frameset","object","embed","applet","link","meta","style","base","template","slot","math","svg","foreignobject","noscript"]),Le=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"]),$e=new Set(["alt","class","dir","height","hidden","href","id","lang","loading","name","rel","role","src","srcset","style","tabindex","target","title","type","width","aria-*"]),Oe=["on","formaction","xlink:","xmlns:"],Pe=["javascript:","data:","vbscript:","file:"],Te=(t,e,r)=>{const s=t.toLowerCase();for(const n of Oe)if(s.startsWith(n))return!1;return r&&s.startsWith("data-")||s.startsWith("aria-")?!0:e.has(s)},_e=t=>{const e=t.toLowerCase().trim();return!Le.has(e)},Ne=t=>t.replace(/[\u0000-\u001F\u007F]+/g,"").replace(/[\u200B-\u200D\uFEFF\u2028\u2029]+/g,"").replace(/\\u[\da-fA-F]{4}/g,"").replace(/\s+/g,"").toLowerCase(),Re=t=>{const e=Ne(t);for(const r of Pe)if(e.startsWith(r))return!1;return!0},je=t=>{try{const e=t.trim();if(e.startsWith("//"))return!0;const r=e.toLowerCase();return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!r.startsWith("http://")&&!r.startsWith("https://")?!0:!r.startsWith("http://")&&!r.startsWith("https://")?!1:typeof window>"u"||!window.location?!0:new URL(e,window.location.href).origin!==window.location.origin}catch{return!0}},x=(t,e={})=>{const{allowTags:r=[],allowAttributes:s=[],allowDataAttributes:n=!0,stripAllTags:i=!1}=e,o=new Set([...Ce,...r.map(m=>m.toLowerCase())].filter(m=>!he.has(m))),c=new Set([...$e,...s.map(m=>m.toLowerCase())]),a=document.createElement("template");if(a.innerHTML=t,i)return a.content.textContent??"";const f=document.createTreeWalker(a.content,NodeFilter.SHOW_ELEMENT),y=[];for(;f.nextNode();){const m=f.currentNode,u=m.tagName.toLowerCase();if(he.has(u)){y.push(m);continue}if(!o.has(u)){y.push(m);continue}const d=[];for(const l of Array.from(m.attributes)){const p=l.name.toLowerCase();if(!Te(p,c,n)){d.push(l.name);continue}if((p==="id"||p==="name")&&!_e(l.value)){d.push(l.name);continue}(p==="href"||p==="src"||p==="srcset")&&!Re(l.value)&&d.push(l.name)}for(const l of d)m.removeAttribute(l);if(u==="a"){const l=m.getAttribute("href"),b=m.getAttribute("target")?.toLowerCase()==="_blank",g=l&&je(l);if(b||g){const w=m.getAttribute("rel"),C=new Set(w?w.split(/\s+/).filter(Boolean):[]);C.add("noopener"),C.add("noreferrer"),m.setAttribute("rel",Array.from(C).join(" "))}}}for(const m of y)m.remove();return a.innerHTML},R=(t,e={})=>x(t,e),Me=t=>{const e=ue();return e?e.createHTML(t):R(t)},De=t=>{const e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"};return t.replace(/[&<>"'`]/g,r=>e[r])},He=t=>x(t,{stripAllTags:!0}),qe=(t=16)=>{const e=new Uint8Array(t);return crypto.getRandomValues(e),btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Be=t=>{const e=document.querySelector('meta[http-equiv="Content-Security-Policy"]');return e?(e.getAttribute("content")??"").includes(t):!1},Ie=t=>Array.isArray(t)?t:[t],v=(t,e)=>{for(const r of t)e(r)};class T{constructor(e){this.element=e,this.delegatedHandlers=new Map}get raw(){return this.element}get node(){return this.element}addClass(...e){return this.element.classList.add(...e),this}removeClass(...e){return this.element.classList.remove(...e),this}toggleClass(e,r){return this.element.classList.toggle(e,r),this}attr(e,r){return r===void 0?this.element.getAttribute(e)??"":(this.element.setAttribute(e,r),this)}prop(e,r){return r===void 0?this.element[e]:(this.element[e]=r,this)}data(e,r){const s=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return r===void 0?this.element.getAttribute(`data-${s}`)??"":(this.element.setAttribute(`data-${s}`,r),this)}text(e){return e===void 0?this.element.textContent??"":(this.element.textContent=e,this)}html(e){return this.element.innerHTML=R(e),this}htmlUnsafe(e){return this.element.innerHTML=e,this}css(e,r){if(typeof e=="string")return r!==void 0&&this.element.style.setProperty(e,r),this;for(const[s,n]of Object.entries(e))this.element.style.setProperty(s,n);return this}append(e){return this.insertContent(e,"beforeend"),this}prepend(e){return this.insertContent(e,"afterbegin"),this}before(e){return this.insertContent(e,"beforebegin"),this}after(e){return this.insertContent(e,"afterend"),this}wrap(e){const r=typeof e=="string"?document.createElement(e):e;return this.element.parentNode?.insertBefore(r,this.element),r.appendChild(this.element),this}unwrap(){const e=this.element.parentElement;return e&&e.parentNode&&(e.parentNode.insertBefore(this.element,e),e.remove()),this}replaceWith(e){let r;if(typeof e=="string"){const s=document.createElement("template");s.innerHTML=R(e),r=s.content.firstElementChild??document.createElement("div")}else r=e;return this.element.replaceWith(r),new T(r)}scrollTo(e={behavior:"smooth"}){return this.element.scrollIntoView(e),this}remove(){return this.element.remove(),this}empty(){return this.element.innerHTML="",this}clone(e=!0){return new T(this.element.cloneNode(e))}find(e){return Array.from(this.element.querySelectorAll(e))}findOne(e){return this.element.querySelector(e)}closest(e){return this.element.closest(e)}parent(){return this.element.parentElement}children(){return Array.from(this.element.children)}siblings(){const e=this.element.parentElement;return e?Array.from(e.children).filter(r=>r!==this.element):[]}next(){return this.element.nextElementSibling}prev(){return this.element.previousElementSibling}on(e,r){return this.element.addEventListener(e,r),this}once(e,r){return this.element.addEventListener(e,r,{once:!0}),this}off(e,r){return this.element.removeEventListener(e,r),this}trigger(e,r){return this.element.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0})),this}delegate(e,r,s){const n=`${e}:${r}`,i=o=>{const c=o.target.closest(r);c&&this.element.contains(c)&&s(o,c)};return this.delegatedHandlers.has(n)||this.delegatedHandlers.set(n,new Map),this.delegatedHandlers.get(n).set(s,i),this.element.addEventListener(e,i),this}undelegate(e,r,s){const n=`${e}:${r}`,i=this.delegatedHandlers.get(n);if(i){const o=i.get(s);o&&(this.element.removeEventListener(e,o),i.delete(s),i.size===0&&this.delegatedHandlers.delete(n))}return this}matches(e){return this.element.matches(e)}hasClass(e){return this.element.classList.contains(e)}show(e=""){return this.element.removeAttribute("hidden"),this.element.style.display=e,this}hide(){return this.element.style.display="none",this}toggle(e){const r=this.element.style.display==="none";return e??r?this.show():this.hide()}focus(){return this.element.focus(),this}blur(){return this.element.blur(),this}val(e){const r=this.element;return e===void 0?r.value??"":(r.value=e,this)}serialize(){const e=this.element;if(e.tagName.toLowerCase()!=="form")return{};const r={},s=new FormData(e);for(const[n,i]of s.entries())if(typeof i=="string")if(n in r){const o=r[n];Array.isArray(o)?o.push(i):r[n]=[o,i]}else r[n]=i;return r}serializeString(){const e=this.element;if(e.tagName.toLowerCase()!=="form")return"";const r=new FormData(e),s=new URLSearchParams;for(const[n,i]of r.entries())typeof i=="string"&&s.append(n,i);return s.toString()}rect(){return this.element.getBoundingClientRect()}offset(){const e=this.element;return{width:e.offsetWidth,height:e.offsetHeight,top:e.offsetTop,left:e.offsetLeft}}insertContent(e,r){if(typeof e=="string"){this.element.insertAdjacentHTML(r,R(e));return}const s=Ie(e);v(s,n=>{this.element.insertAdjacentElement(r,n)})}}class B{constructor(e){this.elements=e,this.delegatedHandlers=new WeakMap}get length(){return this.elements.length}first(){return this.elements[0]}eq(e){const r=this.elements[e];return r?new T(r):void 0}firstEl(){return this.eq(0)}lastEl(){return this.eq(this.elements.length-1)}each(e){return this.elements.forEach((r,s)=>{e(new T(r),s)}),this}map(e){return this.elements.map(e)}filter(e){return new B(this.elements.filter(e))}reduce(e,r){return this.elements.reduce(e,r)}toArray(){return this.elements.map(e=>new T(e))}addClass(...e){return v(this.elements,r=>r.classList.add(...e)),this}removeClass(...e){return v(this.elements,r=>r.classList.remove(...e)),this}toggleClass(e,r){return v(this.elements,s=>s.classList.toggle(e,r)),this}attr(e,r){return r===void 0?this.first()?.getAttribute(e)??"":(v(this.elements,s=>s.setAttribute(e,r)),this)}removeAttr(e){return v(this.elements,r=>r.removeAttribute(e)),this}text(e){return e===void 0?this.first()?.textContent??"":(v(this.elements,r=>{r.textContent=e}),this)}html(e){if(e===void 0)return this.first()?.innerHTML??"";const r=R(e);return v(this.elements,s=>{s.innerHTML=r}),this}htmlUnsafe(e){return v(this.elements,r=>{r.innerHTML=e}),this}css(e,r){return typeof e=="string"?(r!==void 0&&v(this.elements,s=>{s.style.setProperty(e,r)}),this):(v(this.elements,s=>{for(const[n,i]of Object.entries(e))s.style.setProperty(n,i)}),this)}show(e=""){return v(this.elements,r=>{r.removeAttribute("hidden"),r.style.display=e}),this}hide(){return v(this.elements,e=>{e.style.display="none"}),this}on(e,r){return v(this.elements,s=>s.addEventListener(e,r)),this}once(e,r){return v(this.elements,s=>s.addEventListener(e,r,{once:!0})),this}off(e,r){return v(this.elements,s=>s.removeEventListener(e,r)),this}trigger(e,r){return v(this.elements,s=>{s.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,cancelable:!0}))}),this}delegate(e,r,s){const n=`${e}:${r}`;return v(this.elements,i=>{const o=a=>{const f=a.target.closest(r);f&&i.contains(f)&&s(a,f)};this.delegatedHandlers.has(i)||this.delegatedHandlers.set(i,new Map);const c=this.delegatedHandlers.get(i);c.has(n)||c.set(n,new Map),c.get(n).set(s,o),i.addEventListener(e,o)}),this}undelegate(e,r,s){const n=`${e}:${r}`;return v(this.elements,i=>{const o=this.delegatedHandlers.get(i);if(!o)return;const c=o.get(n);if(!c)return;const a=c.get(s);a&&(i.removeEventListener(e,a),c.delete(s),c.size===0&&o.delete(n),o.size===0&&this.delegatedHandlers.delete(i))}),this}remove(){return v(this.elements,e=>e.remove()),this}empty(){return v(this.elements,e=>{e.innerHTML=""}),this}}const Fe=t=>{if(typeof t!="string")return new T(t);const e=document.querySelector(t);if(!e)throw new Error(`bQuery: element not found for selector "${t}"`);return new T(e)},Ue=t=>Array.isArray(t)?new B(t):t instanceof NodeList?new B(Array.from(t)):new B(Array.from(document.querySelectorAll(t))),U={clone(t){return typeof structuredClone=="function"?structuredClone(t):JSON.parse(JSON.stringify(t))},merge(...t){const e={};for(const r of t)for(const[s,n]of Object.entries(r))U.isPrototypePollutionKey(s)||(U.isPlainObject(n)&&U.isPlainObject(e[s])?e[s]=U.merge(e[s],n):e[s]=n);return e},isPrototypePollutionKey(t){return t==="__proto__"||t==="constructor"||t==="prototype"},debounce(t,e){let r;return(...s)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...s),e)}},throttle(t,e){let r=0;return(...s)=>{const n=Date.now();n-r>=e&&(r=n,t(...s))}},uid(t="bQuery"){return`${t}_${Math.random().toString(36).slice(2,9)}`},isElement(t){return t instanceof Element},isCollection(t){return!!(t&&typeof t=="object"&&"elements"in t)},isEmpty(t){return t==null?!0:typeof t=="string"?t.trim().length===0:Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1},isPlainObject(t){return Object.prototype.toString.call(t)==="[object Object]"},isFunction(t){return typeof t=="function"},isString(t){return typeof t=="string"},isNumber(t){return typeof t=="number"&&!Number.isNaN(t)},isBoolean(t){return typeof t=="boolean"},isArray(t){return Array.isArray(t)},parseJson(t,e){try{return JSON.parse(t)}catch{return e}},pick(t,e){const r={};for(const s of e)s in t&&(r[s]=t[s]);return r},omit(t,e){const r={...t};for(const s of e)delete r[s];return r},sleep(t){return new Promise(e=>setTimeout(e,t))},randomInt(t,e){return Math.floor(Math.random()*(e-t+1))+t},clamp(t,e,r){return Math.min(Math.max(t,e),r)},capitalize(t){return t&&t.charAt(0).toUpperCase()+t.slice(1)},toKebabCase(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()},toCamelCase(t){return t.replace(/[-_\s]+(.)?/g,(e,r)=>r?r.toUpperCase():"").replace(/^[A-Z]/,e=>e.toLowerCase())}},I=[];let W=0;const ee=new Set;let z=!0;const te=(t,e)=>{I.push(t);try{return e()}finally{I.pop()}},fe=t=>{if(W>0){ee.add(t);return}t()},Qe=()=>{for(const t of Array.from(ee))ee.delete(t),t()};class re{constructor(e){this._value=e,this.subscribers=new Set}get value(){if(z){const e=I[I.length-1];e&&this.subscribers.add(e)}return this._value}set value(e){if(!Object.is(this._value,e)){this._value=e;for(const r of this.subscribers)fe(r)}}peek(){return this._value}update(e){this.value=e(this._value)}}class ne{constructor(e){this.compute=e,this.dirty=!0,this.subscribers=new Set,this.markDirty=()=>{this.dirty=!0;for(const r of this.subscribers)fe(r)}}get value(){const e=I[I.length-1];return e&&this.subscribers.add(e),this.dirty&&(this.dirty=!1,this.cachedValue=te(this.markDirty,this.compute)),this.cachedValue}peek(){return this.dirty&&(this.dirty=!1,this.cachedValue=te(this.markDirty,this.compute)),this.cachedValue}}const V=t=>new re(t),K=t=>new ne(t),L=t=>{let e,r=!1;const s=()=>{r||(e&&e(),e=te(s,t))};return s(),()=>{r=!0,e&&e()}},J=t=>{W+=1;try{t()}finally{W-=1,W===0&&Qe()}},We=(t,e)=>{let r=e;try{const n=localStorage.getItem(t);n!==null&&(r=JSON.parse(n))}catch{}const s=V(r);return L(()=>{try{localStorage.setItem(t,JSON.stringify(s.value))}catch{}}),s},ze=t=>({get value(){return t.value},peek(){return t.peek()}}),Ve=(t,e,r={})=>{let s,n=!0;return L(()=>{const i=t.value;if(n){n=!1,s=i,r.immediate&&e(i,void 0);return}e(i,s),s=i})},Ke=t=>{const e=z;z=!1;try{return t()}finally{z=e}},Z=t=>t instanceof re,de=t=>t instanceof ne,Je=(t,e)=>{const{type:r}=e;if(r===String)return t;if(r===Number){const s=Number(t);return Number.isNaN(s)?t:s}if(r===Boolean){const s=t.trim().toLowerCase();return s===""||s==="true"||s==="1"?!0:s==="false"||s==="0"?!1:!!t}if(r===Object||r===Array)try{return JSON.parse(t)}catch{return t}if(typeof r=="function"){const s=r,n=r;try{return s(t)}catch{return new n(t)}}return t},Ze=(t,...e)=>t.reduce((r,s,n)=>`${r}${s}${e[n]??""}`,""),Ye=(t,...e)=>{const r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},s=n=>String(n??"").replace(/[&<>"'`]/g,o=>r[o]);return t.reduce((n,i,o)=>`${n}${i}${s(e[o])}`,"")},Ge=(t,e)=>{class r extends HTMLElement{constructor(){super(),this.state={...e.state??{}},this.props={},this.attachShadow({mode:"open"}),this.syncProps()}static get observedAttributes(){return Object.keys(e.props??{})}connectedCallback(){try{e.beforeMount?.call(this),e.connected?.call(this),this.render()}catch(n){this.handleError(n)}}disconnectedCallback(){try{e.disconnected?.call(this)}catch(n){this.handleError(n)}}attributeChangedCallback(){try{this.syncProps(),this.render(!0)}catch(n){this.handleError(n)}}handleError(n){e.onError?e.onError.call(this,n):console.error(`bQuery component error in <${t}>:`,n)}setState(n,i){this.state[n]=i,this.render(!0)}getState(n){return this.state[n]}syncProps(){const n=e.props??{};for(const[i,o]of Object.entries(n)){const c=this.getAttribute(i);let a;if(c==null){if(o.required&&o.default===void 0)throw new Error(`bQuery component: missing required prop "${i}"`);a=o.default??void 0}else a=Je(c,o);if(o.validator&&a!==void 0&&!o.validator(a))throw new Error(`bQuery component: validation failed for prop "${i}" with value ${JSON.stringify(a)}`);this.props[i]=a}}render(n=!1){try{if(n&&e.beforeUpdate&&e.beforeUpdate.call(this,this.props)===!1)return;const i=(a,f)=>{this.dispatchEvent(new CustomEvent(a,{detail:f,bubbles:!0,composed:!0}))};if(!this.shadowRoot)return;const o=e.render({props:this.props,state:this.state,emit:i}),c=e.styles?`<style>${e.styles}</style>`:"";this.shadowRoot.innerHTML=`${c}${o}`,n&&e.updated?.call(this)}catch(i){this.handleError(i)}}}customElements.get(t)||customElements.define(t,r)},Xe=async t=>{const e=typeof t=="function"?t:t.update,r=document;if(r.startViewTransition){await r.startViewTransition(()=>e()).finished;return}e()},se=t=>{const e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width,height:e.height}},me=(t,e,r={})=>{const{duration:s=300,easing:n="ease-out",onComplete:i}=r,o=se(t);if(o.width===0||o.height===0)return Promise.resolve();const c=e.left-o.left,a=e.top-o.top,f=e.width/o.width,y=e.height/o.height;if(c===0&&a===0&&f===1&&y===1)return Promise.resolve();const m=t;return m.style.transform=`translate(${c}px, ${a}px) scale(${f}, ${y})`,m.style.transformOrigin="top left",m.offsetHeight,new Promise(u=>{const d=m.animate([{transform:`translate(${c}px, ${a}px) scale(${f}, ${y})`},{transform:"translate(0, 0) scale(1, 1)"}],{duration:s,easing:n,fill:"forwards"});d.onfinish=()=>{m.style.transform="",m.style.transformOrigin="",i?.(),u()}})},xe=async(t,e,r={})=>{const s=new Map;for(const i of t)s.set(i,se(i));e();const n=t.map(i=>{const o=s.get(i);return o?me(i,o,r):Promise.resolve()});await Promise.all(n)},et={stiffness:100,damping:10,mass:1,precision:.01},tt=(t,e={})=>{const{stiffness:r,damping:s,mass:n,precision:i}={...et,...e};let o=t,c=0,a=t,f=null,y=null;const m=new Set,u=()=>{for(const l of m)l(o)},d=()=>{const l=o-a,p=-r*l,b=-s*c,g=(p+b)/n;if(c+=g*(1/60),o+=c*(1/60),u(),Math.abs(c)<i&&Math.abs(l)<i){o=a,c=0,f=null,u(),y?.(),y=null;return}f=requestAnimationFrame(d)};return{to(l){return a=l,f!==null&&cancelAnimationFrame(f),new Promise(p=>{y=p,f=requestAnimationFrame(d)})},current(){return o},stop(){f!==null&&(cancelAnimationFrame(f),f=null),c=0,y?.(),y=null},onChange(l){return m.add(l),()=>m.delete(l)}}},rt={gentle:{stiffness:80,damping:15},snappy:{stiffness:200,damping:20},bouncy:{stiffness:300,damping:8},stiff:{stiffness:400,damping:30}};class nt{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((r,s)=>{const n=indexedDB.open(e,1);n.onupgradeneeded=()=>{const i=n.result;i.objectStoreNames.contains(this.storeName)||i.createObjectStore(this.storeName)},n.onsuccess=()=>r(n.result),n.onerror=()=>s(n.error)}),this.dbPromise}async withStore(e,r){const s=await this.openDB();return new Promise((n,i)=>{const c=s.transaction(this.storeName,e).objectStore(this.storeName),a=r(c);a.onsuccess=()=>n(a.result),a.onerror=()=>i(a.error)})}async put(e,r){await this.withStore("readwrite",s=>s.put(r,e))}async get(e){return await this.withStore("readonly",s=>s.get(e))??null}async remove(e){await this.withStore("readwrite",r=>r.delete(e))}async keys(){return(await this.withStore("readonly",r=>r.getAllKeys())).map(r=>String(r))}}const st={async open(t){return new nt(t)}};class ot{constructor(e){this.cache=e}async add(e){await this.cache.add(e)}async addAll(e){await this.cache.addAll(e)}async put(e,r){await this.cache.put(e,r)}async match(e){return this.cache.match(e)}async remove(e){return this.cache.delete(e)}async keys(){return(await this.cache.keys()).map(r=>r.url)}}const it={isSupported(){return"caches"in window},async open(t){if(!this.isSupported())throw new Error("bQuery: Cache Storage API not supported");const e=await caches.open(t);return new ot(e)},async delete(t){return this.isSupported()?caches.delete(t):!1},async keys(){return this.isSupported()?caches.keys():[]}},at={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(t,e){return this.isSupported()?Notification.permission!=="granted"?(console.warn("bQuery: Notification permission not granted"),null):new Notification(t,e):(console.warn("bQuery: Notifications not supported in this browser"),null)}};class pe{constructor(e){this.storage=e}async get(e){const r=this.storage.getItem(e);if(r===null)return null;try{return JSON.parse(r)}catch{return r}}async set(e,r){const s=typeof r=="string"?r:JSON.stringify(r);this.storage.setItem(e,s)}async remove(e){this.storage.removeItem(e)}async clear(){this.storage.clear()}async keys(){return Object.keys(this.storage)}}class ct extends pe{constructor(){super(localStorage)}}class lt extends pe{constructor(){super(sessionStorage)}}class ut{constructor(e){this.options=e,this.dbPromise=null}openDB(){return this.dbPromise?this.dbPromise:(this.dbPromise=new Promise((e,r)=>{const s=indexedDB.open(this.options.name,this.options.version??1);s.onupgradeneeded=()=>{const n=s.result;n.objectStoreNames.contains(this.options.store)||n.createObjectStore(this.options.store)},s.onsuccess=()=>e(s.result),s.onerror=()=>r(s.error)}),this.dbPromise)}async withStore(e,r){const s=await this.openDB();return new Promise((n,i)=>{const c=s.transaction(this.options.store,e).objectStore(this.options.store),a=r(c);a.onsuccess=()=>n(a.result),a.onerror=()=>i(a.error)})}async get(e){return await this.withStore("readonly",s=>s.get(e))??null}async set(e,r){await this.withStore("readwrite",s=>s.put(r,e))}async remove(e){await this.withStore("readwrite",r=>r.delete(e))}async clear(){await this.withStore("readwrite",e=>e.clear())}async keys(){return(await this.withStore("readonly",r=>r.getAllKeys())).map(r=>String(r))}}const ht={local(){return new ct},session(){return new lt},indexedDB(t){return new ut(t)}};let $=null;const j=V({path:"",params:{},query:{},matched:null,hash:""}),ye=K(()=>j.value),ft=t=>{if(t==="*")return/^.*$/;const e="\0P\0",r="\0W\0",s=[];let n=t.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(o,c)=>(s.push(c),e));n=n.replace(/\*/g,r),n=n.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&");let i=0;return n=n.replace(/\u0000P\u0000/g,()=>`(?<${s[i++]}>[^/]+)`),n=n.replace(/\u0000W\u0000/g,".*"),new RegExp(`^${n}$`)},dt=t=>{const e=t.match(/:([a-zA-Z_][a-zA-Z0-9_]*)/g);return e?e.map(r=>r.slice(1)):[]},mt=(t,e)=>{for(const r of e){const s=ft(r.path),n=t.match(s);if(n){const i=dt(r.path),o={};return n.groups?Object.assign(o,n.groups):i.forEach((c,a)=>{o[c]=n[a+1]||""}),{matched:r,params:o}}}return null},pt=t=>{const e={};return new URLSearchParams(t).forEach((s,n)=>{const i=e[n];i===void 0?e[n]=s:Array.isArray(i)?i.push(s):e[n]=[i,s]}),e},Y=(t,e,r,s)=>{const n=mt(t,s);return{path:t,params:n?.params??{},query:pt(e),matched:n?.matched??null,hash:r.replace(/^#/,"")}},oe=async(t,e={})=>{if(!$)throw new Error("bQuery router: No router initialized. Call createRouter() first.");await $[e.replace?"replace":"push"](t)},yt=()=>{$?$.back():history.back()},gt=()=>{$?$.forward():history.forward()},wt=t=>{$&&$.destroy();const{routes:e,base:r="",hash:s=!1}=t,n=[],i=[],o=ge(e,r),c=()=>{if(s){const d=window.location.hash.slice(1)||"/",[l,p=""]=d.split("?"),[b,g=""]=p.split("#");return{pathname:l,search:b?`?${b}`:"",hash:g?`#${g}`:""}}let u=window.location.pathname;return r&&u.startsWith(r)&&(u=u.slice(r.length)||"/"),{pathname:u,search:window.location.search,hash:window.location.hash}},a=()=>{const{pathname:u,search:d,hash:l}=c(),p=Y(u,d,l,o);j.value=p},f=async(u,d)=>{const{pathname:l,search:p,hash:b}=c(),g=Y(l,p,b,o),w=new URL(u,window.location.origin),C=s?u:w.pathname,S=Y(C,w.search,w.hash,o);for(const _ of n)if(await _(S,g)===!1)return;const A=s?`#${u}`:`${r}${u}`;history[d]({},"",A),a();for(const _ of i)_(j.value,g)},y=async()=>{const{pathname:u,search:d,hash:l}=c(),p=j.value,b=Y(u,d,l,o);for(const g of n)if(await g(b,p)===!1){const C=s?`#${p.path}`:`${r}${p.path}`;history.pushState({},"",C);return}a();for(const g of i)g(j.value,p)};window.addEventListener("popstate",y),a();const m={push:u=>f(u,"pushState"),replace:u=>f(u,"replaceState"),back:()=>history.back(),forward:()=>history.forward(),go:u=>history.go(u),beforeEach:u=>(n.push(u),()=>{const d=n.indexOf(u);d>-1&&n.splice(d,1)}),afterEach:u=>(i.push(u),()=>{const d=i.indexOf(u);d>-1&&i.splice(d,1)}),currentRoute:ye,routes:o,destroy:()=>{window.removeEventListener("popstate",y),n.length=0,i.length=0,$=null}};return $=m,m},ge=(t,e="")=>{const r=[];for(const s of t){const n=s.path==="*"?"*":`${e}${s.path}`.replace(/\/+/g,"/");r.push({...s,path:n}),s.children&&r.push(...ge(s.children,n))}return r},bt=(t,e={})=>{if(!$)throw new Error("bQuery router: No router initialized.");const r=$.routes.find(n=>n.name===t);if(!r)throw new Error(`bQuery router: Route "${t}" not found.`);let s=r.path;for(const[n,i]of Object.entries(e))s=s.replace(`:${n}`,encodeURIComponent(i));return s},vt=(t,e=!1)=>{const r=j.value.path;return e?r===t:r.startsWith(t)},St=(t,e=!1)=>K(()=>{const r=j.value.path;return e?r===t:r.startsWith(t)}),At=(t,e={})=>r=>{r.preventDefault(),oe(t,e)},Et=(t=document.body)=>{const e=r=>{const n=r.target.closest("a");if(!n||n.target||n.hasAttribute("download")||n.origin!==window.location.origin)return;const i=n.pathname+n.search+n.hash;r.preventDefault(),oe(i)};return t.addEventListener("click",e),()=>t.removeEventListener("click",e)},F=new Map,we=t=>t!==null&&typeof t=="object"&&Object.getPrototypeOf(t)===Object.prototype,M=t=>{if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(M);if(t instanceof Date)return new Date(t.getTime());if(t instanceof Map)return new Map(Array.from(t.entries()).map(([r,s])=>[r,M(s)]));if(t instanceof Set)return new Set(Array.from(t).map(M));const e={};for(const r of Object.keys(t))e[r]=M(t[r]);return e},ie=(t,e)=>{if(t===e)return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object")return!1;if(Array.isArray(t)&&Array.isArray(e))return t.length!==e.length?!1:t.every((n,i)=>ie(n,e[i]));if(Array.isArray(t)!==Array.isArray(e))return!1;const r=Object.keys(t),s=Object.keys(e);return r.length!==s.length?!1:r.every(n=>ie(t[n],e[n]))},kt=(t,e,r)=>{const s=[];for(const n of Object.keys(e)){const i=t[n],o=e[n];r.get(n)===o&&we(i)&&we(o)&&!ie(i,o)&&s.push(n)}return s},ae=(()=>{try{const t=globalThis.process;return typeof t<"u"&&t.env?.NODE_ENV!=="production"}catch{return!0}})(),be=[],ve=t=>{const{id:e,state:r,getters:s={},actions:n={}}=t;if(F.has(e))return console.warn(`bQuery store: Store "${e}" already exists. Returning existing instance.`),F.get(e);const i=r(),o=new Map;for(const d of Object.keys(i))o.set(d,V(i[d]));const c=[],a=()=>{const d=y();for(const l of c)l(d);typeof window<"u"&&window.__BQUERY_DEVTOOLS__?.onStateChange&&window.__BQUERY_DEVTOOLS__.onStateChange(e,d)},f=new Proxy({},{get:(d,l)=>{const p=l;if(o.has(p))return o.get(p).value},ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:(d,l)=>{if(o.has(l))return{enumerable:!0,configurable:!0}},has:(d,l)=>o.has(l)}),y=()=>({...f}),m=new Map,u={};for(const d of Object.keys(i))Object.defineProperty(u,d,{get:()=>o.get(d).value,set:l=>{o.get(d).value=l,a()},enumerable:!0,configurable:!1});for(const d of Object.keys(s)){const l=s[d],p=K(()=>{const b=f,g=new Proxy({},{get:(w,C)=>{const S=C;if(m.has(S))return m.get(S).value}});return l(b,g)});m.set(d,p),Object.defineProperty(u,d,{get:()=>p.value,enumerable:!0,configurable:!1})}for(const d of Object.keys(n)){const l=n[d];u[d]=function(...p){const b=new Proxy(u,{get:(g,w)=>typeof w=="string"&&o.has(w)?o.get(w).value:g[w],set:(g,w,C)=>typeof w=="string"&&o.has(w)?(o.get(w).value=C,a(),!0):!1});return l.apply(b,p)}}Object.defineProperties(u,{$id:{value:e,writable:!1,enumerable:!1},$reset:{value:()=>{const d=r();J(()=>{for(const[l,p]of o)p.value=d[l]}),a()},writable:!1,enumerable:!1},$subscribe:{value:d=>(c.push(d),()=>{const l=c.indexOf(d);l>-1&&c.splice(l,1)}),writable:!1,enumerable:!1},$patch:{value:d=>{J(()=>{if(typeof d=="function"){const l=ae?M(y()):null,p=ae?new Map(Array.from(o.entries()).map(([g,w])=>[g,w.value])):null,b=y();if(d(b),ae&&l&&p){const g=kt(l,b,p);g.length>0&&console.warn(`[bQuery store "${e}"] Nested mutation detected in $patch() for keys: ${g.map(String).join(", ")}.
2
+ Nested object mutations do not trigger reactive updates because the store uses shallow reactivity.
3
+ To fix this, either:
4
+ 1. Replace the entire object: state.user = { ...state.user, name: "New" }
5
+ 2. Use $patchDeep() for automatic deep cloning
6
+ See: https://bquery.dev/guide/store#deep-reactivity`)}for(const[g,w]of Object.entries(b))o.has(g)&&(o.get(g).value=w)}else for(const[l,p]of Object.entries(d))o.has(l)&&(o.get(l).value=p)}),a()},writable:!1,enumerable:!1},$patchDeep:{value:d=>{J(()=>{if(typeof d=="function"){const l=M(y());d(l);for(const[p,b]of Object.entries(l))o.has(p)&&(o.get(p).value=b)}else for(const[l,p]of Object.entries(d))o.has(l)&&(o.get(l).value=M(p))}),a()},writable:!1,enumerable:!1},$state:{get:()=>y(),enumerable:!1}}),F.set(e,u);for(const d of be){const l=d({store:u,options:t});l&&Object.assign(u,l)}return typeof window<"u"&&(window.__BQUERY_DEVTOOLS__||(window.__BQUERY_DEVTOOLS__={stores:new Map}),window.__BQUERY_DEVTOOLS__.stores.set(e,u),window.__BQUERY_DEVTOOLS__.onStoreCreated?.(e,u)),u},Ct=t=>F.get(t),Lt=()=>Array.from(F.keys()),$t=t=>{F.delete(t),typeof window<"u"&&window.__BQUERY_DEVTOOLS__&&window.__BQUERY_DEVTOOLS__.stores.delete(t)},Ot=t=>{be.push(t)},Pt=(t,e)=>{const r=e??`bquery-store-${t.id}`,s=t.state;t.state=()=>{const i=s();if(typeof window<"u")try{const o=localStorage.getItem(r);if(o)return{...i,...JSON.parse(o)}}catch{}return i};const n=ve(t);return n.$subscribe(i=>{if(typeof window<"u")try{localStorage.setItem(r,JSON.stringify(i))}catch{}}),n},Tt=(t,e)=>{const r={};for(const s of e)Object.defineProperty(r,s,{get:()=>t[s],enumerable:!0});return r},_t=(t,e)=>{const r={};for(const s of e)r[s]=(...n)=>t[s](...n);return r},k=(t,e)=>{try{const r=Object.keys(e),s=r.map(i=>{const o=e[i];return Z(o)||de(o)?o.value:o});return new Function(...r,`return (${t})`)(...s)}catch(r){console.error(`bQuery view: Error evaluating "${t}"`,r);return}},ce=(t,e)=>{try{const r=Object.keys(e),s=r.map(i=>e[i]);return new Function(...r,`return (${t})`)(...s)}catch(r){console.error(`bQuery view: Error evaluating "${t}"`,r);return}},Se=t=>{const e={},r=t.trim().replace(/^\{|\}$/g,"").trim();if(!r)return e;const s=[];let n="",i=0,o=null;for(let c=0;c<r.length;c++){const a=r[c],f=c>0?r[c-1]:"";if((a==='"'||a==="'"||a==="`")&&f!=="\\"){o===null?o=a:o===a&&(o=null),n+=a;continue}if(o!==null){n+=a;continue}a==="("||a==="["||a==="{"?(i++,n+=a):a===")"||a==="]"||a==="}"?(i--,n+=a):a===","&&i===0?(s.push(n.trim()),n=""):n+=a}n.trim()&&s.push(n.trim());for(const c of s){let a=-1,f=0,y=null;for(let m=0;m<c.length;m++){const u=c[m],d=m>0?c[m-1]:"";if((u==='"'||u==="'"||u==="`")&&d!=="\\"){y===null?y=u:y===u&&(y=null);continue}if(y===null){if(u==="("||u==="["||u==="{")f++;else if(u===")"||u==="]"||u==="}")f--;else if(u===":"&&f===0){a=m;break}}}if(a>-1){const m=c.slice(0,a).trim().replace(/^['"]|['"]$/g,""),u=c.slice(a+1).trim();e[m]=u}}return e},Nt=(t,e,r,s)=>{const n=L(()=>{const i=k(e,r);t.textContent=String(i??"")});s.push(n)},Rt=t=>(e,r,s,n)=>{const i=L(()=>{const o=k(r,s),c=String(o??"");e.innerHTML=t?R(c):c});n.push(i)},jt=(t,e,r,s)=>{const n=t.parentNode,i=document.createComment(`bq-if: ${e}`);let o=!0;const c=L(()=>{const a=k(e,r);a&&!o?(n?.replaceChild(t,i),o=!0):!a&&o&&(n?.replaceChild(i,t),o=!1)});s.push(c)},Mt=(t,e,r,s)=>{const n=t,i=n.style.display,o=L(()=>{const c=k(e,r);n.style.display=c?i:"none"});s.push(o)},Dt=(t,e,r,s)=>{let n=new Set;const i=L(()=>{const o=new Set;if(e.startsWith("{")){const c=Se(e);for(const[a,f]of Object.entries(c)){const y=k(f,r);t.classList.toggle(a,!!y),o.add(a)}}else if(e.includes("[")){const c=k(e,r);if(Array.isArray(c))for(const a of c)a&&(t.classList.add(a),o.add(a))}else{const c=k(e,r);typeof c=="string"?c.split(/\s+/).forEach(a=>{a&&(t.classList.add(a),o.add(a))}):Array.isArray(c)&&c.forEach(a=>{a&&(t.classList.add(a),o.add(a))})}if(!e.startsWith("{"))for(const c of n)o.has(c)||t.classList.remove(c);n=o});s.push(i)},Ht=(t,e,r,s)=>{const n=t,i=L(()=>{if(e.startsWith("{")){const o=Se(e);for(const[c,a]of Object.entries(o)){const f=k(a,r),y=c.replace(/([A-Z])/g,"-$1").toLowerCase();n.style.setProperty(y,String(f??""))}}else{const o=k(e,r);if(o&&typeof o=="object")for(const[c,a]of Object.entries(o)){const f=c.replace(/([A-Z])/g,"-$1").toLowerCase();n.style.setProperty(f,String(a??""))}}});s.push(i)},qt=(t,e,r,s)=>{const n=t,i=ce(e,r);if(!Z(i)){console.warn(`bQuery view: bq-model requires a signal, got "${e}"`);return}const o=i,c=n.type==="checkbox",a=n.type==="radio",f=()=>{c?n.checked=!!o.value:a?n.checked=o.value===n.value:n.value=String(o.value??"")},y=L(()=>{f()});s.push(y);const m=n.tagName==="SELECT"?"change":"input",u=()=>{c?o.value=n.checked:a?n.checked&&(o.value=n.value):o.value=n.value};n.addEventListener(m,u),s.push(()=>n.removeEventListener(m,u))},Bt=t=>(e,r,s,n)=>{const i=L(()=>{const o=k(r,s);o==null||o===!1?e.removeAttribute(t):o===!0?e.setAttribute(t,""):e.setAttribute(t,String(o))});n.push(i)},It=t=>(e,r,s,n)=>{const i=o=>{const c={...s,$event:o,$el:e};if(/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(r.trim())){const f=ce(r,c);if(typeof f=="function"){f(o);return}}k(r,c)};e.addEventListener(t,i),n.push(()=>e.removeEventListener(t,i))},Ft=(t,e,r,s,n,i)=>{if(!r)return e;const o={...i,[s]:t};return n&&(o[n]=e),k(r,o)},Ut=(t,e)=>(r,s,n,i)=>{const o=r.parentNode;if(!o)return;const c=s.match(/^\(?(\w+)(?:\s*,\s*(\w+))?\)?\s+in\s+(\S.*)$/);if(!c){console.error(`bQuery view: Invalid bq-for expression "${s}"`);return}const[,a,f,y]=c,m=r.getAttribute(":key")||r.getAttribute(`${t}-key`),u=r.cloneNode(!0);u.removeAttribute(`${t}-for`),u.removeAttribute(":key"),u.removeAttribute(`${t}-key`);const d=document.createComment(`bq-for: ${s}`);o.replaceChild(d,r);let l=new Map,p=[];const b=(S,A,_)=>{const D=u.cloneNode(!0),H=[],N={...n,[a]:S};return f&&(N[f]=A),G(D,N,t,e,H),le(D,N,t,e,H),{key:_,element:D,cleanups:H,item:S,index:A}},g=S=>{for(const A of S.cleanups)A();S.element.remove()},w=(S,A)=>{S.index!==A&&f&&(S.index=A)},C=L(()=>{const S=k(y,n);if(!Array.isArray(S)){for(const E of l.values())g(E);l.clear(),p=[];return}const A=[],_=new Map;S.forEach((E,O)=>{const X=Ft(E,O,m,a,f,n);A.push(X),_.set(X,{item:E,index:O})});const D=[];for(const E of p)_.has(E)||D.push(E);for(const E of D){const O=l.get(E);O&&(g(O),l.delete(E))}const H=new Map;let N=d;for(let E=0;E<A.length;E++){const O=A[E],{item:X,index:Ee}=_.get(O);let P=l.get(O);P?(w(P,Ee),H.set(O,P),N.nextSibling!==P.element&&N.after(P.element),N=P.element):(P=b(X,Ee,O),H.set(O,P),N.after(P.element),N=P.element)}l=H,p=A});i.push(()=>{C();for(const S of l.values())for(const A of S.cleanups)A();l.clear()})},Qt=(t,e,r,s)=>{const n=ce(e,r);Z(n)?(n.value=t,s.push(()=>{n.value=null})):typeof r[e]=="object"&&r[e]!==null&&(r[e].value=t)},G=(t,e,r,s,n)=>{const i=Array.from(t.attributes);for(const o of i){const{name:c,value:a}=o;if(!c.startsWith(r))continue;const f=c.slice(r.length+1);if(f==="for"){Ut(r,s)(t,a,e,n);return}if(f==="text")Nt(t,a,e,n);else if(f==="html")Rt(s)(t,a,e,n);else if(f==="if")jt(t,a,e,n);else if(f==="show")Mt(t,a,e,n);else if(f==="class")Dt(t,a,e,n);else if(f==="style")Ht(t,a,e,n);else if(f==="model")qt(t,a,e,n);else if(f==="ref")Qt(t,a,e,n);else if(f.startsWith("bind:")){const y=f.slice(5);Bt(y)(t,a,e,n)}else if(f.startsWith("on:")){const y=f.slice(3);It(y)(t,a,e,n)}}},le=(t,e,r,s,n)=>{const i=Array.from(t.children);for(const o of i)o.hasAttribute(`${r}-for`)?G(o,e,r,s,n):(G(o,e,r,s,n),le(o,e,r,s,n))},Ae=(t,e,r={})=>{const{prefix:s="bq",sanitize:n=!0}=r,i=typeof t=="string"?document.querySelector(t):t;if(!i)throw new Error(`bQuery view: Element "${t}" not found.`);const o=[];return G(i,e,s,n,o),le(i,e,s,n,o),{el:i,context:e,update:c=>{Object.assign(e,c)},destroy:()=>{for(const c of o)c();o.length=0}}},Wt=(t,e={})=>r=>{const s=document.createElement("div");s.innerHTML=t.trim();const n=s.firstElementChild;if(!n)throw new Error("bQuery view: Template must contain a single root element.");return Ae(n,r,e)};h.$=Fe,h.$$=Ue,h.BQueryCollection=B,h.BQueryElement=T,h.Computed=ne,h.Signal=re,h.back=yt,h.batch=J,h.buckets=st,h.cache=it,h.capturePosition=se,h.component=Ge,h.computed=K,h.createPersistedStore=Pt,h.createRouter=wt,h.createStore=ve,h.createTemplate=Wt,h.createTrustedHtml=Me,h.currentRoute=ye,h.destroyStore=$t,h.effect=L,h.escapeHtml=De,h.flip=me,h.flipList=xe,h.forward=gt,h.generateNonce=qe,h.getStore=Ct,h.getTrustedTypesPolicy=ue,h.hasCSPDirective=Be,h.html=Ze,h.interceptLinks=Et,h.isActive=vt,h.isActiveSignal=St,h.isComputed=de,h.isSignal=Z,h.isTrustedTypesSupported=ke,h.link=At,h.listStores=Lt,h.mapActions=_t,h.mapState=Tt,h.mount=Ae,h.navigate=oe,h.notifications=at,h.persistedSignal=We,h.readonly=ze,h.registerPlugin=Ot,h.resolve=bt,h.safeHtml=Ye,h.sanitize=R,h.sanitizeHtml=R,h.signal=V,h.spring=tt,h.springPresets=rt,h.storage=ht,h.stripTags=He,h.transition=Xe,h.untrack=Ke,h.utils=U,h.watch=Ve,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
2
7
  //# sourceMappingURL=full.umd.js.map