!function e(t,a,i){function s(o,n){if(!a[o]){if(!t[o]){var l="function"==typeof require&&require;if(!n&&l)return l(o,!0);if(r)return r(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=a[o]={exports:{}};t[o][0].call(c.exports,(function(e){return s(t[o][1][e]||e)}),c,c.exports,e,t,a,i)}return a[o].exports}for(var r="function"==typeof require&&require,o=0;o1;)a=a[i.shift()];a[i.shift()]=t}},{key:"removeDataByString",value:function(e){for(var t=this.data,a=e.split(".");a.length>1;)t=t[a.shift()];var i=a.shift();i.match(/^\d+$/)?t.splice(Number(i),1):delete t[i]}},{key:"resolveBlock",value:function(e,t,a){var i=this,s=e.match(//g),r=e.match(//g),o=e.match(//g),n=e.match(//g);if(s)for(var l=0,d=s.length;l/g,(function(e,t){return(0,n.selector)("#"+t).innerHTML}))}},{key:"resolveWith",value:function(e){return e=e.replace(/(([\n\r\t]|.)*?)/g,(function(e,t){return e=e.replace(/data\-bind=['"](.*?)['"]/g,"data-bind='"+t+".$1'")}))}},{key:"resolveLoop",value:function(e){var t=this;return e=e.replace(/(([\n\r\t]|.)*?)/g,(function(e,a,i){var s=t.getDataByString(a),r=[],o="";if((r="function"==typeof s?s.apply(t):s)instanceof Array)for(var n=0,l=r.length;n(([\n\r\t]|.)*?)/g)}},{key:"getHtml",value:function(e,t){var a=this.atemplate.find((function(t){return t.id===e})),i="";if(a&&a.html&&(i=a.html),t&&(i=e),!i)return"";var s=this.data;for(i=this.resolveInclude(i),i=this.resolveWith(i);this.hasLoop(i);)i=this.resolveLoop(i);return i=(i=this.resolveBlock(i,s)).replace(/\\([^\\])/g,"$1"),(i=this.resolveAbsBlock(i)).replace(/^([\t ])*\n/gm,"")}},{key:"update",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"html",a=arguments[1],i=this.templates;this.beforeUpdated&&this.beforeUpdated();for(var s=function(s,r){var l=i[s],d="#"+l,c=e.getHtml(l),p=(0,n.selector)("[data-id='"+l+"']");if(p)if("text"===t)p.innerText=c;else if(a){var u=document.createElement("div");u.innerHTML=c;var h=u.querySelector(a).outerHTML;(0,o.default)(p.querySelector(a),h)}else(0,o.default)(p,"
"+c+"
");else(0,n.selector)(d).insertAdjacentHTML("afterend",'
'),"text"===t?(0,n.selector)("[data-id='"+l+"']").innerText=c:(0,n.selector)("[data-id='"+l+"']").innerHTML=c;var m=e.atemplate.find((function(e){return e.id===l}));m.binded||(m.binded=!0,e.addDataBind((0,n.selector)("[data-id='"+l+"']")),e.addActionBind((0,n.selector)("[data-id='"+l+"']")))},r=0,l=i.length;r1?a-1:0),s=1;s1;)t=t[a.shift()];var i=a.shift();return i.match(/^\d+$/)?t.splice(Number(i),1):delete t[i],this}}]),e}();a.default=u,t.exports=a.default},{"./util":2,"ie-array-find-polyfill":5,morphdom:6}],2:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i=a.matches=function(e,t){for(var a=(e.document||e.ownerDocument).querySelectorAll(t),i=a.length;--i>=0&&a.item(i)!==e;);return i>-1},s=(a.selector=function(e){return document.querySelector(e)},a.findAncestor=function(e,t){if("function"==typeof e.closest)return e.closest(t)||null;for(;e&&e!==document;){if(i(e,t))return e;e=e.parentElement}return null}),r=[];a.on=function(e,t,a,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],n=a.split(" ");n.forEach((function(a){var n=function(e){var a=s(e.target,t);a&&(e.delegateTarget=a,i(e))};r.push({listener:n,element:e,query:t,event:a,capture:o}),e.addEventListener(a,n,o)}))},a.off=function(e,t,a){a.split(" ").forEach((function(a){r.forEach((function(i,s){i.element===e&&i.query===t&&i.event===a&&(e.removeEventListener(a,i.listener,i.capture),r.splice(s,1))}))}))}},{}],3:[function(e,t,a){try{var i=new window.CustomEvent("test");if(i.preventDefault(),!0!==i.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var s=function(e,t){var a,i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(a=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i=a.preventDefault,a.preventDefault=function(){i.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},a};s.prototype=window.Event.prototype,window.CustomEvent=s}},{}],4:[function(e,t,a){!function(e){var t=e.Promise,i=t&&"resolve"in t&&"reject"in t&&"all"in t&&"race"in t&&function(){var e;return new t((function(t){e=t})),"function"==typeof e}();void 0!==a&&a?(a.Promise=i?t:T,a.Polyfill=T):"function"==typeof define&&define.amd?define((function(){return i?t:T})):i||(e.Promise=T);var s="pending",r="sealed",o="fulfilled",n="rejected",l=function(){};function d(e){return"[object Array]"===Object.prototype.toString.call(e)}var c,p="undefined"!=typeof setImmediate?setImmediate:setTimeout,u=[];function h(){for(var e=0;e>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var i=arguments[1],s=0;s=97?s===r.toUpperCase():i<=90&&a>=97&&r===s.toUpperCase())}function d(e,t,a){e[a]!==t[a]&&(e[a]=t[a],e[a]?e.setAttribute(a,""):e.removeAttribute(a))}var c={OPTION:function(e,t){var a=e.parentNode;if(a){var i=a.nodeName.toUpperCase();"OPTGROUP"===i&&(i=(a=a.parentNode)&&a.nodeName.toUpperCase()),"SELECT"!==i||a.hasAttribute("multiple")||(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),a.selectedIndex=-1)}d(e,t,"selected")},INPUT:function(e,t){d(e,t,"checked"),d(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var a=t.value;e.value!==a&&(e.value=a);var i=e.firstChild;if(i){var s=i.nodeValue;if(s==a||!a&&s==e.placeholder)return;i.nodeValue=a}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var a,i,s=-1,r=0,o=e.firstChild;o;)if("OPTGROUP"===(i=o.nodeName&&o.nodeName.toUpperCase()))o=(a=o).firstChild;else{if("OPTION"===i){if(o.hasAttribute("selected")){s=r;break}r++}!(o=o.nextSibling)&&a&&(o=a.nextSibling,a=null)}e.selectedIndex=s}}};function p(){}function u(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}var h=function(e){return function(t,a,i){if(i||(i={}),"string"==typeof a)if("#document"===t.nodeName||"HTML"===t.nodeName||"BODY"===t.nodeName){var r=a;(a=s.createElement("html")).innerHTML=r}else a=n(a);var o=i.getNodeKey||u,d=i.onBeforeNodeAdded||p,h=i.onNodeAdded||p,m=i.onBeforeElUpdated||p,f=i.onElUpdated||p,g=i.onBeforeNodeDiscarded||p,v=i.onNodeDiscarded||p,w=i.onBeforeElChildrenUpdated||p,y=!0===i.childrenOnly,b=Object.create(null),x=[];function C(e){x.push(e)}function T(e,t){if(1===e.nodeType)for(var a=e.firstChild;a;){var i=void 0;t&&(i=o(a))?C(i):(v(a),a.firstChild&&T(a,t)),a=a.nextSibling}}function S(e,t,a){!1!==g(e)&&(t&&t.removeChild(e),v(e),T(e,a))}function E(e){h(e);for(var t=e.firstChild;t;){var a=t.nextSibling,i=o(t);if(i){var s=b[i];s&&l(t,s)?(t.parentNode.replaceChild(s,t),P(s,t)):E(t)}else E(t);t=a}}function P(t,a,i){var r=o(a);if(r&&delete b[r],!i){if(!1===m(t,a))return;if(e(t,a),f(t),!1===w(t,a))return}"TEXTAREA"!==t.nodeName?function(e,t){var a,i,r,n,p,u=t.firstChild,h=e.firstChild;e:for(;u;){for(n=u.nextSibling,a=o(u);h;){if(r=h.nextSibling,u.isSameNode&&u.isSameNode(h)){u=n,h=r;continue e}i=o(h);var m=h.nodeType,f=void 0;if(m===u.nodeType&&(1===m?(a?a!==i&&((p=b[a])?r===p?f=!1:(e.insertBefore(p,h),i?C(i):S(h,e,!0),h=p):f=!1):i&&(f=!1),(f=!1!==f&&l(h,u))&&P(h,u)):3!==m&&8!=m||(f=!0,h.nodeValue!==u.nodeValue&&(h.nodeValue=u.nodeValue))),f){u=n,h=r;continue e}i?C(i):S(h,e,!0),h=r}if(a&&(p=b[a])&&l(p,u))e.appendChild(p),P(p,u);else{var g=d(u);!1!==g&&(g&&(u=g),u.actualize&&(u=u.actualize(e.ownerDocument||s)),e.appendChild(u),E(u))}u=n,h=r}!function(e,t,a){for(;t;){var i=t.nextSibling;(a=o(t))?C(a):S(t,e,!0),t=i}}(e,h,i);var v=c[e.nodeName];v&&v(e,t)}(t,a):c.TEXTAREA(t,a)}!function e(t){if(1===t.nodeType||11===t.nodeType)for(var a=t.firstChild;a;){var i=o(a);i&&(b[i]=a),e(a),a=a.nextSibling}}(t);var k,I,_=t,z=_.nodeType,M=a.nodeType;if(!y)if(1===z)1===M?l(t,a)||(v(t),_=function(e,t){for(var a=e.firstChild;a;){var i=a.nextSibling;t.appendChild(a),a=i}return t}(t,(k=a.nodeName,(I=a.namespaceURI)&&"http://www.w3.org/1999/xhtml"!==I?s.createElementNS(I,k):s.createElement(k)))):_=a;else if(3===z||8===z){if(M===z)return _.nodeValue!==a.nodeValue&&(_.nodeValue=a.nodeValue),_;_=a}if(_===a)v(t);else{if(a.isSameNode&&a.isSameNode(_))return;if(P(_,a,y),x)for(var D=0,A=x.length;D=0;n--)i=(a=o[n]).name,s=a.namespaceURI,r=a.value,s?(i=a.localName||i,e.getAttributeNS(s,i)!==r&&("xmlns"===a.prefix&&(i=a.name),e.setAttributeNS(s,i,r))):e.getAttribute(i)!==r&&e.setAttribute(i,r);for(var l=e.attributes,d=l.length-1;d>=0;d--)i=(a=l[d]).name,(s=a.namespaceURI)?(i=a.localName||i,t.hasAttributeNS(s,i)||e.removeAttributeNS(s,i)):t.hasAttribute(i)||e.removeAttribute(i)}}));t.exports=h},{}],7:[function(e,t,a){"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var i,s=(i=e("a-template"))&&i.__esModule?i:{default:i};function r(e){return(r="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)}function o(e,t){for(var a=0;a