@webqit/oohtml 4.4.0 → 4.5.1
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/bindings-api.js +1 -1
- package/dist/bindings-api.js.map +2 -2
- package/dist/context-api.js +1 -1
- package/dist/context-api.js.map +2 -2
- package/dist/data-binding.js +5 -5
- package/dist/data-binding.js.map +2 -2
- package/dist/html-imports.js +1 -1
- package/dist/html-imports.js.map +2 -2
- package/dist/main.js +15 -15
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +10 -10
- package/dist/main.lite.js.map +2 -2
- package/dist/namespaced-html.js +1 -1
- package/dist/namespaced-html.js.map +2 -2
- package/dist/scoped-css.js +1 -1
- package/dist/scoped-css.js.map +2 -2
- package/package.json +2 -2
- package/src/bindings-api/index.js +1 -1
- package/src/context-api/DOMContexts.js +1 -1
- package/src/data-binding/index.js +13 -13
- package/src/html-imports/HTMLImportsContext.js +1 -1
package/dist/namespaced-html.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var se=Object.defineProperty;var le=(n,t,r)=>t in n?se(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var ft=(n,t,r)=>(le(n,typeof t!="symbol"?t+"":t,r),r);function P(n){return!Array.isArray(n)&&typeof n=="object"&&n}function O(n){return Array.isArray(n)}function Q(n){return typeof n=="function"}function Z(n){return n===null||n===""}function V(n){return arguments.length&&(n===void 0||typeof n>"u")}function $(n){return Array.isArray(n)||typeof n=="object"&&n||Q(n)}function yt(n){return Z(n)||V(n)||n===!1||n===0||$(n)&&!Object.keys(n).length}function E(n){return Q(n)||n&&{}.toString.call(n)==="[object function]"}function K(n){return n instanceof Number||typeof n=="number"}function N(n){return K(n)||n!==!0&&n!==!1&&n!==null&&n!==""&&!isNaN(n*1)}function J(n){return n instanceof String||typeof n=="string"&&n!==null}function wt(n){return!J(n)&&!V(n.length)}function at(n,...t){return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n}function _t(e,t){t=t||Object.prototype,t=t&&!O(t)?[t]:t;for(var r=[],e=e;e&&(!t||t.indexOf(e)<0)&&e.name!=="default";)r.push(e),e=e?Object.getPrototypeOf(e):null;return r}function bt(n,t){var r=[];return _t(n,t).forEach(e=>{at(r,...Object.getOwnPropertyNames(e))}),r}function U(n,t,r=!1,e=!1,i=!1){var o=0,s=n.shift();if((N(s)||s===!0||s===!1)&&(o=s,s=n.shift()),!n.length)throw new Error("_merge() requires two or more array/objects.");return n.forEach((l,a)=>{!$(l)&&!E(l)||(r?bt(l):Object.keys(l)).forEach(u=>{if(!!t(u,s,l,a)){var f=s[u],d=l[u];if((O(f)&&O(d)||P(f)&&P(d))&&(o===!0||o>0))s[u]=O(f)&&O(d)?[]:{},U([N(o)?o-1:o,s[u],f,d],t,r,e,i);else if(O(s)&&O(l))e?s[u]=d:s.push(d);else try{i?Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(l,u)):s[u]=l[u]}catch{}}})}),s}function tt(...n){return U(n,(t,r,e)=>!0,!1,!1,!1)}function H(n,...t){if(!n||!["object","function"].includes(typeof n))throw new Error("Argument #1 must be of type object");let r=n[Symbol.for("wq")];if(r||(r=new ct,Object.defineProperty(n,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!t.length)return r;let e,i;for(;e=t.shift();)(i=r)&&!(r=r.get(e))&&(r=new ct,i.set(e,r));return r}var ct=class extends Map{};function D(n,t=!0){return O(n)?n:!t&&P(n)?[n]:n!==!1&&n!==0&&yt(n)?[]:wt(n)?Array.prototype.slice.call(n):P(n)?Object.values(n):[n]}function et(n,t,r={},e={}){t=D(t).slice();for(var i=n;!V(i)&&!Z(i)&&t.length;){var o=t.shift();if(!(r.get?r.get(i,o):$(i)?o in i:i[o])){e.exists=!1;return}i=r.get?r.get(i,o):i[o]}return e.exists=!0,i}function Ot(n,t,r,e={},i={}){let o=(f,d,c)=>i.set?i.set(f,d,c):(N(t[l])&&O(f)?f.push(c):f[d]=c,!0);t=D(t);for(var s=n,l=0;l<t.length;l++)if(l<t.length-1){if(!s||!$(s)&&!E(s))return!1;var a=et(s,t[l],i);if(!$(a)){if(i.buildTree===!1)return!1;a=E(i.buildTree)?i.buildTree(l):N(t[l+1])?[]:{};var u=o(s,t[l],a);if(!u)return!1}s=a}else return o(s,t[l],r)}var rt=class{constructor(t,r=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!r&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let r=await t();return this._synthesis--,r}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.readCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.writeCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,r,e){this.onread(()=>{let i=t(e),o=s=>{s!==void 0&&this.onwrite(()=>{let l=r(s,e),a=u=>{u!==void 0&&this.cycle(t,r,u)};l instanceof Promise?l.then(a):a(l)})};i instanceof Promise?i.then(o):o(i)})}};function Nt(n){return(n=n.trim())&&n.startsWith("(")&&n.endsWith(")")}function mt(n,t,r,e=!0){r=(Array.isArray(r)?r:[r]).map(s=>(s+"").replace("(",e?"(.//":"(./")).join("|");let i=[],o;try{let s=n.document.evaluate(r,t,null,n.XPathResult.ANY_TYPE);for(;o=s.iterateNext();)i.push(o)}catch{}return i}function Ht(n,t,r){r=(Array.isArray(r)?r:[r]).map(e=>(e+"").replace("(","(self::")).join("|");try{return n.document.evaluate(`${r}`,t,null,n.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function nt(n,t,r,e=!1,i=null){let o=i?.get(t)?.get(r);if(typeof o<"u")return o;let s=u=>(i?.has(t)||i?.set(t,new WeakMap),i?.get(t)?.set(r,u),u),l=t.getRootNode(),a=r.getRootNode();return l===a?s(t.contains(r)):e&&a instanceof n.ShadowRoot?s(nt(n,t,a.host,e,i)):s(!1)}function kt(n,t="|"){return[...n].reduce(([r,e,i,o],s)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(s)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(s)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(s)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(s)&&!i[0].endsWith("\\")&&(r=r===s?null:r||s),i[0]+=s,[r,e,i]),[null,0,[""]])[2].reverse()}var k=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Nt(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=kt(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var X=class{constructor(t,r,e){this.context=t,this.namespace=r,this.window=t.defaultView||t.ownerDocument?.defaultView||e,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(E(t[0])?t=[[],...t]:P(t[0])&&!(t[0]instanceof k)&&t.length===1?t=[[],void 0,t[0]]:P(t[1])&&t.length===2?t=[D(t[0],!1),void 0,t[1]]:t[0]=D(t[0],!1),t[0].filter(r=>typeof r!="string"&&!(r instanceof k)&&!(r instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(r=>r instanceof k?r:new k(r)),t}registry(...t){return H(this.window,"realdom",this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,r,e){let{window:i}=this,o=new Set,s=new WeakMap;for(let[l,a]of this.registry(t)){let u=[].concat(r).filter(d=>nt(i,l.context,d.target,l.params.subtree==="cross-roots",s));if(!u.length)continue;let f=[l,Array.isArray(r)?u:u[0]];a?o.add(f):e.call(i,...f)}for(let l of o)e.call(i,...l);o.clear()}disconnectables(t,...r){let e={disconnect(){r.forEach(i=>i&&E(i.disconnect)&&i.disconnect()||E(i)&&i()||P(i)&&(i.disconnected=!0))}};return t&&t.addEventListener("abort",()=>e.disconnect()),e}};var B=class extends X{type="attr";constructor(t,...r){super(t,"attr",...r)}get(t,r=void 0,e={}){let i=typeof t=="string"||t instanceof k;[t=[],r=void 0,e={}]=this.resolveArgs(arguments);let{context:o}=this,s=Wt(o,t);if(!r)return s;let l=e.lifecycleSignals&&this.createSignalGenerator();if(i)for(let a of s){let u=l?l.generate():{};r(a,u,o)}else{let a=l?.generate()||{};r(s,a,o)}if(e.live){l&&(e={...e,signalGenerator:l});let a=this.observe(i?t[0]:t,r,{newValue:!0,...e});return this.disconnectables(e.signal,a)}}observe(t,r,e={}){let i=typeof t=="string"||t instanceof k;if([t=[],r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(i?t[0]:t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:o,window:s,webqit:l}=this;e.eventDetails&&!l.realdom.attrInterceptionHooks?.intercepting&&Ut.call(s,"intercept",()=>{});let a=new s.MutationObserver(c=>{c=Ft(c).map(y=>Vt.call(s,y)),Rt.call(s,d,c,o)}),u={attributes:!0,attributeOldValue:e.oldValue,subtree:e.subtree&&!0};t.length&&(u.attributeFilter=t.map(c=>c+"")),a.observe(o,u);let f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),d={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:f,disconnectable:a};return this.disconnectables(e.signal,a,f)}observeSync(t,r,e={}){let i=typeof t=="string"||t instanceof k;[t,r,e={}]=this.resolveArgs(arguments);let{context:o,window:s}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let l=e.timing==="intercept"?"intercept":"sync";this.registry(l).size||Ut.call(s,l,c=>{this.forEachMatchingContext(l,c,Rt)});let a={disconnect(){d.delete(f)}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:a},d=this.registry(l);return d.set(f,!!f.params.deferred),this.disconnectables(e.signal,a,u)}};function Ft(n){return n.reduce((t,r,e)=>t[e-1]?.attributeName===r.attributeName||H(r.target,"realdom","internalAttrInteractions").get(r.attributeName)?t:t.concat(r),[])}function Rt(n,t){let{context:r,spec:e,callback:i,params:o,atomics:s,originalFilterIsString:l,signalGenerator:a}=n;if(o.subtree||(t=t.filter(c=>c.target===r)),!t.length)return;let u=e.map(c=>c+"");if(o.atomic&&!s.size?t=Wt(r,e,t):o.timing!=="async"&&e.length&&(t=t.filter(c=>u.includes(c.name))),!t.length)return;o.newValue===null&&o.oldValue===null&&o.eventDetails||(t=t.map(c=>{let y;return o.eventDetails||({event:y,...c}=c),!o.oldValue&&"oldValue"in c&&({oldValue:y,...c}=c),!o.newValue&&"value"in c?{value:y,...c}=c:o.newValue&&typeof c.value>"u"&&(c={...c,value:dt(c.target,c.name,()=>c.target.getAttribute(c.name))}),c})),o.atomic&&(t.forEach(c=>s.set(c.name,c)),t=Array.from(s.entries()).map(([,c])=>c));let f=l?t[0]:t,d=a?a.generate():{};i(f,d,r)}function dt(n,t,r){let e=H(n,"realdom","internalAttrInteractions").get(t);H(n,"realdom","internalAttrInteractions").set(t,!0);let i=r();return H(n,"realdom","internalAttrInteractions").set(t,e),i}function Wt(n,t,r=[]){let e={event:null,type:"attribute"};return t.length?t.map(o=>(o=o+"",r.find(s=>s.name===o)||{target:n,name:o,value:dt(n,o,()=>n.getAttribute(o)),...e})):Array.from(n.attributes).map(o=>r.find(s=>s.name===o.nodeName)||{target:n,name:o.nodeName,value:dt(n,o.nodeName,()=>o.nodeValue),...e})}function Vt({target:n,attributeName:t,value:r,oldValue:e}){let s=(this.webqit.realdom.attrInterceptionRecords?.get(n)||{})[t]?.[0]||"mutation";return{target:n,name:t,value:r,oldValue:e,type:"observation",event:s}}function Ut(n,t){let r=this,{webqit:e,document:i,Element:o}=r;e.realdom.attrInterceptionHooks||Object.defineProperty(e.realdom,"attrInterceptionHooks",{value:new Map}),e.realdom.attrInterceptionHooks.has(n)||e.realdom.attrInterceptionHooks.set(n,new Set),e.realdom.attrInterceptionHooks.get(n).add(t);let s=()=>e.realdom.attrInterceptionHooks.get(n).delete(t);if(e.realdom.attrInterceptionHooks?.intercepting)return s;console.warn("Attr mutation APIs are now being intercepted."),e.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"attrInterceptionRecords",{value:new Map});let l=(f,d)=>{e.realdom.attrInterceptionRecords.has(f.target)||e.realdom.attrInterceptionRecords.set(f.target,{});let c=e.realdom.attrInterceptionRecords.get(f.target);if(c[f.name]=c[f.name]||[],c[f.name].unshift(f.event),H(f.target,"realdom","internalAttrInteractions").get(f.name))return d();e.realdom.attrInterceptionHooks.get("intercept")?.forEach(v=>v([f]));let y=d();return e.realdom.attrInterceptionHooks.get("sync")?.forEach(v=>v([f])),y};new r.MutationObserver(f=>{f=f.filter(d=>!(r.webqit.realdom.attrInterceptionRecords?.get(d.target)||{})[d.attributeName]?.shift()),f=Ft(f).map(d=>Vt.call(r,d)),f.length&&(e.realdom.attrInterceptionHooks.get("intercept")?.forEach(d=>d(f)),e.realdom.attrInterceptionHooks.get("sync")?.forEach(d=>d(f)))}).observe(i,{attributes:!0,subtree:!0,attributeOldValue:!0});let u=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(f=>{u[f]=o.prototype[f],o.prototype[f]=function(...d){let c,y=dt(this,d[0],()=>this.getAttribute(d[0]));["setAttribute","toggleAttribute"].includes(f)&&(c=d[1]),f==="toggleAttribute"&&c===void 0&&(c=y===null);let v={target:this,name:d[0],value:c,oldValue:y,type:"interception",event:[this,f]};return l(v,()=>u[f].call(this,...d))}}),s}var it=class extends X{constructor(t,...r){super(t,"tree",...r)}attr(t,r=void 0,e={}){let{context:i,window:o}=this;return new B(i,o).get(...arguments)}query(t,r=void 0,e={}){[t,r=void 0,e={}]=this.resolveArgs(arguments);let{context:i}=this,o=new Map,s=u=>(o.has(u)||o.set(u,{target:u,entrants:[],exits:[],type:"query",event:null}),o.get(u));if(!e.generation||e.generation==="entrants"){if(!t.length)[...i.children].forEach(u=>s(i).entrants.push(u));else if(t.every(u=>u.type==="selector")){let[u,f]=t.reduce(([c,y],v)=>v.kind==="xpath"?[c,y.concat(v)]:[c.concat(v),y],[[],[]]),d=[];e.subtree?(u.length&&d.push(...i.querySelectorAll(u.join(","))),f.length&&d.push(...mt(this.window,i,f))):(u.length&&d.push(...[...i.children].filter(c=>c.matches(u))),f.length&&d.push(...mt(this.window,i,f,!1))),d.forEach(c=>s(c.parentNode||i).entrants.push(c))}}if(!r)return o;let l={disconnected:!1},a=r&&e.lifecycleSignals&&this.createSignalGenerator();for(let[,u]of o){if(l.disconnected)break;let f=a?.generate()||{};r(u,f,i)}if(e.live){a&&(e={...e,signalGenerator:a});let u=this.observe(t,r,e);return this.disconnectables(e.signal,l,u)}return this.disconnectables(e.signal,l,a)}children(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!1})}subtree(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!0})}observe(t,r,e={}){if([t,r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:i,window:o,webqit:s,document:l}=this;e.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(l.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&zt.call(o,"sync",()=>{});let a=new o.MutationObserver(d=>d.forEach(c=>{St.call(o,f,Gt.call(o,c),i)}));a.observe(i,{childList:!0,subtree:e.subtree&&!0});let u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:i,spec:t,callback:r,params:e,signalGenerator:u,disconnectable:a};if(e.staticSensitivity){let d=Bt.call(o,f);return this.disconnectables(e.signal,a,u,d)}return this.disconnectables(e.signal,a,u)}observeSync(t,r,e={}){[t,r,e={}]=this.resolveArgs(arguments);let{context:i,window:o}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let s=e.timing==="intercept"?"intercept":"sync";this.registry(s).size||zt.call(o,s,c=>{this.forEachMatchingContext(s,c,St)});let l=new o.MutationObserver(c=>c.forEach(y=>{Array.isArray((y=Gt.call(o,y)).event)||St.call(o,f,y,i)}));l.observe(i,{childList:!0,subtree:e.subtree&&!0});let a={disconnect(){d.delete(f),l.disconnect()}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:i,spec:t,callback:r,params:e,signalGenerator:u,disconnectable:a},d=this.registry(s);if(d.set(f,!!f.params.deferred),e.staticSensitivity){let c=Bt.call(o,f);return this.disconnectables(e.signal,a,u,c)}return this.disconnectables(e.signal,a,u)}track(t,r,e={}){return e={subtree:!0,...e},this.observe(t,i=>{i.entrants.length&&r(!0,Array.isArray(t)?i.entrants:i.entrants[0]),i.exits.length&&r(!1,Array.isArray(t)?i.exits:i.exits[0])},e)}};function Bt(n){let t=this,{context:r,spec:e,callback:i,params:o,signalGenerator:s}=n,l=e.filter(y=>y.kind==="css"),a=y=>y.match(/\.([\w-]+)/g)?.length?["class"]:[],u=y=>y.match(/#([\w-]+)/g)?.length?["id"]:[],f=y=>[...y.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(v=>v[1]).concat(a(y)).concat(u(y));if(!(n.$attrs=Array.from(new Set(l.filter(y=>(y+"").includes("[")).reduce((y,v)=>y.concat(f(v+"")),[])))).length)return;let d=new Set,c=new Set;return d.push=y=>(c.delete(y),d.add(y)),c.push=y=>(d.delete(y),c.add(y)),n.$deliveryCache={entrants:d,exits:c},new B(r,t).observe(n.$attrs,y=>{let v=new Map,T=x=>(v.has(x)||v.set(x,{target:x,entrants:[],exits:[],type:"static",event:null}),v.get(x)),L=new WeakMap,g=x=>(L.has(x)||L.set(x,l.some(S=>x.matches(S+""))),L.get(x));for(let x of y)["entrants","exits"].forEach(S=>{o.generation&&S!==o.generation||n.$deliveryCache[S].has(x.target)||(S==="entrants"?!g(x.target):g(x.target))||(n.$deliveryCache[S].push(x.target),T(x.target)[S].push(x.target),T(x.target).event=x.event)});for(let[,x]of v){let S=s?.generate()||{};i(x,S,r)}},{subtree:o.subtree,timing:o.timing,eventDetails:o.eventDetails})}function St(n,t){let{context:r,spec:e,callback:i,params:o,signalGenerator:s,$deliveryCache:l}=n,a={...t,entrants:[],exits:[]};if(o.eventDetails||delete a.event,["entrants","exits"].forEach(f=>{if(!(o.generation&&f!==o.generation)&&(e.length?a[f]=ve.call(this,e,o.subtree==="cross-roots",t[f],t.event!=="parse"):a[f]=[...t[f]],!!l))for(let d of a[f])l[f].push(d)}),!a.entrants.length&&!a.exits.length)return;let u=s?.generate()||{};i(a,u,r)}function ve(n,t,r,e){r=Array.isArray(r)?r:[...r];let i=(o,s)=>{if(s.type==="selector"){let l=s.isXpathAttr?[]:o.filter(a=>s.kind==="xpath"?Ht(this,a,s+""):a.matches&&a.matches(s+""));if((e||s.isXpathAttr)&&(l=o.reduce((a,u)=>s.kind==="xpath"?[...a,...mt(this,u,s,e)]:u.querySelectorAll?[...a,...u.querySelectorAll(s+"")]:a,l)),l.length)return l}else if(o.includes(s.content)||e&&o.some(l=>nt(this,l,s.content,t)))return[s.content]};return r.$$searchCache||(r.$$searchCache=new Map),n.reduce((o,s)=>{let l;return r.$$searchCache.has(s.content)?l=r.$$searchCache.get(s.content):(l=i(r,s)||[],s.type==="instance"&&r.$$searchCache.set(s.content,l)),o.concat(l)},[])}function Gt({target:n,addedNodes:t,removedNodes:r}){let e=this,i;return i=D(t).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),null),i=D(r).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),i),i=i||e.document.readyState==="loading"&&"parse"||"mutation",{target:n,entrants:t,exits:r,type:"observation",event:i}}function zt(n,t){let r=this,{webqit:e,document:i,Node:o,CharacterData:s,Element:l,HTMLElement:a,HTMLTemplateElement:u,DocumentFragment:f}=r;e.realdom.domInterceptionHooks||Object.defineProperty(e.realdom,"domInterceptionHooks",{value:new Map}),e.realdom.domInterceptionNoRecurse||Object.defineProperty(e.realdom,"domInterceptionNoRecurse",{value:new Map}),e.realdom.domInterceptionHooks.has(n)||e.realdom.domInterceptionHooks.set(n,new Set),e.realdom.domInterceptionHooks.get(n).add(t);let d=()=>e.realdom.domInterceptionHooks.get(n).delete(t);if(e.realdom.domInterceptionHooks?.intercepting)return d;console.warn("DOM mutation APIs are now being intercepted."),e.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"domInterceptionRecords",{value:new Map});let c=(g,x,S)=>{e.realdom.domInterceptionNoRecurse.set(g,x);let _=S();return e.realdom.domInterceptionNoRecurse.delete(g),_},y=(g,x)=>{g.entrants.concat(g.exits).forEach(_=>{clearTimeout(e.realdom.domInterceptionRecords.get(_)?.timeout),e.realdom.domInterceptionRecords.set(_,g.event);let m=setTimeout(()=>{e.realdom.domInterceptionRecords.delete(_)},0);Object.defineProperty(g.event,"timeout",{value:m,configurable:!0})}),e.realdom.domInterceptionHooks.get("intercept")?.forEach(_=>_(g));let S=x();return e.realdom.domInterceptionHooks.get("sync")?.forEach(_=>_(g)),S},v={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},T={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(v).reduce((g,x)=>g.concat(x),[])).forEach(g=>{Object.keys(v).forEach(_=>{if(!v[_].includes(g))return;let m=Object.getOwnPropertyDescriptor(r[_].prototype,g);!m||(Object.defineProperty(r[_].prototype,g,"value"in m?{...m,value:x}:{...m,set:S}),T[_][g]=m)});function x(..._){let m=Object.keys(T).find(j=>this instanceof r[j]&&g in T[j]),h=T[m],p=()=>h[g].value.call(this,..._);if(e.realdom.domInterceptionNoRecurse.get(this)===g)return p();let b=[],w=[],A=this;["insertBefore"].includes(g)?w=[_[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(g)?(w=[_[1]],["beforebegin","afterend"].includes(_[0])&&(A=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(g)?(b=[...this.childNodes],w=g==="replaceChildren"?[..._]:[_[0]]):["replaceWith","remove"].includes(g)?(b=[this],w=g==="replaceWith"?[..._]:[],A=this.parentNode):["replaceChild"].includes(g)?(b=[_[1]],w=[_[0]]):["removeChild"].includes(g)?b=[..._]:(w=[..._],["before","after"].includes(g)&&(A=this.parentNode));let C=g;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(g)){let j=this.nodeName;if(g==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(_[0])){if(!this.parentNode)return h[g].value.call(this,..._);j=this.parentNode.nodeName}let M=i.createElement(j.includes("-")?"div":j);h.setHTMLUnsafe.value.call(M,w[0],g==="setHTMLUnsafe"?_[1]:{}),w=[...M.childNodes],g==="insertAdjacentHTML"?(C="insertAdjacentElement",_[1]=new f,c(_[1],"append",()=>_[1].append(...M.childNodes))):(C="replaceChildren",_=[...M.childNodes])}return y({target:A,entrants:w,exits:b,type:"interception",event:[this,g]},()=>h[C].value.call(this,..._))}function S(_){let m=Object.keys(T).find(I=>this instanceof r[I]&&g in T[I]),h=T[m],p=()=>h[g].set.call(this,_);if(this instanceof HTMLScriptElement||e.realdom.domInterceptionNoRecurse.get(this)===g)return p();let b=[],w=[],A=this;if(["outerHTML","outerText"].includes(g)?(b=[this],A=this.parentNode):this instanceof u?(A=this.content,b=[...this.content.childNodes]):b=[...this.childNodes],["outerHTML","innerHTML"].includes(g)){let I=this.nodeName;if(g==="outerHTML"){if(!this.parentNode)return p();I=this.parentNode.nodeName}let j=i.createElement(I.includes("-")?"div":I);if(c(j,g,()=>j[g]=_),w=this instanceof u?[...j.content.childNodes]:[...j.childNodes],this instanceof u&&this.hasAttribute("src")||this instanceof ShadowRoot){let M=z=>z.reduce((F,W)=>W instanceof HTMLScriptElement?F.concat(W):W instanceof u?F.concat(M([W.content])):(F=F.concat(M([...W.querySelectorAll?.("template")||[]].map(oe=>oe.content))),F.concat(...W.querySelectorAll?.("script")||[])),[]);for(let z of M(w)){if(this instanceof ShadowRoot){z.setAttribute("data-handling","manual");continue}let F=i.createElement("script");[...z.attributes].forEach(W=>F.setAttribute(W.name,W.value)),F.textContent=z.textContent,c(z,"replaceWith",()=>z.replaceWith(F))}}g==="outerHTML"?(_=new f,c(_,"append",()=>_.append(...w)),p=()=>c(this,"replaceWith",()=>l.prototype.replaceWith.call(this,_))):this instanceof u?p=()=>c(this.content,"replaceChildren",()=>this.content.replaceChildren(...w)):p=()=>c(this,"replaceChildren",()=>l.prototype.replaceChildren.call(this,...w))}return y({target:A,entrants:w,exits:b,type:"interception",event:[this,g]},p)}}),d}function Xt(){Ae.call(this),Se.call(this),Ee.call(this)}function Ae(){let n=this;n.CSS||(n.CSS={}),n.CSS.escape||(n.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Se(){let n=this;"isConnected"in n.Node.prototype||Object.defineProperty(n.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Ee(){let n=this;n.Element.prototype.matches||(n.Element.prototype.matches=n.Element.prototype.matchesSelector||n.Element.prototype.mozMatchesSelector||n.Element.prototype.msMatchesSelector||n.Element.prototype.oMatchesSelector||n.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),e=r.length;--e>=0&&r.item(e)!==this;);return e>-1})}function Qt(){let n=this;if(n.webqit||(n.webqit={}),n.webqit.realdom)return n.webqit.realdom;n.webqit.realdom={},Xt.call(n),n.webqit.realdom.meta=(...r)=>Ce.call(n,...r),n.webqit.realdom.ready=(...r)=>Et.call(n,...r),n.webqit.realdom.realtime=(r,e="dom")=>{if(e==="dom")return new it(r,n);if(e==="attr")return new B(r,n)};let t=new rt(n);return n.webqit.realdom.schedule=(r,...e)=>t[`on${r}`](...e),n.webqit.realdom.synthesizeWhile=(...r)=>t.synthesizeWhile(...r),n.webqit.realdom}function Et(...n){let t="interactive",r;J(n[0])?(t=n[0],E(n[1])&&(r=n[1])):E(n[0])&&(r=n[0]);let e={interactive:["interactive","complete"],complete:["complete"]};if(!e[t])throw new Error(`Invalid ready-state timing: ${t}.`);let i=this;if(!r)return i.webqit.realdom.readyStatePromises||(i.webqit.realdom.readyStatePromises={interactive:new Promise(o=>Et.call(this,"interactive",o)),complete:new Promise(o=>Et.call(this,"complete",o))}),i.webqit.realdom.readyStatePromises[t];if(e[t].includes(i.document.readyState))return r(i);i.webqit.realdom.readyStateCallbacks||(i.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},i.document.addEventListener("readystatechange",()=>{let o=i.document.readyState;for(let s of i.webqit.realdom.readyStateCallbacks[o].splice(0))s(i)},!1)),i.webqit.realdom.readyStateCallbacks[t].push(r)}function Ce(n){let t=this,r={},e;return(e=t.document.querySelector(`meta[name="${n}"]`))&&(r=(e.content||"").split(";").filter(i=>i).reduce((i,o)=>{let s=o.split("=").map(l=>l.trim());return Ot(i,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:N(s[1])?parseInt(s[1]):s[1]),i},{})),{get name(){return n},get content(){return e.content},json(){return JSON.parse(JSON.stringify(r))}}}function pt(n,t){return typeof n!="string"?n:n.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}var q=(n,...t)=>H(n,"oohtml",...t),R={};function Yt(n,t,r){let e=this,i=Qt.call(e);R.window=e,e.webqitConfig||(e.webqitConfig=i.meta("webqit").json()),e.webqit||(e.webqit={}),e.webqit.oohtml||(e.webqit.oohtml={}),e.webqit.oohtml.configs||(e.webqit.oohtml.configs={});let o=n.toUpperCase().replace("-","_");if(!e.webqit.oohtml.configs[o]){e.webqit.oohtml.configs[o]={};let s=e.webqit.oohtml.configs[o];tt(2,s,r,t,i.meta(n).json()),e.webqitConfig.prefix&&Object.keys(s).forEach(l=>{Object.keys(s[l]).forEach(a=>{l==="api"&&typeof s[l][a]=="string"?s[l][a]=`${e.webqitConfig.prefix}${pt(s[l][a])}`:["attr","elements"].includes(l)&&s[l][a]?.startsWith("data-")===!1&&(s[l][a]=`${e.webqitConfig.prefix}-${s[l][a]}`)})})}return{config:e.webqit.oohtml.configs[o],realdom:i,window:e}}function Tt(n,t){return q(n,"internalAttrInteractions").get(t)}function Zt(n,t,r){let e=q(n,"internalAttrInteractions").get(t);q(n,"internalAttrInteractions").set(t,!0);let i=r();return q(n,"internalAttrInteractions").set(t,e),i}function Kt(n,t){return[...n].reduce(([r,e,i],o)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(o)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(o)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(o)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(o)&&!i[0].endsWith("\\")&&(r=r===o?null:r||o),i[0]+=o,[r,e,i]),[null,0,[""]])[2].reverse()}var qe=()=>(0|Math.random()*9e6).toString(36),Ct=new Map;function te(n){let t;return(t=Ct.get(n))||(t=qe(),Ct.set(n,t)),t}function ee(n){let t;return Ct.forEach((r,e)=>{r===n&&(t=e)}),t}function re(){let{window:n}=R,{webqit:t}=n;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class r extends n.Event{constructor(...i){let o=i.pop();if(typeof o!="function")throw new Error("Callback must be provided.");let s=i.pop();if(!s?.kind)throw new Error('"options.kind" must be specified.');let l=["contextrequest","contextclaim"],a=i.pop()||l[0];if(!l.includes(a))throw new Error(`Invalid event type. Must be one of: ${l.join(",")}`);let{kind:u,detail:f,targetContext:d,live:c,signal:y,diff:v,...T}=s;super(a,{...T,bubbles:T.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>o}),Object.defineProperty(this,"kind",{get:()=>u}),Object.defineProperty(this,"targetContext",{get:()=>d}),Object.defineProperty(this,"detail",{get:()=>f}),Object.defineProperty(this,"live",{get:()=>c}),Object.defineProperty(this,"signal",{get:()=>y}),Object.defineProperty(this,"diff",{get:()=>v}),Object.defineProperty(this,"options",{get:()=>T}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(i){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===i)return;Object.defineProperty(this,"_prevValue",{value:i,configurable:!0})}return this.callback(i)}}return t.DOMContextRequestEvent=r,r}var ot=class extends AbortController{constructor(t){super(),t(r=>{let{window:{webqit:{Observer:e}}}=R;e.defineProperty(this,"value",{value:r,configurable:!0,enumerable:!0})},this)}};var st=class extends Error{};var lt=class{static instance(t){return _wq(t).get("contexts::instance")||new this(t)}constructor(t){_wq(t).get("contexts::instance")?.dispose(),_wq(t).set("contexts::instance",this);let r={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>r})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(r=>typeof t[0]=="function"?t[0](r):r.constructor.kind===t[0]&&(!t[1]||r.detail===t[1]))}attach(t){if(!(t instanceof G))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new st(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new ot((r,e)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(r):t[t.length-1]=r);let i;(i=t.find(s=>typeof s=="object"&&s))&&i.live&&(i.signal&&i.signal.addEventListener("abort",()=>e.abort()),t[t.indexOf(i)]={...i,signal:e.signal});let o=new(re())(...t);this["#"].host.dispatchEvent(o)})}};var Pt=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=R;return t}get name(){return[R.window.Document,R.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof Pt)||t.target===this.host)return;let r=new Set;if(this.subscriptions.forEach(e=>{!t.target.contains(e.target)||!t.detail.matchEvent(e)||(this.subscriptions.delete(e),this.unsubscribed(e),r.add(e))}),r.size)return t.respondWith(r)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:r}=lt.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return r?.forEach(e=>{this.subscriptions.add(e),this.subscribed(e),this.handle(e)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(r=>{this.subscriptions.delete(r),this.unsubscribed(r);let{target:e}=r;r.meta.answered=!1,e.dispatchEvent(r)}),this}},G=Pt;ft(G,"kind");var Y=class extends G{static createRequest(t=null){let r=super.createRequest();if(t?.startsWith("@")){let[e,...i]=i.slice(1).split("/").map(o=>o.trim());r.targetContext=e,r.detail=i.join("/")}else r.detail=t;return r}get namespaceObj(){return this.host[this.configs.NAMESPACED_HTML.api.namespace]}handle(t){let{window:{webqit:{Observer:r}}}=R;if(t.meta.controller?.abort(),!(t.detail||"").trim())return t.respondWith(r.unproxy(this.namespaceObj));let e=(t.detail||"").split("/").map(i=>i.trim()).filter(i=>i);if(!e.length)return t.respondWith();e=e.join(`/${this.configs.NAMESPACED_HTML.api.namespace}/`)?.split("/")||[],t.meta.controller=r.reduce(this.namespaceObj,e,r.get,i=>{this.disposed||t.respondWith(i.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t.meta.controller?.abort()}};ft(Y,"kind","namespace");function qt(n={}){let{config:t,window:r}=Yt.call(this,"namespaced-html",n,{attr:{namespace:"namespace",lid:"id"},api:{namespace:"namespace"},tokens:{lidrefPrefix:"~",lidrefSeparator:":"},target:{className:":target",eventName:":target",scrolling:!0}});t.lidSelector=`[${r.CSS.escape(t.attr.lid)}]`,t.namespaceSelector=`[${r.CSS.escape(t.attr.namespace)}]`,r.webqit.DOMNamingContext=Y,je.call(r,t),Me.call(r,t)}function ie(n){let{lidrefPrefix:t,lidrefSeparator:r}=n.tokens;return{escape(e,i=1){return[...e].map(o=>/\w/.test(o)?o:i===2?`\\\\${o}`:`\\${o}`).join("")},lidrefPrefix(e=0){return e?this.escape(t,e):t},lidrefSeparator(e=0){return e?this.escape(r,e):r},isUuid(e,i=0){return e.startsWith(this.lidrefPrefix(i))&&e.includes(this.lidrefSeparator(i))},toUuid(e,i,o=0){return e.endsWith("-root")?i:`${this.lidrefPrefix(o)}${e}${this.lidrefSeparator(o)}${i}`},uuidToId(e,i=0){return this.isUuid(e)?e.split(this.lidrefSeparator(i))[1]:e},uuidToLidref(e,i=0){return this.isUuid(e)?`${this.lidrefPrefix(i)}${e.split(this.lidrefSeparator(i))[1]}`:e}}}function Ie(n,t,r=null,e=0){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:o}}}}=i,s=ie(o),l=new RegExp(`${r?":scope|":""}#(${s.lidrefPrefix(e+1)})?([\\w]+${s.lidrefSeparator(e+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[a,u]=Kt(n,",").reduce(([d,c],y)=>{let v,T;return y=y.replace(l,(L,g,x,S,_)=>{if(v||(v=[...y.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),v.some(b=>_>b.index&&_+L.length<b.index+b[0].length))return L;if(L===":scope")return T=!0,r;let m=g&&!x;if(g&&x)return`#${s.escape(L.replace("#",""),1)}`;if(m&&o.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${s.toUuid(t,S,1)}`;let p;return o.attr.lid==="id"?p=`:is(#${S},[id^="${s.lidrefPrefix(e)}"][id$="${s.lidrefSeparator(e)}${S}"])`:p=`:is(#${S},[${i.CSS.escape(o.attr.lid)}="${S}"])`,m?`:is(${p}):not(${r?r+" ":""}${o.namespaceSelector} *)`:p}),T?[d,c.concat(y)]:[d.concat(y),c]},[[],[]]),f;return r&&a.length?f=[a.length>1?`${r} :is(${a.join(", ")})`:`${r} ${a[0]}`,u.join(", ")].filter(d=>d).join(", "):f=[...a,...u].join(", "),f}function gt(n){let t=this;if(!q(n).has("namespace")){let r=Object.create(null);q(n).set("namespace",r);let e=[t.Document,t.ShadowRoot].some(i=>n instanceof i);Object.defineProperty(r,Symbol.toStringTag,{get(){return e?"RootNamespaceRegistry":"NamespaceRegistry"}})}return q(n).get("namespace")}function ht(n,t=!1){let r=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:e}}}}=r,i=[r.Document,r.ShadowRoot].some(o=>n instanceof o);return gt.call(r,i?n:(t?n.parentNode:n)?.closest?.(e.namespaceSelector)||n.getRootNode())}function ne(n){let t=Object.prototype.toString.call(n)==="[object RootNamespaceRegistry]";return(ee(n)||te(n))+(t?"-root":"")}function je(n){let t=this,{webqit:{Observer:r}}=t;[t.Document.prototype,t.Element.prototype,t.ShadowRoot.prototype].forEach(e=>{let i=e===t.Document.prototype?"Document":e===t.ShadowRoot.prototype?"ShadowRoot":"Element";if(n.api.namespace in e)throw new Error(`The ${i} prototype already has a "${n.api.namespace}" API!`);Object.defineProperty(e,n.api.namespace,{get:function(){return r.proxy(gt.call(t,this))}})})}function Me(n){let t=this,{webqit:{Observer:r,realdom:e,oohtml:{configs:i},DOMNamingContext:o}}=t,s=["aria-owns","aria-controls","aria-labelledby","aria-describedby","aria-flowto"],l=["for","list","form","aria-activedescendant","aria-details","aria-errormessage"],a=[n.attr.lid,...s,...l],u={id:"id",for:"htmlFor","aria-owns":"ariaOwns","aria-controls":"ariaControls","aria-labelledby":"ariaLabelledBy","aria-describedby":"ariaDescribedBy","aria-flowto":"ariaFlowto","aria-activedescendant":"ariaActiveDescendant","aria-details":"ariaDetails","aria-errormessage":"ariaErrorMessage"},f=ie(n),d=(m,h,p)=>{if(!Tt(m,h)&&q(m,"attrOriginals").has(h))return q(m,"attrOriginals").get(h);let b=p();return Tt(m,h)?b:b&&b.split(" ").map(w=>(w=w.trim())&&(h===n.attr.lid?f.uuidToId:f.uuidToLidref).call(f,w)).join(" ")},c=Object.getOwnPropertyDescriptor(t.Document.prototype,"getElementById");Object.defineProperty(t.Document.prototype,"getElementById",{...c,value(m){return this.querySelector(`#${m}`)}});for(let m of["querySelector","querySelectorAll"])for(nodeApi of[t.Document,t.Element]){let h=Object.getOwnPropertyDescriptor(nodeApi.prototype,m);Object.defineProperty(nodeApi.prototype,m,{...h,value(p){return h.value.call(this,Ie.call(t,p,ne(gt.call(t,this))))}})}let y=Object.getOwnPropertyDescriptor(t.Element.prototype,"getAttribute");Object.defineProperty(t.Element.prototype,"getAttribute",{...y,value(m){let h=()=>y.value.call(this,m);return a.includes(m)&&!q(this,"lock").get(m)?d(this,m,h):h()}});let v=Object.getOwnPropertyDescriptor(t.Attr.prototype,"value");Object.defineProperty(t.Attr.prototype,"value",{...v,get(){let m=()=>v.get.call(this);return a.includes(this.name)?d(this.ownerElement,this.name,m):m()}});let T=Object.getOwnPropertyDescriptor(t.Node.prototype,"nodeValue");Object.defineProperty(t.Node.prototype,"nodeValue",{...T,get(){let m=()=>T.get.call(this);return this instanceof t.Attr&&a.includes(this.name)?d(this.ownerElement,this.name,m):m()}});for(let m of a){if(!(m in u))continue;let h=m==="for"?[t.HTMLLabelElement,t.HTMLOutputElement]:[t.Element];for(let p of h){let b=Object.getOwnPropertyDescriptor(p.prototype,u[m]);!b||Object.defineProperty(p.prototype,u[m],{...b,get(){return d(this,m,()=>b.get.call(this,m))}})}}n.attr.lid!=="id"&&Object.defineProperty(t.Element.prototype,n.attr.lid,{configurable:!0,enumerable:!0,get(){return this.getAttribute(n.attr.lid)},set(m){return this.setAttribute(n.attr.lid,m)}});let L=(m,h,p,b)=>Zt(m,h,()=>(typeof p=="function"&&(p=p()),b(p))),g=(m,h,p,b=null)=>{L(m,h,p,w=>{let A=h===n.attr.lid,C=b||ht.call(t,m,A),I=ne(C);if(A){let j=f.uuidToId(w);if(r.get(C,j)!==m){let M=f.toUuid(I,j);M!==w&&m.setAttribute("id",M),r.set(C,j,m)}}else{q(m,"attrOriginals").set(h,w);let j=w.split(" ").map(M=>(M=M.trim())&&f.isUuid(M)?M:f.toUuid(I,M)).join(" ");m.setAttribute(h,j),q(C).set("idrefs",q(C).get("idrefs")||new Set),q(C).get("idrefs").add(m)}})},x=(m,h,p,b=null)=>{L(m,h,p,w=>{let A=h===n.attr.lid,C=b||ht.call(t,m,A);if(A){let I=f.uuidToId(w);r.get(C,I)===m&&r.deleteProperty(C,I)}else{let I=q(m,"attrOriginals").get(h);m.hasAttribute(h)&&m.setAttribute(h,I),q(C).get("idrefs")?.delete(m)}})};e.realtime(t.document).query(n.namespaceSelector,m=>{let h=(p,b,w,A)=>{if(!p.hasAttribute(b))return;let C=()=>p.getAttribute(b);x(p,b,C,w),p.isConnected&&g(p,b,q(p,"attrOriginals").get(b)||C,A)};m.exits.forEach(p=>{if(p.isConnected){let A=gt.call(t,p);for(let C of new Set([...Object.values(A),...q(A).get("idrefs")||[]]))for(let I of a)h(C,I,A)}let b=p[i.CONTEXT_API.api.contexts],w=b.find(o.kind);w&&b.detach(w)}),m.entrants.forEach(p=>{let b,w=ht.call(t,p,!0);for(let C of new Set([...Object.values(w),...q(w).get("idrefs")||[]]))if((b=ht.call(t,C,!0))!==w)for(let I of a)h(C,I,w,b);let A=p[i.CONTEXT_API.api.contexts];A.find(o.kind)||A.attach(new o)})},{id:"namespace-html:namespace",live:!0,subtree:"cross-roots",timing:"sync",staticSensitivity:!0,eventDetails:!0}),e.realtime(t.document).query(`[${a.map(m=>t.CSS.escape(m)).join("],[")}]`,m=>{let h={forID:new Map,forOther:new Map};for(let p of a){let b=p===n.attr.lid?h.forID:h.forOther;m.exits.forEach(w=>{if(!w.hasAttribute(p))return;let A=b.get(w);typeof A>"u"&&(A=(p===n.attr.lid?w.parentNode:w)?.closest?.(n.namespaceSelector)||w.getRootNode().host,b.set(w,A)),!(A&&!A.isConnected)&&x(w,p,()=>w.getAttribute(p))}),m.entrants.forEach(w=>{!w.hasAttribute(p)||g(w,p,()=>w.getAttribute(p))})}h.forID.clear(),h.forOther.clear()},{id:"namespace-html:attrs",live:!0,subtree:"cross-roots",timing:"sync"}),e.realtime(t.document,"attr").observe(a,m=>{for(let h of m)h.oldValue&&x(h.target,h.name,h.oldValue),h.value&&g(h.target,h.name,h.value)},{id:"namespace-html:attr(attrs)",subtree:"cross-roots",timing:"sync",newValue:!0,oldValue:!0});let S,_=()=>{if(!t.location.hash?.startsWith(`#${f.lidrefPrefix()}`))return;let m=t.location.hash?.substring(`#${f.lidrefPrefix()}`.length).split("/").map(p=>p.trim()).filter(p=>p)||[],h=m.reduce((p,b)=>p&&p[n.api.namespace][b],t.document);S&&n.target.className&&S.classList.toggle(n.target.className,!1),h&&h!==t.document&&(n.target.className&&h.classList.toggle(n.target.className,!0),n.target.eventName&&h.dispatchEvent(new t.CustomEvent(n.target.eventName)),n.target.scrolling&&m.length>1&&h.scrollIntoView(),S=h)};t.addEventListener("hashchange",_),e.ready(_)}qt.call(window);})();
|
|
1
|
+
(()=>{var se=Object.defineProperty;var le=(n,t,r)=>t in n?se(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var ft=(n,t,r)=>(le(n,typeof t!="symbol"?t+"":t,r),r);function q(n){return!Array.isArray(n)&&typeof n=="object"&&n}function O(n){return Array.isArray(n)}function Q(n){return typeof n=="function"}function Z(n){return n===null||n===""}function V(n){return arguments.length&&(n===void 0||typeof n>"u")}function $(n){return Array.isArray(n)||typeof n=="object"&&n||Q(n)}function yt(n){return Z(n)||V(n)||n===!1||n===0||$(n)&&!Object.keys(n).length}function E(n){return Q(n)||n&&{}.toString.call(n)==="[object function]"}function K(n){return n instanceof Number||typeof n=="number"}function N(n){return K(n)||n!==!0&&n!==!1&&n!==null&&n!==""&&!isNaN(n*1)}function J(n){return n instanceof String||typeof n=="string"&&n!==null}function wt(n){return!J(n)&&!V(n.length)}function at(n,...t){return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n}function _t(e,t){t=t||Object.prototype,t=t&&!O(t)?[t]:t;for(var r=[],e=e;e&&(!t||t.indexOf(e)<0)&&e.name!=="default";)r.push(e),e=e?Object.getPrototypeOf(e):null;return r}function bt(n,t){var r=[];return _t(n,t).forEach(e=>{at(r,...Object.getOwnPropertyNames(e))}),r}function U(n,t,r=!1,e=!1,i=!1){var o=0,s=n.shift();if((N(s)||s===!0||s===!1)&&(o=s,s=n.shift()),!n.length)throw new Error("_merge() requires two or more array/objects.");return n.forEach((l,a)=>{!$(l)&&!E(l)||(r?bt(l):Object.keys(l)).forEach(u=>{if(!!t(u,s,l,a)){var f=s[u],d=l[u];if((O(f)&&O(d)||q(f)&&q(d))&&(o===!0||o>0))s[u]=O(f)&&O(d)?[]:{},U([N(o)?o-1:o,s[u],f,d],t,r,e,i);else if(O(s)&&O(l))e?s[u]=d:s.push(d);else try{i?Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(l,u)):s[u]=l[u]}catch{}}})}),s}function tt(...n){return U(n,(t,r,e)=>!0,!1,!1,!1)}function H(n,...t){if(!n||!["object","function"].includes(typeof n))throw new Error("Argument #1 must be of type object");let r=n[Symbol.for("wq")];if(r||(r=new ct,Object.defineProperty(n,Symbol.for("wq"),{value:r,enumerable:!1,configurable:!1,writable:!1})),!t.length)return r;let e,i;for(;e=t.shift();)(i=r)&&!(r=r.get(e))&&(r=new ct,i.set(e,r));return r}var ct=class extends Map{};function D(n,t=!0){return O(n)?n:!t&&q(n)?[n]:n!==!1&&n!==0&&yt(n)?[]:wt(n)?Array.prototype.slice.call(n):q(n)?Object.values(n):[n]}function et(n,t,r={},e={}){t=D(t).slice();for(var i=n;!V(i)&&!Z(i)&&t.length;){var o=t.shift();if(!(r.get?r.get(i,o):$(i)?o in i:i[o])){e.exists=!1;return}i=r.get?r.get(i,o):i[o]}return e.exists=!0,i}function Ot(n,t,r,e={},i={}){let o=(f,d,c)=>i.set?i.set(f,d,c):(N(t[l])&&O(f)?f.push(c):f[d]=c,!0);t=D(t);for(var s=n,l=0;l<t.length;l++)if(l<t.length-1){if(!s||!$(s)&&!E(s))return!1;var a=et(s,t[l],i);if(!$(a)){if(i.buildTree===!1)return!1;a=E(i.buildTree)?i.buildTree(l):N(t[l+1])?[]:{};var u=o(s,t[l],a);if(!u)return!1}s=a}else return o(s,t[l],r)}var rt=class{constructor(t,r=!1){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),Object.defineProperty(this,"_synthesis",{value:0,writable:!0}),!r&&this.window.requestAnimationFrame?this._loop():this._synthesis++}get synthesis(){return this._synthesis}async synthesizeWhile(t){this._synthesis++,this._fulfill();let r=await t();return this._synthesis--,r}_fulfill(){for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t)}_loop(){this.window.requestAnimationFrame(()=>{this._fulfill(),this._loop()})}onread(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.readCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.readCallbacks.add(t)}onwrite(t,r=!1){if(r)return new Promise(e=>{this.synthesis?e(t()):this.writeCallbacks.add(()=>{e(t())})});this.synthesis?Promise.resolve().then(t):this.writeCallbacks.add(t)}cycle(t,r,e){this.onread(()=>{let i=t(e),o=s=>{s!==void 0&&this.onwrite(()=>{let l=r(s,e),a=u=>{u!==void 0&&this.cycle(t,r,u)};l instanceof Promise?l.then(a):a(l)})};i instanceof Promise?i.then(o):o(i)})}};function Nt(n){return(n=n.trim())&&n.startsWith("(")&&n.endsWith(")")}function mt(n,t,r,e=!0){r=(Array.isArray(r)?r:[r]).map(s=>(s+"").replace("(",e?"(.//":"(./")).join("|");let i=[],o;try{let s=n.document.evaluate(r,t,null,n.XPathResult.ANY_TYPE);for(;o=s.iterateNext();)i.push(o)}catch{}return i}function Ht(n,t,r){r=(Array.isArray(r)?r:[r]).map(e=>(e+"").replace("(","(self::")).join("|");try{return n.document.evaluate(`${r}`,t,null,n.XPathResult.BOOLEAN_TYPE).booleanValue}catch{}}function nt(n,t,r,e=!1,i=null){let o=i?.get(t)?.get(r);if(typeof o<"u")return o;let s=u=>(i?.has(t)||i?.set(t,new WeakMap),i?.get(t)?.set(r,u),u),l=t.getRootNode(),a=r.getRootNode();return l===a?s(t.contains(r)):e&&a instanceof n.ShadowRoot?s(nt(n,t,a.host,e,i)):s(!1)}function kt(n,t="|"){return[...n].reduce(([r,e,i,o],s)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(s)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(s)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(s)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(s)&&!i[0].endsWith("\\")&&(r=r===s?null:r||s),i[0]+=s,[r,e,i]),[null,0,[""]])[2].reverse()}var k=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:Nt(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=kt(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var X=class{constructor(t,r,e){this.context=t,this.namespace=r,this.window=t.defaultView||t.ownerDocument?.defaultView||e,this.document=this.window.document,this.webqit=this.window.webqit,Object.defineProperty(this,"#",{value:{}})}resolveArgs(t){if(E(t[0])?t=[[],...t]:q(t[0])&&!(t[0]instanceof k)&&t.length===1?t=[[],void 0,t[0]]:q(t[1])&&t.length===2?t=[D(t[0],!1),void 0,t[1]]:t[0]=D(t[0],!1),t[0].filter(r=>typeof r!="string"&&!(r instanceof k)&&!(r instanceof this.window.Node)).length)throw new Error("Argument #2 must be either a string or a Node object, or a list of those.");return t[0]=t[0].map(r=>r instanceof k?r:new k(r)),t}registry(...t){return H(this.window,"realdom",this.namespace,...t)}createSignalGenerator(){return{generate(){return this.lastController?.abort(),this.lastController=new AbortController,{signal:this.lastController.signal}},disconnect(){this.lastController?.abort()}}}forEachMatchingContext(t,r,e){let{window:i}=this,o=new Set,s=new WeakMap;for(let[l,a]of this.registry(t)){let u=[].concat(r).filter(d=>nt(i,l.context,d.target,l.params.subtree==="cross-roots",s));if(!u.length)continue;let f=[l,Array.isArray(r)?u:u[0]];a?o.add(f):e.call(i,...f)}for(let l of o)e.call(i,...l);o.clear()}disconnectables(t,...r){let e={disconnect(){r.forEach(i=>i&&E(i.disconnect)&&i.disconnect()||E(i)&&i()||q(i)&&(i.disconnected=!0))}};return t&&t.addEventListener("abort",()=>e.disconnect()),e}};var B=class extends X{type="attr";constructor(t,...r){super(t,"attr",...r)}get(t,r=void 0,e={}){let i=typeof t=="string"||t instanceof k;[t=[],r=void 0,e={}]=this.resolveArgs(arguments);let{context:o}=this,s=Wt(o,t);if(!r)return s;let l=e.lifecycleSignals&&this.createSignalGenerator();if(i)for(let a of s){let u=l?l.generate():{};r(a,u,o)}else{let a=l?.generate()||{};r(s,a,o)}if(e.live){l&&(e={...e,signalGenerator:l});let a=this.observe(i?t[0]:t,r,{newValue:!0,...e});return this.disconnectables(e.signal,a)}}observe(t,r,e={}){let i=typeof t=="string"||t instanceof k;if([t=[],r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(i?t[0]:t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:o,window:s,webqit:l}=this;e.eventDetails&&!l.realdom.attrInterceptionHooks?.intercepting&&Ut.call(s,"intercept",()=>{});let a=new s.MutationObserver(c=>{c=Ft(c).map(y=>Vt.call(s,y)),Rt.call(s,d,c,o)}),u={attributes:!0,attributeOldValue:e.oldValue,subtree:e.subtree&&!0};t.length&&(u.attributeFilter=t.map(c=>c+"")),a.observe(o,u);let f=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),d={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:f,disconnectable:a};return this.disconnectables(e.signal,a,f)}observeSync(t,r,e={}){let i=typeof t=="string"||t instanceof k;[t,r,e={}]=this.resolveArgs(arguments);let{context:o,window:s}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let l=e.timing==="intercept"?"intercept":"sync";this.registry(l).size||Ut.call(s,l,c=>{this.forEachMatchingContext(l,c,Rt)});let a={disconnect(){d.delete(f)}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:a},d=this.registry(l);return d.set(f,!!f.params.deferred),this.disconnectables(e.signal,a,u)}};function Ft(n){return n.reduce((t,r,e)=>t[e-1]?.attributeName===r.attributeName||H(r.target,"realdom","internalAttrInteractions").get(r.attributeName)?t:t.concat(r),[])}function Rt(n,t){let{context:r,spec:e,callback:i,params:o,atomics:s,originalFilterIsString:l,signalGenerator:a}=n;if(o.subtree||(t=t.filter(c=>c.target===r)),!t.length)return;let u=e.map(c=>c+"");if(o.atomic&&!s.size?t=Wt(r,e,t):o.timing!=="async"&&e.length&&(t=t.filter(c=>u.includes(c.name))),!t.length)return;o.newValue===null&&o.oldValue===null&&o.eventDetails||(t=t.map(c=>{let y;return o.eventDetails||({event:y,...c}=c),!o.oldValue&&"oldValue"in c&&({oldValue:y,...c}=c),!o.newValue&&"value"in c?{value:y,...c}=c:o.newValue&&typeof c.value>"u"&&(c={...c,value:dt(c.target,c.name,()=>c.target.getAttribute(c.name))}),c})),o.atomic&&(t.forEach(c=>s.set(c.name,c)),t=Array.from(s.entries()).map(([,c])=>c));let f=l?t[0]:t,d=a?a.generate():{};i(f,d,r)}function dt(n,t,r){let e=H(n,"realdom","internalAttrInteractions").get(t);H(n,"realdom","internalAttrInteractions").set(t,!0);let i=r();return H(n,"realdom","internalAttrInteractions").set(t,e),i}function Wt(n,t,r=[]){let e={event:null,type:"attribute"};return t.length?t.map(o=>(o=o+"",r.find(s=>s.name===o)||{target:n,name:o,value:dt(n,o,()=>n.getAttribute(o)),...e})):Array.from(n.attributes).map(o=>r.find(s=>s.name===o.nodeName)||{target:n,name:o.nodeName,value:dt(n,o.nodeName,()=>o.nodeValue),...e})}function Vt({target:n,attributeName:t,value:r,oldValue:e}){let s=(this.webqit.realdom.attrInterceptionRecords?.get(n)||{})[t]?.[0]||"mutation";return{target:n,name:t,value:r,oldValue:e,type:"observation",event:s}}function Ut(n,t){let r=this,{webqit:e,document:i,Element:o}=r;e.realdom.attrInterceptionHooks||Object.defineProperty(e.realdom,"attrInterceptionHooks",{value:new Map}),e.realdom.attrInterceptionHooks.has(n)||e.realdom.attrInterceptionHooks.set(n,new Set),e.realdom.attrInterceptionHooks.get(n).add(t);let s=()=>e.realdom.attrInterceptionHooks.get(n).delete(t);if(e.realdom.attrInterceptionHooks?.intercepting)return s;console.warn("Attr mutation APIs are now being intercepted."),e.realdom.attrInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"attrInterceptionRecords",{value:new Map});let l=(f,d)=>{e.realdom.attrInterceptionRecords.has(f.target)||e.realdom.attrInterceptionRecords.set(f.target,{});let c=e.realdom.attrInterceptionRecords.get(f.target);if(c[f.name]=c[f.name]||[],c[f.name].unshift(f.event),H(f.target,"realdom","internalAttrInteractions").get(f.name))return d();e.realdom.attrInterceptionHooks.get("intercept")?.forEach(v=>v([f]));let y=d();return e.realdom.attrInterceptionHooks.get("sync")?.forEach(v=>v([f])),y};new r.MutationObserver(f=>{f=f.filter(d=>!(r.webqit.realdom.attrInterceptionRecords?.get(d.target)||{})[d.attributeName]?.shift()),f=Ft(f).map(d=>Vt.call(r,d)),f.length&&(e.realdom.attrInterceptionHooks.get("intercept")?.forEach(d=>d(f)),e.realdom.attrInterceptionHooks.get("sync")?.forEach(d=>d(f)))}).observe(i,{attributes:!0,subtree:!0,attributeOldValue:!0});let u=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(f=>{u[f]=o.prototype[f],o.prototype[f]=function(...d){let c,y=dt(this,d[0],()=>this.getAttribute(d[0]));["setAttribute","toggleAttribute"].includes(f)&&(c=d[1]),f==="toggleAttribute"&&c===void 0&&(c=y===null);let v={target:this,name:d[0],value:c,oldValue:y,type:"interception",event:[this,f]};return l(v,()=>u[f].call(this,...d))}}),s}var it=class extends X{constructor(t,...r){super(t,"tree",...r)}attr(t,r=void 0,e={}){let{context:i,window:o}=this;return new B(i,o).get(...arguments)}query(t,r=void 0,e={}){[t,r=void 0,e={}]=this.resolveArgs(arguments);let{context:i}=this,o=new Map,s=u=>(o.has(u)||o.set(u,{target:u,entrants:[],exits:[],type:"query",event:null}),o.get(u));if(!e.generation||e.generation==="entrants"){if(!t.length)[...i.children].forEach(u=>s(i).entrants.push(u));else if(t.every(u=>u.type==="selector")){let[u,f]=t.reduce(([c,y],v)=>v.kind==="xpath"?[c,y.concat(v)]:[c.concat(v),y],[[],[]]),d=[];e.subtree?(u.length&&d.push(...i.querySelectorAll(u.join(","))),f.length&&d.push(...mt(this.window,i,f))):(u.length&&d.push(...[...i.children].filter(c=>c.matches(u))),f.length&&d.push(...mt(this.window,i,f,!1))),d.forEach(c=>s(c.parentNode||i).entrants.push(c))}}if(!r)return o;let l={disconnected:!1},a=r&&e.lifecycleSignals&&this.createSignalGenerator();for(let[,u]of o){if(l.disconnected)break;let f=a?.generate()||{};r(u,f,i)}if(e.live){a&&(e={...e,signalGenerator:a});let u=this.observe(t,r,e);return this.disconnectables(e.signal,l,u)}return this.disconnectables(e.signal,l,a)}children(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!1})}subtree(t,r=void 0,e={}){return[t,r=void 0,e={}]=this.resolveArgs(arguments),this.query(t,r,{...e,subtree:!0})}observe(t,r,e={}){if([t,r,e={}]=this.resolveArgs(arguments),["sync","intercept"].includes(e.timing))return this.observeSync(t,r,e);if(e.timing&&e.timing!=="async")throw new Error(`Timing option "${e.timing}" invalid.`);let{context:i,window:o,webqit:s,document:l}=this;e.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(l.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&zt.call(o,"sync",()=>{});let a=new o.MutationObserver(d=>d.forEach(c=>{St.call(o,f,Gt.call(o,c),i)}));a.observe(i,{childList:!0,subtree:e.subtree&&!0});let u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:i,spec:t,callback:r,params:e,signalGenerator:u,disconnectable:a};if(e.staticSensitivity){let d=Bt.call(o,f);return this.disconnectables(e.signal,a,u,d)}return this.disconnectables(e.signal,a,u)}observeSync(t,r,e={}){[t,r,e={}]=this.resolveArgs(arguments);let{context:i,window:o}=this;if(e.timing&&!["sync","intercept"].includes(e.timing))throw new Error(`Timing option "${e.timing}" invalid.`);let s=e.timing==="intercept"?"intercept":"sync";this.registry(s).size||zt.call(o,s,c=>{this.forEachMatchingContext(s,c,St)});let l=new o.MutationObserver(c=>c.forEach(y=>{Array.isArray((y=Gt.call(o,y)).event)||St.call(o,f,y,i)}));l.observe(i,{childList:!0,subtree:e.subtree&&!0});let a={disconnect(){d.delete(f),l.disconnect()}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),f={context:i,spec:t,callback:r,params:e,signalGenerator:u,disconnectable:a},d=this.registry(s);if(d.set(f,!!f.params.deferred),e.staticSensitivity){let c=Bt.call(o,f);return this.disconnectables(e.signal,a,u,c)}return this.disconnectables(e.signal,a,u)}track(t,r,e={}){return e={subtree:!0,...e},this.observe(t,i=>{i.entrants.length&&r(!0,Array.isArray(t)?i.entrants:i.entrants[0]),i.exits.length&&r(!1,Array.isArray(t)?i.exits:i.exits[0])},e)}};function Bt(n){let t=this,{context:r,spec:e,callback:i,params:o,signalGenerator:s}=n,l=e.filter(y=>y.kind==="css"),a=y=>y.match(/\.([\w-]+)/g)?.length?["class"]:[],u=y=>y.match(/#([\w-]+)/g)?.length?["id"]:[],f=y=>[...y.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(v=>v[1]).concat(a(y)).concat(u(y));if(!(n.$attrs=Array.from(new Set(l.filter(y=>(y+"").includes("[")).reduce((y,v)=>y.concat(f(v+"")),[])))).length)return;let d=new Set,c=new Set;return d.push=y=>(c.delete(y),d.add(y)),c.push=y=>(d.delete(y),c.add(y)),n.$deliveryCache={entrants:d,exits:c},new B(r,t).observe(n.$attrs,y=>{let v=new Map,P=x=>(v.has(x)||v.set(x,{target:x,entrants:[],exits:[],type:"static",event:null}),v.get(x)),L=new WeakMap,g=x=>(L.has(x)||L.set(x,l.some(S=>x.matches(S+""))),L.get(x));for(let x of y)["entrants","exits"].forEach(S=>{o.generation&&S!==o.generation||n.$deliveryCache[S].has(x.target)||(S==="entrants"?!g(x.target):g(x.target))||(n.$deliveryCache[S].push(x.target),P(x.target)[S].push(x.target),P(x.target).event=x.event)});for(let[,x]of v){let S=s?.generate()||{};i(x,S,r)}},{subtree:o.subtree,timing:o.timing,eventDetails:o.eventDetails})}function St(n,t){let{context:r,spec:e,callback:i,params:o,signalGenerator:s,$deliveryCache:l}=n,a={...t,entrants:[],exits:[]};if(o.eventDetails||delete a.event,["entrants","exits"].forEach(f=>{if(!(o.generation&&f!==o.generation)&&(e.length?a[f]=ve.call(this,e,o.subtree==="cross-roots",t[f],t.event!=="parse"):a[f]=[...t[f]],!!l))for(let d of a[f])l[f].push(d)}),!a.entrants.length&&!a.exits.length)return;let u=s?.generate()||{};i(a,u,r)}function ve(n,t,r,e){r=Array.isArray(r)?r:[...r];let i=(o,s)=>{if(s.type==="selector"){let l=s.isXpathAttr?[]:o.filter(a=>s.kind==="xpath"?Ht(this,a,s+""):a.matches&&a.matches(s+""));if((e||s.isXpathAttr)&&(l=o.reduce((a,u)=>s.kind==="xpath"?[...a,...mt(this,u,s,e)]:u.querySelectorAll?[...a,...u.querySelectorAll(s+"")]:a,l)),l.length)return l}else if(o.includes(s.content)||e&&o.some(l=>nt(this,l,s.content,t)))return[s.content]};return r.$$searchCache||(r.$$searchCache=new Map),n.reduce((o,s)=>{let l;return r.$$searchCache.has(s.content)?l=r.$$searchCache.get(s.content):(l=i(r,s)||[],s.type==="instance"&&r.$$searchCache.set(s.content,l)),o.concat(l)},[])}function Gt({target:n,addedNodes:t,removedNodes:r}){let e=this,i;return i=D(t).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),null),i=D(r).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),i),i=i||e.document.readyState==="loading"&&"parse"||"mutation",{target:n,entrants:t,exits:r,type:"observation",event:i}}function zt(n,t){let r=this,{webqit:e,document:i,Node:o,CharacterData:s,Element:l,HTMLElement:a,HTMLTemplateElement:u,DocumentFragment:f}=r;e.realdom.domInterceptionHooks||Object.defineProperty(e.realdom,"domInterceptionHooks",{value:new Map}),e.realdom.domInterceptionNoRecurse||Object.defineProperty(e.realdom,"domInterceptionNoRecurse",{value:new Map}),e.realdom.domInterceptionHooks.has(n)||e.realdom.domInterceptionHooks.set(n,new Set),e.realdom.domInterceptionHooks.get(n).add(t);let d=()=>e.realdom.domInterceptionHooks.get(n).delete(t);if(e.realdom.domInterceptionHooks?.intercepting)return d;console.warn("DOM mutation APIs are now being intercepted."),e.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"domInterceptionRecords",{value:new Map});let c=(g,x,S)=>{e.realdom.domInterceptionNoRecurse.set(g,x);let _=S();return e.realdom.domInterceptionNoRecurse.delete(g),_},y=(g,x)=>{g.entrants.concat(g.exits).forEach(_=>{clearTimeout(e.realdom.domInterceptionRecords.get(_)?.timeout),e.realdom.domInterceptionRecords.set(_,g.event);let m=setTimeout(()=>{e.realdom.domInterceptionRecords.delete(_)},0);Object.defineProperty(g.event,"timeout",{value:m,configurable:!0})}),e.realdom.domInterceptionHooks.get("intercept")?.forEach(_=>_(g));let S=x();return e.realdom.domInterceptionHooks.get("sync")?.forEach(_=>_(g)),S},v={ShadowRoot:["innerHTML","setHTMLUnsafe"],DocumentFragment:["replaceChildren","append","prepend"],Document:["replaceChildren","append","prepend"],HTMLElement:["outerText","innerText"],Element:["append","prepend","before","after","insertAdjacentElement","insertAdjacentHTML","remove","replaceChildren","replaceWith","setHTMLUnsafe","innerHTML","outerHTML"],CharacterData:["before","after","remove","replaceWith"],Node:["insertBefore","replaceChild","removeChild","appendChild","textContent","nodeValue"]},P={ShadowRoot:Object.create(null),DocumentFragment:Object.create(null),Document:Object.create(null),HTMLElement:Object.create(null),Element:Object.create(null),CharacterData:Object.create(null),Node:Object.create(null)};return new Set(Object.values(v).reduce((g,x)=>g.concat(x),[])).forEach(g=>{Object.keys(v).forEach(_=>{if(!v[_].includes(g))return;let m=Object.getOwnPropertyDescriptor(r[_].prototype,g);!m||(Object.defineProperty(r[_].prototype,g,"value"in m?{...m,value:x}:{...m,set:S}),P[_][g]=m)});function x(..._){let m=Object.keys(P).find(j=>this instanceof r[j]&&g in P[j]),h=P[m],p=()=>h[g].value.call(this,..._);if(e.realdom.domInterceptionNoRecurse.get(this)===g)return p();let b=[],w=[],A=this;["insertBefore"].includes(g)?w=[_[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(g)?(w=[_[1]],["beforebegin","afterend"].includes(_[0])&&(A=this.parentNode)):["setHTMLUnsafe","replaceChildren"].includes(g)?(b=[...this.childNodes],w=g==="replaceChildren"?[..._]:[_[0]]):["replaceWith","remove"].includes(g)?(b=[this],w=g==="replaceWith"?[..._]:[],A=this.parentNode):["replaceChild"].includes(g)?(b=[_[1]],w=[_[0]]):["removeChild"].includes(g)?b=[..._]:(w=[..._],["before","after"].includes(g)&&(A=this.parentNode));let T=g;if(["insertAdjacentHTML","setHTMLUnsafe"].includes(g)){let j=this.nodeName;if(g==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(_[0])){if(!this.parentNode)return h[g].value.call(this,..._);j=this.parentNode.nodeName}let M=i.createElement(j.includes("-")?"div":j);h.setHTMLUnsafe.value.call(M,w[0],g==="setHTMLUnsafe"?_[1]:{}),w=[...M.childNodes],g==="insertAdjacentHTML"?(T="insertAdjacentElement",_[1]=new f,c(_[1],"append",()=>_[1].append(...M.childNodes))):(T="replaceChildren",_=[...M.childNodes])}return y({target:A,entrants:w,exits:b,type:"interception",event:[this,g]},()=>h[T].value.call(this,..._))}function S(_){let m=Object.keys(P).find(I=>this instanceof r[I]&&g in P[I]),h=P[m],p=()=>h[g].set.call(this,_);if(this instanceof HTMLScriptElement||e.realdom.domInterceptionNoRecurse.get(this)===g)return p();let b=[],w=[],A=this;if(["outerHTML","outerText"].includes(g)?(b=[this],A=this.parentNode):this instanceof u?(A=this.content,b=[...this.content.childNodes]):b=[...this.childNodes],["outerHTML","innerHTML"].includes(g)){let I=this.nodeName;if(g==="outerHTML"){if(!this.parentNode)return p();I=this.parentNode.nodeName}let j=i.createElement(I.includes("-")?"div":I);if(c(j,g,()=>j[g]=_),w=this instanceof u?[...j.content.childNodes]:[...j.childNodes],this instanceof u&&this.hasAttribute("src")||this instanceof ShadowRoot){let M=z=>z.reduce((F,W)=>W instanceof HTMLScriptElement?F.concat(W):W instanceof u?F.concat(M([W.content])):(F=F.concat(M([...W.querySelectorAll?.("template")||[]].map(oe=>oe.content))),F.concat(...W.querySelectorAll?.("script")||[])),[]);for(let z of M(w)){if(this instanceof ShadowRoot){z.setAttribute("data-handling","manual");continue}let F=i.createElement("script");[...z.attributes].forEach(W=>F.setAttribute(W.name,W.value)),F.textContent=z.textContent,c(z,"replaceWith",()=>z.replaceWith(F))}}g==="outerHTML"?(_=new f,c(_,"append",()=>_.append(...w)),p=()=>c(this,"replaceWith",()=>l.prototype.replaceWith.call(this,_))):this instanceof u?p=()=>c(this.content,"replaceChildren",()=>this.content.replaceChildren(...w)):p=()=>c(this,"replaceChildren",()=>l.prototype.replaceChildren.call(this,...w))}return y({target:A,entrants:w,exits:b,type:"interception",event:[this,g]},p)}}),d}function Xt(){Ae.call(this),Se.call(this),Ee.call(this)}function Ae(){let n=this;n.CSS||(n.CSS={}),n.CSS.escape||(n.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function Se(){let n=this;"isConnected"in n.Node.prototype||Object.defineProperty(n.Node.prototype,"isConnected",{get:function(){return!this.ownerDocument||!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}function Ee(){let n=this;n.Element.prototype.matches||(n.Element.prototype.matches=n.Element.prototype.matchesSelector||n.Element.prototype.mozMatchesSelector||n.Element.prototype.msMatchesSelector||n.Element.prototype.oMatchesSelector||n.Element.prototype.webkitMatchesSelector||function(t){for(var r=(this.document||this.ownerDocument).querySelectorAll(t),e=r.length;--e>=0&&r.item(e)!==this;);return e>-1})}function Qt(){let n=this;if(n.webqit||(n.webqit={}),n.webqit.realdom)return n.webqit.realdom;n.webqit.realdom={},Xt.call(n),n.webqit.realdom.meta=(...r)=>Ce.call(n,...r),n.webqit.realdom.ready=(...r)=>Et.call(n,...r),n.webqit.realdom.realtime=(r,e="dom")=>{if(e==="dom")return new it(r,n);if(e==="attr")return new B(r,n)};let t=new rt(n);return n.webqit.realdom.schedule=(r,...e)=>t[`on${r}`](...e),n.webqit.realdom.synthesizeWhile=(...r)=>t.synthesizeWhile(...r),n.webqit.realdom}function Et(...n){let t="interactive",r;J(n[0])?(t=n[0],E(n[1])&&(r=n[1])):E(n[0])&&(r=n[0]);let e={interactive:["interactive","complete"],complete:["complete"]};if(!e[t])throw new Error(`Invalid ready-state timing: ${t}.`);let i=this;if(!r)return i.webqit.realdom.readyStatePromises||(i.webqit.realdom.readyStatePromises={interactive:new Promise(o=>Et.call(this,"interactive",o)),complete:new Promise(o=>Et.call(this,"complete",o))}),i.webqit.realdom.readyStatePromises[t];if(e[t].includes(i.document.readyState))return r(i);i.webqit.realdom.readyStateCallbacks||(i.webqit.realdom.readyStateCallbacks={interactive:[],complete:[]},i.document.addEventListener("readystatechange",()=>{let o=i.document.readyState;for(let s of i.webqit.realdom.readyStateCallbacks[o].splice(0))s(i)},!1)),i.webqit.realdom.readyStateCallbacks[t].push(r)}function Ce(n){let t=this,r={},e;return(e=t.document.querySelector(`meta[name="${n}"]`))&&(r=(e.content||"").split(";").filter(i=>i).reduce((i,o)=>{let s=o.split("=").map(l=>l.trim());return Ot(i,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:N(s[1])?parseInt(s[1]):s[1]),i},{})),{get name(){return n},get content(){return e.content},json(){return JSON.parse(JSON.stringify(r))}}}function pt(n,t){return typeof n!="string"?n:n.replace(/\w\S*/g,function(r){return r.charAt(0).toUpperCase()+(typeof t!==void 0&&t?r.substr(1).toLowerCase():r.substr(1))})}var C=(n,...t)=>H(n,"oohtml",...t),R={};function Yt(n,t,r){let e=this,i=Qt.call(e);R.window=e,e.webqitConfig||(e.webqitConfig=i.meta("webqit").json()),e.webqit||(e.webqit={}),e.webqit.oohtml||(e.webqit.oohtml={}),e.webqit.oohtml.configs||(e.webqit.oohtml.configs={});let o=n.toUpperCase().replace("-","_");if(!e.webqit.oohtml.configs[o]){e.webqit.oohtml.configs[o]={};let s=e.webqit.oohtml.configs[o];tt(2,s,r,t,i.meta(n).json()),e.webqitConfig.prefix&&Object.keys(s).forEach(l=>{Object.keys(s[l]).forEach(a=>{l==="api"&&typeof s[l][a]=="string"?s[l][a]=`${e.webqitConfig.prefix}${pt(s[l][a])}`:["attr","elements"].includes(l)&&s[l][a]?.startsWith("data-")===!1&&(s[l][a]=`${e.webqitConfig.prefix}-${s[l][a]}`)})})}return{config:e.webqit.oohtml.configs[o],realdom:i,window:e}}function Tt(n,t){return C(n,"internalAttrInteractions").get(t)}function Zt(n,t,r){let e=C(n,"internalAttrInteractions").get(t);C(n,"internalAttrInteractions").set(t,!0);let i=r();return C(n,"internalAttrInteractions").set(t,e),i}function Kt(n,t){return[...n].reduce(([r,e,i],o)=>!r&&e===0&&(Array.isArray(t)?t:[t]).includes(o)?[r,e,[""].concat(i)]:(!r&&["(","[","{"].includes(o)&&!i[0].endsWith("\\")&&e++,!r&&[")","]","}"].includes(o)&&!i[0].endsWith("\\")&&e--,['"',"'","`"].includes(o)&&!i[0].endsWith("\\")&&(r=r===o?null:r||o),i[0]+=o,[r,e,i]),[null,0,[""]])[2].reverse()}var qe=()=>(0|Math.random()*9e6).toString(36),Ct=new Map;function te(n){let t;return(t=Ct.get(n))||(t=qe(),Ct.set(n,t)),t}function ee(n){let t;return Ct.forEach((r,e)=>{r===n&&(t=e)}),t}function re(){let{window:n}=R,{webqit:t}=n;if(t.DOMContextRequestEvent)return t.DOMContextRequestEvent;class r extends n.Event{constructor(...i){let o=i.pop();if(typeof o!="function")throw new Error("Callback must be provided.");let s=i.pop();if(!s?.kind)throw new Error('"options.kind" must be specified.');let l=["contextrequest","contextclaim"],a=i.pop()||l[0];if(!l.includes(a))throw new Error(`Invalid event type. Must be one of: ${l.join(",")}`);let{kind:u,detail:f,targetContext:d,live:c,signal:y,diff:v,...P}=s;super(a,{...P,bubbles:P.bubbles!==!1}),Object.defineProperty(this,"callback",{get:()=>o}),Object.defineProperty(this,"kind",{get:()=>u}),Object.defineProperty(this,"targetContext",{get:()=>d}),Object.defineProperty(this,"detail",{get:()=>f}),Object.defineProperty(this,"live",{get:()=>c}),Object.defineProperty(this,"signal",{get:()=>y}),Object.defineProperty(this,"diff",{get:()=>v}),Object.defineProperty(this,"options",{get:()=>P}),Object.defineProperty(this,"meta",{value:{}})}get target(){return super.target||this.meta.target}get answered(){return this.meta.answered||!1}respondWith(i){if(this.meta.answered=!0,this.diff){if("_prevValue"in this&&this._prevValue===i)return;Object.defineProperty(this,"_prevValue",{value:i,configurable:!0})}return this.callback(i)}}return t.DOMContextRequestEvent=r,r}var ot=class extends AbortController{constructor(t){super(),t(r=>{let{window:{webqit:{Observer:e}}}=R;e.defineProperty(this,"value",{value:r,configurable:!0,enumerable:!0})},this)}};var st=class extends Error{};var lt=class{static instance(t){return C(t).get("contexts::instance")||new this(t)}constructor(t){C(t).get("contexts::instance")?.dispose(),C(t).set("contexts::instance",this);let r={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>r})}[Symbol.iterator](){return this["#"].contexts[Symbol.iterator]()}get length(){return this["#"].contexts.size}find(...t){return[...this["#"].contexts].find(r=>typeof t[0]=="function"?t[0](r):r.constructor.kind===t[0]&&(!t[1]||r.detail===t[1]))}attach(t){if(!(t instanceof G))throw new TypeError("Context is not a valid DOMContext instance.");if(this.find(t.constructor.kind,t.detail))throw new st(`Context of same kind "${t.constructor.kind}"${t.detail?` and detail "${t.detail}"`:""} already exists.`);this["#"].contexts.add(t),t.initialize(this["#"].host)}detach(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(...t){return new ot((r,e)=>{typeof t[t.length-1]!="function"&&(t[t.length-1]?t.push(r):t[t.length-1]=r);let i;(i=t.find(s=>typeof s=="object"&&s))&&i.live&&(i.signal&&i.signal.addEventListener("abort",()=>e.abort()),t[t.indexOf(i)]={...i,signal:e.signal});let o=new(re())(...t);this["#"].host.dispatchEvent(o)})}};var Pt=class{static createRequest(){return{kind:this.kind}}constructor(t=null){Object.defineProperty(this,"detail",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get configs(){let{window:{webqit:{oohtml:{configs:t}}}}=R;return t}get name(){return[R.window.Document,R.window.ShadowRoot].some(t=>this.host instanceof t)?1/0:this.host.getAttribute(this.configs.CONTEXT_API.attr.contextname)}subscribed(t){}handle(t){}unsubscribed(t){}matchEvent(t){return t.kind===this.constructor.kind&&(!t.targetContext||t.targetContext===this.name)}handleEvent(t){if(!(this.disposed||typeof t.respondWith!="function")){if(t.type==="contextclaim"){if(!(t.detail instanceof Pt)||t.target===this.host)return;let r=new Set;if(this.subscriptions.forEach(e=>{!t.target.contains(e.target)||!t.detail.matchEvent(e)||(this.subscriptions.delete(e),this.unsubscribed(e),r.add(e))}),r.size)return t.respondWith(r)}if(t.type==="contextrequest")return this.matchEvent(t)?(t.live&&(this.subscriptions.add(t),this.subscribed(t),t.signal?.addEventListener("abort",()=>{this.subscriptions.delete(t),this.unsubscribed(t)})),t.stopPropagation(),this.handle(t)):void 0}}initialize(t){this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this);let{value:r}=lt.instance(t).request("contextclaim",{kind:this.constructor.kind,detail:this});return r?.forEach(e=>{this.subscriptions.add(e),this.subscribed(e),this.handle(e)}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(r=>{this.subscriptions.delete(r),this.unsubscribed(r);let{target:e}=r;r.meta.answered=!1,e.dispatchEvent(r)}),this}},G=Pt;ft(G,"kind");var Y=class extends G{static createRequest(t=null){let r=super.createRequest();if(t?.startsWith("@")){let[e,...i]=i.slice(1).split("/").map(o=>o.trim());r.targetContext=e,r.detail=i.join("/")}else r.detail=t;return r}get namespaceObj(){return this.host[this.configs.NAMESPACED_HTML.api.namespace]}handle(t){let{window:{webqit:{Observer:r}}}=R;if(t.meta.controller?.abort(),!(t.detail||"").trim())return t.respondWith(r.unproxy(this.namespaceObj));let e=(t.detail||"").split("/").map(i=>i.trim()).filter(i=>i);if(!e.length)return t.respondWith();e=e.join(`/${this.configs.NAMESPACED_HTML.api.namespace}/`)?.split("/")||[],t.meta.controller=r.reduce(this.namespaceObj,e,r.get,i=>{this.disposed||t.respondWith(i.value)},{live:t.live,signal:t.signal,descripted:!0})}unsubscribed(t){t.meta.controller?.abort()}};ft(Y,"kind","namespace");function qt(n={}){let{config:t,window:r}=Yt.call(this,"namespaced-html",n,{attr:{namespace:"namespace",lid:"id"},api:{namespace:"namespace"},tokens:{lidrefPrefix:"~",lidrefSeparator:":"},target:{className:":target",eventName:":target",scrolling:!0}});t.lidSelector=`[${r.CSS.escape(t.attr.lid)}]`,t.namespaceSelector=`[${r.CSS.escape(t.attr.namespace)}]`,r.webqit.DOMNamingContext=Y,je.call(r,t),Me.call(r,t)}function ie(n){let{lidrefPrefix:t,lidrefSeparator:r}=n.tokens;return{escape(e,i=1){return[...e].map(o=>/\w/.test(o)?o:i===2?`\\\\${o}`:`\\${o}`).join("")},lidrefPrefix(e=0){return e?this.escape(t,e):t},lidrefSeparator(e=0){return e?this.escape(r,e):r},isUuid(e,i=0){return e.startsWith(this.lidrefPrefix(i))&&e.includes(this.lidrefSeparator(i))},toUuid(e,i,o=0){return e.endsWith("-root")?i:`${this.lidrefPrefix(o)}${e}${this.lidrefSeparator(o)}${i}`},uuidToId(e,i=0){return this.isUuid(e)?e.split(this.lidrefSeparator(i))[1]:e},uuidToLidref(e,i=0){return this.isUuid(e)?`${this.lidrefPrefix(i)}${e.split(this.lidrefSeparator(i))[1]}`:e}}}function Ie(n,t,r=null,e=0){let i=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:o}}}}=i,s=ie(o),l=new RegExp(`${r?":scope|":""}#(${s.lidrefPrefix(e+1)})?([\\w]+${s.lidrefSeparator(e+1)})?((?:[\\w-]|\\\\.)+)`,"g"),[a,u]=Kt(n,",").reduce(([d,c],y)=>{let v,P;return y=y.replace(l,(L,g,x,S,_)=>{if(v||(v=[...y.matchAll(/(["'])(?:(?=(\\?))\2.)*?\1/g)]),v.some(b=>_>b.index&&_+L.length<b.index+b[0].length))return L;if(L===":scope")return P=!0,r;let m=g&&!x;if(g&&x)return`#${s.escape(L.replace("#",""),1)}`;if(m&&o.attr.lid==="id"&&t&&!t.endsWith("-root"))return`#${s.toUuid(t,S,1)}`;let p;return o.attr.lid==="id"?p=`:is(#${S},[id^="${s.lidrefPrefix(e)}"][id$="${s.lidrefSeparator(e)}${S}"])`:p=`:is(#${S},[${i.CSS.escape(o.attr.lid)}="${S}"])`,m?`:is(${p}):not(${r?r+" ":""}${o.namespaceSelector} *)`:p}),P?[d,c.concat(y)]:[d.concat(y),c]},[[],[]]),f;return r&&a.length?f=[a.length>1?`${r} :is(${a.join(", ")})`:`${r} ${a[0]}`,u.join(", ")].filter(d=>d).join(", "):f=[...a,...u].join(", "),f}function gt(n){let t=this;if(!C(n).has("namespace")){let r=Object.create(null);C(n).set("namespace",r);let e=[t.Document,t.ShadowRoot].some(i=>n instanceof i);Object.defineProperty(r,Symbol.toStringTag,{get(){return e?"RootNamespaceRegistry":"NamespaceRegistry"}})}return C(n).get("namespace")}function ht(n,t=!1){let r=this,{webqit:{oohtml:{configs:{NAMESPACED_HTML:e}}}}=r,i=[r.Document,r.ShadowRoot].some(o=>n instanceof o);return gt.call(r,i?n:(t?n.parentNode:n)?.closest?.(e.namespaceSelector)||n.getRootNode())}function ne(n){let t=Object.prototype.toString.call(n)==="[object RootNamespaceRegistry]";return(ee(n)||te(n))+(t?"-root":"")}function je(n){let t=this,{webqit:{Observer:r}}=t;[t.Document.prototype,t.Element.prototype,t.ShadowRoot.prototype].forEach(e=>{let i=e===t.Document.prototype?"Document":e===t.ShadowRoot.prototype?"ShadowRoot":"Element";if(n.api.namespace in e)throw new Error(`The ${i} prototype already has a "${n.api.namespace}" API!`);Object.defineProperty(e,n.api.namespace,{get:function(){return r.proxy(gt.call(t,this))}})})}function Me(n){let t=this,{webqit:{Observer:r,realdom:e,oohtml:{configs:i},DOMNamingContext:o}}=t,s=["aria-owns","aria-controls","aria-labelledby","aria-describedby","aria-flowto"],l=["for","list","form","aria-activedescendant","aria-details","aria-errormessage"],a=[n.attr.lid,...s,...l],u={id:"id",for:"htmlFor","aria-owns":"ariaOwns","aria-controls":"ariaControls","aria-labelledby":"ariaLabelledBy","aria-describedby":"ariaDescribedBy","aria-flowto":"ariaFlowto","aria-activedescendant":"ariaActiveDescendant","aria-details":"ariaDetails","aria-errormessage":"ariaErrorMessage"},f=ie(n),d=(m,h,p)=>{if(!Tt(m,h)&&C(m,"attrOriginals").has(h))return C(m,"attrOriginals").get(h);let b=p();return Tt(m,h)?b:b&&b.split(" ").map(w=>(w=w.trim())&&(h===n.attr.lid?f.uuidToId:f.uuidToLidref).call(f,w)).join(" ")},c=Object.getOwnPropertyDescriptor(t.Document.prototype,"getElementById");Object.defineProperty(t.Document.prototype,"getElementById",{...c,value(m){return this.querySelector(`#${m}`)}});for(let m of["querySelector","querySelectorAll"])for(nodeApi of[t.Document,t.Element]){let h=Object.getOwnPropertyDescriptor(nodeApi.prototype,m);Object.defineProperty(nodeApi.prototype,m,{...h,value(p){return h.value.call(this,Ie.call(t,p,ne(gt.call(t,this))))}})}let y=Object.getOwnPropertyDescriptor(t.Element.prototype,"getAttribute");Object.defineProperty(t.Element.prototype,"getAttribute",{...y,value(m){let h=()=>y.value.call(this,m);return a.includes(m)&&!C(this,"lock").get(m)?d(this,m,h):h()}});let v=Object.getOwnPropertyDescriptor(t.Attr.prototype,"value");Object.defineProperty(t.Attr.prototype,"value",{...v,get(){let m=()=>v.get.call(this);return a.includes(this.name)?d(this.ownerElement,this.name,m):m()}});let P=Object.getOwnPropertyDescriptor(t.Node.prototype,"nodeValue");Object.defineProperty(t.Node.prototype,"nodeValue",{...P,get(){let m=()=>P.get.call(this);return this instanceof t.Attr&&a.includes(this.name)?d(this.ownerElement,this.name,m):m()}});for(let m of a){if(!(m in u))continue;let h=m==="for"?[t.HTMLLabelElement,t.HTMLOutputElement]:[t.Element];for(let p of h){let b=Object.getOwnPropertyDescriptor(p.prototype,u[m]);!b||Object.defineProperty(p.prototype,u[m],{...b,get(){return d(this,m,()=>b.get.call(this,m))}})}}n.attr.lid!=="id"&&Object.defineProperty(t.Element.prototype,n.attr.lid,{configurable:!0,enumerable:!0,get(){return this.getAttribute(n.attr.lid)},set(m){return this.setAttribute(n.attr.lid,m)}});let L=(m,h,p,b)=>Zt(m,h,()=>(typeof p=="function"&&(p=p()),b(p))),g=(m,h,p,b=null)=>{L(m,h,p,w=>{let A=h===n.attr.lid,T=b||ht.call(t,m,A),I=ne(T);if(A){let j=f.uuidToId(w);if(r.get(T,j)!==m){let M=f.toUuid(I,j);M!==w&&m.setAttribute("id",M),r.set(T,j,m)}}else{C(m,"attrOriginals").set(h,w);let j=w.split(" ").map(M=>(M=M.trim())&&f.isUuid(M)?M:f.toUuid(I,M)).join(" ");m.setAttribute(h,j),C(T).set("idrefs",C(T).get("idrefs")||new Set),C(T).get("idrefs").add(m)}})},x=(m,h,p,b=null)=>{L(m,h,p,w=>{let A=h===n.attr.lid,T=b||ht.call(t,m,A);if(A){let I=f.uuidToId(w);r.get(T,I)===m&&r.deleteProperty(T,I)}else{let I=C(m,"attrOriginals").get(h);m.hasAttribute(h)&&m.setAttribute(h,I),C(T).get("idrefs")?.delete(m)}})};e.realtime(t.document).query(n.namespaceSelector,m=>{let h=(p,b,w,A)=>{if(!p.hasAttribute(b))return;let T=()=>p.getAttribute(b);x(p,b,T,w),p.isConnected&&g(p,b,C(p,"attrOriginals").get(b)||T,A)};m.exits.forEach(p=>{if(p.isConnected){let A=gt.call(t,p);for(let T of new Set([...Object.values(A),...C(A).get("idrefs")||[]]))for(let I of a)h(T,I,A)}let b=p[i.CONTEXT_API.api.contexts],w=b.find(o.kind);w&&b.detach(w)}),m.entrants.forEach(p=>{let b,w=ht.call(t,p,!0);for(let T of new Set([...Object.values(w),...C(w).get("idrefs")||[]]))if((b=ht.call(t,T,!0))!==w)for(let I of a)h(T,I,w,b);let A=p[i.CONTEXT_API.api.contexts];A.find(o.kind)||A.attach(new o)})},{id:"namespace-html:namespace",live:!0,subtree:"cross-roots",timing:"sync",staticSensitivity:!0,eventDetails:!0}),e.realtime(t.document).query(`[${a.map(m=>t.CSS.escape(m)).join("],[")}]`,m=>{let h={forID:new Map,forOther:new Map};for(let p of a){let b=p===n.attr.lid?h.forID:h.forOther;m.exits.forEach(w=>{if(!w.hasAttribute(p))return;let A=b.get(w);typeof A>"u"&&(A=(p===n.attr.lid?w.parentNode:w)?.closest?.(n.namespaceSelector)||w.getRootNode().host,b.set(w,A)),!(A&&!A.isConnected)&&x(w,p,()=>w.getAttribute(p))}),m.entrants.forEach(w=>{!w.hasAttribute(p)||g(w,p,()=>w.getAttribute(p))})}h.forID.clear(),h.forOther.clear()},{id:"namespace-html:attrs",live:!0,subtree:"cross-roots",timing:"sync"}),e.realtime(t.document,"attr").observe(a,m=>{for(let h of m)h.oldValue&&x(h.target,h.name,h.oldValue),h.value&&g(h.target,h.name,h.value)},{id:"namespace-html:attr(attrs)",subtree:"cross-roots",timing:"sync",newValue:!0,oldValue:!0});let S,_=()=>{if(!t.location.hash?.startsWith(`#${f.lidrefPrefix()}`))return;let m=t.location.hash?.substring(`#${f.lidrefPrefix()}`.length).split("/").map(p=>p.trim()).filter(p=>p)||[],h=m.reduce((p,b)=>p&&p[n.api.namespace][b],t.document);S&&n.target.className&&S.classList.toggle(n.target.className,!1),h&&h!==t.document&&(n.target.className&&h.classList.toggle(n.target.className,!0),n.target.eventName&&h.dispatchEvent(new t.CustomEvent(n.target.eventName)),n.target.scrolling&&m.length>1&&h.scrollIntoView(),S=h)};t.addEventListener("hashchange",_),e.ready(_)}qt.call(window);})();
|
|
2
2
|
//# sourceMappingURL=namespaced-html.js.map
|