@vkits/parser 0.0.14 → 0.0.15

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s,i={exports:{}};(s=i).exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports;var n=t(i.exports),r={exports:{}},o={exports:{}},a={exports:{}};!function(e){function t(s){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(a);var l={exports:{}};!function(e){var t=a.exports.default;e.exports=function(e,s){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,s||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(l),function(e){var t=a.exports.default,s=l.exports;e.exports=function(e){var i=s(e,"string");return"symbol"==t(i)?i:i+""},e.exports.__esModule=!0,e.exports.default=e.exports}(o),function(e){var t=o.exports;function s(e,s){for(var i=0;i<s.length;i++){var n=s[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t(n.key),n)}}e.exports=function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var d=t(r.exports),c={exports:{}},h={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var t=a.exports.default,s=h.exports;e.exports=function(e,i){if(i&&("object"==t(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return s(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(c);var u=t(c.exports),p={exports:{}},f={exports:{}},g={exports:{}};!function(e){function t(s){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(g);var b=t(g.exports);!function(e){var t=g.exports;e.exports=function(e,s){for(;!{}.hasOwnProperty.call(e,s)&&null!==(e=t(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f),function(e){var t=f.exports;function s(){return e.exports=s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,s,i){var n=t(e,s);if(n){var r=Object.getOwnPropertyDescriptor(n,s);return r.get?r.get.call(arguments.length<3?e:i):r.value}},e.exports.__esModule=!0,e.exports.default=e.exports,s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}(p);var v=t(p.exports),m={exports:{}},y={exports:{}};!function(e){function t(s,i){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(y),function(e){var t=y.exports;e.exports=function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&t(e,s)},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var x=t(m.exports),w={exports:{}};!function(e){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports}(w);var S=t(w.exports);function C(e,t,s,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,s,o):n(t,s))||o);return r>3&&o&&Object.defineProperty(t,s,o),o}let O;"function"==typeof SuppressedError&&SuppressedError;const T="hi-kernel";try{if(document.currentScript)O=document.currentScript.getAttribute(T);else{const e=document.getElementsByTagName("script");O=e[e.length-1].getAttribute(T)}}catch(e){O="isolate"}let B;switch(O){case"share":B=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":B=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)}`;B=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const $=e=>"function"==typeof e,N=e=>"string"==typeof e,k=()=>{};!function(){if("undefined"==typeof globalThis)if(void 0!==e)e.globalThis=e;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}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const E={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.HI&&Reflect.defineProperty(globalThis,"HI",Object.assign({value:Object.create(null)},E));const _=globalThis.HI;if(void 0===_.getById){const e=Object.create(null);Reflect.defineProperty(_,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},E))}void 0===_.error&&Object.assign(_,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const A=Object.freeze([]);function M(){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 I(){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 j(e){e.prototype.toJSON=k}const R=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),P=e=>e,V=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("hi-html",{createHTML:P}):{createHTML:P};let L=Object.freeze({createHTML:e=>V.createHTML(e),protect:(e,t,s,i)=>i});const z=L,H=Object.freeze({get policy(){return L},setPolicy(e){if(L!==z)throw _.error(1201);L=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)}}),D=_.getById(B.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 F{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 q{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 F(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new F(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 U=Object.freeze({unknown:void 0,coupled:1}),W=_.getById(B.observable,(()=>{const e=D.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let i,n=e=>{throw _.error(1101)};function r(e){var t;let i=null!==(t=e.$hiController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new q(e))),i}const o=I();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];$(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends F{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!==U.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return j(l),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){N(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 l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function Q(e,t){W.defineProperty(e,t)}const J=_.getById(B.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),X=Object.freeze({default:{index:0,length:0,get event(){return X.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>J.get(),setEvent(e){J.set(e)}});class G{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}}class K{constructor(e){this.sorted=e}}const Y=Object.freeze({reset:1,splice:2,optimized:3}),Z=new G(0,A,0);Z.reset=!0;const ee=[Z];function te(e,t,s,i,n,r){let o=0,a=0;const l=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,l)),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,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return A;if(t===s){const e=new G(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new G(t,[],s-t)];const d=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 d,c;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]:(d=l[s-1][r]+1,c=l[s][r-1]+1,l[s][r]=d<c?d:c);return l}(e,t,s,i,n,r)),c=[];let h,u=t,p=n;for(let e=0;e<d.length;++e)switch(d[e]){case 0:void 0!==h&&(c.push(h),h=void 0),u++,p++;break;case 1:void 0===h&&(h=new G(u,[],0)),h.addedCount++,u++,h.removed.push(i[p]),p++;break;case 2:void 0===h&&(h=new G(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new G(u,[],0)),h.removed.push(i[p]),p++}return void 0!==h&&c.push(h),c}function se(e,t){let s=!1,i=0;for(let l=0;l<t.length;l++){const d=t[l];if(d.index+=i,s)continue;const c=(n=e.index,r=e.index+e.removed.length,o=d.index,a=d.index+d.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(c>=0){t.splice(l,1),l--,i-=d.addedCount-d.removed.length,e.addedCount+=d.addedCount-c;const n=e.removed.length+d.removed.length-c;if(e.addedCount||n){let t=d.removed;if(e.index<d.index){const s=e.removed.slice(0,d.index-e.index);s.push(...t),t=s}if(e.index+e.removed.length>d.index+d.addedCount){const s=e.removed.slice(d.index+d.addedCount-e.index);t.push(...s)}e.removed=t,d.index<e.index&&(e.index=d.index)}else s=!0}else if(e.index<d.index){s=!0,t.splice(l,0,e),l++;const n=e.addedCount-e.removed.length;d.index+=n,i+=n}}var n,r,o,a;s||t.push(e)}let ie=Object.freeze({support:Y.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?A:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)se(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(te(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):ee,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new G(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new G(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new K(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new G(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new K(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new G(+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 G(0,[],i.length).adjustTo(e)),n}});function ne(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}Object.freeze({reset:ee,setDefaultStrategy(e){ie=e}});class re extends F{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,ne(e,"$hiController",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,W.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,W.notify(e,"sorted"))}},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()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:ie).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,D.enqueue(this))}}let oe=!1;const ae=Object.freeze({sorted:0,enable(){if(oe)return;oe=!0,W.setArrayObserverFactory((e=>new re(e)));const e=Array.prototype;e.$hiPatch||(ne(e,"$hiPatch",1),ne(e,"sorted",0),[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.$hiController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:ie)[t.name](this,i,t,e)}})))}});class le{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class de extends le{createObserver(e){return W.binding(this.evaluate,e,this.isVolatile)}}function ce(e,t,s=W.isVolatileBinding(e)){return new de(e,t,s)}class he extends le{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ue(e,t){return new he(e,t)}let pe;function fe(e){return e.map((e=>e instanceof ge?fe(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}j(he);class ge{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ge?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(pe),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(fe(this.styles)),this}static setDefaultStrategy(e){pe=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ge(e):e instanceof ge?e:new ge([e])}}ge.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const be=M(),ve=Object.freeze({getForInstance:be.getForInstance,getByType:be.getByType,define:e=>(be.register({type:e}),e)});function me(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}ve.define(class{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)=>me(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){me(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){me(this,t.controller,t)}}),Math.random().toString(36).substring(2,8);ve.define(class{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 ge(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)}});const ye=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Se=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ce=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Oe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Te(e){return e&&e.nodeType===Node.COMMENT_NODE}const Be=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=>ye.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Se.test(e),isElementBoundaryStartMarker:e=>Te(e)&&Ce.test(e.data.trim()),isElementBoundaryEndMarker:e=>Te(e)&&Oe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>ke(ye,e),parseContentBindingEndMarker:e=>ke(xe,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Se,e),parseElementBoundaryStartMarker:e=>Ne(Ce,e.trim()),parseElementBoundaryEndMarker:e=>Ne(Oe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Ne(e,t){const s=e.exec(t);return null===s?s:s[1]}function ke(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Ee=Symbol.for("fe-hydration");function _e(e){return e[Ee]===Ee}const Ae=`hi-${Math.random().toString(36).substring(2,8)}`,Me=`${Ae}{`,Ie=`}${Ae}`,je=Ie.length;let Re=0;const Pe=()=>`${Ae}-${++Re}`,Ve=Object.freeze({interpolation:e=>`${Me}${e}${Ie}`,attribute:e=>`${Pe()}="${Me}${e}${Ie}"`,comment:e=>`\x3c!--${Me}${e}${Ie}--\x3e`}),Le=Object.freeze({parse(e,t){const s=e.split(Me);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+je)}""!==o&&i.push(o)}return i}}),ze=M(),He=Object.freeze({getForInstance:ze.getForInstance,getByType:ze.getByType,define:(e,t)=>((t=t||{}).type=e,ze.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?R.tokenList:R.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=R.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=R.event;break;default:e.targetAspect=t,e.aspectType=R.attribute}else e.aspectType=R.content}});class De{constructor(e){this.options=e}createHTML(e){return Ve.attribute(e(this))}createBehavior(){return this}}j(De);class Fe extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function qe(e){return e.nodeType===Node.COMMENT_NODE}function Ue(e){return e.nodeType===Node.TEXT_NODE}function We(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,qe(t)||Ue(t)?t.data.length:t.childNodes.length),s}function Qe(e,t,s){var i;const n=null!==(i=Be.parseAttributeBinding(e))&&void 0!==i?i:Be.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Fe(`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);Xe(t[i],e,s)}e.removeAttribute(Be.attributeMarkerName)}}function Je(e,t,s,i,n){if(Be.isElementBoundaryStartMarker(e))!function(e,t){const s=Be.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(qe(i)){const e=Be.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Be.isContentBindingStartMarker(e.data)){const r=Be.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],d=[];let c=t.nextSibling();e.data="";const h=c;for(;null!==c;){if(qe(c)){const e=Be.parseContentBindingEndMarker(c.data);if(e&&e[1]===a)break}d.push(c),c=t.nextSibling()}if(null===c){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(c.data="",1===d.length&&Ue(d[0]))Xe(l,d[0],i);else{c!==h&&null!==c.previousSibling&&(n[l.targetNodeId]={first:h,last:c.previousSibling});Xe(l,c.parentNode.insertBefore(document.createTextNode(""),c),i)}}}function Xe(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(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 Ye{constructor(){this.index=0,this.length=0}get event(){return X.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 Ze extends Ye{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=U.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(){Ke(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){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}j(Ze),W.defineProperty(Ze.prototype,"index"),W.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=Ee,j(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=Ee,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=U.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,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;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=We(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:Je(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 Fe){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Xe(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new it(r.join("\n"),t,We(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(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 nt={[R.attribute]:H.setAttribute,[R.booleanAttribute]:H.setBooleanAttribute,[R.property]:(e,t,s)=>e[t]=s,[R.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$hiView;if(void 0===t)if(_e(i)&&_e(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$hiTemplate!==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.$hiView=t,e.$hiTemplate=s)}else{const t=e.$hiView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[R.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)}},[R.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=R.content}createHTML(e){return Ve.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw _.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=_e(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case R.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case R.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===R.attribute||this.aspectType===R.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$hiView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){X.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);X.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)}}He.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function dt(e){e.startsWith("hi-")||_.warn(1204,{name:e})}const ct=new Proxy(document.createElement("div"),{get(e,t){dt(t);const s=Reflect.get(e,t);return $(s)?s.bind(e):s},set:(e,t,s)=>(dt(t),Reflect.set(e,t,s))});class ht{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:Pe(),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=at[t];if(!n){const i=`_${t}`;at[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:ct;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(e,t,s,i,n,r=!1){const o=s.attributes,a=e.directives;for(let l=0,d=o.length;l<d;++l){const c=o[l],h=c.value,u=Le.parse(h,a);let p=null;null===u?r&&(p=new rt(ue((()=>h),e.policy)),He.assignAspect(p,c.name)):p=bt.aggregate(u,e.policy),null!==p&&(s.removeAttributeNode(c),l--,d--,e.addFactory(p,t,i,n,s.tagName))}}function pt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=ft(e,s,n,i);n=t.node,i=t.index}}function ft(e,t,s,i){const n=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,n,i),pt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=Le.parse(t.textContent,e.directives);if(null===r)return lt.node=t.nextSibling,lt.index=n+1,lt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ot(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),N(l)?o.textContent=l:(o.textContent=" ",He.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return lt.index=n+1,lt.node=a.nextSibling,lt}(e,s,t,n,i);case 8:const r=Le.parse(s.data,e.directives);null!==r&&e.addFactory(bt.aggregate(r),t,n,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=H.policy){let i;if(N(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new ht(n,t,s);var o,a;return ut(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==Le.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),pt(r,n,"r"),lt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=H.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>N(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new rt(ce(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return He.assignAspect(a,s),a}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function xt(e,t,s,i=He.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&He.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),He.define(yt);class wt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(N(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw _.error(1208);if(this.policy)throw _.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 i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Pe();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,$(a))a=new rt(ce(a));else if(a instanceof le)a=new rt(a);else if(!(o=He.getForInstance(a))){const e=a;a=new rt(ue((()=>e)))}i+=xt(a,n,r,o)}return new wt(i+e[e.length-1],n,s)}}j(wt);const St=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return wt.create(e,t);throw _.error(1206)};St.partial=e=>new yt(e);class Ct extends De{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}He.define(Ct);function Ot(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Tt(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 Bt(e){return e.nodeType===Node.COMMENT_NODE}Object.freeze({positioning:!1,recycle:!0});class $t extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Nt{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=Tt)}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),_e(this.template)&&_e(e)&&e.hydrationStage!==st?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():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=A);const t=this.itemsObserver,s=this.itemsObserver=W.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(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,d=0;for(let c=0,h=e.length;c<h;++c){const h=e[c],u=h.removed;let p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=d=a.length+b.length;for(;f<g;++f){const e=t[f],c=e?e.firstChild:this.location;let h;o&&d>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),d--):h=n.create(),t.splice(f,0,h),s(h,i,f,r),h.insertBefore(c)}b[p]&&a.push(...b.slice(p))}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||(Ze.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 $t(`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 d=a.splice(e,l-e);for(e=0,o=d.length;e<o;++e)d[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 $t(`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(!Bt(t)){t=t.previousSibling;continue}const s=Be.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(Bt(n))if(Be.isRepeatViewEndMarker(n.data))r++;else if(Be.isRepeatViewStartMarker(n.data)){if(!r){if(Be.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.`)}}}He.define(class{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ae.enable()}createHTML(e){return Ve.comment(e(this))}createBehavior(){return new Nt(this)}});class kt extends De{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,A),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Et="slotchange";He.define(class extends kt{observe(e){e.addEventListener(Et,this)}disconnect(e){e.removeEventListener(Et,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}});He.define(class extends kt{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=k,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)}});const _t="boolean",At="reflect",Mt=Object.freeze({locate:I()}),It={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)};class jt{constructor(e,t,s=t.toLowerCase(),i=At,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===_t&&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.$hiController.notify(this.name))}getValue(e){return W.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||D.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case At:const t=this.converter;H.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case _t:H.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Mt.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];N(i)?s.push(new jt(e,i)):s.push(new jt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Rt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Mt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}var Pt=function(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))};const Vt={mode:"open"},Lt={},zt=new Set,Ht=_.getById(B.elementRegistry,(()=>M())),Dt="defer-and-hydrate";class Ft{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.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=jt.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,W.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?Vt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Vt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Lt:Object.assign(Object.assign({},Lt),t.elementOptions),this.styles=ge.normalize(t.styles),Ht.register(this),W.defineProperty(Ft.isRegistered,this.name),Ft.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return zt.has(e)||Ht.getByType(e)?new Ft(class extends e{},t):new Ft(e,t)}static registerBaseType(e){zt.add(e)}static composeAsync(e,t){return new Promise((s=>{(zt.has(e)||Ht.getByType(e))&&s(new Ft(class extends e{},t));const i=new Ft(e,t);W.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}Ft.isRegistered={},Ft.getByType=Ht.getByType,Ft.getForInstance=Ht.getForInstance,Ft.registerAsync=e=>Pt(void 0,void 0,void 0,(function*(){return new Promise((t=>{Ft.isRegistered[e]&&t(Ft.isRegistered[e]),W.getNotifier(Ft.isRegistered).subscribe({handleChange:()=>t(Ft.isRegistered[e])},e)}))})),W.defineProperty(Ft.prototype,"template");class qt{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),_e(this.template)&&_e(e)&&e.hydrationStage!==st&&!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.$hiTemplate=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.$hiTemplate!==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)}}He.define(class{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ve.comment(e(this))}createBehavior(){return new qt(this)}});const Ut=new Map,Wt={":model":e=>e},Qt=Symbol("RenderInstruction"),Jt="default-view";function Xt(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&$(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return wt.create(s,i,a)}function Gt(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:Jt;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=Ft.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=Wt),i=Xt(t,e)}else i=e.template;var n;return{brand:Qt,type:e.type,name:s,template:i}}function Kt(e){return e&&e.brand===Qt}function Yt(e,t){const s=Ut.get(e);if(void 0!==s)return s[null!=t?t:Jt]}St`
1
+ var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var s,i={exports:{}};(s=i).exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},s.exports.__esModule=!0,s.exports.default=s.exports;var n=t(i.exports),r={exports:{}},o={exports:{}},a={exports:{}};!function(e){function t(s){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(a);var l={exports:{}};!function(e){var t=a.exports.default;e.exports=function(e,s){if("object"!=t(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,s||"default");if("object"!=t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(l),function(e){var t=a.exports.default,s=l.exports;e.exports=function(e){var i=s(e,"string");return"symbol"==t(i)?i:i+""},e.exports.__esModule=!0,e.exports.default=e.exports}(o),function(e){var t=o.exports;function s(e,s){for(var i=0;i<s.length;i++){var n=s[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t(n.key),n)}}e.exports=function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(r);var c=t(r.exports),d={exports:{}},h={exports:{}};!function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(h),function(e){var t=a.exports.default,s=h.exports;e.exports=function(e,i){if(i&&("object"==t(i)||"function"==typeof i))return i;if(void 0!==i)throw new TypeError("Derived constructors may only return object or undefined");return s(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(d);var u=t(d.exports),p={exports:{}},f={exports:{}},g={exports:{}};!function(e){function t(s){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(g);var b=t(g.exports);!function(e){var t=g.exports;e.exports=function(e,s){for(;!{}.hasOwnProperty.call(e,s)&&null!==(e=t(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports}(f),function(e){var t=f.exports;function s(){return e.exports=s="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,s,i){var n=t(e,s);if(n){var r=Object.getOwnPropertyDescriptor(n,s);return r.get?r.get.call(arguments.length<3?e:i):r.value}},e.exports.__esModule=!0,e.exports.default=e.exports,s.apply(null,arguments)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}(p);var v=t(p.exports),m={exports:{}},y={exports:{}};!function(e){function t(s,i){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(y),function(e){var t=y.exports;e.exports=function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&t(e,s)},e.exports.__esModule=!0,e.exports.default=e.exports}(m);var x=t(m.exports),w={exports:{}};!function(e){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports}(w);var S=t(w.exports);function C(e,t,s,i){var n,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(r<3?n(o):r>3?n(t,s,o):n(t,s))||o);return r>3&&o&&Object.defineProperty(t,s,o),o}let O;"function"==typeof SuppressedError&&SuppressedError;const T="hi-kernel";try{if(document.currentScript)O=document.currentScript.getAttribute(T);else{const e=document.getElementsByTagName("script");O=e[e.length-1].getAttribute(T)}}catch(e){O="isolate"}let B;switch(O){case"share":B=Object.freeze({updateQueue:1,observable:2,contextEvent:3,elementRegistry:4});break;case"share-v2":B=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)}`;B=Object.freeze({updateQueue:`1.2${e}`,observable:`2.2${e}`,contextEvent:`3.2${e}`,elementRegistry:`4.2${e}`})}const $=e=>"function"==typeof e,N=e=>"string"==typeof e,k=()=>{};!function(){if("undefined"==typeof globalThis)if(void 0!==e)e.globalThis=e;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}}(),"requestIdleCallback"in globalThis||(globalThis.requestIdleCallback=function(e,t){const s=Date.now();return setTimeout((()=>{e({didTimeout:!!(null==t?void 0:t.timeout)&&Date.now()-s>=t.timeout,timeRemaining:()=>0})}),1)},globalThis.cancelIdleCallback=function(e){clearTimeout(e)});const E={configurable:!1,enumerable:!1,writable:!1};void 0===globalThis.HI&&Reflect.defineProperty(globalThis,"HI",Object.assign({value:Object.create(null)},E));const _=globalThis.HI;if(void 0===_.getById){const e=Object.create(null);Reflect.defineProperty(_,"getById",Object.assign({value(t,s){let i=e[t];return void 0===i&&(i=s?e[t]=s():null),i}},E))}void 0===_.error&&Object.assign(_,{warn(){},error:e=>new Error(`Error ${e}`),addMessages(){}});const A=Object.freeze([]);function M(){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 I(){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 j(e){e.prototype.toJSON=k}const R=Object.freeze({none:0,attribute:1,booleanAttribute:2,property:3,content:4,tokenList:5,event:6}),P=e=>e,V=globalThis.trustedTypes?globalThis.trustedTypes.createPolicy("hi-html",{createHTML:P}):{createHTML:P};let L=Object.freeze({createHTML:e=>V.createHTML(e),protect:(e,t,s,i)=>i});const z=L,H=Object.freeze({get policy(){return L},setPolicy(e){if(L!==z)throw _.error(1201);L=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)}}),D=_.getById(B.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 F{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 q{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 F(this.subject):null!==(i=this.subjectSubscribers)&&void 0!==i?i:this.subjectSubscribers=new F(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 U=Object.freeze({unknown:void 0,coupled:1}),W=_.getById(B.observable,(()=>{const e=D.enqueue,t=/(:|&&|\|\||if|\?\.)/,s=new WeakMap;let i,n=e=>{throw _.error(1101)};function r(e){var t;let i=null!==(t=e.$hiController)&&void 0!==t?t:s.get(e);return void 0===i&&(Array.isArray(e)?i=n(e):s.set(e,i=new q(e))),i}const o=I();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];$(n)&&n.call(e,i,t),r(e).notify(this.name)}}}class l extends F{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!==U.coupled||this.first!==this.last||this.first.propertySource!==e.source}unbind(e){this.dispose()}observe(e,t){this.needsRefresh&&null!==this.last&&this.dispose();const s=i;let n;i=this.needsRefresh?this:void 0,this.needsRefresh=this.isVolatileBinding;try{n=this.expression(e,t)}finally{i=s}return n}disconnect(){this.dispose()}dispose(){if(null!==this.last){let e=this.first;for(;void 0!==e;)e.notifier.unsubscribe(this,e.propertyName),e=e.next;this.last=null,this.needsRefresh=this.needsQueue=this.isAsync}}watch(e,t){const s=this.last,n=r(e),o=null===s?this.first:{};if(o.propertySource=e,o.propertyName=t,o.notifier=n,n.subscribe(this,t),null!==s){if(!this.needsRefresh){let t;i=void 0,t=s.propertySource[s.propertyName],i=this,e===t&&(this.needsRefresh=!0)}s.next=o}this.last=o}handleChange(){this.needsQueue?(this.needsQueue=!1,e(this)):this.isAsync||this.call()}call(){null!==this.last&&(this.needsQueue=this.isAsync,this.notify(this))}*records(){let e=this.first;for(;void 0!==e;)yield e,e=e.next}}return j(l),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){N(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 l(e,t,s)},isVolatileBinding:e=>t.test(e.toString())})}));function Q(e,t){W.defineProperty(e,t)}const J=_.getById(B.contextEvent,(()=>{let e=null;return{get:()=>e,set(t){e=t}}})),X=Object.freeze({default:{index:0,length:0,get event(){return X.getEvent()},eventDetail(){return this.event.detail},eventTarget(){return this.event.target}},getEvent:()=>J.get(),setEvent(e){J.set(e)}});class G{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}}class K{constructor(e){this.sorted=e}}const Y=Object.freeze({reset:1,splice:2,optimized:3}),Z=new G(0,A,0);Z.reset=!0;const ee=[Z];function te(e,t,s,i,n,r){let o=0,a=0;const l=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,l)),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,l-o)),n+=o,r-=a,(s-=a)-(t+=o)==0&&r-n==0)return A;if(t===s){const e=new G(t,[],0);for(;n<r;)e.removed.push(i[n++]);return[e]}if(n===r)return[new G(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],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,d;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,d=l[s][r-1]+1,l[s][r]=c<d?c:d);return l}(e,t,s,i,n,r)),d=[];let h,u=t,p=n;for(let e=0;e<c.length;++e)switch(c[e]){case 0:void 0!==h&&(d.push(h),h=void 0),u++,p++;break;case 1:void 0===h&&(h=new G(u,[],0)),h.addedCount++,u++,h.removed.push(i[p]),p++;break;case 2:void 0===h&&(h=new G(u,[],0)),h.addedCount++,u++;break;case 3:void 0===h&&(h=new G(u,[],0)),h.removed.push(i[p]),p++}return void 0!==h&&d.push(h),d}function se(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 d=(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(d>=0){t.splice(l,1),l--,i-=c.addedCount-c.removed.length,e.addedCount+=c.addedCount-d;const n=e.removed.length+c.removed.length-d;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 ie=Object.freeze({support:Y.optimized,normalize:(e,t,s)=>void 0===e?void 0===s?A:function(e,t){let s=[];const i=[];for(let e=0,s=t.length;e<s;e++)se(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(te(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):ee,pop(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new G(e.length,[r],0)),r},push(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new G(e.length-i.length,[],i.length).adjustTo(e)),n},reverse(e,t,s,i){const n=s.apply(e,i);e.sorted++;const r=[];for(let t=e.length-1;t>=0;t--)r.push(t);return t.addSort(new K(r)),n},shift(e,t,s,i){const n=e.length>0,r=s.apply(e,i);return n&&t.addSplice(new G(0,[r],0)),r},sort(e,t,s,i){const n=new Map;for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t])||[];n.set(e[t],[...s,t])}const r=s.apply(e,i);e.sorted++;const o=[];for(let t=0,s=e.length;t<s;++t){const s=n.get(e[t]);o.push(s[0]),n.set(e[t],s.splice(1))}return t.addSort(new K(o)),r},splice(e,t,s,i){const n=s.apply(e,i);return t.addSplice(new G(+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 G(0,[],i.length).adjustTo(e)),n}});function ne(e,t,s,i=!0){Reflect.defineProperty(e,t,{value:s,enumerable:!1,writable:i})}Object.freeze({reset:ee,setDefaultStrategy(e){ie=e}});class re extends F{constructor(e){super(e),this.oldCollection=void 0,this.splices=void 0,this.sorts=void 0,this.needsQueue=!0,this._strategy=null,this._lengthObserver=void 0,this._sortObserver=void 0,this.call=this.flush,ne(e,"$hiController",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,W.notify(e,"length"))}},this.subscribe(e)}return e}get sortObserver(){let e=this._sortObserver;if(void 0===e){const t=this.subject;this._sortObserver=e={sorted:t.sorted,handleChange(){this.sorted!==t.sorted&&(this.sorted=t.sorted,W.notify(e,"sorted"))}},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()}addSort(e){void 0===this.sorts?this.sorts=[e]:this.sorts.push(e),this.enqueue()}reset(e){this.oldCollection=e,this.enqueue()}flush(){var e;const t=this.splices,s=this.sorts,i=this.oldCollection;void 0===t&&void 0===i&&void 0===s||(this.needsQueue=!0,this.splices=void 0,this.sorts=void 0,this.oldCollection=void 0,void 0!==s?this.notify(s):this.notify((null!==(e=this._strategy)&&void 0!==e?e:ie).normalize(i,this.subject,t)))}enqueue(){this.needsQueue&&(this.needsQueue=!1,D.enqueue(this))}}let oe=!1;const ae=Object.freeze({sorted:0,enable(){if(oe)return;oe=!0,W.setArrayObserverFactory((e=>new re(e)));const e=Array.prototype;e.$hiPatch||(ne(e,"$hiPatch",1),ne(e,"sorted",0),[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.$hiController;return void 0===i?t.apply(this,e):(null!==(s=i.strategy)&&void 0!==s?s:ie)[t.name](this,i,t,e)}})))}});class le{constructor(e,t,s=!1){this.evaluate=e,this.policy=t,this.isVolatile=s}}class ce extends le{createObserver(e){return W.binding(this.evaluate,e,this.isVolatile)}}function de(e,t,s=W.isVolatileBinding(e)){return new ce(e,t,s)}class he extends le{createObserver(){return this}bind(e){return this.evaluate(e.source,e.context)}}function ue(e,t){return new he(e,t)}let pe;function fe(e){return e.map((e=>e instanceof ge?fe(e.styles):[e])).reduce(((e,t)=>e.concat(t)),[])}j(he);class ge{constructor(e){this.styles=e,this.targets=new WeakSet,this._strategy=null,this.behaviors=e.map((e=>e instanceof ge?e.behaviors:null)).reduce(((e,t)=>null===t?e:null===e?t:e.concat(t)),null)}get strategy(){return null===this._strategy&&this.withStrategy(pe),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(fe(this.styles)),this}static setDefaultStrategy(e){pe=e}static normalize(e){return void 0===e?void 0:Array.isArray(e)?new ge(e):e instanceof ge?e:new ge([e])}}ge.supportsAdoptedStyleSheets=Array.isArray(document.adoptedStyleSheets)&&"replace"in CSSStyleSheet.prototype;const be=M(),ve=Object.freeze({getForInstance:be.getForInstance,getByType:be.getByType,define:e=>(be.register({type:e}),e)});function me(e,t,s){t.source.style.setProperty(e.targetAspect,s.bind(t))}ve.define(class{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)=>me(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){me(this,e,e[this.targetAspect])}removedCallback(e){e.source.$cssBindings&&e.source.$cssBindings.delete(this)}handleChange(e,t){me(this,t.controller,t)}}),Math.random().toString(36).substring(2,8);ve.define(class{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 ge(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)}});const ye=/fe-b\$\$start\$\$(\d+)\$\$(.+)\$\$fe-b/,xe=/fe-b\$\$end\$\$(\d+)\$\$(.+)\$\$fe-b/,we=/fe-repeat\$\$start\$\$(\d+)\$\$fe-repeat/,Se=/fe-repeat\$\$end\$\$(\d+)\$\$fe-repeat/,Ce=/^(?:.{0,1000})fe-eb\$\$start\$\$(.+?)\$\$fe-eb/,Oe=/fe-eb\$\$end\$\$(.{0,1000})\$\$fe-eb(?:.{0,1000})$/;function Te(e){return e&&e.nodeType===Node.COMMENT_NODE}const Be=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=>ye.test(e),isContentBindingEndMarker:e=>xe.test(e),isRepeatViewStartMarker:e=>we.test(e),isRepeatViewEndMarker:e=>Se.test(e),isElementBoundaryStartMarker:e=>Te(e)&&Ce.test(e.data.trim()),isElementBoundaryEndMarker:e=>Te(e)&&Oe.test(e.data),parseAttributeBinding(e){const t=e.getAttribute(this.attributeMarkerName);return null===t?t:t.split(this.attributeBindingSeparator).map((e=>parseInt(e)))},parseEnumeratedAttributeBinding(e){const t=[],s=this.attributeMarkerName.length+1,i=`${this.attributeMarkerName}-`;for(const n of e.getAttributeNames())if(n.startsWith(i)){const e=Number(n.slice(s));if(Number.isNaN(e))throw new Error(`Invalid attribute marker name: ${n}. Expected format is ${i}<number>.`);t.push(e)}return 0===t.length?null:t},parseContentBindingStartMarker:e=>ke(ye,e),parseContentBindingEndMarker:e=>ke(xe,e),parseRepeatStartMarker:e=>$e(we,e),parseRepeatEndMarker:e=>$e(Se,e),parseElementBoundaryStartMarker:e=>Ne(Ce,e.trim()),parseElementBoundaryEndMarker:e=>Ne(Oe,e)});function $e(e,t){const s=e.exec(t);return null===s?s:parseInt(s[1])}function Ne(e,t){const s=e.exec(t);return null===s?s:s[1]}function ke(e,t){const s=e.exec(t);return null===s?s:[parseInt(s[1]),s[2]]}const Ee=Symbol.for("fe-hydration");function _e(e){return e[Ee]===Ee}const Ae=`hi-${Math.random().toString(36).substring(2,8)}`,Me=`${Ae}{`,Ie=`}${Ae}`,je=Ie.length;let Re=0;const Pe=()=>`${Ae}-${++Re}`,Ve=Object.freeze({interpolation:e=>`${Me}${e}${Ie}`,attribute:e=>`${Pe()}="${Me}${e}${Ie}"`,comment:e=>`\x3c!--${Me}${e}${Ie}--\x3e`}),Le=Object.freeze({parse(e,t){const s=e.split(Me);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+je)}""!==o&&i.push(o)}return i}}),ze=M(),He=Object.freeze({getForInstance:ze.getForInstance,getByType:ze.getByType,define:(e,t)=>((t=t||{}).type=e,ze.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?R.tokenList:R.property;break;case"?":e.targetAspect=t.substring(1),e.aspectType=R.booleanAttribute;break;case"@":e.targetAspect=t.substring(1),e.aspectType=R.event;break;default:e.targetAspect=t,e.aspectType=R.attribute}else e.aspectType=R.content}});class De{constructor(e){this.options=e}createHTML(e){return Ve.attribute(e(this))}createBehavior(){return this}}j(De);class Fe extends Error{constructor(e,t,s){super(e),this.factories=t,this.node=s}}function qe(e){return e.nodeType===Node.COMMENT_NODE}function Ue(e){return e.nodeType===Node.TEXT_NODE}function We(e,t){const s=document.createRange();return s.setStart(e,0),s.setEnd(t,qe(t)||Ue(t)?t.data.length:t.childNodes.length),s}function Qe(e,t,s){var i;const n=null!==(i=Be.parseAttributeBinding(e))&&void 0!==i?i:Be.parseEnumeratedAttributeBinding(e);if(null!==n){for(const i of n){if(!t[i])throw new Fe(`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);Xe(t[i],e,s)}e.removeAttribute(Be.attributeMarkerName)}}function Je(e,t,s,i,n){if(Be.isElementBoundaryStartMarker(e))!function(e,t){const s=Be.parseElementBoundaryStartMarker(e.data);let i=t.nextSibling();for(;null!==i;){if(qe(i)){const e=Be.parseElementBoundaryEndMarker(i.data);if(e&&e===s)break}i=t.nextSibling()}}(e,t);else if(Be.isContentBindingStartMarker(e.data)){const r=Be.parseContentBindingStartMarker(e.data);if(null===r)return;const[o,a]=r,l=s[o],c=[];let d=t.nextSibling();e.data="";const h=d;for(;null!==d;){if(qe(d)){const e=Be.parseContentBindingEndMarker(d.data);if(e&&e[1]===a)break}c.push(d),d=t.nextSibling()}if(null===d){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(d.data="",1===c.length&&Ue(c[0]))Xe(l,c[0],i);else{d!==h&&null!==d.previousSibling&&(n[l.targetNodeId]={first:h,last:d.previousSibling});Xe(l,d.parentNode.insertBefore(document.createTextNode(""),d),i)}}}function Xe(e,t,s){if(void 0===e.targetNodeId)throw new Error("Factory could not be target to the node");s[e.targetNodeId]=t}var Ge;function Ke(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 Ye{constructor(){this.index=0,this.length=0}get event(){return X.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 Ze extends Ye{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=U.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(){Ke(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){Ke(e[0].firstChild,e[e.length-1].lastChild);for(let t=0,s=e.length;t<s;++t)e[t].unbind()}}}j(Ze),W.defineProperty(Ze.prototype,"index"),W.defineProperty(Ze.prototype,"length");const et="unhydrated",tt="hydrating",st="hydrated";class it extends Error{constructor(e,t,s,i){super(e),this.factory=t,this.fragment=s,this.templateString=i}}Ge=Ee,j(class extends Ye{constructor(e,t,s,i){super(),this.firstChild=e,this.lastChild=t,this.sourceTemplate=s,this.hostBindingTarget=i,this[Ge]=Ee,this.context=this,this.source=null,this.isBound=!1,this.sourceLifetime=U.unknown,this.unbindables=[],this.fragment=null,this.behaviors=null,this._hydrationStage=et,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;if(this.hydrationStage!==st&&(this._hydrationStage=tt),this.source===e)return;let i=this.behaviors;if(null===i){this.source=e,this.context=t;try{const{targets:e,boundaries:t}=function(e,t,s){const i=We(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:Je(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 Fe){let t=this.sourceTemplate.html;"string"!=typeof t&&(t=t.innerHTML),e.templateString=t}throw e}this.behaviors=i=new Array(this.factories.length);const n=this.factories;for(let e=0,t=n.length;e<t;++e){const t=n[e];if("h"===t.targetNodeId&&this.hostBindingTarget&&Xe(t,this.hostBindingTarget,this._targets),!(t.targetNodeId in this.targets)){let e=this.sourceTemplate.html;"string"!=typeof e&&(e=e.innerHTML);const i=(null===(s=this.firstChild)||void 0===s?void 0:s.getRootNode()).host,n=t,r=[`HydrationView was unable to successfully target bindings inside "<${((null==i?void 0:i.nodeName)||"unknown").toLowerCase()}>".`,"\nMismatch Details:",` - Expected target node ID: "${t.targetNodeId}"`,` - Available target IDs: [${Object.keys(this.targets).join(", ")||"none"}]`];throw t.targetTagName&&r.push(` - Expected tag name: "${t.targetTagName}"`),n.sourceAspect&&r.push(` - Source aspect: "${n.sourceAspect}"`),void 0!==n.aspectType&&r.push(` - Aspect type: ${n.aspectType}`),r.push("\nThis usually means:"," 1. The server-rendered HTML doesn't match the client template"," 2. The hydration markers are missing or corrupted"," 3. The DOM structure was modified before hydration",`\nTemplate: ${e.slice(0,200)}${e.length>200?"...":""}`),new it(r.join("\n"),t,We(this.firstChild,this.lastChild).cloneContents(),e)}{const s=t.createBehavior();s.bind(this),i[e]=s}}}else{null!==this.source&&this.evaluateUnbindables(),this.isBound=!1,this.source=e,this.context=t;for(let e=0,t=i.length;e<t;++e)i[e].bind(this)}this.isBound=!0,this._hydrationStage=st}unbind(){this.isBound&&null!==this.source&&(this.evaluateUnbindables(),this.source=null,this.context=this,this.isBound=!1)}dispose(){Ke(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 nt={[R.attribute]:H.setAttribute,[R.booleanAttribute]:H.setBooleanAttribute,[R.property]:(e,t,s)=>e[t]=s,[R.content]:function(e,t,s,i){if(null==s&&(s=""),function(e){return void 0!==e.create}(s)){e.textContent="";let t=e.$hiView;if(void 0===t)if(_e(i)&&_e(s)&&void 0!==i.bindingViewBoundaries[this.targetNodeId]&&i.hydrationStage!==st){const e=i.bindingViewBoundaries[this.targetNodeId];t=s.hydrate(e.first,e.last)}else t=s.create();else e.$hiTemplate!==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.$hiView=t,e.$hiTemplate=s)}else{const t=e.$hiView;void 0!==t&&t.isComposed&&(t.isComposed=!1,t.remove(),t.needsBindOnly?t.needsBindOnly=!1:t.unbind()),e.textContent=s}},[R.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)}},[R.event]:()=>{}};class rt{constructor(e){this.dataBinding=e,this.updateTarget=null,this.aspectType=R.content}createHTML(e){return Ve.interpolation(e(this))}createBehavior(){var e;if(null===this.updateTarget){const t=nt[this.aspectType],s=null!==(e=this.dataBinding.policy)&&void 0!==e?e:this.policy;if(!t)throw _.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=_e(e)&&e.hydrationStage&&e.hydrationStage!==st;switch(this.aspectType){case R.event:s[this.data]=e,s.addEventListener(this.targetAspect,this,this.dataBinding.options);break;case R.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===R.attribute||this.aspectType===R.booleanAttribute)){n.bind(e);break}this.updateTarget(s,this.targetAspect,n.bind(e),e)}}unbind(e){const t=e.targets[this.targetNodeId].$hiView;void 0!==t&&t.isComposed&&(t.unbind(),t.needsBindOnly=!0)}handleEvent(e){const t=e.currentTarget[this.data];if(t.isBound){X.setEvent(e);const s=this.dataBinding.evaluate(t.source,t.context);X.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)}}He.define(rt,{aspected:!0});const ot=(e,t)=>`${e}.${t}`,at={},lt={index:0,node:null};function ct(e){e.startsWith("hi-")||_.warn(1204,{name:e})}const dt=new Proxy(document.createElement("div"),{get(e,t){ct(t);const s=Reflect.get(e,t);return $(s)?s.bind(e):s},set:(e,t,s)=>(ct(t),Reflect.set(e,t,s))});class ht{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:Pe(),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=at[t];if(!n){const i=`_${t}`;at[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:dt;for(const e of this.nodeIds)s[e];return new Ze(t,this.factories,s)}}function ut(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 d=o[l],h=d.value,u=Le.parse(h,a);let p=null;null===u?r&&(p=new rt(ue((()=>h),e.policy)),He.assignAspect(p,d.name)):p=bt.aggregate(u,e.policy),null!==p&&(s.removeAttributeNode(d),l--,c--,e.addFactory(p,t,i,n,s.tagName))}}function pt(e,t,s){let i=0,n=t.firstChild;for(;n;){const t=ft(e,s,n,i);n=t.node,i=t.index}}function ft(e,t,s,i){const n=ot(t,i);switch(s.nodeType){case 1:ut(e,t,s,n,i),pt(e,s,n);break;case 3:return function(e,t,s,i,n){const r=Le.parse(t.textContent,e.directives);if(null===r)return lt.node=t.nextSibling,lt.index=n+1,lt;let o,a=o=t;for(let t=0,l=r.length;t<l;++t){const l=r[t];0!==t&&(n++,i=ot(s,n),o=a.parentNode.insertBefore(document.createTextNode(""),a.nextSibling)),N(l)?o.textContent=l:(o.textContent=" ",He.assignAspect(l),e.addFactory(l,s,i,n,null)),a=o}return lt.index=n+1,lt.node=a.nextSibling,lt}(e,s,t,n,i);case 8:const r=Le.parse(s.data,e.directives);null!==r&&e.addFactory(bt.aggregate(r),t,n,i,null)}return lt.index=i+1,lt.node=s.nextSibling,lt}const gt="TEMPLATE",bt={compile(e,t,s=H.policy){let i;if(N(e)){i=document.createElement(gt),i.innerHTML=s.createHTML(e);const t=i.content.firstElementChild;null!==t&&t.tagName===gt&&(i=t)}else i=e;i.content.firstChild||i.content.lastChild||i.content.appendChild(document.createComment(""));const n=document.adoptNode(i.content),r=new ht(n,t,s);var o,a;return ut(r,"",i,"h",0,!0),o=n.firstChild,a=t,(o&&8==o.nodeType&&null!==Le.parse(o.data,a)||1===n.childNodes.length&&Object.keys(t).length>0)&&n.insertBefore(document.createComment(""),n.firstChild),pt(r,n,"r"),lt.node=null,r.freeze()},setDefaultStrategy(e){this.compile=e},aggregate(e,t=H.policy){if(1===e.length)return e[0];let s,i,n=!1;const r=e.length,o=e.map((e=>N(e)?()=>e:(s=e.sourceAspect||s,n=n||e.dataBinding.isVolatile,i=i||e.dataBinding.policy,e.dataBinding.evaluate))),a=new rt(de(((e,t)=>{let s="";for(let i=0;i<r;++i)s+=o[i](e,t);return s}),null!=i?i:t,n));return He.assignAspect(a,s),a}},vt=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,mt=Object.create(null);class yt{constructor(e,t=mt){this.html=e,this.factories=t}createHTML(e){const t=this.factories;for(const s in t)e(t[s]);return this.html}}function xt(e,t,s,i=He.getForInstance(e)){if(i.aspected){const s=vt.exec(t);null!==s&&He.assignAspect(e,s[2])}return e.createHTML(s)}yt.empty=new yt(""),He.define(yt);class wt{constructor(e,t={},s){this.policy=s,this.result=null,this.html=e,this.factories=t}compile(){return null===this.result&&(this.result=bt.compile(this.html,this.factories,this.policy)),this.result}create(e){return this.compile().createView(e)}inline(){return new yt(N(this.html)?this.html:this.html.innerHTML,this.factories)}withPolicy(e){if(this.result)throw _.error(1208);if(this.policy)throw _.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 i="";const n=Object.create(null),r=e=>{var t;const s=null!==(t=e.id)&&void 0!==t?t:e.id=Pe();return n[s]=e,s};for(let s=0,n=e.length-1;s<n;++s){const n=e[s];let o,a=t[s];if(i+=n,$(a))a=new rt(de(a));else if(a instanceof le)a=new rt(a);else if(!(o=He.getForInstance(a))){const e=a;a=new rt(ue((()=>e)))}i+=xt(a,n,r,o)}return new wt(i+e[e.length-1],n,s)}}j(wt);const St=(e,...t)=>{if(Array.isArray(e)&&Array.isArray(e.raw))return wt.create(e,t);throw _.error(1206)};St.partial=e=>new yt(e);class Ct extends De{bind(e){e.source[this.options]=e.targets[this.targetNodeId]}}He.define(Ct);function Ot(e,t,s,i){e.context.parent=i.source,e.context.parentContext=i.context,e.bind(t[s])}function Tt(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 Bt(e){return e.nodeType===Node.COMMENT_NODE}Object.freeze({positioning:!1,recycle:!0});class $t extends Error{constructor(e,t){super(e),this.propertyBag=t}}class Nt{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=Tt)}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),_e(this.template)&&_e(e)&&e.hydrationStage!==st?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():t[0].sorted?this.updateSortedViews(t):this.updateSplicedViews(t)}}observeItems(e=!1){if(!this.items)return void(this.items=A);const t=this.itemsObserver,s=this.itemsObserver=W.getNotifier(this.items),i=t!==s;i&&null!==t&&t.unsubscribe(this),(i||e)&&s.subscribe(this)}updateSortedViews(e){const t=this.views;for(let s=0,i=e.length;s<i;++s){const i=e[s].sorted.slice(),n=i.slice().sort();for(let e=0,s=i.length;e<s;++e){const s=i.find((t=>i[e]===n[t]));if(s!==e){const i=n.splice(s,1);n.splice(e,0,...i);const r=t[e],o=r?r.firstChild:this.location;t[s].remove(),t[s].insertBefore(o);const a=t.splice(s,1);t.splice(e,0,...a)}}}}updateSplicedViews(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 d=0,h=e.length;d<h;++d){const h=e[d],u=h.removed;let p=0,f=h.index;const g=f+h.addedCount,b=t.splice(h.index,u.length),v=c=a.length+b.length;for(;f<g;++f){const e=t[f],d=e?e.firstChild:this.location;let h;o&&c>0?(p<=v&&b.length>0?(h=b[p],p++):(h=a[l],l++),c--):h=n.create(),t.splice(f,0,h),s(h,i,f,r),h.insertBefore(d)}b[p]&&a.push(...b.slice(p))}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||(Ze.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 $t(`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 $t(`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(!Bt(t)){t=t.previousSibling;continue}const s=Be.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(Bt(n))if(Be.isRepeatViewEndMarker(n.data))r++;else if(Be.isRepeatViewStartMarker(n.data)){if(!r){if(Be.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.`)}}}He.define(class{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.options=s,ae.enable()}createHTML(e){return Ve.comment(e(this))}createBehavior(){return new Nt(this)}});class kt extends De{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,A),this.disconnect(t),t[this._controllerProperty]=null}getSource(e){return e[this._controllerProperty].source}updateTarget(e,t){e[this.options.property]=t}computeNodes(e){let t=this.getNodes(e);return"filter"in this.options&&(t=t.filter(this.options.filter)),t}}const Et="slotchange";He.define(class extends kt{observe(e){e.addEventListener(Et,this)}disconnect(e){e.removeEventListener(Et,this)}getNodes(e){return e.assignedNodes(this.options)}handleEvent(e){const t=e.currentTarget;this.updateTarget(this.getSource(t),this.computeNodes(t))}});He.define(class extends kt{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=k,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)}});const _t="boolean",At="reflect",Mt=Object.freeze({locate:I()}),It={toView:e=>e?"true":"false",fromView:e=>!(null==e||"false"===e||!1===e||0===e)};class jt{constructor(e,t,s=t.toLowerCase(),i=At,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===_t&&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.$hiController.notify(this.name))}getValue(e){return W.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||D.enqueue((()=>{s.add(e);const i=e[this.fieldName];switch(t){case At:const t=this.converter;H.setAttribute(e,this.attribute,void 0!==t?t.toView(i):i);break;case _t:H.setBooleanAttribute(e,this.attribute,i)}s.delete(e)}))}static collect(e,...t){const s=[];t.push(Mt.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];N(i)?s.push(new jt(e,i)):s.push(new jt(e,i.property,i.attribute,i.mode,i.converter))}}return s}}function Rt(e,t){let s;function i(e,t){arguments.length>1&&(s.property=t),Mt.locate(e.constructor).push(s)}return arguments.length>1?(s={},void i(e,t)):(s=void 0===e?{}:e,i)}var Pt=function(e,t,s,i){return new(s||(s=Promise))((function(n,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}l((i=i.apply(e,t||[])).next())}))};const Vt={mode:"open"},Lt={},zt=new Set,Ht=_.getById(B.elementRegistry,(()=>M())),Dt="defer-and-hydrate";class Ft{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.templateOptions=t.templateOptions,this.registry=null!==(s=t.registry)&&void 0!==s?s:customElements;const i=e.prototype,n=jt.collect(e,t.attributes),r=new Array(n.length),o={},a={};for(let e=0,t=n.length;e<t;++e){const t=n[e];r[e]=t.attribute,o[t.name]=t,a[t.attribute]=t,W.defineProperty(i,t)}Reflect.defineProperty(e,"observedAttributes",{value:r,enumerable:!0}),this.attributes=n,this.propertyLookup=o,this.attributeLookup=a,this.shadowOptions=void 0===t.shadowOptions?Vt:null===t.shadowOptions?void 0:Object.assign(Object.assign({},Vt),t.shadowOptions),this.elementOptions=void 0===t.elementOptions?Lt:Object.assign(Object.assign({},Lt),t.elementOptions),this.styles=ge.normalize(t.styles),Ht.register(this),W.defineProperty(Ft.isRegistered,this.name),Ft.isRegistered[this.name]=this.type}get isDefined(){return this.platformDefined}define(e=this.registry){var t,s;const i=this.type;return e.get(this.name)||(this.platformDefined=!0,e.define(this.name,i,this.elementOptions),null===(s=null===(t=this.lifecycleCallbacks)||void 0===t?void 0:t.elementDidDefine)||void 0===s||s.call(t,this.name)),this}static compose(e,t){return zt.has(e)||Ht.getByType(e)?new Ft(class extends e{},t):new Ft(e,t)}static registerBaseType(e){zt.add(e)}static composeAsync(e,t){return new Promise((s=>{(zt.has(e)||Ht.getByType(e))&&s(new Ft(class extends e{},t));const i=new Ft(e,t);W.getNotifier(i).subscribe({handleChange:()=>{var e,t;null===(t=null===(e=i.lifecycleCallbacks)||void 0===e?void 0:e.templateDidUpdate)||void 0===t||t.call(e,i.name),s(i)}},"template")}))}}Ft.isRegistered={},Ft.getByType=Ht.getByType,Ft.getForInstance=Ht.getForInstance,Ft.registerAsync=e=>Pt(void 0,void 0,void 0,(function*(){return new Promise((t=>{Ft.isRegistered[e]&&t(Ft.isRegistered[e]),W.getNotifier(Ft.isRegistered).subscribe({handleChange:()=>t(Ft.isRegistered[e])},e)}))})),W.defineProperty(Ft.prototype,"template");class qt{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),_e(this.template)&&_e(e)&&e.hydrationStage!==st&&!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.$hiTemplate=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.$hiTemplate!==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)}}He.define(class{constructor(e,t,s){this.dataBinding=e,this.templateBinding=t,this.templateBindingDependsOnData=s}createHTML(e){return Ve.comment(e(this))}createBehavior(){return new qt(this)}});const Ut=new Map,Wt={":model":e=>e},Qt=Symbol("RenderInstruction"),Jt="default-view";function Xt(e,t){const s=[],i=[],{attributes:n,directives:r,content:o,policy:a}=null!=t?t:{};if(s.push(`<${e}`),n){const e=Object.getOwnPropertyNames(n);for(let t=0,r=e.length;t<r;++t){const r=e[t];0===t?s[0]=`${s[0]} ${r}="`:s.push(`" ${r}="`),i.push(n[r])}s.push('"')}if(r){s[s.length-1]+=" ";for(let e=0,t=r.length;e<t;++e){const t=r[e];s.push(e>0?"":" "),i.push(t)}}if(s[s.length-1]+=">",o&&$(o.create))i.push(o),s.push(`</${e}>`);else{const t=s.length-1;s[t]=`${s[t]}${null!=o?o:""}</${e}>`}return wt.create(s,i,a)}function Gt(e){var t;const s=null!==(t=e.name)&&void 0!==t?t:Jt;let i;if((n=e).element||n.tagName){let t=e.tagName;if(!t){const s=Ft.getByType(e.element);if(!s)throw new Error("Invalid element for model rendering.");t=s.name}e.attributes||(e.attributes=Wt),i=Xt(t,e)}else i=e.template;var n;return{brand:Qt,type:e.type,name:s,template:i}}function Kt(e){return e&&e.brand===Qt}function Yt(e,t){const s=Ut.get(e);if(void 0!==s)return s[null!=t?t:Jt]}St`
2
2
  &nbsp;
3
- `,Object.freeze({instanceOf:Kt,create:Gt,createElementTemplate:Xt,register:function(e){let t=Ut.get(e.type);void 0===t&&Ut.set(e.type,t=Object.create(null));const s=Kt(e)?e:Gt(e);return t[s.name]=s},getByType:Yt,getForInstance:function(e,t){if(e)return Yt(e.constructor,t)}});class Zt 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:X.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:Pe(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Pe(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:H.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 es={bubbles:!0,composed:!0,cancelable:!0},ts="isConnected",ss=new WeakMap;function is(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ss.get(e))&&void 0!==s?s:null}let ns;class rs extends q{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.$hiController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=W.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return W.track(this,ts),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:X.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 shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&ss.set(this.source,t))}}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=is(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=is(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,W.notify(this,ts))}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,W.notify(this,ts),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},es),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=is(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=U.coupled)}static forCustomElement(e,t=!1){const s=e.$hiController;if(void 0!==s&&!t)return s;const i=Ft.getForInstance(e);if(void 0===i)throw _.error(1401);return W.getNotifier(i).subscribe({handleChange:()=>{rs.forCustomElement(e,!0),e.$hiController.connect()}},"template"),W.getNotifier(i).subscribe({handleChange:()=>{rs.forCustomElement(e,!0),e.$hiController.connect()}},"shadowOptions"),e.$hiController=new ns(e,i)}static setStrategy(e){ns=e}}function os(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=is(e))&&void 0!==t?t:e.getRootNode()}j(rs),rs.setStrategy(rs);class as{constructor(e){const t=as.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){hs(os(e),this.sheets)}removeStylesFrom(e){us(os(e),this.sheets)}}as.styleSheetCache=new Map;let ls=0;function ds(e){return e===document?document.body:e}class cs{constructor(e){this.styles=e,this.styleClass="hi-"+ ++ls}addStylesTo(e){e=ds(os(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=ds(os(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let hs=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},us=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ge.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),hs=(e,t)=>{e.adoptedStyleSheets.push(...t)},us=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ge.setDefaultStrategy(as)}else ge.setDefaultStrategy(cs);const ps="defer-hydration",fs="needs-hydration";class gs extends rs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,this.hasExistingShadowRoot&&this.definition.templateOptions===Dt&&(this.source.toggleAttribute(ps,!0),this.source.toggleAttribute(fs,!0))}addHydratingInstance(){if(!gs.hydratingInstances)return;const e=this.definition.name;let t=gs.hydratingInstances.get(e);t||(t=new Set,gs.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return gs.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(ps)||(gs.hydrationObserver.unobserve(t.target),t.target.$hiController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?gs.idleCallbackId=requestIdleCallback(gs.checkHydrationComplete,{timeout:50}):0===(null===(t=gs.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=gs.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),rs.setStrategy(rs))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(fs),this.needsHydration&&(null===(s=null===(t=gs.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name)),this.source.hasAttribute(ps))return this.addHydratingInstance(),void gs.hydrationObserver.observe(this.source,{attributeFilter:[ps]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(_e(this.template)){const e=this.source,t=null!==(i=is(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Be.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Be.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(fs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),W.notify(this,ts)}}removeHydratingInstance(){var e,t;if(!gs.hydratingInstances)return;const s=this.definition.name,i=gs.hydratingInstances.get(s);null===(t=null===(e=gs.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||gs.hydratingInstances.delete(s),gs.idleCallbackId&&cancelIdleCallback(gs.idleCallbackId),gs.idleCallbackId=requestIdleCallback(gs.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),gs.hydrationObserver.unobserve(this.source)}static install(){rs.setStrategy(gs)}}function bs(e){const t=class extends e{constructor(){super(),rs.forCustomElement(this)}$emit(e,t,s){return this.$hiController.emit(e,t,s)}connectedCallback(){this.$hiController.connect()}disconnectedCallback(){this.$hiController.disconnect()}attributeChangedCallback(e,t,s){this.$hiController.onAttributeChangedCallback(e,t,s)}};return Ft.registerBaseType(t),t}function vs(e,t){return $(e)?Ft.compose(e,t).define().type:Ft.compose(this,e).define().type}gs.hydrationObserver=new Zt(gs.hydrationObserverHandler),gs.idleCallbackId=null,gs.hydratingInstances=new Map;const ms=Object.assign(bs(HTMLElement),{from:function(e){return bs(e)},define:vs,compose:function(e,t){return $(e)?Ft.compose(e,t):Ft.compose(this,e)},defineAsync:function(e,t){return $(e)?new Promise((s=>{Ft.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{Ft.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});var ys={exports:{}};!function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(ys);var xs=t(ys.exports),ws={exports:{}},Ss={exports:{}},Cs={exports:{}};!function(e){function t(s){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Cs);var Os={exports:{}};!function(e){var t=Cs.exports.default;e.exports=function(e,s){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,s||"default");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Os),function(e){var t=Cs.exports.default,s=Os.exports;e.exports=function(e){var i=s(e,"string");return"symbol"===t(i)?i:String(i)},e.exports.__esModule=!0,e.exports.default=e.exports}(Ss),function(e){var t=Ss.exports;function s(e,s){for(var i=0;i<s.length;i++){var n=s[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t(n.key),n)}}e.exports=function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(ws);var Ts=t(ws.exports),Bs=function(){function e(){xs(this,e),this.timeOut=0}return Ts(e,[{key:"init",value:function(e){var t,s,i=this;t=setInterval((function(){s="string"==typeof e.front?window[e.front]:e.front(),i.timeOut++,(i.timeOut>=60||s)&&(clearInterval(t),e.callback())}),50)}}]),e}();var $s={exports:{}},Ns={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i},e.exports.__esModule=!0,e.exports.default=e.exports}(Ns),function(e){var t=Ns.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}($s);var ks={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(ks);var Es={exports:{}};!function(e){var t=Ns.exports;e.exports=function(e,s){if(e){if("string"==typeof e)return t(e,s);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,s):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Es);var _s={exports:{}};function As(e){if("string"==typeof e)return String(e).replace(/(^\s*)|(\s*$)/g,"").replace(/\u200B/g,"");if("[object Array]"===Object.prototype.toString.call(e))return e.forEach((function(e){e=As(e)})),e;if("[object Object]"!==Object.prototype.toString.call(e)||null==e)return e;for(var t in e)e[t]=As(e[t]);return e}!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(_s),function(e){var t=$s.exports,s=ks.exports,i=Es.exports,n=_s.exports;e.exports=function(e){return t(e)||s(e)||i(e)||n()},e.exports.__esModule=!0,e.exports.default=e.exports}({exports:{}});var Ms,Is=function(e){return"[object Object]"==function(e){return Object.prototype.toString.call(e)}(e)};function js(e){return function(t,s){if(Is(t))for(var i in t)Rs(e)(i,t[i]);if("string"==typeof t){if(/:/g.test(t))t.split(";").forEach((function(t){var s=(t=As(t)).split(":");Rs(e)(s[0],s[1])}));else Rs(e)(t,s)}}}function Rs(e){return function(t,s){if(e){if(void 0===s)return window.getComputedStyle(e,null).getPropertyValue(t);e.style[t]=s}}}function Ps(e,t,s){return t=b(t),u(e,Vs()?Reflect.construct(t,s||[],b(e).constructor):t.apply(e,s))}function Vs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vs=function(){return!!e})()}var Ls,zs=St(Ms||(Ms=S(["\n<template ",">\n</template>\n"])),new Ct("ParserWrap")),Hs=function(e){function t(){var e;return n(this,t),(e=Ps(this,t)).aliasObj={},e.isHiElement=!1,e.delay=10,e.hiElementPath=atob("aHR0cHM6Ly96anJzLmhhaWVyLm5ldA==")+"/download/cdn/hi-element.js",e.renderType="sync",e}return x(t,ms),d(t,[{key:"loadChanged",value:function(e,t){var s=this;t&&(clearInterval(this.intervalId),this.intervalId=setInterval((function(){window["hi-element"]&&(s.init([t]),clearInterval(s.intervalId))}),this.delay))}},{key:"connectedCallback",value:function(){var e,s;v(b(t.prototype),"connectedCallback",this).call(this),window["hi-element"]||(e=this.hiElementPath,s="hi-element",new Promise((function(t,i){if(void 0!==e){var n=new Bs,r=e.substring(e.lastIndexOf(".")+1),o=document.getElementsByTagName("head")[0];if(document.querySelectorAll('script[src*="'+e+'"]').length<=0){if("js"===r){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!0,o.appendChild(a),a.onload=a.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||t(!0)}}else if("css"===r){var l=document.createElement("link");l.href=e,l.rel="stylesheet",l.type="text/css",o.appendChild(l)}}else n.init({front:String(s),callback:function(){t(!0)}})}else i(!1)})))}},{key:"setAttributeStyle",value:function(e,t){for(var s in console.info("设置组件属性"),t.attributeConfig){var i=t.attributeConfig[s];e.setAttribute(s,i)}console.info("设置组件样式"),js(e)(Object.assign({},t.styleConfig))}},{key:"loadScript",value:function(e,t){var s=document.createElement("script");s.type="text/javascript",s.id=e,s.src=t,this.ParserWrap.appendChild(s)}},{key:"loadIframeScript",value:function(e,t,s){var i,n=this,r=this.ParserWrap.querySelector("#"+e);r&&r.remove();var o=document.createElement("iframe");o.style.border="none",o.style.width="100%",o.id=e,console.info("创建iframe元素"),this.ParserWrap.appendChild(o);var a=document.createElement("script");a.src=this.hiElementPath;var l=null===(i=null==o?void 0:o.contentWindow)||void 0===i?void 0:i.document;l&&(a.onload=function(){var e,i,r,a,d=document.createElement("script");d.src=t,null===(e=null==l?void 0:l.head)||void 0===e||e.appendChild(d);var c=null==l?void 0:l.createElement(s.tagName);null===(i=null==l?void 0:l.body)||void 0===i||i.appendChild(c),console.info("定义标签,并插入到iframe容器"),n.setAttributeStyle(c,s);var h=null!==(a=null===(r=null==l?void 0:l.body)||void 0===r?void 0:r.scrollHeight)&&void 0!==a?a:0;setInterval((function(){var e,t,s=null===(e=null==l?void 0:l.body)||void 0===e?void 0:e.scrollHeight;null!=s&&s!==h&&(o.height=(null===(t=null==l?void 0:l.body)||void 0===t?void 0:t.scrollHeight)+"px",h=s)}),50)},console.info("iframe容器开始加载组件"),l.head.appendChild(a))}},{key:"init",value:function(e){var t=this;if(e)for(var s,i=function(){var s=e[n];if(console.group("[组件<"+s.tagName+">]: ("+s.uniqueId+")"),!s.uniqueId)return{v:console.info("组件渲染引擎----组件未定义唯一id")};if(!s.componentPath)return{v:console.info("组件渲染引擎----没有定义组件路径")};if(console.info("tagName:",s.tagName),console.info("uniqueId:",s.uniqueId),console.info("type:",s.componentType),console.info("version:",s.componentVersion),console.info("path:",s.componentPath),"iframe"===t.renderType)return console.info("组件渲染引擎以iframe形式加载组件"),{v:t.loadIframeScript(s.uniqueId,s.componentPath,s)};customElements.get(s.tagName)||(console.info("组件渲染引擎开始加载组件"),t.loadScript(s.uniqueId,s.componentPath));var i=document.createElement(s.tagName);t.ParserWrap.appendChild(i),console.info("定义标签,并插入到解析器容器"),t.aliasObj[s.alias||s.uniqueId]=i,t.setAttributeStyle(i,s),i.addEventListener("change",(function(e){this.$emit("change",{alias:s.alias,uniqueId:s.uniqueId,type:s.componentType,tagName:s.tagName,value:e.detail})})),console.info("监听change事件"),console.groupEnd()},n=0;n<e.length;n++)if(s=i())return s.v}},{key:"update",value:function(e){if(e)for(var t=0;t<e.length;t++){var s=e[t];if(console.group("[组件<"+s.tagName+">]: ("+s.uniqueId+")"),!s.alias)return void console.info("组件渲染引擎----组件未定义别名,无法更新",s.tagName);this.aliasObj[s.alias]?this.aliasObj[s.alias].update?(console.info("开始更新组件数据"),this.aliasObj[s.alias].update(s.updateData)):console.info("组件渲染引擎----组件未定义update方法,无法更新",s.tagName):console.info("组件渲染引擎----组件未定义",s.tagName),console.groupEnd()}}}]),t}();C([Q],Hs.prototype,"ParserWrap",void 0),C([Q],Hs.prototype,"aliasObj",void 0),C([Rt],Hs.prototype,"renderType",void 0),C([Rt],Hs.prototype,"load",void 0),Hs=C([(Ls={name:"c-view",template:zs,shadowOptions:null},function(e){vs(e,Ls)})],Hs);export{Hs as ComponentVParser};
3
+ `,Object.freeze({instanceOf:Kt,create:Gt,createElementTemplate:Xt,register:function(e){let t=Ut.get(e.type);void 0===t&&Ut.set(e.type,t=Object.create(null));const s=Kt(e)?e:Gt(e);return t[s.name]=s},getByType:Yt,getForInstance:function(e,t){if(e)return Yt(e.constructor,t)}});class Zt 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:X.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:Pe(),o.targetNodeId=null!==(i=o.targetNodeId)&&void 0!==i?i:Pe(),o.targetTagName=null!==(n=t.tagName)&&void 0!==n?n:null,o.policy=null!==(r=o.policy)&&void 0!==r?r:H.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 es={bubbles:!0,composed:!0,cancelable:!0},ts="isConnected",ss=new WeakMap;function is(e){var t,s;return null!==(s=null!==(t=e.shadowRoot)&&void 0!==t?t:ss.get(e))&&void 0!==s?s:null}let ns;class rs extends q{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.$hiController=this,this.view=null,this.source=e,this.definition=t,this.shadowOptions=t.shadowOptions;const s=W.getAccessors(e);if(s.length>0){const t=this.boundObservables=Object.create(null);for(let i=0,n=s.length;i<n;++i){const n=s[i].name,r=e[n];void 0!==r&&(delete e[n],t[n]=r)}}}get isConnected(){return W.track(this,ts),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:X.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 shadowOptions(){return this._shadowRootOptions}set shadowOptions(e){if(void 0===this._shadowRootOptions&&void 0!==e){this._shadowRootOptions=e;let t=this.source.shadowRoot;t?this.hasExistingShadowRoot=!0:(t=this.source.attachShadow(e),"closed"===e.mode&&ss.set(this.source,t))}}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=is(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=is(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,W.notify(this,ts))}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,W.notify(this,ts),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},es),s)))}renderTemplate(e){var t;const s=this.source,i=null!==(t=is(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=U.coupled)}static forCustomElement(e,t=!1){const s=e.$hiController;if(void 0!==s&&!t)return s;const i=Ft.getForInstance(e);if(void 0===i)throw _.error(1401);return W.getNotifier(i).subscribe({handleChange:()=>{rs.forCustomElement(e,!0),e.$hiController.connect()}},"template"),W.getNotifier(i).subscribe({handleChange:()=>{rs.forCustomElement(e,!0),e.$hiController.connect()}},"shadowOptions"),e.$hiController=new ns(e,i)}static setStrategy(e){ns=e}}function os(e){var t;return"adoptedStyleSheets"in e?e:null!==(t=is(e))&&void 0!==t?t:e.getRootNode()}j(rs),rs.setStrategy(rs);class as{constructor(e){const t=as.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){hs(os(e),this.sheets)}removeStylesFrom(e){us(os(e),this.sheets)}}as.styleSheetCache=new Map;let ls=0;function cs(e){return e===document?document.body:e}class ds{constructor(e){this.styles=e,this.styleClass="hi-"+ ++ls}addStylesTo(e){e=cs(os(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=cs(os(e))).querySelectorAll(`.${this.styleClass}`);for(let s=0,i=t.length;s<i;++s)e.removeChild(t[s])}}let hs=(e,t)=>{e.adoptedStyleSheets=[...e.adoptedStyleSheets,...t]},us=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter((e=>-1===t.indexOf(e)))};if(ge.supportsAdoptedStyleSheets){try{document.adoptedStyleSheets.push(),document.adoptedStyleSheets.splice(),hs=(e,t)=>{e.adoptedStyleSheets.push(...t)},us=(e,t)=>{for(const s of t){const t=e.adoptedStyleSheets.indexOf(s);-1!==t&&e.adoptedStyleSheets.splice(t,1)}}}catch(e){}ge.setDefaultStrategy(as)}else ge.setDefaultStrategy(ds);const ps="defer-hydration",fs="needs-hydration";class gs extends rs{get shadowOptions(){return super.shadowOptions}set shadowOptions(e){super.shadowOptions=e,this.hasExistingShadowRoot&&this.definition.templateOptions===Dt&&(this.source.toggleAttribute(ps,!0),this.source.toggleAttribute(fs,!0))}addHydratingInstance(){if(!gs.hydratingInstances)return;const e=this.definition.name;let t=gs.hydratingInstances.get(e);t||(t=new Set,gs.hydratingInstances.set(e,t)),t.add(this.source)}static config(e){return gs.lifecycleCallbacks=e,this}static hydrationObserverHandler(e){for(const t of e)t.target.hasAttribute(ps)||(gs.hydrationObserver.unobserve(t.target),t.target.$hiController.connect())}static checkHydrationComplete(e){var t,s,i;e.didTimeout?gs.idleCallbackId=requestIdleCallback(gs.checkHydrationComplete,{timeout:50}):0===(null===(t=gs.hydratingInstances)||void 0===t?void 0:t.size)&&(null===(i=null===(s=gs.lifecycleCallbacks)||void 0===s?void 0:s.hydrationComplete)||void 0===i||i.call(s),rs.setStrategy(rs))}connect(){var e,t,s,i,n;if(this.needsHydration=null!==(e=this.needsHydration)&&void 0!==e?e:this.source.hasAttribute(fs),this.needsHydration&&(null===(s=null===(t=gs.lifecycleCallbacks)||void 0===t?void 0:t.elementWillHydrate)||void 0===s||s.call(t,this.definition.name)),this.source.hasAttribute(ps))return this.addHydratingInstance(),void gs.hydrationObserver.observe(this.source,{attributeFilter:[ps]});if(!this.needsHydration)return super.connect(),void this.removeHydratingInstance();if(3===this.stage){if(this.stage=0,this.bindObservables(),this.connectBehaviors(),this.template)if(_e(this.template)){const e=this.source,t=null!==(i=is(e))&&void 0!==i?i:e;let s=t.firstChild,r=t.lastChild;null===e.shadowRoot&&(Be.isElementBoundaryStartMarker(s)&&(s.data="",s=s.nextSibling),Be.isElementBoundaryEndMarker(r)&&(r.data="",r=r.previousSibling)),this.view=this.template.hydrate(s,r,e),null===(n=this.view)||void 0===n||n.bind(this.source)}else this.renderTemplate(this.template);this.addStyles(this.mainStyles),this.stage=1,this.source.removeAttribute(fs),this.needsInitialization=this.needsHydration=!1,this.removeHydratingInstance(),W.notify(this,ts)}}removeHydratingInstance(){var e,t;if(!gs.hydratingInstances)return;const s=this.definition.name,i=gs.hydratingInstances.get(s);null===(t=null===(e=gs.lifecycleCallbacks)||void 0===e?void 0:e.elementDidHydrate)||void 0===t||t.call(e,this.definition.name),i&&(i.delete(this.source),i.size||gs.hydratingInstances.delete(s),gs.idleCallbackId&&cancelIdleCallback(gs.idleCallbackId),gs.idleCallbackId=requestIdleCallback(gs.checkHydrationComplete,{timeout:50}))}disconnect(){super.disconnect(),gs.hydrationObserver.unobserve(this.source)}static install(){rs.setStrategy(gs)}}function bs(e){const t=class extends e{constructor(){super(),rs.forCustomElement(this)}$emit(e,t,s){return this.$hiController.emit(e,t,s)}connectedCallback(){this.$hiController.connect()}disconnectedCallback(){this.$hiController.disconnect()}attributeChangedCallback(e,t,s){this.$hiController.onAttributeChangedCallback(e,t,s)}};return Ft.registerBaseType(t),t}function vs(e,t){return $(e)?Ft.compose(e,t).define().type:Ft.compose(this,e).define().type}gs.hydrationObserver=new Zt(gs.hydrationObserverHandler),gs.idleCallbackId=null,gs.hydratingInstances=new Map;const ms=Object.assign(bs(HTMLElement),{from:function(e){return bs(e)},define:vs,compose:function(e,t){return $(e)?Ft.compose(e,t):Ft.compose(this,e)},defineAsync:function(e,t){return $(e)?new Promise((s=>{Ft.composeAsync(e,t).then((e=>{s(e)}))})).then((e=>e.define().type)):new Promise((t=>{Ft.composeAsync(this,e).then((e=>{t(e)}))})).then((e=>e.define().type))}});var ys={exports:{}};!function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(ys);var xs=t(ys.exports),ws={exports:{}},Ss={exports:{}},Cs={exports:{}};!function(e){function t(s){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(s)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Cs);var Os={exports:{}};!function(e){var t=Cs.exports.default;e.exports=function(e,s){if("object"!==t(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,s||"default");if("object"!==t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===s?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(Os),function(e){var t=Cs.exports.default,s=Os.exports;e.exports=function(e){var i=s(e,"string");return"symbol"===t(i)?i:String(i)},e.exports.__esModule=!0,e.exports.default=e.exports}(Ss),function(e){var t=Ss.exports;function s(e,s){for(var i=0;i<s.length;i++){var n=s[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t(n.key),n)}}e.exports=function(e,t,i){return t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(ws);var Ts=t(ws.exports),Bs=function(){function e(){xs(this,e),this.timeOut=0}return Ts(e,[{key:"init",value:function(e){var t,s,i=this;t=setInterval((function(){s="string"==typeof e.front?window[e.front]:e.front(),i.timeOut++,(i.timeOut>=60||s)&&(clearInterval(t),e.callback())}),50)}}]),e}();var $s={exports:{}},Ns={exports:{}};!function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,i=new Array(t);s<t;s++)i[s]=e[s];return i},e.exports.__esModule=!0,e.exports.default=e.exports}(Ns),function(e){var t=Ns.exports;e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}($s);var ks={exports:{}};!function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(ks);var Es={exports:{}};!function(e){var t=Ns.exports;e.exports=function(e,s){if(e){if("string"==typeof e)return t(e,s);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?t(e,s):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(Es);var _s={exports:{}};function As(e){if("string"==typeof e)return String(e).replace(/(^\s*)|(\s*$)/g,"").replace(/\u200B/g,"");if("[object Array]"===Object.prototype.toString.call(e))return e.forEach((function(e){e=As(e)})),e;if("[object Object]"!==Object.prototype.toString.call(e)||null==e)return e;for(var t in e)e[t]=As(e[t]);return e}!function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(_s),function(e){var t=$s.exports,s=ks.exports,i=Es.exports,n=_s.exports;e.exports=function(e){return t(e)||s(e)||i(e)||n()},e.exports.__esModule=!0,e.exports.default=e.exports}({exports:{}});var Ms,Is=function(e){return"[object Object]"==function(e){return Object.prototype.toString.call(e)}(e)};function js(e){return function(t,s){if(Is(t))for(var i in t)Rs(e)(i,t[i]);if("string"==typeof t){if(/:/g.test(t))t.split(";").forEach((function(t){var s=(t=As(t)).split(":");Rs(e)(s[0],s[1])}));else Rs(e)(t,s)}}}function Rs(e){return function(t,s){if(e){if(void 0===s)return window.getComputedStyle(e,null).getPropertyValue(t);e.style[t]=s}}}function Ps(e,t,s){return t=b(t),u(e,Vs()?Reflect.construct(t,s||[],b(e).constructor):t.apply(e,s))}function Vs(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vs=function(){return!!e})()}var Ls,zs=St(Ms||(Ms=S(["\n<template ",">\n</template>\n"])),new Ct("ParserWrap")),Hs=function(e){function t(){var e;return n(this,t),(e=Ps(this,t)).aliasObj={},e.isHiElement=!1,e.delay=40,e.checkCount=50,e.hiElementPath=atob("aHR0cHM6Ly96anJzLmhhaWVyLm5ldA==")+"/download/cdn/hi-element.js",e.renderType="sync",e}return x(t,ms),c(t,[{key:"loadChanged",value:function(e,t){var s=this;t&&(clearInterval(this.intervalId),this.intervalId=setInterval((function(){(window["hi-element"]||0==s.checkCount)&&(s.init([t]),clearInterval(s.intervalId)),s.checkCount--}),this.delay))}},{key:"connectedCallback",value:function(){var e,s;v(b(t.prototype),"connectedCallback",this).call(this),window["hi-element"]||(e=this.hiElementPath,s="hi-element",new Promise((function(t,i){if(void 0!==e){var n=new Bs,r=e.substring(e.lastIndexOf(".")+1),o=document.getElementsByTagName("head")[0];if(document.querySelectorAll('script[src*="'+e+'"]').length<=0){if("js"===r){var a=document.createElement("script");a.src=e,a.type="text/javascript",a.async=!0,o.appendChild(a),a.onload=a.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||t(!0)}}else if("css"===r){var l=document.createElement("link");l.href=e,l.rel="stylesheet",l.type="text/css",o.appendChild(l)}}else n.init({front:String(s),callback:function(){t(!0)}})}else i(!1)})))}},{key:"setAttributeStyle",value:function(e,t){for(var s in console.info("设置组件属性"),t.attributeConfig){var i=t.attributeConfig[s];e.setAttribute(s,i)}console.info("设置组件样式"),js(e)(Object.assign({},t.styleConfig))}},{key:"loadScript",value:function(e,t){var s=document.createElement("script");s.type="text/javascript",s.id=e,s.src=t,this.ParserWrap.appendChild(s)}},{key:"loadIframeScript",value:function(e,t,s){var i,n=this,r=this.ParserWrap.querySelector("#"+e);r&&r.remove();var o=document.createElement("iframe");o.style.border="none",o.style.width="100%",o.id=e,console.info("创建iframe元素"),this.ParserWrap.appendChild(o);var a=document.createElement("script");a.src=this.hiElementPath;var l=null===(i=null==o?void 0:o.contentWindow)||void 0===i?void 0:i.document;l&&(a.onload=function(){var e,i,r,a,c=document.createElement("script");c.src=t,null===(e=null==l?void 0:l.head)||void 0===e||e.appendChild(c);var d=null==l?void 0:l.createElement(s.tagName);null===(i=null==l?void 0:l.body)||void 0===i||i.appendChild(d),console.info("定义标签,并插入到iframe容器"),n.setAttributeStyle(d,s);var h=null!==(a=null===(r=null==l?void 0:l.body)||void 0===r?void 0:r.scrollHeight)&&void 0!==a?a:0;setInterval((function(){var e,t,s=null===(e=null==l?void 0:l.body)||void 0===e?void 0:e.scrollHeight;null!=s&&s!==h&&(o.height=(null===(t=null==l?void 0:l.body)||void 0===t?void 0:t.scrollHeight)+"px",h=s)}),50)},console.info("iframe容器开始加载组件"),l.head.appendChild(a))}},{key:"init",value:function(e){var t=this;if(e)for(var s,i=function(){var s=e[n];if(console.group("[组件<"+s.tagName+">]: ("+s.uniqueId+")"),!s.uniqueId)return{v:console.info("组件渲染引擎----组件未定义唯一id")};if(!s.componentPath)return{v:console.info("组件渲染引擎----没有定义组件路径")};if(console.info("tagName:",s.tagName),console.info("uniqueId:",s.uniqueId),console.info("type:",s.componentType),console.info("version:",s.componentVersion),console.info("path:",s.componentPath),"iframe"===t.renderType)return console.info("组件渲染引擎以iframe形式加载组件"),{v:t.loadIframeScript(s.uniqueId,s.componentPath,s)};customElements.get(s.tagName)||(console.info("组件渲染引擎开始加载组件"),t.loadScript(s.uniqueId,s.componentPath));var i=document.createElement(s.tagName);t.ParserWrap.appendChild(i),console.info("定义标签,并插入到解析器容器"),t.aliasObj[s.alias||s.uniqueId]=i,t.setAttributeStyle(i,s),i.addEventListener("change",(function(e){this.$emit("change",{alias:s.alias,uniqueId:s.uniqueId,type:s.componentType,tagName:s.tagName,value:e.detail})})),console.info("监听change事件"),console.groupEnd()},n=0;n<e.length;n++)if(s=i())return s.v}},{key:"update",value:function(e){if(e)for(var t=0;t<e.length;t++){var s=e[t];if(console.group("[组件<"+s.tagName+">]: ("+s.uniqueId+")"),!s.alias)return void console.info("组件渲染引擎----组件未定义别名,无法更新",s.tagName);this.aliasObj[s.alias]?this.aliasObj[s.alias].update?(console.info("开始更新组件数据"),this.aliasObj[s.alias].update(s.updateData)):console.info("组件渲染引擎----组件未定义update方法,无法更新",s.tagName):console.info("组件渲染引擎----组件未定义",s.tagName),console.groupEnd()}}}]),t}();C([Q],Hs.prototype,"ParserWrap",void 0),C([Q],Hs.prototype,"aliasObj",void 0),C([Rt],Hs.prototype,"renderType",void 0),C([Rt],Hs.prototype,"load",void 0),Hs=C([(Ls={name:"c-view",template:zs,shadowOptions:null},function(e){vs(e,Ls)})],Hs);export{Hs as ComponentVParser};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkits/parser",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "> TODO: description",
5
5
  "author": "liulina0228",
6
6
  "homepage": "",