@microsoft/fast-element 2.0.0-beta.15 → 2.0.0-beta.17
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/CHANGELOG.json +30 -0
- package/CHANGELOG.md +17 -1
- package/dist/dts/components/element-controller.d.ts +12 -2
- package/dist/dts/templating/html-directive.d.ts +6 -1
- package/dist/dts/templating/node-observation.d.ts +1 -1
- package/dist/dts/templating/template.d.ts +5 -0
- package/dist/dts/templating/view.d.ts +6 -1
- package/dist/dts/testing/fakes.d.ts +1 -0
- package/dist/esm/components/element-controller.js +29 -14
- package/dist/esm/observation/observable.js +5 -1
- package/dist/esm/templating/binding-signal.js +6 -1
- package/dist/esm/templating/binding-two-way.js +6 -1
- package/dist/esm/templating/binding.js +9 -1
- package/dist/esm/templating/children.js +8 -4
- package/dist/esm/templating/html-directive.js +6 -0
- package/dist/esm/templating/node-observation.js +4 -4
- package/dist/esm/templating/template.js +6 -1
- package/dist/esm/templating/view.js +6 -0
- package/dist/esm/testing/fakes.js +2 -0
- package/dist/fast-element.d.ts +12 -3
- package/dist/fast-element.debug.js +70 -20
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +70 -20
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +28 -3
- package/docs/api-report.md +8 -0
- package/package.json +1 -1
|
@@ -186,6 +186,10 @@ const isFunction = (object) => typeof object === "function";
|
|
|
186
186
|
* @internal
|
|
187
187
|
*/
|
|
188
188
|
const isString = (object) => typeof object === "string";
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
*/
|
|
192
|
+
const noop = () => void 0;
|
|
189
193
|
|
|
190
194
|
/**
|
|
191
195
|
* The default UpdateQueue.
|
|
@@ -495,6 +499,10 @@ const Observable = FAST.getById(2 /* KernelServiceId.observable */, () => {
|
|
|
495
499
|
this.propertyName = void 0;
|
|
496
500
|
this.notifier = void 0;
|
|
497
501
|
this.next = void 0;
|
|
502
|
+
/**
|
|
503
|
+
* Opts out of JSON stringification.
|
|
504
|
+
*/
|
|
505
|
+
this.toJSON = noop;
|
|
498
506
|
}
|
|
499
507
|
setMode(isAsync) {
|
|
500
508
|
this.isAsync = this.needsQueue = isAsync;
|
|
@@ -1860,6 +1868,11 @@ class StatelessAttachedAttributeDirective {
|
|
|
1860
1868
|
* The unique id of the factory.
|
|
1861
1869
|
*/
|
|
1862
1870
|
this.id = nextId();
|
|
1871
|
+
/**
|
|
1872
|
+
* Opts out of JSON stringification.
|
|
1873
|
+
* @internal
|
|
1874
|
+
*/
|
|
1875
|
+
this.toJSON = noop;
|
|
1863
1876
|
}
|
|
1864
1877
|
/**
|
|
1865
1878
|
* Creates a placeholder string based on the directive's index within the template.
|
|
@@ -1894,6 +1907,14 @@ class OnChangeBinding extends Binding {
|
|
|
1894
1907
|
}
|
|
1895
1908
|
}
|
|
1896
1909
|
class OneTimeBinding extends Binding {
|
|
1910
|
+
constructor() {
|
|
1911
|
+
super(...arguments);
|
|
1912
|
+
/**
|
|
1913
|
+
* Opts out of JSON stringification.
|
|
1914
|
+
* @internal
|
|
1915
|
+
*/
|
|
1916
|
+
this.toJSON = noop;
|
|
1917
|
+
}
|
|
1897
1918
|
createObserver() {
|
|
1898
1919
|
return this;
|
|
1899
1920
|
}
|
|
@@ -2201,6 +2222,11 @@ class HTMLView {
|
|
|
2201
2222
|
* The length of the current collection within a repeat context.
|
|
2202
2223
|
*/
|
|
2203
2224
|
this.length = 0;
|
|
2225
|
+
/**
|
|
2226
|
+
* Opts out of JSON stringification.
|
|
2227
|
+
* @internal
|
|
2228
|
+
*/
|
|
2229
|
+
this.toJSON = noop;
|
|
2204
2230
|
this.firstChild = fragment.firstChild;
|
|
2205
2231
|
this.lastChild = fragment.lastChild;
|
|
2206
2232
|
}
|
|
@@ -2683,6 +2709,11 @@ class ViewTemplate {
|
|
|
2683
2709
|
*/
|
|
2684
2710
|
constructor(html, factories) {
|
|
2685
2711
|
this.result = null;
|
|
2712
|
+
/**
|
|
2713
|
+
* Opts out of JSON stringification.
|
|
2714
|
+
* @internal
|
|
2715
|
+
*/
|
|
2716
|
+
this.toJSON = noop;
|
|
2686
2717
|
this.html = html;
|
|
2687
2718
|
this.factories = factories;
|
|
2688
2719
|
}
|
|
@@ -3094,7 +3125,7 @@ const elements = (selector) => selector
|
|
|
3094
3125
|
class NodeObservationDirective extends StatelessAttachedAttributeDirective {
|
|
3095
3126
|
constructor() {
|
|
3096
3127
|
super(...arguments);
|
|
3097
|
-
this.
|
|
3128
|
+
this.controllerProperty = `${this.id}-c`;
|
|
3098
3129
|
}
|
|
3099
3130
|
/**
|
|
3100
3131
|
* Bind this behavior to the source.
|
|
@@ -3104,7 +3135,7 @@ class NodeObservationDirective extends StatelessAttachedAttributeDirective {
|
|
|
3104
3135
|
*/
|
|
3105
3136
|
bind(controller) {
|
|
3106
3137
|
const target = controller.targets[this.nodeId];
|
|
3107
|
-
target[this.
|
|
3138
|
+
target[this.controllerProperty] = controller;
|
|
3108
3139
|
this.updateTarget(controller.source, this.computeNodes(target));
|
|
3109
3140
|
this.observe(target);
|
|
3110
3141
|
controller.onUnbind(this);
|
|
@@ -3119,7 +3150,7 @@ class NodeObservationDirective extends StatelessAttachedAttributeDirective {
|
|
|
3119
3150
|
const target = controller.targets[this.nodeId];
|
|
3120
3151
|
this.updateTarget(controller.source, emptyArray);
|
|
3121
3152
|
this.disconnect(target);
|
|
3122
|
-
target[this.
|
|
3153
|
+
target[this.controllerProperty] = null;
|
|
3123
3154
|
}
|
|
3124
3155
|
/**
|
|
3125
3156
|
* Gets the data source for the target.
|
|
@@ -3127,7 +3158,7 @@ class NodeObservationDirective extends StatelessAttachedAttributeDirective {
|
|
|
3127
3158
|
* @returns The source.
|
|
3128
3159
|
*/
|
|
3129
3160
|
getSource(target) {
|
|
3130
|
-
return target[this.
|
|
3161
|
+
return target[this.controllerProperty].source;
|
|
3131
3162
|
}
|
|
3132
3163
|
/**
|
|
3133
3164
|
* Updates the source property with the computed nodes.
|
|
@@ -3223,9 +3254,13 @@ class ChildrenDirective extends NodeObservationDirective {
|
|
|
3223
3254
|
* @param target - The target to observe.
|
|
3224
3255
|
*/
|
|
3225
3256
|
observe(target) {
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3257
|
+
let observer = target[this.observerProperty];
|
|
3258
|
+
if (!observer) {
|
|
3259
|
+
observer = new MutationObserver(this.handleEvent);
|
|
3260
|
+
observer.toJSON = noop;
|
|
3261
|
+
observer.target = target;
|
|
3262
|
+
target[this.observerProperty] = observer;
|
|
3263
|
+
}
|
|
3229
3264
|
observer.observe(target, this.options);
|
|
3230
3265
|
}
|
|
3231
3266
|
/**
|
|
@@ -3593,7 +3628,13 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3593
3628
|
this.needsInitialization = true;
|
|
3594
3629
|
this.hasExistingShadowRoot = false;
|
|
3595
3630
|
this._template = null;
|
|
3596
|
-
this.
|
|
3631
|
+
this.stage = 3 /* Stages.disconnected */;
|
|
3632
|
+
/**
|
|
3633
|
+
* A guard against connecting behaviors multiple times
|
|
3634
|
+
* during connect in scenarios where a behavior adds
|
|
3635
|
+
* another behavior during it's connectedCallback
|
|
3636
|
+
*/
|
|
3637
|
+
this.guardBehaviorConnection = false;
|
|
3597
3638
|
this.behaviors = null;
|
|
3598
3639
|
this._mainStyles = null;
|
|
3599
3640
|
/**
|
|
@@ -3611,6 +3652,11 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3611
3652
|
* If `null` then the element is managing its own rendering.
|
|
3612
3653
|
*/
|
|
3613
3654
|
this.view = null;
|
|
3655
|
+
/**
|
|
3656
|
+
* Opts out of JSON stringification.
|
|
3657
|
+
* @internal
|
|
3658
|
+
*/
|
|
3659
|
+
this.toJSON = noop;
|
|
3614
3660
|
this.source = element;
|
|
3615
3661
|
this.definition = definition;
|
|
3616
3662
|
const shadowOptions = definition.shadowOptions;
|
|
@@ -3649,11 +3695,7 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3649
3695
|
*/
|
|
3650
3696
|
get isConnected() {
|
|
3651
3697
|
Observable.track(this, isConnectedPropertyName);
|
|
3652
|
-
return this.
|
|
3653
|
-
}
|
|
3654
|
-
setIsConnected(value) {
|
|
3655
|
-
this._isConnected = value;
|
|
3656
|
-
Observable.notify(this, isConnectedPropertyName);
|
|
3698
|
+
return this.stage === 1 /* Stages.connected */;
|
|
3657
3699
|
}
|
|
3658
3700
|
/**
|
|
3659
3701
|
* Gets/sets the template used to render the component.
|
|
@@ -3728,7 +3770,9 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3728
3770
|
if (count === 0) {
|
|
3729
3771
|
targetBehaviors.set(behavior, 1);
|
|
3730
3772
|
behavior.addedCallback && behavior.addedCallback(this);
|
|
3731
|
-
if (behavior.connectedCallback &&
|
|
3773
|
+
if (behavior.connectedCallback &&
|
|
3774
|
+
!this.guardBehaviorConnection &&
|
|
3775
|
+
(this.stage === 1 /* Stages.connected */ || this.stage === 0 /* Stages.connecting */)) {
|
|
3732
3776
|
behavior.connectedCallback(this);
|
|
3733
3777
|
}
|
|
3734
3778
|
}
|
|
@@ -3752,7 +3796,7 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3752
3796
|
}
|
|
3753
3797
|
if (count === 1 || force) {
|
|
3754
3798
|
targetBehaviors.delete(behavior);
|
|
3755
|
-
if (behavior.disconnectedCallback && this.
|
|
3799
|
+
if (behavior.disconnectedCallback && this.stage !== 3 /* Stages.disconnected */) {
|
|
3756
3800
|
behavior.disconnectedCallback(this);
|
|
3757
3801
|
}
|
|
3758
3802
|
behavior.removedCallback && behavior.removedCallback(this);
|
|
@@ -3813,9 +3857,10 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3813
3857
|
* Runs connected lifecycle behavior on the associated element.
|
|
3814
3858
|
*/
|
|
3815
3859
|
connect() {
|
|
3816
|
-
if (this.
|
|
3860
|
+
if (this.stage !== 3 /* Stages.disconnected */) {
|
|
3817
3861
|
return;
|
|
3818
3862
|
}
|
|
3863
|
+
this.stage = 0 /* Stages.connecting */;
|
|
3819
3864
|
// If we have any observables that were bound, re-apply their values.
|
|
3820
3865
|
if (this.boundObservables !== null) {
|
|
3821
3866
|
const element = this.source;
|
|
@@ -3829,9 +3874,11 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3829
3874
|
}
|
|
3830
3875
|
const behaviors = this.behaviors;
|
|
3831
3876
|
if (behaviors !== null) {
|
|
3877
|
+
this.guardBehaviorConnection = true;
|
|
3832
3878
|
for (const key of behaviors.keys()) {
|
|
3833
3879
|
key.connectedCallback && key.connectedCallback(this);
|
|
3834
3880
|
}
|
|
3881
|
+
this.guardBehaviorConnection = false;
|
|
3835
3882
|
}
|
|
3836
3883
|
if (this.needsInitialization) {
|
|
3837
3884
|
this.renderTemplate(this.template);
|
|
@@ -3841,16 +3888,18 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3841
3888
|
else if (this.view !== null) {
|
|
3842
3889
|
this.view.bind(this.source);
|
|
3843
3890
|
}
|
|
3844
|
-
this.
|
|
3891
|
+
this.stage = 1 /* Stages.connected */;
|
|
3892
|
+
Observable.notify(this, isConnectedPropertyName);
|
|
3845
3893
|
}
|
|
3846
3894
|
/**
|
|
3847
3895
|
* Runs disconnected lifecycle behavior on the associated element.
|
|
3848
3896
|
*/
|
|
3849
3897
|
disconnect() {
|
|
3850
|
-
if (
|
|
3898
|
+
if (this.stage !== 1 /* Stages.connected */) {
|
|
3851
3899
|
return;
|
|
3852
3900
|
}
|
|
3853
|
-
this.
|
|
3901
|
+
this.stage = 2 /* Stages.disconnecting */;
|
|
3902
|
+
Observable.notify(this, isConnectedPropertyName);
|
|
3854
3903
|
if (this.view !== null) {
|
|
3855
3904
|
this.view.unbind();
|
|
3856
3905
|
}
|
|
@@ -3860,6 +3909,7 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3860
3909
|
key.disconnectedCallback && key.disconnectedCallback(this);
|
|
3861
3910
|
}
|
|
3862
3911
|
}
|
|
3912
|
+
this.stage = 3 /* Stages.disconnected */;
|
|
3863
3913
|
}
|
|
3864
3914
|
/**
|
|
3865
3915
|
* Runs the attribute changed callback for the associated element.
|
|
@@ -3882,7 +3932,7 @@ class ElementController extends PropertyChangeNotifier {
|
|
|
3882
3932
|
* Only emits events if connected.
|
|
3883
3933
|
*/
|
|
3884
3934
|
emit(type, detail, options) {
|
|
3885
|
-
if (this.
|
|
3935
|
+
if (this.stage === 1 /* Stages.connected */) {
|
|
3886
3936
|
return this.source.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options)));
|
|
3887
3937
|
}
|
|
3888
3938
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t}),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const a=Object.freeze([]);function h(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const d=e=>"function"==typeof e,u=e=>"string"==typeof e,f=l.getById(1,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class p{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class g{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new p(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new p(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const b=Object.freeze({unknown:void 0,coupled:1}),v=l.getById(2,(()=>{const e=f.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw l.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new g(e))),i}const o=c();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];d(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class h extends p{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==b.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){u(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function y(e,t){v.defineProperty(e,t)}function m(e,t,s){return Object.assign({},s,{get(){return v.trackVolatile(),s.get.apply(this)}})}const w=l.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),C=Object.freeze({default:{index:0,length:0,get event(){return C.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>w.get(),setEvent(e){w.set(e)}});class x{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const T=Object.freeze({reset:1,splice:2,optimized:3}),S=new x(0,a,0);S.reset=!0;const O=[S];function A(e,t,s,i,n,r){let o=0,l=0;const h=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,h)),s===e.length&&r===i.length&&(l=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,h-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return a;if(t===s){const e=new x(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new x(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let h,c;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new x(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function B(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let k=Object.freeze({support:T.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?a:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)B(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(A(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):s:O,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(0,[],i.length).adjustTo(e)),n}});const j=Object.freeze({reset:O,setDefaultStrategy(e){k=e}});function $(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class I extends p{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,$(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,v.notify(e,"length"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:k).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,f.enqueue(this))}}let V=!1;const E=Object.freeze({enable(){if(V)return;V=!0,v.setArrayObserverFactory((e=>new I(e)));const e=Array.prototype;e.$fastPatch||($(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:k)[t.name](this,i,t,e)}})))}});function N(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(E.enable(),t=v.getNotifier(e)),v.track(t.lengthObserver,"length"),e.length}let M;function F(e){return e.map((e=>e instanceof L?F(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class L{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof L?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(M),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(F(this.styles)),this}static setDefaultStrategy(e){M=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new L(e):e instanceof L?e:new L([e])}}L.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const _=h(),z=Object.freeze({getForInstance:_.getForInstance,getByType:_.getByType,define:e=>(_.register({type:e}),e)});function P(){return function(e){z.define(e)}}function R(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==z.getForInstance(o)&&(o=o.createCSS(r)),o instanceof L||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const D=(e,...t)=>{const{styles:s,behaviors:i}=R(e,t),n=new L(s);return i.length?n.withBehaviors(...i):n};class H{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(u(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new L(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}z.define(H);const U=D.partial=(e,...t)=>{const{styles:s,behaviors:i}=R(e,t);return new H(s,i)},q=Object.freeze({queueUpdate:f.enqueue,nextUpdate:f.next,processUpdates:f.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),Q=`fast-${Math.random().toString(36).substring(2,8)}`,W=`${Q}{`,K=`}${Q}`,G=K.length;let J=0;const X=()=>`${Q}-${++J}`,Y=Object.freeze({interpolation:e=>`${W}${e}${K}`,attribute:e=>`${X()}="${W}${e}${K}"`,comment:e=>`\x3c!--${W}${e}${K}--\x3e`}),Z=Object.freeze({parse(e,t){const s=e.split(W);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(K);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+G)}""!==o&&i.push(o)}return i}}),ee=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:C.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=X());e.id||(e.id=X()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),te=h(),se=Object.freeze({getForInstance:te.getForInstance,getByType:te.getByType,define:(e,t)=>((t=t||{}).type=e,te.register(t),e)});function ie(e){return function(t){se.define(t,e)}}class ne{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const re=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?re.tokenList:re.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=re.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=re.event;break;default:e.targetAspect=t,e.aspectType=re.attribute}else e.aspectType=re.content}});class oe{constructor(e){this.options=e,this.id=X()}createHTML(e){return Y.attribute(e(this))}createBehavior(){return this}}const le=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:e=>e;class ae extends ne{createObserver(e,t){return v.binding(this.evaluate,t,this.isVolatile)}}class he extends ne{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ce(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}}function de(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let l=r.v;const a=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}}const ue=(e,t,s)=>e[t]=s,fe=()=>{};class pe{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=X(),this.aspectType=re.content,this.data=`${this.id}-d`}createHTML(e){return Y.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=le(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=q.setAttribute;break;case 2:this.updateTarget=q.setBooleanAttribute;break;case 3:this.updateTarget=ue;break;case 4:this.updateTarget=ce;break;case 5:this.updateTarget=de;break;case 6:this.updateTarget=fe;break;default:throw l.error(1205)}return this}bind(e){var t;const s=e.targets[this.nodeId];switch(this.updateTarget){case fe:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case ce:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){C.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);C.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ge(e,t=v.isVolatileBinding(e)){return new ae(e,t)}function be(e){return new he(e)}function ve(e,t){const s=new ae(e,!1);return s.options=t,s}function ye(e){return d(e)?ge(e):e instanceof ne?e:be((()=>e))}function me(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}se.define(pe,{aspected:!0});class we{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=b.unknown,this.context=this,this.index=0,this.length=0,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return C.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){me(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){me(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v.defineProperty(we.prototype,"index"),v.defineProperty(we.prototype,"length");const Ce=(e,t)=>`${e}.${t}`,xe={},Te={index:0,node:null};function Se(e){e.startsWith("fast-")||l.warn(1204,{name:e})}const Oe=new Proxy(document.createElement("div"),{get(e,t){Se(t);const s=Reflect.get(e,t);return d(s)?s.bind(e):s},set:(e,t,s)=>(Se(t),Reflect.set(e,t,s))});class Ae{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=xe[t];if(!n){const i=`_${t}`;xe[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:Oe;for(const e of this.nodeIds)s[e];return new we(t,this.factories,s)}}function Be(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=Z.parse(d,l);let f=null;null===u?r&&(f=new pe(be((()=>d))),re.assign(f,c.name)):f=Ee.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function ke(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=je(e,s,n,i);n=t.node,i=t.index}}function je(e,t,s,i){const n=Ce(t,i);switch(s.nodeType){case 1:Be(e,t,s,n,i),ke(e,s,n);break;case 3:return function(e,t,s,i,n){const r=Z.parse(t.textContent,e.directives);if(null===r)return Te.node=t.nextSibling,Te.index=n+1,Te;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=Ce(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),u(a)?o.textContent=a:(o.textContent=" ",re.assign(a),e.addFactory(a,s,i,n)),l=o}return Te.index=n+1,Te.node=l.nextSibling,Te}(e,s,t,n,i);case 8:const r=Z.parse(s.data,e.directives);null!==r&&e.addFactory(Ee.aggregate(r),t,n,i)}return Te.index=i+1,Te.node=s.nextSibling,Te}const $e={createHTML:e=>e};let Ie=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",$e):$e;const Ve=Ie,Ee={setHTMLPolicy(e){if(Ie!==Ve)throw l.error(1201);Ie=e},compile(e,t){let s;if(u(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Ie.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ae(i,t);return Be(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==Z.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),ke(n,i,"r"),Te.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>u(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new pe(s);return re.assign(o,t),o}};class Ne{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Ee.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const Me=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Fe(e,t,s){const i=Me.exec(t);return null!==i&&re.assign(e,i[2]),e.createHTML(s)}function Le(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=X();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,d(o))s+=Fe(new pe(ge(o)),r,n);else if(u(o)){const e=Me.exec(r);if(null!==e){const t=new pe(be((()=>o)));re.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof ne?s+=Fe(new pe(o),r,n):void 0===(l=se.getForInstance(o))?s+=Fe(new pe(be((()=>o))),r,n):l.aspected?s+=Fe(o,r,n):s+=o.createHTML(n)}return new Ne(s+e[e.length-1],i)}class _e extends oe{bind(e){e.source[this.options]=e.targets[this.nodeId]}}se.define(_e);const ze=e=>new _e(e);function Pe(e,t){const s=d(e)?e:()=>e,i=d(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const Re=Object.freeze({positioning:!1,recycle:!0});function De(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function He(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}class Ue{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=De,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=He)}bind(e){this.location=e.targets[this.directive.nodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=a);const t=this.itemsObserver,s=this.itemsObserver=v.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=0,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;p<g;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(we.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class qe{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=X(),E.enable()}createHTML(e){return Y.comment(e(this))}createBehavior(){return new Ue(this)}}function Qe(e,t,s=Re){const i=ye(e),n=ye(t);return new qe(i,n,Object.assign(Object.assign({},Re),s))}se.define(qe);const We=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):We;class Ge extends oe{constructor(){super(...arguments),this.sourceProperty=`${this.id}-s`}bind(e){const t=e.targets[this.nodeId];t[this.sourceProperty]=e.source,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,a),this.disconnect(t),t[this.sourceProperty]=null}getSource(e){return e[this.sourceProperty]}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Je extends Ge{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Xe(e){return u(e)&&(e={property:e}),new Je(e)}se.define(Je);class Ye extends Ge{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){var t;const s=null!==(t=e[this.observerProperty])&&void 0!==t?t:e[this.observerProperty]=new MutationObserver(this.handleEvent);s.target=e,s.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ze(e){return u(e)&&(e={property:e}),new Ye(e)}se.define(Ye);const et=Object.freeze({locate:c()}),tt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function st(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const it={toView(e){const t=st(e);return t?t.toString():t},fromView:st};class nt{constructor(e,t,s=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===i&&void 0===n&&(this.converter=tt)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return v.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||f.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;q.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":q.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(et.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];u(i)?s.push(new nt(e,i)):s.push(new nt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function rt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),et.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const ot={mode:"open"},lt={},at=new Set,ht=l.getById(4,(()=>h()));class ct{constructor(e,t=e.definition){var s;this.platformDefined=!1,u(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=nt.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,v.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?ot:null===t.shadowOptions?void 0:Object.assign(Object.assign({},ot),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?lt:Object.assign(Object.assign({},lt),t.elementOptions),this.styles=L.normalize(t.styles),ht.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return at.has(e)||ht.getByType(e)?new ct(class extends e{},t):new ct(e,t)}static registerBaseType(e){at.add(e)}}ct.getByType=ht.getByType,ct.getForInstance=ht.getForInstance;const dt={bubbles:!0,composed:!0,cancelable:!0},ut=new WeakMap;function ft(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ut.get(e))&&void 0!==s?s:null}let pt;class gt extends g{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this._isConnected=!1,this.behaviors=null,this._mainStyles=null,this.$fastController=this,this.view=null,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&ut.set(e,t))}const i=v.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return v.track(this,"isConnected"),this._isConnected}setIsConnected(e){this._isConnected=e,v.notify(this,"isConnected")}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),e.connectedCallback&&this.isConnected&&e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&this.isConnected&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ft(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=ft(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;if(null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.setIsConnected(!0)}disconnect(){if(!this._isConnected)return;this.setIsConnected(!1),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this)}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return!!this._isConnected&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},dt),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=ft(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=b.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=ct.getForInstance(e);if(void 0===s)throw l.error(1401);return e.$fastController=new pt(e,s)}static setStrategy(e){pt=e}}function bt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=ft(e))&&void 0!==t?t:e.getRootNode()}gt.setStrategy(gt);class vt{constructor(e){const t=vt.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){const t=bt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=bt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}vt.styleSheetCache=new Map;let yt=0;function mt(e){return e===document?document.body:e}function wt(e){const t=class extends e{constructor(){super(),gt.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return ct.registerBaseType(t),t}function Ct(e,t){return d(e)?ct.compose(e,t).define().type:ct.compose(this,e).define().type}L.setDefaultStrategy(L.supportsAdoptedStyleSheets?vt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++yt}addStylesTo(e){e=mt(bt(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=mt(bt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}});const xt=Object.assign(wt(HTMLElement),{from:function(e){return wt(e)},define:Ct,compose:function(e,t){return d(e)?ct.compose(e,t):ct.compose(this,e)}});function Tt(e){return function(t){Ct(t,e)}}export{E as ArrayObserver,re as Aspect,et as AttributeConfiguration,nt as AttributeDefinition,ne as Binding,z as CSSDirective,Ye as ChildrenDirective,Ee as Compiler,q as DOM,gt as ElementController,L as ElementStyles,C as ExecutionContext,l as FAST,xt as FASTElement,ct as FASTElementDefinition,pe as HTMLBindingDirective,se as HTMLDirective,we as HTMLView,Y as Markup,Ge as NodeObservationDirective,v as Observable,Z as Parser,g as PropertyChangeNotifier,_e as RefDirective,Ue as RepeatBehavior,qe as RepeatDirective,Je as SlottedDirective,b as SourceLifetime,x as Splice,j as SpliceStrategy,T as SpliceStrategySupport,oe as StatelessAttachedAttributeDirective,p as SubscriberSet,f as Updates,ee as ViewBehaviorOrchestrator,Ne as ViewTemplate,rt as attr,ge as bind,tt as booleanConverter,Ze as children,c as createMetadataLocator,h as createTypeRegistry,D as css,P as cssDirective,U as cssPartial,Tt as customElement,Ke as elements,a as emptyArray,Le as html,ie as htmlDirective,N as lengthOf,ve as listener,ye as normalizeBinding,it as nullableNumberConverter,y as observable,be as oneTime,ze as ref,Qe as repeat,Xe as slotted,m as volatile,Pe as when};
|
|
1
|
+
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t}),void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",{value:Object.create(null),configurable:!1,enumerable:!1,writable:!1});const e=globalThis.FAST,t={1101:"Must call enableArrayObservation before observing arrays.",1201:"The HTML policy can only be set once.",1202:"To bind innerHTML, you must use a TrustedTypesPolicy.",1203:"View=>Model update skipped. To use twoWay binding, the target property must be observable.",1204:"No host element is present. Cannot bind host with ${name}.",1205:"The requested binding behavior is not supported by the binding engine.",1401:"Missing FASTElement definition.",1501:"No registration for Context/Interface '${name}'.",1502:"Dependency injection resolver for '${key}' returned a null factory.",1503:"Invalid dependency injection resolver strategy specified '${strategy}'.",1504:"Unable to autoregister dependency.",1505:"Unable to resolve dependency injection key '${key}'.",1506:"'${name}' is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.",1507:"Attempted to jitRegister something that is not a constructor '${value}'. Did you forget to register this dependency?",1508:"Attempted to jitRegister an intrinsic type '${value}'. Did you forget to add @inject(Key)?",1509:"Attempted to jitRegister an interface '${value}'.",1510:"A valid resolver was not returned from the register method.",1511:"Key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?",1512:"'${key}' not registered. Did you forget to add @singleton()?",1513:"Cyclic dependency found '${name}'.",1514:"Injected properties that are updated on changes to DOM connectivity require the target object to be an instance of FASTElement."},s=/(\$\{\w+?})/g,i=/\$\{(\w+?)}/g,n=Object.freeze({});function r(e,t){return e.split(s).map((e=>{var s;const n=e.replace(i,"$1");return String(null!==(s=t[n])&&void 0!==s?s:e)})).join("")}Object.assign(e,{addMessages(e){Object.assign(t,e)},warn(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Warning";console.warn(r(o,s))},error(e,s=n){var i;const o=null!==(i=t[e])&&void 0!==i?i:"Unknown Error";return new Error(r(o,s))}});const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const l=globalThis.FAST;if(void 0===l.getById){const e=Object.create(null);Reflect.defineProperty(l,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===l.error&&Object.assign(l,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const a=Object.freeze([]);function h(){const e=new Map;return Object.freeze({register:t=>!e.has(t.type)&&(e.set(t.type,t),!0),getByType:t=>e.get(t),getForInstance(t){if(null!=t)return e.get(t.constructor)}})}function c(){const e=new WeakMap;return function(t){let s=e.get(t);if(void 0===s){let i=Reflect.getPrototypeOf(t);for(;void 0===s&&null!==i;)s=e.get(i),i=Reflect.getPrototypeOf(i);s=void 0===s?[]:s.slice(0),e.set(t,s)}return s}}const d=e=>"function"==typeof e,u=e=>"string"==typeof e,f=()=>{},g=l.getById(1,(()=>{const e=[],t=[],s=globalThis.requestAnimationFrame;let i=!0;function n(){if(t.length)throw t.shift()}function r(s){try{s.call()}catch(s){if(!i)throw e.length=0,s;t.push(s),setTimeout(n,0)}}function o(){let t=0;for(;t<e.length;)if(r(e[t]),t++,t>1024){for(let s=0,i=e.length-t;s<i;s++)e[s]=e[s+t];e.length-=t,t=0}e.length=0}function l(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:l,next:()=>new Promise(l),process:o,setMode:e=>i=e})}));class p{constructor(e,t){this.sub1=void 0,this.sub2=void 0,this.spillover=void 0,this.subject=e,this.sub1=t}has(e){return void 0===this.spillover?this.sub1===e||this.sub2===e:-1!==this.spillover.indexOf(e)}subscribe(e){const t=this.spillover;if(void 0===t){if(this.has(e))return;if(void 0===this.sub1)return void(this.sub1=e);if(void 0===this.sub2)return void(this.sub2=e);this.spillover=[this.sub1,this.sub2,e],this.sub1=void 0,this.sub2=void 0}else{-1===t.indexOf(e)&&t.push(e)}}unsubscribe(e){const t=this.spillover;if(void 0===t)this.sub1===e?this.sub1=void 0:this.sub2===e&&(this.sub2=void 0);else{const s=t.indexOf(e);-1!==s&&t.splice(s,1)}}notify(e){const t=this.spillover,s=this.subject;if(void 0===t){const t=this.sub1,i=this.sub2;void 0!==t&&t.handleChange(s,e),void 0!==i&&i.handleChange(s,e)}else for(let i=0,n=t.length;i<n;++i)t[i].handleChange(s,e)}}class b{constructor(e){this.subscribers={},this.subjectSubscribers=null,this.subject=e}notify(e){var t,s;null===(t=this.subscribers[e])||void 0===t||t.notify(e),null===(s=this.subjectSubscribers)||void 0===s||s.notify(e)}subscribe(e,t){var s,i;let n;n=t?null!==(s=this.subscribers[t])&&void 0!==s?s:this.subscribers[t]=new p(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new p(this.subject),n.subscribe(e)}unsubscribe(e,t){var s,i;t?null===(s=this.subscribers[t])||void 0===s||s.unsubscribe(e):null===(i=this.subjectSubscribers)||void 0===i||i.unsubscribe(e)}}const v=Object.freeze({unknown:void 0,coupled:1}),y=l.getById(2,(()=>{const e=g.enqueue,t=/(:|&&|\|\||if)/,s=new WeakMap;let i,n=e=>{throw l.error(1101)};function r(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new b(e))),i}const o=c();class a{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==i&&i.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,i=e[s];if(i!==t){e[s]=t;const n=e[this.callback];d(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class h extends p{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0,this.toJSON=f}setMode(e){this.isAsync=this.needsQueue=e}bind(e){this.controller=e;const t=this.observe(e.source,e.context);return!e.isBound&&this.requiresUnbind(e)&&e.onUnbind(this),t}requiresUnbind(e){return e.sourceLifetime!==v.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return Object.freeze({setArrayObserverFactory(e){n=e},getNotifier:r,track(e,t){i&&i.watch(e,t)},trackVolatile(){i&&(i.needsRefresh=!0)},notify(e,t){r(e).notify(t)},defineProperty(e,t){u(t)&&(t=new a(t)),o(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:o,binding(e,t,s=this.isVolatileBinding(e)){return new h(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function m(e,t){y.defineProperty(e,t)}function w(e,t,s){return Object.assign({},s,{get(){return y.trackVolatile(),s.get.apply(this)}})}const C=l.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),S=Object.freeze({default:{index:0,length:0,get event(){return S.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>C.get(),setEvent(e){C.set(e)}});class x{constructor(e,t,s){this.index=e,this.removed=t,this.addedCount=s}adjustTo(e){let t=this.index;const s=e.length;return t>s?t=s-this.addedCount:t<0&&(t=s+this.removed.length+t-this.addedCount),this.index=t<0?0:t,this}}const T=Object.freeze({reset:1,splice:2,optimized:3}),O=new x(0,a,0);O.reset=!0;const B=[O];function A(e,t,s,i,n,r){let o=0,l=0;const h=Math.min(s-t,r-n);if(0===t&&0===n&&(o=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,i,h)),s===e.length&&r===i.length&&(l=function(e,t,s){let i=e.length,n=t.length,r=0;for(;r<s&&e[--i]===t[--n];)r++;return r}(e,i,h-o)),n+=o,r-=l,(s-=l)-(t+=o)==0&&r-n==0)return a;if(t===s){const e=new x(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new x(t,[],s-t)];const c=function(e){let t=e.length-1,s=e[0].length-1,i=e[t][s];const n=[];for(;t>0||s>0;){if(0===t){n.push(2),s--;continue}if(0===s){n.push(3),t--;continue}const r=e[t-1][s-1],o=e[t-1][s],l=e[t][s-1];let a;a=o<l?o<r?o:r:l<r?l:r,a===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):a===o?(n.push(3),t--,i=o):(n.push(2),s--,i=l)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,l=s-t+1,a=new Array(o);let h,c;for(let e=0;e<o;++e)a[e]=new Array(l),a[e][0]=e;for(let e=0;e<l;++e)a[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<l;++r)e[t+r-1]===i[n+s-1]?a[s][r]=a[s-1][r-1]:(h=a[s-1][r]+1,c=a[s][r-1]+1,a[s][r]=h<c?h:c);return a}(e,t,s,i,n,r)),d=[];let u,f=t,g=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,g++;break;case 1:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++,u.removed.push(i[g]),g++;break;case 2:void 0===u&&(u=new x(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new x(f,[],0)),u.removed.push(i[g]),g++}return void 0!==u&&d.push(u),d}function k(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const h=t[a];if(h.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=h.index,l=h.index+h.addedCount,r<o||l<n?-1:r===o||l===n?0:n<o?r<l?r-o:l-o:l<r?l-n:r-n);if(c>=0){t.splice(a,1),a--,i-=h.addedCount-h.removed.length,e.addedCount+=h.addedCount-c;const n=e.removed.length+h.removed.length-c;if(e.addedCount||n){let t=h.removed;if(e.index<h.index){const s=e.removed.slice(0,h.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>h.index+h.addedCount){const s=e.removed.slice(h.index+h.addedCount-e.index);t.push(...s)}e.removed=t,h.index<e.index&&(e.index=h.index)}else s=!0}else if(e.index<h.index){s=!0,t.splice(a,0,e),a++;const n=e.addedCount-e.removed.length;h.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let j=Object.freeze({support:T.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?a:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)k(t[e],i);for(let t=0,n=i.length;t<n;++t){const n=i[t];1!==n.addedCount||1!==n.removed.length?s=s.concat(A(e,n.index,n.index+n.addedCount,n.removed,0,n.removed.length)):n.removed[0]!==e[n.index]&&s.push(n)}return s}(t,s):s:B,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new x(0,[r],0)),r},sort(e,t,s,i){const n=s.apply(e,i);return t.reset(e),n},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(+i[0],n,i.length>2?i.length-2:0).adjustTo(e)),n},unshift(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new x(0,[],i.length).adjustTo(e)),n}});const $=Object.freeze({reset:B,setDefaultStrategy(e){j=e}});function N(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class I extends p{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this.call=this.flush,N(e,"$fastController",this)}get strategy(){return this._strategy}set strategy(e){this._strategy=e}get lengthObserver(){let e=this._lengthObserver;if(void 0===e){const t=this.subject;this._lengthObserver=e={length:t.length,handleChange(){this.length!==t.length&&(this.length=t.length,y.notify(e,"length"))}},this.subscribe(e)}return e}subscribe(e){this.flush(),super.subscribe(e)}addSplice(e){void 0===this.splices?this.splices=[e]:this.splices.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.oldCollection;void 0===t&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.oldCollection=void 0,this.notify((null!==(e=this._strategy)&&void 0!==e?e:j).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,g.enqueue(this))}}let V=!1;const E=Object.freeze({enable(){if(V)return;V=!0,y.setArrayObserverFactory((e=>new I(e)));const e=Array.prototype;e.$fastPatch||(N(e,"$fastPatch",1),[e.pop,e.push,e.reverse,e.shift,e.sort,e.splice,e.unshift].forEach((t=>{e[t.name]=function(...e){var s;const i=this.$fastController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:j)[t.name](this,i,t,e)}})))}});function M(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(E.enable(),t=y.getNotifier(e)),y.track(t.lengthObserver,"length"),e.length}let F;function L(e){return e.map((e=>e instanceof z?L(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class z{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof z?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(F),this._strategy}addStylesTo(e){this.strategy.addStylesTo(e),this.targets.add(e)}removeStylesFrom(e){this.strategy.removeStylesFrom(e),this.targets.delete(e)}isAttachedTo(e){return this.targets.has(e)}withBehaviors(...e){return this.behaviors=null===this.behaviors?e:this.behaviors.concat(e),this}withStrategy(e){return this._strategy=new e(L(this.styles)),this}static setDefaultStrategy(e){F=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new z(e):e instanceof z?e:new z([e])}}z.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const P=h(),R=Object.freeze({getForInstance:P.getForInstance,getByType:P.getByType,define:e=>(P.register({type:e}),e)});function _(){return function(e){R.define(e)}}function D(e,t){const s=[];let i="";const n=[],r=e=>{n.push(e)};for(let n=0,o=e.length-1;n<o;++n){i+=e[n];let o=t[n];void 0!==R.getForInstance(o)&&(o=o.createCSS(r)),o instanceof z||o instanceof CSSStyleSheet?(""!==i.trim()&&(s.push(i),i=""),s.push(o)):i+=o}return i+=e[e.length-1],""!==i.trim()&&s.push(i),{styles:s,behaviors:n}}const H=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t),n=new z(s);return i.length?n.withBehaviors(...i):n};class U{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(u(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new z(s))}createCSS(e){return this.behaviors.forEach(e),this.styles&&e(this),this.css}addedCallback(e){e.addStyles(this.styles)}removedCallback(e){e.removeStyles(this.styles)}}R.define(U);const q=H.partial=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t);return new U(s,i)},Q=Object.freeze({queueUpdate:g.enqueue,nextUpdate:g.next,processUpdates:g.process,setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}}),J=`fast-${Math.random().toString(36).substring(2,8)}`,W=`${J}{`,K=`}${J}`,G=K.length;let X=0;const Y=()=>`${J}-${++X}`,Z=Object.freeze({interpolation:e=>`${W}${e}${K}`,attribute:e=>`${Y()}="${W}${e}${K}"`,comment:e=>`\x3c!--${W}${e}${K}--\x3e`}),ee=Object.freeze({parse(e,t){const s=e.split(W);if(1===s.length)return null;const i=[];for(let e=0,n=s.length;e<n;++e){const n=s[e],r=n.indexOf(K);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+G)}""!==o&&i.push(o)}return i}}),te=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:S.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=Y());e.id||(e.id=Y()),this.addTarget(s,t),this.addBehavior(e.createBehavior())},addTarget(e,t){s[e]=t},addBehavior(e){t.push(e),n&&e.bind(this)},onUnbind(e){null===i&&(i=[]),i.push(e)},connectedCallback(e){n||(n=!0,t.forEach((e=>e.bind(this))))},disconnectedCallback(e){n&&(n=!1,null!==i&&i.forEach((e=>e.unbind(this))))}}}}),se=h(),ie=Object.freeze({getForInstance:se.getForInstance,getByType:se.getByType,define:(e,t)=>((t=t||{}).type=e,se.register(t),e)});function ne(e){return function(t){ie.define(t,e)}}class re{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const oe=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?oe.tokenList:oe.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=oe.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=oe.event;break;default:e.targetAspect=t,e.aspectType=oe.attribute}else e.aspectType=oe.content}});class le{constructor(e){this.options=e,this.id=Y(),this.toJSON=f}createHTML(e){return Z.attribute(e(this))}createBehavior(){return this}}const ae=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:e=>e;class he extends re{createObserver(e,t){return y.binding(this.evaluate,t,this.isVolatile)}}class ce extends re{constructor(){super(...arguments),this.toJSON=f}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function de(e,t,s,i){if(null==s&&(s=""),s.create){e.textContent="";let t=e.$fastView;void 0===t?t=s.create():e.$fastTemplate!==s&&(t.isComposed&&(t.remove(),t.unbind()),t=s.create()),t.isComposed?t.needsBindOnly&&(t.needsBindOnly=!1,t.bind(i.source,i.context)):(t.isComposed=!0,t.bind(i.source,i.context),t.insertBefore(e),e.$fastView=t,e.$fastTemplate=s)}else{const t=e.$fastView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}}function ue(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let l=r.v;const a=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}}const fe=(e,t,s)=>e[t]=s,ge=()=>{};class pe{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=Y(),this.aspectType=oe.content,this.data=`${this.id}-d`}createHTML(e){return Z.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=ae(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=Q.setAttribute;break;case 2:this.updateTarget=Q.setBooleanAttribute;break;case 3:this.updateTarget=fe;break;case 4:this.updateTarget=de;break;case 5:this.updateTarget=ue;break;case 6:this.updateTarget=ge;break;default:throw l.error(1205)}return this}bind(e){var t;const s=e.targets[this.nodeId];switch(this.updateTarget){case ge:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case de:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){S.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);S.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function be(e,t=y.isVolatileBinding(e)){return new he(e,t)}function ve(e){return new ce(e)}function ye(e,t){const s=new he(e,!1);return s.options=t,s}function me(e){return d(e)?be(e):e instanceof re?e:ve((()=>e))}function we(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ie.define(pe,{aspected:!0});class Ce{constructor(e,t,s){this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=v.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=f,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return S.getEvent()}get isEven(){return this.index%2==0}get isOdd(){return this.index%2!=0}get isFirst(){return 0===this.index}get isInMiddle(){return!this.isFirst&&!this.isLast}get isLast(){return this.index===this.length-1}eventDetail(){return this.event.detail}eventTarget(){return this.event.target}appendTo(e){e.appendChild(this.fragment)}insertBefore(e){if(this.fragment.hasChildNodes())e.parentNode.insertBefore(this.fragment,e);else{const t=this.lastChild;if(e.previousSibling===t)return;const s=e.parentNode;let i,n=this.firstChild;for(;n!==t;)i=n.nextSibling,s.insertBefore(n,e),n=i;s.insertBefore(t,e)}}remove(){const e=this.fragment,t=this.lastChild;let s,i=this.firstChild;for(;i!==t;)s=i.nextSibling,e.appendChild(i),i=s;e.appendChild(t)}dispose(){we(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}bind(e,t=this){if(this.source===e)return;let s=this.behaviors;if(null===s){this.source=e,this.context=t,this.behaviors=s=new Array(this.factories.length);const i=this.factories;for(let e=0,t=i.length;e<t;++e){const t=i[e].createBehavior();t.bind(this),s[e]=t}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=s.length;e<t;++e)s[e].bind(this)}this.isBound=!0}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}static disposeContiguousBatch(e){if(0!==e.length){we(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}y.defineProperty(Ce.prototype,"index"),y.defineProperty(Ce.prototype,"length");const Se=(e,t)=>`${e}.${t}`,xe={},Te={index:0,node:null};function Oe(e){e.startsWith("fast-")||l.warn(1204,{name:e})}const Be=new Proxy(document.createElement("div"),{get(e,t){Oe(t);const s=Reflect.get(e,t);return d(s)?s.bind(e):s},set:(e,t,s)=>(Oe(t),Reflect.set(e,t,s))});class Ae{constructor(e,t){this.fragment=e,this.directives=t,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i){this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.nodeId=s,this.factories.push(e)}freeze(){return this.proto=Object.create(null,this.descriptors),this}addTargetDescriptor(e,t,s){const i=this.descriptors;if("r"===t||"h"===t||i[t])return;if(!i[e]){const t=e.lastIndexOf("."),s=e.substring(0,t),i=parseInt(e.substring(t+1));this.addTargetDescriptor(s,e,i)}let n=xe[t];if(!n){const i=`_${t}`;xe[t]=n={get(){var t;return null!==(t=this[i])&&void 0!==t?t:this[i]=this[e].childNodes[s]}}}i[t]=n}createView(e){const t=this.fragment.cloneNode(!0),s=Object.create(this.proto);s.r=t,s.h=null!=e?e:Be;for(const e of this.nodeIds)s[e];return new Ce(t,this.factories,s)}}function ke(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,h=o.length;a<h;++a){const c=o[a],d=c.value,u=ee.parse(d,l);let f=null;null===u?r&&(f=new pe(ve((()=>d))),oe.assign(f,c.name)):f=Ee.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function je(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=$e(e,s,n,i);n=t.node,i=t.index}}function $e(e,t,s,i){const n=Se(t,i);switch(s.nodeType){case 1:ke(e,t,s,n,i),je(e,s,n);break;case 3:return function(e,t,s,i,n){const r=ee.parse(t.textContent,e.directives);if(null===r)return Te.node=t.nextSibling,Te.index=n+1,Te;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=Se(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),u(a)?o.textContent=a:(o.textContent=" ",oe.assign(a),e.addFactory(a,s,i,n)),l=o}return Te.index=n+1,Te.node=l.nextSibling,Te}(e,s,t,n,i);case 8:const r=ee.parse(s.data,e.directives);null!==r&&e.addFactory(Ee.aggregate(r),t,n,i)}return Te.index=i+1,Te.node=s.nextSibling,Te}const Ne={createHTML:e=>e};let Ie=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ne):Ne;const Ve=Ie,Ee={setHTMLPolicy(e){if(Ie!==Ve)throw l.error(1201);Ie=e},compile(e,t){let s;if(u(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Ie.createHTML(e);const t=s.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(s=t)}else s=e;const i=document.adoptNode(s.content),n=new Ae(i,t);return ke(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==ee.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),je(n,i,"r"),Te.node=null,n.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e){if(1===e.length)return e[0];let t,s,i=!1;const n=e.length,r=e.map((e=>u(e)?()=>e:(t=e.sourceAspect||t,s=e.dataBinding||s,i=i||e.dataBinding.isVolatile,e.dataBinding.evaluate)));s.evaluate=(e,t)=>{let s="";for(let i=0;i<n;++i)s+=r[i](e,t);return s},s.isVolatile=i;const o=new pe(s);return oe.assign(o,t),o}};class Me{constructor(e,t){this.result=null,this.toJSON=f,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Ee.compile(this.html,this.factories)),this.result.createView(e)}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}}const Fe=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Le(e,t,s){const i=Fe.exec(t);return null!==i&&oe.assign(e,i[2]),e.createHTML(s)}function ze(e,...t){let s="";const i=Object.create(null),n=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Y();return i[s]=e,s};for(let i=0,r=e.length-1;i<r;++i){const r=e[i],o=t[i];let l;if(s+=r,d(o))s+=Le(new pe(be(o)),r,n);else if(u(o)){const e=Fe.exec(r);if(null!==e){const t=new pe(ve((()=>o)));oe.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof re?s+=Le(new pe(o),r,n):void 0===(l=ie.getForInstance(o))?s+=Le(new pe(ve((()=>o))),r,n):l.aspected?s+=Le(o,r,n):s+=o.createHTML(n)}return new Me(s+e[e.length-1],i)}class Pe extends le{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ie.define(Pe);const Re=e=>new Pe(e);function _e(e,t){const s=d(e)?e:()=>e,i=d(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const De=Object.freeze({positioning:!1,recycle:!0});function He(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Ue(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}class qe{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=He,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Ue)}bind(e){this.location=e.targets[this.directive.nodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),this.refreshAllViews(),e.onUnbind(this)}unbind(){null!==this.itemsObserver&&this.itemsObserver.unsubscribe(this),this.unbindAllViews()}handleChange(e,t){if(t===this.itemsBindingObserver)this.items=this.itemsBindingObserver.bind(this.controller),this.observeItems(),this.refreshAllViews();else if(t===this.templateBindingObserver)this.template=this.templateBindingObserver.bind(this.controller),this.refreshAllViews(!0);else{if(!t[0])return;t[0].reset?this.refreshAllViews():this.updateViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=a);const t=this.itemsObserver,s=this.itemsObserver=y.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=0,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,g=d.index;const p=g+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;g<p;++g){const e=t[g],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(g,0,d),s(d,i,g,r),d.insertBefore(c)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(Ce.disposeContiguousBatch(l),a=0),0===a){this.views=l=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),l[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<a){n(l[e],t,e,r)}else{const o=s.create();n(o,t,e,r),l.push(o),o.insertBefore(i)}const h=l.splice(e,a-e);for(e=0,o=h.length;e<o;++e)h[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}class Qe{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=Y(),E.enable()}createHTML(e){return Z.comment(e(this))}createBehavior(){return new qe(this)}}function Je(e,t,s=De){const i=me(e),n=me(t);return new Qe(i,n,Object.assign(Object.assign({},De),s))}ie.define(Qe);const We=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):We;class Ge extends le{constructor(){super(...arguments),this.controllerProperty=`${this.id}-c`}bind(e){const t=e.targets[this.nodeId];t[this.controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,a),this.disconnect(t),t[this.controllerProperty]=null}getSource(e){return e[this.controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Xe extends Ge{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Ye(e){return u(e)&&(e={property:e}),new Xe(e)}ie.define(Xe);class Ze extends Ge{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=f,t.target=e,e[this.observerProperty]=t),t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function et(e){return u(e)&&(e={property:e}),new Ze(e)}ie.define(Ze);const tt=Object.freeze({locate:c()}),st={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function it(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const nt={toView(e){const t=it(e);return t?t.toString():t},fromView:it};class rt{constructor(e,t,s=t.toLowerCase(),i="reflect",n){this.guards=new Set,this.Owner=e,this.name=t,this.attribute=s,this.mode=i,this.converter=n,this.fieldName=`_${t}`,this.callbackName=`${t}Changed`,this.hasCallback=this.callbackName in e.prototype,"boolean"===i&&void 0===n&&(this.converter=st)}setValue(e,t){const s=e[this.fieldName],i=this.converter;void 0!==i&&(t=i.fromView(t)),s!==t&&(e[this.fieldName]=t,this.tryReflectToAttribute(e),this.hasCallback&&e[this.callbackName](s,t),e.$fastController.notify(this.name))}getValue(e){return y.track(e,this.name),e[this.fieldName]}onAttributeChangedCallback(e,t){this.guards.has(e)||(this.guards.add(e),this.setValue(e,t),this.guards.delete(e))}tryReflectToAttribute(e){const t=this.mode,s=this.guards;s.has(e)||"fromView"===t||g.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;Q.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":Q.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(tt.locate(e));for(let i=0,n=t.length;i<n;++i){const n=t[i];if(void 0!==n)for(let t=0,i=n.length;t<i;++t){const i=n[t];u(i)?s.push(new rt(e,i)):s.push(new rt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function ot(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),tt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const lt={mode:"open"},at={},ht=new Set,ct=l.getById(4,(()=>h()));class dt{constructor(e,t=e.definition){var s;this.platformDefined=!1,u(t)&&(t={name:t}),this.type=e,this.name=t.name,this.template=t.template,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=rt.collect(e,t.attributes),r=new Array(n.length),o={},l={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,l[t.attribute]=t,y.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?lt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},lt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?at:Object.assign(Object.assign({},at),t.elementOptions),this.styles=z.normalize(t.styles),ct.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return ht.has(e)||ct.getByType(e)?new dt(class extends e{},t):new dt(e,t)}static registerBaseType(e){ht.add(e)}}dt.getByType=ct.getByType,dt.getForInstance=ct.getForInstance;const ut={bubbles:!0,composed:!0,cancelable:!0},ft=new WeakMap;function gt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ft.get(e))&&void 0!==s?s:null}let pt;class bt extends b{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this._mainStyles=null,this.$fastController=this,this.view=null,this.toJSON=f,this.source=e,this.definition=t;const s=t.shadowOptions;if(void 0!==s){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(s),"closed"===s.mode&&ft.set(e,t))}const i=y.getAccessors(e);if(i.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,n=i.length;s<n;++s){const n=i[s].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return y.track(this,"isConnected"),1===this.stage}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=gt(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=gt(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(3!==this.stage)return;if(this.stage=0,null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,y.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,y.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.stage=3}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ut),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=gt(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=v.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=dt.getForInstance(e);if(void 0===s)throw l.error(1401);return e.$fastController=new pt(e,s)}static setStrategy(e){pt=e}}function vt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=gt(e))&&void 0!==t?t:e.getRootNode()}bt.setStrategy(bt);class yt{constructor(e){const t=yt.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){const t=vt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=vt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}yt.styleSheetCache=new Map;let mt=0;function wt(e){return e===document?document.body:e}function Ct(e){const t=class extends e{constructor(){super(),bt.forCustomElement(this)}$emit(e,t,s){return this.$fastController.emit(e,t,s)}connectedCallback(){this.$fastController.connect()}disconnectedCallback(){this.$fastController.disconnect()}attributeChangedCallback(e,t,s){this.$fastController.onAttributeChangedCallback(e,t,s)}};return dt.registerBaseType(t),t}function St(e,t){return d(e)?dt.compose(e,t).define().type:dt.compose(this,e).define().type}z.setDefaultStrategy(z.supportsAdoptedStyleSheets?yt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++mt}addStylesTo(e){e=wt(vt(e));const t=this.styles,s=this.styleClass;for(let i=0;i<t.length;i++){const n=document.createElement("style");n.innerHTML=t[i],n.className=s,e.append(n)}}removeStylesFrom(e){const t=(e=wt(vt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}});const xt=Object.assign(Ct(HTMLElement),{from:function(e){return Ct(e)},define:St,compose:function(e,t){return d(e)?dt.compose(e,t):dt.compose(this,e)}});function Tt(e){return function(t){St(t,e)}}export{E as ArrayObserver,oe as Aspect,tt as AttributeConfiguration,rt as AttributeDefinition,re as Binding,R as CSSDirective,Ze as ChildrenDirective,Ee as Compiler,Q as DOM,bt as ElementController,z as ElementStyles,S as ExecutionContext,l as FAST,xt as FASTElement,dt as FASTElementDefinition,pe as HTMLBindingDirective,ie as HTMLDirective,Ce as HTMLView,Z as Markup,Ge as NodeObservationDirective,y as Observable,ee as Parser,b as PropertyChangeNotifier,Pe as RefDirective,qe as RepeatBehavior,Qe as RepeatDirective,Xe as SlottedDirective,v as SourceLifetime,x as Splice,$ as SpliceStrategy,T as SpliceStrategySupport,le as StatelessAttachedAttributeDirective,p as SubscriberSet,g as Updates,te as ViewBehaviorOrchestrator,Me as ViewTemplate,ot as attr,be as bind,st as booleanConverter,et as children,c as createMetadataLocator,h as createTypeRegistry,H as css,_ as cssDirective,q as cssPartial,Tt as customElement,Ke as elements,a as emptyArray,ze as html,ne as htmlDirective,M as lengthOf,ye as listener,me as normalizeBinding,nt as nullableNumberConverter,m as observable,ve as oneTime,Re as ref,Je as repeat,Ye as slotted,w as volatile,_e as when};
|