"use strict";function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call}return _assertThisInitialized(self)}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return self}function _get(target,property,receiver){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(receiver)}return desc.value}}return _get(target,property,receiver||target)}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break}return object}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o)};return _getPrototypeOf(o)}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function")}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});if(superClass)_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o};return _setPrototypeOf(o,p)}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(iter){if(Symbol.iterator in Object(iter)||Object.prototype.toString.call(iter)==="[object Arguments]")return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr)){for(var i=0,arr2=new Array(arr.length);i2&&arguments[2]!==undefined?arguments[2]:null;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;var n=e;for(;n!==s;){var _e=n.nextSibling;t.insertBefore(n,i),n=_e}},o=function o(t,e){var s=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var i=e;for(;i!==s;){var _e2=i.nextSibling;t.removeChild(i),i=_e2}},r={},a={},l="{{lit-".concat(String(Math.random()).slice(2),"}}"),h="\x3c!--".concat(l,"--\x3e"),d=new RegExp("".concat(l,"|").concat(h)),c="$lit$";var u=function u(t,e){var _this=this;_classCallCheck(this,u);this.parts=[],this.element=e;var s=-1,i=0;var n=[],o=function o(e){var r=e.content,a=document.createTreeWalker(r,133,null,!1);var h=0;for(;a.nextNode();){s++;var _e3=a.currentNode;if(1===_e3.nodeType){if(_e3.hasAttributes()){var _n=_e3.attributes;var _o=0;for(var _t=0;_t<_n.length;_t++){_n[_t].value.indexOf(l)>=0&&_o++}for(;_o-- >0;){var _n2=t.strings[i],_o2=g.exec(_n2)[2],_r=_o2.toLowerCase()+c,_a=_e3.getAttribute(_r).split(d);_this.parts.push({type:"attribute",index:s,name:_o2,strings:_a}),_e3.removeAttribute(_r),i+=_a.length-1}}"TEMPLATE"===_e3.tagName&&o(_e3)}else if(3===_e3.nodeType){var _t2=_e3.data;if(_t2.indexOf(l)>=0){var _o3=_e3.parentNode,_r2=_t2.split(d),_a2=_r2.length-1;for(var _t3=0;_t3<_a2;_t3++){_o3.insertBefore(""===_r2[_t3]?m():document.createTextNode(_r2[_t3]),_e3),_this.parts.push({type:"node",index:++s})}""===_r2[_a2]?(_o3.insertBefore(m(),_e3),n.push(_e3)):_e3.data=_r2[_a2],i+=_a2}}else if(8===_e3.nodeType)if(_e3.data===l){var _t4=_e3.parentNode;null!==_e3.previousSibling&&s!==h||(s++,_t4.insertBefore(m(),_e3)),h=s,_this.parts.push({type:"node",index:s}),null===_e3.nextSibling?_e3.data="":(n.push(_e3),s--),i++}else{var _t5=-1;for(;-1!==(_t5=_e3.data.indexOf(l,_t5+1));){_this.parts.push({type:"node",index:-1})}}}};o(e);for(var _i=0;_i=\/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;var v=function(){function v(t,e,s){_classCallCheck(this,v);this._parts=[],this.template=t,this.processor=e,this.options=s}_createClass(v,[{key:"update",value:function update(t){var e=0;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=this._parts[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var _s=_step.value;void 0!==_s&&_s.setValue(t[e]),e++}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return!=null){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=this._parts[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var _t7=_step2.value;void 0!==_t7&&_t7.commit()}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return!=null){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}}},{key:"_clone",value:function _clone(){var _this2=this;var t=i?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=this.template.parts;var s=0,n=0;var o=function o(t){var i=document.createTreeWalker(t,133,null,!1);var r=i.nextNode();for(;s".concat(_get(_getPrototypeOf(x.prototype),"getHTML",this).call(this),"")}},{key:"getTemplateElement",value:function getTemplateElement(){var t=_get(_getPrototypeOf(x.prototype),"getTemplateElement",this).call(this),e=t.content,s=e.firstChild;return e.removeChild(s),n(e,s.firstChild),t}}]);return x}(f);var _=function _(t){return null===t||!("object"==_typeof(t)||"function"==typeof t)};var y=function(){function y(t,e,s){_classCallCheck(this,y);this.dirty=!0,this.element=t,this.name=e,this.strings=s,this.parts=[];for(var _t11=0;_t110&&arguments[0]!==undefined?arguments[0]:this.startNode;o(this.startNode.parentNode,t.nextSibling,this.endNode)}}]);return V}();var b=function(){function b(t,e,s){_classCallCheck(this,b);if(this.value=void 0,this._pendingValue=void 0,2!==s.length||""!==s[0]||""!==s[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=s}_createClass(b,[{key:"setValue",value:function setValue(t){this._pendingValue=t}},{key:"commit",value:function commit(){for(;s(this._pendingValue);){var _t15=this._pendingValue;this._pendingValue=r,_t15(this)}if(this._pendingValue===r)return;var t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=r}}]);return b}();var w=function(_y){_inherits(w,_y);function w(t,e,s){var _this3;_classCallCheck(this,w);_this3=_possibleConstructorReturn(this,_getPrototypeOf(w).call(this,t,e,s)),_this3.single=2===s.length&&""===s[0]&&""===s[1];return _this3}_createClass(w,[{key:"_createPart",value:function _createPart(){return new T(this)}},{key:"_getValue",value:function _getValue(){return this.single?this.parts[0].value:_get(_getPrototypeOf(w.prototype),"_getValue",this).call(this)}},{key:"commit",value:function commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]);return w}(y);var T=function(_N){_inherits(T,_N);function T(){_classCallCheck(this,T);return _possibleConstructorReturn(this,_getPrototypeOf(T).apply(this,arguments))}return T}(N);var E=!1;try{var _t16={get capture(){return E=!0,!1}};window.addEventListener("test",_t16,_t16),window.removeEventListener("test",_t16,_t16)}catch(t){}var A=function(){function A(t,e,s){var _this4=this;_classCallCheck(this,A);this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=s,this._boundHandleEvent=function(t){return _this4.handleEvent(t)}}_createClass(A,[{key:"setValue",value:function setValue(t){this._pendingValue=t}},{key:"commit",value:function commit(){for(;s(this._pendingValue);){var _t17=this._pendingValue;this._pendingValue=r,_t17(this)}if(this._pendingValue===r)return;var t=this._pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),n=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),n&&(this._options=P(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=r}},{key:"handleEvent",value:function handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}]);return A}();var P=function P(t){return t&&(E?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)};var S=function(){function S(){_classCallCheck(this,S)}_createClass(S,[{key:"handleAttributeExpressions",value:function handleAttributeExpressions(t,e,s,i){var n=e[0];if("."===n){return new w(t,e.slice(1),s).parts}return"@"===n?[new A(t,e.slice(1),i.eventContext)]:"?"===n?[new b(t,e.slice(1),s)]:new y(t,e,s).parts}},{key:"handleTextExpression",value:function handleTextExpression(t){return new V(t)}}]);return S}();var C=new S;function M(t){var e=L.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},L.set(t.type,e));var s=e.stringsArray.get(t.strings);if(void 0!==s)return s;var i=t.strings.join(l);return void 0===(s=e.keyString.get(i))&&(s=new u(t,t.getTemplateElement()),e.keyString.set(i,s)),e.stringsArray.set(t.strings,s),s}var L=new Map,k=new WeakMap;(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.0.0");t.html=function(t){for(var _len=arguments.length,e=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){e[_key-1]=arguments[_key]}return new f(t,e,"html",C)},t.svg=function(t){for(var _len2=arguments.length,e=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){e[_key2-1]=arguments[_key2]}return new x(t,e,"svg",C)},t.DefaultTemplateProcessor=S,t.defaultTemplateProcessor=C,t.directive=function(t){return function(){var i=t.apply(void 0,arguments);return e.set(i,!0),i}},t.isDirective=s,t.removeNodes=o,t.reparentNodes=n,t.noChange=r,t.nothing=a,t.AttributeCommitter=y,t.AttributePart=N,t.BooleanAttributePart=b,t.EventPart=A,t.isPrimitive=_,t.NodePart=V,t.PropertyCommitter=w,t.PropertyPart=T,t.parts=k,t.render=function(t,e,s){var i=k.get(e);void 0===i&&(o(e,e.firstChild),k.set(e,i=new V(Object.assign({templateFactory:M},s))),i.appendInto(e)),i.setValue(t),i.commit()},t.templateCaches=L,t.templateFactory=M,t.TemplateInstance=v,t.SVGTemplateResult=x,t.TemplateResult=f,t.createMarker=m,t.isTemplatePartActive=p,t.Template=u,Object.defineProperty(t,"__esModule",{value:!0})});