astroport/doc/Fat protocols aren't new W.../donate_data/radio-player-controller.js

74 lines
134 KiB
JavaScript

// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3.0
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=86)}({2:function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function s(e){i(a,r,o,s,c,"next",e)}function c(e){i(a,r,o,s,c,"throw",e)}s(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function f(e,t,n){return(f=d()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&h(i,n.prototype),i}).apply(null,arguments)}function p(e){var t="function"==typeof Map?new Map:void 0;return(p=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return f(e,arguments,l(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),h(r,e)})(e)}function v(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function b(e,t,n){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function y(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function m(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return v})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return b})),n.d(t,"h",(function(){return r})),n.d(t,"i",(function(){return p})),n.d(t,"j",(function(){return o})),n.d(t,"k",(function(){return y}))},3:function(e,t,n){"use strict";n.d(t,"a",(function(){return ae})),n.d(t,"b",(function(){return ie})),n.d(t,"c",(function(){return G})),n.d(t,"d",(function(){return F})),n.d(t,"e",(function(){return Y}));var r=n(2),i=new WeakMap,o=function(e){return"function"==typeof e&&i.has(e)},a=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,s=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t!==n;){var r=t.nextSibling;e.removeChild(t),t=r}},c={},u={},l="{{lit-".concat(String(Math.random()).slice(2),"}}"),h="\x3c!--".concat(l,"--\x3e"),d=new RegExp("".concat(l,"|").concat(h)),f=function e(t,n){Object(r.a)(this,e),this.parts=[],this.element=n;for(var i=[],o=[],a=document.createTreeWalker(n.content,133,null,!1),s=0,c=-1,u=0,h=t.strings,f=t.values.length;u<f;){var v=a.nextNode();if(null!==v){if(c++,1===v.nodeType){if(v.hasAttributes()){for(var m=v.attributes,g=m.length,k=0,w=0;w<g;w++)p(m[w].name,"$lit$")&&k++;for(;k-- >0;){var O=h[u],j=y.exec(O)[2],S=j.toLowerCase()+"$lit$",x=v.getAttribute(S);v.removeAttribute(S);var T=x.split(d);this.parts.push({type:"attribute",index:c,name:j,strings:T}),u+=T.length-1}}"TEMPLATE"===v.tagName&&(o.push(v),a.currentNode=v.content)}else if(3===v.nodeType){var _=v.data;if(_.indexOf(l)>=0){for(var E=v.parentNode,C=_.split(d),R=C.length-1,P=0;P<R;P++){var I=void 0,B=C[P];if(""===B)I=b();else{var M=y.exec(B);null!==M&&p(M[2],"$lit$")&&(B=B.slice(0,M.index)+M[1]+M[2].slice(0,-"$lit$".length)+M[3]),I=document.createTextNode(B)}E.insertBefore(I,v),this.parts.push({type:"node",index:++c})}""===C[R]?(E.insertBefore(b(),v),i.push(v)):v.data=C[R],u+=R}}else if(8===v.nodeType)if(v.data===l){var A=v.parentNode;null!==v.previousSibling&&c!==s||(c++,A.insertBefore(b(),v)),s=c,this.parts.push({type:"node",index:c}),null===v.nextSibling?v.data="":(i.push(v),c--),u++}else for(var N=-1;-1!==(N=v.data.indexOf(l,N+1));)this.parts.push({type:"node",index:-1}),u++}else a.currentNode=o.pop()}for(var F=0,U=i;F<U.length;F++){var q=U[F];q.parentNode.removeChild(q)}},p=function(e,t){var n=e.length-t.length;return n>=0&&e.slice(n)===t},v=function(e){return-1!==e.index},b=function(){return document.createComment("")},y=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,m=function(){function e(t,n,i){Object(r.a)(this,e),this.__parts=[],this.template=t,this.processor=n,this.options=i}return Object(r.b)(e,[{key:"update",value:function(e){var t=0,n=!0,r=!1,i=void 0;try{for(var o,a=this.__parts[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var s=o.value;void 0!==s&&s.setValue(e[t]),t++}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var c=!0,u=!1,l=void 0;try{for(var h,d=this.__parts[Symbol.iterator]();!(c=(h=d.next()).done);c=!0){var f=h.value;void 0!==f&&f.commit()}}catch(e){u=!0,l=e}finally{try{c||null==d.return||d.return()}finally{if(u)throw l}}}},{key:"_clone",value:function(){for(var e,t=a?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],i=this.template.parts,o=document.createTreeWalker(t,133,null,!1),s=0,c=0,u=o.nextNode();s<i.length;)if(e=i[s],v(e)){for(;c<e.index;)c++,"TEMPLATE"===u.nodeName&&(n.push(u),o.currentNode=u.content),null===(u=o.nextNode())&&(o.currentNode=n.pop(),u=o.nextNode());if("node"===e.type){var l=this.processor.handleTextExpression(this.options);l.insertAfterNode(u.previousSibling),this.__parts.push(l)}else{var h;(h=this.__parts).push.apply(h,Object(r.c)(this.processor.handleAttributeExpressions(u,e.name,e.strings,this.options)))}s++}else this.__parts.push(void 0),s++;return a&&(document.adoptNode(t),customElements.upgrade(t)),t}}]),e}(),g=" ".concat(l," "),k=function(){function e(t,n,i,o){Object(r.a)(this,e),this.strings=t,this.values=n,this.type=i,this.processor=o}return Object(r.b)(e,[{key:"getHTML",value:function(){for(var e=this.strings.length-1,t="",n=!1,r=0;r<e;r++){var i=this.strings[r],o=i.lastIndexOf("\x3c!--");n=(o>-1||n)&&-1===i.indexOf("--\x3e",o+1);var a=y.exec(i);t+=null===a?i+(n?g:h):i.substr(0,a.index)+a[1]+a[2]+"$lit$"+a[3]+l}return t+=this.strings[e]}},{key:"getTemplateElement",value:function(){var e=document.createElement("template");return e.innerHTML=this.getHTML(),e}}]),e}(),w=function(e){return null===e||!("object"===Object(r.h)(e)||"function"==typeof e)},O=function(e){return Array.isArray(e)||!(!e||!e[Symbol.iterator])},j=function(){function e(t,n,i){Object(r.a)(this,e),this.dirty=!0,this.element=t,this.name=n,this.strings=i,this.parts=[];for(var o=0;o<i.length-1;o++)this.parts[o]=this._createPart()}return Object(r.b)(e,[{key:"_createPart",value:function(){return new S(this)}},{key:"_getValue",value:function(){for(var e=this.strings,t=e.length-1,n="",r=0;r<t;r++){n+=e[r];var i=this.parts[r];if(void 0!==i){var o=i.value;if(w(o)||!O(o))n+="string"==typeof o?o:String(o);else{var a=!0,s=!1,c=void 0;try{for(var u,l=o[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var h=u.value;n+="string"==typeof h?h:String(h)}}catch(e){s=!0,c=e}finally{try{a||null==l.return||l.return()}finally{if(s)throw c}}}}}return n+=e[t]}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}]),e}(),S=function(){function e(t){Object(r.a)(this,e),this.value=void 0,this.committer=t}return Object(r.b)(e,[{key:"setValue",value:function(e){e===c||w(e)&&e===this.value||(this.value=e,o(e)||(this.committer.dirty=!0))}},{key:"commit",value:function(){for(;o(this.value);){var e=this.value;this.value=c,e(this)}this.value!==c&&this.committer.commit()}}]),e}(),x=function(){function e(t){Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,this.options=t}return Object(r.b)(e,[{key:"appendInto",value:function(e){this.startNode=e.appendChild(b()),this.endNode=e.appendChild(b())}},{key:"insertAfterNode",value:function(e){this.startNode=e,this.endNode=e.nextSibling}},{key:"appendIntoPart",value:function(e){e.__insert(this.startNode=b()),e.__insert(this.endNode=b())}},{key:"insertAfterPart",value:function(e){e.__insert(this.startNode=b()),this.endNode=e.endNode,e.endNode=this.startNode}},{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;o(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=c,e(this)}var t=this.__pendingValue;t!==c&&(w(t)?t!==this.value&&this.__commitText(t):t instanceof k?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):O(t)?this.__commitIterable(t):t===u?(this.value=u,this.clear()):this.__commitText(t))}},{key:"__insert",value:function(e){this.endNode.parentNode.insertBefore(e,this.endNode)}},{key:"__commitNode",value:function(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}},{key:"__commitText",value:function(e){var t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}},{key:"__commitTemplateResult",value:function(e){var t=this.options.templateFactory(e);if(this.value instanceof m&&this.value.template===t)this.value.update(e.values);else{var n=new m(t,e.processor,this.options),r=n._clone();n.update(e.values),this.__commitNode(r),this.value=n}}},{key:"__commitIterable",value:function(t){Array.isArray(this.value)||(this.value=[],this.clear());var n,r=this.value,i=0,o=!0,a=!1,s=void 0;try{for(var c,u=t[Symbol.iterator]();!(o=(c=u.next()).done);o=!0){var l=c.value;void 0===(n=r[i])&&(n=new e(this.options),r.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(r[i-1])),n.setValue(l),n.commit(),i++}}catch(e){a=!0,s=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw s}}i<r.length&&(r.length=i,this.clear(n&&n.endNode))}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.startNode;s(this.startNode.parentNode,e.nextSibling,this.endNode)}}]),e}(),T=function(){function e(t,n,i){if(Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,2!==i.length||""!==i[0]||""!==i[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=n,this.strings=i}return Object(r.b)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;o(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=c,e(this)}if(this.__pendingValue!==c){var t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=c}}}]),e}(),_=function(e){function t(e,n,i){var o;return Object(r.a)(this,t),(o=Object(r.e)(this,Object(r.f)(t).call(this,e,n,i))).single=2===i.length&&""===i[0]&&""===i[1],o}return Object(r.d)(t,e),Object(r.b)(t,[{key:"_createPart",value:function(){return new E(this)}},{key:"_getValue",value:function(){return this.single?this.parts[0].value:Object(r.g)(Object(r.f)(t.prototype),"_getValue",this).call(this)}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]),t}(j),E=function(e){function t(){return Object(r.a)(this,t),Object(r.e)(this,Object(r.f)(t).apply(this,arguments))}return Object(r.d)(t,e),t}(S),C=!1;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/try{var R={get capture(){return C=!0,!1}};window.addEventListener("test",R,R),window.removeEventListener("test",R,R)}catch(e){}var P=function(){function e(t,n,i){var o=this;Object(r.a)(this,e),this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=n,this.eventContext=i,this.__boundHandleEvent=function(e){return o.handleEvent(e)}}return Object(r.b)(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;o(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=c,e(this)}if(this.__pendingValue!==c){var t=this.__pendingValue,n=this.value,r=null==t||null!=n&&(t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),i=null!=t&&(null==n||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=I(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=c}}},{key:"handleEvent",value:function(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}]),e}(),I=function(e){return e&&(C?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)},B=new(function(){function e(){Object(r.a)(this,e)}return Object(r.b)(e,[{key:"handleAttributeExpressions",value:function(e,t,n,r){var i=t[0];return"."===i?new _(e,t.slice(1),n).parts:"@"===i?[new P(e,t.slice(1),r.eventContext)]:"?"===i?[new T(e,t.slice(1),n)]:new j(e,t,n).parts}},{key:"handleTextExpression",value:function(e){return new x(e)}}]),e}());
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
function M(e){var t=A.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},A.set(e.type,t));var n=t.stringsArray.get(e.strings);if(void 0!==n)return n;var r=e.strings.join(l);return void 0===(n=t.keyString.get(r))&&(n=new f(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}var A=new Map,N=new WeakMap;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");var F=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new k(e,n,"html",B)};function U(e,t){for(var n=e.element.content,r=e.parts,i=document.createTreeWalker(n,133,null,!1),o=D(r),a=r[o],s=-1,c=0,u=[],l=null;i.nextNode();){s++;var h=i.currentNode;for(h.previousSibling===l&&(l=null),t.has(h)&&(u.push(h),null===l&&(l=h)),null!==l&&c++;void 0!==a&&a.index===s;)a.index=null!==l?-1:a.index-c,a=r[o=D(r,o)]}u.forEach((function(e){return e.parentNode.removeChild(e)}))}var q=function(e){for(var t=11===e.nodeType?0:1,n=document.createTreeWalker(e,133,null,!1);n.nextNode();)t++;return t},D=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=t+1;n<e.length;n++){var r=e[n];if(v(r))return n}return-1};var L=function(e,t){return"".concat(e,"--").concat(t)},V=!0;void 0===window.ShadyCSS?V=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),V=!1);var z=function(e){return function(t){var n=L(t.type,e),r=A.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},A.set(n,r));var i=r.stringsArray.get(t.strings);if(void 0!==i)return i;var o=t.strings.join(l);if(void 0===(i=r.keyString.get(o))){var a=t.getTemplateElement();V&&window.ShadyCSS.prepareTemplateDom(a,e),i=new f(t,a),r.keyString.set(o,i)}return r.stringsArray.set(t.strings,i),i}},H=["html","svg"],W=new Set,Z=function(e,t,n){W.add(e);var r=n?n.element:document.createElement("template"),i=t.querySelectorAll("style"),o=i.length;if(0!==o){for(var a=document.createElement("style"),s=0;s<o;s++){var c=i[s];c.parentNode.removeChild(c),a.textContent+=c.textContent}!function(e){H.forEach((function(t){var n=A.get(L(t,e));void 0!==n&&n.keyString.forEach((function(e){var t=e.element.content,n=new Set;Array.from(t.querySelectorAll("style")).forEach((function(e){n.add(e)})),U(e,n)}))}))}(e);var u=r.content;n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.element.content,i=e.parts;if(null!=n)for(var o=document.createTreeWalker(r,133,null,!1),a=D(i),s=0,c=-1;o.nextNode();){c++;var u=o.currentNode;for(u===n&&(s=q(t),n.parentNode.insertBefore(t,n));-1!==a&&i[a].index===c;){if(s>0){for(;-1!==a;)i[a].index+=s,a=D(i,a);return}a=D(i,a)}}else r.appendChild(t)}(n,a,u.firstChild):u.insertBefore(a,u.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);var l=u.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==l)t.insertBefore(l.cloneNode(!0),t.firstChild);else if(n){u.insertBefore(a,u.firstChild);var h=new Set;h.add(a),U(n,h)}}else window.ShadyCSS.prepareTemplateStyles(r,e)};window.JSCompiler_renameProperty=function(e,t){return e};var $={toAttribute:function(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},Q=function(e,t){return t!==e&&(t==t||e==e)},J={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:Q},K=Promise.resolve(!0),X=function(e){function t(){var e;return Object(r.a)(this,t),(e=Object(r.e)(this,Object(r.f)(t).call(this)))._updateState=0,e._instanceProperties=void 0,e._updatePromise=K,e._hasConnectedResolver=void 0,e._changedProperties=new Map,e._reflectingProperties=void 0,e.initialize(),e}var n;return Object(r.d)(t,e),Object(r.b)(t,[{key:"initialize",value:function(){this._saveInstanceProperties(),this._requestUpdate()}},{key:"_saveInstanceProperties",value:function(){var e=this;this.constructor._classProperties.forEach((function(t,n){if(e.hasOwnProperty(n)){var r=e[n];delete e[n],e._instanceProperties||(e._instanceProperties=new Map),e._instanceProperties.set(n,r)}}))}},{key:"_applyInstanceProperties",value:function(){var e=this;this._instanceProperties.forEach((function(t,n){return e[n]=t})),this._instanceProperties=void 0}},{key:"connectedCallback",value:function(){this._updateState=32|this._updateState,this._hasConnectedResolver&&(this._hasConnectedResolver(),this._hasConnectedResolver=void 0)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._attributeToProperty(e,n)}},{key:"_propertyToAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:J,r=this.constructor,i=r._attributeNameForProperty(e,n);if(void 0!==i){var o=r._propertyValueToAttribute(t,n);if(void 0===o)return;this._updateState=8|this._updateState,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._updateState=-9&this._updateState}}},{key:"_attributeToProperty",value:function(e,t){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){var i=n._classProperties.get(r)||J;this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,i),this._updateState=-17&this._updateState}}}},{key:"_requestUpdate",value:function(e,t){var n=!0;if(void 0!==e){var r=this.constructor,i=r._classProperties.get(e)||J;r._valueHasChanged(this[e],t,i.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==i.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,i))):n=!1}!this._hasRequestedUpdate&&n&&this._enqueueUpdate()}},{key:"requestUpdate",value:function(e,t){return this._requestUpdate(e,t),this.updateComplete}},{key:"_enqueueUpdate",value:(n=Object(r.j)(regeneratorRuntime.mark((function e(){var t,n,r,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._updateState=4|this._updateState,r=this._updatePromise,this._updatePromise=new Promise((function(e,r){t=e,n=r})),e.prev=3,e.next=6,r;case 6:e.next=10;break;case 8:e.prev=8,e.t0=e.catch(3);case 10:if(this._hasConnected){e.next=13;break}return e.next=13,new Promise((function(e){return o._hasConnectedResolver=e}));case 13:if(e.prev=13,null==(i=this.performUpdate())){e.next=18;break}return e.next=18,i;case 18:e.next=23;break;case 20:e.prev=20,e.t1=e.catch(13),n(e.t1);case 23:t(!this._hasRequestedUpdate);case 24:case"end":return e.stop()}}),e,this,[[3,8],[13,20]])}))),function(){return n.apply(this,arguments)})},{key:"performUpdate",value:function(){this._instanceProperties&&this._applyInstanceProperties();var e=!1,t=this._changedProperties;try{(e=this.shouldUpdate(t))&&this.update(t)}catch(t){throw e=!1,t}finally{this._markUpdated()}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}},{key:"_markUpdated",value:function(){this._changedProperties=new Map,this._updateState=-5&this._updateState}},{key:"_getUpdateComplete",value:function(){return this._updatePromise}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((function(e,n){return t._propertyToAttribute(n,t[n],e)})),this._reflectingProperties=void 0)}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}},{key:"_hasConnected",get:function(){return 32&this._updateState}},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"updateComplete",get:function(){return this._getUpdateComplete()}}],[{key:"_ensureClassProperties",value:function(){var e=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((function(t,n){return e._classProperties.set(n,t)}))}}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J;if(this._ensureClassProperties(),this._classProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"===Object(r.h)(e)?Symbol():"__".concat(e);Object.defineProperty(this.prototype,e,{get:function(){return this[n]},set:function(t){var r=this[e];this[n]=t,this._requestUpdate(e,r)},configurable:!0,enumerable:!0})}}},{key:"finalize",value:function(){var e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var t=this.properties,n=[].concat(Object(r.c)(Object.getOwnPropertyNames(t)),Object(r.c)("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[])),i=!0,o=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var u=s.value;this.createProperty(u,t[u])}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}}}},{key:"_attributeNameForProperty",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}},{key:"_valueHasChanged",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Q;return n(e,t)}},{key:"_propertyValueFromAttribute",value:function(e,t){var n=t.type,r=t.converter||$,i="function"==typeof r?r:r.fromAttribute;return i?i(e,n):e}},{key:"_propertyValueToAttribute",value:function(e,t){if(void 0!==t.reflect){var n=t.type,r=t.converter;return(r&&r.toAttribute||$.toAttribute)(e,n)}}},{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this._classProperties.forEach((function(n,r){var i=e._attributeNameForProperty(r,n);void 0!==i&&(e._attributeToPropertyMap.set(i,r),t.push(i))})),t}}]),t}(Object(r.i)(HTMLElement));X.finalized=!0;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
var G=function(e){return function(t){return"function"==typeof t?function(e,t){return window.customElements.define(e,t),t}(e,t):function(e,t){return{kind:t.kind,elements:t.elements,finisher:function(t){window.customElements.define(e,t)}}}(e,t)}};function Y(e){return function(t,n){return void 0!==n?function(e,t,n){t.constructor.createProperty(n,e)}(e,t,n):function(e,t){return"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer:function(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher:function(n){n.createProperty(t.key,e)}}:Object.assign({},t,{finisher:function(n){n.createProperty(t.key,e)}})}(e,t)}}var ee="adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,te=Symbol(),ne=function(){function e(t,n){if(Object(r.a)(this,e),n!==te)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}return Object(r.b)(e,[{key:"toString",value:function(){return this.cssText}},{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(ee?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}}]),e}(),re=function(e){if(e instanceof ne)return e.cssText;if("number"==typeof e)return e;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(e,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},ie=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=n.reduce((function(t,n,r){return t+re(n)+e[r+1]}),e[0]);return new ne(i,te)};(window.litElementVersions||(window.litElementVersions=[])).push("2.2.1");var oe=function(e){return e.flat?e.flat(1/0):function e(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=0,i=t.length;r<i;r++){var o=t[r];Array.isArray(o)?e(o,n):n.push(o)}return n}(e)},ae=function(e){function t(){return Object(r.a)(this,t),Object(r.e)(this,Object(r.f)(t).apply(this,arguments))}return Object(r.d)(t,e),Object(r.b)(t,[{key:"initialize",value:function(){Object(r.g)(Object(r.f)(t.prototype),"initialize",this).call(this),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}},{key:"createRenderRoot",value:function(){return this.attachShadow({mode:"open"})}},{key:"adoptStyles",value:function(){var e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ee?this.renderRoot.adoptedStyleSheets=e.map((function(e){return e.styleSheet})):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((function(e){return e.cssText})),this.localName))}},{key:"connectedCallback",value:function(){Object(r.g)(Object(r.f)(t.prototype),"connectedCallback",this).call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}},{key:"update",value:function(e){var n=this;Object(r.g)(Object(r.f)(t.prototype),"update",this).call(this,e);var i=this.render();i instanceof k&&this.constructor.render(i,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((function(e){var t=document.createElement("style");t.textContent=e.cssText,n.renderRoot.appendChild(t)})))}},{key:"render",value:function(){}}],[{key:"finalize",value:function(){Object(r.g)(Object(r.f)(t),"finalize",this).call(this),this._styles=this.hasOwnProperty(JSCompiler_renameProperty("styles",this))?this._getUniqueStyles():this._styles||[]}},{key:"_getUniqueStyles",value:function(){var e=this.styles,t=[];Array.isArray(e)?oe(e).reduceRight((function(e,t){return e.add(t),e}),new Set).forEach((function(e){return t.unshift(e)})):e&&t.push(e);return t}}]),t}(X);ae.finalized=!0,ae.render=function(e,t,n){if(!n||"object"!==Object(r.h)(n)||!n.scopeName)throw new Error("The `scopeName` option is required.");var i=n.scopeName,o=N.has(t),a=V&&11===t.nodeType&&!!t.host,c=a&&!W.has(i),u=c?document.createDocumentFragment():t;if(function(e,t,n){var r=N.get(t);void 0===r&&(s(t,t.firstChild),N.set(t,r=new x(Object.assign({templateFactory:M},n))),r.appendInto(t)),r.setValue(e),r.commit()}(e,u,Object.assign({templateFactory:z(i)},n)),c){var l=N.get(u);N.delete(u);var h=l.value instanceof m?l.value.template:void 0;Z(i,u,h),s(t,t.firstChild),t.appendChild(u),N.set(t,l)}!o&&a&&window.ShadyCSS.styleElement(t.host)}},36:function(e,t,n){"use strict";var r=n(2),i={};
/*! (c) Andrea Giammarchi - ISC */try{!function(e,t){if("+"!==new e("q=%2B").get("q")||"+"!==new e({q:"+"}).get("q")||"+"!==new e([["q","+"]]).get("q")||"q=%0A"!==new e("q=\n").toString()||"q=+%26"!==new e({q:" &"}).toString()||"q=%25zx"!==new e({q:"%zx"}).toString())throw e;i.URLSearchParams=e}(URLSearchParams)}catch(e){!function(e,t,n){var r=e.create,o=e.defineProperty,a=/[!'\(\)~]|%20|%00/g,s=/%(?![0-9a-fA-F]{2})/g,c=/\+/g,u={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"},l={append:function(e,t){p(this._ungap,e,t)},delete:function(e){delete this._ungap[e]},get:function(e){return this.has(e)?this._ungap[e][0]:null},getAll:function(e){return this.has(e)?this._ungap[e].slice(0):[]},has:function(e){return e in this._ungap},set:function(e,n){this._ungap[e]=[t(n)]},forEach:function(e,n){var r=this;for(var i in r._ungap)r._ungap[i].forEach(o,i);function o(o){e.call(n,o,t(i),r)}},toJSON:function(){return{}},toString:function(){var e=[];for(var t in this._ungap)for(var n=b(t),r=0,i=this._ungap[t];r<i.length;r++)e.push(n+"="+b(i[r]));return e.join("&")}};for(var h in l)o(d.prototype,h,{configurable:!0,writable:!0,value:l[h]});function d(e){var t=r(null);switch(o(this,"_ungap",{value:t}),!0){case!e:break;case"string"==typeof e:"?"===e.charAt(0)&&(e=e.slice(1));for(var i=e.split("&"),a=0,s=i.length;a<s;a++){var c=(u=i[a]).indexOf("=");-1<c?p(t,v(u.slice(0,c)),v(u.slice(c+1))):u.length&&p(t,v(u),"")}break;case n(e):for(a=0,s=e.length;a<s;a++){var u;p(t,(u=e[a])[0],u[1])}break;case"forEach"in e:e.forEach(f,t);break;default:for(var l in e)p(t,l,e[l])}}function f(e,t){p(this,t,e)}function p(e,t,r){var i=n(r)?r.join(","):r;t in e?e[t].push(i):e[t]=[i]}function v(e){return decodeURIComponent(e.replace(s,"%25").replace(c," "))}function b(e){return encodeURIComponent(e).replace(a,y)}function y(e){return u[e]}i.URLSearchParams=d}(Object,String,Array.isArray)}!function(e){var t=!1;try{t=!!Symbol.iterator}catch(e){}function n(e,n){var r=[];return e.forEach(n,r),t?r[Symbol.iterator]():{next:function(){var e=r.shift();return{done:void 0===e,value:e}}}}"forEach"in e||(e.forEach=function(e,t){var n=this,r=Object.create(null);this.toString().replace(/=[\s\S]*?(?:&|$)/g,"=").split("=").forEach((function(i){!i.length||i in r||(r[i]=n.getAll(i)).forEach((function(r){e.call(t,r,i,n)}))}))}),"keys"in e||(e.keys=function(){return n(this,(function(e,t){this.push(t)}))}),"values"in e||(e.values=function(){return n(this,(function(e,t){this.push(e)}))}),"entries"in e||(e.entries=function(){return n(this,(function(e,t){this.push([t,e])}))}),!t||Symbol.iterator in e||(e[Symbol.iterator]=e.entries),"sort"in e||(e.sort=function(){for(var e,t,n,r=this.entries(),i=r.next(),o=i.done,a=[],s=Object.create(null);!o;)t=(n=i.value)[0],a.push(t),t in s||(s[t]=[]),s[t].push(n[1]),o=(i=r.next()).done;for(a.sort(),e=0;e<a.length;e++)this.delete(a[e]);for(e=0;e<a.length;e++)t=a[e],this.append(t,s[t].shift())}),function(t){var n=t.defineProperty,i=t.getOwnPropertyDescriptor,o=function(t){var n=t.append;t.append=e.append,URLSearchParams.call(t,t._usp.search.slice(1)),t.append=n},a=function(e,t){if(!(e instanceof t))throw new TypeError("'searchParams' accessed on an object that does not implement interface "+t.name)},s=function(r){var s,c,u=r.prototype,l=i(u,"searchParams"),h=i(u,"href"),d=i(u,"search");!l&&d&&d.set&&(c=function(t){function r(n,r){e.append.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function i(n){e.delete.call(this,n),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}function o(n,r){e.set.call(this,n,r),n=this.toString(),t.set.call(this._usp,n?"?"+n:"")}return function(e,t){return e.append=r,e.delete=i,e.set=o,n(e,"_usp",{configurable:!0,writable:!0,value:t})}}(d),s=function(e,t){return n(e,"_searchParams",{configurable:!0,writable:!0,value:c(t,e)}),t},t.defineProperties(u,{href:{get:function(){return h.get.call(this)},set:function(e){var t=this._searchParams;h.set.call(this,e),t&&o(t)}},search:{get:function(){return d.get.call(this)},set:function(e){var t=this._searchParams;d.set.call(this,e),t&&o(t)}},searchParams:{get:function(){return a(this,r),this._searchParams||s(this,new URLSearchParams(this.search.slice(1)))},set:function(e){a(this,r),s(this,e)}}}))};try{s(HTMLAnchorElement),/^function|object$/.test("undefined"==typeof URL?"undefined":t(r.h)(URL))&&URL.prototype&&s(URL)}catch(e){}}(Object)}(i.URLSearchParams.prototype);var o=i.URLSearchParams;t.a=o},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r="URLSearchParams"in self,i="Symbol"in self&&"iterator"in Symbol,o="FileReader"in self&&"Blob"in self&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in self,s="ArrayBuffer"in self;if(s)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function h(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function v(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function b(e){var t=new FileReader,n=v(t);return t.readAsArrayBuffer(e),n}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:o&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&o&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var e,t,n,r=p(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=v(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=l(e),t=h(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},f.prototype.delete=function(e){delete this.map[l(e)]},f.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},f.prototype.set=function(e,t){this.map[l(e)]=h(t)},f.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),d(e)},i&&(f.prototype[Symbol.iterator]=f.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function k(e,t){var n,r,i=(t=t||{}).body;if(e instanceof k){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function O(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})},m.call(k.prototype),m.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];O.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})};var S=self.DOMException;try{new S}catch(e){(S=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),S.prototype.constructor=S}function x(e,t){return new Promise((function(n,r){var i=new k(e,t);if(i.signal&&i.signal.aborted)return r(new S("Aborted","AbortError"));var a=new XMLHttpRequest;function s(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new O(i,r))},a.onerror=function(){r(new TypeError("Network request failed"))},a.ontimeout=function(){r(new TypeError("Network request failed"))},a.onabort=function(){r(new S("Aborted","AbortError"))},a.open(i.method,i.url,!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&o&&(a.responseType="blob"),i.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),i.signal&&(i.signal.addEventListener("abort",s),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",s)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}x.polyfill=!0,self.fetch||(self.fetch=x,self.Headers=f,self.Request=k,self.Response=O)},86:function(e,t,n){"use strict";n.r(t);var r=n(3),i=n(42),o=n(36);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;a(this,e),this.callback=t,this.threshhold=n,this.context=r,this.deferTimeout=void 0}var t,n,r;return t=e,(n=[{key:"execute",value:function(){clearTimeout(this.deferTimeout),this.deferTimeout=setTimeout(this.executeCallback.bind(this),this.threshhold)}},{key:"executeCallback",value:function(){this.callback.apply(this.context)}}])&&s(t.prototype,n),r&&s(t,r),e}(),u=n(2);function l(){var e=Object(u.k)(["\n :host {\n display: inline-block;\n }\n\n #dragcover {\n width: 100%;\n height: 100%;\n position: absolute;\n touch-action: none;\n }\n\n .container {\n display: block;\n position: relative;\n background-color: white;\n height: 100%;\n margin-left: ",";\n margin-right: ",";\n }\n\n .waveform-image {\n width: 100%;\n height: 100%;\n position: absolute;\n }\n\n .zone-of-silence {\n position: absolute;\n top: 0;\n bottom: 0;\n background: linear-gradient(\n #000,\n #000 47%,\n "," 50%,\n #000 53%,\n #000 100%\n );\n }\n\n #fill {\n position: absolute;\n height: 100%;\n background-color: ",";\n }\n "]);return l=function(){return e},e}function h(){var e=Object(u.k)(["var(--waveformLeftRightMarginSize, 10px)"]);return h=function(){return e},e}function d(){var e=Object(u.k)(["var(--zoneOfSilenceColor, #f6e652)"]);return d=function(){return e},e}function f(){var e=Object(u.k)(["var(--fillColor, #3272b6)"]);return f=function(){return e},e}function p(){var e=Object(u.k)(['\n <div\n id="dragcover"\n @mousedown=',"\n @mouseup=","\n @mouseleave=","\n @mousemove=","\n @touchstart=","\n @touchend=","\n @touchmove=","\n ></div>\n "]);return p=function(){return e},e}function v(){var e=Object(u.k)(['\n <div\n class="zone-of-silence"\n style="left: ',"%; width: ",'%"\n ></div>\n ']);return v=function(){return e},e}function b(){var e=Object(u.k)(["\n ","\n "]);return b=function(){return e},e}function y(){var e=Object(u.k)(['\n <div class="container">\n <div id="fill" style="width: ','%"></div>\n <img class="waveform-image" src="','" />\n '," ","\n </div>\n "]);return y=function(){return e},e}var m=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},g=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).percentComplete=0,e.waveformUrl="",e.interactive=!1,e.zonesOfSilence=[],e._percentComplete=0,e._userIsInteracting=!1,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(y(),this._percentComplete,this.waveformUrl,this.zonesOfSilenceTemplate,this.interactive?this.interactionCoverTemplate:"")}},{key:"updated",value:function(e){e.has("percentComplete")&&!this._userIsInteracting&&(this._percentComplete=this.percentComplete)}},{key:"drag",value:function(e){this._userIsInteracting&&this.updatePercentComplete(e)}},{key:"dragstart",value:function(e){this._userIsInteracting=!0,this.updatePercentComplete(e)}},{key:"dragend",value:function(){this._userIsInteracting=!1}},{key:"updatePercentComplete",value:function(e){if(this.container){var t=this.container.offsetLeft,n=e.pageX-t;this._percentComplete=this.offsetXToPercent(n),this.dispatchValueChangeEvent()}}},{key:"dispatchValueChangeEvent",value:function(){var e=new CustomEvent("valuechange",{detail:{value:this._percentComplete}});this.dispatchEvent(e)}},{key:"offsetXToPercent",value:function(e){return null===this.dragcover?0:e/this.dragcover.clientWidth*100}},{key:"zonesOfSilenceTemplate",get:function(){return Object(r.d)(b(),this.zonesOfSilence.map((function(e){return Object(r.d)(v(),e.startPercent,e.endPercent-e.startPercent)})))}},{key:"interactionCoverTemplate",get:function(){return Object(r.d)(p(),this.dragstart,this.dragend,this.dragend,this.drag,this.dragstart,this.dragend,this.drag)}},{key:"dragcover",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("dragcover")}},{key:"container",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector(".container")}}],[{key:"styles",get:function(){var e=Object(r.b)(f()),t=Object(r.b)(d()),n=Object(r.b)(h());return Object(r.b)(l(),n,n,t,e)}}]),t}(r.a);m([Object(r.e)({type:Number})],g.prototype,"percentComplete",void 0),m([Object(r.e)({type:String})],g.prototype,"waveformUrl",void 0),m([Object(r.e)({type:Boolean})],g.prototype,"interactive",void 0),m([Object(r.e)({type:Array})],g.prototype,"zonesOfSilence",void 0),m([Object(r.e)({type:Number})],g.prototype,"_percentComplete",void 0),g=m([Object(r.c)("waveform-progress")],g);var k,w=function e(t,n){Object(u.a)(this,e),this.startPercent=0,this.endPercent=0,this.startPercent=t,this.endPercent=n};function O(){var e=Object(u.k)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20">\n <g fill="none" fill-rule="evenodd" transform="translate(1)">\n <polygon fill="#FFF" points="7 3 16 17 -2 17" transform="rotate(90 7 10)"/>\n <line x1="15" x2="15" y1="20" stroke="#FFF" stroke-width="2"/>\n </g>\n</svg>\n']);return O=function(){return e},e}!function(e){e[e.playing=0]="playing",e[e.paused=1]="paused"}(k||(k={}));var j=Object(r.d)(O());function S(){var e=Object(u.k)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20">\n <g fill="none" fill-rule="evenodd" transform="translate(1 1)">\n <polygon fill="#FFF" points="9 2 18 16 0 16" transform="rotate(-90 9 9)"/>\n <line x1=".5" x2=".5" y1="18" stroke="#FFF" stroke-width="2"/>\n </g>\n</svg>\n']);return S=function(){return e},e}var x=Object(r.d)(S());function T(){var e=Object(u.k)(['\n<svg width="20" height="20" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>icon/replay</title><desc>Created with Sketch.</desc><g id="icon/replay" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Replay-button"><polyline id="Path" stroke="#FFF" stroke-width="2" points="14.4444444 16.6666667 20 16.6666667 20 3.33333333 5.55555556 3.33333333"/><polygon id="Path-2" fill="#FFF" points="5.55555556 0 5.55555556 6.66666667 1.11111111 3.33333333"/><text id="10" font-family="HelveticaNeue, Helvetica Neue" font-size="10" font-weight="normal" fill="#FFF"><tspan x="0" y="17.333">10</tspan></text></g></g></svg>\n']);return T=function(){return e},e}var _=Object(r.d)(T());function E(){var e=Object(u.k)(['\n<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" transform="matrix(-1 0 0 1 20 0)"><path d="m14.4444444 16.6666667h5.5555556v-13.33333337h-14.44444444" stroke="#fff" stroke-width="2"/><g fill="#fff"><path d="m5.55555556 0v6.66666667l-4.44444445-3.33333334z"/><text font-family="HelveticaNeue, Helvetica Neue" font-size="10" transform="matrix(-1 0 0 1 13.333334 0)"><tspan x="0" y="17.333333">10</tspan></text></g></g></svg>\n']);return E=function(){return e},e}var C=Object(r.d)(E());function R(){var e=Object(u.k)(['\n<svg height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"><path d="m34.5 18 12.5 25h-25z" fill="#333" fill-rule="evenodd" transform="matrix(0 1 -1 0 65 -4)"/></svg>\n']);return R=function(){return e},e}var P=Object(r.d)(R());function I(){var e=Object(u.k)(['\n<svg height="60" viewBox="0 0 60 60" width="60" xmlns="http://www.w3.org/2000/svg"><path d="m32 18h6v25h-6zm-10 0h6v25h-6z" fill="#333" fill-rule="evenodd"/></svg>\n']);return I=function(){return e},e}var B=Object(r.d)(I());function M(){var e=Object(u.k)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="23" height="17" viewBox="0 0 23 17">\n <g fill="none" fill-rule="evenodd" stroke="#FFF" transform="translate(1 1)">\n <g stroke-linecap="round" transform="translate(2 2.522)">\n <path d="M8.5,9.97826087 L15.5,2.97826087" transform="rotate(180 12 6.478)"/>\n <path d="M15.5,11.2695652 L15.5,8.26956522" transform="rotate(90 15.5 9.77)"/>\n <path d="M16.1555266,5.77496471 L16.1480288,4.77499282" transform="rotate(-120 16.152 5.275)"/>\n <path d="M12.9236091,2.48093451 L12.9161756,1.48096213" transform="rotate(-150 12.92 1.98)"/>\n <path d="M8.5,3.47826087 L8.5,0.47826087" transform="rotate(180 8.5 1.978)"/>\n <path d="M4.07639089,2.48093451 L4.08382438,1.48096213" transform="rotate(150 4.08 1.98)"/>\n <path d="M0.844473378,5.77496471 L0.851971223,4.77499282" transform="rotate(120 .848 5.275)"/>\n <path d="M1.5,11.2695652 L1.5,8.26956522" transform="rotate(90 1.5 9.77)"/>\n </g>\n <path stroke-width="2" d="M10.5,14.9867607 C22.0227273,14.9867607 20.9752066,15.5091468 20.9752066,9.99117383 C20.9752066,4.47320089 16.2852969,0 10.5,0 C4.71470314,0 0.0247933884,4.47320089 0.0247933884,9.99117383 C0.0247933884,15.5091468 -1.02272727,14.9867607 10.5,14.9867607 Z"/>\n </g>\n</svg>\n']);return M=function(){return e},e}var A=Object(r.d)(M());function N(){var e=Object(u.k)(['\n<svg height="22" viewBox="0 0 22 22" width="22" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#fff" stroke-width="2"><path d="m14 3c2 2.05128205 3 4.71794872 3 8 0 3.2820513-1 5.9487179-3 8m4-18c2 2.56410256 3 5.8974359 3 10s-1 7.4358974-3 10" stroke-linecap="round"/><path d="m10 3.5-4 3.81h-5v8.38h5l4 3.81z" fill="#fff" stroke-linejoin="round"/></g></svg>\n']);return N=function(){return e},e}var F=Object(r.d)(N());function U(){var e=Object(u.k)(['\n<svg height="22" viewBox="0 0 22 22" width="22" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd" stroke="#fff" stroke-width="2"><path d="m14 3c2 2.05128205 3 4.71794872 3 8 0 3.2820513-1 5.9487179-3 8" stroke-linecap="round"/><path d="m18 1c2 2.56410256 3 5.8974359 3 10s-1 7.4358974-3 10" stroke-linecap="round" stroke-opacity=".1"/><path d="m10 3.5-4 3.81h-5v8.38h5l4 3.81z" fill="#fff" stroke-linejoin="round"/></g></svg>\n']);return U=function(){return e},e}var q=Object(r.d)(U());function D(){var e=Object(u.k)(['\n<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 22 22"><g fill="none" fill-rule="evenodd"><path stroke="#FFF" stroke-linecap="round" stroke-width="2" d="M16,7 L16,15" transform="rotate(-45 16 11)"/><path stroke="#FFF" stroke-linecap="round" stroke-width="2" d="M16,7 L16,15" transform="rotate(-135 16 11)"/><polygon fill="#FFF" stroke="#FFF" stroke-linejoin="round" stroke-width="2" points="10 3.5 6 7.31 1 7.31 1 15.69 6 15.69 10 19.5"/></g></svg>\n']);return D=function(){return e},e}var L=Object(r.d)(D());function V(){var e=Object(u.k)(["\n :host {\n display: flex;\n justify-content: center;\n align-items: center;\n padding-left: 0.25rem;\n padding-right: 0.25rem;\n }\n\n .container {\n display: flex;\n justify-content: space-between;\n color: white;\n width: 100%;\n }\n\n .vertical-button-stack {\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n\n .vertical-button-container {\n text-align: center;\n }\n\n .vertical-button-container button {\n vertical-align: bottom;\n }\n\n .vertical-button-container svg {\n vertical-align: bottom;\n }\n\n .vertical-button-value {\n font-size: 0.7em;\n line-height: 1.4em;\n text-align: center;\n }\n\n #play-pause-btn {\n border-radius: 50%;\n height: ",";\n width: ",";\n border: none;\n background-color: white;\n vertical-align: middle;\n }\n\n #play-pause-btn:active {\n background-color: rgba(255, 255, 255, 0.75);\n }\n\n #play-pause-btn svg {\n width: 100%;\n height: 100%;\n }\n\n .unstyled-button {\n background: none;\n border: none;\n margin: 0;\n padding: 0;\n }\n\n button {\n cursor: pointer;\n }\n\n .jump-btn:active img {\n opacity: 0.75;\n }\n "]);return V=function(){return e},e}function z(){var e=Object(u.k)(["var(--playPauseDiameter, 4rem)"]);return z=function(){return e},e}function H(){var e=Object(u.k)(['\n <div class="container">\n <div class="vertical-button-stack playback-speed">\n <div class="vertical-button-container">\n <button id="playback-rate-btn" class="unstyled-button" @click="','">\n ','\n </button>\n </div>\n <div class="vertical-button-value">\n ','x\n </div>\n </div>\n <button id="prev-section-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="back-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="play-pause-btn" @click="','">\n ','\n </button>\n <button id="forward-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <button id="next-section-btn" class="jump-btn unstyled-button" @click="','">\n ','\n </button>\n <div class="vertical-button-stack volume">\n <div class="vertical-button-container">\n <button id="volume-control-btn" class="unstyled-button" @click="','">\n ','\n </button>\n </div>\n <div class="vertical-button-value">\n ',"%\n </div>\n </div>\n </div>\n "]);return H=function(){return e},e}var W=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},Z=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).playbackMode=k.paused,e.playbackRate=1,e.volume=1,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(H(),this.handlePlaybackRateChange,A,this.playbackRate,this.handlePrevSectionButton,x,this.handleBackButton,_,this.handlePlayPauseButton,this.playPauseButtonImage,this.handleForwardButton,C,this.handleNextSectionButton,j,this.handleVolumeChange,this.volumeButtonImage,100*this.volume)}},{key:"handlePlaybackRateChange",value:function(){2===this.playbackRate?this.playbackRate=.5:this.playbackRate+=.25;var e=new CustomEvent("playbackRateChange",{detail:{playbackRate:this.playbackRate}});this.dispatchEvent(e)}},{key:"handleVolumeChange",value:function(){1===this.volume?this.volume=0:this.volume+=.25;var e=new CustomEvent("volumeChange",{detail:{volume:this.volume}});this.dispatchEvent(e)}},{key:"handleBackButton",value:function(){var e=new Event("back-button-pressed");this.dispatchEvent(e)}},{key:"handlePrevSectionButton",value:function(){var e=new Event("prev-section-button-pressed");this.dispatchEvent(e)}},{key:"handleNextSectionButton",value:function(){var e=new Event("next-section-button-pressed");this.dispatchEvent(e)}},{key:"handlePlayPauseButton",value:function(){this.playbackMode=this.playbackMode===k.playing?k.paused:k.playing;var e=new Event("play-pause-button-pressed");this.dispatchEvent(e)}},{key:"handleForwardButton",value:function(){var e=new Event("forward-button-pressed");this.dispatchEvent(e)}},{key:"playPauseButtonImage",get:function(){var e=P;switch(this.playbackMode){case k.playing:e=B;break;case k.paused:e=P}return e}},{key:"volumeButtonImage",get:function(){var e=q;return 0===this.volume&&(e=L),1===this.volume&&(e=F),e}}],[{key:"styles",get:function(){var e=Object(r.b)(z());return Object(r.b)(V(),e,e)}}]),t}(r.a);function $(){var e=Object(u.k)(['\n<svg height="10" viewBox="0 0 8 10" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 1 5 8h-10z" fill="#fff" fill-rule="evenodd" transform="matrix(0 -1 1 0 -1 9)"/></svg>\n']);return $=function(){return e},e}W([Object(r.e)({type:k})],Z.prototype,"playbackMode",void 0),W([Object(r.e)({type:Number})],Z.prototype,"playbackRate",void 0),W([Object(r.e)({type:Number})],Z.prototype,"volume",void 0),Z=W([Object(r.c)("playback-controls")],Z);var Q=Object(r.d)($());function J(){var e=Object(u.k)(['\n<svg height="10" viewBox="0 0 8 10" width="8" xmlns="http://www.w3.org/2000/svg"><path d="m4 1 5 8h-10z" fill="#fff" fill-rule="evenodd" transform="matrix(0 1 -1 0 9 1)"/></svg>\n']);return J=function(){return e},e}var K=Object(r.d)(J());function X(){var e=Object(u.k)(["\n .container {\n display: flex;\n justify-content: center;\n height: 100%;\n }\n\n .arrow {\n padding-top: 10px;\n opacity: 1;\n transition: opacity "," ease-out, padding-top "," ease-out;\n }\n\n .right-arrow {\n visibility: hidden;\n }\n\n .arrow {\n visibility: hidden;\n }\n\n .container.mode-left .right-arrow {\n opacity: 0;\n }\n\n .container.mode-right .left-arrow {\n opacity: 0;\n }\n\n .container.mode-neither .left-arrow, .container.mode-neither .right-arrow {\n opacity: 0;\n padding-top: 75%;\n }\n\n .container.mode-neither .center-divider {\n height: ",";\n }\n\n .center-divider {\n border-left: 1px solid white;\n width: 1px;\n left: 50%;\n height: ",";\n align-self: flex-end;\n transition: height "," ease-out;\n }\n "]);return X=function(){return e},e}function G(){var e=Object(u.k)(["var(--markerHeightExpanded, 25px)"]);return G=function(){return e},e}function Y(){var e=Object(u.k)(["var(--markerHeightCollapsed, 10px)"]);return Y=function(){return e},e}function ee(){var e=Object(u.k)(["0.1s"]);return ee=function(){return e},e}function te(){var e=Object(u.k)(['\n <div class="container mode-','">\n <div class="left-arrow arrow">','</div>\n <div class="center-divider"></div>\n <div class="right-arrow arrow">',"</div>\n </div>\n "]);return te=function(){return e},e}var ne,re=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a};!function(e){e.left="left",e.right="right",e.both="both",e.neither="neither"}(ne||(ne={}));var ie=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).markerMode=ne.neither,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(te(),this.markerMode,K,Q)}}],[{key:"styles",get:function(){var e=Object(r.b)(ee()),t=Object(r.b)(Y()),n=Object(r.b)(G());return Object(r.b)(X(),e,e,t,n,e)}}]),t}(r.a);function oe(){var e=Object(u.k)(["\n .container {\n position: relative;\n height: 20px;\n }\n\n .color-fill {\n height: 10px;\n border-radius: 1em;\n position: absolute;\n bottom: 7px;\n left: 2px;\n right: -2px;\n }\n\n .marker-container {\n position: absolute;\n left: ",";\n right: ",";\n height: 100%;\n }\n\n section-marker {\n position: absolute;\n width: 2rem;\n height: ",";\n bottom: 7px;\n /*\n we set the left side of the marker to the spot where we want it, but the marker line is in\n the center of the marker so we need to shift it to the left by half its width so this transform\n is doing that\n */\n transform: translateX(-50%);\n }\n\n input[type='range'] {\n -webkit-appearance: none;\n height: ",";\n padding: 0;\n width: 100%;\n background: none;\n outline: none;\n position: absolute;\n bottom: 0;\n }\n\n input[type='range']::-webkit-slider-thumb {\n -webkit-appearance: none;\n box-sizing: content-box;\n margin-top: ",";\n ","\n }\n\n input[type='range']::-moz-range-thumb {\n ","\n }\n\n input[type='range']::-ms-thumb {\n /* should come after -webkit- */\n ","\n margin-top: 0;\n }\n\n input[type='range']::-webkit-slider-runnable-track {\n ","\n }\n\n input[type='range']::-moz-range-track {\n ","\n }\n\n input[type='range']::-moz-range-progress {\n ",";\n }\n\n input[type='range']::-ms-track {\n /* should come after -webkit- */\n border-color: transparent;\n color: transparent;\n ","\n }\n\n input[type='range']::-ms-fill-lower {\n background-color: ",";\n ",";\n }\n\n input[type='range']::-ms-tooltip {\n display: none;\n }\n "]);return oe=function(){return e},e}function ae(){var e=Object(u.k)(["\n border: ",";\n ",";\n "]);return ae=function(){return e},e}function se(){var e=Object(u.k)(["\n height: ",";\n border-radius: ",";\n "]);return se=function(){return e},e}function ce(){var e=Object(u.k)(["\n background-color: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n border: ",";\n cursor: pointer;\n "]);return ce=function(){return e},e}function ue(){var e=Object(u.k)(["var(--webkitThumbTopMargin, -6px)"]);return ue=function(){return e},e}function le(){var e=Object(u.k)(["var(--trackColor, rgba(0, 0, 0, 0.1))"]);return le=function(){return e},e}function he(){var e=Object(u.k)(["var(--trackFillColor, #3272b6)"]);return he=function(){return e},e}function de(){var e=Object(u.k)(["var(--trackBorder, 1px solid white)"]);return de=function(){return e},e}function fe(){var e=Object(u.k)(["var(--trackBorderRadius, 5px)"]);return fe=function(){return e},e}function pe(){var e=Object(u.k)(["var(--trackHeight, 10px)"]);return pe=function(){return e},e}function ve(){var e=Object(u.k)(["var(--thumbColor, white)"]);return ve=function(){return e},e}function be(){var e=Object(u.k)(["var(--thumbBorder, 1px solid black)"]);return be=function(){return e},e}function ye(){var e=Object(u.k)(["var(--thumbBorderRadius, 50%)"]);return ye=function(){return e},e}function me(){var e=Object(u.k)(["var(--thumbDiameter, 20px)"]);return me=function(){return e},e}function ge(){var e=Object(u.k)(["var(--scrubberBarHeight, 20px)"]);return ge=function(){return e},e}function ke(){var e=Object(u.k)(["var(--markerInset, 10px)"]);return ke=function(){return e},e}function we(){var e=Object(u.k)(["\n <section-marker\n data-location=",'\n style="left: ','%">\n </section-marker>\n ']);return we=function(){return e},e}function Oe(){var e=Object(u.k)(['\n <div class="container">\n <div class="color-fill">\n </div>\n\n <div class="marker-container">\n ','\n </div>\n\n <input\n id="slider"\n type="range"\n min=',"\n max=","\n step=","\n value=","\n @mousedown=","\n @mouseup=","\n @touchstart=","\n @touchend=","\n @input=","\n @change=",'\n />\n\n <div id="webkit-range-input-style"></div>\n </div>\n ']);return Oe=function(){return e},e}re([Object(r.e)({type:ne})],ie.prototype,"markerMode",void 0),ie=re([Object(r.c)("section-marker")],ie);var je=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},Se=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).value=0,e.min=0,e.max=100,e.step=.1,e.sectionMarkerPercentages=[],e.expandSectionMarkers=!1,e._userInteracting=!1,e._value=0,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(Oe(),this.sectionMarkerPercentages.map((function(e){return Object(r.d)(we(),e,e)})),this.min,this.max,this.step,this.value,this.interactionStarted,this.interactionEnded,this.interactionStarted,this.interactionEnded,this.handleSlide,this.handleSlide)}},{key:"updated",value:function(e){!this._userInteracting&&e.has("value")&&(this._value=this.value,this.rangeSlider&&(this.rangeSlider.value="".concat(this.value)),this.updateWebkitSliderStyle(),this.updateMarkerFlags())}},{key:"firstUpdated",value:function(){this.updateWebkitSliderStyle(),this.updateMarkerFlags()}},{key:"handleSlide",value:function(e){var t=e.target.value;this._value=parseFloat(t),this.updateWebkitSliderStyle(),this.updateMarkerFlags(),this.emitChangeEvent()}},{key:"interactionStarted",value:function(){this._userInteracting=!0,this.dispatchEvent(new Event("userInteractionStarted"))}},{key:"interactionEnded",value:function(){this._userInteracting=!1,this.dispatchEvent(new Event("userInteractionEnded"))}},{key:"updateWebkitSliderStyle",value:function(){this.webkitStyle&&(this.webkitStyle.innerHTML="\n <style>\n .color-fill {\n background: linear-gradient(to right,\n var(--trackFillColor, #3272b6) 0%, var(--trackFillColor, #3272b6) ".concat(this.percentage,"%,\n var(--trackColor, rgba(0, 0, 0, 0.1)) ").concat(this.percentage,"%, var(--trackColor, rgba(0, 0, 0, 0.1)) 100%);\n }\n </style>\n "))}},{key:"emitChangeEvent",value:function(){var e=new CustomEvent("valuechange",{detail:{value:this._value}});this.dispatchEvent(e)}},{key:"updateMarkerFlags",value:function(){var e=this;if(this.expandSectionMarkers){var t=this._value,n=this.sortedMarkers.filter((function(e){return e>t})),r=Math.min.apply(Math,Object(u.c)(n)),i=this.sortedMarkers.filter((function(e){return e<=t})),o=Math.max.apply(Math,Object(u.c)(i));this.sectionMarkerPercentages.forEach((function(t){if(e.shadowRoot){var n=e.shadowRoot.querySelector('section-marker[data-location="'.concat(t,'"]'));if(n)switch(t){case r:n.markerMode=ne.left;break;case o:n.markerMode=ne.right;break;default:n.markerMode=ne.neither}}}))}}},{key:"percentage",get:function(){var e=this.max-this.min;return(this._value-this.min)/e*100}},{key:"rangeSlider",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("slider")}},{key:"webkitStyle",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("webkit-range-input-style")}},{key:"sortedMarkers",get:function(){return this.sectionMarkerPercentages.sort()}}],[{key:"styles",get:function(){var e=Object(r.b)(ke()),t=Object(r.b)(ge()),n=Object(r.b)(me()),i=Object(r.b)(ye()),o=Object(r.b)(be()),a=Object(r.b)(ve()),s=Object(r.b)(pe()),c=Object(r.b)(fe()),u=Object(r.b)(de()),l=Object(r.b)(he()),h=(Object(r.b)(le()),Object(r.b)(ue())),d=Object(r.b)(ce(),a,n,n,i,o),f=Object(r.b)(se(),s,c),p=Object(r.b)(ae(),u,f);return Object(r.b)(oe(),e,e,s,t,h,d,d,d,p,p,f,p,l,f)}}]),t}(r.a);function xe(){var e=Object(u.k)(['\n <svg height="14" viewBox="0 0 14 14" width="14" xmlns="http://www.w3.org/2000/svg">\n <title>Magnifying Glass</title>\n <path\n d="m5.17668106 0c-2.859002 0-5.17668106 2.31767906-5.17668106 5.17668106 0 2.85900201 2.31767906 5.17668104 5.17668106 5.17668104.98756168.0210349 1.96052598-.240917 2.80403558-.75493263l4.09820586 4.20605333 1.7255603-1.7255603-4.20605333-4.09820586c.51401563-.8435096.77596753-1.8164739.75493263-2.80403558 0-2.859002-2.31767903-5.17668106-5.17668104-5.17668106m0 1.72556035c1.90600134 0 3.45112071 1.54511938 3.45112071 3.45112071 0 1.90600134-1.54511937 3.45112071-3.45112071 3.45112071-1.90600133 0-3.45112071-1.54511937-3.45112071-3.45112071 0-1.90600133 1.54511938-3.45112071 3.45112071-3.45112071"\n fill="#fff"\n />\n </svg>\n']);return xe=function(){return e},e}je([Object(r.e)({type:Number})],Se.prototype,"value",void 0),je([Object(r.e)({type:Number})],Se.prototype,"min",void 0),je([Object(r.e)({type:Number})],Se.prototype,"max",void 0),je([Object(r.e)({type:Number})],Se.prototype,"step",void 0),je([Object(r.e)({type:Array})],Se.prototype,"sectionMarkerPercentages",void 0),je([Object(r.e)({type:Boolean})],Se.prototype,"expandSectionMarkers",void 0),Se=je([Object(r.c)("scrubber-bar")],Se);var Te=Object(r.d)(xe());function _e(){var e=Object(u.k)(['\n <svg height="9" viewBox="0 0 19 9" width="19" xmlns="http://www.w3.org/2000/svg">\n <title>Toggle Quick Search</title>\n <path\n d="m1 1 9 7 8-7"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n />\n </svg>\n']);return _e=function(){return e},e}var Ee=Object(r.d)(_e());function Ce(){var e=Object(u.k)(['\n <svg height="12" viewBox="0 0 12 12" width="12" xmlns="http://www.w3.org/2000/svg">\n <title>Clear Search Results</title>\n <g fill="none" fill-rule="evenodd">\n <circle cx="6" cy="6" fill="#fff" r="6" />\n <g stroke="#000" stroke-linecap="round">\n <path d="m3.375 3.375 5.18412641 5.18412641" />\n <path d="m3.375 3.375 5.18412641 5.18412641" transform="matrix(-1 0 0 1 12 0)" />\n </g>\n </g>\n </svg>\n']);return Ce=function(){return e},e}var Re=Object(r.d)(Ce());function Pe(){var e=Object(u.k)(["\n ul {\n padding: ",";\n margin: 0;\n list-style: none;\n }\n\n ul li {\n padding: ",";\n margin: 0;\n display: block;\n }\n\n ul li a {\n color: ",";\n text-decoration: ",";\n cursor: pointer;\n }\n "]);return Pe=function(){return e},e}function Ie(){var e=Object(u.k)(["var(--quickSearchLinkDecoration, none)"]);return Ie=function(){return e},e}function Be(){var e=Object(u.k)(["var(--quickSearchLinkColor, rgb(68, 132, 202))"]);return Be=function(){return e},e}function Me(){var e=Object(u.k)(["var(--quickSearchListItemPadding, 0.5em 0 0 0)"]);return Me=function(){return e},e}function Ae(){var e=Object(u.k)(["var(--quickSearchListPadding, 0 0 0.5em 0)"]);return Ae=function(){return e},e}function Ne(){var e=Object(u.k)(["\n <li>\n <a @click="," data-quick-search-index=",">\n ","\n </a>\n </li>\n "]);return Ne=function(){return e},e}function Fe(){var e=Object(u.k)(["\n <ul>\n ","\n </ul>\n "]);return Fe=function(){return e},e}var Ue=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},qe=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).quickSearches=[],e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){var e=this;return Object(r.d)(Fe(),this.quickSearches.map((function(t,n){return Object(r.d)(Ne(),e.doQuickSearch,n,t.displayText)})))}},{key:"doQuickSearch",value:function(e){var t=e.target.dataset.quickSearchIndex;if(t){var n=parseInt(t,10),r=this.quickSearches[n],i=new CustomEvent("searchTermSelected",{detail:{searchEntry:r},bubbles:!0,composed:!0});this.dispatchEvent(i)}}}],[{key:"styles",get:function(){var e=Object(r.b)(Ae()),t=Object(r.b)(Me()),n=Object(r.b)(Be()),i=Object(r.b)(Ie());return Object(r.b)(Pe(),e,t,n,i)}}]),t}(r.a);function De(){var e=Object(u.k)(["\n .container {\n position: relative;\n }\n\n .search-bar {\n display: flex;\n justify-content: flex-start;\n }\n\n .endcap {\n display: flex;\n justify-content: center;\n align-items: center;\n height: calc("," * 2);\n border: ",";\n padding: 0 calc("," / 2);\n }\n\n .endcap svg {\n height: ",";\n width: ",";\n }\n\n .clear-search-container {\n border-left: 0;\n border-radius: 0 calc(",")\n calc(",") 0;\n }\n\n .search-bar.is-searching .clear-search-container {\n padding: 0 calc("," / 2) 0 0;\n }\n\n .search-bar.is-searching .clear-search-container button {\n display: block;\n }\n\n .clear-search-container button {\n display: none;\n }\n\n .magnifier-container {\n border-radius: calc(",") 0 0\n calc(",");\n border-right: 0;\n }\n .container.is-open .magnifier-container {\n border-radius: calc(",") 0 0 0;\n }\n\n .container.shows-disclosure .clear-search-container {\n border-radius: 0 0 0 0;\n }\n .container.shows-disclosure .clear-search-container {\n border-right: 0;\n }\n .disclosure-container {\n border-radius: 0 calc(",")\n calc(",") 0;\n display: none;\n }\n .container.shows-disclosure .disclosure-container {\n display: flex;\n }\n .container.is-open .disclosure-container {\n border-radius: 0 calc(",") 0 0;\n }\n .disclosure-container button {\n border: 0;\n background: none;\n }\n\n #search-input {\n border-top: ",";\n border-bottom: ",";\n border-left: 0;\n border-right: 0;\n border-radius: 0;\n background-color: ",";\n color: ",";\n padding: 0;\n margin: 0;\n font-size: ",";\n flex: 1 1 auto;\n min-width: ",";\n }\n\n #search-input:focus {\n outline: none;\n }\n\n .quick-search {\n border-radius: 0 0 calc(",")\n calc(",");\n display: none;\n position: absolute;\n left: 0;\n right: 0;\n background-color: black;\n z-index: 1;\n max-height: ",";\n overflow-y: scroll;\n scrollbar-width: none;\n padding: 0 calc("," / 2);\n }\n\n .quick-search::-webkit-scrollbar {\n display: none;\n }\n\n .container.is-open.shows-disclosure .quick-search {\n border: ",";\n border-top: 0;\n display: block;\n }\n\n button {\n background: none;\n border: none;\n margin: 0;\n padding: 0;\n }\n "]);return De=function(){return e},e}function Le(){var e=Object(u.k)(["var(--expandableSearchBarMaxExpansionHeight, 150px)"]);return Le=function(){return e},e}function Ve(){var e=Object(u.k)(["var(--expandableSearchBarMinWidth, 5em)"]);return Ve=function(){return e},e}function ze(){var e=Object(u.k)(["var(--expandableSearchBarBorderColor, 1px solid white)"]);return ze=function(){return e},e}function He(){var e=Object(u.k)(["var(--expandableSearchBarFontSize, 1em)"]);return He=function(){return e},e}function We(){var e=Object(u.k)(["var(--expandableSearchBarTextColor, white)"]);return We=function(){return e},e}function Ze(){var e=Object(u.k)(["var(--expandableSearchBarBackgroundColor, black)"]);return Ze=function(){return e},e}function $e(){var e=Object(u.k)(['\n <div\n class="\n container\n ',"\n ",'"\n >\n <div class="search-bar ','">\n <div class="magnifier-container endcap">\n ','\n </div>\n <input\n id="search-input"\n type="text"\n placeholder="Search"\n value=',"\n @keyup=",'\n />\n <div class="clear-search-container endcap">\n <button id="clear-search-button" @click=',">\n ",'\n </button>\n </div>\n <div class="disclosure-container endcap">\n <button id="disclosure-button" @click=',">\n ",'\n </button>\n </div>\n </div>\n <div class="quick-search">\n <quick-search\n .quickSearches=',"\n @searchTermSelected=","\n >\n </quick-search>\n </div>\n </div>\n "]);return $e=function(){return e},e}Ue([Object(r.e)({type:Array})],qe.prototype,"quickSearches",void 0),qe=Ue([Object(r.c)("quick-search")],qe);var Qe=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},Je=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).isOpen=!1,e.showsDisclosure=!1,e.searchTerm="",e.quickSearches=[],e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)($e(),this.isOpen?"is-open":"",this.showsDisclosure?"shows-disclosure":"",""===this.searchTerm?"":"is-searching",Te,this.searchTerm,this.inputChanged,this.clearSearch,Re,this.toggleDisclosure,Ee,this.quickSearches,this.quickSearchSelected)}},{key:"clearSearch",value:function(){this.searchTerm="",this.searchInput&&(this.searchInput.value="",this.searchInput.focus()),this.emitSearchClearedEvent()}},{key:"inputChanged",value:function(e){this.searchInput&&(this.searchTerm=this.searchInput.value),this.emitInputChangeEvent(),"Enter"===e.key&&this.emitEnterKeyPressedEvent()}},{key:"emitInputChangeEvent",value:function(){var e=new CustomEvent("inputchange",{detail:{value:this.searchTerm}});this.dispatchEvent(e)}},{key:"emitEnterKeyPressedEvent",value:function(){var e=new CustomEvent("enterKeyPressed",{detail:{value:this.searchTerm}});this.dispatchEvent(e)}},{key:"emitSearchClearedEvent",value:function(){var e=new Event("searchCleared");this.dispatchEvent(e)}},{key:"quickSearchSelected",value:function(e){var t=new CustomEvent("quickSearchSelected",{detail:{quickSearchEntry:e.detail.searchEntry}});this.dispatchEvent(t),this.isOpen=!1}},{key:"toggleDisclosure",value:function(){this.isOpen=!this.isOpen}},{key:"searchInput",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("search-input")}}],[{key:"styles",get:function(){var e=Object(r.b)(Ze()),t=Object(r.b)(We()),n=Object(r.b)(He()),i=Object(r.b)(ze()),o=Object(r.b)(Ve()),a=Object(r.b)(Le());return Object(r.b)(De(),n,i,n,n,n,n,n,n,n,n,n,n,n,n,i,i,e,t,n,o,n,n,a,n,i)}}]),t}(r.a);Qe([Object(r.e)({type:Boolean})],Je.prototype,"isOpen",void 0),Qe([Object(r.e)({type:Boolean})],Je.prototype,"showsDisclosure",void 0),Qe([Object(r.e)({type:String})],Je.prototype,"searchTerm",void 0),Qe([Object(r.e)({type:Array})],Je.prototype,"quickSearches",void 0),Je=Qe([Object(r.c)("expandable-search-bar")],Je);var Ke=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(u.a)(this,e),this.displayText="",this.data={},this.displayText=t,this.data=n};function Xe(){var e=Object(u.k)(['\n <svg height="13" viewBox="0 0 8 13" width="8" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m-1.5 8.5 5-5 5 5"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n transform="matrix(0 -1 1 0 -2 9.7)"\n />\n </svg>\n']);return Xe=function(){return e},e}var Ge=Object(r.d)(Xe());function Ye(){var e=Object(u.k)(['\n <svg height="13" viewBox="0 0 8 13" width="8" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m-1.5 8.5 5-5 5 5"\n fill="none"\n stroke="#fff"\n stroke-linecap="round"\n stroke-linejoin="round"\n stroke-width="2"\n transform="matrix(0 -1 -1 0 10 9.7)"\n />\n </svg>\n']);return Ye=function(){return e},e}var et=Object(r.d)(Ye());function tt(){var e=Object(u.k)(["\n .container {\n text-align: center;\n }\n\n button {\n background: none;\n border: 0;\n cursor: pointer;\n }\n "]);return tt=function(){return e},e}function nt(){var e=Object(u.k)(['\n <div class="container">\n <button @click=',' id="previous-button">\n ','\n </button>\n <span class="results-range">\n <span id="current-result">','</span> /\n <span id="number-of-results">',"</span>\n </span>\n <button @click=",' id="next-button">\n ',"\n </button>\n </div>\n "]);return nt=function(){return e},e}var rt=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},it=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).numberOfResults=0,e.currentResultIndex=0,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(nt(),this.goToPreviousResult,Ge,this.currentResultIndex+1,this.numberOfResults,this.goToNextResult,et)}},{key:"updated",value:function(e){e.has("numberOfResults")&&(this.currentResultIndex=0)}},{key:"goToPreviousResult",value:function(){this.currentResultIndex<1?this.currentResultIndex=this.numberOfResults-1:this.currentResultIndex-=1,this.emitSearchResultIndexChangedEvent()}},{key:"goToNextResult",value:function(){this.currentResultIndex===this.numberOfResults-1?this.currentResultIndex=0:this.currentResultIndex+=1,this.emitSearchResultIndexChangedEvent()}},{key:"emitSearchResultIndexChangedEvent",value:function(){var e=new CustomEvent("searchResultIndexChanged",{detail:{searchResultIndex:this.currentResultIndex}});this.dispatchEvent(e)}}],[{key:"styles",get:function(){return Object(r.b)(tt())}}]),t}(r.a);rt([Object(r.e)({type:Number})],it.prototype,"numberOfResults",void 0),rt([Object(r.e)({type:Number})],it.prototype,"currentResultIndex",void 0),it=rt([Object(r.c)("search-results-switcher")],it);var ot=function e(t,n){Object(u.a)(this,e),this.start=0,this.end=0,this.start=t,this.end=n};function at(){var e=Object(u.k)(["\n ","\n "]);return at=function(){return e},e}var st=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ct=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).entry=void 0,e.isActive=!1,e.isSelected=!1,e.isClickable=!1,e.isSearchResult=!1,e.isMusicEntry=!1,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(at(),this.entry?this.entry.displayText:"")}}]),t}(r.a);function ut(){var e=Object(u.k)(["\n ","\n "]);return ut=function(){return e},e}st([Object(r.e)({type:Object})],ct.prototype,"entry",void 0),st([Object(r.e)({type:Boolean,reflect:!0})],ct.prototype,"isActive",void 0),st([Object(r.e)({type:Boolean,reflect:!0})],ct.prototype,"isSelected",void 0),st([Object(r.e)({type:Boolean,reflect:!0})],ct.prototype,"isClickable",void 0),st([Object(r.e)({type:Boolean,reflect:!0})],ct.prototype,"isSearchResult",void 0),st([Object(r.e)({type:Boolean,reflect:!0})],ct.prototype,"isMusicEntry",void 0),ct=st([Object(r.c)("transcript-entry")],ct);var lt=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},ht=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).seconds=0,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(ut(),this.durationString)}},{key:"durationString",get:function(){return"number"!=typeof this.seconds?"":[Math.floor(this.seconds/3600),Math.floor(this.seconds/60)%60,Math.floor(this.seconds%60)].map((function(e){return e<10?"0".concat(e):e})).filter((function(e,t){return"00"!==e||t>0})).join(":")}}]),t}(r.a);lt([Object(r.e)({type:Number})],ht.prototype,"seconds",void 0),ht=lt([Object(r.c)("duration-formatter")],ht);var dt=function(){function e(t){Object(u.a)(this,e),this.entries=[],this.entries=t}return Object(u.b)(e,[{key:"searchResults",get:function(){return this.entries.filter((function(e){return void 0!==e.searchMatchIndex}))}}]),e}();function ft(){var e=Object(u.k)(["\n :host {\n color: ",";\n }\n\n .container {\n position: relative;\n }\n\n .auto-scroll-button.hidden {\n display: none;\n }\n\n .auto-scroll-button {\n position: absolute;\n left: 0;\n right: 0;\n bottom: 1rem;\n margin: auto;\n width: ",";\n border-radius: 1em;\n border: 0;\n display: inline-block;\n color: ",";\n background-color: ",";\n font-size: ",";\n z-index: 10;\n }\n\n .context-overlay {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n z-index: -1;\n }\n\n .context-overlay.top {\n top: 0;\n border-bottom: 1px solid green;\n }\n\n .context-overlay.bottom {\n bottom: 0;\n border-top: 1px solid green;\n }\n\n .time {\n display: ",";\n flex: 0 0 ",";\n color: ",";\n position: relative;\n }\n\n .time-display {\n position: absolute;\n top: 0;\n font-size: ",";\n line-height: ",";\n transition: top 1s;\n }\n\n .scroll-container {\n display: flex;\n overflow-y: auto;\n -ms-overflow-style: none;\n scrollbar-width: none;\n height: ",";\n }\n\n .scroll-container::-webkit-scrollbar {\n display: none;\n }\n\n transcript-entry {\n cursor: pointer;\n }\n\n transcript-entry:hover {\n color: ",";\n }\n\n transcript-entry[ismusicentry] {\n color: ",";\n display: block;\n font-style: italic;\n }\n\n transcript-entry[ismusicentry]:hover {\n color: ",";\n }\n\n transcript-entry[ismusicentry][isactive] {\n color: ",";\n }\n\n transcript-entry[isactive] {\n color: ",";\n }\n\n transcript-entry[issearchresult] {\n display: inline-block; /* without this, the outline adds an extra space to the right of the text */\n padding: 0 5px;\n position: relative;\n }\n\n transcript-entry[issearchresult]:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n border: 2px solid ",";\n border-radius: 5px;\n }\n\n transcript-entry[issearchresult][isselected]:after {\n border: 2px solid ",";\n }\n "]);return ft=function(){return e},e}function pt(){var e=Object(u.k)(["var(--transcriptSearchResultActiveBorderColor, green)"]);return pt=function(){return e},e}function vt(){var e=Object(u.k)(["var(--transcriptSearchResultInactiveBorderColor, gray)"]);return vt=function(){return e},e}function bt(){var e=Object(u.k)(["var(--transcriptMusicActiveTextColor, silver)"]);return bt=function(){return e},e}function yt(){var e=Object(u.k)(["var(--transcriptMusicActiveTextColor, white)"]);return yt=function(){return e},e}function mt(){var e=Object(u.k)(["var(--transcriptMusicNormalTextColor, gray)"]);return mt=function(){return e},e}function gt(){var e=Object(u.k)(["var(--transcriptHoverTextColor, silver)"]);return gt=function(){return e},e}function kt(){var e=Object(u.k)(["var(--transcriptActiveTextColor, white)"]);return kt=function(){return e},e}function wt(){var e=Object(u.k)(["var(--transcriptNormalTextColor, gray)"]);return wt=function(){return e},e}function Ot(){var e=Object(u.k)(["var(--autoScrollButtonFontSize, 1em)"]);return Ot=function(){return e},e}function jt(){var e=Object(u.k)(["var(--autoScrollButtonWidth, 12rem)"]);return jt=function(){return e},e}function St(){var e=Object(u.k)(["var(--autoScrollButtonBackgroundColor, white)"]);return St=function(){return e},e}function xt(){var e=Object(u.k)(["var(--autoScrollButtonFontColor, black)"]);return xt=function(){return e},e}function Tt(){var e=Object(u.k)(["var(--timeDisplay, block)"]);return Tt=function(){return e},e}function _t(){var e=Object(u.k)(["var(--timeColumnWidth, 3rem)"]);return _t=function(){return e},e}function Et(){var e=Object(u.k)(["var(--timeColor, white)"]);return Et=function(){return e},e}function Ct(){var e=Object(u.k)(["var(--timeLineHeight, 1em)"]);return Ct=function(){return e},e}function Rt(){var e=Object(u.k)(["var(--timeFontSize, 1em)"]);return Rt=function(){return e},e}function Pt(){var e=Object(u.k)(["var(--transcriptHeight, 200px)"]);return Pt=function(){return e},e}function It(){var e=Object(u.k)(['\n <div class="bottom context-overlay" style="height: ','px"></div>\n ']);return It=function(){return e},e}function Bt(){var e=Object(u.k)(['\n <div class="top context-overlay" style="height: ','px"></div>\n ']);return Bt=function(){return e},e}function Mt(){var e=Object(u.k)(["\n "," ","\n "]);return Mt=function(){return e},e}function At(){var e=Object(u.k)(['\n <div class="time-display" style="top: ','px">\n <duration-formatter .seconds=',"> </duration-formatter>\n </div>\n "]);return At=function(){return e},e}function Nt(){var e=Object(u.k)(["\n <button\n @click=",'\n class="auto-scroll-button ','"\n >\n Scroll text with audio\n </button>\n ']);return Nt=function(){return e},e}function Ft(){var e=Object(u.k)(["\n <transcript-entry\n .entry=","\n ?isSelected=","\n ?isActive=","\n ?isSearchResult=","\n ?isMusicEntry=",'\n isClickable="true"\n data-search-result-index=',"\n data-identifier=","\n @click=","\n >\n </transcript-entry>\n "]);return Ft=function(){return e},e}function Ut(){var e=Object(u.k)(['\n <div class="container">\n ','\n\n <div class="scroll-container" id="scroll-container" @wheel='," @touchmove=",'>\n <div class="col time">\n ','\n </div>\n\n <div class="col">\n ',"\n ","\n </div>\n </div>\n </div>\n "]);return Ut=function(){return e},e}var qt=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},Dt=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).config=void 0,e.currentTime=0,e.topContextHeight=50,e.bottomContextHeight=50,e.autoScroll=!0,e.selectedSearchResultIndex=0,e.showContextZones=!1,e.timeScrollTop=0,e.currentEntries=[],e.scrollTimerDelay=15e3,e.scrollResumeTimerId=-1,e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){var e=this;return Object(r.d)(Ut(),this.showContextZones?this.contextZoneDevTemplates:"",this.didScroll,this.didScroll,this.timeDisplayTemplate,this.autoScrollButtonTemplate,this.transcriptEntries.map((function(t){return e.transcriptEntryTemplate(t)})))}},{key:"scrollToSelectedSearchResult",value:function(){var e=this.selectedSearchResult;e&&(this.autoScroll=!1,this.scrollToElement(e))}},{key:"transcriptEntryTemplate",value:function(e){var t=void 0!==this.currentEntries.find((function(t){return t.id===e.id})),n=e.searchMatchIndex===this.selectedSearchResultIndex,i=void 0!==e.searchMatchIndex,o=e.isMusic;return Object(r.d)(Ft(),e,n,t,i,o,e.searchMatchIndex,e.id,this.transcriptEntrySelected)}},{key:"transcriptEntrySelected",value:function(e){var t=e.target.entry;if(t){var n=new CustomEvent("transcriptEntrySelected",{detail:{entry:t}});this.dispatchEvent(n),void 0!==t.searchMatchIndex&&(this.selectedSearchResultIndex=t.searchMatchIndex),this.autoScroll=!1}}},{key:"handleCurrentTimeChange",value:function(){var e=this,t=this.transcriptEntries;if(0!==t.length){var n=t.filter((function(t){return e.currentTime>=t.start&&e.currentTime<=t.end}));this.entryArraysMatch(n,this.currentEntries)||(this.dispatchEvent(new Event("currentEntriesUpdated")),this.currentEntries=n)}}},{key:"entryArraysMatch",value:function(e,t){if(e.length!==t.length)return!1;var n=e.map((function(e){return e.id})).sort(),r=t.map((function(e){return e.id})).sort(),i=!0;return n.forEach((function(e,t){r[t]!==e&&(i=!1)})),!!i}},{key:"entryIdentifierClosestToTime",value:function(e){if(0===this.transcriptEntries.length)return null;var t=this.transcriptEntries[0],n=Math.abs(e-t.start),r=t.id;return this.transcriptEntries.forEach((function(t){var i=Math.abs(e-t.start);i<n&&(n=i,r=t.id)})),r}},{key:"elementClosestToTime",value:function(e){var t=this.entryIdentifierClosestToTime(e);return t?this.elementForIdentifier(t):null}},{key:"elementForIdentifier",value:function(e){return this.shadowRoot&&this.shadowRoot.querySelector('transcript-entry[data-identifier="'.concat(e,'"]'))}},{key:"didScroll",value:function(){var e=this;this.autoScroll=!1,window.clearTimeout(this.scrollResumeTimerId),this.scrollResumeTimerId=window.setTimeout((function(){e.autoScroll=!0}),this.scrollTimerDelay)}},{key:"enableAutoScroll",value:function(){this.autoScroll=!0,this.scrollToClosestEntry()}},{key:"updated",value:function(e){e.has("currentTime")&&this.handleCurrentTimeChange(),e.has("selectedSearchResultIndex")&&this.scrollToSelectedSearchResult(),e.has("currentEntries")&&(this.scrollToClosestEntry(),this.updateTimePosition()),e.has("autoScroll")&&this.handleAutoScrollChange(),e.has("config")&&(this.selectedSearchResultIndex=0,this.scrollToSelectedSearchResult())}},{key:"handleAutoScrollChange",value:function(){var e=new CustomEvent("autoScrollChanged",{detail:{autoScroll:this.autoScroll}});this.dispatchEvent(e)}},{key:"scrollToClosestEntry",value:function(){if(this.autoScroll){var e=this.closestEntryToCurrentTime;e&&this.scrollToElement(e)}}},{key:"scrollToElement",value:function(e){var t=this.scrollView;if(t){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height,o=this.topContextHeight,a=i-this.bottomContextHeight;if(r.bottom>n.top+a||r.top<n.top){var s=r.top-n.top+t.scrollTop-o;this.scrollToOffsetWithDuration(s,1)}}}},{key:"updateTimePosition",value:function(){var e=this.closestEntryToCurrentTime;if(e){var t=e.parentNode.getBoundingClientRect(),n=e.getBoundingClientRect().top-t.top;this.timeScrollTop=n}}},{key:"scrollToOffsetWithDuration",value:function(e,t,n){var r=this.scrollView;if(r){var i,o,a=r.scrollTop,s=e-a,c=performance.now();!function e(){var u;r&&(i=performance.now(),o=(i-c)/1e3/t,r.scrollTop=a+s*((u=o)<.5?2*u*u:(4-2*u)*u-1),o<1?window.requestAnimationFrame(e):n&&n())}()}}},{key:"autoScrollButtonTemplate",get:function(){return Object(r.d)(Nt(),this.enableAutoScroll,this.autoScroll?"hidden":"")}},{key:"timeDisplayTemplate",get:function(){return Object(r.d)(At(),this.timeScrollTop,this.currentTime)}},{key:"contextZoneDevTemplates",get:function(){return Object(r.d)(Mt(),this.topContextZoneDevTemplate,this.bottomContextZoneDevTemplate)}},{key:"topContextZoneDevTemplate",get:function(){return Object(r.d)(Bt(),this.topContextHeight)}},{key:"bottomContextZoneDevTemplate",get:function(){return Object(r.d)(It(),this.bottomContextHeight)}},{key:"transcriptEntries",get:function(){return this.config?this.config.entries:[]}},{key:"scrollView",get:function(){return this.shadowRoot&&this.shadowRoot.getElementById("scroll-container")}},{key:"activeTranscriptEntry",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector("transcript-entry[isActive]")}},{key:"selectedSearchResult",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector('transcript-entry[data-search-result-index="'.concat(this.selectedSearchResultIndex,'"]'))}},{key:"closestEntryToCurrentTime",get:function(){return this.activeTranscriptEntry||this.elementClosestToTime(this.currentTime)}}],[{key:"styles",get:function(){var e=Object(r.b)(Pt()),t=Object(r.b)(Rt()),n=Object(r.b)(Ct()),i=Object(r.b)(Et()),o=Object(r.b)(_t()),a=Object(r.b)(Tt()),s=Object(r.b)(xt()),c=Object(r.b)(St()),u=Object(r.b)(jt()),l=Object(r.b)(Ot()),h=Object(r.b)(wt()),d=Object(r.b)(kt()),f=Object(r.b)(gt()),p=Object(r.b)(mt()),v=Object(r.b)(yt()),b=Object(r.b)(bt()),y=Object(r.b)(vt()),m=Object(r.b)(pt());return Object(r.b)(ft(),h,u,s,c,l,a,o,i,t,n,e,f,p,b,v,d,y,m)}}]),t}(r.a);qt([Object(r.e)({type:dt})],Dt.prototype,"config",void 0),qt([Object(r.e)({type:Number})],Dt.prototype,"currentTime",void 0),qt([Object(r.e)({type:Number})],Dt.prototype,"topContextHeight",void 0),qt([Object(r.e)({type:Number})],Dt.prototype,"bottomContextHeight",void 0),qt([Object(r.e)({type:Boolean})],Dt.prototype,"autoScroll",void 0),qt([Object(r.e)({type:Number})],Dt.prototype,"selectedSearchResultIndex",void 0),qt([Object(r.e)({type:Boolean})],Dt.prototype,"showContextZones",void 0),qt([Object(r.e)({type:Number})],Dt.prototype,"timeScrollTop",void 0),qt([Object(r.e)({type:Array})],Dt.prototype,"currentEntries",void 0),Dt=qt([Object(r.c)("transcript-view")],Dt);var Lt=function(){function e(t,n,r,i,o,a){Object(u.a)(this,e),this.id=t,this.start=n,this.end=r,this.rawText=i,this.isMusic=o,this.searchMatchIndex=a}return Object(u.b)(e,[{key:"displayText",get:function(){return this.isMusic?"[Transcript unavailable]":this.rawText}}]),e}(),Vt=function(){function e(t,n){Object(u.a)(this,e),this.startIndex=t,this.endIndex=n}return Object(u.b)(e,[{key:"length",get:function(){return Math.abs(this.endIndex-this.startIndex)}}]),e}(),zt=function e(t,n){Object(u.a)(this,e),this.entry=t,this.range=n},Ht=function e(t,n,r){Object(u.a)(this,e),this.range=t,this.text=n,this.isSearchMatch=r},Wt=function(){function e(){Object(u.a)(this,e)}return Object(u.b)(e,null,[{key:"getIntersection",value:function(e,t){var n=e.startIndex<t.startIndex?e:t,r=n===e?t:e;if(!(n.endIndex<r.startIndex)){var i=n.endIndex<r.endIndex?n.endIndex:r.endIndex;return new Vt(r.startIndex,i)}}}]),e}(),Zt=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];Object(u.a)(this,e),this.mergedTranscript="",this.mergedTranscriptLowercased="",this.transcriptEntryRanges=[],this.mergedTranscript=t,this.transcriptEntryRanges=n,this.mergedTranscriptLowercased=t.toLowerCase()},$t=function(){function e(t){Object(u.a)(this,e),this.searchIndexCache=new Zt,this.buildIndex(t)}return Object(u.b)(e,[{key:"getTranscriptEntryAt",value:function(e){return this.searchIndexCache.transcriptEntryRanges.find((function(t){var n=t.range;return n.endIndex>e&&n.startIndex<=e}))}},{key:"getSearchRanges",value:function(e){for(var t=[],n=e.toLowerCase(),r=-1;-1!==(r=this.searchIndexCache.mergedTranscriptLowercased.indexOf(n,r+1));){var i=new Vt(r,r+n.length);t.push(i)}return t}},{key:"buildIndex",value:function(e){var t=0,n=[],r="";e.entries.forEach((function(e){var i=e.displayText,o=new Vt(t,t+i.length),a=new zt(e,o);n.push(a),r+="".concat(e.displayText," "),t=r.length})),r=r.trim(),this.searchIndexCache=new Zt(r,n)}},{key:"mergedTranscript",get:function(){return this.searchIndexCache.mergedTranscript}},{key:"transcriptEntryRanges",get:function(){return this.searchIndexCache.transcriptEntryRanges}}]),e}(),Qt=function(){function e(t){Object(u.a)(this,e),this.searchIndex=new $t(t)}return Object(u.b)(e,[{key:"search",value:function(e){var t=this,n=this.getSearchSeparatedTranscript(e),r=[],i=0,o=1;return n.forEach((function(e){if(e.isSearchMatch){var n=t.searchIndex.getTranscriptEntryAt(e.range.startIndex);if(!n)return;var a=t.searchIndex.getTranscriptEntryAt(e.range.endIndex)||n,s=t.createBlankTranscriptEntryConfig(n.entry);return s.searchMatchIndex=i,i+=1,s.rawText=e.text,s.id=o,o+=1,s.end=a.entry.end,void r.push(s)}t.searchIndex.transcriptEntryRanges.forEach((function(n){var i=Wt.getIntersection(e.range,n.range);if(i&&0!==i.length){var a=t.createBlankTranscriptEntryConfig(n.entry),s=t.searchIndex.mergedTranscript.substring(i.startIndex,i.endIndex);a.rawText=s.trim(),a.id=o,o+=1,r.push(a)}}))})),new dt(r)}},{key:"createBlankTranscriptEntryConfig",value:function(e){return new Lt(e.id,e.start,e.end,"",e.isMusic)}},{key:"getSearchSeparatedTranscript",value:function(e){var t=this,n=this.searchIndex.getSearchRanges(e),r=this.searchIndex.mergedTranscript;if(0===n.length){var i=new Vt(0,r.length);return[new Ht(i,r,!1)]}var o=[],a=0;n.forEach((function(e){var n=new Vt(a,e.startIndex),r=t.getSearchResult(n,!1);o.push(r);var i=t.getSearchResult(e,!0);o.push(i),a=e.endIndex}));var s=new Vt(a,r.length),c=this.getSearchResult(s,!1);return o.push(c),o}},{key:"getSearchResult",value:function(e,t){var n=this.searchIndex.mergedTranscript.substring(e.startIndex,e.endIndex);return new Ht(e,n,t)}}]),e}();function Jt(){var e=Object(u.k)(["\n section[role='main'] {\n display: -ms-grid;\n display: grid;\n grid-gap: 0.5rem;\n }\n\n /* mobile view */\n @media (max-width: 770px) {\n section[role='main'] {\n -ms-grid-columns: 25% 0.5rem 1fr;\n -ms-grid-rows: auto 0.5rem auto 0.5rem auto 0.5rem auto 0.5rem auto;\n grid-template-columns: 25% 1fr;\n grid-template-areas:\n 'collection-logo title-date'\n 'waveform-scrubber waveform-scrubber'\n 'playback-controls playback-controls'\n 'search-section search-section'\n 'transcript-container transcript-container';\n }\n .date {\n text-align: left;\n }\n transcript-view {\n --timeDisplay: none;\n }\n playback-controls {\n width: 75%;\n margin: auto;\n grid-row: 5;\n grid-column: 1;\n -ms-grid-row: 5;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .title-date {\n grid-row: 1;\n grid-column: 3;\n -ms-grid-row: 1;\n -ms-grid-column: 3;\n }\n .transcript-container {\n grid-row: 9;\n grid-column: 1;\n -ms-grid-row: 9;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .collection-logo {\n grid-row: 1;\n grid-column: 1;\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n }\n .waveform-scrubber-container {\n grid-row: 3;\n grid-column: 1;\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n }\n .search-section {\n grid-row: 7;\n grid-column: 1;\n -ms-grid-row: 7;\n -ms-grid-column: 1;\n -ms-grid-column-span: 3;\n width: 75%;\n margin: auto;\n }\n expandable-search-bar {\n width: 100%;\n }\n }\n\n /* wide view */\n @media (min-width: 770px) {\n section[role='main'] {\n -ms-grid-columns: 192px 0.5rem 0 0.5rem 250px 0.5rem 1fr;\n -ms-grid-rows: auto 0.5rem auto 0.5rem auto;\n grid-template-columns: 192px 0 250px 1fr;\n grid-template-areas:\n 'title-date title-date title-date title-date'\n 'collection-logo 1 playback-controls waveform-scrubber'\n 'search-section transcript-container transcript-container transcript-container';\n }\n .title-date {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n grid-row: 1;\n grid-column: 1;\n -ms-grid-row: 1;\n -ms-grid-column: 1;\n -ms-grid-column-span: 7;\n }\n transcript-view {\n --timeDisplay: block;\n }\n playback-controls {\n grid-row: 3;\n grid-column: 5;\n -ms-grid-row: 3;\n -ms-grid-column: 5;\n -ms-grid-column-span: 1;\n }\n .transcript-container {\n grid-row: 5;\n grid-column: 3;\n -ms-grid-row: 5;\n -ms-grid-column: 3;\n -ms-grid-column-span: 5;\n }\n .collection-logo {\n grid-row: 3;\n grid-column: 1;\n -ms-grid-row: 3;\n -ms-grid-column: 1;\n }\n .waveform-scrubber-container {\n grid-row: 3;\n grid-column: 7;\n -ms-grid-row: 3;\n -ms-grid-column: 7;\n -ms-grid-column-span: 1;\n }\n .search-section {\n grid-row: 5;\n grid-column: 1;\n -ms-grid-row: 5;\n -ms-grid-column: 1;\n -ms-grid-column-span: 1;\n }\n }\n\n .title-date {\n grid-area: title-date;\n }\n\n .title {\n color: ",";\n font: ",";\n }\n\n .date {\n color: ",";\n font: ",";\n }\n\n waveform-progress {\n width: 100%;\n height: ",";\n }\n\n playback-controls {\n grid-area: playback-controls;\n }\n\n .transcript-container {\n grid-area: transcript-container;\n }\n\n transcript-view {\n max-width: 600px;\n display: block;\n }\n\n .collection-logo {\n width: 100%;\n max-height: ",";\n object-fit: contain;\n grid-area: collection-logo;\n align-self: center;\n }\n\n .waveform-scrubber-container {\n width: 100%;\n height: 100%;\n grid-area: waveform-scrubber;\n }\n\n .search-section {\n grid-area: search-section;\n }\n\n .search-results-info {\n margin-top: 0.5em;\n }\n\n .quick-search-container {\n max-height: 150px;\n overflow-y: scroll;\n scrollbar-width: none;\n margin: 0 0.5em;\n }\n\n .quick-search-container::-webkit-scrollbar {\n display: none;\n }\n\n expandable-search-bar {\n display: block;\n margin: auto;\n }\n\n .no-search-results-message {\n text-align: center;\n }\n\n .hidden {\n display: none;\n }\n "]);return Jt=function(){return e},e}function Kt(){var e=Object(u.k)(["var(--waveformProgressHeight, 5rem)"]);return Kt=function(){return e},e}function Xt(){var e=Object(u.k)(["var(--dateFont, 1em sans-serif)"]);return Xt=function(){return e},e}function Gt(){var e=Object(u.k)(["var(--dateColor, white)"]);return Gt=function(){return e},e}function Yt(){var e=Object(u.k)(["var(--titleFont, 1.5em sans-serif)"]);return Yt=function(){return e},e}function en(){var e=Object(u.k)(["var(--titleColor, white)"]);return en=function(){return e},e}function tn(){var e=Object(u.k)(["var(--collectionLogoMaxHeight, 8rem)"]);return tn=function(){return e},e}function nn(){var e=Object(u.k)(['\n <div\n class="no-search-results-message ','"\n >\n No search results.\n </div>\n ']);return nn=function(){return e},e}function rn(){var e=Object(u.k)(['\n <search-results-switcher\n class="','"\n @searchResultIndexChanged=',"\n >\n </search-results-switcher>\n "]);return rn=function(){return e},e}function on(){var e=Object(u.k)(['\n <div class="search-section">\n <expandable-search-bar\n searchTerm=',"\n .quickSearches=","\n @inputchange=","\n @enterKeyPressed=","\n @searchCleared=",'\n >\n </expandable-search-bar>\n <div class="search-results-info">\n '," ","\n </div>\n </div>\n "]);return on=function(){return e},e}function an(){var e=Object(u.k)(['\n <div class="transcript-container">\n <transcript-view\n .config=',"\n .currentTime=","\n @transcriptEntrySelected=","\n >\n </transcript-view>\n </div>\n "]);return an=function(){return e},e}function sn(){var e=Object(u.k)(["\n <scrubber-bar\n .sectionMarkerPercentages=","\n .value=","\n @valuechange=","\n >\n </scrubber-bar>\n "]);return sn=function(){return e},e}function cn(){var e=Object(u.k)(["\n <playback-controls\n @back-button-pressed=","\n @play-pause-button-pressed=","\n @forward-button-pressed=","\n @volumeChange=","\n @playbackRateChange=","\n @next-section-button-pressed=","\n @prev-section-button-pressed=","\n >\n </playback-controls>\n "]);return cn=function(){return e},e}function un(){var e=Object(u.k)(["\n <audio-element\n .sources=","\n .playbackRate=","\n .volume=","\n @timeupdate=","\n @durationchange=","\n @playbackStarted=","\n @playbackPaused=","\n @canplay=","\n >\n </audio-element>\n "]);return un=function(){return e},e}function ln(){var e=Object(u.k)(['\n <waveform-progress\n interactive="true"\n .waveformUrl=',"\n .percentComplete=","\n @valuechange=","\n >\n </waveform-progress>\n "]);return ln=function(){return e},e}function hn(){var e=Object(u.k)(['\n <img class="collection-logo" src='," />\n "]);return hn=function(){return e},e}function dn(){var e=Object(u.k)(['\n <div class="title-date">\n <div class="title">\n ','\n </div>\n\n <div class="date">\n ',"\n </div>\n </div>\n "]);return dn=function(){return e},e}function fn(){var e=Object(u.k)(["\n ",'\n <section role="main">\n '," "," ",'\n <div class="waveform-scrubber-container">\n '," ","\n </div>\n "," ","\n </section>\n "]);return fn=function(){return e},e}var pn=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},vn=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).config=void 0,e.transcriptConfig=void 0,e.searchResultsTranscript=void 0,e.currentTime=0,e.searchTerm="",e.skipMusicSections=!1,e.percentComplete=0,e.isPlaying=!1,e.duration=0,e.playbackRate=1,e.volume=1,e.shouldShowSearchResultSwitcher=!1,e.shouldShowNoSearchResultMessage=!1,e.musicZones=[],e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"render",value:function(){return Object(r.d)(fn(),this.audioElementTemplate,this.titleDateTemplate,this.collectionLogoTemplate,this.playbackControlsTemplate,this.waveFormProgressTemplate,this.scrubberBarTemplate,this.searchSectionTemplate,this.transcriptViewTemplate)}},{key:"play",value:function(){this.audioElement&&this.audioElement.play()}},{key:"pause",value:function(){this.audioElement&&this.audioElement.pause()}},{key:"seekTo",value:function(e){this.audioElement&&this.audioElement.seekTo(e)}},{key:"updateSearchTerm",value:function(e){var t=e.detail||{};if(t.value){var n=t.value;this.searchTerm=n,this.emitSearchTermChangedEvent(n)}}},{key:"searchCleared",value:function(){this.searchTerm="",this.searchResultsTranscript=void 0,this.emitSearchClearedEvent(),this.emitSearchTermChangedEvent(""),this.transcriptView&&(this.transcriptView.selectedSearchResultIndex=0),this.searchResultsSwitcher&&(this.searchResultsSwitcher.currentResultIndex=0)}},{key:"searchResultIndexChanged",value:function(e){var t=(e.detail||{}).searchResultIndex;void 0!==t&&this.transcriptView&&(this.transcriptView.selectedSearchResultIndex=t,this.transcriptView.scrollToSelectedSearchResult())}},{key:"searchEnterKeyPressed",value:function(e){var t=e.detail||{};t.value&&this.executeSearch(t.value)}},{key:"executeSearch",value:function(e){!this.searchHandler||e.length<2?this.searchResultsTranscript=void 0:this.searchResultsTranscript=this.searchHandler.search(e)}},{key:"changePlaybackRate",value:function(e){var t=e.detail||{};t.playbackRate&&(this.playbackRate=t.playbackRate)}},{key:"volumeChanged",value:function(e){void 0!==(e.detail||{}).volume&&(this.volume=e.detail.volume)}},{key:"backButtonHandler",value:function(){this.audioElement&&this.audioElement.seekBy(-10)}},{key:"playPauseButtonHandler",value:function(){this.isPlaying=!this.isPlaying,this.audioElement&&(this.isPlaying?this.audioElement.play():this.audioElement.pause())}},{key:"forwardButtonHandler",value:function(){this.audioElement&&this.audioElement.seekBy(10)}},{key:"nextSectionButtonHandler",value:function(){var e=this;if(this.audioElement){var t=this.scrubberBarMarkerPercentages.filter((function(t){return t>e.percentComplete+.1})),n=Math.min.apply(Math,Object(u.c)(t)),r=this.duration*(n/100)+.1;this.audioElement.seekTo(r)}}},{key:"prevSectionButtonHandler",value:function(){var e=this;if(this.audioElement){var t=this.scrubberBarMarkerPercentages.filter((function(t){return t<e.percentComplete-.1})),n=Math.max.apply(Math,Object(u.c)(t)),r=this.duration*(n/100)-.1;this.audioElement.seekTo(r)}}},{key:"handleDurationChange",value:function(e){var t=e.detail||{};t.duration&&(this.duration=t.duration)}},{key:"handleTimeChange",value:function(e){var t=e.detail||{};if(t.currentTime){this.currentTime=t.currentTime;var n=this.currentTime/this.duration;this.percentComplete=100*n}}},{key:"emitCurrentTimeChangedEvent",value:function(){var e=new CustomEvent("currentTimeChanged",{detail:{currentTime:this.currentTime}});this.dispatchEvent(e)}},{key:"emitSearchClearedEvent",value:function(){var e=new Event("searchCleared");this.dispatchEvent(e)}},{key:"emitSearchTermChangedEvent",value:function(e){var t=new CustomEvent("searchTermChanged",{detail:{searchTerm:e}});this.dispatchEvent(t)}},{key:"playbackPaused",value:function(){this.isPlaying=!1,this.playbackControls&&(this.playbackControls.playbackMode=k.paused);var e=new Event("playbackPaused");this.dispatchEvent(e)}},{key:"playbackStarted",value:function(){this.isPlaying=!0,this.playbackControls&&(this.playbackControls.playbackMode=k.playing);var e=new Event("playbackStarted");this.dispatchEvent(e)}},{key:"canplay",value:function(){var e=new Event("canplay");this.dispatchEvent(e)}},{key:"valueChangedFromScrub",value:function(e){var t=e.detail||{};if(t.value){var n=t.value,r=this.duration*(n/100);this.currentTime=r,this.audioElement&&this.audioElement.seekTo(r),this.percentComplete=n;var i=new CustomEvent("timeChangedFromScrub",{detail:{newTime:this.currentTime}});this.dispatchEvent(i)}}},{key:"transcriptEntrySelected",value:function(e){var t=(e.detail||{}).entry||{};if(t.start){var n=t.start;this.currentTime=n,this.audioElement&&(this.audioElement.seekTo(n),this.audioElement.play());var r=new CustomEvent("transcriptEntrySelected",{detail:{newTime:this.currentTime}});this.dispatchEvent(r)}}},{key:"updateMusicZones",value:function(){var e=this.transcriptEntries.filter((function(e){return!0===e.isMusic})).map((function(e){return new ot(e.start,e.end)}));this.musicZones=e}},{key:"skipMusicZone",value:function(){var e=this,t=this.musicZones.find((function(t){return e.currentTime>t.start&&e.currentTime<t.end}));t&&this.audioElement&&this.audioElement.seekTo(t.end+.1)}},{key:"updateSearchResultSwitcher",value:function(){if(this.shouldShowNoSearchResultMessage=!1,this.shouldShowSearchResultSwitcher=!1,0!==this.searchTerm.length){var e=this.searchResults.length;0===e?this.shouldShowNoSearchResultMessage=!0:(this.shouldShowSearchResultSwitcher=!0,this.searchResultsSwitcher&&(this.searchResultsSwitcher.numberOfResults=e))}}},{key:"updated",value:function(e){e.has("transcriptConfig")&&(this.updateMusicZones(),this.setupSearchHandler()),e.has("searchResultsTranscript")&&this.updateSearchResultSwitcher(),e.has("searchTerm")&&this.executeSearch(this.searchTerm),e.has("currentTime")&&(this.emitCurrentTimeChangedEvent(),this.skipMusicSections&&this.skipMusicZone())}},{key:"setupSearchHandler",value:function(){this.transcriptConfig&&(this.searchHandler=new Qt(this.transcriptConfig)),this.searchTerm&&this.executeSearch(this.searchTerm)}},{key:"titleDateTemplate",get:function(){return Object(r.d)(dn(),this.config?this.config.title:"",this.config?this.config.date:"")}},{key:"collectionLogoTemplate",get:function(){return Object(r.d)(hn(),this.logoUrl)}},{key:"logoUrl",get:function(){return this.config?this.config.logoUrl:""}},{key:"waveFormProgressTemplate",get:function(){return this.waveformUrl?Object(r.d)(ln(),this.waveformUrl,this.percentComplete,this.valueChangedFromScrub):void 0}},{key:"zonesOfSilence",get:function(){var e=this;return 0===this.duration?[]:this.transcriptEntries.filter((function(e){return!0===e.isMusic})).map((function(t){var n=t.start/e.duration*100,r=t.end/e.duration*100;return new w(n,r)}))}},{key:"waveformUrl",get:function(){return this.config?this.config.waveformUrl:""}},{key:"audioElementTemplate",get:function(){return Object(r.d)(un(),this.audioSources,this.playbackRate,this.volume,this.handleTimeChange,this.handleDurationChange,this.playbackStarted,this.playbackPaused,this.canplay)}},{key:"audioSources",get:function(){return this.config?this.config.audioSources:[]}},{key:"playbackControlsTemplate",get:function(){return Object(r.d)(cn(),this.backButtonHandler,this.playPauseButtonHandler,this.forwardButtonHandler,this.volumeChanged,this.changePlaybackRate,this.nextSectionButtonHandler,this.prevSectionButtonHandler)}},{key:"scrubberBarMarkerPercentages",get:function(){var e=[0];return this.zonesOfSilence.forEach((function(t){e.push(t.startPercent),e.push(t.endPercent)})),e.push(100),e}},{key:"scrubberBarTemplate",get:function(){return Object(r.d)(sn(),this.scrubberBarMarkerPercentages,this.percentComplete,this.valueChangedFromScrub)}},{key:"transcriptViewTemplate",get:function(){return Object(r.d)(an(),this.currentTranscript,this.currentTime,this.transcriptEntrySelected)}},{key:"currentTranscript",get:function(){return this.searchResultsTranscript||this.transcriptConfig}},{key:"searchSectionTemplate",get:function(){return Object(r.d)(on(),this.searchTerm,this.quickSearches,this.updateSearchTerm,this.searchEnterKeyPressed,this.searchCleared,this.searchResultsSwitcherTemplate,this.noSearchResultsTemplate)}},{key:"searchResultsSwitcherTemplate",get:function(){return Object(r.d)(rn(),this.shouldShowSearchResultSwitcher?"":"hidden",this.searchResultIndexChanged)}},{key:"noSearchResultsTemplate",get:function(){return Object(r.d)(nn(),this.shouldShowNoSearchResultMessage?"":"hidden")}},{key:"quickSearches",get:function(){return this.config?this.config.quickSearches.map((function(e){return new Ke(e)})):[]}},{key:"transcriptEntries",get:function(){return this.currentTranscript?this.currentTranscript.entries:[]}},{key:"transcriptView",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("transcript-view"):null}},{key:"audioElement",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("audio-element"):null}},{key:"playbackControls",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("playback-controls"):null}},{key:"searchResultsSwitcher",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("search-results-switcher"):null}},{key:"searchResults",get:function(){return this.searchResultsTranscript?this.searchResultsTranscript.searchResults:[]}}],[{key:"styles",get:function(){var e=Object(r.b)(tn()),t=Object(r.b)(en()),n=Object(r.b)(Yt()),i=Object(r.b)(Gt()),o=Object(r.b)(Xt()),a=Object(r.b)(Kt());return Object(r.b)(Jt(),t,n,i,o,a,e)}}]),t}(r.a);pn([Object(r.e)({type:Object})],vn.prototype,"config",void 0),pn([Object(r.e)({type:Object})],vn.prototype,"transcriptConfig",void 0),pn([Object(r.e)({type:Object})],vn.prototype,"searchResultsTranscript",void 0),pn([Object(r.e)({type:Number})],vn.prototype,"currentTime",void 0),pn([Object(r.e)({type:String})],vn.prototype,"searchTerm",void 0),pn([Object(r.e)({type:Boolean})],vn.prototype,"skipMusicSections",void 0),pn([Object(r.e)({type:Number})],vn.prototype,"percentComplete",void 0),pn([Object(r.e)({type:Boolean})],vn.prototype,"isPlaying",void 0),pn([Object(r.e)({type:Number})],vn.prototype,"duration",void 0),pn([Object(r.e)({type:Number})],vn.prototype,"playbackRate",void 0),pn([Object(r.e)({type:Number})],vn.prototype,"volume",void 0),pn([Object(r.e)({type:Boolean})],vn.prototype,"shouldShowSearchResultSwitcher",void 0),pn([Object(r.e)({type:Boolean})],vn.prototype,"shouldShowNoSearchResultMessage",void 0);vn=pn([Object(r.c)("radio-player")],vn);var bn=function e(t,n,r,i,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];Object(u.a)(this,e),this.quickSearches=[],this.title=t,this.date=n,this.logoUrl=r,this.waveformUrl=i,this.audioSources=o,this.quickSearches=a};function yn(){var e=Object(u.k)(["\n <source src="," type="," />\n "]);return yn=function(){return e},e}function mn(){var e=Object(u.k)(["\n <audio\n @timeupdate=","\n @durationchange=","\n @play=","\n @pause=","\n @canplay=","\n >\n ","\n </audio>\n "]);return mn=function(){return e},e}var gn=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===("undefined"==typeof Reflect?"undefined":Object(u.h)(Reflect))&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a},kn=function(e){function t(){var e;return Object(u.a)(this,t),(e=Object(u.e)(this,Object(u.f)(t).apply(this,arguments))).showControls=!1,e.playbackRate=1,e.volume=1,e.sources=[],e}return Object(u.d)(t,e),Object(u.b)(t,[{key:"load",value:function(){this.audioElement&&(this.audioElement.load(),this.audioElement.playbackRate=this.playbackRate)}},{key:"play",value:function(){this.audioElement&&this.audioElement.play()}},{key:"pause",value:function(){this.audioElement&&this.audioElement.pause()}},{key:"seekTo",value:function(e){this.audioElement&&(this.audioElement.currentTime=e)}},{key:"seekBy",value:function(e){this.audioElement&&(this.audioElement.currentTime=this.audioElement.currentTime+e)}},{key:"render",value:function(){return Object(r.d)(mn(),this.handleTimeChange,this.handleDurationChange,this.playbackStarted,this.playbackPaused,this.canplay,this.sources.map((function(e){return Object(r.d)(yn(),e.url,e.mimetype)})))}},{key:"updated",value:function(e){this.audioElement&&(e.has("playbackRate")&&(this.audioElement.playbackRate=this.playbackRate),e.has("volume")&&(this.audioElement.volume=this.volume),e.has("showControls")&&(this.showControls?this.audioElement.setAttribute("controls","true"):this.audioElement.removeAttribute("controls")))}},{key:"handleDurationChange",value:function(e){var t=e.target,n=new CustomEvent("durationchange",{detail:{duration:t.duration}});this.dispatchEvent(n)}},{key:"handleTimeChange",value:function(e){var t=e.target,n=new CustomEvent("timeupdate",{detail:{currentTime:t.currentTime}});this.dispatchEvent(n)}},{key:"playbackStarted",value:function(){var e=new Event("playbackStarted");this.dispatchEvent(e)}},{key:"playbackPaused",value:function(){var e=new Event("playbackPaused");this.dispatchEvent(e)}},{key:"canplay",value:function(){var e=new Event("canplay");this.dispatchEvent(e)}},{key:"duration",get:function(){return this.audioElement?this.audioElement.duration:0}},{key:"currentTime",get:function(){return this.audioElement?this.audioElement.currentTime:0}},{key:"audioElement",get:function(){return this.shadowRoot&&this.shadowRoot.querySelector("audio")}}]),t}(r.a);gn([Object(r.e)({type:Boolean})],kn.prototype,"showControls",void 0),gn([Object(r.e)({type:Number})],kn.prototype,"playbackRate",void 0),gn([Object(r.e)({type:Number})],kn.prototype,"volume",void 0),gn([Object(r.e)({type:Array})],kn.prototype,"sources",void 0),kn=gn([Object(r.c)("audio-element")],kn);var wn=function e(t,n){Object(u.a)(this,e),this.url=t,this.mimetype=n};function On(e){return(On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jn(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function Sn(){var e=function(e,t){t||(t=e.slice(0));return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n <radio-player\n .config=","\n .transcriptConfig=","\n @searchTermChanged=","\n @playbackPaused=","\n @currentTimeChanged=","\n @timeChangedFromScrub=","\n @transcriptEntrySelected=","\n @canplay=","\n >\n </radio-player>\n "]);return Sn=function(){return e},e}function xn(e){return(xn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Tn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function En(e,t,n){return t&&_n(e.prototype,t),n&&_n(e,n),e}function Cn(e,t){return(Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}n.d(t,"default",(function(){return Rn}));var Rn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t){return!t||"object"!==On(t)&&"function"!=typeof t?Tn(e):t}(this,xn(t).call(this))).itemId="",e.currentTime=0,e.searchTerm="",e.baseUrl="https://archive.org",e.currentTimeQueryParamDebouncer=new c(e.updateCurrentTimeParam,1e3,Tn(e)),e.searchTermQueryParamDebouncer=new c(e.updateSearchQueryParam,1e3,Tn(e)),e.loadMetadataCacheIfAvailable(),e}var n,a;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Cn(e,t)}(t,e),En(t,null,[{key:"properties",get:function(){return{itemId:{type:String},radioPlayerConfig:{type:Object},transcriptConfig:{type:Object},baseUrl:{type:String}}}}]),En(t,[{key:"loadMetadataCacheIfAvailable",value:function(){var e,t=document.querySelector(".js-ia-metadata");t&&(e=JSON.parse(t.value)),this.metadataCache=e}},{key:"render",value:function(){return Object(r.d)(Sn(),this.radioPlayerConfig,this.transcriptConfig,this.searchTermChanged,this.playbackPaused,this.currentTimeChanged,this.timeChangedFromScrub,this.transcriptEntrySelected,this.canplay)}},{key:"updated",value:function(e){e.has("itemId")&&this.loadItemMetadata()}},{key:"firstUpdated",value:function(){var e=new o.a(window.location.search),t=e.get("q"),n=e.get("start");t&&this.radioPlayer&&(this.searchTerm=t,this.radioPlayer.searchTerm=t),n&&(this.currentTime=n,this.startPlaybackAt=parseFloat(n))}},{key:"searchTermChanged",value:function(e){var t=e.detail.searchTerm;this.searchTerm=t,this.searchTermQueryParamDebouncer.execute()}},{key:"canplay",value:function(){this.startPlaybackAt&&this.radioPlayer&&(this.radioPlayer.seekTo(this.startPlaybackAt),this.startPlaybackAt=void 0)}},{key:"currentTimeChanged",value:function(e){this.currentTime=e.detail.currentTime}},{key:"playbackPaused",value:function(){this.currentTimeQueryParamDebouncer.execute()}},{key:"timeChangedFromScrub",value:function(e){this.currentTime=e.detail.newTime,this.currentTimeQueryParamDebouncer.execute()}},{key:"transcriptEntrySelected",value:function(e){this.currentTime=e.detail.newTime,this.currentTimeQueryParamDebouncer.execute()}},{key:"loadItemMetadata",value:(n=regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="",!this.metadataCache){e.next=5;break}t=this.metadataCache,e.next=12;break;case 5:return n="".concat(this.baseUrl,"/metadata/").concat(this.itemId),e.next=8,Object(i.a)(n);case 8:return r=e.sent,e.next=11,r.json();case 11:t=e.sent;case 12:this.handleMetadataResponse(t);case 13:case"end":return e.stop()}}),e,this)})),a=function(){var e=this,t=arguments;return new Promise((function(r,i){var o=n.apply(e,t);function a(e){jn(o,r,i,a,s,"next",e)}function s(e){jn(o,r,i,a,s,"throw",e)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"handleMetadataResponse",value:function(e){var t,n=this,r=e,i=r.files,o=r.metadata.collection[0],a=[i.find((function(e){return"advanced audio coding"===e.format.toLowerCase()})),i.find((function(e){return"ogg vorbis"===e.format.toLowerCase()})),i.find((function(e){return"vbr mp3"===e.format.toLowerCase()}))].filter((function(e){return void 0!==e})),s=a.map((function(e){var t="".concat(n.baseUrl,"/download/").concat(n.itemId,"/").concat(e.name),r="";switch(e.format.toLowerCase()){case"ogg vorbis":r="audio/ogg";break;case"advanced audio coding":r="audio/aac";break;case"vbr mp3":r="audio/mpeg"}return new wn(t,r)})),c=r.files.find((function(e){if("png"!==e.format.toLowerCase())return!1;var t=e.original;return a.find((function(e){return e.name===t}))}));c&&(t="".concat(this.baseUrl,"/download/").concat(this.itemId,"/").concat(c.name)),this.radioPlayerConfig=new bn(r.metadata.contributor,r.metadata.start_localtime||r.metadata.start_time,"".concat(this.baseUrl,"/services/img/").concat(o),t,s),this.setupBaseTranscript(r)}},{key:"setupBaseTranscript",value:function(e){var t=e.speech_vs_music_asr;if(t){var n=t.map((function(e){return new Lt(e.id,e.start,e.end,e.text,e.is_music,e.search_match_index)}));this.transcriptConfig=new dt(n)}}},{key:"updateSearchQueryParam",value:function(){var e=new o.a(window.location.search);""===this.searchTerm?e.delete("q"):e.set("q","".concat(this.searchTerm)),window.history.replaceState({},"","?".concat(e.toString()))}},{key:"updateCurrentTimeParam",value:function(){var e=new o.a(window.location.search),t=Math.floor(this.currentTime);e.set("start","".concat(t)),window.history.replaceState({},"","?".concat(e.toString()))}},{key:"radioPlayer",get:function(){return this.shadowRoot?this.shadowRoot.querySelector("radio-player"):null}}]),t}(r.a);customElements.define("radio-player-controller",Rn)}});
//# sourceMappingURL=radio-player-controller.min.js.map
// @license-end