@webqit/oohtml 2.1.56 → 2.1.58
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/README.md +86 -32
- package/dist/html-bindings.js +54 -0
- package/dist/html-bindings.js.map +7 -0
- package/dist/html-bracelets.js +1 -1
- package/dist/html-bracelets.js.map +3 -3
- package/dist/main.js +38 -6
- package/dist/main.js.map +3 -3
- package/dist/scoped-js.js +4 -4
- package/dist/scoped-js.js.map +3 -3
- package/package.json +3 -3
- package/src/html-bindings/index.js +233 -0
- package/src/index.js +3 -3
- package/src/html-bracelets/AttrBracelet.js +0 -122
- package/src/html-bracelets/Bracelet.js +0 -82
- package/src/html-bracelets/HTMLBracelets.js +0 -68
- package/src/html-bracelets/TextBracelet.js +0 -69
- package/src/html-bracelets/index.js +0 -72
- /package/src/{html-bracelets → html-bindings}/targets.browser.js +0 -0
package/README.md
CHANGED
|
@@ -161,18 +161,17 @@ foo.addEventListener('load', loadedCallback);
|
|
|
161
161
|
└ *The HTMLImports API for programmatic module import*:
|
|
162
162
|
|
|
163
163
|
```js
|
|
164
|
-
document.import('/foo#fragment1'
|
|
165
|
-
|
|
166
|
-
});
|
|
164
|
+
const import1 = document.import('/foo#fragment1');
|
|
165
|
+
console.log(import1); // { value: div }
|
|
167
166
|
```
|
|
168
167
|
|
|
169
168
|
```js
|
|
170
|
-
document.import('/foo/nested#fragment2'
|
|
171
|
-
|
|
172
|
-
});
|
|
169
|
+
const import2 = document.import('/foo/nested#fragment2');
|
|
170
|
+
console.log(import2); // { value: div }
|
|
173
171
|
```
|
|
174
172
|
|
|
175
173
|
└ *Scoped templates for object-scoped module system*:
|
|
174
|
+
> With an equivalent `Element.prototype.import()` API for accessing scoped modules
|
|
176
175
|
|
|
177
176
|
```html
|
|
178
177
|
<section> <!-- object with own modules -->
|
|
@@ -191,16 +190,16 @@ document.import('/foo/nested#fragment2', divElement => {
|
|
|
191
190
|
|
|
192
191
|
```js
|
|
193
192
|
// Using the HTMLImports API
|
|
194
|
-
document.querySelector('div')
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
const moduleHost = document.querySelector('div');
|
|
194
|
+
const localImport1 = moduleHost.import('foo#fragment1'); // the local module: foo#fragment1
|
|
195
|
+
console.log(localImport1); // { value: div }
|
|
197
196
|
```
|
|
198
197
|
|
|
199
198
|
```js
|
|
200
199
|
// Using the HTMLImports API
|
|
201
|
-
document.querySelector('div')
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
const moduleHost = document.querySelector('div');
|
|
201
|
+
const globalImport1 = moduleHost.import('/foo#fragment1'); // the global module: foo#fragment1
|
|
202
|
+
console.log(globalImport1); // { value: div }
|
|
204
203
|
```
|
|
205
204
|
|
|
206
205
|
<details><summary>
|
|
@@ -270,6 +269,14 @@ document.import('/foo#fragment1', divElement => {
|
|
|
270
269
|
});
|
|
271
270
|
```
|
|
272
271
|
|
|
272
|
+
```js
|
|
273
|
+
const import1 = document.import('/foo#fragment1', true);
|
|
274
|
+
console.log(import1); // { value: undefined }
|
|
275
|
+
Observer.observe(import1, 'value', divElement => {
|
|
276
|
+
console.log(divElement); // To be received after remote module has been loaded
|
|
277
|
+
});
|
|
278
|
+
```
|
|
279
|
+
|
|
273
280
|
└ *"Imports Contexts" for context-based imports resolution*:
|
|
274
281
|
|
|
275
282
|
```html
|
|
@@ -290,9 +297,9 @@ document.import('/foo#fragment1', divElement => {
|
|
|
290
297
|
|
|
291
298
|
```js
|
|
292
299
|
// Using the HTMLImports API
|
|
293
|
-
document.querySelector('section')
|
|
294
|
-
|
|
295
|
-
|
|
300
|
+
const moduleHost = document.querySelector('section');
|
|
301
|
+
const globalImport2 = moduleHost.import('#fragment2'); // module:/foo/nested#fragment2
|
|
302
|
+
console.log(globalImport2); // { value: div }
|
|
296
303
|
```
|
|
297
304
|
|
|
298
305
|
└ *"Imports Contexts" with named contexts*:
|
|
@@ -314,9 +321,9 @@ document.querySelector('section').import('#fragment2', divElement => {
|
|
|
314
321
|
|
|
315
322
|
```js
|
|
316
323
|
// Using the HTMLImports API
|
|
317
|
-
document.querySelector('div')
|
|
318
|
-
|
|
319
|
-
|
|
324
|
+
const moduleHost = document.querySelector('div');
|
|
325
|
+
const globalImport2 = moduleHost.import('@context1#fragment2'); // module:/foo/nested#fragment2
|
|
326
|
+
console.log(globalImport2); // { value: div }
|
|
320
327
|
```
|
|
321
328
|
|
|
322
329
|
└ *"Imports Contexts" with context inheritance*:
|
|
@@ -356,9 +363,9 @@ document.querySelector('div').import('@context1#fragment2', divElement => {
|
|
|
356
363
|
|
|
357
364
|
```js
|
|
358
365
|
// Using the HTMLImports API
|
|
359
|
-
document.querySelector('div')
|
|
360
|
-
|
|
361
|
-
|
|
366
|
+
const moduleHost = document.querySelector('div');
|
|
367
|
+
const localOrGlobalImport2 = moduleHost.import('#fragment2'); // the local module: foo#fragment2, and if not found, resolves from context to the module: /bar/nested#fragment2
|
|
368
|
+
console.log(localOrGlobalImport2); // { value: div }
|
|
362
369
|
```
|
|
363
370
|
|
|
364
371
|
</details>
|
|
@@ -621,6 +628,7 @@ Here are a few examples in the wide range of use cases these features cover.
|
|
|
621
628
|
+ [Example 2: *Multi-Level Namespacing*](#example-2-multi-level-namespacing)
|
|
622
629
|
+ [Example 3: *Dynamic Shadow DOM*](#example-3-dynamic-shadow-dom)
|
|
623
630
|
+ [Example 4: *List Items*](#example-4-list-items)
|
|
631
|
+
+ [Example 5: *Live List*](#example-4-live-list)
|
|
624
632
|
|
|
625
633
|
### Example 1: *Single Page Application*
|
|
626
634
|
|
|
@@ -829,25 +837,71 @@ The following is a "component" that derives its list items and other reusable sn
|
|
|
829
837
|
```html
|
|
830
838
|
<div namespace>
|
|
831
839
|
|
|
832
|
-
<import ref="other"></import>
|
|
833
840
|
<ul id="list"></ul>
|
|
834
|
-
<import ref="other"></import>
|
|
835
841
|
|
|
836
842
|
<template def="item" scoped>
|
|
837
|
-
<li>
|
|
838
|
-
<a></a>
|
|
839
|
-
</li>
|
|
843
|
+
<li><a>Item</a></li>
|
|
840
844
|
</template>
|
|
841
845
|
|
|
842
|
-
<
|
|
843
|
-
|
|
846
|
+
<script scoped>
|
|
847
|
+
// Import item template
|
|
848
|
+
let itemImport = this.import('item');
|
|
849
|
+
let itemTemplate = itemImport.value;
|
|
850
|
+
|
|
851
|
+
// Iterate
|
|
852
|
+
[ 'Item 1', 'Item 2', 'Item 3' ].forEach(entry => {
|
|
853
|
+
const currentItem = itemTemplate.content.cloneNode(true);
|
|
854
|
+
// Add to DOM
|
|
855
|
+
this.namespace.list.appendChild(currentItem);
|
|
856
|
+
// Render
|
|
857
|
+
currentItem.innerHTML = entry;
|
|
858
|
+
});
|
|
859
|
+
</script>
|
|
860
|
+
|
|
861
|
+
</div>
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
</details>
|
|
865
|
+
|
|
866
|
+
### Example 4: *Live List*
|
|
867
|
+
|
|
868
|
+
The following is the same list as above but implemented as a live list! Here, we make a few changes: the script element is Stateful; the loop itself now uses the literal `for ... of` construct, [which is capable of rendering live lists](https://github.com/webqit/stateful-js/wiki#with-control-structures), so that any additions and removals on the original list is statically reflected!
|
|
869
|
+
|
|
870
|
+
<details><summary>Code</summary>
|
|
871
|
+
|
|
872
|
+
```html
|
|
873
|
+
<div namespace>
|
|
874
|
+
|
|
875
|
+
<ul id="list"></ul>
|
|
876
|
+
|
|
877
|
+
<template def="item" scoped>
|
|
878
|
+
<li><a>Item</a></li>
|
|
844
879
|
</template>
|
|
845
880
|
|
|
846
881
|
<script scoped>
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
882
|
+
// Import item template
|
|
883
|
+
let itemImport = this.import('item');
|
|
884
|
+
let itemTemplate = itemImport.value;
|
|
885
|
+
|
|
886
|
+
// Iterate
|
|
887
|
+
let items = [ 'Item 1', 'Item 2', 'Item 3' ];
|
|
888
|
+
for (let entry of items) {
|
|
889
|
+
const currentItem = itemTemplate.content.cloneNode(true);
|
|
890
|
+
// Add to DOM
|
|
891
|
+
this.namespace.list.appendChild(currentItem);
|
|
892
|
+
// Remove from DOM whenever corresponding entry is removed
|
|
893
|
+
if (typeof entry === 'undefined') {
|
|
894
|
+
currentItem.remove();
|
|
895
|
+
continue;
|
|
896
|
+
}
|
|
897
|
+
// Render
|
|
898
|
+
currentItem.innerHTML = entry;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// Add a new entry
|
|
902
|
+
setTimeout(() => items.push('Item 4'), 1000);
|
|
903
|
+
// Remove an new entry
|
|
904
|
+
setTimeout(() => items.pop(), 2000);
|
|
851
905
|
</script>
|
|
852
906
|
|
|
853
907
|
</div>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
(()=>{var me=Object.defineProperty;var Ue=(n,t,r)=>t in n?me(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r;var de=(n,t)=>{for(var r in t)me(n,r,{get:t[r],enumerable:!0})};var D=(n,t,r)=>(Ue(n,typeof t!="symbol"?t+"":t,r),r);var ee={};de(ee,{apply:()=>It,batch:()=>Mt,construct:()=>Yt,defineProperties:()=>lr,defineProperty:()=>bt,deleteProperties:()=>ur,deleteProperty:()=>wt,get:()=>H,getOwnPropertyDescriptor:()=>jt,getOwnPropertyDescriptors:()=>cr,getPrototypeOf:()=>Xt,has:()=>Rt,intercept:()=>sr,isExtensible:()=>Jt,observe:()=>te,ownKeys:()=>yt,path:()=>or,preventExtensions:()=>Zt,read:()=>ar,reduce:()=>Kt,set:()=>Z,setPrototypeOf:()=>Qt});function O(n){return!Array.isArray(n)&&typeof n=="object"&&n}function ot(n){return typeof n}function _(n){return Array.isArray(n)}function Lt(n,t,r=null){return _(t)?n.filter(e=>r?t.filter(i=>r(e,i)).length:t.indexOf(e)!==-1):[]}function z(n,...t){if(globalThis.webqit||(globalThis.webqit={}),globalThis.webqit.refs||Object.defineProperty(globalThis.webqit,"refs",{value:new ut}),!arguments.length)return globalThis.webqit.refs;let r=globalThis.webqit.refs.get(n);r||(r=new ut,globalThis.webqit.refs.set(n,r));let e,i;for(;e=t.shift();)(i=r)&&!(r=r.get(e))&&(r=new ut,i.set(e,r));return r}var ut=class extends Map{constructor(...t){super(...t),this.observers=new Set}set(t,r){let e=super.set(t,r);return this.fire("set",t,r,t),e}delete(t){let r=super.delete(t);return this.fire("delete",t),r}has(t){return this.fire("has",t),super.has(t)}get(t){return this.fire("get",t),super.get(t)}keyNames(){return Array.from(super.keys())}observe(t,r,e){let i={type:t,key:r,callback:e};return this.observers.add(i),()=>this.observers.delete(i)}unobserve(t,r,e){if(Array.isArray(t)||Array.isArray(r))throw new Error('The "type" and "key" arguments can only be strings.');for(let i of this.observers)!(Ct([t,"*"],i.type)&&Ct([r,"*"],i.key)&&i.callback===e)||this.observers.delete(i)}fire(t,r,...e){for(let i of this.observers)!(Ct([t,"*"],i.type)&&Ct([r,"*"],i.key))||i.callback(...e)}},Ct=(n,t)=>Array.isArray(t)?Lt(n,t).length:n.includes(t);function st(n){return typeof n=="function"}function ft(n){return n===null||n===""}function L(n){return arguments.length&&(n===void 0||typeof n>"u")}function E(n){return Array.isArray(n)||typeof n=="object"&&n||st(n)}function Vt(n){return ft(n)||L(n)||n===!1||n===0||E(n)&&!Object.keys(n).length}function $(n){return st(n)||n&&{}.toString.call(n)==="[object function]"}function ht(n){return n instanceof Number||typeof n=="number"}function k(n){return ht(n)||n!==!0&&n!==!1&&n!==null&&n!==""&&!isNaN(n*1)}function ct(n){return n instanceof String||typeof n=="string"&&n!==null}function Ht(n){return!ct(n)&&!L(n.length)}function Tt(n,...t){return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n}function zt(e,t){t=t||Object.prototype,t=t&&!_(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 Wt(n,t){var r=[];return zt(n,t).forEach(e=>{Tt(r,...Object.getOwnPropertyNames(e))}),r}function j(n,t,r=!1,e=!1,i=!1){var o=0,s=n.shift();if((k(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((c,a)=>{!E(c)&&!$(c)||(r?Wt(c):Object.keys(c)).forEach(l=>{if(!!t(l,s,c,a)){var u=s[l],h=c[l];if((_(u)&&_(h)||O(u)&&O(h))&&(o===!0||o>0))s[l]=_(u)&&_(h)?[]:{},j([k(o)?o-1:o,s[l],u,h],t,r,e,i);else if(_(s)&&_(c))e?s[l]=h:s.push(h);else try{i?Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(c,l)):s[l]=c[l]}catch{}}})}),s}function pt(...n){return j(n,(t,r,e)=>!0,!1,!1,!1)}function S(n,t=!0){return _(n)?n:!t&&O(n)?[n]:n!==!1&&n!==0&&Vt(n)?[]:Ht(n)?Array.prototype.slice.call(n):O(n)?Object.values(n):[n]}var P=(...n)=>z("observer-api",...n),at=(n,t)=>n instanceof Promise?n.then(t):t(n),kt={};var Y=class{constructor(t,r){this.registry=t,Object.assign(this,{...r,target:t.target}),this.params.signal&&this.params.signal.addEventListener("abort",()=>this.remove())}remove(){return this.removed=!0,this.registry.removeRegistration(this)}};var mt=class extends Y{constructor(){super(...arguments),this.emit.currentRegistration=this,Object.defineProperty(this,"abortController",{value:new AbortController}),Object.defineProperty(this,"signal",{value:this.abortController.signal}),kt.setMaxListeners?.(0,this.signal)}remove(){this.abortController.abort(),super.remove()}fire(t){if(this.emit.recursionTarget&&!["inject","force-async","force-sync"].includes(this.params.recursions))return;let r=t,e=this.filter;if(e!==1/0&&(e=S(e,!1))&&(r=t.filter(i=>e.includes(i.key))),this.params.diff&&(r=r.filter(i=>i.type!=="set"||i.value!==i.oldValue)),r.length){if(this.emit.recursionTarget&&this.params.recursions!=="force-sync"){this.emit.recursionTarget.push(...r);return}this.emit.recursionTarget=this.params.recursions==="inject"?r:[];let i=this.filter===1/0||Array.isArray(this.filter)?this.emit(r,this):this.emit(r[0],this);return at(i,o=>{let s=this.emit.recursionTarget;return delete this.emit.recursionTarget,this.params.recursions==="force-async"&&s.length?this.emit.currentRegistration.fire(s):o})}}};var Q=class{constructor(t){this.target=t,this.entries=[]}addRegistration(t){return this.entries.push(t),t}removeRegistration(t){this.entries=this.entries.filter(r=>r!==t)}static _getInstance(t,r,e=!0,i=this.__namespace){if(!E(r))throw new Error(`Subject must be of type object; "${ot(r)}" given!`);let o=this;return i&&P("namespaces").has(t+"-"+i)&&(o=P("namespaces").get(t+"-"+i),t+="-"+i),!P(r,"registry").has(t)&&e&&P(r,"registry").set(t,new o(r)),P(r,"registry").get(t)}static _namespace(t,r,e=null){if(t+="-"+r,arguments.length===2)return P("namespaces").get(t);if(!(e.prototype instanceof this))throw new Error(`The implementation of the namespace ${this.name}.${r} must be a subclass of ${this.name}.`);P("namespaces").set(t,e),e.__namespace=r}};var C=class{constructor(t,r){if(this.target=t,!r.operation)throw new Error("Descriptor operation must be given in definition!");Object.assign(this,r)}};var W=class extends Q{static getInstance(t,r=!0,e=null){return super._getInstance("listeners",...arguments)}static namespace(t,r=null){return super._namespace("listeners",...arguments)}constructor(t){super(t),this.batches=[]}addRegistration(t,r,e){return super.addRegistration(new mt(this,{filter:t,emit:r,params:e}))}emit(t,r=!1){if(this.batches.length){this.batches[0].snapshots.push({events:[...t],isPropertyDescriptors:r});return}this.$emit(this.entries,[{events:t,isPropertyDescriptors:r}])}$emit(t,r){let e=t.filter(a=>a.params.withPropertyDescriptors).length,i=r.some(a=>a.isPropertyDescriptors),o=[],s=[],c=t.length;r.forEach(a=>{(e||!i)&&o.push(...a.events),e!==c&&i&&(a.isPropertyDescriptors?s.push(...a.events.map(l=>{let{target:u,type:h,...f}=l,m=new C(u,{type:"set",...f});return Object.defineProperty(m,"value","get"in f.value?{get:()=>f.value.get()}:{value:f.value.value}),f.oldValue&&Object.defineProperty(m,"oldValue","get"in f.oldValue?{get:()=>f.oldValue.get()}:{value:f.oldValue.value}),m})):s.push(...a.events))}),t.forEach(a=>{a.params.withPropertyDescriptors?a.fire(o.length?o:s):a.fire(s.length?s:o)})}batch(t){this.batches.unshift({entries:[...this.entries],snapshots:[]});let r=t();return at(r,e=>{let i=this.batches.shift();return i.snapshots.length&&this.$emit(i.entries,i.snapshots),e})}};var dt=class extends Y{exec(t,r,e){return this.running||!this.traps[t.operation]?r(...Array.prototype.slice.call(arguments,2)):(this.running=!0,this.traps[t.operation](t,e,(...i)=>(this.running=!1,r(...i))))}};var V=class extends Q{static getInstance(t,r=!0,e=null){return super._getInstance("traps",...arguments)}static namespace(t,r=null){return super._namespace("traps",...arguments)}addRegistration(t){return super.addRegistration(new dt(this,t))}emit(t,r=null){let e=this;return function i(o,...s){let c=e.entries[o];return c?c.exec(t,(...a)=>i(o+1,...a),...s):r?r(t,...s):s[0]}(0)}};var Gt={};de(Gt,{accessorize:()=>nr,proxy:()=>ve,unaccessorize:()=>ir,unproxy:()=>gt});function nr(n,t,r={}){n=qt(n);let e=P(n,"accessorizedProps");function i(a){let l,u=n;do l=Object.getOwnPropertyDescriptor(u,a);while(!l&&(u=Object.getPrototypeOf(u)));return l?{proto:u,descriptor:l}:{descriptor:{value:void 0,configurable:!0,enumerable:!0,writable:!0}}}function o(a){if(e.has(a+""))return!0;let l=i(a);l.getValue=function(f=!1){return f?this.descriptor:this.descriptor.get?this.descriptor.get():this.descriptor.value},l.setValue=function(f,m=!1){if(this.dirty=!0,m){this.descriptor=f;return}return this.descriptor.set?this.descriptor.set(f)!==!1:(this.descriptor.value=f,!0)},l.intact=function(){let f=Object.getOwnPropertyDescriptor(n,a);return f?.get===h.get&&f?.set===h.set&&e.get(a+"")===this},l.restore=function(){return this.intact()?(this.proto&&this.proto!==n||!this.proto&&!this.dirty?delete n[a]:Object.defineProperty(n,a,this.descriptor),e.delete(a+""),!0):!1},e.set(isNaN(a)?a:parseInt(a),l);let{enumerable:u=!0}=l.descriptor,h={enumerable:u,configurable:!0};("value"in l.descriptor||l.descriptor.set)&&(h.set=function(f){return Z(this,a,f,r)}),("value"in l.descriptor||l.descriptor.get)&&(h.get=function(){return H(this,a,r)});try{return Object.defineProperty(n,a,h),!0}catch{return e.delete(a+""),!1}}let c=(Array.isArray(t)?t:t===void 0?Object.keys(n):[t]).map(o);return t===void 0||Array.isArray(t)?c:c[0]}function ir(n,t,r={}){n=qt(n);let e=P(n,"accessorizedProps");function i(c){return e.has(c+"")?e.get(c+"").restore():!0}let s=(Array.isArray(t)?t:t===void 0?Object.keys(n):[t]).map(i);return t===void 0||Array.isArray(t)?s:s[0]}function ve(n,t={},r=void 0){let e=qt(n);if(typeof t.membrane=="boolean")throw new Error("The params.membrane parameter cannot be of type boolean.");if(t.membrane&&P(e,"membraneRef").has(t.membrane))return P(e,"membraneRef").get(t.membrane);let i={apply(c,a,l){if(Array.isArray(a)){let u=qt(a);return P(u).set("$length",u.length),Mt(u,()=>It(c,a,l))}return It(c,gt(a),l)},construct:(c,a,l=null)=>Yt(c,a,l,t),defineProperty:(c,a,l)=>bt(c,a,l,t),deleteProperty:(c,a)=>wt(c,a,t),get:(c,a,l=null)=>{let u={...t,receiver:l};Array.isArray(c)&&a==="length"&&P(c).has("$length")&&(u.forceValue=P(c).get("$length"));let h=H(c,a,u);return Array.isArray(c)&&typeof h=="function"?ve(h,{...t,membrane:l}):h},getOwnPropertyDescriptor:(c,a)=>jt(c,a,t),getPrototypeOf:c=>Xt(c,t),has:(c,a)=>Rt(c,a,t),isExtensible:c=>Jt(c,t),ownKeys:c=>yt(c,t),preventExtensions:c=>Zt(c,t),set:(c,a,l,u=null)=>{let h={...t,receiver:u};return Array.isArray(c)&&a==="length"&&(h.forceOldValue=P(c).get("$length"),P(c).set("$length",l)),Z(c,a,l,h)},setPrototypeOf:(c,a)=>Qt(c,a,t)},o=r?.(i)||i,s=new Proxy(e,o);return t.membrane&&P(e,"membraneRef").set(t.membrane,s),P(s).set(s,e),s}function gt(n){return P(n).get(n)||n}function qt(n){if(!n||!E(n))throw new Error("Target must be of type object!");return gt(n)}var xt=class extends Array{};function or(...n){return new xt(...n)}function Kt(n,t,r,e=o=>o,i={}){if(!!t.length)return function o(s,c,a){let l=c[a.level],u=a.level===c.length-1;return s instanceof C&&s.operation!=="get"?a={...a,probe:"always"}:a.probe!=="always"&&(a={...a,probe:!u}),r(s,l,(h,...f)=>{let m=p=>{p instanceof C&&(p.path=[p.key],s instanceof C&&(p.path=s.path.concat(p.key),Object.defineProperty(p,"context",{get:()=>s,configurable:!0})))},y=p=>{let x=R(p,!1);return at(x,g=>{p instanceof C?p.value=g:p=g;let d=f[0]||{};return o(p,c,{...a,...d,level:a.level+1})})};return Nt(l)&&Array.isArray(h)?(h.forEach(m),u?e(h,...f):h.map(y)):(m(h),u?e(h,...f):y(h))},a)}(n,t.slice(0),{...i,level:0})}function te(n,t,r,e={}){if(n=R(n,!e.level),$(arguments[1])&&([,r,e={}]=arguments,t=1/0),!$(r))throw new Error(`Handler must be a function; "${ot(r)}" given!`);if(t instanceof xt)return Kt(n,t,te,r,e);if(e={...e,descripted:!0},delete e.live,!E(n))return e.probe&&H(n,t,r,e);let i=Oe(n,t,r,e);return e.probe?H(n,t,i,e):i()}function sr(n,t,r={}){return n=R(n),O(t)||([,,,r={}]=arguments,t={[arguments[1]]:arguments[2]}),V.getInstance(n,!0,r.namespace).addRegistration({traps:t,params:r})}function jt(n,t,r=i=>i,e={}){return M(n,"getOwnPropertyDescriptor",{key:t},r,e)}function cr(n,t,r=i=>i,e={}){return M(n,"getOwnPropertyDescriptors",{key:t},r,e)}function Xt(n,t=e=>e,r={}){return M(n,"getPrototypeOf",{},t,r)}function Jt(n,t=e=>e,r={}){return M(n,"isExtensible",{},t,r)}function yt(n,t=e=>e,r={}){return M(n,"ownKeys",{},t,r)}function Rt(n,t,r=i=>i,e={}){return M(n,"has",{key:t},r,e)}function H(n,t,r=i=>i,e={}){let i,o=R(n,!e.level);return O(r)?[e,r]=[r,s=>s]:e.live&&(i=!0),t instanceof xt?Kt(o,t,H,r,e):fr(o,t,s=>{let c=[...s];return function a(l,u,h){if(!u.length)return h(l);let f=u.shift();if(!["string","number","symbol"].includes(typeof f))throw new Error(`Property name/key ${f} invalid.`);function m(x,g=void 0){let d=v=>(x.value=v,a([...l,e.live||e.descripted?x:v],u,h));if(arguments.length>1)return d(g);if(!E(o))return d(o?.[x.key]);let b=P(o,"accessorizedProps",!1),A=b&&b.get(x.key);if(A&&A.intact())return d(A.getValue(e.withPropertyDescriptors));if(e.withPropertyDescriptors){let v=Object.getOwnPropertyDescriptor(o,x.key);return"forceValue"in e&&"value"in v&&(v.value=e.forceValue),d(v)}return"forceValue"in e?d(e.forceValue):d(Reflect.get(o,x.key,...e.receiver?[e.receiver]:[]))}let y=new C(o,{type:"get",key:f,value:void 0,operation:"get",related:c});if(!E(o))return m(y);let p=V.getInstance(o,!1,e.namespace);return p?p.emit(y,m):m(y)}([],s.slice(0),a=>{let l=Nt(t)?a:a[0];return i&&E(o)?Oe(o,t,r,e)(l):r(l)})},e)}function Mt(n,t,r={}){return n=R(n),W.getInstance(n,!0,r.namespace).batch(t)}function ar(n,t,r={}){t=R(t),n=R(n);let e=(r.only||[]).slice(0),i=(r.except||[]).slice(0),o=yt(r.spread?[...n]:n).map(l=>isNaN(l)?l:parseInt(l)),s=e.length?e.filter(l=>o.includes(l)):o.filter(l=>!i.includes(l)),c=l=>!Array.isArray(t)||isNaN(l)?l:l-i.filter(u=>u<l).length,a=l=>{let u=jt(n,l,r);"value"in u&&u.writable&&u.enumerable&&u.configurable?Z(t,c(l),u.value,r):(u.enumerable||r.onlyEnumerable===!1)&&bt(t,l,{...u,configurable:!0},r)};return Mt(t,()=>{s.forEach(a)}),te(n,l=>{l.filter(u=>e.length?e.includes(u.key):!i.includes(u.key)).forEach(u=>{if(u.operation==="deleteProperty")return wt(t,c(u.key),r);if(u.operation==="defineProperty"){(u.value.enumerable||r.onlyEnumerable===!1)&&bt(t,c(u.key),{...u.value,configurable:!0},r);return}a(u.key)})},{...r,withPropertyDescriptors:!0})}function Z(n,t,r,e=s=>s,i={},o=!1){let s=R(n),c=[[t,r]];O(t)&&([,,e=l=>l,i={},o=!1]=arguments,c=Object.entries(t)),O(e)&&([o,i,e]=[typeof i=="boolean"?i:o,e,l=>l]);let a=c.map(([l])=>l);return function l(u,h,f){if(!h.length)return f(u);let[m,y]=h.shift();function p(g,d=void 0){let b=X=>(g.status=X,l(u.concat(g),h,f));if(arguments.length>1)return b(g,d);let A=P(s,"accessorizedProps",!1),v=A&&A.get(g.key);return g.operation==="defineProperty"?(v&&!v.restore()&&b(!1),Object.defineProperty(s,g.key,g.value),b(!0)):v&&v.intact()?b(v.setValue(g.value)):b(Reflect.set(s,g.key,g.value))}function x(g,d){if(i.diff&&y===d)return l(u,h,f);let b=new C(s,{type:o?"def":"set",key:m,value:y,isUpdate:g,oldValue:d,related:[...a],operation:o?"defineProperty":"set",detail:i.detail}),A=V.getInstance(s,!1,i.namespace);return A?A.emit(b,p):p(b)}return Rt(s,m,g=>{if(!g)return x(g);let d={...i,withPropertyDescriptors:o};return"forceOldValue"in i&&(d.forceValue=i.forceOldValue),H(s,m,b=>x(g,b),d)},i)}([],c.slice(0),l=>{let u=W.getInstance(s,!1,i.namespace);return u&&u.emit(l,o),e(Nt(t)?l.map(h=>h.status):l[0]?.status)})}function bt(n,t,r,e=o=>o,i={}){return Z(n,t,r,e,i,!0)}function lr(n,t,r=i=>i,e={}){return Z(n,t,r,e,!0)}function wt(n,t,r=i=>i,e={}){n=R(n),O(r)&&([e,r]=[r,s=>s]);let i=S(t,!1),o=[...i];return function s(c,a,l){if(!a.length)return l(c);let u=a.shift();function h(m,y=void 0){let p=d=>(m.status=d,s(c.concat(m),a,l));if(arguments.length>1)return p(m,y);let x=P(n,"accessorizedProps",!1),g=x&&x.get(m.key);return g&&!g.restore()&&p(!1),p(Reflect.deleteProperty(n,m.key))}function f(m){let y=new C(n,{type:"delete",key:u,oldValue:m,related:[...o],operation:"deleteProperty",detail:e.detail}),p=V.getInstance(n,!1,e.namespace);return p?p.emit(y,h):h(y)}return H(n,u,f,e)}([],i.slice(0),s=>{let c=W.getInstance(n,!1,e.namespace);return c&&c.emit(s),r(Nt(t)?s.map(a=>a.status):s[0].status)})}function ur(n,t,r=i=>i,e={}){return wt(...arguments)}function Yt(n,t,r=null,e=o=>o,i={}){return M(n,"construct",arguments.length>2?{argumentsList:t,newTarget:r}:{argumentsList:t},e,i)}function It(n,t,r,e=o=>o,i={}){return M(n,"apply",{thisArgument:t,argumentsList:r},e,i)}function Qt(n,t,r=i=>i,e={}){return M(n,"setPrototypeOf",{proto:t},r,e)}function Zt(n,t=e=>e,r={}){return M(n,"preventExtensions",{},t,r)}function Oe(n,t,r,e={}){let i;e.signal||(i=new AbortController,e={...e,signal:i.signal},kt.setMaxListeners?.(0,i.signal));let o=W.getInstance(n,!0,e.namespace);return function s(c,a=null){a?.remove();let u={signal:o.addRegistration(t,s,e).signal};if(arguments.length){let h=r(c,u);if(arguments.length>1)return h}return i}}function M(n,t,r={},e=o=>o,i={}){n=R(n),O(e)&&([i,e]=[e,a=>a]);function o(a,l){return arguments.length>1?e(l):e((Reflect[t]||Object[t])(n,...Object.values(r)))}let s=new C(n,{operation:t,...r}),c=V.getInstance(n,!1,i.namespace);return c?c.emit(s,o):o(s)}function Nt(n){return n===1/0||Array.isArray(n)}function R(n,t=!0){if((!n||!E(n))&&t)throw new Error(`Object must be of type object or array! "${ot(n)}" given.`);return n instanceof C&&(n=n.value),n&>(n)}function fr(n,t,r,e={}){return t===1/0?e.level&&!E(n)?r([]):yt(n,r,e):r(S(t,!1))}var hr={...ee,...Gt},w=hr;function _t(n,t,r={},e={}){t=S(t).slice();for(var i=n;!L(i)&&!ft(i)&&t.length;){var o=t.shift();if(!(r.get?r.get(i,o):E(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 re(n,t,r,e={},i={}){let o=(u,h,f)=>i.set?i.set(u,h,f):(k(t[c])&&_(u)?u.push(f):u[h]=f,!0);t=S(t);for(var s=n,c=0;c<t.length;c++)if(c<t.length-1){if(!s||!E(s)&&!$(s))return!1;var a=_t(s,t[c],i);if(!E(a)){if(i.buildTree===!1)return!1;a=$(i.buildTree)?i.buildTree(c):k(t[c+1])?[]:{};var l=o(s,t[c],a);if(!l)return!1}s=a}else return o(s,t[c],r)}var vt=class{constructor(t,r=!0){Object.defineProperty(this,"window",{value:t}),Object.defineProperty(this,"readCallbacks",{value:new Set}),Object.defineProperty(this,"writeCallbacks",{value:new Set}),this.async=r,this.window.requestAnimationFrame?this._run():this.async=!1}_run(){this.window.requestAnimationFrame(()=>{for(let t of this.readCallbacks)t(),this.readCallbacks.delete(t);for(let t of this.writeCallbacks)t(),this.writeCallbacks.delete(t);this._run()})}onread(t,r=!1){if(r)return new Promise(e=>{this.async===!1?e(t()):this.readCallbacks.add(()=>{e(t())})});this.async===!1?t():this.readCallbacks.add(t)}onwrite(t,r=!1){if(r)return new Promise(e=>{this.async===!1?e(t()):this.writeCallbacks.add(()=>{e(t())})});this.async===!1?t():this.writeCallbacks.add(t)}cycle(t,r,e){this.onread(()=>{let i=t(e),o=s=>{s!==void 0&&this.onwrite(()=>{let c=r(s,e),a=l=>{l!==void 0&&this.cycle(t,r,l)};c instanceof Promise?c.then(a):a(c)})};i instanceof Promise?i.then(o):o(i)})}};function $e(n){return(n=n.trim())&&n.startsWith("(")&&n.endsWith(")")}function Dt(n,t,r,e=!0){r=(Array.isArray(r)?r:[r]).map(c=>(c+"").replace("(",e?"(.//":"(./")).join("|");let i=n.document.evaluate(r,t,null,XPathResult.ANY_TYPE),o=[],s;for(;s=i.iterateNext();)o.push(s);return o}function Ae(n,t,r){return r=(Array.isArray(r)?r:[r]).map(e=>(e+"").replace("(","(self::")).join("|"),n.document.evaluate(`${r}`,t,null,XPathResult.BOOLEAN_TYPE).booleanValue}function Ee(n,t="|"){return[...n].reduce(([r,e],i)=>i===t&&r===0?[r,[""].concat(e)]:(["(","["].includes(i)&&!e[0].endsWith("\\")&&r++,[")","]"].includes(i)&&!e[0].endsWith("\\")&&r--,e[0]+=i,[r,e]),[0,[""]])[1].reverse()}var q=class{constructor(t){this.content=t,this.type=typeof t=="string"?"selector":"instance",this.kind=this.type==="instance"?null:$e(t)?"xpath":"css",this.kind==="xpath"&&(this.isXpathAttr=Ee(t.trim().slice(1,-1),"@").length>1)}toString(){return this.content}};var K=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($(t[0])?t=[[],...t]:O(t[0])&&!(t[0]instanceof q)&&t.length===1?t=[[],void 0,t[0]]:O(t[1])&&t.length===2?t=[S(t[0],!1),void 0,t[1]]:t[0]=S(t[0],!1),t[0].filter(r=>typeof r!="string"&&!(r instanceof q)&&!(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 q?r:new q(r)),t}registry(...t){return z("realdom.realtime",this.window,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=Array.isArray(r)?r:[r],s=new Set;for(let[c,a]of this.registry(t))for(let[l,u]of a){let h=o.filter(f=>l.contains(f.target)?c==="subtree"||f.target===l:!1);if(!!h.length){Array.isArray(r)||(h=h[0]);for(let f of u)s.add([f,h,l])}}for(let[c,a,l]of s)e.call(i,c,a,l)}disconnectables(t,...r){let e={disconnect(){r.forEach(i=>i&&$(i.disconnect)&&i.disconnect()||$(i)&&i()||O(i)&&(i.disconnected=!0))}};return t&&t.addEventListener("abort",()=>e.disconnect()),e}};var U=class extends K{constructor(t,...r){super(t,"attr",...r)}get(t,r=void 0,e={}){let i=typeof t=="string"||t instanceof q;[t=[],r=void 0,e={}]=this.resolveArgs(arguments);let{context:o}=this,s=ke(o,t);if(!r)return s;let c=e.lifecycleSignals&&this.createSignalGenerator();if(i)for(let a of s){let l=c?.generate()||{};r(a,l,o)}else{let a=c?.generate()||{};r(s,a,o)}if(e.live){c&&(e={...e,signalGenerator:c});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 q;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:c}=this;e.eventDetails&&!c.realdom.attrInterceptionHooks?.intercepting&&Ce.call(s,"intercept",()=>{});let a=new s.MutationObserver(f=>{f=Te(f).map(m=>qe.call(s,m)),Se.call(s,h,f,o)}),l={attributes:!0,attributeOldValue:e.oldValue,subtree:e.subtree};t.length&&(l.attributeFilter=t.map(f=>f+"")),a.observe(o,l);let u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),h={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:a};return this.disconnectables(e.signal,a,u)}observeSync(t,r,e={}){let i=typeof t=="string"||t instanceof q;[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 c=e.timing==="intercept"?"intercept":"sync",a=e.subtree?"subtree":"children";this.registry(c).size||Ce.call(s,c,y=>{this.forEachMatchingContext(c,y,Se)});let l={disconnect(){m.delete(h),m.size||f.delete(o)}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),h={context:o,spec:t,callback:r,params:e,atomics:new Map,originalFilterIsString:i,signalGenerator:u,disconnectable:l},f=this.registry(c,a);f.has(o)||f.set(o,new Set);let m=f.get(o);return m.add(h),this.disconnectables(e.signal,l,u)}};function Te(n){return n.reduce((t,r,e)=>t[e-1]?.attributeName===r.attributeName?t:t.concat(r),[])}function Se(n,t){let{context:r,spec:e,callback:i,params:o,atomics:s,originalFilterIsString:c,signalGenerator:a}=n,l=e.map(f=>f+"");if(o.atomic&&!s.size?t=ke(r,e,t):o.timing!=="async"&&e.length&&(t=t.filter(f=>l.includes(f.name))),!t.length)return;o.newValue===null&&o.oldValue===null&&o.eventDetails||(t=t.map(f=>{let m;return o.eventDetails||({event:m,...f}=f),!o.oldValue&&"oldValue"in f&&({oldValue:m,...f}=f),!o.newValue&&"value"in f?{value:m,...f}=f:o.newValue&&typeof f.value>"u"&&(f={...f,value:f.target.getAttribute(f.name)}),f})),o.atomic&&(t.forEach(f=>s.set(f.name,f)),t=Array.from(s.entries()).map(([,f])=>f));let u=c?t[0]:t,h=a?.generate()||{};i(u,h,r)}function ke(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:n.getAttribute(o),...e})):Array.from(n.attributes).map(o=>r.find(s=>s.name===o.nodeName)||{target:n,name:o.nodeName,value:o.nodeValue,...e})}function qe({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 Ce(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 c=(u,h)=>{e.realdom.attrInterceptionRecords.has(u.target)||e.realdom.attrInterceptionRecords.set(u.target,{});let f=e.realdom.attrInterceptionRecords.get(u.target);f[u.name]=f[u.name]||[],f[u.name].unshift(u.event),e.realdom.attrInterceptionHooks.get("intercept")?.forEach(y=>y([u]));let m=h();return e.realdom.attrInterceptionHooks.get("sync")?.forEach(y=>y([u])),m};new r.MutationObserver(u=>{u=u.filter(h=>!(r.webqit.realdom.attrInterceptionRecords?.get(h.target)||{})[h.attributeName]?.shift()),u=Te(u).map(h=>qe.call(r,h)),u.length&&(e.realdom.attrInterceptionHooks.get("intercept")?.forEach(h=>h(u)),e.realdom.attrInterceptionHooks.get("sync")?.forEach(h=>h(u)))}).observe(i,{attributes:!0,subtree:!0,attributeOldValue:!0});let l=Object.create(null);return["setAttribute","removeAttribute","toggleAttribute"].forEach(u=>{l[u]=o.prototype[u],o.prototype[u]=function(...h){let f,m=this.getAttribute(h[0]);["setAttribute","toggleAttribute"].includes(u)&&(f=h[1]),u==="toggleAttribute"&&f===void 0&&(f=m===null);let y={target:this,name:h[0],value:f,oldValue:m,type:"interception",event:[this,u]};return c(y,()=>l[u].call(this,...h))}}),s}var Ot=class extends K{constructor(t,...r){super(t,"tree",...r)}attr(t,r=void 0,e={}){let{context:i,window:o}=this;return new U(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=l=>(o.has(l)||o.set(l,{target:l,entrants:[],exits:[],type:"query",event:null}),o.get(l));if(!e.generation||e.generation==="entrants"){if(!t.length)[...i.children].forEach(l=>s(i).entrants.push(l));else if(t.every(l=>l.type==="selector")){let[l,u]=t.reduce(([f,m],y)=>y.kind==="xpath"?[f,m.concat(y)]:[f.concat(y),m],[[],[]]),h=[];e.subtree?(l.length&&h.push(...i.querySelectorAll(l.join(","))),u.length&&h.push(...Dt(this.window,i,u))):(l.length&&h.push(...[...i.children].filter(f=>f.matches(l))),u.length&&h.push(...Dt(this.window,i,u,!1))),h.forEach(f=>s(f.parentNode||i).entrants.push(f))}}if(!r)return o;let c={disconnected:!1},a=r&&e.lifecycleSignals&&this.createSignalGenerator();for(let[,l]of o){if(c.disconnected)break;let u=a?.generate()||{};r(l,u,i)}if(e.live){a&&(e={...e,signalGenerator:a});let l=this.observe(t,r,e);return this.disconnectables(e.signal,c,l)}return this.disconnectables(e.signal,c,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:c}=this;e.eventDetails&&(s.realdom.domInterceptionRecordsAlwaysOn=!0),(c.readyState==="loading"||s.realdom.domInterceptionRecordsAlwaysOn)&&!s.realdom.domInterceptionHooks?.intercepting&&Re.call(o,"sync",()=>{});let a=new o.MutationObserver(h=>h.forEach(f=>{ne.call(o,u,je.call(o,f),i)}));a.observe(i,{childList:!0,subtree:e.subtree});let l=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),u={context:i,spec:t,callback:r,params:e,signalGenerator:l,disconnectable:a};if(e.staticSensitivity){let h=Ie.call(o,u);return this.disconnectables(e.signal,a,l,h)}return this.disconnectables(e.signal,a,l)}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",c=e.subtree?"subtree":"children";this.registry(s).size||Re.call(o,s,y=>{this.forEachMatchingContext(s,y,ne)});let a=new o.MutationObserver(y=>y.forEach(p=>{Array.isArray((p=je.call(o,p)).event)||ne.call(o,h,p,i)}));a.observe(i,{childList:!0,subtree:e.subtree});let l={disconnect(){a.disconnect(),m.delete(h),m.size||f.delete(i)}},u=e.signalGenerator||e.lifecycleSignals&&this.createSignalGenerator(),h={context:i,spec:t,callback:r,params:e,signalGenerator:u,disconnectable:l},f=this.registry(s,c);f.has(i)||f.set(i,new Set);let m=f.get(i);if(m.add(h),e.staticSensitivity){let y=Ie.call(o,h);return this.disconnectables(e.signal,l,u,y)}return this.disconnectables(e.signal,l,u)}};function Ie(n){let t=this,{context:r,spec:e,callback:i,params:o,signalGenerator:s}=n,c=e.filter(m=>m.kind==="css"),a=m=>m.match(/\.([\w-]+)/g)?.length?["class"]:[],l=m=>m.match(/#([\w-]+)/g)?.length?["id"]:[],u=m=>[...m.matchAll(/\[([^\=\]]+)(\=[^\]]+)?\]/g)].map(y=>y[1]).concat(a(m)).concat(l(m));if(!(n.$attrs=Array.from(new Set(c.filter(m=>(m+"").includes("[")).reduce((m,y)=>m.concat(u(y+"")),[])))).length)return;let h=new Set,f=new Set;return h.push=m=>(f.delete(m),h.add(m)),f.push=m=>(h.delete(m),f.add(m)),n.$deliveryCache={entrants:h,exits:f},new U(r,t).observe(n.$attrs,m=>{let y=new Map,p=d=>(y.has(d)||y.set(d,{target:d,entrants:[],exits:[],type:"static",event:null}),y.get(d)),x=new WeakMap,g=d=>(x.has(d)||x.set(d,c.some(b=>d.matches(b+""))),x.get(d));for(let d of m)["entrants","exits"].forEach(b=>{o.generation&&b!==o.generation||n.$deliveryCache[b].has(d.target)||(b==="entrants"?!g(d.target):g(d.target))||(n.$deliveryCache[b].push(d.target),p(d.target)[b].push(d.target),p(d.target).event=d.event)});for(let[,d]of y){let b=s?.generate()||{};i(d,b,r)}},{subtree:o.subtree,timing:o.timing,eventDetails:o.eventDetails})}function ne(n,t){let{context:r,spec:e,callback:i,params:o,signalGenerator:s,$deliveryCache:c}=n,a={...t,entrants:[],exits:[]};if(o.eventDetails||delete a.event,["entrants","exits"].forEach(u=>{if(!(o.generation&&u!==o.generation)&&(e.length?a[u]=gr.call(this,e,t[u],t.event!=="parse"):a[u]=[...t[u]],!!c))for(let h of a[u])c[u].push(h)}),!a.entrants.length&&!a.exits.length)return;let l=s?.generate()||{};i(a,l,r)}function gr(n,t,r){t=Array.isArray(t)?t:[...t];let e=(i,o)=>{if(o.type==="selector"){let s=o.isXpathAttr?[]:i.filter(c=>o.kind==="xpath"?Ae(this,c,o+""):c.matches&&c.matches(o+""));if((r||o.isXpathAttr)&&(s=i.reduce((c,a)=>o.kind==="xpath"?[...c,...Dt(this,a,o,r)]:a.querySelectorAll?[...c,...a.querySelectorAll(o+"")]:c,s)),s.length)return s}else if(i.includes(o.content)||r&&i.some(s=>s.contains(o.content)))return[o.content]};return t.$$searchCache||(t.$$searchCache=new Map),n.reduce((i,o)=>{let s;return t.$$searchCache.has(o.content)?s=t.$$searchCache.get(o.content):(s=e(t,o)||[],o.type==="instance"&&t.$$searchCache.set(o.content,s)),i.concat(s)},[])}function je({target:n,addedNodes:t,removedNodes:r}){let e=this,i;return i=S(t).reduce((o,s)=>o||e.webqit.realdom.domInterceptionRecords?.get(s),null),i=S(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 Re(n,t){let r=this,{webqit:e,document:i,Node:o,CharacterData:s,Element:c,HTMLElement:a,HTMLTemplateElement:l,DocumentFragment:u}=r;e.realdom.domInterceptionHooks||Object.defineProperty(e.realdom,"domInterceptionHooks",{value:new Map}),e.realdom.domInterceptionHooks.has(n)||e.realdom.domInterceptionHooks.set(n,new Set),e.realdom.domInterceptionHooks.get(n).add(t);let h=()=>e.realdom.domInterceptionHooks.get(n).delete(t);if(e.realdom.domInterceptionHooks?.intercepting)return h;console.warn("DOM mutation APIs are now being intercepted."),e.realdom.domInterceptionHooks.intercepting=!0,Object.defineProperty(e.realdom,"domInterceptionRecords",{value:new Map});let f=(p,x)=>{p.entrants.concat(p.exits).forEach(d=>{clearTimeout(e.realdom.domInterceptionRecords.get(d)?.timeout),e.realdom.domInterceptionRecords.set(d,p.event);let b=setTimeout(()=>{e.realdom.domInterceptionRecords.delete(d)},0);Object.defineProperty(p.event,"timeout",{value:b,configurable:!0})}),e.realdom.domInterceptionHooks.get("intercept")?.forEach(d=>d(p));let g=x();return e.realdom.domInterceptionHooks.get("sync")?.forEach(d=>d(p)),g},m={characterData:Object.create(null),other:Object.create(null)};["insertBefore","insertAdjacentElement","insertAdjacentHTML","setHTML","replaceChildren","replaceWith","remove","replaceChild","removeChild","before","after","append","prepend","appendChild"].forEach(p=>{function x(...g){let d=this instanceof s?m.characterData:m.other,b=()=>d[p].call(this,...g);if(!(this instanceof s||this instanceof c||this instanceof u))return b();let A=[],v=[],X=this;["insertBefore"].includes(p)?v=[g[0]]:["insertAdjacentElement","insertAdjacentHTML"].includes(p)?(v=[g[1]],["beforebegin","afterend"].includes(g[0])&&(X=this.parentNode)):["setHTML","replaceChildren"].includes(p)?(A=[...this.childNodes],v=p==="replaceChildren"?[...g]:[g[0]]):["replaceWith","remove"].includes(p)?(A=[this],v=p==="replaceWith"?[...g]:[],X=this.parentNode):["replaceChild"].includes(p)?(A=[g[1]],v=[g[0]]):["removeChild"].includes(p)?A=[...g]:(v=[...g],["before","after"].includes(p)&&(X=this.parentNode));let J=p;if(["insertAdjacentHTML","setHTML"].includes(p)){let pe=this.nodeName;if(p==="insertAdjacentHTML"&&["beforebegin","afterend"].includes(g[0])){if(!this.parentNode)return d[p].call(this,...g);pe=this.parentNode.nodeName}let St=i.createElement(pe);d.setHTML.call(St,v[0],p==="setHTML"?g[1]:{}),v=[...St.childNodes],p==="insertAdjacentHTML"?(J="insertAdjacentElement",g[1]=new u,g[1].______isTemp=!0,g[1].append(...St.childNodes)):(J="replaceChildren",g=[...St.childNodes])}return f({target:X,entrants:v,exits:A,type:"interception",event:[this,p]},()=>d[J].call(this,...g))}["insertBefore","replaceChild","removeChild","appendChild"].includes(p)?(m.other[p]=o.prototype[p],o.prototype[p]=x):(["after","before","remove","replaceWith"].includes(p)&&(m.characterData[p]=s.prototype[p],s.prototype[p]=x),c.prototype[p]&&(m.other[p]=c.prototype[p],c.prototype[p]=x))});let y=Object.create(null);return["outerHTML","outerText","innerHTML","innerText","textContent","nodeValue"].forEach(p=>{let x=["textContent","nodeValue"].includes(p)?o:["outerText","innerText"].includes(p)?a:c;y[p]=Object.getOwnPropertyDescriptor(x.prototype,p),Object.defineProperty(x.prototype,p,{...y[p],set:function(g){let d=()=>y[p].set.call(this,g);if(!(this instanceof c))return d();let b=[],A=[],v=this;if(["outerHTML","outerText"].includes(p)?(b=[this],v=this.parentNode):b=[...this.childNodes],["outerHTML","innerHTML"].includes(p)){let J=this.nodeName;if(p==="outerHTML"){if(!this.parentNode)return d();J=this.parentNode.nodeName}let it=i.createElement(J==="TEMPLATE"?"div":J);y[p].set.call(it,g),A=this instanceof l?[]:[...it.childNodes],p==="outerHTML"?(g=new u,g.______isTemp=!0,g.append(...it.childNodes),d=()=>c.prototype.replaceWith.call(this,g)):this instanceof l?d=()=>this.content.replaceChildren(...it.childNodes):d=()=>c.prototype.replaceChildren.call(this,...it.childNodes)}return f({target:v,entrants:A,exits:b,type:"interception",event:[this,p]},d)}})}),["append","prepend","replaceChildren"].forEach(p=>{[i,u.prototype].forEach(x=>{let g=x[p];x[p]=function(...d){if(this.______isTemp)return g.call(this,...d);let b=p==="replaceChildren"?[...this.childNodes]:[];return f({target:this,entrants:d,exits:b,type:"interception",event:[this,p]},()=>g.call(this,...d))}})}),h}function Me(){yr.call(this),br.call(this),wr.call(this)}function yr(){let n=this;n.CSS||(n.CSS={}),n.CSS.escape||(n.CSS.escape=t=>t.replace(/([\:@\~\$\&])/g,"\\$1"))}function br(){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 wr(){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 Ne(){let n=this;if(n.webqit||(n.webqit={}),n.webqit.realdom)return n.webqit.realdom;n.webqit.realdom={},Me.call(n),n.webqit.realdom.meta=(...r)=>xr.call(n,...r),n.webqit.realdom.ready=(...r)=>ie.call(n,...r),n.webqit.realdom.realtime=(r,e="dom")=>{if(e==="dom")return new Ot(r,n);if(e==="attr")return new U(r,n)};let t=new vt(n);return n.webqit.realdom.schedule=(r,...e)=>t[`on${r}`](...e),n.webqit.realdom}function ie(...n){let t="interactive",r;ct(n[0])?(t=n[0],$(n[1])&&(r=n[1])):$(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=>ie.call(this,"interactive",o)),complete:new Promise(o=>ie.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 xr(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(c=>c.trim());return re(i,s[0].split("."),s[1]==="true"?!0:s[1]==="false"?!1:k(s[1])?parseInt(s[1]):s[1]),i},{})),{get name(){return n},get content(){return e.content},json(){return JSON.parse(JSON.stringify(r))}}}var N=(...n)=>z("oohtml",...n);function oe(n,t,r){let e=n.toUpperCase().replace("-","_"),i=this,o=Ne.call(i);return i.webqit||(i.webqit={}),i.webqit.oohtml||(i.webqit.oohtml={}),i.webqit.oohtml.configs||(i.webqit.oohtml.configs={}),i.webqit.oohtml.configs[e]||(i.webqit.oohtml.configs[e]={}),pt(2,i.webqit.oohtml.configs[e],r,t,o.meta(n).json()),{config:i.webqit.oohtml.configs[e],realdom:o,window:i}}function se(n,t,r=1,e=!1){if(r&&typeof n=="object"&&n&&typeof t=="object"&&t&&(!e||Object.keys(n).length===Object.keys(t).length)){for(let i in n)if(!se(n[i],t[i],r-1,e))return!1;return!0}return Array.isArray(n)&&Array.isArray(t)&&n.length===t.length?(t=t.slice(0).sort())&&n.slice(0).sort().every((i,o)=>i===t[o]):n===t}var $t=class{constructor(t,r){Object.defineProperty(this,"request",{value:t}),Object.defineProperty(this,"hostElement",{value:r}),t.live&&!t.signal&&(Object.defineProperty(this,"abortController",{value:new AbortController}),t.signal=this.abortController.signal)}callback(t){w.defineProperty(this,"value",{value:t,configurable:!0,enumerable:!0})}abort(){if(this.abortController)return this.abortController.abort();let t=this.hostElement.ownerDocument?.defaultView||this.hostElement.defaultView;if(this.request.signal)return this.request.signal.dispatchEvent(new t.Event("abort"))}};function Fe(){let n=this;return class extends n.Event{constructor(r,e,{type:i="contextrequest",...o}={}){super(i,o),Object.defineProperty(this,"request",{get:()=>r}),Object.defineProperty(this,"callback",{get:()=>e})}respondWith(r,...e){if(this.request.diff){if("prevValue"in this&&this.prevValue===r)return;Object.defineProperty(this,"prevValue",{value:r,configurable:!0})}return this.callback(r,...e)}}}var I=class{static instance(t){return N(t).get("context::instance")||new this(t)}constructor(t){N(t).get("context::instance")?.dispose(),N(t).set("context::instance",this);let r={host:t,contexts:new Set};Object.defineProperty(this,"#",{get:()=>r});let e=Fe.call(t.ownerDocument?.defaultView||t.defaultView);Object.defineProperty(this,"ContextRequestEvent",{get:()=>e}),this[Symbol.iterator]=function*(){yield*r.contexts}}get length(){this["#"].contexts.size}findProvider(t){return[...this["#"].contexts].find(t)}attachProvider(t){this["#"].contexts.add(t),t.initialize(this["#"].host)}detachProvider(t){t.dispose(this["#"].host),this["#"].contexts.delete(t)}request(t,r=null,e={}){typeof r=="object"&&(e=r,r=null);let i;r||(i=new $t(t,this["#"].host),r=i.callback.bind(i));let o=this["#"].host.dispatchEvent(new this.ContextRequestEvent(t,r,{bubbles:!0,...e}));return i??o}dispose(){}};var B=class{static get config(){return{}}static attachTo(t,r,e=!1){this.providers.set(this.type,this);let i,o=I.instance(t);return!e&&(i=o.findProvider(s=>this.matchId(s.id,r)))?i:o.attachProvider(new this(r))}static detachFrom(t,r,e=!1){let i,o=I.instance(t);for(i of o["#"].contexts)if(!(!this.matchId(i.id,r)||typeof e=="function"&&!e(i))&&(o.detachProvider(i),typeof multiple!="function"&&!e))return i}static createId(t,r={}){let e={type:this.type,...r};return e.contextName||(t.getAttribute&&!(e.contextName=(t.getAttribute(this.config.context.attr.contextname)||"").trim())?delete e.contextName:t.ownerDocument||(e.contextName="root")),e}static matchId(t,r){return se(t,r,1,!0)}static createRequest(t={}){return{type:this.type,...t}}static matchRequest(t,r){return r.type===t.type&&(!r.contextName||r.contextName===t.contextName)}constructor(t){Object.defineProperty(this,"id",{get:()=>t}),Object.defineProperty(this,"subscriptions",{value:new Set})}get length(){this.subscriptions.size}handle(t){}subscribe(t){this.subscriptions.add(t),t.request.signal&&t.request.signal.addEventListener("abort",()=>{this.unsubscribe(t)})}unsubscribe(t){this.subscriptions.delete(t),t.request.controller?.abort()}handleEvent(t){if(!(this.disposed||t.target===this.host&&t.request?.superContextOnly||!(typeof t.request=="object"&&t.request)||typeof t.respondWith!="function"||!this.constructor.matchRequest(this.id,t.request)))if(t.stopPropagation(),t.type==="contextclaim"){let r=new Set;this.subscriptions.forEach(e=>{!t.target.contains(e.request.superContextOnly?e.target.parentNode:e.target)||!this.constructor.matchRequest(t.request,e.request)||(this.subscriptions.delete(e),r.add(e))}),t.respondWith(r)}else t.type==="contextrequest"&&(t.request.live&&this.subscribe(t),this.handle(t))}initialize(t){return this.host=t,this.disposed=!1,t.addEventListener("contextrequest",this),t.addEventListener("contextclaim",this),I.instance(t).request({...this.id,superContextOnly:!0},r=>r.forEach(e=>{this.subscribe(e),this.handle(e)}),{type:"contextclaim"}),this}dispose(t){return this.disposed=!0,t.removeEventListener("contextrequest",this),t.removeEventListener("contextclaim",this),this.subscriptions.forEach(r=>{this.unsubscribe(r);let{target:e,request:i,callback:o,options:s}=r;I.instance(e).request(i,o,s)}),this}};D(B,"providers",new Map),D(B,"type");var lt=class extends B{static matchRequest(t,r){return super.matchRequest(t,r)&&(!r.detail||!t.detail||(Array.isArray(r.detail)?r.detail[0]===t.detail:r.detail===t.detail))}get bindingsObj(){return this.host[this.constructor.config.api.bindings]}handle(t){if(t.request.controller?.abort(),!(t.request.detail+"").trim())return t.respondWith(this.bindingsObj);t.request.controller=w.reduce(this.bindingsObj,Array.isArray(t.request.detail)?t.request.detail:[t.request.detail],w.get,r=>{this.disposed||t.respondWith(r.value)},{live:t.request.live,descripted:!0})}};D(lt,"type","bindings");var ce=(n,...t)=>{let r=t.pop();return n.constructor.name==="AsyncFunction"?G(n.call(...t),r):r(n.call(...t))},G=(n,t)=>n instanceof Promise?n.then(t):t(n),ae=n=>typeof n=="object"&&n||typeof n=="function";function De(n){let t=typeof n[n.length-1]=="object"?n.pop():{},r=n.pop()||"";return t.functionParams=n,{source:r,params:t}}var Le={};function Ve(...n){let t,r={runtimeParams:Or,compilerParams:vr,parserParams:_r};for(;t=n.shift();){let{runtimeParams:e={},compilerParams:{globalsNoObserve:i=[],globalsOnlyPathsExcept:o=[],...s}={},parserParams:c={}}=t;r={runtimeParams:{...r.runtimeParams,...e},compilerParams:{...r.compilerParams,globalsNoObserve:[...r.compilerParams.globalsNoObserve,...i],globalsOnlyPathsExcept:[...r.compilerParams.globalsOnlyPathsExcept,...o],...s},parserParams:{...r.parserParams,...c}},n.devMode}return r}var _r={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!1,allowSuperOutsideMethod:!1,preserveParens:!1,locations:!0},vr={globalsNoObserve:["arguments","debugger"],globalsOnlyPathsExcept:[],originalSource:!0,locations:!0,compact:2},Or={apiVersion:3};var At=Object.create(null);var tt=class extends EventTarget{managedAlways=new Set;managedOnce=new Set;constructor(){super(),Le.setMaxListeners?.(0,this)}fire(t){return this.dispatchEvent(new Event(t,{cancelable:!0}))}on(...t){return this.addEventListener(...t),()=>this.removeEventListener(...t)}abort(t=!1){this.managedAlways.forEach(r=>r.abort?r.abort(t):r(t)),this.managedOnce.forEach(r=>r.abort?r.abort(t):r(t)),this.managedOnce.clear(),this.fire("abort")}manage(t){this.managedAlways.add(t)}once(t){this.managedOnce.add(t)}};var et=class extends tt{subscribers=new Set;signals=new Map;constructor(t,r,e){super(),this.context=t,this.context?.once(()=>this.abort()),this.once(()=>this.watchMode(!1)),this.type=r,this.state=e}get name(){return[...this.context?.signals.keys()||[]].find(t=>this.context.signals.get(t)===this)}signal(t,r="prop"){let e=this.signals.get(t);return e||(e=new et(this,r,r==="object"?t:ae(this.state)?w.get(this.state,t):void 0),this.signals.set(t,e),this.signals.size===1&&this.watchMode(),e.once(()=>{this.signals.delete(t),this.signals.size||this.watchMode(!1)})),e}subscribe(t){this.subscribers.add(t),t.once(()=>{this.subscribers.delete(t),this.subscribers.size||this.abort()})}watchMode(t=!0){this.mutationsWatch?.abort(),!(!t||!this.signals.size||!ae(this.state))&&(this.mutationsWatch=w.observe(this.state,r=>{let e={map:new Map,add(o,s){for(let c of o)c.spec.beforeSchedule?.(s)!==!1&&(this.map.has(c.runtime)||this.map.set(c.runtime,new Set),this.map.get(c.runtime).add(c))}};for(let o of r){let s=this.signals.get(o.key);!s||(e.add(s.subscribers,o),s.refresh(o.value))}let i=e.map.size?[...e.map].sort((o,s)=>o.$serial>s.$serial?-1:1):e.map;for(let[o,s]of i)o.state!=="aborted"&&o.schedule(...s)},{recursions:"force-sync"}))}refresh(t){this.state=t;for(let[r,e]of this.signals)e.refresh(w.get(this.state??{},r));this.watchMode()}};var T=class extends et{symbols=new Map;constructor(t,r,e=void 0){super(t,r,e||Object.create(null))}};var F=class extends tt{state;constructor(t,r,e,i,o,s){super(),t?.once(this),this.context=t,this.type=r,this.spec=e,this.scope=o,t?.scope!==o&&this.manage(o),this.serial=i,s&&(this.closure=s),t?.type==="iteration"?this.path=t.path.concat(this.spec.index):t?.type==="round"?this.path=t.path.concat(this.serial):this.path=(t?.path||[]).slice(0,-1).concat(this.serial),this.flowControl=new Map}get runtime(){return this.context.runtime}contains(t){return this===t.context||t.context&&this.contains(t.context)}order(t){if(!t)return this;let[r,e]=t.path.length<this.path.length?[t,this]:[this,t];return r.path.reduce((i,o,s)=>i&&o<=e.path[s],!0)&&r||e}beforeExecute(){this.state="running";let t=this.flowControl;return this.flowControl=new Map,t}execute(t=null){try{return this.runtime.thread.unshift(this),G(this.beforeExecute(),r=>ce(this.closure,this,this,e=>(this.spec.complete&&(e=this.spec.complete(e,this)),this.afterExecute(r),this.runtime.thread.shift(),t?t(e,this):e)))}catch(r){if(r.cause)throw r;let e=`${r.message||r}`;this.runtime.throw(e,[this.serial,this.context?.serial],globalThis[r.name])}}afterExecute(t){this.state="complete";let r=this.flowControl;this.handleDownstream(r.size,t.size),this.handleRightstream(r.size,t.size);for(let e of["break","continue","return"])r.has(e)&&!r.get(e).endpoint?this.hoistFlowControl(e,r.get(e).arg):t.has(e)&&!t.get(e).endpoint&&this.hoistFlowControl(e,t.get(e).arg,!0)}typed(t,r,e=void 0){let i=Array.isArray(r)?"array":r===null?"null":typeof r;if(i===t||t==="iterable"&&r?.[Symbol.iterator]||t==="desctructurable"&&!["undefined","null"].includes(i))return r;throw t==="iterable"?new Error("value is not iterable."):t==="desctructurable"?new Error((e?`Cannot access ${e}; `:"")+"object not desctructurable."):new Error(`value must be of type ${t}.`)}let(t,r,e,i={}){return this.var(t,r,e,{...i,kind:"let"})}const(t,r,e,i={}){return this.var(t,r,e,{...i,kind:"const"})}var(t,r,e,i={}){i={kind:"var",...i},e||(e=()=>{});let o=i.restOf?(...c)=>{try{return e(...c)}catch(a){throw new Error(`Cannot declare ${t}; ${a.message}`)}}:e,s=(c,a)=>{let l=i.kind==="var"?this.runtime.scope:a.scope;for(;i.kind==="var"&&!["module","function"].includes(l.type)&&!w.has(l.state,t)&&l.context;)l=l.context;let u=l.symbols.get(t);if(u&&(u.kind!==i.kind||i.kind==="let"&&u.serial!==r))throw new Error(`Identifier "${t}" has already been declared.`);u?.reader?.abort(),u={serial:r,kind:i.kind};let h=c;return i.restOf&&(i.type==="array"?h=[]:h={},u.reader=w.read(c,h,{except:i.restOf,spread:i.type==="array"}),a.once(u.reader)),l.symbols.set(t,u),w.set(l.state,t,h),h};return this.autorun(i.kind,{complete:s,...i},r,o)}update(t,r,e={}){let i=this.scope;for(;i&&!w.has(i.state,t);)i=i.context;if(!i)throw new ReferenceError(`${t} is not defined.`);let o=i.symbols.get(t);if(o?.kind==="const")throw new ReferenceError(`Assignment to constant variable "${t}".`);let s=w.get(i.state,t),c=e.restOf?(...a)=>{try{return r(...a)}catch(l){throw new Error(`Cannot update ${t}; ${l.message}`)}}:r;return ce(c,void 0,s,a=>{o?.reader?.abort();let l=a;return e.restOf&&(o=o||{},e.type==="array"?l=[]:l={},o.reader=w.read(a,l,{except:e.restOf,spread:e.type==="array"}),this.once(o.reader)),w.set(i.state,t,l),["postinc","postdec"].includes(e.kind)?s:l})}ref(t,...r){let e=0,i={};typeof r[0]=="number"?(e=r.shift(),i=r.shift()||{}):typeof r[0]=="object"&&(i=r.shift());let o=this.scope;for(;o&&!w.has(o.state,t);)o=o.context;if(!o){if(i.isTypeCheck)return;throw new Error(`${t} is not defined.`)}let s=o.symbols.get(t)?.kind,c=o.signal(t,s);return i.typed&&this.typed(i.typed,c.state,t),this.autobind(c,e,i)}obj(t,...r){let e=0,i={};return typeof r[0]=="number"?(e=r.shift(),i=r.shift()||{}):typeof r[0]=="object"&&(i=r.shift()),this.autobind(this.runtime.$objects.signal(t,"object"),e,i)}autobind(t,r,e){let i=this.runtime.$params.isStatefulFunction,o=t.type==="const",s=this===this.runtime,c=this.state==="aborted",a=this;return function l(u,h){if(i&&!o&&!s&&!c&&u.subscribe(a),!h||!u.state||typeof u.state!="object"){let m=u.state;return typeof u.state=="function"&&(m=w.proxy(u.state,{membrane:u})),m}let f;return w.proxy(u.state,{},m=>({...m,get(y,p,x=null){return f?m.get(y,p,x):(f=!0,l(u.signal(p),h-1))}}))}(t,r)}autorun(t,...r){let e=r.pop(),i=r.pop(),o=r.pop()||{},s=F,c=this.scope;if(t==="iteration"){let l=this.runtime.constructor;s=e.constructor.name==="AsyncFunction"?l.AutoAsyncIterator:l.AutoIterator}["block","iteration"].includes(t)&&(c=new T(c,t));let a=new s(this,t,o,i,c,e);if(!(t==="downstream"&&(this.downstream=a,this.flowControlApplied())))return a.execute()}function(t,r,e,i){t&&w.set(this.scope.state,i.name,i);let o=this;return Object.defineProperty(i,"toString",{value:function(s=!1){if(s&&r)return Function.prototype.toString.call(i);let c=o.runtime.extractSource(e);return c.startsWith("static ")?c.replace("static ",""):c}}),i}class(t,r,e){return t&&w.set(this.scope.state,r.name,r),e.forEach(({name:i,static:o,isStatefulFunction:s,serial:c})=>{this.function(!1,s,c,o?r[i]:r.prototype[i])}),r}async import(...t){return this.runtime.import(...t)}async export(...t){return this.runtime.export(...t)}continue(t){return this.applyFlowControl("continue",t)}break(t){return this.applyFlowControl("break",t)}return(t){return this.applyFlowControl("return",t)}applyFlowControl(t,r,e=!1){let i=this.flowControl.size;if(e?this.flowControl.delete(t):this.flowControl.set(t,{arg:r}),this.type==="round"&&(this.context.breakpoint=this),this.type==="round"&&["break","continue"].includes(t)&&r===this.context?.spec.label){e||(this.flowControl.get(t).endpoint=!0),this.state!=="running"&&this.handleRightstream(this.flowControl.size,i);return}this.state!=="running"&&(this.handleDownstream(this.flowControl.size,i),this.hoistFlowControl(...arguments))}hoistFlowControl(...t){return this.context?.applyFlowControl(...t)}flowControlApplied(t,r){return arguments.length?arguments.length===1?this.flowControl.has(t):this.flowControl.get(t)?.arg===r:this.flowControl.size||!1}handleDownstream(t,r){let e;this.type!=="block"||!(e=this.context?.downstream)||(t?e.abort():r&&(e.state="resuming",this.runtime.schedule(e)))}handleRightstream(t,r){if(this.type!=="round")return;let e=this,i=new Set;for(;e=e.nextRound;)t?e.abort():r&&e.state!=="inert"&&(e.state="resuming",i.add(e));i.size&&this.runtime.schedule(...i),!t&&r&&this.runtime.on("reflection",()=>{this.context.iterating||this.context.iterate()},{once:!0})}abort(t=!1){return t&&(this.context?.breakpoint===this&&delete this.context.breakpoint,this.flowControl.clear()),this.state=t?"inert":"aborted",super.abort(t)}};var rt=class extends F{rounds=new Map;constructor(t,r,e,i,o,s){e.$closure=s,super(t,r,e,i,o),this.manage(()=>{delete this.breakpoint,this.rounds.clear()})}pseudorun(t){return this.runtime.iThread.unshift(this),G(t(),r=>(this.runtime.iThread.pop(),r))}createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:()=>({done:!this.pseudorun(()=>this.spec.test(this))})}}closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=this.spec.parameters(this),this.iterator=this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&this.spec.init(this),this.iterator=this.createIterator()),this.iterate()}terminated(){return this.breakpoint&&!this.breakpoint.flowControlApplied("continue",this.spec.label)&&this.breakpoint.flowControlApplied()}advance(){this.spec.kind==="for"&&this.pseudorun(()=>this.spec.advance(this))}iterate(){this.iterating=!0;let t=()=>!this.terminated()&&!(this.cursor=this.iterator.next()).done,r=()=>{this.createRound(this.cursor.value).execute(),this.advance()};if(this.spec.kind==="do-while")do r();while(t());else for(;t();)r();this.iterating=!1}createRound(t){let r=this.rounds.size,e={index:r},i=["for-in","for-of"].includes(this.spec.kind)?{[this.production]:t}:{...this.scope.state},o=new T(this.scope,"round",i);this.scope.symbols.forEach((a,l)=>{o.symbols.set(l,a)});let s=new F(this,"round",e,this.serial,o,this.spec.$closure),c=this.spec.kind==="for-in"?t:r;return this.rounds.set(c,s),this.lastRound&&(this.lastRound.nextRound=s,s.prevRound=this.lastRound),this.lastRound=s,s}watchMode(){let t=(r,e)=>{let i=new Set,o=new Set;for(let s of r){if(Array.isArray(this.iteratee)&&s.key==="length")continue;let c=this.spec.kind==="for-in"?s.key:s.value,a=this.spec.kind==="for-in"?s.key:parseInt(s.key),l=this.rounds.get(a);if(l)w.set(l.scope.state,this.production,c),s.type==="delete"&&(this.rounds.set(a,void 0),l.prevRound&&(l.prevRound.nextRound=l.nextRound),l.nextRound&&(l.nextRound.prevRound=l.prevRound),i.add(l));else if(s.type!=="delete"&&!s.isUpdate){if(this.spec.kind==="for-of"&&this.iterator.original&&!e.done)continue;o.add(c)}}this.runtime.on("reflection",()=>{i.forEach(s=>s.abort(!0))},{once:!0}),o.size&&(this.iterator=function*(s){yield*s,yield*o}(this.iterator),e.done&&this.iterate())};this.once(w.observe(this.iteratee,r=>{G(this.cursor,e=>t(r,e))}))}};var Et=class extends rt{async createIterator(){return this.spec.kind==="for-in"?function*(){for(let t in this.iteratee)yield t}.call(this):this.spec.kind==="for-of"?function*(){for(let t of this.iteratee)yield t}.call(this):{next:async()=>({done:!await this.pseudorun(()=>this.spec.test(this))})}}async closure(){["for-of","for-in"].includes(this.spec.kind)?([this.production,this.iteratee]=await this.spec.parameters(this),this.iterator=await this.createIterator(),this.iterator.original=!0,this.watchMode()):(this.spec.kind==="for"&&await this.spec.init(this),this.iterator=await this.createIterator()),await this.iterate()}async iterate(){let t;this.iterating=!0;let r=async()=>!this.terminated()&&(this.cursor=this.iterator.next())&&(t=await this.cursor)&&!t.done,e=async()=>{await this.createRound(t.value).execute(),await this.advance()};if(this.spec.kind==="do-while")do await e();while(await r());else for(;await r();)await e();this.iterating=!1}};var Pt=class{constructor(t){Object.defineProperty(this,"runtime",{value:t});let r={statechange:()=>{w.defineProperty(this,"value",{value:t.flowControl.get("return")?.arg,enumerable:!0,configurable:!0})}};for(let e in r)t.on(e,r[e]),r[e]();t.$params.sourceType==="module"&&Object.defineProperty(this,"exports",{value:t.exports})}dispose(){return this.runtime.abort(!0)}};var nt=class extends F{locations=[];queue=new Set;thread=[];iThread=[];constructor(t,r,e,i,o){super(t,r,{},-1,i,o);let{$serial:s=0,...c}=e;this.$serial=s,this.$params=c,this.$objects=new T(void 0,"objects"),this.manage(this.$objects),this.exports=Object.create(null),this.$promises={imports:[],exports:[]},this.manage(()=>{w.deleteProperties(this.exports,Object.keys(this.exports)),this.$promises.imports.splice(0),this.$promises.exports.splice(0)})}extractSource(t,r=!1){let[[e,i,o],[s]]=this.locations[t],c=this.$params.originalSource.slice(e,s);return r?{expr:c,line:i,column:o}:c}throw(t,r,e=null,i=null){let o,s=i!==null?`[${i}]: ${t}`:t,c=r.map(l=>l!==-1&&this.extractSource(l,!0)).filter(l=>l);c.push({source:this.$params.originalSource}),o=new(e||Error)(s,{cause:c});let a=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;throw a&&(o.fileName=a),i&&(o.code=i),o}get runtime(){return this}get nowRunning(){return this.thread[0]}schedule(...t){let r=this.queue.size;for(let e of t)this.queue.add(e);if(!r)return this.flowControlDirty=!1,function e(i,o){let s;for(let c of this.queue){if(o&&o.order(c)!==o||["aborted","running"].includes(c.state)||this.iThread[0]?.contains(c)){this.queue.delete(c);continue}s=s?s.order(c):c,o||(o=s)}return s?(s.abort(),s.execute(c=>(this.queue.delete(s),e.call(this,c,s)))):(this.fire("reflection"),this.flowControlApplied()&&this.fire("statechange"),i)}.call(this,void 0,this.nowRunning)}execute(t=null){return super.execute(r=>{let e=this.$params.isStatefulFunction?new Pt(this):r;return t?t(e,this):e})}spawn(t,r,e){let i=this.nowRunning||this,o={...this.$params,$serial:this.$serial+1,isStatefulFunction:t},s=new T(i.scope,"function",{this:r});return new this.constructor(i,"function",o,s,e).execute()}async import(...t){let r=t.pop(),e=typeof r=="string"?{source:r}:r,i=s=>{if(e.forExport||e.isDynamic)return s;this.assignModules(t,this.scope.state,s,r.serial)};if(this.$params.experimentalFeatures!==!1&&At[e.source])return i(At[e.source]);let o=(async()=>{let s=this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace||this.$params.fileName;try{return i(await import(e.source))}catch(c){throw c.code==="ERR_MODULE_NOT_FOUND"&&this.throw(`Cannot find package "${e.source}"${s?` imported at "${s}"`:""}.`,[e.serial],null,c.code),c}})();return e.isDynamic||this.$promises[e.forExport?"exports":"imports"].push(o),o}async export(...t){let r=Array.isArray(t[t.length-1])?null:t.pop(),e=r?await this.import({...r,forExport:!0}):this.scope.state;this.assignModules(t,this.exports,e,r?.serial)}assignModules(t,r,e,i=null){let o=[];for(let[s,c,a]of t){if(s==="*"&&a){w.set(r,a,e);continue}w.has(e,s)||this.throw(`The requested module does not provide an export named "${s}".`,[c,i]),w.set(r,a||s,w.get(e,s)),o.push([s,c,a])}!o.length||this.once(w.observe(e,s=>{for(let[c,,a]of o)for(let l of s)c==="*"?w.set(r,l.key,l.value):l.key===c&&w.set(r,a||c,l.value)}))}afterExecute(...t){return this.$params.sourceType==="module"&&this.$params.experimentalFeatures!==!1&&this.$params.exportNamespace&&(At[this.$params.exportNamespace]=this.exports,this.once(()=>{delete At[this.$params.exportNamespace]})),super.afterExecute(...t)}};D(nt,"AutoAsyncIterator",Et),D(nt,"AutoIterator",rt);function He(n,t,r,e){let{env:i,functionParams:o=[],exportNamespace:s,fileName:c}=e,{parserParams:a,compilerParams:l,runtimeParams:u}=Ve(e);if(n==="module")a.sourceType=n,a.allowAwaitOutsideFunction=!0;else if(["function","async-function"].includes(n)){let f=" "+r.split(`
|
|
2
|
+
`).join(`
|
|
3
|
+
`);r=`return ${n==="async-function"?"async ":""}function**(${o.join(", ")}) {
|
|
4
|
+
${f}
|
|
5
|
+
}`,l.startStatic=!0}else if(!["script","async-script"].includes(n))throw new Error(`Unrecognized sourceType specified: "${n}".`);l.sourceType=n;let h=t(r,{parserParams:a,compilerParams:l});if(h instanceof Promise&&!["async-function","async-script","module"].includes(n))throw new Error("Parse-compile can only return a Promise for sourceTypes: async-function, async-script, module.");return u.sourceType=n,u.exportNamespace=s,u.fileName=c,G(h,f=>{let m=["async-script","module"].includes(n),p=((d,b)=>u.compileFunction?u.compileFunction(b,d):new(m?async function(){}.constructor:Function)(...d.concat(b)))([f.identifier+""],f+""),x=["function","async-function"].includes(n),g=d=>{let b=p;d&&(b=b.bind(d));let A="global",v=new T(void 0,A,globalThis);return(n.endsWith("script")||i)&&(A="env",v=new T(v,A,i)),n==="module"&&(A="module",v=new T(v,A)),typeof d<"u"&&(v=new T(v,"this",{this:d})),new nt(void 0,A,{...u,originalSource:f.originalSource,isStatefulFunction:!x},v,b)};return x?g().execute():{createRuntime:g,compiledSource:f}})}function le(...n){let{source:t,params:r}=De(n),e=He("async-function",$r,t,r);if(!(e instanceof Promise))return e;let i=async function(...o){return(await e).call(this,...o)};return Object.defineProperty(i,"toString",{value:async function(...o){return(await e).toString(...o)}}),i}function $r(...n){let t=typeof n[n.length-1]=="object"?n.pop():{},r=n.pop()||"";if(globalThis.webqit?.$fCompiler){let{parse:e,compile:i}=globalThis.webqit.$fCompiler,o=e(r,t.parserParams);return i(o,t.compilerParams)}if(globalThis.webqit=globalThis.webqit||{},!globalThis.webqit.$fCompilerWorker){let o=`
|
|
6
|
+
const compilerUrls = [ '${(document.querySelector('meta[name="$f-compiler-url"]')?.content.split(",")||[]).concat("https://unpkg.com/@webqit/stateful-js/dist/compiler.js").join("','")}' ];
|
|
7
|
+
( function importScript() {
|
|
8
|
+
try { importScripts( compilerUrls.shift().trim() ) } catch( e ) { if ( compilerUrls.length ) { importScript(); } }
|
|
9
|
+
} )();
|
|
10
|
+
const { parse, compile } = globalThis.webqit.$fCompiler;
|
|
11
|
+
globalThis.onmessage = e => {
|
|
12
|
+
const { source, params } = e.data;
|
|
13
|
+
const ast = parse( source, params.parserParams );
|
|
14
|
+
const compilation = compile( ast, params.compilerParams );
|
|
15
|
+
e.ports[ 0 ]?.postMessage( {
|
|
16
|
+
identifier: compilation.identifier,
|
|
17
|
+
originalSource: compilation.originalSource,
|
|
18
|
+
compiledSource: compilation + '',
|
|
19
|
+
topLevelAwait: compilation.topLevelAwait
|
|
20
|
+
} );
|
|
21
|
+
};`;globalThis.webqit.$fCompilerWorker=new Worker(`data:text/javascript;base64,${btoa(o)}`)}return new Promise(e=>{let i=new MessageChannel;webqit.$fCompilerWorker.postMessage({source:r,params:t},[i.port2]),i.port1.onmessage=o=>{let{compiledSource:s,...c}=o.data;Object.defineProperty(c,"toString",{value:()=>s}),e(c)}})}function he(n={}){let{config:t,window:r}=oe.call(this,"html-bindings",n,{attr:{bind:"bind",itemIndex:"data-index"},tokens:{nodeType:"processing-instruction",tagStart:"?{",tagEnd:"}?",stateStart:"; [=",stateEnd:"]"},staticsensitivity:!0,isomorphic:!0});t.api={bind:r.webqit.oohtml.configs.BINDINGS_API.api.bind,import:r.webqit.oohtml.configs.HTML_IMPORTS.context.api.import},t.attrSelector=`[${r.CSS.escape(t.attr.bind)}]`;let e=(i,o)=>{let s=`starts-with(., "${i}")`,c=`substring(., string-length(.) - string-length("${o}") + 1) = "${o}"`;return`${s} and ${c}`};t.braceletSelector=`comment()[${e(t.tokens.tagStart,t.tokens.tagEnd)}]`,r.webqit.Observer=w,Ar.call(r,t)}function Ar(n){let t=this,{realdom:r}=t.webqit;r.realtime(t.document).subtree(`(${n.braceletSelector})`,e=>{ze.call(this,...e.exits),Er.call(this,n,...e.entrants)},{live:!0}),r.realtime(t.document).subtree(n.attrSelector,e=>{ze.call(this,...e.exits),Pr.call(this,n,...e.entrants)},{live:!0,timing:"sync",staticSensitivity:n.staticsensitivity})}function We(n){if(N(n).has("subscripts"))return N(n).get("subscripts");let t={},r=new AbortController;t.$set=function(i,o,s){i&&(i[o]=s)},w.intercept(t,{get:(i,o,s)=>{if(!(i.key in t)){let c=lt.createRequest({detail:i.key,live:!0,signal:r.signal});I.instance(n).request(c,a=>{w.set(t,i.key,a)})}return s(t[i.key]??(i.key in globalThis?globalThis[i.key]:void 0))},has:(i,o,s)=>s(!0)});let e={scope:t,abortController:r,subscripts:new Map};return N(n).set("subscripts",e),e}function ze(...n){for(let t of n){let r=t.nodeName==="#text"?t.parentNode:t,{subscripts:e,abortController:i}=N(r).get("subscripts")||{};if(!e?.has(t))return;e.get(t).state.dispose(),e.get(t).signals.forEach(o=>o.abort()),e.delete(t),e.size||(i.abort(),N(r).delete("subscripts"))}}async function Er(n,...t){let r=this,e=o=>{let s=n.tokens.tagStart.split("").map(m=>`\\${m}`).join(""),c=n.tokens.tagEnd.split("").map(m=>`\\${m}`).join(""),a=n.tokens.stateStart.split("").map(m=>m===" "?"(?:\\s+)?":`\\${m}`).join(""),l=n.tokens.stateEnd.split("").map(m=>`\\${m}`).join(""),u=`^${s}(.*?)(?:${a}(\\d+)${l}(?:\\s+)?)?${c}$`,[,h,f]=o.match(new RegExp(u));return{raw:o,expr:h,span:parseInt(f??0)}},i=t.reduce((o,s)=>{if(s.isBracelet)return o;let c=e(s.nodeValue),a=s;if(c.span){if(a=s.nextSibling,a?.nodeName!=="#text"||a.nodeValue.length<c.span)return o;a.nodeValue.length>c.span&&a.splitText(c.span)}else s.nextSibling?a=s.parentNode.insertBefore(s.ownerDocument.createTextNode(""),s.nextSibling):a=s.parentNode.appendChild(s.ownerDocument.createTextNode(""));a.isBracelet=!0;let l=s;return r.webqit.env!=="server"&&(l.remove(),l=null),o.concat({textNode:a,template:c,stateNode:l})},[]);for(let{textNode:o,template:s,stateNode:c}of i){let{scope:a,subscripts:l}=We(o.parentNode),u="";u+=`let content = ((${s.expr}) ?? '') + '';`,u+="$set(this, 'nodeValue', content);",c&&(u+=`$set($stateNode__, 'nodeValue', \`${n.tokens.tagStart}${s.expr}${n.tokens.stateStart}\` + content.length + \`${n.tokens.stateEnd} ${n.tokens.tagEnd}\`);`);let h=new le("$signals__","$stateNode__",u,{env:a}),f=[];l.set(o,{compiled:h,signals:f,state:await h.call(o,f,c)})}}async function Pr(n,...t){for(let r of t){let e=Sr(n,r.getAttribute(n.attr.bind)),{scope:i,subscripts:o}=We(r),s=new le("$signals__",e,{env:i}),c=[];o.set(r,{compiled:s,signals:c,state:await s.call(r,c)})}}var ue=new Map;function Sr(n,t){if(ue.has(t))return ue.get(t);let r={},e=fe(t,";").map(i=>{let[o,s]=fe(i,":").map(h=>h.trim()),c=o[0],a=o.slice(1).trim(),l=`(${s})`,u=`(${l} ?? '')`;if(c==="&")return`this.style[\`${a}\`] = ${u};`;if(c==="%")return`this.classList.toggle(\`${a}\`, !!${l});`;if(c==="@")return a.endsWith("?")?`this.toggleAttribute(\`${a.substring(0,-1).trim()}\`, !!${l});`:`this.setAttribute(\`${a}\`, ${u});`;if(c==="~"){if(r[a])throw new Error(`Duplicate binding: ${o}.`);if(r[a]=!0,a==="text")return`$set(this, 'textContent', ${u});`;if(a==="html")return`this.setHTML(${u});`;if(a==="items"){let[h,f]=fe(s,"/"),[m,y,p,x]=h.trim().match(/(.*?[\)\s+])(of|in)([\(\{\[\s+].*)/i)||[];if(!m)throw new Error(`Invalid ${c}items spec: ${i}.`);if(y.startsWith("(")?y=y.trim().slice(1,-1).split(",").map(d=>d.trim()):y=[y],y.length>(p==="in"?3:2))throw new Error(`Invalid ${c}items spec: ${i}.`);let g=p==="in"?y[2]:y[1]||"$index__";return`
|
|
22
|
+
let $iteratee__ = ${x};
|
|
23
|
+
let $import__ = this.${n.api.import}( ${f.trim()}, true );
|
|
24
|
+
$signals__.push( $import__ );
|
|
25
|
+
|
|
26
|
+
if ( $import__.value && $iteratee__ ) {
|
|
27
|
+
let $existing__ = new Map;
|
|
28
|
+
this.querySelectorAll( '[${n.attr.itemIndex}]' ).forEach( x => {
|
|
29
|
+
$existing__.set( x.getAttribute( '${n.attr.itemIndex}' ), x );
|
|
30
|
+
} );
|
|
31
|
+
${g?`let ${g} = -1;`:""}
|
|
32
|
+
for ( let ${y[0]} ${p} $iteratee__ ) {
|
|
33
|
+
${g?`${g} ++;`:""}
|
|
34
|
+
${p==="in"&&y[1]?`let ${y[1]} = $iteratee__[ ${y[0]} ];`:""}
|
|
35
|
+
const $itemBinding__ = { ${y.join(", ")} };
|
|
36
|
+
|
|
37
|
+
const $key___ = ( ${p==="in"?y[0]:g} ) + '';
|
|
38
|
+
let $itemNode__ = $existing__.get( $key___ );
|
|
39
|
+
if ( $itemNode__ ) {
|
|
40
|
+
$existing__.delete( $key___ );
|
|
41
|
+
} else {
|
|
42
|
+
$itemNode__ = ( Array.isArray( $import__.value ) ? $import__.value[ 0 ] : ( $import__.value.content ? $import__.value.content.firstElementChild : $import__.value ) ).cloneNode( true );
|
|
43
|
+
$itemNode__.setAttribute( "${n.attr.itemIndex}", $key___ );
|
|
44
|
+
this.appendChild( $itemNode__ );
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
$itemNode__.${n.api.bind}( $itemBinding__ );
|
|
48
|
+
if ( ${p==="in"?`!( ${y[0]} in $iteratee__ )`:`typeof ${y[0]} === 'undefined'`} ) { $itemNode__.remove(); }
|
|
49
|
+
}
|
|
50
|
+
$existing__.forEach( x => x.remove() );
|
|
51
|
+
$existing__.clear();
|
|
52
|
+
}`}}if(i.trim())throw new Error(`Invalid binding: ${i}.`)}).join(`
|
|
53
|
+
`);return ue.set(t,e),e}function fe(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()}he.call(window);})();
|
|
54
|
+
//# sourceMappingURL=html-bindings.js.map
|