@microsoft/fast-element 2.0.0-beta.17 → 2.0.0-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +21 -0
- package/CHANGELOG.md +10 -1
- package/dist/dts/dom-policy.d.ts +68 -0
- package/dist/dts/dom.d.ts +116 -0
- package/dist/dts/index.d.ts +3 -2
- 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 +15 -24
- package/dist/dts/polyfills.d.ts +0 -1
- package/dist/dts/templating/binding-signal.d.ts +3 -1
- package/dist/dts/templating/binding-two-way.d.ts +3 -1
- package/dist/dts/templating/binding.d.ts +16 -5
- package/dist/dts/templating/compiler.d.ts +11 -13
- package/dist/dts/templating/dangerous-html.d.ts +18 -0
- package/dist/dts/templating/html-directive.d.ts +50 -119
- package/dist/dts/templating/node-observation.d.ts +11 -1
- package/dist/dts/templating/ref.d.ts +4 -0
- package/dist/dts/templating/render.d.ts +30 -6
- package/dist/dts/templating/repeat.d.ts +1 -5
- package/dist/dts/templating/template.d.ts +39 -13
- package/dist/dts/templating/view.d.ts +2 -2
- package/dist/dts/utilities.d.ts +39 -0
- package/dist/esm/components/attributes.js +1 -1
- package/dist/esm/debug.js +4 -1
- package/dist/esm/dom-policy.js +337 -0
- package/dist/esm/dom.js +117 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.rollup.debug.js +3 -1
- package/dist/esm/index.rollup.js +3 -1
- package/dist/esm/platform.js +1 -1
- package/dist/esm/polyfills.js +3 -7
- package/dist/esm/templating/binding-signal.js +3 -2
- package/dist/esm/templating/binding-two-way.js +3 -2
- package/dist/esm/templating/binding.js +31 -54
- package/dist/esm/templating/compiler.js +31 -38
- package/dist/esm/templating/dangerous-html.js +23 -0
- package/dist/esm/templating/html-directive.js +38 -135
- package/dist/esm/templating/node-observation.js +14 -8
- package/dist/esm/templating/ref.js +1 -1
- package/dist/esm/templating/render.js +17 -6
- package/dist/esm/templating/repeat.js +2 -6
- package/dist/esm/templating/template.js +81 -56
- package/dist/esm/testing/fixture.js +1 -1
- package/dist/esm/utilities.js +68 -0
- package/dist/fast-element.api.json +1088 -608
- package/dist/fast-element.d.ts +190 -147
- package/dist/fast-element.debug.js +708 -384
- package/dist/fast-element.debug.min.js +1 -1
- package/dist/fast-element.js +679 -358
- package/dist/fast-element.min.js +1 -1
- package/dist/fast-element.untrimmed.d.ts +190 -147
- package/docs/api-report.md +66 -56
- package/package.json +5 -1
- package/yarn-error.log +177 -0
- package/dist/dts/templating/dom.d.ts +0 -41
- package/dist/esm/templating/dom.js +0 -49
package/dist/fast-element.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){if("undefined"==typeof globalThis)if("undefined"!=typeof global)global.globalThis=global;else if("undefined"!=typeof self)self.globalThis=self;else if("undefined"!=typeof window)window.globalThis=window;else{const e=new Function("return this")();e.globalThis=e}}(),globalThis.trustedTypes||(globalThis.trustedTypes={createPolicy:(e,t)=>t});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))}void 0===t.error&&Object.assign(t,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const s=Object.freeze([]);function i(){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 n(){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 r=e=>"function"==typeof e,o=e=>"string"==typeof e,l=()=>{},a=t.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 h{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 c{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 h(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new h(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 d=Object.freeze({unknown:void 0,coupled:1}),u=t.getById(2,(()=>{const e=a.enqueue,s=/(:|&&|\|\||if)/,i=new WeakMap;let u,f=e=>{throw t.error(1101)};function p(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:i.get(e);return void 0===s&&(Array.isArray(e)?s=f(e):i.set(e,s=new c(e))),s}const g=n();class b{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==u&&u.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];r(n)&&n.call(e,i,t),p(e).notify(this.name)}}}class v extends h{constructor(e,t,s=!1){super(e,t),this.expression=e,this.isVolatileBinding=s,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0,this.toJSON=l}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!==d.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=u;let i;u=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{u=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=p(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;u=void 0,t=s.propertySource[s.propertyName],u=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 Object.freeze({setArrayObserverFactory(e){f=e},getNotifier:p,track(e,t){u&&u.watch(e,t)},trackVolatile(){u&&(u.needsRefresh=!0)},notify(e,t){p(e).notify(t)},defineProperty(e,t){o(t)&&(t=new b(t)),g(e).push(t),Reflect.defineProperty(e,t.name,{enumerable:!0,get(){return t.getValue(this)},set(e){t.setValue(this,e)}})},getAccessors:g,binding(e,t,s=this.isVolatileBinding(e)){return new v(e,t,s)},isVolatileBinding:e=>s.test(e.toString())})}));function f(e,t){u.defineProperty(e,t)}function p(e,t,s){return Object.assign({},s,{get(){return u.trackVolatile(),s.get.apply(this)}})}const g=t.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),b=Object.freeze({default:{index:0,length:0,get event(){return b.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>g.get(),setEvent(e){g.set(e)}});class v{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 y=Object.freeze({reset:1,splice:2,optimized:3}),m=new v(0,s,0);m.reset=!0;const w=[m];function C(e,t,i,n,r,o){let l=0,a=0;const h=Math.min(i-t,o-r);if(0===t&&0===r&&(l=function(e,t,s){for(let i=0;i<s;++i)if(e[i]!==t[i])return i;return s}(e,n,h)),i===e.length&&o===n.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,n,h-l)),r+=l,o-=a,(i-=a)-(t+=l)==0&&o-r==0)return s;if(t===i){const e=new v(t,[],0);for(;r<o;)e.removed.push(n[r++]);return[e]}if(r===o)return[new v(t,[],i-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,i,n,r,o)),d=[];let u,f=t,p=r;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 v(f,[],0)),u.addedCount++,f++,u.removed.push(n[p]),p++;break;case 2:void 0===u&&(u=new v(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new v(f,[],0)),u.removed.push(n[p]),p++}return void 0!==u&&d.push(u),d}function x(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 S=Object.freeze({support:y.optimized,normalize:(e,t,i)=>void 0===e?void 0===i?s:i.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)x(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(C(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,i):i:w,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new v(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new v(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 v(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 v(+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 v(0,[],i.length).adjustTo(e)),n}});const T=Object.freeze({reset:w,setDefaultStrategy(e){S=e}});function O(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class B extends h{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,O(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,u.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:S).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,a.enqueue(this))}}let A=!1;const k=Object.freeze({enable(){if(A)return;A=!0,u.setArrayObserverFactory((e=>new B(e)));const e=Array.prototype;e.$fastPatch||(O(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:S)[t.name](this,i,t,e)}})))}});function j(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(k.enable(),t=u.getNotifier(e)),u.track(t.lengthObserver,"length"),e.length}let $;function N(e){return e.map((e=>e instanceof V?N(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class V{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof V?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(N(this.styles)),this}static setDefaultStrategy(e){$=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new V(e):e instanceof V?e:new V([e])}}V.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const I=i(),E=Object.freeze({getForInstance:I.getForInstance,getByType:I.getByType,define:e=>(I.register({type:e}),e)});function L(){return function(e){E.define(e)}}function z(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!==E.getForInstance(o)&&(o=o.createCSS(r)),o instanceof V||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 F=(e,...t)=>{const{styles:s,behaviors:i}=z(e,t),n=new V(s);return i.length?n.withBehaviors(...i):n};class M{constructor(e,t){this.behaviors=t,this.css="";const s=e.reduce(((e,t)=>(o(t)?this.css+=t:e.push(t),e)),[]);s.length&&(this.styles=new V(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)}}E.define(M);const _=F.partial=(e,...t)=>{const{styles:s,behaviors:i}=z(e,t);return new M(s,i)},P=Object.freeze({queueUpdate:a.enqueue,nextUpdate:a.next,processUpdates:a.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)}}),R=`fast-${Math.random().toString(36).substring(2,8)}`,H=`${R}{`,q=`}${R}`,D=q.length;let U=0;const Q=()=>`${R}-${++U}`,J=Object.freeze({interpolation:e=>`${H}${e}${q}`,attribute:e=>`${Q()}="${H}${e}${q}"`,comment:e=>`\x3c!--${H}${e}${q}--\x3e`}),W=Object.freeze({parse(e,t){const s=e.split(H);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(q);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+D)}""!==o&&i.push(o)}return i}}),G=Object.freeze({create(e){const t=[],s={};let i=null,n=!1;return{source:e,context:b.default,targets:s,get isBound(){return n},addBehaviorFactory(e,t){const s=e.nodeId||(e.nodeId=Q());e.id||(e.id=Q()),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))))}}}}),K=i(),X=Object.freeze({getForInstance:K.getForInstance,getByType:K.getByType,define:(e,t)=>((t=t||{}).type=e,K.register(t),e)});function Y(e){return function(t){X.define(t,e)}}class Z{constructor(e,t=!1){this.evaluate=e,this.isVolatile=t}}const ee=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6,assign(e,t){if(t)switch(e.sourceAspect=t,t[0]){case":":e.targetAspect=t.substring(1),e.aspectType="classList"===e.targetAspect?ee.tokenList:ee.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=ee.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=ee.event;break;default:e.targetAspect=t,e.aspectType=ee.attribute}else e.aspectType=ee.content}});class te{constructor(e){this.options=e,this.id=Q(),this.toJSON=l}createHTML(e){return J.attribute(e(this))}createBehavior(){return this}}const se=globalThis.TrustedHTML?e=>(s,i)=>{const n=e(s,i);if(n instanceof TrustedHTML)return n;throw t.error(1202)}:e=>e;class ie extends Z{createObserver(e,t){return u.binding(this.evaluate,t,this.isVolatile)}}class ne extends Z{constructor(){super(...arguments),this.toJSON=l}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function re(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 oe(e,t,s){var i;const n=`${this.id}-t`,r=null!==(i=e[n])&&void 0!==i?i:e[n]={v:0,cv:Object.create(null)},o=r.cv;let l=r.v;const a=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}}const le=(e,t,s)=>e[t]=s,ae=()=>{};class he{constructor(e){this.dataBinding=e,this.updateTarget=null,this.id=Q(),this.aspectType=ee.content,this.data=`${this.id}-d`}createHTML(e){return J.interpolation(e(this))}createBehavior(){if(null===this.updateTarget)switch("innerHTML"===this.targetAspect&&(this.dataBinding.evaluate=se(this.dataBinding.evaluate)),this.aspectType){case 1:this.updateTarget=P.setAttribute;break;case 2:this.updateTarget=P.setBooleanAttribute;break;case 3:this.updateTarget=le;break;case 4:this.updateTarget=re;break;case 5:this.updateTarget=oe;break;case 6:this.updateTarget=ae;break;default:throw t.error(1205)}return this}bind(e){var t;const s=e.targets[this.nodeId];switch(this.updateTarget){case ae:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case re:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.nodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){b.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);b.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ce(e,t=u.isVolatileBinding(e)){return new ie(e,t)}function de(e){return new ne(e)}function ue(e,t){const s=new ie(e,!1);return s.options=t,s}function fe(e){return r(e)?ce(e):e instanceof Z?e:de((()=>e))}function pe(e,t){const s=e.parentNode;let i,n=e;for(;n!==t;)i=n.nextSibling,s.removeChild(n),n=i;s.removeChild(t)}X.define(he,{aspected:!0});class ge{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=d.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=l,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return b.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(){pe(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){pe(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}u.defineProperty(ge.prototype,"index"),u.defineProperty(ge.prototype,"length");const be=(e,t)=>`${e}.${t}`,ve={},ye={index:0,node:null};function me(e){e.startsWith("fast-")||t.warn(1204,{name:e})}const we=new Proxy(document.createElement("div"),{get(e,t){me(t);const s=Reflect.get(e,t);return r(s)?s.bind(e):s},set:(e,t,s)=>(me(t),Reflect.set(e,t,s))});class Ce{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=ve[t];if(!n){const i=`_${t}`;ve[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:we;for(const e of this.nodeIds)s[e];return new ge(t,this.factories,s)}}function xe(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=W.parse(d,l);let f=null;null===u?r&&(f=new he(de((()=>d))),ee.assign(f,c.name)):f=ke.aggregate(u),null!==f&&(s.removeAttributeNode(c),a--,h--,e.addFactory(f,t,i,n))}}function Se(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Te(e,s,n,i);n=t.node,i=t.index}}function Te(e,t,s,i){const n=be(t,i);switch(s.nodeType){case 1:xe(e,t,s,n,i),Se(e,s,n);break;case 3:return function(e,t,s,i,n){const r=W.parse(t.textContent,e.directives);if(null===r)return ye.node=t.nextSibling,ye.index=n+1,ye;let l,a=l=t;for(let t=0,h=r.length;t<h;++t){const h=r[t];0!==t&&(n++,i=be(s,n),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),o(h)?l.textContent=h:(l.textContent=" ",ee.assign(h),e.addFactory(h,s,i,n)),a=l}return ye.index=n+1,ye.node=a.nextSibling,ye}(e,s,t,n,i);case 8:const r=W.parse(s.data,e.directives);null!==r&&e.addFactory(ke.aggregate(r),t,n,i)}return ye.index=i+1,ye.node=s.nextSibling,ye}const Oe={createHTML:e=>e};let Be=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",Oe):Oe;const Ae=Be,ke={setHTMLPolicy(e){if(Be!==Ae)throw t.error(1201);Be=e},compile(e,t){let s;if(o(e)){s=document.createElement("TEMPLATE"),s.innerHTML=Be.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 Ce(i,t);return xe(n,"",s,"h",0,!0),(function(e,t){return e&&8==e.nodeType&&null!==W.parse(e.data,t)}(i.firstChild,t)||1===i.childNodes.length&&Object.keys(t).length>0)&&i.insertBefore(document.createComment(""),i.firstChild),Se(n,i,"r"),ye.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=>o(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 l=new he(s);return ee.assign(l,t),l}};class je{constructor(e,t){this.result=null,this.toJSON=l,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=ke.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 $e=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Ne(e,t,s){const i=$e.exec(t);return null!==i&&ee.assign(e,i[2]),e.createHTML(s)}function Ve(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=Q();return i[s]=e,s};for(let i=0,l=e.length-1;i<l;++i){const l=e[i],a=t[i];let h;if(s+=l,r(a))s+=Ne(new he(ce(a)),l,n);else if(o(a)){const e=$e.exec(l);if(null!==e){const t=new he(de((()=>a)));ee.assign(t,e[2]),s+=t.createHTML(n)}else s+=a}else a instanceof Z?s+=Ne(new he(a),l,n):void 0===(h=X.getForInstance(a))?s+=Ne(new he(de((()=>a))),l,n):h.aspected?s+=Ne(a,l,n):s+=a.createHTML(n)}return new je(s+e[e.length-1],i)}class Ie extends te{bind(e){e.source[this.options]=e.targets[this.nodeId]}}X.define(Ie);const Ee=e=>new Ie(e);function Le(e,t){const s=r(e)?e:()=>e,i=r(t)?t:()=>t;return(e,t)=>s(e,t)?i(e,t):null}const ze=Object.freeze({positioning:!1,recycle:!0});function Fe(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Me(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 _e{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=Fe,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=Me)}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=s);const t=this.itemsObserver,i=this.itemsObserver=u.getNotifier(this.items),n=t!==i;n&&null!==t&&t.unsubscribe(this),(n||e)&&i.subscribe(this)}updateViews(e){const t=this.views,s=this.bindView,i=this.items,n=this.template,r=this.controller,o=this.directive.options.recycle,l=[];let a=0,h=0;for(let c=0,d=e.length;c<d;++c){const d=e[c],u=d.removed;let f=0,p=d.index;const g=p+d.addedCount,b=t.splice(d.index,u.length),v=h=l.length+b.length;for(;p<g;++p){const e=t[p],c=e?e.firstChild:this.location;let d;o&&h>0?(f<=v&&b.length>0?(d=b[f],f++):(d=l[a],a++),h--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(c)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(ge.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 Pe{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,this.id=Q(),k.enable()}createHTML(e){return J.comment(e(this))}createBehavior(){return new _e(this)}}function Re(e,t,s=ze){const i=fe(e),n=fe(t);return new Pe(i,n,Object.assign(Object.assign({},ze),s))}X.define(Pe);const He=e=>1===e.nodeType,qe=e=>e?t=>1===t.nodeType&&t.matches(e):He;class De extends te{constructor(){super(...arguments),this.controllerProperty=`${this.id}-c`}bind(e){const t=e.targets[this.nodeId];t[this.controllerProperty]=e,this.updateTarget(e.source,this.computeNodes(t)),this.observe(t),e.onUnbind(this)}unbind(e){const t=e.targets[this.nodeId];this.updateTarget(e.source,s),this.disconnect(t),t[this.controllerProperty]=null}getSource(e){return e[this.controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Ue extends De{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 Qe(e){return o(e)&&(e={property:e}),new Ue(e)}X.define(Ue);class Je extends De{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=l,t.target=e,e[this.observerProperty]=t),t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function We(e){return o(e)&&(e={property:e}),new Je(e)}X.define(Je);const Ge=Object.freeze({locate:n()}),Ke={toView:e=>e?"true":"false",fromView:e=>null!=e&&"false"!==e&&!1!==e&&0!==e};function Xe(e){if(null==e)return null;const t=1*e;return isNaN(t)?null:t}const Ye={toView(e){const t=Xe(e);return t?t.toString():t},fromView:Xe};class Ze{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=Ke)}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 u.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||a.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;P.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":P.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Ge.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];o(i)?s.push(new Ze(e,i)):s.push(new Ze(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function et(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Ge.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}const tt={mode:"open"},st={},it=new Set,nt=t.getById(4,(()=>i()));class rt{constructor(e,t=e.definition){var s;this.platformDefined=!1,o(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=Ze.collect(e,t.attributes),r=new Array(n.length),l={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,u.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?tt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},tt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?st:Object.assign(Object.assign({},st),t.elementOptions),this.styles=V.normalize(t.styles),nt.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 it.has(e)||nt.getByType(e)?new rt(class extends e{},t):new rt(e,t)}static registerBaseType(e){it.add(e)}}rt.getByType=nt.getByType,rt.getForInstance=nt.getForInstance;const ot={bubbles:!0,composed:!0,cancelable:!0},lt=new WeakMap;function at(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:lt.get(e))&&void 0!==s?s:null}let ht;class ct extends c{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this._mainStyles=null,this.$fastController=this,this.view=null,this.toJSON=l,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&<.set(e,t))}const i=u.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 u.track(this,"isConnected"),1===this.stage}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=at(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=at(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(3!==this.stage)return;if(this.stage=0,null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,u.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,u.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.stage=3}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ot),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=at(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=d.coupled)}static forCustomElement(e){const s=e.$fastController;if(void 0!==s)return s;const i=rt.getForInstance(e);if(void 0===i)throw t.error(1401);return e.$fastController=new ht(e,i)}static setStrategy(e){ht=e}}function dt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=at(e))&&void 0!==t?t:e.getRootNode()}ct.setStrategy(ct);class ut{constructor(e){const t=ut.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){const t=dt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=dt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}ut.styleSheetCache=new Map;let ft=0;function pt(e){return e===document?document.body:e}function gt(e){const t=class extends e{constructor(){super(),ct.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 rt.registerBaseType(t),t}function bt(e,t){return r(e)?rt.compose(e,t).define().type:rt.compose(this,e).define().type}V.setDefaultStrategy(V.supportsAdoptedStyleSheets?ut:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++ft}addStylesTo(e){e=pt(dt(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=pt(dt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}});const vt=Object.assign(gt(HTMLElement),{from:function(e){return gt(e)},define:bt,compose:function(e,t){return r(e)?rt.compose(e,t):rt.compose(this,e)}});function yt(e){return function(t){bt(t,e)}}export{k as ArrayObserver,ee as Aspect,Ge as AttributeConfiguration,Ze as AttributeDefinition,Z as Binding,E as CSSDirective,Je as ChildrenDirective,ke as Compiler,P as DOM,ct as ElementController,V as ElementStyles,b as ExecutionContext,t as FAST,vt as FASTElement,rt as FASTElementDefinition,he as HTMLBindingDirective,X as HTMLDirective,ge as HTMLView,J as Markup,De as NodeObservationDirective,u as Observable,W as Parser,c as PropertyChangeNotifier,Ie as RefDirective,_e as RepeatBehavior,Pe as RepeatDirective,Ue as SlottedDirective,d as SourceLifetime,v as Splice,T as SpliceStrategy,y as SpliceStrategySupport,te as StatelessAttachedAttributeDirective,h as SubscriberSet,a as Updates,G as ViewBehaviorOrchestrator,je as ViewTemplate,et as attr,ce as bind,Ke as booleanConverter,We as children,n as createMetadataLocator,i as createTypeRegistry,F as css,L as cssDirective,_ as cssPartial,yt as customElement,qe as elements,s as emptyArray,Ve as html,Y as htmlDirective,j as lengthOf,ue as listener,fe as normalizeBinding,Ye as nullableNumberConverter,f as observable,de as oneTime,Ee as ref,Re as repeat,Qe as slotted,p as volatile,Le as when};
|
|
1
|
+
const e=e=>"function"==typeof e,t=e=>"string"==typeof e,s=()=>{};!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 i={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.FAST&&Reflect.defineProperty(globalThis,"FAST",Object.assign({value:Object.create(null)},i));const n=globalThis.FAST;if(void 0===n.getById){const e=Object.create(null);Reflect.defineProperty(n,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},i))}void 0===n.error&&Object.assign(n,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const r=Object.freeze([]);function o(){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 l(){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 a=n.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})})),c=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),h=e=>e,d=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("fast-html",{createHTML:h}):{createHTML:h};let u=Object.freeze({createHTML:e=>d.createHTML(e),protect:(e,t,s,i)=>i});const f=u,p=Object.freeze({queueUpdate:a.enqueue,nextUpdate:a.next,processUpdates:a.process,get policy(){return u},setPolicy(e){if(u!==f)throw n.error(1201);u=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 g(e,s,i,n){return(e,s,i,...r)=>{t(i)&&(i=i.replace("javascript:","")),n(e,s,i,...r)}}function b(e,t,s,i){throw new Error(`${s} on ${null!=e?e:"text"} is blocked by the current DOMPolicy.`)}const v={onabort:b,onauxclick:b,onbeforeinput:b,onbeforematch:b,onblur:b,oncancel:b,oncanplay:b,oncanplaythrough:b,onchange:b,onclick:b,onclose:b,oncontextlost:b,oncontextmenu:b,oncontextrestored:b,oncopy:b,oncuechange:b,oncut:b,ondblclick:b,ondrag:b,ondragend:b,ondragenter:b,ondragleave:b,ondragover:b,ondragstart:b,ondrop:b,ondurationchange:b,onemptied:b,onended:b,onerror:b,onfocus:b,onformdata:b,oninput:b,oninvalid:b,onkeydown:b,onkeypress:b,onkeyup:b,onload:b,onloadeddata:b,onloadedmetadata:b,onloadstart:b,onmousedown:b,onmouseenter:b,onmouseleave:b,onmousemove:b,onmouseout:b,onmouseover:b,onmouseup:b,onpaste:b,onpause:b,onplay:b,onplaying:b,onprogress:b,onratechange:b,onreset:b,onresize:b,onscroll:b,onsecuritypolicyviolation:b,onseeked:b,onseeking:b,onselect:b,onslotchange:b,onstalled:b,onsubmit:b,onsuspend:b,ontimeupdate:b,ontoggle:b,onvolumechange:b,onwaiting:b,onwebkitanimationend:b,onwebkitanimationiteration:b,onwebkitanimationstart:b,onwebkittransitionend:b,onwheel:b},y={elements:{a:{[c.attribute]:{href:g},[c.property]:{href:g}},area:{[c.attribute]:{href:g},[c.property]:{href:g}},button:{[c.attribute]:{formaction:g},[c.property]:{formAction:g}},embed:{[c.attribute]:{src:b},[c.property]:{src:b}},form:{[c.attribute]:{action:g},[c.property]:{action:g}},frame:{[c.attribute]:{src:g},[c.property]:{src:g}},iframe:{[c.attribute]:{src:g},[c.property]:{src:g,srcdoc:b}},input:{[c.attribute]:{formaction:g},[c.property]:{formAction:g}},link:{[c.attribute]:{href:b},[c.property]:{href:b}},object:{[c.attribute]:{codebase:b,data:b},[c.property]:{codeBase:b,data:b}},script:{[c.attribute]:{src:b,text:b},[c.property]:{src:b,text:b,innerText:b,textContent:b}},style:{[c.property]:{innerText:b,textContent:b}}},aspects:{[c.attribute]:Object.assign({},v),[c.property]:Object.assign({innerHTML:b},v),[c.event]:Object.assign({},v)}};function m(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 w(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]=m(r,{});break;default:s[i]=m(n,r)}}for(const t in e)t in s||(s[t]=m(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]=w(n,{});break;default:s[i]=w(n,r)}}for(const t in e)t in s||(s[t]=w(e[t],{}));return Object.freeze(s)}function C(e,t,s,i,n){const r=e[s];if(r){const e=r[i];if(e)return e(t,s,i,n)}}const S=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=y,Object.freeze({elements:r.elements?x(r.elements,o.elements):o.elements,aspects:r.aspects?w(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(),l=n.elements[o];if(l){const n=C(l,e,t,s,i);if(n)return n}return null!==(r=C(n.aspects,e,t,s,i))&&void 0!==r?r:i}})}});class T{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 O{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 T(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new T(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}),B=n.getById(2,(()=>{const i=a.enqueue,r=/(:|&&|\|\||if)/,o=new WeakMap;let c,h=e=>{throw n.error(1101)};function d(e){var t;let s=null!==(t=e.$fastController)&&void 0!==t?t:o.get(e);return void 0===s&&(Array.isArray(e)?s=h(e):o.set(e,s=new O(e))),s}const u=l();class f{constructor(e){this.name=e,this.field=`_${e}`,this.callback=`${e}Changed`}getValue(e){return void 0!==c&&c.watch(e,this.name),e[this.field]}setValue(t,s){const i=this.field,n=t[i];if(n!==s){t[i]=s;const r=t[this.callback];e(r)&&r.call(t,n,s),d(t).notify(this.name)}}}class p extends T{constructor(e,t,i=!1){super(e,t),this.expression=e,this.isVolatileBinding=i,this.needsRefresh=!0,this.needsQueue=!0,this.isAsync=!0,this.first=this,this.last=null,this.propertySource=void 0,this.propertyName=void 0,this.notifier=void 0,this.next=void 0,this.toJSON=s}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=c;let i;c=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{i=this.expression(e,t)}finally{c=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=d(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;c=void 0,t=s.propertySource[s.propertyName],c=this,e===t&&(this.needsRefresh=!0)}s.next=n}this.last=n}handleChange(){this.needsQueue?(this.needsQueue=!1,i(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){h=e},getNotifier:d,track(e,t){c&&c.watch(e,t)},trackVolatile(){c&&(c.needsRefresh=!0)},notify(e,t){d(e).notify(t)},defineProperty(e,s){t(s)&&(s=new f(s)),u(e).push(s),Reflect.defineProperty(e,s.name,{enumerable:!0,get(){return s.getValue(this)},set(e){s.setValue(this,e)}})},getAccessors:u,binding(e,t,s=this.isVolatileBinding(e)){return new p(e,t,s)},isVolatileBinding:e=>r.test(e.toString())})}));function k(e,t){B.defineProperty(e,t)}function j(e,t,s){return Object.assign({},s,{get(){return B.trackVolatile(),s.get.apply(this)}})}const N=n.getById(3,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),$=Object.freeze({default:{index:0,length:0,get event(){return $.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>N.get(),setEvent(e){N.set(e)}});class V{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 z=Object.freeze({reset:1,splice:2,optimized:3}),I=new V(0,r,0);I.reset=!0;const L=[I];function E(e,t,s,i,n,o){let l=0,a=0;const c=Math.min(s-t,o-n);if(0===t&&0===n&&(l=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&&o===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-l)),n+=l,o-=a,(s-=a)-(t+=l)==0&&o-n==0)return r;if(t===s){const e=new V(t,[],0);for(;n<o;)e.removed.push(i[n++]);return[e]}if(n===o)return[new V(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],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 c,h;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]:(c=a[s-1][r]+1,h=a[s][r-1]+1,a[s][r]=c<h?c:h);return a}(e,t,s,i,n,o)),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 V(f,[],0)),u.addedCount++,f++,u.removed.push(i[p]),p++;break;case 2:void 0===u&&(u=new V(f,[],0)),u.addedCount++,f++;break;case 3:void 0===u&&(u=new V(f,[],0)),u.removed.push(i[p]),p++}return void 0!==u&&d.push(u),d}function M(e,t){let s=!1,i=0;for(let a=0;a<t.length;a++){const c=t[a];if(c.index+=i,s)continue;const h=(n=e.index,r=e.index+e.removed.length,o=c.index,l=c.index+c.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(h>=0){t.splice(a,1),a--,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(a,0,e),a++;const n=e.addedCount-e.removed.length;c.index+=n,i+=n}}var n,r,o,l;s||t.push(e)}let _=Object.freeze({support:z.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?r:s.length>1?function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)M(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(E(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:L,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new V(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new V(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 V(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 V(+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 V(0,[],i.length).adjustTo(e)),n}});const F=Object.freeze({reset:L,setDefaultStrategy(e){_=e}});function P(e,t,s){Reflect.defineProperty(e,t,{value:s,enumerable:!1})}class R extends T{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,P(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,B.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:_).normalize(s,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,a.enqueue(this))}}let H=!1;const D=Object.freeze({enable(){if(H)return;H=!0,B.setArrayObserverFactory((e=>new R(e)));const e=Array.prototype;e.$fastPatch||(P(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:_)[t.name](this,i,t,e)}})))}});function q(e){if(!e)return 0;let t=e.$fastController;return void 0===t&&(D.enable(),t=B.getNotifier(e)),B.track(t.lengthObserver,"length"),e.length}let U;function Q(e){return e.map((e=>e instanceof J?Q(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}class J{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof J?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(U),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(Q(this.styles)),this}static setDefaultStrategy(e){U=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new J(e):e instanceof J?e:new J([e])}}J.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const W=o(),G=Object.freeze({getForInstance:W.getForInstance,getByType:W.getByType,define:e=>(W.register({type:e}),e)});function K(){return function(e){G.define(e)}}function X(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!==G.getForInstance(o)&&(o=o.createCSS(r)),o instanceof J||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 Y=(e,...t)=>{const{styles:s,behaviors:i}=X(e,t),n=new J(s);return i.length?n.withBehaviors(...i):n};class Z{constructor(e,s){this.behaviors=s,this.css="";const i=e.reduce(((e,s)=>(t(s)?this.css+=s:e.push(s),e)),[]);i.length&&(this.styles=new J(i))}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)}}G.define(Z);const ee=Y.partial=(e,...t)=>{const{styles:s,behaviors:i}=X(e,t);return new Z(s,i)},te=`fast-${Math.random().toString(36).substring(2,8)}`,se=`${te}{`,ie=`}${te}`,ne=ie.length;let re=0;const oe=()=>`${te}-${++re}`,le=Object.freeze({interpolation:e=>`${se}${e}${ie}`,attribute:e=>`${oe()}="${se}${e}${ie}"`,comment:e=>`\x3c!--${se}${e}${ie}--\x3e`}),ae=Object.freeze({parse(e,t){const s=e.split(se);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(ie);let o;if(-1===r)o=n;else{const e=n.substring(0,r);i.push(t[e]),o=n.substring(r+ne)}""!==o&&i.push(o)}return i}}),ce=o(),he=Object.freeze({getForInstance:ce.getForInstance,getByType:ce.getByType,define:(e,t)=>((t=t||{}).type=e,ce.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?c.tokenList:c.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=c.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=c.event;break;default:e.targetAspect=t,e.aspectType=c.attribute}else e.aspectType=c.content}});function de(e){return function(t){he.define(t,e)}}class ue{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class fe{constructor(e){this.options=e,this.toJSON=s}createHTML(e){return le.attribute(e(this))}createBehavior(){return this}}class pe extends ue{createObserver(e,t){return B.binding(this.evaluate,t,this.isVolatile)}}class ge extends ue{constructor(){super(...arguments),this.toJSON=s}createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}const be={[c.attribute]:p.setAttribute,[c.booleanAttribute]:p.setBooleanAttribute,[c.property]:(e,t,s)=>e[t]=s,[c.content]:function(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}},[c.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 l=r.v;const a=e[t];if(null!=s&&s.length){const e=s.split(/\s+/);for(let t=0,s=e.length;t<s;++t){const s=e[t];""!==s&&(o[s]=l,a.add(s))}}if(r.v=l+1,0!==l){l-=1;for(const e in o)o[e]===l&&a.remove(e)}},[c.event]:()=>{}};class ve{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=c.content}createHTML(e){return le.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=be[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw n.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];switch(this.aspectType){case c.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case c.content:e.onUnbind(this);default:const i=null!==(t=s[this.data])&&void 0!==t?t:s[this.data]=this.dataBinding.createObserver(this,this);i.target=s,i.controller=e,this.updateTarget(s,this.targetAspect,i.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$fastView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){$.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);$.setEvent(null),!0!==s&&e.preventDefault()}}handleChange(e,t){const s=t.target,i=t.controller;this.updateTarget(s,this.targetAspect,t.bind(i),i)}}function ye(e,t,s=B.isVolatileBinding(e)){return new pe(e,t,s)}function me(e,t){return new ge(e,t)}function we(e,t){const s=new pe(e);return s.options=t,s}function xe(t){return e(t)?ye(t):t instanceof ue?t:me((()=>t))}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)}he.define(ve,{aspected:!0});class Se{constructor(e,t,i){this.fragment=e,this.factories=t,this.targets=i,this.behaviors=null,this.unbindables=[],this.source=null,this.isBound=!1,this.sourceLifetime=A.unknown,this.context=this,this.index=0,this.length=0,this.toJSON=s,this.firstChild=e.firstChild,this.lastChild=e.lastChild}get event(){return $.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()}}}B.defineProperty(Se.prototype,"index"),B.defineProperty(Se.prototype,"length");const Te=(e,t)=>`${e}.${t}`,Oe={},Ae={index:0,node:null};function Be(e){e.startsWith("fast-")||n.warn(1204,{name:e})}const ke=new Proxy(document.createElement("div"),{get(t,s){Be(s);const i=Reflect.get(t,s);return e(i)?i.bind(t):i},set:(e,t,s)=>(Be(t),Reflect.set(e,t,s))});class je{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:oe(),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=Oe[t];if(!n){const i=`_${t}`;Oe[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:ke;for(const e of this.nodeIds)s[e];return new Se(t,this.factories,s)}}function Ne(e,t,s,i,n,r=!1){const o=s.attributes,l=e.directives;for(let a=0,c=o.length;a<c;++a){const h=o[a],d=h.value,u=ae.parse(d,l);let f=null;null===u?r&&(f=new ve(me((()=>d),e.policy)),he.assignAspect(f,h.name)):f=ze.aggregate(u,e.policy),null!==f&&(s.removeAttributeNode(h),a--,c--,e.addFactory(f,t,i,n,s.tagName))}}function $e(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=Ve(e,s,n,i);n=t.node,i=t.index}}function Ve(e,s,i,n){const r=Te(s,n);switch(i.nodeType){case 1:Ne(e,s,i,r,n),$e(e,i,r);break;case 3:return function(e,s,i,n,r){const o=ae.parse(s.textContent,e.directives);if(null===o)return Ae.node=s.nextSibling,Ae.index=r+1,Ae;let l,a=l=s;for(let s=0,c=o.length;s<c;++s){const c=o[s];0!==s&&(r++,n=Te(i,r),l=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),t(c)?l.textContent=c:(l.textContent=" ",he.assignAspect(c),e.addFactory(c,i,n,r,null)),a=l}return Ae.index=r+1,Ae.node=a.nextSibling,Ae}(e,i,s,r,n);case 8:const o=ae.parse(i.data,e.directives);null!==o&&e.addFactory(ze.aggregate(o),s,r,n,null)}return Ae.index=n+1,Ae.node=i.nextSibling,Ae}const ze={compile(e,s,i=p.policy){let n;if(t(e)){n=document.createElement("TEMPLATE"),n.innerHTML=i.createHTML(e);const t=n.content.firstElementChild;null!==t&&"TEMPLATE"===t.tagName&&(n=t)}else n=e;const r=document.adoptNode(n.content),o=new je(r,s,i);var l,a;return Ne(o,"",n,"h",0,!0),l=r.firstChild,a=s,(l&&8==l.nodeType&&null!==ae.parse(l.data,a)||1===r.childNodes.length&&Object.keys(s).length>0)&&r.insertBefore(document.createComment(""),r.firstChild),$e(o,r,"r"),Ae.node=null,o.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,s=p.policy){if(1===e.length)return e[0];let i,n,r,o=!1;const l=e.length,a=e.map((e=>t(e)?()=>e:(i=e.sourceAspect||i,n=e.dataBinding||n,o=o||e.dataBinding.isVolatile,r=r||e.dataBinding.policy,e.dataBinding.evaluate)));n.evaluate=(e,t)=>{let s="";for(let i=0;i<l;++i)s+=a[i](e,t);return s},n.isVolatile=o,n.policy=null!=r?r:s;const c=new ve(n);return he.assignAspect(c,i),c}},Ie=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function Le(e,t,s,i=he.getForInstance(e)){if(i.aspected){const s=Ie.exec(t);null!==s&&he.assignAspect(e,s[2])}return e.createHTML(s)}class Ee{constructor(e,t={},i){this.policy=i,this.result=null,this.toJSON=s,this.html=e,this.factories=t}create(e){return null===this.result&&(this.result=ze.compile(this.html,this.factories,this.policy)),this.result.createView(e)}withPolicy(e){if(this.result)throw n.error(1208);if(this.policy)throw n.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(t,s,i){let n="";const r=Object.create(null),o=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=oe();return r[s]=e,s};for(let i=0,r=t.length-1;i<r;++i){const r=t[i];let l,a=s[i];if(n+=r,e(a))a=new ve(ye(a));else if(a instanceof ue)a=new ve(a);else if(!(l=he.getForInstance(a))){const e=a;a=new ve(me((()=>e)))}n+=Le(a,r,o,l)}return new Ee(n+t[t.length-1],r,i)}}function Me(e,...t){if(Array.isArray(e)&&Array.isArray(e.raw))return Ee.create(e,t);throw n.error(1206)}class _e extends fe{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}he.define(_e);const Fe=e=>new _e(e);function Pe(t,s){const i=e(t)?t:()=>t,n=e(s)?s:()=>s;return(e,t)=>i(e,t)?n(e,t):null}const Re=Object.freeze({positioning:!1,recycle:!0});function He(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function De(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.context.length=t.length,e.context.index=s,e.bind(t[s])}class qe{constructor(e){this.directive=e,this.items=null,this.itemsObserver=null,this.bindView=He,this.views=[],this.itemsBindingObserver=e.dataBinding.createObserver(e,this),this.templateBindingObserver=e.templateBinding.createObserver(e,this),e.options.positioning&&(this.bindView=De)}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),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=r);const t=this.itemsObserver,s=this.itemsObserver=B.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,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=l.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=l[a],a++),c--):d=n.create(),t.splice(p,0,d),s(d,i,p,r),d.insertBefore(h)}b[f]&&l.push(...b.slice(f))}for(let e=a,t=l.length;e<t;++e)l[e].dispose();if(this.directive.options.positioning)for(let e=0,s=t.length;e<s;++e){const i=t[e].context;i.length=s,i.index=e}}refreshAllViews(e=!1){const t=this.items,s=this.template,i=this.location,n=this.bindView,r=this.controller;let o=t.length,l=this.views,a=l.length;if(0!==o&&!e&&this.directive.options.recycle||(Se.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 c=l.splice(e,a-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)e[t].unbind()}}class Ue{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,D.enable()}createHTML(e){return le.comment(e(this))}createBehavior(){return new qe(this)}}function Qe(e,t,s=Re){const i=xe(e),n=xe(t);return new Ue(i,n,Object.assign(Object.assign({},Re),s))}he.define(Ue);const Je=e=>1===e.nodeType,We=e=>e?t=>1===t.nodeType&&t.matches(e):Je;class Ge 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,r),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}class Ke extends Ge{observe(e){e.addEventListener("slotchange",this)}disconnect(e){e.removeEventListener("slotchange",this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}}function Xe(e){return t(e)&&(e={property:e}),new Ke(e)}he.define(Ke);class Ye extends Ge{constructor(e){super(e),this.observerProperty=`${this.id}-o`,this.handleEvent=(e,t)=>{const s=t.target;this.updateTarget(this.getSource(s),this.computeNodes(s))},e.childList=!0}observe(e){let t=e[this.observerProperty];t||(t=new MutationObserver(this.handleEvent),t.toJSON=s,t.target=e,e[this.observerProperty]=t),t.observe(e,this.options)}disconnect(e){const t=e[this.observerProperty];t.target=null,t.disconnect()}getNodes(e){return"selector"in this.options?Array.from(e.querySelectorAll(this.options.selector)):Array.from(e.childNodes)}}function Ze(e){return t(e)&&(e={property:e}),new Ye(e)}he.define(Ye);class et{constructor(e){this.html=e}createHTML(){return this.html}}function tt(e){return new et(e)}he.define(et);const st=Object.freeze({locate:l()}),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 B.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||a.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case"reflect":const t=this.converter;p.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case"boolean":p.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...s){const i=[];s.push(st.locate(e));for(let n=0,r=s.length;n<r;++n){const r=s[n];if(void 0!==r)for(let s=0,n=r.length;s<n;++s){const n=r[s];t(n)?i.push(new ot(e,n)):i.push(new ot(e,n.property,n.attribute,n.mode,n.converter))}}return i}}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"},ct={},ht=new Set,dt=n.getById(4,(()=>o()));class ut{constructor(e,s=e.definition){var i;this.platformDefined=!1,t(s)&&(s={name:s}),this.type=e,this.name=s.name,this.template=s.template,this.registry=null!==(i=s.registry)&&void 0!==i?i:customElements;const n=e.prototype,r=ot.collect(e,s.attributes),o=new Array(r.length),l={},a={};for(let e=0,t=r.length;e<t;++e){const t=r[e];o[e]=t.attribute,l[t.name]=t,a[t.attribute]=t,B.defineProperty(n,t)}Reflect.defineProperty(e,"observedAttributes",{value:o,enumerable:!0}),this.attributes=r,this.propertyLookup=l,this.attributeLookup=a,this.shadowOptions=void 0===s.shadowOptions?at:null===s.shadowOptions?void 0:Object.assign(Object.assign({},at),s.shadowOptions),this.elementOptions=void 0===s.elementOptions?ct:Object.assign(Object.assign({},ct),s.elementOptions),this.styles=J.normalize(s.styles),dt.register(this)}get isDefined(){return this.platformDefined}define(e=this.registry){const t=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,t,this.elementOptions)),this}static compose(e,t){return ht.has(e)||dt.getByType(e)?new ut(class extends e{},t):new ut(e,t)}static registerBaseType(e){ht.add(e)}}ut.getByType=dt.getByType,ut.getForInstance=dt.getForInstance;const ft={bubbles:!0,composed:!0,cancelable:!0},pt=new WeakMap;function gt(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:pt.get(e))&&void 0!==s?s:null}let bt;class vt extends O{constructor(e,t){super(e),this.boundObservables=null,this.needsInitialization=!0,this.hasExistingShadowRoot=!1,this._template=null,this.stage=3,this.guardBehaviorConnection=!1,this.behaviors=null,this._mainStyles=null,this.$fastController=this,this.view=null,this.toJSON=s,this.source=e,this.definition=t;const i=t.shadowOptions;if(void 0!==i){let t=e.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=e.attachShadow(i),"closed"===i.mode&&pt.set(e,t))}const n=B.getAccessors(e);if(n.length>0){const t=this.boundObservables=Object.create(null);for(let s=0,i=n.length;s<i;++s){const i=n[s].name,r=e[i];void 0!==r&&(delete e[i],t[i]=r)}}}get isConnected(){return B.track(this,"isConnected"),1===this.stage}get template(){var e;if(null===this._template){const t=this.definition;this.source.resolveTemplate?this._template=this.source.resolveTemplate():t.template&&(this._template=null!==(e=t.template)&&void 0!==e?e:null)}return this._template}set template(e){this._template!==e&&(this._template=e,this.needsInitialization||this.renderTemplate(e))}get mainStyles(){var e;if(null===this._mainStyles){const t=this.definition;this.source.resolveStyles?this._mainStyles=this.source.resolveStyles():t.styles&&(this._mainStyles=null!==(e=t.styles)&&void 0!==e?e:null)}return this._mainStyles}set mainStyles(e){this._mainStyles!==e&&(null!==this._mainStyles&&this.removeStyles(this._mainStyles),this._mainStyles=e,this.needsInitialization||this.addStyles(e))}addBehavior(e){var t,s;const i=null!==(t=this.behaviors)&&void 0!==t?t:this.behaviors=new Map,n=null!==(s=i.get(e))&&void 0!==s?s:0;0===n?(i.set(e,1),e.addedCallback&&e.addedCallback(this),!e.connectedCallback||this.guardBehaviorConnection||1!==this.stage&&0!==this.stage||e.connectedCallback(this)):i.set(e,n+1)}removeBehavior(e,t=!1){const s=this.behaviors;if(null===s)return;const i=s.get(e);void 0!==i&&(1===i||t?(s.delete(e),e.disconnectedCallback&&3!==this.stage&&e.disconnectedCallback(this),e.removedCallback&&e.removedCallback(this)):s.set(e,i-1))}addStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=gt(s))&&void 0!==t?t:this.source).append(e)}else if(!e.isAttachedTo(s)){const t=e.behaviors;if(e.addStylesTo(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}removeStyles(e){var t;if(!e)return;const s=this.source;if(e instanceof HTMLElement){(null!==(t=gt(s))&&void 0!==t?t:s).removeChild(e)}else if(e.isAttachedTo(s)){const t=e.behaviors;if(e.removeStylesFrom(s),null!==t)for(let e=0,s=t.length;e<s;++e)this.addBehavior(t[e])}}connect(){if(3!==this.stage)return;if(this.stage=0,null!==this.boundObservables){const e=this.source,t=this.boundObservables,s=Object.keys(t);for(let i=0,n=s.length;i<n;++i){const n=s[i];e[n]=t[n]}this.boundObservables=null}const e=this.behaviors;if(null!==e){this.guardBehaviorConnection=!0;for(const t of e.keys())t.connectedCallback&&t.connectedCallback(this);this.guardBehaviorConnection=!1}this.needsInitialization?(this.renderTemplate(this.template),this.addStyles(this.mainStyles),this.needsInitialization=!1):null!==this.view&&this.view.bind(this.source),this.stage=1,B.notify(this,"isConnected")}disconnect(){if(1!==this.stage)return;this.stage=2,B.notify(this,"isConnected"),null!==this.view&&this.view.unbind();const e=this.behaviors;if(null!==e)for(const t of e.keys())t.disconnectedCallback&&t.disconnectedCallback(this);this.stage=3}onAttributeChangedCallback(e,t,s){const i=this.definition.attributeLookup[e];void 0!==i&&i.onAttributeChangedCallback(this.source,s)}emit(e,t,s){return 1===this.stage&&this.source.dispatchEvent(new CustomEvent(e,Object.assign(Object.assign({detail:t},ft),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=gt(s))&&void 0!==t?t:s;if(null!==this.view)this.view.dispose(),this.view=null;else if(!this.needsInitialization||this.hasExistingShadowRoot){this.hasExistingShadowRoot=!1;for(let e=i.firstChild;null!==e;e=i.firstChild)i.removeChild(e)}e&&(this.view=e.render(s,i,s),this.view.sourceLifetime=A.coupled)}static forCustomElement(e){const t=e.$fastController;if(void 0!==t)return t;const s=ut.getForInstance(e);if(void 0===s)throw n.error(1401);return e.$fastController=new bt(e,s)}static setStrategy(e){bt=e}}function yt(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=gt(e))&&void 0!==t?t:e.getRootNode()}vt.setStrategy(vt);class mt{constructor(e){const t=mt.styleSheetCache;this.sheets=e.map((e=>{if(e instanceof CSSStyleSheet)return e;let s=t.get(e);return void 0===s&&(s=new CSSStyleSheet,s.replaceSync(e),t.set(e,s)),s}))}addStylesTo(e){const t=yt(e);t.adoptedStyleSheets=[...t.adoptedStyleSheets,...this.sheets]}removeStylesFrom(e){const t=yt(e),s=this.sheets;t.adoptedStyleSheets=t.adoptedStyleSheets.filter((e=>-1===s.indexOf(e)))}}mt.styleSheetCache=new Map;let wt=0;function xt(e){return e===document?document.body:e}function Ct(e){const t=class extends e{constructor(){super(),vt.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 ut.registerBaseType(t),t}function St(t,s){return e(t)?ut.compose(t,s).define().type:ut.compose(this,t).define().type}J.setDefaultStrategy(J.supportsAdoptedStyleSheets?mt:class{constructor(e){this.styles=e,this.styleClass="fast-"+ ++wt}addStylesTo(e){e=xt(yt(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=xt(yt(e))).querySelectorAll(`.${this.styleClass}`);t[0].parentNode;for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}});const Tt=Object.assign(Ct(HTMLElement),{from:function(e){return Ct(e)},define:St,compose:function(t,s){return e(t)?ut.compose(t,s):ut.compose(this,t)}});function Ot(e){return function(t){St(t,e)}}p.setPolicy(S.create());export{D as ArrayObserver,st as AttributeConfiguration,ot as AttributeDefinition,ue as Binding,G as CSSDirective,Ye as ChildrenDirective,ze as Compiler,p as DOM,c as DOMAspect,et as DangerousHTMLDirective,vt as ElementController,J as ElementStyles,$ as ExecutionContext,n as FAST,Tt as FASTElement,ut as FASTElementDefinition,ve as HTMLBindingDirective,he as HTMLDirective,Se as HTMLView,le as Markup,Ge as NodeObservationDirective,B as Observable,ae as Parser,O as PropertyChangeNotifier,_e as RefDirective,qe as RepeatBehavior,Ue as RepeatDirective,Ke as SlottedDirective,A as SourceLifetime,V as Splice,F as SpliceStrategy,z as SpliceStrategySupport,fe as StatelessAttachedAttributeDirective,T as SubscriberSet,a as Updates,Ee as ViewTemplate,lt as attr,ye as bind,it as booleanConverter,Ze as children,l as createMetadataLocator,o as createTypeRegistry,Y as css,K as cssDirective,ee as cssPartial,Ot as customElement,tt as dangerousHTML,We as elements,r as emptyArray,Me as html,de as htmlDirective,q as lengthOf,we as listener,xe as normalizeBinding,rt as nullableNumberConverter,k as observable,me as oneTime,Fe as ref,Qe as repeat,Xe as slotted,j as volatile,Pe as when};
|