siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
138 lines (134 loc) • 103 kB
JavaScript
/**
@license @nocompile
Copyright (c) 2018 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(){/*
Copyright (c) 2016 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
*/
'use strict';var n,p="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this,aa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};function ba(){ba=function(){};p.Symbol||(p.Symbol=ca)}var ca=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}();
function da(){ba();var a=p.Symbol.iterator;a||(a=p.Symbol.iterator=p.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&aa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ea(this)}});da=function(){}}function ea(a){var b=0;return fa(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})}function fa(a){da();a={next:a};a[p.Symbol.iterator]=function(){return this};return a}function ia(a){da();var b=a[Symbol.iterator];return b?b.call(a):ea(a)}
function ja(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}
(function(){if(!function(){var a=document.createEvent("Event");a.initEvent("foo",!0,!0);a.preventDefault();return a.defaultPrevented}()){var a=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(a.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var b=/Trident/.test(navigator.userAgent);if(!window.CustomEvent||b&&"function"!==typeof window.CustomEvent)window.CustomEvent=function(a,b){b=b||{};var c=document.createEvent("CustomEvent");
c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c},window.CustomEvent.prototype=window.Event.prototype;if(!window.Event||b&&"function"!==typeof window.Event){var c=window.Event;window.Event=function(a,b){b=b||{};var c=document.createEvent("Event");c.initEvent(a,!!b.bubbles,!!b.cancelable);return c};if(c)for(var d in c)window.Event[d]=c[d];window.Event.prototype=c.prototype}if(!window.MouseEvent||b&&"function"!==typeof window.MouseEvent){b=window.MouseEvent;window.MouseEvent=function(a,
b){b=b||{};var c=document.createEvent("MouseEvent");c.initMouseEvent(a,!!b.bubbles,!!b.cancelable,b.view||window,b.detail,b.screenX,b.screenY,b.clientX,b.clientY,b.ctrlKey,b.altKey,b.shiftKey,b.metaKey,b.button,b.relatedTarget);return c};if(b)for(d in b)window.MouseEvent[d]=b[d];window.MouseEvent.prototype=b.prototype}Array.from||(Array.from=function(a){return[].slice.call(a)});Object.assign||(Object.assign=function(a,b){for(var c=[].slice.call(arguments,1),d=0,e;d<c.length;d++)if(e=c[d])for(var f=
a,m=e,q=Object.getOwnPropertyNames(m),x=0;x<q.length;x++)e=q[x],f[e]=m[e];return a})})(window.WebComponents);(function(){function a(){}function b(a,b){if(!a.childNodes.length)return[];switch(a.nodeType){case Node.DOCUMENT_NODE:return ua.call(a,b);case Node.DOCUMENT_FRAGMENT_NODE:return lb.call(a,b);default:return U.call(a,b)}}var c="undefined"===typeof HTMLTemplateElement,d=!(document.createDocumentFragment().cloneNode()instanceof DocumentFragment),e=!1;/Trident/.test(navigator.userAgent)&&function(){function a(a,b){if(a instanceof DocumentFragment)for(var d;d=a.firstChild;)c.call(this,d,b);else c.call(this,
a,b);return a}e=!0;var b=Node.prototype.cloneNode;Node.prototype.cloneNode=function(a){a=b.call(this,a);this instanceof DocumentFragment&&(a.__proto__=DocumentFragment.prototype);return a};DocumentFragment.prototype.querySelectorAll=HTMLElement.prototype.querySelectorAll;DocumentFragment.prototype.querySelector=HTMLElement.prototype.querySelector;Object.defineProperties(DocumentFragment.prototype,{nodeType:{get:function(){return Node.DOCUMENT_FRAGMENT_NODE},configurable:!0},localName:{get:function(){},
configurable:!0},nodeName:{get:function(){return"#document-fragment"},configurable:!0}});var c=Node.prototype.insertBefore;Node.prototype.insertBefore=a;var d=Node.prototype.appendChild;Node.prototype.appendChild=function(b){b instanceof DocumentFragment?a.call(this,b,null):d.call(this,b);return b};var f=Node.prototype.removeChild,g=Node.prototype.replaceChild;Node.prototype.replaceChild=function(b,c){b instanceof DocumentFragment?(a.call(this,b,c),f.call(this,c)):g.call(this,b,c);return c};Document.prototype.createDocumentFragment=
function(){var a=this.createElement("df");a.__proto__=DocumentFragment.prototype;return a};var h=Document.prototype.importNode;Document.prototype.importNode=function(a,b){b=h.call(this,a,b||!1);a instanceof DocumentFragment&&(b.__proto__=DocumentFragment.prototype);return b}}();var f=Node.prototype.cloneNode,g=Document.prototype.createElement,h=Document.prototype.importNode,k=Node.prototype.removeChild,l=Node.prototype.appendChild,m=Node.prototype.replaceChild,q=DOMParser.prototype.parseFromString,
x=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML")||{get:function(){return this.innerHTML},set:function(a){this.innerHTML=a}},M=Object.getOwnPropertyDescriptor(window.Node.prototype,"childNodes")||{get:function(){return this.childNodes}},U=Element.prototype.querySelectorAll,ua=Document.prototype.querySelectorAll,lb=DocumentFragment.prototype.querySelectorAll,mb=function(){if(!c){var a=document.createElement("template"),b=document.createElement("template");b.content.appendChild(document.createElement("div"));
a.content.appendChild(b);a=a.cloneNode(!0);return 0===a.content.childNodes.length||0===a.content.firstChild.content.childNodes.length||d}}();if(c){var S=document.implementation.createHTMLDocument("template"),C=!0,V=document.createElement("style");V.textContent="template{display:none;}";var ha=document.head;ha.insertBefore(V,ha.firstElementChild);a.prototype=Object.create(HTMLElement.prototype);var va=!document.createElement("div").hasOwnProperty("innerHTML");a.G=function(b){if(!b.content&&b.namespaceURI===
document.documentElement.namespaceURI){b.content=S.createDocumentFragment();for(var c;c=b.firstChild;)l.call(b.content,c);if(va)b.__proto__=a.prototype;else if(b.cloneNode=function(b){return a.a(this,b)},C)try{P(b),W(b)}catch(Tg){C=!1}a.C(b.content)}};var X={option:["select"],thead:["table"],col:["colgroup","table"],tr:["tbody","table"],th:["tr","tbody","table"],td:["tr","tbody","table"]},P=function(b){Object.defineProperty(b,"innerHTML",{get:function(){return nb(this)},set:function(b){var c=X[(/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(b)||
["",""])[1].toLowerCase()];if(c)for(var d=0;d<c.length;d++)b="<"+c[d]+">"+b+"</"+c[d]+">";S.body.innerHTML=b;for(a.C(S);this.content.firstChild;)k.call(this.content,this.content.firstChild);b=S.body;if(c)for(d=0;d<c.length;d++)b=b.lastChild;for(;b.firstChild;)l.call(this.content,b.firstChild)},configurable:!0})},W=function(a){Object.defineProperty(a,"outerHTML",{get:function(){return"<template>"+this.innerHTML+"</template>"},set:function(a){if(this.parentNode){S.body.innerHTML=a;for(a=this.ownerDocument.createDocumentFragment();S.body.firstChild;)l.call(a,
S.body.firstChild);m.call(this.parentNode,a,this)}else throw Error("Failed to set the 'outerHTML' property on 'Element': This element has no parent node.");},configurable:!0})};P(a.prototype);W(a.prototype);a.C=function(c){c=b(c,"template");for(var d=0,e=c.length,f;d<e&&(f=c[d]);d++)a.G(f)};document.addEventListener("DOMContentLoaded",function(){a.C(document)});Document.prototype.createElement=function(){var b=g.apply(this,arguments);"template"===b.localName&&a.G(b);return b};DOMParser.prototype.parseFromString=
function(){var b=q.apply(this,arguments);a.C(b);return b};Object.defineProperty(HTMLElement.prototype,"innerHTML",{get:function(){return nb(this)},set:function(b){x.set.call(this,b);a.C(this)},configurable:!0,enumerable:!0});var Ve=/[&\u00A0"]/g,yc=/[&\u00A0<>]/g,zc=function(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}};V=function(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b};var We=V("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),
Xe=V("style script xmp iframe noembed noframes plaintext noscript".split(" ")),nb=function(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):M.get.call(a),e=0,f=d.length,g;e<f&&(g=d[e]);e++){a:{var h=g;var k=a;var l=b;switch(h.nodeType){case Node.ELEMENT_NODE:for(var P=h.localName,m="<"+P,W=h.attributes,q=0;k=W[q];q++)m+=" "+k.name+'="'+k.value.replace(Ve,zc)+'"';m+=">";h=We[P]?m:m+nb(h,l)+"</"+P+">";break a;case Node.TEXT_NODE:h=h.data;h=k&&Xe[k.localName]?h:h.replace(yc,zc);break a;
case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),Error("not implemented");}}c+=h}return c}}if(c||mb){a.a=function(a,b){var c=f.call(a,!1);this.G&&this.G(c);b&&(l.call(c.content,f.call(a.content,!0)),ob(c.content,a.content));return c};var ob=function(c,d){if(d.querySelectorAll&&(d=b(d,"template"),0!==d.length)){c=b(c,"template");for(var e=0,f=c.length,g,h;e<f;e++)h=d[e],g=c[e],a&&a.G&&a.G(h),m.call(g.parentNode,Ye.call(h,!0),g)}},Ye=Node.prototype.cloneNode=
function(b){if(!e&&d&&this instanceof DocumentFragment)if(b)var c=Ze.call(this.ownerDocument,this,!0);else return this.ownerDocument.createDocumentFragment();else this.nodeType===Node.ELEMENT_NODE&&"template"===this.localName&&this.namespaceURI==document.documentElement.namespaceURI?c=a.a(this,b):c=f.call(this,b);b&&ob(c,this);return c},Ze=Document.prototype.importNode=function(c,d){d=d||!1;if("template"===c.localName)return a.a(c,d);var e=h.call(this,c,d);if(d){ob(e,c);c=b(e,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"]');
for(var f,k=0;k<c.length;k++){f=c[k];d=g.call(document,"script");d.textContent=f.textContent;for(var l=f.attributes,P=0,W;P<l.length;P++)W=l[P],d.setAttribute(W.name,W.value);m.call(f.parentNode,d,f)}}return e}}c&&(window.HTMLTemplateElement=a)})();var ka=setTimeout;function la(){}function ma(a,b){return function(){a.apply(b,arguments)}}function r(a){if(!(this instanceof r))throw new TypeError("Promises must be constructed via new");if("function"!==typeof a)throw new TypeError("not a function");this.u=0;this.ma=!1;this.h=void 0;this.I=[];na(a,this)}
function oa(a,b){for(;3===a.u;)a=a.h;0===a.u?a.I.push(b):(a.ma=!0,pa(function(){var c=1===a.u?b.Na:b.Oa;if(null===c)(1===a.u?qa:ra)(b.ga,a.h);else{try{var d=c(a.h)}catch(e){ra(b.ga,e);return}qa(b.ga,d)}}))}function qa(a,b){try{if(b===a)throw new TypeError("A promise cannot be resolved with itself.");if(b&&("object"===typeof b||"function"===typeof b)){var c=b.then;if(b instanceof r){a.u=3;a.h=b;sa(a);return}if("function"===typeof c){na(ma(c,b),a);return}}a.u=1;a.h=b;sa(a)}catch(d){ra(a,d)}}
function ra(a,b){a.u=2;a.h=b;sa(a)}function sa(a){2===a.u&&0===a.I.length&&pa(function(){a.ma||"undefined"!==typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",a.h)});for(var b=0,c=a.I.length;b<c;b++)oa(a,a.I[b]);a.I=null}function ta(a,b,c){this.Na="function"===typeof a?a:null;this.Oa="function"===typeof b?b:null;this.ga=c}function na(a,b){var c=!1;try{a(function(a){c||(c=!0,qa(b,a))},function(a){c||(c=!0,ra(b,a))})}catch(d){c||(c=!0,ra(b,d))}}
r.prototype["catch"]=function(a){return this.then(null,a)};r.prototype.then=function(a,b){var c=new this.constructor(la);oa(this,new ta(a,b,c));return c};r.prototype["finally"]=function(a){var b=this.constructor;return this.then(function(c){return b.resolve(a()).then(function(){return c})},function(c){return b.resolve(a()).then(function(){return b.reject(c)})})};
function wa(a){return new r(function(b,c){function d(a,g){try{if(g&&("object"===typeof g||"function"===typeof g)){var h=g.then;if("function"===typeof h){h.call(g,function(b){d(a,b)},c);return}}e[a]=g;0===--f&&b(e)}catch(m){c(m)}}if(!a||"undefined"===typeof a.length)throw new TypeError("Promise.all accepts an array");var e=Array.prototype.slice.call(a);if(0===e.length)return b([]);for(var f=e.length,g=0;g<e.length;g++)d(g,e[g])})}
function xa(a){return a&&"object"===typeof a&&a.constructor===r?a:new r(function(b){b(a)})}function ya(a){return new r(function(b,c){c(a)})}function za(a){return new r(function(b,c){for(var d=0,e=a.length;d<e;d++)a[d].then(b,c)})}var pa="function"===typeof setImmediate&&function(a){setImmediate(a)}||function(a){ka(a,0)};/*
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
*/
if(!window.Promise){window.Promise=r;r.prototype.then=r.prototype.then;r.all=wa;r.race=za;r.resolve=xa;r.reject=ya;var Aa=document.createTextNode(""),Ba=[];(new MutationObserver(function(){for(var a=Ba.length,b=0;b<a;b++)Ba[b]();Ba.splice(0,a)})).observe(Aa,{characterData:!0});pa=function(a){Ba.push(a);Aa.textContent=0<Aa.textContent.length?"":"a"}};(function(a){function b(a,b){if("function"===typeof window.CustomEvent)return new CustomEvent(a,b);var c=document.createEvent("CustomEvent");c.initCustomEvent(a,!!b.bubbles,!!b.cancelable,b.detail);return c}function c(a){if(M)return a.ownerDocument!==document?a.ownerDocument:null;var b=a.__importDoc;if(!b&&a.parentNode){b=a.parentNode;if("function"===typeof b.closest)b=b.closest("link[rel=import]");else for(;!h(b)&&(b=b.parentNode););a.__importDoc=b}return b}function d(a){var b=m(document,"link[rel=import]:not([import-dependency])"),
c=b.length;c?q(b,function(b){return g(b,function(){0===--c&&a()})}):a()}function e(a){function b(){"loading"!==document.readyState&&document.body&&(document.removeEventListener("readystatechange",b),a())}document.addEventListener("readystatechange",b);b()}function f(a){e(function(){return d(function(){return a&&a()})})}function g(a,b){if(a.__loaded)b&&b();else if("script"===a.localName&&!a.src||"style"===a.localName&&!a.firstChild)a.__loaded=!0,b&&b();else{var c=function(d){a.removeEventListener(d.type,
c);a.__loaded=!0;b&&b()};a.addEventListener("load",c);ha&&"style"===a.localName||a.addEventListener("error",c)}}function h(a){return a.nodeType===Node.ELEMENT_NODE&&"link"===a.localName&&"import"===a.rel}function k(){var a=this;this.a={};this.b=0;this.c=new MutationObserver(function(b){return a.Ja(b)});this.c.observe(document.head,{childList:!0,subtree:!0});this.loadImports(document)}function l(a){q(m(a,"template"),function(a){q(m(a.content,'script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]'),
function(a){var b=document.createElement("script");q(a.attributes,function(a){return b.setAttribute(a.name,a.value)});b.textContent=a.textContent;a.parentNode.replaceChild(b,a)});l(a.content)})}function m(a,b){return a.childNodes.length?a.querySelectorAll(b):U}function q(a,b,c){var d=a?a.length:0,e=c?-1:1;for(c=c?d-1:0;c<d&&0<=c;c+=e)b(a[c],c)}var x=document.createElement("link"),M="import"in x,U=x.querySelectorAll("*"),ua=null;!1==="currentScript"in document&&Object.defineProperty(document,"currentScript",
{get:function(){return ua||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null)},configurable:!0});var lb=/(url\()([^)]*)(\))/g,mb=/(@import[\s]+(?!url\())([^;]*)(;)/g,S=/(<link[^>]*)(rel=['|"]?stylesheet['|"]?[^>]*>)/g,C={Ea:function(a,b){a.href&&a.setAttribute("href",C.X(a.getAttribute("href"),b));a.src&&a.setAttribute("src",C.X(a.getAttribute("src"),b));if("style"===a.localName){var c=C.qa(a.textContent,b,lb);a.textContent=C.qa(c,b,mb)}},qa:function(a,b,c){return a.replace(c,
function(a,c,d,e){a=d.replace(/["']/g,"");b&&(a=C.X(a,b));return c+"'"+a+"'"+e})},X:function(a,b){if(void 0===C.aa){C.aa=!1;try{var c=new URL("b","http://a");c.pathname="c%20d";C.aa="http://a/c%20d"===c.href}catch(yc){}}if(C.aa)return(new URL(a,b)).href;c=C.xa;c||(c=document.implementation.createHTMLDocument("temp"),C.xa=c,c.ja=c.createElement("base"),c.head.appendChild(c.ja),c.ia=c.createElement("a"));c.ja.href=b;c.ia.href=a;return c.ia.href||a}},V={async:!0,load:function(a,b,c){if(a)if(a.match(/^data:/)){a=
a.split(",");var d=a[1];d=-1<a[0].indexOf(";base64")?atob(d):decodeURIComponent(d);b(d)}else{var e=new XMLHttpRequest;e.open("GET",a,V.async);e.onload=function(){var a=e.responseURL||e.getResponseHeader("Location");a&&0===a.indexOf("/")&&(a=(location.origin||location.protocol+"//"+location.host)+a);var d=e.response||e.responseText;304===e.status||0===e.status||200<=e.status&&300>e.status?b(d,a):c(d)};e.send()}else c("error: href must be specified")}},ha=/Trident/.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent);
k.prototype.loadImports=function(a){var b=this;a=m(a,"link[rel=import]");q(a,function(a){return b.g(a)})};k.prototype.g=function(a){var b=this,c=a.href;if(void 0!==this.a[c]){var d=this.a[c];d&&d.__loaded&&(a.__import=d,this.f(a))}else this.b++,this.a[c]="pending",V.load(c,function(a,d){a=b.Ka(a,d||c);b.a[c]=a;b.b--;b.loadImports(a);b.l()},function(){b.a[c]=null;b.b--;b.l()})};k.prototype.Ka=function(a,b){if(!a)return document.createDocumentFragment();ha&&(a=a.replace(S,function(a,b,c){return-1===
a.indexOf("type=")?b+" type=import-disable "+c:a}));var c=document.createElement("template");c.innerHTML=a;if(c.content)a=c.content,l(a);else for(a=document.createDocumentFragment();c.firstChild;)a.appendChild(c.firstChild);if(c=a.querySelector("base"))b=C.X(c.getAttribute("href"),b),c.removeAttribute("href");c=m(a,'link[rel=import],link[rel=stylesheet][href][type=import-disable],style:not([type]),link[rel=stylesheet][href]:not([type]),script:not([type]),script[type="application/javascript"],script[type="text/javascript"],script[type="module"]');
var d=0;q(c,function(a){g(a);C.Ea(a,b);a.setAttribute("import-dependency","");if("script"===a.localName&&!a.src&&a.textContent){if("module"===a.type)throw Error("Inline module scripts are not supported in HTML Imports.");a.setAttribute("src","data:text/javascript;charset=utf-8,"+encodeURIComponent(a.textContent+("\n//# sourceURL="+b+(d?"-"+d:"")+".js\n")));a.textContent="";d++}});return a};k.prototype.l=function(){var a=this;if(!this.b){this.c.disconnect();this.flatten(document);var b=!1,c=!1,d=function(){c&&
b&&(a.loadImports(document),a.b||(a.c.observe(document.head,{childList:!0,subtree:!0}),a.da()))};this.Ma(function(){c=!0;d()});this.La(function(){b=!0;d()})}};k.prototype.flatten=function(a){var b=this;a=m(a,"link[rel=import]");q(a,function(a){var c=b.a[a.href];(a.__import=c)&&c.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(b.a[a.href]=a,a.readyState="loading",a.__import=a,b.flatten(c),a.appendChild(c))})};k.prototype.La=function(a){function b(e){if(e<d){var f=c[e],h=document.createElement("script");f.removeAttribute("import-dependency");
q(f.attributes,function(a){return h.setAttribute(a.name,a.value)});ua=h;f.parentNode.replaceChild(h,f);g(h,function(){ua=null;b(e+1)})}else a()}var c=m(document,"script[import-dependency]"),d=c.length;b(0)};k.prototype.Ma=function(a){var b=m(document,"style[import-dependency],link[rel=stylesheet][import-dependency]"),d=b.length;if(d){var e=ha&&!!document.querySelector("link[rel=stylesheet][href][type=import-disable]");q(b,function(b){g(b,function(){b.removeAttribute("import-dependency");0===--d&&
a()});if(e&&b.parentNode!==document.head){var f=document.createElement(b.localName);f.__appliedElement=b;f.setAttribute("type","import-placeholder");b.parentNode.insertBefore(f,b.nextSibling);for(f=c(b);f&&c(f);)f=c(f);f.parentNode!==document.head&&(f=null);document.head.insertBefore(b,f);b.removeAttribute("type")}})}else a()};k.prototype.da=function(){var a=this,b=m(document,"link[rel=import]");q(b,function(b){return a.f(b)},!0)};k.prototype.f=function(a){a.__loaded||(a.__loaded=!0,a.import&&(a.import.readyState=
"complete"),a.dispatchEvent(b(a.import?"load":"error",{bubbles:!1,cancelable:!1,detail:void 0})))};k.prototype.Ja=function(a){var b=this;q(a,function(a){return q(a.addedNodes,function(a){a&&a.nodeType===Node.ELEMENT_NODE&&(h(a)?b.g(a):b.loadImports(a))})})};var va=null;if(M)x=m(document,"link[rel=import]"),q(x,function(a){a.import&&"loading"===a.import.readyState||(a.__loaded=!0)}),x=function(a){a=a.target;h(a)&&(a.__loaded=!0)},document.addEventListener("load",x,!0),document.addEventListener("error",
x,!0);else{var X=Object.getOwnPropertyDescriptor(Node.prototype,"baseURI");Object.defineProperty((!X||X.configurable?Node:Element).prototype,"baseURI",{get:function(){var a=h(this)?this:c(this);return a?a.href:X&&X.get?X.get.call(this):(document.querySelector("base")||window.location).href},configurable:!0,enumerable:!0});Object.defineProperty(HTMLLinkElement.prototype,"import",{get:function(){return this.__import||null},configurable:!0,enumerable:!0});e(function(){va=new k})}f(function(){return document.dispatchEvent(b("HTMLImportsLoaded",
{cancelable:!0,bubbles:!0,detail:void 0}))});a.useNative=M;a.whenReady=f;a.importForElement=c;a.loadImports=function(a){va&&va.loadImports(a)}})(window.HTMLImports=window.HTMLImports||{});/*
Copyright (c) 2014 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
*/
window.WebComponents=window.WebComponents||{flags:{}};var Ca=document.querySelector('script[src*="webcomponents-lite.js"]'),Da=/wc-(.+)/,t={};if(!t.noOpts){location.search.slice(1).split("&").forEach(function(a){a=a.split("=");var b;a[0]&&(b=a[0].match(Da))&&(t[b[1]]=a[1]||!0)});if(Ca)for(var Ea=0,Fa=void 0;Fa=Ca.attributes[Ea];Ea++)"src"!==Fa.name&&(t[Fa.name]=Fa.value||!0);if(t.log&&t.log.split){var Ga=t.log.split(",");t.log={};Ga.forEach(function(a){t.log[a]=!0})}else t.log={}}
window.WebComponents.flags=t;var Ha=t.shadydom;Ha&&(window.ShadyDOM=window.ShadyDOM||{},window.ShadyDOM.force=Ha);var Ia=t.register||t.ce;Ia&&window.customElements&&(window.customElements.forcePolyfill=Ia);/*
Copyright (c) 2016 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 Ja(){this.pa=this.root=null;this.T=!1;this.D=this.P=this.ca=this.assignedSlot=this.assignedNodes=this.H=null;this.childNodes=this.nextSibling=this.previousSibling=this.lastChild=this.firstChild=this.parentNode=this.K=void 0;this.ka=this.la=!1;this.O={}}Ja.prototype.toJSON=function(){return{}};function u(a){a.__shady||(a.__shady=new Ja);return a.__shady}function v(a){return a&&a.__shady};var w=window.ShadyDOM||{};w.Ga=!(!Element.prototype.attachShadow||!Node.prototype.getRootNode);var Ka=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild");w.m=!!(Ka&&Ka.configurable&&Ka.get);w.ea=w.force||!w.Ga;w.J=w.noPatch||!1;w.oa=w.preferPerformance;function y(a){return(a=v(a))&&void 0!==a.firstChild}function z(a){return"ShadyRoot"===a.za}function La(a){return(a=(a=v(a))&&a.root)&&Ma(a)}
var Na=Element.prototype,Oa=Na.matches||Na.matchesSelector||Na.mozMatchesSelector||Na.msMatchesSelector||Na.oMatchesSelector||Na.webkitMatchesSelector,Pa=document.createTextNode(""),Qa=0,Ra=[];(new MutationObserver(function(){for(;Ra.length;)try{Ra.shift()()}catch(a){throw Pa.textContent=Qa++,a;}})).observe(Pa,{characterData:!0});function Sa(a){Ra.push(a);Pa.textContent=Qa++}var Ta=!!document.contains;function Ua(a,b){for(;b;){if(b==a)return!0;b=b.__shady_parentNode}return!1}
function Va(a){for(var b=a.length-1;0<=b;b--){var c=a[b],d=c.getAttribute("id")||c.getAttribute("name");d&&"length"!==d&&isNaN(d)&&(a[d]=c)}a.item=function(b){return a[b]};a.namedItem=function(b){if("length"!==b&&isNaN(b)&&a[b])return a[b];for(var c=ia(a),d=c.next();!d.done;d=c.next())if(d=d.value,(d.getAttribute("id")||d.getAttribute("name"))==b)return d;return null};return a}
function A(a,b,c,d){c=void 0===c?"":c;for(var e in b){var f=b[e];if(!(d&&0<=d.indexOf(e))){f.configurable=!0;var g=c+e;if(f.value)a[g]=f.value;else try{Object.defineProperty(a,g,f)}catch(h){}}}}function B(a){var b={};Object.getOwnPropertyNames(a).forEach(function(c){b[c]=Object.getOwnPropertyDescriptor(a,c)});return b};var Wa=[],Xa;function Ya(a){Xa||(Xa=!0,Sa(Za));Wa.push(a)}function Za(){Xa=!1;for(var a=!!Wa.length;Wa.length;)Wa.shift()();return a}Za.list=Wa;function $a(){this.a=!1;this.addedNodes=[];this.removedNodes=[];this.S=new Set}function ab(a){a.a||(a.a=!0,Sa(function(){a.flush()}))}$a.prototype.flush=function(){if(this.a){this.a=!1;var a=this.takeRecords();a.length&&this.S.forEach(function(b){b(a)})}};$a.prototype.takeRecords=function(){if(this.addedNodes.length||this.removedNodes.length){var a=[{addedNodes:this.addedNodes,removedNodes:this.removedNodes}];this.addedNodes=[];this.removedNodes=[];return a}return[]};
function bb(a,b){var c=u(a);c.H||(c.H=new $a);c.H.S.add(b);var d=c.H;return{ya:b,F:d,Aa:a,takeRecords:function(){return d.takeRecords()}}}function cb(a){var b=a&&a.F;b&&(b.S.delete(a.ya),b.S.size||(u(a.Aa).H=null))}
function db(a,b){var c=b.getRootNode();return a.map(function(a){var b=c===a.target.getRootNode();if(b&&a.addedNodes){if(b=Array.from(a.addedNodes).filter(function(a){return c===a.getRootNode()}),b.length)return a=Object.create(a),Object.defineProperty(a,"addedNodes",{value:b,configurable:!0}),a}else if(b)return a}).filter(function(a){return a})};var eb=/[&\u00A0"]/g,fb=/[&\u00A0<>]/g;function gb(a){switch(a){case "&":return"&";case "<":return"<";case ">":return">";case '"':return""";case "\u00a0":return" "}}function hb(a){for(var b={},c=0;c<a.length;c++)b[a[c]]=!0;return b}var ib=hb("area base br col command embed hr img input keygen link meta param source track wbr".split(" ")),jb=hb("style script xmp iframe noembed noframes plaintext noscript".split(" "));
function kb(a,b){"template"===a.localName&&(a=a.content);for(var c="",d=b?b(a):a.childNodes,e=0,f=d.length,g=void 0;e<f&&(g=d[e]);e++){a:{var h=g;var k=a,l=b;switch(h.nodeType){case Node.ELEMENT_NODE:k=h.localName;for(var m="<"+k,q=h.attributes,x=0,M;M=q[x];x++)m+=" "+M.name+'="'+M.value.replace(eb,gb)+'"';m+=">";h=ib[k]?m:m+kb(h,l)+"</"+k+">";break a;case Node.TEXT_NODE:h=h.data;h=k&&jb[k.localName]?h:h.replace(fb,gb);break a;case Node.COMMENT_NODE:h="\x3c!--"+h.data+"--\x3e";break a;default:throw window.console.error(h),
Error("not implemented");}}c+=h}return c};var pb=w.m,qb={querySelector:function(a){return this.__shady_native_querySelector(a)},querySelectorAll:function(a){return this.__shady_native_querySelectorAll(a)}},rb={};function sb(a){rb[a]=function(b){return b["__shady_native_"+a]}}function tb(a,b){A(a,b,"__shady_native_");for(var c in b)sb(c)}function D(a,b){b=void 0===b?[]:b;for(var c=0;c<b.length;c++){var d=b[c],e=Object.getOwnPropertyDescriptor(a,d);e&&(Object.defineProperty(a,"__shady_native_"+d,e),e.value?qb[d]||(qb[d]=e.value):sb(d))}}
var E=document.createTreeWalker(document,NodeFilter.SHOW_ALL,null,!1),F=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT,null,!1),ub=document.implementation.createHTMLDocument("inert");function vb(a){for(var b;b=a.__shady_native_firstChild;)a.__shady_native_removeChild(b)}var wb=["firstElementChild","lastElementChild","children","childElementCount"],xb=["querySelector","querySelectorAll"];
function yb(){var a=["dispatchEvent","addEventListener","removeEventListener"];window.EventTarget?D(window.EventTarget.prototype,a):(D(Node.prototype,a),D(Window.prototype,a));pb?D(Node.prototype,"parentNode firstChild lastChild previousSibling nextSibling childNodes parentElement textContent".split(" ")):tb(Node.prototype,{parentNode:{get:function(){E.currentNode=this;return E.parentNode()}},firstChild:{get:function(){E.currentNode=this;return E.firstChild()}},lastChild:{get:function(){E.currentNode=
this;return E.lastChild()}},previousSibling:{get:function(){E.currentNode=this;return E.previousSibling()}},nextSibling:{get:function(){E.currentNode=this;return E.nextSibling()}},childNodes:{get:function(){var a=[];E.currentNode=this;for(var c=E.firstChild();c;)a.push(c),c=E.nextSibling();return a}},parentElement:{get:function(){F.currentNode=this;return F.parentNode()}},textContent:{get:function(){switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:for(var a=document.createTreeWalker(this,
NodeFilter.SHOW_TEXT,null,!1),c="",d;d=a.nextNode();)c+=d.nodeValue;return c;default:return this.nodeValue}},set:function(a){if("undefined"===typeof a||null===a)a="";switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:vb(this);(0<a.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_native_insertBefore(document.createTextNode(a),void 0);break;default:this.nodeValue=a}}}});D(Node.prototype,"appendChild insertBefore removeChild replaceChild cloneNode contains".split(" "));
a={firstElementChild:{get:function(){F.currentNode=this;return F.firstChild()}},lastElementChild:{get:function(){F.currentNode=this;return F.lastChild()}},children:{get:function(){var a=[];F.currentNode=this;for(var c=F.firstChild();c;)a.push(c),c=F.nextSibling();return Va(a)}},childElementCount:{get:function(){return this.children?this.children.length:0}}};pb?(D(Element.prototype,wb),D(Element.prototype,["previousElementSibling","nextElementSibling","innerHTML"]),Object.getOwnPropertyDescriptor(HTMLElement.prototype,
"children")&&D(HTMLElement.prototype,["children"]),Object.getOwnPropertyDescriptor(HTMLElement.prototype,"innerHTML")&&D(HTMLElement.prototype,["innerHTML"])):(tb(Element.prototype,a),tb(Element.prototype,{previousElementSibling:{get:function(){F.currentNode=this;return F.previousSibling()}},nextElementSibling:{get:function(){F.currentNode=this;return F.nextSibling()}},innerHTML:{get:function(){return kb(this,function(a){return a.__shady_native_childNodes})},set:function(a){var b="template"===this.localName?
this.content:this;vb(b);var d=this.localName||"div";d=this.namespaceURI&&this.namespaceURI!==ub.namespaceURI?ub.createElementNS(this.namespaceURI,d):ub.createElement(d);d.innerHTML=a;for(a="template"===this.localName?d.content:d;d=a.__shady_native_firstChild;)b.__shady_native_insertBefore(d,void 0)}}}));D(Element.prototype,"setAttribute getAttribute hasAttribute removeAttribute focus blur".split(" "));D(Element.prototype,xb);D(HTMLElement.prototype,["focus","blur","contains"]);pb&&D(HTMLElement.prototype,
["parentElement","children","innerHTML"]);window.HTMLTemplateElement&&D(window.HTMLTemplateElement.prototype,["innerHTML"]);pb?D(DocumentFragment.prototype,wb):tb(DocumentFragment.prototype,a);D(DocumentFragment.prototype,xb);pb?(D(Document.prototype,wb),D(Document.prototype,["activeElement"])):tb(Document.prototype,a);D(Document.prototype,["importNode","getElementById"]);D(Document.prototype,xb)};var zb=B({get childNodes(){return this.__shady_childNodes},get firstChild(){return this.__shady_firstChild},get lastChild(){return this.__shady_lastChild},get textContent(){return this.__shady_textContent},set textContent(a){this.__shady_textContent=a},get childElementCount(){return this.__shady_childElementCount},get children(){return this.__shady_children},get firstElementChild(){return this.__shady_firstElementChild},get lastElementChild(){return this.__shady_lastElementChild},get innerHTML(){return this.__shady_innerHTML},
set innerHTML(a){return this.__shady_innerHTML=a},get shadowRoot(){return this.__shady_shadowRoot}}),Ab=B({get parentElement(){return this.__shady_parentElement},get parentNode(){return this.__shady_parentNode},get nextSibling(){return this.__shady_nextSibling},get previousSibling(){return this.__shady_previousSibling},get nextElementSibling(){return this.__shady_nextElementSibling},get previousElementSibling(){return this.__shady_previousElementSibling},get className(){return this.__shady_className},
set className(a){return this.__shady_className=a}}),Bb;for(Bb in zb)zb[Bb].enumerable=!1;for(var Cb in Ab)Ab[Cb].enumerable=!1;var Db=w.m||w.J,Eb=Db?function(){}:function(a){var b=u(a);b.la||(b.la=!0,A(a,Ab))},Fb=Db?function(){}:function(a){var b=u(a);b.ka||(b.ka=!0,A(a,zb))};var Gb="__eventWrappers"+Date.now(),Hb=function(){var a=Object.getOwnPropertyDescriptor(Event.prototype,"composed");return a?function(b){return a.get.call(b)}:null}(),Ib={blur:!0,focus:!0,focusin:!0,focusout:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,wheel:!0,beforeinput:!0,input:!0,keydown:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,touchstart:!0,touchend:!0,touchmove:!0,touchcancel:!0,pointerover:!0,
pointerenter:!0,pointerdown:!0,pointermove:!0,pointerup:!0,pointercancel:!0,pointerout:!0,pointerleave:!0,gotpointercapture:!0,lostpointercapture:!0,dragstart:!0,drag:!0,dragenter:!0,dragleave:!0,dragover:!0,drop:!0,dragend:!0,DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,keypress:!0},Jb={DOMAttrModified:!0,DOMAttributeNameChanged:!0,DOMCharacterDataModified:!0,DOMElementNameChanged:!0,DOMNodeInserted:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemoved:!0,DOMNodeRemovedFromDocument:!0,DOMSubtreeModified:!0};
function Kb(a){return a instanceof Node?a.__shady_getRootNode():a}function Lb(a,b){var c=[],d=a;for(a=Kb(a);d;)c.push(d),d.__shady_assignedSlot?d=d.__shady_assignedSlot:d.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&d.host&&(b||d!==a)?d=d.host:d=d.__shady_parentNode;c[c.length-1]===document&&c.push(window);return c}function Mb(a){a.__composedPath||(a.__composedPath=Lb(a.target,!0));return a.__composedPath}
function Nb(a,b){if(!z)return a;a=Lb(a,!0);for(var c=0,d,e=void 0,f,g=void 0;c<b.length;c++)if(d=b[c],f=Kb(d),f!==e&&(g=a.indexOf(f),e=f),!z(f)||-1<g)return d}function Ob(a){function b(b,d){b=new a(b,d);b.__composed=d&&!!d.composed;return b}b.__proto__=a;b.prototype=a.prototype;return b}var Pb={focus:!0,blur:!0};function Qb(a){return a.__target!==a.target||a.__relatedTarget!==a.relatedTarget}
function Rb(a,b,c){if(c=b.__handlers&&b.__handlers[a.type]&&b.__handlers[a.type][c])for(var d=0,e;(e=c[d])&&(!Qb(a)||a.target!==a.relatedTarget)&&(e.call(b,a),!a.__immediatePropagationStopped);d++);}
function Sb(a){var b=a.composedPath();Object.defineProperty(a,"currentTarget",{get:function(){return d},configurable:!0});for(var c=b.length-1;0<=c;c--){var d=b[c];Rb(a,d,"capture");if(a.Z)return}Object.defineProperty(a,"eventPhase",{get:function(){return Event.AT_TARGET}});var e;for(c=0;c<b.length;c++){d=b[c];var f=v(d);f=f&&f.root;if(0===c||f&&f===e)if(Rb(a,d,"bubble"),d!==window&&(e=d.__shady_getRootNode()),a.Z)break}}
function Tb(a,b,c,d,e,f){for(var g=0;g<a.length;g++){var h=a[g],k=h.type,l=h.capture,m=h.once,q=h.passive;if(b===h.node&&c===k&&d===l&&e===m&&f===q)return g}return-1}
function Ub(a,b,c){if(b){var d=typeof b;if("function"===d||"object"===d)if("object"!==d||b.handleEvent&&"function"===typeof b.handleEvent){if(Jb[a])return this.__shady_native_addEventListener(a,b,c);if(c&&"object"===typeof c){var e=!!c.capture;var f=!!c.once;var g=!!c.passive}else e=!!c,g=f=!1;var h=c&&c.$||this,k=b[Gb];if(k){if(-1<Tb(k,h,a,e,f,g))return}else b[Gb]=[];k=function(e){f&&this.__shady_removeEventListener(a,b,c);e.__target||Vb(e);if(h!==this){var g=Object.getOwnPropertyDescriptor(e,"currentTarget");
Object.defineProperty(e,"currentTarget",{get:function(){return h},configurable:!0})}e.__previousCurrentTarget=e.currentTarget;if(!z(h)||-1!=e.composedPath().indexOf(h))if(e.composed||-1<e.composedPath().indexOf(h))if(Qb(e)&&e.target===e.relatedTarget)e.eventPhase===Event.BUBBLING_PHASE&&e.stopImmediatePropagation();else if(e.eventPhase===Event.CAPTURING_PHASE||e.bubbles||e.target===h||h instanceof Window){var k="function"===d?b.call(h,e):b.handleEvent&&b.handleEvent(e);h!==this&&(g?(Object.defineProperty(e,
"currentTarget",g),g=null):delete e.currentTarget);return k}};b[Gb].push({node:h,type:a,capture:e,once:f,passive:g,Ya:k});Pb[a]?(this.__handlers=this.__handlers||{},this.__handlers[a]=this.__handlers[a]||{capture:[],bubble:[]},this.__handlers[a][e?"capture":"bubble"].push(k)):this.__shady_native_addEventListener(a,k,c)}}}
function Wb(a,b,c){if(b){if(Jb[a])return this.__shady_native_removeEventListener(a,b,c);if(c&&"object"===typeof c){var d=!!c.capture;var e=!!c.once;var f=!!c.passive}else d=!!c,f=e=!1;var g=c&&c.$||this,h=void 0;var k=null;try{k=b[Gb]}catch(l){}k&&(e=Tb(k,g,a,d,e,f),-1<e&&(h=k.splice(e,1)[0].Ya,k.length||(b[Gb]=void 0)));this.__shady_native_removeEventListener(a,h||b,c);h&&Pb[a]&&this.__handlers&&this.__handlers[a]&&(a=this.__handlers[a][d?"capture":"bubble"],h=a.indexOf(h),-1<h&&a.splice(h,1))}}
function Xb(){for(var a in Pb)window.__shady_native_addEventListener(a,function(a){a.__target||(Vb(a),Sb(a))},!0)}
var Yb=B({get composed(){void 0===this.__composed&&(Hb?this.__composed="focusin"===this.type||"focusout"===this.type||Hb(this):!1!==this.isTrusted&&(this.__composed=Ib[this.type]));return this.__composed||!1},composedPath:function(){this.__composedPath||(this.__composedPath=Lb(this.__target,this.composed));return this.__composedPath},get target(){return Nb(this.currentTarget||this.__previousCurrentTarget,this.composedPath())},get relatedTarget(){if(!this.__relatedTarget)return null;this.__relatedTargetComposedPath||
(this.__relatedTargetComposedPath=Lb(this.__relatedTarget,!0));return Nb(this.currentTarget||this.__previousCurrentTarget,this.__relatedTargetComposedPath)},stopPropagation:function(){Event.prototype.stopPropagation.call(this);this.Z=!0},stopImmediatePropagation:function(){Event.prototype.stopImmediatePropagation.call(this);this.Z=this.__immediatePropagationStopped=!0}});
function Vb(a){a.__target=a.target;a.__relatedTarget=a.relatedTarget;if(w.m){var b=Object.getPrototypeOf(a);if(!Object.hasOwnProperty(b,"__shady_patchedProto")){var c=Object.create(b);c.__shady_sourceProto=b;A(c,Yb);b.__shady_patchedProto=c}a.__proto__=b.__shady_patchedProto}else A(a,Yb)}var Zb=Ob(Event),$b=Ob(CustomEvent),ac=Ob(MouseEvent);
function bc(){if(!Hb&&Object.getOwnPropertyDescriptor(Event.prototype,"isTrusted")){var a=function(){var a=new MouseEvent("click",{bubbles:!0,cancelable:!0,composed:!0});this.__shady_dispatchEvent(a)};Element.prototype.click?Element.prototype.click=a:HTMLElement.prototype.click&&(HTMLElement.prototype.click=a)}}var cc=Object.getOwnPropertyNames(Document.prototype).filter(function(a){return"on"===a.substring(0,2)});function dc(a,b){return{index:a,L:[],R:b}}
function ec(a,b,c,d){var e=0,f=0,g=0,h=0,k=Math.min(b-e,d-f);if(0==e&&0==f)a:{for(g=0;g<k;g++)if(a[g]!==c[g])break a;g=k}if(b==a.length&&d==c.length){h=a.length;for(var l=c.length,m=0;m<k-g&&fc(a[--h],c[--l]);)m++;h=m}e+=g;f+=g;b-=h;d-=h;if(0==b-e&&0==d-f)return[];if(e==b){for(b=dc(e,0);f<d;)b.L.push(c[f++]);return[b]}if(f==d)return[dc(e,b-e)];k=e;g=f;d=d-g+1;h=b-k+1;b=Array(d);for(l=0;l<d;l++)b[l]=Array(h),b[l][0]=l;for(l=0;l<h;l++)b[0][l]=l;for(l=1;l<d;l++)for(m=1;m<h;m++)if(a[k+m-1]===c[g+l-1])b[l][m]=
b[l-1][m-1];else{var q=b[l-1][m]+1,x=b[l][m-1]+1;b[l][m]=q<x?q:x}k=b.length-1;g=b[0].length-1;d=b[k][g];for(a=[];0<k||0<g;)0==k?(a.push(2),g--):0==g?(a.push(3),k--):(h=b[k-1][g-1],l=b[k-1][g],m=b[k][g-1],q=l<m?l<h?l:h:m<h?m:h,q==h?(h==d?a.push(0):(a.push(1),d=h),k--,g--):q==l?(a.push(3),k--,d=l):(a.push(2),g--,d=m));a.reverse();b=void 0;k=[];for(g=0;g<a.length;g++)switch(a[g]){case 0:b&&(k.push(b),b=void 0);e++;f++;break;case 1:b||(b=dc(e,0));b.R++;e++;b.L.push(c[f]);f++;break;case 2:b||(b=dc(e,0));
b.R++;e++;break;case 3:b||(b=dc(e,0)),b.L.push(c[f]),f++}b&&k.push(b);return k}function fc(a,b){return a===b};function gc(a,b,c){Eb(a);c=c||null;var d=u(a),e=u(b),f=c?u(c):null;d.previousSibling=c?f.previousSibling:b.__shady_lastChild;if(f=v(d.previousSibling))f.nextSibling=a;if(f=v(d.nextSibling=c))f.previousSibling=a;d.parentNode=b;c?c===e.firstChild&&(e.firstChild=a):(e.lastChild=a,e.firstChild||(e.firstChild=a));e.childNodes=null}
function hc(a,b,c){Fb(b);var d=u(b);void 0!==d.firstChild&&(d.childNodes=null);if(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE){d=a.__shady_childNodes;for(var e=0;e<d.length;e++)gc(d[e],b,c);a=u(a);b=void 0!==a.firstChild?null:void 0;a.firstChild=a.lastChild=b;a.childNodes=b}else gc(a,b,c)}
function ic(a,b){var c=u(a);b=u(b);a===b.firstChild&&(b.firstChild=c.nextSibling);a===b.lastChild&&(b.lastChild=c.previousSibling);a=c.previousSibling;var d=c.nextSibling;a&&(u(a).nextSibling=d);d&&(u(d).previousSibling=a);c.parentNode=c.previousSibling=c.nextSibling=void 0;void 0!==b.childNodes&&(b.childNodes=null)}
function jc(a){var b=u(a);if(void 0===b.firstChild){b.childNodes=null;var c=b.firstChild=a.__shady_native_firstChild||null;b.lastChild=a.__shady_native_lastChild||null;Fb(a);b=c;for(c=void 0;b;b=b.__shady_native_nextSibling){var d=u(b);d.parentNode=a;d.nextSibling=b.__shady_native_nextSibling||null;d.previousSibling=c||null;c=b;Eb(b)}}};var kc=null;function G(){kc||(kc=window.ShadyCSS&&window.ShadyCSS.ScopingShim);return kc||null}function lc(a,b){var c=G();c&&c.unscopeNode(a,b)}function mc(a,b){var c=G();if(!c)return!0;if(a.nodeType===Node.DOCUMENT_FRAGMENT_NODE){c=!0;a=a.__shady_childNodes;for(var d=0;c&&d<a.length;d++)c=c&&mc(a[d],b);return c}return a.nodeType!==Node.ELEMENT_NODE?!0:c.currentScopeForNode(a)===b}function nc(a){if(a.nodeType!==Node.ELEMENT_NODE)return"";var b=G();return b?b.currentScopeForNode(a):""}
function oc(a,b){if(a){a.nodeType===Node.ELEMENT_NODE&&b(a);a=a.__shady_childNodes;for(var c=0,d;c<a.length;c++)d=a[c],d.nodeType===Node.ELEMENT_NODE&&oc(d,b)}};var pc=window.document,qc=w.oa,rc=Object.getOwnPropertyDescriptor(Node.prototype,"isConnected"),sc=rc&&rc.get;function tc(a){for(var b;b=a.__shady_firstChild;)a.__shady_removeChild(b)}function uc(a){var b=v(a);if(b&&void 0!==b.K){b=a.__shady_childNodes;for(var c=0,d=b.length,e=void 0;c<d&&(e=b[c]);c++)uc(e)}if(a=v(a))a.K=void 0}function vc(a){var b=a;a&&"slot"===a.localName&&(b=(b=(b=v(a))&&b.D)&&b.length?b[0]:vc(a.__shady_nextSibling));return b}
function wc(a,b,c){if(a=(a=v(a))&&a.H)b&&a.addedNodes.push(b),c&&a.removedNodes.push(c),ab(a)}
var Cc=B({get parentNode(){var a=v(this);a=a&&a.parentNode;return void 0!==a?a:this.__shady_native_parentNode},get firstChild(){var a=v(this);a=a&&a.firstChild;return void 0!==a?a:this.__shady_native_firstChild},get lastChild(){var a=v(this);a=a&&a.lastChild;return void 0!==a?a:this.__shady_native_lastChild},get nextSibling(){var a=v(this);a=a&&a.nextSibling;return void 0!==a?a:this.__shady_native_nextSibling},get previousSibling(){var a=v(this);a=a&&a.previousSibling;return void 0!==a?a:this.__shady_native_previousSibling},
get childNodes(){if(y(this)){var a=v(this);if(!a.childNodes){a.childNodes=[];for(var b=this.__shady_firstChild;b;b=b.__shady_nextSibling)a.childNodes.push(b)}var c=a.childNodes}else c=this.__shady_native_childNodes;c.item=function(a){return c[a]};return c},get parentElement(){var a=v(this);(a=a&&a.parentNode)&&a.nodeType!==Node.ELEMENT_NODE&&(a=null);return void 0!==a?a:this.__shady_native_parentElement},get isConnected(){if(sc&&sc.call(this))return!0;if(this.nodeType==Node.DOCUMENT_FRAGMENT_NODE)return!1;
var a=this.ownerDocument;if(Ta){if(a.__shady_native_contains(this))return!0}else if(a.documentElement&&a.documentElement.__shady_native_contains(this))return!0;for(a=this;a&&!(a instanceof Document);)a=a.__shady_parentNode||(z(a)?a.host:void 0);return!!(a&&a instanceof Document)},get textContent(){if(y(this)){for(var a=[],b=0,c=this.__shady_childNodes,d;d=c[b];b++)d.nodeType!==Node.COMMENT_NODE&&a.push(d.__shady_textContent);return a.join("")}return this.__shady_native_textContent},set textContent(a){if("undefined"===
typeof a||null===a)a="";switch(this.nodeType){case Node.ELEMENT_NODE:case Node.DOCUMENT_FRAGMENT_NODE:if(!y(this)&&w.m){var b=this.__shady_firstChild;(b!=this.__shady_lastChild||b&&b.nodeType!=Node.TEXT_NODE)&&tc(this);this.__shady_native_textContent=a}else tc(this),(0<a.length||this.nodeType===Node.ELEMENT_NODE)&&this.__shady_insertBefore(document.createTextNode(a));break;default:this.nodeValue=a}},insertBefore:function(a,b){if(this.ownerDocument!==pc&&a.ownerDocument!==pc)return this.__shady_native_insertBefore(a,
b),a;if(a===this)throw Error("Failed to execute 'appendChild' on 'Node': The new child element contains the parent.");if(b){var c=v(b);c=c&&c.parentNode;if(void 0!==c&&c!==this||void 0===c&&b.__shady_native_parentNode!==this)throw Error("Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.");}if(b===a)return a;var d=[],e=(c=xc(this))?c.host.localName:nc(this),f=a.__shady_parentNode;if(f){var g=nc(a);f.__shady_removeChild(a,!!c||
!xc(a))}f=!0;var h=(!qc||void 0===a.__noInsertionPoint)&&!mc(a,e),k=c&&!a.__noInsertionPoint&&(!qc||a.nodeType===Node.DOCUMENT_FRAGMENT_NODE);if(k||h)h&&(g=g||nc(a)),oc(a,function(a){k&&"slot"===a.localName&&d.push(a);if(h){var b=g;G()&&(b&&lc(a,b),(b=G())&&b.scopeNode(a,e))}});if("slot"===this.localName||d.length)d.length&&(c.c=c.c||[],c.a=c.a||[],c.b=c.b||{},c.c.push.apply(c.c,d instanceof Array?d:ja(ia(d)))),c&&Ac(c);y(this)&&(hc(a,this,b),c=v(this),La(this)?(Ac(c.root),f=!1):c.root&&(f=!1));f?
(c=z(this)?this.host:this,b?(b=vc(b),c.__shady_native_insertBefore(a,b)):c.__shady_native_appendChild(a)):a.ownerDocument!==this.ownerDocument&&this.ownerDocument.adoptNode(a);wc(this,a);return a},appendChild:function(a){return this.__shady_insertBefore(a)},removeChild:function(a,b){b=void 0===b?!1:b;if(this.ownerDocument!==pc)return this.__shady_native_removeChild(a);if(a.__shady_parentNode!==this)throw Error("The node to be removed is not a child of this node: "+a);var c=xc(a),d=c&&Bc(c,a),e=v(this);
if(y(this)&&(ic(a,this),La(this))){Ac(e.root);var f=!0}if(G()&&!b&&c){var g=nc(a);oc(a,function(a){lc(a,g)})}uc(a);c&&((b=this&&"slot"===this.localName)&&(f=!0),(d||b)&&Ac(c));f||(f=z(this)?this.host:this,(!e.root&&"slot"!==a.localName||f===a.__shady_native_parentNode)&&f.__shady_native_removeChild(a));wc(this,null,a);return a},replaceChild:function(a,b){this.__shady_insertBefore(a,b);this.__shady_removeChild(b);return a},cloneNode:function(a){if("template"==this.localName)return this.__shady_native_cloneNode(a);
var b=this.__shady_native_cloneNode(!1);if(a&&b.nodeType!==Node.ATTRIBUTE_NODE){a=this.__shady_childNodes;for(var c=0,d;c<a.length;c++)d=a[c].__shady_cloneNode(!0),b.__shady_appendChild(d)}return b},getRootNode:function(a){if(this&&this.nodeType){var b=u(this),c=b.K;void 0===c&&(z(this)?(c=this,b.K=c):(c=(c=this.__shady_parentNode)?c.__shady_getRootNode(a):this,document.documentElement.__shady_native_contains(this)&&(b.K=c)));return c}},contains:function(a){return Ua(this,a)}});function Dc(a,b,c){var d=[];Ec(a.__shady_childNodes,b,c,d);return d}function Ec(a,b,c,d){for(var e=0,f=a.length,g=void 0;e<f&&(g=a[e]);e++){var h;if(h=g.nodeType===Node.ELEMENT_NODE){h=g;var k=b,l=c,m=d,q=k(h);q&&m.push(h);l&&l(q)?h=q:(Ec(h.__shady_childNodes,k,l,m),h=void 0)}if(h)break}}
var Fc=B({get firstElementChild(){var a=v(this);if(a&&void 0!==a.firstChild){for(a=this.__shady_firstChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_nextSibling;return a}return this.__shady_native_firstElementChild},get lastElementChild(){var a=v(this);if(a&&void 0!==a.lastChild){for(a=this.__shady_lastChild;a&&a.nodeType!==Node.ELEMENT_NODE;)a=a.__shady_previousSibling;return a}return this.__shady_native_lastElementChild},get children(){return y(this)?Va(Array.prototype.filter.call(this.__shady_childNodes,
function(a){return a.nodeType===Node.ELEMENT_NODE})):this.__shady_native_children},get childElementCount(){var a=this.__shady_children;return a?a.length:0}}),Gc=B({querySelector:function(a){return Dc(this,function(b){return Oa.call(b,a)},function(a){return!!a})[0]||null},querySelectorAll:function(a,b){if(b){b=Array.prototype.slice.call(this.__shady_native_querySelectorAll(a));var c=this.__shady_getRootNode();return b.filter(function(a){return a.__shady_getRootNode()==c})}return Dc(this,function(b){return Oa.call(b,
a)})}}),Hc=w.oa?Object.assign({},Fc):Fc;Object.assign(Fc,Gc);var Ic=B({getElementById:function(a){return""===a?null:Dc(this,function(b){return b.id==a},function(a){return!!a})[0]||null}});var Jc=B({get activeElement(){var a=w.m?document.__shady_native_activeElement:document.activeElement;if(!a||!a.nodeType)return null;var b=!!z(this);if(!(this===document||b&&this.host!==a&&this.host.__shady_native_contains(a)))return null;for(b=xc(a);b&&b!==this;)a=b.host,b=xc(a);retur