quran-madina-html 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- /*! quran-madina-html 23-06-2026 */
2
- !function(){var E="quran-madina-html",n=/localhost/.test(document.location.hostname)?"../":`https://www.unpkg.com/${E}/`;function T(t,e="class",n="lightgrey",r="transparent"){var i="tag"===e.toLowerCase()?document.getElementsByTagName(t):document.getElementsByClassName(t);Array.from(i).forEach(function(t){t.onmouseover=function(){Array.from(i).forEach(function(t){t.style.backgroundColor=n})},t.onmouseout=function(){Array.from(i).forEach(function(t){t.style.backgroundColor=r})}})}var m=/[﴿﴾۝]/;function L(t,e,n,r,i){for(var o=k.suras[t].ayas,a=[],s=r+i;0<=s&&s<o.length&&o[s].p==e;s+=i){var c=function(t,e){for(var n=0;n<t.r.length;n++)if(t.r[n].l===e)return t.r[n];return null}(o[s],n);if(null===c)break;if(i<0){if(a.unshift(c),0===c.o)break}else a.push(c)}return a}function C(t,e){for(var n=0;n<e.length;n++){var r=document.createElement("div");r.textContent=e[n].t,r.style.cssText="display:inline;visibility:hidden",t.appendChild(r)}}function s(t,e,n){for(var r=[],i=null,o=0,a=t;a<k.suras.length;a++){for(var s=k.suras[a].ayas,c=!1,l=a===t?e:0;l<s.length;l++){for(var u=2<=l,d=s[l],h=0;h<d.r.length;h++){var p=d.r[h],f=d.p+":"+p.l;i&&i.key===f||(i={key:f,offset:p.o,stretch:p.s,parts:[]},r.push(i)),i.parts.push({sura:a,ayaIdx:l,part:p,countable:u})}if(u&&(o+=function(t){var e=0;return t.r.forEach(function(t){t.t.split(/\s+/).forEach(function(t){""===t||m.test(t)||(e+=1)})}),e}(d))>=n[1]){c=!0;break}}if(c)break}return r}function M(r,t,e,c,n){var i,o=s(t,e,c),a=1<o.length,l=0;r.innerHTML="",r.removeAttribute("style"),a&&(r.style="display:block;",r.style.setProperty("font-family",k.font_family,""),r.style.setProperty("font-size",k.font_size+"px",""),"me_quran"===k.font_family&&r.style.setProperty("line-height",2*k.font_size+"px",""),r.style.width=k.line_width+10+"px",e=k.suras[t].ayas[e].p,r.style.setProperty("box-shadow","inset "+(e%2==1?"":"-")+"8px 0 7px -7px #333",""),n||((e=document.createElement("quran-madina-html-header")).innerHTML=k.suras[t].name,(t=S()).addEventListener("click",I),(i=O()).addEventListener("click",x),e.appendChild(t),e.appendChild(i),r.appendChild(e))),o.forEach(function(t,e){var n,s=document.createElement("quran-madina-html-line");a?(s.style.setProperty("display","block",""),0<=t.stretch?s.style.setProperty("transform",`scaleX(${t.stretch})`,""):s.style.setProperty("text-align","center",""),0<t.offset&&0===e?(n=t.parts[0],C(s,L(n.sura,k.suras[n.sura].ayas[n.ayaIdx].p,n.part.l,n.ayaIdx,-1))):0<t.offset&&(s.style.setProperty("padding-right",t.offset+"px",""),s.style.setProperty("transform-origin","left"))):(s.style.setProperty("font-family",k.font_family,""),s.style.setProperty("font-size",k.font_size+"px","")),r.appendChild(s),t.parts.forEach(function(t){var n,e,r,i,o=document.createElement("div"),a=P(t.sura+1,t.ayaIdx-1);DOMTokenList.prototype.add.apply(o.classList,a),t.countable?(n=o,e=t.part.t,r=c,i=l,e.split(/(\s+)/).forEach(function(t){var e;""!==t&&(/^\s+$/.test(t)?n.appendChild(document.createTextNode(t)):((e=document.createElement("span")).textContent=t,e.classList.add(E+"-word"),(m.test(t)||(i+=1)<r[0]||i>r[1])&&e.classList.add(E+"-word-hidden"),n.appendChild(e)))}),l=i):o.textContent=t.part.t,o.style.cssText="display:inline",s.appendChild(o),T(a.slice(-1)[0])}),a&&e===o.length-1&&(n=t.parts[t.parts.length-1],C(s,L(n.sura,k.suras[n.sura].ayas[n.ayaIdx].p,n.part.l,n.ayaIdx,1)))}),a||n||(t=document.createElement("quran-madina-html-copy"),(i=S()).addEventListener("click",I),t.appendChild(i),r.appendChild(t))}function P(t,e){var n=(t,e)=>String(t).padStart(e,"0"),t=[E+"-part",`${E}-${n(t,3)}-`+n(e,3)];return-1==e&&t.push("quran-madina-html-sura-start"),t}function S(){var t=document.createElement("div");return t.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),t.firstChild}function O(){var t=document.createElement("div");return t.innerHTML='<svg class="quran-madina-html-icon" viewBox="0 0 820 615" style="height:20px"><path d="M70 1.9C37.6 8.8 12.6 33.4 3.4 67.5c-1.8 6.6-1.9 11.9-1.9 98v91l2.3 8c5.1 17.8 17 36.4 29.9 46.7 10.8 8.6 25.4 15.4 38.1 17.8 3.1.6 15.2 1 26.8 1 17.7 0 21.3.2 21.7 1.4.4.9.6 17.1.7 36.1 0 32.4.2 34.9 2 38.5 6.4 12.5 21.4 17.4 33.3 10.8 2.3-1.3 7.5-6.4 12.1-11.9l63-74.1c.6-.4 16.3-.8 34.9-.8H300l-.2-18.3-.3-18.2-42.8.1-43.1.5c-.2.2-12.7 15.1-27.9 33.1-15.1 18-27.8 32.4-28.1 32.1-.3-.4-.6-15.3-.6-33.2v-32.6l-38.8-.1c-42.1-.2-43.9-.4-54.3-6-6.5-3.6-16.9-14.6-20.2-21.5-5.8-11.9-5.7-10-5.7-100.7 0-92-.2-89.4 6.3-101.7 3.9-7.3 13.5-17.1 20.3-20.7C76 36.7 66.1 37 244.5 37L412 38.1c18 4.1 33.5 20.5 37.5 39.6 2.2 10.2 2.1 164.6 0 174.8-3.9 18.3-16.4 32.7-33.5 38.5-3.2 1.1-7.8 2-10 2-3.1 0-4 .4-4 1.7 0 1-.2 8.8-.3 17.3-.2 8.5-.2 16.2 0 17 .9 3.3 21.7-.5 34.1-6 13.7-6.3 27.5-17.9 36.2-30.5 5-7.2 10.8-20.4 13.2-30.1l2.3-8.9V165 76.5l-2.3-9c-8.1-31.4-30.5-54.9-61.7-64.8l-7-2.2-169-.2C87.7.1 78 .2 70 1.9zm277.294 102.559q19.5-.5 28.25 24.5 2.5 7.25-3.75 19.75-5.75 11.75-9.75 16-19.5 21.5-67 25.25-27.75 2.25-50.25-2.25-5.25 38.25-16.5 50-26 26.75-66 29.5-27.75 2-42.5-11-20.25-17.75-16.5-48.5 3-23.75 14.25-42.5 2.75-4.5 4.75-7.5 2-3 3-4.25 2.25-2.75 4.75-1.25 2.75 1.5 0 6.25-12.75 24.5-10 45 4 30.5 44.5 30.5 30.25 0 53.25-15.5 12.5-8.25 14.75-14.25-2.25-20.75-13.75-35.75-3.5-4.25-1.75-8l9.5-23.5q3-7.5 8.25 1.25l8.75 14.75q7.75 4.25 28.25 5 16.75-19.25 39.25-36.25 22.5-16.75 36.25-17.25zm11.5 40.5q-12.5-9.5-31.75-5.75-19 3.75-41.25 19.5 50.75.5 73-13.75zm-71.5-89.75q1.5-2 4.25-1.25 5 1.75 9.5 4.5 4.75 2.75 8.75 6.25 2 2 .75 4.5l-12 19q-1.75 2.5-4.5.5-2.5-2-18-11.25-2.75-1.75-1-4.25zm278.784 232.623c-4.7.4-4.7.4-6.7 6.1-1.2 3.1-9.3 25.9-18 50.7l-36.6 102.7-3.5 9.8h17.9 17.8l5.7-17 5.7-17h31.7 31.8l5.6 17.2 5.6 17.3 17.9-.3 18-.3-6-17.2-15-43.2-13.3-38.5-14.1-41-9.9-28.7c-.3-.6-30.2-1.1-34.6-.6zm35.7 106c-.2.2-10 .2-21.9.1l-21.5-.3 9.8-29.5 11-32.5c1.2-2.9 1.8-1.4 12.1 29.4l10.5 32.8zm148.8 139.609c32.4-6.9 57.4-31.5 66.6-65.6 1.8-6.6 1.9-11.9 1.9-98v-91l-2.3-8c-5.1-17.8-17-36.4-29.9-46.7-10.8-8.6-25.4-15.4-38.1-17.8-3.1-.6-15.2-1-26.8-1-17.7 0-21.3-.2-21.7-1.4-.4-.9-.6-17.1-.7-36.1 0-32.4-.2-34.9-2-38.5-6.4-12.5-21.4-17.4-33.3-10.8-2.3 1.3-7.5 6.4-12.1 11.9l-63 74.1c-.6.4-16.3.8-34.9.8h-33.7l.2 18.3.3 18.2 42.8-.1 43.1-.5c.2-.2 12.7-15.1 27.9-33.1 15.1-18 27.8-32.4 28.1-32.1.3.4.6 15.3.6 33.2v32.6l38.8.1c42.1.2 43.9.4 54.3 6 6.5 3.6 16.9 14.6 20.2 21.5 5.8 11.9 5.7 10 5.7 100.7 0 92 .2 89.4-6.3 101.7-3.9 7.3-13.5 17.1-20.3 20.7-11.4 6.1-1.5 5.8-179.9 5.8-108.2 0-164.5-.4-167.5-1.1-18-4.1-33.5-20.5-37.5-39.6-2.2-10.2-2.1-164.6 0-174.8 3.9-18.3 16.4-32.7 33.5-38.5 3.2-1.1 7.8-2 10-2 3.1 0 4-.4 4-1.7 0-1 .2-8.8.3-17.3.2-8.5.2-16.2 0-17-.9-3.3-21.7.5-34.1 6-13.7 6.3-27.5 17.9-36.2 30.5-5 7.2-10.8 20.4-13.2 30.1l-2.3 8.9v88.5 88.5l2.3 9c8.1 31.4 30.5 54.9 61.7 64.8l7 2.2 169 .2 177.5-1.6z"/></svg>'.trim(),t.firstChild}function N(t){console.log(E+"> "+t)}function I(){var t;textWithHeader=this.parentElement.parentElement.innerText.split("\n"),text=1<textWithHeader.length?textWithHeader.slice(1).join(" ")+"\n\n"+textWithHeader[0]:(t=this.parentElement.parentElement.getAttribute("sura"),textWithHeader[0]+"\n\n"+k.suras[t-1].name),navigator.clipboard.writeText(text),alert("⎘ تم نسخ:\n\n"+text)}function x(){var t=this.parentElement.parentElement;URL=null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")?`https://quran.com/${t.getAttribute("sura")}/`+t.getAttribute("aya"):"https://quran.com/page/"+t.getAttribute("page"),window.open(URL,"_blank")}var t,e,r,i,o,k={content:"Loading .."},a=document.currentScript||document.querySelector(`script[src*="${E}"]`),c=a.getAttribute("data-name")||"Madina05",l=(a.getAttribute("data-font")||"me_quran").replaceAll(" ","_"),u=a.getAttribute("data-font-size")||16,a=a.getAttribute("data-cdn"),a=(a&&(n=a.replace(/\/?$/,"/")),N(c+` with font: ${l} size: `+u),n+"dist/"+E+".min.css?v=1.1");document.getElementById(E)||(t=document.getElementsByTagName("head")[0],(e=document.createElement("link")).id=E,e.rel="stylesheet",e.type="text/css",e.href=a,e.media="all",t.appendChild(e)),a=n+`assets/db/${c}-${l}-${u}px.json`,r=function(t){k=t;const e=new FontFace(k.font_family,"url("+encodeURI(null==(t=k.font_url)||/^(https?:)?\/\//.test(t)?t:n+String(t).replace(/^\//,""))+")");e.load().then(()=>{document.fonts.add(e)}),xtag.register(E,{lifecycle:{created:function(){this.render(this)},inserted:function(){},removed:function(){},attributeChanged:function(){this.render(this)}},events:{},accessors:{page:{attribute:{},set:function(t){this.xtag.data.page=t},get:function(){return this.getAttribute("page")}},page_param:{attribute:{},set:function(t){this.xtag.data.page_param=t},get:function(){return this.getAttribute("page_param")}},aya:{attribute:{},set:function(t){this.xtag.data.aya=t},get:function(){return this.getAttribute("aya")}},sura:{attribute:{},set:function(t){this.xtag.data.sura=t},get:function(){return this.getAttribute("sura")}},words:{attribute:{},set:function(t){this.xtag.data.words=t},get:function(){return this.getAttribute("words")}},headless:{attribute:{},set:function(t){this.xtag.data.headless=t},get:function(){return this.getAttribute("headless")}}},methods:{render:function(t){if(!this.xtag.data.rendering){this.xtag.data.rendering=!0;try{this.doRender(t)}finally{this.xtag.data.rendering=!1}}},doRender:function(e){var n,r,i,o,a,s,c,t,l=null,u=this.page,d=null!=(d=this.headless)&&(""===(d=String(d).trim().toLowerCase())||"true"===d||"1"===d||"yes"===d),h=null!=this.sura&&null!=this.aya;if(h)t=this.sura,r=n=Array(2).fill(t.split("-")[0]-1)[0],i=!1,[o,a]=2==(t=this.aya).split("-").length?t.split("-").map(t=>parseInt(t)+1):Array(2).fill(parseInt(t.split("-")[0])+1),null!=this.page&&N("Ignoring page parameter!"),u=k.suras[n].ayas[o].p;else{if(null==this.page)return console.error(E+"> Bad arguments: Not rendering!"),1;for(a=o=r=n=0;k.suras[n].ayas.slice(-1)[0].p<u;)n+=1;for(r=n;r<114&&k.suras[r].ayas[0].p<=u;)r+=1;for(r-=1;k.suras[n].ayas[o].p<u;)o+=1;for(a=k.suras[r].ayas.length-1;k.suras[r].ayas[a].p>u;)a-=1;i=!0}if(null!=this.words)if(h){if(null!=(l=null==(t=this.words)||2!=(t=1==(t=t.split(/[-:]/).map(t=>parseInt(t,10))).length?[t[0],t[0]]:t).length||isNaN(t[0])||isNaN(t[1])?null:t))return void M(e,n,o,l,d);N("Bad words parameter: "+this.words)}else N("Ignoring words parameter with page!");e.innerHTML="",e.removeAttribute("style"),(s=k.suras[n].ayas[o].r[0].l)!=(c=k.suras[r].ayas[a].r.slice(-1)[0].l)&&(i=!0,e.style="display:block;"),i&&(e.style.setProperty("font-family",k.font_family,""),e.style.setProperty("font-size",k.font_size+"px",""),"me_quran"===k.font_family)&&e.style.setProperty("line-height",2*k.font_size+"px","");var p,f,l="",m=(i&&!d&&((l=document.createElement("quran-madina-html-header")).innerHTML=k.suras[n].name,(f=S()).addEventListener("click",I),(p=O()).addEventListener("click",x),l.appendChild(f),l.appendChild(p),e.appendChild(l)),o),v=n;for(let t=s;t<=c;t++){const _=t;line=document.createElement("quran-madina-html-line"),e.appendChild(line),i||(line.style.setProperty("font-family",k.font_family,""),line.style.setProperty("font-size",k.font_size+"px","")),i&&(e.style.width=k.line_width+10+"px",y=k.suras[v].ayas[m].p%2==1?"":"-",e.style.setProperty("box-shadow","inset "+y+"8px 0 7px -7px #333",""),line.style.setProperty("display","block","")),i&&h&&t===s&&C(line,L(n,u,s,o,-1));var y,g,b,w=n==r?a:k.suras[v].ayas.length-1;for(let t=m;t<=Math.min(m+5,w);t++)k.suras[v].ayas[t].p==u&&(line_match=k.suras[v].ayas[t].r.filter(t=>t.l==_)).length&&(i&&(""==line.innerHTML.trim()&&(g=line_match[0].o,line.style.setProperty("padding-right",g+"px",""),0<g)&&line.style.setProperty("transform-origin","left"),0<=line_match[0].s?line.style.setProperty("transform",`scaleX(${line_match[0].s})`,""):line.style.setProperty("text-align","center","")),g=document.createElement("div"),b=P(v+1,t-1),DOMTokenList.prototype.add.apply(g.classList,b),g.textContent=line_match[0].t,g.style.cssText="display:inline",line.appendChild(g),T(b.slice(-1)[0]),w<=(m=t))&&v<113&&k.suras[v+1].ayas[0].p==u&&k.suras[v+1].ayas[0].r[0].l==_+1&&(v+=1,m=0);i&&h&&t===c&&C(line,L(r,u,c,a,1))}i||d||(l=document.createElement("quran-madina-html-copy"),(f=S()).addEventListener("click",I),l.appendChild(f),e.appendChild(l))}}})},i=function(t){console.error(t)},(o=new XMLHttpRequest).onreadystatechange=function(){o.readyState===XMLHttpRequest.DONE&&(200===o.status?r&&r(JSON.parse(o.responseText)):i&&i(o))},o.open("GET",a,!0),o.send()}(),function(){function t(t){if((this._element=t).className!=this._classCache&&(this._classCache=t.className,this._classCache))for(var e=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;e.length>n;n++)i.call(this,e[n])}function e(t,e){t.className=e.join(" ")}var n,r,i,o,a,s,c,l;void 0===window.Element||"classList"in document.documentElement||(s=Array.prototype,n=s.indexOf,r=s.slice,i=s.push,o=s.splice,a=s.join,t.prototype={add:function(t){this.contains(t)||(i.call(this,t),e(this._element,r.call(this,0)))},contains:function(t){return-1!==n.call(this,t)},item:function(t){return this[t]||null},remove:function(t){t=n.call(this,t);-1!==t&&(o.call(this,t,1),e(this._element,r.call(this,0)))},toString:function(){return a.call(this," ")},toggle:function(t){-1===n.call(this,t)?this.add(t):this.remove(t)}},window.DOMTokenList=t,s=Element.prototype,c="classList",l=function(){return new t(this)},Object.defineProperty?Object.defineProperty(s,c,{get:l}):s.__defineGetter__(c,l))}(),function(){window.WebComponents=window.WebComponents||{flags:{}};var t,e=document.querySelector('script[src*="webcomponents-lite.js"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(t){var e,t=t.split("=");t[0]&&(e=t[0].match(/wc-(.+)/))&&(n[e[1]]=t[1]||!0)}),e)for(var r,i=0;r=e.attributes[i];i++)"src"!==r.name&&(n[r.name]=r.value||!0);n.log&&n.log.split?(t=n.log.split(","),n.log={},t.forEach(function(t){n.log[t]=!0})):n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(t){"use strict";function y(t){return void 0!==_[t]}function g(){r.call(this),this._isInvalid=!0}function b(t){return""==t&&g.call(this),t.toLowerCase()}function w(t){var e=t.charCodeAt(0);return 32<e&&e<127&&-1==[34,35,60,62,63,96].indexOf(e)?t:encodeURIComponent(t)}function n(t,e,n){function r(t){d.push(t)}var i,o,a=e||"scheme start",s=0,c="",l=!1,u=!1,d=[];t:for(;(t[s-1]!=T||0==s)&&!this._isInvalid;){var h=t[s];switch(a){case"scheme start":if(!h||!L.test(h)){if(e){r("Invalid scheme.");break t}c="",a="no scheme";continue}c+=h.toLowerCase(),a="scheme";break;case"scheme":if(h&&C.test(h))c+=h.toLowerCase();else{if(":"!=h){if(e){if(T==h)break t;r("Code point not allowed in scheme: "+h);break t}c="",s=0,a="no scheme";continue}if(this._scheme=c,c="",e)break t;y(this._scheme)&&(this._isRelative=!0),a="file"==this._scheme?"relative":this._isRelative&&n&&n._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==h?(this._query="?",a="query"):"#"==h?(this._fragment="#",a="fragment"):T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._schemeData+=w(h));break;case"no scheme":if(n&&y(n._scheme)){a="relative";continue}r("Missing scheme."),g.call(this);break;case"relative or authority":if("/"!=h||"/"!=t[s+1]){r("Expected /, got: "+h),a="relative";continue}a="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=n._scheme),T==h){this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._username=n._username,this._password=n._password;break t}if("/"==h||"\\"==h)"\\"==h&&r("\\ is an invalid code point."),a="relative slash";else if("?"==h)this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query="?",this._username=n._username,this._password=n._password,a="query";else{if("#"!=h){var p=t[s+1],f=t[s+2];("file"!=this._scheme||!L.test(h)||":"!=p&&"|"!=p||T!=f&&"/"!=f&&"\\"!=f&&"?"!=f&&"#"!=f)&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password,this._path=n._path.slice(),this._path.pop()),a="relative path";continue}this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._fragment="#",this._username=n._username,this._password=n._password,a="fragment"}break;case"relative slash":if("/"!=h&&"\\"!=h){"file"!=this._scheme&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password),a="relative path";continue}"\\"==h&&r("\\ is an invalid code point."),a="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=h){r("Expected '/', got: "+h),a="authority ignore slashes";continue}a="authority second slash";break;case"authority second slash":if(a="authority ignore slashes","/"==h)break;r("Expected '/', got: "+h);continue;case"authority ignore slashes":if("/"!=h&&"\\"!=h){a="authority";continue}r("Expected authority, got: "+h);break;case"authority":if("@"==h){l&&(r("@ already seen."),c+="%40");for(var l=!0,m=0;c.length>m;m++){var v=c[m];"\t"!=v&&"\n"!=v&&"\r"!=v?":"!=v||null!==this._password?(v=w(v),null!==this._password?this._password+=v:this._username+=v):this._password="":r("Invalid whitespace in authority.")}c=""}else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){s-=c.length,c="",a="host";continue}c+=h}break;case"file host":if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){a=2!=c.length||!L.test(c[0])||":"!=c[1]&&"|"!=c[1]?(0==c.length||(this._host=b.call(this,c),c=""),"relative path start"):"relative path";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid whitespace in file host."):c+=h;break;case"host":case"hostname":if(":"!=h||u){if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){if(this._host=b.call(this,c),c="",a="relative path start",e)break t;continue}"\t"!=h&&"\n"!=h&&"\r"!=h?("["==h?u=!0:"]"==h&&(u=!1),c+=h):r("Invalid code point in host/hostname: "+h)}else if(this._host=b.call(this,c),c="",a="port","hostname"==e)break t;break;case"port":if(/[0-9]/.test(h))c+=h;else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h||e){if(""!=c&&((p=parseInt(c,10))!=_[this._scheme]&&(this._port=p+""),c=""),e)break t;a="relative path start";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid code point in port: "+h):g.call(this)}break;case"relative path start":if("\\"==h&&r("'\\' not allowed in path."),a="relative path","/"!=h&&"\\"!=h)continue;break;case"relative path":T!=h&&"/"!=h&&"\\"!=h&&(e||"?"!=h&&"#"!=h)?"\t"!=h&&"\n"!=h&&"\r"!=h&&(c+=w(h)):("\\"==h&&r("\\ not allowed in relative path."),".."==(c=(f=E[c.toLowerCase()])?f:c)?(this._path.pop(),"/"!=h&&"\\"!=h&&this._path.push("")):"."==c&&"/"!=h&&"\\"!=h?this._path.push(""):"."!=c&&("file"==this._scheme&&0==this._path.length&&2==c.length&&L.test(c[0])&&"|"==c[1]&&(c=c[0]+":"),this._path.push(c)),c="","?"==h?(this._query="?",a="query"):"#"==h&&(this._fragment="#",a="fragment"));break;case"query":e||"#"!=h?T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._query+=(o=void 0,32<(o=(i=h).charCodeAt(0))&&o<127&&-1==[34,35,60,62,96].indexOf(o)?i:encodeURIComponent(i))):(this._fragment="#",a="fragment");break;case"fragment":T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._fragment+=h)}s++}}function r(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function i(t,e){void 0===e||e instanceof i||(e=new i(e+"")),this._url=t,r.call(this);t=t.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");n.call(this,t,null,e)}var _,E,T,L,C,e,o=!1;if(!t.forceJURL)try{var a=new URL("b","http://a");a.pathname="c%20d",o="http://a/c%20d"===a.href}catch(t){}o||((_=Object.create(null)).ftp=21,_.file=0,_.gopher=70,_.http=80,_.https=443,_.ws=80,_.wss=443,(E=Object.create(null))["%2e"]=".",E[".%2e"]="..",E["%2e."]="..",T=void(E["%2e%2e"]=".."),L=/[a-zA-Z]/,C=/[a-zA-Z0-9\+\-\.]/,i.prototype={toString:function(){return this.href},get href(){var t;return this._isInvalid?this._url:((t="")==this._username&&null==this._password||(t=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+t+this.host:"")+this.pathname+this._query+this._fragment)},set href(t){r.call(this),n.call(this,t)},get protocol(){return this._scheme+":"},set protocol(t){this._isInvalid||n.call(this,t+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"host")},get hostname(){return this._host},set hostname(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"hostname")},get port(){return this._port},set port(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(t){!this._isInvalid&&this._isRelative&&(this._path=[],n.call(this,t,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(t){!this._isInvalid&&this._isRelative&&((this._query="?")==t[0]&&(t=t.slice(1)),n.call(this,t,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(t){this._isInvalid||((this._fragment="#")==t[0]&&(t=t.slice(1)),n.call(this,t,"fragment"))},get origin(){var t;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return(t=this.host)?this._scheme+"://"+t:""}},(e=t.URL)&&(i.createObjectURL=function(){return e.createObjectURL.apply(e,arguments)},i.revokeObjectURL=function(t){e.revokeObjectURL(t)}),t.URL=i)}(self),"undefined"==typeof WeakMap&&function(){function t(){this.name="__st"+(1e9*Math.random()>>>0)+e+++"__"}var r=Object.defineProperty,e=Date.now()%1e9;t.prototype={set:function(t,e){var n=t[this.name];return n&&n[0]===t?n[1]=e:r(t,this.name,{value:[t,e],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},delete:function(t){var e=t[this.name];return!(!e||e[0]!==t||(e[0]=e[1]=void 0))},has:function(t){var e=t[this.name];return!!e&&e[0]===t}},window.WeakMap=t}(),function(t){function i(){p=!1;var t=f,r=(f=[],t.sort(function(t,e){return t.uid_-e.uid_}),!1);t.forEach(function(t){var e,n=t.takeRecords();(e=t).nodes_.forEach(function(t){t=s.get(t);t&&t.forEach(function(t){t.observer===e&&t.removeTransientObservers()})}),n.length&&(t.callback_(n,t),r=!0)}),r&&i()}function l(t,e){for(var n=t;n;n=n.parentNode){var r=s.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;(n===t||a.subtree)&&(a=e(a))&&o.enqueue(a)}}}function e(t){this.callback_=t,this.nodes_=[],this.records_=[],this.uid_=++m}function r(t,e){this.type=t,this.target=e,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function u(t,e){return v=new r(t,e)}function d(t){return y||((n=new r((e=v).type,e.target)).addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,(y=n).oldValue=t,y);var e,n}function o(t,e){return t===e?t:y&&((e=t)===y||e===v)?y:null}function a(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}var s,n,c,h,p,f,m,v,y;t.JsMutationObserver||(s=new WeakMap,h=/Trident|Edge/.test(navigator.userAgent)?setTimeout:window.setImmediate||(n=[],c=Math.random()+"",window.addEventListener("message",function(t){t.data===c&&(t=n,n=[],t.forEach(function(t){t()}))}),function(t){n.push(t),window.postMessage(c,"*")}),p=!1,f=[],m=0,e.prototype={observe:function(t,e){if(n=t,t=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(n)||n,!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=s.get(t);r||s.set(t,r=[]);for(var i,o=0;r.length>o;o++)if(r[o].observer===this){(i=r[o]).removeListeners(),i.options=e;break}i||(i=new a(this,t,e),r.push(i),this.nodes_.push(t)),i.addListeners()},disconnect:function(){this.nodes_.forEach(function(t){for(var e=s.get(t),n=0;e.length>n;n++){var r=e[n];if(r.observer===this){r.removeListeners(),e.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var t=this.records_;return this.records_=[],t}},a.prototype={enqueue:function(t){var e=this.observer.records_,n=e.length;if(0<e.length){var r=o(e[n-1],t);if(r)return void(e[n-1]=r)}else r=this.observer,f.push(r),p||(p=!0,h(i));e[n]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){var e;t!==this.target&&(this.addListeners_(t),this.transientObservedNodes.push(t),(e=s.get(t))||s.set(t,e=[]),e.push(this))},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=s.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}},this)},handleEvent:function(t){switch(t.stopImmediatePropagation(),t.type){case"DOMAttrModified":var e=t.attrName,n=t.relatedNode.namespaceURI,r=t.target,i=((o=new u("attributes",r)).attributeName=e,o.attributeNamespace=n,t.attrChange===MutationEvent.ADDITION?null:t.prevValue);l(r,function(t){return!t.attributes||t.attributeFilter&&t.attributeFilter.length&&-1===t.attributeFilter.indexOf(e)&&-1===t.attributeFilter.indexOf(n)?void 0:t.attributeOldValue?d(i):o});break;case"DOMCharacterDataModified":var o=u("characterData",r=t.target),i=t.prevValue;l(r,function(t){return t.characterData?t.characterDataOldValue?d(i):o:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(t.target);case"DOMNodeInserted":var a,r=t.target,s="DOMNodeInserted"===t.type?(a=[r],[]):(a=[],[r]),c=r.previousSibling,r=r.nextSibling;(o=u("childList",t.target.parentNode)).addedNodes=a,o.removedNodes=s,o.previousSibling=c,o.nextSibling=r,l(t.relatedNode,function(t){return t.childList?o:void 0})}v=y=void 0}},t.JsMutationObserver=e,t.MutationObserver)||((t.MutationObserver=e)._isPolyfilled=!0)}(self),"undefined"==typeof HTMLTemplateElement&&function(){function n(t){switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case" ":return"&nbsp;"}}var r=document.implementation.createHTMLDocument("template"),i=!0,e=((HTMLTemplateElement=function(){}).prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(t){if(!t.content){t.content=r.createDocumentFragment();for(var e;e=t.firstChild;)t.content.appendChild(e);if(i)try{Object.defineProperty(t,"innerHTML",{get:function(){for(var t="",e=this.content.firstChild;e;e=e.nextSibling)t+=e.outerHTML||e.data.replace(o,n);return t},set:function(t){for(r.body.innerHTML=t,HTMLTemplateElement.bootstrap(r);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;r.body.firstChild;)this.content.appendChild(r.body.firstChild)},configurable:!0})}catch(t){i=!1}HTMLTemplateElement.bootstrap(t.content)}},HTMLTemplateElement.bootstrap=function(t){for(var e,n=t.querySelectorAll("template"),r=0,i=n.length;r<i&&(e=n[r]);r++)HTMLTemplateElement.decorate(e)},document.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)}),document.createElement),o=(document.createElement=function(){"use strict";var t=e.apply(document,arguments);return"template"==t.localName&&HTMLTemplateElement.decorate(t),t},/[&\u00A0<>]/g)}(),function(){"use strict";var t,e;window.performance||(t=Date.now(),window.performance={now:function(){return Date.now()-t}}),window.requestAnimationFrame||(window.requestAnimationFrame=(e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)?function(t){return e(function(){t(performance.now())})}:function(t){return window.setTimeout(t,1e3/60)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}),(r=document.createEvent("Event")).initEvent("foo",!0,!0),r.preventDefault();r.defaultPrevented||(n=Event.prototype.preventDefault,Event.prototype.preventDefault=function(){this.cancelable&&(n.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))});var n,r=/Trident/.test(navigator.userAgent);(!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(t,e){e=e||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),n},window.CustomEvent.prototype=window.Event.prototype),(!window.Event||r&&"function"!=typeof window.Event)&&(r=window.Event,window.Event=function(t,e){e=e||{};var n=document.createEvent("Event");return n.initEvent(t,Boolean(e.bubbles),Boolean(e.cancelable)),n},window.Event.prototype=r.prototype)}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(t){function e(t,e){(function t(e,n){{var r;i(n)?e&&e():(r=function(){"complete"!==n.readyState&&n.readyState!==s||(n.removeEventListener(c,r),t(e,n))},n.addEventListener(c,r))}})(function(){!function(t,e){function n(){a==s&&t&&t({allImports:o,loadedImports:c,errorImports:l})}function r(t){h(t),c.push(this),a++,n()}function i(){l.push(this),a++,n()}var o=e.querySelectorAll("link[rel=import]"),a=0,s=o.length,c=[],l=[];if(s)for(var u,d=0;d<s&&(u=o[d]);d++)!function(t){return p?t.__loaded||t.import&&"loading"!==t.import.readyState:t.__importParsed}(u)?(u.addEventListener("load",r),u.addEventListener("error",i)):(c.push(this),a++,n());else n()}(t,e)},e=e||o)}function i(t){return"complete"===t.readyState||t.readyState===s}function h(t){t.target.__loaded=!0}function l(t){t.import?h({target:t}):(t.addEventListener("load",h),t.addEventListener("error",h))}function n(t){return r?window.ShadowDOMPolyfill.wrapIfNeeded(t):t}var p=Boolean("import"in document.createElement("link")),r=Boolean(window.ShadowDOMPolyfill),o=n(document),a={get:function(){var t=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return n(t)},configurable:!0},a=(Object.defineProperty(document,"_currentScript",a),Object.defineProperty(o,"_currentScript",a),/Trident/.test(navigator.userAgent)),s=a?"complete":"interactive",c="readystatechange";if(p&&(new MutationObserver(function(t){for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)if(e.addedNodes){i=void 0;o=void 0;s=void 0;c=void 0;a=void 0;var i=e.addedNodes;for(var o,a,s=0,c=i.length;s<c&&(o=i[s]);s++)"link"===(a=o).localName&&"import"===a.rel&&l(o)}}).observe(document.head,{childList:!0}),"loading"===document.readyState))for(var u,d=document.querySelectorAll("link[rel=import]"),f=0,m=d.length;f<m&&(u=d[f]);f++)l(u);e(function(t){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var e=o.createEvent("CustomEvent");e.initCustomEvent("HTMLImportsLoaded",!0,!0,t),o.dispatchEvent(e)}),t.IMPORT_LINK_TYPE="import",t.useNative=p,t.rootDocument=o,t.whenReady=e,t.isIE=a}(window.HTMLImports),function(e){var n=[];e.addModule=function(t){n.push(t)},e.initializeModules=function(){n.forEach(function(t){t(e)})}}(window.HTMLImports),window.HTMLImports.addModule(function(t){var r=/(url\()([^)]*)(\))/g,i=/(@import[\s]+(?!url\())([^;]*)(;)/g;t.path={resolveUrlsInStyle:function(t,e){var n=t.ownerDocument.createElement("a");return t.textContent=this.resolveUrlsInCssText(t.textContent,e,n),t},resolveUrlsInCssText:function(t,e,n){t=this.replaceUrls(t,n,e,r);return this.replaceUrls(t,n,e,i)},replaceUrls:function(t,i,o,e){return t.replace(e,function(t,e,n,r){n=n.replace(/["']/g,"");return o&&(n=new URL(n,o).href),i.href=n,e+"'"+(n=i.href)+"'"+r})}}}),window.HTMLImports.addModule(function(e){var a={async:!0,ok:function(t){return 200<=t.status&&t.status<300||304===t.status||0===t.status},load:function(t,r,i){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,a.async),o.addEventListener("readystatechange",function(t){if(4===o.readyState){var e=null;try{var n=o.getResponseHeader("Location");n&&(e="/"===n.substr(0,1)?location.origin+n:n)}catch(t){console.error(t.message)}r.call(i,!a.ok(o)&&o,o.response||o.responseText,e)}}),o.send(),o},loadDocument:function(t,e,n){this.load(t,e,n).responseType="document"}};e.xhr=a}),window.HTMLImports.addModule(function(t){function e(t,e){this.cache={},this.onload=t,this.oncomplete=e,this.inflight=0,this.pending={}}var o=t.xhr,a=t.flags;e.prototype={addNodes:function(t){this.inflight+=t.length;for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)this.require(e);this.checkDone()},addNode:function(t){this.inflight++,this.require(t),this.checkDone()},require:function(t){var e=t.src||t.href;t.__nodeUrl=e,this.dedupe(e,t)||this.fetch(e,t)},dedupe:function(t,e){return this.pending[t]?(this.pending[t].push(e),!0):this.cache[t]?(this.onload(t,e,this.cache[t]),this.tail(),!0):!(this.pending[t]=[e])},fetch:function(r,i){var t,e,n;a.load&&console.log("fetch",r,i),r?r.match(/^data:/)?(t=(n=r.split(","))[0],e=n[1],e=(-1<t.indexOf(";base64")?atob:decodeURIComponent)(e),setTimeout(function(){this.receive(r,i,null,e)}.bind(this),0)):(n=function(t,e,n){this.receive(r,i,t,e,n)}.bind(this),o.load(r,n)):setTimeout(function(){this.receive(r,i,{error:"href must be specified"},null)}.bind(this),0)},receive:function(t,e,n,r,i){this.cache[t]=r;for(var o,a=this.pending[t],s=0,c=a.length;s<c&&(o=a[s]);s++)this.onload(t,o,r,n,i),this.tail();this.pending[t]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},t.Loader=e}),window.HTMLImports.addModule(function(t){function e(t){this.addCallback=t,this.mo=new MutationObserver(this.handler.bind(this))}e.prototype={handler:function(t){for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)"childList"===e.type&&e.addedNodes.length&&this.addedNodes(e.addedNodes)},addedNodes:function(t){this.addCallback&&this.addCallback(t);for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)e.children&&e.children.length&&this.addedNodes(e.children)},observe:function(t){this.mo.observe(t,{childList:!0,subtree:!0})}},t.Observer=e}),window.HTMLImports.addModule(function(n){function a(t){return"link"===t.localName&&t.rel===s}function r(t){t=t.textContent+function(t){var e=t.ownerDocument,t=(e.__importedScripts=e.__importedScripts||0,t.ownerDocument.baseURI),n=e.__importedScripts?"-"+e.__importedScripts:"";return e.__importedScripts++,"\n//# sourceURL="+t+n+".js\n"}(t);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}var i=n.path,e=n.rootDocument,o=n.flags,l=n.isIE,s=n.IMPORT_LINK_TYPE,t="link[rel="+s+"]",c={documentSelectors:t,importsSelectors:[t,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var t=this.nextToParse();t&&this.parse(t)},parse:function(t){var e;this.isParsed(t)?o.parse&&console.log("[%s] is already parsed",t.localName):(e=this[this.map[t.localName]])&&(this.markParsing(t),e.call(this,t))},parseDynamic:function(t,e){this.dynamicElements.push(t),e||this.parseNext()},markParsing:function(t){o.parse&&console.log("parsing",t),this.parsingElement=t},markParsingComplete:function(t){t.__importParsed=!0,this.markDynamicParsingComplete(t),t.__importElement&&(t.__importElement.__importParsed=!0,this.markDynamicParsingComplete(t.__importElement)),this.parsingElement=null,o.parse&&console.log("completed",t)},markDynamicParsingComplete:function(t){t=this.dynamicElements.indexOf(t);0<=t&&this.dynamicElements.splice(t,1)},parseImport:function(t){if(t.import=t.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(t),t.import&&(t.import.__importParsed=!0),this.markParsingComplete(t),t.__resource&&!t.__error?t.dispatchEvent(new CustomEvent("load",{bubbles:!1})):t.dispatchEvent(new CustomEvent("error",{bubbles:!1})),t.__pending)for(var e;t.__pending.length;)(e=t.__pending.shift())&&e({target:t});this.parseNext()},parseLink:function(t){a(t)?this.parseImport(t):(t.href=t.href,this.parseGeneric(t))},parseStyle:function(t){var e,n,r=t;(n=(e=t).ownerDocument.createElement("style")).textContent=e.textContent,i.resolveUrlsInStyle(n),t=n,(r.__appliedElement=t).__importElement=r,this.parseGeneric(t)},parseGeneric:function(t){this.trackElement(t),this.addElementToDocument(t)},rootImportForElement:function(t){for(var e=t;e.ownerDocument.__importLink;)e=e.ownerDocument.__importLink;return e},addElementToDocument:function(t){var e=this.rootImportForElement(t.__importElement||t);e.parentNode.insertBefore(t,e)},trackElement:function(e,n){function r(t){e.removeEventListener("load",r),e.removeEventListener("error",r),n&&n(t),i.markParsingComplete(e),i.parseNext()}var i=this;if(e.addEventListener("load",r),e.addEventListener("error",r),l&&"style"===e.localName){var t=!1;if(-1==e.textContent.indexOf("@import"))t=!0;else if(e.sheet)for(var o,t=!0,a=e.sheet.cssRules,s=a?a.length:0,c=0;c<s&&(o=a[c]);c++)o.type===CSSRule.IMPORT_RULE&&(t=t&&Boolean(o.styleSheet));t&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var e=document.createElement("script");e.__importElement=t,e.src=t.src||r(t),n.currentScript=t,this.trackElement(e,function(){e.parentNode&&e.parentNode.removeChild(e),n.currentScript=null}),this.addElementToDocument(e)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(e)||this.nextToParseDynamic())},nextToParseInDoc:function(t,e){if(t&&this._mayParse.indexOf(t)<0){this._mayParse.push(t);for(var n,r=t.querySelectorAll(this.parseSelectorsForNode(t)),i=0,o=r.length;i<o&&(n=r[i]);i++)if(!this.isParsed(n))return this.hasResource(n)?a(n)?this.nextToParseInDoc(n.__doc,n):n:void 0}return e},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(t){return(t.ownerDocument||t)===e?this.documentSelectors:this.importsSelectors},isParsed:function(t){return t.__importParsed},needsDynamicParsing:function(t){return 0<=this.dynamicElements.indexOf(t)},hasResource:function(t){return!a(t)||void 0!==t.__doc}};n.parser=c,n.IMPORT_SELECTOR=t}),window.HTMLImports.addModule(function(t){function s(t,e){var n=document.implementation.createHTMLDocument(l),r=(n._URL=e,n.createElement("base")),e=(r.setAttribute("href",e),n.baseURI||Object.getOwnPropertyDescriptor(n,"baseURI")||Object.defineProperty(n,"baseURI",{value:e}),n.createElement("meta"));return e.setAttribute("charset","utf-8"),n.head.appendChild(e),n.head.appendChild(r),n.body.innerHTML=t,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var c=t.flags,l=t.IMPORT_LINK_TYPE,e=t.IMPORT_SELECTOR,n=t.rootDocument,r=t.Loader,i=t.Observer,u=t.parser,e={documents:{},documentPreloadSelectors:e,importsPreloadSelectors:[e].join(","),loadNode:function(t){o.addNode(t)},loadSubtree:function(t){t=this.marshalNodes(t);o.addNodes(t)},marshalNodes:function(t){return t.querySelectorAll(this.loadSelectorsForNode(t))},loadSelectorsForNode:function(t){return(t.ownerDocument||t)===n?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(t,e,n,r,i){var o,a;c.load&&console.log("loaded",t,e),e.__resource=n,e.__error=r,a=l,"link"===(o=o=e).localName&&o.getAttribute("rel")===a&&(void 0===(o=this.documents[t])&&((o=r?null:s(n,i||t))&&(o.__importLink=e,this.bootDocument(o)),this.documents[t]=o),e.__doc=o),u.parseNext()},bootDocument:function(t){this.loadSubtree(t),this.observer.observe(t),u.parseNext()},loadedAll:function(){u.parseNext()}},o=new r(e.loaded.bind(e),e.loadedAll.bind(e));e.observer=new i,document.baseURI||(r={get:function(){var t=document.querySelector("base");return(t||window.location).href},configurable:!0},Object.defineProperty(document,"baseURI",r),Object.defineProperty(n,"baseURI",r)),t.importer=e,t.importLoader=o}),window.HTMLImports.addModule(function(t){var s=t.parser,c=t.importer,t={added:function(t){for(var e,n,r,i,o=0,a=t.length;o<a&&(i=t[o]);o++)e||(e=i.ownerDocument,n=s.isParsed(e)),(r=this.shouldLoadNode(i))&&c.loadNode(i),this.shouldParseNode(i)&&n&&s.parseDynamic(i,r)},shouldLoadNode:function(t){return 1===t.nodeType&&e.call(t,c.loadSelectorsForNode(t))},shouldParseNode:function(t){return 1===t.nodeType&&e.call(t,s.parseSelectorsForNode(t))}},e=(c.observer.addCallback=t.added.bind(t),HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector)}),function(t){function e(){window.HTMLImports.importer.bootDocument(n)}var n,r=t.initializeModules;t.isIE,t.useNative||(r(),n=t.rootDocument,"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?e():document.addEventListener("DOMContentLoaded",e))}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[];e.addModule=function(t){n.push(t)},e.initializeModules=function(){n.forEach(function(t){t(e)})},e.hasNative=Boolean(document.registerElement),e.isIE=/Trident/.test(navigator.userAgent),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(t){function r(t,e){(function t(e,n,r){var i=e.firstElementChild;if(!i)for(i=e.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)!0!==n(i,r)&&t(i,n,r),i=i.nextElementSibling;return null})(t,function(t){return!!e(t)||void n(t,e)}),n(t,e)}function n(t,e){for(var n=t.shadowRoot;n;)r(n,e),n=n.olderShadowRoot}var c=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=function(t,e){!function t(e,n,r){if(e=window.wrap(e),!(0<=r.indexOf(e))){r.push(e);for(var i,o=e.querySelectorAll("link[rel="+c+"]"),a=0,s=o.length;a<s&&(i=o[a]);a++)i.import&&t(i.import,n,r);n(e)}}(t,e,[])},t.forSubtree=r}),window.CustomElements.addModule(function(n){function a(t,e){return r(t,e)||i(t,e)}function r(t,e){return!!n.upgrade(t,e)||void(e&&s(t))}function i(t,e){m(t,function(t){return!!r(t,e)||void 0})}function e(t){b.push(t),g||(g=!0,setTimeout(o))}function o(){g=!1;for(var t,e=b,n=0,r=e.length;n<r&&(t=e[n]);n++)t();b=[]}function s(t){y?e(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&!t.__attached&&(t.__attached=!0,t.attachedCallback)&&t.attachedCallback()}function l(t){y?e(function(){u(t)}):u(t)}function u(t){t.__upgraded__&&t.__attached&&(t.__attached=!1,t.detachedCallback)&&t.detachedCallback()}function d(t,e){if(f.dom){var n=e[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var r=n.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=(i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"").split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,i||"")}var o=function(t){for(var e=t,n=window.wrap(document);e;){if(e==n)return!0;e=e.parentNode||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host}}(t);e.forEach(function(t){"childList"===t.type&&(w(t.addedNodes,function(t){t.localName&&a(t,o)}),w(t.removedNodes,function(t){t.localName&&(l(t=t),m(t,function(t){l(t)}))}))}),f.dom&&console.groupEnd()}function h(t){var e;t.__observer||((e=new MutationObserver(d.bind(this,t))).observe(t,{childList:!0,subtree:!0}),t.__observer=e)}function p(t){t=window.wrap(t),f.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),a(t,t===window.wrap(document)),h(t),f.dom&&console.groupEnd()}var f=n.flags,m=n.forSubtree,v=n.forDocumentTree,y=window.MutationObserver._isPolyfilled&&f["throttle-attached"],g=(n.hasPolyfillMutations=y,n.hasThrottledAttached=y,!1),b=[],w=Array.prototype.forEach.call.bind(Array.prototype.forEach),_=Element.prototype.createShadowRoot;_&&(Element.prototype.createShadowRoot=function(){var t=_.call(this);return window.CustomElements.watchShadow(this),t}),n.watchShadow=function(t){if(t.shadowRoot&&!t.shadowRoot.__watched){f.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)h(e),e=e.olderShadowRoot}},n.upgradeDocumentTree=function(t){v(t,p)},n.upgradeDocument=p,n.upgradeSubtree=i,n.upgradeAll=a,n.attached=s,n.takeRecords=function(t){for(t=(t=window.wrap(t))||window.wrap(document);t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(d(t,e.takeRecords()),o())}}),window.CustomElements.addModule(function(i){function o(t,e,n){return a.upgrade&&console.group("upgrade:",t.localName),e.is&&t.setAttribute("is",e.is),r(t,e),t.__upgraded__=!0,(e=t).createdCallback&&e.createdCallback(),n&&i.attached(t),i.upgradeSubtree(t,n),a.upgrade&&console.groupEnd(),t}function r(t,e){if(!Object.__proto__)for(var n=t,r=e.prototype,i=e.native,o={},a=r;a!==i&&a!==HTMLElement.prototype;){for(var s,c=Object.getOwnPropertyNames(a),l=0;s=c[l];l++)o[s]||(Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s)),o[s]=1);a=Object.getPrototypeOf(a)}t.__proto__=e.prototype}var a=i.flags;i.upgrade=function(t,e){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var n=t.getAttribute("is"),r=i.getRegisteredDefinition(t.localName)||i.getRegisteredDefinition(n);if(r&&(n&&r.tag==t.localName||!n&&!r.extends))return o(t,r,e)}},i.upgradeWithDefinition=o,i.implementPrototype=r}),window.CustomElements.addModule(function(f){function m(t,e,n){t=t.toLowerCase();var r=this.getAttribute(t),i=(n.apply(this,arguments),this.getAttribute(t));this.attributeChangedCallback&&i!==r&&this.attributeChangedCallback(t,r,i)}function v(t){return t?w[t.toLowerCase()]:void 0}function i(t,e){t=t&&t.toLowerCase();var n,r=v((e=e&&e.toLowerCase())||t);if(r){if(t==r.tag&&e==r.is)return new r.ctor;if(!e&&!r.is)return new r.ctor}return e?(n=i(t)).setAttribute("is",e):(n=_(t),0<=t.indexOf("-")&&o(n,HTMLElement)),n}function t(t,e){var n=t[e];t[e]=function(){var t=n.apply(this,arguments);return r(t),t}}var n,e=f.isIE,y=f.upgradeDocumentTree,r=f.upgradeAll,g=f.upgradeWithDefinition,o=f.implementPrototype,a=f.useNative,b=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],w={},_=document.createElement.bind(document),s=document.createElementNS.bind(document),a=Object.__proto__||a?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;for(var n=t;n;){if(n===e.prototype)return!0;n=n.__proto__}return!1};t(Node.prototype,"cloneNode"),t(document,"importNode"),e&&(n=document.importNode,document.importNode=function(){var t,e=n.apply(document,arguments);return e.nodeType==e.DOCUMENT_FRAGMENT_NODE?((t=document.createDocumentFragment()).appendChild(e),t):e}),document.registerElement=function(t,e){var n,r,i,e=e||{};if(!t)throw Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+t+"'.");if(function(t){for(var e=0;b.length>e;e++)if(t===b[e])return 1}(t))throw Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+t+"'. The type name is invalid.");if(v(t))throw Error("DuplicateDefinitionError: a type with name '"+t+"' is already registered");e.prototype||(e.prototype=Object.create(HTMLElement.prototype)),e.__name=t.toLowerCase(),e.lifecycle=e.lifecycle||{},e.ancestry=function t(e){e=v(e);return e?t(e.extends).concat([e]):[]}(e.extends);for(var o,a=e,s=a.extends,c=0;o=a.ancestry[c];c++)s=o.is&&o.tag;a.tag=s||a.__name,s&&(a.is=a.__name);var t=e;if(!Object.__proto__){var l=HTMLElement.prototype;t.is&&(p=document.createElement(t.tag),l=Object.getPrototypeOf(p));for(var u,d=t.prototype,h=!1;d;)d==l&&(h=!0),(u=Object.getPrototypeOf(d))&&(d.__proto__=u),d=u;h||console.warn(t.tag+" prototype not found in prototype chain for "+t.is),t.native=l}var p=e.prototype;return p.setAttribute._polyfilled||(n=p.setAttribute,p.setAttribute=function(t,e){m.call(this,t,e,n)},r=p.removeAttribute,p.removeAttribute=function(t){m.call(this,t,null,r)},p.setAttribute._polyfilled=!0),t=e.__name,(w[t]=e).ctor=(i=e,function(){return g(_((t=i).tag),t);var t}),e.ctor.prototype=e.prototype,e.prototype.constructor=e.ctor,f.ready&&y(document),e.ctor},document.createElement=i,document.createElementNS=function(t,e,n){return"http://www.w3.org/1999/xhtml"===t?i(e,n):s(t,e)},f.registry=w,f.instanceof=a,f.reservedTagList=b,f.getRegisteredDefinition=v,document.register=document.registerElement}),function(t){function e(){i(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(t){setTimeout(t,16)})(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=t.useNative,r=t.initializeModules,i=(t.isIE,n?(t.watchShadow=n=function(){},t.upgrade=n,t.upgradeAll=n,t.upgradeDocumentTree=n,t.upgradeSubtree=n,t.takeRecords=n,t.instanceof=function(t,e){return t instanceof e}):r(),t.upgradeDocumentTree),o=t.upgradeDocument;window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(t){t.import&&o(wrap(t.import))}),"complete"!==document.readyState&&!t.flags.eager&&("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready)?(n=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded",window.addEventListener(n,e)):e()}(window.CustomElements),function(){var t=document.createElement("style"),e=(t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n",document.querySelector("head"));e.insertBefore(t,e.firstChild)}(window.WebComponents),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.PointerEventsPolyfill=e()}(this,function(){"use strict";function t(){this.array=[],this.size=0}function e(t,e,n,r){this.addCallback=t.bind(r),this.removeCallback=e.bind(r),this.changedCallback=n.bind(r),_&&(this.observer=new _(this.mutationWatcher.bind(this)))}function n(t){return"body /shadow-deep/ "+r(t)}function r(t){return'[touch-action="'+t+'"]'}function i(t){return"{ -ms-touch-action: "+t+"; touch-action: "+t+"; touch-action-delay: none; }"}function o(t){if(!m.pointermap.has(t))throw Error("InvalidPointerId")}var a=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],s=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],c=function(t,e){e=e||Object.create(null);var n=document.createEvent("Event");n.initEvent(t,e.bubbles||!1,e.cancelable||!1);for(var r,i=2;i<a.length;i++)n[r=a[i]]=e[r]||s[i];return n.buttons=e.buttons||0,t=e.pressure||(n.buttons?.5:0),n.x=n.clientX,n.y=n.clientY,n.pointerId=e.pointerId||0,n.width=e.width||0,n.height=e.height||0,n.pressure=t,n.tiltX=e.tiltX||0,n.tiltY=e.tiltY||0,n.pointerType=e.pointerType||"",n.hwTimestamp=e.hwTimestamp||0,n.isPrimary=e.isPrimary||!1,n},l=window.Map&&window.Map.prototype.forEach?Map:t,u=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],d=[!(t.prototype={set:function(t,e){return void 0===e?this.delete(t):(this.has(t)||this.size++,void(this.array[t]=e))},has:function(t){return void 0!==this.array[t]},delete:function(t){this.has(t)&&(delete this.array[t],this.size--)},get:function(t){return this.array[t]},clear:function(){this.array.length=0,this.size=0},forEach:function(n,r){return this.array.forEach(function(t,e){n.call(r,t,e,this)},this)}}),!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],h={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},p="undefined"!=typeof SVGElementInstance,f={pointermap:new l,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(t,e){var n=e,e=n.events;e&&(e.forEach(function(t){n[t]&&(this.eventMap[t]=n[t].bind(n))},this),this.eventSources[t]=n,this.eventSourceList.push(n))},register:function(t){for(var e,n=this.eventSourceList.length,r=0;r<n&&(e=this.eventSourceList[r]);r++)e.register.call(e,t)},unregister:function(t){for(var e,n=this.eventSourceList.length,r=0;r<n&&(e=this.eventSourceList[r]);r++)e.unregister.call(e,t)},contains:function(t,e){try{return t.contains(e)}catch(t){return!1}},down:function(t){t.bubbles=!0,this.fireEvent("pointerdown",t)},move:function(t){t.bubbles=!0,this.fireEvent("pointermove",t)},up:function(t){t.bubbles=!0,this.fireEvent("pointerup",t)},enter:function(t){t.bubbles=!1,this.fireEvent("pointerenter",t)},leave:function(t){t.bubbles=!1,this.fireEvent("pointerleave",t)},over:function(t){t.bubbles=!0,this.fireEvent("pointerover",t)},out:function(t){t.bubbles=!0,this.fireEvent("pointerout",t)},cancel:function(t){t.bubbles=!0,this.fireEvent("pointercancel",t)},leaveOut:function(t){this.out(t),this.contains(t.target,t.relatedTarget)||this.leave(t)},enterOver:function(t){this.over(t),this.contains(t.target,t.relatedTarget)||this.enter(t)},eventHandler:function(t){var e;t._handledByPE||(e=t.type,(e=this.eventMap&&this.eventMap[e])&&e(t),t._handledByPE=!0)},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(t,e){t.addEventListener(e,this.boundHandler)},removeEvent:function(t,e){t.removeEventListener(e,this.boundHandler)},makeEvent:function(t,e){this.captureInfo[e.pointerId]&&(e.relatedTarget=null);t=new c(t,e);return e.preventDefault&&(t.preventDefault=e.preventDefault),t._target=t._target||e.target,t},fireEvent:function(t,e){t=this.makeEvent(t,e);return this.dispatchEvent(t)},cloneEvent:function(t){for(var e,n=Object.create(null),r=0;r<u.length;r++)n[e=u[r]]=t[e]||d[r],!p||"target"!==e&&"relatedTarget"!==e||n[e]instanceof SVGElementInstance&&(n[e]=n[e].correspondingUseElement);return t.preventDefault&&(n.preventDefault=function(){t.preventDefault()}),n},getTarget:function(t){var e=this.captureInfo[t.pointerId];return e?t._target!==e&&t.type in h?void 0:e:t._target},setCapture:function(t,e){this.captureInfo[t]&&this.releaseCapture(t),this.captureInfo[t]=e;var n=document.createEvent("Event");n.initEvent("gotpointercapture",!0,!1),n.pointerId=t,this.implicitRelease=this.releaseCapture.bind(this,t),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),n._target=e,this.asyncDispatchEvent(n)},releaseCapture:function(t){var e,n=this.captureInfo[t];n&&((e=document.createEvent("Event")).initEvent("lostpointercapture",!0,!1),e.pointerId=t,this.captureInfo[t]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),e._target=n,this.asyncDispatchEvent(e))},dispatchEvent:function(t){var e=this.getTarget(t);return e?e.dispatchEvent(t):void 0},asyncDispatchEvent:function(t){requestAnimationFrame(this.dispatchEvent.bind(this,t))}},m=(f.boundHandler=f.eventHandler.bind(f),f),v={shadow:function(t){return t?t.shadowRoot||t.webkitShadowRoot:void 0},canTarget:function(t){return t&&Boolean(t.elementFromPoint)},targetingShadow:function(t){t=this.shadow(t);return this.canTarget(t)?t:void 0},olderShadow:function(t){var e=t.olderShadowRoot;return e||(t=t.querySelector("shadow"))&&(e=t.olderShadowRoot),e},allShadows:function(t){for(var e=[],n=this.shadow(t);n;)e.push(n),n=this.olderShadow(n);return e},searchRoot:function(t,e,n){if(t){for(var r,i,t=t.elementFromPoint(e,n),o=this.targetingShadow(t);o;){if(r=o.elementFromPoint(e,n))return i=this.targetingShadow(r),this.searchRoot(i,e,n)||r;o=this.olderShadow(o)}return t}},owner:function(t){for(var e=t;e.parentNode;)e=e.parentNode;return e=e.nodeType!==Node.DOCUMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?document:e},findTarget:function(t){var e=t.clientX,n=t.clientY,t=this.owner(t.target);return t.elementFromPoint(e,n)||(t=document),this.searchRoot(t,e,n)}},y=Array.prototype.forEach.call.bind(Array.prototype.forEach),g=Array.prototype.map.call.bind(Array.prototype.map),b=Array.prototype.slice.call.bind(Array.prototype.slice),w=Array.prototype.filter.call.bind(Array.prototype.filter),_=window.MutationObserver||window.WebKitMutationObserver,A={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]},f=(e.prototype={watchSubtree:function(t){this.observer&&v.canTarget(t)&&this.observer.observe(t,A)},enableOnSubtree:function(t){this.watchSubtree(t),t===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(t)},installNewSubtree:function(t){y(this.findElements(t),this.addElement,this)},findElements:function(t){return t.querySelectorAll?t.querySelectorAll("[touch-action]"):[]},removeElement:function(t){this.removeCallback(t)},addElement:function(t){this.addCallback(t)},elementChanged:function(t,e){this.changedCallback(t,e)},concatLists:function(t,e){return t.concat(b(e))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(t){return t.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(t){var e=g(t,this.findElements,this);return e.push(w(t,this.isElement)),e.reduce(this.concatLists,[])},mutationWatcher:function(t){t.forEach(this.mutationHandler,this)},mutationHandler:function(t){"childList"===t.type?(this.flattenMutationTree(t.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(t.removedNodes).forEach(this.removeElement,this)):"attributes"===t.type&&this.elementChanged(t.target,t.oldValue)}},e),E=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",L=window.PointerEvent||window.MSPointerEvent,C=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,M=m.pointermap,P=[1,4,2,8,16],S=!1;try{S=1===new MouseEvent("test",{buttons:1}).buttons}catch(t){}var O,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(t){m.listen(t,this.events)},unregister:function(t){m.unlisten(t,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(t){for(var e,n=this.lastTouches,r=t.clientX,i=t.clientY,o=0,a=n.length;o<a&&(e=n[o]);o++){var s=Math.abs(r-e.x),c=Math.abs(i-e.y);if(s<=25&&c<=25)return!0}},prepareEvent:function(t){var e=m.cloneEvent(t),n=e.preventDefault;return e.preventDefault=function(){t.preventDefault(),n()},e.pointerId=this.POINTER_ID,e.isPrimary=!0,e.pointerType=this.POINTER_TYPE,e},prepareButtonsForMove:function(t,e){var n=M.get(this.POINTER_ID);t.buttons=n?n.buttons:0,e.buttons=t.buttons},mousedown:function(t){var e,n;this.isEventSimulatedFromTouch(t)||(e=M.get(this.POINTER_ID),n=this.prepareEvent(t),S||(n.buttons=P[n.button],e&&(n.buttons|=e.buttons),t.buttons=n.buttons),M.set(this.POINTER_ID,t),e?m.move(n):m.down(n))},mousemove:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),S||this.prepareButtonsForMove(e,t),m.move(e))},mouseup:function(t){var e,n,r;this.isEventSimulatedFromTouch(t)||(e=M.get(this.POINTER_ID),n=this.prepareEvent(t),S||(r=P[n.button],n.buttons=e?e.buttons&~r:0,t.buttons=n.buttons),M.set(this.POINTER_ID,t),0===n.buttons||n.buttons===P[n.button]?(this.cleanupMouse(),m.up(n)):m.move(n))},mouseover:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),S||this.prepareButtonsForMove(e,t),m.enterOver(e))},mouseout:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),S||this.prepareButtonsForMove(e,t),m.leaveOut(e))},cancel:function(t){t=this.prepareEvent(t);m.cancel(t),this.cleanupMouse()},cleanupMouse:function(){M.delete(this.POINTER_ID)}},H=m.captureInfo,q=v.findTarget.bind(v),I=v.allShadows.bind(v),x=m.pointermap,k="touch-action",D={events:["touchstart","touchmove","touchend","touchcancel"],register:function(t){j.enableOnSubtree(t)},unregister:function(t){},elementAdded:function(t){var e=t.getAttribute(k),n=this.touchActionToScrollType(e);n&&(t._scrollType=n,m.listen(t,this.events),I(t).forEach(function(t){t._scrollType=n,m.listen(t,this.events)},this))},elementRemoved:function(t){t._scrollType=void 0,m.unlisten(t,this.events),I(t).forEach(function(t){t._scrollType=void 0,m.unlisten(t,this.events)},this)},elementChanged:function(t,e){var n=t.getAttribute(k),r=this.touchActionToScrollType(n),n=this.touchActionToScrollType(e);r&&n?(t._scrollType=r,I(t).forEach(function(t){t._scrollType=r},this)):n?this.elementRemoved(t):r&&this.elementAdded(t)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(t){var e=this.scrollTypes;return"none"===t?"none":t===e.XSCROLLER?"X":t===e.YSCROLLER?"Y":e.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(t){return this.firstTouch===t.identifier},setPrimaryTouch:function(t){(0===x.size||1===x.size&&x.has(1))&&(this.firstTouch=t.identifier,this.firstXY={X:t.clientX,Y:t.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(t){t.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var t=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(t,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(t){return"touchstart"!==t&&"touchmove"!==t?0:1},touchToPointer:function(t){var e=this.currentTouchEvent,n=m.cloneEvent(t),r=n.pointerId=t.identifier+2,i=(n.target=H[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(e.type),n.width=t.radiusX||t.webkitRadiusX||0,n.height=t.radiusY||t.webkitRadiusY||0,n.pressure=t.force||t.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(t),n.pointerType=this.POINTER_TYPE,this);return n.preventDefault=function(){i.scrolling=!1,i.firstXY=null,e.preventDefault()},n},processTouches:function(t,e){var n=t.changedTouches;this.currentTouchEvent=t;for(var r,i=0;n.length>i;i++)r=n[i],e.call(this,this.touchToPointer(r))},shouldScroll:function(t){var e,n;if(this.firstXY)return t="none"!==(n=t.currentTarget._scrollType)&&("XY"===n||(t=t.changedTouches[0],e="Y"===n?"X":"Y",n=Math.abs(t["client"+n]-this.firstXY[n]),Math.abs(t["client"+e]-this.firstXY[e])<=n)),this.firstXY=null,t},findTouch:function(t,e){for(var n,r=0,i=t.length;r<i&&(n=t[r]);r++)if(n.identifier===e)return!0},vacuumTouches:function(t){var n,r=t.touches;x.size>=r.length&&(n=[],x.forEach(function(t,e){1===e||this.findTouch(r,e-2)||(e=t.out,n.push(e))},this),n.forEach(this.cancelOut,this))},touchstart:function(t){this.vacuumTouches(t),this.setPrimaryTouch(t.changedTouches[0]),this.dedupSynthMouse(t),this.scrolling||(this.clickCount++,this.processTouches(t,this.overDown))},overDown:function(t){x.set(t.pointerId,{target:t.target,out:t,outTarget:t.target}),m.over(t),m.enter(t),m.down(t)},touchmove:function(t){this.scrolling||(this.shouldScroll(t)?(this.scrolling=!0,this.touchcancel(t)):(t.preventDefault(),this.processTouches(t,this.moveOverOut)))},moveOverOut:function(t){var e,n,r=x.get(t.pointerId);r&&(e=r.out,n=r.outTarget,m.move(t),e&&n!==t.target&&(e.relatedTarget=t.target,t.relatedTarget=n,e.target=n,t.target?(m.leaveOut(e),m.enterOver(t)):(t.target=n,t.relatedTarget=null,this.cancelOut(t))),r.out=t,r.outTarget=t.target)},touchend:function(t){this.dedupSynthMouse(t),this.processTouches(t,this.upOut)},upOut:function(t){this.scrolling||(m.up(t),m.out(t),m.leave(t)),this.cleanUpPointer(t)},touchcancel:function(t){this.processTouches(t,this.cancelOut)},cancelOut:function(t){m.cancel(t),m.out(t),m.leave(t),this.cleanUpPointer(t)},cleanUpPointer:function(t){x.delete(t.pointerId),this.removePrimaryPointer(t)},dedupSynthMouse:function(t){var e=N.lastTouches,t=t.changedTouches[0];this.isPrimaryTouch(t)&&(t={x:t.clientX,y:t.clientY},e.push(t),e=function(t,e){e=t.indexOf(e);-1<e&&t.splice(e,1)}.bind(null,e,t),setTimeout(e,2500))}},j=new f(D.elementAdded,D.elementRemoved,D.elementChanged,D),R=m.pointermap,F=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,U={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(t){m.listen(t,this.events)},unregister:function(t){m.unlisten(t,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(t){var e=t;return F&&((e=m.cloneEvent(t)).pointerType=this.POINTER_TYPES[t.pointerType]),e},cleanup:function(t){R.delete(t)},MSPointerDown:function(t){R.set(t.pointerId,t);t=this.prepareEvent(t);m.down(t)},MSPointerMove:function(t){t=this.prepareEvent(t);m.move(t)},MSPointerUp:function(t){var e=this.prepareEvent(t);m.up(e),this.cleanup(t.pointerId)},MSPointerOut:function(t){t=this.prepareEvent(t);m.leaveOut(t)},MSPointerOver:function(t){t=this.prepareEvent(t);m.enterOver(t)},MSPointerCancel:function(t){var e=this.prepareEvent(t);m.cancel(e),this.cleanup(t.pointerId)},MSLostPointerCapture:function(t){t=m.makeEvent("lostpointercapture",t);m.dispatchEvent(t)},MSGotPointerCapture:function(t){t=m.makeEvent("gotpointercapture",t);m.dispatchEvent(t)}},Y=window.navigator.msPointerEnabled?(O=function(t){o(t),this.msSetPointerCapture(t)},function(t){o(t),this.msReleasePointerCapture(t)}):(O=function(t){o(t),m.setCapture(t,this)},function(t){o(t),m.releaseCapture(t,this)});return L&&(E.forEach(function(t){t+""===t?(T+=r(t)+i(t)+"\n",C&&(T+=n(t)+i(t)+"\n")):(T+=t.selectors.map(r)+i(t.rule)+"\n",C&&(T+=t.selectors.map(n)+i(t.rule)+"\n"))}),(L=document.createElement("style")).textContent=T,document.head.appendChild(L)),window.PointerEvent||(window.PointerEvent=c,window.navigator.msPointerEnabled?(E=window.navigator.msMaxTouchPoints,Object.defineProperty(window.navigator,"maxTouchPoints",{value:E,enumerable:!0}),m.registerSource("ms",U)):(m.registerSource("mouse",N),void 0!==window.ontouchstart&&m.registerSource("touch",D)),m.register(document)),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:O},releasePointerCapture:{value:Y}}),{dispatcher:m,Installer:f,PointerEvent:c,PointerMap:l,targetFinding:v}}),function(){function s(t){t=N.call(t);return O[t]||(O[t]=t.match(I)[1].toLowerCase())}function i(t,e){e=i[e||s(t)];return e?e(t):t}function p(t){return A[s(t)]?[t]:Array.prototype.slice.call(t,0)}function c(t,e,n){var r=s(n);return"object"==r&&"object"==s(t[e])?R.merge(t[e],n):t[e]=i(n,r),t}function d(t,e,n){var r,i,o={};for(i in e)o[i.split(":")[0]]=i;for(i in n)r=o[i.split(":")[0]],"function"==typeof e[r]?(r.match(":mixins")||(e[r+":mixins"]=e[r],delete e[r],r+=":mixins"),e[r].__mixin__=R.applyPseudos(i+(i.match(":mixins")?"":":mixins"),n[i],t.pseudos,e[r].__mixin__)):(e[i]=n[i],delete e[r])}function f(u){return function t(e,n){for(var r=e.length;r--;)n.unshift(e[r]),R.mixins[e[r]].mixins&&t(R.mixins[e[r]].mixins,n);return n}(u.mixins,[]).forEach(function(t){var e,n=R.mixins[t];for(e in n){var r=n[e],i=u[e];if(i)switch(e){case"mixins":break;case"events":o=c=s=a=void 0;var o,a=u,s=i,c=r;for(o in c)s[o+":__mixin__("+H+++")"]=R.applyPseudos(o,c[o],a.pseudos);break;case"accessors":case"prototype":for(var l in r)i[l]?d(u,i[l],r[l]):i[l]=r[l];break;default:d(u,i,r)}else u[e]=r}}),u}function t(t){return 0===t.button}function o(t,e){var n,r,i,o,a,s=Object.getOwnPropertyDescriptor(t,"target");for(n in e)x[n]||(r=n,i=t,o=e,a=s,a?i[r]=o[r]:Object.defineProperty(i,r,{writable:!0,enumerable:!0,value:o[r]}));t.baseEvent=e}function m(t,e,n,r,i){a[i].call(t,n,e&&e.boolean?"":r)}function v(t,e,n,r,i){if(e&&(e.property||e.selector))for(var o=e.property?[t.xtag[e.property]]:e.selector?R.query(t,e.selector):[],a=o.length;a--;)o[a][i](n,r)}function y(t,e){t.prototype[e]={};var n,r,i,o=t.accessors[e],a=o.attribute;for(r in a&&(n=a.name=(a?a.name||e.replace(T,"$1-$2"):e).toLowerCase(),a.key=e,t.attributes[n]=a),o)!function(t,e,r,i,o,a){var n=r.split(":"),s=n[0];"get"==s?(n[0]=e,t.prototype[e].get=R.applyPseudos(n.join(":"),i[r],t.pseudos,i[r])):"set"==s?(n[0]=e,t.prototype[e].set=R.applyPseudos(n.join(":"),o?function(t){var e,n="setAttribute";o.boolean?(t=!!t,e=this.hasAttribute(a),t||(n="removeAttribute")):(t=o.validate?o.validate.call(this,t):t,e=this.getAttribute(a)),m(this,o,a,t,n),i[r].call(this,t,e),v(this,o,a,t,n)}:i[r]?function(t){i[r].call(this,t)}:null,t.pseudos,i[r]),o&&(o.setter=i[r])):t.prototype[e][r]=i[r]}(t,e,r,o,a,n);a&&(t.prototype[e].get||(i=(a.boolean?"has":"get")+"Attribute",t.prototype[e].get=function(){return this[i](n)}),t.prototype[e].set||(t.prototype[e].set=function(t){t=a.boolean?!!t:a.validate?a.validate.call(this,t):t;var e=!a.boolean||t?"setAttribute":"removeAttribute";m(this,a,n,t,e),v(this,a,n,t,e)}))}function g(t){return"function"==typeof t?q.exec(""+t)[1]:t}function h(){}function b(){return!0}var e,n,w=window,_=document,a={setAttribute:Element.prototype.setAttribute,removeAttribute:Element.prototype.removeAttribute},E=Element.prototype.createShadowRoot,l=_.createElement("div"),u=/,/g,T=/([a-z])([A-Z])/g,r=/\(|\)/g,L=/:(\w+)\u276A(.+?(?=\u276B))|:(\w+)/g,C=/(\d+)/g,M={action:function(t,e){return-1<t.value.match(C).indexOf(e.keyCode+"")==("keypass"==t.name)||null}},P={dom:"ms"==(e=((e=Object.keys(window).join()).match(/,(ms)/)||e.match(/,(moz)/)||e.match(/,(O)/)||[null,"webkit"])[1].toLowerCase())?"MS":e,lowercase:e,css:"-"+e+"-",js:"ms"==e?e:e.charAt(0).toUpperCase()+e.substring(1)},S=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype[P.lowercase+"MatchesSelector"],O={},N=O.toString,I=/\s([a-zA-Z]+)/,A=(i.object=function(t){var e,n={};for(e in t)n[e]=i(t[e]);return n},i.array=function(t){for(var e=t.length,n=Array(e);e--;)n[e]=i(t[e]);return n},{undefined:1,null:1,number:1,boolean:1,string:1,function:1}),H=0,x={};for(n in _.createEvent("CustomEvent"))x[n]=1;var k,D,q=/\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)\s*\*\//,R={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__||(this.__xtag__={data:{}})}}}},register:function(t,e){if("string"!=typeof t)throw"First argument must be a Custom Element string name";t=t.toLowerCase(),R.tags[t]=e||{};var n,i=e.prototype,a=(delete e.prototype,R.tags[t].compiled=f(R.merge({},R.defaultOptions,e))),o=a.prototype,r=a.lifecycle;for(n in a.events)a.events[n]=R.parseEvent(n,a.events[n]);for(n in r)r[n.split(":")[0]]=R.applyPseudos(n,r[n],a.pseudos,r[n]);for(n in a.methods)o[n.split(":")[0]]={value:R.applyPseudos(n,a.methods[n],a.pseudos,a.methods[n]),enumerable:!0};for(n in a.accessors)y(a,n);a.shadow&&(a.shadow=a.shadow.nodeName?a.shadow:R.createFragment(a.shadow)),a.content&&(a.content=a.content.nodeName?a.content.innerHTML:g(a.content));var s=r.created,c=r.finalized,l=(o.createdCallback={enumerable:!0,value:function(){var t,e=this,n=(a.shadow&&E&&this.createShadowRoot().appendChild(a.shadow.cloneNode(!0)),a.content&&(this.appendChild(document.createElement("div")).outerHTML=a.content),s?s.apply(this,arguments):null);for(t in R.addEvents(this,a.events),a.attributes){var r=a.attributes[t],i=this.hasAttribute(t),o=void 0!==r.def;(i||r.boolean||o)&&(this[r.key]=r.boolean?i:!i&&o?r.def:this.getAttribute(t))}return a.pseudos.forEach(function(t){t.onAdd.call(e,t)}),this.xtagComponentReady=!0,c&&c.apply(this,arguments),n}},r.inserted),u=r.removed,e=((l||u)&&(o.attachedCallback={value:function(){return u&&(this.xtag.__parentNode__=this.parentNode),l?l.apply(this,arguments):void 0},enumerable:!0}),u&&(o.detachedCallback={value:function(){var t=p(arguments),t=(t.unshift(this.xtag.__parentNode__),u.apply(this,t));return delete this.xtag.__parentNode__,t},enumerable:!0}),r.attributeChanged&&(o.attributeChangedCallback={value:r.attributeChanged,enumerable:!0}),o.setAttribute={writable:!0,enumerable:!0,value:function(t,e){var n,t=t.toLowerCase(),r=a.attributes[t];r&&(n=this.getAttribute(t),e=r.boolean?"":r.validate?r.validate.call(this,e):e),m(this,r,t,e,"setAttribute"),r&&(r.setter&&r.setter.call(this,!!r.boolean||e,n),v(this,r,t,e,"setAttribute"))}},o.removeAttribute={writable:!0,enumerable:!0,value:function(t){var t=t.toLowerCase(),e=a.attributes[t],n=this.hasAttribute(t);m(this,e,t,"","removeAttribute"),e&&(e.setter&&e.setter.call(this,!e.boolean&&void 0,n),v(this,e,t,"","removeAttribute"))}},{}),d=i instanceof w.HTMLElement,h=a.extends&&(e.extends=a.extends);return i&&Object.getOwnPropertyNames(i).forEach(function(t){var e=o[t],n=d?Object.getOwnPropertyDescriptor(i,t):i[t];if(e)for(var r in n)e[r]="function"==typeof n[r]&&e[r]?R.wrap(n[r],e[r]):n[r];o[t]=e||n}),e.prototype=Object.create((h?Object.create(_.createElement(h).constructor):w.HTMLElement).prototype,o),_.registerElement(t,e)},mixins:{},prefix:P,captureEvents:{focus:1,blur:1,scroll:1,DOMMouseScroll:1},customEvents:{animationstart:{attach:[P.dom+"AnimationStart"]},animationend:{attach:[P.dom+"AnimationEnd"]},transitionend:{attach:[P.dom+"TransitionEnd"]},move:{attach:["pointermove"]},enter:{attach:["pointerenter"]},leave:{attach:["pointerleave"]},scrollwheel:{attach:["DOMMouseScroll","mousewheel"],condition:function(t){return t.delta=t.wheelDelta?t.wheelDelta/40:Math.round(t.detail/3.5*-1),!0}},tap:{attach:["pointerdown","pointerup"],condition:function(t,e){if("pointerdown"==t.type)e.startX=t.clientX,e.startY=t.clientY;else if(0===t.button&&Math.abs(e.startX-t.clientX)<10&&Math.abs(e.startY-t.clientY)<10)return!0}},tapstart:{attach:["pointerdown"],condition:t},tapend:{attach:["pointerup"],condition:t},tapmove:{attach:["pointerdown"],condition:function(t,e){var n;return"pointerdown"==t.type?(n=e.listener.bind(this),e.tapmoveListeners||(e.tapmoveListeners=R.addEvents(document,{pointermove:n,pointerup:n,pointercancel:n}))):"pointerup"!=t.type&&"pointercancel"!=t.type||(R.removeEvents(document,e.tapmoveListeners),e.tapmoveListeners=null),!0}},taphold:{attach:["pointerdown","pointerup"],condition:function(t,e){if("pointerdown"==t.type)(e.pointers=e.pointers||{})[t.pointerId]=setTimeout(R.fireEvent.bind(null,this,"taphold"),e.duration||1e3);else{if("pointerup"!=t.type)return!0;e.pointers&&(clearTimeout(e.pointers[t.pointerId]),delete e.pointers[t.pointerId])}}}},pseudos:{__mixin__:{},mixins:{onCompiled:function(e,t){var n=t.source&&t.source.__mixin__||t.source;if(!n)return e;switch(t.value){case null:case"":case"before":return function(){return n.apply(this,arguments),e.apply(this,arguments)};case"after":return function(){var t=e.apply(this,arguments);return n.apply(this,arguments),t};case"none":return e}}},keypass:M,keyfail:M,delegate:{action:function(t,e){for(var n,r=e.target,i=e.currentTarget;!n&&r&&r!=i;)r.tagName&&S.call(r,t.value)&&(n=r),r=r.parentNode;return(n=!n&&i.tagName&&S.call(i,t.value)?i:n)?t.listener=t.listener.bind(n):null}},preventable:{action:function(t,e){return!e.defaultPrevented}},duration:{onAdd:function(t){t.source.duration=Number(t.value)}},capture:{onCompiled:function(t,e){e.source&&(e.source.capture=!0)}}},clone:i,typeOf:s,toArray:p,wrap:function(e,n){return function(){var t=e.apply(this,arguments);return n.apply(this,arguments),t}},merge:function(t,e,n){if("string"==s(e))return c(t,e,n);for(var r=1,i=arguments.length;r<i;r++){var o,a=arguments[r];for(o in a)c(t,o,a[o])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:function(t,e){return(e||"").length?p(t.querySelectorAll(e)):[]},skipTransition:function(t,e,n){var r=P.js+"TransitionProperty",i=(t.style[r]=t.style.transitionProperty="none",e?e.call(n||t):null);return R.skipFrame(function(){t.style[r]=t.style.transitionProperty="",i&&i.call(n||t)})},requestFrame:(D=w.requestAnimationFrame||w[P.lowercase+"RequestAnimationFrame"]||function(t){return w.setTimeout(t,20)},function(t){return D(t)}),cancelFrame:(k=w.cancelAnimationFrame||w[P.lowercase+"CancelAnimationFrame"]||w.clearTimeout,function(t){return k(t)}),skipFrame:function(t){var e=R.requestFrame(function(){e=R.requestFrame(t)});return e},matchSelector:function(t,e){return S.call(t,e)},set:function(t,e,n){t[e]=n,window.CustomElements&&CustomElements.upgradeAll(t)},innerHTML:function(t,e){R.set(t,"innerHTML",e)},hasClass:function(t,e){return-1<t.className.split(" ").indexOf(e.trim())},addClass:function(t,e){var n=t.className.trim().split(" ");return e.trim().split(" ").forEach(function(t){~n.indexOf(t)||n.push(t)}),t.className=n.join(" ").trim(),t},removeClass:function(t,e){var n=e.trim().split(" ");return t.className=t.className.trim().split(" ").filter(function(t){return t&&!~n.indexOf(t)}).join(" "),t},toggleClass:function(t,e){return R[R.hasClass(t,e)?"removeClass":"addClass"].call(null,t,e)},queryChildren:function(t,e){var n=t.id,r="#"+(t.id=n||"x_"+R.uid())+" > ",i=t.parentNode||!l.appendChild(t),r=(e=r+(e+"").replace(u,","+r),t.parentNode.querySelectorAll(e));return n||t.removeAttribute("id"),i||l.removeChild(t),p(r)},createFragment:function(t){var e=document.createElement("template");return t&&(t.nodeName?p(arguments).forEach(function(t){e.content.appendChild(t)}):e.innerHTML=g(t)),document.importNode(e.content,!0)},manipulate:function(t,e){var n=t.nextSibling,r=t.parentNode,e=e.call(t)||t;n?r.insertBefore(e,n):r.appendChild(e)},applyPseudos:function(i,o,a,s){var t,c=o,l={};if(i.match(":")){var u=[],e=0;i.replace(r,function(t){return"("==t?1==++e?"❪":"(":--e?")":"❫"}).replace(L,function(t,e,n,r){u.push([e||r,n])});for(var d=u.length;d--;)!function(){var t=u[d][0],e=u[d][1];if(!R.pseudos[t])throw"pseudo not found: "+t+" "+e;var e=""===e||void 0===e?null:e,n=l[d]=Object.create(R.pseudos[t]),r=(n.key=i,n.name=t,n.value=e,n.arguments=(e||"").split(","),n.action=n.action||b,n.source=s,n.onAdd=n.onAdd||h,n.onRemove=n.onRemove||h,n.listener=c);c=function(){var t=n.action.apply(this,[n].concat(p(arguments)));return null===t||!1===t||(t=n.listener.apply(this,arguments),n.listener=r),t},a?a.push(n):n.onAdd.call(o,n)}()}for(t in l)l[t].onCompiled&&(c=l[t].onCompiled(c,l[t])||c);return c},removePseudos:function(e,t){t.forEach(function(t){t.onRemove.call(e,t)})},parseEvent:function(t,e){var t=t.split(":"),r=t.shift(),n=R.customEvents[r],i=R.merge({type:r,stack:h,condition:b,capture:R.captureEvents[r],attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:h,onRemove:h},n||{}),o=(i.attach=p(i.base||i.attach),i.chain=r+(i.pseudos.length?":"+i.pseudos:"")+(t.length?":"+t.join(":"):""),R.applyPseudos(i.chain,e,i._pseudos,i));return i.stack=function(t){t.currentTarget=t.currentTarget||this;var e=t.detail||{};return e.__stack__?e.__stack__==o?(t.stopPropagation(),t.cancelBubble=!0,o.apply(this,arguments)):void 0:o.apply(this,arguments)},i.listener=function(t){var e=p(arguments),n=i.condition.apply(this,e.concat([i]));return n&&(t.type!=r&&t.baseEvent&&t.type!=t.baseEvent.type?void R.fireEvent(t.target,r,{baseEvent:t,detail:!0!==n&&(n.__stack__=o)?n:{__stack__:o}}):i.stack.apply(this,e))},i.attach.forEach(function(t){i._attach.push(R.parseEvent(t,i.listener))}),i},addEvent:function(e,t,n,r){t="function"==typeof n?R.parseEvent(t,n):n;return t._pseudos.forEach(function(t){t.onAdd.call(e,t)}),t._attach.forEach(function(t){R.addEvent(e,t.type,t)}),t.onAdd.call(e,t,t.listener),e.addEventListener(t.type,t.stack,r||t.capture),t},addEvents:function(t,e){var n,r={};for(n in e)r[n]=R.addEvent(t,n,e[n]);return r},removeEvent:function(e,t,n){(n=n||t).onRemove.call(e,n,n.listener),R.removePseudos(e,n._pseudos),n._attach.forEach(function(t){R.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(t,e){for(var n in e)R.removeEvent(t,e[n])},fireEvent:function(t,e,n){var r=_.createEvent("CustomEvent");r.initCustomEvent(e,!1!==(n=n||{}).bubbles,!1!==n.cancelable,n.detail),n.baseEvent&&o(r,n.baseEvent),t.dispatchEvent(r)}};"function"==typeof define&&define.amd?define(R):"undefined"!=typeof module&&module.exports?module.exports=R:w.xtag=R,_.addEventListener("WebComponentsReady",function(){R.fireEvent(_.body,"DOMComponentsLoaded")})}();
1
+ /*! quran-madina-html 30-06-2026 */
2
+ !function(){var E="quran-madina-html",n=/localhost/.test(document.location.hostname)?"../":`https://www.unpkg.com/${E}/`;function T(t,e="class",n="lightgrey",r="transparent"){var i="tag"===e.toLowerCase()?document.getElementsByTagName(t):document.getElementsByClassName(t);Array.from(i).forEach(function(t){t.onmouseover=function(){Array.from(i).forEach(function(t){t.style.backgroundColor=n})},t.onmouseout=function(){Array.from(i).forEach(function(t){t.style.backgroundColor=r})}})}var e=/[\u0621-\u064A\u0671-\u06D3]/;function u(t){return e.test(t)}function g(t){var e=0;return t.t.split(/\s+/).forEach(function(t){u(t)&&(e+=1)}),e}function C(t,e,n,r,i){for(var o=k.suras[t].ayas,a=[],s=r+i;0<=s&&s<o.length&&o[s].p==e;s+=i){var c=function(t,e){for(var n=0;n<t.r.length;n++)if(t.r[n].l===e)return t.r[n];return null}(o[s],n);if(null===c)break;if(i<0){if(a.unshift(c),0===c.o)break}else a.push(c)}return a}function L(t,e){for(var n=0;n<e.length;n++){var r=document.createElement("div");r.textContent=e[n].t,r.style.cssText="display:inline;visibility:hidden",t.appendChild(r)}}function s(t,e,n){for(var r=[],i=null,o=0,a=t;a<k.suras.length;a++){for(var s=k.suras[a].ayas,c=!1,l=a===t?e:0;l<s.length;l++){for(var u=2<=l,d=s[l],h=0;h<d.r.length;h++){var p=d.r[h],f=d.p+":"+p.l;i&&i.key===f||(i={key:f,offset:p.o,stretch:p.s,parts:[]},r.push(i)),i.parts.push({sura:a,ayaIdx:l,part:p,countable:u})}if(u&&(o+=function(t){var e=0;return t.r.forEach(function(t){e+=g(t)}),e}(d))>=n[1]){c=!0;break}}if(c)break}for(var m=0,v=(r.forEach(function(t){t.parts.forEach(function(t){t.countable&&(m+=g(t.part))}),t.lastWord=m}),0);v<r.length-1&&r[v].lastWord<n[0];)v+=1;for(var y=v;y<r.length-1&&r[y].lastWord<n[1];)y+=1;return{groups:r.slice(v,y+1),counterStart:0<v?r[v-1].lastWord:0}}function M(r,t,e,c,n){var i,t=s(t,e,c),o=t.groups,a=1<o.length,l=t.counterStart;r.innerHTML="",r.removeAttribute("style"),a&&(r.style="display:block;",r.style.setProperty("font-family",k.font_family,""),r.style.setProperty("font-size",k.font_size+"px",""),"me_quran"===k.font_family&&r.style.setProperty("line-height",2*k.font_size+"px",""),r.style.width=k.line_width+10+"px",e=parseInt(o[0].key.split(":")[0],10),r.style.setProperty("box-shadow","inset "+(e%2==1?"":"-")+"8px 0 7px -7px #333",""),n||((t=document.createElement("quran-madina-html-header")).innerHTML=k.suras[o[0].parts[0].sura].name,(e=P()).addEventListener("click",I),(i=O()).addEventListener("click",x),t.appendChild(e),t.appendChild(i),r.appendChild(t))),o.forEach(function(t,e){var n,s=document.createElement("quran-madina-html-line");a?(s.style.setProperty("display","block",""),0<=t.stretch?s.style.setProperty("transform",`scaleX(${t.stretch})`,""):s.style.setProperty("text-align","center",""),0<t.offset&&0===e?(n=t.parts[0],L(s,C(n.sura,k.suras[n.sura].ayas[n.ayaIdx].p,n.part.l,n.ayaIdx,-1))):0<t.offset&&(s.style.setProperty("padding-right",t.offset+"px",""),s.style.setProperty("transform-origin","left"))):(s.style.setProperty("font-family",k.font_family,""),s.style.setProperty("font-size",k.font_size+"px","")),r.appendChild(s),t.parts.forEach(function(t){var n,e,r,i,o=document.createElement("div"),a=S(t.sura+1,t.ayaIdx-1);DOMTokenList.prototype.add.apply(o.classList,a),t.countable?(n=o,e=t.part.t,r=c,i=l,e.split(/(\s+)/).forEach(function(t){var e;""!==t&&(/^\s+$/.test(t)?n.appendChild(document.createTextNode(t)):((e=document.createElement("span")).textContent=t,e.classList.add(E+"-word"),(!u(t)||(i+=1)<r[0]||i>r[1])&&e.classList.add(E+"-word-hidden"),n.appendChild(e)))}),l=i):o.textContent=t.part.t,o.style.cssText="display:inline",s.appendChild(o),T(a.slice(-1)[0])}),a&&e===o.length-1&&(n=t.parts[t.parts.length-1],L(s,C(n.sura,k.suras[n.sura].ayas[n.ayaIdx].p,n.part.l,n.ayaIdx,1)))}),a||n||(e=document.createElement("quran-madina-html-copy"),(i=P()).addEventListener("click",I),e.appendChild(i),r.appendChild(e))}function S(t,e){var n=(t,e)=>String(t).padStart(e,"0"),t=[E+"-part",`${E}-${n(t,3)}-`+n(e,3)];return-1==e&&t.push("quran-madina-html-sura-start"),t}function P(){var t=document.createElement("div");return t.innerHTML='<svg viewBox="0 0 24 24" class="quran-madina-html-icon" width="20px"><path d="M16.02 20.96H3.78c-.41 0-.75-.34-.75-.75V7.74c0-.41.34-.75.75-.75h7.87c.21 0 .39.08.53.22l4.37 4.37c.14.14.22.32.22.53v8.11c0 .4-.34.74-.75.74ZM4.53 19.47h10.75v-6.61h-3.62c-.41 0-.75-.34-.75-.75V8.48H4.53v10.99Z"></path><path d="m20.74 7.63-4.37-4.37c-.14-.14-.36-.2-.53-.22H8.01c-.41 0-.75.34-.75.75V5.5h1.49v-.97h6.34v3.62c0 .41.34.75.75.75h3.62v8.19h-1.2v1.49h1.95c.41 0 .75-.34.75-.75V8.16c0-.21-.08-.4-.22-.53Z"></path></svg>'.trim(),t.firstChild}function O(){var t=document.createElement("div");return t.innerHTML='<svg class="quran-madina-html-icon" viewBox="0 0 820 615" style="height:20px"><path d="M70 1.9C37.6 8.8 12.6 33.4 3.4 67.5c-1.8 6.6-1.9 11.9-1.9 98v91l2.3 8c5.1 17.8 17 36.4 29.9 46.7 10.8 8.6 25.4 15.4 38.1 17.8 3.1.6 15.2 1 26.8 1 17.7 0 21.3.2 21.7 1.4.4.9.6 17.1.7 36.1 0 32.4.2 34.9 2 38.5 6.4 12.5 21.4 17.4 33.3 10.8 2.3-1.3 7.5-6.4 12.1-11.9l63-74.1c.6-.4 16.3-.8 34.9-.8H300l-.2-18.3-.3-18.2-42.8.1-43.1.5c-.2.2-12.7 15.1-27.9 33.1-15.1 18-27.8 32.4-28.1 32.1-.3-.4-.6-15.3-.6-33.2v-32.6l-38.8-.1c-42.1-.2-43.9-.4-54.3-6-6.5-3.6-16.9-14.6-20.2-21.5-5.8-11.9-5.7-10-5.7-100.7 0-92-.2-89.4 6.3-101.7 3.9-7.3 13.5-17.1 20.3-20.7C76 36.7 66.1 37 244.5 37L412 38.1c18 4.1 33.5 20.5 37.5 39.6 2.2 10.2 2.1 164.6 0 174.8-3.9 18.3-16.4 32.7-33.5 38.5-3.2 1.1-7.8 2-10 2-3.1 0-4 .4-4 1.7 0 1-.2 8.8-.3 17.3-.2 8.5-.2 16.2 0 17 .9 3.3 21.7-.5 34.1-6 13.7-6.3 27.5-17.9 36.2-30.5 5-7.2 10.8-20.4 13.2-30.1l2.3-8.9V165 76.5l-2.3-9c-8.1-31.4-30.5-54.9-61.7-64.8l-7-2.2-169-.2C87.7.1 78 .2 70 1.9zm277.294 102.559q19.5-.5 28.25 24.5 2.5 7.25-3.75 19.75-5.75 11.75-9.75 16-19.5 21.5-67 25.25-27.75 2.25-50.25-2.25-5.25 38.25-16.5 50-26 26.75-66 29.5-27.75 2-42.5-11-20.25-17.75-16.5-48.5 3-23.75 14.25-42.5 2.75-4.5 4.75-7.5 2-3 3-4.25 2.25-2.75 4.75-1.25 2.75 1.5 0 6.25-12.75 24.5-10 45 4 30.5 44.5 30.5 30.25 0 53.25-15.5 12.5-8.25 14.75-14.25-2.25-20.75-13.75-35.75-3.5-4.25-1.75-8l9.5-23.5q3-7.5 8.25 1.25l8.75 14.75q7.75 4.25 28.25 5 16.75-19.25 39.25-36.25 22.5-16.75 36.25-17.25zm11.5 40.5q-12.5-9.5-31.75-5.75-19 3.75-41.25 19.5 50.75.5 73-13.75zm-71.5-89.75q1.5-2 4.25-1.25 5 1.75 9.5 4.5 4.75 2.75 8.75 6.25 2 2 .75 4.5l-12 19q-1.75 2.5-4.5.5-2.5-2-18-11.25-2.75-1.75-1-4.25zm278.784 232.623c-4.7.4-4.7.4-6.7 6.1-1.2 3.1-9.3 25.9-18 50.7l-36.6 102.7-3.5 9.8h17.9 17.8l5.7-17 5.7-17h31.7 31.8l5.6 17.2 5.6 17.3 17.9-.3 18-.3-6-17.2-15-43.2-13.3-38.5-14.1-41-9.9-28.7c-.3-.6-30.2-1.1-34.6-.6zm35.7 106c-.2.2-10 .2-21.9.1l-21.5-.3 9.8-29.5 11-32.5c1.2-2.9 1.8-1.4 12.1 29.4l10.5 32.8zm148.8 139.609c32.4-6.9 57.4-31.5 66.6-65.6 1.8-6.6 1.9-11.9 1.9-98v-91l-2.3-8c-5.1-17.8-17-36.4-29.9-46.7-10.8-8.6-25.4-15.4-38.1-17.8-3.1-.6-15.2-1-26.8-1-17.7 0-21.3-.2-21.7-1.4-.4-.9-.6-17.1-.7-36.1 0-32.4-.2-34.9-2-38.5-6.4-12.5-21.4-17.4-33.3-10.8-2.3 1.3-7.5 6.4-12.1 11.9l-63 74.1c-.6.4-16.3.8-34.9.8h-33.7l.2 18.3.3 18.2 42.8-.1 43.1-.5c.2-.2 12.7-15.1 27.9-33.1 15.1-18 27.8-32.4 28.1-32.1.3.4.6 15.3.6 33.2v32.6l38.8.1c42.1.2 43.9.4 54.3 6 6.5 3.6 16.9 14.6 20.2 21.5 5.8 11.9 5.7 10 5.7 100.7 0 92 .2 89.4-6.3 101.7-3.9 7.3-13.5 17.1-20.3 20.7-11.4 6.1-1.5 5.8-179.9 5.8-108.2 0-164.5-.4-167.5-1.1-18-4.1-33.5-20.5-37.5-39.6-2.2-10.2-2.1-164.6 0-174.8 3.9-18.3 16.4-32.7 33.5-38.5 3.2-1.1 7.8-2 10-2 3.1 0 4-.4 4-1.7 0-1 .2-8.8.3-17.3.2-8.5.2-16.2 0-17-.9-3.3-21.7.5-34.1 6-13.7 6.3-27.5 17.9-36.2 30.5-5 7.2-10.8 20.4-13.2 30.1l-2.3 8.9v88.5 88.5l2.3 9c8.1 31.4 30.5 54.9 61.7 64.8l7 2.2 169 .2 177.5-1.6z"/></svg>'.trim(),t.firstChild}function N(t){console.log(E+"> "+t)}function I(){var t=this.parentElement.parentElement,e=t.querySelector("quran-madina-html-header"),n=(e=e?e.textContent.replace(/\s+/g," ").trim():null!=(e=t.getAttribute("sura"))?k.suras[e-1].name:"",(n=(t=(t=t).cloneNode(!0)).querySelector("quran-madina-html-header"))&&n.parentNode.removeChild(n),Array.from(t.querySelectorAll(`.${E}-word-hidden`)).forEach(function(t){t.parentNode.removeChild(t)}),Array.from(t.querySelectorAll("div,span")).forEach(function(t){/visibility:\s*hidden/.test(t.getAttribute("style")||"")&&t.parentNode.removeChild(t)}),t),t=n.querySelectorAll("quran-madina-html-line"),t=t.length?Array.from(t).map(function(t){return t.textContent.replace(/\s+/g," ").trim()}).filter(function(t){return""!==t}).join(" "):n.textContent.replace(/\s+/g," ").trim(),n=t+"\n\n"+e;navigator.clipboard.writeText(n),alert("⎘ تم نسخ:\n\n"+n)}function x(){var t=this.parentElement.parentElement;URL=null!=t.getAttribute("sura")&&null!=t.getAttribute("aya")?`https://quran.com/${t.getAttribute("sura")}/`+t.getAttribute("aya"):"https://quran.com/page/"+t.getAttribute("page"),window.open(URL,"_blank")}var t,r,i,o,a,k={content:"Loading .."},c=document.currentScript||document.querySelector(`script[src*="${E}"]`),l=c.getAttribute("data-name")||"Madina05",d=(c.getAttribute("data-font")||"me_quran").replaceAll(" ","_"),h=c.getAttribute("data-font-size")||16,c=c.getAttribute("data-cdn"),c=(c&&(n=c.replace(/\/?$/,"/")),N(l+` with font: ${d} size: `+h),n+"dist/"+E+".min.css?v=1.1");document.getElementById(E)||(t=document.getElementsByTagName("head")[0],(r=document.createElement("link")).id=E,r.rel="stylesheet",r.type="text/css",r.href=c,r.media="all",t.appendChild(r)),c=n+`assets/db/${l}-${d}-${h}px.json`,i=function(t){k=t;const e=new FontFace(k.font_family,"url("+encodeURI(null==(t=k.font_url)||/^(https?:)?\/\//.test(t)?t:n+String(t).replace(/^\//,""))+")");e.load().then(()=>{document.fonts.add(e)}),xtag.register(E,{lifecycle:{created:function(){this.render(this)},inserted:function(){},removed:function(){},attributeChanged:function(){this.render(this)}},events:{},accessors:{page:{attribute:{},set:function(t){this.xtag.data.page=t},get:function(){return this.getAttribute("page")}},page_param:{attribute:{},set:function(t){this.xtag.data.page_param=t},get:function(){return this.getAttribute("page_param")}},aya:{attribute:{},set:function(t){this.xtag.data.aya=t},get:function(){return this.getAttribute("aya")}},sura:{attribute:{},set:function(t){this.xtag.data.sura=t},get:function(){return this.getAttribute("sura")}},words:{attribute:{},set:function(t){this.xtag.data.words=t},get:function(){return this.getAttribute("words")}},headless:{attribute:{},set:function(t){this.xtag.data.headless=t},get:function(){return this.getAttribute("headless")}}},methods:{render:function(t){if(!this.xtag.data.rendering){this.xtag.data.rendering=!0;try{this.doRender(t)}finally{this.xtag.data.rendering=!1}}},doRender:function(e){var n,r,i,o,a,s,c,t,l=null,u=this.page,d=null!=(d=this.headless)&&(""===(d=String(d).trim().toLowerCase())||"true"===d||"1"===d||"yes"===d),h=null!=this.sura&&null!=this.aya;if(h)t=this.sura,r=n=Array(2).fill(t.split("-")[0]-1)[0],i=!1,[o,a]=2==(t=this.aya).split("-").length?t.split("-").map(t=>parseInt(t)+1):Array(2).fill(parseInt(t.split("-")[0])+1),null!=this.page&&N("Ignoring page parameter!"),u=k.suras[n].ayas[o].p;else{if(null==this.page)return console.error(E+"> Bad arguments: Not rendering!"),1;for(a=o=r=n=0;k.suras[n].ayas.slice(-1)[0].p<u;)n+=1;for(r=n;r<114&&k.suras[r].ayas[0].p<=u;)r+=1;for(r-=1;k.suras[n].ayas[o].p<u;)o+=1;for(a=k.suras[r].ayas.length-1;k.suras[r].ayas[a].p>u;)a-=1;i=!0}if(null!=this.words)if(h){if(null!=(l=null==(t=this.words)||2!=(t=1==(t=t.split(/[-:]/).map(t=>parseInt(t,10))).length?[t[0],t[0]]:t).length||isNaN(t[0])||isNaN(t[1])||t[0]<1||t[1]<t[0]?null:t))return a!==o&&N("Ignoring aya range end with words parameter!"),500<l[1]-l[0]+1&&(N("words selection capped at 500 words"),l[1]=l[0]+499),void M(e,n,o,l,d);N("Bad words parameter: "+this.words)}else N("Ignoring words parameter with page!");e.innerHTML="",e.removeAttribute("style"),(s=k.suras[n].ayas[o].r[0].l)!=(c=k.suras[r].ayas[a].r.slice(-1)[0].l)&&(i=!0,e.style="display:block;"),i&&(e.style.setProperty("font-family",k.font_family,""),e.style.setProperty("font-size",k.font_size+"px",""),"me_quran"===k.font_family)&&e.style.setProperty("line-height",2*k.font_size+"px","");var p,f,l="",m=(i&&!d&&((l=document.createElement("quran-madina-html-header")).innerHTML=k.suras[n].name,(f=P()).addEventListener("click",I),(p=O()).addEventListener("click",x),l.appendChild(f),l.appendChild(p),e.appendChild(l)),o),v=n;for(let t=s;t<=c;t++){const _=t;line=document.createElement("quran-madina-html-line"),e.appendChild(line),i||(line.style.setProperty("font-family",k.font_family,""),line.style.setProperty("font-size",k.font_size+"px","")),i&&(e.style.width=k.line_width+10+"px",y=k.suras[v].ayas[m].p%2==1?"":"-",e.style.setProperty("box-shadow","inset "+y+"8px 0 7px -7px #333",""),line.style.setProperty("display","block","")),i&&h&&t===s&&L(line,C(n,u,s,o,-1));var y,g,b,w=n==r?a:k.suras[v].ayas.length-1;for(let t=m;t<=Math.min(m+5,w);t++)k.suras[v].ayas[t].p==u&&(line_match=k.suras[v].ayas[t].r.filter(t=>t.l==_)).length&&(i&&(""==line.innerHTML.trim()&&(g=line_match[0].o,line.style.setProperty("padding-right",g+"px",""),0<g)&&line.style.setProperty("transform-origin","left"),0<=line_match[0].s?line.style.setProperty("transform",`scaleX(${line_match[0].s})`,""):line.style.setProperty("text-align","center","")),g=document.createElement("div"),b=S(v+1,t-1),DOMTokenList.prototype.add.apply(g.classList,b),g.textContent=line_match[0].t,g.style.cssText="display:inline",line.appendChild(g),T(b.slice(-1)[0]),w<=(m=t))&&v<113&&k.suras[v+1].ayas[0].p==u&&k.suras[v+1].ayas[0].r[0].l==_+1&&(v+=1,m=0);i&&h&&t===c&&L(line,C(r,u,c,a,1))}i||d||(l=document.createElement("quran-madina-html-copy"),(f=P()).addEventListener("click",I),l.appendChild(f),e.appendChild(l))}}})},o=function(t){console.error(t)},(a=new XMLHttpRequest).onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(200===a.status?i&&i(JSON.parse(a.responseText)):o&&o(a))},a.open("GET",c,!0),a.send()}(),function(){function t(t){if((this._element=t).className!=this._classCache&&(this._classCache=t.className,this._classCache))for(var e=this._classCache.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;e.length>n;n++)i.call(this,e[n])}function e(t,e){t.className=e.join(" ")}var n,r,i,o,a,s,c,l;void 0===window.Element||"classList"in document.documentElement||(s=Array.prototype,n=s.indexOf,r=s.slice,i=s.push,o=s.splice,a=s.join,t.prototype={add:function(t){this.contains(t)||(i.call(this,t),e(this._element,r.call(this,0)))},contains:function(t){return-1!==n.call(this,t)},item:function(t){return this[t]||null},remove:function(t){t=n.call(this,t);-1!==t&&(o.call(this,t,1),e(this._element,r.call(this,0)))},toString:function(){return a.call(this," ")},toggle:function(t){-1===n.call(this,t)?this.add(t):this.remove(t)}},window.DOMTokenList=t,s=Element.prototype,c="classList",l=function(){return new t(this)},Object.defineProperty?Object.defineProperty(s,c,{get:l}):s.__defineGetter__(c,l))}(),function(){window.WebComponents=window.WebComponents||{flags:{}};var t,e=document.querySelector('script[src*="webcomponents-lite.js"]'),n={};if(!n.noOpts){if(location.search.slice(1).split("&").forEach(function(t){var e,t=t.split("=");t[0]&&(e=t[0].match(/wc-(.+)/))&&(n[e[1]]=t[1]||!0)}),e)for(var r,i=0;r=e.attributes[i];i++)"src"!==r.name&&(n[r.name]=r.value||!0);n.log&&n.log.split?(t=n.log.split(","),n.log={},t.forEach(function(t){n.log[t]=!0})):n.log={}}n.register&&(window.CustomElements=window.CustomElements||{flags:{}},window.CustomElements.flags.register=n.register),WebComponents.flags=n}(),function(t){"use strict";function y(t){return void 0!==_[t]}function g(){r.call(this),this._isInvalid=!0}function b(t){return""==t&&g.call(this),t.toLowerCase()}function w(t){var e=t.charCodeAt(0);return 32<e&&e<127&&-1==[34,35,60,62,63,96].indexOf(e)?t:encodeURIComponent(t)}function n(t,e,n){function r(t){d.push(t)}var i,o,a=e||"scheme start",s=0,c="",l=!1,u=!1,d=[];t:for(;(t[s-1]!=T||0==s)&&!this._isInvalid;){var h=t[s];switch(a){case"scheme start":if(!h||!C.test(h)){if(e){r("Invalid scheme.");break t}c="",a="no scheme";continue}c+=h.toLowerCase(),a="scheme";break;case"scheme":if(h&&L.test(h))c+=h.toLowerCase();else{if(":"!=h){if(e){if(T==h)break t;r("Code point not allowed in scheme: "+h);break t}c="",s=0,a="no scheme";continue}if(this._scheme=c,c="",e)break t;y(this._scheme)&&(this._isRelative=!0),a="file"==this._scheme?"relative":this._isRelative&&n&&n._scheme==this._scheme?"relative or authority":this._isRelative?"authority first slash":"scheme data"}break;case"scheme data":"?"==h?(this._query="?",a="query"):"#"==h?(this._fragment="#",a="fragment"):T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._schemeData+=w(h));break;case"no scheme":if(n&&y(n._scheme)){a="relative";continue}r("Missing scheme."),g.call(this);break;case"relative or authority":if("/"!=h||"/"!=t[s+1]){r("Expected /, got: "+h),a="relative";continue}a="authority ignore slashes";break;case"relative":if(this._isRelative=!0,"file"!=this._scheme&&(this._scheme=n._scheme),T==h){this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._username=n._username,this._password=n._password;break t}if("/"==h||"\\"==h)"\\"==h&&r("\\ is an invalid code point."),a="relative slash";else if("?"==h)this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query="?",this._username=n._username,this._password=n._password,a="query";else{if("#"!=h){var p=t[s+1],f=t[s+2];("file"!=this._scheme||!C.test(h)||":"!=p&&"|"!=p||T!=f&&"/"!=f&&"\\"!=f&&"?"!=f&&"#"!=f)&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password,this._path=n._path.slice(),this._path.pop()),a="relative path";continue}this._host=n._host,this._port=n._port,this._path=n._path.slice(),this._query=n._query,this._fragment="#",this._username=n._username,this._password=n._password,a="fragment"}break;case"relative slash":if("/"!=h&&"\\"!=h){"file"!=this._scheme&&(this._host=n._host,this._port=n._port,this._username=n._username,this._password=n._password),a="relative path";continue}"\\"==h&&r("\\ is an invalid code point."),a="file"==this._scheme?"file host":"authority ignore slashes";break;case"authority first slash":if("/"!=h){r("Expected '/', got: "+h),a="authority ignore slashes";continue}a="authority second slash";break;case"authority second slash":if(a="authority ignore slashes","/"==h)break;r("Expected '/', got: "+h);continue;case"authority ignore slashes":if("/"!=h&&"\\"!=h){a="authority";continue}r("Expected authority, got: "+h);break;case"authority":if("@"==h){l&&(r("@ already seen."),c+="%40");for(var l=!0,m=0;c.length>m;m++){var v=c[m];"\t"!=v&&"\n"!=v&&"\r"!=v?":"!=v||null!==this._password?(v=w(v),null!==this._password?this._password+=v:this._username+=v):this._password="":r("Invalid whitespace in authority.")}c=""}else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){s-=c.length,c="",a="host";continue}c+=h}break;case"file host":if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){a=2!=c.length||!C.test(c[0])||":"!=c[1]&&"|"!=c[1]?(0==c.length||(this._host=b.call(this,c),c=""),"relative path start"):"relative path";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid whitespace in file host."):c+=h;break;case"host":case"hostname":if(":"!=h||u){if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h){if(this._host=b.call(this,c),c="",a="relative path start",e)break t;continue}"\t"!=h&&"\n"!=h&&"\r"!=h?("["==h?u=!0:"]"==h&&(u=!1),c+=h):r("Invalid code point in host/hostname: "+h)}else if(this._host=b.call(this,c),c="",a="port","hostname"==e)break t;break;case"port":if(/[0-9]/.test(h))c+=h;else{if(T==h||"/"==h||"\\"==h||"?"==h||"#"==h||e){if(""!=c&&((p=parseInt(c,10))!=_[this._scheme]&&(this._port=p+""),c=""),e)break t;a="relative path start";continue}"\t"==h||"\n"==h||"\r"==h?r("Invalid code point in port: "+h):g.call(this)}break;case"relative path start":if("\\"==h&&r("'\\' not allowed in path."),a="relative path","/"!=h&&"\\"!=h)continue;break;case"relative path":T!=h&&"/"!=h&&"\\"!=h&&(e||"?"!=h&&"#"!=h)?"\t"!=h&&"\n"!=h&&"\r"!=h&&(c+=w(h)):("\\"==h&&r("\\ not allowed in relative path."),".."==(c=(f=E[c.toLowerCase()])?f:c)?(this._path.pop(),"/"!=h&&"\\"!=h&&this._path.push("")):"."==c&&"/"!=h&&"\\"!=h?this._path.push(""):"."!=c&&("file"==this._scheme&&0==this._path.length&&2==c.length&&C.test(c[0])&&"|"==c[1]&&(c=c[0]+":"),this._path.push(c)),c="","?"==h?(this._query="?",a="query"):"#"==h&&(this._fragment="#",a="fragment"));break;case"query":e||"#"!=h?T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._query+=(o=void 0,32<(o=(i=h).charCodeAt(0))&&o<127&&-1==[34,35,60,62,96].indexOf(o)?i:encodeURIComponent(i))):(this._fragment="#",a="fragment");break;case"fragment":T!=h&&"\t"!=h&&"\n"!=h&&"\r"!=h&&(this._fragment+=h)}s++}}function r(){this._scheme="",this._schemeData="",this._username="",this._password=null,this._host="",this._port="",this._path=[],this._query="",this._fragment="",this._isInvalid=!1,this._isRelative=!1}function i(t,e){void 0===e||e instanceof i||(e=new i(e+"")),this._url=t,r.call(this);t=t.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g,"");n.call(this,t,null,e)}var _,E,T,C,L,e,o=!1;if(!t.forceJURL)try{var a=new URL("b","http://a");a.pathname="c%20d",o="http://a/c%20d"===a.href}catch(t){}o||((_=Object.create(null)).ftp=21,_.file=0,_.gopher=70,_.http=80,_.https=443,_.ws=80,_.wss=443,(E=Object.create(null))["%2e"]=".",E[".%2e"]="..",E["%2e."]="..",T=void(E["%2e%2e"]=".."),C=/[a-zA-Z]/,L=/[a-zA-Z0-9\+\-\.]/,i.prototype={toString:function(){return this.href},get href(){var t;return this._isInvalid?this._url:((t="")==this._username&&null==this._password||(t=this._username+(null!=this._password?":"+this._password:"")+"@"),this.protocol+(this._isRelative?"//"+t+this.host:"")+this.pathname+this._query+this._fragment)},set href(t){r.call(this),n.call(this,t)},get protocol(){return this._scheme+":"},set protocol(t){this._isInvalid||n.call(this,t+":","scheme start")},get host(){return this._isInvalid?"":this._port?this._host+":"+this._port:this._host},set host(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"host")},get hostname(){return this._host},set hostname(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"hostname")},get port(){return this._port},set port(t){!this._isInvalid&&this._isRelative&&n.call(this,t,"port")},get pathname(){return this._isInvalid?"":this._isRelative?"/"+this._path.join("/"):this._schemeData},set pathname(t){!this._isInvalid&&this._isRelative&&(this._path=[],n.call(this,t,"relative path start"))},get search(){return this._isInvalid||!this._query||"?"==this._query?"":this._query},set search(t){!this._isInvalid&&this._isRelative&&((this._query="?")==t[0]&&(t=t.slice(1)),n.call(this,t,"query"))},get hash(){return this._isInvalid||!this._fragment||"#"==this._fragment?"":this._fragment},set hash(t){this._isInvalid||((this._fragment="#")==t[0]&&(t=t.slice(1)),n.call(this,t,"fragment"))},get origin(){var t;if(this._isInvalid||!this._scheme)return"";switch(this._scheme){case"data":case"file":case"javascript":case"mailto":return"null"}return(t=this.host)?this._scheme+"://"+t:""}},(e=t.URL)&&(i.createObjectURL=function(){return e.createObjectURL.apply(e,arguments)},i.revokeObjectURL=function(t){e.revokeObjectURL(t)}),t.URL=i)}(self),"undefined"==typeof WeakMap&&function(){function t(){this.name="__st"+(1e9*Math.random()>>>0)+e+++"__"}var r=Object.defineProperty,e=Date.now()%1e9;t.prototype={set:function(t,e){var n=t[this.name];return n&&n[0]===t?n[1]=e:r(t,this.name,{value:[t,e],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},delete:function(t){var e=t[this.name];return!(!e||e[0]!==t||(e[0]=e[1]=void 0))},has:function(t){var e=t[this.name];return!!e&&e[0]===t}},window.WeakMap=t}(),function(t){function i(){p=!1;var t=f,r=(f=[],t.sort(function(t,e){return t.uid_-e.uid_}),!1);t.forEach(function(t){var e,n=t.takeRecords();(e=t).nodes_.forEach(function(t){t=s.get(t);t&&t.forEach(function(t){t.observer===e&&t.removeTransientObservers()})}),n.length&&(t.callback_(n,t),r=!0)}),r&&i()}function l(t,e){for(var n=t;n;n=n.parentNode){var r=s.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;(n===t||a.subtree)&&(a=e(a))&&o.enqueue(a)}}}function e(t){this.callback_=t,this.nodes_=[],this.records_=[],this.uid_=++m}function r(t,e){this.type=t,this.target=e,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function u(t,e){return v=new r(t,e)}function d(t){return y||((n=new r((e=v).type,e.target)).addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,(y=n).oldValue=t,y);var e,n}function o(t,e){return t===e?t:y&&((e=t)===y||e===v)?y:null}function a(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}var s,n,c,h,p,f,m,v,y;t.JsMutationObserver||(s=new WeakMap,h=/Trident|Edge/.test(navigator.userAgent)?setTimeout:window.setImmediate||(n=[],c=Math.random()+"",window.addEventListener("message",function(t){t.data===c&&(t=n,n=[],t.forEach(function(t){t()}))}),function(t){n.push(t),window.postMessage(c,"*")}),p=!1,f=[],m=0,e.prototype={observe:function(t,e){if(n=t,t=window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(n)||n,!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=s.get(t);r||s.set(t,r=[]);for(var i,o=0;r.length>o;o++)if(r[o].observer===this){(i=r[o]).removeListeners(),i.options=e;break}i||(i=new a(this,t,e),r.push(i),this.nodes_.push(t)),i.addListeners()},disconnect:function(){this.nodes_.forEach(function(t){for(var e=s.get(t),n=0;e.length>n;n++){var r=e[n];if(r.observer===this){r.removeListeners(),e.splice(n,1);break}}},this),this.records_=[]},takeRecords:function(){var t=this.records_;return this.records_=[],t}},a.prototype={enqueue:function(t){var e=this.observer.records_,n=e.length;if(0<e.length){var r=o(e[n-1],t);if(r)return void(e[n-1]=r)}else r=this.observer,f.push(r),p||(p=!0,h(i));e[n]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){var e;t!==this.target&&(this.addListeners_(t),this.transientObservedNodes.push(t),(e=s.get(t))||s.set(t,e=[]),e.push(this))},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=s.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}},this)},handleEvent:function(t){switch(t.stopImmediatePropagation(),t.type){case"DOMAttrModified":var e=t.attrName,n=t.relatedNode.namespaceURI,r=t.target,i=((o=new u("attributes",r)).attributeName=e,o.attributeNamespace=n,t.attrChange===MutationEvent.ADDITION?null:t.prevValue);l(r,function(t){return!t.attributes||t.attributeFilter&&t.attributeFilter.length&&-1===t.attributeFilter.indexOf(e)&&-1===t.attributeFilter.indexOf(n)?void 0:t.attributeOldValue?d(i):o});break;case"DOMCharacterDataModified":var o=u("characterData",r=t.target),i=t.prevValue;l(r,function(t){return t.characterData?t.characterDataOldValue?d(i):o:void 0});break;case"DOMNodeRemoved":this.addTransientObserver(t.target);case"DOMNodeInserted":var a,r=t.target,s="DOMNodeInserted"===t.type?(a=[r],[]):(a=[],[r]),c=r.previousSibling,r=r.nextSibling;(o=u("childList",t.target.parentNode)).addedNodes=a,o.removedNodes=s,o.previousSibling=c,o.nextSibling=r,l(t.relatedNode,function(t){return t.childList?o:void 0})}v=y=void 0}},t.JsMutationObserver=e,t.MutationObserver)||((t.MutationObserver=e)._isPolyfilled=!0)}(self),"undefined"==typeof HTMLTemplateElement&&function(){function n(t){switch(t){case"&":return"&amp;";case"<":return"&lt;";case">":return"&gt;";case" ":return"&nbsp;"}}var r=document.implementation.createHTMLDocument("template"),i=!0,e=((HTMLTemplateElement=function(){}).prototype=Object.create(HTMLElement.prototype),HTMLTemplateElement.decorate=function(t){if(!t.content){t.content=r.createDocumentFragment();for(var e;e=t.firstChild;)t.content.appendChild(e);if(i)try{Object.defineProperty(t,"innerHTML",{get:function(){for(var t="",e=this.content.firstChild;e;e=e.nextSibling)t+=e.outerHTML||e.data.replace(o,n);return t},set:function(t){for(r.body.innerHTML=t,HTMLTemplateElement.bootstrap(r);this.content.firstChild;)this.content.removeChild(this.content.firstChild);for(;r.body.firstChild;)this.content.appendChild(r.body.firstChild)},configurable:!0})}catch(t){i=!1}HTMLTemplateElement.bootstrap(t.content)}},HTMLTemplateElement.bootstrap=function(t){for(var e,n=t.querySelectorAll("template"),r=0,i=n.length;r<i&&(e=n[r]);r++)HTMLTemplateElement.decorate(e)},document.addEventListener("DOMContentLoaded",function(){HTMLTemplateElement.bootstrap(document)}),document.createElement),o=(document.createElement=function(){"use strict";var t=e.apply(document,arguments);return"template"==t.localName&&HTMLTemplateElement.decorate(t),t},/[&\u00A0<>]/g)}(),function(){"use strict";var t,e;window.performance||(t=Date.now(),window.performance={now:function(){return Date.now()-t}}),window.requestAnimationFrame||(window.requestAnimationFrame=(e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)?function(t){return e(function(){t(performance.now())})}:function(t){return window.setTimeout(t,1e3/60)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)}),(r=document.createEvent("Event")).initEvent("foo",!0,!0),r.preventDefault();r.defaultPrevented||(n=Event.prototype.preventDefault,Event.prototype.preventDefault=function(){this.cancelable&&(n.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))});var n,r=/Trident/.test(navigator.userAgent);(!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(t,e){e=e||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),n},window.CustomEvent.prototype=window.Event.prototype),(!window.Event||r&&"function"!=typeof window.Event)&&(r=window.Event,window.Event=function(t,e){e=e||{};var n=document.createEvent("Event");return n.initEvent(t,Boolean(e.bubbles),Boolean(e.cancelable)),n},window.Event.prototype=r.prototype)}(window.WebComponents),window.HTMLImports=window.HTMLImports||{flags:{}},function(t){function e(t,e){(function t(e,n){{var r;i(n)?e&&e():(r=function(){"complete"!==n.readyState&&n.readyState!==s||(n.removeEventListener(c,r),t(e,n))},n.addEventListener(c,r))}})(function(){!function(t,e){function n(){a==s&&t&&t({allImports:o,loadedImports:c,errorImports:l})}function r(t){h(t),c.push(this),a++,n()}function i(){l.push(this),a++,n()}var o=e.querySelectorAll("link[rel=import]"),a=0,s=o.length,c=[],l=[];if(s)for(var u,d=0;d<s&&(u=o[d]);d++)!function(t){return p?t.__loaded||t.import&&"loading"!==t.import.readyState:t.__importParsed}(u)?(u.addEventListener("load",r),u.addEventListener("error",i)):(c.push(this),a++,n());else n()}(t,e)},e=e||o)}function i(t){return"complete"===t.readyState||t.readyState===s}function h(t){t.target.__loaded=!0}function l(t){t.import?h({target:t}):(t.addEventListener("load",h),t.addEventListener("error",h))}function n(t){return r?window.ShadowDOMPolyfill.wrapIfNeeded(t):t}var p=Boolean("import"in document.createElement("link")),r=Boolean(window.ShadowDOMPolyfill),o=n(document),a={get:function(){var t=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return n(t)},configurable:!0},a=(Object.defineProperty(document,"_currentScript",a),Object.defineProperty(o,"_currentScript",a),/Trident/.test(navigator.userAgent)),s=a?"complete":"interactive",c="readystatechange";if(p&&(new MutationObserver(function(t){for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)if(e.addedNodes){i=void 0;o=void 0;s=void 0;c=void 0;a=void 0;var i=e.addedNodes;for(var o,a,s=0,c=i.length;s<c&&(o=i[s]);s++)"link"===(a=o).localName&&"import"===a.rel&&l(o)}}).observe(document.head,{childList:!0}),"loading"===document.readyState))for(var u,d=document.querySelectorAll("link[rel=import]"),f=0,m=d.length;f<m&&(u=d[f]);f++)l(u);e(function(t){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var e=o.createEvent("CustomEvent");e.initCustomEvent("HTMLImportsLoaded",!0,!0,t),o.dispatchEvent(e)}),t.IMPORT_LINK_TYPE="import",t.useNative=p,t.rootDocument=o,t.whenReady=e,t.isIE=a}(window.HTMLImports),function(e){var n=[];e.addModule=function(t){n.push(t)},e.initializeModules=function(){n.forEach(function(t){t(e)})}}(window.HTMLImports),window.HTMLImports.addModule(function(t){var r=/(url\()([^)]*)(\))/g,i=/(@import[\s]+(?!url\())([^;]*)(;)/g;t.path={resolveUrlsInStyle:function(t,e){var n=t.ownerDocument.createElement("a");return t.textContent=this.resolveUrlsInCssText(t.textContent,e,n),t},resolveUrlsInCssText:function(t,e,n){t=this.replaceUrls(t,n,e,r);return this.replaceUrls(t,n,e,i)},replaceUrls:function(t,i,o,e){return t.replace(e,function(t,e,n,r){n=n.replace(/["']/g,"");return o&&(n=new URL(n,o).href),i.href=n,e+"'"+(n=i.href)+"'"+r})}}}),window.HTMLImports.addModule(function(e){var a={async:!0,ok:function(t){return 200<=t.status&&t.status<300||304===t.status||0===t.status},load:function(t,r,i){var o=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(t+="?"+Math.random()),o.open("GET",t,a.async),o.addEventListener("readystatechange",function(t){if(4===o.readyState){var e=null;try{var n=o.getResponseHeader("Location");n&&(e="/"===n.substr(0,1)?location.origin+n:n)}catch(t){console.error(t.message)}r.call(i,!a.ok(o)&&o,o.response||o.responseText,e)}}),o.send(),o},loadDocument:function(t,e,n){this.load(t,e,n).responseType="document"}};e.xhr=a}),window.HTMLImports.addModule(function(t){function e(t,e){this.cache={},this.onload=t,this.oncomplete=e,this.inflight=0,this.pending={}}var o=t.xhr,a=t.flags;e.prototype={addNodes:function(t){this.inflight+=t.length;for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)this.require(e);this.checkDone()},addNode:function(t){this.inflight++,this.require(t),this.checkDone()},require:function(t){var e=t.src||t.href;t.__nodeUrl=e,this.dedupe(e,t)||this.fetch(e,t)},dedupe:function(t,e){return this.pending[t]?(this.pending[t].push(e),!0):this.cache[t]?(this.onload(t,e,this.cache[t]),this.tail(),!0):!(this.pending[t]=[e])},fetch:function(r,i){var t,e,n;a.load&&console.log("fetch",r,i),r?r.match(/^data:/)?(t=(n=r.split(","))[0],e=n[1],e=(-1<t.indexOf(";base64")?atob:decodeURIComponent)(e),setTimeout(function(){this.receive(r,i,null,e)}.bind(this),0)):(n=function(t,e,n){this.receive(r,i,t,e,n)}.bind(this),o.load(r,n)):setTimeout(function(){this.receive(r,i,{error:"href must be specified"},null)}.bind(this),0)},receive:function(t,e,n,r,i){this.cache[t]=r;for(var o,a=this.pending[t],s=0,c=a.length;s<c&&(o=a[s]);s++)this.onload(t,o,r,n,i),this.tail();this.pending[t]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},t.Loader=e}),window.HTMLImports.addModule(function(t){function e(t){this.addCallback=t,this.mo=new MutationObserver(this.handler.bind(this))}e.prototype={handler:function(t){for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)"childList"===e.type&&e.addedNodes.length&&this.addedNodes(e.addedNodes)},addedNodes:function(t){this.addCallback&&this.addCallback(t);for(var e,n=0,r=t.length;n<r&&(e=t[n]);n++)e.children&&e.children.length&&this.addedNodes(e.children)},observe:function(t){this.mo.observe(t,{childList:!0,subtree:!0})}},t.Observer=e}),window.HTMLImports.addModule(function(n){function a(t){return"link"===t.localName&&t.rel===s}function r(t){t=t.textContent+function(t){var e=t.ownerDocument,t=(e.__importedScripts=e.__importedScripts||0,t.ownerDocument.baseURI),n=e.__importedScripts?"-"+e.__importedScripts:"";return e.__importedScripts++,"\n//# sourceURL="+t+n+".js\n"}(t);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}var i=n.path,e=n.rootDocument,o=n.flags,l=n.isIE,s=n.IMPORT_LINK_TYPE,t="link[rel="+s+"]",c={documentSelectors:t,importsSelectors:[t,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var t=this.nextToParse();t&&this.parse(t)},parse:function(t){var e;this.isParsed(t)?o.parse&&console.log("[%s] is already parsed",t.localName):(e=this[this.map[t.localName]])&&(this.markParsing(t),e.call(this,t))},parseDynamic:function(t,e){this.dynamicElements.push(t),e||this.parseNext()},markParsing:function(t){o.parse&&console.log("parsing",t),this.parsingElement=t},markParsingComplete:function(t){t.__importParsed=!0,this.markDynamicParsingComplete(t),t.__importElement&&(t.__importElement.__importParsed=!0,this.markDynamicParsingComplete(t.__importElement)),this.parsingElement=null,o.parse&&console.log("completed",t)},markDynamicParsingComplete:function(t){t=this.dynamicElements.indexOf(t);0<=t&&this.dynamicElements.splice(t,1)},parseImport:function(t){if(t.import=t.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(t),t.import&&(t.import.__importParsed=!0),this.markParsingComplete(t),t.__resource&&!t.__error?t.dispatchEvent(new CustomEvent("load",{bubbles:!1})):t.dispatchEvent(new CustomEvent("error",{bubbles:!1})),t.__pending)for(var e;t.__pending.length;)(e=t.__pending.shift())&&e({target:t});this.parseNext()},parseLink:function(t){a(t)?this.parseImport(t):(t.href=t.href,this.parseGeneric(t))},parseStyle:function(t){var e,n,r=t;(n=(e=t).ownerDocument.createElement("style")).textContent=e.textContent,i.resolveUrlsInStyle(n),t=n,(r.__appliedElement=t).__importElement=r,this.parseGeneric(t)},parseGeneric:function(t){this.trackElement(t),this.addElementToDocument(t)},rootImportForElement:function(t){for(var e=t;e.ownerDocument.__importLink;)e=e.ownerDocument.__importLink;return e},addElementToDocument:function(t){var e=this.rootImportForElement(t.__importElement||t);e.parentNode.insertBefore(t,e)},trackElement:function(e,n){function r(t){e.removeEventListener("load",r),e.removeEventListener("error",r),n&&n(t),i.markParsingComplete(e),i.parseNext()}var i=this;if(e.addEventListener("load",r),e.addEventListener("error",r),l&&"style"===e.localName){var t=!1;if(-1==e.textContent.indexOf("@import"))t=!0;else if(e.sheet)for(var o,t=!0,a=e.sheet.cssRules,s=a?a.length:0,c=0;c<s&&(o=a[c]);c++)o.type===CSSRule.IMPORT_RULE&&(t=t&&Boolean(o.styleSheet));t&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var e=document.createElement("script");e.__importElement=t,e.src=t.src||r(t),n.currentScript=t,this.trackElement(e,function(){e.parentNode&&e.parentNode.removeChild(e),n.currentScript=null}),this.addElementToDocument(e)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(e)||this.nextToParseDynamic())},nextToParseInDoc:function(t,e){if(t&&this._mayParse.indexOf(t)<0){this._mayParse.push(t);for(var n,r=t.querySelectorAll(this.parseSelectorsForNode(t)),i=0,o=r.length;i<o&&(n=r[i]);i++)if(!this.isParsed(n))return this.hasResource(n)?a(n)?this.nextToParseInDoc(n.__doc,n):n:void 0}return e},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(t){return(t.ownerDocument||t)===e?this.documentSelectors:this.importsSelectors},isParsed:function(t){return t.__importParsed},needsDynamicParsing:function(t){return 0<=this.dynamicElements.indexOf(t)},hasResource:function(t){return!a(t)||void 0!==t.__doc}};n.parser=c,n.IMPORT_SELECTOR=t}),window.HTMLImports.addModule(function(t){function s(t,e){var n=document.implementation.createHTMLDocument(l),r=(n._URL=e,n.createElement("base")),e=(r.setAttribute("href",e),n.baseURI||Object.getOwnPropertyDescriptor(n,"baseURI")||Object.defineProperty(n,"baseURI",{value:e}),n.createElement("meta"));return e.setAttribute("charset","utf-8"),n.head.appendChild(e),n.head.appendChild(r),n.body.innerHTML=t,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var c=t.flags,l=t.IMPORT_LINK_TYPE,e=t.IMPORT_SELECTOR,n=t.rootDocument,r=t.Loader,i=t.Observer,u=t.parser,e={documents:{},documentPreloadSelectors:e,importsPreloadSelectors:[e].join(","),loadNode:function(t){o.addNode(t)},loadSubtree:function(t){t=this.marshalNodes(t);o.addNodes(t)},marshalNodes:function(t){return t.querySelectorAll(this.loadSelectorsForNode(t))},loadSelectorsForNode:function(t){return(t.ownerDocument||t)===n?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(t,e,n,r,i){var o,a;c.load&&console.log("loaded",t,e),e.__resource=n,e.__error=r,a=l,"link"===(o=o=e).localName&&o.getAttribute("rel")===a&&(void 0===(o=this.documents[t])&&((o=r?null:s(n,i||t))&&(o.__importLink=e,this.bootDocument(o)),this.documents[t]=o),e.__doc=o),u.parseNext()},bootDocument:function(t){this.loadSubtree(t),this.observer.observe(t),u.parseNext()},loadedAll:function(){u.parseNext()}},o=new r(e.loaded.bind(e),e.loadedAll.bind(e));e.observer=new i,document.baseURI||(r={get:function(){var t=document.querySelector("base");return(t||window.location).href},configurable:!0},Object.defineProperty(document,"baseURI",r),Object.defineProperty(n,"baseURI",r)),t.importer=e,t.importLoader=o}),window.HTMLImports.addModule(function(t){var s=t.parser,c=t.importer,t={added:function(t){for(var e,n,r,i,o=0,a=t.length;o<a&&(i=t[o]);o++)e||(e=i.ownerDocument,n=s.isParsed(e)),(r=this.shouldLoadNode(i))&&c.loadNode(i),this.shouldParseNode(i)&&n&&s.parseDynamic(i,r)},shouldLoadNode:function(t){return 1===t.nodeType&&e.call(t,c.loadSelectorsForNode(t))},shouldParseNode:function(t){return 1===t.nodeType&&e.call(t,s.parseSelectorsForNode(t))}},e=(c.observer.addCallback=t.added.bind(t),HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector)}),function(t){function e(){window.HTMLImports.importer.bootDocument(n)}var n,r=t.initializeModules;t.isIE,t.useNative||(r(),n=t.rootDocument,"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?e():document.addEventListener("DOMContentLoaded",e))}(window.HTMLImports),window.CustomElements=window.CustomElements||{flags:{}},function(e){var t=e.flags,n=[];e.addModule=function(t){n.push(t)},e.initializeModules=function(){n.forEach(function(t){t(e)})},e.hasNative=Boolean(document.registerElement),e.isIE=/Trident/.test(navigator.userAgent),e.useNative=!t.register&&e.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule(function(t){function r(t,e){(function t(e,n,r){var i=e.firstElementChild;if(!i)for(i=e.firstChild;i&&i.nodeType!==Node.ELEMENT_NODE;)i=i.nextSibling;for(;i;)!0!==n(i,r)&&t(i,n,r),i=i.nextElementSibling;return null})(t,function(t){return!!e(t)||void n(t,e)}),n(t,e)}function n(t,e){for(var n=t.shadowRoot;n;)r(n,e),n=n.olderShadowRoot}var c=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=function(t,e){!function t(e,n,r){if(e=window.wrap(e),!(0<=r.indexOf(e))){r.push(e);for(var i,o=e.querySelectorAll("link[rel="+c+"]"),a=0,s=o.length;a<s&&(i=o[a]);a++)i.import&&t(i.import,n,r);n(e)}}(t,e,[])},t.forSubtree=r}),window.CustomElements.addModule(function(n){function a(t,e){return r(t,e)||i(t,e)}function r(t,e){return!!n.upgrade(t,e)||void(e&&s(t))}function i(t,e){m(t,function(t){return!!r(t,e)||void 0})}function e(t){b.push(t),g||(g=!0,setTimeout(o))}function o(){g=!1;for(var t,e=b,n=0,r=e.length;n<r&&(t=e[n]);n++)t();b=[]}function s(t){y?e(function(){c(t)}):c(t)}function c(t){t.__upgraded__&&!t.__attached&&(t.__attached=!0,t.attachedCallback)&&t.attachedCallback()}function l(t){y?e(function(){u(t)}):u(t)}function u(t){t.__upgraded__&&t.__attached&&(t.__attached=!1,t.detachedCallback)&&t.detachedCallback()}function d(t,e){if(f.dom){var n=e[0];if(n&&"childList"===n.type&&n.addedNodes&&n.addedNodes){for(var r=n.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=(i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"").split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",e.length,i||"")}var o=function(t){for(var e=t,n=window.wrap(document);e;){if(e==n)return!0;e=e.parentNode||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host}}(t);e.forEach(function(t){"childList"===t.type&&(w(t.addedNodes,function(t){t.localName&&a(t,o)}),w(t.removedNodes,function(t){t.localName&&(l(t=t),m(t,function(t){l(t)}))}))}),f.dom&&console.groupEnd()}function h(t){var e;t.__observer||((e=new MutationObserver(d.bind(this,t))).observe(t,{childList:!0,subtree:!0}),t.__observer=e)}function p(t){t=window.wrap(t),f.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),a(t,t===window.wrap(document)),h(t),f.dom&&console.groupEnd()}var f=n.flags,m=n.forSubtree,v=n.forDocumentTree,y=window.MutationObserver._isPolyfilled&&f["throttle-attached"],g=(n.hasPolyfillMutations=y,n.hasThrottledAttached=y,!1),b=[],w=Array.prototype.forEach.call.bind(Array.prototype.forEach),_=Element.prototype.createShadowRoot;_&&(Element.prototype.createShadowRoot=function(){var t=_.call(this);return window.CustomElements.watchShadow(this),t}),n.watchShadow=function(t){if(t.shadowRoot&&!t.shadowRoot.__watched){f.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)h(e),e=e.olderShadowRoot}},n.upgradeDocumentTree=function(t){v(t,p)},n.upgradeDocument=p,n.upgradeSubtree=i,n.upgradeAll=a,n.attached=s,n.takeRecords=function(t){for(t=(t=window.wrap(t))||window.wrap(document);t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(d(t,e.takeRecords()),o())}}),window.CustomElements.addModule(function(i){function o(t,e,n){return a.upgrade&&console.group("upgrade:",t.localName),e.is&&t.setAttribute("is",e.is),r(t,e),t.__upgraded__=!0,(e=t).createdCallback&&e.createdCallback(),n&&i.attached(t),i.upgradeSubtree(t,n),a.upgrade&&console.groupEnd(),t}function r(t,e){if(!Object.__proto__)for(var n=t,r=e.prototype,i=e.native,o={},a=r;a!==i&&a!==HTMLElement.prototype;){for(var s,c=Object.getOwnPropertyNames(a),l=0;s=c[l];l++)o[s]||(Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s)),o[s]=1);a=Object.getPrototypeOf(a)}t.__proto__=e.prototype}var a=i.flags;i.upgrade=function(t,e){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var n=t.getAttribute("is"),r=i.getRegisteredDefinition(t.localName)||i.getRegisteredDefinition(n);if(r&&(n&&r.tag==t.localName||!n&&!r.extends))return o(t,r,e)}},i.upgradeWithDefinition=o,i.implementPrototype=r}),window.CustomElements.addModule(function(f){function m(t,e,n){t=t.toLowerCase();var r=this.getAttribute(t),i=(n.apply(this,arguments),this.getAttribute(t));this.attributeChangedCallback&&i!==r&&this.attributeChangedCallback(t,r,i)}function v(t){return t?w[t.toLowerCase()]:void 0}function i(t,e){t=t&&t.toLowerCase();var n,r=v((e=e&&e.toLowerCase())||t);if(r){if(t==r.tag&&e==r.is)return new r.ctor;if(!e&&!r.is)return new r.ctor}return e?(n=i(t)).setAttribute("is",e):(n=_(t),0<=t.indexOf("-")&&o(n,HTMLElement)),n}function t(t,e){var n=t[e];t[e]=function(){var t=n.apply(this,arguments);return r(t),t}}var n,e=f.isIE,y=f.upgradeDocumentTree,r=f.upgradeAll,g=f.upgradeWithDefinition,o=f.implementPrototype,a=f.useNative,b=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],w={},_=document.createElement.bind(document),s=document.createElementNS.bind(document),a=Object.__proto__||a?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;for(var n=t;n;){if(n===e.prototype)return!0;n=n.__proto__}return!1};t(Node.prototype,"cloneNode"),t(document,"importNode"),e&&(n=document.importNode,document.importNode=function(){var t,e=n.apply(document,arguments);return e.nodeType==e.DOCUMENT_FRAGMENT_NODE?((t=document.createDocumentFragment()).appendChild(e),t):e}),document.registerElement=function(t,e){var n,r,i,e=e||{};if(!t)throw Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+t+"'.");if(function(t){for(var e=0;b.length>e;e++)if(t===b[e])return 1}(t))throw Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+t+"'. The type name is invalid.");if(v(t))throw Error("DuplicateDefinitionError: a type with name '"+t+"' is already registered");e.prototype||(e.prototype=Object.create(HTMLElement.prototype)),e.__name=t.toLowerCase(),e.lifecycle=e.lifecycle||{},e.ancestry=function t(e){e=v(e);return e?t(e.extends).concat([e]):[]}(e.extends);for(var o,a=e,s=a.extends,c=0;o=a.ancestry[c];c++)s=o.is&&o.tag;a.tag=s||a.__name,s&&(a.is=a.__name);var t=e;if(!Object.__proto__){var l=HTMLElement.prototype;t.is&&(p=document.createElement(t.tag),l=Object.getPrototypeOf(p));for(var u,d=t.prototype,h=!1;d;)d==l&&(h=!0),(u=Object.getPrototypeOf(d))&&(d.__proto__=u),d=u;h||console.warn(t.tag+" prototype not found in prototype chain for "+t.is),t.native=l}var p=e.prototype;return p.setAttribute._polyfilled||(n=p.setAttribute,p.setAttribute=function(t,e){m.call(this,t,e,n)},r=p.removeAttribute,p.removeAttribute=function(t){m.call(this,t,null,r)},p.setAttribute._polyfilled=!0),t=e.__name,(w[t]=e).ctor=(i=e,function(){return g(_((t=i).tag),t);var t}),e.ctor.prototype=e.prototype,e.prototype.constructor=e.ctor,f.ready&&y(document),e.ctor},document.createElement=i,document.createElementNS=function(t,e,n){return"http://www.w3.org/1999/xhtml"===t?i(e,n):s(t,e)},f.registry=w,f.instanceof=a,f.reservedTagList=b,f.getRegisteredDefinition=v,document.register=document.registerElement}),function(t){function e(){i(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(t){setTimeout(t,16)})(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=t.useNative,r=t.initializeModules,i=(t.isIE,n?(t.watchShadow=n=function(){},t.upgrade=n,t.upgradeAll=n,t.upgradeDocumentTree=n,t.upgradeSubtree=n,t.takeRecords=n,t.instanceof=function(t,e){return t instanceof e}):r(),t.upgradeDocumentTree),o=t.upgradeDocument;window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(t){t.import&&o(wrap(t.import))}),"complete"!==document.readyState&&!t.flags.eager&&("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready)?(n=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded",window.addEventListener(n,e)):e()}(window.CustomElements),function(){var t=document.createElement("style"),e=(t.textContent="body {transition: opacity ease-in 0.2s; } \nbody[unresolved] {opacity: 0; display: block; overflow: hidden; position: relative; } \n",document.querySelector("head"));e.insertBefore(t,e.firstChild)}(window.WebComponents),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.PointerEventsPolyfill=e()}(this,function(){"use strict";function t(){this.array=[],this.size=0}function e(t,e,n,r){this.addCallback=t.bind(r),this.removeCallback=e.bind(r),this.changedCallback=n.bind(r),_&&(this.observer=new _(this.mutationWatcher.bind(this)))}function n(t){return"body /shadow-deep/ "+r(t)}function r(t){return'[touch-action="'+t+'"]'}function i(t){return"{ -ms-touch-action: "+t+"; touch-action: "+t+"; touch-action-delay: none; }"}function o(t){if(!m.pointermap.has(t))throw Error("InvalidPointerId")}var a=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","pageX","pageY"],s=[!1,!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0],c=function(t,e){e=e||Object.create(null);var n=document.createEvent("Event");n.initEvent(t,e.bubbles||!1,e.cancelable||!1);for(var r,i=2;i<a.length;i++)n[r=a[i]]=e[r]||s[i];return n.buttons=e.buttons||0,t=e.pressure||(n.buttons?.5:0),n.x=n.clientX,n.y=n.clientY,n.pointerId=e.pointerId||0,n.width=e.width||0,n.height=e.height||0,n.pressure=t,n.tiltX=e.tiltX||0,n.tiltY=e.tiltY||0,n.pointerType=e.pointerType||"",n.hwTimestamp=e.hwTimestamp||0,n.isPrimary=e.isPrimary||!1,n},l=window.Map&&window.Map.prototype.forEach?Map:t,u=["bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","buttons","pointerId","width","height","pressure","tiltX","tiltY","pointerType","hwTimestamp","isPrimary","type","target","currentTarget","which","pageX","pageY","timeStamp"],d=[!(t.prototype={set:function(t,e){return void 0===e?this.delete(t):(this.has(t)||this.size++,void(this.array[t]=e))},has:function(t){return void 0!==this.array[t]},delete:function(t){this.has(t)&&(delete this.array[t],this.size--)},get:function(t){return this.array[t]},clear:function(){this.array.length=0,this.size=0},forEach:function(n,r){return this.array.forEach(function(t,e){n.call(r,t,e,this)},this)}}),!1,null,null,0,0,0,0,!1,!1,!1,!1,0,null,0,0,0,0,0,0,0,"",0,!1,"",null,null,0,0,0,0],h={pointerover:1,pointerout:1,pointerenter:1,pointerleave:1},p="undefined"!=typeof SVGElementInstance,f={pointermap:new l,eventMap:Object.create(null),captureInfo:Object.create(null),eventSources:Object.create(null),eventSourceList:[],registerSource:function(t,e){var n=e,e=n.events;e&&(e.forEach(function(t){n[t]&&(this.eventMap[t]=n[t].bind(n))},this),this.eventSources[t]=n,this.eventSourceList.push(n))},register:function(t){for(var e,n=this.eventSourceList.length,r=0;r<n&&(e=this.eventSourceList[r]);r++)e.register.call(e,t)},unregister:function(t){for(var e,n=this.eventSourceList.length,r=0;r<n&&(e=this.eventSourceList[r]);r++)e.unregister.call(e,t)},contains:function(t,e){try{return t.contains(e)}catch(t){return!1}},down:function(t){t.bubbles=!0,this.fireEvent("pointerdown",t)},move:function(t){t.bubbles=!0,this.fireEvent("pointermove",t)},up:function(t){t.bubbles=!0,this.fireEvent("pointerup",t)},enter:function(t){t.bubbles=!1,this.fireEvent("pointerenter",t)},leave:function(t){t.bubbles=!1,this.fireEvent("pointerleave",t)},over:function(t){t.bubbles=!0,this.fireEvent("pointerover",t)},out:function(t){t.bubbles=!0,this.fireEvent("pointerout",t)},cancel:function(t){t.bubbles=!0,this.fireEvent("pointercancel",t)},leaveOut:function(t){this.out(t),this.contains(t.target,t.relatedTarget)||this.leave(t)},enterOver:function(t){this.over(t),this.contains(t.target,t.relatedTarget)||this.enter(t)},eventHandler:function(t){var e;t._handledByPE||(e=t.type,(e=this.eventMap&&this.eventMap[e])&&e(t),t._handledByPE=!0)},listen:function(e,t){t.forEach(function(t){this.addEvent(e,t)},this)},unlisten:function(e,t){t.forEach(function(t){this.removeEvent(e,t)},this)},addEvent:function(t,e){t.addEventListener(e,this.boundHandler)},removeEvent:function(t,e){t.removeEventListener(e,this.boundHandler)},makeEvent:function(t,e){this.captureInfo[e.pointerId]&&(e.relatedTarget=null);t=new c(t,e);return e.preventDefault&&(t.preventDefault=e.preventDefault),t._target=t._target||e.target,t},fireEvent:function(t,e){t=this.makeEvent(t,e);return this.dispatchEvent(t)},cloneEvent:function(t){for(var e,n=Object.create(null),r=0;r<u.length;r++)n[e=u[r]]=t[e]||d[r],!p||"target"!==e&&"relatedTarget"!==e||n[e]instanceof SVGElementInstance&&(n[e]=n[e].correspondingUseElement);return t.preventDefault&&(n.preventDefault=function(){t.preventDefault()}),n},getTarget:function(t){var e=this.captureInfo[t.pointerId];return e?t._target!==e&&t.type in h?void 0:e:t._target},setCapture:function(t,e){this.captureInfo[t]&&this.releaseCapture(t),this.captureInfo[t]=e;var n=document.createEvent("Event");n.initEvent("gotpointercapture",!0,!1),n.pointerId=t,this.implicitRelease=this.releaseCapture.bind(this,t),document.addEventListener("pointerup",this.implicitRelease),document.addEventListener("pointercancel",this.implicitRelease),n._target=e,this.asyncDispatchEvent(n)},releaseCapture:function(t){var e,n=this.captureInfo[t];n&&((e=document.createEvent("Event")).initEvent("lostpointercapture",!0,!1),e.pointerId=t,this.captureInfo[t]=void 0,document.removeEventListener("pointerup",this.implicitRelease),document.removeEventListener("pointercancel",this.implicitRelease),e._target=n,this.asyncDispatchEvent(e))},dispatchEvent:function(t){var e=this.getTarget(t);return e?e.dispatchEvent(t):void 0},asyncDispatchEvent:function(t){requestAnimationFrame(this.dispatchEvent.bind(this,t))}},m=(f.boundHandler=f.eventHandler.bind(f),f),v={shadow:function(t){return t?t.shadowRoot||t.webkitShadowRoot:void 0},canTarget:function(t){return t&&Boolean(t.elementFromPoint)},targetingShadow:function(t){t=this.shadow(t);return this.canTarget(t)?t:void 0},olderShadow:function(t){var e=t.olderShadowRoot;return e||(t=t.querySelector("shadow"))&&(e=t.olderShadowRoot),e},allShadows:function(t){for(var e=[],n=this.shadow(t);n;)e.push(n),n=this.olderShadow(n);return e},searchRoot:function(t,e,n){if(t){for(var r,i,t=t.elementFromPoint(e,n),o=this.targetingShadow(t);o;){if(r=o.elementFromPoint(e,n))return i=this.targetingShadow(r),this.searchRoot(i,e,n)||r;o=this.olderShadow(o)}return t}},owner:function(t){for(var e=t;e.parentNode;)e=e.parentNode;return e=e.nodeType!==Node.DOCUMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?document:e},findTarget:function(t){var e=t.clientX,n=t.clientY,t=this.owner(t.target);return t.elementFromPoint(e,n)||(t=document),this.searchRoot(t,e,n)}},y=Array.prototype.forEach.call.bind(Array.prototype.forEach),g=Array.prototype.map.call.bind(Array.prototype.map),b=Array.prototype.slice.call.bind(Array.prototype.slice),w=Array.prototype.filter.call.bind(Array.prototype.filter),_=window.MutationObserver||window.WebKitMutationObserver,R={subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0,attributeFilter:["touch-action"]},f=(e.prototype={watchSubtree:function(t){this.observer&&v.canTarget(t)&&this.observer.observe(t,R)},enableOnSubtree:function(t){this.watchSubtree(t),t===document&&"complete"!==document.readyState?this.installOnLoad():this.installNewSubtree(t)},installNewSubtree:function(t){y(this.findElements(t),this.addElement,this)},findElements:function(t){return t.querySelectorAll?t.querySelectorAll("[touch-action]"):[]},removeElement:function(t){this.removeCallback(t)},addElement:function(t){this.addCallback(t)},elementChanged:function(t,e){this.changedCallback(t,e)},concatLists:function(t,e){return t.concat(b(e))},installOnLoad:function(){document.addEventListener("readystatechange",function(){"complete"===document.readyState&&this.installNewSubtree(document)}.bind(this))},isElement:function(t){return t.nodeType===Node.ELEMENT_NODE},flattenMutationTree:function(t){var e=g(t,this.findElements,this);return e.push(w(t,this.isElement)),e.reduce(this.concatLists,[])},mutationWatcher:function(t){t.forEach(this.mutationHandler,this)},mutationHandler:function(t){"childList"===t.type?(this.flattenMutationTree(t.addedNodes).forEach(this.addElement,this),this.flattenMutationTree(t.removedNodes).forEach(this.removeElement,this)):"attributes"===t.type&&this.elementChanged(t.target,t.oldValue)}},e),E=["none","auto","pan-x","pan-y",{rule:"pan-x pan-y",selectors:["pan-x pan-y","pan-y pan-x"]}],T="",C=window.PointerEvent||window.MSPointerEvent,L=!window.ShadowDOMPolyfill&&document.head.createShadowRoot,M=m.pointermap,S=[1,4,2,8,16],P=!1;try{P=1===new MouseEvent("test",{buttons:1}).buttons}catch(t){}var O,N={POINTER_ID:1,POINTER_TYPE:"mouse",events:["mousedown","mousemove","mouseup","mouseover","mouseout"],register:function(t){m.listen(t,this.events)},unregister:function(t){m.unlisten(t,this.events)},lastTouches:[],isEventSimulatedFromTouch:function(t){for(var e,n=this.lastTouches,r=t.clientX,i=t.clientY,o=0,a=n.length;o<a&&(e=n[o]);o++){var s=Math.abs(r-e.x),c=Math.abs(i-e.y);if(s<=25&&c<=25)return!0}},prepareEvent:function(t){var e=m.cloneEvent(t),n=e.preventDefault;return e.preventDefault=function(){t.preventDefault(),n()},e.pointerId=this.POINTER_ID,e.isPrimary=!0,e.pointerType=this.POINTER_TYPE,e},prepareButtonsForMove:function(t,e){var n=M.get(this.POINTER_ID);t.buttons=n?n.buttons:0,e.buttons=t.buttons},mousedown:function(t){var e,n;this.isEventSimulatedFromTouch(t)||(e=M.get(this.POINTER_ID),n=this.prepareEvent(t),P||(n.buttons=S[n.button],e&&(n.buttons|=e.buttons),t.buttons=n.buttons),M.set(this.POINTER_ID,t),e?m.move(n):m.down(n))},mousemove:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),P||this.prepareButtonsForMove(e,t),m.move(e))},mouseup:function(t){var e,n,r;this.isEventSimulatedFromTouch(t)||(e=M.get(this.POINTER_ID),n=this.prepareEvent(t),P||(r=S[n.button],n.buttons=e?e.buttons&~r:0,t.buttons=n.buttons),M.set(this.POINTER_ID,t),0===n.buttons||n.buttons===S[n.button]?(this.cleanupMouse(),m.up(n)):m.move(n))},mouseover:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),P||this.prepareButtonsForMove(e,t),m.enterOver(e))},mouseout:function(t){var e;this.isEventSimulatedFromTouch(t)||(e=this.prepareEvent(t),P||this.prepareButtonsForMove(e,t),m.leaveOut(e))},cancel:function(t){t=this.prepareEvent(t);m.cancel(t),this.cleanupMouse()},cleanupMouse:function(){M.delete(this.POINTER_ID)}},H=m.captureInfo,q=v.findTarget.bind(v),I=v.allShadows.bind(v),x=m.pointermap,k="touch-action",D={events:["touchstart","touchmove","touchend","touchcancel"],register:function(t){j.enableOnSubtree(t)},unregister:function(t){},elementAdded:function(t){var e=t.getAttribute(k),n=this.touchActionToScrollType(e);n&&(t._scrollType=n,m.listen(t,this.events),I(t).forEach(function(t){t._scrollType=n,m.listen(t,this.events)},this))},elementRemoved:function(t){t._scrollType=void 0,m.unlisten(t,this.events),I(t).forEach(function(t){t._scrollType=void 0,m.unlisten(t,this.events)},this)},elementChanged:function(t,e){var n=t.getAttribute(k),r=this.touchActionToScrollType(n),n=this.touchActionToScrollType(e);r&&n?(t._scrollType=r,I(t).forEach(function(t){t._scrollType=r},this)):n?this.elementRemoved(t):r&&this.elementAdded(t)},scrollTypes:{EMITTER:"none",XSCROLLER:"pan-x",YSCROLLER:"pan-y",SCROLLER:/^(?:pan-x pan-y)|(?:pan-y pan-x)|auto$/},touchActionToScrollType:function(t){var e=this.scrollTypes;return"none"===t?"none":t===e.XSCROLLER?"X":t===e.YSCROLLER?"Y":e.SCROLLER.exec(t)?"XY":void 0},POINTER_TYPE:"touch",firstTouch:null,isPrimaryTouch:function(t){return this.firstTouch===t.identifier},setPrimaryTouch:function(t){(0===x.size||1===x.size&&x.has(1))&&(this.firstTouch=t.identifier,this.firstXY={X:t.clientX,Y:t.clientY},this.scrolling=!1,this.cancelResetClickCount())},removePrimaryPointer:function(t){t.isPrimary&&(this.firstTouch=null,this.firstXY=null,this.resetClickCount())},clickCount:0,resetId:null,resetClickCount:function(){var t=function(){this.clickCount=0,this.resetId=null}.bind(this);this.resetId=setTimeout(t,200)},cancelResetClickCount:function(){this.resetId&&clearTimeout(this.resetId)},typeToButtons:function(t){return"touchstart"!==t&&"touchmove"!==t?0:1},touchToPointer:function(t){var e=this.currentTouchEvent,n=m.cloneEvent(t),r=n.pointerId=t.identifier+2,i=(n.target=H[r]||q(n),n.bubbles=!0,n.cancelable=!0,n.detail=this.clickCount,n.button=0,n.buttons=this.typeToButtons(e.type),n.width=t.radiusX||t.webkitRadiusX||0,n.height=t.radiusY||t.webkitRadiusY||0,n.pressure=t.force||t.webkitForce||.5,n.isPrimary=this.isPrimaryTouch(t),n.pointerType=this.POINTER_TYPE,this);return n.preventDefault=function(){i.scrolling=!1,i.firstXY=null,e.preventDefault()},n},processTouches:function(t,e){var n=t.changedTouches;this.currentTouchEvent=t;for(var r,i=0;n.length>i;i++)r=n[i],e.call(this,this.touchToPointer(r))},shouldScroll:function(t){var e,n;if(this.firstXY)return t="none"!==(n=t.currentTarget._scrollType)&&("XY"===n||(t=t.changedTouches[0],e="Y"===n?"X":"Y",n=Math.abs(t["client"+n]-this.firstXY[n]),Math.abs(t["client"+e]-this.firstXY[e])<=n)),this.firstXY=null,t},findTouch:function(t,e){for(var n,r=0,i=t.length;r<i&&(n=t[r]);r++)if(n.identifier===e)return!0},vacuumTouches:function(t){var n,r=t.touches;x.size>=r.length&&(n=[],x.forEach(function(t,e){1===e||this.findTouch(r,e-2)||(e=t.out,n.push(e))},this),n.forEach(this.cancelOut,this))},touchstart:function(t){this.vacuumTouches(t),this.setPrimaryTouch(t.changedTouches[0]),this.dedupSynthMouse(t),this.scrolling||(this.clickCount++,this.processTouches(t,this.overDown))},overDown:function(t){x.set(t.pointerId,{target:t.target,out:t,outTarget:t.target}),m.over(t),m.enter(t),m.down(t)},touchmove:function(t){this.scrolling||(this.shouldScroll(t)?(this.scrolling=!0,this.touchcancel(t)):(t.preventDefault(),this.processTouches(t,this.moveOverOut)))},moveOverOut:function(t){var e,n,r=x.get(t.pointerId);r&&(e=r.out,n=r.outTarget,m.move(t),e&&n!==t.target&&(e.relatedTarget=t.target,t.relatedTarget=n,e.target=n,t.target?(m.leaveOut(e),m.enterOver(t)):(t.target=n,t.relatedTarget=null,this.cancelOut(t))),r.out=t,r.outTarget=t.target)},touchend:function(t){this.dedupSynthMouse(t),this.processTouches(t,this.upOut)},upOut:function(t){this.scrolling||(m.up(t),m.out(t),m.leave(t)),this.cleanUpPointer(t)},touchcancel:function(t){this.processTouches(t,this.cancelOut)},cancelOut:function(t){m.cancel(t),m.out(t),m.leave(t),this.cleanUpPointer(t)},cleanUpPointer:function(t){x.delete(t.pointerId),this.removePrimaryPointer(t)},dedupSynthMouse:function(t){var e=N.lastTouches,t=t.changedTouches[0];this.isPrimaryTouch(t)&&(t={x:t.clientX,y:t.clientY},e.push(t),e=function(t,e){e=t.indexOf(e);-1<e&&t.splice(e,1)}.bind(null,e,t),setTimeout(e,2500))}},j=new f(D.elementAdded,D.elementRemoved,D.elementChanged,D),A=m.pointermap,F=window.MSPointerEvent&&"number"==typeof window.MSPointerEvent.MSPOINTER_TYPE_MOUSE,U={events:["MSPointerDown","MSPointerMove","MSPointerUp","MSPointerOut","MSPointerOver","MSPointerCancel","MSGotPointerCapture","MSLostPointerCapture"],register:function(t){m.listen(t,this.events)},unregister:function(t){m.unlisten(t,this.events)},POINTER_TYPES:["","unavailable","touch","pen","mouse"],prepareEvent:function(t){var e=t;return F&&((e=m.cloneEvent(t)).pointerType=this.POINTER_TYPES[t.pointerType]),e},cleanup:function(t){A.delete(t)},MSPointerDown:function(t){A.set(t.pointerId,t);t=this.prepareEvent(t);m.down(t)},MSPointerMove:function(t){t=this.prepareEvent(t);m.move(t)},MSPointerUp:function(t){var e=this.prepareEvent(t);m.up(e),this.cleanup(t.pointerId)},MSPointerOut:function(t){t=this.prepareEvent(t);m.leaveOut(t)},MSPointerOver:function(t){t=this.prepareEvent(t);m.enterOver(t)},MSPointerCancel:function(t){var e=this.prepareEvent(t);m.cancel(e),this.cleanup(t.pointerId)},MSLostPointerCapture:function(t){t=m.makeEvent("lostpointercapture",t);m.dispatchEvent(t)},MSGotPointerCapture:function(t){t=m.makeEvent("gotpointercapture",t);m.dispatchEvent(t)}},Y=window.navigator.msPointerEnabled?(O=function(t){o(t),this.msSetPointerCapture(t)},function(t){o(t),this.msReleasePointerCapture(t)}):(O=function(t){o(t),m.setCapture(t,this)},function(t){o(t),m.releaseCapture(t,this)});return C&&(E.forEach(function(t){t+""===t?(T+=r(t)+i(t)+"\n",L&&(T+=n(t)+i(t)+"\n")):(T+=t.selectors.map(r)+i(t.rule)+"\n",L&&(T+=t.selectors.map(n)+i(t.rule)+"\n"))}),(C=document.createElement("style")).textContent=T,document.head.appendChild(C)),window.PointerEvent||(window.PointerEvent=c,window.navigator.msPointerEnabled?(E=window.navigator.msMaxTouchPoints,Object.defineProperty(window.navigator,"maxTouchPoints",{value:E,enumerable:!0}),m.registerSource("ms",U)):(m.registerSource("mouse",N),void 0!==window.ontouchstart&&m.registerSource("touch",D)),m.register(document)),window.Element&&!Element.prototype.setPointerCapture&&Object.defineProperties(Element.prototype,{setPointerCapture:{value:O},releasePointerCapture:{value:Y}}),{dispatcher:m,Installer:f,PointerEvent:c,PointerMap:l,targetFinding:v}}),function(){function s(t){t=N.call(t);return O[t]||(O[t]=t.match(I)[1].toLowerCase())}function i(t,e){e=i[e||s(t)];return e?e(t):t}function p(t){return R[s(t)]?[t]:Array.prototype.slice.call(t,0)}function c(t,e,n){var r=s(n);return"object"==r&&"object"==s(t[e])?A.merge(t[e],n):t[e]=i(n,r),t}function d(t,e,n){var r,i,o={};for(i in e)o[i.split(":")[0]]=i;for(i in n)r=o[i.split(":")[0]],"function"==typeof e[r]?(r.match(":mixins")||(e[r+":mixins"]=e[r],delete e[r],r+=":mixins"),e[r].__mixin__=A.applyPseudos(i+(i.match(":mixins")?"":":mixins"),n[i],t.pseudos,e[r].__mixin__)):(e[i]=n[i],delete e[r])}function f(u){return function t(e,n){for(var r=e.length;r--;)n.unshift(e[r]),A.mixins[e[r]].mixins&&t(A.mixins[e[r]].mixins,n);return n}(u.mixins,[]).forEach(function(t){var e,n=A.mixins[t];for(e in n){var r=n[e],i=u[e];if(i)switch(e){case"mixins":break;case"events":o=c=s=a=void 0;var o,a=u,s=i,c=r;for(o in c)s[o+":__mixin__("+H+++")"]=A.applyPseudos(o,c[o],a.pseudos);break;case"accessors":case"prototype":for(var l in r)i[l]?d(u,i[l],r[l]):i[l]=r[l];break;default:d(u,i,r)}else u[e]=r}}),u}function t(t){return 0===t.button}function o(t,e){var n,r,i,o,a,s=Object.getOwnPropertyDescriptor(t,"target");for(n in e)x[n]||(r=n,i=t,o=e,a=s,a?i[r]=o[r]:Object.defineProperty(i,r,{writable:!0,enumerable:!0,value:o[r]}));t.baseEvent=e}function m(t,e,n,r,i){a[i].call(t,n,e&&e.boolean?"":r)}function v(t,e,n,r,i){if(e&&(e.property||e.selector))for(var o=e.property?[t.xtag[e.property]]:e.selector?A.query(t,e.selector):[],a=o.length;a--;)o[a][i](n,r)}function y(t,e){t.prototype[e]={};var n,r,i,o=t.accessors[e],a=o.attribute;for(r in a&&(n=a.name=(a?a.name||e.replace(T,"$1-$2"):e).toLowerCase(),a.key=e,t.attributes[n]=a),o)!function(t,e,r,i,o,a){var n=r.split(":"),s=n[0];"get"==s?(n[0]=e,t.prototype[e].get=A.applyPseudos(n.join(":"),i[r],t.pseudos,i[r])):"set"==s?(n[0]=e,t.prototype[e].set=A.applyPseudos(n.join(":"),o?function(t){var e,n="setAttribute";o.boolean?(t=!!t,e=this.hasAttribute(a),t||(n="removeAttribute")):(t=o.validate?o.validate.call(this,t):t,e=this.getAttribute(a)),m(this,o,a,t,n),i[r].call(this,t,e),v(this,o,a,t,n)}:i[r]?function(t){i[r].call(this,t)}:null,t.pseudos,i[r]),o&&(o.setter=i[r])):t.prototype[e][r]=i[r]}(t,e,r,o,a,n);a&&(t.prototype[e].get||(i=(a.boolean?"has":"get")+"Attribute",t.prototype[e].get=function(){return this[i](n)}),t.prototype[e].set||(t.prototype[e].set=function(t){t=a.boolean?!!t:a.validate?a.validate.call(this,t):t;var e=!a.boolean||t?"setAttribute":"removeAttribute";m(this,a,n,t,e),v(this,a,n,t,e)}))}function g(t){return"function"==typeof t?q.exec(""+t)[1]:t}function h(){}function b(){return!0}var e,n,w=window,_=document,a={setAttribute:Element.prototype.setAttribute,removeAttribute:Element.prototype.removeAttribute},E=Element.prototype.createShadowRoot,l=_.createElement("div"),u=/,/g,T=/([a-z])([A-Z])/g,r=/\(|\)/g,C=/:(\w+)\u276A(.+?(?=\u276B))|:(\w+)/g,L=/(\d+)/g,M={action:function(t,e){return-1<t.value.match(L).indexOf(e.keyCode+"")==("keypass"==t.name)||null}},S={dom:"ms"==(e=((e=Object.keys(window).join()).match(/,(ms)/)||e.match(/,(moz)/)||e.match(/,(O)/)||[null,"webkit"])[1].toLowerCase())?"MS":e,lowercase:e,css:"-"+e+"-",js:"ms"==e?e:e.charAt(0).toUpperCase()+e.substring(1)},P=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype[S.lowercase+"MatchesSelector"],O={},N=O.toString,I=/\s([a-zA-Z]+)/,R=(i.object=function(t){var e,n={};for(e in t)n[e]=i(t[e]);return n},i.array=function(t){for(var e=t.length,n=Array(e);e--;)n[e]=i(t[e]);return n},{undefined:1,null:1,number:1,boolean:1,string:1,function:1}),H=0,x={};for(n in _.createEvent("CustomEvent"))x[n]=1;var k,D,q=/\/\*!?(?:\@preserve)?[ \t]*(?:\r\n|\n)([\s\S]*?)(?:\r\n|\n)\s*\*\//,A={tags:{},defaultOptions:{pseudos:[],mixins:[],events:{},methods:{},accessors:{},lifecycle:{},attributes:{},prototype:{xtag:{get:function(){return this.__xtag__||(this.__xtag__={data:{}})}}}},register:function(t,e){if("string"!=typeof t)throw"First argument must be a Custom Element string name";t=t.toLowerCase(),A.tags[t]=e||{};var n,i=e.prototype,a=(delete e.prototype,A.tags[t].compiled=f(A.merge({},A.defaultOptions,e))),o=a.prototype,r=a.lifecycle;for(n in a.events)a.events[n]=A.parseEvent(n,a.events[n]);for(n in r)r[n.split(":")[0]]=A.applyPseudos(n,r[n],a.pseudos,r[n]);for(n in a.methods)o[n.split(":")[0]]={value:A.applyPseudos(n,a.methods[n],a.pseudos,a.methods[n]),enumerable:!0};for(n in a.accessors)y(a,n);a.shadow&&(a.shadow=a.shadow.nodeName?a.shadow:A.createFragment(a.shadow)),a.content&&(a.content=a.content.nodeName?a.content.innerHTML:g(a.content));var s=r.created,c=r.finalized,l=(o.createdCallback={enumerable:!0,value:function(){var t,e=this,n=(a.shadow&&E&&this.createShadowRoot().appendChild(a.shadow.cloneNode(!0)),a.content&&(this.appendChild(document.createElement("div")).outerHTML=a.content),s?s.apply(this,arguments):null);for(t in A.addEvents(this,a.events),a.attributes){var r=a.attributes[t],i=this.hasAttribute(t),o=void 0!==r.def;(i||r.boolean||o)&&(this[r.key]=r.boolean?i:!i&&o?r.def:this.getAttribute(t))}return a.pseudos.forEach(function(t){t.onAdd.call(e,t)}),this.xtagComponentReady=!0,c&&c.apply(this,arguments),n}},r.inserted),u=r.removed,e=((l||u)&&(o.attachedCallback={value:function(){return u&&(this.xtag.__parentNode__=this.parentNode),l?l.apply(this,arguments):void 0},enumerable:!0}),u&&(o.detachedCallback={value:function(){var t=p(arguments),t=(t.unshift(this.xtag.__parentNode__),u.apply(this,t));return delete this.xtag.__parentNode__,t},enumerable:!0}),r.attributeChanged&&(o.attributeChangedCallback={value:r.attributeChanged,enumerable:!0}),o.setAttribute={writable:!0,enumerable:!0,value:function(t,e){var n,t=t.toLowerCase(),r=a.attributes[t];r&&(n=this.getAttribute(t),e=r.boolean?"":r.validate?r.validate.call(this,e):e),m(this,r,t,e,"setAttribute"),r&&(r.setter&&r.setter.call(this,!!r.boolean||e,n),v(this,r,t,e,"setAttribute"))}},o.removeAttribute={writable:!0,enumerable:!0,value:function(t){var t=t.toLowerCase(),e=a.attributes[t],n=this.hasAttribute(t);m(this,e,t,"","removeAttribute"),e&&(e.setter&&e.setter.call(this,!e.boolean&&void 0,n),v(this,e,t,"","removeAttribute"))}},{}),d=i instanceof w.HTMLElement,h=a.extends&&(e.extends=a.extends);return i&&Object.getOwnPropertyNames(i).forEach(function(t){var e=o[t],n=d?Object.getOwnPropertyDescriptor(i,t):i[t];if(e)for(var r in n)e[r]="function"==typeof n[r]&&e[r]?A.wrap(n[r],e[r]):n[r];o[t]=e||n}),e.prototype=Object.create((h?Object.create(_.createElement(h).constructor):w.HTMLElement).prototype,o),_.registerElement(t,e)},mixins:{},prefix:S,captureEvents:{focus:1,blur:1,scroll:1,DOMMouseScroll:1},customEvents:{animationstart:{attach:[S.dom+"AnimationStart"]},animationend:{attach:[S.dom+"AnimationEnd"]},transitionend:{attach:[S.dom+"TransitionEnd"]},move:{attach:["pointermove"]},enter:{attach:["pointerenter"]},leave:{attach:["pointerleave"]},scrollwheel:{attach:["DOMMouseScroll","mousewheel"],condition:function(t){return t.delta=t.wheelDelta?t.wheelDelta/40:Math.round(t.detail/3.5*-1),!0}},tap:{attach:["pointerdown","pointerup"],condition:function(t,e){if("pointerdown"==t.type)e.startX=t.clientX,e.startY=t.clientY;else if(0===t.button&&Math.abs(e.startX-t.clientX)<10&&Math.abs(e.startY-t.clientY)<10)return!0}},tapstart:{attach:["pointerdown"],condition:t},tapend:{attach:["pointerup"],condition:t},tapmove:{attach:["pointerdown"],condition:function(t,e){var n;return"pointerdown"==t.type?(n=e.listener.bind(this),e.tapmoveListeners||(e.tapmoveListeners=A.addEvents(document,{pointermove:n,pointerup:n,pointercancel:n}))):"pointerup"!=t.type&&"pointercancel"!=t.type||(A.removeEvents(document,e.tapmoveListeners),e.tapmoveListeners=null),!0}},taphold:{attach:["pointerdown","pointerup"],condition:function(t,e){if("pointerdown"==t.type)(e.pointers=e.pointers||{})[t.pointerId]=setTimeout(A.fireEvent.bind(null,this,"taphold"),e.duration||1e3);else{if("pointerup"!=t.type)return!0;e.pointers&&(clearTimeout(e.pointers[t.pointerId]),delete e.pointers[t.pointerId])}}}},pseudos:{__mixin__:{},mixins:{onCompiled:function(e,t){var n=t.source&&t.source.__mixin__||t.source;if(!n)return e;switch(t.value){case null:case"":case"before":return function(){return n.apply(this,arguments),e.apply(this,arguments)};case"after":return function(){var t=e.apply(this,arguments);return n.apply(this,arguments),t};case"none":return e}}},keypass:M,keyfail:M,delegate:{action:function(t,e){for(var n,r=e.target,i=e.currentTarget;!n&&r&&r!=i;)r.tagName&&P.call(r,t.value)&&(n=r),r=r.parentNode;return(n=!n&&i.tagName&&P.call(i,t.value)?i:n)?t.listener=t.listener.bind(n):null}},preventable:{action:function(t,e){return!e.defaultPrevented}},duration:{onAdd:function(t){t.source.duration=Number(t.value)}},capture:{onCompiled:function(t,e){e.source&&(e.source.capture=!0)}}},clone:i,typeOf:s,toArray:p,wrap:function(e,n){return function(){var t=e.apply(this,arguments);return n.apply(this,arguments),t}},merge:function(t,e,n){if("string"==s(e))return c(t,e,n);for(var r=1,i=arguments.length;r<i;r++){var o,a=arguments[r];for(o in a)c(t,o,a[o])}return t},uid:function(){return Math.random().toString(36).substr(2,10)},query:function(t,e){return(e||"").length?p(t.querySelectorAll(e)):[]},skipTransition:function(t,e,n){var r=S.js+"TransitionProperty",i=(t.style[r]=t.style.transitionProperty="none",e?e.call(n||t):null);return A.skipFrame(function(){t.style[r]=t.style.transitionProperty="",i&&i.call(n||t)})},requestFrame:(D=w.requestAnimationFrame||w[S.lowercase+"RequestAnimationFrame"]||function(t){return w.setTimeout(t,20)},function(t){return D(t)}),cancelFrame:(k=w.cancelAnimationFrame||w[S.lowercase+"CancelAnimationFrame"]||w.clearTimeout,function(t){return k(t)}),skipFrame:function(t){var e=A.requestFrame(function(){e=A.requestFrame(t)});return e},matchSelector:function(t,e){return P.call(t,e)},set:function(t,e,n){t[e]=n,window.CustomElements&&CustomElements.upgradeAll(t)},innerHTML:function(t,e){A.set(t,"innerHTML",e)},hasClass:function(t,e){return-1<t.className.split(" ").indexOf(e.trim())},addClass:function(t,e){var n=t.className.trim().split(" ");return e.trim().split(" ").forEach(function(t){~n.indexOf(t)||n.push(t)}),t.className=n.join(" ").trim(),t},removeClass:function(t,e){var n=e.trim().split(" ");return t.className=t.className.trim().split(" ").filter(function(t){return t&&!~n.indexOf(t)}).join(" "),t},toggleClass:function(t,e){return A[A.hasClass(t,e)?"removeClass":"addClass"].call(null,t,e)},queryChildren:function(t,e){var n=t.id,r="#"+(t.id=n||"x_"+A.uid())+" > ",i=t.parentNode||!l.appendChild(t),r=(e=r+(e+"").replace(u,","+r),t.parentNode.querySelectorAll(e));return n||t.removeAttribute("id"),i||l.removeChild(t),p(r)},createFragment:function(t){var e=document.createElement("template");return t&&(t.nodeName?p(arguments).forEach(function(t){e.content.appendChild(t)}):e.innerHTML=g(t)),document.importNode(e.content,!0)},manipulate:function(t,e){var n=t.nextSibling,r=t.parentNode,e=e.call(t)||t;n?r.insertBefore(e,n):r.appendChild(e)},applyPseudos:function(i,o,a,s){var t,c=o,l={};if(i.match(":")){var u=[],e=0;i.replace(r,function(t){return"("==t?1==++e?"❪":"(":--e?")":"❫"}).replace(C,function(t,e,n,r){u.push([e||r,n])});for(var d=u.length;d--;)!function(){var t=u[d][0],e=u[d][1];if(!A.pseudos[t])throw"pseudo not found: "+t+" "+e;var e=""===e||void 0===e?null:e,n=l[d]=Object.create(A.pseudos[t]),r=(n.key=i,n.name=t,n.value=e,n.arguments=(e||"").split(","),n.action=n.action||b,n.source=s,n.onAdd=n.onAdd||h,n.onRemove=n.onRemove||h,n.listener=c);c=function(){var t=n.action.apply(this,[n].concat(p(arguments)));return null===t||!1===t||(t=n.listener.apply(this,arguments),n.listener=r),t},a?a.push(n):n.onAdd.call(o,n)}()}for(t in l)l[t].onCompiled&&(c=l[t].onCompiled(c,l[t])||c);return c},removePseudos:function(e,t){t.forEach(function(t){t.onRemove.call(e,t)})},parseEvent:function(t,e){var t=t.split(":"),r=t.shift(),n=A.customEvents[r],i=A.merge({type:r,stack:h,condition:b,capture:A.captureEvents[r],attach:[],_attach:[],pseudos:"",_pseudos:[],onAdd:h,onRemove:h},n||{}),o=(i.attach=p(i.base||i.attach),i.chain=r+(i.pseudos.length?":"+i.pseudos:"")+(t.length?":"+t.join(":"):""),A.applyPseudos(i.chain,e,i._pseudos,i));return i.stack=function(t){t.currentTarget=t.currentTarget||this;var e=t.detail||{};return e.__stack__?e.__stack__==o?(t.stopPropagation(),t.cancelBubble=!0,o.apply(this,arguments)):void 0:o.apply(this,arguments)},i.listener=function(t){var e=p(arguments),n=i.condition.apply(this,e.concat([i]));return n&&(t.type!=r&&t.baseEvent&&t.type!=t.baseEvent.type?void A.fireEvent(t.target,r,{baseEvent:t,detail:!0!==n&&(n.__stack__=o)?n:{__stack__:o}}):i.stack.apply(this,e))},i.attach.forEach(function(t){i._attach.push(A.parseEvent(t,i.listener))}),i},addEvent:function(e,t,n,r){t="function"==typeof n?A.parseEvent(t,n):n;return t._pseudos.forEach(function(t){t.onAdd.call(e,t)}),t._attach.forEach(function(t){A.addEvent(e,t.type,t)}),t.onAdd.call(e,t,t.listener),e.addEventListener(t.type,t.stack,r||t.capture),t},addEvents:function(t,e){var n,r={};for(n in e)r[n]=A.addEvent(t,n,e[n]);return r},removeEvent:function(e,t,n){(n=n||t).onRemove.call(e,n,n.listener),A.removePseudos(e,n._pseudos),n._attach.forEach(function(t){A.removeEvent(e,t)}),e.removeEventListener(n.type,n.stack)},removeEvents:function(t,e){for(var n in e)A.removeEvent(t,e[n])},fireEvent:function(t,e,n){var r=_.createEvent("CustomEvent");r.initCustomEvent(e,!1!==(n=n||{}).bubbles,!1!==n.cancelable,n.detail),n.baseEvent&&o(r,n.baseEvent),t.dispatchEvent(r)}};"function"==typeof define&&define.amd?define(A):"undefined"!=typeof module&&module.exports?module.exports=A:w.xtag=A,_.addEventListener("WebComponentsReady",function(){A.fireEvent(_.body,"DOMComponentsLoaded")})}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quran-madina-html",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "devDependencies": {
5
5
  "grunt": "^1.6.2",
6
6
  "grunt-contrib-clean": "^2.0.1",
@@ -66,6 +66,7 @@
66
66
  "overrides": {
67
67
  "minimatch": "3.1.5",
68
68
  "undici": "7.28.0",
69
- "lodash": "4.18.1"
69
+ "lodash": "4.18.1",
70
+ "js-yaml": "^3.15.0"
70
71
  }
71
72
  }