import{m as t,q as e,w as s,u as n,v as i,x as r,y as o,z as a,P as _,B as l,H as h,J as d,M as c,N as p}from"./vaadin-grid-7a951967.js";
/**
 * @fileoverview
 * @suppress {checkPrototypalTypes}
 * @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
 * Google as part of the polymer project is also subject to an additional IP
 * rights grant found at http://polymer.github.io/PATENTS.txt
 */const u=t=>{for(;t;){const e=Object.getOwnPropertyDescriptor(t,"observedAttributes");if(e)return e.get;t=Object.getPrototypeOf(t.prototype).constructor}return()=>[]},m=t((t=>{const n=e(t);let i=u(n);return class extends n{constructor(){super(),this.__isUpgradeDisabled}static get observedAttributes(){return i.call(this).concat("disable-upgrade")}_initializeProperties(){this.hasAttribute("disable-upgrade")?this.__isUpgradeDisabled=!0:super._initializeProperties()}_enableProperties(){this.__isUpgradeDisabled||super._enableProperties()}_canApplyPropertyDefault(t){return super._canApplyPropertyDefault(t)&&!(this.__isUpgradeDisabled&&this._isPropertyPending(t))}attributeChangedCallback(t,e,n,i){"disable-upgrade"==t?this.__isUpgradeDisabled&&null==n&&(super._initializeProperties(),this.__isUpgradeDisabled=!1,s(this).isConnected&&super.connectedCallback()):super.attributeChangedCallback(t,e,n,i)}connectedCallback(){this.__isUpgradeDisabled||super.connectedCallback()}disconnectedCallback(){this.__isUpgradeDisabled||super.disconnectedCallback()}}}));
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
function f(t,e,s,n,i){let r;i&&(r="object"==typeof s&&null!==s,r&&(n=t.__dataTemp[e]));let o=n!==s&&(n==n||s==s);return r&&o&&(t.__dataTemp[e]=s),o}const y=t((t=>class extends t{_shouldPropertyChange(t,e,s){return f(this,t,e,s,!0)}})),b=t((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,s){return f(this,t,e,s,this.mutableData)}}));y._mutablePropertyChange=f;
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
let g=null;function C(){return g}C.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:C,writable:!0}});const P=n(C),T=y(P);const w=n(class{});function I(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(Boolean(t)!=Boolean(i.__hideTemplateChildren__))if(i.nodeType===Node.TEXT_NODE)t?(i.__polymerTextContent__=i.textContent,i.textContent=""):i.textContent=i.__polymerTextContent__;else if("slot"===i.localName)if(t)i.__polymerReplaced__=document.createComment("hidden-slot"),s(s(i).parentNode).replaceChild(i.__polymerReplaced__,i);else{const t=i.__polymerReplaced__;t&&s(s(t).parentNode).replaceChild(i,t)}else i.style&&(t?(i.__polymerDisplay__=i.style.display,i.style.display="none"):i.style.display=i.__polymerDisplay__);i.__hideTemplateChildren__=t,i._showHideChildren&&i._showHideChildren(t)}}class x extends w{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let s=this.__templatizeOptions;(t&&s.instanceProps||!s.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,s){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,s(t)}));else{let n=this.__dataHost.__dataHost;n&&n._addEventListenerToNode(t,e,s)}}_showHideChildren(t){I(t,this.children)}_setUnmanagedPropertyToNode(t,e,s){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=s:super._setUnmanagedPropertyToNode(t,e,s)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}x.prototype.__dataHost,x.prototype.__templatizeOptions,x.prototype._methodHost,x.prototype.__templatizeOwner,x.prototype.__hostProps;const O=y(x);function H(t){let e=t.__dataHost;return e&&e._methodHost||e}function v(t,e,s){let n=s.mutableData?O:x;F.mixin&&(n=F.mixin(n));let i=class extends n{};return i.prototype.__templatizeOptions=s,i.prototype._bindTemplate(t),function(t,e,s,n){let i=s.hostProps||{};for(let e in n.instanceProps){delete i[e];let s=n.notifyInstanceProp;s&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:k(e,s)})}if(n.forwardHostProp&&e.__dataHost)for(let e in i)s.hasHostProps||(s.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,s){t.__dataHost._setPendingPropertyOrPath("_host_"+e,s[e],!0,!0)}})}(i,t,e,s),i}function A(t,e,s,n){let i=s.forwardHostProp;if(i&&e.hasHostProps){const _="template"==t.localName;let l=e.templatizeTemplateClass;if(!l){if(_){let t=s.mutableData?T:P;class n extends t{}l=e.templatizeTemplateClass=n}else{const s=t.constructor;class n extends s{}l=e.templatizeTemplateClass=n}let o=e.hostProps;for(let t in o)l.prototype._addPropertyEffect("_host_"+t,l.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:E(t,i)}),l.prototype._createNotifyingProperty("_host_"+t);r&&n&&function(t,e,s){const n=s.constructor._properties,{propertyEffects:i}=t,{instanceProps:r}=e;for(let t in i)if(!(n[t]||r&&r[t])){const e=i[t];for(let s=0;s<e.length;s++){const{part:n}=e[s].info;if(!n.signature||!n.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,s,n)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),_)a=l,g=o=t,Object.setPrototypeOf(o,a.prototype),new a,g=null,t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,l.prototype);const s=e.hostProps;for(let e in s)if(e="_host_"+e,e in t){const s=t[e];delete t[e],t.__data[e]=s}}}var o,a}function E(t,e){return function(t,s,n){e.call(t.__templatizeOwner,s.substring("_host_".length),n[s])}}function k(t,e){return function(t,s,n){e.call(t.__templatizeOwner,t,s,n[s])}}function F(t,e,s){if(i&&!H(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(s=s||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let n=(e?e.constructor:x)._parseTemplate(t),r=n.templatizeInstanceClass;r||(r=v(t,n,s),n.templatizeInstanceClass=r);const o=H(t);A(t,n,s,o);let a=class extends r{};return a.prototype._methodHost=o,a.prototype.__dataHost=t,a.prototype.__templatizeOwner=e,a.prototype.__hostProps=n.hostProps,a=a,a}
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
class D{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,S.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),S.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,s){return t instanceof D?t._cancelAsync():t=new D,t.setConfig(e,s),t}}let S=new Set;const z=function(t){S.add(t)},M=function(){const t=Boolean(S.size);return S.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t},N=function(){let t,e;do{t=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),e=M()}while(t||e)};
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
let R=!1;function U(){if(o&&!a){if(!R){R=!0;const t=document.createElement("style");t.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(t)}return!0}return!1}
/**
@license
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/const B=b(_);class j extends B{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!l,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null,this._templateInfo}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let t=0;t<this.__instances.length;t++)this.__detachInstance(t)}connectedCallback(){if(super.connectedCallback(),U()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let t=s(s(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,t)}}__ensureTemplatized(){if(!this.__ctor){const t=this;let e=this.template=t._templateInfo?t:this.querySelector("template");if(!e){let t=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");t.disconnect(),this.__render()}));return t.observe(this,{childList:!0}),!1}let s={};s[this.as]=!0,s[this.indexAs]=!0,s[this.itemsIndexAs]=!0,this.__ctor=F(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:s,forwardHostProp:function(t,e){let s=this.__instances;for(let n,i=0;i<s.length&&(n=s[i]);i++)n.forwardHostProp(t,e)},notifyInstanceProp:function(t,e,s){if(h(this.as,e)){let n=t[this.itemsIndexAs];e==this.as&&(this.items[n]=s);let i=d(this.as,`${JSCompiler_renameProperty("items",this)}.${n}`,e);this.notifyPath(i,s)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(t){if("string"==typeof t){let e=t,s=this.__getMethodHost();return function(){return s[e].apply(s,arguments)}}return t}__sortChanged(t){this.__sortFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__filterChanged(t){this.__filterFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(t){return Math.ceil(1e3/t)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(t){if(this.__sortFn||this.__filterFn)if(t){if(this.__observePaths){let e=this.__observePaths;for(let s=0;s<e.length;s++)0===t.indexOf(e[s])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(t){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(t.path,t.value)||("items"===t.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(t,e=0){this.__renderDebouncer=D.debounce(this.__renderDebouncer,e>0?c.after(e):p,t.bind(this)),z(this.__renderDebouncer)}render(){this.__debounceRender(this.__render),N()}__render(){if(!this.__ensureTemplatized())return;let t=this.items||[];const e=this.__sortAndFilterItems(t),s=this.__calculateLimit(e.length);this.__updateInstances(t,s,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>this.__continueChunking()))),this._setRenderedItemCount(this.__instances.length),l&&!this.notifyDomChange||this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(t){let e=new Array(t.length);for(let s=0;s<t.length;s++)e[s]=s;return this.__filterFn&&(e=e.filter(((e,s,n)=>this.__filterFn(t[e],s,n)))),this.__sortFn&&e.sort(((e,s)=>this.__sortFn(t[e],t[s]))),e}__calculateLimit(t){let e=t;const s=this.__instances.length;if(this.initialCount){let n;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(t,this.initialCount),n=Math.max(e-s,0),this.__chunkCount=n||1):(n=Math.min(Math.max(t-s,0),this.__chunkCount),e=Math.min(s+n,t)),this.__shouldMeasureChunk=n===this.__chunkCount,this.__shouldContinueChunking=e<t,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const t=performance.now()-this.__renderStartTime,e=this._targetFrameTime/t;this.__chunkCount=Math.round(this.__chunkCount*e)||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(t,e,s){const n=this.__itemsIdxToInstIdx={};let i;for(i=0;i<e;i++){let e=this.__instances[i],r=s[i],o=t[r];n[r]=i,e?(e._setPendingProperty(this.as,o),e._setPendingProperty(this.indexAs,i),e._setPendingProperty(this.itemsIndexAs,r),e._flushProperties()):this.__insertInstance(o,i,r)}for(let t=this.__instances.length-1;t>=i;t--)this.__detachAndRemoveInstance(t)}__detachInstance(t){let e=this.__instances[t];const n=s(e.root);for(let t=0;t<e.children.length;t++){let s=e.children[t];n.appendChild(s)}return e}__attachInstance(t,e){let s=this.__instances[t];e.insertBefore(s.root,this)}__detachAndRemoveInstance(t){this.__detachInstance(t),this.__instances.splice(t,1)}__stampInstance(t,e,s){let n={};return n[this.as]=t,n[this.indexAs]=e,n[this.itemsIndexAs]=s,new this.__ctor(n)}__insertInstance(t,e,n){const i=this.__stampInstance(t,e,n);let r=this.__instances[e+1],o=r?r.children[0]:this;return s(s(this).parentNode).insertBefore(i.root,o),this.__instances[e]=i,i}_showHideChildren(t){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(t)}__handleItemPath(t,e){let s=t.slice(6),n=s.indexOf("."),i=n<0?s:s.substring(0,n);if(i==parseInt(i,10)){let t=n<0?"":s.substring(n+1);this.__handleObservedPaths(t);let r=this.__itemsIdxToInstIdx[i],o=this.__instances[r];if(o){let s=this.as+(t?"."+t:"");o._setPendingPropertyOrPath(s,e,!1,!0),o._flushProperties()}return!0}}itemForElement(t){let e=this.modelForElement(t);return e&&e[this.as]}indexForElement(t){let e=this.modelForElement(t);return e&&e[this.indexAs]}modelForElement(t){return function(t,e){let n;for(;e;)if(n=e.__dataHost?e:e.__templatizeInstance){if(n.__dataHost==t)return n;e=n.__dataHost}else e=s(e).parentNode;return null}(this.template,t)}}customElements.define(j.is,j);export{m as D,b as O,D as a,N as b,z as e,u as f,U as h,I as s,F as t};
