UNPKG

vue-carousel-3d

Version:

Beautiful, flexible and touch supported 3D Carousel for Vue.js

163 lines โ€ข 144 kB
System.register([],(function(t){"use strict";return{execute:function(){t({$:function(t,e){var n,i;const r=null!==(n=null==e?void 0:e.selector)&&void 0!==n?n:".js-session-resumable",o=`${null!==(i=null==e?void 0:e.keyPrefix)&&void 0!==i?i:"session-resume:"}${t}`,s=[];for(const l of document.querySelectorAll(r))(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&s.push(l);const a=s.filter(t=>function(t){return t.id&&t.value!==t.defaultValue&&t.form!==Xr}(t)).map(t=>[t.id,t.value]);if(a.length)try{sessionStorage.setItem(o,JSON.stringify(a))}catch(c){}},A:function(t){Ot.push(t)},G:function(t=document){let e=!1;const n=new MutationObserver(t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)Ce(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&Te(t)});return n.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-action"]}),{get closed(){return e},unsubscribe(){e=!0,n.disconnect()}}},H:function(t){let e=!1,n=null;function i(t,e,n,i=!1){e instanceof HTMLInputElement&&(e.indeterminate=i,e.checked!==n&&(e.checked=n,setTimeout(()=>{const n=new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{relatedTarget:t}});e.dispatchEvent(n)})))}function r(r){const o=r.target;o instanceof Element&&(o.hasAttribute("data-check-all")?function(e){if(e instanceof CustomEvent&&e.detail){const{relatedTarget:t}=e.detail;if(t&&t.hasAttribute("data-check-all-item"))return}const r=e.target;if(!(r instanceof HTMLInputElement))return;n=null;for(const n of t.querySelectorAll("[data-check-all-item]"))i(r,n,r.checked);r.indeterminate=!1,s()}(r):o.hasAttribute("data-check-all-item")&&function(r){if(r instanceof CustomEvent&&r.detail){const{relatedTarget:t}=r.detail;if(t&&(t.hasAttribute("data-check-all")||t.hasAttribute("data-check-all-item")))return}const o=r.target;if(!(o instanceof HTMLInputElement))return;const a=Array.from(t.querySelectorAll("[data-check-all-item]"));if(e&&n){const[t,e]=[a.indexOf(n),a.indexOf(o)].sort();for(const n of a.slice(t,+e+1||9e9))i(o,n,o.checked)}e=!1,n=o;const c=t.querySelector("[data-check-all]");if(c){const t=a.length,e=a.filter(t=>t instanceof HTMLInputElement&&t.checked).length;i(o,c,e===t,t>e&&e>0)}s()}(r))}function o(t){if(!(t.target instanceof Element))return;(t.target instanceof HTMLLabelElement&&t.target.control||t.target).hasAttribute("data-check-all-item")&&(e=t.shiftKey)}function s(){const e=t.querySelector("[data-check-all-count]");if(e){const n=t.querySelectorAll("[data-check-all-item]:checked").length;e.textContent=n.toString()}}return t.addEventListener("mousedown",o),t.addEventListener("change",r),{unsubscribe:()=>{t.removeEventListener("mousedown",o),t.removeEventListener("change",r)}}},M:function(t,e){0===Object.keys(Bt.children).length&&document.addEventListener("keydown",Kt);const n=function(t){return t.split(",").map(t=>t.split(" "))}(e||t.getAttribute("data-hotkey")||"").map(e=>Bt.insert(e).add(t));Wt.set(t,n)},N:function(t){const e=Wt.get(t);if(e&&e.length)for(const n of e)n&&n.delete(t);0===Object.keys(Bt.children).length&&document.removeEventListener("keydown",Kt)},O:function(t){return t.split("\n").reduce((function(t,e){var n=function(t){var e=Tr.exec(t);if(!e)return null;var n=e[2]&&0===e[2].indexOf("native"),i=e[2]&&0===e[2].indexOf("eval"),r=Lr.exec(e[2]);i&&null!=r&&(e[2]=r[1],e[3]=r[2],e[4]=r[3]);return{file:n?null:e[2],methodName:e[1]||"<unknown>",arguments:n?[e[2]]:[],lineNumber:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}(e)||function(t){var e=Mr.exec(t);if(!e)return null;return{file:e[2],methodName:e[1]||"<unknown>",arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}}(e)||function(t){var e=Cr.exec(t);if(!e)return null;var n=e[3]&&e[3].indexOf(" > eval")>-1,i=Sr.exec(e[3]);n&&null!=i&&(e[3]=i[1],e[4]=i[2],e[5]=null);return{file:e[3],methodName:e[1]||"<unknown>",arguments:e[2]?e[2].split(","):[],lineNumber:e[4]?+e[4]:null,column:e[5]?+e[5]:null}}(e)||function(t){var e=Hr.exec(t);if(!e)return null;return{file:e[2],methodName:e[1]||"<unknown>",arguments:[],lineNumber:+e[3],column:e[4]?+e[4]:null}}(e)||function(t){var e=Nr.exec(t);if(!e)return null;return{file:e[3],methodName:e[1]||"<unknown>",arguments:[],lineNumber:+e[4],column:e[5]?+e[5]:null}}(e);return n&&t.push(n),t}),[])},P:function(t,e){return $r(t,e),{unsubscribe:()=>{!function(t){const e=qr.get(t);if(null==e)return;qr.delete(t),Fr-=1,0===Fr&&document.removeEventListener("keydown",Vr);e.copyMarkdown&&t.removeEventListener("copy",Br)}(t)}}},Q:Wr,S:L,U:jr,V:Ur,W:function(t){qt.push(t)},Y:function(t){Xr=t.target,setTimeout((function(){t.defaultPrevented&&(Xr=null)}),0)},Z:function(t,e){var n;const i=`${null!==(n=null==e?void 0:e.keyPrefix)&&void 0!==n?n:"session-resume:"}${t}`;let r;try{r=sessionStorage.getItem(i)}catch(s){}if(!r)return;try{sessionStorage.removeItem(i)}catch(a){}const o=[];for(const[c,l]of JSON.parse(r)){const t=new CustomEvent("session:resume",{bubbles:!0,cancelable:!0,detail:{targetId:c,targetValue:l}});if(document.dispatchEvent(t)){const t=document.getElementById(c);t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.value===t.defaultValue&&(t.value=l,o.push(t))}}setTimeout((function(){for(const t of o)t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))}),0)},_:
/*! *****************************************************************************
      Copyright (c) Microsoft Corporation. All rights reserved.
      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 http://www.apache.org/licenses/LICENSE-2.0

      THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
      KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
      WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
      MERCHANTABLITY OR NON-INFRINGEMENT.

      See the Apache Version 2.0 License for specific language governing permissions
      and limitations under the License.
      ***************************************************************************** */
function(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},a:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=!!i.capture,o=r?F:q,s=o[t];s||(s=new L,o[t]=s,document.addEventListener(t,z,r));s.add(e,n)},a8:function(t=0,e={}){return(n,i,r)=>{if(!r||"function"!=typeof r.value)throw new Error("debounce can only decorate functions");const o=r.value;r.value=T(o,t,e),Object.defineProperty(n,i,r)}},ab:function(t){return t&&t.default||t},b:function(t,e,n){const i=n||HTMLElement,r=t.querySelector(e);if(r instanceof i)return r;throw new QueryError(`Element not found: <${i.name}> ${e}`)},c:function(t,e,n){const i=n||HTMLElement,r=t.closest(e);if(r instanceof i)return r;throw new QueryError(`Element not found: <${i.name}> ${e}`)},d:T,f:function(t,e,n){return t.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */,g:function(t,e){const n=t.getAttribute(e);if(null!=n)return n;throw new QueryError(`Attribute not found on element: ${e}`)}
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */,h:$t,j:function(t,e){return t(e={exports:{}},e.exports),e.exports},l:function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")},m:function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t},n:function(t,e,n){const i=n||HTMLInputElement,r=t.elements.namedItem(e);if(r instanceof i)return r;throw new QueryError(`Element not found by name: <${i.name}> ${e}`)},o:function(){var t;return(t=It()).observe.apply(t,arguments)},q:function(t,e,n){const i=n||HTMLElement,r=[];for(const o of t.querySelectorAll(e))o instanceof i&&r.push(o);return r},r:function(t,e){_t||(_t=new Map,document.addEventListener("submit",Ft));const n=_t.get(t)||[];_t.set(t,[...n,e])},t:ce,w:function(t,e){Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase();for(const i of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(i.closest(n)===t)return i}(this,e)}})},x:function(t,e){Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),i=[];for(const r of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))r.closest(n)===t&&i.push(r);return i}(this,e)}})},y:function(t){(function(t,e,n){if(t[e]){const i=t[e];t[e]=function(...t){n.apply(this,t),i.apply(this,t)}}else t[e]=n})(t.prototype,"connectedCallback",(function(){this.toggleAttribute("data-catalyst",!0),function(t){ke.add(t.tagName.toLowerCase()),Te(t)}(this)})),function(t){const e=t.name.replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/(^-|-Element$)/g,"").toLowerCase();window.customElements.get(e)||(window[t.name]=t,window.customElements.define(e,t))}(t)},z:k});class QueryError extends Error{constructor(t){super(t),this.name="QueryError",this.framesToPop=1}}const e=new WeakMap,n=t=>(...n)=>{const i=t(...n);return e.set(i,!0),i},i=t=>"function"==typeof t&&e.has(t),r=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,o=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},s={},a={},c=`{{lit-${String(Math.random()).slice(2)}}}`,l=`\x3c!--${c}--\x3e`,u=new RegExp(`${c}|${l}`);class Template{constructor(t,e){this.parts=[],this.element=e;const n=[],i=[],r=document.createTreeWalker(e.content,133,null,!1);let o=0,s=-1,a=0;const{strings:l,values:{length:h}}=t;for(;a<h;){const t=r.nextNode();if(null!==t){if(s++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let i=0;for(let t=0;t<n;t++)d(e[t].name,"$lit$")&&i++;for(;i-- >0;){const e=l[a],n=f.exec(e)[2],i=n.toLowerCase()+"$lit$",r=t.getAttribute(i);t.removeAttribute(i);const o=r.split(u);this.parts.push({type:"attribute",index:s,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),r.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(c)>=0){const i=t.parentNode,r=e.split(u),o=r.length-1;for(let e=0;e<o;e++){let n,o=r[e];if(""===o)n=m();else{const t=f.exec(o);null!==t&&d(t[2],"$lit$")&&(o=o.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),n=document.createTextNode(o)}i.insertBefore(n,t),this.parts.push({type:"node",index:++s})}""===r[o]?(i.insertBefore(m(),t),n.push(t)):t.data=r[o],a+=o}}else if(8===t.nodeType)if(t.data===c){const e=t.parentNode;null!==t.previousSibling&&s!==o||(s++,e.insertBefore(m(),t)),o=s,this.parts.push({type:"node",index:s}),null===t.nextSibling?t.data="":(n.push(t),s--),a++}else{let e=-1;for(;-1!==(e=t.data.indexOf(c,e+1));)this.parts.push({type:"node",index:-1}),a++}}else r.currentNode=i.pop()}for(const c of n)c.parentNode.removeChild(c)}}const d=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},h=t=>-1!==t.index,m=()=>document.createComment(""),f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */
class TemplateInstance{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const n of this.__parts)void 0!==n&&n.commit()}_clone(){const t=r?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,i=document.createTreeWalker(t,133,null,!1);let o,s=0,a=0,c=i.nextNode();for(;s<n.length;)if(o=n[s],h(o)){for(;a<o.index;)a++,"TEMPLATE"===c.nodeName&&(e.push(c),i.currentNode=c.content),null===(c=i.nextNode())&&(i.currentNode=e.pop(),c=i.nextNode());if("node"===o.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(c.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(c,o.name,o.strings,this.options));s++}else this.__parts.push(void 0),s++;return r&&(document.adoptNode(t),customElements.upgrade(t)),t}}
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */const p=` ${c} `;class TemplateResult{constructor(t,e,n,i){this.strings=t,this.values=e,this.type=n,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let i=0;i<t;i++){const t=this.strings[i],r=t.lastIndexOf("\x3c!--");n=(r>-1||n)&&-1===t.indexOf("--\x3e",r+1);const o=f.exec(t);e+=null===o?t+(n?p:l):t.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+c}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */const g=t=>null===t||!("object"==typeof t||"function"==typeof t),v=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class AttributeCommitter{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let i=0;i<n.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new AttributePart(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let i=0;i<e;i++){n+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(g(t)||!v(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class AttributePart{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===s||g(t)&&t===this.value||(this.value=t,i(t)||(this.committer.dirty=!0))}commit(){for(;i(this.value);){const t=this.value;this.value=s,t(this)}this.value!==s&&this.committer.commit()}}class NodePart{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(m()),this.endNode=t.appendChild(m())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=m()),t.__insert(this.endNode=m())}insertAfterPart(t){t.__insert(this.startNode=m()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s,t(this)}const t=this.__pendingValue;t!==s&&(g(t)?t!==this.value&&this.__commitText(t):t instanceof TemplateResult?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):v(t)?this.__commitIterable(t):t===a?(this.value=a,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof TemplateInstance&&this.value.template===e)this.value.update(t.values);else{const n=new TemplateInstance(e,t.processor,this.options),i=n._clone();n.update(t.values),this.__commitNode(i),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,i=0;for(const r of t)n=e[i],void 0===n&&(n=new NodePart(this.options),e.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(e[i-1])),n.setValue(r),n.commit(),i++;i<e.length&&(e.length=i,this.clear(n&&n.endNode))}clear(t=this.startNode){o(this.startNode.parentNode,t.nextSibling,this.endNode)}}class BooleanAttributePart{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s,t(this)}if(this.__pendingValue===s)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=s}}class PropertyCommitter extends AttributeCommitter{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new PropertyPart(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class PropertyPart extends AttributePart{}let b=!1;try{const t={get capture(){return b=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(lo){}class EventPart{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;i(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=s,t(this)}if(this.__pendingValue===s)return;const t=this.__pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=E(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=s}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const E=t=>t&&(b?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */;const w=new class DefaultTemplateProcessor{handleAttributeExpressions(t,e,n,i){const r=e[0];if("."===r){return new PropertyCommitter(t,e.slice(1),n).parts}return"@"===r?[new EventPart(t,e.slice(1),i.eventContext)]:"?"===r?[new BooleanAttributePart(t,e.slice(1),n)]:new AttributeCommitter(t,e,n).parts}handleTextExpression(t){return new NodePart(t)}};
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */function y(t){let e=x.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},x.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const i=t.strings.join(c);return n=e.keyString.get(i),void 0===n&&(n=new Template(t,t.getTemplateElement()),e.keyString.set(i,n)),e.stringsArray.set(t.strings,n),n}const x=new Map,A=new WeakMap;
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */t("e",(t,e,n)=>{let i=A.get(e);void 0===i&&(o(e,e.firstChild),A.set(e,i=new NodePart(Object.assign({templateFactory:y},n))),i.appendInto(e)),i.setValue(t),i.commit()});
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */
(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");t("i",(t,...e)=>new TemplateResult(t,e,"html",w));function k(t,e=0,{start:n=!0,middle:i=!0,once:r=!1}={}){let o,s=0,a=!1;function c(...l){if(a)return;const u=Date.now()-s;s=Date.now(),n?(n=!1,t.apply(this,l),r&&c.cancel()):(i&&u<e||!i)&&(clearTimeout(o),o=setTimeout(()=>{s=Date.now(),t.apply(this,l),r&&c.cancel()},i?e-u:e))}return c.cancel=()=>{clearTimeout(o),a=!0},c}function T(t,e=0,{start:n=!1,middle:i=!1,once:r=!1}={}){return k(t,e,{start:n,middle:i,once:r})}function L(){if(!(this instanceof L))return new L;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var M=window.document.documentElement,C=M.matches||M.webkitMatchesSelector||M.mozMatchesSelector||M.oMatchesSelector||M.msMatchesSelector;L.prototype.matchesSelector=function(t,e){return C.call(t,e)},L.prototype.querySelectorAll=function(t,e){return e.querySelectorAll(t)},L.prototype.indexes=[];var S=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;L.prototype.indexes.push({name:"ID",selector:function(t){var e;if(e=t.match(S))return e[0].slice(1)},element:function(t){if(t.id)return[t.id]}});var N=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;L.prototype.indexes.push({name:"CLASS",selector:function(t){var e;if(e=t.match(N))return e[0].slice(1)},element:function(t){var e=t.className;if(e){if("string"==typeof e)return e.split(/\s/);if("object"==typeof e&&"baseVal"in e)return e.baseVal.split(/\s/)}}});var H,D=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;L.prototype.indexes.push({name:"TAG",selector:function(t){var e;if(e=t.match(D))return e[0].toUpperCase()},element:function(t){return[t.nodeName.toUpperCase()]}}),L.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},H="function"==typeof window.Map?window.Map:function(){function t(){this.map={}}return t.prototype.get=function(t){return this.map[t+" "]},t.prototype.set=function(t,e){this.map[t+" "]=e},t}();var I=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function P(t,e){var n,i,r,o,s,a,c=(t=t.slice(0).concat(t.default)).length,l=e,u=[];do{if(I.exec(""),(r=I.exec(l))&&(l=r[3],r[2]||!l))for(n=0;n<c;n++)if(s=(a=t[n]).selector(r[1])){for(i=u.length,o=!1;i--;)if(u[i].index===a&&u[i].key===s){o=!0;break}o||u.push({index:a,key:s});break}}while(r);return u}function _(t,e){var n,i,r;for(n=0,i=t.length;n<i;n++)if(r=t[n],e.isPrototypeOf(r))return r}function O(t,e){return t.id-e.id}L.prototype.logDefaultIndexUsed=function(){},L.prototype.add=function(t,e){var n,i,r,o,s,a,c,l,u=this.activeIndexes,d=this.selectors;if("string"==typeof t){for(n={id:this.uid++,selector:t,data:e},c=P(this.indexes,t),i=0;i<c.length;i++)o=(l=c[i]).key,(s=_(u,r=l.index))||((s=Object.create(r)).map=new H,u.push(s)),r===this.indexes.default&&this.logDefaultIndexUsed(n),(a=s.map.get(o))||(a=[],s.map.set(o,a)),a.push(n);this.size++,d.push(t)}},L.prototype.remove=function(t,e){if("string"==typeof t){var n,i,r,o,s,a,c,l,u=this.activeIndexes,d={},h=1===arguments.length;for(n=P(this.indexes,t),r=0;r<n.length;r++)for(i=n[r],o=u.length;o--;)if(a=u[o],i.index.isPrototypeOf(a)){if(c=a.map.get(i.key))for(s=c.length;s--;)(l=c[s]).selector!==t||!h&&l.data!==e||(c.splice(s,1),d[l.id]=!0);break}this.size-=Object.keys(d).length}},L.prototype.queryAll=function(t){if(!this.selectors.length)return[];var e,n,i,r,o,s,a,c,l={},u=[],d=this.querySelectorAll(this.selectors.join(", "),t);for(e=0,i=d.length;e<i;e++)for(o=d[e],n=0,r=(s=this.matches(o)).length;n<r;n++)l[(c=s[n]).id]?a=l[c.id]:(a={id:c.id,selector:c.selector,data:c.data,elements:[]},l[c.id]=a,u.push(a)),a.elements.push(o);return u.sort(O)},L.prototype.matches=function(t){if(!t)return[];var e,n,i,r,o,s,a,c,l,u,d,h=this.activeIndexes,m={},f=[];for(e=0,r=h.length;e<r;e++)if(c=(a=h[e]).element(t))for(n=0,o=c.length;n<o;n++)if(l=a.map.get(c[n]))for(i=0,s=l.length;i<s;i++)!m[d=(u=l[i]).id]&&this.matchesSelector(t,u.selector)&&(m[d]=!0,f.push(u));return f.sort(O)};var q={},F={},R=new WeakMap,$=new WeakMap,B=new WeakMap,W=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function j(t,e,n){var i=t[e];return t[e]=function(){return n.apply(t,arguments),i.apply(t,arguments)},t}function V(){R.set(this,!0)}function U(){R.set(this,!0),$.set(this,!0)}function K(){return B.get(this)||null}function Y(t,e){W&&Object.defineProperty(t,"currentTarget",{configurable:!0,enumerable:!0,get:e||W.get})}function z(t){if(function(t){try{return t.eventPhase,!0}catch(e){return!1}}(t)){var e=(1===t.eventPhase?F:q)[t.type];if(e){var n=function(t,e,n){var i=[],r=e;do{if(1!==r.nodeType)break;var o=t.matches(r);if(o.length){var s={node:r,observers:o};n?i.unshift(s):i.push(s)}}while(r=r.parentElement);return i}(e,t.target,1===t.eventPhase);if(n.length){j(t,"stopPropagation",V),j(t,"stopImmediatePropagation",U),Y(t,K);for(var i=0,r=n.length;i<r&&!R.get(t);i++){var o=n[i];B.set(t,o.node);for(var s=0,a=o.observers.length;s<a&&!$.get(t);s++)o.observers[s].data.call(o.node,t)}B.delete(t),Y(t)}}}}const X=new WeakMap,Q=(t("u",n((...t)=>e=>{let n=X.get(e);void 0===n&&(n={lastRenderedIndex:2147483647,values:[]},X.set(e,n));const i=n.values;let r=i.length;n.values=t;for(let o=0;o<t.length&&!(o>n.lastRenderedIndex);o++){const s=t[o];if(g(s)||"function"!=typeof s.then){e.setValue(s),n.lastRenderedIndex=o;break}o<r&&s===i[o]||(n.lastRenderedIndex=2147483647,r=0,Promise.resolve(s).then(t=>{const i=n.values.indexOf(s);i>-1&&i<n.lastRenderedIndex&&(n.lastRenderedIndex=i,e.setValue(t),e.commit())}))}})),!!navigator.userAgent.match(/Macintosh/));class Combobox{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!Q&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||(n.click(),!0))})(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":Q&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":Q&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){if(e.isComposing="compositionstart"===t.type,!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",G)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",G)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Z)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Z),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(r=e)}const o=n[r];if(o)for(const s of n)o===s?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),J(this.list,o)):s.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function G(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function Z(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function J(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,r=e.offsetTop,o=r+e.clientHeight;return r>=n&&o<=i})(t,e)||(t.scrollTop=e.offsetTop)}t("C",Combobox);var tt=null,et=null,nt=[];function it(t,e){var n=[];function i(){var t=n;n=[],e(t)}return function(){for(var e=arguments.length,r=Array(e),o=0;o<e;o++)r[o]=arguments[o];n.push(r),1===n.length&&rt(t,i)}}function rt(t,e){et||(et=new MutationObserver(ot)),tt||(tt=t.createElement("div"),et.observe(tt,{attributes:!0})),nt.push(e),tt.setAttribute("data-twiddle",""+Date.now())}function ot(){var t=nt;nt=[];for(var e=0;e<t.length;e++)try{t[e]()}catch(n){setTimeout((function(){throw n}),0)}}var st=new WeakMap,at=new WeakMap,ct=new WeakMap,lt=new WeakMap;function ut(t,e){for(var n=0;n<e.length;n++){var i=e[n],r=i[0],o=i[1],s=i[2];r===vt?(dt(s,o),ht(s,o)):r===bt?mt(s,o):r===Et&&ft(t.observers,o)}}function dt(t,e){if(e instanceof t.elementConstructor){var n=st.get(e);if(n||(n=[],st.set(e,n)),-1===n.indexOf(t.id)){var i=void 0;if(t.initialize&&(i=t.initialize.call(void 0,e)),i){var r=at.get(e);r||(r={},at.set(e,r)),r[""+t.id]=i}n.push(t.id)}}}function ht(t,e){if(e instanceof t.elementConstructor){var n=lt.get(e);if(n||(n=[],lt.set(e,n)),-1===n.indexOf(t.id)){t.elements.push(e);var i=at.get(e),r=i?i[""+t.id]:null;if(r&&r.add&&r.add.call(void 0,e),t.subscribe){var o=t.subscribe.call(void 0,e);if(o){var s=ct.get(e);s||(s={},ct.set(e,s)),s[""+t.id]=o}}t.add&&t.add.call(void 0,e),n.push(t.id)}}}function mt(t,e){if(e instanceof t.elementConstructor){var n=lt.get(e);if(n){var i=t.elements.indexOf(e);if(-1!==i&&t.elements.splice(i,1),-1!==(i=n.indexOf(t.id))){var r=at.get(e),o=r?r[""+t.id]:null;if(o&&o.remove&&o.remove.call(void 0,e),t.subscribe){var s=ct.get(e),a=s?s[""+t.id]:null;a&&a.unsubscribe&&a.unsubscribe()}t.remove&&t.remove.call(void 0,e),n.splice(i,1)}0===n.length&&lt.delete(e)}}}function ft(t,e){var n=lt.get(e);if(n){for(var i=n.slice(0),r=0;r<i.length;r++){var o=t[i[r]];if(o){var s=o.elements.indexOf(e);-1!==s&&o.elements.splice(s,1);var a=at.get(e),c=a?a[""+o.id]:null;c&&c.remove&&c.remove.call(void 0,e);var l=ct.get(e),u=l?l[""+o.id]:null;u&&u.unsubscribe&&u.unsubscribe(),o.remove&&o.remove.call(void 0,e)}}lt.delete(e)}}var pt=null;function gt(t){return"matches"in t||"webkitMatchesSelector"in t||"mozMatchesSelector"in t||"oMatchesSelector"in t||"msMatchesSelector"in t}var vt=1,bt=2,Et=3;function wt(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];"childList"===r.type?(yt(t,e,r.addedNodes),xt(t,e,r.removedNodes)):"attributes"===r.type&&At(t,e,r.target)}(function(t){if(null===pt){var e=t.createElement("div"),n=t.createElement("div"),i=t.createElement("div");e.appendChild(n),n.appendChild(i),e.innerHTML="",pt=i.parentNode!==n}return pt})(t.ownerDocument)&&function(t,e){for(var n=0;n<t.observers.length;n++){var i=t.observers[n];if(i)for(var r=i.elements,o=0;o<r.length;o++){var s=r[o];s.parentNode||e.push([Et,s])}}}(t,e)}function yt(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];if(gt(r))for(var o=t.selectorSet.matches(r),s=0;s<o.length;s++){var a=o[s].data;e.push([vt,r,a])}if("querySelectorAll"in r)for(var c=t.selectorSet.queryAll(r),l=0;l<c.length;l++)for(var u=c[l],d=u.data,h=u.elements,m=0;m<h.length;m++)e.push([vt,h[m],d])}}function xt(t,e,n){for(var i=0;i<n.length;i++){var r=n[i];if("querySelectorAll"in r){e.push([Et,r]);for(var o=r.querySelectorAll("*"),s=0;s<o.length;s++)e.push([Et,o[s]])}}}function At(t,e,n){if(gt(n))for(var i=t.selectorSet.matches(n),r=0;r<i.length;r++){var o=i[r].data;e.push([vt,n,o])}if("querySelectorAll"in n){var s=lt.get(n);if(s)for(var a=0;a<s.length;a++){var c=t.observers[s[a]];c&&(t.selectorSet.matchesSelector(n,c.selector)||e.push([bt,n,c]))}}}var kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt=0;function Lt(t){this.rootNode=9===t.nodeType?t.documentElement:t,this.ownerDocument=9===t.nodeType?t:t.ownerDocument,this.observers=[],this.selectorSet=new L,this.mutationObserver=new MutationObserver(St.bind(this,this)),this._scheduleAddRootNodes=it(this.ownerDocument,Ct.bind(this,this)),this._handleThrottledChangedTargets=it(this.ownerDocument,Ht.bind(this,this)),this.rootNode.addEventListener("change",Nt.bind(this,this),!1),function(t,e){var n=t.readyState;"interactive"===n||"complete"===n?rt(t,e):t.addEventListener("DOMContentLoaded",rt(t,e))}(this.ownerDocument,Mt.bind(this,this))}function Mt(t){t.mutationObserver.observe(t.rootNode,{childList:!0,attributes:!0,subtree:!0}),t._scheduleAddRootNodes()}function Ct(t){var e=[];yt(t,e,[t.rootNode]),ut(t,e)}function St(t,e){var n=[];wt(t,n,e),ut(t,n)}function Nt(t,e){t._handleThrottledChangedTargets(e.target)}function Ht(t,e){var n=[];!function(t,e,n){for(var i=0;i<n.length;i++)for(var r=n[i],o=r.form?r.form.elements:t.rootNode.querySelectorAll("input"),s=0;s<o.length;s++)At(t,e,o[s])}(t,n,e),ut(t,n)}Lt.prototype.disconnect=function(){this.mutationObserver.disconnect()},Lt.prototype.observe=function(t,e){var n=void 0;"function"==typeof e?n={selector:t,initialize:e}:"object"===(void 0===e?"undefined":kt(e))?(n=e).selector=t:n=t;var i=this,r={id:Tt++,selector:n.selector,initialize:n.initialize,add:n.add,remove:n.remove,subscribe:n.subscribe,elements:[],elementConstructor:n.hasOwnProperty("constructor")?n.constructor:this.ownerDocument.defaultView.Element,abort:function(){i._abortObserving(r)}};return this.selectorSet.add(r.selector,r),this.observers[r.id]=r,this._scheduleAddRootNodes(),r},Lt.prototype._abortObserving=function(t){for(var e=t.elements,n=0;n<e.length;n++)mt(t,e[n]);this.selectorSet.remove(t.selector,t),delete this.observers[t.id]},Lt.prototype.triggerObservers=function(t){var e=[];!function(t,e,n){if("querySelectorAll"in n){At(t,e,n);for(var i=n.querySelectorAll("*"),r=0;r<i.length;r++)At(t,e,i[r])}}(this,e,t),ut(this,e)};var Dt=void 0;function It(){return Dt||(Dt=new Lt(window.document)),Dt}class ErrorWithResponse extends Error{constructor(t,e){super(t),this.response=e}}function Pt(){let t,e;return[new Promise((function(n,i){t=n,e=i})),t,e]}let _t;const Ot=[],qt=[];function Ft(t){if(!(t.target instanceof HTMLFormElement))return;const e=t.target,n=function(t){const e=[];for(const n of _t.keys())if(t.matches(n)){const t=_t.get(n)||[];e.push(...t)}return e}(e);if(0===n.length)return;const i=function(t){const e={method:t.method||"GET",url:t.action,headers:new Headers({"X-Requested-With":"XMLHttpRequest"}),body:null};if("GET"===e.method.toUpperCase()){const n=function(t){const e=new URLSearchParams,n=new FormData(t).entries();for(const[i,r]of[...n])e.append(i,r.toString());return e.toString()}(t);n&&(e.url+=(~e.url.indexOf("?")?"&":"?")+n)}else e.body=new FormData(t);return e}(e),[r,o,s]=Pt();t.preventDefault(),async function(t,e,n,i){let r=!1;for(const o of t){const[t,s]=Pt(),a=()=>(r=!0,s(),i),c={text:a,json:()=>(n.headers.set("Accept","application/json"),a()),html:()=>(n.headers.set("Accept","text/html"),a())};await Promise.race([t,o(e,c,n)])}return r}(n,e,i,r).then(async t=>{if(t){for(const t of qt)await t(e);(async function(t){const e=await window.fetch(t.url,{method:t.method,body:null!==t.body?t.body:void 0,headers:t.headers,credentials:"same-origin"}),n={url:e.url,status:e.status,statusText:e.statusText,headers:e.headers,text:"",get json(){const t=JSON.parse(this.text);return delete this.json,this.json=t,this.json},get html(){return delete this.html,this.html=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}(document,this.text),this.html}},i=await e.text();if(n.text=i,e.ok)return n;throw new ErrorWithResponse("request failed",n)})(i).then(o,s).catch(()=>{}).then(()=>{for(const t of Ot)t(e)})}else e.submit()},t=>{e.submit(),setTimeout(()=>{throw t})})}t("k","undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});class Leaf{constructor(t){this.children=[],this.parent=t}delete(t){const e=this.children.indexOf(t);return-1!==e&&(this.children=this.children.slice(0,e).concat(this.children.slice(e+1)),0===this.children.length&&this.parent.delete(this),!0)}add(t){return this.children.push(t),this}}class RadixTrie{constructor(t){this.parent=null,this.children={},this.parent=t||null}get(t){return this.children[t]}insert(t){let e=this;for(let n=0;n<t.length;n+=1){const i=t[n];let r=e.get(i);if(n===t.length-1)return r instanceof RadixTrie&&(e.delete(r),r=null),r||(r=new Leaf(e),e.children[i]=r),r;r instanceof Leaf&&(r=null),r||(r=new RadixTrie(e),e.children[i]=r),e=r}return e}delete(t){for(const e in this.children){if(this.children[e]===t){const t=delete this.children[e];return 0===Object.keys(this.children).length&&this.parent&&this.parent.delete(this),t}}return!1}}function Rt(t){if(!(t instanceof HTMLElement))return!1;const e=t.nodeName.toLowerCase(),n=(t.getAttribute("type")||"").toLowerCase();return"select"===e||"textarea"===e||"input"===e&&"submit"!==n&&"reset"!==n&&"checkbox"!==n&&"radio"!==n||t.isContentEditable}function $t(t){return`${t.ctrlKey?"Control+":""}${t.altKey?"Alt+":""}${t.metaKey?"Meta+":""}${t.shiftKey&&t.key.toUpperCase()!==t.key?"Shift+":""}${t.key}`}const Bt=new RadixTrie,Wt=new WeakMap;let jt=Bt,Vt=null;function Ut(){Vt=null,jt=Bt}function Kt(t){if(t.defaultPrevented)return;if(t.target instanceof Node&&Rt(t.target))return;null!=Vt&&window.clearTimeout(Vt),Vt=window.setTimeout(Ut,1500);const e=jt.get($t(t));if(e)return jt=e,e instanceof Leaf?(function(t){Rt(t)?t.focus():t.click()}(e.children[e.children.length-1]),t.preventDefault(),void Ut()):void 0;Ut()}const Yt=new WeakMap;function zt(t,e){setTimeout((function(){e.dispatchEvent(new Event(t))}),0)}async function Xt(t){return Qt(t).then((function(e){const n=document.createElement("template");n.innerHTML=e;const i=document.importNode(n.content,!0);!t.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:i}}))||(t.replaceWith(i),t.dispatchEvent(new CustomEvent("include-fragment-replaced")))}),(function(){t.classList.add("is-error")}))}function Qt(t){const e=t.src;let n=Yt.get(t);return n&&n.src===e?n.data:(n=e?t.load():Promise.reject(new Error("missing src")),Yt.set(t,{src:e,data:n}),n)}class IncludeFragmentElement extends HTMLElement{constructor(){super(),this._attached=!1}static get observedAttributes(){return["src"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return Qt(this)}attributeChangedCallback(t){"src"===t&&this._attached&&Xt(this)}connectedCallback(){this._attached=!0,this.src&&Xt(this)}disconnectedCallback(){this._attached=!1}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return Promise.resolve().then(()=>(zt("loadstart",this),this.fetch(this.request()))).then(t=>{if(200!==t.status)throw new Error(`Failed to load resource: the server responded with a status of ${t.status}`);const e=t.headers.get("Content-Type");if(!(n=this.accept,n&&n.split(",").find(t=>t.match(/^\s*\*\/\*/))||e&&e.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${e}`);var n;return t}).then(t=>t.text()).then(t=>(zt("load",this),zt("loadend",this),t),t=>{throw zt("error",this),zt("loadend",this),t})}fetch(t){return fetch(t)}}t("I",IncludeFragmentElement),window.customElements.get("include-fragment")||(window.IncludeFragmentElement=IncludeFragmentElement,window.customElements.define("include-fragment",IncludeFragmentElement))
/**
       * @license
       * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */;t("p",n(t=>e=>{if(void 0===t&&e instanceof AttributePart){if(t!==e.value){const t=e.committer.name;e.committer.element.removeAttribute(t)}}else e.setValue(t)}));
/**
       * @license
       * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
       * This code may only be used under the BSD style license found at
       * http://polymer.github.io/LICENSE.txt
       * The complete set of authors may be found at
       * http://polymer.github.io/AUTHORS.txt
       * The complete set of contributors may be found at
       * http://polymer.github.io/CONTRIBUTORS.txt
       * Code distributed by Google as part of the polymer project is also
       * subject to an additional IP rights grant found at
       * http://polymer.github.io/PATENTS.txt
       */const Gt=(t,e)=>{const n=t.startNode.parentNode,i=void 0===e?t.endNode:e.startNode,r=n.insertBefore(m(),i);n.insertBefore(m(),i);const o=new NodePart(t.options);return o.insertAfterNode(r),o},Zt=(t,e)=>(t.setValue(e),t.commit(),t),Jt=(t,e,n)=>{const i=t.startNode.parentNode,r=n?n.startNode:t.endNode,o=e.endNode.nextSibling;o!==r&&((t,e,n=null,i=null)=>{for(;e!==n;){const n=e.nextSibling;t.insertBefore(e,i),e=n}})(i,e.startNode,o,r)},te=t=>{o(t.startNode.parentNode,t.startNode,t.endNode.nextSibling)},ee=(t,e,n)=>{const i=new Map;for(let r=e;r<=n;r++)i.set(t[r],r);return i},ne=new WeakMap,ie=new WeakMap;t("s",n((t,e,n)=>{let i;return void 0===n?n=e:void 0!==e&&(i=e),e=>{if(!(e instanceof NodePart))throw new Error("repeat can only be used in text bindings");const r=ne.get(e)||[],o=ie.get(e)||[],s=[],a=[],c=[];let l,u,d=0;for(const g of t)c[d]=i?i(g,d):d,a[d]=n(g,d),d++;let h=0,m=r.length-1,f=0,p=a.length-1;for(;h<=m&&f<=p;)if(null===r[h])h++;else if(null===r[m])m--;else if(o[h]===c[f])s[f]=Zt(r[h],a[f]),h++,f++;else if(o[m]===c[p])s[p]=Zt(r[m],a[p]),m--,p--;else if(o[h]===c[p])s[p]=Zt(r[h],a[p]),Jt(e,r[h],s[p+1]),h++,p--;else if(o[m]===c[f])s[f]=Zt(r[m],a[f]),Jt(e,r[m],r[h]),m--,f++;else if(void 0===l&&(l=ee(c,f,p),u=ee(o,h,m)),l.has(o[h]))if(l.has(o[m])){const t=u.get(c[f]),n=void 0!==t?r[t]:null;if(null===n){const t=Gt(e,r[h]);Zt(t,a[f]),s[f]=t}else s[f]=Zt(n,a[f]),Jt(e,n,r[h]),r[t]=null;f++}else te(r[m]),m--;else te(r[h]),h++;for(;f<=p;){const t=Gt(e,s[p+1]);Zt(t,a[f]),s[f++]=t}for(;h<=m;){const t=r[h++];null!==t&&te(t)}ne.set(e,s),ie.set(e,c)}}));async function re(t,e){let n;const i=new Promise((e,i)=>{n=self.setTimeout(()=>i(new Error("timeout")),t)});if(!e)return i;try{await Promise.race([i,se(e)])}catch(Zr){throw self.clearTimeout(n),Zr}}async function oe(t,e){let n;const i=new Promise(e=>{n=self.setTimeout(e,t)});if(!e)return i;try{await Promise.race([i,se(e)])}catch(Zr){throw self.clearTimeout(n),Zr}}function se(t){return new Promise((e,n)=>{const i=new Error("aborted");i.name="AbortError",t.aborted?n(i):t.addEventListener("abort",()=>n(i))})}async function ae(t,e,n){const i=new WebSocket(t),r=function(t){return new Promise((e,n)=>{t.readyState===WebSocket.OPEN?e(t):(t.onerror=()=>{t.onerror=null,t.onopen=null,n(new Error("connect failed"))},t.onopen=()=>{t.onerror=null,t.onopen=null,e(t)})})}(i);try{return await Promise.race([r,re(e,n)]),i}catch(Zr){throw async function(t){try{(await t).close()}catch(e){}}(r),Zr}}function ce(t,e){return async function(t,e,n=1/0,i){const r=i?se(i):null;for(let s=0;s<e;s++)try{const e=r?Promise.race([t(),r]):t();return await e}catch(Zr){if("AbortError"===Zr.name)throw Zr;if(s===e-1)throw Zr;const r=1e3*Math.pow(2,s),a=(o=.1*r,Math.floor(Math.random()*Math.floor(o)));await oe(Math.min(n,r+a),i)}var o;throw new Error("retry failed")}(()=>ae(t,e.timeout,e.signal),e.attempts,e.maxDelay,e.signal)}t("a2",class StableSocket{constructor(t,e,n){this.socket=null,this.opening=null,this.url=t,this.delegate=e,this.policy=n}async open(){if(this.opening||this.socket)return;this.opening=new AbortController;const t=Object.assign(Object.assign({},this.policy),{signal:this.opening.signal});try{this.socket=await ce(this.url,t)}catch(e){return void this.delegate.socketDidFinish(this)}finally{this.opening=null}this.socket.onclose=t=>{var e,n,i;this.socket=null,this.delegate.socketDidClose(this,t.code,t.reason),(i=t.code)===le||i===ue?this.delegate.socketDidFinish(this):setTimeout(()=>this.open(),(e=100,n=150,Math.random()*(n-e)+e))},this.socket.onmessage=t=>{this.delegate.socketDidReceiveMessage(this,t.data)},this.delegate.socketDidOpen(this)}close(t,e){this.opening?(this.opening.abort(),this.opening=null):this.socket&&(this.socket.onclose=null,this.socket.close(t,e),this.socket=null,this.delegate.socketDidClose(this,t,e),this.delegate.socketDidFinish(this))}send(t){this.socket&&this.socket.send(t)}isOpen(){return!!this.socket}});const le=1008,ue=1011;function*de(t){let e="",n=0,i=!1;for(let r=0;r<t.length;r+=1)"{"!==t[r]||"{"!==t[r+1]||"\\"===t[r-1]||i?"}"===t[r]&&"}"===t[r+1]&&"\\"!==t[r-1]&&i&&(i=!1,yield{type:"part",start:n,end:r+2,value:e.slice(2).trim()},e="",r+=2,n=r):(i=!0,e&&(yield{type:"string",start:n,end:r,value:e}),e="{{",n=r,r+=2),e+=t[r]||"";e&&(yield{type:"string",start:n,end:t.length,value:e})}var he,me,fe=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n},pe=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};class AttributeTemplatePart{constructor(t,e){this.expression=e,he.set(this,void 0),me.set(this,""),fe(this,he,t),pe(this,he).updateParent("")}get attributeName(){return pe(this,he).attr.name}get attributeNamespace(){return pe(this,he).attr.namespaceURI}get value(){return pe(this,me)}set value(t){fe(this,me,t||""),pe(this,he).updateParent(t)}get element(){return pe(this,he).element}get booleanValue(){return pe(this,he).booleanValue}set booleanValue(t){pe(this,he).booleanValue=t}}t("ac",AttributeTemplatePart),he=new WeakMap,me=new WeakMap;class AttributeValueSetter{constructor(t,e){this.element=t,this.attr=e,this.partList=[]}get booleanValue(){return this.element.hasAttributeNS(this.attr.namespaceURI,this.attr.name)}set booleanValue(t){if(1!==this.partList.length)throw new DOMException("Operation not supported","NotSupportedError");this.partList[0].value=t?"":null}append(t){this.partList.push(t)}updateParent(t){if(1===this.partList.length&&null===t)this.element.removeAttributeNS(this.attr.namespaceURI,this.attr.name);else{const t=this.partList.map(t=>"string"==typeof t?t:t.value).join("");this.element.setAttributeNS(this.attr.namespaceURI,this.attr.name,t)}}}var ge,ve=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n},be=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};class NodeTemplatePart{constructor(t,e){this.expression=e,ge.set(this,void 0),ve(this,ge,[t]),t.textContent=""}get value(){return be(this,ge).map(t=>t.textContent).join("")}set value(t){this.replace(t)}get previousSibling(){return be(this,ge)[0].previousSibling}get nextSibling(){return be(this,ge)[be(this,ge).length-1].nextSibling}replace(...t){const e=t.map(t=>"string"==typeof t?new Text(t):t);be(this,ge)[0].before(...e);for(const n of be(this,ge))n.remove();ve(this,ge,e)}}t("ad",NodeTemplatePart),ge=new WeakMap;const Ee={createCallback(t,e,n){this.processCallback(t,e,n)},processCallback(t,e,n){var i;if("object"==typeof n&&n)for(const r of e)r.expression in n&&(r.value=String(null!==(i=n[r.expression])&&void 0!==i?i:""))}};var we,ye,xe=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n},Ae=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)};class TemplateInstance$1 extends DocumentFragment{constructor(t,e,n=Ee){var i,r;super(),we.set(this,void 0),ye.set(this,void 0),Object.getPrototypeOf(this!==TemplateInstance$1.prototype)&&Object.setPrototypeOf(this,TemplateInstance$1.prototype),this.appendChild(t.content.cloneNode(!0)),xe(this,ye,Array.from(function*(t){const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null,!1);let n;for(;n=e.nextNode();)if(n instanceof Element&&n.hasAttributes())for(let t=0;t<n.attributes.length;t+=1){const e=n.attributes.item(t);if(e&&e.value.includes("{{")){const t=new AttributeValueSetter(n,e);for(const n of de(e.value))if("string"===n.type)t.append(n.value);else{const e=new AttributeTemplatePart(t,n.value);t.append(e),yield e}}}else if(n instanceof Text&&n.textContent&&n.textContent.includes("{{"))for(const t of de(n.textContent)){t.end<n.textContent.length&&n.splitText(t.end),"part"===t.type&&(yield new NodeTemplatePart(n,t.value));break}}(this))),xe(this,we,n),null===(r=(i=Ae(this,we)).createCallback)||void 0===r||r.call(i,this,Ae(this,ye),e)}update(t){Ae(this,we).processCallback(this,Ae(this,ye),t)}}t("v",TemplateInstance$1),we=new WeakMap,ye=new WeakMap;const ke=new Set;function Te(t){for(const e of t.querySelectorAll("[data-action]"))Ce(e);t.hasAttribute("data-action")&&Ce(t)}function Le(t){const e=t.currentTarget;for(const n of Me(e))if(t.type===n.type&&ke.has(n.tag)){const i=e.closest(n.tag);i&&"function"==typeof i[n.method]&&i[n.method](t)}}function*Me(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=e.lastIndexOf("#"),i=e.slice(0,t),r=e.slice(t+1,n),o=e.slice(n+1);yield{type:i,tag:r,method:o}}}function Ce(t){for(const e of Me(t))t.addEventListener(e.type,Le)}function Se(t){let e=Array.from(t.querySelectorAll("[autofocus]")).filter(He)[0];e||(e=t,t.setAttribute("tabindex","-1")),e.focus()}function Ne(t){const e=t.currentTarget;e instanceof Element&&("Escape"===t.key||"Esc"===t.key?(_e(e,!1),t.stopPropagation()):"Tab"===t.key&&function(t){if(!(t.currentTarget instanceof Element))return;const e=t.currentTarget.querySelector("details-dialog");if(!e)return;t.preventDefault();const n=Array.from(e.querySelectorAll("*")).filter(He);if(0===n.length)return;const i=t.shiftKey?-1:1,r=e.getRootNode(),o=e.contains(r.activeElement)?r.activeElement:null;let s=-1===i?-1:0;if(o instanceof HTMLElement){const t=n.indexOf(o);-1!==t&&(s=t+i)}s<0?s=n.length-1:s%=n.length;n[s].focus()}(t))}function He(t){return t.tabIndex>=0&&!t.disabled&&function(t){return!t.hidden&&(!t.type||"hidden"!==t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}(t)}function De(t){const e=t.querySelector("details-dialog");return!(e instanceof DetailsDialogElement)||e.dispatchEvent(new CustomEvent("details-dialog-close",{bubbles:!0,cancelable:!0}))}function Ie(t){if(!(t.currentTarget instanceof Element))return;const e=t.currentTarget.closest("details");e&&e.hasAttribute("open")&&(De(e)||(t.preventDefault(),t.stopPropagation()))}function Pe(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.querySelector("details-dialog");if(n instanceof DetailsDialogElement)if(e.hasAttribute("open")){const t="getRootNode"in n?n.getRootNode():document;t.activeElement instanceof HTMLElement&&Re.set(n,{details:e,activeElement:t.activeElement}),Se(n),e.addEventListener("keydown",Ne)}else{for(const e of n.querySelectorAll("form"))e.reset();const t=function(t,e){const n=Re.get(e);return n&&n.activeElement instanceof HTMLElement?n.activeElement:t.querySelector("summary")}(e,n);t&&t.focus(),e.removeEventListener("keydown",Ne)}}function _e(t,e){e!==t.hasAttribute("open")&&(e?t.setAttribute("open",""):De(t)&&t.removeAttribute("open"))}function Oe(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.querySelector("details-dialog");if(!(n instanceof DetailsDialogElement))return;const i=n.querySelector("include-fragment:not([src])");if(!i)return;const r=n.src;null!==r&&(i.addEventListener("loadend",()=>{e.hasAttribute("open")&&Se(n)}),i.setAttribute("src",r),Fe(e))}function qe(t,e,n){Fe(t),e&&t.addEventListener("toggle",Oe,{once:!0}),e&&n&&t.addEventListener("mouseover",Oe,{once:!0})}function Fe(t){t.removeEventListener("toggle",Oe),t.removeEventListener("mouseover",Oe)}const Re=new WeakMap;class DetailsDialogElement extends HTMLElement{static get CLOSE_ATTR(){return"data-close-dialog"}static get CLOSE_SELECTOR(){return"[data-close-dialog]"}constructor(){super(),Re.set(this,{details:null,activeElement:null}),this.addEventListener("click",(function({target:t}){if(!(t instanceof Element))return;const e=t.closest("details");e&&t.closest("[data-close-dialog]")&&_e(e,!1)}))}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t||"")}get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}connectedCallback(){this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true");const t=Re.get(this);if(!t)return;const e=this.parentElement;if(!e)return;const n=e.querySelector("summary");n&&(n.hasAttribute("role")||n.setAttribute("role","button"),n.addEventListener("click",Ie,{capture:!0})),e.addEventListener("toggle",Pe),t.details=e,qe(e,this.src,this.preload)}disconnectedCallback(){const t=Re.get(this);if(!t)return;const{details:e}=t;if(!e)return;e.removeEventListener("toggle",Pe),Fe(e);const n=e.querySelector("summary");n&&n.removeEventListener("click",Ie,{capture:!0}),t.details=null}toggle(t){const e=Re.get(this);if(!e)return;const{details:n}=e;n&&_e(n,t)}static get observedAttributes(){return["src","preload"]}attributeChangedCallback(){const t=Re.get(this);if(!t)return;const{details:e}=t;e&&qe(e,this.src,this.preload)}}t("D",DetailsDialogElement),window.customElements.get("details-dialog")||(window.DetailsDialogElement=DetailsDialogElement,window.customElements.define("details-dialog",DetailsDialogElement));const $e=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=Be.bind(null,this,!0),e={currentQuery:null,oninput:We(t),fetch:t,controller:null};$e.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&Be(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=$e.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=$e.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function Be(t,e){const n=t.input;if(!n)return;const i=$e.get(t);if(!i)return;const r=n.value;if(e&&i.currentQuery===r)return;i.currentQuery=r;const o=t.src;if(!o)return;const s=document.getElementById(t.getAttribute("aria-owns")||"");if(!s)return;const a=new URL(o,window.location.href),c=new URLSearchParams(a.search);let l;c.append(t.getAttribute("param")||"q",r),a.search=c.toString(),i.controller?i.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),i.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let u="";try{l=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(i){throw"AbortError"!==i.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),i}}(t,a.toString(),{signal:i.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),u=await l.text(),t.removeAttribute("loading"),i.controller=null}catch(d){return void("AbortError"!==d.name&&(t.removeAttribute("loading"),i.controller=null))}l&&l.ok?(s.innerHTML=u,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function We(t){let e;return function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t()},300)}}t("R",RemoteInputElement),window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement));const je=new WeakMap;let Ve=null;function Ue(t,e){return t.closest("task-lists")===e.closest("task-lists")}function Ke(t){if(t.currentTarget!==t.target)return;const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".contains-task-list");if(!n)return;if(e.classList.add("is-ghost"),t.dataTransfer&&t.dataTransfer.setData("text/plain",(e.textContent||"").trim()),!e.parentElement)return;const i=Array.from(e.parentElement.children),r=i.indexOf(e),o=je.get(e);o&&o.sortStarted(n),Ve={didDrop:!1,dragging:e,dropzone:e,sourceList:n,sourceSibling:i[r+1]||null,sourceIndex:r}}function Ye(t){if(!Ve)return;const e=t.currentTarget;e instanceof Element&&(Ue(Ve.dragging,e)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),Ve.dropzone!==e&&(Ve.dragging.classList.add("is-dragging"),Ve.dropzone=e,!function(t,e){if(t.parentNode===e.parentNode){let n=t;for(;n;){if(n===e)return!0;n=n.previousElementSibling}}return!1}(Ve.dragging,e)?e.after(Ve.dragging):e.before(Ve.dragging))):t.stopPropagation())}function ze(t){if(!Ve)return;t.preventDefault(),t.stopPropagation();const e=t.currentTarget;if(!(e instanceof Element))return;if(Ve.didDrop=!0,!Ve.dragging.parentElement)return;let n=Array.from(Ve.dragging.parentElement.children).indexOf(Ve.dragging);const i=e.closest(".contains-task-list");if(!i)return;if(Ve.sourceIndex===n&&Ve.sourceList===i)return;Ve.sourceList===i&&Ve.sourceIndex<n&&n++;const r={list:Ve.sourceList,index:Ve.sourceIndex},o={list:i,index:n},s=je.get(Ve.dragging);s&&s.sortFinished({src:r,dst:o})}function Xe(){Ve&&(Ve.dragging.classList.remove("is-dragging"),Ve.dragging.classList.remove("is-ghost"),Ve.didDrop||Ve.sourceList.insertBefore(Ve.dragging,Ve.sourceSibling),Ve=null)}function Qe(t){if(!Ve)return;const e=t.currentTarget;e instanceof Element&&(Ue(Ve.dragging,e)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move")):t.stopPropagation())}const Ge=new WeakMap;class TaskListsElement extends HTMLElement{constructor(){super(),this.addEventListener("change",t=>{const e=t.target;e instanceof HTMLInputElement&&e.classList.contains("task-list-item-checkbox")&&this.dispatchEvent(new CustomEvent("task-lists-check",{bubbles:!0,detail:{position:rn(e),checked:e.checked}}))}),Ge.set(this,new MutationObserver(an.bind(null,this)))}connectedCallback(){const t=Ge.get(this);t&&t.observe(this,{childList:!0,subtree:!0}),an(this)}disconnectedCallback(){const t=Ge.get(this);t&&t.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get sortable(){return this.hasAttribute("sortable")}set sortable(t){t?this.setAttribute("sortable",""):this.removeAttribute("sortable")}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,n){if(e!==n)switch(t){case"disabled":cn(this)}}}const Ze=document.createElement("template");Ze.innerHTML='\n  <span class="handle">\n    <svg class="drag-handle" aria-hidden="true" width="16" height="15" version="1.1" viewBox="0 0 16 15">\n      <path d="M12,4V5H4V4h8ZM4,8h8V7H4V8Zm0,3h8V10H4v1Z"></path>\n    </svg>\n  </span>';const Je=new WeakMap;function tn(t){if(Je.get(t))return;Je.set(t,!0);const e=t.closest("task-lists");if(!(e instanceof TaskListsElement))return;if(e.querySelectorAll(".task-list-item").length<=1)return;const n=Ze.content.cloneNode(!0),i=n.querySelector(".handle");if(t.prepend(n),!i)throw new Error("handle not found");i.addEventListener("mouseenter",mn),i.addEventListener("mouseleave",fn),function(t,e,n){je.set(t,{sortStarted:e,sortFinished:n}),t.addEventListener("dragstart",Ke),t.addEventListener("dragenter",Ye),t.addEventListener("dragend",Xe),t.addEventListener("drop",ze),t.addEventListener("dragover",Qe)}(t,dn,hn),t.addEventListener("mouseenter",en),t.addEventListener("mouseleave",nn)}function en(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest("task-lists");n instanceof TaskListsElement&&n.sortable&&!n.disabled&&e.classList.add("hovered")}function nn(t){const e=t.currentTarget;e instanceof Element&&e.classList.remove("hovered")}function rn(t){const e=on(t);if(!e)throw new Error(".contains-task-list not found");const n=t.closest(".task-list-item"),i=n?Array.from(e.children).indexOf(n):-1;return[ln(e),i]}function on(t){const e=t.parentElement;return e?e.closest(".contains-task-list"):null}function sn(t){return on(t)===function t(e){const n=on(e);return n?t(n)||n:null}(t)}function an(t){const e=t.querySelectorAll(".contains-task-list > .task-list-item");for(const n of e)sn(n)&&tn(n);cn(t)}function cn(t){for(const e of t.querySelectorAll(".task-list-item"))e.classList.toggle("enabled",!t.disabled);for(const e of t.querySelectorAll(".task-list-item-checkbox"))e instanceof HTMLInputElement&&(e.disabled=t.disabled)}function ln(t){const e=t.closest("task-lists");if(!e)throw new Error("parent not found");return Array.from(e.querySelectorAll("ol, ul")).indexOf(t)}const un=new WeakMap;function dn(t){const e=t.closest("task-lists");if(!e)throw new Error("parent not found");un.set(e,Array.from(e.querySelectorAll("ol, ul")))}function hn({src:t,dst:e}){const n=t.list.closest("task-lists");if(!n)return;const i=un.get(n);i&&(un.delete(n),n.dispatchEvent(new CustomEvent("task-lists-move",{bubbles:!0,detail:{src:[i.indexOf(t.list),t.index],dst:[i.indexOf(e.list),e.index]}})))}function mn(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".task-list-item");if(!n)return;const i=n.closest("task-lists");i instanceof TaskListsElement&&i.sortable&&!i.disabled&&n.setAttribute("draggable","true")}function fn(t){if(Ve)return;const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".task-list-item");n&&n.setAttribute("draggable","false")}window.customElements.get("task-lists")||(window.TaskListsElement=TaskListsElement,window.customElements.define("task-lists",TaskListsElement)),t("T",TaskListsElement);class AutocompleteEvent extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const pn=new WeakMap;function gn(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=pn.get(t);n&&n.abort();pn.set(t,e);const i=()=>pn.delete(t),r=function(t){return new Promise((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()})}(e);return r.then(i,i),r}(t,n)}class Autocomplete{constructor(t,e,n){this.container=t,this.input=e,this.results=n,this.combobox=new Combobox(e,n),this.results.hidden=!0,this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e){let n;return function(){for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),t(...r)},e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}onKeydown(t){if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit(t){let{target:e}=t;const n=e;if(!(n instanceof HTMLElement))return;if(this.container.open=!1,n instanceof HTMLAnchorElement)return;const i=n.getAttribute("data-autocomplete-value")||n.textContent;this.container.value=i}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id="".concat(this.results.id,"-option-").concat(t++)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),gn(this.input,n.toString()).then(t=>{this.results.innerHTML=t,this.identifyOptions();const e=!!this.results.querySelector('[role="option"]');this.container.open=e,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}const vn=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);e instanceof HTMLInputElement&&n&&(vn.set(this,new Autocomplete(this,e,n)),n.setAttribute("role","listbox"))}disconnectedCallback(){const t=vn.get(this);t&&(t.destroy(),vn.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=vn.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new AutocompleteEvent("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function bn(t,e=0,{start:n=!1,middle:i=!1,once:r=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:r=!1}={}){var o,s=0,a=!1,c=function c(...l){if(!a){var u=Date.now()-s;s=Date.now(),n?(n=!1,t(...l),r&&c.cancel()):(i&&u<e||!i)&&(clearTimeout(o),o=setTimeout((function(){s=Date.now(),t(...l),r&&c.cancel()}),i?e-u:e))}};return c.cancel=function(){clearTimeout(o),a=!0},c}(t,e,{start:n,middle:i,once:r})}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement)),t("B",AutocompleteElement);const En=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=bn(yn.bind(null,this),300),n={check:e,controller:null};En.set(this,n),t.addEventListener("input",wn),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=En.get(this);e&&(En.delete(this),t.removeEventListener("input",wn),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}}function wn(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,r=n.csrf,o=En.get(n);if(!i||!r||!o)return;let s="Verifyingโ€ฆ";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>s=t}})),n.required&&e.setCustomValidity(s)}async function yn(t){const e=t.input;if(!e)return;const n=t.src,i=t.csrf,r=En.get(t);if(!n||!i||!r)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const o=new FormData;o.append("authenticity_token",i),o.append("value",e.value),e.dispatchEvent(new CustomEvent("auto-check-send",{bubbles:!0,detail:{body:o}})),r.controller?r.controller.abort():t.dispatchEvent(new CustomEvent("loadstart")),r.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const i=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(i){throw"AbortError"!==i.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),i}}(t,n,{credentials:"same-origin",signal:r.controller.signal,method:"POST",body:o});i.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(i,e,t.required):function(t,e,n){let i="Validation failed";e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:t=>i=t}})),n&&e.setCustomValidity(i)}(i,e,t.required),r.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(s){"AbortError"!==s.name&&(r.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}function xn(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function An(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),xn(n),e.removeChild(n),Promise.resolve()}function kn(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)An(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const o=n.getElementById(e);o&&(r=o,r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement?An(r.value):r instanceof HTMLAnchorElement&&r.hasAttribute("href")?An(r.href):xn(r)).then(i)}var r}function Tn(t){const e=t.currentTarget;e instanceof HTMLElement&&kn(e)}function Ln(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),kn(e))}}function Mn(t){t.currentTarget.addEventListener("keydown",Ln)}function Cn(t){t.currentTarget.removeEventListener("keydown",Ln)}window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Tn),this.addEventListener("focus",Mn),this.addEventListener("blur",Cn)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement)),t("F",ClipboardCopyElement);class DetailsMenuElement extends HTMLElement{constructor(){super()}get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[Hn(t,"compositionstart",t=>Bn(this,t)),Hn(t,"compositionend",t=>Bn(this,t)),Hn(t,"click",e=>qn(t,this,e)),Hn(t,"change",e=>qn(t,this,e)),Hn(t,"keydown",e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=Sn.get(e);if(!i||i.isComposing)return;const r=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&($n(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{r&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=_n(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{r&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=_n(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(On&&n.ctrlKey){const e=_n(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(On&&n.ctrlKey){const e=_n(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Rn(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e)),Hn(t,"toggle",()=>Dn(t,this),{once:!0}),Hn(t,"toggle",()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(t)),this.preload?Hn(t,"mouseover",()=>Dn(t,this),{once:!0}):Nn,...In(t)];Sn.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Sn.get(this);if(t){Sn.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Sn=new WeakMap,Nn={unsubscribe(){}};function Hn(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function Dn(t,e){const n=e.getAttribute("src");if(!n)return;const i=Sn.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const r=e.querySelector("include-fragment");r&&!r.hasAttribute("src")&&(r.addEventListener("loadend",()=>Pn(t)),r.setAttribute("src",n))}function In(t){let e=!1;return[Hn(t,"mousedown",()=>e=!0),Hn(t,"keydown",()=>e=!1),Hn(t,"toggle",()=>{t.hasAttribute("open")&&(Pn(t)||e||function(t){const e=document.activeElement;if(e&&Rn(e)&&t.contains(e))return;const n=_n(t,!0);n&&n.focus()}(t))})]}function Pn(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("[autofocus]");return!!e&&(e.focus(),!0)}function _n(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),i=document.activeElement,r=i instanceof HTMLElement?n.indexOf(i):-1,o=e?n[r+1]:n[r-1],s=e?n[0]:n[n.length-1];return o||s}const On=navigator.userAgent.match(/Macintosh/);function qn(t,e,n){const i=n.target;if(i instanceof Element&&i.closest("details")===t)if("click"===n.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]'),n=e&&"LABEL"===e.tagName&&e.querySelector("input");e&&!n&&Fn(e,t)}else if("change"===n.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Fn(e,t)}}function Fn(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");n&&n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&$n(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Rn(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function $n(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Bn(t,e){const n=Sn.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));class Attachment{constructor(t,e){this.file=t,this.directory=e,this.state="pending",this.id=null,this.href=null,this.name=null,this.percent=0}static traverse(t,e){return function(t,e){if(e&&function(t){return t.items&&Array.from(t.items).some(t=>{const e=t.webkitGetAsEntry&&t.webkitGetAsEntry();return e&&e.isDirectory})}(t))return async function t(e,n){const i=[];for(const r of Wn(n))if(r.isDirectory)i.push(...await t(r.fullPath,await Vn(r)));else{const t=await jn(r);i.push(new Attachment(t,e))}return i}("",function(t){return Array.from(t.items).map(t=>t.webkitGetAsEntry()).filter(t=>null!=t)}(t));return Promise.resolve(Wn(Array.from(t.files||[])).map(t=>new Attachment(t)))}(t,e)}static from(t){const e=[];for(const n of t)if(n instanceof File)e.push(new Attachment(n));else{if(!(n instanceof Attachment))throw new Error("Unexpected type");e.push(n)}return e}get fullPath(){return this.directory?`${this.directory}/${this.file.name}`:this.file.name}isImage(){return["image/gif","image/png","image/jpg","image/jpeg"].indexOf(this.file.type)>-1}saving(t){if("pending"!==this.state&&"saving"!==this.state)throw new Error(`Unexpected transition from ${this.state} to saving`);this.state="saving",this.percent=t}saved(t){var e,n,i;if("pending"!==this.state&&"saving"!==this.state)throw new Error(`Unexpected transition from ${this.state} to saved`);this.state="saved",this.id=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,this.href=null!==(n=null==t?void 0:t.href)&&void 0!==n?n:null,this.name=null!==(i=null==t?void 0:t.name)&&void 0!==i?i:null}isPending(){return"pending"===this.state}isSaving(){return"saving"===this.state}isSaved(){return"saved"===this.state}}function Wn(t){return Array.from(t).filter(t=>!function(t){return t.name.startsWith(".")}(t))}function jn(t){return new Promise((function(e,n){t.file(e,n)}))}function Vn(t){return new Promise((function(e,n){const i=[],r=t.createReader(),o=()=>{r.readEntries(t=>{t.length>0?(i.push(...t),o()):e(i)},n)};o()}))}t("a9",Attachment);class FileAttachmentElement extends HTMLElement{constructor(){super(),this.addEventListener("dragenter",Yn),this.addEventListener("dragover",Yn),this.addEventListener("dragleave",zn),this.addEventListener("drop",Xn),this.addEventListener("paste",Gn),this.addEventListener("change",Zn)}get directory(){return this.hasAttribute("directory")}set directory(t){t?this.setAttribute("directory",""):this.removeAttribute("directory")}async attach(t){const e=t instanceof DataTransfer?await Attachment.traverse(t,this.directory):Attachment.from(t);this.dispatchEvent(new CustomEvent("file-attachment-accept",{bubbles:!0,cancelable:!0,detail:{attachments:e}}))&&e.length&&this.dispatchEvent(new CustomEvent("file-attachment-accepted",{bubbles:!0,detail:{attachments:e}}))}}function Un(t){return Array.from(t.types).indexOf("Files")>=0}let Kn=null;function Yn(t){const e=t.currentTarget;Kn&&clearTimeout(Kn),Kn=window.setTimeout(()=>e.removeAttribute("hover"),200);const n=t.dataTransfer;n&&Un(n)&&(n.dropEffect="copy",e.setAttribute("hover",""),t.stopPropagation(),t.preventDefault())}function zn(t){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),t.currentTarget.removeAttribute("hover"),t.stopPropagation(),t.preventDefault()}function Xn(t){const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;e.removeAttribute("hover");const n=t.dataTransfer;n&&Un(n)&&(e.attach(n),t.stopPropagation(),t.preventDefault())}const Qn=/^image\/(gif|png|jpeg)$/;function Gn(t){if(!t.clipboardData)return;if(!t.clipboardData.items)return;const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;const n=function(t){for(const e of t)if(Qn.test(e.type))return e.getAsFile();return null}(t.clipboardData.items);if(!n)return;const i=[n];e.attach(i),t.preventDefault()}function Zn(t){const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;const n=t.target;if(!(n instanceof HTMLInputElement))return;const i=e.getAttribute("input");if(!i||n.id!==i)return;const r=n.files;r&&0!==r.length&&(e.attach(r),n.value="")}window.customElements.get("file-attachment")||(window.FileAttachmentElement=FileAttachmentElement,window.customElements.define("file-attachment",FileAttachmentElement)),t("aa",FileAttachmentElement);class FilterInputElement extends HTMLElement{constructor(){super(),this.currentQuery=null,this.filter=null,this.debounceInputChange=function(t){let e;return function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t()},300)}}(()=>Jn(this,!0)),this.boundFilterResults=()=>{Jn(this,!1)}}static get observedAttributes(){return["aria-owns"]}attributeChangedCallback(t,e){e&&"aria-owns"===t&&Jn(this,!1)}connectedCallback(){const t=this.input;t&&(t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false"),t.addEventListener("focus",this.boundFilterResults),t.addEventListener("change",this.boundFilterResults),t.addEventListener("input",this.debounceInputChange))}disconnectedCallback(){const t=this.input;t&&(t.removeEventListener("focus",this.boundFilterResults),t.removeEventListener("change",this.boundFilterResults),t.removeEventListener("input",this.debounceInputChange))}get input(){const t=this.querySelector("input");return t instanceof HTMLInputElement?t:null}reset(){const t=this.input;t&&(t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}}async function Jn(t,e=!1){const n=t.input;if(!n)return;const i=n.value.trim(),r=t.getAttribute("aria-owns");if(!r)return;const o=document.getElementById(r);if(!o)return;const s=o.hasAttribute("data-filter-list")?o:o.querySelector("[data-filter-list]");if(!s)return;if(t.dispatchEvent(new CustomEvent("filter-input-start",{bubbles:!0})),e&&t.currentQuery===i)return;t.currentQuery=i;const a=t.filter||ti,c=s.childElementCount;let l=0,u=!1;for(const m of Array.from(s.children)){if(!(m instanceof HTMLElement))continue;const t=a(m,ei(m),i);!0===t.hideNew&&(u=t.hideNew),m.hidden=!t.match,t.match&&l++}const d=o.querySelector("[data-filter-new-item]"),h=!!d&&i.length>0&&!u;d instanceof HTMLElement&&(d.hidden=!h,h&&function(t,e){const n=t.querySelector("[data-filter-new-item-text]");n&&(n.textContent=e);const i=t.querySelector("[data-filter-new-item-value]");(i instanceof HTMLInputElement||i instanceof HTMLButtonElement)&&(i.value=e)}(d,i)),function(t,e){const n=t.querySelector("[data-filter-empty-state]");n instanceof HTMLElement&&(n.hidden=e)}(o,l>0||h),t.dispatchEvent(new CustomEvent("filter-input-updated",{bubbles:!0,detail:{count:l,total:c}}))}function ti(t,e,n){return{match:-1!==e.toLowerCase().indexOf(n.toLowerCase()),hideNew:e===n}}function ei(t){return((t.querySelector("[data-filter-item-text]")||t).textContent||"").trim()}t("L",FilterInputElement),window.customElements.get("filter-input")||(window.FilterInputElement=FilterInputElement,window.customElements.define("filter-input",FilterInputElement));const ni=new Set(["๐Ÿ‘‹","๐Ÿคš","๐Ÿ–๏ธ","โœ‹","๐Ÿ––","๐Ÿ‘Œ","๐Ÿค","โœŒ๏ธ","๐Ÿคž","๐ŸคŸ","๐Ÿค˜","๐Ÿค™","๐Ÿ‘ˆ","๐Ÿ‘‰","๐Ÿ‘†","๐Ÿ–•","๐Ÿ‘‡","โ˜๏ธ","๐Ÿ‘","๐Ÿ‘Ž","โœŠ","๐Ÿ‘Š","๐Ÿค›","๐Ÿคœ","๐Ÿ‘","๐Ÿ™Œ","๐Ÿ‘","๐Ÿคฒ","๐Ÿ™","โœ๏ธ","๐Ÿ’…","๐Ÿคณ","๐Ÿ’ช","๐Ÿฆต","๐Ÿฆถ","๐Ÿ‘‚","๐Ÿฆป","๐Ÿ‘ƒ","๐Ÿ‘ถ","๐Ÿง’","๐Ÿ‘ฆ","๐Ÿ‘ง","๐Ÿง‘","๐Ÿ‘ฑ","๐Ÿ‘จ","๐Ÿง”","๐Ÿ‘ฑโ€โ™‚๏ธ","๐Ÿ‘จโ€๐Ÿฆฐ","๐Ÿ‘จโ€๐Ÿฆฑ","๐Ÿ‘จโ€๐Ÿฆณ","๐Ÿ‘จโ€๐Ÿฆฒ","๐Ÿ‘ฉ","๐Ÿ‘ฑโ€โ™€๏ธ","๐Ÿ‘ฉโ€๐Ÿฆฐ","๐Ÿ‘ฉโ€๐Ÿฆฑ","๐Ÿ‘ฉโ€๐Ÿฆณ","๐Ÿ‘ฉโ€๐Ÿฆฒ","๐Ÿง“","๐Ÿ‘ด","๐Ÿ‘ต","๐Ÿ™","๐Ÿ™โ€โ™‚๏ธ","๐Ÿ™โ€โ™€๏ธ","๐Ÿ™Ž","๐Ÿ™Žโ€โ™‚๏ธ","๐Ÿ™Žโ€โ™€๏ธ","๐Ÿ™…","๐Ÿ™…โ€โ™‚๏ธ","๐Ÿ™…โ€โ™€๏ธ","๐Ÿ™†","๐Ÿ™†โ€โ™‚๏ธ","๐Ÿ™†โ€โ™€๏ธ","๐Ÿ’","๐Ÿ’โ€โ™‚๏ธ","๐Ÿ’โ€โ™€๏ธ","๐Ÿ™‹","๐Ÿ™‹โ€โ™‚๏ธ","๐Ÿ™‹โ€โ™€๏ธ","๐Ÿง","๐Ÿงโ€โ™‚๏ธ","๐Ÿงโ€โ™€๏ธ","๐Ÿ™‡","๐Ÿ™‡โ€โ™‚๏ธ","๐Ÿ™‡โ€โ™€๏ธ","๐Ÿคฆ","๐Ÿคฆโ€โ™‚๏ธ","๐Ÿคฆโ€โ™€๏ธ","๐Ÿคท","๐Ÿคทโ€โ™‚๏ธ","๐Ÿคทโ€โ™€๏ธ","๐Ÿ‘จโ€โš•๏ธ","๐Ÿ‘ฉโ€โš•๏ธ","๐Ÿ‘จโ€๐ŸŽ“","๐Ÿ‘ฉโ€๐ŸŽ“","๐Ÿ‘จโ€๐Ÿซ","๐Ÿ‘ฉโ€๐Ÿซ","๐Ÿ‘จโ€โš–๏ธ","๐Ÿ‘ฉโ€โš–๏ธ","๐Ÿ‘จโ€๐ŸŒพ","๐Ÿ‘ฉโ€๐ŸŒพ","๐Ÿ‘จโ€๐Ÿณ","๐Ÿ‘ฉโ€๐Ÿณ","๐Ÿ‘จโ€๐Ÿ”ง","๐Ÿ‘ฉโ€๐Ÿ”ง","๐Ÿ‘จโ€๐Ÿญ","๐Ÿ‘ฉโ€๐Ÿญ","๐Ÿ‘จโ€๐Ÿ’ผ","๐Ÿ‘ฉโ€๐Ÿ’ผ","๐Ÿ‘จโ€๐Ÿ”ฌ","๐Ÿ‘ฉโ€๐Ÿ”ฌ","๐Ÿ‘จโ€๐Ÿ’ป","๐Ÿ‘ฉโ€๐Ÿ’ป","๐Ÿ‘จโ€๐ŸŽค","๐Ÿ‘ฉโ€๐ŸŽค","๐Ÿ‘จโ€๐ŸŽจ","๐Ÿ‘ฉโ€๐ŸŽจ","๐Ÿ‘จโ€โœˆ๏ธ","๐Ÿ‘ฉโ€โœˆ๏ธ","๐Ÿ‘จโ€๐Ÿš€","๐Ÿ‘ฉโ€๐Ÿš€","๐Ÿ‘จโ€๐Ÿš’","๐Ÿ‘ฉโ€๐Ÿš’","๐Ÿ‘ฎ","๐Ÿ‘ฎโ€โ™‚๏ธ","๐Ÿ‘ฎโ€โ™€๏ธ","๐Ÿ•ต๏ธ","๐Ÿ•ต๏ธโ€โ™‚๏ธ","๐Ÿ•ต๏ธโ€โ™€๏ธ","๐Ÿ’‚","๐Ÿ’‚โ€โ™‚๏ธ","๐Ÿ’‚โ€โ™€๏ธ","๐Ÿ‘ท","๐Ÿ‘ทโ€โ™‚๏ธ","๐Ÿ‘ทโ€โ™€๏ธ","๐Ÿคด","๐Ÿ‘ธ","๐Ÿ‘ณ","๐Ÿ‘ณโ€โ™‚๏ธ","๐Ÿ‘ณโ€โ™€๏ธ","๐Ÿ‘ฒ","๐Ÿง•","๐Ÿคต","๐Ÿ‘ฐ","๐Ÿคฐ","๐Ÿคฑ","๐Ÿ‘ผ","๐ŸŽ…","๐Ÿคถ","๐Ÿฆธ","๐Ÿฆธโ€โ™‚๏ธ","๐Ÿฆธโ€โ™€๏ธ","๐Ÿฆน","๐Ÿฆนโ€โ™‚๏ธ","๐Ÿฆนโ€โ™€๏ธ","๐Ÿง™","๐Ÿง™โ€โ™‚๏ธ","๐Ÿง™โ€โ™€๏ธ","๐Ÿงš","๐Ÿงšโ€โ™‚๏ธ","๐Ÿงšโ€โ™€๏ธ","๐Ÿง›","๐Ÿง›โ€โ™‚๏ธ","๐Ÿง›โ€โ™€๏ธ","๐Ÿงœ","๐Ÿงœโ€โ™‚๏ธ","๐Ÿงœโ€โ™€๏ธ","๐Ÿง","๐Ÿงโ€โ™‚๏ธ","๐Ÿงโ€โ™€๏ธ","๐Ÿ’†","๐Ÿ’†โ€โ™‚๏ธ","๐Ÿ’†โ€โ™€๏ธ","๐Ÿ’‡","๐Ÿ’‡โ€โ™‚๏ธ","๐Ÿ’‡โ€โ™€๏ธ","๐Ÿšถ","๐Ÿšถโ€โ™‚๏ธ","๐Ÿšถโ€โ™€๏ธ","๐Ÿง","๐Ÿงโ€โ™‚๏ธ","๐Ÿงโ€โ™€๏ธ","๐ŸงŽ","๐ŸงŽโ€โ™‚๏ธ","๐ŸงŽโ€โ™€๏ธ","๐Ÿ‘จโ€๐Ÿฆฏ","๐Ÿ‘ฉโ€๐Ÿฆฏ","๐Ÿ‘จโ€๐Ÿฆผ","๐Ÿ‘ฉโ€๐Ÿฆผ","๐Ÿ‘จโ€๐Ÿฆฝ","๐Ÿ‘ฉโ€๐Ÿฆฝ","๐Ÿƒ","๐Ÿƒโ€โ™‚๏ธ","๐Ÿƒโ€โ™€๏ธ","๐Ÿ’ƒ","๐Ÿ•บ","๐Ÿ•ด๏ธ","๐Ÿง–","๐Ÿง–โ€โ™‚๏ธ","๐Ÿง–โ€โ™€๏ธ","๐Ÿง—","๐Ÿง—โ€โ™‚๏ธ","๐Ÿง—โ€โ™€๏ธ","๐Ÿ‡","๐Ÿ‚","๐ŸŒ๏ธ","๐ŸŒ๏ธโ€โ™‚๏ธ","๐ŸŒ๏ธโ€โ™€๏ธ","๐Ÿ„","๐Ÿ„โ€โ™‚๏ธ","๐Ÿ„โ€โ™€๏ธ","๐Ÿšฃ","๐Ÿšฃโ€โ™‚๏ธ","๐Ÿšฃโ€โ™€๏ธ","๐ŸŠ","๐ŸŠโ€โ™‚๏ธ","๐ŸŠโ€โ™€๏ธ","โ›น๏ธ","โ›น๏ธโ€โ™‚๏ธ","โ›น๏ธโ€โ™€๏ธ","๐Ÿ‹๏ธ","๐Ÿ‹๏ธโ€โ™‚๏ธ","๐Ÿ‹๏ธโ€โ™€๏ธ","๐Ÿšด","๐Ÿšดโ€โ™‚๏ธ","๐Ÿšดโ€โ™€๏ธ","๐Ÿšต","๐Ÿšตโ€โ™‚๏ธ","๐Ÿšตโ€โ™€๏ธ","๐Ÿคธ","๐Ÿคธโ€โ™‚๏ธ","๐Ÿคธโ€โ™€๏ธ","๐Ÿคฝ","๐Ÿคฝโ€โ™‚๏ธ","๐Ÿคฝโ€โ™€๏ธ","๐Ÿคพ","๐Ÿคพโ€โ™‚๏ธ","๐Ÿคพโ€โ™€๏ธ","๐Ÿคน","๐Ÿคนโ€โ™‚๏ธ","๐Ÿคนโ€โ™€๏ธ","๐Ÿง˜","๐Ÿง˜โ€โ™‚๏ธ","๐Ÿง˜โ€โ™€๏ธ","๐Ÿ›€","๐Ÿ›Œ","๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘","๐Ÿ‘ญ","๐Ÿ‘ซ","๐Ÿ‘ฌ"]);function ii(t){return ni.has(t)}function ri(t){return[...t].filter(t=>!si(t.codePointAt(0))).join("")}function oi(t,e){const n=[...t].map(t=>t.codePointAt(0));return n[1]&&(si(n[1])||65039===n[1])?n[1]=e:n.splice(1,0,e),String.fromCodePoint(...n)}function si(t){return t>=127995&&t<=127999}function ai(t){switch(t){case 1:return 127995;case 2:return 127996;case 3:return 127997;case 4:return 127998;case 5:return 127999;default:return null}}class GEmojiElement extends HTMLElement{get image(){return this.firstElementChild instanceof HTMLImageElement?this.firstElementChild:null}get tone(){return(this.getAttribute("tone")||"").split(" ").map(t=>{const e=parseInt(t,10);return e>=0&&e<=5?e:0}).join(" ")}set tone(t){this.setAttribute("tone",t)}connectedCallback(){if(null===this.image&&!function(){const t=/\bWindows NT 6.1\b/.test(navigator.userAgent),e=/\bWindows NT 6.2\b/.test(navigator.userAgent),n=/\bWindows NT 6.3\b/.test(navigator.userAgent),i=/\bFreeBSD\b/.test(navigator.userAgent),r=/\bLinux\b/.test(navigator.userAgent)&&!/\bAndroid\b/.test(navigator.userAgent);return!(t||e||n||r||i)}()){const t=this.getAttribute("fallback-src");if(t){this.textContent="";const e=function(t){const e=document.createElement("img");return e.className="emoji",e.alt=t.getAttribute("alias")||"",e.height=20,e.width=20,e}(this);e.src=t,this.appendChild(e)}}this.hasAttribute("tone")&&ci(this)}static get observedAttributes(){return["tone"]}attributeChangedCallback(t){switch(t){case"tone":ci(this)}}}function ci(t){if(t.image)return;const e=t.tone.split(" ").map(t=>parseInt(t,10));if(0===e.length)t.textContent=ri(t.textContent||"");else if(1===e.length){const n=e[0];t.textContent=0===n?ri(t.textContent||""):function(t,e){const n=ri(t);if(!ii(n))return t;const i=ai(e);return i?n.split("โ€").map(t=>ii(t)?oi(t,i):t).join("โ€"):t}(t.textContent||"",n)}else t.textContent=function(t,e){const n=ri(t);if(!ii(n))return t;const i=e.map(t=>ai(t));return n.split("โ€").map(t=>{if(!ii(t))return t;const e=i.shift();return e?oi(t,e):t}).join("โ€")}(t.textContent||"",e)}window.customElements.get("g-emoji")||(window.GEmojiElement=GEmojiElement,window.customElements.define("g-emoji",GEmojiElement));const li=document.createElement("template");li.innerHTML='\n  <div class="crop-wrapper">\n    <img width="100%" class="crop-image" alt="">\n    <div class="crop-container">\n      <div data-crop-box class="crop-box">\n        <div class="crop-outline"></div>\n        <div data-direction="nw" class="handle nw"></div>\n        <div data-direction="ne" class="handle ne"></div>\n        <div data-direction="sw" class="handle sw"></div>\n        <div data-direction="se" class="handle se"></div>\n      </div>\n    </div>\n  </div>\n';const ui=new WeakMap,di=new WeakMap,hi=new WeakMap;function mi(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=hi.get(e)||{};let r=0,o=0;if("keydown"===t.type)"ArrowUp"===t.key?o=-1:"ArrowDown"===t.key?o=1:"ArrowLeft"===t.key?r=-1:"ArrowRight"===t.key&&(r=1);else if(di.has(e)&&t instanceof MouseEvent){const n=di.get(e);if(!n)return;r=t.pageX-n.dragStartX,o=t.pageY-n.dragStartY}if(0!==r||0!==o){const t=Math.min(Math.max(0,n.offsetLeft+r),i.width-n.offsetWidth),s=Math.min(Math.max(0,n.offsetTop+o),i.height-n.offsetHeight);n.style.left="".concat(t,"px"),n.style.top="".concat(s,"px"),wi(e,{x:t,y:s,width:n.offsetWidth,height:n.offsetHeight})}t instanceof MouseEvent&&di.set(e,{dragStartX:t.pageX,dragStartY:t.pageY})}function fi(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");if(!(n instanceof ImageCropElement))return;const{box:i}=hi.get(n)||{},r=n.getBoundingClientRect();let o,s,a;if(t.key){if("Escape"===t.key)return bi(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;o=i.offsetWidth+a,s=i.offsetHeight+a,ui.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=ui.get(n);if(!e)return;o=t.pageX-e.startX-r.left-window.pageXOffset,s=t.pageY-e.startY-r.top-window.pageYOffset}o&&s&&gi(n,o,s,!(t instanceof KeyboardEvent))}function pi(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");if(!(n instanceof ImageCropElement))return;const{box:i}=hi.get(n)||{},r=t.target;if(r instanceof HTMLElement)if(r.hasAttribute("data-direction")){const e=r.getAttribute("data-direction");n.addEventListener("mousemove",fi),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),ui.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),fi(t)}else n.addEventListener("mousemove",mi)}function gi(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=Math.max(Math.abs(e),Math.abs(n),10);const o=ui.get(t);if(!o)return;const{box:s,image:a}=hi.get(t)||{};r=Math.min(r,n>0?a.height-o.startY:o.startY,e>0?a.width-o.startX:o.startX);const c=i?Math.round(Math.max(0,e>0?o.startX:o.startX-r)):s.offsetLeft,l=i?Math.round(Math.max(0,n>0?o.startY:o.startY-r)):s.offsetTop;s.style.left="".concat(c,"px"),s.style.top="".concat(l,"px"),s.style.width="".concat(r,"px"),s.style.height="".concat(r,"px"),wi(t,{x:c,y:l,width:r,height:r})}function vi(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");n instanceof ImageCropElement&&(n.loaded=!0,bi(n))}function bi(t){const{image:e}=hi.get(t)||{},n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);ui.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),gi(t,n,n)}function Ei(t){const e=t.currentTarget;e instanceof ImageCropElement&&(di.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",fi),e.removeEventListener("mousemove",mi))}function wi(t,e){const{image:n}=hi.get(t)||{},i=n.naturalWidth/n.width;for(const r in e){const n=Math.round(e[r]*i);e[r]=n;const o=t.querySelector("[data-image-crop-input='".concat(r,"']"));o instanceof HTMLInputElement&&(o.value=n.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(hi.has(this))return;this.appendChild(document.importNode(li.content,!0));const t=this.querySelector("[data-crop-box]");if(!(t instanceof HTMLElement))return;const e=this.querySelector("img");e instanceof HTMLImageElement&&(hi.set(this,{box:t,image:e}),e.addEventListener("load",vi),this.addEventListener("mouseleave",Ei),this.addEventListener("mouseup",Ei),t.addEventListener("mousedown",pi),this.addEventListener("keydown",mi),this.addEventListener("keydown",fi),this.src&&(e.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=hi.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const yi=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref"];function xi(t){const e=[];for(const n of t.querySelectorAll(yi.join(", ")))n.hidden||n.offsetWidth<=0&&n.offsetHeight<=0||n.closest("markdown-toolbar")===t&&e.push(n);return e}const Ai=new WeakMap;class MarkdownButtonElement extends HTMLElement{constructor(){super();const t=()=>{const t=Ai.get(this);t&&_i(this,t)};var e;this.addEventListener("keydown",(e=t,function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),e(t))})),this.addEventListener("click",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","button")}click(){const t=Ai.get(this);t&&_i(this,t)}}class MarkdownHeaderButtonElement extends MarkdownButtonElement{constructor(){super();const t=parseInt(this.getAttribute("level")||"3",10);if(t<1||t>6)return;const e=`${"#".repeat(t)} `;Ai.set(this,{prefix:e})}}window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=MarkdownHeaderButtonElement,window.customElements.define("md-header",MarkdownHeaderButtonElement));class MarkdownBoldButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"**",suffix:"**",trimFirst:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","b")}}window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=MarkdownBoldButtonElement,window.customElements.define("md-bold",MarkdownBoldButtonElement));class MarkdownItalicButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"_",suffix:"_",trimFirst:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","i")}}window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=MarkdownItalicButtonElement,window.customElements.define("md-italic",MarkdownItalicButtonElement));class MarkdownQuoteButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"> ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=MarkdownQuoteButtonElement,window.customElements.define("md-quote",MarkdownQuoteButtonElement));class MarkdownCodeButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"})}}window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=MarkdownCodeButtonElement,window.customElements.define("md-code",MarkdownCodeButtonElement));class MarkdownLinkButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","k")}}window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=MarkdownLinkButtonElement,window.customElements.define("md-link",MarkdownLinkButtonElement));class MarkdownImageButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"![",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-image")||(window.MarkdownImageButtonElement=MarkdownImageButtonElement,window.customElements.define("md-image",MarkdownImageButtonElement));class MarkdownUnorderedListButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"- ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=MarkdownUnorderedListButtonElement,window.customElements.define("md-unordered-list",MarkdownUnorderedListButtonElement));class MarkdownOrderedListButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"1. ",multiline:!0,orderedList:!0})}}window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=MarkdownOrderedListButtonElement,window.customElements.define("md-ordered-list",MarkdownOrderedListButtonElement));class MarkdownTaskListButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","L")}}window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=MarkdownTaskListButtonElement,window.customElements.define("md-task-list",MarkdownTaskListButtonElement));class MarkdownMentionButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"@",prefixSpace:!0})}}window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=MarkdownMentionButtonElement,window.customElements.define("md-mention",MarkdownMentionButtonElement));class MarkdownRefButtonElement extends MarkdownButtonElement{constructor(){super(),Ai.set(this,{prefix:"#",prefixSpace:!0})}}window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=MarkdownRefButtonElement,window.customElements.define("md-ref",MarkdownRefButtonElement));const ki=navigator.userAgent.match(/Macintosh/)?"Meta":"Control";class MarkdownToolbarElement extends HTMLElement{constructor(){super()}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.addEventListener("keydown",Li);const t=Ci.bind(null,this);this.field&&(this.field.addEventListener("keydown",t),Mi.set(this,t)),this.setAttribute("tabindex","0"),this.addEventListener("focus",Ti,{once:!0})}disconnectedCallback(){const t=Mi.get(this);t&&this.field&&(this.field.removeEventListener("keydown",t),Mi.delete(this)),this.removeEventListener("keydown",Li)}get field(){const t=this.getAttribute("for");if(!t)return null;const e="getRootNode"in this?this.getRootNode():document;let n;return(e instanceof Document||e instanceof ShadowRoot)&&(n=e.getElementById(t)),n instanceof HTMLTextAreaElement?n:null}}function Ti({target:t}){if(!(t instanceof Element))return;t.removeAttribute("tabindex");let e="0";for(const n of xi(t))n.setAttribute("tabindex",e),"0"===e&&(n.focus(),e="-1")}function Li(t){const e=t.key;if("ArrowRight"!==e&&"ArrowLeft"!==e&&"Home"!==e&&"End"!==e)return;const n=t.currentTarget;if(!(n instanceof HTMLElement))return;const i=xi(n),r=i.indexOf(t.target),o=i.length;if(-1===r)return;let s=0;"ArrowLeft"===e&&(s=r-1),"ArrowRight"===e&&(s=r+1),"End"===e&&(s=o-1),s<0&&(s=o-1),s>o-1&&(s=0);for(let a=0;a<o;a+=1)i[a].setAttribute("tabindex",a===s?"0":"-1");t.preventDefault(),i[s].focus()}const Mi=new WeakMap;function Ci(t,e){if(e.metaKey&&"Meta"===ki||e.ctrlKey&&"Control"===ki){const n=function(t,e){for(const n of t.querySelectorAll("[hotkey]"))if(n.getAttribute("hotkey")===e)return n;return null}(t,e.key);n&&(n.click(),e.preventDefault())}}function Si(t){return t.trim().split("\n").length>1}function Ni(t,e){return Array(e+1).join(t)}function Hi(t,e,n){let i=e;const r=n?/\n/:/\s/;for(;t[i]&&!t[i].match(r);)i++;return i}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=MarkdownToolbarElement,window.customElements.define("markdown-toolbar",MarkdownToolbarElement));let Di=null;function Ii(t,e){const n=t.value.slice(t.selectionStart,t.selectionEnd);let i;i=e.orderedList?function(t){const e=/^\d+\.\s+/,n=t.selectionStart===t.selectionEnd;let i,r,o,s,a=t.value.slice(t.selectionStart,t.selectionEnd),c=a,l=a.split("\n");if(n){const e=t.value.slice(0,t.selectionStart).split(/\n/);o=t.selectionStart-e[e.length-1].length,s=Hi(t.value,t.selectionStart,!0),c=t.value.slice(o,s)}const u=c.split("\n");if(u.every(t=>e.test(t))){if(l=u.map(t=>t.replace(e,"")),a=l.join("\n"),n&&o&&s){const e=u[0].length-l[0].length;r=i=t.selectionStart-e,t.selectionStart=o,t.selectionEnd=s}}else{l=function(t){let e,n,i;const r=[];for(i=e=0,n=t.length;e<n;i=++e){const e=t[i];r.push(`${i+1}. ${e}`)}return r}(l),a=l.join("\n");const{newlinesToAppend:e,newlinesToPrepend:o}=Pi(t);r=t.selectionStart+e.length,i=r+a.length,n&&(r=i),a=e+a+o}return{text:a,selectionStart:r,selectionEnd:i}}(t):e.multiline&&Si(n)?function(t,e){const{prefix:n,suffix:i,surroundWithNewlines:r}=e;let o=t.value.slice(t.selectionStart,t.selectionEnd),s=t.selectionStart,a=t.selectionEnd;const c=o.split("\n");if(c.every(t=>t.startsWith(n)&&t.endsWith(i)))o=c.map(t=>t.slice(n.length,t.length-i.length)).join("\n"),a=s+o.length;else if(o=c.map(t=>n+t+i).join("\n"),r){const{newlinesToAppend:e,newlinesToPrepend:n}=Pi(t);s+=e.length,a=s+o.length,o=e+o+n}return{text:o,selectionStart:s,selectionEnd:a}}(t,e):function(t,e){let n,i;const{prefix:r,suffix:o,blockPrefix:s,blockSuffix:a,replaceNext:c,prefixSpace:l,scanFor:u,surroundWithNewlines:d}=e,h=t.selectionStart,m=t.selectionEnd;let f=t.value.slice(t.selectionStart,t.selectionEnd),p=Si(f)&&s.length>0?`${s}\n`:r,g=Si(f)&&a.length>0?`\n${a}`:o;if(l){const e=t.value[t.selectionStart-1];0===t.selectionStart||null==e||e.match(/\s/)||(p=` ${p}`)}f=function(t,e,n,i=!1){if(t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){let n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=Hi(t.value,t.selectionEnd,i);else{const i=t.selectionStart-e.length,r=t.selectionEnd+n.length,o=t.value.slice(i,t.selectionStart)===e,s=t.value.slice(t.selectionEnd,r)===n;o&&s&&(t.selectionStart=i,t.selectionEnd=r)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,p,g,e.multiline);let v=t.selectionStart,b=t.selectionEnd;const E=c.length>0&&g.indexOf(c)>-1&&f.length>0;if(d){const e=Pi(t);n=e.newlinesToAppend,i=e.newlinesToPrepend,p=n+r,g+=i}if(f.startsWith(p)&&f.endsWith(g)){const t=f.slice(p.length,f.length-g.length);if(h===m){let e=h-p.length;e=Math.max(e,v),e=Math.min(e,v+t.length),v=b=e}else b=v+t.length;return{text:t,selectionStart:v,selectionEnd:b}}if(E){if(u.length>0&&f.match(u)){g=g.replace(c,f);const t=p+g;return v=b=v+p.length,{text:t,selectionStart:v,selectionEnd:b}}{const t=p+f+g;return v=v+p.length+f.length+g.indexOf(c),b=v+c.length,{text:t,selectionStart:v,selectionEnd:b}}}{let t=p+f+g;v=h+p.length,b=m+p.length;const n=f.match(/^\s*|\s*$/g);if(e.trimFirst&&n){const e=n[0]||"",i=n[1]||"";t=e+p+f.trim()+g+i,v+=e.length,b-=i.length}return{text:t,selectionStart:v,selectionEnd:b}}}(t,e),function(t,{text:e,selectionStart:n,selectionEnd:i}){const r=t.selectionStart,o=t.value.slice(0,r),s=t.value.slice(t.selectionEnd);if(null===Di||!0===Di){t.contentEditable="true";try{Di=document.execCommand("insertText",!1,e)}catch(a){Di=!1}t.contentEditable="false"}if(Di&&!t.value.slice(0,t.selectionStart).endsWith(e)&&(Di=!1),!Di){try{document.execCommand("ms-beginUndoUnit")}catch(Zr){}t.value=o+e+s;try{document.execCommand("ms-endUndoUnit")}catch(Zr){}t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}null!=n&&null!=i?t.setSelectionRange(n,i):t.setSelectionRange(r,t.selectionEnd)}(t,i)}function Pi(t){const e=t.value.slice(0,t.selectionStart),n=t.value.slice(t.selectionEnd),i=e.match(/\n*$/),r=n.match(/^\n*/),o=i?i[0].length:0,s=r?r[0].length:0;let a,c;return e.match(/\S/)&&o<2&&(a=Ni("\n",2-o)),n.match(/\S/)&&s<2&&(c=Ni("\n",2-s)),null==a&&(a=""),null==c&&(c=""),{newlinesToAppend:a,newlinesToPrepend:c}}function _i(t,e){const n=t.closest("markdown-toolbar");if(!(n instanceof MarkdownToolbarElement))return;const i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,trimFirst:!1}),e),r=n.field;r&&(r.focus(),Ii(r,i))}t("X",MarkdownToolbarElement);class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),i=n.indexOf(n.find(t=>t.matches('[aria-selected="true"]')));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),Oi(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),Oi(this,t)}else"Home"===t.code?(Oi(this,0),t.preventDefault()):"End"===t.code&&(Oi(this,n.length-1),t.preventDefault())}),this.addEventListener("click",t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');n&&n.closest('[role="tablist"]')&&Oi(this,e.indexOf(n))})}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}}function Oi(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),i=t.querySelectorAll('[role="tabpanel"]'),r=n[e],o=i[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");r.setAttribute("aria-selected","true"),r.setAttribute("tabindex","0"),r.focus(),o.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}t("K",TabContainerElement),window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));const qi=/\s|\(|\[/;function Fi(t,e,n){const i=t.lastIndexOf(e,n-1);if(-1===i)return;if(t.lastIndexOf(" ",n-1)>i)return;const r=t[i-1];return!r||qi.test(r)?{word:t.substring(i+e.length,n),position:i+e.length}:void 0}const Ri=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],$i=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","max-height","min-height","padding-bottom","padding-left","padding-right","padding-top","border-bottom","border-left","border-right","border-top","text-decoration","text-indent","text-transform","width","word-spacing"],Bi=new WeakMap;function Wi(t,e=t.selectionEnd){const{mirror:n,marker:i}=function(t,e){const n=t.nodeName.toLowerCase();if("textarea"!==n&&"input"!==n)throw new Error("expected textField to a textarea or input");let i=Bi.get(t);if(i&&i.parentElement===t.parentElement)i.innerHTML="";else{i=document.createElement("div"),Bi.set(t,i);const e=window.getComputedStyle(t),r=Ri.slice(0);"textarea"===n?r.push("white-space:pre-wrap;"):r.push("white-space:nowrap;");for(let t=0,n=$i.length;t<n;t++){const n=$i[t];r.push(`${n}:${e.getPropertyValue(n)};`)}i.style.cssText=r.join(" ")}const r=document.createElement("span");let o,s;if(r.style.cssText="position: absolute;",r.innerHTML="&nbsp;","number"==typeof e){let n=t.value.substring(0,e);n&&(o=document.createTextNode(n)),n=t.value.substring(e),n&&(s=document.createTextNode(n))}else{const e=t.value;e&&(o=document.createTextNode(e))}if(o&&i.appendChild(o),i.appendChild(r),s&&i.appendChild(s),!i.parentElement){if(!t.parentElement)throw new Error("textField must have a parentElement to mirror");t.parentElement.insertBefore(i,t)}return i.scrollTop=t.scrollTop,i.scrollLeft=t.scrollLeft,{mirror:i,marker:r}}(t,e),r=n.getBoundingClientRect(),o=i.getBoundingClientRect();return setTimeout(()=>{n.remove()},5e3),{top:o.top-r.top,left:o.left-r.left}}const ji=new WeakMap;class TextExpander{constructor(t,e){this.expander=t,this.input=e,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithList=!1,e.addEventListener("paste",this.onpaste),e.addEventListener("input",this.oninput),e.addEventListener("keydown",this.onkeydown),e.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}activate(t,e){if(this.input!==document.activeElement)return;this.deactivate(),this.menu=e,e.id||(e.id=`text-expander-${Math.floor(1e5*Math.random()).toString()}`),this.expander.append(e),this.combobox=new Combobox(this.input,e);const{top:n,left:i}=Wi(this.input,t.position);e.style.top=`${n}px`,e.style.left=`${i}px`,this.combobox.start(),e.addEventListener("combobox-commit",this.oncommit),e.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1)}deactivate(){const t=this.menu;t&&this.combobox&&(this.menu=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),this.combobox.destroy(),t.remove())}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(!this.combobox)return;const n=this.match;if(!n)return;const i=this.input.value.substring(0,n.position-n.key.length),r=this.input.value.substring(n.position+n.text.length),o={item:e,key:n.key,value:null};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:o})))return;if(!o.value)return;const s=`${o.value} `;this.input.value=i+s+r,this.deactivate(),this.input.focus();const a=i.length+s.length;this.input.selectionStart=a,this.input.selectionEnd=a}onBlur(){this.interactingWithList?this.interactingWithList=!1:this.deactivate()}onPaste(){this.justPasted=!0}async onInput(){if(this.justPasted)return void(this.justPasted=!1);const t=this.findMatch();if(t){this.match=t;const e=await this.notifyProviders(t);if(!this.match)return;e?this.activate(t,e):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const t=this.input.selectionEnd,e=this.input.value;for(const n of this.expander.keys){const i=Fi(e,n,t);if(i)return{text:i.word,key:n,position:i.position}}}async notifyProviders(t){const e=[];if(this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:t=>e.push(t),text:t.text,key:t.key}})))return(await Promise.all(e)).filter(t=>t.matched).map(t=>t.fragment)[0]}onMousedown(){this.interactingWithList=!0}onKeydown(t){"Escape"===t.key&&(this.deactivate(),t.stopImmediatePropagation(),t.preventDefault())}}class TextExpanderElement extends HTMLElement{get keys(){const t=this.getAttribute("keys");return t?t.split(" "):[]}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const e=new TextExpander(this,t);ji.set(this,e)}disconnectedCallback(){const t=ji.get(this);t&&(t.destroy(),ji.delete(this))}}window.customElements.get("text-expander")||(window.TextExpanderElement=TextExpanderElement,window.customElements.define("text-expander",TextExpanderElement));const Vi=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ui=["January","February","March","April","May","June","July","August","September","October","November","December"];function Ki(t){return"0".concat(t).slice(-2)}function Yi(t,e){const n=t.getDay(),i=t.getDate(),r=t.getMonth(),o=t.getFullYear(),s=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return Vi[n].slice(0,3);case"A":return Vi[n];case"b":return Ui[r].slice(0,3);case"B":return Ui[r];case"c":return t.toString();case"d":return Ki(i);case"e":return String(i);case"H":return Ki(s);case"I":return Ki(Yi(t,"%l"));case"l":return String(0===s||12===s?12:(s+12)%12);case"m":return Ki(r+1);case"M":return Ki(a);case"p":return s>11?"PM":"AM";case"P":return s>11?"pm":"am";case"S":return Ki(c);case"w":return String(n);case"y":return Ki(o%100);case"Y":return String(o);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function zi(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(Zr){if(!(Zr instanceof RangeError))throw Zr}}}let Xi=null;const Qi=zi({day:"numeric",month:"short"});function Gi(){if(null!==Xi)return Xi;const t=Qi();if(t){const e=t.format(new Date(0));return Xi=!!e.match(/^\d/),Xi}return!1}let Zi=null;const Ji=zi({day:"numeric",month:"short",year:"numeric"});function tr(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const er=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?er.delete(this):er.set(this,new Date(t))}const r=this.getFormattedTitle(),o=this.getAttribute("title");"title"===t||!r||o&&o!==i||this.setAttribute("title",r);const s=this.getFormattedDate();s&&(this.textContent=s)}get date(){return er.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=nr();if(e)return e.format(t);try{return t.toLocaleString()}catch(Zr){if(Zr instanceof RangeError)return t.toString();throw Zr}}getFormattedDate(){}}const nr=zi({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),ir=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||ir.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;const e=function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let i=Gi()?"weekday day month year":"weekday month day, year";for(const r in n){const e=n[r][t.getAttribute(r)];i=i.replace(r,e||"")}return i=i.replace(/(\s,)|(,\s$)/,""),Yi(e,i).replace(/\s+/," ").trim()}(this,t)||"",n=function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const r=t.getAttribute("minute");"numeric"!==r&&"2-digit"!==r||(n.minute=r);const o=t.getAttribute("second");"numeric"!==o&&"2-digit"!==o||(n.second=o);const s=t.getAttribute("time-zone-name");"short"!==s&&"long"!==s||(n.timeZoneName=s);if(0===Object.keys(n).length)return;let a=ir.get(t);a||(a=zi(n),ir.set(t,a));const c=a();if(c)return c.format(e);{const t=n.second?"%H:%M:%S":"%H:%M";return Yi(e,t)}}(this,t)||"";return"".concat(e," ").concat(n).trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class RelativeTime{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||"on ".concat(this.formatDate())}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24);return t>=0&&r<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24);return t>=0&&r<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24),o=Math.round(r/30),s=Math.round(o/12);return t<0?rr(this.locale,0,"second"):e<10?rr(this.locale,0,"second"):e<45?rr(this.locale,-e,"second"):e<90?rr(this.locale,-n,"minute"):n<45?rr(this.locale,-n,"minute"):n<90?rr(this.locale,-i,"hour"):i<24?rr(this.locale,-i,"hour"):i<36?rr(this.locale,-r,"day"):r<30?rr(this.locale,-r,"day"):o<18?rr(this.locale,-o,"month"):rr(this.locale,-s,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24),o=Math.round(r/30),s=Math.round(o/12);return n<1?"1m":n<60?"".concat(n,"m"):i<24?"".concat(i,"h"):r<365?"".concat(r,"d"):"".concat(s,"y")}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24),o=Math.round(r/30),s=Math.round(o/12);return o>=18?rr(this.locale,s,"year"):o>=12?rr(this.locale,s,"year"):r>=45?rr(this.locale,o,"month"):r>=30?rr(this.locale,o,"month"):i>=36?rr(this.locale,r,"day"):i>=24?rr(this.locale,r,"day"):n>=90?rr(this.locale,i,"hour"):n>=45?rr(this.locale,i,"hour"):e>=90?rr(this.locale,n,"minute"):e>=45?rr(this.locale,n,"minute"):rr(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),r=Math.round(i/24),o=Math.round(r/30),s=Math.round(o/12);return r>=365?"".concat(s,"y"):i>=24?"".concat(r,"d"):n>=60?"".concat(i,"h"):n>1?"".concat(n,"m"):"1m"}formatDate(){let t=Gi()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==Zi)return Zi;const t=Ji();if(t){const e=t.format(new Date(0));return Zi=!!e.match(/\d,/),Zi}return!0}()?", %Y":" %Y"),Yi(this.date,t)}formatTime(){const t=or();return t?t.format(this.date):Yi(this.date,"%l:%M%P")}}function rr(t,e,n){const i=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(Zr){if(!(Zr instanceof RangeError))throw Zr}}(t,{numeric:"auto"});return i?i.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return"this ".concat(e);case"day":return"today";case"hour":case"minute":return"in 0 ".concat(e,"s");case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return"next ".concat(e);case"day":return"tomorrow";case"hour":case"minute":case"second":return"in 1 ".concat(e)}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return"last ".concat(e);case"day":return"yesterday";case"hour":case"minute":case"second":return"1 ".concat(e," ago")}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return"in ".concat(t," ").concat(e,"s")}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return"".concat(-t," ").concat(e,"s ago")}throw new RangeError("Invalid unit argument for format() '".concat(e,"'"))}(e,n)}const or=zi({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new RelativeTime(t,tr(this)).toString()}connectedCallback(){sr.push(this),ar||(cr(),ar=setInterval(cr,6e4)),super.connectedCallback()}disconnectedCallback(){const t=sr.indexOf(this);-1!==t&&sr.splice(t,1),sr.length||ar&&(clearInterval(ar),ar=null)}}t("E",RelativeTimeElement);const sr=[];let ar;function cr(){let t,e,n;for(e=0,n=sr.length;e<n;e++)t=sr[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new RelativeTime(e,tr(this)).microTimeAgo():new RelativeTime(e,tr(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new RelativeTime(e,tr(this)).microTimeUntil():new RelativeTime(e,tr(this)).timeUntil()}}function lr(t,e){const n=t.value.substring(0,t.selectionStart||0),i=t.value.substring(t.selectionEnd||0),r=0===n.length||n.match(/\n$/)?"":"\n",o=n+r+e;t.value=o+i,t.selectionStart=o.length,t.selectionEnd=t.selectionStart,t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),t.focus()}function ur(t){const e=t.dataTransfer;if(!e)return;if(function(t){return Array.from(t.types).indexOf("Files")>=0}(e))return;if(!fr(e))return;const n=pr(e);if(!n.some(vr))return;t.stopPropagation(),t.preventDefault();const i=t.currentTarget;i instanceof HTMLTextAreaElement&&lr(i,n.map(mr).join(""))}function dr(t){const e=t.dataTransfer;e&&(e.dropEffect="link")}function hr(t){const e=t.clipboardData;if(!e||!fr(e))return;const n=pr(e);if(!n.some(vr))return;t.stopPropagation(),t.preventDefault();const i=t.currentTarget;i instanceof HTMLTextAreaElement&&lr(i,n.map(mr).join(""))}function mr(t){return vr(t)?`\n![](${t})\n`:t}function fr(t){return Array.from(t.types).indexOf("text/uri-list")>=0}function pr(t){return(t.getData("text/uri-list")||"").split("\r\n")}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement)),window.IncludeFragmentElement.prototype.fetch=t=>(t.headers.append("X-Requested-With","XMLHttpRequest"),window.fetch(t));const gr=/\.(gif|png|jpe?g)$/i;function vr(t){return gr.test(t)}function br(t){const e=t.dataTransfer;if(!e)return;if(function(t){return Array.from(t.types).indexOf("Files")>=0}(e))return;const n=Ar(e);if(!n)return;t.stopPropagation(),t.preventDefault();const i=t.currentTarget;i instanceof HTMLTextAreaElement&&lr(i,xr(n))}function Er(t){const e=t.dataTransfer;e&&(e.dropEffect="copy")}function wr(t){if(!t.clipboardData)return;const e=Ar(t.clipboardData);if(!e)return;t.stopPropagation(),t.preventDefault();const n=t.currentTarget;n instanceof HTMLTextAreaElement&&lr(n,xr(e))}function yr(t){return(t.textContent||"").trim().replace(/\|/g,"\\|").replace(/\n/g," ")||"ย "}function xr(t){const e=Array.from(t.querySelectorAll("tr")),n=e.shift();if(!n)return"";const i=(r=n,Array.from(r.querySelectorAll("td, th")).map(yr));var r;const o=i.map(()=>"--");return`\n${`${i.join(" | ")}\n${o.join(" | ")}\n`}${e.map(t=>Array.from(t.querySelectorAll("td")).map(yr).join(" | ")).join("\n")}\n\n`}function Ar(t){if(-1===Array.from(t.types).indexOf("text/html"))return null;const e=t.getData("text/html");if(!/<table/i.test(e))return null;const n=function(t){const e=document.createElement("div");return e.innerHTML=t,e.querySelector("table")}(e);return!n||n.closest("[data-paste-markdown-skip]")?null:n}function kr(t){const e=t.clipboardData;if(!e||!function(t){return Array.from(t.types).indexOf("text/x-gfm")>=0}(e))return;const n=t.currentTarget;if(!(n instanceof HTMLTextAreaElement))return;const i=e.getData("text/x-gfm");i&&(t.stopPropagation(),t.preventDefault(),lr(n,i))}t("J",(function(t){return function(t){t.addEventListener("dragover",Er),t.addEventListener("drop",br),t.addEventListener("paste",wr)}(t),function(t){t.addEventListener("dragover",dr),t.addEventListener("drop",ur),t.addEventListener("paste",hr)}(t),function(t){t.addEventListener("paste",kr)}(t),{unsubscribe:()=>{!function(t){t.removeEventListener("dragover",Er),t.removeEventListener("drop",br),t.removeEventListener("paste",wr)}(t),function(t){t.removeEventListener("dragover",dr),t.removeEventListener("drop",ur),t.removeEventListener("paste",hr)}(t),function(t){t.removeEventListener("paste",kr)}(t)}}}));var Tr=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Lr=/\((\S*)(?::(\d+))(?::(\d+))\)/;var Mr=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Cr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Sr=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;var Nr=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;var Hr=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Dr(t){if(null===t.parentNode||!(t.parentNode instanceof HTMLElement))throw new Error;const e=t.parentNode.children;for(let n=0;n<e.length;++n)if(e[n]===t)return n;return 0}let Ir=0;function Pr(t){return t.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}const _r={INPUT:t=>t instanceof HTMLInputElement&&t.checked?"[x] ":"[ ] ",CODE(t){const e=t.textContent||"";return t.parentNode&&"PRE"===t.parentNode.nodeName?(t.textContent=`\`\`\`\n${e.replace(/\n+$/,"")}\n\`\`\`\n\n`,t):e.indexOf("`")>=0?`\`\` ${e} \`\``:`\`${e}\``},STRONG:t=>`**${t.textContent||""}**`,EM:t=>`_${t.textContent||""}_`,DEL:t=>`~${t.textContent||""}~`,BLOCKQUOTE(t){const e=(t.textContent||"").trim().replace(/^/gm,"> "),n=document.createElement("pre");return n.textContent=`${e}\n\n`,n},A(t){const e=t.textContent||"",n=t.getAttribute("href");return/^https?:/.test(e)&&e===n?e:n?`[${e}](${n})`:e},IMG(t){const e=t.getAttribute("alt")||"",n=t.getAttribute("src");if(!n)throw new Error;const i=t.hasAttribute("width")?` width="${Pr(t.getAttribute("width")||"")}"`:"",r=t.hasAttribute("height")?` height="${Pr(t.getAttribute("height")||"")}"`:"";return i||r?`<img alt="${Pr(e)}"${i}${r} src="${Pr(n)}">`:`![${e}](${n})`},LI(t){const e=t.parentNode;if(!e)throw new Error;let n="";if(!function(t){const e=t.childNodes[0],n=t.childNodes[1];return!!(e&&t.childNodes.length<3)&&!("OL"!==e.nodeName&&"UL"!==e.nodeName||n&&(n.nodeType!==Node.TEXT_NODE||(n.textContent||"").trim()))}(t))if("OL"===e.nodeName)if(Ir>0&&!e.previousSibling){n=`${Dr(t)+Ir+1}\\. `}else n=`${Dr(t)+1}. `;else n="* ";const i=n.replace(/\S/g," "),r=(t.textContent||"").trim().replace(/^/gm,i),o=document.createElement("pre");return o.textContent=r.replace(i,n),o},OL(t){const e=document.createElement("li");return e.appendChild(document.createElement("br")),t.append(e),t},H1(t){const e=parseInt(t.nodeName.slice(1));return t.prepend(`${Array(e+1).join("#")} `),t},UL:t=>t};_r.UL=_r.OL;for(let t=2;t<=6;++t)_r[`H${t}`]=_r.H1;function Or(t){const e=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT,(function(t){return t.nodeName in _r&&!function(t){if(t instanceof HTMLAnchorElement&&1===t.childNodes.length){const e=t.childNodes[0];if(e instanceof HTMLImageElement)return e.src===t.href}return!1}(t)&&(function(t){return"IMG"===t.nodeName||null!=t.firstChild}(t)||function(t){return"INPUT"===t.nodeName&&t instanceof HTMLInputElement&&"checkbox"===t.type}(t))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})),n=[];let i=e.nextNode();for(;i;)i instanceof HTMLElement&&n.push(i),i=e.nextNode();n.reverse();for(const r of n)r.replaceWith(_r[r.nodeName](r))}const qr=new WeakMap;let Fr=0;const Rr=/\bEdge\//.test(navigator.userAgent);function $r(t,e){const n=0===Fr;Fr+=qr.has(t)?0:1;const i=Object.assign({quoteMarkdown:!1,copyMarkdown:!1,scopeSelector:""},e);qr.set(t,i),n&&document.addEventListener("keydown",Vr),i.copyMarkdown&&t.addEventListener("copy",Br)}function Br(t){const e=t.target;if(!(e instanceof HTMLElement))return;if(zr(e))return;const n=t.clipboardData;if(!n)return;const i=window.getSelection();if(!i)return;let r;try{r=i.getRangeAt(0)}catch(a){return}const o=i.toString(),s=Kr(o,r,!0);s&&(n.setData("text/plain",o),n.setData("text/x-gfm",s.selectionText),t.preventDefault(),i.removeAllRanges(),i.addRange(r))}function Wr(t){let e=t;for(;e=e.parentElement;)if(qr.has(e))return e}function jr(t){for(const e of t.querySelectorAll("textarea"))if(e instanceof HTMLTextAreaElement&&Yr(e))return e}function Vr(t){if(function(t){return t.defaultPrevented||"r"!==t.key||t.metaKey||t.altKey||t.shiftKey||t.ctrlKey||t.target instanceof HTMLElement&&zr(t.target)}(t))return;const e=window.getSelection();if(!e)return;let n;try{n=e.getRangeAt(0)}catch(i){return}Ur(e.toString(),n)&&t.preventDefault()}function Ur(t,e){const n=Kr(t,e,!1);if(!n)return!1;const{container:i,selectionText:r}=n;if(!i.dispatchEvent(new CustomEvent("quote-selection",{bubbles:!0,cancelable:!0,detail:{range:e,selectionText:r}})))return!0;const o=jr(i);return!!o&&(function(t,e){let n=`> ${t.replace(/\n/g,"\n> ")}\n\n`;e.value&&(n=`${e.value}\n\n${n}`);e.value=n,e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),e.focus(),e.selectionStart=e.value.length,e.scrollTop=e.scrollHeight}(r,o),!0)}function Kr(t,e,n){let i=t.trim();if(!i)return;let r=e.startContainer;if(!r)return;if(r.nodeType!==Node.ELEMENT_NODE&&(r=r.parentNode),!(r instanceof Element))return;const o=Wr(r);if(!o)return;const s=qr.get(o);if(s){if(s.quoteMarkdown&&!Rr)try{const t=function(t,e){const n=t.startContainer;if(!(n&&n.parentNode&&n.parentNode instanceof HTMLElement))throw new Error("the range must start within an HTMLElement");const i=n.parentNode;let r=t.cloneContents();if(e){const t=r.querySelector(e);t&&(r=document.createDocumentFragment(),r.appendChild(t))}Ir=0;const o=i.closest("li");if(i.closest("pre")){const t=document.createElement("pre");t.appendChild(r),r=document.createDocumentFragment(),r.appendChild(t)}else if(o&&o.parentNode&&("OL"===o.parentNode.nodeName&&(Ir=Dr(o)),!r.querySelector("li"))){const t=document.createElement("li");if(!o.parentNode)throw new Error;const e=document.createElement(o.parentNode.nodeName);t.appendChild(r),e.appendChild(t),r=document.createDocumentFragment(),r.appendChild(e)}return r}(e,s.scopeSelector);o.dispatchEvent(new CustomEvent("quote-selection-markdown",{bubbles:!0,cancelable:!1,detail:{fragment:t,range:e,unwrap:n}})),Or(t),i=function(t){const e=document.body;if(!e)return"";const n=document.createElement("div");n.appendChild(t),n.style.cssText="position:absolute;left:-9999px;",e.appendChild(n);let i="";try{const t=window.getSelection();if(t){const e=document.createRange();e.selectNodeContents(n),t.removeAllRanges(),t.addRange(e),i=t.toString(),t.removeAllRanges(),e.detach()}}finally{e.removeChild(n)}return i}(t).replace(/^\n+/,"").replace(/\s+$/,"")}catch(a){setTimeout(()=>{throw a})}return{selectionText:i,container:o}}}function Yr(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}function zr(t){const e=t.nodeName.toLowerCase(),n=(t.getAttribute("type")||"").toLowerCase();return"select"===e||"textarea"===e||"input"===e&&"submit"!==n&&"reset"!==n||t.isContentEditable}let Xr=null;t("a0",(function(t){var e=null,n=!1,i=void 0,r=void 0,o=void 0;function s(e){if(i!==e.clientX||r!==e.clientY){var a=t.style.height;o&&o!==a&&(n=!0,t.style.maxHeight="",t.removeEventListener("mousemove",s)),o=a}i=e.clientX,r=e.clientY}var a=t.ownerDocument,c=a.documentElement;function l(){if(!(n||t.value===e||t.offsetWidth<=0&&t.offsetHeight<=0)){var i=function(){for(var e=0,n=t;n!==a.body&&null!==n;)e+=n.offsetTop||0,n=n.offsetParent;var i=e-a.defaultView.pageYOffset;return{top:i,bottom:c.clientHeight-(i+t.offsetHeight)}}(),r=i.top,s=i.bottom;if(!(r<0||s<0)){var l=Number(getComputedStyle(t).height.replace(/px/,""))+s;t.style.maxHeight=l-100+"px";var u=t.parentElement;if(u instanceof HTMLElement){var d=u.style.height;u.style.height=getComputedStyle(u).height,t.style.height="auto",t.style.height=t.scrollHeight+"px",u.style.height=d,o=t.style.height}e=t.value}}}function u(){n=!1,t.style.height="",t.style.maxHeight=""}t.addEventListener("mousemove",s),t.addEventListener("input",l),t.addEventListener("change",l);var d=t.form;return d&&d.addEventListener("reset",u),t.value&&l(),{unsubscribe:function(){t.removeEventListener("mousemove",s),t.removeEventListener("input",l),t.removeEventListener("change",l),d&&d.removeEventListener("reset",u)}}}));t("a1",class MultiMap{constructor(t){if(this.map=new Map,t)for(const[e,n]of t)this.set(e,n)}get(t){const e=this.map.get(t);return e||new Set}set(t,e){let n=this.map.get(t);return n||(n=new Set,this.map.set(t,n)),n.add(e),this}has(t){return this.map.has(t)}delete(t,e){const n=this.map.get(t);if(!n)return!1;if(!e)return this.map.delete(t);const i=n.delete(e);return n.size||this.map.delete(t),i}drain(t){const e=[];for(const n of this.keys())this.delete(n,t)&&!this.has(n)&&e.push(n);return e}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}get size(){return this.map.size}});var Qr,Gr,Zr=function(){return"".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12)},Jr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;return{name:t,value:e,delta:0,entries:[],id:Zr(),isFinal:!1}},to=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}));return n.observe({type:t,buffered:!0}),n}}catch(t){}},eo=!1,no=!1,io=function(t){eo=!t.persisted},ro=function(){addEventListener("pagehide",io),addEventListener("unload",(function(){}))},oo=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];no||(ro(),no=!0),addEventListener("visibilitychange",(function(e){var n=e.timeStamp;"hidden"===document.visibilityState&&t({timeStamp:n,isUnloading:eo})}),{capture:!0,once:e})},so=function(t,e,n,i){var r;return function(){n&&e.isFinal&&n.disconnect(),e.value>=0&&(i||e.isFinal||"hidden"===document.visibilityState)&&(e.delta=e.value-(r||0),(e.delta||e.isFinal||void 0===r)&&(t(e),r=e.value))}},ao=(t("a3",(function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Jr("CLS",0),r=function(t){t.hadRecentInput||(i.value+=t.value,i.entries.push(t),e())},o=to("layout-shift",r);o&&(e=so(t,i,o,n),oo((function(t){var n=t.isUnloading;o.takeRecords().map(r),n&&(i.isFinal=!0),e()})))})),function(){return void 0===Qr&&(Qr="hidden"===document.visibilityState?0:1/0,oo((function(t){var e=t.timeStamp;return Qr=e}),!0)),{get timeStamp(){return Qr}}}),co=(t("a4",(function(t){var e,n=Jr("FCP"),i=ao(),r=to("paint",(function(t){"first-contentful-paint"===t.name&&t.startTime<i.timeStamp&&(n.value=t.startTime,n.isFinal=!0,n.entries.push(t),e())}));r&&(e=so(t,n,r))})),t("a5",(function(t){var e=Jr("FID"),n=ao(),i=function(t){t.startTime<n.timeStamp&&(e.value=t.processingStart-t.startTime,e.entries.push(t),e.isFinal=!0,o())},r=to("first-input",i),o=so(t,e,r);r?oo((function(){r.takeRecords().map(i),r.disconnect()}),!0):window.perfMetrics&&window.perfMetrics.onFirstInputDelay&&window.perfMetrics.onFirstInputDelay((function(t,i){i.timeStamp<n.timeStamp&&(e.value=t,e.isFinal=!0,e.entries=[{entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+t}],o())}))})),function(){return Gr||(Gr=new Promise((function(t){return["scroll","keydown","pointerdown"].map((function(e){addEventListener(e,t,{once:!0,passive:!0,capture:!0})}))}))),Gr});t("a6",(function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=Jr("LCP"),r=ao(),o=function(t){var n=t.startTime;n<r.timeStamp?(i.value=n,i.entries.push(t)):i.isFinal=!0,e()},s=to("largest-contentful-paint",o);if(s){e=so(t,i,s,n);var a=function(){i.isFinal||(s.takeRecords().map(o),i.isFinal=!0,e())};co().then(a),oo(a,!0)}})),t("a7",(function(t){var e,n=Jr("TTFB");e=function(){try{var e=performance.getEntriesByType("navigation")[0]||function(){var t=performance.timing,e={entryType:"navigation",startTime:0};for(var n in t)"navigationStart"!==n&&"toJSON"!==n&&(e[n]=Math.max(t[n]-t.navigationStart,0));return e}();n.value=n.delta=e.responseStart,n.entries=[e],n.isFinal=!0,t(n)}catch(t){}},"complete"===document.readyState?setTimeout(e,0):addEventListener("pageshow",e)}))}}}));
//# sourceMappingURL=vendor-66930b34.js.map