diff --git a/README.md b/README.md index 1a92843..0718aa1 100644 --- a/README.md +++ b/README.md @@ -154,3 +154,34 @@ halo: 1. `auto`:自动模式,根据系统的暗黑模式自动切换。 2. `dark`:强制暗黑模式。 3. `light`:强制明亮模式。 + +### 适配字体和字号 +为了更好的调整搜索框的大小和字体以适配主题,提供了以下 CSS 变量: +```css +--halo-search-widget-font-size-search-form-input:; /*输入框字体大小*/ +--halo-search-widget-line-height-search-form-input:; /*输入框行高*/ +--halo-search-widget-font-size-search-form-result-item-title:; /*搜索结果项标题字体大小*/ +--halo-search-widget-line-height-search-form-result-item-title:; /*搜索结果项标题行高*/ +--halo-search-widget-font-size-search-form-result-item-content:; /*搜索结果项内容字体大小*/ +--halo-search-widget-line-height-search-form-result-item-content:; /*搜索结果项内容行高*/ +--halo-search-widget-font-size-search-form-empty:; /*搜索结果为空时的字体大小*/ +--halo-search-widget-line-height-search-form-empty:; /*搜索结果为空时的行高*/ +--halo-search-widget-font-size-search-form-commands-item:; /*搜索框底部快捷键提示字体大小*/ +--halo-search-widget-line-height-search-commands-item:; /*搜索框底部快捷键提示行高*/ +--halo-search-widget-font-size-search-form-commands-item-kbd:; /*搜索框底部快捷键提示图标大小*/ +--halo-search-widget-min-width-search-commands-item-kbd:; /*搜索框底部快捷键提示图标 min-wight*/ +--halo-search-widget-font-family-search-form:; /*搜索框字体*/ +``` +适配主题字体示例: +```css +@font-face { + font-family: "custom-font2"; + font-weight: 400; + font-style: normal; + font-display: swap; + src: url("/upload/AlimamaDaoLiTi.woff2") format("woff2"); + } +html body { + --halo-search-widget-font-family-search-form: "custom-font2"; +} +``` \ No newline at end of file diff --git a/packages/search-widget/src/search-form.ts b/packages/search-widget/src/search-form.ts index 3f09d55..97c63ad 100644 --- a/packages/search-widget/src/search-form.ts +++ b/packages/search-widget/src/search-form.ts @@ -196,6 +196,66 @@ export class SearchForm extends LitElement { --halo-search-widget-color-command-kbd-border, #e5e7eb ); + --font-size-search-form-input: var( + --halo-search-widget-font-size-search-form-input, + 1rem + ); + --line-height-search-form-input: var( + --halo-search-widget-line-height-search-form-input, + 1.5rem + ); + --font-size-search-form-result-item-title: var( + --halo-search-widget-font-size-search-form-result-item-title, + 0.875rem + ); + --line-height-search-form-result-item-title: var( + --halo-search-widget-line-height-search-form-result-item-title, + 1.25rem + ); + --font-size-search-form-result-item-content: var( + --halo-search-widget-font-size-search-form-result-item-content, + 0.75rem + ); + --line-height-search-form-result-item-content: var( + --halo-search-widget-line-height-search-form-result-item-content, + 1rem + ); + --font-size-search-form-empty: var( + --halo-search-widget-font-size-search-form-empty, + 0.875rem + ); + --line-height-search-form-empty: var( + --halo-search-widget-line-height-search-form-empty, + 1.25rem + ); + --font-size-search-form-loading: var( + --halo-search-widget-font-size-search-form-loading, + 0.875rem + ); + --line-height-search-form-loading: var( + --halo-search-widget-line-height-search-form-loading, + 1.25rem + ); + --font-size-search-form-commands-item: var( + --halo-search-widget-font-size-search-form-commands-item, + 0.75rem + ); + --line-height-search-form-commands-item: var( + --halo-search-widget-line-height-search-commands-item, + 1rem + ); + --font-size-search-form-commands-item-kbd: var( + --halo-search-widget-font-size-search-form-commands-item-kbd, + 10px + ); + --min-width-search-form-commands-item-kbd: var( + --halo-search-widget-min-width-search-commands-item-kbd, + 1.25rem + ); + --font-family-custom-sreach-form: var( + --halo-search-widget-font-family-search-form, + custom-font + ); } :host * { @@ -203,10 +263,10 @@ export class SearchForm extends LitElement { border-width: 0; border-style: solid; border-color: #e5e7eb; - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, - Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, - 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol, - 'Noto Color Emoji'; + font-family: var(--font-family-custom-sreach-form), ui-sans-serif, + system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, + Helvetica Neue, Arial, Noto Sans, sans-serif, 'Apple Color Emoji', + 'Segoe UI Emoji', Segoe UI Symbol, 'Noto Color Emoji'; font-feature-settings: normal; font-variation-settings: normal; } @@ -226,8 +286,8 @@ export class SearchForm extends LitElement { outline: 2px solid transparent; outline-offset: 2px; border: none; - font-size: 1rem; - line-height: 1.5rem; + font-size: var(--font-size-search-form-input); + line-height: var(--line-height-search-form-input); background-color: var(--color-form-input-bg); color: var(--color-form-input); } @@ -245,8 +305,8 @@ export class SearchForm extends LitElement { display: flex; align-items: center; justify-content: center; - font-size: 0.875rem; - line-height: 1.25rem; + font-size: var(--font-size-search-form-empty); + line-height: var(--line-height-search-form-empty); color: var(--color-result-empty); } @@ -281,8 +341,8 @@ export class SearchForm extends LitElement { } .search-form__result-item-title { - font-size: 0.875rem; - line-height: 1.25rem; + font-size: var(--font-size-search-form-result-item-title); + line-height: var(--line-height-search-form-result-item-title); font-weight: 600; padding: 0; margin: 0; @@ -290,8 +350,8 @@ export class SearchForm extends LitElement { } .search-form__result-item-content { - font-size: 0.75rem; - line-height: 1rem; + font-size: var(--font-size-search-form-result-item-content); + line-height: var(--line-height-search-form-result-item-content); color: var(--color-result-item-content); padding: 0; margin: 0; @@ -316,20 +376,20 @@ export class SearchForm extends LitElement { } .search-form__commands-item span { - font-size: 0.75rem; - line-height: 1rem; + font-size: var(--font-size-search-form-commands-item); + line-height: var(--line-height-search-form-commands-item); color: var(--color-command-kbd-item); } .search-form__commands-item kbd { color: var(--color-command-kbd-item); - font-size: 10px; + font-size: var(--font-size-search-form-commands-item-kbd); text-align: center; padding: 0.125rem 0.3rem; border-width: 1px; border-radius: 0.25rem; border-color: var(--color-command-kbd-border); - min-width: 1.25rem; + min-width: var(--min-width-search-form-commands-item-kbd); margin-left: 0.3rem; box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05); } diff --git a/src/main/resources/static/search-widget.iife.js b/src/main/resources/static/search-widget.iife.js index b30f5f4..9989707 100644 --- a/src/main/resources/static/search-widget.iife.js +++ b/src/main/resources/static/search-widget.iife.js @@ -1,30 +1,30 @@ -var SearchWidget=function(g){var zt;"use strict";/** +var SearchWidget=function(g){var Ht;"use strict";/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const D=globalThis,X=D.ShadowRoot&&(D.ShadyCSS===void 0||D.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),pt=new WeakMap;let ft=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(X&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=pt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&pt.set(e,t))}return t}toString(){return this.cssText}};const Wt=i=>new ft(typeof i=="string"?i:i+"",void 0,Y),tt=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new ft(e,i,Y)},Gt=(i,t)=>{if(X)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=D.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},mt=X?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return Wt(e)})(i):i;/** + */const D=globalThis,X=D.ShadowRoot&&(D.ShadyCSS===void 0||D.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Y=Symbol(),mt=new WeakMap;let ft=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==Y)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(X&&t===void 0){const r=e!==void 0&&e.length===1;r&&(t=mt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&mt.set(e,t))}return t}toString(){return this.cssText}};const Wt=i=>new ft(typeof i=="string"?i:i+"",void 0,Y),tt=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((r,s,o)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+i[o+1],i[0]);return new ft(e,i,Y)},Gt=(i,t)=>{if(X)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const r=document.createElement("style"),s=D.litNonce;s!==void 0&&r.setAttribute("nonce",s),r.textContent=e.cssText,i.appendChild(r)}},pt=X?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return Wt(e)})(i):i;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:Vt,defineProperty:Kt,getOwnPropertyDescriptor:Ft,getOwnPropertyNames:qt,getOwnPropertySymbols:Jt,getPrototypeOf:Zt}=Object,_=globalThis,gt=_.trustedTypes,Qt=gt?gt.emptyScript:"",et=_.reactiveElementPolyfillSupport,P=(i,t)=>i,B={toAttribute(i,t){switch(t){case Boolean:i=i?Qt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},it=(i,t)=>!Vt(i,t),$t={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$t){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Kt(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:o}=Ft(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return r==null?void 0:r.call(this)},set(n){const a=r==null?void 0:r.call(this);o.call(this,n),this.requestUpdate(t,a,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$t}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=Zt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...qt(e),...Jt(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(mt(r))}else t!==void 0&&e.push(mt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$ES??(this._$ES=[])).push(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)==null||t.forEach(e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e){var o;const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const n=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:B).toAttribute(e,s.type);this._$Em=t,n==null?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var o;const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const n=s.getPropertyOptions(r),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:B;this._$Em=r,this[r]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,s,r=!1,o){if(t!==void 0){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??it)(r?o:this[t],e))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,n]of r)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$ES)==null||s.forEach(r=>{var o;return(o=r.hostUpdate)==null?void 0:o.call(r)}),this.update(e)):this._$ET()}catch(r){throw t=!1,this._$ET(),r}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(s=>{var r;return(r=s.hostUpdated)==null?void 0:r.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[P("elementProperties")]=new Map,x[P("finalized")]=new Map,et==null||et({ReactiveElement:x}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.0");/** + */const{is:Vt,defineProperty:Kt,getOwnPropertyDescriptor:Ft,getOwnPropertyNames:qt,getOwnPropertySymbols:Jt,getPrototypeOf:Zt}=Object,_=globalThis,gt=_.trustedTypes,Qt=gt?gt.emptyScript:"",et=_.reactiveElementPolyfillSupport,P=(i,t)=>i,B={toAttribute(i,t){switch(t){case Boolean:i=i?Qt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},it=(i,t)=>!Vt(i,t),$t={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_.litPropertyMetadata??(_.litPropertyMetadata=new WeakMap);class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=$t){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),s=this.getPropertyDescriptor(t,r,e);s!==void 0&&Kt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,r){const{get:s,set:o}=Ft(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return s==null?void 0:s.call(this)},set(n){const a=s==null?void 0:s.call(this);o.call(this,n),this.requestUpdate(t,a,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??$t}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=Zt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,r=[...qt(e),...Jt(e)];for(const s of r)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[r,s]of e)this.elementProperties.set(r,s)}this._$Eh=new Map;for(const[e,r]of this.elementProperties){const s=this._$Eu(e,r);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const s of r)e.unshift(pt(s))}else t!==void 0&&e.push(pt(t));return e}static _$Eu(t,e){const r=e.attribute;return r===!1?void 0:typeof r=="string"?r:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$Eg=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$ES??(this._$ES=[])).push(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$ES)==null||e.splice(this._$ES.indexOf(t)>>>0,1)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostConnected)==null?void 0:r.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)==null||t.forEach(e=>{var r;return(r=e.hostDisconnected)==null?void 0:r.call(e)})}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e){var o;const r=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,r);if(s!==void 0&&r.reflect===!0){const n=(((o=r.converter)==null?void 0:o.toAttribute)!==void 0?r.converter:B).toAttribute(e,r.type);this._$Em=t,n==null?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(t,e){var o;const r=this.constructor,s=r._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const n=r.getPropertyOptions(s),a=typeof n.converter=="function"?{fromAttribute:n.converter}:((o=n.converter)==null?void 0:o.fromAttribute)!==void 0?n.converter:B;this._$Em=s,this[s]=a.fromAttribute(e,n.type),this._$Em=null}}requestUpdate(t,e,r,s=!1,o){if(t!==void 0){if(r??(r=this.constructor.getPropertyOptions(t)),!(r.hasChanged??it)(s?o:this[t],e))return;this.C(t,e,r)}this.isUpdatePending===!1&&(this._$Eg=this._$EP())}C(t,e,r){this._$AL.has(t)||this._$AL.set(t,e),r.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this._$Ep){for(const[o,n]of this._$Ep)this[o]=n;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,n]of s)n.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.C(o,this[o],n)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(r=this._$ES)==null||r.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$ET()}catch(s){throw t=!1,this._$ET(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)==null||e.forEach(r=>{var s;return(s=r.hostUpdated)==null?void 0:s.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(e=>this._$EO(e,this[e]))),this._$ET()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[P("elementProperties")]=new Map,x[P("finalized")]=new Map,et==null||et({ReactiveElement:x}),(_.reactiveElementVersions??(_.reactiveElementVersions=[])).push("2.0.0");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const U=globalThis,W=U.trustedTypes,_t=W?W.createPolicy("lit-html",{createHTML:i=>i}):void 0,bt="$lit$",b=`lit$${(Math.random()+"").slice(9)}$`,yt="?"+b,Xt=`<${yt}>`,v=document,O=()=>v.createComment(""),j=i=>i===null||typeof i!="object"&&typeof i!="function",vt=Array.isArray,Yt=i=>vt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",st=`[ -\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,wt=/>/g,A=RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),St=/'/g,Et=/"/g,xt=/^(?:script|style|textarea|title)$/i,te=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),w=te(1),$=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Tt=new WeakMap,S=v.createTreeWalker(v,129);function Ct(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return _t!==void 0?_t.createHTML(t):t}const ee=(i,t)=>{const e=i.length-1,s=[];let r,o=t===2?"":"",n=M;for(let a=0;a"?(n=r??M,c=-1):u[1]===void 0?c=-2:(c=n.lastIndex-u[2].length,h=u[1],n=u[3]===void 0?A:u[3]==='"'?Et:St):n===Et||n===St?n=A:n===At||n===wt?n=M:(n=A,r=void 0);const m=n===A&&i[a+1].startsWith("/>")?" ":"";o+=n===M?l+Xt:c>=0?(s.push(h),l.slice(0,c)+bt+l.slice(c)+b+m):l+b+(c===-2?a:m)}return[Ct(i,o+(i[e]||"")+(t===2?"":"")),s]};class N{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let o=0,n=0;const a=t.length-1,l=this.parts,[h,u]=ee(t,e);if(this.el=N.createElement(h,s),S.currentNode=this.el.content,e===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(r=S.nextNode())!==null&&l.length0){r.textContent=W?W.emptyScript:"";for(let m=0;m2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}_$AI(t,e=this,s,r){const o=this.strings;let n=!1;if(o===void 0)t=T(this,t,e,0),n=!j(t)||t!==this._$AH&&t!==$,n&&(this._$AH=t);else{const a=t;let l,h;for(t=o[0],l=0;l{const s=(e==null?void 0:e.renderBefore)??t;let r=s._$litPart$;if(r===void 0){const o=(e==null?void 0:e.renderBefore)??null;s._$litPart$=r=new I(t.insertBefore(O(),o),o,void 0,e??{})}return r._$AI(i),r};/** + */const U=globalThis,W=U.trustedTypes,_t=W?W.createPolicy("lit-html",{createHTML:i=>i}):void 0,vt="$lit$",v=`lit$${(Math.random()+"").slice(9)}$`,bt="?"+v,Xt=`<${bt}>`,y=document,O=()=>y.createComment(""),j=i=>i===null||typeof i!="object"&&typeof i!="function",yt=Array.isArray,Yt=i=>yt(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",rt=`[ +\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,wt=/>/g,A=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),St=/'/g,Et=/"/g,xt=/^(?:script|style|textarea|title)$/i,te=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),w=te(1),$=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Tt=new WeakMap,S=y.createTreeWalker(y,129);function kt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return _t!==void 0?_t.createHTML(t):t}const ee=(i,t)=>{const e=i.length-1,r=[];let s,o=t===2?"":"",n=M;for(let a=0;a"?(n=s??M,h=-1):u[1]===void 0?h=-2:(h=n.lastIndex-u[2].length,c=u[1],n=u[3]===void 0?A:u[3]==='"'?Et:St):n===Et||n===St?n=A:n===At||n===wt?n=M:(n=A,s=void 0);const p=n===A&&i[a+1].startsWith("/>")?" ":"";o+=n===M?l+Xt:h>=0?(r.push(c),l.slice(0,h)+vt+l.slice(h)+v+p):l+v+(h===-2?a:p)}return[kt(i,o+(i[e]||"")+(t===2?"":"")),r]};class z{constructor({strings:t,_$litType$:e},r){let s;this.parts=[];let o=0,n=0;const a=t.length-1,l=this.parts,[c,u]=ee(t,e);if(this.el=z.createElement(c,r),S.currentNode=this.el.content,e===2){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=S.nextNode())!==null&&l.length0){s.textContent=W?W.emptyScript:"";for(let p=0;p2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=d}_$AI(t,e=this,r,s){const o=this.strings;let n=!1;if(o===void 0)t=T(this,t,e,0),n=!j(t)||t!==this._$AH&&t!==$,n&&(this._$AH=t);else{const a=t;let l,c;for(t=o[0],l=0;l{const r=(e==null?void 0:e.renderBefore)??t;let s=r._$litPart$;if(s===void 0){const o=(e==null?void 0:e.renderBefore)??null;r._$litPart$=s=new N(t.insertBefore(O(),o),o,void 0,e??{})}return s._$AI(i),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let C=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ae(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return $}};C._$litElement$=!0,C.finalized=!0,(zt=globalThis.litElementHydrateSupport)==null||zt.call(globalThis,{LitElement:C});const ot=globalThis.litElementPolyfillSupport;ot==null||ot({LitElement:C}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.0");/** + */let k=class extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ae(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return $}};k._$litElement$=!0,k.finalized=!0,(Ht=globalThis.litElementHydrateSupport)==null||Ht.call(globalThis,{LitElement:k});const ot=globalThis.litElementPolyfillSupport;ot==null||ot({LitElement:k}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.0");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const kt=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/** + */const Ct=i=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const le={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it},ce=(i=le,t,e)=>{const{kind:s,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(e.name,i),s==="accessor"){const{name:n}=e;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i)},init(a){return a!==void 0&&this.C(n,void 0,i),a}}}if(s==="setter"){const{name:n}=e;return function(a){const l=this[n];t.call(this,a),this.requestUpdate(n,l,i)}}throw Error("Unsupported decorator location: "+s)};function V(i){return(t,e)=>typeof e=="object"?ce(i,t,e):((s,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(r,o):void 0})(i,t,e)}/** + */const le={attribute:!0,type:String,converter:B,reflect:!1,hasChanged:it},he=(i=le,t,e)=>{const{kind:r,metadata:s}=e;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(e.name,i),r==="accessor"){const{name:n}=e;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(n,l,i)},init(a){return a!==void 0&&this.C(n,void 0,i),a}}}if(r==="setter"){const{name:n}=e;return function(a){const l=this[n];t.call(this,a),this.requestUpdate(n,l,i)}}throw Error("Unsupported decorator location: "+r)};function V(i){return(t,e)=>typeof e=="object"?he(i,t,e):((r,s,o)=>{const n=s.hasOwnProperty(o);return s.constructor.createProperty(o,n?{...r,wrapped:!0}:r),n?Object.getOwnPropertyDescriptor(s,o):void 0})(i,t,e)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -32,27 +32,27 @@ var SearchWidget=function(g){var zt;"use strict";/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const he=i=>i.strings===void 0;/** + */const ce=i=>i.strings===void 0;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const K={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},F=i=>(...t)=>({_$litDirective$:i,values:t});let q=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/** + */const K={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},F=i=>(...t)=>({_$litDirective$:i,values:t});let q=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const R=(i,t)=>{var s;const e=i._$AN;if(e===void 0)return!1;for(const r of e)(s=r._$AO)==null||s.call(r,t,!1),R(r,t);return!0},J=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},Pt=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),pe(t)}};function de(i){this._$AN!==void 0?(J(this),this._$AM=i,Pt(this)):this._$AM=i}function ue(i,t=!1,e=0){const s=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(s))for(let o=e;o{i.type==K.CHILD&&(i._$AP??(i._$AP=ue),i._$AQ??(i._$AQ=de))};class fe extends q{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),Pt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var s,r;t!==this.isConnected&&(this.isConnected=t,t?(s=this.reconnected)==null||s.call(this):(r=this.disconnected)==null||r.call(this)),e&&(R(this,t),J(this))}setValue(t){if(he(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** + */const I=(i,t)=>{var r;const e=i._$AN;if(e===void 0)return!1;for(const s of e)(r=s._$AO)==null||r.call(s,t,!1),I(s,t);return!0},J=i=>{let t,e;do{if((t=i._$AM)===void 0)break;e=t._$AN,e.delete(i),i=t}while((e==null?void 0:e.size)===0)},Pt=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),me(t)}};function de(i){this._$AN!==void 0?(J(this),this._$AM=i,Pt(this)):this._$AM=i}function ue(i,t=!1,e=0){const r=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(r))for(let o=e;o{i.type==K.CHILD&&(i._$AP??(i._$AP=ue),i._$AQ??(i._$AQ=de))};class fe extends q{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),Pt(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,s;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(s=this.disconnected)==null||s.call(this)),e&&(I(this,t),J(this))}setValue(t){if(ce(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const me=()=>new ge;class ge{}const at=new WeakMap,$e=F(class extends fe{render(i){return d}update(i,[t]){var s;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(s=i.options)==null?void 0:s.host,this.ot(this.lt=i.element)),d}ot(i){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=at.get(t);e===void 0&&(e=new WeakMap,at.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t;return typeof this.G=="function"?(i=at.get(this.ct??globalThis))==null?void 0:i.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var _e=typeof global=="object"&&global&&global.Object===Object&&global;const be=_e;var ye=typeof self=="object"&&self&&self.Object===Object&&self,ve=be||ye||Function("return this")();const Ut=ve;var Ae=Ut.Symbol;const Z=Ae;var Ot=Object.prototype,we=Ot.hasOwnProperty,Se=Ot.toString,H=Z?Z.toStringTag:void 0;function Ee(i){var t=we.call(i,H),e=i[H];try{i[H]=void 0;var s=!0}catch{}var r=Se.call(i);return s&&(t?i[H]=e:delete i[H]),r}var xe=Object.prototype,Te=xe.toString;function Ce(i){return Te.call(i)}var ke="[object Null]",Pe="[object Undefined]",jt=Z?Z.toStringTag:void 0;function Ue(i){return i==null?i===void 0?Pe:ke:jt&&jt in Object(i)?Ee(i):Ce(i)}function Oe(i){return i!=null&&typeof i=="object"}var je="[object Symbol]";function Me(i){return typeof i=="symbol"||Oe(i)&&Ue(i)==je}var Ne=/\s/;function Ie(i){for(var t=i.length;t--&&Ne.test(i.charAt(t)););return t}var Re=/^\s+/;function He(i){return i&&i.slice(0,Ie(i)+1).replace(Re,"")}function lt(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var Mt=0/0,ze=/^[-+]0x[0-9a-f]+$/i,Le=/^0b[01]+$/i,De=/^0o[0-7]+$/i,Be=parseInt;function Nt(i){if(typeof i=="number")return i;if(Me(i))return Mt;if(lt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=lt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=He(i);var e=Le.test(i);return e||De.test(i)?Be(i.slice(2),e?2:8):ze.test(i)?Mt:+i}var We=function(){return Ut.Date.now()};const ct=We;var Ge="Expected a function",Ve=Math.max,Ke=Math.min;function Fe(i,t,e){var s,r,o,n,a,l,h=0,u=!1,c=!1,f=!0;if(typeof i!="function")throw new TypeError(Ge);t=Nt(t)||0,lt(e)&&(u=!!e.leading,c="maxWait"in e,o=c?Ve(Nt(e.maxWait)||0,t):o,f="trailing"in e?!!e.trailing:f);function m(p){var y=s,L=r;return s=r=void 0,h=p,n=i.apply(L,y),n}function k(p){return h=p,a=setTimeout(Q,t),u?m(p):n}function Ye(p){var y=p-l,L=p-h,Bt=t-y;return c?Ke(Bt,o-L):Bt}function Lt(p){var y=p-l,L=p-h;return l===void 0||y>=t||y<0||c&&L>=o}function Q(){var p=ct();if(Lt(p))return Dt(p);a=setTimeout(Q,Ye(p))}function Dt(p){return a=void 0,f&&s?m(p):(s=r=void 0,n)}function ti(){a!==void 0&&clearTimeout(a),h=0,s=l=r=a=void 0}function ei(){return a===void 0?n:Dt(ct())}function ut(){var p=ct(),y=Lt(p);if(s=arguments,r=this,l=p,y){if(a===void 0)return k(l);if(c)return clearTimeout(a),a=setTimeout(Q,t),m(l)}return a===void 0&&(a=setTimeout(Q,t)),n}return ut.cancel=ti,ut.flush=ei,ut}/** + */const pe=()=>new ge;class ge{}const at=new WeakMap,$e=F(class extends fe{render(i){return d}update(i,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.ot(void 0),(e||this.rt!==this.lt)&&(this.G=t,this.ct=(r=i.options)==null?void 0:r.host,this.ot(this.lt=i.element)),d}ot(i){if(typeof this.G=="function"){const t=this.ct??globalThis;let e=at.get(t);e===void 0&&(e=new WeakMap,at.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ct,void 0),e.set(this.G,i),i!==void 0&&this.G.call(this.ct,i)}else this.G.value=i}get rt(){var i,t;return typeof this.G=="function"?(i=at.get(this.ct??globalThis))==null?void 0:i.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var _e=typeof global=="object"&&global&&global.Object===Object&&global;const ve=_e;var be=typeof self=="object"&&self&&self.Object===Object&&self,ye=ve||be||Function("return this")();const Ut=ye;var Ae=Ut.Symbol;const Z=Ae;var Ot=Object.prototype,we=Ot.hasOwnProperty,Se=Ot.toString,R=Z?Z.toStringTag:void 0;function Ee(i){var t=we.call(i,R),e=i[R];try{i[R]=void 0;var r=!0}catch{}var s=Se.call(i);return r&&(t?i[R]=e:delete i[R]),s}var xe=Object.prototype,Te=xe.toString;function ke(i){return Te.call(i)}var Ce="[object Null]",Pe="[object Undefined]",jt=Z?Z.toStringTag:void 0;function Ue(i){return i==null?i===void 0?Pe:Ce:jt&&jt in Object(i)?Ee(i):ke(i)}function Oe(i){return i!=null&&typeof i=="object"}var je="[object Symbol]";function Me(i){return typeof i=="symbol"||Oe(i)&&Ue(i)==je}var ze=/\s/;function Ne(i){for(var t=i.length;t--&&ze.test(i.charAt(t)););return t}var Ie=/^\s+/;function Re(i){return i&&i.slice(0,Ne(i)+1).replace(Ie,"")}function lt(i){var t=typeof i;return i!=null&&(t=="object"||t=="function")}var Mt=0/0,He=/^[-+]0x[0-9a-f]+$/i,Le=/^0b[01]+$/i,De=/^0o[0-7]+$/i,Be=parseInt;function zt(i){if(typeof i=="number")return i;if(Me(i))return Mt;if(lt(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=lt(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=Re(i);var e=Le.test(i);return e||De.test(i)?Be(i.slice(2),e?2:8):He.test(i)?Mt:+i}var We=function(){return Ut.Date.now()};const ht=We;var Ge="Expected a function",Ve=Math.max,Ke=Math.min;function Fe(i,t,e){var r,s,o,n,a,l,c=0,u=!1,h=!1,f=!0;if(typeof i!="function")throw new TypeError(Ge);t=zt(t)||0,lt(e)&&(u=!!e.leading,h="maxWait"in e,o=h?Ve(zt(e.maxWait)||0,t):o,f="trailing"in e?!!e.trailing:f);function p(m){var b=r,L=s;return r=s=void 0,c=m,n=i.apply(L,b),n}function C(m){return c=m,a=setTimeout(Q,t),u?p(m):n}function Ye(m){var b=m-l,L=m-c,Bt=t-b;return h?Ke(Bt,o-L):Bt}function Lt(m){var b=m-l,L=m-c;return l===void 0||b>=t||b<0||h&&L>=o}function Q(){var m=ht();if(Lt(m))return Dt(m);a=setTimeout(Q,Ye(m))}function Dt(m){return a=void 0,f&&r?p(m):(r=s=void 0,n)}function ti(){a!==void 0&&clearTimeout(a),c=0,r=l=s=a=void 0}function ei(){return a===void 0?n:Dt(ht())}function ut(){var m=ht(),b=Lt(m);if(r=arguments,s=this,l=m,b){if(a===void 0)return C(l);if(h)return clearTimeout(a),a=setTimeout(Q,t),p(l)}return a===void 0&&(a=setTimeout(Q,t)),n}return ut.cancel=ti,ut.flush=ei,ut}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let ht=class extends q{constructor(t){if(super(t),this.et=d,t.type!==K.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this.vt=void 0,this.et=t;if(t===$)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};ht.directiveName="unsafeHTML",ht.resultType=1;const It=F(ht);/** + */let ct=class extends q{constructor(t){if(super(t),this.et=d,t.type!==K.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this.vt=void 0,this.et=t;if(t===$)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.vt;this.et=t;const e=[t];return e.raw=e,this.vt={_$litType$:this.constructor.resultType,strings:e,values:[]}}};ct.directiveName="unsafeHTML",ct.resultType=1;const Nt=F(ct);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const qe=F(class extends q{constructor(i){var t;if(super(i),i.type!==K.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var s,r;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!((s=this.st)!=null&&s.has(o))&&this.it.add(o);return this.render(t)}const e=i.element.classList;for(const o of this.it)o in t||(e.remove(o),this.it.delete(o));for(const o in t){const n=!!t[o];n===this.it.has(o)||(r=this.st)!=null&&r.has(o)||(n?(e.add(o),this.it.add(o)):(e.remove(o),this.it.delete(o)))}return $}}),Je=tt` + */const qe=F(class extends q{constructor(i){var t;if(super(i),i.type!==K.ATTRIBUTE||i.name!=="class"||((t=i.strings)==null?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){var r,s;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.st=new Set(i.strings.join(" ").split(/\s/).filter(o=>o!=="")));for(const o in t)t[o]&&!((r=this.st)!=null&&r.has(o))&&this.it.add(o);return this.render(t)}const e=i.element.classList;for(const o of this.it)o in t||(e.remove(o),this.it.delete(o));for(const o in t){const n=!!t[o];n===this.it.has(o)||(s=this.st)!=null&&s.has(o)||(n?(e.add(o),this.it.add(o)):(e.remove(o),this.it.delete(o)))}return $}}),Je=tt` *, ::before, ::after { @@ -199,7 +199,7 @@ var SearchWidget=function(g){var zt;"use strict";/** [role='button'] { cursor: pointer; } -`;var z=globalThis&&globalThis.__decorate||function(i,t,e,s){var r=arguments.length,o=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,s);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(r<3?n(o):r>3?n(t,e,o):n(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o};let E=class extends C{constructor(){super(),this.baseUrl="",this.hits=[],this.loading=!1,this.selectedIndex=0,this.inputRef=me(),this.fetchHits=Fe(async t=>{const s=await(await fetch(`${this.baseUrl}/apis/api.halo.run/v1alpha1/indices/post?keyword=${t}&highlightPreTag=%3Cmark%3E&highlightPostTag=%3C/mark%3E`)).json();this.hits=s.hits||[],this.loading=!1},300),this.handleKeydown=t=>{const{key:e,ctrlKey:s}=t;if((e==="ArrowUp"||e==="k"&&s)&&(this.selectedIndex=Math.max(0,this.selectedIndex-1),t.preventDefault()),(e==="ArrowDown"||e==="j"&&s)&&(this.selectedIndex=Math.min(this.hits.length,this.selectedIndex+1),t.preventDefault()),e==="Enter"){const r=this.hits[this.selectedIndex-1];r&&this.handleOpenLink(r)}},this.addEventListener("keydown",this.handleKeydown)}render(){return w` +`;var H=globalThis&&globalThis.__decorate||function(i,t,e,r){var s=arguments.length,o=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(t,e,o):n(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o};let E=class extends k{constructor(){super(),this.baseUrl="",this.hits=[],this.loading=!1,this.selectedIndex=0,this.inputRef=pe(),this.fetchHits=Fe(async t=>{const r=await(await fetch(`${this.baseUrl}/apis/api.halo.run/v1alpha1/indices/post?keyword=${t}&highlightPreTag=%3Cmark%3E&highlightPostTag=%3C/mark%3E`)).json();this.hits=r.hits||[],this.loading=!1},300),this.handleKeydown=t=>{const{key:e,ctrlKey:r}=t;if((e==="ArrowUp"||e==="k"&&r)&&(this.selectedIndex=Math.max(0,this.selectedIndex-1),t.preventDefault()),(e==="ArrowDown"||e==="j"&&r)&&(this.selectedIndex=Math.min(this.hits.length,this.selectedIndex+1),t.preventDefault()),e==="Enter"){const s=this.hits[this.selectedIndex-1];s&&this.handleOpenLink(s)}},this.addEventListener("keydown",this.handleKeydown)}render(){return w`

- ${It(t.title)} + ${Nt(t.title)}

- ${It(t.content)} + ${Nt(t.content)}

`)} @@ -248,49 +248,109 @@ var SearchWidget=function(g){var zt;"use strict";/** Esc - `}firstUpdated(t){var e;super.firstUpdated(t),(e=this.inputRef.value)==null||e.focus()}onInput(t){const s=t.target.value;if(this.selectedIndex=0,s===""){this.hits=[];return}this.loading=!0,this.fetchHits(s)}handleOpenLink(t){window.location.href=t.permalink}};E.styles=[Je,tt` + `}firstUpdated(t){var e;super.firstUpdated(t),(e=this.inputRef.value)==null||e.focus()}onInput(t){const r=t.target.value;if(this.selectedIndex=0,r===""){this.hits=[];return}this.loading=!0,this.fetchHits(r)}handleOpenLink(t){window.location.href=t.permalink}};E.styles=[Je,tt` :host { - --color-form-input-bg: var( - --halo-search-widget-color-form-input-bg, - #fff + --color-form-input-bg: var( + --halo-search-widget-color-form-input-bg, + #fff + ); + --color-form-input: var(--halo-search-widget-color-form-input, #333); + --color-form-input-placeholder: var( + --halo-search-widget-color-form-input-placeholder, + rgb(107 114 128) + ); + --color-form-divider: var( + --halo-search-widget-color-form-divider, + rgb(243 244 246) + ); + --color-result-empty: var( + --halo-search-widget-color-result-empty, + rgb(107 114 128) + ); + --color-result-item-bg: var( + --halo-search-widget-color-result-item-bg, + rgb(249 250 251) + ); + --color-result-item-hover-bg: var( + --halo-search-widget-color-result-item-hover-bg, + rgb(243 244 246) + ); + --color-result-item-title: var( + --halo-search-widget-color-result-item-title, + #333 + ); + --color-result-item-content: var( + --halo-search-widget-color-result-item-content, + rgb(75, 85, 99) + ); + --color-command-kbd-item: var( + --halo-search-widget-color-command-kbd-item, + #333 + ); + --color-command-kbd-border: var( + --halo-search-widget-color-command-kbd-border, + #e5e7eb + ); + --font-size-search-form-input: var( + --halo-search-widget-font-size-search-form-input, + 1rem + ); + --line-height-search-form-input: var( + --halo-search-widget-line-height-search-form-input, + 1.5rem + ); + --font-size-search-form-result-item-title: var( + --halo-search-widget-font-size-search-form-result-item-title, + 0.875rem + ); + --line-height-search-form-result-item-title: var( + --halo-search-widget-line-height-search-form-result-item-title, + 1.25rem + ); + --font-size-search-form-result-item-content: var( + --halo-search-widget-font-size-search-form-result-item-content, + 0.75rem + ); + --line-height-search-form-result-item-content: var( + --halo-search-widget-line-height-search-form-result-item-content, + 1rem + ); + --font-size-search-form-empty: var( + --halo-search-widget-font-size-search-form-empty, + 0.875rem + ); + --line-height-search-form-empty: var( + --halo-search-widget-line-height-search-form-empty, + 1.25rem + ); + --font-size-search-form-loading: var( + --halo-search-widget-font-size-search-form-loading, + 0.875rem + ); + --line-height-search-form-loading: var( + --halo-search-widget-line-height-search-form-loading, + 1.25rem + ); + --font-size-search-form-commands-item: var( + --halo-search-widget-font-size-search-form-commands-item, + 0.75rem + ); + --line-height-search-form-commands-item: var( + --halo-search-widget-line-height-search-commands-item, + 1rem + ); + --font-size-search-form-commands-item-kbd: var( + --halo-search-widget-font-size-search-form-commands-item-kbd, + 10px ); - --color-form-input: var(--halo-search-widget-color-form-input, #333); - --color-form-input-placeholder: var( - --halo-search-widget-color-form-input-placeholder, - rgb(107 114 128) - ); - --color-form-divider: var( - --halo-search-widget-color-form-divider, - rgb(243 244 246) - ); - --color-result-empty: var( - --halo-search-widget-color-result-empty, - rgb(107 114 128) - ); - --color-result-item-bg: var( - --halo-search-widget-color-result-item-bg, - rgb(249 250 251) - ); - --color-result-item-hover-bg: var( - --halo-search-widget-color-result-item-hover-bg, - rgb(243 244 246) - ); - --color-result-item-title: var( - --halo-search-widget-color-result-item-title, - #333 - ); - --color-result-item-content: var( - --halo-search-widget-color-result-item-content, - rgb(75, 85, 99) - ); - --color-command-kbd-item: var( - --halo-search-widget-color-command-kbd-item, - #333 - ); - --color-command-kbd-border: var( - --halo-search-widget-color-command-kbd-border, - #e5e7eb + --min-width-search-form-commands-item-kbd: var( + --halo-search-widget-min-width-search-commands-item-kbd, + 1.25rem ); + --font-family-custom-sreach-form: var( + --halo-search-widget-font-family-search-form, + custom-font + ); } :host * { @@ -298,7 +358,7 @@ var SearchWidget=function(g){var zt;"use strict";/** border-width: 0; border-style: solid; border-color: #e5e7eb; - font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, + font-family: var(--font-family-custom-sreach-form), ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', Segoe UI Symbol, 'Noto Color Emoji'; @@ -321,8 +381,8 @@ var SearchWidget=function(g){var zt;"use strict";/** outline: 2px solid transparent; outline-offset: 2px; border: none; - font-size: 1rem; - line-height: 1.5rem; + font-size: var(--font-size-search-form-input); + line-height: var(--line-height-search-form-input); background-color: var(--color-form-input-bg); color: var(--color-form-input); } @@ -340,8 +400,8 @@ var SearchWidget=function(g){var zt;"use strict";/** display: flex; align-items: center; justify-content: center; - font-size: 0.875rem; - line-height: 1.25rem; + font-size: var(--font-size-search-form-empty); + line-height: var(--line-height-search-form-empty); color: var(--color-result-empty); } @@ -376,8 +436,8 @@ var SearchWidget=function(g){var zt;"use strict";/** } .search-form__result-item-title { - font-size: 0.875rem; - line-height: 1.25rem; + font-size: var(--font-size-search-form-result-item-title); + line-height: var(--line-height-search-form-result-item-title); font-weight: 600; padding: 0; margin: 0; @@ -385,13 +445,17 @@ var SearchWidget=function(g){var zt;"use strict";/** } .search-form__result-item-content { - font-size: 0.75rem; - line-height: 1rem; + font-size: var(--font-size-search-form-result-item-content); + line-height: var(--line-height-search-form-result-item-content); color: var(--color-result-item-content); padding: 0; margin: 0; } + .search-form__result-item-content img { + width: 50%; + } + .search-form__commands { border-top-width: 1px; border-color: var(--color-form-divider); @@ -407,28 +471,28 @@ var SearchWidget=function(g){var zt;"use strict";/** } .search-form__commands-item span { - font-size: 0.75rem; - line-height: 1rem; + font-size: var(--font-size-search-form-commands-item); + line-height: var(--line-height-search-form-commands-item); color: var(--color-command-kbd-item); } .search-form__commands-item kbd { color: var(--color-command-kbd-item); - font-size: 10px; + font-size: var(--font-size-search-form-commands-item-kbd); text-align: center; padding: 0.125rem 0.3rem; border-width: 1px; border-radius: 0.25rem; border-color: var(--color-command-kbd-border); - min-width: 1.25rem; + min-width: var(--min-width-search-form-commands-item-kbd); margin-left: 0.3rem; box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgb(0 0 0 / 0.05); } - `],z([V({type:String})],E.prototype,"baseUrl",void 0),z([nt()],E.prototype,"hits",void 0),z([nt()],E.prototype,"loading",void 0),z([nt()],E.prototype,"selectedIndex",void 0),E=z([kt("search-form")],E);/** + `],H([V({type:String})],E.prototype,"baseUrl",void 0),H([nt()],E.prototype,"hits",void 0),H([nt()],E.prototype,"loading",void 0),H([nt()],E.prototype,"selectedIndex",void 0),E=H([Ct("search-form")],E);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Rt="important",Ze=" !"+Rt,Qe=F(class extends q{constructor(i){var t;if(super(i),i.type!==K.ATTRIBUTE||i.name!=="style"||((t=i.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{const s=i[e];return s==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(i,[t]){const{style:e}=i.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(t)),this.render(t);for(const s of this.ut)t[s]==null&&(this.ut.delete(s),s.includes("-")?e.removeProperty(s):e[s]=null);for(const s in t){const r=t[s];if(r!=null){this.ut.add(s);const o=typeof r=="string"&&r.endsWith(Ze);s.includes("-")||o?e.setProperty(s,o?r.slice(0,-11):r,o?Rt:""):e[s]=r}}return $}});var dt=globalThis&&globalThis.__decorate||function(i,t,e,s){var r=arguments.length,o=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,s);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(r<3?n(o):r>3?n(t,e,o):n(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o};g.SearchModal=class extends C{constructor(){super(...arguments),this.open=!1,this.baseUrl="",this.handleKeydown=t=>{const{key:e}=t;e==="Escape"&&(this.close(),t.preventDefault())}}render(){return w`
2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((t,e)=>{const r=i[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(i,[t]){const{style:e}=i.element;if(this.ut===void 0)return this.ut=new Set(Object.keys(t)),this.render(t);for(const r of this.ut)t[r]==null&&(this.ut.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const s=t[r];if(s!=null){this.ut.add(r);const o=typeof s=="string"&&s.endsWith(Ze);r.includes("-")||o?e.setProperty(r,o?s.slice(0,-11):s,o?It:""):e[r]=s}}return $}});var dt=globalThis&&globalThis.__decorate||function(i,t,e,r){var s=arguments.length,o=s<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,t,e,r);else for(var a=i.length-1;a>=0;a--)(n=i[a])&&(o=(s<3?n(o):s>3?n(t,e,o):n(t,e))||o);return s>3&&o&&Object.defineProperty(t,e,o),o};g.SearchModal=class extends k{constructor(){super(...arguments),this.open=!1,this.baseUrl="",this.handleKeydown=t=>{const{key:e}=t;e==="Escape"&&(this.close(),t.preventDefault())}}render(){return w`