UNPKG

protvista-datatable

Version:

[![Published on NPM](https://img.shields.io/npm/v/protvista-datatable.svg)](https://www.npmjs.com/package/protvista-datatable)

165 lines (162 loc) 62.8 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("ProtvistaUtils")):"function"==typeof define&&define.amd?define(["ProtvistaUtils"],e):"object"==typeof exports?exports.ProtvistaDatatable=e(require("ProtvistaUtils")):t.ProtvistaDatatable=e(t.ProtvistaUtils)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=14)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function r(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}},function(t,e){function r(e){return t.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(e)}t.exports=r},function(t,e){function r(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=r=function(t){return typeof t}:t.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(e)}t.exports=r},function(t,e,r){var n=r(10);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&n(t,e)}},function(t,e,r){var n=r(17);function i(e,r,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=i=Reflect.get:t.exports=i=function(t,e,r){var i=n(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(r):o.value}},i(e,r,o||e)}t.exports=i},function(t,e,r){var n=r(3),i=r(18);t.exports=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?i(t):e}},function(t,e,r){t.exports=r(23)},function(t,e,r){var n=r(19),i=r(20),o=r(21),a=r(22);t.exports=function(t){return n(t)||i(t)||o(t)||a()}},function(t,e){function r(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)}))}}},function(t,e){function r(e,n){return t.exports=r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},r(e,n)}t.exports=r},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}},function(t,e,r){"use strict";r.r(e),r.d(e,"defaultConverter",(function(){return Et})),r.d(e,"notEqual",(function(){return Pt})),r.d(e,"UpdatingElement",(function(){return Tt})),r.d(e,"ReactiveElement",(function(){return Tt})),r.d(e,"customElement",(function(){return Nt})),r.d(e,"property",(function(){return Ct})),r.d(e,"internalProperty",(function(){return Ot})),r.d(e,"state",(function(){return Rt})),r.d(e,"query",(function(){return Lt})),r.d(e,"queryAsync",(function(){return jt})),r.d(e,"queryAll",(function(){return Vt})),r.d(e,"eventOptions",(function(){return It})),r.d(e,"queryAssignedNodes",(function(){return Dt})),r.d(e,"html",(function(){return ut})),r.d(e,"svg",(function(){return lt})),r.d(e,"TemplateResult",(function(){return H})),r.d(e,"SVGTemplateResult",(function(){return $})),r.d(e,"supportsAdoptingStyleSheets",(function(){return Ht})),r.d(e,"CSSResult",(function(){return Bt})),r.d(e,"unsafeCSS",(function(){return zt})),r.d(e,"css",(function(){return Gt})),r.d(e,"LitElement",(function(){return Yt}));var n=r(0),i=r.n(n),o=r(1),a=r.n(o),s=r(5),u=r.n(s),l=r(4),c=r.n(l),d=r(6),h=r.n(d),f=r(2),p=r.n(f),v=r(3),y=r.n(v),m="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,g=function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e!==r;){var n=e.nextSibling;t.removeChild(e),e=n}},b="{{lit-".concat(String(Math.random()).slice(2),"}}"),_="\x3c!--".concat(b,"--\x3e"),w=new RegExp("".concat(b,"|").concat(_)),S=function t(e,r){i()(this,t),this.parts=[],this.element=r;for(var n=[],o=[],a=document.createTreeWalker(r.content,133,null,!1),s=0,u=-1,l=0,c=e.strings,d=e.values.length;l<d;){var h=a.nextNode();if(null!==h){if(u++,1===h.nodeType){if(h.hasAttributes()){for(var f=h.attributes,p=f.length,v=0,y=0;y<p;y++)x(f[y].name,"$lit$")&&v++;for(;v-- >0;){var m=c[l],g=P.exec(m)[2],_=g.toLowerCase()+"$lit$",S=h.getAttribute(_);h.removeAttribute(_);var k=S.split(w);this.parts.push({type:"attribute",index:u,name:g,strings:k}),l+=k.length-1}}"TEMPLATE"===h.tagName&&(o.push(h),a.currentNode=h.content)}else if(3===h.nodeType){var A=h.data;if(A.indexOf(b)>=0){for(var T=h.parentNode,N=A.split(w),C=N.length-1,O=0;O<C;O++){var R=void 0,L=N[O];if(""===L)R=E();else{var j=P.exec(L);null!==j&&x(j[2],"$lit$")&&(L=L.slice(0,j.index)+j[1]+j[2].slice(0,-"$lit$".length)+j[3]),R=document.createTextNode(L)}T.insertBefore(R,h),this.parts.push({type:"node",index:++u})}""===N[C]?(T.insertBefore(E(),h),n.push(h)):h.data=N[C],l+=C}}else if(8===h.nodeType)if(h.data===b){var V=h.parentNode;null!==h.previousSibling&&u!==s||(u++,V.insertBefore(E(),h)),s=u,this.parts.push({type:"node",index:u}),null===h.nextSibling?h.data="":(n.push(h),u--),l++}else for(var M=-1;-1!==(M=h.data.indexOf(b,M+1));)this.parts.push({type:"node",index:-1}),l++}else a.currentNode=o.pop()}for(var F=0,I=n;F<I.length;F++){var U=I[F];U.parentNode.removeChild(U)}},x=function(t,e){var r=t.length-e.length;return r>=0&&t.slice(r)===e},k=function(t){return-1!==t.index},E=function(){return document.createComment("")},P=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function A(t,e){for(var r=t.element.content,n=t.parts,i=document.createTreeWalker(r,133,null,!1),o=N(n),a=n[o],s=-1,u=0,l=[],c=null;i.nextNode();){s++;var d=i.currentNode;for(d.previousSibling===c&&(c=null),e.has(d)&&(l.push(d),null===c&&(c=d)),null!==c&&u++;void 0!==a&&a.index===s;)a.index=null!==c?-1:a.index-u,a=n[o=N(n,o)]}l.forEach((function(t){return t.parentNode.removeChild(t)}))}var T=function(t){for(var e=11===t.nodeType?0:1,r=document.createTreeWalker(t,133,null,!1);r.nextNode();)e++;return e},N=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=e+1;r<t.length;r++){var n=t[r];if(k(n))return r}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 */ var C=new WeakMap,O=function(t){return"function"==typeof t&&C.has(t)},R={},L={},j=r(8),V=r.n(j);function M(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return F(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function F(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n} /** * @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 */var I=function(){function t(e,r,n){i()(this,t),this.__parts=[],this.template=e,this.processor=r,this.options=n}return a()(t,[{key:"update",value:function(t){var e,r=0,n=M(this.__parts);try{for(n.s();!(e=n.n()).done;){var i=e.value;void 0!==i&&i.setValue(t[r]),r++}}catch(t){n.e(t)}finally{n.f()}var o,a=M(this.__parts);try{for(a.s();!(o=a.n()).done;){var s=o.value;void 0!==s&&s.commit()}}catch(t){a.e(t)}finally{a.f()}}},{key:"_clone",value:function(){for(var t,e=m?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),r=[],n=this.template.parts,i=document.createTreeWalker(e,133,null,!1),o=0,a=0,s=i.nextNode();o<n.length;)if(t=n[o],k(t)){for(;a<t.index;)a++,"TEMPLATE"===s.nodeName&&(r.push(s),i.currentNode=s.content),null===(s=i.nextNode())&&(i.currentNode=r.pop(),s=i.nextNode());if("node"===t.type){var u=this.processor.handleTextExpression(this.options);u.insertAfterNode(s.previousSibling),this.__parts.push(u)}else{var l;(l=this.__parts).push.apply(l,V()(this.processor.handleAttributeExpressions(s,t.name,t.strings,this.options)))}o++}else this.__parts.push(void 0),o++;return m&&(document.adoptNode(e),customElements.upgrade(e)),e}}]),t}();function U(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){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 */();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h()(this,r)}}var q=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:function(t){return t}}),D=" ".concat(b," "),H=function(){function t(e,r,n,o){i()(this,t),this.strings=e,this.values=r,this.type=n,this.processor=o}return a()(t,[{key:"getHTML",value:function(){for(var t=this.strings.length-1,e="",r=!1,n=0;n<t;n++){var i=this.strings[n],o=i.lastIndexOf("\x3c!--");r=(o>-1||r)&&-1===i.indexOf("--\x3e",o+1);var a=P.exec(i);e+=null===a?i+(r?D:_):i.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+b}return e+=this.strings[t]}},{key:"getTemplateElement",value:function(){var t=document.createElement("template"),e=this.getHTML();return void 0!==q&&(e=q.createHTML(e)),t.innerHTML=e,t}}]),t}(),$=function(t){c()(r,t);var e=U(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"getHTML",value:function(){return"<svg>".concat(u()(p()(r.prototype),"getHTML",this).call(this),"</svg>")}},{key:"getTemplateElement",value:function(){var t=u()(p()(r.prototype),"getTemplateElement",this).call(this),e=t.content,n=e.firstChild;return e.removeChild(n),function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;e!==r;){var i=e.nextSibling;t.insertBefore(e,n),e=i}}(e,n.firstChild),t}}]),r}(H);function B(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h()(this,r)}}function z(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return W(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n} /** * @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 */var G=function(t){return null===t||!("object"===y()(t)||"function"==typeof t)},J=function(t){return Array.isArray(t)||!(!t||!t[Symbol.iterator])},X=function(){function t(e,r,n){i()(this,t),this.dirty=!0,this.element=e,this.name=r,this.strings=n,this.parts=[];for(var o=0;o<n.length-1;o++)this.parts[o]=this._createPart()}return a()(t,[{key:"_createPart",value:function(){return new Y(this)}},{key:"_getValue",value:function(){var t=this.strings,e=t.length-1,r=this.parts;if(1===e&&""===t[0]&&""===t[1]){var n=r[0].value;if("symbol"===y()(n))return String(n);if("string"==typeof n||!J(n))return n}for(var i="",o=0;o<e;o++){i+=t[o];var a=r[o];if(void 0!==a){var s=a.value;if(G(s)||!J(s))i+="string"==typeof s?s:String(s);else{var u,l=z(s);try{for(l.s();!(u=l.n()).done;){var c=u.value;i+="string"==typeof c?c:String(c)}}catch(t){l.e(t)}finally{l.f()}}}}return i+=t[e]}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}]),t}(),Y=function(){function t(e){i()(this,t),this.value=void 0,this.committer=e}return a()(t,[{key:"setValue",value:function(t){t===R||G(t)&&t===this.value||(this.value=t,O(t)||(this.committer.dirty=!0))}},{key:"commit",value:function(){for(;O(this.value);){var t=this.value;this.value=R,t(this)}this.value!==R&&this.committer.commit()}}]),t}(),K=function(){function t(e){i()(this,t),this.value=void 0,this.__pendingValue=void 0,this.options=e}return a()(t,[{key:"appendInto",value:function(t){this.startNode=t.appendChild(E()),this.endNode=t.appendChild(E())}},{key:"insertAfterNode",value:function(t){this.startNode=t,this.endNode=t.nextSibling}},{key:"appendIntoPart",value:function(t){t.__insert(this.startNode=E()),t.__insert(this.endNode=E())}},{key:"insertAfterPart",value:function(t){t.__insert(this.startNode=E()),this.endNode=t.endNode,t.endNode=this.startNode}},{key:"setValue",value:function(t){this.__pendingValue=t}},{key:"commit",value:function(){if(null!==this.startNode.parentNode){for(;O(this.__pendingValue);){var t=this.__pendingValue;this.__pendingValue=R,t(this)}var e=this.__pendingValue;e!==R&&(G(e)?e!==this.value&&this.__commitText(e):e instanceof H?this.__commitTemplateResult(e):e instanceof Node?this.__commitNode(e):J(e)?this.__commitIterable(e):e===L?(this.value=L,this.clear()):this.__commitText(e))}}},{key:"__insert",value:function(t){this.endNode.parentNode.insertBefore(t,this.endNode)}},{key:"__commitNode",value:function(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}},{key:"__commitText",value:function(t){var e=this.startNode.nextSibling,r="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=r:this.__commitNode(document.createTextNode(r)),this.value=t}},{key:"__commitTemplateResult",value:function(t){var e=this.options.templateFactory(t);if(this.value instanceof I&&this.value.template===e)this.value.update(t.values);else{var r=new I(e,t.processor,this.options),n=r._clone();r.update(t.values),this.__commitNode(n),this.value=r}}},{key:"__commitIterable",value:function(e){Array.isArray(this.value)||(this.value=[],this.clear());var r,n,i=this.value,o=0,a=z(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;void 0===(r=i[o])&&(r=new t(this.options),i.push(r),0===o?r.appendIntoPart(this):r.insertAfterPart(i[o-1])),r.setValue(s),r.commit(),o++}}catch(t){a.e(t)}finally{a.f()}o<i.length&&(i.length=o,this.clear(r&&r.endNode))}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.startNode;g(this.startNode.parentNode,t.nextSibling,this.endNode)}}]),t}(),Q=function(){function t(e,r,n){if(i()(this,t),this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=e,this.name=r,this.strings=n}return a()(t,[{key:"setValue",value:function(t){this.__pendingValue=t}},{key:"commit",value:function(){for(;O(this.__pendingValue);){var t=this.__pendingValue;this.__pendingValue=R,t(this)}if(this.__pendingValue!==R){var e=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=R}}}]),t}(),Z=function(t){c()(r,t);var e=B(r);function r(t,n,o){var a;return i()(this,r),(a=e.call(this,t,n,o)).single=2===o.length&&""===o[0]&&""===o[1],a}return a()(r,[{key:"_createPart",value:function(){return new tt(this)}},{key:"_getValue",value:function(){return this.single?this.parts[0].value:u()(p()(r.prototype),"_getValue",this).call(this)}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]),r}(X),tt=function(t){c()(r,t);var e=B(r);function r(){return i()(this,r),e.apply(this,arguments)}return r}(Y),et=!1;!function(){try{var t={get capture(){return et=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}}();var rt=function(){function t(e,r,n){var o=this;i()(this,t),this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=r,this.eventContext=n,this.__boundHandleEvent=function(t){return o.handleEvent(t)}}return a()(t,[{key:"setValue",value:function(t){this.__pendingValue=t}},{key:"commit",value:function(){for(;O(this.__pendingValue);){var t=this.__pendingValue;this.__pendingValue=R,t(this)}if(this.__pendingValue!==R){var e=this.__pendingValue,r=this.value,n=null==e||null!=r&&(e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive),i=null!=e&&(null==r||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=nt(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=R}}},{key:"handleEvent",value:function(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}]),t}(),nt=function(t){return t&&(et?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)}; /** * @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 it(t){var e=ot.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},ot.set(t.type,e));var r=e.stringsArray.get(t.strings);if(void 0!==r)return r;var n=t.strings.join(b);return void 0===(r=e.keyString.get(n))&&(r=new S(t,t.getTemplateElement()),e.keyString.set(n,r)),e.stringsArray.set(t.strings,r),r}var ot=new Map,at=new WeakMap,st=new(function(){function t(){i()(this,t)}return a()(t,[{key:"handleAttributeExpressions",value:function(t,e,r,n){var i=e[0];return"."===i?new Z(t,e.slice(1),r).parts:"@"===i?[new rt(t,e.slice(1),n.eventContext)]:"?"===i?[new Q(t,e.slice(1),r)]:new X(t,e,r).parts}},{key:"handleTextExpression",value:function(t){return new K(t)}}]),t}()); /** * @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 */ /** * @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 */ "undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.4.1");var ut=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return new H(t,r,"html",st)},lt=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return new $(t,r,"svg",st)},ct=function(t,e){return"".concat(t,"--").concat(e)},dt=!0;void 0===window.ShadyCSS?dt=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),dt=!1);var ht=function(t){return function(e){var r=ct(e.type,t),n=ot.get(r);void 0===n&&(n={stringsArray:new WeakMap,keyString:new Map},ot.set(r,n));var i=n.stringsArray.get(e.strings);if(void 0!==i)return i;var o=e.strings.join(b);if(void 0===(i=n.keyString.get(o))){var a=e.getTemplateElement();dt&&window.ShadyCSS.prepareTemplateDom(a,t),i=new S(e,a),n.keyString.set(o,i)}return n.stringsArray.set(e.strings,i),i}},ft=["html","svg"],pt=new Set,vt=function(t,e,r){pt.add(t);var n=r?r.element:document.createElement("template"),i=e.querySelectorAll("style"),o=i.length;if(0!==o){for(var a=document.createElement("style"),s=0;s<o;s++){var u=i[s];u.parentNode.removeChild(u),a.textContent+=u.textContent}!function(t){ft.forEach((function(e){var r=ot.get(ct(e,t));void 0!==r&&r.keyString.forEach((function(t){var e=t.element.content,r=new Set;Array.from(e.querySelectorAll("style")).forEach((function(t){r.add(t)})),A(t,r)}))}))}(t);var l=n.content;r?function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.element.content,i=t.parts;if(null!=r)for(var o=document.createTreeWalker(n,133,null,!1),a=N(i),s=0,u=-1;o.nextNode();){u++;var l=o.currentNode;for(l===r&&(s=T(e),r.parentNode.insertBefore(e,r));-1!==a&&i[a].index===u;){if(s>0){for(;-1!==a;)i[a].index+=s,a=N(i,a);return}a=N(i,a)}}else n.appendChild(e)}(r,a,l.firstChild):l.insertBefore(a,l.firstChild),window.ShadyCSS.prepareTemplateStyles(n,t);var c=l.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)e.insertBefore(c.cloneNode(!0),e.firstChild);else if(r){l.insertBefore(a,l.firstChild);var d=new Set;d.add(a),A(r,d)}}else window.ShadyCSS.prepareTemplateStyles(n,t)},yt=r(7),mt=r.n(yt),gt=r(9),bt=r.n(gt),_t=r(13),wt=r.n(_t);function St(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return xt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xt(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function kt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){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 */();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h()(this,r)}}window.JSCompiler_renameProperty=function(t,e){return t};var Et={toAttribute:function(t,e){switch(e){case Boolean:return t?"":null;case Object:case Array:return null==t?t:JSON.stringify(t)}return t},fromAttribute:function(t,e){switch(e){case Boolean:return null!==t;case Number:return null===t?null:Number(t);case Object:case Array:return JSON.parse(t)}return t}},Pt=function(t,e){return e!==t&&(e==e||t==t)},At={attribute:!0,type:String,converter:Et,reflect:!1,hasChanged:Pt},Tt=function(t){c()(n,t);var e,r=kt(n);function n(){var t;return i()(this,n),(t=r.call(this)).initialize(),t}return a()(n,[{key:"initialize",value:function(){var t=this;this._updateState=0,this._updatePromise=new Promise((function(e){return t._enableUpdatingResolver=e})),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}},{key:"_saveInstanceProperties",value:function(){var t=this;this.constructor._classProperties.forEach((function(e,r){if(t.hasOwnProperty(r)){var n=t[r];delete t[r],t._instanceProperties||(t._instanceProperties=new Map),t._instanceProperties.set(r,n)}}))}},{key:"_applyInstanceProperties",value:function(){var t=this;this._instanceProperties.forEach((function(e,r){return t[r]=e})),this._instanceProperties=void 0}},{key:"connectedCallback",value:function(){this.enableUpdating()}},{key:"enableUpdating",value:function(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(t,e,r){e!==r&&this._attributeToProperty(t,r)}},{key:"_propertyToAttribute",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:At,n=this.constructor,i=n._attributeNameForProperty(t,r);if(void 0!==i){var o=n._propertyValueToAttribute(e,r);if(void 0===o)return;this._updateState=8|this._updateState,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._updateState=-9&this._updateState}}},{key:"_attributeToProperty",value:function(t,e){if(!(8&this._updateState)){var r=this.constructor,n=r._attributeToPropertyMap.get(t);if(void 0!==n){var i=r.getPropertyOptions(n);this._updateState=16|this._updateState,this[n]=r._propertyValueFromAttribute(e,i),this._updateState=-17&this._updateState}}}},{key:"requestUpdateInternal",value:function(t,e,r){var n=!0;if(void 0!==t){var i=this.constructor;r=r||i.getPropertyOptions(t),i._valueHasChanged(this[t],e,r.hasChanged)?(this._changedProperties.has(t)||this._changedProperties.set(t,e),!0!==r.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(t,r))):n=!1}!this._hasRequestedUpdate&&n&&(this._updatePromise=this._enqueueUpdate())}},{key:"requestUpdate",value:function(t,e){return this.requestUpdateInternal(t,e),this.updateComplete}},{key:"_enqueueUpdate",value:(e=bt()(mt.a.mark((function t(){var e;return mt.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._updateState=4|this._updateState,t.prev=1,t.next=4,this._updatePromise;case 4:t.next=8;break;case 6:t.prev=6,t.t0=t.catch(1);case 8:if(null==(e=this.performUpdate())){t.next=12;break}return t.next=12,e;case 12:return t.abrupt("return",!this._hasRequestedUpdate);case 13:case"end":return t.stop()}}),t,this,[[1,6]])}))),function(){return e.apply(this,arguments)})},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"performUpdate",value:function(){if(this._hasRequestedUpdate){this._instanceProperties&&this._applyInstanceProperties();var t=!1,e=this._changedProperties;try{(t=this.shouldUpdate(e))?this.update(e):this._markUpdated()}catch(e){throw t=!1,this._markUpdated(),e}t&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(e)),this.updated(e))}}},{key:"_markUpdated",value:function(){this._changedProperties=new Map,this._updateState=-5&this._updateState}},{key:"updateComplete",get:function(){return this._getUpdateComplete()}},{key:"_getUpdateComplete",value:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._updatePromise}},{key:"shouldUpdate",value:function(t){return!0}},{key:"update",value:function(t){var e=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((function(t,r){return e._propertyToAttribute(r,e[r],t)})),this._reflectingProperties=void 0),this._markUpdated()}},{key:"updated",value:function(t){}},{key:"firstUpdated",value:function(t){}}],[{key:"observedAttributes",get:function(){var t=this;this.finalize();var e=[];return this._classProperties.forEach((function(r,n){var i=t._attributeNameForProperty(n,r);void 0!==i&&(t._attributeToPropertyMap.set(i,n),e.push(i))})),e}},{key:"_ensureClassProperties",value:function(){var t=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((function(e,r){return t._classProperties.set(r,e)}))}}},{key:"createProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:At;if(this._ensureClassProperties(),this._classProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){var r="symbol"===y()(t)?Symbol():"__".concat(t),n=this.getPropertyDescriptor(t,r,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}},{key:"getPropertyDescriptor",value:function(t,e,r){return{get:function(){return this[e]},set:function(n){var i=this[t];this[e]=n,this.requestUpdateInternal(t,i,r)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(t){return this._classProperties&&this._classProperties.get(t)||At}},{key:"finalize",value:function(){var t=Object.getPrototypeOf(this);if(t.hasOwnProperty("finalized")||t.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var e,r=this.properties,n=St([].concat(V()(Object.getOwnPropertyNames(r)),V()("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[])));try{for(n.s();!(e=n.n()).done;){var i=e.value;this.createProperty(i,r[i])}}catch(t){n.e(t)}finally{n.f()}}}},{key:"_attributeNameForProperty",value:function(t,e){var r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}},{key:"_valueHasChanged",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Pt;return r(t,e)}},{key:"_propertyValueFromAttribute",value:function(t,e){var r=e.type,n=e.converter||Et,i="function"==typeof n?n:n.fromAttribute;return i?i(t,r):t}},{key:"_propertyValueToAttribute",value:function(t,e){if(void 0!==e.reflect){var r=e.type,n=e.converter;return(n&&n.toAttribute||Et.toAttribute)(t,r)}}}]),n}(wt()(HTMLElement));Tt.finalized=!0; /** * @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 */ var Nt=function(t){return function(e){return"function"==typeof e?function(t,e){return window.customElements.define(t,e),e}(t,e):function(t,e){return{kind:e.kind,elements:e.elements,finisher:function(e){window.customElements.define(t,e)}}}(t,e)}};function Ct(t){return function(e,r){return void 0!==r?function(t,e,r){e.constructor.createProperty(r,t)}(t,e,r):function(t,e){return"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?Object.assign(Object.assign({},e),{finisher:function(r){r.createProperty(e.key,t)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer:function(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher:function(r){r.createProperty(e.key,t)}}}(t,e)}}function Ot(t){return Ct({attribute:!1,hasChanged:null==t?void 0:t.hasChanged})}var Rt=function(t){return Ot(t)};function Lt(t,e){return function(r,n){var i={get:function(){return this.renderRoot.querySelector(t)},enumerable:!0,configurable:!0};if(e){var o=void 0!==n?n:r.key,a="symbol"===y()(o)?Symbol():"__".concat(o);i.get=function(){return void 0===this[a]&&(this[a]=this.renderRoot.querySelector(t)),this[a]}}return void 0!==n?Mt(i,r,n):Ft(i,r)}}function jt(t){return function(e,r){var n={get:function(){var e=this;return bt()(mt.a.mark((function r(){return mt.a.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.updateComplete;case 2:return r.abrupt("return",e.renderRoot.querySelector(t));case 3:case"end":return r.stop()}}),r)})))()},enumerable:!0,configurable:!0};return void 0!==r?Mt(n,e,r):Ft(n,e)}}function Vt(t){return function(e,r){var n={get:function(){return this.renderRoot.querySelectorAll(t)},enumerable:!0,configurable:!0};return void 0!==r?Mt(n,e,r):Ft(n,e)}}var Mt=function(t,e,r){Object.defineProperty(e,r,t)},Ft=function(t,e){return{kind:"method",placement:"prototype",key:e.key,descriptor:t}};function It(t){return function(e,r){return void 0!==r?function(t,e,r){Object.assign(e[r],t)}(t,e,r):function(t,e){return Object.assign(Object.assign({},e),{finisher:function(r){Object.assign(r.prototype[e.key],t)}})}(t,e)}}var Ut=Element.prototype,qt=Ut.msMatchesSelector||Ut.webkitMatchesSelector;function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return function(n,i){var o={get:function(){var n="slot".concat(t?"[name=".concat(t,"]"):":not([name])"),i=this.renderRoot.querySelector(n),o=i&&i.assignedNodes({flatten:e});return o&&r&&(o=o.filter((function(t){return t.nodeType===Node.ELEMENT_NODE&&(t.matches?t.matches(r):qt.call(t,r))}))),o},enumerable:!0,configurable:!0};return void 0!==i?Mt(o,n,i):Ft(o,n)}} /** @license Copyright (c) 2019 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 */var Ht=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,$t=Symbol(),Bt=function(){function t(e,r){if(i()(this,t),r!==$t)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}return a()(t,[{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(Ht?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}},{key:"toString",value:function(){return this.cssText}}]),t}(),zt=function(t){return new Bt(String(t),$t)},Wt=function(t){if(t instanceof Bt)return t.cssText;if("number"==typeof t)return t;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(t,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},Gt=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];var i=r.reduce((function(e,r,n){return e+Wt(r)+t[n+1]}),t[0]);return new Bt(i,$t)};function Jt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){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 */();return function(){var r,n=p()(t);if(e){var i=p()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return h()(this,r)}}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");var Xt={},Yt=function(t){c()(r,t);var e=Jt(r);function r(){return i()(this,r),e.apply(this,arguments)}return a()(r,[{key:"initialize",value:function(){u()(p()(r.prototype),"initialize",this).call(this),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}},{key:"createRenderRoot",value:function(){return this.attachShadow(this.constructor.shadowRootOptions)}},{key:"adoptStyles",value:function(){var t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?Ht?this.renderRoot.adoptedStyleSheets=t.map((function(t){return t instanceof CSSStyleSheet?t:t.styleSheet})):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((function(t){return t.cssText})),this.localName))}},{key:"connectedCallback",value:function(){u()(p()(r.prototype),"connectedCallback",this).call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}},{key:"update",value:function(t){var e=this,n=this.render();u()(p()(r.prototype),"update",this).call(this,t),n!==Xt&&this.constructor.render(n,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((function(t){var r=document.createElement("style");r.textContent=t.cssText,e.renderRoot.appendChild(r)})))}},{key:"render",value:function(){return Xt}}],[{key:"getStyles",value:function(){return this.styles}},{key:"_getUniqueStyles",value:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var t=this.getStyles();if(Array.isArray(t)){var e=function t(e,r){return e.reduceRight((function(e,r){return Array.isArray(r)?t(r,e):(e.add(r),e)}),r)}(t,new Set),r=[];e.forEach((function(t){return r.unshift(t)})),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((function(t){if(t instanceof CSSStyleSheet&&!Ht){var e=Array.prototype.slice.call(t.cssRules).reduce((function(t,e){return t+e.cssText}),"");return zt(e)}return t}))}}}]),r}(Tt);Yt.finalized=!0,Yt.render=function(t,e,r){if(!r||"object"!==y()(r)||!r.scopeName)throw new Error("The `scopeName` option is required.");var n=r.scopeName,i=at.has(e),o=dt&&11===e.nodeType&&!!e.host,a=o&&!pt.has(n),s=a?document.createDocumentFragment():e;if(function(t,e,r){var n=at.get(e);void 0===n&&(g(e,e.firstChild),at.set(e,n=new K(Object.assign({templateFactory:it},r))),n.appendInto(e)),n.setValue(t),n.commit()}(t,s,Object.assign({templateFactory:ht(n)},r)),a){var u=at.get(s);at.delete(s);var l=u.value instanceof I?u.value.template:void 0;vt(n,s,l),g(e,e.firstChild),e.appendChild(s),at.set(e,u)}!i&&o&&window.ShadyCSS.styleElement(e.host)},Yt.shadowRootOptions={mode:"open"}},function(t,e,r){var n=r(2),i=r(10),o=r(24),a=r(25);function s(e){var r="function"==typeof Map?new Map:void 0;return t.exports=s=function(t){if(null===t||!o(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(t))return r.get(t);r.set(t,e)}function e(){return a(t,arguments,n(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),i(e,t)},s(e)}t.exports=s},function(t,e,r){t.exports=r(15)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(16);window.customElements&&customElements.define(n.default.is,n.default)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(12),i=r(27),o=r(28),a=r(29);class s extends n.LitElement{constructor(){super(),this.height="25rem",this.visibleChildren=[],this.noScrollToRow=!1,this.noDeselect=!1,this.expandTable=!1,this.scrollFilter=new i.ScrollFilter(this),this.wheelListener=t=>this.scrollFilter.wheel(t),this.eventHandler=this.eventHandler.bind(this)}static get is(){return"protvista-datatable"}connectedCallback(){super.connectedCallback();const t=this.querySelector("table tbody");if(!t)return;this.mutationObserver=new MutationObserver(()=>{this.init()}),this.mutationObserver.observe(t,{characterData:!0,childList:!0,subtree:!0});const e=document.createElement("style");e.innerHTML=a.default.toString(),document.querySelector("head").appendChild(e),this.closest("protvista-manager")&&(this.manager=this.closest("protvista-manager"),this.manager.register(this)),this.noDeselect||document.addEventListener("click",this.eventHandler),this.classList.add("feature"),this.hasAttribute("filter-scroll")&&document.addEventListener("wheel",this.wheelListener),this.init()}disconnectedCallback(){super.disconnectedCallback(),this.manager&&this.manager.unregister(this),document.removeEventListener("click",this.eventHandler),document.removeEventListener("wheel",this.wheelListener),this.mutationObserver.disconnect()}init(){if(this.columns=this.querySelectorAll("table thead th"),!this.querySelector(".pd-group-column-header")){const t=document.createElement("th");t.classList.add("pd-group-column-header");const e=this.querySelector("table thead tr");e.insertBefore(t,e.firstChild)}this.rows=this.querySelectorAll("table tbody tr"),this.rows.forEach(t=>{if(!t.dataset.groupFor&&!t.querySelector(".pd-group-trigger")){const e=t.insertCell(0);if(e.classList.add("pd-group-trigger"),this.querySelector("[data-group-for]")){const r=document.createElement("button");r.dataset.triggerId=t.dataset.id,e.appendChild(r),r.addEventListener("click",t=>this.handleGroupToggle(t))}}t.addEventListener("click",e=>this.handleClick(e,t))}),this.updateRowStyling(),this.selectedFilters=new Map,this.filterMap=this.parseDataForFilters(),this.addFilterOptions()}parseDataForFilters(){const t=o.parseColumnFilters(this.columns);return this.rows.forEach(e=>{e.childNodes.forEach(e=>{var r;if(null===(r=e.dataset)||void 0===r?void 0:r.filter){t.get(e.dataset.filter).add(e.dataset.filterValue)}})}),t}addFilterOptions(){this.columns.forEach(t=>{if(t.dataset.filter){let e,r;t.querySelector(".filter-wrap")?(e=t.querySelector("select"),r=t.querySelector(".filter-wrap")):(r=document.createElement("span"),r.className="filter-wrap",r.innerHTML=t.innerHTML,e=document.createElement("select"),e.dataset.testid="select",e.onchange=e=>this.handleFilterChange(e,t.dataset.filter)),e.innerHTML="<option selected value>-- Select --</option>",this.filterMap.get(t.dataset.filter).forEach(t=>{const r=document.createElement("option");r.value=t,r.label=t,r.dataset.testid="select-option",e.appendChild(r)}),t.innerHTML="",r.appendChild(e),t.appendChild(r)}})}eventHandler(t){const e=t.target;e.closest("protvista-datatable")||e.closest(".feature")||(this.selectedid=null,this.highlight=null)}static get properties(){return{highlight:{converter:t=>{if(t&&"null"!==t)try{const e=t.split(":").map(t=>Number(t));if(2!==e.length)throw new Error("Highlight should be only 2 values separated by ':'.");return[e[0],e[1]]}catch(t){console.error("Invalid highlight coordinates:",t)}return null}},height:{type:String},displayStart:{type:Number},displayEnd:{type:Number},visibleChildren:{type:Array},selectedid:{type:String},noScrollToRow:{type:Boolean},noDeselect:{type:Boolean},expandTable:{type:Boolean}}}static get styles(){return n.css` :host { display: block; } .protvista-datatable-container { overflow-y: auto; // Note: overflow-x was set to 'hidden' but changing // to 'auto' doesn't seem to be an issue. overflow-x: auto; scrollbar-gutter: stable; } :host([scrollable="true"]) .protvista-datatable-container { overflow-y: auto; } :host([scrollable="false"]) .protvista-datatable-container { overflow-y: hidden; } `}handleGroupToggle(t){const{triggerId:e}=t.target.dataset;this.visibleChildren.includes(e)?(this.visibleChildren=this.visibleChildren.filter(t=>t!==e),t.target.classList.remove(a.EXPANDED.cssText)):(this.visibleChildren=[...this.visibleChildren,e],t.target.classList.add(a.EXPANDED.cssText))}handleClick(t,e){if(e.classList.contains("transparent"))return;const{id:r,start:n,end:i}=e.dataset;this.selectedid=r;const o={};n&&i&&(o.highlight=`${n}:${i}`),this.selectedid&&(o.selectedid=this.selectedid),this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,cancelable:!0}))}handleFilterChange(t,e){const{selectedOptions:r}=t.target,{value:n}=r.item(0);n?this.selectedFilters.set(e,n):this.selectedFilters.delete(e),this.updateRowStyling()}isRowVisible(t){const e=!t.dataset.groupFor||t.dataset.groupFor&&this.visibleChildren.includes(t.dataset.groupFor);if(!this.selectedFilters||0===this.selectedFilters.size)return e;for(const[e,r]of this.selectedFilters){let n;if(t.dataset.groupFor){n=this.querySelector(`[data-id="${t.dataset.groupFor}"]`).querySelector(`[data-filter="${e}"]`)}else n=t.querySelector(`[data-filter="${e}"]`);if(n&&n.dataset.filterValue!==r)return!1}return e}updateRowStyling(){var t;let e=0;null===(t=this.rows)||void 0===t||t.forEach(t=>{this.isRowVisible(t)?t.classList.remove(a.HIDDEN.cssText):t.classList.add(a.HIDDEN.cssText),t.dataset.groupFor||e++;const{start:r,end:n}=t.dataset;if(t.classList.add(e%2==0?"even":"odd"),!this.selectedid||this.selectedid!==t.dataset.id&&t.dataset.groupFor!==this.selectedid?t.classList.remove(a.ACTIVE