brainsatplay-components
Advanced tools
Comparing version 0.0.0 to 0.0.1
@@ -1,2 +0,2 @@ | ||
var play=function(t){"use strict"; | ||
var components=function(t){"use strict"; | ||
/** | ||
@@ -17,3 +17,3 @@ * @license | ||
*/ | ||
var $;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(l=globalThis.reactiveElementVersions)&&void 0!==l?l:globalThis.reactiveElementVersions=[]).push("1.2.1");const _=globalThis.trustedTypes,g=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,f="?"+m,y=`<${f}>`,b=document,A=(t="")=>b.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S=/-->/g,C=/>/g,U=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,P=/'/g,k=/"/g,T=/^(?:script|style|textarea)$/i,N=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),O=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),M=new WeakMap,R=b.createTreeWalker(b,129,null,!1),j=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=w;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,d=0;for(;d<i.length&&(o.lastIndex=d,a=o.exec(i),null!==a);)d=o.lastIndex,o===w?"!--"===a[1]?o=S:void 0!==a[1]?o=C:void 0!==a[2]?(T.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=U):void 0!==a[3]&&(o=U):o===U?">"===a[0]?(o=null!=n?n:w,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?U:'"'===a[3]?k:P):o===k||o===P?o=U:o===S||o===C?o=w:(o=U,n=void 0);const c=o===U&&t[e+1].startsWith("/>")?" ":"";r+=o===w?i+y:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+m+c):i+m+(-2===h?(s.push(void 0),e):c)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==g?g.createHTML(l):l,s]};class z{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=j(t,e);if(this.el=z.createElement(a,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=R.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(m)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(m),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?V:"?"===e[1]?G:"@"===e[1]?J:D})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(T.test(s.tagName)){const t=s.textContent.split(m),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],A()),R.nextNode(),l.push({type:2,index:++n});s.append(t[e],A())}}}else if(8===s.nodeType)if(s.data===f)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(m,t+1));)l.push({type:7,index:n}),t+=m.length-1}n++}}static createElement(t,e){const i=b.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,s){var n,r,o,l;if(e===O)return e;let a=void 0!==s?null===(n=i._$Cl)||void 0===n?void 0:n[s]:i._$Cu;const h=E(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Cl)&&void 0!==o?o:l._$Cl=[])[s]=a:i._$Cu=a),void 0!==a&&(e=B(t,a._$AS(t,e.values),a,s)),e}class L{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:b).importNode(i,!0);R.currentNode=n;let r=R.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new I(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new q(r,this,t)),this.v.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=R.nextNode(),o++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class I{constructor(t,e,i,s){var n;this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),E(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==O&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==H&&E(this._$AH)?this._$AA.nextSibling.data=t:this.S(b.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=z.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new L(n,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=M.get(t.strings);return void 0===e&&M.set(t.strings,e=new z(t)),e}A(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new I(this.M(A()),this.M(A()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class D{constructor(t,e,i,s,n){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=H}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=B(this,t,e,0),r=!E(t)||t!==this._$AH&&t!==O,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=B(this,s[i+o],e,o),l===O&&(l=this._$AH[o]),r||(r=!E(l)||l!==this._$AH[o]),l===H?t=H:t!==H&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.k(t)}k(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends D{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===H?void 0:t}}const W=_?_.emptyScript:"";class G extends D{constructor(){super(...arguments),this.type=4}k(t){t&&t!==H?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class J extends D{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:H)===O)return;const s=this._$AH,n=t===H&&s!==H||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==H&&(s===H||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const K=window.litHtmlPolyfillSupport; | ||
var $;v.finalized=!0,v.elementProperties=new Map,v.elementStyles=[],v.shadowRootOptions={mode:"open"},null==d||d({ReactiveElement:v}),(null!==(l=globalThis.reactiveElementVersions)&&void 0!==l?l:globalThis.reactiveElementVersions=[]).push("1.2.1");const _=globalThis.trustedTypes,m=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,f="?"+g,y=`<${f}>`,b=document,A=(t="")=>b.createComment(t),E=t=>null===t||"object"!=typeof t&&"function"!=typeof t,x=Array.isArray,w=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,S=/-->/g,C=/>/g,U=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,P=/'/g,k=/"/g,T=/^(?:script|style|textarea)$/i,N=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),O=Symbol.for("lit-noChange"),H=Symbol.for("lit-nothing"),M=new WeakMap,R=b.createTreeWalker(b,129,null,!1),j=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=w;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,d=0;for(;d<i.length&&(o.lastIndex=d,a=o.exec(i),null!==a);)d=o.lastIndex,o===w?"!--"===a[1]?o=S:void 0!==a[1]?o=C:void 0!==a[2]?(T.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=U):void 0!==a[3]&&(o=U):o===U?">"===a[0]?(o=null!=n?n:w,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?U:'"'===a[3]?k:P):o===k||o===P?o=U:o===S||o===C?o=w:(o=U,n=void 0);const c=o===U&&t[e+1].startsWith("/>")?" ":"";r+=o===w?i+y:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+g+c):i+g+(-2===h?(s.push(void 0),e):c)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==m?m.createHTML(l):l,s]};class z{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=j(t,e);if(this.el=z.createElement(a,i),R.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=R.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(g)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(g),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?V:"?"===e[1]?G:"@"===e[1]?J:D})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(T.test(s.tagName)){const t=s.textContent.split(g),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],A()),R.nextNode(),l.push({type:2,index:++n});s.append(t[e],A())}}}else if(8===s.nodeType)if(s.data===f)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(g,t+1));)l.push({type:7,index:n}),t+=g.length-1}n++}}static createElement(t,e){const i=b.createElement("template");return i.innerHTML=t,i}}function B(t,e,i=t,s){var n,r,o,l;if(e===O)return e;let a=void 0!==s?null===(n=i._$Cl)||void 0===n?void 0:n[s]:i._$Cu;const h=E(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Cl)&&void 0!==o?o:l._$Cl=[])[s]=a:i._$Cu=a),void 0!==a&&(e=B(t,a._$AS(t,e.values),a,s)),e}class L{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:b).importNode(i,!0);R.currentNode=n;let r=R.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new I(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new q(r,this,t)),this.v.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=R.nextNode(),o++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class I{constructor(t,e,i,s){var n;this.type=2,this._$AH=H,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=B(this,t,e),E(t)?t===H||null==t||""===t?(this._$AH!==H&&this._$AR(),this._$AH=H):t!==this._$AH&&t!==O&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return x(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==H&&E(this._$AH)?this._$AA.nextSibling.data=t:this.S(b.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=z.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new L(n,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=M.get(t.strings);return void 0===e&&M.set(t.strings,e=new z(t)),e}A(t){x(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new I(this.M(A()),this.M(A()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class D{constructor(t,e,i,s,n){this.type=1,this._$AH=H,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=H}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=B(this,t,e,0),r=!E(t)||t!==this._$AH&&t!==O,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=B(this,s[i+o],e,o),l===O&&(l=this._$AH[o]),r||(r=!E(l)||l!==this._$AH[o]),l===H?t=H:t!==H&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.k(t)}k(t){t===H?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class V extends D{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===H?void 0:t}}const W=_?_.emptyScript:"";class G extends D{constructor(){super(...arguments),this.type=4}k(t){t&&t!==H?this.element.setAttribute(this.name,W):this.element.removeAttribute(this.name)}}class J extends D{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=B(this,t,e,0))&&void 0!==i?i:H)===O)return;const s=this._$AH,n=t===H&&s!==H||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==H&&(s===H||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class q{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const K=window.litHtmlPolyfillSupport; | ||
/** | ||
@@ -24,2 +24,2 @@ * @license | ||
*/ | ||
var Z,F;null==K||K(z,I),(null!==($=globalThis.litHtmlVersions)&&void 0!==$?$:globalThis.litHtmlVersions=[]).push("2.1.2");class Q extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new I(e.insertBefore(A(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return O}}Q.finalized=!0,Q._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(F=globalThis.litElementVersions)&&void 0!==F?F:globalThis.litElementVersions=[]).push("3.1.2");class Y extends Q{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return r`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return N`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>N`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-audio-volume",Y);var tt=Object.freeze({__proto__:null,Volume:Y});class et extends Q{constructor(t={}){super(),this.source=t.source,this.autoplay=t.autoplay,this.controls=t.controls}static get styles(){return r`video{width:100%}`}static get properties(){return{source:{converter:{toAttribute:t=>t,fromAttribute:t=>t}},autoplay:{type:Boolean},controls:{type:Boolean}}}willUpdate(t){}render(){let t=document.createElement("video");if("object"==typeof this.source)t.srcObject=this.source;else if(this.source){const e=document.createElement("source");e.src=this.source,t.insertAdjacentElement("beforeend",e)}return this.autoplay&&(t.autoplay=this.autoplay),this.controls&&(t.controls=this.controls),t}}customElements.define("brainsatplay-video-player",et);var it=Object.freeze({__proto__:null,Player:et});class st extends Q{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return r`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return N`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>N`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-data-timeseries",st);var nt=Object.freeze({__proto__:null,TimeSeries:st}),rt=Object.freeze({__proto__:null,audio:tt,video:it,data:nt});class ot extends Q{constructor(t={}){var e,i;super(),this.verb=null!==(e=t.verb)&&void 0!==e?e:"contribute",this.color=null!==(i=t.color)&&void 0!==i?i:"blue"}static get styles(){return r`img{width:100%}`}static get properties(){return{verb:{type:String},color:{type:String,reflect:!0}}}willUpdate(t){}render(){return N`<a href="https://opencollective.com/brainsatplay/donate" target="_blank"><img src="https://opencollective.com/brainsatplay/${this.verb}/button@2x.png?color=${this.color}"></a>`}}customElements.define("brainsatplay-contribute",ot);var lt=Object.freeze({__proto__:null,Contribute:ot});class at extends Q{constructor(t={brand:{content:"My Brand"},primary:{menu:[],options:[]},secondary:[]}){var e,i,s,n;super(),this.getElement=t=>"button"===t.type?N`<a href="${t.link}" target="${t.external?"_blank":"_self"}"><button>${t.content}</button></a>`:N`<a href="${t.link}" target="${t.external?"_blank":"_self"}" class="decorate">${t.content}</a>`,this.primary=null!==(e=t.primary)&&void 0!==e?e:{menu:[],options:[]},this.secondary=null!==(i=t.secondary)&&void 0!==i?i:[],this.color=null!==(s=t.color)&&void 0!==s?s:"blue",this.brand=null!==(n=t.brand)&&void 0!==n?n:"My Brand"}static get styles(){return r`:host{width:100%;height:100%;position:absolute;top:0;left:0;font-family:sans-serif}:host *{box-sizing:border-box}nav{color:#fff;width:100%;padding:0 25px;display:flex;align-items:center;background:#060606}#primary{position:sticky;top:0;left:0;height:70px;max-height:100px;justify-content:space-between;font-size:80%}#primary>div{height:100%;width:100%;display:flex;align-items:center;justify-content:space-between;flex-direction:row-reverse}#menu,#options{height:100%;display:flex;align-items:center;justify-content:center}#secondary{height:50px;justify-content:flex-end;border-bottom:1px solid #3d3d3d;font-size:75%}a{color:#fff;text-decoration:none}.brand{padding-right:15px}a:not(.brand){height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.decorate{padding:10px 15px}#primary .decorate:hover{box-shadow:0 4px 0 #0fb3ff inset}#secondary .decorate:hover{box-shadow:0 3px 0 #c4c4c4 inset}button{border:1px solid #fff;color:#fff;border-radius:3px;background:0 0;padding:5px 10px;margin-left:10px;font-size:95%}nav button:last-child{margin-right:0}button:hover{outline:1.1px solid #fff;cursor:pointer}@media only screen and (max-width:800px){#primary #menu{display:none}}`}static get properties(){return{primary:{type:Object,reflect:!0},secondary:{type:Array,reflect:!0},brand:{type:Object},color:{type:String,reflect:!0}}}willUpdate(t){}render(){var t,e,i;return N`${this.secondary.length>0?N`<nav id="secondary">${null===(t=this.secondary)||void 0===t?void 0:t.map((t=>this.getElement(t)))}</nav>`:""}<nav id="primary">${N`<a class="brand" target="${this.brand.external?"_blank":"_self"}" href="${this.brand.link}">${/(jpg|gif|png|JPG|GIF|PNG|JPEG|jpeg)$/.test(this.brand.content)?N`<img src="${this.brand.content}">`:N`<h1>${this.brand.content.toUpperCase()}</h1>`}</a>`}<div><div id="options">${null===(e=this.primary.options)||void 0===e?void 0:e.map((t=>this.getElement(t)))}</div><div id="menu">${null===(i=this.primary.menu)||void 0===i?void 0:i.map((t=>this.getElement(t)))}</div></div></nav>`}}return customElements.define("brainsatplay-nav",at),t.Nav=at,t.brand=lt,t.streams=rt,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); | ||
var Z,F;null==K||K(z,I),(null!==($=globalThis.litHtmlVersions)&&void 0!==$?$:globalThis.litHtmlVersions=[]).push("2.1.2");class Q extends v{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new I(e.insertBefore(A(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return O}}Q.finalized=!0,Q._$litElement$=!0,null===(Z=globalThis.litElementHydrateSupport)||void 0===Z||Z.call(globalThis,{LitElement:Q});const X=globalThis.litElementPolyfillSupport;null==X||X({LitElement:Q}),(null!==(F=globalThis.litElementVersions)&&void 0!==F?F:globalThis.litElementVersions=[]).push("3.1.2");class Y extends Q{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return r`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return N`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>N`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-audio-volume",Y);var tt=Object.freeze({__proto__:null,Volume:Y});class et extends Q{constructor(t={}){super(),this.source=t.source,this.autoplay=t.autoplay,this.controls=t.controls}static get styles(){return r`video{width:100%}`}static get properties(){return{source:{converter:{toAttribute:t=>t,fromAttribute:t=>t}},autoplay:{type:Boolean},controls:{type:Boolean}}}willUpdate(t){}render(){let t=document.createElement("video");if("object"==typeof this.source)t.srcObject=this.source;else if(this.source){const e=document.createElement("source");e.src=this.source,t.insertAdjacentElement("beforeend",e)}return this.autoplay&&(t.autoplay=this.autoplay),this.controls&&(t.controls=this.controls),t}}customElements.define("brainsatplay-video-player",et);var it=Object.freeze({__proto__:null,Player:et});class st extends Q{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return r`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return N`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>N`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-data-timeseries",st);var nt=Object.freeze({__proto__:null,TimeSeries:st}),rt=Object.freeze({__proto__:null,audio:tt,video:it,data:nt});class ot extends Q{constructor(t={}){var e,i;super(),this.verb=null!==(e=t.verb)&&void 0!==e?e:"contribute",this.color=null!==(i=t.color)&&void 0!==i?i:"blue"}static get styles(){return r`img{width:100%}`}static get properties(){return{verb:{type:String},color:{type:String,reflect:!0}}}willUpdate(t){}render(){return N`<a href="https://opencollective.com/brainsatplay/donate" target="_blank"><img src="https://opencollective.com/brainsatplay/${this.verb}/button@2x.png?color=${this.color}"></a>`}}customElements.define("brainsatplay-contribute",ot);var lt=Object.freeze({__proto__:null,Contribute:ot});class at extends Q{constructor(t={brand:{content:"My Brand"},primary:{menu:[],options:[]},secondary:[]}){var e,i,s,n;super(),this.getElement=t=>"button"===t.type?N`<a href="${t.link}" target="${t.external?"_blank":"_self"}"><button>${t.content}</button></a>`:N`<a href="${t.link}" target="${t.external?"_blank":"_self"}" class="decorate">${t.content}</a>`,this.primary=null!==(e=t.primary)&&void 0!==e?e:{menu:[],options:[]},this.secondary=null!==(i=t.secondary)&&void 0!==i?i:[],this.color=null!==(s=t.color)&&void 0!==s?s:"blue",this.brand=null!==(n=t.brand)&&void 0!==n?n:"My Brand"}static get styles(){return r`:host{font-family:sans-serif}header{width:100%;position:absolute;top:0;left:0}:host *{box-sizing:border-box}nav{color:#fff;width:100%;padding:0 25px;display:flex;align-items:center;background:#060606}#primary{position:sticky;top:0;left:0;height:70px;max-height:100px;justify-content:space-between;font-size:80%}#primary>div{height:100%;width:100%;display:flex;align-items:center;justify-content:space-between;flex-direction:row-reverse}#menu,#options{height:100%;display:flex;align-items:center;justify-content:center}#secondary{height:50px;justify-content:flex-end;border-bottom:1px solid #3d3d3d;font-size:75%}a{color:#fff;text-decoration:none}.brand{padding-right:15px}a:not(.brand){height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.decorate{padding:10px 15px}#primary .decorate:hover{box-shadow:0 4px 0 #0fb3ff inset}#secondary .decorate:hover{box-shadow:0 3px 0 #c4c4c4 inset}button{border:1px solid #fff;color:#fff;border-radius:3px;background:0 0;padding:5px 10px;margin-left:10px;font-size:95%}nav button:last-child{margin-right:0}button:hover{outline:1.1px solid #fff;cursor:pointer}@media only screen and (max-width:800px){#primary #menu{display:none}}`}static get properties(){return{primary:{type:Object,reflect:!0},secondary:{type:Array,reflect:!0},brand:{type:Object},color:{type:String,reflect:!0}}}willUpdate(t){}render(){var t,e,i;return N`<header>${this.secondary.length>0?N`<nav id="secondary">${null===(t=this.secondary)||void 0===t?void 0:t.map((t=>this.getElement(t)))}</nav>`:""}<nav id="primary">${N`<a class="brand" target="${this.brand.external?"_blank":"_self"}" href="${this.brand.link}">${/(jpg|gif|png|JPG|GIF|PNG|JPEG|jpeg)$/.test(this.brand.content)?N`<img src="${this.brand.content}">`:N`<h1>${this.brand.content.toUpperCase()}</h1>`}</a>`}<div><div id="options">${null===(e=this.primary.options)||void 0===e?void 0:e.map((t=>this.getElement(t)))}</div><div id="menu">${null===(i=this.primary.menu)||void 0===i?void 0:i.map((t=>this.getElement(t)))}</div></div></nav></header>`}}return customElements.define("brainsatplay-nav",at),t.Nav=at,t.brand=lt,t.streams=rt,Object.defineProperty(t,"__esModule",{value:!0}),t}({}); |
@@ -26,10 +26,11 @@ // Note: Inspired by the Red Hat website https://www.redhat.com/en | ||
:host { | ||
font-family: sans-serif; | ||
} | ||
:host{ | ||
header { | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
font-family: sans-serif; | ||
} | ||
@@ -167,2 +168,3 @@ | ||
return html ` | ||
<header> | ||
${(this.secondary.length > 0) ? html `<nav id="secondary">${(_a = this.secondary) === null || _a === void 0 ? void 0 : _a.map(o => this.getElement(o))}</nav>` : ``} | ||
@@ -181,2 +183,3 @@ <nav id="primary"> | ||
</nav> | ||
</header> | ||
`; | ||
@@ -183,0 +186,0 @@ } |
@@ -17,3 +17,3 @@ /** | ||
*/ | ||
var v;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.2.1");const $=globalThis.trustedTypes,_=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,g=`lit$${(Math.random()+"").slice(9)}$`,m="?"+g,f=`<${m}>`,y=document,b=(t="")=>y.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,S=/>/g,C=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,U=/'/g,P=/"/g,k=/^(?:script|style|textarea)$/i,T=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),H=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),O=new WeakMap,M=y.createTreeWalker(y,129,null,!1),R=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=x;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,d=0;for(;d<i.length&&(o.lastIndex=d,a=o.exec(i),null!==a);)d=o.lastIndex,o===x?"!--"===a[1]?o=w:void 0!==a[1]?o=S:void 0!==a[2]?(k.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=C):void 0!==a[3]&&(o=C):o===C?">"===a[0]?(o=null!=n?n:x,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?C:'"'===a[3]?P:U):o===P||o===U?o=C:o===w||o===S?o=x:(o=C,n=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";r+=o===x?i+f:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+g+c):i+g+(-2===h?(s.push(void 0),e):c)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(l):l,s]};class j{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=R(t,e);if(this.el=j.createElement(a,i),M.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=M.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(g)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(g),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?D:"?"===e[1]?W:"@"===e[1]?G:I})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(k.test(s.tagName)){const t=s.textContent.split(g),e=t.length-1;if(e>0){s.textContent=$?$.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],b()),M.nextNode(),l.push({type:2,index:++n});s.append(t[e],b())}}}else if(8===s.nodeType)if(s.data===m)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(g,t+1));)l.push({type:7,index:n}),t+=g.length-1}n++}}static createElement(t,e){const i=y.createElement("template");return i.innerHTML=t,i}}function z(t,e,i=t,s){var n,r,o,l;if(e===H)return e;let a=void 0!==s?null===(n=i._$Cl)||void 0===n?void 0:n[s]:i._$Cu;const h=A(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Cl)&&void 0!==o?o:l._$Cl=[])[s]=a:i._$Cu=a),void 0!==a&&(e=z(t,a._$AS(t,e.values),a,s)),e}class B{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:y).importNode(i,!0);M.currentNode=n;let r=M.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new L(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new J(r,this,t)),this.v.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=M.nextNode(),o++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class L{constructor(t,e,i,s){var n;this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),A(t)?t===N||null==t||""===t?(this._$AH!==N&&this._$AR(),this._$AH=N):t!==this._$AH&&t!==H&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return E(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==N&&A(this._$AH)?this._$AA.nextSibling.data=t:this.S(y.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new B(n,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}A(t){E(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new L(this.M(b()),this.M(b()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class I{constructor(t,e,i,s,n){this.type=1,this._$AH=N,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=z(this,t,e,0),r=!A(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=z(this,s[i+o],e,o),l===H&&(l=this._$AH[o]),r||(r=!A(l)||l!==this._$AH[o]),l===N?t=N:t!==N&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.k(t)}k(t){t===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class D extends I{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===N?void 0:t}}const V=$?$.emptyScript:"";class W extends I{constructor(){super(...arguments),this.type=4}k(t){t&&t!==N?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class G extends I{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=z(this,t,e,0))&&void 0!==i?i:N)===H)return;const s=this._$AH,n=t===N&&s!==N||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==N&&(s===N||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}}const q=window.litHtmlPolyfillSupport; | ||
var v;p.finalized=!0,p.elementProperties=new Map,p.elementStyles=[],p.shadowRootOptions={mode:"open"},null==h||h({ReactiveElement:p}),(null!==(o=globalThis.reactiveElementVersions)&&void 0!==o?o:globalThis.reactiveElementVersions=[]).push("1.2.1");const $=globalThis.trustedTypes,_=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,m=`lit$${(Math.random()+"").slice(9)}$`,g="?"+m,f=`<${g}>`,y=document,b=(t="")=>y.createComment(t),A=t=>null===t||"object"!=typeof t&&"function"!=typeof t,E=Array.isArray,x=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,w=/-->/g,S=/>/g,C=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,U=/'/g,P=/"/g,k=/^(?:script|style|textarea)$/i,T=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),H=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),O=new WeakMap,M=y.createTreeWalker(y,129,null,!1),R=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=x;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,d=0;for(;d<i.length&&(o.lastIndex=d,a=o.exec(i),null!==a);)d=o.lastIndex,o===x?"!--"===a[1]?o=w:void 0!==a[1]?o=S:void 0!==a[2]?(k.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=C):void 0!==a[3]&&(o=C):o===C?">"===a[0]?(o=null!=n?n:x,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?C:'"'===a[3]?P:U):o===P||o===U?o=C:o===w||o===S?o=x:(o=C,n=void 0);const c=o===C&&t[e+1].startsWith("/>")?" ":"";r+=o===x?i+f:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+m+c):i+m+(-2===h?(s.push(void 0),e):c)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(l):l,s]};class j{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=R(t,e);if(this.el=j.createElement(a,i),M.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=M.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(m)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(m),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?D:"?"===e[1]?W:"@"===e[1]?G:I})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(k.test(s.tagName)){const t=s.textContent.split(m),e=t.length-1;if(e>0){s.textContent=$?$.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],b()),M.nextNode(),l.push({type:2,index:++n});s.append(t[e],b())}}}else if(8===s.nodeType)if(s.data===g)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(m,t+1));)l.push({type:7,index:n}),t+=m.length-1}n++}}static createElement(t,e){const i=y.createElement("template");return i.innerHTML=t,i}}function z(t,e,i=t,s){var n,r,o,l;if(e===H)return e;let a=void 0!==s?null===(n=i._$Cl)||void 0===n?void 0:n[s]:i._$Cu;const h=A(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Cl)&&void 0!==o?o:l._$Cl=[])[s]=a:i._$Cu=a),void 0!==a&&(e=z(t,a._$AS(t,e.values),a,s)),e}class B{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:y).importNode(i,!0);M.currentNode=n;let r=M.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new L(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new J(r,this,t)),this.v.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=M.nextNode(),o++)}return n}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class L{constructor(t,e,i,s){var n;this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=z(this,t,e),A(t)?t===N||null==t||""===t?(this._$AH!==N&&this._$AR(),this._$AH=N):t!==this._$AH&&t!==H&&this.$(t):void 0!==t._$litType$?this.T(t):void 0!==t.nodeType?this.S(t):(t=>{var e;return E(t)||"function"==typeof(null===(e=t)||void 0===e?void 0:e[Symbol.iterator])})(t)?this.A(t):this.$(t)}M(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}S(t){this._$AH!==t&&(this._$AR(),this._$AH=this.M(t))}$(t){this._$AH!==N&&A(this._$AH)?this._$AA.nextSibling.data=t:this.S(y.createTextNode(t)),this._$AH=t}T(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=j.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.m(i);else{const t=new B(n,this),e=t.p(this.options);t.m(i),this.S(e),this._$AH=t}}_$AC(t){let e=O.get(t.strings);return void 0===e&&O.set(t.strings,e=new j(t)),e}A(t){E(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new L(this.M(b()),this.M(b()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cg=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class I{constructor(t,e,i,s,n){this.type=1,this._$AH=N,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=N}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=z(this,t,e,0),r=!A(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=z(this,s[i+o],e,o),l===H&&(l=this._$AH[o]),r||(r=!A(l)||l!==this._$AH[o]),l===N?t=N:t!==N&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.k(t)}k(t){t===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class D extends I{constructor(){super(...arguments),this.type=3}k(t){this.element[this.name]=t===N?void 0:t}}const V=$?$.emptyScript:"";class W extends I{constructor(){super(...arguments),this.type=4}k(t){t&&t!==N?this.element.setAttribute(this.name,V):this.element.removeAttribute(this.name)}}class G extends I{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=z(this,t,e,0))&&void 0!==i?i:N)===H)return;const s=this._$AH,n=t===N&&s!==N||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==N&&(s===N||n);n&&this.element.removeEventListener(this.name,this,s),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){z(this,t)}}const q=window.litHtmlPolyfillSupport; | ||
/** | ||
@@ -24,2 +24,2 @@ * @license | ||
*/ | ||
var K,Z;null==q||q(j,L),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.1.2");class F extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new L(e.insertBefore(b(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return H}}F.finalized=!0,F._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:F});const Q=globalThis.litElementPolyfillSupport;null==Q||Q({LitElement:F}),(null!==(Z=globalThis.litElementVersions)&&void 0!==Z?Z:globalThis.litElementVersions=[]).push("3.1.2");class X extends F{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return n`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return T`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>T`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-audio-volume",X);var Y=Object.freeze({__proto__:null,Volume:X});class tt extends F{constructor(t={}){super(),this.source=t.source,this.autoplay=t.autoplay,this.controls=t.controls}static get styles(){return n`video{width:100%}`}static get properties(){return{source:{converter:{toAttribute:t=>t,fromAttribute:t=>t}},autoplay:{type:Boolean},controls:{type:Boolean}}}willUpdate(t){}render(){let t=document.createElement("video");if("object"==typeof this.source)t.srcObject=this.source;else if(this.source){const e=document.createElement("source");e.src=this.source,t.insertAdjacentElement("beforeend",e)}return this.autoplay&&(t.autoplay=this.autoplay),this.controls&&(t.controls=this.controls),t}}customElements.define("brainsatplay-video-player",tt);var et=Object.freeze({__proto__:null,Player:tt});class it extends F{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return n`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return T`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>T`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-data-timeseries",it);var st=Object.freeze({__proto__:null,TimeSeries:it}),nt=Object.freeze({__proto__:null,audio:Y,video:et,data:st});class rt extends F{constructor(t={}){var e,i;super(),this.verb=null!==(e=t.verb)&&void 0!==e?e:"contribute",this.color=null!==(i=t.color)&&void 0!==i?i:"blue"}static get styles(){return n`img{width:100%}`}static get properties(){return{verb:{type:String},color:{type:String,reflect:!0}}}willUpdate(t){}render(){return T`<a href="https://opencollective.com/brainsatplay/donate" target="_blank"><img src="https://opencollective.com/brainsatplay/${this.verb}/button@2x.png?color=${this.color}"></a>`}}customElements.define("brainsatplay-contribute",rt);var ot=Object.freeze({__proto__:null,Contribute:rt});class lt extends F{constructor(t={brand:{content:"My Brand"},primary:{menu:[],options:[]},secondary:[]}){var e,i,s,n;super(),this.getElement=t=>"button"===t.type?T`<a href="${t.link}" target="${t.external?"_blank":"_self"}"><button>${t.content}</button></a>`:T`<a href="${t.link}" target="${t.external?"_blank":"_self"}" class="decorate">${t.content}</a>`,this.primary=null!==(e=t.primary)&&void 0!==e?e:{menu:[],options:[]},this.secondary=null!==(i=t.secondary)&&void 0!==i?i:[],this.color=null!==(s=t.color)&&void 0!==s?s:"blue",this.brand=null!==(n=t.brand)&&void 0!==n?n:"My Brand"}static get styles(){return n`:host{width:100%;height:100%;position:absolute;top:0;left:0;font-family:sans-serif}:host *{box-sizing:border-box}nav{color:#fff;width:100%;padding:0 25px;display:flex;align-items:center;background:#060606}#primary{position:sticky;top:0;left:0;height:70px;max-height:100px;justify-content:space-between;font-size:80%}#primary>div{height:100%;width:100%;display:flex;align-items:center;justify-content:space-between;flex-direction:row-reverse}#menu,#options{height:100%;display:flex;align-items:center;justify-content:center}#secondary{height:50px;justify-content:flex-end;border-bottom:1px solid #3d3d3d;font-size:75%}a{color:#fff;text-decoration:none}.brand{padding-right:15px}a:not(.brand){height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.decorate{padding:10px 15px}#primary .decorate:hover{box-shadow:0 4px 0 #0fb3ff inset}#secondary .decorate:hover{box-shadow:0 3px 0 #c4c4c4 inset}button{border:1px solid #fff;color:#fff;border-radius:3px;background:0 0;padding:5px 10px;margin-left:10px;font-size:95%}nav button:last-child{margin-right:0}button:hover{outline:1.1px solid #fff;cursor:pointer}@media only screen and (max-width:800px){#primary #menu{display:none}}`}static get properties(){return{primary:{type:Object,reflect:!0},secondary:{type:Array,reflect:!0},brand:{type:Object},color:{type:String,reflect:!0}}}willUpdate(t){}render(){var t,e,i;return T`${this.secondary.length>0?T`<nav id="secondary">${null===(t=this.secondary)||void 0===t?void 0:t.map((t=>this.getElement(t)))}</nav>`:""}<nav id="primary">${T`<a class="brand" target="${this.brand.external?"_blank":"_self"}" href="${this.brand.link}">${/(jpg|gif|png|JPG|GIF|PNG|JPEG|jpeg)$/.test(this.brand.content)?T`<img src="${this.brand.content}">`:T`<h1>${this.brand.content.toUpperCase()}</h1>`}</a>`}<div><div id="options">${null===(e=this.primary.options)||void 0===e?void 0:e.map((t=>this.getElement(t)))}</div><div id="menu">${null===(i=this.primary.menu)||void 0===i?void 0:i.map((t=>this.getElement(t)))}</div></div></nav>`}}customElements.define("brainsatplay-nav",lt);export{lt as Nav,ot as brand,nt as streams}; | ||
var K,Z;null==q||q(j,L),(null!==(v=globalThis.litHtmlVersions)&&void 0!==v?v:globalThis.litHtmlVersions=[]).push("2.1.2");class F extends p{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=((t,e,i)=>{var s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new L(e.insertBefore(b(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Dt)||void 0===t||t.setConnected(!1)}render(){return H}}F.finalized=!0,F._$litElement$=!0,null===(K=globalThis.litElementHydrateSupport)||void 0===K||K.call(globalThis,{LitElement:F});const Q=globalThis.litElementPolyfillSupport;null==Q||Q({LitElement:F}),(null!==(Z=globalThis.litElementVersions)&&void 0!==Z?Z:globalThis.litElementVersions=[]).push("3.1.2");class X extends F{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return n`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return T`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>T`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-audio-volume",X);var Y=Object.freeze({__proto__:null,Volume:X});class tt extends F{constructor(t={}){super(),this.source=t.source,this.autoplay=t.autoplay,this.controls=t.controls}static get styles(){return n`video{width:100%}`}static get properties(){return{source:{converter:{toAttribute:t=>t,fromAttribute:t=>t}},autoplay:{type:Boolean},controls:{type:Boolean}}}willUpdate(t){}render(){let t=document.createElement("video");if("object"==typeof this.source)t.srcObject=this.source;else if(this.source){const e=document.createElement("source");e.src=this.source,t.insertAdjacentElement("beforeend",e)}return this.autoplay&&(t.autoplay=this.autoplay),this.controls&&(t.controls=this.controls),t}}customElements.define("brainsatplay-video-player",tt);var et=Object.freeze({__proto__:null,Player:tt});class it extends F{constructor(t={}){var e,i,s;super(),this.volume=null!==(e=t.volume)&&void 0!==e?e:0,this.backgroundColor=null!==(i=t.backgroundColor)&&void 0!==i?i:"#69ce2b",this.count=null!==(s=t.count)&&void 0!==s?s:10}static get styles(){return n`#wrapper{width:100%}`}static get properties(){return{volume:{type:Number},count:{type:Number},backgroundColor:{type:String,reflect:!0}}}willUpdate(t){t.has("volume")&&(!this.volume||this.volume<0?this.volume=0:this.volume>1&&(this.volume=1))}render(){var t;const e=Math.round(this.count*(null!==(t=this.volume)&&void 0!==t?t:0));return T`<style>.target{width:calc(${100/this.count}% - 10px);height:10px;display:inline-block;margin:5px;background-color:#e6e7e8}.active{background-color:${this.backgroundColor}}</style><div id="wrapper">${Array.from({length:this.count},((t,i)=>T`<div class="${i<e?"target active":"target"}"></div>`))}</div>`}}customElements.define("brainsatplay-data-timeseries",it);var st=Object.freeze({__proto__:null,TimeSeries:it}),nt=Object.freeze({__proto__:null,audio:Y,video:et,data:st});class rt extends F{constructor(t={}){var e,i;super(),this.verb=null!==(e=t.verb)&&void 0!==e?e:"contribute",this.color=null!==(i=t.color)&&void 0!==i?i:"blue"}static get styles(){return n`img{width:100%}`}static get properties(){return{verb:{type:String},color:{type:String,reflect:!0}}}willUpdate(t){}render(){return T`<a href="https://opencollective.com/brainsatplay/donate" target="_blank"><img src="https://opencollective.com/brainsatplay/${this.verb}/button@2x.png?color=${this.color}"></a>`}}customElements.define("brainsatplay-contribute",rt);var ot=Object.freeze({__proto__:null,Contribute:rt});class lt extends F{constructor(t={brand:{content:"My Brand"},primary:{menu:[],options:[]},secondary:[]}){var e,i,s,n;super(),this.getElement=t=>"button"===t.type?T`<a href="${t.link}" target="${t.external?"_blank":"_self"}"><button>${t.content}</button></a>`:T`<a href="${t.link}" target="${t.external?"_blank":"_self"}" class="decorate">${t.content}</a>`,this.primary=null!==(e=t.primary)&&void 0!==e?e:{menu:[],options:[]},this.secondary=null!==(i=t.secondary)&&void 0!==i?i:[],this.color=null!==(s=t.color)&&void 0!==s?s:"blue",this.brand=null!==(n=t.brand)&&void 0!==n?n:"My Brand"}static get styles(){return n`:host{font-family:sans-serif}header{width:100%;position:absolute;top:0;left:0}:host *{box-sizing:border-box}nav{color:#fff;width:100%;padding:0 25px;display:flex;align-items:center;background:#060606}#primary{position:sticky;top:0;left:0;height:70px;max-height:100px;justify-content:space-between;font-size:80%}#primary>div{height:100%;width:100%;display:flex;align-items:center;justify-content:space-between;flex-direction:row-reverse}#menu,#options{height:100%;display:flex;align-items:center;justify-content:center}#secondary{height:50px;justify-content:flex-end;border-bottom:1px solid #3d3d3d;font-size:75%}a{color:#fff;text-decoration:none}.brand{padding-right:15px}a:not(.brand){height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.decorate{padding:10px 15px}#primary .decorate:hover{box-shadow:0 4px 0 #0fb3ff inset}#secondary .decorate:hover{box-shadow:0 3px 0 #c4c4c4 inset}button{border:1px solid #fff;color:#fff;border-radius:3px;background:0 0;padding:5px 10px;margin-left:10px;font-size:95%}nav button:last-child{margin-right:0}button:hover{outline:1.1px solid #fff;cursor:pointer}@media only screen and (max-width:800px){#primary #menu{display:none}}`}static get properties(){return{primary:{type:Object,reflect:!0},secondary:{type:Array,reflect:!0},brand:{type:Object},color:{type:String,reflect:!0}}}willUpdate(t){}render(){var t,e,i;return T`<header>${this.secondary.length>0?T`<nav id="secondary">${null===(t=this.secondary)||void 0===t?void 0:t.map((t=>this.getElement(t)))}</nav>`:""}<nav id="primary">${T`<a class="brand" target="${this.brand.external?"_blank":"_self"}" href="${this.brand.link}">${/(jpg|gif|png|JPG|GIF|PNG|JPEG|jpeg)$/.test(this.brand.content)?T`<img src="${this.brand.content}">`:T`<h1>${this.brand.content.toUpperCase()}</h1>`}</a>`}<div><div id="options">${null===(e=this.primary.options)||void 0===e?void 0:e.map((t=>this.getElement(t)))}</div><div id="menu">${null===(i=this.primary.menu)||void 0===i?void 0:i.map((t=>this.getElement(t)))}</div></div></nav></header>`}}customElements.define("brainsatplay-nav",lt);export{lt as Nav,ot as brand,nt as streams}; |
{ | ||
"name": "brainsatplay-components", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"author": "Garrett Flynn <garrettmflynn@gmail.com>", | ||
@@ -22,4 +22,4 @@ "license": "AGPL-3.0-or-later", | ||
"files": [ | ||
"/dist", | ||
"/src" | ||
"/dist", | ||
"/src" | ||
], | ||
@@ -26,0 +26,0 @@ "resolutions": { |
export * from './Nav' | ||
export * from './Page' |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
160256
2225