@microsoft/fast-element 2.0.0-beta.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.json +497 -0
- package/CHANGELOG.md +172 -1
- package/README.md +1 -9
- package/api-extractor.context.json +14 -0
- package/api-extractor.di.json +14 -0
- package/dist/context/context.api.json +1068 -0
- package/dist/di/di.api.json +4929 -0
- package/dist/dts/binding/binding.d.ts +49 -0
- package/dist/dts/binding/normalize.d.ts +9 -0
- package/dist/dts/binding/one-time.d.ts +11 -0
- package/dist/dts/binding/one-way.d.ts +20 -0
- package/dist/dts/{templating/binding-signal.d.ts → binding/signal.d.ts} +19 -4
- package/dist/dts/{templating/binding-two-way.d.ts → binding/two-way.d.ts} +9 -5
- package/dist/dts/components/attributes.d.ts +6 -0
- package/dist/dts/components/element-controller.d.ts +104 -8
- package/dist/dts/components/element-hydration.d.ts +2 -0
- package/dist/dts/components/fast-definitions.d.ts +6 -0
- package/dist/dts/components/hydration.d.ts +56 -0
- package/dist/dts/components/install-hydration.d.ts +1 -0
- package/dist/dts/context.d.ts +29 -15
- package/dist/dts/di/di.d.ts +0 -5
- package/dist/dts/dom-policy.d.ts +83 -0
- package/dist/dts/dom.d.ts +100 -0
- package/dist/dts/hydration/target-builder.d.ts +63 -0
- package/dist/dts/index.d.ts +33 -26
- package/dist/dts/index.rollup.d.ts +0 -1
- package/dist/dts/index.rollup.debug.d.ts +0 -1
- package/dist/dts/interfaces.d.ts +32 -82
- package/dist/dts/metadata.d.ts +6 -5
- package/dist/dts/observation/arrays.d.ts +1 -1
- package/dist/dts/observation/observable.bench.d.ts +18 -0
- package/dist/dts/observation/observable.d.ts +5 -5
- package/dist/dts/pending-task.d.ts +19 -7
- package/dist/dts/platform.d.ts +11 -2
- package/dist/dts/polyfills.d.ts +0 -8
- package/dist/dts/styles/css-binding-directive.d.ts +60 -0
- package/dist/dts/styles/css.d.ts +9 -7
- package/dist/dts/styles/element-styles.d.ts +1 -14
- package/dist/dts/styles/host.d.ts +2 -5
- package/dist/dts/styles/style-strategy.d.ts +42 -0
- package/dist/dts/templating/compiler.d.ts +11 -13
- package/dist/dts/templating/{binding.d.ts → html-binding-directive.d.ts} +21 -41
- package/dist/dts/templating/html-directive.d.ts +44 -140
- package/dist/dts/templating/install-hydratable-view-templates.d.ts +1 -0
- package/dist/dts/templating/node-observation.d.ts +11 -1
- package/dist/dts/templating/ref.d.ts +4 -0
- package/dist/dts/templating/render.bench.d.ts +3 -0
- package/dist/dts/templating/render.d.ts +49 -9
- package/dist/dts/templating/repeat-basic-reverse.bench.d.ts +3 -0
- package/dist/dts/templating/repeat-basic-shift.bench.d.ts +3 -0
- package/dist/dts/templating/repeat.d.ts +31 -9
- package/dist/dts/templating/template.d.ts +97 -12
- package/dist/dts/templating/view.d.ts +146 -29
- package/dist/dts/templating/when-basic.bench.d.ts +3 -0
- package/dist/dts/templating/when-conditional.bench.d.ts +3 -0
- package/dist/dts/templating/when-switch.bench.d.ts +3 -0
- package/dist/dts/templating/when.d.ts +3 -1
- package/dist/dts/testing/fakes.d.ts +12 -1
- package/dist/dts/tsdoc-metadata.json +1 -1
- package/dist/dts/utilities.d.ts +55 -1
- package/dist/esm/binding/binding.js +18 -0
- package/dist/esm/binding/normalize.js +17 -0
- package/dist/esm/binding/one-time.js +21 -0
- package/dist/esm/binding/one-way.js +30 -0
- package/dist/esm/{templating/binding-signal.js → binding/signal.js} +22 -6
- package/dist/esm/{templating/binding-two-way.js → binding/two-way.js} +18 -12
- package/dist/esm/components/attributes.js +16 -1
- package/dist/esm/components/element-controller.js +319 -49
- package/dist/esm/components/element-hydration.js +2 -0
- package/dist/esm/components/fast-definitions.js +12 -4
- package/dist/esm/components/fast-element.js +3 -1
- package/dist/esm/components/hydration.js +104 -0
- package/dist/esm/components/install-hydration.js +3 -0
- package/dist/esm/context.js +26 -4
- package/dist/esm/debug.js +8 -2
- package/dist/esm/di/di.js +9 -12
- package/dist/esm/dom-policy.js +345 -0
- package/dist/esm/dom.js +101 -0
- package/dist/esm/hydration/target-builder.js +175 -0
- package/dist/esm/index.js +34 -25
- package/dist/esm/index.rollup.debug.js +3 -1
- package/dist/esm/index.rollup.js +3 -1
- package/dist/esm/interfaces.js +51 -3
- package/dist/esm/metadata.js +11 -8
- package/dist/esm/observation/arrays.js +1 -1
- package/dist/esm/observation/observable.bench.js +79 -0
- package/dist/esm/observation/observable.js +20 -15
- package/dist/esm/observation/update-queue.js +2 -2
- package/dist/esm/pending-task.js +13 -1
- package/dist/esm/platform.js +12 -2
- package/dist/esm/polyfills.js +3 -61
- package/dist/esm/styles/css-binding-directive.js +76 -0
- package/dist/esm/styles/css.js +14 -7
- package/dist/esm/styles/element-styles.js +0 -33
- package/dist/esm/styles/style-strategy.js +1 -0
- package/dist/esm/templating/children.js +8 -4
- package/dist/esm/templating/compiler.js +37 -44
- package/dist/esm/templating/html-binding-directive.js +218 -0
- package/dist/esm/templating/html-directive.js +25 -152
- package/dist/esm/templating/install-hydratable-view-templates.js +17 -0
- package/dist/esm/templating/node-observation.js +14 -8
- package/dist/esm/templating/ref.js +1 -1
- package/dist/esm/templating/render.bench.js +56 -0
- package/dist/esm/templating/render.js +74 -30
- package/dist/esm/templating/repeat-basic-reverse.bench.js +43 -0
- package/dist/esm/templating/repeat-basic-shift.bench.js +43 -0
- package/dist/esm/templating/repeat.js +116 -17
- package/dist/esm/templating/template.js +135 -60
- package/dist/esm/templating/view.js +254 -34
- package/dist/esm/templating/when-basic.bench.js +36 -0
- package/dist/esm/templating/when-conditional.bench.js +39 -0
- package/dist/esm/templating/when-switch.bench.js +68 -0
- package/dist/esm/templating/when.js +12 -5
- package/dist/esm/testing/fakes.js +32 -1
- package/dist/esm/testing/fixture.js +1 -1
- package/dist/esm/utilities.js +97 -1
- package/dist/fast-element.api.json +9788 -5666
- package/dist/fast-element.d.ts +813 -2392
- package/dist/fast-element.debug.js +2785 -969
- package/dist/fast-element.debug.min.js +3 -1
- package/dist/fast-element.js +2638 -828
- package/dist/fast-element.min.js +3 -1
- package/dist/fast-element.untrimmed.d.ts +661 -313
- package/docs/{api-report.md → api-report.api.md} +238 -151
- package/docs/context/api-report.api.md +69 -0
- package/docs/di/api-report.api.md +315 -0
- package/karma.conf.cjs +2 -1
- package/package.json +59 -47
- package/scripts/run-api-extractor.js +51 -0
- package/scripts/run-benchmarks.js +46 -0
- package/tensile.config.js +12 -0
- package/dist/dts/templating/dom.d.ts +0 -41
- package/dist/esm/templating/binding.js +0 -282
- package/dist/esm/templating/dom.js +0 -49
- package/docs/guide/declaring-templates.md +0 -230
- package/docs/guide/defining-elements.md +0 -214
- package/docs/guide/leveraging-css.md +0 -253
- package/docs/guide/next-steps.md +0 -13
- package/docs/guide/observables-and-state.md +0 -213
- package/docs/guide/using-directives.md +0 -576
- package/docs/guide/working-with-shadow-dom.md +0 -296
package/dist/fast-element.min.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
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});const e={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},e));const t=globalThis.FAST;if(void 0===t.getById){const s=Object.create(null);Reflect.defineProperty(t,"getById",Object.assign({value(e,t){let i=s[e];return void 0===i&&(i=t?s[e]=t():null),i}},e))}const s=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;function i(e){return e===document?document.body:e}let n=0;class r{constructor(e){this.styles=e,this.styleClass="fast-"+ ++n}addStylesTo(e){e=i(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.querySelectorAll(`.${this.styleClass}`);e=i(e);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}s||t.getById(5,(()=>r));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 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 g=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 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.binding=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!==g.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.binding(e,t)}finally{i=s}return n}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 B(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 A(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++)A(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(B(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 I(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class $ 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,I(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 $(e)));const e=Array.prototype;e.$fastPatch||(I(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}const L=new Map;let _;function z(e){return e.map((e=>e instanceof F?z(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class F{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof F?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(_),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(z(this.styles)),this}static setDefaultStrategy(e){_=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new F(e):e instanceof F?e:new F([e])}}F.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;class M{constructor(e){this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let t=L.get(e);return void 0===t&&(t=new CSSStyleSheet,t.replaceSync(e),L.set(e,t)),t}))}addStylesTo(e){e.adoptedStyleSheets=[...e.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=this.sheets;e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))}}F.setDefaultStrategy(l.getById(5,(()=>M)));const P=h(),R=Object.freeze({getForInstance:P.getForInstance,getByType:P.getByType,define:e=>(P.register({type:e}),e)});function H(){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 F||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 U=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t),n=new F(s);return i.length?n.withBehaviors(...i):n};class q{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 F(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(q);const Q=U.partial=(e,...t)=>{const{styles:s,behaviors:i}=D(e,t);return new q(s,i)},W=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)}}),G=`fast-${Math.random().toString(36).substring(2,8)}`,J=`${G}{`,K=`}${G}`,X=K.length;let Y=0;const Z=()=>`${G}-${++Y}`,ee=Object.freeze({interpolation:e=>`${J}${e}${K}`,attribute:e=>`${Z()}="${J}${e}${K}"`,comment:e=>`\x3c!--${J}${e}${K}--\x3e`}),te=Object.freeze({parse(e,t){const s=e.split(J);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+X)}""!==o&&i.push(o)}return i}}),se=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=Z());e.id||(e.id=Z()),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))))}}}}),ie=h(),ne=Object.freeze({getForInstance:ie.getForInstance,getByType:ie.getByType,define:(e,t)=>((t=t||{}).type=e,ie.register(t),e)});function re(e){return function(t){ne.define(t,e)}}class oe{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const le=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":":switch(e.targetAspect=t.substring(1),e.targetAspect){case"innerHTML":default:e.aspectType=le.property;break;case"classList":e.aspectType=le.tokenList}break;case"?":e.targetAspect=t.substring(1),e.aspectType=le.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=le.event;break;default:"class"===t?(e.targetAspect="className",e.aspectType=le.property):(e.targetAspect=t,e.aspectType=le.attribute)}else e.aspectType=le.content}});class ae{constructor(e){this.options=e,this.id=Z()}createHTML(e){return ee.attribute(e(this))}createBehavior(){return this}}const he=globalThis.TrustedHTML?e=>(t,s)=>{const i=e(t,s);if(i instanceof TrustedHTML)return i;throw l.error(1202)}:e=>e;class ce extends oe{createObserver(e,t){return v.binding(this.evaluate,t,this.isVolatile)}}class de extends oe{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ue(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 fe(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={c:0,v:Object.create(null)},o=r.v;let l=r.c;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 pe=(e,t,s)=>e[t]=s,be=()=>{};class ge{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=Z(),this.aspectType=le.content,this.bind=this.bindDefault,this.data=`${this.id}-d`}createHTML(e){return ee.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=he(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=W.setAttribute;break;case 2:this.updateTarget=W.setBooleanAttribute;break;case 3:this.updateTarget=pe;break;case 4:this.bind=this.bindContent,this.updateTarget=ue;break;case 5:this.updateTarget=fe;break;case 6:this.bind=this.bindEvent,this.updateTarget=be;break;default:throw l.error(1205)}return this}bindDefault(e){var t;const s=e.targets[this.nodeId],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),this.updateTarget===ue&&e.onUnbind(this)}bindContent(e){this.bindDefault(e),e.onUnbind(this)}bindEvent(e){const t=e.targets[this.nodeId];t[this.data]=e,t.addEventListener(this.targetAspect,this,this.dataBinding.options)}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;C.setEvent(e);const s=t[this.data],i=this.dataBinding.evaluate(s.source,s.context);C.setEvent(null),!0!==i&&e.preventDefault()}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ve(e,t=v.isVolatileBinding(e)){return new ce(e,t)}function ye(e){return new de(e)}function me(e,t){const s=new ce(e,!1);return s.options=t,s}function we(e){return d(e)?ve(e):e instanceof oe?e:ye((()=>e))}function Ce(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}ne.define(ge,{aspected:!0});class xe{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=g.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(){Ce(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){Ce(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}v.defineProperty(xe.prototype,"index"),v.defineProperty(xe.prototype,"length");const Te=(e,t)=>`${e}.${t}`,Se={},Oe={index:0,node:null};function Be(e){e.startsWith("fast-")||l.warn(1204,{name:e})}const Ae=new Proxy(document.createElement("div"),{get(e,t){Be(t);const s=Reflect.get(e,t);return d(s)?s.bind(e):s},set:(e,t,s)=>(Be(t),Reflect.set(e,t,s))});class ke{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=Se[t];if(!n){const i=`_${t}`;Se[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:Ae;for(const e of this.nodeIds)s[e];return new xe(t,this.factories,s)}}function je(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=te.parse(d,l);let f=null;null===u?r&&(f=new ge(ye((()=>d))),le.assign(f,c.name)):f=Le.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Ie(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=Te(t,i);switch(s.nodeType){case 1:je(e,t,s,n,i),Ie(e,s,n);break;case 3:return function(e,t,s,i,n){const r=te.parse(t.textContent,e.directives);if(null===r)return Oe.node=t.nextSibling,Oe.index=n+1,Oe;let o,l=o=t;for(let t=0,a=r.length;t<a;++t){const a=r[t];0!==t&&(n++,i=Te(s,n),o=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),u(a)?o.textContent=a:(o.textContent=" ",le.assign(a),e.addFactory(a,s,i,n)),l=o}return Oe.index=n+1,Oe.node=l.nextSibling,Oe}(e,s,t,n,i);case 8:const r=te.parse(s.data,e.directives);null!==r&&e.addFactory(Le.aggregate(r),t,n,i)}return Oe.index=i+1,Oe.node=s.nextSibling,Oe}const Ve={createHTML:e=>e};let Ee=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Ve):Ve;const Ne=Ee,Le={setHTMLPolicy(e){if(Ee!==Ne)throw l.error(1201);Ee=e},compile(e,t){let s;if(u(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Ee.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 ke(i,t);return je(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==te.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Ie(n,i,"r"),Oe.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 ge(s);return le.assign(o,t),o}};class _e{constructor(e,t){this.result=null,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=Le.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 ze=/([ \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=ze.exec(t);return null!==i&&le.assign(e,i[2]),e.createHTML(s)}function Me(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=Z();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 ge(ve(o)),r,n);else if(u(o)){const e=ze.exec(r);if(null!==e){const t=new ge(ye((()=>o)));le.assign(t,e[2]),s+=t.createHTML(n)}else s+=o}else o instanceof oe?s+=Fe(new ge(o),r,n):void 0===(l=ne.getForInstance(o))?s+=Fe(new ge(ye((()=>o))),r,n):l.aspected?s+=Fe(o,r,n):s+=o.createHTML(n)}return new _e(s+e[e.length-1],i)}class Pe extends ae{bind(e){e.source[this.options]=e.targets[this.nodeId]}}ne.define(Pe);const Re=e=>new Pe(e);function He(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 Ue(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function qe(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.views=[],this.items=null,this.itemsObserver=null,this.bindView=Ue,this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=qe)}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 b=p+d.addedCount,g=t.splice(d.index,u.length),v=h=l.length+g.length;for(;p<b;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&g.length>0?(d=g[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}g[f]&&l.push(...g.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=e,i.index=s}}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||(xe.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 We{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=Z(),E.enable()}createHTML(e){return ee.comment(e(this))}createBehavior(){return new Qe(this)}}function Ge(e,t,s=De){const i=we(e),n=we(t);return new We(i,n,Object.assign(Object.assign({},De),s))}ne.define(We);const Je=e=>1===e.nodeType,Ke=e=>e?t=>1===t.nodeType&&t.matches(e):Je;class Xe extends ae{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 Ye extends Xe{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 Ze(e){return u(e)&&(e={property:e}),new Ye(e)}ne.define(Ye);class et extends Xe{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 tt(e){return u(e)&&(e={property:e}),new et(e)}ne.define(et);const st=Object.freeze({locate:c()}),it={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function nt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const rt={toView(e){const t=nt(e);return t?t.toString():t},fromView:nt};class ot{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=it)}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;W.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":W.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(st.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 ot(e,i)):s.push(new ot(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function lt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),st.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const at={mode:"open"},ht={},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=ot.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?at:null===t.shadowOptions?void 0:Object.assign(Object.assign({},at),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?ht:Object.assign(Object.assign({},ht),t.elementOptions),this.styles=F.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){const s=ct.getByType(e);return new dt(s?class extends e{}:e,t)}}dt.getByType=ct.getByType,dt.getForInstance=ct.getForInstance;const ut={bubbles:!0,composed:!0,cancelable:!0},ft=new WeakMap;function pt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ft.get(e))&&void 0!==s?s:null}class bt extends b{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&&ft.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,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.append(e);else if(!e.isAttachedTo(i)){const t=e.behaviors;if(e.addStylesTo(i),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,i=null!==(t=pt(s))&&void 0!==t?t:s.getRootNode();if(e instanceof HTMLElement)i.removeChild(e);else if(e.isAttachedTo(i)){const t=e.behaviors;if(e.removeStylesFrom(i),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(this._isConnected)return;this.needsInitialization?this.finishInitialization():null!==this.view&&this.view.bind(this.source);const e=this.behaviors;if(null!==e)for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);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},ut),s)))}finishInitialization(){const e=this.source,t=this.boundObservables;if(null!==t){const 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}this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1}renderTemplate(e){var t;const s=this.source,i=null!==(t=pt(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=g.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 bt(e,s)}}function gt(e){return 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)}}}function vt(e,t){return d(e)?dt.compose(e,t).define().type:dt.compose(this,e).define().type}const yt=Object.assign(gt(HTMLElement),{from:function(e){return gt(e)},define:vt,compose:function(e,t){return d(e)?dt.compose(e,t):dt.compose(this,e)}});function mt(e){return function(t){vt(t,e)}}export{M as AdoptedStyleSheetsStrategy,E as ArrayObserver,le as Aspect,st as AttributeConfiguration,ot as AttributeDefinition,oe as Binding,R as CSSDirective,et as ChildrenDirective,Le as Compiler,W as DOM,bt as ElementController,F as ElementStyles,C as ExecutionContext,l as FAST,yt as FASTElement,dt as FASTElementDefinition,ge as HTMLBindingDirective,ne as HTMLDirective,xe as HTMLView,ee as Markup,Xe as NodeObservationDirective,v as Observable,te as Parser,b as PropertyChangeNotifier,Pe as RefDirective,Qe as RepeatBehavior,We as RepeatDirective,Ye as SlottedDirective,g as SourceLifetime,x as Splice,j as SpliceStrategy,T as SpliceStrategySupport,ae as StatelessAttachedAttributeDirective,p as SubscriberSet,f as Updates,se as ViewBehaviorOrchestrator,_e as ViewTemplate,lt as attr,ve as bind,it as booleanConverter,tt as children,c as createMetadataLocator,h as createTypeRegistry,U as css,H as cssDirective,Q as cssPartial,mt as customElement,Ke as elements,a as emptyArray,Me as html,re as htmlDirective,N as lengthOf,me as listener,we as normalizeBinding,rt as nullableNumberConverter,y as observable,ye as oneTime,Re as ref,Ge as repeat,Ze as slotted,m as volatile,He as when};
|
|
1
|
+
let e;const t="fast-kernel";try{if(document.currentScript)e=document.currentScript.getAttribute(t);else{const s=document.getElementsByTagName("script");e=s[s.length-1].getAttribute(t)}}catch(t){e="isolate"}let s;switch(e){case"share":s=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":s=Object.freeze({updateQueue:1.2,observable:2.2,contextEvent:3.2,elementRegistry:4.2});break;default:const e=`-${Math.random().toString(36).substring(2,8)}`;s=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const i=e=>"function"==typeof e,n=e=>"string"==typeof e,r=()=>{};!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}}();const o={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},o));const a=globalThis.FAST;if(void 0===a.getById){const e=Object.create(null);Reflect.defineProperty(a,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},o))}void 0===a.error&&Object.assign(a,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const l=Object.freeze([]);function c(){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 h(){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}}function d(e){e.prototype.toJSON=r}const u=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),f=e=>e,p=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:f}):{createHTML:f};let g=Object.freeze({createHTML:e=>p.createHTML(e),protect:(e,t,s,i)=>i});const b=g,v=Object.freeze({get policy(){return g},setPolicy(e){if(g!==b)throw a.error(1201);g=e},setAttribute(e,t,s){null==s?e.removeAttribute(t):e.setAttribute(t,s)},setBooleanAttribute(e,t,s){s?e.setAttribute(t,""):e.removeAttribute(t)}});function m(e,t,s,i){return(e,t,s,...r)=>{n(s)&&(s=s.replace(/(javascript:|vbscript:|data:)/,"")),i(e,t,s,...r)}}function y(e,t,s,i){throw a.error(1209,{aspectName:s,tagName:null!=e?e:"text"})}const w={onabort:y,onauxclick:y,onbeforeinput:y,onbeforematch:y,onblur:y,oncancel:y,oncanplay:y,oncanplaythrough:y,onchange:y,onclick:y,onclose:y,oncontextlost:y,oncontextmenu:y,oncontextrestored:y,oncopy:y,oncuechange:y,oncut:y,ondblclick:y,ondrag:y,ondragend:y,ondragenter:y,ondragleave:y,ondragover:y,ondragstart:y,ondrop:y,ondurationchange:y,onemptied:y,onended:y,onerror:y,onfocus:y,onformdata:y,oninput:y,oninvalid:y,onkeydown:y,onkeypress:y,onkeyup:y,onload:y,onloadeddata:y,onloadedmetadata:y,onloadstart:y,onmousedown:y,onmouseenter:y,onmouseleave:y,onmousemove:y,onmouseout:y,onmouseover:y,onmouseup:y,onpaste:y,onpause:y,onplay:y,onplaying:y,onprogress:y,onratechange:y,onreset:y,onresize:y,onscroll:y,onsecuritypolicyviolation:y,onseeked:y,onseeking:y,onselect:y,onslotchange:y,onstalled:y,onsubmit:y,onsuspend:y,ontimeupdate:y,ontoggle:y,onvolumechange:y,onwaiting:y,onwebkitanimationend:y,onwebkitanimationiteration:y,onwebkitanimationstart:y,onwebkittransitionend:y,onwheel:y},S={elements:{a:{[u.attribute]:{href:m},[u.property]:{href:m}},area:{[u.attribute]:{href:m},[u.property]:{href:m}},button:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},embed:{[u.attribute]:{src:y},[u.property]:{src:y}},form:{[u.attribute]:{action:m},[u.property]:{action:m}},frame:{[u.attribute]:{src:m},[u.property]:{src:m}},iframe:{[u.attribute]:{src:m},[u.property]:{src:m,srcdoc:y}},input:{[u.attribute]:{formaction:m},[u.property]:{formAction:m}},link:{[u.attribute]:{href:y},[u.property]:{href:y}},object:{[u.attribute]:{codebase:y,data:y},[u.property]:{codeBase:y,data:y}},script:{[u.attribute]:{src:y,text:y},[u.property]:{src:y,text:y,innerText:y,textContent:y}},style:{[u.property]:{innerText:y,textContent:y}}},aspects:{[u.attribute]:Object.assign({},w),[u.property]:Object.assign({innerHTML:y},w),[u.event]:Object.assign({},w)}};function C(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=r;break;default:s[i]=n}}for(const t in e)t in s||(s[t]=e[t]);return Object.freeze(s)}function x(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=C(r,{});break;default:s[i]=C(n,r)}}for(const t in e)t in s||(s[t]=C(e[t],{}));return Object.freeze(s)}function B(e,t){const s={};for(const i in t){const n=e[i],r=t[i];switch(n){case null:break;case void 0:s[i]=x(n,{});break;default:s[i]=x(n,r)}}for(const t in e)t in s||(s[t]=x(e[t],{}));return Object.freeze(s)}function T(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const $=Object.freeze({create(e={}){var t,s;const i=null!==(t=e.trustedType)&&void 0!==t?t:function(){const e=e=>e;return globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:e}):{createHTML:e}}(),n=(r=null!==(s=e.guards)&&void 0!==s?s:{},o=S,Object.freeze({elements:r.elements?B(r.elements,o.elements):o.elements,aspects:r.aspects?x(r.aspects,o.aspects):o.aspects}));var r,o;return Object.freeze({createHTML:e=>i.createHTML(e),protect(e,t,s,i){var r;const o=(null!=e?e:"").toLowerCase(),a=n.elements[o];if(a){const n=T(a,e,t,s,i);if(n)return n}return null!==(r=T(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}}),O=a.getById(s.updateQueue,(()=>{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 a(t){e.push(t),e.length<2&&(i?s(o):o())}return Object.freeze({enqueue:a,next:()=>new Promise(a),process:o,setMode:e=>i=e})}));class N{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 k{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 N(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new N(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 A=Object.freeze({unknown:void 0,coupled:1}),E=a.getById(s.observable,(()=>{const e=O.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let r,o=e=>{throw a.error(1101)};function l(e){var t;let i=null!==(t=e.$fastController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=o(e):s.set(e,i=new k(e))),i}const c=h();class u{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==r&&r.watch(e,this.name),e[this.field]}setValue(e,t){const s=this.field,n=e[s];if(n!==t){e[s]=t;const r=e[this.callback];i(r)&&r.call(e,n,t),l(e).notify(this.name)}}}class f extends N{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!==A.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=r;let i;r=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{r=s}return i}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,i=l(e),n=null===s?this.first:{};if(n.propertySource=e,n.propertyName=t,n.notifier=i,i.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;r=void 0,t=s.propertySource[s.propertyName],r=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}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 d(f),Object.freeze({setArrayObserverFactory(e){o=e},getNotifier:l,track(e,t){r&&r.watch(e,t)},trackVolatile(){r&&(r.needsRefresh=!0)},notify(e,t){l(e).notify(t)},defineProperty(e,t){n(t)&&(t=new u(t)),c(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:c,binding(e,t,s=this.isVolatileBinding(e)){return new f(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function M(e,t){E.defineProperty(e,t)}function j(e,t,s){return Object.assign({},s,{get(){return E.trackVolatile(),s.get.apply(this)}})}const V=a.getById(s.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),I=Object.freeze({default:{index:0,length:0,get event(){return I.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>V.get(),setEvent(e){V.set(e)}});class _{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 R=Object.freeze({reset:1,splice:2,optimized:3}),z=new _(0,l,0);z.reset=!0;const L=[z];function F(e,t,s,i,n,r){let o=0,a=0;const c=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,c)),s===e.length&&r===i.length&&(a=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,c-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return l;if(t===s){const e=new _(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new _(t,[],s-t)];const h=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],a=e[t][s-1];let l;l=o<a?o<r?o:r:a<r?a:r,l===r?(r===i?n.push(0):(n.push(1),i=r),t--,s--):l===o?(n.push(3),t--,i=o):(n.push(2),s--,i=a)}return n.reverse()}(function(e,t,s,i,n,r){const o=r-n+1,a=s-t+1,l=new Array(o);let c,h;for(let e=0;e<o;++e)l[e]=new Array(a),l[e][0]=e;for(let e=0;e<a;++e)l[0][e]=e;for(let s=1;s<o;++s)for(let r=1;r<a;++r)e[t+r-1]===i[n+s-1]?l[s][r]=l[s-1][r-1]:(c=l[s-1][r]+1,h=l[s][r-1]+1,l[s][r]=c<h?c:h);return l}(e,t,s,i,n,r)),d=[];let u,f=t,p=n;for(let e=0;e<h.length;++e)switch(h[e]){case 0:void 0!==u&&(d.push(u),u=void 0),f++,p++;break;case 1:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new _(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new _(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function H(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const c=t[l];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,a=c.index+c.addedCount,r<o||a<n?-1:r===o||a===n?0:n<o?r<a?r-o:a-o:a<r?a-n:r-n);if(h>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-h;const n=e.removed.length+c.removed.length-h;if(e.addedCount||n){let t=c.removed;if(e.index<c.index){const s=e.removed.slice(0,c.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>c.index+c.addedCount){const s=e.removed.slice(c.index+c.addedCount-e.index);t.push(...s)}e.removed=t,c.index<e.index&&(e.index=c.index)}else s=!0}else if(e.index<c.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let P=Object.freeze({support:R.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?l:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)H(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(F(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):L,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new _(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new _(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 _(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 _(+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 _(0,[],i.length).adjustTo(e)),n}});const D=Object.freeze({reset:L,setDefaultStrategy(e){P=e}});function U(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class Q extends N{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,U(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,E.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:P).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,O.enqueue(this))}}let q=!1;const W=Object.freeze({enable(){if(q)return;q=!0,E.setArrayObserverFactory((e=>new Q(e)));const e=Array.prototype;e.$fastPatch||(U(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:P)[t.name](this,i,t,e)}})))}});function X(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(W.enable(),t=E.getNotifier(e)),E.track(t.lengthObserver,"length"),e.length}class J{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class G extends J{createObserver(e){return E.binding(this.evaluate,e,this.isVolatile)}}function K(e,t,s=E.isVolatileBinding(e)){return new G(e,t,s)}function Y(e,t){const s=new G(e);return s.options=t,s}class Z extends J{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ee(e,t){return new Z(e,t)}function te(e){return i(e)?K(e):e instanceof J?e:ee((()=>e))}let se;function ie(e){return e.map((e=>e instanceof ne?ie(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}d(Z);class ne{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ne?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(se),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(ie(this.styles)),this}static setDefaultStrategy(e){se=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ne(e):e instanceof ne?e:new ne([e])}}ne.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const re=c(),oe=Object.freeze({getForInstance:re.getForInstance,getByType:re.getByType,define:e=>(re.register({type:e}),e)});function ae(){return function(e){oe.define(e)}}function le(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}class ce{constructor(e,t){this.dataBinding=e,this.targetAspect=t}createCSS(e){return e(this),`var(${this.targetAspect})`}addedCallback(e){var t;const s=e.source;if(!s.$cssBindings){s.$cssBindings=new Map;const e=s.setAttribute;s.setAttribute=(t,i)=>{e.call(s,t,i),"style"===t&&s.$cssBindings.forEach(((e,t)=>le(t,e.controller,e.observer)))}}const i=null!==(t=e[this.targetAspect])&&void 0!==t?t:e[this.targetAspect]=this.dataBinding.createObserver(this,this);i.controller=e,e.source.$cssBindings.set(this,{controller:e,observer:i})}connectedCallback(e){le(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){le(this,t.controller,t)}}oe.define(ce);const he=`${Math.random().toString(36).substring(2,8)}`;let de=0;const ue=()=>`--v${he}${++de}`;function fe(e,t){const s=[];let n="";const r=[],o=e=>{r.push(e)};for(let r=0,a=e.length-1;r<a;++r){n+=e[r];let a=t[r];i(a)?a=new ce(K(a),ue()).createCSS(o):a instanceof J?a=new ce(a,ue()).createCSS(o):void 0!==oe.getForInstance(a)&&(a=a.createCSS(o)),a instanceof ne||a instanceof CSSStyleSheet?(""!==n.trim()&&(s.push(n),n=""),s.push(a)):n+=a}return n+=e[e.length-1],""!==n.trim()&&s.push(n),{styles:s,behaviors:r}}const pe=(e,...t)=>{const{styles:s,behaviors:i}=fe(e,t),n=new ne(s);return i.length?n.withBehaviors(...i):n};class ge{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(n(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new ne(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)}}oe.define(ge),pe.partial=(e,...t)=>{const{styles:s,behaviors:i}=fe(e,t);return new ge(s,i)};const be=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,ve=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,me=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,ye=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,we=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Se=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Ce(e){return e&&e.nodeType===Node.COMMENT_NODE}const xe=Object.freeze({attributeMarkerName:"data-fe-b",attributeBindingSeparator:" ",contentBindingStartMarker:(e,t)=>`fe-b$$start$$${e}$$${t}$$fe-b`,contentBindingEndMarker:(e,t)=>`fe-b$$end$$${e}$$${t}$$fe-b`,repeatStartMarker:e=>`fe-repeat$$start$$${e}$$fe-repeat`,repeatEndMarker:e=>`fe-repeat$$end$$${e}$$fe-repeat`,isContentBindingStartMarker:e=>be.test(e),isContentBindingEndMarker:e=>ve.test(e),isRepeatViewStartMarker:e=>me.test(e),isRepeatViewEndMarker:e=>ye.test(e),isElementBoundaryStartMarker:e=>Ce(e)&&we.test(e.data.trim()),isElementBoundaryEndMarker:e=>Ce(e)&&Se.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseContentBindingStartMarker:e=>$e(be,e),parseContentBindingEndMarker:e=>$e(ve,e),parseRepeatStartMarker:e=>Be(me,e),parseRepeatEndMarker:e=>Be(ye,e),parseElementBoundaryStartMarker:e=>Te(we,e.trim()),parseElementBoundaryEndMarker:e=>Te(Se,e)});function Be(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Te(e,t){const s=e.exec(t);return null===s?s:s[1]}function $e(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Oe=Symbol.for("fe-hydration");function Ne(e){return e[Oe]===Oe}const ke=`fast-${Math.random().toString(36).substring(2,8)}`,Ae=`${ke}{`,Ee=`}${ke}`,Me=Ee.length;let je=0;const Ve=()=>`${ke}-${++je}`,Ie=Object.freeze({interpolation:e=>`${Ae}${e}${Ee}`,attribute:e=>`${Ve()}="${Ae}${e}${Ee}"`,comment:e=>`\x3c!--${Ae}${e}${Ee}--\x3e`}),_e=Object.freeze({parse(e,t){const s=e.split(Ae);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(Ee);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+Me)}""!==o&&i.push(o)}return i}}),Re=c(),ze=Object.freeze({getForInstance:Re.getForInstance,getByType:Re.getByType,define:(e,t)=>((t=t||{}).type=e,Re.register(t),e),assignAspect(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?u.tokenList:u.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=u.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=u.event;break;default:e.targetAspect=t,e.aspectType=u.attribute}else e.aspectType=u.content}});function Le(e){return function(t){ze.define(t,e)}}class Fe{constructor(e){this.options=e}createHTML(e){return Ie.attribute(e(this))}createBehavior(){return this}}d(Fe);class He extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function Pe(e){return e.nodeType===Node.COMMENT_NODE}function De(e){return e.nodeType===Node.TEXT_NODE}function Ue(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,Pe(t)||De(t)?t.data.length:t.childNodes.length),s}function Qe(e,t,s){const i=xe.parseAttributeBinding(e);if(null!==i){for(const n of i){if(!t[n])throw new He(`HydrationView was unable to successfully target factory on ${e.nodeName} inside ${e.getRootNode().host.nodeName}. This likely indicates a template mismatch between SSR rendering and hydration.`,t,e);We(t[n],e,s)}e.removeAttribute(xe.attributeMarkerName)}}function qe(e,t,s,i,n){if(xe.isElementBoundaryStartMarker(e))!function(e,t){const s=xe.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(Pe(i)){const e=xe.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(xe.isContentBindingStartMarker(e.data)){const r=xe.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let h=t.nextSibling();e.data="";const d=h;for(;null!==h;){if(Pe(h)){const e=xe.parseContentBindingEndMarker(h.data);if(e&&e[1]===a)break}c.push(h),h=t.nextSibling()}if(null===h){const t=e.getRootNode();throw new Error(`Error hydrating Comment node inside "${function(e){return e instanceof DocumentFragment&&"mode"in e}(t)?t.host.nodeName:t.nodeName}".`)}if(h.data="",1===c.length&&De(c[0]))We(l,c[0],i);else{h!==d&&null!==h.previousSibling&&(n[l.targetNodeId]={first:d,last:h.previousSibling});We(l,h.parentNode.insertBefore(document.createTextNode(""),h),i)}}}function We(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Xe;function Je(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;){if(i=n.nextSibling,!i)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);s.removeChild(n),n=i}s.removeChild(t)}class Ge{constructor(){this.index=0,this.length=0}get event(){return I.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}}class Ke extends Ge{constructor(e,t,s){super(),this.fragment=e,this.factories=t,this.targets=s,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,this.firstChild=e.firstChild,this.lastChild=e.lastChild}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(){Je(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){Je(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}d(Ke),E.defineProperty(Ke.prototype,"index"),E.defineProperty(Ke.prototype,"length");const Ye="unhydrated",Ze="hydrating",et="hydrated";class tt extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Xe=Oe,d(class extends Ge{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Xe]=Oe,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=Ye,this._bindingViewBoundaries={},this._targets={},this.factories=s.compile().factories}get hydrationStage(){return this._hydrationStage}get targets(){return this._targets}get bindingViewBoundaries(){return this._bindingViewBoundaries}insertBefore(e){if(null!==this.fragment)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)}}appendTo(e){null!==this.fragment&&e.appendChild(this.fragment)}remove(){const e=this.fragment||(this.fragment=document.createDocumentFragment()),t=this.lastChild;let s,i=this.firstChild;for(;i!==t;){if(s=i.nextSibling,!s)throw new Error(`Unmatched first/last child inside "${t.getRootNode().host.nodeName}".`);e.appendChild(i),i=s}e.appendChild(t)}bind(e,t=this){var s,i;if(this.hydrationStage!==et&&(this._hydrationStage=Ze),this.source===e)return;let n=this.behaviors;if(null===n){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=Ue(e,t),n=i.commonAncestorContainer,r=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_COMMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>0===i.comparePoint(e,0)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}),o={},a={};let l=r.currentNode=e;for(;null!==l;){switch(l.nodeType){case Node.ELEMENT_NODE:Qe(l,s,o);break;case Node.COMMENT_NODE:qe(l,r,s,o,a)}l=r.nextNode()}return i.detach(),{targets:o,boundaries:a}}(this.firstChild,this.lastChild,this.factories);this._targets=e,this._bindingViewBoundaries=t}catch(e){if(e instanceof He){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=n=new Array(this.factories.length);const r=this.factories;for(let e=0,t=r.length;e<t;++e){const t=r[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&We(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;throw"string"!=typeof e&&(e=e.innerHTML),new tt(`HydrationView was unable to successfully target bindings inside "${null===(i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host)||void 0===i?void 0:i.nodeName}".`,t,Ue(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),n[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=n.length;e<t;++e)n[e].bind(this)}this.isBound=!0,this._hydrationStage=et}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Je(this.firstChild,this.lastChild),this.unbind()}onUnbind(e){this.unbindables.push(e)}evaluateUnbindables(){const e=this.unbindables;for(let t=0,s=e.length;t<s;++t)e[t].unbind(this);e.length=0}});const st={[u.attribute]:v.setAttribute,[u.booleanAttribute]:v.setBooleanAttribute,[u.property]:(e,t,s)=>e[t]=s,[u.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$fastView;if(void 0===t)if(Ne(i)&&Ne(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==et){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else 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}},[u.tokenList]:function(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 a=r.v;const l=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]=a,l.add(s))}}if(r.v=a+1,0!==a){a-=1;for(const e in o)o[e]===a&&l.remove(e)}},[u.event]:()=>{}};class it{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=u.content}createHTML(e){return Ie.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=st[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw a.error(1205);this.data=`${this.id}-d`,this.updateTarget=s.protect(this.targetTagName,this.aspectType,this.targetAspect,t)}return this}bind(e){var t;const s=e.targets[this.targetNodeId],i=Ne(e)&&e.hydrationStage&&e.hydrationStage!==et;switch(this.aspectType){case u.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case u.content:e.onUnbind(this);default:const n=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);if(n.target=s,n.controller=e,i&&(this.aspectType===u.attribute||this.aspectType===u.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){I.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);I.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)}}ze.define(it,{aspected:!0});const nt=(e,t)=>`${e}.${t}`,rt={},ot={index:0,node:null};function at(e){e.startsWith("fast-")||a.warn(1204,{name:e})}const lt=new Proxy(document.createElement("div"),{get(e,t){at(t);const s=Reflect.get(e,t);return i(s)?s.bind(e):s},set:(e,t,s)=>(at(t),Reflect.set(e,t,s))});class ct{constructor(e,t,s){this.fragment=e,this.directives=t,this.policy=s,this.proto=null,this.nodeIds=new Set,this.descriptors={},this.factories=[]}addFactory(e,t,s,i,n){var r,o;this.nodeIds.has(s)||(this.nodeIds.add(s),this.addTargetDescriptor(t,s,i)),e.id=null!==(r=e.id)&&void 0!==r?r:Ve(),e.targetNodeId=s,e.targetTagName=n,e.policy=null!==(o=e.policy)&&void 0!==o?o:this.policy,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=rt[t];if(!n){const i=`_${t}`;rt[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:lt;for(const e of this.nodeIds)s[e];return new Ke(t,this.factories,s)}}function ht(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,c=o.length;l<c;++l){const h=o[l],d=h.value,u=_e.parse(d,a);let f=null;null===u?r&&(f=new it(ee((()=>d),e.policy)),ze.assignAspect(f,h.name)):f=pt.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),l--,c--,e.addFactory(f,t,i,n,s.tagName))}}function dt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=ut(e,s,n,i);n=t.node,i=t.index}}function ut(e,t,s,i){const r=nt(t,i);switch(s.nodeType){case 1:ht(e,t,s,r,i),dt(e,s,r);break;case 3:return function(e,t,s,i,r){const o=_e.parse(t.textContent,e.directives);if(null===o)return ot.node=t.nextSibling,ot.index=r+1,ot;let a,l=a=t;for(let t=0,c=o.length;t<c;++t){const c=o[t];0!==t&&(r++,i=nt(s,r),a=l.parentNode.insertBefore(document.createTextNode(""),l.nextSibling)),n(c)?a.textContent=c:(a.textContent=" ",ze.assignAspect(c),e.addFactory(c,s,i,r,null)),l=a}return ot.index=r+1,ot.node=l.nextSibling,ot}(e,s,t,r,i);case 8:const o=_e.parse(s.data,e.directives);null!==o&&e.addFactory(pt.aggregate(o),t,r,i,null)}return ot.index=i+1,ot.node=s.nextSibling,ot}const ft="TEMPLATE",pt={compile(e,t,s=v.policy){let i;if(n(e)){i=document.createElement(ft),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===ft&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const r=document.adoptNode(i.content),o=new ct(r,t,s);var a,l;return ht(o,"",i,"h",0,!0),a=r.firstChild,l=t,(a&&8==a.nodeType&&null!==_e.parse(a.data,l)||1===r.childNodes.length&&Object.keys(t).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),dt(o,r,"r"),ot.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=v.policy){if(1===e.length)return e[0];let s,i,r=!1;const o=e.length,a=e.map((e=>n(e)?()=>e:(s=e.sourceAspect||s,r=r||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),l=new it(K(((e,t)=>{let s="";for(let i=0;i<o;++i)s+=a[i](e,t);return s}),null!=i?i:t,r));return ze.assignAspect(l,s),l}},gt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,bt=Object.create(null);class vt{constructor(e,t=bt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function mt(e,t,s,i=ze.getForInstance(e)){if(i.aspected){const s=gt.exec(t);null!==s&&ze.assignAspect(e,s[2])}return e.createHTML(s)}vt.empty=new vt(""),ze.define(vt);class yt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=pt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new vt(n(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw a.error(1208);if(this.policy)throw a.error(1207);return this.policy=e,this}render(e,t,s){const i=this.create(s);return i.bind(e),i.appendTo(t),i}static create(e,t,s){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Ve();return r[s]=e,s};for(let s=0,r=e.length-1;s<r;++s){const r=e[s];let a,l=t[s];if(n+=r,i(l))l=new it(K(l));else if(l instanceof J)l=new it(l);else if(!(a=ze.getForInstance(l))){const e=l;l=new it(ee((()=>e)))}n+=mt(l,r,o,a)}return new yt(n+e[e.length-1],r,s)}}d(yt);const wt=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return yt.create(e,t);throw a.error(1206)};wt.partial=e=>new vt(e);class St extends Fe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}ze.define(St);const Ct=e=>new St(e),xt=()=>null;function Bt(e){return void 0===e?xt:i(e)?e:()=>e}function Tt(e,t,s){const n=i(e)?e:()=>e,r=Bt(t),o=Bt(s);return(e,t)=>n(e,t)?r(e,t):o(e,t)}const $t=Object.freeze({positioning:!1,recycle:!0});function Ot(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Nt(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])}function kt(e){return e.nodeType===Node.COMMENT_NODE}class At extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Et{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Ot,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e),e.options.positioning&&(this.bindView=Nt)}bind(e){this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.items=this.itemsBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),this.observeItems(!0),Ne(this.template)&&Ne(e)&&e.hydrationStage!==et?this.hydrateViews(this.template):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=l);const t=this.itemsObserver,s=this.itemsObserver=E.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,a=[];let l=0,c=0;for(let h=0,d=e.length;h<d;++h){const d=e[h],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=c=a.length+b.length;for(;p<g;++p){const e=t[p],h=e?e.firstChild:this.location;let d;o&&c>0?(f<=v&&b.length>0?(d=b[f],f++):(d=a[l],l++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&a.push(...b.slice(f))}for(let e=l,t=a.length;e<t;++e)a[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,a=this.views,l=a.length;if(0!==o&&!e&&this.directive.options.recycle||(Ke.disposeContiguousBatch(a),l=0),0===l){this.views=a=new Array(o);for(let e=0;e<o;++e){const o=s.create();n(o,t,e,r),a[e]=o,o.insertBefore(i)}}else{let e=0;for(;e<o;++e)if(e<l){const i=a[e];if(!i){const t=new XMLSerializer;throw new At(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:e,hydrationStage:this.controller.hydrationStage,itemsLength:o,viewsState:a.map((e=>e?"hydrated":"empty")),viewTemplateString:t.serializeToString(s.create().fragment),rootNodeContent:t.serializeToString(this.location.getRootNode())})}n(i,t,e,r)}else{const o=s.create();n(o,t,e,r),a.push(o),o.insertBefore(i)}const c=a.splice(e,l-e);for(e=0,o=c.length;e<o;++e)c[e].dispose()}}unbindAllViews(){const e=this.views;for(let t=0,s=e.length;t<s;++t){const s=e[t];if(!s){const s=new XMLSerializer;throw new At(`View is null or undefined inside "${this.location.getRootNode().host.nodeName}".`,{index:t,hydrationStage:this.controller.hydrationStage,viewsState:e.map((e=>e?"hydrated":"empty")),rootNodeContent:s.serializeToString(this.location.getRootNode())})}s.unbind()}}hydrateViews(e){if(!this.items)return;this.views=new Array(this.items.length);let t=this.location.previousSibling;for(;null!==t;){if(!kt(t)){t=t.previousSibling;continue}const s=xe.parseRepeatEndMarker(t.data);if(null===s){t=t.previousSibling;continue}t.data="";const i=t.previousSibling;if(!i)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": end should never be null.`);let n=i,r=0;for(;null!==n;){if(kt(n))if(xe.isRepeatViewEndMarker(n.data))r++;else if(xe.isRepeatViewStartMarker(n.data)){if(!r){if(xe.parseRepeatStartMarker(n.data)!==s)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": Mismatched start and end markers.`);n.data="",t=n.previousSibling,n=n.nextSibling;const r=e.hydrate(n,i);this.views[s]=r,this.bindView(r,this.items,s,this.controller);break}r--}n=n.previousSibling}if(!n)throw new Error(`Error when hydrating inside "${this.location.getRootNode().host.nodeName}": start should never be null.`)}}}class Mt{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,W.enable()}createHTML(e){return Ie.comment(e(this))}createBehavior(){return new Et(this)}}function jt(e,t,s=$t){const i=te(e),n=te(t);return new Mt(i,n,Object.assign(Object.assign({},$t),s))}ze.define(Mt);const Vt=e=>1===e.nodeType,It=e=>e?t=>1===t.nodeType&&t.matches(e):Vt;class _t extends Fe{get id(){return this._id}set id(e){this._id=e,this._controllerProperty=`${e}-c`}bind(e){const t=e.targets[this.targetNodeId];t[this._controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.targetNodeId];this.updateTarget(e.source,l),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}}const Rt="slotchange";class zt extends _t{observe(e){e.addEventListener(Rt,this)}disconnect(e){e.removeEventListener(Rt,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Lt(e){return n(e)&&(e={property:e}),new zt(e)}ze.define(zt);class Ft extends _t{constructor(e){super(e),this.observerProperty=Symbol(),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=r,e[this.observerProperty]=t),t.target=e,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 Ht(e){return n(e)&&(e={property:e}),new Ft(e)}ze.define(Ft);const Pt="boolean",Dt="reflect",Ut=Object.freeze({locate:h()}),Qt={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e},qt={toView:e=>"boolean"==typeof e?e.toString():"",fromView:e=>[null,void 0,void 0].includes(e)?null:Qt.fromView(e)};function Wt(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Xt={toView(e){const t=Wt(e);return t?t.toString():t},fromView:Wt};class Jt{constructor(e,t,s=t.toLowerCase(),i=Dt,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,i===Pt&&void 0===n&&(this.converter=Qt)}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 E.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||O.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case Dt:const t=this.converter;v.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case Pt:v.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Ut.locate(e));for(let i=0,r=t.length;i<r;++i){const r=t[i];if(void 0!==r)for(let t=0,i=r.length;t<i;++t){const i=r[t];n(i)?s.push(new Jt(e,i)):s.push(new Jt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Gt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Ut.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const Kt={mode:"open"},Yt={},Zt=new Set,es=a.getById(s.elementRegistry,(()=>c()));class ts{constructor(e,t=e.definition){var s;this.platformDefined=!1,n(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,r=Jt.collect(e,t.attributes),o=new Array(r.length),a={},l={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,a[t.name]=t,l[t.attribute]=t,E.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=a,this.attributeLookup=l,this.shadowOptions=void 0===t.shadowOptions?Kt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Kt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Yt:Object.assign(Object.assign({},Yt),t.elementOptions),this.styles=ne.normalize(t.styles),es.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 Zt.has(e)||es.getByType(e)?new ts(class extends e{},t):new ts(e,t)}static registerBaseType(e){Zt.add(e)}}ts.getByType=es.getByType,ts.getForInstance=es.getForInstance;class ss{constructor(e){this.directive=e,this.location=null,this.controller=null,this.view=null,this.data=null,this.dataBindingObserver=e.dataBinding.createObserver(this,e),this.templateBindingObserver=e.templateBinding.createObserver(this,e)}bind(e){if(this.location=e.targets[this.directive.targetNodeId],this.controller=e,this.data=this.dataBindingObserver.bind(e),this.template=this.templateBindingObserver.bind(e),e.onUnbind(this),Ne(this.template)&&Ne(e)&&e.hydrationStage!==et&&!this.view){const t=e.bindingViewBoundaries[this.directive.targetNodeId];t&&(this.view=this.template.hydrate(t.first,t.last),this.bindView(this.view))}else this.refreshView()}unbind(e){const t=this.view;null!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleChange(e,t){t===this.dataBindingObserver&&(this.data=this.dataBindingObserver.bind(this.controller)),(this.directive.templateBindingDependsOnData||t===this.templateBindingObserver)&&(this.template=this.templateBindingObserver.bind(this.controller)),this.refreshView()}bindView(e){e.isComposed?e.needsBindOnly&&(e.needsBindOnly=!1,e.bind(this.data)):(e.isComposed=!0,e.bind(this.data),e.insertBefore(this.location),e.$fastTemplate=this.template)}refreshView(){let e=this.view;const t=this.template;null===e?(this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context):e.$fastTemplate!==t&&(e.isComposed&&(e.remove(),e.unbind()),this.view=e=t.create(),this.view.context.parent=this.controller.source,this.view.context.parentContext=this.controller.context),this.bindView(e)}}class is{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ie.comment(e(this))}createBehavior(){return new ss(this)}}ze.define(is);const ns=new Map,rs={":model":e=>e},os=Symbol("RenderInstruction"),as="default-view",ls=wt`
|
|
2
|
+
|
|
3
|
+
`;function cs(e){return void 0===e?ls:e.template}function hs(e,t){const s=[],n=[],{attributes:r,directives:o,content:a,policy:l}=null!=t?t:{};if(s.push(`<${e}`),r){const e=Object.getOwnPropertyNames(r);for(let t=0,i=e.length;t<i;++t){const i=e[t];0===t?s[0]=`${s[0]} ${i}="`:s.push(`" ${i}="`),n.push(r[i])}s.push('"')}if(o){s[s.length-1]+=" ";for(let e=0,t=o.length;e<t;++e){const t=o[e];s.push(e>0?"":" "),n.push(t)}}if(s[s.length-1]+=">",a&&i(a.create))n.push(a),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=a?a:""}</${e}>`}return yt.create(s,n,l)}function ds(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:as;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=ts.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=rs),i=hs(t,e)}else i=e.template;var n;return{brand:os,type:e.type,name:s,template:i}}function us(e){return e&&e.brand===os}function fs(e,t){const s=ns.get(e);if(void 0!==s)return s[null!=t?t:as]}function ps(e,t){if(e)return fs(e.constructor,t)}Object.freeze({instanceOf:us,create:ds,createElementTemplate:hs,register:function(e){let t=ns.get(e.type);void 0===t&&ns.set(e.type,t=Object.create(null));const s=us(e)?e:ds(e);return t[s.name]=s},getByType:fs,getForInstance:ps});class gs{constructor(e){this.node=e,e.$fastTemplate=this}get context(){return this}bind(e){}unbind(){}insertBefore(e){e.parentNode.insertBefore(this.node,e)}remove(){this.node.parentNode.removeChild(this.node)}create(){return this}hydrate(e,t){return this}}function bs(e,t){let s,r;s=void 0===e?ee((e=>e)):te(e);let o=!1;if(void 0===t)o=!0,r=ee(((e,t)=>{var i;const n=s.evaluate(e,t);return n instanceof Node?null!==(i=n.$fastTemplate)&&void 0!==i?i:new gs(n):cs(ps(n))}));else if(i(t))r=K(((e,i)=>{var r;let o=t(e,i);return n(o)?o=cs(ps(s.evaluate(e,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new gs(o)),o}),void 0,!0);else if(n(t))o=!0,r=ee(((e,i)=>{var n;const r=s.evaluate(e,i);return r instanceof Node?null!==(n=r.$fastTemplate)&&void 0!==n?n:new gs(r):cs(ps(r,t))}));else if(t instanceof J){const e=t.evaluate;t.evaluate=(t,i)=>{var r;let o=e(t,i);return n(o)?o=cs(ps(s.evaluate(t,i),o)):o instanceof Node&&(o=null!==(r=o.$fastTemplate)&&void 0!==r?r:new gs(o)),o},r=t}else r=ee(((e,s)=>t));return new is(s,r,o)}class vs extends MutationObserver{constructor(e){super((function(e){this.callback.call(null,e.filter((e=>this.observedNodes.has(e.target))))})),this.callback=e,this.observedNodes=new Set}observe(e,t){this.observedNodes.add(e),super.observe(e,t)}unobserve(e){this.observedNodes.delete(e),this.observedNodes.size<1&&this.disconnect()}}Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:I.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){var s,i,n,r;const o=e;o.id=null!==(s=o.id)&&void 0!==s?s:Ve(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Ve(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:v.policy,this.addTarget(o.targetNodeId,t),this.addBehavior(o.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))))}}}});const ms={bubbles:!0,composed:!0,cancelable:!0},ys="isConnected",ws=new WeakMap;function Ss(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ws.get(e))&&void 0!==s?s:null}let Cs;class xs extends k{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.behaviorsConnected=!1,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&&ws.set(e,t))}const i=E.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 E.track(this,ys),1===this.stage}get context(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.context)&&void 0!==t?t:I.default}get isBound(){var e,t;return null!==(t=null===(e=this.view)||void 0===e?void 0:e.isBound)&&void 0!==t&&t}get sourceLifetime(){var e;return null===(e=this.view)||void 0===e?void 0:e.sourceLifetime}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))}onUnbind(e){var t;null===(t=this.view)||void 0===t||t.onUnbind(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=Ss(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=Ss(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.removeBehavior(t[e])}}connect(){3===this.stage&&(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,E.notify(this,ys))}bindObservables(){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}}connectBehaviors(){if(!1===this.behaviorsConnected){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.behaviorsConnected=!0}}disconnectBehaviors(){if(!0===this.behaviorsConnected){const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.behaviorsConnected=!1}}disconnect(){1===this.stage&&(this.stage=2,E.notify(this,ys),null!==this.view&&this.view.unbind(),this.disconnectBehaviors(),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},ms),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=Ss(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=A.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=ts.getForInstance(e);if(void 0===s)throw a.error(1401);return e.$fastController=new Cs(e,s)}static setStrategy(e){Cs=e}}function Bs(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=Ss(e))&&void 0!==t?t:e.getRootNode()}d(xs),xs.setStrategy(xs);class Ts{constructor(e){const t=Ts.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){ks(Bs(e),this.sheets)}removeStylesFrom(e){As(Bs(e),this.sheets)}}Ts.styleSheetCache=new Map;let $s=0;function Os(e){return e===document?document.body:e}class Ns{constructor(e){this.styles=e,this.styleClass="fast-"+ ++$s}addStylesTo(e){e=Os(Bs(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=Os(Bs(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let ks=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},As=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ne.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),ks=(e,t)=>{e.adoptedStyleSheets.push(...t)},As=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ne.setDefaultStrategy(Ts)}else ne.setDefaultStrategy(Ns);const Es="defer-hydration",Ms="needs-hydration";class js extends xs{static hydrationObserverHandler(e){for(const t of e)js.hydrationObserver.unobserve(t.target),t.target.$fastController.connect()}connect(){var e,t;if(void 0===this.needsHydration&&(this.needsHydration=null!==this.source.getAttribute(Ms)),this.source.hasAttribute(Es))return void js.hydrationObserver.observe(this.source,{attributeFilter:[Es]});if(!this.needsHydration)return void super.connect();if(3!==this.stage)return;this.stage=0,this.bindObservables(),this.connectBehaviors();const s=this.source,i=null!==(e=Ss(s))&&void 0!==e?e:s;if(this.template)if(Ne(this.template)){let e=i.firstChild,n=i.lastChild;null===s.shadowRoot&&(xe.isElementBoundaryStartMarker(e)&&(e.data="",e=e.nextSibling),xe.isElementBoundaryEndMarker(n)&&(n.data="",n=n.previousSibling)),this.view=this.template.hydrate(e,n,s),null===(t=this.view)||void 0===t||t.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(Ms),this.needsInitialization=this.needsHydration=!1,E.notify(this,ys)}disconnect(){super.disconnect(),js.hydrationObserver.unobserve(this.source)}static install(){xs.setStrategy(js)}}function Vs(e){const t=class extends e{constructor(){super(),xs.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 ts.registerBaseType(t),t}function Is(e,t){return i(e)?ts.compose(e,t).define().type:ts.compose(this,e).define().type}js.hydrationObserver=new vs(js.hydrationObserverHandler);const _s=Object.assign(Vs(HTMLElement),{from:function(e){return Vs(e)},define:Is,compose:function(e,t){return i(e)?ts.compose(e,t):ts.compose(this,e)}});function Rs(e){return function(t){Is(t,e)}}v.setPolicy($.create());export{W as ArrayObserver,Ut as AttributeConfiguration,Jt as AttributeDefinition,J as Binding,ce as CSSBindingDirective,oe as CSSDirective,Ft as ChildrenDirective,pt as Compiler,v as DOM,u as DOMAspect,xs as ElementController,ne as ElementStyles,I as ExecutionContext,a as FAST,_s as FASTElement,ts as FASTElementDefinition,it as HTMLBindingDirective,ze as HTMLDirective,Ke as HTMLView,js as HydratableElementController,tt as HydrationBindingError,vt as InlineTemplateDirective,Ie as Markup,_t as NodeObservationDirective,E as Observable,_e as Parser,k as PropertyChangeNotifier,St as RefDirective,ss as RenderBehavior,is as RenderDirective,Et as RepeatBehavior,Mt as RepeatDirective,zt as SlottedDirective,A as SourceLifetime,_ as Splice,D as SpliceStrategy,R as SpliceStrategySupport,Fe as StatelessAttachedAttributeDirective,N as SubscriberSet,O as Updates,yt as ViewTemplate,Gt as attr,Qt as booleanConverter,Ht as children,pe as css,ae as cssDirective,Rs as customElement,It as elements,l as emptyArray,wt as html,Le as htmlDirective,X as lengthOf,Y as listener,te as normalizeBinding,qt as nullableBooleanConverter,Xt as nullableNumberConverter,M as observable,ee as oneTime,K as oneWay,Ct as ref,bs as render,jt as repeat,Lt as slotted,j as volatile,Tt as when};
|