// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


/******************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise */

var extendStatics = function(d, b) {
    extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
    return extendStatics(d, b);
};

function __extends(d, b) {
    if (typeof b !== "function" && b !== null)
        throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
    extendStatics(d, b);
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}

var __assign = function() {
    __assign = Object.assign || function __assign(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};

function __decorate(decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
}

function __values(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const e$7=e=>n=>"function"==typeof n?((e,n)=>(customElements.define(e,n),n))(e,n):((e,n)=>{const{kind:t,elements:s}=n;return {kind:t,elements:s,finisher(n){customElements.define(e,n);}}})(e,n);

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const i$5=(i,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this));},finisher(n){n.createProperty(e.key,i);}};function e$6(e){return (n,t)=>void 0!==t?((i,e,n)=>{e.constructor.createProperty(n,i);})(e,n,t):i$5(e,n)}

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function t$3(t){return e$6({...t,state:!0})}

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const o$5=({finisher:e,descriptor:t})=>(o,n)=>{var r;if(void 0===n){const n=null!==(r=o.originalKey)&&void 0!==r?r:o.key,i=null!=t?{kind:"method",placement:"prototype",key:n,descriptor:t(o.key)}:{...o,key:n};return null!=e&&(i.finisher=function(t){e(t,n);}),i}{const r=o.constructor;void 0!==t&&Object.defineProperty(o,n,t(n)),null==e||e(r,n);}};

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function e$5(e){return o$5({finisher:(r,t)=>{Object.assign(r.prototype[t],e);}})}

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */function i$4(i,n){return o$5({descriptor:o=>{const t={get(){var o,n;return null!==(n=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==n?n:null},enumerable:!0,configurable:!0};if(n){const n="symbol"==typeof o?Symbol():"__"+o;t.get=function(){var o,t;return void 0===this[n]&&(this[n]=null!==(t=null===(o=this.renderRoot)||void 0===o?void 0:o.querySelector(i))&&void 0!==t?t:null),this[n]};}return t}})}

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
function e$4(e){return o$5({descriptor:r=>({async get(){var r;return await this.updateComplete,null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(e)},enumerable:!0,configurable:!0})})}

/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var n$4;null!=(null===(n$4=window.HTMLSlotElement)||void 0===n$4?void 0:n$4.prototype.assignedElements)?(o,n)=>o.assignedElements(n):(o,n)=>o.assignedNodes(n).filter((o=>o.nodeType===Node.ELEMENT_NODE));

/**
 * @license
 * Copyright 2018 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
function matches(element, selector) {
    var nativeMatches = element.matches
        || element.webkitMatchesSelector
        || element.msMatchesSelector;
    return nativeMatches.call(element, selector);
}

/**
 * @license
 * Copyright 2019 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const t$2=window,e$3=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),n$3=new WeakMap;let o$4 = class o{constructor(t,e,n){if(this._$cssResult$=!0,n!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$3&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n$3.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n$3.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new o$4("string"==typeof t?t:t+"",void 0,s$3),i$3=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new o$4(n,t,s$3)},S$1=(s,n)=>{e$3?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),o=t$2.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n);}));},c$1=e$3?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var s$2;const e$2=window,r$1=e$2.trustedTypes,h$1=r$1?r$1.emptyScript:"",o$3=e$2.reactiveElementPolyfillSupport,n$2={toAttribute(t,i){switch(i){case Boolean:t=t?h$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},a$1=(t,i)=>i!==t&&(i==i||t==t),l$3={attribute:!0,type:String,converter:n$2,reflect:!1,hasChanged:a$1};let d$1 = class d extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e));})),t}static createProperty(t,i=l$3){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l$3}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(c$1(i));}else void 0!==i&&s.push(c$1(i));return s}static _$Ep(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S$1(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$EO(t,i,s=l$3){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:n$2).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null;}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:n$2;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a$1)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek();}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}};d$1.finalized=!0,d$1.elementProperties=new Map,d$1.elementStyles=[],d$1.shadowRootOptions={mode:"open"},null==o$3||o$3({ReactiveElement:d$1}),(null!==(s$2=e$2.reactiveElementVersions)&&void 0!==s$2?s$2:e$2.reactiveElementVersions=[]).push("1.6.1");

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
var t$1;const i$2=window,s$1=i$2.trustedTypes,e$1=s$1?s$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,o$2="$lit$",n$1=`lit$${(Math.random()+"").slice(9)}$`,l$2="?"+n$1,h=`<${l$2}>`,r=document,d=()=>r.createComment(""),u=t=>null===t||"object"!=typeof t&&"function"!=typeof t,c=Array.isArray,v=t=>c(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),a="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${a}(?:([^\\s"'>=/]+)(${a}*=${a}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,w=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=w(1),T=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),E=new WeakMap,C=r.createTreeWalker(r,129,null,!1),P=(t,i)=>{const s=t.length-1,l=[];let r,d=2===i?"<svg>":"",u=f;for(let i=0;i<s;i++){const s=t[i];let e,c,v=-1,a=0;for(;a<s.length&&(u.lastIndex=a,c=u.exec(s),null!==c);)a=u.lastIndex,u===f?"!--"===c[1]?u=_:void 0!==c[1]?u=m:void 0!==c[2]?(y.test(c[2])&&(r=RegExp("</"+c[2],"g")),u=p):void 0!==c[3]&&(u=p):u===p?">"===c[0]?(u=null!=r?r:f,v=-1):void 0===c[1]?v=-2:(v=u.lastIndex-c[2].length,e=c[1],u=void 0===c[3]?p:'"'===c[3]?$:g):u===$||u===g?u=p:u===_||u===m?u=f:(u=p,r=void 0);const w=u===p&&t[i+1].startsWith("/>")?" ":"";d+=u===f?s+h:v>=0?(l.push(e),s.slice(0,v)+o$2+s.slice(v)+n$1+w):s+n$1+(-2===v?(l.push(void 0),i):w);}const c=d+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==e$1?e$1.createHTML(c):c,l]};class V{constructor({strings:t,_$litType$:i},e){let h;this.parts=[];let r=0,u=0;const c=t.length-1,v=this.parts,[a,f]=P(t,i);if(this.el=V.createElement(a,e),C.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(h=C.nextNode())&&v.length<c;){if(1===h.nodeType){if(h.hasAttributes()){const t=[];for(const i of h.getAttributeNames())if(i.endsWith(o$2)||i.startsWith(n$1)){const s=f[u++];if(t.push(i),void 0!==s){const t=h.getAttribute(s.toLowerCase()+o$2).split(n$1),i=/([.?@])?(.*)/.exec(s);v.push({type:1,index:r,name:i[2],strings:t,ctor:"."===i[1]?k:"?"===i[1]?I:"@"===i[1]?L:R});}else v.push({type:6,index:r});}for(const i of t)h.removeAttribute(i);}if(y.test(h.tagName)){const t=h.textContent.split(n$1),i=t.length-1;if(i>0){h.textContent=s$1?s$1.emptyScript:"";for(let s=0;s<i;s++)h.append(t[s],d()),C.nextNode(),v.push({type:2,index:++r});h.append(t[i],d());}}}else if(8===h.nodeType)if(h.data===l$2)v.push({type:2,index:r});else {let t=-1;for(;-1!==(t=h.data.indexOf(n$1,t+1));)v.push({type:7,index:r}),t+=n$1.length-1;}r++;}}static createElement(t,i){const s=r.createElement("template");return s.innerHTML=t,s}}function N(t,i,s=t,e){var o,n,l,h;if(i===T)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const d=u(i)?void 0:i._$litDirective$;return (null==r?void 0:r.constructor)!==d&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===d?r=void 0:(r=new d(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=N(t,r._$AS(t,i.values),r,e)),i}class S{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:r).importNode(s,!0);C.currentNode=o;let n=C.nextNode(),l=0,h=0,d=e[0];for(;void 0!==d;){if(l===d.index){let i;2===d.type?i=new M(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new z(n,this,t)),this.u.push(i),d=e[++h];}l!==(null==d?void 0:d.index)&&(n=C.nextNode(),l++);}return o}p(t){let i=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class M{constructor(t,i,s,e){var o;this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cm=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===(null==t?void 0:t.nodeType)&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=N(this,t,i),u(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==T&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):v(t)?this.k(t):this.g(t);}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t));}g(t){this._$AH!==A&&u(this._$AH)?this._$AA.nextSibling.data=t:this.T(r.createTextNode(t)),this._$AH=t;}$(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=V.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.p(s);else {const t=new S(o,this),i=t.v(this.options);t.p(s),this.T(i),this._$AH=t;}}_$AC(t){let i=E.get(t.strings);return void 0===i&&E.set(t.strings,i=new V(t)),i}k(t){c(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new M(this.S(d()),this.S(d()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class R{constructor(t,i,s,e,o){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=N(this,t,i,0),n=!u(t)||t!==this._$AH&&t!==T,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=N(this,e[s+l],i,l),h===T&&(h=this._$AH[l]),n||(n=!u(h)||h!==this._$AH[l]),h===A?t=A:t!==A&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class k extends R{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}const H=s$1?s$1.emptyScript:"";class I extends R{constructor(){super(...arguments),this.type=4;}j(t){t&&t!==A?this.element.setAttribute(this.name,H):this.element.removeAttribute(this.name);}}class L extends R{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=N(this,t,i,0))&&void 0!==s?s:A)===T)return;const e=this._$AH,o=t===A&&e!==A||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==A&&(e===A||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){N(this,t);}}const j=i$2.litHtmlPolyfillSupport;null==j||j(V,M),(null!==(t$1=i$2.litHtmlVersions)&&void 0!==t$1?t$1:i$2.litHtmlVersions=[]).push("2.7.0");const B=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new M(i.insertBefore(d(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l};

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */var l$1,o$1;class s extends d$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=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 i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1);}render(){return T}}s.finalized=!0,s._$litElement$=!0,null===(l$1=globalThis.litElementHydrateSupport)||void 0===l$1||l$1.call(globalThis,{LitElement:s});const n=globalThis.litElementPolyfillSupport;null==n||n({LitElement:s});(null!==(o$1=globalThis.litElementVersions)&&void 0!==o$1?o$1:globalThis.litElementVersions=[]).push("3.3.0");

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
const fn = () => { };
const optionsBlock = {
    get passive() {
        return false;
    }
};
document.addEventListener('x', fn, optionsBlock);
document.removeEventListener('x', fn);

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
class BaseElement extends s {
    click() {
        if (this.mdcRoot) {
            this.mdcRoot.focus();
            this.mdcRoot.click();
            return;
        }
        super.click();
    }
    /**
     * Create and attach the MDC Foundation to the instance
     */
    createFoundation() {
        if (this.mdcFoundation !== undefined) {
            this.mdcFoundation.destroy();
        }
        if (this.mdcFoundationClass) {
            this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter());
            this.mdcFoundation.init();
        }
    }
    firstUpdated() {
        this.createFoundation();
    }
}

/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var MDCFoundation = /** @class */ (function () {
    function MDCFoundation(adapter) {
        if (adapter === void 0) { adapter = {}; }
        this.adapter = adapter;
    }
    Object.defineProperty(MDCFoundation, "cssClasses", {
        get: function () {
            // Classes extending MDCFoundation should implement this method to return an object which exports every
            // CSS class the foundation class needs as a property. e.g. {ACTIVE: 'mdc-component--active'}
            return {};
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCFoundation, "strings", {
        get: function () {
            // Classes extending MDCFoundation should implement this method to return an object which exports all
            // semantic strings as constants. e.g. {ARIA_ROLE: 'tablist'}
            return {};
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCFoundation, "numbers", {
        get: function () {
            // Classes extending MDCFoundation should implement this method to return an object which exports all
            // of its semantic numbers as constants. e.g. {ANIMATION_DELAY_MS: 350}
            return {};
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCFoundation, "defaultAdapter", {
        get: function () {
            // Classes extending MDCFoundation may choose to implement this getter in order to provide a convenient
            // way of viewing the necessary methods of an adapter. In the future, this could also be used for adapter
            // validation.
            return {};
        },
        enumerable: false,
        configurable: true
    });
    MDCFoundation.prototype.init = function () {
        // Subclasses should override this method to perform initialization routines (registering events, etc.)
    };
    MDCFoundation.prototype.destroy = function () {
        // Subclasses should override this method to perform de-initialization routines (de-registering events, etc.)
    };
    return MDCFoundation;
}());

/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
var cssClasses = {
    // Ripple is a special case where the "root" component is really a "mixin" of sorts,
    // given that it's an 'upgrade' to an existing component. That being said it is the root
    // CSS class that all other CSS classes derive from.
    BG_FOCUSED: 'mdc-ripple-upgraded--background-focused',
    FG_ACTIVATION: 'mdc-ripple-upgraded--foreground-activation',
    FG_DEACTIVATION: 'mdc-ripple-upgraded--foreground-deactivation',
    ROOT: 'mdc-ripple-upgraded',
    UNBOUNDED: 'mdc-ripple-upgraded--unbounded',
};
var strings = {
    VAR_FG_SCALE: '--mdc-ripple-fg-scale',
    VAR_FG_SIZE: '--mdc-ripple-fg-size',
    VAR_FG_TRANSLATE_END: '--mdc-ripple-fg-translate-end',
    VAR_FG_TRANSLATE_START: '--mdc-ripple-fg-translate-start',
    VAR_LEFT: '--mdc-ripple-left',
    VAR_TOP: '--mdc-ripple-top',
};
var numbers = {
    DEACTIVATION_TIMEOUT_MS: 225,
    FG_DEACTIVATION_MS: 150,
    INITIAL_ORIGIN_SCALE: 0.6,
    PADDING: 10,
    TAP_DELAY_MS: 300, // Delay between touch and simulated mouse events on touch devices
};

/**
 * Stores result from supportsCssVariables to avoid redundant processing to
 * detect CSS custom variable support.
 */
function getNormalizedEventCoords(evt, pageOffset, clientRect) {
    if (!evt) {
        return { x: 0, y: 0 };
    }
    var x = pageOffset.x, y = pageOffset.y;
    var documentX = x + clientRect.left;
    var documentY = y + clientRect.top;
    var normalizedX;
    var normalizedY;
    // Determine touch point relative to the ripple container.
    if (evt.type === 'touchstart') {
        var touchEvent = evt;
        normalizedX = touchEvent.changedTouches[0].pageX - documentX;
        normalizedY = touchEvent.changedTouches[0].pageY - documentY;
    }
    else {
        var mouseEvent = evt;
        normalizedX = mouseEvent.pageX - documentX;
        normalizedY = mouseEvent.pageY - documentY;
    }
    return { x: normalizedX, y: normalizedY };
}

/**
 * @license
 * Copyright 2016 Google Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
// Activation events registered on the root element of each instance for activation
var ACTIVATION_EVENT_TYPES = [
    'touchstart', 'pointerdown', 'mousedown', 'keydown',
];
// Deactivation events registered on documentElement when a pointer-related down event occurs
var POINTER_DEACTIVATION_EVENT_TYPES = [
    'touchend', 'pointerup', 'mouseup', 'contextmenu',
];
// simultaneous nested activations
var activatedTargets = [];
var MDCRippleFoundation = /** @class */ (function (_super) {
    __extends(MDCRippleFoundation, _super);
    function MDCRippleFoundation(adapter) {
        var _this = _super.call(this, __assign(__assign({}, MDCRippleFoundation.defaultAdapter), adapter)) || this;
        _this.activationAnimationHasEnded = false;
        _this.activationTimer = 0;
        _this.fgDeactivationRemovalTimer = 0;
        _this.fgScale = '0';
        _this.frame = { width: 0, height: 0 };
        _this.initialSize = 0;
        _this.layoutFrame = 0;
        _this.maxRadius = 0;
        _this.unboundedCoords = { left: 0, top: 0 };
        _this.activationState = _this.defaultActivationState();
        _this.activationTimerCallback = function () {
            _this.activationAnimationHasEnded = true;
            _this.runDeactivationUXLogicIfReady();
        };
        _this.activateHandler = function (e) {
            _this.activateImpl(e);
        };
        _this.deactivateHandler = function () {
            _this.deactivateImpl();
        };
        _this.focusHandler = function () {
            _this.handleFocus();
        };
        _this.blurHandler = function () {
            _this.handleBlur();
        };
        _this.resizeHandler = function () {
            _this.layout();
        };
        return _this;
    }
    Object.defineProperty(MDCRippleFoundation, "cssClasses", {
        get: function () {
            return cssClasses;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCRippleFoundation, "strings", {
        get: function () {
            return strings;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCRippleFoundation, "numbers", {
        get: function () {
            return numbers;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(MDCRippleFoundation, "defaultAdapter", {
        get: function () {
            return {
                addClass: function () { return undefined; },
                browserSupportsCssVars: function () { return true; },
                computeBoundingRect: function () {
                    return ({ top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 });
                },
                containsEventTarget: function () { return true; },
                deregisterDocumentInteractionHandler: function () { return undefined; },
                deregisterInteractionHandler: function () { return undefined; },
                deregisterResizeHandler: function () { return undefined; },
                getWindowPageOffset: function () { return ({ x: 0, y: 0 }); },
                isSurfaceActive: function () { return true; },
                isSurfaceDisabled: function () { return true; },
                isUnbounded: function () { return true; },
                registerDocumentInteractionHandler: function () { return undefined; },
                registerInteractionHandler: function () { return undefined; },
                registerResizeHandler: function () { return undefined; },
                removeClass: function () { return undefined; },
                updateCssVariable: function () { return undefined; },
            };
        },
        enumerable: false,
        configurable: true
    });
    MDCRippleFoundation.prototype.init = function () {
        var _this = this;
        var supportsPressRipple = this.supportsPressRipple();
        this.registerRootHandlers(supportsPressRipple);
        if (supportsPressRipple) {
            var _a = MDCRippleFoundation.cssClasses, ROOT_1 = _a.ROOT, UNBOUNDED_1 = _a.UNBOUNDED;
            requestAnimationFrame(function () {
                _this.adapter.addClass(ROOT_1);
                if (_this.adapter.isUnbounded()) {
                    _this.adapter.addClass(UNBOUNDED_1);
                    // Unbounded ripples need layout logic applied immediately to set coordinates for both shade and ripple
                    _this.layoutInternal();
                }
            });
        }
    };
    MDCRippleFoundation.prototype.destroy = function () {
        var _this = this;
        if (this.supportsPressRipple()) {
            if (this.activationTimer) {
                clearTimeout(this.activationTimer);
                this.activationTimer = 0;
                this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_ACTIVATION);
            }
            if (this.fgDeactivationRemovalTimer) {
                clearTimeout(this.fgDeactivationRemovalTimer);
                this.fgDeactivationRemovalTimer = 0;
                this.adapter.removeClass(MDCRippleFoundation.cssClasses.FG_DEACTIVATION);
            }
            var _a = MDCRippleFoundation.cssClasses, ROOT_2 = _a.ROOT, UNBOUNDED_2 = _a.UNBOUNDED;
            requestAnimationFrame(function () {
                _this.adapter.removeClass(ROOT_2);
                _this.adapter.removeClass(UNBOUNDED_2);
                _this.removeCssVars();
            });
        }
        this.deregisterRootHandlers();
        this.deregisterDeactivationHandlers();
    };
    /**
     * @param evt Optional event containing position information.
     */
    MDCRippleFoundation.prototype.activate = function (evt) {
        this.activateImpl(evt);
    };
    MDCRippleFoundation.prototype.deactivate = function () {
        this.deactivateImpl();
    };
    MDCRippleFoundation.prototype.layout = function () {
        var _this = this;
        if (this.layoutFrame) {
            cancelAnimationFrame(this.layoutFrame);
        }
        this.layoutFrame = requestAnimationFrame(function () {
            _this.layoutInternal();
            _this.layoutFrame = 0;
        });
    };
    MDCRippleFoundation.prototype.setUnbounded = function (unbounded) {
        var UNBOUNDED = MDCRippleFoundation.cssClasses.UNBOUNDED;
        if (unbounded) {
            this.adapter.addClass(UNBOUNDED);
        }
        else {
            this.adapter.removeClass(UNBOUNDED);
        }
    };
    MDCRippleFoundation.prototype.handleFocus = function () {
        var _this = this;
        requestAnimationFrame(function () { return _this.adapter.addClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); });
    };
    MDCRippleFoundation.prototype.handleBlur = function () {
        var _this = this;
        requestAnimationFrame(function () { return _this.adapter.removeClass(MDCRippleFoundation.cssClasses.BG_FOCUSED); });
    };
    /**
     * We compute this property so that we are not querying information about the client
     * until the point in time where the foundation requests it. This prevents scenarios where
     * client-side feature-detection may happen too early, such as when components are rendered on the server
     * and then initialized at mount time on the client.
     */
    MDCRippleFoundation.prototype.supportsPressRipple = function () {
        return this.adapter.browserSupportsCssVars();
    };
    MDCRippleFoundation.prototype.defaultActivationState = function () {
        return {
            activationEvent: undefined,
            hasDeactivationUXRun: false,
            isActivated: false,
            isProgrammatic: false,
            wasActivatedByPointer: false,
            wasElementMadeActive: false,
        };
    };
    /**
     * supportsPressRipple Passed from init to save a redundant function call
     */
    MDCRippleFoundation.prototype.registerRootHandlers = function (supportsPressRipple) {
        var e_1, _a;
        if (supportsPressRipple) {
            try {
                for (var ACTIVATION_EVENT_TYPES_1 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next(); !ACTIVATION_EVENT_TYPES_1_1.done; ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next()) {
                    var evtType = ACTIVATION_EVENT_TYPES_1_1.value;
                    this.adapter.registerInteractionHandler(evtType, this.activateHandler);
                }
            }
            catch (e_1_1) { e_1 = { error: e_1_1 }; }
            finally {
                try {
                    if (ACTIVATION_EVENT_TYPES_1_1 && !ACTIVATION_EVENT_TYPES_1_1.done && (_a = ACTIVATION_EVENT_TYPES_1.return)) _a.call(ACTIVATION_EVENT_TYPES_1);
                }
                finally { if (e_1) throw e_1.error; }
            }
            if (this.adapter.isUnbounded()) {
                this.adapter.registerResizeHandler(this.resizeHandler);
            }
        }
        this.adapter.registerInteractionHandler('focus', this.focusHandler);
        this.adapter.registerInteractionHandler('blur', this.blurHandler);
    };
    MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) {
        var e_2, _a;
        if (evt.type === 'keydown') {
            this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);
        }
        else {
            try {
                for (var POINTER_DEACTIVATION_EVENT_TYPES_1 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next(); !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done; POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next()) {
                    var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;
                    this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler);
                }
            }
            catch (e_2_1) { e_2 = { error: e_2_1 }; }
            finally {
                try {
                    if (POINTER_DEACTIVATION_EVENT_TYPES_1_1 && !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_1.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_1);
                }
                finally { if (e_2) throw e_2.error; }
            }
        }
    };
    MDCRippleFoundation.prototype.deregisterRootHandlers = function () {
        var e_3, _a;
        try {
            for (var ACTIVATION_EVENT_TYPES_2 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next(); !ACTIVATION_EVENT_TYPES_2_1.done; ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next()) {
                var evtType = ACTIVATION_EVENT_TYPES_2_1.value;
                this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);
            }
        }
        catch (e_3_1) { e_3 = { error: e_3_1 }; }
        finally {
            try {
                if (ACTIVATION_EVENT_TYPES_2_1 && !ACTIVATION_EVENT_TYPES_2_1.done && (_a = ACTIVATION_EVENT_TYPES_2.return)) _a.call(ACTIVATION_EVENT_TYPES_2);
            }
            finally { if (e_3) throw e_3.error; }
        }
        this.adapter.deregisterInteractionHandler('focus', this.focusHandler);
        this.adapter.deregisterInteractionHandler('blur', this.blurHandler);
        if (this.adapter.isUnbounded()) {
            this.adapter.deregisterResizeHandler(this.resizeHandler);
        }
    };
    MDCRippleFoundation.prototype.deregisterDeactivationHandlers = function () {
        var e_4, _a;
        this.adapter.deregisterInteractionHandler('keyup', this.deactivateHandler);
        try {
            for (var POINTER_DEACTIVATION_EVENT_TYPES_2 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next(); !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done; POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next()) {
                var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;
                this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler);
            }
        }
        catch (e_4_1) { e_4 = { error: e_4_1 }; }
        finally {
            try {
                if (POINTER_DEACTIVATION_EVENT_TYPES_2_1 && !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done && (_a = POINTER_DEACTIVATION_EVENT_TYPES_2.return)) _a.call(POINTER_DEACTIVATION_EVENT_TYPES_2);
            }
            finally { if (e_4) throw e_4.error; }
        }
    };
    MDCRippleFoundation.prototype.removeCssVars = function () {
        var _this = this;
        var rippleStrings = MDCRippleFoundation.strings;
        var keys = Object.keys(rippleStrings);
        keys.forEach(function (key) {
            if (key.indexOf('VAR_') === 0) {
                _this.adapter.updateCssVariable(rippleStrings[key], null);
            }
        });
    };
    MDCRippleFoundation.prototype.activateImpl = function (evt) {
        var _this = this;
        if (this.adapter.isSurfaceDisabled()) {
            return;
        }
        var activationState = this.activationState;
        if (activationState.isActivated) {
            return;
        }
        // Avoid reacting to follow-on events fired by touch device after an already-processed user interaction
        var previousActivationEvent = this.previousActivationEvent;
        var isSameInteraction = previousActivationEvent && evt !== undefined && previousActivationEvent.type !== evt.type;
        if (isSameInteraction) {
            return;
        }
        activationState.isActivated = true;
        activationState.isProgrammatic = evt === undefined;
        activationState.activationEvent = evt;
        activationState.wasActivatedByPointer = activationState.isProgrammatic ? false : evt !== undefined && (evt.type === 'mousedown' || evt.type === 'touchstart' || evt.type === 'pointerdown');
        var hasActivatedChild = evt !== undefined &&
            activatedTargets.length > 0 &&
            activatedTargets.some(function (target) { return _this.adapter.containsEventTarget(target); });
        if (hasActivatedChild) {
            // Immediately reset activation state, while preserving logic that prevents touch follow-on events
            this.resetActivationState();
            return;
        }
        if (evt !== undefined) {
            activatedTargets.push(evt.target);
            this.registerDeactivationHandlers(evt);
        }
        activationState.wasElementMadeActive = this.checkElementMadeActive(evt);
        if (activationState.wasElementMadeActive) {
            this.animateActivation();
        }
        requestAnimationFrame(function () {
            // Reset array on next frame after the current event has had a chance to bubble to prevent ancestor ripples
            activatedTargets = [];
            if (!activationState.wasElementMadeActive
                && evt !== undefined
                && (evt.key === ' ' || evt.keyCode === 32)) {
                // If space was pressed, try again within an rAF call to detect :active, because different UAs report
                // active states inconsistently when they're called within event handling code:
                // - https://bugs.chromium.org/p/chromium/issues/detail?id=635971
                // - https://bugzilla.mozilla.org/show_bug.cgi?id=1293741
                // We try first outside rAF to support Edge, which does not exhibit this problem, but will crash if a CSS
                // variable is set within a rAF callback for a submit button interaction (#2241).
                activationState.wasElementMadeActive = _this.checkElementMadeActive(evt);
                if (activationState.wasElementMadeActive) {
                    _this.animateActivation();
                }
            }
            if (!activationState.wasElementMadeActive) {
                // Reset activation state immediately if element was not made active.
                _this.activationState = _this.defaultActivationState();
            }
        });
    };
    MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) {
        return (evt !== undefined && evt.type === 'keydown') ?
            this.adapter.isSurfaceActive() :
            true;
    };
    MDCRippleFoundation.prototype.animateActivation = function () {
        var _this = this;
        var _a = MDCRippleFoundation.strings, VAR_FG_TRANSLATE_START = _a.VAR_FG_TRANSLATE_START, VAR_FG_TRANSLATE_END = _a.VAR_FG_TRANSLATE_END;
        var _b = MDCRippleFoundation.cssClasses, FG_DEACTIVATION = _b.FG_DEACTIVATION, FG_ACTIVATION = _b.FG_ACTIVATION;
        var DEACTIVATION_TIMEOUT_MS = MDCRippleFoundation.numbers.DEACTIVATION_TIMEOUT_MS;
        this.layoutInternal();
        var translateStart = '';
        var translateEnd = '';
        if (!this.adapter.isUnbounded()) {
            var _c = this.getFgTranslationCoordinates(), startPoint = _c.startPoint, endPoint = _c.endPoint;
            translateStart = startPoint.x + "px, " + startPoint.y + "px";
            translateEnd = endPoint.x + "px, " + endPoint.y + "px";
        }
        this.adapter.updateCssVariable(VAR_FG_TRANSLATE_START, translateStart);
        this.adapter.updateCssVariable(VAR_FG_TRANSLATE_END, translateEnd);
        // Cancel any ongoing activation/deactivation animations
        clearTimeout(this.activationTimer);
        clearTimeout(this.fgDeactivationRemovalTimer);
        this.rmBoundedActivationClasses();
        this.adapter.removeClass(FG_DEACTIVATION);
        // Force layout in order to re-trigger the animation.
        this.adapter.computeBoundingRect();
        this.adapter.addClass(FG_ACTIVATION);
        this.activationTimer = setTimeout(function () {
            _this.activationTimerCallback();
        }, DEACTIVATION_TIMEOUT_MS);
    };
    MDCRippleFoundation.prototype.getFgTranslationCoordinates = function () {
        var _a = this.activationState, activationEvent = _a.activationEvent, wasActivatedByPointer = _a.wasActivatedByPointer;
        var startPoint;
        if (wasActivatedByPointer) {
            startPoint = getNormalizedEventCoords(activationEvent, this.adapter.getWindowPageOffset(), this.adapter.computeBoundingRect());
        }
        else {
            startPoint = {
                x: this.frame.width / 2,
                y: this.frame.height / 2,
            };
        }
        // Center the element around the start point.
        startPoint = {
            x: startPoint.x - (this.initialSize / 2),
            y: startPoint.y - (this.initialSize / 2),
        };
        var endPoint = {
            x: (this.frame.width / 2) - (this.initialSize / 2),
            y: (this.frame.height / 2) - (this.initialSize / 2),
        };
        return { startPoint: startPoint, endPoint: endPoint };
    };
    MDCRippleFoundation.prototype.runDeactivationUXLogicIfReady = function () {
        var _this = this;
        // This method is called both when a pointing device is released, and when the activation animation ends.
        // The deactivation animation should only run after both of those occur.
        var FG_DEACTIVATION = MDCRippleFoundation.cssClasses.FG_DEACTIVATION;
        var _a = this.activationState, hasDeactivationUXRun = _a.hasDeactivationUXRun, isActivated = _a.isActivated;
        var activationHasEnded = hasDeactivationUXRun || !isActivated;
        if (activationHasEnded && this.activationAnimationHasEnded) {
            this.rmBoundedActivationClasses();
            this.adapter.addClass(FG_DEACTIVATION);
            this.fgDeactivationRemovalTimer = setTimeout(function () {
                _this.adapter.removeClass(FG_DEACTIVATION);
            }, numbers.FG_DEACTIVATION_MS);
        }
    };
    MDCRippleFoundation.prototype.rmBoundedActivationClasses = function () {
        var FG_ACTIVATION = MDCRippleFoundation.cssClasses.FG_ACTIVATION;
        this.adapter.removeClass(FG_ACTIVATION);
        this.activationAnimationHasEnded = false;
        this.adapter.computeBoundingRect();
    };
    MDCRippleFoundation.prototype.resetActivationState = function () {
        var _this = this;
        this.previousActivationEvent = this.activationState.activationEvent;
        this.activationState = this.defaultActivationState();
        // Touch devices may fire additional events for the same interaction within a short time.
        // Store the previous event until it's safe to assume that subsequent events are for new interactions.
        setTimeout(function () { return _this.previousActivationEvent = undefined; }, MDCRippleFoundation.numbers.TAP_DELAY_MS);
    };
    MDCRippleFoundation.prototype.deactivateImpl = function () {
        var _this = this;
        var activationState = this.activationState;
        // This can happen in scenarios such as when you have a keyup event that blurs the element.
        if (!activationState.isActivated) {
            return;
        }
        var state = __assign({}, activationState);
        if (activationState.isProgrammatic) {
            requestAnimationFrame(function () {
                _this.animateDeactivation(state);
            });
            this.resetActivationState();
        }
        else {
            this.deregisterDeactivationHandlers();
            requestAnimationFrame(function () {
                _this.activationState.hasDeactivationUXRun = true;
                _this.animateDeactivation(state);
                _this.resetActivationState();
            });
        }
    };
    MDCRippleFoundation.prototype.animateDeactivation = function (_a) {
        var wasActivatedByPointer = _a.wasActivatedByPointer, wasElementMadeActive = _a.wasElementMadeActive;
        if (wasActivatedByPointer || wasElementMadeActive) {
            this.runDeactivationUXLogicIfReady();
        }
    };
    MDCRippleFoundation.prototype.layoutInternal = function () {
        var _this = this;
        this.frame = this.adapter.computeBoundingRect();
        var maxDim = Math.max(this.frame.height, this.frame.width);
        // Surface diameter is treated differently for unbounded vs. bounded ripples.
        // Unbounded ripple diameter is calculated smaller since the surface is expected to already be padded appropriately
        // to extend the hitbox, and the ripple is expected to meet the edges of the padded hitbox (which is typically
        // square). Bounded ripples, on the other hand, are fully expected to expand beyond the surface's longest diameter
        // (calculated based on the diagonal plus a constant padding), and are clipped at the surface's border via
        // `overflow: hidden`.
        var getBoundedRadius = function () {
            var hypotenuse = Math.sqrt(Math.pow(_this.frame.width, 2) + Math.pow(_this.frame.height, 2));
            return hypotenuse + MDCRippleFoundation.numbers.PADDING;
        };
        this.maxRadius = this.adapter.isUnbounded() ? maxDim : getBoundedRadius();
        // Ripple is sized as a fraction of the largest dimension of the surface, then scales up using a CSS scale transform
        var initialSize = Math.floor(maxDim * MDCRippleFoundation.numbers.INITIAL_ORIGIN_SCALE);
        // Unbounded ripple size should always be even number to equally center align.
        if (this.adapter.isUnbounded() && initialSize % 2 !== 0) {
            this.initialSize = initialSize - 1;
        }
        else {
            this.initialSize = initialSize;
        }
        this.fgScale = "" + this.maxRadius / this.initialSize;
        this.updateLayoutCssVars();
    };
    MDCRippleFoundation.prototype.updateLayoutCssVars = function () {
        var _a = MDCRippleFoundation.strings, VAR_FG_SIZE = _a.VAR_FG_SIZE, VAR_LEFT = _a.VAR_LEFT, VAR_TOP = _a.VAR_TOP, VAR_FG_SCALE = _a.VAR_FG_SCALE;
        this.adapter.updateCssVariable(VAR_FG_SIZE, this.initialSize + "px");
        this.adapter.updateCssVariable(VAR_FG_SCALE, this.fgScale);
        if (this.adapter.isUnbounded()) {
            this.unboundedCoords = {
                left: Math.round((this.frame.width / 2) - (this.initialSize / 2)),
                top: Math.round((this.frame.height / 2) - (this.initialSize / 2)),
            };
            this.adapter.updateCssVariable(VAR_LEFT, this.unboundedCoords.left + "px");
            this.adapter.updateCssVariable(VAR_TOP, this.unboundedCoords.top + "px");
        }
    };
    return MDCRippleFoundation;
}(MDCFoundation));
// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.
var MDCRippleFoundation$1 = MDCRippleFoundation;

/**
 * @license
 * Copyright 2017 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const o=e(class extends i$1{constructor(t$1){var i;if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||(null===(i=t$1.strings)||void 0===i?void 0:i.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((i=>t[i])).join(" ")+" "}update(i,[s]){var r,o;if(void 0===this.nt){this.nt=new Set,void 0!==i.strings&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in s)s[t]&&!(null===(r=this.st)||void 0===r?void 0:r.has(t))&&this.nt.add(t);return this.render(s)}const e=i.element.classList;this.nt.forEach((t=>{t in s||(e.remove(t),this.nt.delete(t));}));for(const t in s){const i=!!s[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(e.add(t),this.nt.add(t)):(e.remove(t),this.nt.delete(t)));}return T}});

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const i=e(class extends i$1{constructor(t$1){var e;if(super(t$1),t$1.type!==t.ATTRIBUTE||"style"!==t$1.name||(null===(e=t$1.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`}),"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.vt){this.vt=new Set;for(const t in r)this.vt.add(t);return this.render(r)}this.vt.forEach((t=>{null==r[t]&&(this.vt.delete(t),t.includes("-")?s.removeProperty(t):s[t]="");}));for(const t in r){const e=r[t];null!=e&&(this.vt.add(t),t.includes("-")?s.setProperty(t,e):s[t]=e);}return T}});

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
class RippleBase extends BaseElement {
    constructor() {
        super(...arguments);
        this.primary = false;
        this.accent = false;
        this.unbounded = false;
        this.disabled = false;
        this.activated = false;
        this.selected = false;
        this.internalUseStateLayerCustomProperties = false;
        this.hovering = false;
        this.bgFocused = false;
        this.fgActivation = false;
        this.fgDeactivation = false;
        this.fgScale = '';
        this.fgSize = '';
        this.translateStart = '';
        this.translateEnd = '';
        this.leftPos = '';
        this.topPos = '';
        this.mdcFoundationClass = MDCRippleFoundation$1;
    }
    get isActive() {
        return matches(this.parentElement || this, ':active');
    }
    createAdapter() {
        return {
            browserSupportsCssVars: () => true,
            isUnbounded: () => this.unbounded,
            isSurfaceActive: () => this.isActive,
            isSurfaceDisabled: () => this.disabled,
            addClass: (className) => {
                switch (className) {
                    case 'mdc-ripple-upgraded--background-focused':
                        this.bgFocused = true;
                        break;
                    case 'mdc-ripple-upgraded--foreground-activation':
                        this.fgActivation = true;
                        break;
                    case 'mdc-ripple-upgraded--foreground-deactivation':
                        this.fgDeactivation = true;
                        break;
                }
            },
            removeClass: (className) => {
                switch (className) {
                    case 'mdc-ripple-upgraded--background-focused':
                        this.bgFocused = false;
                        break;
                    case 'mdc-ripple-upgraded--foreground-activation':
                        this.fgActivation = false;
                        break;
                    case 'mdc-ripple-upgraded--foreground-deactivation':
                        this.fgDeactivation = false;
                        break;
                }
            },
            containsEventTarget: () => true,
            registerInteractionHandler: () => undefined,
            deregisterInteractionHandler: () => undefined,
            registerDocumentInteractionHandler: () => undefined,
            deregisterDocumentInteractionHandler: () => undefined,
            registerResizeHandler: () => undefined,
            deregisterResizeHandler: () => undefined,
            updateCssVariable: (varName, value) => {
                switch (varName) {
                    case '--mdc-ripple-fg-scale':
                        this.fgScale = value;
                        break;
                    case '--mdc-ripple-fg-size':
                        this.fgSize = value;
                        break;
                    case '--mdc-ripple-fg-translate-end':
                        this.translateEnd = value;
                        break;
                    case '--mdc-ripple-fg-translate-start':
                        this.translateStart = value;
                        break;
                    case '--mdc-ripple-left':
                        this.leftPos = value;
                        break;
                    case '--mdc-ripple-top':
                        this.topPos = value;
                        break;
                }
            },
            computeBoundingRect: () => (this.parentElement || this).getBoundingClientRect(),
            getWindowPageOffset: () => ({ x: window.pageXOffset, y: window.pageYOffset }),
        };
    }
    startPress(ev) {
        this.waitForFoundation(() => {
            this.mdcFoundation.activate(ev);
        });
    }
    endPress() {
        this.waitForFoundation(() => {
            this.mdcFoundation.deactivate();
        });
    }
    startFocus() {
        this.waitForFoundation(() => {
            this.mdcFoundation.handleFocus();
        });
    }
    endFocus() {
        this.waitForFoundation(() => {
            this.mdcFoundation.handleBlur();
        });
    }
    startHover() {
        this.hovering = true;
    }
    endHover() {
        this.hovering = false;
    }
    /**
     * Wait for the MDCFoundation to be created by `firstUpdated`
     */
    waitForFoundation(fn) {
        if (this.mdcFoundation) {
            fn();
        }
        else {
            this.updateComplete.then(fn);
        }
    }
    update(changedProperties) {
        if (changedProperties.has('disabled')) {
            // stop hovering when ripple is disabled to prevent a stuck "hover" state
            // When re-enabled, the outer component will get a `mouseenter` event on
            // the first movement, which will call `startHover()`
            if (this.disabled) {
                this.endHover();
            }
        }
        super.update(changedProperties);
    }
    /** @soyTemplate */
    render() {
        const shouldActivateInPrimary = this.activated && (this.primary || !this.accent);
        const shouldSelectInPrimary = this.selected && (this.primary || !this.accent);
        /** @classMap */
        const classes = {
            'mdc-ripple-surface--accent': this.accent,
            'mdc-ripple-surface--primary--activated': shouldActivateInPrimary,
            'mdc-ripple-surface--accent--activated': this.accent && this.activated,
            'mdc-ripple-surface--primary--selected': shouldSelectInPrimary,
            'mdc-ripple-surface--accent--selected': this.accent && this.selected,
            'mdc-ripple-surface--disabled': this.disabled,
            'mdc-ripple-surface--hover': this.hovering,
            'mdc-ripple-surface--primary': this.primary,
            'mdc-ripple-surface--selected': this.selected,
            'mdc-ripple-upgraded--background-focused': this.bgFocused,
            'mdc-ripple-upgraded--foreground-activation': this.fgActivation,
            'mdc-ripple-upgraded--foreground-deactivation': this.fgDeactivation,
            'mdc-ripple-upgraded--unbounded': this.unbounded,
            'mdc-ripple-surface--internal-use-state-layer-custom-properties': this.internalUseStateLayerCustomProperties,
        };
        return x `
        <div class="mdc-ripple-surface mdc-ripple-upgraded ${o(classes)}"
          style="${i({
            '--mdc-ripple-fg-scale': this.fgScale,
            '--mdc-ripple-fg-size': this.fgSize,
            '--mdc-ripple-fg-translate-end': this.translateEnd,
            '--mdc-ripple-fg-translate-start': this.translateStart,
            '--mdc-ripple-left': this.leftPos,
            '--mdc-ripple-top': this.topPos,
        })}"></div>`;
    }
}
__decorate([
    i$4('.mdc-ripple-surface')
], RippleBase.prototype, "mdcRoot", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "primary", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "accent", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "unbounded", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "disabled", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "activated", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "selected", void 0);
__decorate([
    e$6({ type: Boolean })
], RippleBase.prototype, "internalUseStateLayerCustomProperties", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "hovering", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "bgFocused", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "fgActivation", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "fgDeactivation", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "fgScale", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "fgSize", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "translateStart", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "translateEnd", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "leftPos", void 0);
__decorate([
    t$3()
], RippleBase.prototype, "topPos", void 0);

/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const styles$2 = i$3 `.mdc-ripple-surface{--mdc-ripple-fg-size: 0;--mdc-ripple-left: 0;--mdc-ripple-top: 0;--mdc-ripple-fg-scale: 1;--mdc-ripple-fg-translate-end: 0;--mdc-ripple-fg-translate-start: 0;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:transform,opacity;position:relative;outline:none;overflow:hidden}.mdc-ripple-surface::before,.mdc-ripple-surface::after{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:""}.mdc-ripple-surface::before{transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index, 1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index, 0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{transform:scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;transform:scale(0);transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top, 0);left:var(--mdc-ripple-left, 0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{animation:mdc-ripple-fg-opacity-out 150ms;transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}.mdc-ripple-surface::before,.mdc-ripple-surface::after{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-upgraded--unbounded::before,.mdc-ripple-upgraded--unbounded::after{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{top:var(--mdc-ripple-top, calc(50% - 50%));left:var(--mdc-ripple-left, calc(50% - 50%));width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size, 100%);height:var(--mdc-ripple-fg-size, 100%)}.mdc-ripple-surface::before,.mdc-ripple-surface::after{background-color:#000;background-color:var(--mdc-ripple-color, #000)}.mdc-ripple-surface:hover::before,.mdc-ripple-surface.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}@keyframes mdc-ripple-fg-radius-in{from{animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1)}to{transform:translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1))}}@keyframes mdc-ripple-fg-opacity-in{from{animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-out{from{animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}:host{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;display:block}:host .mdc-ripple-surface{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;will-change:unset}.mdc-ripple-surface--primary::before,.mdc-ripple-surface--primary::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary:hover::before,.mdc-ripple-surface--primary.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--primary.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--primary--activated::before,.mdc-ripple-surface--primary--activated::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--activated:hover::before,.mdc-ripple-surface--primary--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--primary--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--primary--selected::before,.mdc-ripple-surface--primary--selected::after{background-color:#6200ee;background-color:var(--mdc-ripple-color, var(--mdc-theme-primary, #6200ee))}.mdc-ripple-surface--primary--selected:hover::before,.mdc-ripple-surface--primary--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--primary--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--primary--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent::before,.mdc-ripple-surface--accent::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent:hover::before,.mdc-ripple-surface--accent.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-opacity, 0.04)}.mdc-ripple-surface--accent.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-opacity, 0.12)}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before{opacity:0.12;opacity:var(--mdc-ripple-activated-opacity, 0.12)}.mdc-ripple-surface--accent--activated::before,.mdc-ripple-surface--accent--activated::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--activated:hover::before,.mdc-ripple-surface--accent--activated.mdc-ripple-surface--hover::before{opacity:0.16;opacity:var(--mdc-ripple-hover-opacity, 0.16)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-focus-opacity, 0.24)}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--activated:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.24;opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.mdc-ripple-surface--accent--selected::before{opacity:0.08;opacity:var(--mdc-ripple-selected-opacity, 0.08)}.mdc-ripple-surface--accent--selected::before,.mdc-ripple-surface--accent--selected::after{background-color:#018786;background-color:var(--mdc-ripple-color, var(--mdc-theme-secondary, #018786))}.mdc-ripple-surface--accent--selected:hover::before,.mdc-ripple-surface--accent--selected.mdc-ripple-surface--hover::before{opacity:0.12;opacity:var(--mdc-ripple-hover-opacity, 0.12)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-focus-opacity, 0.2)}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--accent--selected:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.2;opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--accent--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.mdc-ripple-surface--disabled{opacity:0}.mdc-ripple-surface--internal-use-state-layer-custom-properties::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties::after{background-color:#000;background-color:var(--mdc-ripple-hover-state-layer-color, #000)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:hover::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-surface--hover::before{opacity:0.04;opacity:var(--mdc-ripple-hover-state-layer-opacity, 0.04)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):focus::before{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-focus-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded)::after{transition:opacity 150ms linear}.mdc-ripple-surface--internal-use-state-layer-custom-properties:not(.mdc-ripple-upgraded):active::after{transition-duration:75ms;opacity:0.12;opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}.mdc-ripple-surface--internal-use-state-layer-custom-properties.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-pressed-state-layer-opacity, 0.12)}`;

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
let Ripple = class Ripple extends RippleBase {
};
Ripple.styles = [styles$2];
Ripple = __decorate([
    e$7('mwc-ripple')
], Ripple);

/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * TypeScript version of the decorator
 * @see https://www.typescriptlang.org/docs/handbook/decorators.html#property-decorators
 */
function tsDecorator(prototype, name, descriptor) {
    const constructor = prototype.constructor;
    if (!descriptor) {
        /**
         * lit uses internal properties with two leading underscores to
         * provide storage for accessors
         */
        const litInternalPropertyKey = `__${name}`;
        descriptor =
            constructor.getPropertyDescriptor(name, litInternalPropertyKey);
        if (!descriptor) {
            throw new Error('@ariaProperty must be used after a @property decorator');
        }
    }
    // descriptor must exist at this point, reassign so typescript understands
    const propDescriptor = descriptor;
    let attribute = '';
    if (!propDescriptor.set) {
        throw new Error(`@ariaProperty requires a setter for ${name}`);
    }
    // TODO(b/202853219): Remove this check when internal tooling is
    // compatible
    // tslint:disable-next-line:no-any bail if applied to internal generated class
    if (prototype.dispatchWizEvent) {
        return descriptor;
    }
    const wrappedDescriptor = {
        configurable: true,
        enumerable: true,
        set(value) {
            if (attribute === '') {
                const options = constructor.getPropertyOptions(name);
                // if attribute is not a string, use `name` instead
                attribute =
                    typeof options.attribute === 'string' ? options.attribute : name;
            }
            if (this.hasAttribute(attribute)) {
                this.removeAttribute(attribute);
            }
            propDescriptor.set.call(this, value);
        }
    };
    if (propDescriptor.get) {
        wrappedDescriptor.get = function () {
            return propDescriptor.get.call(this);
        };
    }
    return wrappedDescriptor;
}
/**
 * A property decorator proxies an aria attribute to an internal node
 *
 * This decorator is only intended for use with ARIA attributes, such as `role`
 * and `aria-label` due to screenreader needs.
 *
 * Upon first render, `@ariaProperty` will remove the attribute from the host
 * element to prevent screenreaders from reading the host instead of the
 * internal node.
 *
 * This decorator should only be used for non-Symbol public fields decorated
 * with `@property`, or on a setter with an optional getter.
 *
 * @example
 * ```ts
 * class MyElement {
 *   @ariaProperty
 *   @property({ type: String, attribute: 'aria-label' })
 *   ariaLabel!: string;
 * }
 * ```
 * @category Decorator
 * @ExportDecoratedItems
 */
function ariaProperty(protoOrDescriptor, name, 
// tslint:disable-next-line:no-any any is required as a return type from decorators
descriptor) {
    if (name !== undefined) {
        return tsDecorator(protoOrDescriptor, name, descriptor);
    }
    else {
        throw new Error('@ariaProperty only supports TypeScript Decorators');
    }
}

/**
 * @license
 * Copyright 2020 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/**
 * Class that encapsulates the events handlers for `mwc-ripple`
 *
 *
 * Example:
 * ```
 * class XFoo extends LitElement {
 *   async getRipple() {
 *     this.renderRipple = true;
 *     await this.updateComplete;
 *     return this.renderRoot.querySelector('mwc-ripple');
 *   }
 *   rippleHandlers = new RippleHandlers(() => this.getRipple());
 *
 *   render() {
 *     return html`
 *       <div @mousedown=${this.rippleHandlers.startPress}></div>
 *       ${this.renderRipple ? html`<mwc-ripple></mwc-ripple>` : ''}
 *     `;
 *   }
 * }
 * ```
 */
class RippleHandlers {
    constructor(
    /** Function that returns a `mwc-ripple` */
    rippleFn) {
        this.startPress = (ev) => {
            rippleFn().then((r) => {
                r && r.startPress(ev);
            });
        };
        this.endPress = () => {
            rippleFn().then((r) => {
                r && r.endPress();
            });
        };
        this.startFocus = () => {
            rippleFn().then((r) => {
                r && r.startFocus();
            });
        };
        this.endFocus = () => {
            rippleFn().then((r) => {
                r && r.endFocus();
            });
        };
        this.startHover = () => {
            rippleFn().then((r) => {
                r && r.startHover();
            });
        };
        this.endHover = () => {
            rippleFn().then((r) => {
                r && r.endHover();
            });
        };
    }
}

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: BSD-3-Clause
 */const l=l=>null!=l?l:A;

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
class IconButtonBase extends s {
    constructor() {
        super(...arguments);
        this.disabled = false;
        this.icon = '';
        this.shouldRenderRipple = false;
        this.rippleHandlers = new RippleHandlers(() => {
            this.shouldRenderRipple = true;
            return this.ripple;
        });
    }
    /** @soyTemplate */
    renderRipple() {
        return this.shouldRenderRipple ? x `
            <mwc-ripple
                .disabled="${this.disabled}"
                unbounded>
            </mwc-ripple>` :
            '';
    }
    focus() {
        const buttonElement = this.buttonElement;
        if (buttonElement) {
            this.rippleHandlers.startFocus();
            buttonElement.focus();
        }
    }
    blur() {
        const buttonElement = this.buttonElement;
        if (buttonElement) {
            this.rippleHandlers.endFocus();
            buttonElement.blur();
        }
    }
    /** @soyTemplate */
    render() {
        return x `<button
        class="mdc-icon-button mdc-icon-button--display-flex"
        aria-label="${this.ariaLabel || this.icon}"
        aria-haspopup="${l(this.ariaHasPopup)}"
        ?disabled="${this.disabled}"
        @focus="${this.handleRippleFocus}"
        @blur="${this.handleRippleBlur}"
        @mousedown="${this.handleRippleMouseDown}"
        @mouseenter="${this.handleRippleMouseEnter}"
        @mouseleave="${this.handleRippleMouseLeave}"
        @touchstart="${this.handleRippleTouchStart}"
        @touchend="${this.handleRippleDeactivate}"
        @touchcancel="${this.handleRippleDeactivate}"
    >${this.renderRipple()}
    ${this.icon ? x `<i class="material-icons">${this.icon}</i>` : ''}
    <span
      ><slot></slot
    ></span>
  </button>`;
    }
    handleRippleMouseDown(event) {
        const onUp = () => {
            window.removeEventListener('mouseup', onUp);
            this.handleRippleDeactivate();
        };
        window.addEventListener('mouseup', onUp);
        this.rippleHandlers.startPress(event);
    }
    handleRippleTouchStart(event) {
        this.rippleHandlers.startPress(event);
    }
    handleRippleDeactivate() {
        this.rippleHandlers.endPress();
    }
    handleRippleMouseEnter() {
        this.rippleHandlers.startHover();
    }
    handleRippleMouseLeave() {
        this.rippleHandlers.endHover();
    }
    handleRippleFocus() {
        this.rippleHandlers.startFocus();
    }
    handleRippleBlur() {
        this.rippleHandlers.endFocus();
    }
}
__decorate([
    e$6({ type: Boolean, reflect: true })
], IconButtonBase.prototype, "disabled", void 0);
__decorate([
    e$6({ type: String })
], IconButtonBase.prototype, "icon", void 0);
__decorate([
    ariaProperty,
    e$6({ type: String, attribute: 'aria-label' })
], IconButtonBase.prototype, "ariaLabel", void 0);
__decorate([
    ariaProperty,
    e$6({ type: String, attribute: 'aria-haspopup' })
], IconButtonBase.prototype, "ariaHasPopup", void 0);
__decorate([
    i$4('button')
], IconButtonBase.prototype, "buttonElement", void 0);
__decorate([
    e$4('mwc-ripple')
], IconButtonBase.prototype, "ripple", void 0);
__decorate([
    t$3()
], IconButtonBase.prototype, "shouldRenderRipple", void 0);
__decorate([
    e$5({ passive: true })
], IconButtonBase.prototype, "handleRippleMouseDown", null);
__decorate([
    e$5({ passive: true })
], IconButtonBase.prototype, "handleRippleTouchStart", null);

/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const styles$1 = i$3 `.material-icons{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}.mdc-icon-button{font-size:24px;width:48px;height:48px;padding:12px}.mdc-icon-button .mdc-icon-button__focus-ring{display:none}.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{display:block;max-height:48px;max-width:48px}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{pointer-events:none;border:2px solid transparent;border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{border-color:CanvasText}}@media screen and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring::after,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring::after{content:"";border:2px solid transparent;border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}}@media screen and (forced-colors: active)and (forced-colors: active){.mdc-icon-button.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring::after,.mdc-icon-button:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring::after{border-color:CanvasText}}.mdc-icon-button.mdc-icon-button--reduced-size .mdc-icon-button__ripple{width:40px;height:40px;margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-icon-button.mdc-icon-button--reduced-size.mdc-ripple-upgraded--background-focused .mdc-icon-button__focus-ring,.mdc-icon-button.mdc-icon-button--reduced-size:not(.mdc-ripple-upgraded):focus .mdc-icon-button__focus-ring{max-height:40px;max-width:40px}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{color:rgba(0, 0, 0, 0.38);color:var(--mdc-theme-text-disabled-on-light, rgba(0, 0, 0, 0.38))}.mdc-icon-button svg,.mdc-icon-button img{width:24px;height:24px}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}.mdc-icon-button{display:inline-block;position:relative;box-sizing:border-box;border:none;outline:none;background-color:transparent;fill:currentColor;color:inherit;text-decoration:none;cursor:pointer;user-select:none;z-index:0;overflow:visible}.mdc-icon-button .mdc-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.mdc-icon-button:disabled{cursor:default;pointer-events:none}.mdc-icon-button--display-flex{align-items:center;display:inline-flex;justify-content:center}.mdc-icon-button__icon{display:inline-block}.mdc-icon-button__icon.mdc-icon-button__icon--on{display:none}.mdc-icon-button--on .mdc-icon-button__icon{display:none}.mdc-icon-button--on .mdc-icon-button__icon.mdc-icon-button__icon--on{display:inline-block}.mdc-icon-button__link{height:100%;left:0;outline:none;position:absolute;top:0;width:100%}:host{display:inline-block;outline:none}:host([disabled]){pointer-events:none}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block}:host{--mdc-ripple-color: currentcolor;-webkit-tap-highlight-color:transparent}:host,.mdc-icon-button{vertical-align:top}.mdc-icon-button{width:var(--mdc-icon-button-size, 48px);height:var(--mdc-icon-button-size, 48px);padding:calc( (var(--mdc-icon-button-size, 48px) - var(--mdc-icon-size, 24px)) / 2 )}.mdc-icon-button i,.mdc-icon-button svg,.mdc-icon-button img,.mdc-icon-button ::slotted(*){display:block;width:var(--mdc-icon-size, 24px);height:var(--mdc-icon-size, 24px)}`;

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
let IconButton = class IconButton extends IconButtonBase {
};
IconButton.styles = [styles$1];
IconButton = __decorate([
    e$7('mwc-icon-button')
], IconButton);

/**
 * @license
 * Copyright 2021 Google LLC
 * SPDX-LIcense-Identifier: Apache-2.0
 */
const styles = i$3 `:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`;

/**
 * @license
 * Copyright 2018 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */
/** @soyCompatible */
let Icon = class Icon extends s {
    /** @soyTemplate */
    render() {
        return x `<span><slot></slot></span>`;
    }
};
Icon.styles = [styles];
Icon = __decorate([
    e$7('mwc-icon')
], Icon);

var badbad = "data:image/gif;base64, ";

var badmorph = "../demoasset/bad-morph-c2bb8f615fe93323.gif";

var land$1 = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20data-name%3D%22Layer%202%22%20viewBox%3D%220%200%201287.15%2038.21%22%3E%3Cg%20data-name%3D%22Layer%202%22%3E%3Cpath%20d%3D%22M1015.47%2032.86V16.23h6.44v16.63%22%20style%3D%22fill%3A%231d3ba9%22%2F%3E%3Cpath%20d%3D%22M1011.69%2017.09s-4.06%203.8-6.43.02c-2.37-3.79%201.02-3.57%201.02-3.57s-1.61-3.51.42-5.8%203.64-1.27%203.64-1.27-.76-3.81.93-4.4%203.21%201.52%203.21%201.52.68-3.93%203.3-3.57%203.05%203.66%203.05%203.66%202.37-1.95%204.06-.17%201.18%204.48%201.18%204.48%201.61-3.14%203.89-2.25%201.52%203.09%201.52%203.09%202.37%201.5%201.1%203.03-3.64%202.39-3.64%202.39%203.3.79%202.45%202.67-3.81%201.85-3.81%201.85l-2.37%201.14h-8.12s-3.38%201.43-4.23.5-1.18-3.34-1.18-3.34Z%22%20style%3D%22fill%3A%234db6ac%22%2F%3E%3Cpath%20d%3D%22M0%2038.21V8.39c11.13%201.08%2065.43%2017.4%2086.67%2016.08s47.4%205.28%2054%207.49%2030.36-4.19%2053.46-11.1S313.6%2031.73%20343.3%2031.95s28.38-5.5%2043.56-8.34%2057.42%205.47%2079.86%206.02%2059.14-6.02%2059.14-6.02c19.73-3.77%2032.73-14.57%2048.01-12.14s28.59%205.33%2042.72%205.86%2045.82-3.34%2053.74-5.86%2035.64-5.4%2043.56%200%2018.15%202.39%2035.64%2014.17c7.45%205.02%2034.65%206.35%2042.57%207.54s64.02.3%2069.3-1.24%2034.72-6.47%2043.1-5.98%2092.86%204.88%20107.39%205.98%2066.66-2.03%2089.76-2.12%2046.2-.31%2059.4%202.12c10.51%201.93%2025.61-.92%2036.33-2.2%201.3-.16%202.53-.35%203.69-.39%2033.98-1.17%2041.27%207.55%2049%204.27s13.53-7.51%2037.04-9.16V38.2H0Z%22%20style%3D%22fill%3A%230c2b77%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";

var castle$1 = "../demoasset/castle-alternate-7575ab637e5138e2.svg";

var demoCSS = i$3`
  /* Generic */
  ul.unstyled {
    padding: 0;
    margin: 0;
    list-style-type: none;
  }
  dl.unstyled,
  .unstyled dt,
  .unstyled dd {
    margin: 0;
    padding: 0;
  }
  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  legend,
  pre {
    font: inherit;
    margin: 0;
    padding: 0;
  }
  p,
  span {
    font-family: var(--mono);
  }
  /* Variables */
  #demo {
    /* Blues */
    --blue-10: 217.2, 100%, 88.6%;
    --blue-20: 217.4, 100%, 75.5%;
    --blue-30: 217.5, 100%, 63.3%;
    --blue-40: 214.1, 81.7%, 50.6%;
    --blue-50: 211.3, 100%, 41.4%;
    --blue-60: 214.4, 98%, 38.4%;
    /* Grays */
    --gray-10: 0, 0%, 93.7%;
    --gray-20: 0, 0%, 86.7%;
    --gray-30: 0, 0%, 74.9%;
    --gray-40: 207.3, 4.5%, 52.4%;
    --gray-50: 200, 4.3%, 41%;
    --gray-60: 204, 3.8%, 25.7%;
    /* Indigos */
    --indigo-60: 227.1, 70.7%, 38.8%;
    --indigo-70: 222.6, 81.7%, 25.7%;
    --indigo-80: 225.3, 76%, 14.7%;
    /* Purples */
    --purple-30: 266, 69%, 63.3%;
    --purple-40: 272.1, 62.3%, 40.6%;
    --purple-50: 269.2, 75.2%, 28.4%;
    /* Pinks */
    --pink-20: 321.6, 100%, 77.6%;
    --pink-30: 327.4, 83.3%, 62.4%;
    --pink-40: 323.9, 98.3%, 47.1%;
    --pink-50: 321.3, 92%, 39%;
    /* Greens */
    --green-20: 174.7, 41.3%, 78.6%;
    --green-30: 172.4, 51.9%, 58.4%;
    --green-40: 174.3, 41.8%, 50.8%;
    --green-50: 172.7, 60.2%, 37.5%;
    /* Custom Colors */
    --drawer-ditch: 230, 14%, 17%;
    --drawer-glow: hsl(227, 63%, 14%, 15%);
    --drawer-highlight: 240, 52%, 11%;
    --drawer-lowlight: 240, 52%, 1%;
    --drawer-surface: 240, 52%, 6%;
    --content-glow: 235, 69%, 18%;
    --content-gloam: 235, 69%, 18%;
    --content-surface: 227, 63%, 9%;
    --highlight-text: white;
    --lowlight-text: 218, 27%, 68%;
    --link-normal: 221, 92%, 71%;
    --link-focus: 221, 92%, 100%;
    /* Sizes */
    --bar-height-flex: var(--bar-height-short);
    --bar-height-short: 4.68rem;
    --bar-height-tall: 8.74rem;
    --bottom-castle: 24vh;
    --bottom-land: 10vh;
    --button-corners: 3.125rem;
    --content-width: calc(100vw - var(--drawer-width));
    --drawer-width-collapsed: 40px;
    --drawer-width: calc(var(--line-length-short) + var(--size-xhuge));
    --example-width: min(var(--line-length-wide), var(--content-width));
    --field-width: calc(var(--example-width) * 0.74);
    --line-length-short: 28rem;
    --line-length-wide: 40rem;
    --line-short: 1.4em;
    --line-tall: 1.8em;
    --size-colassal: 4rem;
    --size-gigantic: 5rem;
    --size-huge: 2rem;
    --size-jumbo: 3rem;
    --size-large-em: 1.26em;
    --size-large: 1.26rem;
    --size-micro: 0.28rem;
    --size-mini: 0.6rem;
    --size-normal: 1rem;
    --size-small: 0.8rem;
    --size-xgigantic: 6.26rem;
    --size-xhuge: 2.6rem;
    --size-xlarge: 1.66rem;
    /* Timings */
    --drawer-lapse: 100ms;
    --full-lapse: 300ms;
    --half-lapse: 150ms;
    --quick-lapse: 50ms;
    /* Fonts */
    --title: "Press Start 2P", sans-serif;
    --mono: "Roboto Mono", monospace;
    --sans-serif: "Roboto", sans-serif;
  }
  /* Links */
  a {
    color: hsl(var(--link-normal));
    text-decoration: none;
    vertical-align: bottom;
  }
  #guide a {
    font-weight: normal;
    text-decoration: underline;
    color: hsl(var(--lowlight-text));
  }
    color: hsl(var(--lowlight-text));
  }
  #guide a:focus mwc-icon,
  #guide a:hover mwc-icon,
  #guide a:hover,
  #guide a:focus,
  #guide a:active,
  #guide a:active mwc-icon a span {
    color: hsl(var(--link-focus));
  }
  a mwc-icon {
    --mdc-icon-size: var(--size-large-em);
    bottom: -4px; /* TODO: magic numbers */
    color: hsl(var(--link-focus));
    position: relative;
  }
  a,
  a span,
  a mwc-icon {
    transition: color var(--half-lapse) ease-out 0s,
      text-decoration var(--half-lapse) ease-out 0s,
      transform var(--half-lapse) ease-out 0s;
  }
  a span + mwc-icon,
  a mwc-icon + span {
    margin-left: var(--size-micro);
  }
  a:focus mwc-icon,
  a:hover mwc-icon,
  a:active mwc-icon {
    transform: scale(1.1);
  }
  a:focus,
  a:hover,
  a:active {
    color: hsl(var(--link-focus));
  }
  a:focus mwc-icon,
  a:hover mwc-icon,
  a:active mwc-con {
    color: hsl(var(--link-normal));
  }
  #sitemap a:focus,
  #sitemap a:hover,
  #sitemap a:active {
    color: var(--highlight-text);
  }
  #guide a:focus span,
  #guide a:hover span,
  #guide a:active span,
  #sitemap a:focus,
  #sitemap a:hover,
  #sitemap a:active {
    text-decoration: hsl(var(--link-focus)) dotted underline 1px;
    text-underline-offset: 2px;
  }
  /* Demo */
  :host {
    display: block;
  }
  :host,
  #demo {
    font-family: var(--sans-serif);
    font-size: var(--size-normal);
    height: 100%;
    min-height: 100vh;
    max-width: 100%;
    width: 100%;
    background-color: hsl(var(--drawer-surface));
  }
  #demo {
    color: var(--highlight-text);
    display: grid;
    grid-template-columns: var(--drawer-width) 1fr;
    grid-template-rows: 1fr;
    transition: grid-template-columns var(--drawer-lapse) ease-out 0s;
  }
  #demo.drawerClosed {
    /* TODO: redo for new drawer-peek layout, share variables */
    grid-template-columns: var(--drawer-width-collapsed) 1fr;
  }
  #demo.game {
    visibility: hidden;
  }
  #drawer {
    background: linear-gradient(
          to left,
          hsl(var(--drawer-ditch)) 1px,
          transparent 1px
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      radial-gradient(
          ellipse at left,
          hsl(var(--drawer-lowlight), 70%) -10%,
          transparent 69%
        )
        calc((100vw - (var(--drawer-width) / 2)) * -1) -150vh / 100vw 400vh no-repeat
        fixed,
      radial-gradient(
          ellipse at right,
          hsl(var(--drawer-highlight), 70%) -10%,
          transparent 69%
        )
        calc(var(--drawer-width) / 2) -150vh / 100vw 400vh no-repeat fixed,
      linear-gradient(
          to right,
          hsl(var(--drawer-lowlight), 20%) 0,
          transparent 50%
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to bottom,
          hsl(var(--drawer-lowlight), 30%) 0,
          transparent 50%
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to left,
          hsl(var(--drawer-highlight), 10%) 0,
          transparent 25%
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to top,
          hsl(var(--drawer-highlight), 10%) 0,
          transparent 50%
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to right,
          hsl(var(--drawer-lowlight), 80%) 2px,
          transparent 2px
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to bottom,
          hsl(var(--drawer-lowlight), 80%) 2px,
          transparent 2px
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to left,
          hsl(var(--drawer-highlight), 80%) 1px,
          transparent 1px
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      linear-gradient(
          to top,
          hsl(var(--drawer-highlight), 80%) 1px,
          transparent 1px
        )
        0 0 / var(--drawer-width) 100vh no-repeat fixed,
      hsl(var(--drawer-surface));
    border-right: 2px solid hsl(var(--drawer-ditch));
    box-shadow: 5px 0 9px 0 var(--drawer-glow);
    padding-bottom: 60px; /* TODO: offset for disclaimer */
    position: relative;
    z-index: 20;
  }
  #drawer > .drawerIcon {
    /* TODO: redo for new drawer-peek layout, share variables */
    --mdc-icon-size: var(--size-xlarge);
    inset: auto 0 auto auto;
    position: absolute;
    transition: opacity var(--half-lapse) ease-out 0s;
    z-index: 4;
    transform: translateX(50%) translateY(50vh);
    border: 2px solid #252731;
    background-color: hsl(var(--drawer-surface));
    border-radius: 40px;
    transition: 200ms ease-in-out;
  }
  .drawerOpen #drawer > .drawerIcon {
    transform: none;
    border: none;
    background: none;
  }
  #drawer > .drawerIcon[disabled] {
    --mdc-theme-text-disabled-on-light: hsl(var(--gray-40));
    opacity: 0.74;
  }
  .drawerClosed #drawer > .drawerCloseIcon {
    opacity: 0;
    transition-delay: 0;
  }
  .drawerOpen #drawer > .drawerCloseIcon {
    opacity: 1;
    transition-delay: var(--half-lapse);
  }

  #drawer .disclaimer {
    bottom: 0;
    color: hsla(var(--lowlight-text), 0.8);
    display: block;
    font-size: 0.6em; /* TODO: variable, font size accessibility */
    font-style: italic; /* TODO: dyslexia */
    font-weight: 100;
    line-height: 1.25; /* TODO: variable */
    padding: var(--size-xhuge);
    position: absolute;
    visibility: hidden;
    transition: none;
    opacity: 0;
  }
  .drawerOpen #drawer .disclaimer {
    visibility: visible;
    transition: 1000ms opacity;
    opacity: 1;
  }
  /* Content */
  #content {
    font-family: var(--mono);
    /* This transform may be required due to paint issues with animated elements in drawer
     However, using this also prevents background-attachment: fixed from functioning
     Therefore, background has to be moved to internal wrapper .sticky */
    /* transform: translateZ(0); */
  }
  #content .sticky {
    /* Due to CSS grid and sticky restrictions, have to add internal wrapper
     to get sticky behavior, centering in viewport behavior, and fixed background */
    position: sticky;
    top: 0;
  }
  .animating #content .sticky {
    overflow-y: hidden;
  }
  #content .relative {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    justify-content: safe center;
    position: relative;
  }
  #content .sticky,
  #content .relative {
    min-height: 100vh;
  }
  .drawerOpen #content .sticky {
    --offset: calc(50% + (var(--drawer-width) / 2));
    background-position:
    /* castle */ var(--offset) var(--content-bottom),
      /* land */ var(--offset) var(--land-content-bottom),
      /* pink */ var(--offset) 75vh, /* purple */ var(--offset) 50vh,
      /* blue */ var(--offset) var(--bar-height-short);
  }
  #content .sticky {
    --content-bottom: calc(100vh - var(--bottom-castle));
    --land-content-bottom: calc(100vh - var(--bottom-land));
    background: 
    /* castle */ url(${r$2(castle$1)}) center
        var(--content-bottom) / auto var(--bottom-castle) no-repeat fixed,
      /* land */ url(${r$2(land$1)}) center var(--land-content-bottom) /
        auto var(--bottom-land) no-repeat fixed,
      /* pink */
        radial-gradient(
          ellipse at bottom,
          hsl(var(--pink-40), 64%) 0,
          transparent 69%
        )
        center 75vh / 80vw 100vh no-repeat fixed,
      /* purple */
        radial-gradient(
          ellipse at bottom,
          hsl(var(--purple-30), 64%) 0,
          transparent 69%
        )
        center 50vh / 200vw 100vh no-repeat fixed,
      /* blue */
        radial-gradient(
          circle,
          hsl(var(--content-gloam), 56%) -20%,
          transparent 50%
        )
        center var(--bar-height-short) / 68vw 68vh no-repeat fixed,
      /* color */ hsl(var(--content-surface));
    transition: background-position var(--drawer-lapse) ease-out 0s;
  }
  /* Sitemap */
  #sitemap {
    /* TODO: redo for new drawer-peek layout, share variables */
    --map-bg-width: 240vw;
    --map-bg-height: 62vh;
    --map-bg-offset: 52vh;
    align-content: center;
    align-items: center;
    /* TODO: redo for new drawer-peek layout, share variables */
    background: 
      /* gradient */ radial-gradient(
          ellipse at bottom,
          hsl(0, 0%, 0%, 15%) 5%,
          hsl(var(--content-surface)) 58%
        )
        center var(--map-bg-offset) / var(--map-bg-width) var(--map-bg-height)
        no-repeat fixed,
      /* color */ hsl(var(--content-surface));
    box-sizing: border-box;
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto auto auto;
    font-family: var(--mono);
    justify-content: center;
    inset: var(--bar-height-flex) 0 0 0;
    margin-left: 0;
    padding: var(--size-huge);
    position: absolute;
    transition: transform var(--full-lapse) ease-out 0s,
      background-position var(--drawer-lapse) ease-out 0s,
      background-size var(--drawer-lapse) ease-out 0s,
      margin-left var(--drawer-lapse) ease-out 0s,
      padding-left var(--drawer-lapse) ease-out 0s;
    z-index: 10;
  }
  #sitemap .fade {
    margin: auto;
    max-width: var(--content-width);
    width: var(--example-width);
    transition: opacity var(--full-lapse) ease-in 0s;
  }
  .sitemapOpen #sitemap {
    transform: translateY(0);
  }
  .sitemapOpen #sitemap .fade {
    opacity: 1;
    transition-delay: var(--half-lapse);
  }
  .sitemapClosed #sitemap {
    transform: translateY(100%);
    pointer-events: none;
  }
  .sitemapClosed #sitemap .fade {
    opacity: 0;
  }
  .drawerOpen #sitemap {
    --stack-size: calc(var(--drawer-width) + var(--size-huge));
    /* TODO: redo for new drawer-peek layout, share variables */
    background-position: calc(50% + (var(--stack-size) / 2))
      var(--map-bg-offset);
    background-size: calc(var(--map-bg-width) - var(--stack-size))
      var(--map-bg-height);
    margin-left: calc(var(--drawer-width) * -1);
    padding-left: var(--stack-size);
  }
  #demo:not(.animating).sitemapClosed #sitemap {
    max-height: 0;
    max-width: 0;
    opacity: 0;
    z-index: -2;
  }
  #sitemap .links {
    display: grid;
    font-family: var(--title);
    gap: var(--size-huge);
    grid-template-areas: "game home signup" "game comments store" "game login .";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    margin-bottom: var(--size-gigantic);
    white-space: nowrap;
  }
  /* TODO: redo for new drawer-peek layout, updated queries
@media screen and (max-width: 32.8125em), screen and (max-width: 28.125em) {
  #sitemap .links {
    grid-template-areas: "game home" "login signup" "comments store";
    grid-template-columns: auto auto;
    grid-template-rows: auto auto auto;
    margin-bottom: var(--size-jumbo);
  }
}
@media screen and (max-width: 21.875em) {
  #sitemap .links {
    grid-template-areas: "game" "home" "signup" "login" "store" "comments";
    grid-template-columns: auto;
    grid-template-rows: auto auto auto auto auto auto;
    margin-bottom: var(--size-huge);
  }
}
*/
  #sitemap .h1,
  #sitemap p {
    line-height: var(--line-tall);
  }
  #sitemap .h1 {
    color: var(--highlight-text);
    font-size: var(--size-large);
    font-weight: bold;
    margin-bottom: var(--size-small);
  }
  #sitemap p {
    color: hsl(var(--lowlight-text));
    margin-bottom: var(--size-normal);
  }
  #sitemap .game {
    grid-area: game;
    /* TODO: ??? white-space: break-spaces; */
  }
  #sitemap .home {
    grid-area: home;
  }
  #sitemap .comments {
    grid-area: comments;
  }
  #sitemap .login {
    grid-area: login;
  }
  #sitemap .signup {
    grid-area: signup;
  }
  #sitemap .store {
    grid-area: store;
  }
  /* Bar */
  #bar {
    align-items: end;
    background: hsl(var(--content-surface));
    display: grid;
    gap: 0 var(--size-small);
    grid-template-areas: "h1 sitemapIcon" "h2 sitemapIcon";
    grid-template-columns: max-content auto;
    grid-template-rows: auto auto;
    justify-content: stretch;
    margin: 0 0 var(--size-huge) 0;
    padding: var(--size-small);
    position: sticky;
    top: 0;
    z-index: 30;
  }
  #bar .h1 {
    font-family: "Press Start 2P", monospace;
    font-size: var(--size-large);
    grid-area: h1;
  }
  #bar .h2 {
    color: hsl(var(--gray-40));
    font-size: var(--size-normal);
    grid-area: h2;
  }
  #bar .h2 abbr {
    text-decoration: none;
  }
  #bar .sitemapIcon {
    --mdc-icon-size: var(--size-xlarge);
    grid-area: sitemapIcon;
    justify-self: right;
  }
  /* Example */
  #example {
    box-sizing: border-box;
    margin: auto;
    max-width: var(--content-width);
    width: var(--example-width);
    padding: var(--size-jumbo) var(--size-jumbo)
      calc(var(--bottom-castle) * 0.75) var(--size-jumbo);
  }
  #example fieldset {
    margin-bottom: var(--size-jumbo);
    position: relative;
    z-index: 2;
  }
  #example .fields {
    margin: 0 auto;
    max-width: var(--content-width);
    width: var(--field-width);
  }
  #example .h3 {
    color: var(--highlight-text);
    font-family: var(--title);
    font-size: var(--size-xlarge);
    letter-spacing: 2px;
    line-height: var(--size-large-em);
    margin-bottom: var(--size-normal);
    text-transform: capitalize;
  }
  #example.home .h3 {
    font-size: var(--size-huge);
    text-transform: none;
  }
  #example .h3 {
    text-shadow: -2px -2px 0 hsl(var(--content-gloam)),
      2px 2px 0 hsl(var(--content-surface)),
      -2px 2px 0 hsl(var(--content-surface)),
      2px -2px 0 hsl(var(--content-surface));
  }
  #example p {
    color: hsl(var(--lowlight-text));
    line-height: var(--line-tall);
    margin-bottom: var(--size-huge);
    text-shadow: -1px -1px 0 hsl(var(--content-surface)),
      1px 1px 0 hsl(var(--content-surface)),
      -1px 1px 0 hsl(var(--content-surface)),
      1px -1px 0 hsl(var(--content-surface));
  }
  #example p:last-of-type {
    --negative-size: calc(var(--size-colassal) * -1);
    background: linear-gradient(
          90deg,
          transparent 0%,
          hsl(var(--content-gloam)) 15%,
          hsl(var(--content-gloam)) 30%,
          hsl(var(--content-glow)) 50%,
          hsl(var(--content-gloam)) 70%,
          hsl(var(--content-gloam)) 85%,
          transparent 100%
        )
        center bottom / 100% 1px no-repeat scroll,
      radial-gradient(
          ellipse at bottom,
          hsl(var(--content-gloam), 36%),
          transparent 70%
        )
        center bottom / 100% 50% no-repeat scroll,
      transparent;
    margin: 0 var(--negative-size) var(--size-jumbo) var(--negative-size);
    padding: 0 var(--size-colassal) var(--size-large);
  }
  #example.home p:last-of-type {
    background: none;
    border: 0;
    margin-bottom: var(--size-jumbo);
    padding-bottom: 0;
  }
  /* Form */
  fieldset {
    border: 0;
    display: block;
    margin: 0;
    padding: 0;
  }
  legend {
    display: block;
    font: inherit;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  label {
    display: block;
  }
  label {
    font-weight: bold;
    letter-spacing: 0.5px;
    line-height: 1;
  }
  label:not(:last-child) {
    margin-bottom: var(--size-xlarge);
  }
  label > span {
    display: block;
    margin-bottom: var(--size-small);
  }
  input,
  textarea {
    background: hsl(var(--gray-60));
    border: 0 solid transparent;
    border-radius: 2px;
    box-sizing: border-box;
    color: inherit;
    display: block;
    font-family: var(--sans-serif);
    line-height: 1;
    margin: 0;
    padding: var(--size-small);
    width: 100%;
  }
  textarea {
    line-height: var(--line-short);
    min-height: calc(var(--line-short) * 6);
  }
  /* Guide */
  #guide {
    color: hsl(var(--lowlight-text));
    overflow: hidden;
    transform: translateZ(0);
    width: 100%;
    font-size: var(--size-small);
  }
  .mask {
    transition: opacity var(--half-lapse) ease-out 0s;
    width: var(--drawer-width);
  }
  .drawerOpen .mask {
    opacity: 1;
  }
  .drawerClosed .mask {
    opacity: 0;
  }
  #guide .h1,
  #guide .h2 {
    color: var(--highlight-text);
    font-size: var(--size-large);
    font-weight: bold;
  }
  #guide .h1 {
    border: 0 solid hsl(var(--drawer-ditch));
    border-width: 2px 0;
    font-size: var(--size-md);
    letter-spacing: 3px;
    line-height: 1;
    padding: var(--size-small);
    text-transform: uppercase;
  }
  #guide .text:first-child .h1 {
    border-top-color: transparent;
  }
  #guide .h2 {
    line-height: var(--size-large-em);
    margin-bottom: var(--size-mini);
  }
  #guide p {
    color: hsl(var(--lowlight-text));
    line-height: var(--line-short);
    max-width: var(--line-length-short);
  }
  #guide a,
  #guide code,
  #guide pre {
    display: block;
  }
  #guide .h1,
  #guide .text.result {
    margin-bottom: var(--size-huge);
  }
  #guide .text,
  #guide #label + .scoreExample {
    margin-bottom: var(--size-xhuge);
  }
  #guide p,
  #guide .code {
    margin-bottom: var(--size-normal);
  }
  #guide .h2,
  #guide p,
  #guide a.documentation {
    padding: 0 var(--size-xhuge);
  }
  #guide .code {
    /* TODO: code block background color */
    color: var(--highlight-text);
    background: hsl(0, 0%, 100%, 5%);
    margin: 0 var(--size-xhuge) var(--size-xhuge);
    padding: var(--size-small) var(--size-normal);
    margin-bottom: var(--size-large);
    position: relative;
  }
  #guide a.log {
    padding: var(--size-small) var(--size-huge);
  }
  #guide a.log.disabled {
    display: none;
  }
  /* Guide Score */
  #score {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--size-huge);
    margin: 0 var(--size-gigantic) var(--line-short);
    padding-top: var(--size-micro);
    padding-bottom: var(--size-xhuge);
  }
  #score p {
    margin-bottom: 0;
    padding: 0 var(--size-small);
  }
  #score .score {
    display: flex;
    flex-direction: column;
    gap: var(--size-small);
    line-height: 1;
  }
  .score {
    color: hsl(var(--link-normal));
    font-family: var(--sans-serif);
    font-size: var(--size-jumbo);
    font-weight: bold;
    line-height: 1;
    text-indent: -0.1em;
  }
  #score img {
    height: calc(var(--size-jumbo) * 1.35);
    width: auto;
  }
  /* Store Cart */
  dl.cart {
    --stoplight-accent: 13px;
    margin-bottom: var(--size-jumbo);
  }
  .cart .item {
    display: flex;
    align-items: top;
    justify-content: space-between;
    margin-bottom: var(--size-xlarge);
  }
  .cart img {
    height: auto;
    width: 50px;
  }
  .cart .stoplight img {
    margin-top: calc(var(--stoplight-accent) * -1);
  }
  .cart dt {
    flex: 0 0 var(--size-gigantic);
    margin-right: var(--size-xlarge);
    padding-top: var(--stoplight-accent);
  }
  .cart dd:not(:last-child) {
    flex: 1 0 auto;
    margin-top: calc(
      var(--size-normal) + var(--stoplight-accent) + var(--size-small)
    );
  }
  .cart dd:last-child {
    flex: 0 0 var(--size-gigantic);
  }
  /* Guide Animation */
  @keyframes scoreBump {
    from {
      transform: scale(1) translate(0, 0);
    }
    to {
      transform: scale(1.14) translate(-2%, 0);
    }
  }
   @keyframes drawerBump {
    70% { transform:translateX(0%); }
    80% { transform:translateX(17%); }
    90% { transform:translateX(0%); }
    95% { transform:translateX(8%); }
    97% { transform:translateX(0%); }
    99% { transform:translateX(3%); }
    100% { transform:translateX(0); }
  }
  #score {
    animation: var(--full-lapse) ease-out 0s 2 alternate both running scoreBump;
    transform-origin: left center;
  }
  .unscored #score, .draweropen.scored:not(.drawerClosed) {
    animation-play-state: paused;
  }

  .scored #score, .drawerClosed.scored #drawer,  .drawerClosed.scored:not(.drawerOpen)  {
    animation-play-state: running;
  }

 #drawer {
    animation:  .5s ease-out 0s 2 alternate both paused drawerBump;
  }
  #guide .response,
  #label p,
  .scoreExample {
    transition: max-height var(--full-lapse) ease-out var(--half-lapse),
      opacity var(--full-lapse) ease-out var(--half-lapse);
  }
  .unscored #guide .response,
  .unscored .scoreExample {
    max-height: 0;
    opacity: 0;
  }
  .scored #guide .response,
  .scored #label p,
  .scored .scoreExample {
    opacity: 1;
  }
  /* Slotted Checkbox */
  ::slotted(div.g-recaptcha) {
    display: flex;
    justify-content: center;
    margin: 0 auto var(--size-xhuge);
    position: relative;
    z-index: 1;
  }
  /* Slotted Button / Button */
  .button {
    margin-bottom: var(--size-jumbo);
  }
  ::slotted(button),
  .button {
    appearance: none;
    background: transparent /* hsl(var(--blue-50)) */;
    border: 0;
    border-radius: 0;
    color: var(--highlight-text);
    cursor: pointer;
    display: inline-block;
    font-family: var(--title);
    font-size: var(--size-small);
    line-height: var(--size-large-em);
    margin: 0 auto var(--size-xlarge);
    outline: 0;
    padding: var(--size-normal) var(--size-huge);
    position: relative;
    text-transform: uppercase;
    width: 100%;
    z-index: 0;
  }
  .button {
    width: auto;
  }
  /* Button Animation */
  ::slotted(button),
  .button,
  ::slotted(button)::after,
  .button::after,
  ::slotted(button)::before,
  .button::before {
    /* TODO: timing variables? */
    transition: border 50ms ease-out 0s, border-radius 50ms ease-out 0s,
      background 100ms ease-in-out 50ms, box-shadow 150ms ease-out 50ms,
      outline 50ms ease-out 0s, text-shadow 50ms ease-out 0s;
  }
  /* Button Layers */
  ::slotted(button)::after,
  .button::after,
  ::slotted(button)::before,
  .button::before {
    content: "";
    display: block;
    position: absolute;
    z-index: -1;
  }
  /* Button Text */
  ::slotted(button),
  .button {
    text-shadow: 2px 2px black;
  }
  /*
::slotted(button:focus),
.button:focus,
::slotted(button:hover),
.button:hover,
::slotted(button:active),
.button:active {
  text-shadow: black 2px 2px, hsl(var(--gray-50)) 4px 4px;
}

*/
  /* Button Shape */
  ::slotted(button)::before,
  .button::before {
    /* Round Glow Shape */
    border-radius: 100%;
    inset: 0 25%;
  }
  ::slotted(button),
  .button,
  ::slotted(button)::after,
  .button::after {
    /* Normal Shape */
    border-radius: 1px;
  }
  ::slotted(button:focus),
  .button:focus,
  ::slotted(button:focus)::after,
  .button:focus::after,
  ::slotted(button:focus-visible),
  .button:focus-visible,
  ::slotted(button:focus-visible)::after,
  .button:focus-visible::after,
  ::slotted(button:hover),
  .button:hover,
  ::slotted(button:hover)::after,
  .button:hover::after,
  ::slotted(button:active),
  .button:active,
  ::slotted(button:active)::after,
  .button:active::after {
    /* Focus/Hover/Active Shape */
    border-radius: var(--button-corners);
  }
  /* Button Background */
  ::slotted(button)::after,
  .button::after {
    /* background: hsl(var(--blue-40)); */
    background: hsl(var(--pink-40));
    inset: 0;
  }
  ::slotted(button:active)::after,
  .button:active::after {
    /* background: hsl(var(--blue-50)); */
    background: hsl(var(--pink-50));
  }
  /* Button Border */
  ::slotted(button)::after,
  .button::after {
    border: 1px solid transparent;
  }
  ::slotted(button:focus)::after,
  .button:focus::after,
  ::slotted(button:hover)::after,
  .button:hover::after {
    /* Focus/Hover Border */
    border-bottom: 1px solid rgba(0, 0, 0, 30%);
    border-right: 1px solid rgba(0, 0, 0, 30%);
    border-top: 1px solid rgba(255, 255, 255, 20%);
    border-left: 1px solid rgba(255, 255, 255, 20%);
  }
  ::slotted(button:active)::after,
  .button:active::after {
    /* Active Border */
    border-bottom: 1px solid rgba(255, 255, 255, 20%);
    border-right: 1px solid rgba(255, 255, 255, 20%);
    border-top: 1px solid rgba(0, 0, 0, 30%);
    border-left: 1px solid rgba(0, 0, 0, 30%);
  }
  ::slotted(button:focus-visible)::after,
  .button:focus-visible::after {
    /* Focus Outline */
    /* outline: 2px solid hsl(var(--blue-30)); */
    outline: 2px solid hsl(var(--pink-30));
    outline-offset: 4px;
  }
  ::slotted(button:hover)::after,
  .button:hover::after,
  ::slotted(button:active)::after,
  .button:active::after {
    outline: none;
  }
  /* Button Shadow */
  ::slotted(button:focus)::after,
  .button:focus::after,
  ::slotted(button:hover)::after,
  .button:hover::after {
    /* Focus/Hover Square Glow */
    box-shadow: 1px 2px var(--size-jumbo) 2px hsl(var(--blue-50), 32%);
  }
  ::slotted(button:active)::after,
  .button:active::after {
    /* Active Square Glow */
    box-shadow: 1px 2px var(--size-jumbo) 2px hsl(0, 0%, 0%, 10%);
  }
  ::slotted(button:focus)::before,
  .button:focus::before,
  ::slotted(button:hover)::before,
  .button:hover::before {
    /* Focus/Hover Round Glow */
    box-shadow: 2px 2px var(--size-xgigantic) 20px hsl(var(--blue-50), 32%);
  }
  ::slotted(button:active)::before,
  .button:active::before {
    /* Active Round Glow */
    box-shadow: 2px 2px var(--size-xgigantic) 20px hsl(0, 0%, 0%, 10%);
  }
`;

var human = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2049.58%2052.28%22%3E%3Cpath%20d%3D%22M35.73%2019.14c0-7.23-4.9-13.09-10.94-13.09s-10.94%205.86-10.94%2013.09c0%204.85%202.2%209.08%205.48%2011.34l.99%207.29s3.14%207.01%204.48%206.99c1.37-.02%204.51-7.22%204.51-7.22l.96-7.05c3.27-2.26%205.47-6.49%205.47-11.34Z%22%20style%3D%22fill%3A%2382b1ff%3Bopacity%3A.98%22%2F%3E%3Cpath%20d%3D%22M45.7%2024.85s-4.55-7.24-5.23-9.94C38.48%206.9%2033.45%200%2024.79%200c-.23%200-.46%200-.68.02-.2%200-.39.02-.58.04h-.05C15.62.72%2010.99%207.31%209.1%2014.91c-.67%202.7-5.23%209.94-5.23%209.94%202.22%204.21%207.42%208.42%2015.98%209.6l-.54-3.97c-3.1-2.15-5.24-6.06-5.46-10.6.37-10.43%2015.92-6.25%2017.76-10.96%202.5%202.4%204.1%206.08%204.1%2010.22%200%204.85-2.2%209.07-5.47%2011.34l-.54%203.97c8.56-1.18%2013.76-5.39%2015.98-9.6Z%22%20style%3D%22fill%3A%230c2b77%22%2F%3E%3Cpath%20d%3D%22m49.58%2052.28-6.45-11.49-7.37-1.35-6.21-3.75-.25%201.85s-3.14%207.2-4.51%207.22c-1.33.02-4.48-6.99-4.48-6.99l-.28-2.08-6.21%203.75-7.37%201.35L0%2052.28%22%20style%3D%22fill%3A%231a73e8%22%2F%3E%3C%2Fsvg%3E";

var hydrant$1 = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2059.7%2059.7%22%3E%3Cpath%20fill%3D%22%23448aff%22%20d%3D%22M.6.3h58.5v58.5H.6z%22%2F%3E%3Cg%20fill%3D%22%231a73e8%22%3E%3Cpath%20d%3D%22M30%206.4c.3%200%20.5%200%20.6-.2l.2-.3h.4l-.2-.4c.2%200%20.3.4.7%200l-.5-.8c-.1-.3-.3-.5-.3-.8s-.1-.5-.4-.6c-.3%200-.7-.1-.9.3l.5.6c0%20.3-.3.3-.5.4l-.1-.2c-.3%200-.4.2-.5.4V5h-.1l-.2.7-.7-.5c0-.3-.1-.5-.4-.5h-.4v.5l-.4.7c.5.4.8%201%201.6%201l.4-.6.5.2-.2.1c0%20.4.1.6.5.8.2-.3.5-.5.4-.9zm-4.3-4.9c.3%200%20.6-.1.8-.4L27%201h.3-2.6l.4.5c.2.2.4%200%20.7%200zM27%202.8l1.3.7c.5.2.7-.4%201.3-.3l-1-1H28l-.8.2c0-.4.4-.5.4-.8-.4-.2-.8-.3-1.2%200%200%20.2-.3.2-.4.3.3.8.5%201%201.2%201zm-5%203.8c.2%200%20.4%200%20.5-.3l.1-.2H24V4.7h-.6l-.4-.4-.8%201.5H22l-.3.4c0%20.2.2.3.4.4zm7%202.5c-.4%200-.8-.2-.9-.8%200-.3-.2-.5-.6-.4%200%20.1-.1.3%200%20.4l-.4.2c0%20.3.1.5.4.7l.3-.4.1.1v.6l.4.2-.2.7c.8.3.8.3%201.4-.4l-.3-.2-.3-.2.7-.3L29%209zM16%204.9c.5-.2.8-.5.7-1-.2-.5-.1-1-.2-1.5-.6-.2-.6.3-.8.6l.6.3c-.5.4-.8%201-.4%201.6zm21.8%2016.9.5-.4h-.4l.1-.6c0-.2-.1-.3-.3-.3l-.1-.4-.7-.4c-.3.3-.2.6-.1.8l.5.2v.6h-.1v.7h-.6c0%20.5.3.8.8%201%20.4-.3%200-.5%200-.9.2%200%20.3-.2.4-.3zm-7.8-6c.2-.2.2-.5.1-1-1.2.2-1.4.4-1%201.3.4.2.7%200%201-.3zm.8%203.2c.4-.2%200-.7.3-1-1.3.1-1.4.3-1.1%201.3.3.1.6%200%20.8-.2zM21.4%207.5l.4-.4h-.4c0-.5-.2-.9-.3-1.3l-.6-.3c-.4.2-.2.5-.2.8l.8.2-.3.6.5.5zm3.3-4.7.2.4.1-.3h.3v-.7c-.8-.6-.6-.6-1.3-.3%200%20.7.1.8.7%201zM21%204.4l1.1-1.2c0-.4-.4-.4-.7-.5-.7.8-.8%201-.3%201.7zm-5.9%202.9c.8-.5.8-1%200-1.4-.7.8-.6%201%200%201.4zm5.5-4%20.2-.6h-.6c-.2-.3%200-.7-.5-.6v1.3l.9-.1z%22%2F%3E%3Cpath%20d%3D%22M29.2%201.4c0-.3-.2-.4-.6-.4-.3%200-.6.3-.4.7%200%20.2.3.4.5.6.5-.3.6-.5.5-.9zM54.6%2026zM26.9%203.7l.4.4c.1.1.3%200%20.4-.2%200-.3%200-.5-.2-.5-.4%200-.5-.4-.7-.6%200%20.2-.3.3-.2.4v.2l-.5-.1h-.5s-.2.3-.1.4.2.3.4.3h.7l.3-.3zm22.8%2021.1c.2.3.4.4.7.4v.2c.5-.3.5-.3.2-.6v-1c-.7%200-.5.8-.9%201zM12.6%202c-.5.4-.7.8-.4%201.5.8-.3.9-.7.4-1.5zM26%209.2c.1.1.3%200%20.4-.3-.5-.2-.6-1-1.3-1%200%20.7.5%201%20.9%201.3zm21.3%2015%20.6.1.1.4.8.1c.1-.9%200-1-1-.9v-.4l-.2.2-.1-.3c-.5.1-.7.4-.6%201l.4-.2zm5.1%201.1q-.4.7.2%201c.6-.4.6-.6-.2-1zM21%201.8v-.4l-.4-.5h-.4c-.2.1-.3.4-.4.6.4.4.8-.1%201.2.2zM18.1%204c.1-.3-.2-.4-.4-.6q-.6.5-.1%201c.3%200%20.5%200%20.5-.3zm23.2%2015.4s-.2.3-.1.4c0%20.2.2.3.4.3s.3-.2.3-.4V19c-.2.2-.2.5-.6.5zm6.2%202.8c-.4%200-.7%200-.8.2l-.6-.3q.2.4.1.8c.2%200%20.2-.1.3-.2v.1c.6.3.8.2%201-.6zM30.2%202s.2%200%20.3-.2v-.5c-.2-.2-.4-.1-.6%200l-.4.1c-.2.2-.2.4%200%20.6.1.3.4.1.7%200zm1.3%2011-.8.1-.2.4.2.2c.2.1.3%200%20.3-.1%200%200%20.2-.1.2%200%20.4%200%20.2-.3.4-.4v-.1zm1.9-.6c.5%200%20.5-.4.7-.6-.3-.3-.6-.3-.9-.2l.2.8zM22.1%201.7c.3-.2.2-.5.2-.8h-.7c-.1.5.3.6.5.8zM27%207c.2%200%20.4%200%20.6-.2l-.4-.3h-.4s-.1.3%200%20.4l.3.2zm-2.2%204c.2.3.4.5.6.5v.5c.6%200%20.7-.1.6-.4l-.1-.2.4-.6q-.9-.5-1.5.2zm4-3.6c-.2%200-.4%200-.5.2%200%20.2.2.4.4.4l.7-.2-.6-.4zM17%208.3v.2c.1.2.4%200%20.5-.2v-.2c-.1-.2-.4-.1-.6.2zM30.7%2010h.8l-.2-.7-.6.6zm.4%205.5c.2.2.4%200%20.4-.1v-.5l-.4.2.1-.2s-.1-.1-.1%200l-.2.2h.1l.1.4zm-5.3-9.4v.2l.1.1c.3%200%20.5-.2.6-.5-.4-.2-.6%200-.8.2zM24%204c-.1.4.2.5.5.7.1-.5-.1-.6-.4-.8zm11%2017.5q.5%200%20.5-.6a.9.9%200%200%200-.6.6zM23.1%201h.2-.2zm-8.2%203.5c-.3.1-.4.4-.4.7.5-.2.6-.4.4-.7zm8.3-2.2q-.4.2-.3.6l.3-.6zm20.1%2019.5h.5c.1%200%20.2%200%20.3-.2l-.3-.1-.6.3zm5.1%201.2q0%20.4.4.7c0-.3%200-.7-.4-.7zM25%209c-.2-.3-.4-.3-.7%200%20.3.2.5.2.7%200zm15.4%206.3c.3-.5%200-.5-.3-.6l-.2.4.5.2zm-.3-.6zM29.8%208.6q.2%200%20.4-.4l-.5-.4q.2.5%200%20.9zm1.6-7.1zm.1.6-.1-.6-.4.2.5.4zM41.6%2013l.2.7.2-.1c0-.3-.1-.5-.4-.6zM28.9%208.5v.2l.4.1v-.3h-.4zm-5.7.1h.3l.4-.1c-.3-.3-.5-.2-.7.1zm10.6%207.7-.1.2.1.4q.2-.3%200-.6zm7.7%204.3.4.3q0-.4-.4-.3zM33%2017v-.4c-.6%200-.6.4-.9.7l.6.3-.5.7-.3.3c0%20.2%200%20.6.2.7l.8-.1v-.3c.2-.2.3-.4.2-.7-.2-.4-.1-.7-.1-1.1l.3.4c.3-.3%200-.4-.3-.4zM14.7%201h-.1zm27.7%2018.9c.2.2.4.2.6.2-.1-.2-.3-.3-.6-.2zm.6.2zM22.3%204.2v-.3H22v.3h.3zM34.4%2013h.2v-.3h-.3v.3zm23.7.2c-.2%200-.2.2%200%20.4l.2-.3-.2-.1zm.4.8c-.1%200-.3-.1-.5.1h.5zm0%20.1zm.3%2018.9v-4.6l-1%20.2c-.4.5.4%201%200%201.6l-.4-.1-.4.5-.8-.5c-.3.2%200%20.6-.3.8l-.3.2c-.2%200-.3-.2-.5-.4l.4-.2c.2-.1.2-.3%200-.4l-.6-.3h.7c.1-.7.1-.7-.4-.8l-.6-.2.2.2c.3.2.2.4%200%20.6%200%200-.3.1-.4%200a1%201%200%200%200-.9%200h-.1c-.5-.3-.7-.2-.8.3l-.2.2c0%20.5-.4.8-.4%201.4l1%20.1-.2-.4q.5-.3.1-1.1l.6-.1c.3.8.5%201%201.3.7l.8%201%201.5-.4c0%20.4-.2.6-.3%201l.7.4c.5-.1.9-.4%201-1%20.2.2.3.3.2.4a1%201%200%200%200%20.1.9z%22%2F%3E%3Cpath%20d%3D%22m43.2%2021.2.3.2.4-.2c.2%200%20.3%200%20.5-.2l.5.1V21l.1.2%201-.4h.1c.3-.2.6%200%20.9-.2l.6-.2.3-.4-.5-.1v-.2c.2%200%20.4.4.7%200l-.2-.3.3-.3v.3h.7v.6l-.6.3c-.2%200-.4%200-.5.2l-.1-.1c-.1.5-.1.5-.6.9l.6-.1.2-.2v.2l.2-.3h.4v.4c.3-.1.6-.1.8%200H49l.4.4q-.3.8.2%201.2c0%20.2-.2.4-.4.6.5.2.6.1.7-.5.6%200%201-.6%201.7-.5l.2-.2v.4h.1v.7l.6.2v.2c0%20.3.2.5.5.5l.3-.1c.2.5%200%20.8%200%201.1-.2.4-.2.8.2%201H53l-.2.6-.3-.5-.3.5c.6.2%201%20.4%201.3%201l-.3.4c-.4.1-.4%200-.4.6l.6.3.2-.1v-.5h.7c.1-.5.2-1%200-1.3v-.6L55%2028h.4c.8.3%201%20.2%201.5-.4.2-.2.4-.4.4-.6l.1-.3.4-.2.3.1c.2%200%20.5%200%20.6-.4-.2-.1-.2-.4-.4-.6.2%200%20.3-.2.3-.4l.2.1V24l-.1.2v-.4l.1-.1v-2.5c-.5.1-1.1-.2-1.6.2l-.8.6-.1-.4-.4.4h-.1l-.1-.5-.2-.3c.4%200%20.7.2%201%20.4v-.5l.5-.2c0%20.1.1.2.3.2%200-.2-.2-.2-.3-.3l-.5-.4-.2.2.1-.5.7.5c-.1-.3.2-.4.3-.6.3%201%20.4%201%201%20.7l-.1-.5.2.3c.3-.5%200-.7-.2-1-.3.1-.6%200-1-.1l.1-.3c.2%200%20.3.1.3.2.1.3.5.2.6%200l.5-.2v-6.3.5l-.3.8.2.2v.1c0%20.4-.4.7-.4%201l-.1.1-.1-.1-.1-.1v-.4l.1-.3c-.1-.6-.6-.4-1-.5l.4-.6.2-.3-.4-.5h.8l.4-.3-.8-.2-.1-.7-.4.2-.2-.7v-.1c.3.1.5%200%20.6-.2h.2l.5.7a33.4%2033.4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201-.3Zm.2%205.2v-.6c.4.2.2.4%200%20.6Zm-.9-6.4h.4V9l-.4.3v-.5ZM41.8%205c.2-.3.5-.2.8-.4l-.1.3.2.2-.4.2c-.3%200-.5%200-.7-.2h.2Zm.4%201.9h-.4l.1-.6.5.1v.2h-.2V7Zm-.8%201.7.2-.1c.4%200%20.8%200%201-.6%200-.1.2-.3.4%200v.5c-.2%200-.4%200-.6.2a1%201%200%200%201-.5.2h-.2l-.2.1c0%20.5%200%20.7-.2.9-.1%200-.3%200-.5-.2.7-.1.4-.7.6-1Zm.6%209v-.1h.1Zm1.7-3.7-.9.2-.4-.8-.5.4h-1l-.4-1%20.7-.5.5.1c.5-.2.3-1.2%201.2-1v.6l.1.1v.3c0%20.2%200%20.5-.2.8.4%200%20.7-.1%201%20.2h.4v.8l-.2.2-.3-.3Zm2.5%202.6-.4-.4-.2.5-.2.2-.4-.3h-1l-.2-.3.2-.4h-.2l.9-.4-.2.4c-.1.1-.3.1-.4.4l.2.2.5-.1.3.2c.3-.2.5-.3.5-.5l.5-.5v-.3h.1l.4.2c-.1%200-.3.1-.3.3-.2.1-.2.3%200%20.5h.1l-.2.3Zm.2%201%20.3-.8c0%20.3%200%20.5.2.8l.5-.3.2-.4a7.8%207.8%200%200%201%20.4.6v.1c-.3.3-.2.8-.6%201v-.3c0-.4-.2-.6-.5-.7h-.5ZM29.2%201h.5-.5Z%22%2F%3E%3Cpath%20d%3D%22M34.7%201.4V.9h-4.1l.2.4.3-.3c-.1.2%200%20.4.3.5v-.2l.5.3-.2.8c0%20.5-.2%201%20.1%201.4v1.4l.6-.1c-.2.2-.1.5%200%201v.3s-.2.1-.2%200h-.3l.2-.3c-.3%200-.6-.1-.8.2-.1.1%200%20.3%200%20.4l-.1.4c-.1.2-.4.3-.6.4l-.5.3c.4.2.7.4%201%20.1h.4c.1.6.3.7%201%20.8V8h.3c0%20.3%200%20.4.4.7l-.4.6c.5.1.5.1.7-.5.3%200%20.5-.2.8-.3l.1.5.6-.8h.2l.2-.2.2.1.2-.5.2-.2h.6c0-.6.7-1%20.6-1.7%200-.2-.2-.4-.4-.4H36l-.3.4v-.2c-.3%200-.2.2-.2.3-.3-.1-.6-.2-1%200l.2-.2c.4%200%20.6-.3.7-.7%200%200%20.2-.1.2-.3v-.2q-.4-.4-.1-1c.2%200%20.4%200%20.4.4%200%20.3.2.5.5.6.2-.2.2-.4%200-.6.1-.4.7-.3.6-.7l-.5-.5c0-.3%200-.5.4-.7.5-.1.5-.2.9-.8-.3%200-.5%200-.7-.2H35c0%20.2%200%20.3-.2.5Zm1%204.4h.1Zm0%200h.1v.3-.2Zm0%20.2c0%20.2-.1.3-.2.3%200%200%200-.2.2-.3Zm-.7.7h.3c.2%200%20.3.2.2.3l-.3.2H35v-.5Zm-.9-1.2.4.2-.4.2v-.4ZM33%207v-.3l.1.2-.1.1Zm-.3-4.7.4-.9q.5.3.7%201.1l-.7.2-.4-.4Zm.5%201.9.3-.3c.3%200%20.4.2.5.5-.4%200-.6%200-.8-.2Zm1.5%202.7h-.2c-.2%200-.2.7-.7.3l-.2-.7c.4%200%20.8%200%201.1.4Zm.7-4.7.8.2.1-.3c.3.3.2.4-.3.8l-.6-.3v-.4Zm-.2%202a.7.7%200%200%200-.6-.1l.3-.3.3.3Zm23.6%208.1v-1%20.2c-.3.4-.3.6%200%20.8ZM52.8%201h-.2l.1.1.1-.2Zm6%2019.5v-1%201Zm-9.4-5.9Zm-4%2012.2V28c.8%200%201-.2.8-1v-.6l.3.1c.3-.3.4-.5.2-.7l.5-.3q-.5-.4-1-.1c0-.1%200-.2-.2-.3l-.4.5-1.3-.6v.4c-.2.4-.5.8-.5%201.1%200%20.3.4.6.6%201%20.4%200%20.7-.1%201-.6ZM34.4%209Z%22%2F%3E%3Cpath%20d%3D%22M34.2%209.8c0%20.2%200%20.5-.2.7v.2h-.1l-.1.6c.4%200%20.5-.3.7-.5l.4.2h.1c.3.2.4.4.5.7l.3.3c.2-.4%200-.8%200-1.2h.2l-.1-.3v-.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-.4%200-.4-.3-.5-.6l-.3.3-.4-.4v.5a1%201%200%200%200-.4.5c-.4-.3-.4-.3-.8%200l-.3-.3-.4.5-1.3-.6v.4l-.5.9c0-.3-.1-.5-.4-.7-.2-.1-.5%200-.8.2l.4.7h.8c0%20.3.4.6.6%201%20.3%200%20.7-.1%201-.6v1.1c.8%200%201-.2.8-1%200-.8.2-1.2.9-1.5v1c0%20.3.3.6.8.7v-.2c.2.3.4.5%201%20.4%200%20.3%200%20.6.2.8h-.2c0%20.6%200%20.6-.5.7%200%20.3.1.5.5.5.3%200%20.2-.3.3-.5l.6.6c.4-.2.5-.5.4-1V14c.3.1.4%200%20.6-.3.3.1.6.1.8.3l.5-.4h.2zm-2.6.4zm21.2%2021c0-.1-.1-.2-.3-.2s-.4%200-.4.2l-.1%201.3H53c0%20.5.3.8.8%201%20.4-.3%200-.6%200-.9.6-.3.5-.8.6-1.3zM19.6%201h.2-.8.6zm32.6%2023c0-.2-.3-.4-.5-.2s-.3.1-.6%200c0%20.5-.2%201%20.3%201.5l1-.2-.2-1.1zm-5.7%206v-.9l-.4.1c0-.2-.1-.4-.5-.7-.2.3-.2.6%200%20.9-.3.1-.3.4-.1%201%20.4.2.7%200%201-.3zm-.1%203.5c.3.2.6%200%20.8-.1.5-.3.1-.8.3-1.2-1.3.2-1.4.4-1%201.3zM31.5%2021.6c.8-.5.8-1%200-1.4-.6.8-.6%201%200%201.4zm17.2.1-.8.2c.1.9.2%201%201%201%20.3-.4-.2-.8-.2-1.2zm-20.1-3.9c.8-.3%201-.7.5-1.5-.6.4-.7.8-.5%201.5zm19.8%2015.1c-.1.2%200%20.6.2.6h.7v-1c-.4.1-.8%200-1%20.4zm-5.5-9.8c-.3%200-.4-.2-.5-.4l.1-.3-.3.2a1%201%200%200%200-.5-.4c0-.5%200-.6-.6-.8%200%20.6%200%20.7.4.9%200%20.5.6.8%201%201.1%200%20.2.2%200%20.4-.3zM56.4%2032l-1.1%201.3h1c.2-.4.4-.7%200-1.2zM33.3%2017.5l.2.3h.4c-.3.4-.3.5.1%201%20.3%200%20.5-.2.6-.5%200-.2%200-.3-.2-.5.1%200%20.3%200%20.4-.2-.5-.4-1-.3-1.5%200zM58%2034.4c.2%200%20.3-.2.3-.4v-.8c-.1.1-.2.4-.6.5%200%200-.1.3%200%20.4l.3.3zm-8.3-2.6.2.3h.8l.5-.2c-.5-.4-1-.3-1.5-.1zM48%2027.4h-.8l-.2.4.1.2c.2%200%20.3%200%20.4-.2h.2c.3%200%20.2-.2.3-.3v-.1zm10.2%209.2c0-.7%200-.8-.7-.9%200%20.6%200%20.6.7%201zM24%207c-.2-.2-.4-.1-.6%200v.6c.3.1.4.2.6%200s.2-.4%200-.6zm18%2018.6c-.2%200-.2.1-.1.6.5%200%20.6%200%20.6-.3%200-.2-.2-.3-.5-.3zM24.4%201.2l.1-.3H24c0%20.1%200%20.2.2.3h.3z%22%2F%3E%3Cpath%20d%3D%22M30.2%2010.8c.2-.2.2-.5%200-.6h-.3c-.2.1-.2.5%200%20.7l.3-.1Zm14.6%2011.1c0%20.2.1.4.3.4l.7-.3-.6-.3c-.2%200-.3%200-.4.2Zm-11.5.6.1.3c.2.1.5%200%20.6-.2v-.3c-.2-.1-.5%200-.7.2ZM48%2029.7v-.5c-.3%200-.4.1-.5.2v.4c.2.1.4%200%20.5-.1Zm7.9%207.1c-.2%200-.2.4%200%20.6h.3c.2-.2.1-.4%200-.6h-.4ZM37.5%202.2c-.3.3-.3.6-.2.8.5-.2.5-.3.2-.8ZM41%2019c0-.5-.2-.7-.5-.8-.2.4.1.6.4.8Zm10.3%2016.8q.7-.1.6-.6c-.3.1-.5.3-.6.6ZM39.7%2014.7Zm-.1.6c.4-.3.4-.3.1-.6-.3%200-.4.3-.1.6Zm17%2013.7Zm.4-.7c-.6.3-.6.3-.4.6l.4-.4v-.2Zm-8.1-3.5c0%20.3-.7.3-.4.8.4-.2.3-.5.4-.8Zm-17.6-6c-.3%200-.3.3-.4.6.5-.2.6-.3.4-.6ZM30.1%208.4l.2.7.3-.5s-.2-.2-.5-.2Zm11.4%2014.8c-.2-.2-.5-.2-.8%200%20.3.3.5.3.8%200Z%22%2F%3E%3Cpath%20d%3D%22M56.8%2029.5c.4-.4%200-.4-.2-.6l-.2.5.4.1Zm-.2-.5Zm1.4-1.7.3.6h.1c0-.3%200-.5-.4-.6Zm-18.3-4.8h-.3v.6h.4v-.2h.1l.4-.2h-.5v-.2Zm-6.4-12.3.5-.5c-.6%200-.6.2-.5.5ZM38.5%203h-.3v.3h.3V3Zm11.6%2027.7.2.4q.2-.3-.1-.5l-.1.1Zm7.8%204.1.5.4q0-.4-.5-.4ZM37.1%204.1l.3-.1v-.2h-.3v.3Zm-4.5%206.2v.3h.3l-.1-.4h-.2Zm26.2%2026.5-.4.2h.4v-.2Zm-9.4-5.5.3.5c.3-.3%200-.4-.3-.5Zm9.3%203.3v.6l.1-.1v-.4h-.1Zm-20-16.4h-.2v.3h.3l-.1-.3ZM51%2027.3V27h-.2v.3h.2Zm-7.5-13.5v.1h.2v-.3l-.2.2Z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%234db6ac%22%20d%3D%22M59%2021a3%203%200%200%200-.5-.4%204.4%204.4%200%200%200-3.8.1%206.5%206.5%200%200%200-3.2%203.3c-.3.8-1%204.6-.4%205.2-3.1-3.7-8.9%200-6.6%204.6-2.6%200-6.2%201.9-4.4%205.1-3.5-1.6-6.6.4-6.6%204-3.4-1.7-5.7%203.4-5.2%206.1%201-.4%202.7%200%203.7%200h11.8c4.3.1%208.9.6%2013.1.2.7%200%201.5%200%202.2-.2V21Z%22%2F%3E%3Cg%20fill%3D%22%2326998b%22%3E%3Cpath%20d%3D%22M51.1%2042.5zM49.3%2049v-.2l.2-.1v-.3c-.1-.2-.3-.2-.5%200l-.4.2h-.3l-.2-.2c-.2%200-.2.2-.2.3l.1.4v.1h1.4v-.1h-.1zm-12-2c-.2.2-.3.4-.2.7l-.4.2v.2c-.2.2%200%20.4%200%20.6l.2.1h.6c.2%200%20.2-.1.2-.2v-.7c.2-.2.2-.4.2-.7-.3.1-.4-.1-.6-.2zm6.9-4.6.2.2.2.3-.4.1c0%20.4%200%20.4.3.5l.1-.1.3.2.1-.2v-.5l.4-.5h-.3V42c-.2%200-.2-.1-.3-.2h-.5l-.1.2-.1.2.1.2zm-1.8%204v.3l.4-.1v.3c.2%200%20.3-.1.3-.3v-.3c.1-.1%200-.3.2-.4%200-.2-.2-.3-.4-.4h-.4l-.1.1-.1.1a.42.42%200%200%200%200%20.7zm4.1-1.5h.4l.1.3-.1.1v.2c.2%200%20.3%200%20.4-.2V45s.2%200%20.2-.2q.2-.2%200-.3h-.1s0-.3-.2-.3l-.3-.2-.2.1-.2.3h-.1l-.2.2.2.2v.2zm-6.9.2c0-.2.2%200%20.2-.2l.3-.3-.3-.2-.3-.1h-.6l-.1.2v.2c0%20.2%200%20.3.2.4l-.2.2.1.2c0-.2.2-.2.2-.3h.5zM51.4%2047c.1%200%20.2%200%20.2-.2v-.3c.3%200%20.3-.2.2-.3l.2-.2c0-.2%200-.3-.2-.3l-.1.2c-.3%200-.4.3-.7.3v.9h.4zm-1.6-7.6h.2v.6l.4-.2-.1-.3h.2l.2-.3h.7v-1H51c-.2%200-.3%200-.4-.3l-.3.2v.5h.1v.3l-.2-.1c-.1%200-.3%200-.3.2v.2h-.4c0%20.2%200%20.2.2.3zm-8.3%206.2.4-.2c.2%200%20.3-.1.3-.3l-.5-.1.2-.3c-.2%200-.4-.2-.5%200-.2%200-.2.2-.3.4h.5v.5zm7-7%20.2.3v.1l.3-.3c.3-.1.3-.4%200-.6-.2-.1-.3-.1-.4%200l-.2.4zm.5%201.2v-.2h-.2c0-.4-.2-.5-.5-.6-.2.3-.1.6%200%20.7.2.1.4.2.4.4%200%20.1.1%200%20.2%200q-.2-.2-.1-.3s0%20.1.2%200z%22%2F%3E%3Cpath%20d%3D%22M52.4%2047.2c.1-.2%200-.4-.2-.5H52l-.1.2-.2-.2s0%20.2-.2.3l.1.1v.4l.1.2h.2l-.3.1.2.3v.2l.5-.1v-.5l-.2-.2-.2.1.1-.2.4-.2Zm-3.2-4.6c0%20.1%200%20.2.2.2l.4-.1v-.5a.6.6%200%200%200-.4-.1l-.2.1v.4Zm-3.7-3.8.4.2v-.3c.1-.1%200-.3%200-.4h-.4v.5Zm3-1.6v-.5c-.4%200-.5%200-.6.2l.2.3q.2.1.4%200Zm-.3%204.1h-.3v.2s0%20.2.2.3h.2c.2%200%20.2-.2.2-.3%200-.2-.2-.2-.3-.2Zm.8%206.3c0%20.1%200%20.3.4.4v-.2c.1-.2.1-.2%200-.4l-.4.2Zm4.8.7h-.5l.1.3h.2l.1.1c.2-.1%200-.3%200-.4Zm0%20.4zm-16.2-5.4c-.2-.1-.3%200-.5.1l.2.3c.3%200%20.3-.2.3-.4Zm2%20.1.1.2c0-.3-.1-.4-.2-.5h-.3c0%20.3%200%20.3.4.3Zm13.2-.9c.2-.2.2-.2%200-.4l-.1-.1c-.3.2-.2.3%200%20.5Zm4.6%206.6h-.2v.1h.7c-.2-.2-.3-.2-.5%200Zm-11-.2-.3-.1H46c-.2.1-.2.2-.2.3h1l-.2-.2h-.1Z%22%2F%3E%3Cpath%20d%3D%22M58.8%2037.6v-.1c-.1-.1-.3%200-.4%200%200-.3.2-.1.3-.2V37c-.1-.3-.2-.3-.5-.3-.1%200-.3%200-.4.2-.2.2-.2.3-.1.5h-.2l-.4-.4v-.7c-.2-.2-.4-.2-.5-.2h-.4c-.2-.1-.2-.1-.4%200V36h-.3l-.3-.3c.2%200%20.4-.1.5-.3h.1c.2%200%20.3-.1.3-.3V35l-.3-.1a2%202%200%200%200-.5.1l-.2.3-.1.4-.2.1v.7l.4-.2c0%20.2%200%20.4.2.5l.2-.3.2-.3c0%20.1%200%20.2.2.3h.1l.1.6-.2.1v.2l-.1.1h-.2l-.4.2.2.1c0%20.1-.2.2%200%20.3l.3.3h.2s.1%200%200%20.2c-.1%200-.1.2%200%20.2v.7h.1v.1l.2.2h-.6v.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2-.2-.2-.3-.1Zm13.8-10.7v-.3c-.1-.2-.2.1-.3%200v.2h.3Zm-2.1%203v-.3h-.3q0%20.3.3.3Zm-9.2%207.3-.2.4.2.1c.2-.1.1-.3%200-.5ZM50%2042c.2%200%20.3%200%20.2-.3H50v.3Zm-5.7%201.9-.1.3h.2c.1-.2%200-.2-.1-.3Zm-4.4%201.7zm-.4%201.4.1.1c.1%200%20.2%200%20.3-.2l.1-.1c.2-.1.3-.4.3-.6V46h.3l.1-.3c.2%200%20.3.1.4%200l-.2-.1-.2-.4-.1-.1a.3.3%200%200%200-.5%200l-.2.3v.4h-.3c-.2-.2-.5%200-.6.2v.5c.1%200%20.2.3.4.3h.1Z%22%2F%3E%3Cpath%20d%3D%22M39.8%2045.4h-.2v.3h.2c0-.2%200-.1.1-.1l-.1-.2zm1%201.1v-.1c0-.1-.1-.2-.3%200l.2.2.1-.1zm-2.4-.7h-.3v.3q.2%200%20.3-.3zm3.4.5c0%20.2%200%20.2.2.3%200-.3%200-.3-.2-.3zm-1.4-1.9-.1.2h.4s-.1-.2-.3-.2zm2.9-.2v-.3l-.2.1v.1h.2zm-4.8-.2q-.3%200-.1.2v-.3zm11-3.5c.1.2.1.2.3%200h-.3zm2.2.5c-.2%200-.2%200%200%20.2V41zm-.4.9s.2.1.2%200v-.1h-.2zm-1.7-2.3h.1v-.2h-.3v.1c0%20.1.1.1.2%200zm-3%206.4v.2c.2%200%20.2%200%20.3-.2h-.3zm1.3-7c-.1-.1-.2-.1-.2%200l.1.1c.1%200%200%200%200-.2zm3.1%208.3c.3.2.3.2.4%200h-.3zm1.9%200v-.2h-.1l-.1.1.1.2zM47%2043.8l.1-.2c-.2%200-.3%200-.2.1zm.3-2.3v.1l.1.1v-.2zm.1%201.8-.1-.2.1.2zm4-3.8.1-.1h-.1zM40.6%2045c0-.2-.2-.1-.2-.2%200%20.1%200%20.2.2.1zm.9%201.1s0-.2-.2-.2c0%20.1%200%20.2.2.2zm-3%201.7v.2c.1%200%20.1-.1%200-.2zm4.5-6-.2.2q.2%200%20.2-.2zm6.5-.8q0%20.1.2%200s-.1-.1-.2%200zm2%20.4v.2h.1v-.2h-.1zm.3-.4.1-.2s-.2%200-.1.1zm-10.2%203.2h-.1.1zm-.3.1V44h-.1v.2zm1.1%202.8h.2l-.1-.1-.1.1zm7.7-6.3h.2-.1zm-1.2%206.6h.1l-.2-.2v.2zm-7.6-2.2v.1h.1v-.1h-.1zm-3.2%202.2h.2-.2zm11.1-2.1H49zm.2.2v.1zm-2.3-2.7.1.1q0-.1%200%200zm-2.5%204.7h.1zm-6.2-3.1h-.2l.1.1v-.1zm1.3-.4v.1-.1zM50%2049.2v.1h.1v-.1zm3.4-13.9c0%20.2%200%20.5.3.5h.6l-.1-.5-.1-.2a.5.5%200%200%200-.7%200v.2zM52%2037.1v.1c-.3.1-.3.4-.3.5v.3c.2%200%20.2.3.3.4.2-.1.5-.4.5-.6s0-.4-.3-.5l-.2-.1zm.2-3.8.2.2.8-.2c-.3%200-.3-.3-.3-.4s0-.2-.2-.2h-.6v.6z%22%2F%3E%3Cpath%20d%3D%22M45%2049c0-.2%200-.4-.2-.4h1v-.1l.2.1c0-.2.3%200%20.4-.2%200-.3-.2-.4-.3-.6v-.5l.2-.2.2-.3-.2-.2h.2c.1-.3-.1-.3-.2-.5H46v-.3h.1c0%20.2.1.2.2.2h.2c0-.2.1-.3.2-.3q.2-.2%200-.2v.1l-.2-.1v-.1l-.2-.1h-.1L46%2045h-.2l-.2-.1-.2.1v.4l.2.1.2.1h-.3c-.3.1-.5.3-.5.6h-.5c.1-.2.3%200%20.4-.1.2-.2%200-.2%200-.4l.2-.4v-.2h.1c0-.2.2-.2.3-.3.1%200%20.3%200%20.3-.2V44c.1%200%20.1-.1%200-.2h-.2l-.5-.1-.3.3c0%20.2%200%20.5-.2.6%200%20.2.1.4.4.5-.5%200-.6.3-.5.7h-.1c0%20.1-.1%200-.2%200v.3c-.3%200-.4%200-.5.2v.3l.1.1c-.4.2-.4.5-.4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2048.5h.3l.2-.1-.2-.2c-.2%200-.3.1-.3.3Zm14.1-15.1.1.3.2-.1v-.3h-.3Zm-.1.6.2.1s.1-.2%200-.4l-.2.3Zm-6.6%2015.2c0-.1%200-.1-.1%200h-.1.2Zm5-14.2c0-.1%200%200-.1%200h-.2v.1l.3.1V35Zm-9.2%2013.7.2.2c.1%200%200-.1%200-.1%200-.1%200-.2-.2-.1Zm4.4-8.4h-.2c0%20.1%200%20.2.1.1h.1Zm1-2.9q0-.2-.2-.3l.1.3Zm-3.5%206.8v-.3.3ZM59%2037.7v-.2.2Zm-11%203.6V41v.1Zm7.7%202.6v.2-.2Zm-8.9%203.3v.1-.1Zm6-4.7a2%202%200%200%201-.2%200h.2Zm1-.1c.1.1.2%200%20.2%200h-.2ZM59%2031.6v.2-.2ZM47.6%2046.4h-.1c0%20.1%200%200%20.1%200ZM58.9%2033v.2-.2Zm-.7-3h.1v-.1ZM45.4%2041.2h.1V41Zm10.8-5.4-.1.1h.1v-.1ZM48.5%2048c-.1%200-.1.1%200%20.1Zm1.5-6.7h.2-.2Zm3.9-3.8zm2.4-7.9-.2.1c-.2%200-.2.2-.3.3v.2l.2.2.1.1c.3.1.5.2.7%200l.1-.1h.4c.2%200%20.3-.2.3-.3v-.5h-.7c-.2-.5-.2-.5-.6-.4v.4Zm1.4%202.7.1-.3v-.1h-.4c-.1%200-.3.2-.2.3l-.1-.1-.1-.1h-.3c-.2-.1-.4%200-.5.2v.5h.2l.2.1.4.2.2.4c0%20.1.2.2.3.1.1%200%200-.1%200-.2l-.1-.4v-.4h.1c.2%200%200%20.2.1.4s.1.2.2.1h.2c-.1-.2-.1-.2%200-.4l-.3-.3Zm.6-.3v.7h.4c.1%200%20.2%200%20.2-.2l.1-.3v-.1c0-.2-.1-.4-.4-.4h-.4v.3Zm.5-5.2-.4.1v.5h.1l.4.3.2-.3V27h-.3Zm-.2%201.2c0%20.3%200%20.5.3.5h.2V28c-.2-.1-.3-.2-.5%200ZM56%2029h.4v-.3c0-.2-.2-.3-.4-.3h-.3l.1.4.2.1Zm2.6%202.1v.4h.5V31c-.2-.2-.4-.1-.5%200Zm-.6-4.9-.4-.4c-.3%200-.4.1-.4.4l.4.2q.2%200%20.3-.2Zm-7.2%2010.3c-.2%200-.3.1-.3.3l.2.2c.3-.2.2-.4.1-.5Zm1.9-.8h.2c-.1-.2-.3-.2-.5-.2%200%200-.2%200-.2.2.1.1.1.1.4%200h.1Zm3.5-.2H56l-.2.2h.7s.1-.2%200-.2c0-.1-.1-.2-.2-.1v.1Zm2.2-11.1-.1-.3c-.2%200-.1.2-.3.2v.1c.2.2.3.1.4%200Zm-.8%203.4h-.2q.2.3.4.2c0-.1%200-.2-.2-.3Zm-2.1%2016.6zm-.7-6.4h.2v-.2l-.3.1Zm-2.4.6.1.2q.2-.1.2-.4c-.2%200-.2%200-.3.2Zm3.9-3.8v-.3c-.2%200-.3%200-.3.2l.1.1h.2Zm1.9-6.6V28c-.2%200-.2%200-.2.2h.2ZM56.4%2044v.1h.3v-.2h-.3ZM59%2030.7v-.1h-.2l.1.1Zm-5%205.9s.2.2.3%200H54Zm1.5.7s0-.1-.2%200h.2Zm-.5-4.5v.2-.2Zm-.3%202.7v.1h.2-.2Zm-.1.3-.1-.2v.1Zm.5.8H55s.1%200%200%200Zm-1.8%203.3h-.2v.1l.2-.1Zm-.3-3.7h.1Z%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%231d3ba9%22%20d%3D%22M16.6%2011.2h3.7V8.6c0-.8-3.7-.8-3.7%200v2.6ZM8.7%2034.5h19.5c1.7%200%201.7-11.4%200-11.4H8.7c-1.6%200-1.6%2011.4%200%2011.4Z%22%2F%3E%3Cg%20fill%3D%22%230c2b77%22%3E%3Cpath%20d%3D%22M25.7%2016v35.2H11.3V16c0-3.4%202.7-6.2%206.1-6.2h2.1c3.4%200%206.2%202.8%206.2%206.2Z%22%2F%3E%3Crect%20width%3D%2217.3%22%20height%3D%224%22%20x%3D%229.8%22%20y%3D%2216.2%22%20rx%3D%22.7%22%20transform%3D%22rotate%28180%2018.5%2018.2%29%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%231d3ba9%22%3E%3Cpath%20d%3D%22M27.1%2017H9.8c0-.4.4-.7.8-.7h15.8c.4%200%20.7.3.7.7v.2Z%22%2F%3E%3Crect%20width%3D%223.4%22%20height%3D%223.4%22%20x%3D%2216.8%22%20y%3D%2227%22%20rx%3D%22.6%22%20transform%3D%22rotate%28225%2018.5%2028.7%29%22%2F%3E%3Cpath%20d%3D%22M19.5%2040.3v10.9h-2v-11c0-.4.3-.8.8-.8h.3c.5%200%201%20.4%201%20.9Zm4.1%200v10.9h-2.1v-11c0-.4.4-.8.9-.8h.3c.5%200%201%20.4%201%20.9Zm-8.2%200v10.9h-2v-11c0-.4.3-.8.8-.8h.3c.5%200%201%20.4%201%20.9Z%22%2F%3E%3C%2Fg%3E%3Ccircle%20cx%3D%2218.5%22%20cy%3D%2228.8%22%20r%3D%224.9%22%20fill%3D%22none%22%20stroke%3D%22%231d3ba9%22%20stroke-width%3D%221.8%22%2F%3E%3Cg%20stroke-miterlimit%3D%2210%22%3E%3Cpath%20fill%3D%22%236c27a8%22%20stroke%3D%22%236c27a8%22%20stroke-width%3D%22.4%22%20d%3D%22M59.2%2058.8h-58V47.2h58z%22%2F%3E%3Cpath%20fill%3D%22%2347127f%22%20stroke%3D%22%239961e2%22%20stroke-width%3D%221.4%22%20d%3D%22M8.2%2059.2v-4.5c0-1.8%201.4-3.2%203.1-3.2H52c1.7%200%203%201.4%203%203.2v4.5%22%2F%3E%3C%2Fg%3E%3Cpath%20fill%3D%22%230254c2%22%20d%3D%22M58.7%201v57.7H1V1h57.6m1-1.1H0v59.7h59.7V0Z%22%2F%3E%3C%2Fsvg%3E";

var badFly = "data:image/png;base64, ";

var celebrate = "../demoasset/celebrate-ece5a54e321ab2e7.png";

var hover = "../demoasset/hover-13bd4972c72e1a52.gif";

var spotlight = "data:image/gif;base64, ";

var badCard = "data:image/png;base64, ";

var castle = "../demoasset/castle-7575ab637e5138e2.svg";

var fourSquares = "../demoasset/fourSquares-de5c55d13d7de923.png";

var goodCard = "data:image/png;base64, ";

var hydrant = "../demoasset/hydrant-d11f08c8f1a631a3.svg";

var iconBad = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22Layer_2%22%20data-name%3D%22Layer%202%22%20viewBox%3D%220%200%2016.98%2015.78%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%235eccbe%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22Layer_2-2%22%20data-name%3D%22Layer%202%22%3E%3Cpath%20d%3D%22m12.3%205.91.05.01h.01l-.06-.02v.01z%22%20class%3D%22cls-1%22%2F%3E%3Cpath%20d%3D%22M16.89%2014.6c-.2-.49-.62-.81-.98-1.1-.18-.14-.35-.27-.48-.42-.68-1.19-.49-2.05-.27-3.03.29-1.31.62-2.79-1.16-5.15-.97-3.08-1.69-4.42-2.56-4.76-.67-.26-1.3.11-1.97.5-.91.53-1.95%201.14-3.56.74-.39-.21-.76-.26-1.08-.15-.57.19-.85.82-1.09%201.38-.12.28-.25.57-.38.71v.02c-.62.65-1.74%201.85-1.52%203.99.17%202.95%200%203.3-.6%203.93-.53.57-.41%201.2-.31%201.7.06.32.12.62.05.91-.12.49-.32.68-.54.89-.14.13-.28.27-.4.48a.34.34%200%200%200%20.3.51l16.28.03c.18%200%20.33-.13.34-.31%200-.09.05-.57-.07-.87Zm-3.9-8.41-.35-.14.34.15C11.96%208.63%2010.4%209.91%208.35%2010H8.2c-2.62%200-4.31-2.92-4.87-3.89a.497.497%200%200%201%20.06-.58c.14-.16.37-.21.57-.13.59.25%201.83.68%203.5.77l.33.02.03.33c.06.77.52%201.21.79%201.4.23-.24.64-.76.71-1.49l.03-.3.3-.03c1.66-.18%202.38-.43%202.66-.56.19-.09.41-.05.57.09.15.15.2.37.12.56ZM1.77%201.96c-.6.05-.55.82-.38%201.2%200%200%20.34.51.68.14.1-.11.17-.25.21-.4.05-.2.06-.43-.02-.62-.09-.19-.29-.34-.5-.32ZM2.78.9c.04.26.17.61.39.68.22.07.44-.21.46-.6.03-.39-.14-.95-.49-.97-.38-.03-.42.52-.36.89ZM14.12.05c-.6.05-.55.82-.38%201.2%200%200%20.34.51.68.14.1-.11.17-.25.21-.4.05-.2.06-.43-.02-.62-.09-.19-.29-.34-.5-.32ZM15.8%202.2c-.21-.2-.42-.2-.6-.09-.37.22-.65.85-.66%201.15-.01.37.13.88.71.79.54-.08.92-1.49.55-1.86Z%22%20class%3D%22cls-1%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";

var land = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20data-name%3D%22Layer%202%22%20viewBox%3D%220%200%201287.15%2038.21%22%3E%3Cg%20data-name%3D%22Layer%202%22%3E%3Cpath%20d%3D%22M1015.47%2032.86V16.23h6.44v16.63%22%20style%3D%22fill%3A%231d3ba9%22%2F%3E%3Cpath%20d%3D%22M1011.69%2017.09s-4.06%203.8-6.43.02c-2.37-3.79%201.02-3.57%201.02-3.57s-1.61-3.51.42-5.8%203.64-1.27%203.64-1.27-.76-3.81.93-4.4%203.21%201.52%203.21%201.52.68-3.93%203.3-3.57%203.05%203.66%203.05%203.66%202.37-1.95%204.06-.17%201.18%204.48%201.18%204.48%201.61-3.14%203.89-2.25%201.52%203.09%201.52%203.09%202.37%201.5%201.1%203.03-3.64%202.39-3.64%202.39%203.3.79%202.45%202.67-3.81%201.85-3.81%201.85l-2.37%201.14h-8.12s-3.38%201.43-4.23.5-1.18-3.34-1.18-3.34Z%22%20style%3D%22fill%3A%234db6ac%22%2F%3E%3Cpath%20d%3D%22M0%2038.21V8.39c11.13%201.08%2065.43%2017.4%2086.67%2016.08s47.4%205.28%2054%207.49%2030.36-4.19%2053.46-11.1S313.6%2031.73%20343.3%2031.95s28.38-5.5%2043.56-8.34%2057.42%205.47%2079.86%206.02%2059.14-6.02%2059.14-6.02c19.73-3.77%2032.73-14.57%2048.01-12.14s28.59%205.33%2042.72%205.86%2045.82-3.34%2053.74-5.86%2035.64-5.4%2043.56%200%2018.15%202.39%2035.64%2014.17c7.45%205.02%2034.65%206.35%2042.57%207.54s64.02.3%2069.3-1.24%2034.72-6.47%2043.1-5.98%2092.86%204.88%20107.39%205.98%2066.66-2.03%2089.76-2.12%2046.2-.31%2059.4%202.12c10.51%201.93%2025.61-.92%2036.33-2.2%201.3-.16%202.53-.35%203.69-.39%2033.98-1.17%2041.27%207.55%2049%204.27s13.53-7.51%2037.04-9.16V38.2H0Z%22%20style%3D%22fill%3A%230c2b77%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";

var logo = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xml%3Aspace%3D%22preserve%22%20style%3D%22enable-background%3Anew%200%200%20382.4%20381.2%22%20viewBox%3D%220%200%20382.4%20381.2%22%3E%3Cpath%20d%3D%22M198.4%200c2.4.2%204.9.4%207.3.6%2027%202%2052.4%209.5%2076.3%2022.3%2016.2%208.7%2030.8%2019.6%2043.9%2032.5%204.1%204.1%207.9%208.5%2011.7%2012.8%201.7%201.9%201.7%202%203.5.2l39.1-39.1c.5-.5%201-1%201.5-1.4.1%200%20.3.1.5.2v151.7c0%202.8.2%205.6.2%208.3%200%202.6%200%202.6-2.6%202.6l-56-.3c-31.9%200-63.8%200-95.6.1-2.5%200-5%20.1-7.5.2-.4%200-.8-.1-1.6-.2l1.7-1.7c15.5-15.5%2030.9-31%2046.4-46.4%201.1-1.1%201.2-1.9.3-3.2-15.6-22.4-36.9-36-64-40-3.8-.6-7.6-1.1-11.4-1.6-1.6-.2-2.1.4-2.1%202%20.1%2016.3.1%2032.5.1%2048.8%200%204.2.1%208.4.2%2012.6%200%20.6-.1%201.2-.1%202.2-.8-.7-1.4-1.2-1.8-1.6l-46.3-46.3c-1.2-1.2-1.9-1.3-3.3-.3-22.5%2015.6-35.9%2036.9-40.1%2064l-1.5%209.9c-.3%202.1-.1%202.3%202%202.3%2020.3%200%2040.6%200%2060.8-.1h2.8c-.8%201-1.3%201.6-1.8%202.1-15.4%2015.4-30.7%2030.7-46.1%2046-1.3%201.3-1.3%202.1-.3%203.6%2015.3%2021.9%2036.1%2035.3%2062.5%2039.6%206%201%2012%202%2018.2%201.7%2017.5-.9%2033.7-5.7%2047.8-16.4%204.6-3.5%209.1-7%2013.2-10.9%206.1-5.8%2011.1-12.5%2015.3-19.9.2-.4.4-.8.7-1.1.1-.1.2-.3.4-.6.6.5%201.1.9%201.6%201.3%2013.4%2013.5%2026.8%2027%2040.1%2040.5%209%209.1%2018%2018.3%2027.1%2027.3%201.2%201.2%201.2%202%20.2%203.3-12.5%2015.9-27%2029.6-43.7%2040.9-19.2%2013.1-40.1%2022.3-62.7%2027.7-9.6%202.3-19.2%204-29.1%204.5-7%20.4-14.1.8-21.1.6-16.4-.4-32.6-3-48.4-7.7-18-5.3-34.8-13.2-50.4-23.4-2.5-1.6-4.9-3.5-7.4-5.1-10.2-6.4-18.7-14.7-27-23.3-3.1-3.2-6-6.7-9.2-10.3L.4%20353.8c-.1-1.3-.1-2-.1-2.8V199.9c0-4.9-.1-9.8%200-14.6.3-16.4%203-32.5%207.6-48.2%205.5-18.9%2013.9-36.5%2024.9-52.8%208.4-12.4%2018.1-23.6%2029.1-33.8%202-1.9%204.1-3.6%206.2-5.3.7-.6%201.4-1.2%202.2-2C55.7%2029%2041.7%2014.9%2027.7.9c0-.1.1-.3.1-.4.7-.1%201.4-.1%202.2-.1h150.8c1%200%202-.2%203-.3%204.8-.1%209.7-.1%2014.6-.1z%22%20style%3D%22fill%3A%23020612%22%2F%3E%3C%2Fsvg%3E";

var logoBlue = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xml%3Aspace%3D%22preserve%22%20style%3D%22enable-background%3Anew%200%200%20382.4%20381.2%22%20viewBox%3D%220%200%20382.4%20381.2%22%3E%3Cpath%20d%3D%22M198.4%200c2.4.2%204.9.4%207.3.6%2027%202%2052.4%209.5%2076.3%2022.3%2016.2%208.7%2030.8%2019.6%2043.9%2032.5%204.1%204.1%207.9%208.5%2011.7%2012.8%201.7%201.9%201.7%202%203.5.2l39.1-39.1c.5-.5%201-1%201.5-1.4.1%200%20.3.1.5.2v151.7c0%202.8.2%205.6.2%208.3%200%202.6%200%202.6-2.6%202.6l-56-.3c-31.9%200-63.8%200-95.6.1-2.5%200-5%20.1-7.5.2-.4%200-.8-.1-1.6-.2l1.7-1.7c15.5-15.5%2030.9-31%2046.4-46.4%201.1-1.1%201.2-1.9.3-3.2-15.6-22.4-36.9-36-64-40-3.8-.6-7.6-1.1-11.4-1.6-1.6-.2-2.1.4-2.1%202%20.1%2016.3.1%2032.5.1%2048.8%200%204.2.1%208.4.2%2012.6%200%20.6-.1%201.2-.1%202.2-.8-.7-1.4-1.2-1.8-1.6l-46.3-46.3c-1.2-1.2-1.9-1.3-3.3-.3-22.5%2015.6-35.9%2036.9-40.1%2064l-1.5%209.9c-.3%202.1-.1%202.3%202%202.3%2020.3%200%2040.6%200%2060.8-.1h2.8c-.8%201-1.3%201.6-1.8%202.1-15.4%2015.4-30.7%2030.7-46.1%2046-1.3%201.3-1.3%202.1-.3%203.6%2015.3%2021.9%2036.1%2035.3%2062.5%2039.6%206%201%2012%202%2018.2%201.7%2017.5-.9%2033.7-5.7%2047.8-16.4%204.6-3.5%209.1-7%2013.2-10.9%206.1-5.8%2011.1-12.5%2015.3-19.9.2-.4.4-.8.7-1.1.1-.1.2-.3.4-.6.6.5%201.1.9%201.6%201.3%2013.4%2013.5%2026.8%2027%2040.1%2040.5%209%209.1%2018%2018.3%2027.1%2027.3%201.2%201.2%201.2%202%20.2%203.3-12.5%2015.9-27%2029.6-43.7%2040.9-19.2%2013.1-40.1%2022.3-62.7%2027.7-9.6%202.3-19.2%204-29.1%204.5-7%20.4-14.1.8-21.1.6-16.4-.4-32.6-3-48.4-7.7-18-5.3-34.8-13.2-50.4-23.4-2.5-1.6-4.9-3.5-7.4-5.1-10.2-6.4-18.7-14.7-27-23.3-3.1-3.2-6-6.7-9.2-10.3L.4%20353.8c-.1-1.3-.1-2-.1-2.8V199.9c0-4.9-.1-9.8%200-14.6.3-16.4%203-32.5%207.6-48.2%205.5-18.9%2013.9-36.5%2024.9-52.8%208.4-12.4%2018.1-23.6%2029.1-33.8%202-1.9%204.1-3.6%206.2-5.3.7-.6%201.4-1.2%202.2-2C55.7%2029%2041.7%2014.9%2027.7.9c0-.1.1-.3.1-.4.7-.1%201.4-.1%202.2-.1h150.8c1%200%202-.2%203-.3%204.8-.1%209.7-.1%2014.6-.1z%22%20style%3D%22fill%3A%23448aff%22%2F%3E%3C%2Fsvg%3E";

var noClick = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xml%3Aspace%3D%22preserve%22%20id%3D%22Layer_1%22%20x%3D%220%22%20y%3D%220%22%20style%3D%22enable-background%3Anew%200%200%2048%2048%22%20version%3D%221.1%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cstyle%3E.st0%7Bfill%3A%23ee0290%7D%3C%2Fstyle%3E%3Cpath%20d%3D%22M31%2025.5c.7-2.4%201.5-4.9%202.2-7.3.6-1.9-.3-2.9-2.2-2.3-2.5.7-4.9%201.5-7.4%202.2l7.4%207.4zM25.2%2024l-5-5c-2.1.6-4.2%201.3-6.3%201.9-.8.2-1.7.6-1.4%201.6.2.6.9%201.3%201.5%201.5.7.3%201.3.5%202.1.8.9.3%201.2%201.5.5%202.2-2.1%202.1-4.2%204.1-6.2%206.3-1.3%201.4-1.5%203.1-.7%204.7.8%201.4%202.3%202.2%204.1%201.8.9-.2%201.7-.8%202.4-1.4%202-1.9%203.9-3.8%205.9-5.8.7-.7%201.8-.4%202.2.5.2.7.5%201.4.8%202.1.3.6.9%201.4%201.5%201.5%201%20.2%201.4-.7%201.6-1.6.6-2.1%201.2-4.2%201.9-6.3L25.2%2024z%22%20class%3D%22st0%22%2F%3E%3Cpath%20d%3D%22M23.1%2026.1%204.5%207.6c-.6-.6-.6-1.6%200-2.2.6-.6%201.5-.6%202.1%200L43.2%2042c.6.6.6%201.5%200%202.1-.6.6-1.5.6-2.1%200l-13-13-5-5z%22%20class%3D%22st0%22%2F%3E%3C%2Fsvg%3E";

var pointer = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2049.48%2049.48%22%3E%3Cpath%20d%3D%22M23.05%2049.48v-4.24c-5.16-.53-9.45-2.5-12.88-5.93-3.43-3.43-5.4-7.72-5.93-12.88H0v-3.39h4.24c.53-5.16%202.5-9.45%205.93-12.88%203.43-3.43%207.72-5.4%2012.88-5.93V0h3.39v4.24c5.16.53%209.45%202.5%2012.88%205.93%203.43%203.43%205.4%207.72%205.93%2012.88h4.24v3.39h-4.24c-.53%205.16-2.5%209.45-5.93%2012.88-3.43%203.43-7.72%205.4-12.88%205.93v4.24h-3.39Zm1.69-7.57c4.71%200%208.75-1.69%2012.12-5.06%203.37-3.37%205.06-7.41%205.06-12.12%200-4.71-1.69-8.75-5.06-12.12-3.37-3.37-7.41-5.06-12.12-5.06s-8.75%201.69-12.12%205.06-5.06%207.41-5.06%2012.12c0%204.71%201.69%208.75%205.06%2012.12%203.37%203.37%207.41%205.06%2012.12%205.06Z%22%20style%3D%22fill%3A%23ee0290%22%2F%3E%3C%2Fsvg%3E";

var gameHTML = x`
  <div id="game" class="l0">
    <div class="overlay" id="overlay"></div>
    <div class="castle-wrap">
      <img src="${land}" class="land" alt="" />
      <img src="${castle}" class="castle" alt="" id="castle" />
    </div>
  </div>
  <div class="globalnav">
    <mwc-icon-button
      aria-controls="sitemap"
      aria-expanded="true"
      aria-label="Close"
      class="closebtn"
      icon="close"
      id="closegame"
    ></mwc-icon-button>
  </div>
  <div class="controller">
    <ul>
      <!-- 
        <li class="status-container">
          <h3 class="bold">status:</h3> <span id="status">Game hasn't started</span>
        </li>
      -->
      <li class="status-container score-wrap" id="statuscontainer">
        <div class="score-container bad-score score-container">
          <h3>
            <img src="${iconBad}" alt="Bads caught" />
            <span id="badscore" class="score">0</span>
          </h3>
          <span class="badge">👀 That's a lot of bads</span>
        </div>
        <div class="human-score-container score-container">
          <h3>
            <i class="material-symbols-rounded" alt="Humans saved">face</i>
          </h3>
          <span id="humanscore" class="score">0</span>
          <span class="badge">👏 Way to save the humans!</span>
        </div>
        <div class="high-score-container score-container">
          <h3 class="bold">
            <i class="material-symbols-rounded" alt="High score"
              >military_tech</i
            >
          </h3>
          <span id="highscore" class="score">0</span>
          <span class="badge">🎉 New High Score</span>
        </div>
        <div class="bonus-container score-container" id="bonusscorewrap">
          <h3 class="bold">
            <i class="material-symbols-rounded" alt="Items">add</i>
          </h3>
          <span id="bonuses" class="bonusicons"> </span>
          <span class="badge">🎉 all badges collected</span>
        </div>
      </li>

      <li class="reload-container ready">
        <span class="progress-wrap">
          <h3><img src="${logo}" alt="" /></h3>
          <progress id="progress" class="progress" value="100" max="100">
            100%
          </progress>
          <span class="text">
            <span class="icon"><span class="key">R</span></span>
          </span>
        </span>
      </li>
    </ul>
    <div class="intro">
      <div class="intro-wrap">
        <h1>BadFinder</h1>
        <div class="content">
          <div class="content-wrap">
            <img src="${badCard}" alt="" />
            <span>
              <img src="${pointer}" class="norm" alt="don't click" />
              <span>Get the bads before they reach the castle.</span>
            </span>
          </div>
          <div class="content-wrap">
            <img src="${goodCard}" alt="" />
            <span>
              <img src="${noClick}" class="norm" alt="don't click" />
              <span>Protect the humans!</span>
            </span>
          </div>
        </div>
        <button id="start" class="play">Play</button>
      </div>
    </div>
  </div>

  <div class="bonusdialogue" id="dialoguebonus">
    <div class="bonusdialogue-wrap">
      <div class="content">
        <img src="${fourSquares}" alt="" class="featuredimg" id="bonusimg" />
        <div>
          <h4>Items unlocked!</h4>
          <p>Collect squares with bikes, crosswalks and hydrants.</p>
        </div>
      </div>
      <button id="resume">Let's go</button>
    </div>
  </div>

  <div class="bonusdialogue" id="dialoguescan">
    <div class="bonusdialogue-wrap">
      <div class="content">
        <div class="instructions-wrap">
          <span class="key">R</span>
          <span>=</span>
          <img src="${logoBlue}" alt="" />
        </div>
        <div>
          <p>
            Blocks are now hidden, Press the R key to run a reCAPTCHA and reveal
            them.
          </p>
          <!--Todo: change to "tap recaptcha" on mobile -->
        </div>
      </div>
      <button id="resume">Play on</button>
    </div>
  </div>

  <div class="bonusdialogue fail" id="dialoguefail">
    <div class="bonusdialogue-wrap">
      <div class="content">
        <img src="${badFly}" alt="" class="featuredimg" id="levelupimg" />
        <!-- Change from bad-fly  -->
        <div>
          <h4><span id="badcount">14</span> bads caught!</h4>
          <p>
            <span id="reason">A bad slipped by and got to the castle.</span>
            That's okay, you <span id="humancount">still saved 4 humans.</span>
          </p>
        </div>
        <div class="levelup-container" id="levelupcontainer">
          <img src="${hover}" alt="" />
          <div>
            <h5>Expert mode!</h5>
            <p id="levelupdesc">
              Hovering on a square now reveals the entire thing!
            </p>
          </div>
        </div>
        <button id="restart">Keep playing</button>
      </div>
    </div>
  </div>

  <div class="dialogue" id="dialoguenewlevel">
    <p class="reason" id="reason">Nice try</p>
    <div class="levelup-container" id="levelupcontainer">
      <img src="${hydrant}" alt="" id="bonusimg" />
      <p>
        You've unlocked items! Click on squares with bikes, crosswalks and
        hydrants to collect them all.
      </p>
    </div>
    <button class="startgame icon-btn" id="restart">
      <i class="material-symbols-rounded">play_arrow</i>
    </button>
  </div>

  <svg
    id="boomboom"
    class="boomboom"
    data-name="Layer 2"
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 99.1 89.19"
  >
    <defs>
      <style>
        .cls-1 {
          fill: #fbfd17;
        }

        .cls-2 {
          fill: #9b9a9f;
        }
      </style>
    </defs>
    <g>
      <g id="right" class="right">
        <circle class="cls-2" cx="81.83" cy="22.19" r="5.92" />
        <circle class="cls-2" cx="63.11" cy="31.69" r="1.04" />
        <circle class="cls-2" cx="68.29" cy="47.7" r="1.04" />
        <circle class="cls-2" cx="80.79" cy="51.86" r="1.04" />
        <circle class="cls-2" cx="81.83" cy="40.31" r="4.16" />
        <circle class="cls-2" cx="75.92" cy="48.74" r="4.16" />
        <circle class="cls-2" cx="67.64" cy="43.95" r="4.16" />
        <circle class="cls-2" cx="60" cy="41.04" r="4.16" />
        <circle class="cls-2" cx="74.86" cy="32.72" r="6.75" />
        <circle class="cls-2" cx="57.63" cy="36.15" r="6.75" />
        <circle class="cls-2" cx="87.75" cy="32.72" r="3.1" />
        <circle class="cls-2" cx="71.7" cy="40" r="3.1" />
        <circle class="cls-2" cx="57.92" cy="51.86" r="4.16" />
        <circle class="cls-2" cx="63.49" cy="49.8" r="5.86" />
        <circle class="cls-2" cx="53.76" cy="62.27" r="6.97" />
        <circle class="cls-2" cx="81.83" cy="59.87" r="6.97" />
        <circle class="cls-2" cx="71.7" cy="58.12" r="4.16" />
      </g>
      <g id="bottom" class="bottom">
        <circle class="cls-2" cx="41.29" cy="68.21" r="1.04" />
        <circle class="cls-2" cx="57.92" cy="75.8" r="3.1" />
        <circle class="cls-2" cx="35.19" cy="74.81" r="3.1" />
        <circle class="cls-2" cx="68.29" cy="69.24" r="3.1" />
        <circle class="cls-2" cx="47.5" cy="74.81" r="4.16" />
        <circle class="cls-2" cx="42.33" cy="61.6" r="6.75" />
        <circle class="cls-2" cx="44.4" cy="58.12" r="3.1" />
      </g>
      <g id="left" class="left">
        <circle class="cls-2" cx="24.58" cy="22.19" r="4.16" />
        <circle class="cls-2" cx="15.42" cy="24.05" r="1.04" />
        <circle class="cls-2" cx="32.09" cy="62.93" r="1.04" />
        <circle class="cls-2" cx="16.46" cy="64.74" r="3.1" />
        <circle class="cls-2" cx="23.53" cy="30.5" r="4.16" />
        <circle class="cls-2" cx="28.74" cy="30.65" r="1.04" />
        <circle class="cls-2" cx="13.35" cy="42.08" r="1.04" />
        <circle class="cls-2" cx="37.05" cy="41.04" r="1.04" />
        <circle class="cls-2" cx="32.89" cy="53.96" r="4.16" />
        <circle class="cls-2" cx="20.03" cy="50.8" r="5.09" />
        <circle class="cls-2" cx="32.54" cy="36.89" r="5.09" />
        <circle class="cls-2" cx="44.4" cy="47.7" r="4.16" />
        <circle class="cls-2" cx="26.63" cy="40.31" r="5.72" />
        <circle class="cls-2" cx="44.1" cy="33.69" r="8.67" />
        <circle class="cls-2" cx="31.05" cy="26.34" r="5.72" />
        <circle class="cls-2" cx="37.05" cy="45.19" r="6.75" />
        <circle class="cls-2" cx="48.55" cy="49.8" r="6.75" />
        <circle class="cls-2" cx="29.78" cy="62.93" r="6.75" />
        <circle class="cls-2" cx="23.53" cy="57.07" r="3.1" />
        <circle class="cls-2" cx="13.65" cy="47.7" r="3.1" />
        <circle class="cls-2" cx="16.84" cy="33.69" r="3.19" />
      </g>
      <g id="up" class="up">
        <circle class="cls-2" cx="69.64" cy="28.1" r="1.04" />
        <circle class="cls-2" cx="58.96" cy="12.1" r="1.04" />
        <circle class="cls-2" cx="48.04" cy="13.14" r="2.08" />
        <circle class="cls-2" cx="57.63" cy="24.05" r="5.72" />
        <circle class="cls-2" cx="37.05" cy="18.96" r="5.72" />
        <circle class="cls-2" cx="48.55" cy="22.19" r="6.75" />
        <circle class="cls-2" cx="69.64" cy="17.45" r="6.75" />
        <circle class="cls-2" cx="70.67" cy="22.25" r="4.81" />
        <circle class="cls-2" cx="65.87" cy="28.1" r="4.16" />
        <circle class="cls-2" cx="64.15" cy="14.26" r="3.19" />
      </g>
      <path
        class="blob"
        d="M47.03,80.71s-4.86,9.68-16.19,8.36c-11.33-1.32-5.83-13.86-7.15-17.38S6.96,57.85,5.42,49.04-3.6,34.28,2.12,29.44s10.92-2.3,12.28-1.04,5.1-6.86,7.08-9.62,9.68-7.16,13.86-8.26S47.94-3.78,60.02,1.06s9.83,13.52,11.72,16.55,12.01-3.35,17.07-3.13c5.06,.22,11.44,9.02,10.12,14.96s-.88,23.38-5.06,27.2c-4.18,3.82-10.48,15.92-23.17,20.32l-12.69,4.4s-7.22-1.1-10.98-.66Z"
      />
    </g>
  </svg>

  <svg
    class="crackin"
    id="crackin"
    data-name="Layer 2"
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 55.12 55.12"
  >
    <defs>
      <style>
        .cls-1 {
          fill: #9b9a9f;
        }
      </style>
    </defs>
    <g id="rect">
      <g id="right" class="right">
        <polygon
          class="cls-1"
          points="51.17 55.12 54.71 55.12 53.81 51.4 51.17 55.12"
        />
        <polygon
          class="cls-1"
          points="54.71 55.12 55.12 55.12 55.12 49.56 53.81 51.4 54.71 55.12"
        />
        <polygon
          class="cls-1"
          points="53.81 51.4 48.51 29.4 34.92 34.17 42.86 55.12 51.17 55.12 53.81 51.4"
        />
        <polygon
          class="cls-1"
          points="53.81 51.4 55.12 49.56 55.12 27.08 48.51 29.4 53.81 51.4"
        />
        <polygon
          class="cls-1"
          points="32.02 26.51 34.92 34.17 48.51 29.4 45.21 15.7 32.02 26.51"
        />
        <polygon
          class="cls-1"
          points="48.51 29.4 55.12 27.08 55.12 7.59 45.21 15.7 48.51 29.4"
        />
      </g>
      <g id="bottom" class="bottom">
        <polygon
          class="cls-1"
          points="12.68 49.65 15.4 55.12 21.98 55.12 23.24 43.28 12.68 49.65"
        />
        <polygon
          class="cls-1"
          points="23.8 38.08 23.24 43.28 35.56 35.86 23.24 43.28 21.98 55.12 42.86 55.12 34.92 34.17 23.8 38.08"
        />
        <polygon
          class="cls-1"
          points="12.68 49.65 23.24 43.28 23.8 38.08 9.44 43.12 12.68 49.65"
        />
        <polygon
          class="cls-1"
          points="32.02 26.51 32.02 26.51 26.56 12.1 26.56 12.3 23.8 38.08 34.92 34.17 32.02 26.51 32.02 26.51"
        />
      </g>
      <g id="top" class="top">
        <polygon
          class="cls-1"
          points="45.21 15.7 42.58 4.79 30.84 5.54 29.54 7.53 40.15 19.84 29.54 7.53 26.56 12.1 32.02 26.51 45.21 15.7"
        />
        <polygon
          class="cls-1"
          points="27.99 5.73 29.54 7.53 30.84 5.54 27.99 5.73"
        />
        <polygon
          class="cls-1"
          points="45.21 15.7 55.12 7.59 55.12 3.98 42.58 4.79 45.21 15.7"
        />
        <polygon
          class="cls-1"
          points="9.45 6.92 14.36 0 10.74 0 3.42 7.31 9.45 6.92"
        />
        <polygon
          class="cls-1"
          points="27.99 5.73 23.05 0 14.36 0 9.45 6.92 27.99 5.73"
        />
        <polygon
          class="cls-1"
          points="42.58 4.79 41.42 0 34.45 0 30.84 5.54 42.58 4.79"
        />
        <polygon
          class="cls-1"
          points="55.12 3.98 55.12 0 41.42 0 42.58 4.79 55.12 3.98"
        />
        <polygon
          class="cls-1"
          points="30.84 5.54 34.45 0 23.05 0 27.99 5.73 30.84 5.54"
        />
        <polygon class="cls-1" points="10.74 0 0 0 0 7.53 3.42 7.31 10.74 0" />
      </g>
      <g id="left" class="left">
        <polygon
          class="cls-1"
          points="9.44 43.12 0 46.44 0 55.12 3.61 55.12 12.68 49.65 9.44 43.12"
        />
        <polygon
          class="cls-1"
          points="3.61 55.12 15.4 55.12 12.68 49.65 3.61 55.12"
        />
        <polygon
          class="cls-1"
          points="5.95 36.12 0 40.69 0 46.44 9.44 43.12 5.95 36.12"
        />
        <polygon class="cls-1" points="0 24.15 0 40.69 5.95 36.12 0 24.15" />
        <polygon
          class="cls-1"
          points="25.61 21.05 5.95 36.12 9.44 43.12 23.8 38.08 26.56 12.3 26.56 12.1 29.54 7.53 27.99 5.73 9.45 6.92 0 20.24 0 24.15 5.95 36.12 25.61 21.05"
        />
        <polygon
          class="cls-1"
          points="3.42 7.31 0 10.74 0 20.24 9.45 6.92 3.42 7.31"
        />
        <polygon class="cls-1" points="0 7.53 0 10.74 3.42 7.31 0 7.53" />
      </g>
    </g>
  </svg>

  <svg
    id="squarecrack"
    class="squarecrack"
    data-name="Layer 2"
    xmlns="http://www.w3.org/2000/svg"
    viewBox="0 0 55.12 55.12"
  >
    <defs>
      <style>
        .cls-1 {
          fill: #9b9a9f;
        }
      </style>
    </defs>
    <g id="boomboom-2">
      <g id="bottom" class="bottom">
        <polygon
          class="cls-1"
          points="27.23 31.76 27.23 27.35 18.16 27.35 18.16 31.89 18.16 36.43 27.23 36.43 27.23 31.76"
        />
        <rect class="cls-1" x="18.16" y="36.43" width="9.08" height="9.08" />
        <polygon
          class="cls-1"
          points="31.76 36.43 27.23 36.43 27.23 45.51 36.31 45.51 36.31 36.43 31.76 36.43"
        />
        <rect class="cls-1" x="27.23" y="27.35" width="4.53" height="4.4" />
        <rect class="cls-1" x="27.23" y="31.76" width="4.53" height="4.67" />
        <rect class="cls-1" x="27.23" y="22.82" width="4.53" height="4.54" />
        <rect class="cls-1" x="45.39" y="45.51" width="9.32" height="9.2" />
        <rect class="cls-1" x="36.31" y="45.51" width="9.08" height="9.2" />
        <rect class="cls-1" x="18.16" y="45.51" width="9.08" height="9.2" />
        <rect class="cls-1" x="27.23" y="45.51" width="9.08" height="9.2" />
      </g>
      <g id="right" class="right">
        <polygon
          class="cls-1"
          points="31.76 27.35 31.76 31.76 31.76 36.43 36.31 36.43 45.39 36.43 48.01 36.43 48.01 29.59 48.01 22.82 40.85 22.82 40.85 22.82 40.85 22.82 31.76 22.82 31.76 27.35"
        />
        <rect class="cls-1" x="36.31" y="36.43" width="9.08" height="9.08" />
        <polygon
          class="cls-1"
          points="45.39 36.43 45.39 45.51 54.71 45.51 54.71 36.43 48.01 36.43 45.39 36.43"
        />
        <polygon
          class="cls-1"
          points="45.39 9.2 40.85 9.2 40.85 22.82 48.01 22.82 48.01 22.75 48.01 22.82 54.71 22.82 54.71 9.2 49.87 9.2 45.39 9.2"
        />
        <rect class="cls-1" x="48.01" y="22.82" width="6.7" height="6.78" />
        <rect class="cls-1" x="48.01" y="29.59" width="6.7" height="6.84" />
      </g>
      <g id="top" class="top">
        <rect class="cls-1" x="45.39" y="4.66" width="4.49" height="4.54" />
        <polygon
          class="cls-1"
          points="27.23 9.2 27.23 18.28 27.23 22.82 31.76 22.82 31.76 22.75 31.76 22.82 40.85 22.82 40.85 9.2 36.31 9.2 27.23 9.2"
        />
        <polygon
          class="cls-1"
          points="18.16 18.28 27.23 18.28 27.23 9.2 18.16 9.2 18.16 12.35 18.16 18.28"
        />
        <polygon
          class="cls-1"
          points="18.16 22.82 18.16 27.35 27.23 27.35 27.23 22.82 27.23 18.28 18.16 18.28 18.16 22.82"
        />
        <rect class="cls-1" x="49.87" width="4.83" height="4.66" />
        <rect class="cls-1" x="49.87" y="4.66" width="4.83" height="4.54" />
        <rect class="cls-1" x="5.96" width="5.65" height="6.24" />
        <rect class="cls-1" x="11.61" width="6.55" height="6.24" />
        <polygon
          class="cls-1"
          points="18.16 9.2 27.23 9.2 27.23 0 18.16 0 18.16 6.24 18.16 9.2"
        />
        <rect class="cls-1" x="45.39" width="4.49" height="4.66" />
        <rect class="cls-1" x="27.23" width="9.08" height="9.2" />
        <polygon
          class="cls-1"
          points="40.85 9.2 45.39 9.2 45.39 4.66 45.28 4.66 45.39 4.66 45.39 0 36.31 0 36.31 9.2 40.85 9.2"
        />
        <rect class="cls-1" width="5.96" height="6.24" />
      </g>
      <g id="left" class="left">
        <rect class="cls-1" y="12.35" width="5.96" height="5.92" />
        <rect class="cls-1" y="6.24" width="5.96" height="6.12" />
        <rect class="cls-1" y="30.64" width="6.81" height="5.8" />
        <rect class="cls-1" y="24.59" width="6.81" height="6.05" />
        <polygon
          class="cls-1"
          points="18.16 36.43 13.62 36.43 6.81 36.43 0 36.43 0 54.71 18.16 54.71 18.16 45.51 18.16 36.43"
        />
        <polygon
          class="cls-1"
          points="18.16 12.35 18.16 9.2 18.16 6.24 11.61 6.24 11.61 12.35 18.16 12.35"
        />
        <polygon
          class="cls-1"
          points="13.62 22.82 13.62 24.59 13.62 27.35 18.16 27.35 18.16 22.82 13.62 22.82"
        />
        <rect class="cls-1" x="5.96" y="6.24" width="5.65" height="6.12" />
        <polygon
          class="cls-1"
          points="18.16 12.35 11.61 12.35 11.61 18.28 13.62 18.28 13.62 18.22 13.62 18.28 18.16 18.28 18.16 12.35"
        />
        <polygon
          class="cls-1"
          points="13.62 30.64 13.62 31.89 18.16 31.89 18.16 27.35 13.62 27.35 13.62 30.64"
        />
        <rect class="cls-1" x="13.62" y="18.28" width="4.54" height="4.54" />
        <polygon
          class="cls-1"
          points="13.62 30.64 6.81 30.64 6.81 36.43 13.62 36.43 13.62 31.89 13.62 30.64"
        />
        <polygon
          class="cls-1"
          points="11.61 12.35 5.96 12.35 5.96 18.28 6.81 18.28 6.81 18.22 6.81 18.28 11.61 18.28 11.61 12.35"
        />
        <polygon
          class="cls-1"
          points="13.62 27.35 13.62 24.59 6.81 24.59 6.81 30.64 13.62 30.64 13.62 27.35"
        />
        <polygon
          class="cls-1"
          points="13.62 22.82 13.62 18.28 11.61 18.28 6.81 18.28 6.81 24.59 13.62 24.59 13.62 22.82"
        />
        <polygon
          class="cls-1"
          points="6.81 18.28 5.96 18.28 0 18.28 0 24.59 6.81 24.59 6.81 18.28"
        />
        <rect class="cls-1" x="13.62" y="31.89" width="4.54" height="4.54" />
      </g>
    </g>
  </svg>
`;

function initializeGame() {
  const game = document.getElementById("game");
  const bonusDialogue = document.getElementById("dialoguebonus");
    document.getElementById("resume");
    const bonusIcons = document.getElementById("bonuses"),
    bonusscore = document.getElementById("bonusscorewrap"),
    boomboom = document.getElementById("squarecrack");
    Array.from(game.querySelectorAll(".brick"));
    const castle = document.getElementById("castle");
    document.getElementById("console");
    const failDesc = document.getElementById("reason"),
    failDialogue = document.getElementById("dialoguefail"),
    highscorecounter = document.getElementById("highscore"),
    humanscore = document.getElementById("humanscore"),
    levelupContainer = document.getElementById("levelupcontainer"),
    levelupDesc = document.getElementById("levelupdesc"),
    levelupimg = document.getElementById("levelupimg"),
    overlay = document.getElementById("overlay"),
    progress = document.getElementById("progress"),
    progresscontainer = progress.closest(".reload-container"),
    restartbtn = document.getElementById("restart"),
    scanDialogue = document.getElementById("dialoguescan"),
    score = document.getElementById("badscore"),
    startbtn = document.getElementById("start"),
    statusContainer = document.getElementById("statuscontainer"),
    closebtn = document.getElementById("closegame");

  let brickGen,
    fallingBricks,
    totalscore = 0,
    humansfound = 0,
    bonusActivated = false,
    highscore = 0,
    reloaded = true,
    level = 0;

  const brickClass = "brick-wrap",
    humanClass = "human",
    badClass = "badbad";

  const l0limit = 4, // Scanner
    l1limit = 14, // bonus
    l2limit = 45, // Hover level
    l3limit = 120, // spotlight level
    radius = 28;

  function messages(totalscore, newhighscore) {
    // todo: Alert flag for bonusActivated, if bonusarray has all 4 categories
    //  if (bonusActivated ) {
    //   statusContainer.dataset.alert = "bonus";
    //  }
    if (totalscore >= 45) {
      statusContainer.dataset.alert = "bad";
    }
    if (humansfound >= 18) {
      statusContainer.dataset.alert = "human";
    }
    if (newhighscore) {
      highscore = totalscore;
      scoreboardupdate(highscorecounter, highscore.toLocaleString("en-US"));
      if (level !== 0 && totalscore >= 10) {
        // Don't show highscore in the first level
        console.log("highscoressssss");
        statusContainer.dataset.alert = "high-score";
      }
    }
  }

  function levelFind(currentLevel, score) {
    let newlevel;
    switch (currentLevel) {
      case 0:
        newlevel = score >= l0limit ? 1 : currentLevel;
        break;
      case 1:
        newlevel = score >= l2limit ? 2 : currentLevel;
        break;
      case 2:
        newlevel = score >= l3limit ? 3 : currentLevel;
        break;
    }
    // if currentLevel != newlevel
    return newlevel;
  }

  function levelSet(unlock) {
    let desc, img, title;
    function dismissdialogue(elem) {
      let active = true;
      elem.addEventListener("click", dismiss);
      setTimeout(() => {
        dismiss();
      }, 5000);
      function dismiss() {
        if (active) {
          elem.classList.remove("visible");
          resumeGame();
          active = false;
        }
      }
    }

    if (unlock == "scanner") {
      pauseGame();
      revealBoom();
      scanDialogue.classList.add("visible");
      game.classList = "l1";
      dismissdialogue(scanDialogue);
      level = 1;
    } else if (unlock == "bonus") {
      pauseGame();
      bonusDialogue.classList.add("visible");
      bonusActivated = true;
      bonusscore.classList.add("visible");
      dismissdialogue(bonusDialogue);
    } else {
      if (level == 2) {
        revealBoom(true); // Remove
        // hide scanner
        title = "Expert Mode!";
        desc = "Hovering on a square now reveals the entire thing!";
        img = hover;
      } else if (level == 3) {
        title = "Super Expert Mode!";
        desc = "Hovering squares now spotlights them.";
        img = spotlight;
      }
      // For every new level
      game.className = `l${level}`;
      failDialogue.classList = "bonusdialogue levelup visible";
      levelupDesc.innerHTML = desc;
      levelupDesc.previousElementSibling.innerHTML = title;
      levelupimg.src = celebrate;
      levelupContainer.firstElementChild.src = img;
    }
  }

  function scoreboardupdate(elem, num) {
    elem.classList = "animateout";
    elem.addEventListener("animationend", (event) => {
      elem.innerHTML = num.toLocaleString("en-US");
      elem.classList.add("animatein");
    });
  }

  function clearBricks() {
    document.querySelectorAll("." + brickClass).forEach((brick) => {
      brick.remove();
    }); // Delete the brix
  }

  function brickFall() {
    const activeBricks = game.querySelectorAll(
      "div." + brickClass + ":not(.clearing)"
    );
    const low = calcFall(Array.from(activeBricks));
    if (low.hit) {
      // Always if we're 50 away from the bottom
      if (!low.lowbrick.classList.contains("human")) {
        // only explode if we arent human
        explodeBrick(low.lowbrick, "bottom");
      } else {
        low.lowbrick.classList.add("clearing");
        humansfound = humansfound + 1;
        // take lowbrick out of comission
        humanscore.innerHTML = humansfound; // Right now this is a running total
        scoreboardupdate(humanscore, humansfound);
        countIt(low.lowbrick, "human", 1);
        console.log("human hit");
      }
    }
  }

  function calcFall(bricks) {
    let dist = 0,
      i = 0,
      lowbrick,
      hit = false,
      lowvalue = 0;

    const castleposleft = game.offsetWidth / 2 - castle.offsetWidth / 2;
    const castleposright = castleposleft + castle.offsetWidth;
    bricks.forEach((brick) => {
      i++;
      let bottom = game.offsetHeight - 50;
      let multiple = i / 10 < 3 ? i / 10 : 3; // Cap out at 3
      let rate = 1 + multiple; // Get faster as we produce more
      dist = parseInt(brick.style.top);
      brick.style.top = `${(dist += 5 * rate)}px`; // set the new top val

      // Logic for castle position
      let brickright = parseInt(brick.style.left);
      let brickleft = brickright + brick.offsetWidth;
      // if we're in the castle area, reset bottom value to less
      if (brickleft >= castleposleft && brickright <= castleposright) {
        bottom = bottom - castle.offsetHeight;
      }

      if (dist > lowvalue) {
        // Are we the lowest?
        lowvalue = dist;
        lowbrick = brick;
        hit = lowvalue + brick.offsetHeight >= bottom ? true : false; //are we the bottom?
      }
    });

    return {
      lowvalue,
      lowbrick,
      hit,
    };
  }

  function addBrick(bonusActivated, level) {
    bonusActivated = bonusActivated ? bonusActivated : false;
    let brickWrap = document.createElement("div");
    let brick = document.createElement("div");

    // Set the brick's initial position and speed
    brickWrap.classList.add(brickClass);
    brick.classList.add("brick");
    brickWrap.style.left = Math.random() * (game.offsetWidth - 70) + "px";
    brickWrap.style.top = "0px";
    brickWrap.style.transition = "top 500ms linear";

    // Choose a random type for the brick
    let type = Math.random();
    if (type < 0.233) {
      brickWrap.classList.add(humanClass);
    } else if (type < 0.33) {
      if (bonusActivated == true) {
        let bonus =
          type <= 0.24
            ? "bike"
            : type <= 0.27
            ? "stoplight"
            : type <= 0.3
            ? "crosswalk"
            : "hydrant";
        brickWrap.setAttribute("data-bonus", bonus);
        brickWrap.classList.add(bonus, "bonus");
      } else {
        brickWrap.classList.add(humanClass);
      }
    } else {
      brickWrap.classList.add(badClass);
    }
    // Add the brick to the game
    game.appendChild(brickWrap).appendChild(brick);
    // Add the the brick to the bricks
    // bricks.push(brickWrap);

    if (level == 3) {
      // todo: migrating all level settings to a single place
      brickMouseListen(brickWrap);
    }
  }

  let activebrick;

  function brickMouseListen(brick) {
    brick.addEventListener("mouseenter", (event) => {
      activebrick = brick;
    });
    brick.addEventListener("mouseleave", (event) => {
      // remove clip and active path
      brick.children[0].style["-webkit-clip-path"] = "inset(100%)";
      brick.children[0].style["clip-path"] = "inset(100%)";
      activebrick = undefined;
    });
  }

  function updatepos(event) {
    if (activebrick != undefined) {
      let x = event.clientX,
        y = event.clientY,
        elem = activebrick.children[0],
        pos = elem.getBoundingClientRect();

      x = x - pos.left;
      y = y - pos.top;
      let circle = `circle(${radius}px at ${x}px ${y}px)`;
      elem.style["-webkit-clip-path"] = circle;
      elem.style["clip-path"] = circle;
    }
  }

  function updateProgress() {
    let complete = 0;
    progresscontainer.classList.remove("ready");
    progress.value = complete;
    reloaded = false;

    let updator = setInterval(() => {
      // update progress
      complete = complete + 5;
      progress.value = complete;
    }, 100);

    setTimeout(() => {
      reloaded = true;
      progresscontainer.classList.add("ready");
      clearInterval(updator);
    }, 2000);
  }

  function getBricks() {
    let allbricks = Array.from(document.querySelectorAll(`.${brickClass}`));
    return allbricks;
  }

  function revealBoom(remove) {
    // listen for space keypress
    let scanner = function (event) {
      if (
        (event.key === "r" && reloaded) ||
        (event.key == "R" && reloaded) ||
        (event.key == " " && reloaded)
      ) {
        event.preventDefault();
        // Do this on mobile, also display it in CSS
        updateProgress();
        overlay.classList.add("scan");
        overlay.addEventListener("animationend", () => {
          overlay.classList.remove("scan");
        });

        let bricks = getBricks();
        bricks.forEach((brick) => {
          brick.classList.add("peekaboo");
          setTimeout(() => {
            brick.classList.remove("peekaboo");
          }, 1000);
        });
      } else {
        return;
      }
    };
    if (remove) {
      document.removeEventListener("keydown", scanner, false);
      progresscontainer.classList.remove("visible");
      console.log("REMOVE REMOVE REMOVE");
    } else {
      progresscontainer.classList.add("visible");
      document.addEventListener("keydown", scanner, false);
    }
  }

  function explodeBrick(target, reason) {
    target.appendChild(boomboom); // Put the svg into the brick
    target.classList.add("splode", "clicked");
    pauseGame(); // Stop the listen
    let icon = document.createElement("i");
    icon.classList.add("material-symbols-rounded", "warn");
    // icon.innerHTML = "priority_high"; // Add this back for afloating exclamation on click
    target.appendChild(icon);
    target.addEventListener("animationend", (e2) => {
      let time = 0;
      if (e2.animationName == "bottom1" && time == 0) {
        gameOver(reason); // Second animation, not the first
      }
    });
  }

  function handleClick(event) {
    let target = event.target;
    if (target.classList.contains(brickClass)) {
      if (target.classList.contains(humanClass)) {
        explodeBrick(target, humanClass);
      } else if (target.classList.contains("bonus")) {
        countIt(target, "bonus", 1, target.dataset.bonus);
      } else {
        countIt(target, "bad", 1);
      }
    }
  }

  function countIt(target, type, amount, icon) {
    target.classList.add("zap");
    let scorecontainer = document.createElement("h4");
    scorecontainer.classList.add("addscore");
    if (type == "bad") {
      totalscore = totalscore + amount;
      if (level == 0 && totalscore == 3 && bonusActivated != true) {
        // change to 10
        levelFind(level, totalscore);
        levelSet("scanner");
      } else if (
        level == 1 &&
        totalscore == l1limit &&
        bonusActivated != true
      ) {
        levelFind(level, totalscore);
        bonusActivated = true;
        levelSet("bonus");
      }
      scoreboardupdate(score, totalscore);
      scorecontainer.innerHTML = "+" + amount; // add floating +1
    } else if (type == "bonus") {
      if (bonusIcons.querySelector("." + icon) == null) {
        // todo: push icon to a bonuslist array if it's unique
        let bonusicon = document.createElement("span");
        bonusicon.classList.add("material-symbols-outlined", icon, "bonuses");
        bonusIcons.appendChild(bonusicon);
      }
    } else {
      //human
      scorecontainer.innerHTML = "+" + amount;
    }
    target.appendChild(scorecontainer);
    scorecontainer.addEventListener("animationend", () => {
      target.remove();
    });
  }
  //
  // Game lifecycle
  //
  function startGame(isfirst) {
    if (isfirst == true) {
      const introwrap = document.querySelectorAll(".intro")[0];
      introwrap.classList.add("out");
      introwrap.addEventListener("transitionend", (event) => {
        introwrap.remove();
      });
      addBrick(false, level);
    } else {
      addBrick(bonusActivated, level); // Show bonus bricks
    }
    if (level == 3) {
      document.addEventListener("mousemove", updatepos);
    } else {
      document.removeEventListener("mousemove", updatepos);
    }
    resumeGame();
  }

  function restartGame() {
    clearBricks();
    game.removeEventListener("click", handleClick);
    failDialogue.classList.remove("visible");
    score.innerHTML = 0;
    statusContainer.dataset.alert = ""; // remove alerts
    startGame(false); // add brick challenge if restarting
  }

  function pauseGame() {
    clearInterval(fallingBricks); // Stop the tracker
    clearInterval(brickGen); // Stop the drop
    game.removeEventListener("click", handleClick); // pause clicks
  }

  function resumeGame() {
    game.addEventListener("click", handleClick); // pause clicks
    brickGen = setInterval(() => {
      addBrick(bonusActivated, level);
    }, 900); // adjust to 900
    fallingBricks = setInterval(() => {
      brickFall();
    }, 100); //adjust to 100
  }

  function gameOver(reason) {
    let newhighscore = totalscore > highscore ? true : false;
    const desc =
      reason == humanClass
        ? "A human was mistaken as a bad."
        : "A bad slipped by and got to the castle.";
    const goodcount = document.getElementById("humancount"),
      badcount = document.getElementById("badcount");

    messages(totalscore, newhighscore);
    if (levelFind(level, totalscore) > level) {
      // New level
      level = levelFind(level, totalscore);
      levelSet();
    } else {
      // No new level
      failDialogue.classList = "bonusdialogue fail visible"; // hide the extra dialogue
      levelupimg.src = badFly;
    }
    const humantext =
      humansfound > 1
        ? ` still saved ${humansfound} humans.`
        : ` can try again forever.`;
    failDesc.innerHTML = desc;
    badcount.innerHTML = totalscore; // update bad num
    goodcount.innerHTML = humantext;
    // Regardless
    // levelupDialogue.classList.add("visible"); // show the dialogue
    clearInterval(fallingBricks); // Stop the tracker
    clearInterval(brickGen); // Stop the drop
    totalscore = 0;
    clearBricks();
  }
  function goodbye() {
    const baseurl = window.location.href.split("#")[0];
    window.location = baseurl;
  }

  // Init
  const start = () => startGame(true);
  const resume = () => {
    restartGame();
    restartbtn.blur();
  };
  startbtn.addEventListener("click", start);
  restartbtn.addEventListener("click", resume);
  closebtn.addEventListener("click", goodbye);

  return () => {
    startbtn.removeEventListener("click", start);
    restartbtn.removeEventListener("click", resume);
  };
}

var stoplight = "../demoasset/item-stoplight-53247b633eed5a85.svg";

// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

const STEPS = ["home", "signup", "login", "store", "comment", "game"];

const DEFAULT_STEP = "home";

const ACTIONS = {
  comment: "send_comment",
  home: "home",
  login: "log_in",
  signup: "sign_up",
  store: "check_out",
  game: undefined,
};

const FORMS = {
  comment: "FORM_COMMENT",
  home: "FORM_HOME",
  login: "FORM_LOGIN",
  signup: "FORM_SIGNUP",
  store: "FORM_STORE",
  game: undefined,
};

const GUIDES = {
  comment: "GUIDE_COMMENT",
  home: "GUIDE_HOME",
  login: "GUIDE_LOGIN",
  signup: "GUIDE_SIGNUP",
  store: "GUIDE_STORE",
  game: undefined,
};

const LABELS = {
  comment: "Post comment",
  home: "View examples",
  login: "Log in",
  signup: "Sign up",
  store: "Buy now",
  game: undefined,
};

const RESULTS = {
  comment: "RESULT_COMMENT",
  home: "RESULT_HOME",
  login: "RESULT_LOGIN",
  signup: "RESULT_SIGNUP",
  store: "RESULT_STORE",
  game: undefined,
};

const getGame = (step) => {
  if (step === "game") {
    return gameHTML;
  }
  return A;
};

class RecaptchaDemo extends s {
  static get styles() {
    return demoCSS;
  }

  static properties = {
    /* Initial */
    animating: { type: Boolean, state: true, attribute: false },
    drawerOpen: { type: Boolean, state: true, attribute: false },
    sitemapOpen: { type: Boolean, state: true, attribute: false },
    step: { type: String },
    /* Result */
    score: { type: String },
    label: { type: String },
    reason: { type: String },
  };

  constructor() {
    super();
    /* Initial */
    this.animating = false;
    this.drawerOpen = true;
    this.sitemapOpen = false;
    this._step = DEFAULT_STEP;
    this.step = this._step;
    /* Result */
    this._score = undefined;
    this.score = this._score;
    this.label = undefined;
    this.reason = undefined;
    /* Other */
    this.cleanupGame = () => {};
    /* In the year of our lord 2023 */
    this._syncGameState = this.syncGameState.bind(this);
  }

  connectedCallback() {
    super.connectedCallback();
    this.syncGameState();
    window.addEventListener("hashchange", this._syncGameState);
    window.addEventListener("popstate", this._syncGameState);
  }

  disconnectedCallback() {
    this.syncGameState();
    window.removeEventListener("hashchange", this._syncGameState);
    window.removeEventListener("popstate", this._syncGameState);
    super.disconnectedCallback();
  }

  /* TODO: better/more reliable way to sync game state */
  syncGameState() {
    if (window.location.hash === "#game") {
      this.goToGame();
      return;
    }
    if (this.step === "game") {
      const stepFromRoute =
        STEPS.find((step) => {
          return window.location.pathname.includes(step);
        }) || DEFAULT_STEP;
      this.step = stepFromRoute;
      this.cleanupGame();
      this.renderGame();
    }
  }

  /* TODO: better/more reliable way to change button state */
  set score(value) {
    let oldValue = this._score;
    this._score = value;
    this.requestUpdate("score", oldValue);
    const buttonElement = document.querySelector("recaptcha-demo > button");
    if (buttonElement && this._score) {
      // TODO: redesign per b/278563766
      let updateButton = () => {};
      if (this.step === "comment") {
        updateButton = () => {
          buttonElement.innerText = "Play the game!";
        };
      } else {
        updateButton = () => {
          buttonElement.innerText = "Go to next demo";
        };
      }
      window.setTimeout(updateButton, 100);
    }
  }

  get score() {
    return this._score;
  }

  /* TODO: better/more reliable way to change button state */
  set step(value) {
    let oldValue = this._step;
    this._step = value;
    this.requestUpdate("step", oldValue);
    const buttonElement = document.querySelector("recaptcha-demo > button");
    if (buttonElement && !this.score) {
      buttonElement.innerText = LABELS[this._step];
    }
  }

  get step() {
    return this._step;
  }

  toggleDrawer() {
    this.animating = true;
    this.drawerOpen = !this.drawerOpen;
  }

  toggleSiteMap() {
    this.animating = true;
    this.sitemapOpen = !this.sitemapOpen;
  }

  goToGame() {
    this.animating = true;
    this.drawerOpen = false;
    this.sitemapOpen = false;
    this.step = "game";
    this.renderGame();
    window.setTimeout(() => {
      this.cleanupGame();
      this.cleanupGame = initializeGame();
    }, 1);
  }

  goToResult() {
    this.animating = true;
    const resultElement = this.shadowRoot.getElementById("result");
    const topOffset =
      Number(resultElement.getBoundingClientRect().top) +
      Number(resultElement.ownerDocument.defaultView.pageYOffset);
    window.setTimeout(() => {
      window.location.hash = "#result";
      window.scrollTo(0, topOffset);
    }, 100);
  }

  goToNextStep() {
    const nextIndex = STEPS.indexOf(this.step) + 1;
    const nextStep = STEPS[nextIndex] || DEFAULT_STEP;
    if (nextStep === "game") {
      this.goToGame();
      return;
    }
    this.animating = true;
    window.location.assign(`${window.location.origin}/${nextStep}`);
    // Don't need to assign this.step because of full page redirect
    return;
  }

  handleAnimation() {
    const currentlyRunning = this.shadowRoot.getAnimations({ subtree: true });
    this.animating = Boolean(currentlyRunning?.length || 0);
  }

  handleSlotchange() {
    // TODO: remove if not needed
  }

  handleSubmit() {
    if (this.score && this.label) {
      this.goToNextStep();
      return;
    }
    this.goToResult();
    // TODO: interrogate slotted button for callback?
  }

  renderGame() {
    B(getGame(this.step), document.body);
  }

  get BAR() {
    return x`
      <nav aria-label="Main Menu" id="bar">
        <h1 class="h1">BadFinder</h1>
        <h2 class="h2">
          A reCAPTCHA <abbr title="Demonstration">demo</abbr> site
        </h2>
        <mwc-icon-button
          @click=${this.toggleSiteMap}
          aria-controls="sitemap"
          aria-expanded="${this.sitemapOpen ? "true" : "false"}"
          aria-label="${this.sitemapOpen ? "Show site map" : "Hide site map"}"
          class="sitemapIcon"
          icon="${this.sitemapOpen ? "close" : "menu"}"
        ></mwc-icon-button>
      </nav>
    `;
  }

  get BUTTON() {
    return x`
      <div class="fields">
        <slot
          @click=${this.handleSubmit}
          @slotchange=${this.handleSlotchange}
        ></slot>
      </div>
    `;
  }

  get CONTENT() {
    return x`
      <main id="content">
        <div class="sticky">
          <div class="relative">
            <!-- bar -->
            ${this.BAR}
            <!-- forms -->
            ${this[FORMS[this.step]]}
            <!-- sitemap -->
            ${this.SITEMAP}
          </div>
        </div>
      </main>
    `;
  }

  get DRAWER() {
    return x`
      <aside id="drawer">
        <mwc-icon-button
          @click=${this.toggleDrawer}
          ?disabled=${this.step === "game"}
          aria-controls="drawer"
          aria-expanded="${this.drawerOpen ? "true" : "false"}"
          aria-label="${this.drawerOpen
            ? "Close the information panel"
            : "Open the information panel"}"
          class="drawerIcon"
          icon="${this.drawerOpen ? "close" : "code"}"
        ></mwc-icon-button>
        ${this[GUIDES[this.step]]}
        <p class="disclaimer">
          Response is shown here for convenience. We recommend using a backend
          to hide scores and reCAPTCHA responses for security reasons.
        </p>
      </aside>
    `;
  }

  get EXAMPLE() {
    return x`
      <!-- drawer -->
      ${this.DRAWER}
      <!-- content -->
      ${this.CONTENT}
    `;
  }

  get FORM_COMMENT() {
    return x`
      <form id="example">
        <fieldset>
          <legend><h3 class="h3">Comment form</h3></legend>
          <p>Click the "post comment" button to see if you can post or not.</p>
          <div class="fields">
            <label>
              <span>Comment</span>
              <textarea disabled>Great job protecting your users!</textarea>
            </label>
          </div>
        </fieldset>
        ${this.BUTTON}
      </form>
    `;
  }

  get FORM_HOME() {
    return x`
      <section id="example" class="home">
        <h3 class="h3">Stop the bad</h3>
        <p>
          BadFinder is a pretend world that's kinda like the real world. It's
          built to explore the different ways of using reCAPTCHA Enterprise to
          protect web sites and applications.
        </p>
        <p>
          Play the game, search the store, view the source, or just poke around
          and have fun!
        </p>
        <button @click=${this.goToNextStep} class="button" type="button">
          View examples
        </button>
      </section>
    `;
  }

  get FORM_LOGIN() {
    return x`
      <form id="example">
        <fieldset>
          <legend><h3 class="h3">Log in</h3></legend>
          <p>Click the "log in" button to see your score.</p>
          <div class="fields">
            <label>
              <span>Email</span>
              <input type="email" value="user@example.com" disabled />
            </label>
            <label>
              <span>Password</span>
              <input type="password" value="password" disabled />
            </label>
          </div>
        </fieldset>
        ${this.BUTTON}
      </form>
    `;
  }

  get FORM_SIGNUP() {
    return x`
      <form id="example">
        <fieldset>
          <legend><h3 class="h3">Secure Sign up</h3></legend>
          <p>
            Use with sign up forms to verify new accounts. Click the "sign up"
            button to see your score.
          </p>
          <div class="fields">
            <label>
              <span>Email</span>
              <input type="email" value="user@example.com" disabled />
            </label>
            <label>
              <span>Password</span>
              <input type="password" value="password" disabled />
            </label>
            <label>
              <span>Confirm Password</span>
              <input type="password" value="password" disabled />
            </label>
          </div>
        </fieldset>
        ${this.BUTTON}
      </form>
    `;
  }

  get FORM_STORE() {
    return x`
      <form id="example">
        <fieldset>
          <legend><h3 class="h3">Safe stores</h3></legend>
          <p>
            Add reCAPTCHA to stores and check out wizards to prevent fraud.
            Click the "buy now" button to see your score.
          </p>
          <div class="fields">
            <dl class="unstyled cart">
              <div class="item hydrant">
                <dt>
                  <img alt="Demo Product Hydrant" src="${hydrant$1}" />
                </dt>
                <dd>Hydrant</dd>
                <dd>
                  <label>
                    <span>Amount</span>
                    <input type="number" value="1" disabled />
                  </label>
                </dd>
              </div>
              <div class="item stoplight">
                <dt>
                  <img alt="Demo Product Stoplight" src="${stoplight}" />
                </dt>
                <dd>Stoplight</dd>
                <dd>
                  <label>
                    <span>Amount</span>
                    <input type="number" value="1" disabled />
                  </label>
                </dd>
              </div>
            </dl>
            <label>
              <span>Credit card</span>
              <input type="text" value="7777-8888-3333-2222" disabled />
            </label>
          </div>
        </fieldset>
        ${this.BUTTON}
      </form>
    `;
  }

  get GUIDE_CODE() {
    return `
    {
      "event": {
        "expectedAction": "${ACTIONS[this.step]}",
        ...
      },
      ...
      "riskAnalysis": {
        "reasons": [],
        "score": "${this.score || "?.?"}"
      },
      "tokenProperties": {
        "action": "${ACTIONS[this.step]}",
        ...
        "valid": ${this.reason !== 'Invalid token'}
      },
    }`
      .replace(/^([ ]+)[}](?!,)/m, "}")
      .replace(/([ ]{6})/g, "  ")
      .trim();
  }

  get GUIDE_COMMENT() {
    return x`
      <div id="guide">
        <div class="mask">
          <section class="text pattern">
            <h4 class="h1">Pattern</h4>
            <h5 class="h2">Prevent spam</h5>
            <p>
              Add reCAPTCHA to comment/ feedback forms and prevent bot-generated comments.
            </p>

            <a
              class="documentation"
              href="https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages#user-action"
              target="_blank"
              ><span>Learn more</span><mwc-icon>launch</mwc-icon></a
            >
          </section>
          ${this[RESULTS[this.step]]}
        </div>
      </div>
    `;
  }

  get GUIDE_HOME() {
    return x`
      <div id="guide">
        <div class="mask">
          <section class="text pattern">
            <h4 class="h1">Pattern</h4>
            <h5 class="h2">Protect your entire site</h5>
            <p>
              Add reCAPTCHA to user interactions across your entire site.
              Tracking the behavior of legitimate users and bad ones between
              different pages and actions will improve scores.
              Click VIEW EXAMPLES to begin!
            </p>
          </section>
          ${this[RESULTS[this.step]]}
        </div>
      </div>
    `;
  }

  get GUIDE_LOGIN() {
    return x`
      <div id="guide">
        <div class="mask">
          <section class="text pattern">
            <h4 class="h1">Pattern</h4>
            <h5 class="h2">Prevent malicious log in</h5>
            <p>
              Add reCAPTCHA to user actions like logging in to prevent malicious
              activity on user accounts.
            </p>
            <a
              class="documentation"
              href="https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages#user-action"
              target="_blank"
              ><span>Learn more</span><mwc-icon>launch</mwc-icon></a
            >
          </section>
          ${this[RESULTS[this.step]]}
        </div>
      </div>
    `;
  }

  get GUIDE_SCORE() {
    const score = this.score && this.score.slice(0, 3);
    const percentage = score && Number(score) * 100;
    let card = null;
    switch (this.label) {
      case "Not Bad":
        card = x`
          <p>reCAPTCHA is ${percentage || "???"}% confident you're not bad.</p>
          <img alt="Not Bad" src="${human}" />
        `;
        break;
      case "Bad":
        card = x`
          <p>Suspicious request. Reason: "${this.reason}".</p>
          <img alt="Bad" src="${badbad}" />
        `;
        break;
      default:
        card = x`
          <p>
            reCAPTCHA hasn't been run on this page yet. Click a button or
            initiate an action to run.
          </p>
          <img alt="Unknown" src="${badmorph}" />
        `;
    }
    return x`
      <div id="label">
        <div id="score">
          <div class="score">${score || "–"}</div>
          ${card}
        </div>
      </div>
    `;
  }

  get GUIDE_SIGNUP() {
    return x`
      <div id="guide">
        <div class="mask">
          <section class="text pattern">
            <h4 class="h1">Pattern</h4>
            <h5 class="h2">Run on sign up</h5>
            <p>
              Add reCAPTCHA to user interactions like signing up for new user
              accounts to prevent malicious actors from creating accounts.
            </p>
            <a
              class="documentation"
              href="https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages#html-button"
              target="_blank"
              ><span>Learn more </span><mwc-icon>launch</mwc-icon></a
            >
          </section>
          ${this[RESULTS[this.step]]}
        </div>
      </div>
    `;
  }

  get GUIDE_STORE() {
    return x`
      <div id="guide">
        <div class="mask">
          <section class="text pattern">
            <h4 class="h1">Pattern</h4>
            <h5 class="h2">Prevent fraud</h5>
            <p>
              Add reCAPTCHA to user interactions like checkout, or add to cart
              buttons on payment pages or check out wizards to prevent fraud.
            </p>

            <a
              class="documentation"
              href="https://cloud.google.com/recaptcha-enterprise/docs/instrument-web-pages#user-action"
              target="_blank"
              ><span>Learn more</span><mwc-icon>launch</mwc-icon></a
            >
          </section>
          ${this[RESULTS[this.step]]}
        </div>
      </div>
    `;
  }

  get RESULT_COMMENT() {
    return x`
      <section id="result" class="text result">
        <h4 class="h1">Result</h4>
        ${this.GUIDE_SCORE}

        <section class="response">
          <h5 class="h1">Response Details</h5>

          <div class="code">
            <code>
              <pre>${this.GUIDE_CODE}</pre>
            </code>
          </div>
          <a
            class="log disabled"
            href="https://cloud.google.com/recaptcha-enterprise/docs/create-assessment"
            target="_blank"
            ><mwc-icon>description</mwc-icon><span>View Log</span></a
          >
        </section>
      </section>
    `;
  }

  get RESULT_HOME() {
    return x`
      <section id="result" class="text result">
        <h4 class="h1">Result</h4>
        ${this.GUIDE_SCORE}
        <section class="response">
          <h5 class="h1">Response Details</h5>

          <div class="code">
            <code>
              <pre>${this.GUIDE_CODE}</pre>
            </code>
          </div>
          <a
            class="log disabled"
            href="https://cloud.google.com/recaptcha-enterprise/docs/create-assessment"
            target="_blank"
            ><mwc-icon>description</mwc-icon><span>View Log</span></a
          >
          <p class="scoreExample">
            Use score responses to take or prevent end-user actions in the
            background. For example, filter scrapers from traffic statistics.
          </p>
        </section>
      </section>
    `;
  }

  get RESULT_LOGIN() {
    return x`
      <section id="result" class="text result">
        <h4 class="h1">Result</h4>
        ${this.GUIDE_SCORE}
        <section class="response">
          <h5 class="h1">Response Details</h5>
          <div class="code">
            <code>
              <pre>${this.GUIDE_CODE}</pre>
            </code>
          </div>
          <a
            class="log disabled"
            href="https://cloud.google.com/recaptcha-enterprise/docs/create-assessment"
            target="_blank"
            ><mwc-icon>description</mwc-icon><span>View log</span></a
          >
          <p class="scoreExample">
            Use score responses to take or prevent end-user actions in the
            background. For example, require a second factor to log in (MFA).
          </p>
        </section>
      </section>
    `;
  }

  get RESULT_SIGNUP() {
    return x`
      <section id="result" class="text result">
        <h4 class="h1">Result</h4>
        ${this.GUIDE_SCORE}
        <section class="response">
          <h5 class="h1">Response Details</h5>
          <div class="code">
            <code>
              <pre>${this.GUIDE_CODE}</pre>
            </code>
          </div>
          <a
            class="log disabled"
            href="https://cloud.google.com/recaptcha-enterprise/docs/create-assessment"
            target="_blank"
            ><mwc-icon>description</mwc-icon><span>View Log</span></a
          >
          <p class="scoreExample">
            Use score responses to take or prevent end-user actions in the
            background. For example, require email verification using MFA.
          </p>
        </section>
      </section>
    `;
  }

  get RESULT_STORE() {
    return x`
      <section id="result" class="text result">
        <h4 class="h1">Result</h4>
        ${this.GUIDE_SCORE}
        <section class="response">
          <h5 class="h1">Response Details</h5>
          <div class="code">
            <code>
              <pre>${this.GUIDE_CODE}</pre>
            </code>
          </div>
          <a
            class="log disabled"
            href="https://cloud.google.com/recaptcha-enterprise/docs/create-assessment"
            target="_blank"
            ><mwc-icon>description</mwc-icon><span>View Log</span></a
          >
          <p class="scoreExample">
            Use score responses to take or prevent end-user actions in the
            background. For example, queue risky transactions for manual review.
          </p>
        </section>
      </section>
    `;
  }

  get SITEMAP() {
    const tabindex = this.sitemapOpen ? "0" : "-1";
    return x`
      <nav id="sitemap">
        <div class="fade">
          <ul class="unstyled links">
            <li class="home">
              <a href="/" tabindex=${tabindex}>Home</a>
            </li>
            <li class="comments">
              <a href="/comment" tabindex=${tabindex}>Comments</a>
            </li>
            <li class="game">
              <a @click=${this.goToGame} href="#game" tabindex=${tabindex}
                >The game</a
              >
            </li>
            <li class="login">
              <a href="/login" tabindex=${tabindex}>Log in</a>
            </li>
            <li class="signup">
              <a href="/signup" tabindex=${tabindex}>Sign up</a>
            </li>
            <li class="store">
              <a href="/store" tabindex=${tabindex}>Store</a>
            </li>
          </ul>
          <section>
            <h3 class="h1">About</h3>
            <p>
              BadFinder is a pretend world that's kinda like the real world.
              It's built to explore the different ways of using reCAPTCHA
              Enterprise to protect web sites and applications.
            </p>
            <p>
              Play the game, search the store, view the source, or just poke
              around and have fun!
            </p>
          </section>
        </div>
      </nav>
    `;
  }

  render() {
    return x`
      <div
        @animationend=${this.handleAnimation}
        @animationstart=${this.handleAnimation}
        @transitionend=${this.handleAnimation}
        @transitionstart=${this.handleAnimation}
        class="${o({
          [this.step]: true,
          animating: this.animating,
          drawerOpen: this.step !== "game" && this.drawerOpen,
          drawerClosed: this.step === "game" || !this.drawerOpen,
          scored: this.score && this.label,
          sitemapOpen: this.sitemapOpen,
          sitemapClosed: !this.sitemapOpen,
          unscored: !this.score || !this.label,
        })}"
        id="demo"
      >
        ${this.EXAMPLE}
      </div>
    `;
  }
}

customElements.define("recaptcha-demo", RecaptchaDemo);
