vendor: 4,706 bytes, lines 1-2
1/*! For license information please see webawesome.custom.min.js.LICENSE.txt */ 2(()=>{"use strict";var t=class extends Event{constructor(t){super("wa-after-collapse",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},e=class extends Event{constructor(t){super("wa-after-expand",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},i=class extends Event{constructor(t){super("wa-collapse",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=t}},o=class extends Event{constructor(t){super("wa-expand",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=t}};const a=globalThis,s=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;class l{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)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(s&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&r.set(e,t))}return t}toString(){return this.cssText}}const h=(t,...e)=>{const i=1===t.length?t[0]:e.reduce((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1],t[0]);return new l(i,t,n)},c=(t,e)=>{if(s)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const i of e){const e=document.createElement("style"),o=a.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},d=s?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new l("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:u,defineProperty:p,getOwnPropertyDescriptor:m,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:b}=Object,v=globalThis,w=v.trustedTypes,y=w?w.emptyScript:"",x=v.reactiveElementPolyfillSupport,k=(t,e)=>t,C={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},S=(t,e)=>!u(t,e),_={attribute:!0,type:String,converter:C,reflect:!1,useDefault:!1,hasChanged:S};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;class E extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=_){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&p(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){const{get:o,set:a}=m(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:o,set(e){const s=o?.call(this);a?.call(this,e),this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??_}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;const t=b(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){const t=this.properties,e=[...f(t),...g(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}
vendor: 4,627 bytes, line 2
2removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(void 0!==o&&!0===i.reflect){const a=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(e,i.type);this._$Em=t,null==a?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(t,e){const i=this.constructor,o=i._$Eh.get(t);if(void 0!==o&&this._$Em!==o){const t=i.getPropertyOptions(o),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:C;this._$Em=o,this[o]=a.fromAttribute(e,t.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const o=this.constructor,a=this[t];if(i??=o.getPropertyOptions(t),!((i.hasChanged??S)(a,e)||i.useDefault&&i.reflect&&a===this._$Ej?.get(t)&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:a},s){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,s??e??this[t]),!0!==a||void 0!==s)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[k("elementProperties")]=new Map,E[k("finalized")]=new Map,x?.({ReactiveElement:E}),(v.reactiveElementVersions??=[]).push("2.1.0");const A=globalThis,$=A.trustedTypes,L=$?$.createPolicy("lit-html",{createHTML:t=>t}):void 0,D="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,z="?"+M,T=`<${z}>`,O=document,P=()=>O.createComment(""),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,I=Array.isArray,R=t=>I(t)||"function"==typeof t?.[Symbol.iterator],V="[ \t\n\f\r]",B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,N=/-->/g,H=/>/g,q=RegExp(`>|${V}(?:([^\\s"'>=/]+)(${V}*=${V}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),U=/'/g,W=/"/g,j=/^(?:script|style|textarea|title)$/i,Y=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),K=Y(1),X=Y(2),G=Y(3),Q=Symbol.for("lit-noChange"),J=Symbol.for("lit-nothing"),Z=new WeakMap,tt=O.createTreeWalker(O,129);function et(t,e){if(!I(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==L?L.createHTML(e):e}const it=(t,e)=>{const i=t.length-1,o=[];let a,s=2===e?"<svg>":3===e?"<math>":"",n=B;for(let e=0;e<i;e++){const i=t[e];let r,l,h=-1,c=0;for(;c<i.length&&(n.lastIndex=c,l=n.exec(i),null!==l);)c=n.lastIndex,n===B?"!--"===l[1]?n=N:void 0!==l[1]?n=H:void 0!==l[2]?(j.test(l[2])&&(a=RegExp("</"+l[2],"g")),n=q):void 0!==l[3]&&(n=q):n===q?">"===l[0]?(n=a??B,h=-1):void 0===l[1]?h=-2:(h=n.lastIndex-l[2].length,r=l[1],n=void 0===l[3]?q:'"'===l[3]?W:U):n===W||n===U?n=q:n===N||n===H?n=B:(n=q,a=void 0);const d=n===q&&t[e+1].startsWith("/>")?" ":"";s+=n===B?i+T:h>=0?(o.push(r),i.slice(0,h)+D+i.slice(h)+M+d):i+M+(-2===h?e:d)}return[et(t,s+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};
vendor: 5,429 bytes, line 2
2class ot{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let a=0,s=0;const n=t.length-1,r=this.parts,[l,h]=it(t,e);if(this.el=ot.createElement(l,i),tt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=tt.nextNode())&&r.length<n;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(D)){const e=h[s++],i=o.getAttribute(t).split(M),n=/([.?@])?(.*)/.exec(e);r.push({type:1,index:a,name:n[2],strings:i,ctor:"."===n[1]?lt:"?"===n[1]?ht:"@"===n[1]?ct:rt}),o.removeAttribute(t)}else t.startsWith(M)&&(r.push({type:6,index:a}),o.removeAttribute(t));if(j.test(o.tagName)){const t=o.textContent.split(M),e=t.length-1;if(e>0){o.textContent=$?$.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],P()),tt.nextNode(),r.push({type:2,index:++a});o.append(t[e],P())}}}else if(8===o.nodeType)if(o.data===z)r.push({type:2,index:a});else{let t=-1;for(;-1!==(t=o.data.indexOf(M,t+1));)r.push({type:7,index:a}),t+=M.length-1}a++}}static createElement(t,e){const i=O.createElement("template");return i.innerHTML=t,i}}function at(t,e,i=t,o){if(e===Q)return e;let a=void 0!==o?i._$Co?.[o]:i._$Cl;const s=F(e)?void 0:e._$litDirective$;return a?.constructor!==s&&(a?._$AO?.(!1),void 0===s?a=void 0:(a=new s(t),a._$AT(t,i,o)),void 0!==o?(i._$Co??=[])[o]=a:i._$Cl=a),void 0!==a&&(e=at(t,a._$AS(t,e.values),a,o)),e}class st{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,o=(t?.creationScope??O).importNode(e,!0);tt.currentNode=o;let a=tt.nextNode(),s=0,n=0,r=i[0];for(;void 0!==r;){if(s===r.index){let e;2===r.type?e=new nt(a,a.nextSibling,this,t):1===r.type?e=new r.ctor(a,r.name,r.strings,this,t):6===r.type&&(e=new dt(a,this,t)),this._$AV.push(e),r=i[++n]}s!==r?.index&&(a=tt.nextNode(),s++)}return tt.currentNode=O,o}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class nt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,o){this.type=2,this._$AH=J,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=at(this,t,e),F(t)?t===J||null==t||""===t?(this._$AH!==J&&this._$AR(),this._$AH=J):t!==this._$AH&&t!==Q&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):R(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==J&&F(this._$AH)?this._$AA.nextSibling.data=t:this.T(O.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,o="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=ot.createElement(et(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new st(o,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new ot(t)),e}k(t){I(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const a of t)o===e.length?e.push(i=new nt(this.O(P()),this.O(P()),this,this.options)):i=e[o],i._$AI(a),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class rt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,a){this.type=1,this._$AH=J,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=a,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=J}_$AI(t,e=this,i,o){const a=this.strings;let s=!1;if(void 0===a)t=at(this,t,e,0),s=!F(t)||t!==this._$AH&&t!==Q,s&&(this._$AH=t);else{const o=t;let n,r;for(t=a[0],n=0;n<a.length-1;n++)r=at(this,o[i+n],e,n),r===Q&&(r=this._$AH[n]),s||=!F(r)||r!==this._$AH[n],r===J?t=J:t!==J&&(t+=(r??"")+a[n+1]),this._$AH[n]=r}s&&!o&&this.j(t)}j(t){t===J?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class lt extends rt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===J?void 0:t}}class ht extends rt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==J)}}class ct extends rt{constructor(t,e,i,o,a){super(t,e,i,o,a),this.type=5}_$AI(t,e=this){if((t=at(this,t,e,0)??J)===Q)return;const i=this._$AH,o=t===J&&i!==J||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,a=t!==J&&(i===J||o);o&&this.element.removeEventListener(this.name,this,i),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class dt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){at(this,t)}}const ut={M:D,P:M,A:z,C:1,L:it,R:st,D:R,V:at,I:nt,H:rt,N:ht,U:ct,B:lt,F:dt},pt=A.litHtmlPolyfillSupport;pt?.(ot,nt),(A.litHtmlVersions??=[]).push("3.3.0");const mt=globalThis;
2class ft extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{const o=i?.renderBefore??e;let a=o._$litPart$;if(void 0===a){const t=i?.renderBefore??null;o._$litPart$=a=new nt(e.insertBefore(P(),t),t,void 0,i??{})}return a._$AI(t),a})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}}ft._$litElement$=!0,ft.finalized=!0,mt.litElementHydrateSupport?.({LitElement:ft});const gt=mt.litElementPolyfillSupport;gt?.({LitElement:ft});(mt.litElementVersions??=[]).push("4.2.0");var bt=h` 3 @layer wa-component { 4 :host { 5 display: block; 6 border: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-surface-border); 7 border-radius: var(--wa-panel-border-radius); 8 overflow: hidden; 9 } 10 11 /* Appearance modifiers */ 12 :host([appearance='outlined']) { 13 background-color: var(--wa-color-surface-default); 14 border-color: var(--wa-color-surface-border); 15 } 16 17 :host([appearance='filled']) { 18 border-color: transparent; 19 } 20 21 :host([appearance='filled-outlined']) { 22 background-color: var(--wa-color-neutral-fill-quiet); 23 border-color: var(--wa-color-neutral-border-quiet); 24 } 25 26 :host([appearance='plain']) { 27 background-color: transparent; 28 border-color: transparent; 29 border-radius: 0; 30 } 31 } 32`;function vt(t,e){const i={waitUntilFirstUpdate:!1,...e};return(e,o)=>{const{update:a}=e,s=Array.isArray(t)?t:[t];e.update=function(t){s.forEach(e=>{const a=e;if(t.has(a)){const e=t.get(a),s=this[a];e!==s&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[o](e,s))}}),a.call(this,t)}}}var wt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,xt=t=>{throw TypeError(t)},kt=(t,e,i,o)=>{for(var a,s=o>1?void 0:o?yt(e,i):e,n=t.length-1;n>=0;n--)(a=t[n])&&(s=(o?a(e,i,s):a(s))||s);return o&&s&&wt(e,i,s),s},Ct=(t,e,i)=>e.has(t)||xt("Cannot "+i);const St=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},_t={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:S},Et=(t=_t,e,i)=>{const{kind:o,metadata:a}=i;let s=globalThis.litPropertyMetadata.get(a);if(void 0===s&&globalThis.litPropertyMetadata.set(a,s=new Map),"setter"===o&&((t=Object.create(t)).wrapped=!0),s.set(i.name,t),"accessor"===o){const{name:o}=i;return{set(i){const a=e.get.call(this);e.set.call(this,i),this.requestUpdate(o,a,t)},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===o){const{name:o}=i;return function(i){const a=this[o];e.call(this,i),this.requestUpdate(o,a,t)}}throw Error("Unsupported decorator location: "+o)};function At(t){return(e,i)=>"object"==typeof i?Et(t,e,i):((t,e,i)=>{const o=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),o?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function $t(t){return At({...t,state:!0,attribute:!1})}const Lt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function Dt(t,e){return(i,o,a)=>{const s=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof o?i:a??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return Lt(i,o,{get(){let i=t.call(this);return void 0===i&&(i=s(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return Lt(i,o,{get(){return s(this)}})}}var Mt,zt=h` 33 :host { 34 box-sizing: border-box; 35 } 36 37 :host *, 38 :host *::before, 39 :host *::after { 40 box-sizing: inherit; 41 } 42 43 [hidden], 44 :host([hidden]) { 45 display: none !important; 46 } 47`,Tt=/;\s+$/;function Ot(t){return t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Pt(t){const{property:e,value:i,element:o}=t;
47if(i){let t=o.getAttribute("style")||"";t&&(t.match(Tt)||(t+=";"),t+=" ");const a=`${e}: ${i}`;if(t.includes(a))return;return`${t}${a};`}return null}var Ft=class extends ft{constructor(){var t,e,i;super(),t=this,i=!1,(e=Mt).has(t)?xt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),this.initialReflectedProperties=new Map,this.didSSR=Boolean(this.shadowRoot),this.customStates={set:(t,e)=>{if(Boolean(this.internals?.states))try{e?this.internals.states.add(t):this.internals.states.delete(t)}catch(t){if(!String(t).includes("must start with '--'"))throw t;console.error("Your browser implements an outdated version of CustomStateSet. Consider using a polyfill")}},has:t=>{if(!Boolean(this.internals?.states))return!1;try{return this.internals.states.has(t)}catch{return!1}}};try{this.internals=this.attachInternals()}catch{console.error("Element internals are not supported in your browser. Consider using a polyfill")}this.customStates.set("wa-defined",!0);let o=this.constructor;for(let[t,e]of o.elementProperties)"inherit"===e.default&&void 0!==e.initial&&"string"==typeof t&&this.customStates.set(`initial-${t}-${e.initial}`,!0)}static get styles(){const t=Array.isArray(this.css)?this.css:this.css?[this.css]:[];return[zt,...t]}connectedCallback(){super.connectedCallback(),this.didSSR||this.shadowRoot?.prepend(document.createComment(` Web Awesome: https://webawesome.com/docs/components/${this.localName.replace("wa-","")} `)),this.didSSR&&this.updateComplete.then(()=>{this.shadowRoot?.prepend(document.createComment(` Web Awesome: https://webawesome.com/docs/components/${this.localName.replace("wa-","")} `))})}attributeChangedCallback(t,e,i){var o,a,s;Ct(o=this,a=Mt,"read from private field"),(s?s.call(o):a.get(o))||(this.constructor.elementProperties.forEach((t,e)=>{t.reflect&&null!=this[e]&&this.initialReflectedProperties.set(e,this[e])}),((t,e,i,o)=>{Ct(t,e,"write to private field"),o?o.call(t,i):e.set(t,i)})(this,Mt,!0)),super.attributeChangedCallback(t,e,i)}willUpdate(t){super.willUpdate(t),this.initialReflectedProperties.forEach((e,i)=>{t.has(i)&&null==this[i]&&(this[i]=e)})}firstUpdated(t){super.firstUpdated(t),this.didSSR&&this.shadowRoot?.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})}update(t){try{super.update(t)}catch(t){if(this.didSSR&&!this.hasUpdated){const e=new Event("lit-hydration-error",{bubbles:!0,composed:!0,cancelable:!1});e.error=t,this.dispatchEvent(e)}throw t}}setStyle(t,e){if(!this.style){const i=Pt({property:Ot(t),value:e,element:this});return void(i&&this.setAttribute("style",i))}this.style[t]=e}setStyleProperty(t,e){if(!this.style){const i=Pt({property:t,value:e,element:this});return void(i&&this.setAttribute("style",i))}this.style.setProperty(t,e)}relayNativeEvent(t,e){t.stopImmediatePropagation(),this.dispatchEvent(new t.constructor(t.type,{...t,...e}))}};Mt=new WeakMap,kt([At()],Ft.prototype,"dir",2),kt([At()],Ft.prototype,"lang",2),kt([At({type:Boolean,reflect:!0,attribute:"did-ssr"})],Ft.prototype,"didSSR",2);var It=class extends Ft{constructor(){super(...arguments),this.mode="multiple",this.iconPlacement="end",this.headingLevel="3",this.appearance="outlined"}getAllItems(){return this.defaultSlot.assignedElements({flatten:!0}).filter(t=>"wa-accordion-item"===t.tagName.toLowerCase())}getFocusableItems(){return this.getAllItems().filter(t=>!t.disabled)}ownsItem(t){return t.closest("wa-accordion")===this}handleSlotChange(){if(this.didSSR){const t=[];
47if(this.getAllItems().forEach(e=>{e.didSSR&&!e.hasUpdated&&t.push(e.updateComplete)}),t.length>0)return void Promise.allSettled(t).then(()=>{this.handleSlotChange()})}this.syncIconPlacement(),this.syncHeadingLevel(),this.syncAppearance()}handleKeyDown(t){const e=this.getFocusableItems();if(!e.length)return;const i=t.composedPath().find(t=>t instanceof Element&&"wa-accordion-item"===t.tagName.toLowerCase());if(!i||!this.ownsItem(i))return;const o=e.findIndex(t=>t===i);let a=o;switch(t.key){case"ArrowDown":t.preventDefault(),a=(o+1)%e.length;break;case"ArrowUp":t.preventDefault(),a=(o-1+e.length)%e.length;break;case"Home":t.preventDefault(),a=0;break;case"End":t.preventDefault(),a=e.length-1;break;default:return}e[a].focus()}syncIconPlacement(){this.getAllItems().forEach(t=>t.iconPlacement=this.iconPlacement)}syncHeadingLevel(){this.getAllItems().forEach(t=>t.headingLevel=this.headingLevel)}syncAppearance(){this.getAllItems().forEach(t=>t.appearance=this.appearance)}async handleItemTrigger(a){const{item:s}=a.detail;if(this.ownsItem(s)&&(a.stopPropagation(),!s.disabled))if(s.expanded){if("single"===this.mode)return;const e=new i({item:s});if(this.dispatchEvent(e),e.defaultPrevented)return;await s.collapse(),this.dispatchEvent(new t({item:s}))}else{"single"!==this.mode&&"single-collapsible"!==this.mode||this.getAllItems().filter(t=>
47t!==s&&t.expanded).forEach(t=>t.collapse());const t=new o({item:s});if(this.dispatchEvent(t),t.defaultPrevented)return;await s.expand(),this.dispatchEvent(new e({item:s}))}}expandAll(){"single"!==this.mode&&"single-collapsible"!==this.mode&&this.getAllItems().filter(t=>!t.disabled&&!t.expanded).forEach(t=>t.expand())}collapseAll(){this.getAllItems().filter(t=>t.expanded).forEach(t=>t.collapse())}render(){return K` 48 <slot 49 @slotchange=${this.handleSlotChange} 50 @wa-accordion-item-trigger=${this.handleItemTrigger} 51 @keydown=${this.handleKeyDown} 52 ></slot> 53 `}};It.css=bt,kt([Dt("slot")],It.prototype,"defaultSlot",2),kt([At({reflect:!0})],It.prototype,"mode",2),kt([At({attribute:"icon-placement",reflect:!0})],It.prototype,"iconPlacement",2),kt([At({attribute:"heading-level",reflect:!0})],It.prototype,"headingLevel",2),kt([At({reflect:!0})],It.prototype,"appearance",2),kt([vt("iconPlacement",{waitUntilFirstUpdate:!0})],It.prototype,"syncIconPlacement",1),kt([vt("headingLevel",{waitUntilFirstUpdate:!0})],It.prototype,"syncHeadingLevel",1),kt([vt("appearance",{waitUntilFirstUpdate:!0})],It.prototype,"syncAppearance",1),It=kt([St("wa-accordion")],It);var Rt=class extends Event{constructor(){super("wa-accordion-item-collapsed",{bubbles:!1,cancelable:!1,composed:!1})}},Vt=class extends Event{constructor(){super("wa-accordion-item-expanded",{bubbles:!1,cancelable:!1,composed:!1})}},Bt=class extends Event{constructor(t){super("wa-accordion-item-trigger",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}};function Nt(t,e){return new Promise(i=>{t.addEventListener(e,function o(a){a.target===t&&(t.removeEventListener(e,o),i())})})}async function Ht(t,e,i){return t.animate(e,i).finished.catch(()=>{})}function qt(t,e){return new Promise(i=>{const o=new AbortController,{signal:a}=o;if(t.classList.contains(e))return;t.classList.add(e);let s=!1,n=()=>{s||(s=!0,t.classList.remove(e),i(),o.abort())};t.addEventListener("animationend",n,{once:!0,signal:a}),t.addEventListener("animationcancel",n,{once:!0,signal:a}),requestAnimationFrame(()=>{s||0!==t.getAnimations().length||n()})})}function Ut(t){return(t=t.toString().toLowerCase()).indexOf("ms")>-1?parseFloat(t)||0:t.indexOf("s")>-1?1e3*(parseFloat(t)||0):parseFloat(t)||0}const Wt=new Set,jt=new Map;let Yt,Kt="ltr",Xt="en";const Gt="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(Gt){const t=new MutationObserver(Jt);Kt=document.documentElement.dir||"ltr",Xt=document.documentElement.lang||navigator.language,t.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function Qt(...t){t.map(t=>{const e=t.$code.toLowerCase();jt.has(e)?jt.set(e,Object.assign(Object.assign({},jt.get(e)),t)):jt.set(e,t),Yt||(Yt=t)}),Jt()}function Jt(){Gt&&(Kt=document.documentElement.dir||"ltr",Xt=document.documentElement.lang||navigator.language),[...Wt.keys()].map(t=>{"function"==typeof t.requestUpdate&&t.requestUpdate()})}class Zt{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){Wt.add(this.host)}hostDisconnected(){Wt.delete(this.host)}dir(){return`${this.host.dir||Kt}`.toLowerCase()}lang(){const t=`${this.host.lang||Xt}`.toLowerCase().replace(/_/g,"-");try{return new Intl.Locale(t),t}catch(t){return Yt?Yt.$code.toLowerCase():"en"}}getTranslationData(t){var e,i;let o;try{o=new Intl.Locale(t.replace(/_/g,"-"))}catch(t){return{locale:void 0,language:"",region:"",primary:void 0,secondary:void 0}}const a=o.language.toLowerCase(),s=null!==(i=null===(e=o.region)||void 0===e?void 0:e.toLowerCase())&&void 0!==i?i:"";return{locale:o,language:a,region:s,primary:jt.get(`${a}-${s}`),secondary:jt.get(a)}}exists(t,e){var i;const{primary:o,secondary:a}=this.getTranslationData(null!==(i=e.lang)&&void 0!==i?i:this.lang());return e=Object.assign({includeFallback:!1},e),!!(o&&o[t]||a&&a[t]||e.includeFallback&&Yt&&Yt[t])}term(t,...e){const{primary:i,secondary:o}=this.getTranslationData(this.lang());let a;if(i&&i[t])a=i[t];else if(o&&o[t])a=o[t];else{if(!Yt||!Yt[t])return console.error(`No translation found for: ${String(t)}`),String(t);a=Yt[t]}return"function"==typeof a?a(...e):a}date(t,e){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),e).format(t)}number(t,e){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),e).format(t)}relativeTime(t,e,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(t,e)}}var te={$code:"en",$name:"English",$dir:"ltr",allTagsRemoved:"All tags removed",am:"AM",autosizeColumn:"Autosize column",captions:"Captions",carousel:"C
53arousel",chooseDate:"Choose date",chooseDecade:"Choose decade",chooseMonth:"Choose month",chooseTime:"Choose time",chooseYear:"Choose year",clearEntry:"Clear entry",clearFilter:"Clear filter",clearSort:"Clear sort",close:"Close",closeCalendar:"Close calendar",closeTimeInput:"Close time picker",collapseRow:"Collapse row",columnMenu:"Column options",columnMovedToPosition:(t,e,i)=>`${t} moved to position ${e} of ${i}`,columns:"Columns",compactPageXOfY:(t,e)=>`${t} of ${e}`,completed:"Completed",copied:"Copied",copy:"Copy",createOption:t=>`Create "${t}"`,currentlyPlaying:"currently playing",currentValue:"Current value",date:"Date",datePickerKeyboardHelp:"Use arrow keys to change values; press Alt+Down Arrow to open the calendar.",day:"Day",dayPeriod:"AM/PM",decrement:"Decrement",deselectAllRows:"Deselect all rows",disabled:"Disabled",dropFileHere:"Drop file here or click to browse",dropFilesHere:"Drop files here or click to browse",empty:"Empty",endDate:"End date",enterFullscreen:"Enter fullscreen",error:"Error",exitFullscreen:"Exit fullscreen",expandRow:"Expand row",filterByColumn:t=>`Filter by ${t}`,filterFrom:"From",filterMax:"Max",filterMin:"Min",filterTo:"To",firstPage:"First page",goToSlide:(t,e)=>`Go to slide ${t} of ${e}`,hideColumn:"Hide column",hidePassword:"Hide password",hour:"Hour",incompleteDate:"Enter a valid date.",increment:"Increment",jumpBackwardX:t=>`Jump back ${t} pages`,jumpForwardX:t=>`Jump forward ${t} pages`,lastPage:"Last page",loading:"Loading",locked:"Locked",minute:"Minute",month:"Month",moreOptions:"More Options",mute:"Mute",nextDecade:"Next decade",nextMonth:"Next month",nextPage:"Next page",nextSlide:"Next slide",nextVideo:"Next Video",nextYear:"Next year",noData:"No data",noOptions:"No options",noResults:"No matching results",notCompleted:"Not completed",now:"Now",numCharacters:t=>1===t?"1 character":`${t} characters`,numCharactersRemaining:t=>1===t?"1 character remaining":`${t} characters remaining`,numOptionsAvailable:t=>0===t?"No options available":1===t?"1 option available":`${t} options available`,numOptionsSelected:t=>0===t?"No options selected":1===t?"1 option selected":`${t} options selected`,numRowsCopied:t=>1===t?"1 row copied":`${t} rows copied`,numRowsSelected:t=>1===t?"1 row selected":`${t} rows selected`,optionPosition:(t,e,i)=>`${t}, ${e} of ${i}`,optionsLoadError:"Options could not be loaded",pageXOfY:(t,e)=>`Page ${t} of ${e}`,pagination:"Pagination",pause:"Pause",pauseAnimation:"Pause animation",pictureInPicture:"Picture in picture",pinLeft:"Pin left",pinRight:"Pin right",play:"Play",playAnimation:"Play animation",playbackSpeed:"Playback speed",playlist:"Playlist",pm:"PM",previousDecade:"Previous decade",previousMonth:"Previous month",previousPage:"Previous page",previousSlide:"Previous slide",previousVideo:"Previous video",previousYear:"Previous year",progress:"Progress",rangeTooLong:t=>1===t?"Select a range no longer than 1 day":`Select a range no longer than ${t} days`,rangeTooShort:t=>1===t?"Select a range at least 1 day long":`Select a range at least ${t} days long`,readonly:"Read-only",remove:"Remove",resetColumns:"Reset columns",resize:"Resize",resizeColumn:"Resize column",rowsPerPage:"Rows per page",scrollableRegion:"Scrollable region",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",search:"Search",second:"Second",seek:"Seek",seekProgress:(t,e)=>`${t} of ${e}`,selectAColorFromTheScreen:"Select a color from the screen",selectAllRows:"Select all rows",selected:"Selected",selectedDateLabel:t=>`Selected: ${t}`,selectedRangeLabel:t=>`Selected range: ${t}`,selectGroup:"Select group",selectionCleared:"Selection cleared",selectRow:"Select row",showingNofMRows:(t,e)=>`Showing ${t} of ${e} rows`,showingXtoYofZ:(t,e,i)=>`${t}â${e} of ${i}`,showPassword:"Show password",slideNum:t=>`Slide ${t}`,sortAscending:"Sort ascending",sortColumn:"Sort column",sortDescending:"Sort descending",startDate:"Start date",steps:"Steps",stepXOfY:(t,e)=>`Step ${t} of ${e}`,tagAdded:t=>`${t} added`,tagAlreadyAdded:t=>`${t} is already added`,tagInputKeyboardHelp:"Press Backspace or Delete to remove this tag.",tagRemoved:t=>`${t} removed`,time:"Time",timeInputKeyboardHelp:"Use arrow keys to change values; press Alt+Down Arrow to open the time picker.",today:"Today",toggleColorFormat:"Toggle color format",tooFewTags:t=>1===t?"Add at least 1 tag":`Add at least ${t} tags`,tooManyTags:t=>1===t?"Add no more than 1 tag":`Add no more than ${t} tags`,unmute:"Unmute",unpin:"Unpin",unpinColumn:"Unpin column",videoPlayer:"Video player",volume:"Volume",year:"Year",zoomIn:"Zoom in",zoomOut:"Zoom out"};Qt(te);var ee=te,ie=class extends Zt{lang(){return this.host.didSSR&&!this.host.hasUpdated?this.host.lang||"en":super.lang()}};Qt(ee);var oe=h` 54 @layer wa-component { 55 :host { 56 --spacing: var(--wa-space-m); 57 --show-duration: var(--wa-transition-normal); 58 --hide-duration: var(--wa-transition-normal); 59 --easing: var(--wa-transition-easing); 60 61 display: block; 62 } 63 64 :host(:not(:first-child)) { 65 border-top: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-surface-border); 66 } 67 68 :host([appearance='filled']) { 69 background-color: var(--wa-color-neutral-fill-quiet); 70 } 71 72 :host([appearance='filled']:not(:first-child)) { 73 margin-block-start: var(--wa-panel-border-width); 74 border-top: none; 75 } 76 77 [part~='heading'] { 78 margin: 0; 79 font: inherit; 80 } 81 82 [part~='button'] { 83 display: flex; 84 align-items: center; 85 gap: var(--spacing); 86 padding: var(--spacing); 87 width: 100%; 88 background: none; 89 border: none; 90 cursor: pointer; 91 text-align: start; 92 color: var(--wa-color-text-normal); 93 font: inherit; 94 font-weight: var(--wa-font-weight-semibold); 95 96 &:focus { 97 outline: none; 98 } 99 100 &:focus-visible { 101 outline: var(--wa-focus-ring); 102 /* Inset by the full ring width + offset so the parent's overflow:hidden doesn't clip it */ 103 outline-offset: calc(0px - var(--wa-focus-ring-width) - var(--wa-focus-ring-offset)); 104 } 105 } 106 107 /* Icon at end (default) */ 108 :host([icon-placement='end']) [part~='button'] { 109 justify-content: space-between; 110 } 111 112 /* Icon at start */ 113 :host([icon-placement='start']) [part~='button'] { 114 flex-direction: row-reverse; 115 justify-content: flex-end; 116 } 117 118 :host([disabled]) { 119 opacity: 0.5;
120 cursor: not-allowed; 121 } 122 123 :host([disabled]) [part~='button'] { 124 cursor: not-allowed; 125 pointer-events: none; 126 } 127 128 :host(:first-child) [part~='button'] { 129 border-top-left-radius: var(--wa-panel-border-radius); 130 border-top-right-radius: var(--wa-panel-border-radius); 131 } 132 133 :host(:last-child:not([expanded])) [part~='button'] { 134 border-bottom-left-radius: var(--wa-panel-border-radius); 135 border-bottom-right-radius: var(--wa-panel-border-radius); 136 } 137 138 [part~='icon'] { 139 flex: 0 0 auto; 140 display: flex; 141 align-items: center; 142 color: var(--wa-color-text-quiet); 143 transition: rotate var(--hide-duration) var(--easing); 144 } 145 146 :host([expanded]) [part~='icon'] { 147 rotate: 90deg; 148 transition-duration: var(--show-duration); 149 } 150 151 :host([expanded]:dir(rtl)) [part~='icon'] { 152 rotate: -90deg; 153 } 154 155 .body { 156 overflow: hidden; 157 color: var(--wa-color-text-quiet); 158 } 159 160 :host([expanded]) .body:not(.animating) { 161 overflow: visible; 162 } 163 164 .content { 165 display: block; 166 padding: 0 var(--spacing) var(--spacing); 167 } 168 } 169`;const ae=1,se=2,ne=3,re=4,le=t=>(...e)=>({_$litDirective$:t,values:e});class he{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const ce=le(class extends he{constructor(t){if(super(t),t.type!==ae||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.st)t in e||(i.remove(t),this.st.delete(t));for(const t in e){const o=!!e[t];o===this.st.has(t)||this.nt?.has(t)||(o?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return Q}});var de=class extends Ft{constructor(){super(...arguments),this.animationGeneration=0,this.localize=new ie(this),this.isAnimating=!1,this.label="",this.expanded=!1,this.disabled=!1,this.headingLevel="3",this.iconPlacement="end",this.appearance="outlined"}firstUpdated(t){super.firstUpdated(t),this.body.style.height=this.expanded?"auto":"0"}updated(){this.customStates.set("animating",this.isAnimating)}handleTriggerClick(){this.disabled||this.dispatchEvent(new Bt({item:this}))}handleTriggerKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleTriggerClick())}async handleExpandedChange(){this.animationGeneration++;const t=this.animationGeneration;if(this.expanded){this.isAnimating=!0;const e=Ut(getComputedStyle(this.body).getPropertyValue("--show-duration")||"200ms"),i=getComputedStyle(this.body).getPropertyValue("--easing")||"ease";if(await Ht(this.body,[{height:"0",opacity:"0"},{height:`${this.body.scrollHeight}px`,opacity:"1"}],{duration:e,easing:i}),this.animationGeneration!==t)return;this.body.style.height="auto",this.isAnimating=!1,this.dispatchEvent(new Vt)}else{this.isAnimating=!0;const e=Ut(getComputedStyle(this.body).getPropertyValue("--hide-duration")||"200ms"),i=getComputedStyle(this.body).getPropertyValue("--easing")||"ease";if(await Ht(this.body,[{height:`${this.body.scrollHeight}px`,opacity:"1"},{height:"0",opacity:"0"}],{duration:e,easing:i}),this.animationGeneration!==t)return;this.body.style.height="0",this.isAnimating=!1,this.dispatchEvent(new Rt)}}async expand(){if(!this.expanded&&!this.disabled)return this.expanded=!0,Nt(this,"wa-accordion-item-expanded")}async collapse(){if(this.expanded&&!this.disabled)return this.expanded=!1,Nt(this,"wa-accordion-item-collapsed")}async toggle(){return this.expanded?this.collapse():this.expand()}focus(t){this.triggerButton?.focus(t)}renderHeadingWrapper(t){const e=parseInt(this.headingLevel,10);switch(e>=1&&e<=6?e:3){case 1:return K`<h1 part="heading">${t}</h1>`;case 2:return K`<h2 part="heading">${t}</h2>`;case 4:return K`<h4 part="heading">${t}</h4>`;case 5:return K`<h5 part="heading">${t}</h5>`;case 6:return K`<h6 part="heading">${t}</h6>`;default:return K`<h3 part="heading">${t}</h3>`}}render(){const t=this.hasUpdated?"rtl"===this.localize.dir():"rtl"===this.dir,e=K` 170 <button 171 part="button" 172 type="button" 173 id="trigger" 174 aria-expanded=${this.expanded?"true":"false"} 175 aria-controls="panel" 176 aria-disabled=${this.disabled?"true":"false"} 177 tabindex=${this.disabled?"-1":"0"} 178 @click=${this.handleTriggerClick} 179 @keydown=${this.handleTriggerKeyDown} 180 > 181 <slot name="label" part="label">${this.label}</slot>
182 <span part="icon"> 183 <slot name="icon"> 184 <wa-icon library="system" variant="solid" name=${t?"chevron-left":"chevron-right"}></wa-icon> 185 </slot> 186 </span> 187 </button> 188 `;return K` 189 <div part="base accordion-item"> 190 ${"none"===this.headingLevel?e:this.renderHeadingWrapper(e)} 191 <div 192 part="panel" 193 id="panel" 194 class=${ce({body:!0,animating:this.isAnimating})} 195 role="region" 196 aria-labelledby="trigger" 197 > 198 <slot part="content" class="content"></slot> 199 </div> 200 </div> 201 `}};de.css=oe,kt([Dt(".body")],de.prototype,"body",2),kt([Dt('[part~="button"]')],de.prototype,"triggerButton",2),kt([$t()],de.prototype,"isAnimating",2),kt([At()],de.prototype,"label",2),kt([At({type:Boolean,reflect:!0})],de.prototype,"expanded",2),kt([At({type:Boolean,reflect:!0})],de.prototype,"disabled",2),kt([At({attribute:"heading-level",reflect:!0})],de.prototype,"headingLevel",2),kt([At({attribute:"icon-placement",reflect:!0})],de.prototype,"iconPlacement",2),kt([At({reflect:!0})],de.prototype,"appearance",2),kt([vt("expanded",{waitUntilFirstUpdate:!0})],de.prototype,"handleExpandedChange",1),de=kt([St("wa-accordion-item")],de);var ue=class extends Event{constructor(){super("wa-error",{bubbles:!0,cancelable:!1,composed:!0})}},pe=class extends Event{constructor(){super("wa-load",{bubbles:!0,cancelable:!1,composed:!0})}},me=h` 202 :host { 203 --primary-color: currentColor; 204 --primary-opacity: 1; 205 --secondary-color: currentColor; 206 --secondary-opacity: 0.4; 207 --rotate-angle: 0deg; 208 209 box-sizing: content-box; 210 display: inline-flex;
211 align-items: center; 212 justify-content: center; 213 vertical-align: -0.125em; 214 } 215 216 /* #region Canvas â the box the icon is centered within (mirrors Font Awesome's icon canvas). Orthogonal to font-size. */ 217 218 /* Fixed width (default): 1.25em à 1em (20 à 16px) */ 219 :host(:not([canvas])), 220 :host([canvas='fixed']) { 221 width: 1.25em; 222 height: 1em; 223 min-width: 1.25em; /* <-- this is what Safari respects for intrinsic */ 224 min-height: 1em; 225 } 226 227 /* Auto: hug the icon's width. \`auto-width\` is the deprecated alias for canvas="auto". */ 228 :host([canvas='auto']), 229 :host([auto-width]:not([canvas])) { 230 width: auto; 231 height: 1em; 232 } 233 234 /* Square: 1.25em à 1.25em (20 à 20px) */ 235 :host([canvas='square']) { 236 width: 1.25em; 237 height: 1.25em; 238 min-width: 1.25em; 239 min-height: 1.25em; 240 } 241 242 /* Roomy: 1.5em à 1.5em (24 à 24px) */ 243 :host([canvas='roomy']) { 244 width: 1.5em; 245 height: 1.5em; 246 min-width: 1.5em; 247 min-height: 1.5em; 248 } 249 250 /* #endregion */ 251 252 svg { 253 /* NOTE: Avoid setting fill here. A stylesheet rule beats SVG presentation attributes, breaking stroke-based 254 libraries like Lucide (fill="none" stroke="currentColor") and attribute-based mutators (issue #1733). The default 255 library applies fill="currentColor" in its mutator instead. */ 256 height: 1em; 257 overflow: visible; 258 width: auto; 259 260 /* Duotone colors with path-specific opacity fallback */ 261 path[data-duotone-primary] { 262 color: var(--primary-color); 263 opacity: var(--path-opacity, var(--primary-opacity)); 264 } 265 266 path[data-duotone-secondary] { 267 color: var(--secondary-color); 268 opacity: var(--path-opacity, var(--secondary-opacity)); 269 } 270 } 271 272 /* Rotation */ 273 :host([rotate]) { 274 transform: rotate(var(--rotate-angle, 0deg)); 275 } 276 277 /* Flipping */ 278 :host([flip='x']) { 279 transform: scaleX(-1); 280 } 281 :host([flip='y']) { 282 transform: scaleY(-1); 283 } 284 :host([flip='both']) { 285 transform: scale(-1, -1); 286 } 287 288 /* Rotation and Flipping combined */ 289 :host([rotate][flip='x']) { 290 transform: rotate(var(--rotate-angle, 0deg)) scaleX(-1); 291 } 292 :host([rotate][flip='y']) { 293 transform: rotate(var(--rotate-angle, 0deg)) scaleY(-1); 294 } 295 :host([rotate][flip='both']) { 296 transform: rotate(var(--rotate-angle, 0deg)) scale(-1, -1); 297 } 298 299 /* #region Animations â ported from Font Awesome 7.3 (--fa-* props mapped to wa-icon's --* names) */ 300 301 :host([animation='beat']) { 302 animation-name: beat; 303 animation-delay: var(--animation-delay, 0s); 304 animation-direction: var(--animation-direction, normal); 305 animation-duration: var(--animation-duration, 1s); 306 animation-iteration-count: var(--animation-iteration-count, infinite); 307 animation-timing-function: var(--animation-timing, ease-in-out); 308 } 309 310 :host([animation='bounce']) { 311 animation-name: bounce; 312 animation-delay: var(--animation-delay, 0s); 313 animation-direction: var(--animation-direction, normal); 314 animation-duration: var(--animation-duration, 1s); 315 animation-iteration-count: var(--animation-iteration-count, infinite); 316 animation-timing-function: var(--animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); 317 } 318 319 :host([animation='fade']) { 320 animation-name: fade; 321 animation-delay: var(--animation-delay, 0s); 322 animation-direction: var(--animation-direction, normal); 323 animation-duration: var(--animation-duration, 1s); 324 animation-iteration-count: var(--animation-iteration-count, infinite); 325 animation-timing-function: var(--animation-timing, ease-in-out); 326 } 327 328 :host([animation='beat-fade']) { 329 animation-name: beat-fade; 330 animation-delay: var(--animation-delay, 0s); 331 animation-direction: var(--animation-direction, normal); 332 animation-duration: var(--animation-duration, 1s); 333 animation-iteration-count: var(--animation-iteration-count, infinite); 334 animation-timing-function: var(--animation-timing, ease-in-out); 335 } 336 337 :host([animation='flip']) { 338 animation-name: flip; 339 animation-delay: var(--animation-delay, 0s); 340 animation-direction: var(--animation-direction, normal); 341 animation-duration: var(--animation-duration, 1.5s); 342 animation-iteration-count: var(--animation-iteration-count, infinite); 343 animation-timing-function: var(--animation-timing, ease-in-out); 344 } 345 346 :host([animation='flip-360']) { 347 animation-name: flip-360; 348 animation-delay: var(--animation-delay, 0s); 349 animation-direction: var(--animation-direction, normal); 350 animation-duration: var(--animation-duration, 1s); 351 animation-iteration-count: var(--animation-iteration-count, infinite); 352 animation-timing-function: var(--animation-timing, ease-in-out); 353 } 354 355 :host([animation='shake']) { 356 animation-name: shake; 357 animation-delay: var(--animation-delay, 0s); 358 animation-direction: var(--animation-direction, normal); 359 animation-duration: var(--animation-duration, 0.75s); 360 animation-iteration-count: var(--animation-iteration-count, infinite); 361 animation-timing-function: var(--animation-timing, ease-in-out); 362 } 363 364 :host([animation='spin']) { 365 animation-name: spin; 366 animation-delay: var(--animation-delay, 0s); 367 animation-direction: var(--animation-direction, normal); 368 animation-duration: var(--animation-duration, 2s); 369 animation-iteration-count: var(--animation-iteration-count, infinite); 370 animation-timing-function: var(--animation-timing, linear); 371 } 372 373 :host([animation='spin-pulse']) { 374 animation-name: spin; 375 animation-delay: var(--animation-delay, 0s); 376 animation-direction: var(--animation-direction, normal); 377 animation-duration: var(--animation-duration, 1s); 378 animation-iteration-count: var(--animation-iteration-count, infinite); 379 animation-timing-function: var(--animation-timing, steps(8)); 380 } 381 382 /* spin-reverse is FA's reverse modifier expressed as a standalone value; reverse any spin via --animation-direction: reverse */ 383 :host([animation='spin-reverse']) { 384 animation-name: spin; 385 animation-delay: var(--animation-delay, 0s); 386 animation-direction: var(--animation-direction, reverse); 387 animation-duration: var(--animation-duration, 2s); 388 animation-iteration-count: var(--animation-iteration-count, infinite); 389 animation-timing-function: var(--animation-timing, linear); 390 } 391 392 :host([animation='spin-snap']) { 393 animation-name: spin-snap;
394 animation-delay: var(--animation-delay, 0s); 395 animation-direction: var(--animation-direction, normal); 396 animation-duration: var(--animation-duration, 3s); 397 animation-iteration-count: var(--animation-iteration-count, infinite); 398 animation-timing-function: var(--animation-timing, linear); 399 } 400 401 :host([animation='spin-snap-4']) { 402 animation-name: spin-snap-4; 403 animation-delay: var(--animation-delay, 0s); 404 animation-direction: var(--animation-direction, normal); 405 animation-duration: var(--animation-duration, 2.4s); 406 animation-iteration-count: var(--animation-iteration-count, infinite); 407 animation-timing-function: var(--animation-timing, linear); 408 } 409 410 :host([animation='spin-snap-8']) { 411 animation-name: spin-snap-8; 412 animation-delay: var(--animation-delay, 0s); 413 animation-direction: var(--animation-direction, normal); 414 animation-duration: var(--animation-duration, 4s); 415 animation-iteration-count: var(--animation-iteration-count, infinite); 416 animation-timing-function: var(--animation-timing, linear); 417 } 418 419 :host([animation='buzz']) { 420 animation-name: buzz; 421 animation-delay: var(--animation-delay, 0s); 422 animation-direction: var(--animation-direction, normal); 423 animation-duration: var(--animation-duration, 0.6s); 424 animation-iteration-count: var(--animation-iteration-count, infinite); 425 animation-timing-function: var(--animation-timing, linear); 426 } 427 428 :host([animation='wag']) { 429 animation-name: wag; 430 animation-delay: var(--animation-delay, 0s); 431 animation-direction: var(--animation-direction, normal); 432 animation-duration: var(--animation-duration, 0.9s); 433 animation-iteration-count: var(--animation-iteration-count, infinite); 434 animation-timing-function: var(--animation-timing, ease-out); 435 transform-origin: bottom center; 436 } 437 438 :host([animation='float']) { 439 animation-name: float; 440 animation-delay: var(--animation-delay, 0s); 441 animation-direction: var(--animation-direction, normal); 442 animation-duration: var(--animation-duration, 3s); 443 animation-iteration-count: var(--animation-iteration-count, infinite); 444 animation-timing-function: var(--animation-timing, ease-in-out); 445 will-change: transform; 446 } 447 448 :host([animation='swing']) { 449 animation-name: swing; 450 animation-delay: var(--animation-delay, 0s); 451 animation-direction: var(--animation-direction, normal); 452 animation-duration: var(--animation-duration, 1.2s); 453 animation-iteration-count: var(--animation-iteration-count, infinite); 454 animation-timing-function: var(--animation-timing, ease-out); 455 transform-origin: top center; 456 } 457 458 :host([animation='jello']) { 459 animation-name: jello; 460 animation-delay: var(--animation-delay, 0s); 461 animation-direction: var(--animation-direction, normal); 462 animation-duration: var(--animation-duration, 0.9s); 463 animation-iteration-count: var(--animation-iteration-count, infinite); 464 animation-timing-function: var(--animation-timing, ease-out); 465 } 466 467 @media (prefers-reduced-motion: reduce) { 468 :host([animation='beat']), 469 :host([animation='bounce']), 470 :host([animation='fade']), 471 :host([animation='beat-fade']), 472 :host([animation='flip']), 473 :host([animation='flip-360']), 474 :host([animation='shake']), 475 :host([animation='spin']), 476 :host([animation='spin-pulse']), 477 :host([animation='spin-reverse']), 478 :host([animation='spin-snap']), 479 :host([animation='spin-snap-4']), 480 :host([animation='spin-snap-8']), 481 :host([animation='buzz']), 482 :host([animation='wag']), 483 :host([animation='float']), 484 :host([animation='swing']), 485 :host([animation='jello']) { 486 animation: none !important; 487 transition: none !important; 488 } 489 } 490 491 /* #endregion */ 492 493 /* #region Keyframes â ported verbatim from Font Awesome 7.3 */ 494 495 @keyframes beat { 496 0% { 497 transform: scale(1); 498 } 499 25% { 500 transform: scale(calc(1.25 * var(--beat-scale, 1.25))); 501 } 502 45% { 503 transform: scale(calc(1.22 * var(--beat-scale, 1.22))); 504 } 505 65% { 506 transform: scale(calc(1.25 * var(--beat-scale, 1.25))); 507 } 508 90% { 509 transform: scale(1); 510 } 511 } 512 513 @keyframes bounce { 514 0% { 515 transform: scale(1, 1) translateY(0); 516 /* No fallback by design (ported from FA 7.3): the first segment uses the user's --animation-timing or the CSS 517 initial ease, while the explicit cubic-beziers on later stops drive the bounce physics. */ 518 animation-timing-function: var(--animation-timing); 519 }
520 14% { 521 transform: scale(var(--bounce-start-scale-x, 1.06), var(--bounce-start-scale-y, 0.94)) 522 translateY(var(--bounce-anticipation, 3px)); 523 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33); 524 } 525 32% { 526 transform: scale(var(--bounce-jump-scale-x, 0.94), var(--bounce-jump-scale-y, 1.12)) 527 translateY(calc(-1 * var(--bounce-height, 0.5em))); 528 animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1); 529 } 530 52% { 531 transform: scale(1, 1) translateY(calc(-1 * var(--bounce-height, 0.5em) * 1.1)); 532 animation-timing-function: cubic-bezier(0.5, 0, 1, 0.5); 533 } 534 70% { 535 transform: scale(var(--bounce-land-scale-x, 1.06), var(--bounce-land-scale-y, 0.92)) translateY(0); 536 animation-timing-function: cubic-bezier(0.33, 0.33, 0.66, 1); 537 } 538 85% { 539 transform: scale(0.98, 1.04) translateY(calc(-2px * var(--bounce-rebound, 1))); 540 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 1); 541 } 542 100% { 543 transform: scale(1, 1) translateY(0); 544 } 545 } 546 547 @keyframes fade { 548 0% { 549 opacity: 1; 550 transform: scale(1); 551 animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); 552 } 553 40% { 554 opacity: var(--fade-opacity, 0.4); 555 transform: scale(0.98); 556 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 557 } 558 100% { 559 opacity: 1; 560 transform: scale(1); 561 } 562 } 563 564 @keyframes beat-fade { 565 0% { 566 opacity: var(--beat-fade-opacity, 0.4); 567 transform: scale(1); 568 animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); 569 } 570 25% { 571 opacity: calc(var(--beat-fade-opacity, 0.4) + 0.4); 572 transform: scale(var(--beat-fade-scale, 1.28)); 573 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 574 } 575 45% { 576 opacity: 1; 577 transform: scale(var(--beat-fade-scale, 1.25)); 578 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 579 } 580 65% { 581 opacity: calc(var(--beat-fade-opacity, 0.4) + 0.4); 582 transform: scale(var(--beat-fade-scale, 1.28)); 583 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 584 } 585 100% { 586 opacity: var(--beat-fade-opacity, 0.4); 587 transform: scale(1); 588 } 589 } 590 591 @keyframes flip { 592 0% { 593 transform: perspective(2em) scale(1) rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), 0deg); 594 animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); 595 } 596 8% { 597 transform: perspective(2em) scale(var(--flip-anticipation-scale, 0.95)) 598 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), 0deg); 599 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33); 600 } 601 35% { 602 transform: perspective(2em) scale(1) 603 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), calc(var(--flip-angle, -360deg) * 0.6)); 604 animation-timing-function: linear; 605 } 606 65% { 607 transform: perspective(2em) scale(1) 608 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), calc(var(--flip-angle, -360deg) * 0.5)); 609 animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1); 610 } 611 92% { 612 transform: perspective(2em) scale(1) 613 rotate3d( 614 var(--flip-x, 0), 615 var(--flip-y, 1), 616 var(--flip-z, 0), 617 calc(var(--flip-angle, -360deg) * var(--flip-overshoot, 1.04)) 618 ); 619 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 1); 620 } 621 100% { 622 transform: perspective(2em) scale(1) 623 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), var(--flip-angle, -360deg)); 624 } 625 } 626 627 @keyframes flip-360 { 628 0% { 629 transform: perspective(2em) scale(1) rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), 0deg); 630 animation-timing-function: cubic-bezier(0.2, 0, 0.4, 1); 631 } 632 8% { 633 transform: perspective(2em) scale(var(--flip-anticipation-scale, 0.95)) 634 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), 0deg); 635 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33); 636 } 637 50% { 638 transform: perspective(2em) scale(1) 639 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), calc(var(--flip-angle, -360deg) * 0.6)); 640 animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1); 641 } 642 80% { 643 transform: perspective(2em) scale(1) 644 rotate3d( 645 var(--flip-x, 0), 646 var(--flip-y, 1), 647 var(--flip-z, 0), 648 calc(var(--flip-angle, -360deg) * var(--flip-overshoot, 1.04)) 649 ); 650 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 1); 651 } 652 100% { 653 transform: perspective(2em) scale(1) 654 rotate3d(var(--flip-x, 0), var(--flip-y, 1), var(--flip-z, 0), var(--flip-angle, -360deg)); 655 } 656 } 657 658 @keyframes shake { 659 0% { 660 transform: rotate(0deg); 661 animation-timing-function: cubic-bezier(0.2, 0, 0.8, 1); 662 } 663 8% { 664 transform: rotate(35deg) translateX(1px); 665 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 666 } 667 20% { 668 transform: rotate(-22deg) translateX(-1px); 669 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 670 } 671 35% { 672 transform: rotate(15deg) translateX(1px); 673 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 674 } 675 50% { 676 transform: rotate(-9deg); 677 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 678 } 679 65% { 680 transform: rotate(5deg); 681 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 682 } 683 78% { 684 transform: rotate(-3deg); 685 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 686 } 687 90% { 688 transform: rotate(1deg); 689 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 690 } 691 100% { 692 transform: rotate(0deg); 693 } 694 } 695 696 @keyframes spin { 697 0% { 698 transform: rotate(0deg); 699 } 700 100% { 701 transform: rotate(360deg); 702 } 703 } 704 705 @keyframes spin-snap { 706 0% { 707 transform: rotate(0deg); 708 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 709 } 710 12% { 711 transform: rotate(60deg); 712 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 713 } 714 16.67% { 715 transform: rotate(60deg); 716 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 717 } 718 28.67% { 719 transform: rotate(120deg); 720 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 721 } 722 33.33% { 723 transform: rotate(120deg); 724 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 725 } 726 45.33% { 727 transform: rotate(180deg); 728 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 729 } 730 50% { 731 transform: rotate(180deg); 732 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 733 } 734 62% { 735 transform: rotate(240deg); 736 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 737 } 738 66.67% { 739 transform: rotate(240deg); 740 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 741 } 742 78.67% { 743 transform: rotate(300deg); 744 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 745 } 746 83.33% { 747 transform: rotate(300deg); 748 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 749 } 750 95.33% { 751 transform: rotate(360deg); 752 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 753 } 754 100% { 755 transform: rotate(360deg); 756 } 757 } 758 759 @keyframes spin-snap-4 { 760 0% { 761 transform: rotate(0deg); 762 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 763 } 764 15% { 765 transform: rotate(90deg); 766 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 767 } 768 25% { 769 transform: rotate(90deg); 770 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 771 } 772 40% { 773 transform: rotate(180deg); 774 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 775 } 776 50% { 777 transform: rotate(180deg); 778 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 779 } 780 65% { 781 transform: rotate(270deg); 782 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 783 } 784 75% { 785 transform: rotate(270deg); 786 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 787 } 788 90% { 789 transform: rotate(360deg); 790 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 791 } 792 100% { 793 transform: rotate(360deg); 794 } 795 } 796 797 @keyframes spin-snap-8 { 798 0% { 799 transform: rotate(0deg); 800 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 801 } 802 9% { 803 transform: rotate(45deg); 804 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 805 } 806 12.5% { 807 transform: rotate(45deg); 808 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 809 } 810 21.5% { 811 transform: rotate(90deg); 812 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 813 } 814 25% { 815 transform: rotate(90deg); 816 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 817 } 818 34% { 819 transform: rotate(135deg); 820 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 821 } 822 37.5% { 823 transform: rotate(135deg); 824 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 825 } 826 46.5% { 827 transform: rotate(180deg); 828 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 829 } 830 50% { 831 transform: rotate(180deg); 832 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 833 } 834 59% { 835 transform: rotate(225deg); 836 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 837 } 838 62.5% { 839 transform: rotate(225deg); 840 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 841 } 842 71.5% { 843 transform: rotate(270deg); 844 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 845 } 846 75% { 847 transform: rotate(270deg); 848 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 849 } 850 84% { 851 transform: rotate(315deg); 852 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 853 } 854 87.5% { 855 transform: rotate(315deg); 856 animation-timing-function: cubic-bezier(0, 0, 0.2, 1); 857 } 858 96.5% { 859 transform: rotate(360deg); 860 animation-timing-function: cubic-bezier(0.8, 0, 1, 1); 861 } 862 100% { 863 transform: rotate(360deg); 864 } 865 } 866 867 @keyframes buzz { 868 0% { 869 transform: translateX(0) rotate(0deg); 870 animation-timing-function: cubic-bezier(0.1, 0, 0.9, 1); 871 } 872 5% { 873 transform: translateX(var(--buzz-distance, 4px)) rotate(0.5deg); 874 } 875 10% { 876 transform: translateX(calc(-1 * var(--buzz-distance, 4px))) rotate(-0.5deg); 877 } 878 15% { 879 transform: translateX(var(--buzz-distance, 4px)) rotate(0.3deg); 880 } 881 20% { 882 transform: translateX(calc(-1 * var(--buzz-distance, 4px))) rotate(-0.3deg); 883 } 884 25% { 885 transform: translateX(calc(var(--buzz-distance, 4px) * 0.7)) rotate(0.2deg); 886 } 887 30% { 888 transform: translateX(calc(-1 * var(--buzz-distance, 4px) * 0.7)) rotate(-0.2deg); 889 } 890 35% { 891 transform: translateX(calc(var(--buzz-distance, 4px) * 0.4)) rotate(0.1deg); 892 } 893 40% { 894 transform: translateX(0) rotate(0deg); 895 } 896 100% { 897 transform: translateX(0) rotate(0deg); 898 } 899 } 900 901 @keyframes wag { 902 0% { 903 transform: rotate(0deg); 904 animation-timing-function: cubic-bezier(0.2, 0, 0.6, 1); 905 } 906 12% { 907 transform: rotate(var(--wag-angle, 12deg)); 908 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 909 } 910 24% { 911 transform: rotate(2deg); 912 animation-timing-function: cubic-bezier(0.2, 0, 0.6, 1); 913 } 914 36% { 915 transform: rotate(calc(var(--wag-angle, 12deg) * 0.85)); 916 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 917 } 918 48% { 919 transform: rotate(1deg); 920 animation-timing-function: cubic-bezier(0.2, 0, 0.6, 1); 921 } 922 58% { 923 transform: rotate(calc(var(--wag-angle, 12deg) * 0.6)); 924 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 925 } 926 68% { 927 transform: rotate(0deg); 928 } 929 100% { 930 transform: rotate(0deg); 931 } 932 } 933 934 @keyframes float { 935 0% { 936 transform: translateY(0) translateX(0) rotate(0deg) 937 scale(var(--float-squash-x, 1.02), var(--float-squash-y, 0.98)); 938 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33); 939 } 940 15% { 941 transform: translateY(calc(-0.4 * var(--float-height, 6px))) translateX(var(--float-drift, 1px)) 942 rotate(var(--float-tilt, 1deg)) scale(1, 1); 943 animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1); 944 } 945 35% { 946 transform: translateY(calc(-1 * var(--float-height, 6px))) translateX(0) rotate(0deg) 947 scale(var(--float-stretch-x, 0.98), var(--float-stretch-y, 1.03));
948 animation-timing-function: cubic-bezier(0.5, 0, 0.5, 0); 949 } 950 50% { 951 transform: translateY(calc(-0.92 * var(--float-height, 6px))) translateX(calc(-0.5 * var(--float-drift, 1px))) 952 rotate(calc(-0.5 * var(--float-tilt, 1deg))) scale(0.995, 1.01); 953 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 0.33); 954 } 955 70% { 956 transform: translateY(calc(-0.3 * var(--float-height, 6px))) translateX(calc(-1 * var(--float-drift, 1px))) 957 rotate(calc(-1 * var(--float-tilt, 1deg))) scale(1, 1); 958 animation-timing-function: cubic-bezier(0.33, 0.66, 0.66, 1); 959 } 960 90% { 961 transform: translateY(calc(0.05 * var(--float-height, 6px))) translateX(0) rotate(0deg) 962 scale(var(--float-squash-x, 1.02), var(--float-squash-y, 0.98)); 963 animation-timing-function: cubic-bezier(0.33, 0, 0.66, 1); 964 } 965 100% { 966 transform: translateY(0) translateX(0) rotate(0deg) 967 scale(var(--float-squash-x, 1.02), var(--float-squash-y, 0.98)); 968 } 969 } 970 971 @keyframes swing { 972 0% { 973 transform: rotate(0deg); 974 animation-timing-function: cubic-bezier(0.2, 0, 0.8, 1); 975 } 976 8% { 977 transform: rotate(var(--swing-angle, 22deg)); 978 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 979 } 980 18% { 981 transform: rotate(calc(-1 * var(--swing-angle, 22deg) * 0.85)); 982 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 983 } 984 28% { 985 transform: rotate(calc(var(--swing-angle, 22deg) * 0.65)); 986 animation-timing-function: cubic-bezier(0.35, 0, 0.65, 1); 987 } 988 38% { 989 transform: rotate(calc(-1 * var(--swing-angle, 22deg) * 0.45)); 990 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 991 } 992 48% { 993 transform: rotate(calc(var(--swing-angle, 22deg) * 0.25)); 994 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 995 } 996 56% { 997 transform: rotate(calc(-1 * var(--swing-angle, 22deg) * 0.1)); 998 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 999 } 1000 64% { 1001 transform: rotate(0deg); 1002 } 1003 100% { 1004 transform: rotate(0deg); 1005 } 1006 } 1007 1008 @keyframes jello { 1009 0% { 1010 transform: scale(1, 1); 1011 animation-timing-function: cubic-bezier(0.2, 0, 0.8, 1); 1012 } 1013 12% { 1014 transform: scale(var(--jello-scale-x, 1.15), calc(2 - var(--jello-scale-x, 1.15))); 1015 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 1016 } 1017 24% { 1018 transform: scale(calc(2 - var(--jello-scale-y, 1.12)), var(--jello-scale-y, 1.12)); 1019 animation-timing-function: cubic-bezier(0.3, 0, 0.7, 1); 1020 } 1021 36% { 1022 transform: scale( 1023 calc(1 + (var(--jello-scale-x, 1.15) - 1) * 0.5), 1024 calc(2 - (1 + (var(--jello-scale-x, 1.15) - 1) * 0.5)) 1025 ); 1026 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 1027 } 1028 48% { 1029 transform: scale( 1030 calc(2 - (1 + (var(--jello-scale-y, 1.12) - 1) * 0.3)), 1031 calc(1 + (var(--jello-scale-y, 1.12) - 1) * 0.3) 1032 ); 1033 animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); 1034 } 1035 58% { 1036 transform: scale(1.02, 0.98); 1037 animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); 1038 } 1039 68% { 1040 transform: scale(1, 1); 1041 } 1042 100% { 1043 transform: scale(1, 1); 1044 } 1045 } 1046 1047 /* #endregion */ 1048`,fe="",ge="";function be(){if(!ge){const e=document.querySelector("[data-fa-kit-code]");e&&(t=e.getAttribute("data-fa-kit-code")||"",ge=t)}var t;return ge}var ve="7.3.0";function we(t,e,i){const o=function(t,e,i){let o="solid";return"chisel"===e&&(o="chisel-regular"),"etch"===e&&(o="etch-solid"),"graphite"===e&&(o="graphite-thin"),"jelly"===e&&(o="jelly-regular","duo-regular"===i&&(o="jelly-duo-regular"),"fill-regular"===i&&(o="jelly-fill-regular")),"jelly-duo"===e&&(o="jelly-duo-regular"),"jelly-fill"===e&&(o="jelly-fill-regular"),"notdog"===e&&("solid"===i&&(o="notdog-solid"),"duo-solid"===i&&(o="notdog-duo-solid")),"notdog-duo"===e&&(o="notdog-duo-solid"),"slab"===e&&("solid"!==i&&"regular"!==i||(o="slab-regular"),"press-regular"===i&&(o="slab-press-regular")),"slab-press"===e&&(o="slab-press-regular"),"slab-duo"===e&&(o="slab-duo-regular"),"slab-press-duo"===e&&(o="slab-press-duo-regular"),"thumbprint"===e&&(o="thumbprint-light"),"utility"===e&&(o="utility-semibold"),"utility-duo"===e&&(o="utility-duo-semibold"),"utility-fill"===e&&(o="utility-fill-semibold"),"whiteboard"===e&&(o="whiteboard-semibold"),"mosaic"===e&&(o="mosaic-solid"),"pixel"===e&&(o="pixel-regular"),"vellum"===e&&(o="vellum-solid"),"classic"===e&&("thin"===i&&(o="thin"),"light"===i&&(o="light"),"regular"===i&&(o="regular"),"solid"===i&&(o="solid")),"duotone"===e&&("thin"===i&&(o="duotone-thin"),"light"===i&&(o="duotone-light"),"regular"===i&&(o="duotone-regular"),"solid"===i&&(o="duotone")),"sharp"===e&&("thin"===i&&(o="sharp-thin"),"light"===i&&(o="sharp-light"),"regular"===i&&(o="sharp-regular"),"solid"===i&&(o="sharp-solid")),"sharp-duotone"===e&&("thin"===i&&(o="sharp-duotone-thin"),"light"===i&&(o="sharp-duotone-light"),"regular"===i&&(o="sharp-duotone-regular"),"solid"===i&&(o="sharp-duotone-solid")),"brands"===e&&(o="brands"),o}(0,e,i),a=fe.replace(/\/$/,"");if(a)return`${a}/${o}/${t}.svg`;const s=be();return s.length>0?`https://ka-p.fontawesome.com/releases/v${ve}/svgs/${o}/${t}.svg?token=${encodeURIComponent(s)}`:`https://ka-f.fontawesome.com/releases/v${ve}/svgs/${o}/${t}.svg`}var ye={name:"default",resolver:(t,e="classic",i="solid")=>we(t,e,i),mutator:(t,e)=>{if(t.hasAttribute("fill")||t.setAttribute("fill","currentColor"),e?.family&&!t.hasAttribute("data-duotone-initialized")){const{family:i,variant:o}=e;if("duotone"===i||"sharp-duotone"===i||"notdog-duo"===i||"notdog"===i&&"duo-solid"===o||"jelly-duo"===i||"jelly"===i&&"duo-regular"===o||"utility-duo"===i||"slab-duo"===i||"slab-press-duo"===i||"thumbprint"===i){const i=[...t.querySelectorAll("path")],o=i.find(t=>
1048!t.hasAttribute("opacity")),a=i.find(t=>t.hasAttribute("opacity"));if(!o||!a)return;if(o.setAttribute("data-duotone-primary",""),a.setAttribute("data-duotone-secondary",""),e.swapOpacity&&o&&a){const t=a.getAttribute("opacity")||"0.4";o.style.setProperty("--path-opacity",t),a.style.setProperty("--path-opacity","1")}t.setAttribute("data-duotone-initialized","")}}}};var xe={solid:{"arrow-down":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"/></svg>',"arrow-up":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M214.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 109.3 160 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-370.7 105.4 105.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>',backward:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M236.3 107.1C247.9 96 265 92.9 279.7 99.2C294.4 105.5 304 120 304 136L304 272.3L476.3 107.2C487.9 96 505 92.9 519.7 99.2C534.4 105.5 544 120 544 136L544 504C544 520 534.4 534.5 519.7 540.8C505 547.1 487.9 544 476.3 532.9L304 367.7L304 504C304 520 294.4 534.5 279.7 540.8C265 547.1 247.9 544 236.3 532.9L44.3 348.9C36.5 341.3 32 330.9 32 320C32 309.1 36.5 298.7 44.3 291.1L236.3 107.1z"/></svg>',"backward-step":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M491 100.8C478.1 93.8 462.3 94.5 450 102.6L192 272.1L192 128C192 110.3 177.7 96 160 96C142.3 96 128 110.3 128 128L128 512C128 529.7 142.3 544 160 544C177.7 544 192 529.7 192 512L192 367.9L450 537.5C462.3 545.6 478 546.3 491 539.3C504 532.3 512 518.8 512 504.1L512 136.1C512 121.4 503.9 107.9 491 100.9z"/></svg>',bars:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2026 Fonticons, Inc. --\x3e<path d="M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"/></svg>',"angles-left":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M77.3 256 214.7 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256zm192 0L406.7 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L269.3 256z"/></svg>',"angles-right":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M434.7 256 297.3 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L434.7 256zm-192 0L105.3 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256z"/></svg>',check:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"/></svg>',"chevron-down":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/></svg>',"chevron-left":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"/></svg>',"chevron-right":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/></svg>',circle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z"/></svg>',"closed-captioning":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M64 192C64 156.7 92.7 128 128 128L512 128C547.3 128 576 156.7 576 192L576 448C576 483.3 547.3 512 512 512L128 512C92.7 512 64 483.3 64 448L64 192zM216 272L248 272C252.4 272 256 275.6 256 280C256 293.3 266.7 304 280 304C293.3 304 304 293.3 304 280C304 249.1 278.9 224 248 224L216 224C185.1 224 160 249.1 160 280L160 360C160 390.9 185.1 416 216 416L248 416C278.9 416 304 390.9 304 360C304 346.7 293.3 336 280 336C266.7 336 256 346.7 256 360C256 364.4 252.4 368 248 368L216 368C211.6 368 208 364.4 208 360L208 280C208 275.6 211.6 272 216 272zM384 280C384 275.6 387.6 272 392 272L424 272C428.4 272 432 275.6 432 280C432 293.3 442.7 304 456 304C469.3 304 480 293.3 480 280C480 249.1 454.9 224 424 224L392 224C361.1 224 336 249.1 336 280L336 360C336 39
10480.9 361.1 416 392 416L424 416C454.9 416 480 390.9 480 360C480 346.7 469.3 336 456 336C442.7 336 432 346.7 432 360C432 364.4 428.4 368 424 368L392 368C387.6 368 384 364.4 384 360L384 280z"/></svg>',"closed-captioning-slash":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M39 39.1C48.4 29.7 63.6 29.7 72.9 39.1L161.8 128L512 128C547.3 128 576 156.7 576 192L576 448C576 473.5 561.1 495.4 539.6 505.8L601 567.1C610.4 576.5 610.4 591.7 601 601C591.6 610.3 576.4 610.4 567.1 601L39 73.1C29.7 63.7 29.7 48.5 39 39.1zM384 350.1L384 279.9C384 275.5 387.6 271.9 392 271.9L424 271.9C428.4 271.9 432 275.5 432 279.9C432 293.2 442.7 303.9 456 303.9C469.3 303.9 480 293.2 480 279.9C480 249 454.9 223.9 424 223.9L392 223.9C361.1 223.9 336 249 336 279.9L336 302.1L384 350.1zM445.5 411.6C465.7 403.2 480 383.2 480 359.9C480 346.6 469.3 335.9 456 335.9C442.7 335.9 432 346.6 432 359.9C432 364.3 428.4 367.9 424 367.9L401.8 367.9L445.5 411.6zM162.3 264.1C160.8 269.1 160 274.5 160 280L160 360C160 390.9 185.1 416 216 416L248 416C266.1 416 282.1 407.5 292.4 394.2L410.2 512L128 512C92.7 512 64 483.3 64 448L64 192C64 184.2 65.4 176.7 68 169.8L162.3 264.1zM256.1 357.9C256 358.6 256 359.3 256 360C256 364.4 252.4 368 248 368L216 368C211.6 368 208 364.4 208 360L208 309.8L256.1 357.9z"/></svg>',compress:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M160 64c0-17.7-14.3-32-32-32S96 46.3 96 64l0 64-64 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c17.7 0 32-14.3 32-32l0-96zM32 320c-17.7 0-32 14.3-32 32s14.3 32 32 32l64 0 0 64c0 17.7 14.3 32 32 32s32-14.3 32-32l0-96c0-17.7-14.3-32-32-32l-96 0zM352 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32l96 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-64 0 0-64zM320 320c-17.7 0-32 14.3-32 32l0 96c0 17.7 14.3 32 32 32s32-14.3 32-32l0-64 64 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0z"/></svg>',ellipsis:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M96 320C96 289.1 121.1 264 152 264C182.9 264 208 289.1 208 320C208 350.9 182.9 376 152 376C121.1 376 96 350.9 96 320zM264 320C264 289.1 289.1 264 320 264C350.9 264 376 289.1 376 320C376 350.9 350.9 376 320 376C289.1 376 264 350.9 264 320zM488 264C518.9 264 544 289.1 544 320C544 350.9 518.9 376 488 376C457.1 376 432 350.9 432 320C432 289.1 457.1 264 488 264z"/></svg>',"ellipsis-vertical":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M320 208C289.1 208 264 182.9 264 152C264 121.1 289.1 96 320 96C350.9 96 376 121.1 376 152C376 182.9 350.9 208 320 208zM320 432C350.9 432 376 457.1 376 488C376 518.9 350.9 544 320 544C289.1 544 264 518.9 264 488C264 457.1 289.1 432 320 432zM376 320C376 350.9 350.9 376 320 376C289.1 376 264 350.9 264 320C264 289.1 289.1 264 320 264C350.9 264 376 289.1 376 320z"/></svg>',expand:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 96C110.3 96 96 110.3 96 128L96 224C96 241.7 110.3 256 128 256C145.7 256 160 241.7 160 224L160 160L224 160C241.7 160 256 145.7 256 128C256 110.3 241.7 96 224 96L128 96zM160 416C160 398.3 145.7 384 128 384C110.3 384 96 398.3 96 416L96 512C96 529.7 110.3 544 128 544L224 544C241.7 544 256 529.7 256 512C256 494.3 241.7 480 224 480L160 480L160 416zM416 96C398.3 96 384 110.3 384 128C384 145.7 398.3 160 416 160L480 160L480 224C480 241.7 494.3 256 512 256C529.7 256 544 241.7 544 224L544 128C544 110.3 529.7 96 512 96L416 96zM544 416C544 398.3 529.7 384 512 384C494.3 384 480 398.3 480 416L480 480L416 480C398.3 480 384 494.3 384 512C384 529.7 398.3 544 416 544L512 544C529.7 544 544 529.7 544 512L544 416z"/></svg>',eyedropper:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M341.6 29.2l-101.6 101.6-9.4-9.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-9.4-9.4 101.6-101.6c39-39 39-102.2 0-141.1s-102.2-39-141.1 0zM
104855.4 323.3c-15 15-23.4 35.4-23.4 56.6l0 42.4-26.6 39.9c-8.5 12.7-6.8 29.6 4 40.4s27.7 12.5 40.4 4l39.9-26.6 42.4 0c21.2 0 41.6-8.4 56.6-23.4l109.4-109.4-45.3-45.3-109.4 109.4c-3 3-7.1 4.7-11.3 4.7l-36.1 0 0-36.1c0-4.2 1.7-8.3 4.7-11.3l109.4-109.4-45.3-45.3-109.4 109.4z"/></svg>',filter:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M32 64C19.1 64 7.4 71.8 2.4 83.8S.2 109.5 9.4 118.6L192 301.3 192 416c0 8.5 3.4 16.6 9.4 22.6l64 64c9.2 9.2 22.9 11.9 34.9 6.9S320 492.9 320 480l0-178.7 182.6-182.6c9.2-9.2 11.9-22.9 6.9-34.9S492.9 64 480 64L32 64z"/></svg>',forward:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M403.7 107.1C392.1 96 375 92.9 360.3 99.2C345.6 105.5 336 120 336 136L336 272.3L163.7 107.2C152.1 96 135 92.9 120.3 99.2C105.6 105.5 96 120 96 136L96 504C96 520 105.6 534.5 120.3 540.8C135 547.1 152.1 544 163.7 532.9L336 367.7L336 504C336 520 345.6 534.5 360.3 540.8C375 547.1 392.1 544 403.7 532.9L595.7 348.9C603.6 341.4 608 330.9 608 320C608 309.1 603.5 298.7 595.7 291.1L403.7 107.1z"/></svg>',file:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M192 64C156.7 64 128 92.7 128 128L128 512C128 547.3 156.7 576 192 576L448 576C483.3 576 512 547.3 512 512L512 234.5C512 217.5 505.3 201.2 493.3 189.2L386.7 82.7C374.7 70.7 358.5 64 341.5 64L192 64zM453.5 240L360 240C346.7 240 336 229.3 336 216L336 122.5L453.5 240z"/></svg>',"file-audio":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM389.8 307.7C380.7 301.4 368.3 303.6 362 312.7C355.7 321.8 357.9 334.2 367 340.5C390.9 357.2 406.4 384.8 406.4 416C406.4 447.2 390.8 474.9 367 491.5C357.9 497.8 355.7 510.3 362 519.3C368.3 528.3 380.8 530.6 389.8 524.3C423.9 500.5 446.4 460.8 446.4 416C446.4 371.2 424 331.5 389.8 307.7zM208 376C199.2 376 192 383.2 192 392L192 440C192 448.8 199.2 456 208 456L232 456L259.2 490C262.2 493.8 266.8 496 271.7 496L272 496C280.8 496 288 488.8 288 480L288 352C288 343.2 280.8 336 272 336L271.7 336C266.8 336 262.2 338.2 259.2 342L232 376L208 376zM336 448.2C336 458.9 346.5 466.4 354.9 459.8C367.8 449.5 376 433.7 376 416C376 398.3 367.8 382.5 354.9 372.2C346.5 365.5 336 373.1 336 383.8L336 448.3z"/></svg>',"file-code":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM282.2 359.6C290.8 349.5 289.7 334.4 279.6 325.8C269.5 317.2 254.4 318.3 245.8 328.4L197.8 384.4C190.1 393.4 190.1 406.6 197.8 415.6L245.8 471.6C254.4 481.7 269.6 482.8 279.6 474.2C289.6 465.6 290.8 450.4 282.2 440.4L247.6 400L282.2 359.6zM394.2 328.4C385.6 318.3 370.4 317.2 360.4 325.8C350.4 334.4 349.2 349.6 357.8 359.6L392.4 400L357.8 440.4C349.2 450.5 350.3 465.6 360.4 474.2C370.5 482.8 385.6 481.7 394.2 471.6L442.2 415.6C449.9 406.6 449.9 393.4 442.2 384.4L394.2 328.4z"/></svg>',"file-excel":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM292 330.7C284.6 319.7 269.7 316.7 258.7 324C247.7 331.3 244.7 346.3 252 357.3L291.2 416L252 474.7C244.6 485.7 247.6 500.6 258.7 508C269.8 515.4 284.6 512.4 292 501.3L320 459.3L348 501.3C355.4 512.3 370.3 515.3 381.3 508C392.3 500.7 395.3 485.7 388 474.7L348.8 416L388 357.3C395.4 346.3 392.4 331.4 381.3 324C370.2 316.6 355.4 319.6 348 330.7L320 372.7L292 330.7z"/></svg>',"file-image":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM256 320C256 302.3 241.7 288 224 288C206.3 288 192 302.3 192 320C192 337.7 206.3 352 224 352C241.7 352 256 337.7 256 320zM220.6 512L419.4 512C435.2 512 448 499.2 448 483.4C448 476.1 445.2 469 440.1 463.7L343.3 361.9C337.3 355.6 328.9 352 320.1 352L319.8 352C311 352 302.7 355.6 296.6 361.9L199.9 463.7C194.8 469 192 476.1 192 483.4C192 499.2 204.8 512 220.6 512z"/></svg>',"file-pdf":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 64C92.7 64 64 92.7 64 128L64 512C64 547.3 92.7 576 128 576L208 576L208 464C208 428.7 23
10486.7 400 272 400L448 400L448 234.5C448 217.5 441.3 201.2 429.3 189.2L322.7 82.7C310.7 70.7 294.5 64 277.5 64L128 64zM389.5 240L296 240C282.7 240 272 229.3 272 216L272 122.5L389.5 240zM272 444C261 444 252 453 252 464L252 592C252 603 261 612 272 612C283 612 292 603 292 592L292 564L304 564C337.1 564 364 537.1 364 504C364 470.9 337.1 444 304 444L272 444zM304 524L292 524L292 484L304 484C315 484 324 493 324 504C324 515 315 524 304 524zM400 444C389 444 380 453 380 464L380 592C380 603 389 612 400 612L432 612C460.7 612 484 588.7 484 560L484 496C484 467.3 460.7 444 432 444L400 444zM420 572L420 484L432 484C438.6 484 444 489.4 444 496L444 560C444 566.6 438.6 572 432 572L420 572zM508 464L508 592C508 603 517 612 528 612C539 612 548 603 548 592L548 548L576 548C587 548 596 539 596 528C596 517 587 508 576 508L548 508L548 484L576 484C587 484 596 475 596 464C596 453 587 444 576 444L528 444C517 444 508 453 508 464z"/></svg>',"file-powerpoint":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM280 320C266.7 320 256 330.7 256 344L256 488C256 501.3 266.7 512 280 512C293.3 512 304 501.3 304 488L304 464L328 464C367.8 464 400 431.8 400 392C400 352.2 367.8 320 328 320L280 320zM328 416L304 416L304 368L328 368C341.3 368 352 378.7 352 392C352 405.3 341.3 416 328 416z"/></svg>',"file-video":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM208 368L208 464C208 481.7 222.3 496 240 496L336 496C353.7 496 368 481.7 368 464L368 440L403 475C406.2 478.2 410.5 480 415 480C424.4 480 432 472.4 432 463L432 368.9C432 359.5 424.4 351.9 415 351.9C410.5 351.9 406.2 353.7 403 356.9L368 391.9L368 367.9C368 350.2 353.7 335.9 336 335.9L240 335.9C222.3 335.9 208 350.2 208 367.9z"/></svg>',"file-word":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM263.4 338.8C260.5 325.9 247.7 317.7 234.8 320.6C221.9 323.5 213.7 336.3 216.6 349.2L248.6 493.2C250.9 503.7 260 511.4 270.8 512C281.6 512.6 291.4 505.9 294.8 495.6L320 419.9L345.2 495.6C348.6 505.8 358.4 512.5 369.2 512C380 511.5 389.1 503.8 391.4 493.2L423.4 349.2C426.3 336.3 418.1 323.4 405.2 320.6C392.3 317.8 379.4 325.9 376.6 338.8L363.4 398.2L342.8 336.4C339.5 326.6 330.4 320 320 320C309.6 320 300.5 326.6 297.2 336.4L276.6 398.2L263.4 338.8z"/></svg>',"file-zipper":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M128 128C128 92.7 156.7 64 192 64L341.5 64C358.5 64 374.8 70.7 386.8 82.7L493.3 189.3C505.3 201.3 512 217.6 512 234.6L512 512C512 547.3 483.3 576 448 576L192 576C156.7 576 128 547.3 128 512L128 128zM336 122.5L336 216C336 229.3 346.7 240 360 240L453.5 240L336 122.5zM192 136C192 149.3 202.7 160 216 160L264 160C277.3 160 288 149.3 288 136C288 122.7 277.3 112 264 112L216 112C202.7 112 192 122.7 192 136zM192 232C192 245.3 202.7 256 216 256L264 256C277.3 256 288 245.3 288 232C288 218.7 277.3 208 264 208L216 208C202.7 208 192 218.7 192 232zM256 304L224 304C206.3 304 192 318.3 192 336L192 384C192 410.5 213.5 432 240 432C266.5 432 288 410.5 288 384L288 336C288 318.3 273.7 304 256 304zM240 368C248.8 368 256 375.2 256 384C256 392.8 248.8 400 240 400C231.2 400 224 392.8 224 384C224 375.2 231.2 368 240 368z"/></svg>',"forward-step":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M21 36.8c12.9-7 28.7-6.3 41 1.8L320 208.1 320 64c0-17.7 14.3-32 32-32s32 14.3 32 32l0 384c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-144.1-258 169.6c-12.3 8.1-28 8.8-41 1.8S0 454.7 0 440L0 72C0 57.3 8.1 43.8 21 36.8z"/></svg>',gauge:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm320 96c0-26.9-16.5-49.9-40-59.3L280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 172.7c-23.5 9.5-40 32.5-40 59.3 0 35.3 28.7 64 64 64s64-28.7 64-64zM144 176a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm-16 80a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm288 32a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM400 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>',gear:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M259.1 73.5C262.1 58.7 275.2 48 290.4 48L350.2 48C365.4 48 378.5 58.7 381.5 73.5L396 143.5C410.1 149.5 423.3 157.2 435.3 166.3L503.1 143.8C517.5 139 533.3 145 540.9 158.2L570.8 210C578.4 223.2 575.7 239.8 564.3 249.9L511 297.3C511.9 304.7 512.3 312.3 512.3 320C512.3 327.7 511.8 335.3 511 342.7L564.4 390.2C575.8 400.3 578.4 417 570.9 430.1L541 481.9C533.4 495 517.6 501.1 503.2 496.3L435.4 473.8C423.3 482.9 410.1 490.5 396.1 496.6L381.7 566.5C378.6 581.4 365.5 592 350.4 592L290.6 592C275.4 592 262.3 581.3 259.3 566.5L244.9 496.6C230.8 490.6 217.7 482.9 205.6 473.8L137.5 496.3C123.1 501.1 107.3 495.1 99.7 481.9L69.8 430.1C62.2 416.9 64.9 400.3 76.3 390.2L129.7 342.7C128.8 335.3 128.4 327.7 128.4 320C128.4 312.3 128.9 304.7 129.7 297.3L76.3 249.8C64.9 239.7 62.3 223 69.8 209.9L99.7 158.1C107.3 144.9 123.1 138.9 137.5 143.7L205.3 166.2C217.4 157.1 230.6 149.5 244.6 143.4L259.1 73.5zM320.3 400C364.5 399.8 400.2 363.9 400 319.7C399.8 275.5 363.9 239.8 319.7 240C275.5 240.2 239.8 276.1 240 320.3C240.2 364.5 276.1 400.2 320.3 400z"/></svg>',"grip-vertical":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M128 40c0-22.1-17.9-40-40-40L40 0C17.9 0 0 17.9 0 40L0 88c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zm0 192c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM0 424l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 40c0-22.1-17.9-40-40-40L232 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48zM192 232l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40zM320 424c0-22.1-17.9-40-40-40l-48 0c-22.1 0-40 17.9-40 40l0 48c0 22.1 17.9 40 40 40l48 0c22.1 0 40-17.9 40-40l0-48z"/></svg>',indeterminate:'<svg part="indeterminate-icon" class="icon" viewB
1048ox="0 0 16 16"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round"><g stroke="currentColor" stroke-width="2"><g transform="translate(2.285714 6.857143)"><path d="M10.2857143,1.14285714 L1.14285714,1.14285714"/></g></g></g></svg>',"magnifying-glass":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>',minus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32z"/></svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z"/></svg>',"picture-in-picture":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M448 32c35.3 0 64 28.7 64 64l0 112-64 0 0-112-384 0 0 320 144 0 0 64-144 0-6.5-.3c-30.1-3.1-54.1-27-57.1-57.1L0 416 0 96C0 62.9 25.2 35.6 57.5 32.3L64 32 448 32zm16 224c26.5 0 48 21.5 48 48l0 128c0 26.5-21.5 48-48 48l-160 0c-26.5 0-48-21.5-48-48l0-128c0-26.5 21.5-48 48-48l160 0z"/></svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"/></svg>',"play-circle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9l0 176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z"/></svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M352 128C352 110.3 337.7 96 320 96C302.3 96 288 110.3 288 128L288 288L128 288C110.3 288 96 302.3 96 320C96 337.7 110.3 352 128 352L288 352L288 512C288 529.7 302.3 544 320 544C337.7 544 352 529.7 352 512L352 352L512 352C529.7 352 544 337.7 544 320C544 302.3 529.7 288 512 288L352 288L352 128z"/></svg>',star:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z"/></svg>',"table-columns":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 128 0 0-256-128 0zm320 0l-128 0 0 256 128 0 0-256z"/></svg>',thumbtack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M32 32C32 14.3 46.3 0 64 0L320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-29.5 0 10.3 134.1c37.1 21.2 65.8 56.4 78.2 99.7l3.8 13.4c2.8 9.7 .8 20-5.2 28.1S362 352 352 352L32 352c-10 0-19.5-4.7-25.5-12.7s-8-18.4-5.2-28.1L5 297.8c12.4-43.3 41-78.5 78.2-99.7L93.5 64 64 64C46.3 64 32 49.7 32 32zM160 400l64 0 0 112c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-112z"/></svg>',"up-down":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M406.6 502.6l96-96c9.2-9.2 11.9-22.9 6.9-34.9S492.9 352 480 352l-64 0 0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 320-64 0c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l96 96c12.5 12.5 32.8 12.5 45.3 0zM150.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-9.2 9.2-11.9 22.9-6.9 34.9S19.1 160 32 160l64 0 0 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320 64 0c12.9 0 24.6-7.8 29.6-19.8s2.2-25.7-6.9-34.9l-96-96z"/></svg>',upload:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M352 173.3L352 384C352 401.7 337.7 416 320 416C302.3 416 288 401.7 288 384L288 173.3L246.6 214.7C234.1 227.2 213.8 227.2 201.3 214.7C188.8 202.2 188.8 181.9 201.3 169.4L297.3 73.4C309.8 60.9 330.1 60.9 342.6 73.4L438.6 169.4C451.1 181.9 451.1 202.2 438.6 214.7C426.1 227.2 405.8 227.2 393.3 214.7L352 173.3zM320 464C364.2 464 400 428.2 400 384L480 384C515.3 384 544 412.7 544 448L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 448C96 412.7 124.7 384 160 384L240 384C240 428.2 275.8 464 320 464zM464 488C477.3 488 488 477.3 488 464C488 450.7 477.3 440 464 440C450.7 440 440 450.7 440 464C440 477.3 450.7 488 464 488z"/></svg>',user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z"/></svg>',volume:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM441.1 107c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C443.3 170.7 464 210.9 464 256s-20.7 85.3-53.2 111.8c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5c43.2-35.2 70.9-88.9 70.9-149s-27.7-113.8-70.9-149zm-60.5 74.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C361.1 227.6 368 241 368 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C402.1 312.9 416 286.1 416 256s-13.9-56.9-35.5-74.5z"/></svg>',"volume-low":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM380.6 181.5c-10.3-8.4-25.4-6.8-33.8 3.5s-6.8 25.4 3.5 33.8C361.1 227.6 368 241 368 256s-6.9 28.4-17.7 37.3c-10.3 8.4-11.8 23.5-3.5 33.8s23.5 11.8 33.8 3.5C402.1 312.9 416 286.1 416 256s-13.9-56.9-35.5-74.5z"/></svg>',"volume-xmark":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M48 352l48 0 134.1 119.2c6.4 5.7 14.6 8.8 23.1 8.8 19.2 0 34.8-15.6 34.8-34.8l0-378.4c0-19.2-15.6-34.8-34.8-34.8-8.5 0-16.7 3.1-23.1 8.8L96 160 48 160c-26.5 0-48 21.5-48 48l0 96c0 26.5 21.5 48 48 48zM367 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"/></svg>',xmark:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"/></svg>'},regular:{calendar:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M216 64C229.3 64 240 74.7 240 88L240 128L400 128L400 88C400 74.7 410.7 64 424 64C437.3 64 448 74.7 448 88L448 128L480 128C515.3 128 544 156.7 544 192L544 480C544 515.3 515.3 544 480 544L160 544C124.7 544 96 515.3 96 480L96 192C96 156.7 124.7 128 160 128L192 128L192 88C192 74.7 202.7 64 216 64zM216 176L160 176C151.2 176 144 183.2 144 192L144 240L496 240L496 192C496 183.2 488.8 176 480 176L216 176zM144 288L144 480C144 488.8 151.2 496 160 496L480 496C488.8 496 496 488.8 496 480L496 288L144 288z"/></svg>',"circle-question":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M464 256a208 208 0 1 0 -416 0 208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zm256-80c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 47.2-36 67.2-56 74.5l0 3.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8.1c0-20.5 14.8-35.2 30.1-40.2 6.4-2.1 13.2-5.5 18.2-10.3 4.3-4.2 7.7-10 7.7-19.6 0-17.7-14.3-32-32-32zM224 368a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>',"circle-xmark":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c-9.4 9.4-9.4 24.6 0 33.9l55 55-55 55c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l55-55 55 55c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-55-55 55-
104855c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-55 55-55-55c-9.4-9.4-24.6-9.4-33.9 0z"/></svg>',clock:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\x3c!--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--\x3e<path d="M528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112C434.9 112 528 205.1 528 320zM64 320C64 461.4 178.6 576 320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320zM296 184L296 320C296 328 300 335.5 306.7 340L402.7 404C413.7 411.4 428.6 408.4 436 397.3C443.4 386.2 440.4 371.4 429.3 364L344 307.2L344 184C344 170.7 333.3 160 320 160C306.7 160 296 170.7 296 184z"/></svg>',copy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M384 336l-192 0c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l133.5 0c4.2 0 8.3 1.7 11.3 4.7l58.5 58.5c3 3 4.7 7.1 4.7 11.3L400 320c0 8.8-7.2 16-16 16zM192 384l192 0c35.3 0 64-28.7 64-64l0-197.5c0-17-6.7-33.3-18.7-45.3L370.7 18.7C358.7 6.7 342.5 0 325.5 0L192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-16-48 0 0 16c0 8.8-7.2 16-16 16L64 464c-8.8 0-16-7.2-16-16l0-256c0-8.8 7.2-16 16-16l16 0 0-48-16 0z"/></svg>',eye:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M288 80C222.8 80 169.2 109.6 128.1 147.7 89.6 183.5 63 226 49.4 256 63 286 89.6 328.5 128.1 364.3 169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256 513 226 486.4 183.5 447.9 147.7 406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1 3.3 7.9 3.3 16.7 0 24.6-14.9 35.7-46.2 87.7-93 131.1-47.1 43.7-111.8 80.6-192.6 80.6S142.5 443.2 95.4 399.4c-46.8-43.5-78.1-95.4-93-131.1-3.3-7.9-3.3-16.7 0-24.6 14.9-35.7 46.2-87.7 93-131.1zM288 336c44.2 0 80-35.8 80-80 0-29.6-16.1-55.5-40-69.3-1.4 59.7-49.6 107.9-109.3 109.3 13.8 23.9 39.7 40 69.3 40zm-79.6-88.4c2.5 .3 5 .4 7.6 .4 35.3 0 64-28.7 64-64 0-2.6-.2-5.1-.4-7.6-37.4 3.9-67.2 33.7-71.1 71.1zm45.6-115c10.8-3 22.2-4.5 33.9-4.5 8.8 0 17.5 .9 25.8 2.6 .3 .1 .5 .1 .8 .2 57.9 12.2 101.4 63.7 101.4 125.2 0 70.7-57.3 128-128 128-61.6 0-113-43.5-125.2-101.4-1.8-8.6-2.8-17.5-2.8-26.6 0-11 1.4-21.8 4-32 .2-.7 .3-1.3 .5-1.9 11.9-43.4 46.1-77.6 89.5-89.5z"/></svg>',"eye-slash":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM176.9 111.1c32.1-18.9 69.2-31.1 111.1-31.1 65.2 0 118.8 29.6 159.9 67.7 38.5 35.7 65.1 78.3 78.6 108.3-13.6 30-40.2 72.5-78.6 108.3-3.1 2.8-6.2 5.6-9.4 8.4L393.8 328c14-20.5 22.2-45.3 22.2-72 0-70.7-57.3-128-128-128-26.7 0-51.5 8.2-72 22.2l-39.1-39.1zm182 182l-108-108c11.1-5.8 23.7-9.1 37.1-9.1 44.2 0 80 35.8 80 80 0 13.4-3.3 26-9.1 37.1zM103.4 173.2l-34-34c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6L352.2 422c-20 6.4-41.4 10-64.2 10-65.2 0-118.8-29.6-159.9-67.7-38.5-35.7-65.1-78.3-78.6-108.3 10.4-23.1 28.6-53.6 54-82.8z"/></svg>',star:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc. --\x3e<path d="M288.1-32c9 0 17.3 5.1 21.4 13.1L383 125.3 542.9 150.7c8.9 1.4 16.3 7.7 19.1 16.3s.5 18-5.8 24.4L441.7 305.9 467 465.8c1.4 8.9-2.3 17.9-9.6 23.2s-17 6.1-25 2L288.1 417.6 143.8 491c-8 4.1-17.7 3.3-25-2s-11-14.2-9.6-23.2L134.4 305.9 20 191.4c-6.4-6.4-8.6-15.8-5.8-24.4s10.1-14.9 19.1-16.3l159.9-25.4 73.6-144.2c4.1-8 12.4-13.1 21.4-13.1zm0 76.8L230.3 158c-3.5 6.8-10 11.6-17.6 12.8l-125.5 20 89.8 89.9c5.4 5.4 7.9 13.1 6.7 20.7l-19.8 125.5 113.3-57.6c6.8-3.5 14.9-3.5 21.8 0l113.3 57.6-19.8-125.5c-1.2-7.6 1.3-15.3 6.7-20.7l89.8-89.9-125.5-20c-7.6-1.2-14.1-6-17.6-12.8L288.1 44.8z"/></svg>'}},ke="classic",Ce=[ye,{name:"system",resolver:(t,e="classic",i="solid")=>{let o=xe[i][t]??xe.regular[t]??xe.regular["circle-question"];return o?function(t){return`data:image/svg+xml,${encodeURIComponent(t)}`}(o):""},mutator:t=>{t.hasAttribute("fill")||t.setAttribute("fill","currentColor")}}],Se=new Set;function _e(t){return Ce.find(e=>e.name===t)}const{I:Ee}=ut,Ae={};var $e,Le=Symbol(),De=Symbol(),Me=new Map,ze=class extends Ft{constructor(){super(...arguments),this.svg=null,this.autoWidth=!1,this.swapOpacity=!1,this.label="",this.library="default",this.rotate=0,this.resolveIcon=async(t,e)=>{let i;if(e?.spriteSheet){this.hasUpdated||await this.updateComplete,this.svg=K`<svg part="svg"> 1049 <use part="use" href="${t}"></use> 1050 </svg>`,await this.updateComplete;const i=this.shadowRoot.querySelector("[part='svg']");return"function"==typeof e.mutator&&e.mutator(i,this),this.svg}try{if(i=await fetch(t,{mode:"cors"}),!i.ok)return 410===i.status?Le:De}catch{return De}try{const t=document.createElement("div");t.innerHTML=await i.text();const e=t.firstElementChild;if("svg"!==e?.tagName?.toLowerCase())return Le;$e||($e=new DOMParser);const o=$e.parseFromString(e.outerHTML,"text/html").body.querySelector("svg");return o?(o.part.add("svg"),document.adoptNode(o)):Le}catch{return Le}}}connectedCallback(){var t;super.connectedCallback(),t=this,Se.add(t)}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("rotate")&&this.style.setProperty("--rotate-angle",`${this.rotate}deg`),this.setIcon()}disconnectedCallback(){var t;super.disconnectedCallback(),t=this,Se.delete(t)}async getIconSource(){const t=_e(this.library),e=this.family||ke;if(this.name&&t){const i="auto"===this.canvas||this.autoWidth;let o;try{o=await t.resolver(this.name,e,this.variant,i)}catch{o=void 0}return{url:o,fromLibrary:!0}}return{url:this.src,fromLibrary:!1}}handleLabelChange(){"string"==typeof this.label&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){const{url:t,fromLibrary:e}=await this.getIconSource(),i=e?_e(this.library):void 0;if(!t)return void(this.svg=null);let o=Me.get(t);o||(o=this.resolveIcon(t,i),Me.set(t,o));const a=await o;a===De&&Me.delete(t);if(t===(await this.getIconSource()).url)if(((t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e)(a))this.svg=a;else switch(a){case De:case Le:this.svg=null,this.dispatchEvent(new ue);break;default:this.svg=a.cloneNode(!0),i?.mutator?.(this.svg,this),this.dispatchEvent(new pe)}}willUpdate(t){return this.style||this.setStyleProperty("--rotate-angle",`${this.rotate}deg`),super.willUpdate(t)}updated(t){super.updated(t);const e=_e(this.library);this.hasAttribute("rotate")&&this.style.setProperty("--rotate-angle",`${this.rotate}deg`);const i=this.shadowRoot?.querySelector("svg");i&&e?.mutator?.(i,this)}render(){return this.hasUpdated?this.svg:K`<svg part="svg" width="16" height="16" viewB
1050ox="0 0 16 16"></svg>`}};ze.css=me,kt([$t()],ze.prototype,"svg",2),kt([At({reflect:!0})],ze.prototype,"name",2),kt([At({reflect:!0})],ze.prototype,"family",2),kt([At({reflect:!0})],ze.prototype,"variant",2),kt([At({reflect:!0})],ze.prototype,"canvas",2),kt([At({attribute:"auto-width",type:Boolean,reflect:!0})],ze.prototype,"autoWidth",2),kt([At({attribute:"swap-opacity",type:Boolean,reflect:!0})],ze.prototype,"swapOpacity",2),kt([At()],ze.prototype,"src",2),kt([At()],ze.prototype,"label",2),kt([At({reflect:!0})],ze.prototype,"library",2),kt([At({type:Number,reflect:!0})],ze.prototype,"rotate",2),kt([At({type:String,reflect:!0})],ze.prototype,"flip",2),kt([At({type:String,reflect:!0})],ze.prototype,"animation",2),kt([vt("label")],ze.prototype,"handleLabelChange",1),kt([vt(["family","name","library","variant","src","autoWidth","canvas","swapOpacity"],{waitUntilFirstUpdate:!0})],ze.prototype,"setIcon",1),ze=kt([St("wa-icon")],ze);var Te=h` 1051 :where(:root), 1052 .wa-neutral, 1053 :host([variant='neutral']) { 1054 --wa-color-fill-loud: var(--wa-color-neutral-fill-loud); 1055 --wa-color-fill-normal: var(--wa-color-neutral-fill-normal); 1056 --wa-color-fill-quiet: var(--wa-color-neutral-fill-quiet); 1057 --wa-color-border-loud: var(--wa-color-neutral-border-loud); 1058 --wa-color-border-normal: var(--wa-color-neutral-border-normal); 1059 --wa-color-border-quiet: var(--wa-color-neutral-border-quiet); 1060 --wa-color-on-loud: var(--wa-color-neutral-on-loud); 1061 --wa-color-on-normal: var(--wa-color-neutral-on-normal); 1062 --wa-color-on-quiet: var(--wa-color-neutral-on-quiet); 1063 } 1064 1065 .wa-brand, 1066 :host([variant='brand']) { 1067 --wa-color-fill-loud: var(--wa-color-brand-fill-loud); 1068 --wa-color-fill-normal: var(--wa-color-brand-fill-normal); 1069 --wa-color-fill-quiet: var(--wa-color-brand-fill-quiet); 1070 --wa-color-border-loud: var(--wa-color-brand-border-loud); 1071 --wa-color-border-normal: var(--wa-color-brand-border-normal); 1072 --wa-color-border-quiet: var(--wa-color-brand-border-quiet); 1073 --wa-color-on-loud: var(--wa-color-brand-on-loud); 1074 --wa-color-on-normal: var(--wa-color-brand-on-normal); 1075 --wa-color-on-quiet: var(--wa-color-brand-on-quiet); 1076 } 1077 1078 .wa-success, 1079 :host([variant='success']) { 1080 --wa-color-fill-loud: var(--wa-color-success-fill-loud); 1081 --wa-color-fill-normal: var(--wa-color-success-fill-normal); 1082 --wa-color-fill-quiet: var(--wa-color-success-fill-quiet); 1083 --wa-color-border-loud: var(--wa-color-success-border-loud); 1084 --wa-color-border-normal: var(--wa-color-success-border-normal); 1085 --wa-color-border-quiet: var(--wa-color-success-border-quiet); 1086 --wa-color-on-loud: var(--wa-color-success-on-loud); 1087 --wa-color-on-normal: var(--wa-color-success-on-normal); 1088 --wa-color-on-quiet: var(--wa-color-success-on-quiet); 1089 } 1090 1091 .wa-warning, 1092 :host([variant='warning']) { 1093 --wa-color-fill-loud: var(--wa-color-warning-fill-loud); 1094 --wa-color-fill-normal: var(--wa-color-warning-fill-normal); 1095 --wa-color-fill-quiet: var(--wa-color-warning-fill-quiet); 1096 --wa-color-border-loud: var(--wa-color-warning-border-loud); 1097 --wa-color-border-normal: var(--wa-color-warning-border-normal); 1098 --wa-color-border-quiet: var(--wa-color-warning-border-quiet); 1099 --wa-color-on-loud: var(--wa-color-warning-on-loud); 1100 --wa-color-on-normal: var(--wa-color-warning-on-normal); 1101 --wa-color-on-quiet: var(--wa-color-warning-on-quiet); 1102 } 1103 1104 .wa-danger, 1105 :host([variant='danger']) { 1106 --wa-color-fill-loud: var(--wa-color-danger-fill-loud); 1107 --wa-color-fill-normal: var(--wa-color-danger-fill-normal); 1108 --wa-color-fill-quiet: var(--wa-color-danger-fill-quiet); 1109 --wa-color-border-loud: var(--wa-color-danger-border-loud); 1110 --wa-color-border-normal: var(--wa-color-danger-border-normal); 1111 --wa-color-border-quiet: var(--wa-color-danger-border-quiet); 1112 --wa-color-on-loud: var(--wa-color-danger-on-loud); 1113 --wa-color-on-normal: var(--wa-color-danger-on-normal); 1114 --wa-color-on-quiet: var(--wa-color-danger-on-quiet); 1115 } 1116`,Oe=h` 1117 :host { 1118 --pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud)); 1119 1120 display: inline-flex;
1121 align-items: center; 1122 justify-content: center; 1123 padding: 0.375em 0.625em; 1124 color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud)); 1125 font-size: max(var(--wa-font-size-3xs), 0.75em); 1126 font-weight: var(--wa-font-weight-semibold); 1127 line-height: 1; 1128 vertical-align: middle; 1129 white-space: nowrap; 1130 background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud)); 1131 border-color: transparent; 1132 border-radius: var(--wa-border-radius-s); 1133 border-style: var(--wa-border-style); 1134 border-width: var(--wa-border-width-s); 1135 user-select: none; 1136 -webkit-user-select: none; 1137 cursor: inherit; 1138 1139 min-width: 1.25em; /* <-- this is what Safari respects for intrinsic */ 1140 min-height: 1em; 1141 } 1142 1143 /* Appearance modifiers */ 1144 :host([appearance='outlined']) { 1145 --pulse-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud)); 1146 1147 color: var(--wa-color-on-quiet, var(--wa-color-brand-on-quiet)); 1148 background-color: transparent; 1149 border-color: var(--wa-color-border-loud, var(--wa-color-brand-border-loud)); 1150 } 1151 1152 :host([appearance='filled']) { 1153 --pulse-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal)); 1154 1155 color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal)); 1156 background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal)); 1157 border-color: transparent; 1158 } 1159 1160 :host([appearance='filled-outlined']) { 1161 --pulse-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal)); 1162 1163 color: var(--wa-color-on-normal, var(--wa-color-brand-on-normal)); 1164 background-color: var(--wa-color-fill-normal, var(--wa-color-brand-fill-normal)); 1165 border-color: var(--wa-color-border-normal, var(--wa-color-brand-border-normal)); 1166 } 1167 1168 :host([appearance='accent']) { 1169 --pulse-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud)); 1170 1171 color: var(--wa-color-on-loud, var(--wa-color-brand-on-loud)); 1172 background-color: var(--wa-color-fill-loud, var(--wa-color-brand-fill-loud)); 1173 border-color: transparent; 1174 } 1175 1176 /* Pill modifier */ 1177 :host([pill]) { 1178 border-radius: var(--wa-border-radius-pill); 1179 } 1180 1181 /* Pulse attention */ 1182 :host([attention='pulse']) { 1183 animation: pulse 1.5s infinite; 1184 } 1185 1186 @keyframes pulse { 1187 0% { 1188 box-shadow: 0 0 0 0 var(--pulse-color); 1189 } 1190 70% { 1191 box-shadow: 0 0 0 0.5rem transparent; 1192 } 1193 100% { 1194 box-shadow: 0 0 0 0 transparent; 1195 } 1196 } 1197 1198 /* Bounce attention */ 1199 :host([attention='bounce']) { 1200 animation: bounce 1s cubic-bezier(0.28, 0.84, 0.42, 1) infinite; 1201 } 1202 1203 @keyframes bounce { 1204 0%, 1205 20%, 1206 50%, 1207 80%, 1208 100% { 1209 transform: translateY(0); 1210 } 1211 40% { 1212 transform: translateY(-5px); 1213 } 1214 60% { 1215 transform: translateY(-2px); 1216 } 1217 } 1218 1219 /* Prevents vertical space when icons with vertical-align are slotted in - https://github.com/shoelace-style/webawesome/issues/2280 */ 1220 [part='start'], 1221 [part='end'] { 1222 line-height: 0; 1223 } 1224 1225 slot[name='start']::slotted(*) { 1226 margin-inline-end: 0.375em; 1227 } 1228 1229 slot[name='end']::slotted(*) { 1230 margin-inline-start: 0.375em; 1231 } 1232`,Pe=class extends Ft{constructor(){super(...arguments),this.variant="brand",this.appearance="accent",this.pill=!1,this.attention="none"}render(){return K` 1233 <span part="start"> 1234 <slot name="start"></slot> 1235 </span> 1236
1237 <span part="base badge" role="status"> 1238 <slot></slot> 1239 </span> 1240 1241 <span part="end"> 1242 <slot name="end"></slot> 1243 </span> 1244 `}};Pe.css=[Te,Oe],kt([At({reflect:!0})],Pe.prototype,"variant",2),kt([At({reflect:!0})],Pe.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],Pe.prototype,"pill",2),kt([At({reflect:!0})],Pe.prototype,"attention",2),Pe=kt([St("wa-badge")],Pe);var Fe=()=>({checkValidity(t){const e=t.input,i={message:"",isValid:!0,invalidKeys:[]};if(!e)return i;let o=!0;if("checkValidity"in e&&(o=e.checkValidity()),o)return i;if(i.isValid=!1,"validationMessage"in e&&(i.message=e.validationMessage),!("validity"in e))return i.invalidKeys.push("customError"),i;for(const t in e.validity){if("valid"===t)continue;const o=t;e.validity[o]&&i.invalidKeys.push(o)}return i}}),Ie=class extends Event{constructor(){super("wa-invalid",{bubbles:!0,cancelable:!1,composed:!0})}},Re=class extends Ft{constructor(){super(),this.name=null,this.disabled=!1,this.required=!1,this.assumeInteractionOn=["input"],this.validators=[],this.valueHasChanged=!1,this.hasInteracted=!1,this.customError=null,this.emittedEvents=[],this.emitInvalid=t=>{t.target===this&&(this.hasInteracted=!0,this.dispatchEvent(new Ie))},this.handleInteraction=t=>{const e=this.emittedEvents;e.includes(t.type)||e.push(t.type),e.length===this.assumeInteractionOn?.length&&(this.hasInteracted=!0)},"addEventListener"in this&&this.addEventListener("invalid",this.emitInvalid)}static get validators(){return[{observedAttributes:["custom-error"],checkValidity(t){const e={message:"",isValid:!0,invalidKeys:[]};return t.customError&&(e.message=t.customError,e.isValid=!1,e.invalidKeys=["customError"]),e}}]}static get observedAttributes(){const t=new Set(super.observedAttributes||[]);for(const e of this.validators)if(e.observedAttributes)for(const i of e.observedAttributes)t.add(i);return[...t]}connectedCallback(){super.connectedCallback(),this.didSSR&&!this.hasUpdated?this.updateComplete.then(()=>{this.updateValidity()}):this.updateValidity(),this.assumeInteractionOn.forEach(t=>{this.addEventListener?.(t,this.handleInteraction)})}firstUpdated(...t){super.firstUpdated(...t),this.updateValidity()}willUpdate(t){if(t.has("customError")&&(this.customError||(this.customError=null),this.setCustomValidity(this.customError||"")),t.has("value")||t.has("disabled")||t.has("defaultValue")){const t=this.value;this.updateFormValue(t)}t.has("disabled")&&(this.customStates.set("disabled",this.disabled),!this.hasAttribute("disabled")&&this.matches(":disabled")||this.toggleAttribute("disabled",this.disabled)),super.willUpdate(t),this.didSSR&&!this.hasUpdated?this.updateComplete.then(()=>this.updateValidity()):this.updateValidity()}updateFormValue(t){if(Array.isArray(t)){if(this.name){const e=new FormData;for(const i of t)e.append(this.name,i);this.setValue(e,e)}}else this.setValue(t,t)}get labels(){return this.internals.labels}getForm(){return this.internals.form}set form(t){t?this.setAttribute("form",t):this.removeAttribute("form")}get form(){return this.internals.form}get validity(){return this.internals.validity}get willValidate(){return this.internals.willValidate}get validationMessage(){return this.internals.validationMessage}checkValidity(){return this.updateValidity(),this.internals.checkValidity()}reportValidity(){return this.updateValidity(),this.hasInteracted=!0,this.internals.reportValidity()}get validationTarget(){return this.input||void 0}setValidity(...t){const e=t[0],i=t[1];let o=t[2];o||(o=this.validationTarget),this.internals.setValidity(e,i,o||void 0),this.requestUpdate("validity"),this.setCustomStates()}setCustomStates(){const t=Boolean(this.required),e=this.internals.validity.valid,i=this.hasInteracted;this.customStates.set("required",t),this.customStates.set("optional",!t),this.customStates.set("invalid",!e),this.customStates.set("valid",e),this.customStates.set("user-invalid",!e&&i),this.customStates.set("user-valid",e&&i)}setCustomValidity(t){if(!t)return this.customError=null,void this.setValidity({});this.customError=t,this.setValidity({customError:!0},t,this.validationTarget)}formResetCallback(){this.resetValidity(),this.hasInteracted=!1,this.valueHasChanged=!1,this.emittedEvents=[],this.updateV
vendor: 1,973 bytes, lines 1244-1265
1244alidity()}formDisabledCallback(t){this.disabled=t,this.updateValidity()}formStateRestoreCallback(t,e){this.didSSR&&!this.hasUpdated?this.updateComplete.then(()=>{this.value=t,"restore"===e&&this.resetValidity(),this.updateValidity()}):(this.value=t,"restore"===e&&this.resetValidity(),this.updateValidity())}setValue(...t){const[e,i]=t;this.internals.setFormValue(e,i)}get allValidators(){return[...this.constructor.validators||[],...this.validators||[]]}resetValidity(){this.setCustomValidity(""),this.setValidity({})}updateValidity(){if(this.disabled||this.hasAttribute("disabled")||!this.willValidate)return void this.resetValidity();const t=this.allValidators;if(!t?.length)return;const e={customError:Boolean(this.customError)},i=this.validationTarget||this.input||void 0;let o="";for(const i of t){const{isValid:t,message:a,invalidKeys:s}=i.checkValidity(this);t||(o||(o=a),s?.length>=0&&s.forEach(t=>e[t]=!0))}o||(o=this.validationMessage),this.setValidity(e,o,i)}};Re.formAssociated=!0,kt([At({reflect:!0})],Re.prototype,"name",2),kt([At({type:Boolean})],Re.prototype,"disabled",2),kt([At({state:!0,attribute:!1})],Re.prototype,"valueHasChanged",2),kt([At({state:!0,attribute:!1})],Re.prototype,"hasInteracted",2),kt([At({attribute:"custom-error",reflect:!0})],Re.prototype,"customError",2),kt([At({attribute:!1,state:!0,type:Object})],Re.prototype,"validity",1);var Ve=h` 1245 @layer wa-component { 1246 :host { 1247 display: inline-block; 1248 1249 /* Workaround because Chrome doesn't like :host(:has()) below 1250 * https://issues.chromium.org/issues/40062355 1251 * Firefox doesn't like this nested rule, so both are needed */ 1252 &:has(wa-badge) { 1253 position: relative; 1254 } 1255 } 1256 1257 /* Apply relative positioning only when needed to position wa-badge 1258 * This avoids creating a new stacking context for every button */ 1259 :host(:has(wa-badge)) { 1260 position: relative; 1261 } 1262 } 1263 1264 .button { 1265 display: inline-flex;
1266 align-items: center; 1267 justify-content: center; 1268 text-decoration: none; 1269 user-select: none; 1270 -webkit-user-select: none; 1271 white-space: nowrap; 1272 vertical-align: middle; 1273 transition-property: background, border, box-shadow, color, opacity, transform; 1274 transition-duration: var(--wa-transition-fast); 1275 transition-timing-function: var(--wa-transition-easing); 1276 transform-origin: center; 1277 cursor: pointer; 1278 padding: 0 var(--wa-form-control-padding-inline); 1279 font-family: inherit; 1280 font-size: inherit; 1281 font-weight: var(--wa-font-weight-action); 1282 height: var(--wa-form-control-height); 1283 width: 100%; 1284 1285 background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)); 1286 1287 border-color: transparent; 1288 color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud)); 1289 border-start-start-radius: var(--_button-start-start-radius, var(--wa-form-control-border-radius)); 1290 border-start-end-radius: var(--_button-start-end-radius, var(--wa-form-control-border-radius)); 1291 border-end-start-radius: var(--_button-end-start-radius, var(--wa-form-control-border-radius)); 1292 border-end-end-radius: var(--_button-end-end-radius, var(--wa-form-control-border-radius)); 1293 border-style: var(--wa-form-control-border-style); 1294 border-width: var(--wa-form-control-border-width); 1295 } 1296 1297 /* Hover and active transforms */ 1298 .button:not(.disabled):not(.loading) { 1299 @media (hover: hover) { 1300 &:hover { 1301 transform: var(--wa-button-transform-hover); 1302 } 1303 } 1304 &:active { 1305 transform: var(--wa-button-transform-active); 1306 } 1307 1308 @media (prefers-reduced-motion: reduce) { 1309 &:hover, 1310 &:active { 1311 transform: none; 1312 } 1313 } 1314 } 1315 1316 /* Appearance modifiers */ 1317 :host([appearance='plain']) { 1318 /* Indentation overrides for grouping */ 1319 margin-inline-start: var(--_button-horizontal-indent); 1320 margin-block-start: var(--_button-vertical-indent); 1321 1322 .button { 1323 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1324 background-color: transparent; 1325 border-color: transparent; 1326 } 1327 @media (hover: hover) { 1328 .button:not(.disabled):not(.loading):hover { 1329 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1330 background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)); 1331 } 1332 } 1333 .button:not(.disabled):not(.loading):active { 1334 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1335 background-color: color-mix( 1336 in oklab, 1337 var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)), 1338 var(--wa-color-mix-active) 1339 ); 1340 } 1341 } 1342 1343 :host([appearance='outlined']) { 1344 /* Indentation overrides for grouping outlined */ 1345 margin-inline-start: var(--_button-horizontal-indent-outlined); 1346 margin-block-start: var(--_button-vertical-indent-outlined); 1347 1348 .button { 1349 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1350 background-color: transparent; 1351 border-color: var(--wa-color-border-loud, var(--wa-color-neutral-border-loud)); 1352 } 1353 @media (hover: hover) { 1354 .button:not(.disabled):not(.loading):hover { 1355 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1356 background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)); 1357 } 1358 } 1359 .button:not(.disabled):not(.loading):active { 1360 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 1361 background-color: color-mix( 1362 in oklab, 1363 var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)), 1364 var(--wa-color-mix-active) 1365 ); 1366 } 1367 } 1368 1369 :host([appearance='filled']) { 1370 /* Indentation overrides for grouping */ 1371 margin-inline-start: var(--_button-horizontal-indent); 1372 margin-block-start: var(--_button-vertical-indent); 1373 1374 .button { 1375 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1376 background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)); 1377 border-color: transparent; 1378 } 1379 @media (hover: hover) { 1380 .button:not(.disabled):not(.loading):hover { 1381 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1382 background-color: color-mix( 1383 in oklab, 1384 var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)), 1385 var(--wa-color-mix-hover) 1386 ); 1387 } 1388 } 1389 .button:not(.disabled):not(.loading):active { 1390 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1391 background-color: color-mix( 1392 in oklab, 1393 var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)), 1394 var(--wa-color-mix-active) 1395 ); 1396 } 1397 } 1398 1399 :host([appearance='filled-outlined']) { 1400 /* Indentation overrides for grouping outlined */ 1401 margin-inline-start: var(--_button-horizontal-indent-outlined); 1402 margin-block-start: var(--_button-vertical-indent-outlined); 1403 1404 .button { 1405 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1406 background-color: var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)); 1407 border-color: var(--wa-color-border-normal, var(--wa-color-neutral-border-normal)); 1408 } 1409 @media (hover: hover) { 1410 .button:not(.disabled):not(.loading):hover { 1411 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1412 background-color: color-mix( 1413 in oklab, 1414 var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)), 1415 var(--wa-color-mix-hover) 1416 ); 1417 } 1418 } 1419 .button:not(.disabled):not(.loading):active { 1420 color: var(--wa-color-on-normal, var(--wa-color-neutral-on-normal)); 1421 background-color: color-mix( 1422 in oklab, 1423 var(--wa-color-fill-normal, var(--wa-color-neutral-fill-normal)), 1424 var(--wa-color-mix-active) 1425 ); 1426 } 1427 } 1428 1429 :host([appearance='accent']) { 1430 /* Indentation overrides for grouping */ 1431 margin-inline-start: var(--_button-horizontal-indent); 1432 margin-block-start: var(--_button-vertical-indent); 1433 1434 .button { 1435 color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud)); 1436 background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)); 1437 border-color: transparent; 1438 } 1439 @media (hover: hover) { 1440 .button:not(.disabled):not(.loading):hover { 1441 background-color: color-mix( 1442 in oklab, 1443 var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)), 1444 var(--wa-color-mix-hover) 1445 ); 1446 } 1447 } 1448 .button:not(.disabled):not(.loading):active { 1449 background-color: color-mix( 1450 in oklab, 1451 var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)), 1452 var(--wa-color-mix-active) 1453 ); 1454 } 1455 } 1456 1457 /* Focus states */ 1458 .button:focus { 1459 outline: none; 1460 } 1461 1462 .button:focus-visible { 1463 outline: var(--wa-focus-ring); 1464 outline-offset: var(--wa-focus-ring-offset); 1465 } 1466 1467 /* Disabled state */ 1468 :host([disabled]) { 1469 opacity: 0.5;
1470 cursor: not-allowed; 1471 1472 /* When disabled, prevent mouse events from bubbling up from children */ 1473 .button { 1474 pointer-events: none; 1475 } 1476 } 1477 1478 /* Keep it last so Safari doesn't stop parsing this block */ 1479 .button::-moz-focus-inner { 1480 border: 0; 1481 } 1482 1483 /* Icon buttons */ 1484 .button.is-icon-button { 1485 outline-offset: 2px; 1486 width: var(--wa-form-control-height); 1487 aspect-ratio: 1; 1488 } 1489 1490 /* Icon buttons with a caret need to grow to fit both the icon and the caret */ 1491 .button.is-icon-button.caret { 1492 width: auto; 1493 aspect-ratio: auto; 1494 min-width: var(--wa-form-control-height); 1495 } 1496 1497 /* Pill modifier */ 1498 :host([pill]) .button { 1499 border-start-start-radius: var(--_button-start-start-radius, var(--wa-border-radius-pill)); 1500 border-start-end-radius: var(--_button-start-end-radius, var(--wa-border-radius-pill)); 1501 border-end-start-radius: var(--_button-end-start-radius, var(--wa-border-radius-pill)); 1502 border-end-end-radius: var(--_button-end-end-radius, var(--wa-border-radius-pill)); 1503 } 1504 1505 /* 1506 * Label 1507 */ 1508 1509 .start, 1510 .end { 1511 flex: 0 0 auto; 1512 display: flex;
1513 align-items: center; 1514 pointer-events: none; 1515 } 1516 1517 .label { 1518 display: inline-block; 1519 } 1520 1521 .is-icon-button .label { 1522 display: flex; 1523 justify-content: center; 1524 } 1525 1526 .label::slotted(wa-icon) { 1527 align-self: center; 1528 } 1529 1530 /* 1531 * Caret modifier 1532 */ 1533 1534 wa-icon[part='caret'] { 1535 display: flex; 1536 align-self: center; 1537 align-items: center; 1538 1539 &::part(svg) { 1540 width: 0.875em; 1541 height: 0.875em; 1542 } 1543 1544 .button:has(&) .end { 1545 display: none; 1546 } 1547 } 1548 1549 /* 1550 * Loading modifier 1551 */ 1552 1553 .loading { 1554 position: relative; 1555 cursor: wait; 1556 1557 .start, 1558 .label, 1559 .end, 1560 .caret { 1561 /* Hidden with opacity, not visibility, so the label stays in the accessibility tree */ 1562 opacity: 0; 1563 1564 /* Unlike visibility: hidden, opacity leaves the content clickable */ 1565 pointer-events: none; 1566 } 1567 1568 wa-spinner { 1569 --indicator-color: currentColor; 1570 --track-color: color-mix(in oklab, currentColor, transparent 90%); 1571 1572 position: absolute; 1573 font-size: 1em; 1574 height: 1em; 1575 width: 1em; 1576 top: calc(50% - 0.5em); 1577 left: calc(50% - 0.5em); 1578 } 1579 } 1580 1581 /* 1582 * Badges 1583 */ 1584 1585 .button ::slotted(wa-badge) { 1586 border-color: var(--wa-color-surface-default); 1587 position: absolute; 1588 inset-block-start: 0; 1589 inset-inline-end: 0; 1590 translate: 50% -50%; 1591 pointer-events: none; 1592 } 1593 1594 :host(:dir(rtl)) ::slotted(wa-badge) { 1595 translate: -50% -50%; 1596 } 1597 1598 /* 1599 * Button spacing 1600 */ 1601 1602 slot[name='start']::slotted(*) { 1603 margin-inline-end: 0.75em; 1604 } 1605 1606 slot[name='end']::slotted(*), 1607 .button:not(.visually-hidden-label) [part='caret'] { 1608 margin-inline-start: 0.75em; 1609 } 1610`,Be={small:"s",medium:"m",large:"l"};var Ne=new Set;function He(t,e){e in Be&&!Ne.has(`${t}:${e}`)&&(Ne.add(`${t}:${e}`),console.warn(`[${t}] size="${e}" is deprecated. Use size="${Be[e]}" instead. The long-form value will be removed in the next major version.`))}var qe=class{constructor(t,...e){this.slotNames=[],this.handleSlotChange=t=>{const e=t.target;(this.slotNames.includes("[default]")&&!e.name||e.name&&this.slotNames.includes(e.name))&&this.host.requestUpdate()},(this.host=t).addController(this),this.slotNames=e}hasDefaultSlot(){return!!this.host.childNodes&&[...this.host.childNodes].some(t=>
1610{if(t.nodeType===Node.TEXT_NODE&&""!==t.textContent.trim())return!0;if(t.nodeType===Node.ELEMENT_NODE){const e=t;if("wa-visually-hidden"===e.tagName.toLowerCase())return!1;if(!e.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(t){return null!==this.host.querySelector?.(`:scope > [slot="${t}"]`)}test(t,e){return e&&this.host.didSSR&&!this.host.hasUpdated?Boolean(this.host[e]):"[default]"===t?this.hasDefaultSlot():this.hasNamedSlot(t)}hostConnected(){const t=this.host.shadowRoot;t&&"addEventListener"in t&&t.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){const t=this.host.shadowRoot;t&&"removeEventListener"in t&&t.removeEventListener("slotchange",this.handleSlotChange)}},Ue=h` 1611 :host([size='xs']) { 1612 font-size: var(--wa-font-size-xs); 1613 } 1614 1615 :host([size='s']), 1616 :host([size='small']) { 1617 font-size: var(--wa-font-size-s); 1618 } 1619 1620 :host([size='m']), 1621 :host([size='medium']) { 1622 font-size: var(--wa-font-size-m); 1623 } 1624 1625 :host([size='l']), 1626 :host([size='large']) { 1627 font-size: var(--wa-font-size-l); 1628 } 1629 1630 :host([size='xl']) { 1631 font-size: var(--wa-font-size-xl); 1632 } 1633`;const We=t=>t??J,je=Symbol.for(""),Ye=t=>{if(t?.r===je)return t?._$litStatic$},Ke=(t,...e)=>({_$litStatic$:e.reduce((e,i,o)=>e+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(i)+t[o+1],t[0]),r:je}),Xe=new Map,Ge=t=>(e,...i)=>{const o=i.length;let a,s;const n=[],r=[];let l,h=0,c=!1;for(;h<o;){for(l=e[h];h<o&&void 0!==(s=i[h],a=Ye(s));)l+=a+e[++h],c=!0;h!==o&&r.push(s),n.push(l),h++}if(h===o&&n.push(e[o]),c){const t=n.join("$$lit$$");void 0===(e=Xe.get(t))&&(n.raw=n,Xe.set(t,e=n)),i=r}return t(e,...i)},Qe=Ge(K);Ge(X),Ge(G);var Je=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["click"],this.hasSlotController=new qe(this,"[default]","start","end"),this.localize=new ie(this),this.invalid=!1,this.isIconButton=!1,this.title="",this.variant="neutral",this.appearance="accent",this.size="m",this.withCaret=!1,this.withStart=!1,this.withEnd=!1,this.disabled=!1,this.loading=!1,this.pill=!1,this.type="button"}static get validators(){return[...super.validators,Fe()]}handleSizeChange(){He(this.localName,this.size)}constructLightDOMButton(){const t=document.createElement("button");for(const e of this.attributes)"style"!==e.name&&t.setAttribute(e.name,e.value);return t.type=this.type,t.style.position="absolute !important",t.style.width="0 !important",t.style.height="0 !important",t.style.clipPath="inset(50%) !important",t.style.overflow="hidden !important",t.style.whiteSpace="nowrap !important",this.name&&(t.name=this.name),t.value=this.value||"",t}handleClick(t){if(this.disabled||this.loading)return t.preventDefault(),void t.stopImmediatePropagation();if("submit"!==this.type&&"reset"!==this.type)return;if(!this.getForm())return;const e=this.constructLightDOMButton();this.parentElement?.append(e),e.click(),e.remove()}handleInvalid(){this.dispatchEvent(new Ie)}handleLabelSlotChange(){const t=this.labelSlot.assignedNodes({flatten:!0});let e=!1,i=!1,o=!1,a=!1;[...t].forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const o=t;"wa-icon"===o.localName?(i=!0,e||(e=void 0!==o.label)):a=!0}else if(t.nodeType===Node.TEXT_NODE){(t.textContent?.trim()||"").length>0&&(o=!0)}}),this.isIconButton=i&&!o&&!a,this.customStates.set("icon-button",this.isIconButton),this.isIconButton&&!e&&console.warn('Icon buttons must have a label for screen readers. Add <wa-icon label="..."> to remove this warning.',this)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.customStates.set("disabled",this.disabled),this.updateValidity()}handleHrefChange(){this.customStates.set("link",this.isLink())}handleLoadingChange(){this.customStates.set("loading",this.loading)}setValue(...t){}click(){this.button.click()}focus(t){this.button.focus(t)}blur(){this.button.blur()}render(){const t=this.isLink(),e=t?Ke`a`:Ke`button`;return Qe` 1634 <${e} 1635 part="base button" 1636 class=${ce({button:!0,caret:this.withCaret,disabled:this.disabled,loading:this.loading,rtl:"rtl"===this.localize.dir(),"has-label":this.hasSlotController.test("[default]"),"has-start":this.hasSlotController.test("start","withStart"),"has-end":this.hasSlotController.test("end","withEnd"),"is-icon-button":this.isIconButton})} 1637 ?disabled=${We(t?void 0:this.disabled)} 1638 type=${We(t?void 0:this.type)} 1639 title=${this.title} 1640 name=${We(t?void 0:this.name)} 1641 value=${We(t?void 0:this.value)} 1642 href=${We(t?this.href:void 0)} 1643 target=${We(t?this.target:void 0)} 1644 download=${We(t?this.download:void 0)} 1645 rel=${We(t&&this.rel?this.rel:void 0)} 1646 role=${We(t?void 0:"button")} 1647 aria-disabled=${We(t&&this.disabled?"true":void 0)} 1648 aria-busy=${this.loading?"true":"false"} 1649 tabindex=${this.disabled?"-1":"0"} 1650 @invalid=${this.isButton()?this.handleInvalid:null} 1651 @click=${this.handleClick} 1652 > 1653 <slot name="start" part="start" class="start"></slot> 1654 <slot part="label" class="label" @slotchange=${this.handleLabelSlotChange}></slot> 1655 <slot name="end" part="end" class="end"></slot> 1656 ${this.withCaret?Qe` 1657 <wa-icon part="caret" class="caret" library="system" name="chevron-down" variant="solid"></wa-icon> 1658 `:""} 1659 ${this.loading?Qe`<wa-spinner part="spinner"></wa-spinner>`:""} 1660 </${e}> 1661 `}};Je.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},Je.css=[Ve,Te,Ue],kt([Dt(".button")],Je.prototype,"button",2),kt([Dt("slot:not([name])")],Je.prototype,"labelSlot",2),kt([$t()],Je.prototype,"invali
1661d",2),kt([$t()],Je.prototype,"isIconButton",2),kt([At()],Je.prototype,"title",2),kt([At({reflect:!0})],Je.prototype,"variant",2),kt([At({reflect:!0})],Je.prototype,"appearance",2),kt([At({reflect:!0})],Je.prototype,"size",2),kt([vt("size")],Je.prototype,"handleSizeChange",1),kt([At({attribute:"with-caret",type:Boolean,reflect:!0})],Je.prototype,"withCaret",2),kt([At({attribute:"with-start",type:Boolean})],Je.prototype,"withStart",2),kt([At({attribute:"with-end",type:Boolean})],Je.prototype,"withEnd",2),kt([At({type:Boolean})],Je.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],Je.prototype,"loading",2),kt([At({type:Boolean,reflect:!0})],Je.prototype,"pill",2),kt([At()],Je.prototype,"type",2),kt([At({reflect:!0})],Je.prototype,"name",2),kt([At({reflect:!0})],Je.prototype,"value",2),kt([At({reflect:!0})],Je.prototype,"href",2),kt([At()],Je.prototype,"target",2),kt([At()],Je.prototype,"rel",2),kt([At()],Je.prototype,"download",2),kt([At({attribute:"formaction"})],Je.prototype,"formAction",2),kt([At({attribute:"formenctype"})],Je.prototype,"formEnctype",2),kt([At({attribute:"formmethod"})],Je.prototype,"formMethod",2),kt([At({attribute:"formnovalidate",type:Boolean})],Je.prototype,"formNoValidate",2),kt([At({attribute:"formtarget"})],Je.prototype,"formTarget",2),kt([vt("disabled",{waitUntilFirstUpdate:!0})],Je.prototype,"handleDisabledChange",1),kt([vt("href")],Je.prototype,"handleHrefChange",1),kt([vt("loading",{waitUntilFirstUpdate:!0})],Je.prototype,"handleLoadingChange",1),Je=kt([St("wa-button")],Je),Je.disableWarning?.("change-in-update");var Ze=h` 1662 :host { 1663 --track-width: 2px; 1664 --track-color: var(--wa-color-neutral-fill-normal); 1665 --indicator-color: var(--wa-color-brand-fill-loud); 1666 --speed: 2s; 1667 --size: 1em; 1668 1669 /* 1670 Resizing a spinner element using anything but font-size will break the animation because the animation uses em 1671 units. Therefore, if a spinner is used in a flex container without \`flex: none\` applied, the spinner can 1672 grow/shrink and break the animation. The use of \`flex: none\` on the host element prevents this by always having 1673 the spinner sized according to its actual dimensions. 1674 */ 1675 flex: none; 1676 display: inline-flex; 1677 width: var(--size); 1678 height: var(--size); 1679 } 1680 1681 svg { 1682 width: 100%; 1683 height: 100%; 1684 aspect-ratio: 1; 1685 animation: spin var(--speed) linear infinite; 1686 } 1687 1688 .track, 1689 .indicator { 1690 --radius: calc(var(--size) / 2 - var(--track-width) / 2); 1691 --circumference: calc(var(--radius) * 2 * 3.141592654); 1692 1693 cx: calc(var(--size) / 2); 1694 cy: calc(var(--size) / 2); 1695 r: var(--radius); 1696 fill: none; 1697 stroke-width: var(--track-width); 1698 } 1699 1700 .track { 1701 stroke: var(--track-color); 1702 } 1703 1704 .indicator { 1705 stroke: var(--indicator-color); 1706 stroke-linecap: round; 1707 stroke-dasharray: calc(0.597 * var(--circumference)), calc(0.796 * var(--circumference)); 1708 stroke-dashoffset: calc(-0.04 * var(--circumference)); 1709 animation: dash 1.5s ease-in-out infinite; 1710 } 1711 1712 @keyframes spin { 1713 0% { 1714 transform: rotate(0deg); 1715 } 1716 100% { 1717 transform: rotate(360deg); 1718 } 1719 } 1720 1721 @keyframes dash { 1722 0% { 1723 stroke-dasharray: calc(0.008 * var(--circumference)), calc(1.194 * var(--circumference)); 1724 stroke-dashoffset: 0; 1725 } 1726 50% { 1727 stroke-dasharray: calc(0.716 * var(--circumference)), calc(1.194 * var(--circumference)); 1728 stroke-dashoffset: calc(-0.278 * var(--circumference)); 1729 } 1730 100% { 1731 stroke-dasharray: calc(0.716 * var(--circumference)), calc(1.194 * var(--circumference)); 1732 stroke-dashoffset: calc(-0.987 * var(--circumference)); 1733 } 1734 } 1735`,ti=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this)}render(){return K` 1736 <svg 1737 part="base spinner" 1738 role="progressbar" 1739 aria-label=${this.localize.term("loading")} 1740 fill="none" 1741 xmlns="http://www.w3.org/2000/svg" 1742 > 1743 <circle class="track" /> 1744 <circle class="indicator" /> 1745 </svg> 1746 `}};
1746ti.css=Ze,ti=kt([St("wa-spinner")],ti);var ei=h` 1747 :host { 1748 display: inline-flex; 1749 } 1750 1751 .button-group { 1752 display: flex; 1753 position: relative; 1754 isolation: isolate; 1755 flex-wrap: wrap; 1756 1757 @media (hover: hover) { 1758 > :hover, 1759 &::slotted(:hover) { 1760 z-index: 1; 1761 } 1762 } 1763 1764 /* Focus and checked are always on top */ 1765 > :focus, 1766 &::slotted(:focus), 1767 > [aria-checked='true'], 1768 &::slotted([aria-checked='true']), 1769 > [checked], 1770 &::slotted([checked]) { 1771 z-index: 2 !important; 1772 } 1773 1774 :host([orientation='horizontal']) & { 1775 flex-direction: row; 1776 } 1777 1778 :host([orientation='vertical']) & { 1779 flex-direction: column; 1780 } 1781 } 1782 1783 /* Set custom properties to be inherited by slotted buttons */ 1784 :host([orientation='horizontal']) { 1785 --_button-horizontal-indent: var(--wa-form-control-border-width); 1786 --_button-horizontal-indent-outlined: calc(var(--wa-form-control-border-width) * -1); 1787 1788 ::slotted(:first-child) { 1789 --_button-horizontal-indent: 0; 1790 --_button-horizontal-indent-outlined: 0; 1791 } 1792 } 1793 1794 :host([orientation='vertical']) { 1795 --_button-vertical-indent: var(--wa-form-control-border-width); 1796 --_button-vertical-indent-outlined: calc(var(--wa-form-control-border-width) * -1); 1797 1798 ::slotted(:first-child) { 1799 --_button-vertical-indent: 0; 1800 --_button-vertical-indent-outlined: 0; 1801 } 1802 } 1803 1804 /* All buttons that are not in front or at the end get their border radius removed */ 1805 ::slotted(:not(:first-child):not(:last-child)) { 1806 --_button-start-start-radius: 0; 1807 --_button-start-end-radius: 0; 1808 --_button-end-start-radius: 0; 1809 --_button-end-end-radius: 0; 1810 } 1811 1812 /* Remove leading and trailing buttons border radius individually */ 1813 :host([orientation='horizontal']) { 1814 ::slotted(:first-child:not(:last-child)) { 1815 --_button-start-end-radius: 0; 1816 --_button-end-end-radius: 0; 1817 } 1818 1819 ::slotted(:last-child:not(:first-child)) { 1820 --_button-start-start-radius: 0; 1821 --_button-end-start-radius: 0; 1822 } 1823 } 1824 1825 :host([orientation='vertical']) { 1826 ::slotted(:first-child:not(:last-child)) { 1827 --_button-end-start-radius: 0; 1828 --_button-end-end-radius: 0; 1829 } 1830 1831 ::slotted(:last-child:not(:first-child)) { 1832 --_button-start-start-radius: 0; 1833 --_button-start-end-radius: 0; 1834 } 1835 } 1836`,ii=class extends Ft{constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal"}updated(t){super.updated(t),t.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(t){const e=oi(t.target);e?.classList.add("button-focus")}handleBlur(t){const e=oi(t.target);e?.classList.remove("button-focus")}handleMouseOver(t){const e=oi(t.target);e?.classList.add("button-hover")}handleMouseOut(t){const e=oi(t.target);e?.classList.remove("button-hover")}render(){return K` 1837 <slot 1838 part="base" 1839 class="button-group" 1840 role="${this.disableRole?"presentation":"group"}" 1841 aria-label=${this.label} 1842 aria-orientation=${this.orientation} 1843 @focusout=${this.handleBlur} 1844 @focusin=${this.handleFocus} 1845 @mouseover=${this.handleMouseOver} 1846 @mouseout=${this.handleMouseOut} 1847 ></slot> 1848 `}};function oi(t){const e="wa-button, wa-radio-button";return t.closest(e)??t.querySelector(e)}function ai(t,e=new WeakMap){if(null===t||"object"!=typeof t)return t;if(e.has(t))return e.get(t);if(Array.isArray(t)){const i=[];e.set(t,i);for(const o of t)i.push(ai(o,e));return i}if(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t)){const i={};e.set(t,i);for(const o of Object.keys(t))i[o]=ai(t[o],e);return i}return t}ii.css=[ei],kt([Dt("slot")],ii.prototype,"defaultSlot",2),kt([$t()],ii.prototype,"disableRole",2),kt([$t()],ii.prototype,"hasOutlined",2),kt([At()],ii.prototype,"label",2),kt([At({reflect:!0})],ii.prototype,"orientation",2),ii=kt([St("wa-button-group")],ii);function si(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function ni(t,e){const i=ai(t);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const o=e[t],a=i[t];si(o)&&si(a)?i[t]=ni(a,o):i[t]=o}return i}var ri=h` 1849 :host { 1850 --fill-color-1: color-mix(in srgb, var(--wa-color-blue-60) 40%, transparent); 1851 --fill-color-2: color-mix(in srgb, var(--wa-color-pink-60) 40%, transparent); 1852 --fill-color-3: color-mix(in srgb, var(--wa-color-green-60) 40%, transparent); 1853 --fill-color-4: color-mix(in srgb, var(--wa-color-yellow-60) 40%, transparent); 1854 --fill-color-5: color-mix(in srgb, var(--wa-color-purple-60) 40%, transparent); 1855 --fill-color-6: color-mix(in srgb, var(--wa-color-orange-60) 40%, transparent); 1856 1857 --border-color-1: var(--wa-color-blue-60); 1858 --border-color-2: var(--wa-color-pink-60); 1859 --border-color-3: var(--wa-color-green-60); 1860 --border-color-4: var(--wa-color-yellow-60); 1861 --border-color-5: var(--wa-color-purple-60); 1862 --border-color-6: var(--wa-color-orange-60); 1863 1864 --grid-color: var(--wa-color-neutral-border-quiet); 1865 1866 --border-width: var(--wa-border-width-s); 1867 --border-radius: var(--wa-border-radius-s); 1868 --grid-border-width: var(--wa-border-width-s); 1869 --line-border-width: var(--wa-border-width-m); 1870 --point-radius: var(--wa-border-width-l); 1871 1872 display: block; 1873 aspect-ratio: 16/9; 1874 } 1875 1876 canvas { 1877 width: 100%; 1878 height: 100%; 1879 } 1880`;class li{constructor({name:t,initialValue:e,detect:i}){this.name=t,this.initialValue=e??!0,this.detect=i,li.all[t]=this,Object.defineProperty(li,t,{get(){return this.all[t].value},configurable:!0,enumerable:!0})}#t;#e;get valuePending(){return void 0!==this.#t?this.#t:(void 0!==this.#e||(this.#e=this.detect(),this.#e instanceof Promise?this.#e.then(t=>this.#t=t):this.#t=this.#e),this.#e)}get value(){if(void 0!==this.#t)return this.#t;let t=this.valuePending;return t instanceof Promise?this.initialValue:t}static all={};static detectAll(){return Promise.all(Object.values(li.all).map(t=>t.valuePending))}}new li({name:"TRANSITIONRUN_EVENT_LOOP",detect(){let t=document.createElement("div");document.body.appendChild(t);let e="--bar-"+Date.now();return t.style.cssText=`${e}: 1; transition: ${e} 1ms step-start allow-discrete`,new Promise(i=>{let o=0;requestAnimationFrame(()=>{setTimeout(t=>i(o>1),50),t.addEventListener("transitionrun",t=>o++),t.style.setProperty(e,"2")})}).finally(()=>t.remove())}}),new li({name:"UNREGISTERED_TRANSITION",detect(){let t=document.createElement("div");document.body.appendChild(t);let e="--foo-"+Date.now();return t.style.cssText=`${e}: 1; transition: ${e} 1ms step-start allow-discrete`,new Promise(i=>{requestAnimationFrame(()=>{setTimeout(t=>i(!0),30),t.addEventListener("transitionstart",t=>i(!1)),t.style.setProperty(e,"2")})}).finally(()=>t.remove())}});let hi=new WeakMap;const ci={"<angle>":"0deg","<color>":"transparent","<custom-ident>":"none","<image>":"linear-gradient(transparent 0% 100%)","<integer>":"0","<length>":"0px","<length-percentage>":"0px","<number>":"0","<percentage>":"0%","<resolution>":"1dppx","<string>":"''","<time>":"0s","<transform-function>":"scale(1)","<transform-list>":"scale(1)","<url>":"url('')"};let di=new Map;function ui(t,e={},i=globalThis.document){let o=di.get(i);if(!t.startsWith("--")||o&&t in o||function(t,e=globalThis.document){let i=e.createElement("div");e.body.append(i);let o="foo(bar)";i.style.setProperty(t,o);let a=!0;if(getComputedStyle(i).getPropertyValue(t)===o){let s=i.appendChild(e.createElement("div"));a=getComputedStyle(s).getPropertyValue(t)!==o}return i.remove(),a}(t,i))return;let a={syntax:e.syntax||"*",inherits:e.inherits??!0};void 0!==e.initialValue?a.initialValue=e.initialValue:"*"!==a.syntax&&a.syntax in ci&&(a.initialValue=ci[a.syntax]);let s=function(t,e=globalThis.document){let i=(e=e.ownerDocument??e).defaultView;if(e.adoptedStyleSheets){let o=new i.CSSStyleSheet;return o.replaceSync(t),Object.isFrozen(e.adoptedStyleSheets)?e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]:e.adoptedStyleSheets.push(o),o}{let i=hi.get(e);
1880return i||(i=e.head.appendChild(e.createElement("style")),hi.set(e,i)),i.insertAdjacentText("beforeend",t),i.sheet}}(`@layer style-observer-registered-properties {\n\t\t@property ${t} {\n\t\t\tsyntax: "${a.syntax}";\n\t\t\tinherits: ${a.inherits};\n\t\t\t${void 0!==a.initialValue?`initial-value: ${a.initialValue};`:""}\n\t\t}\n\t}`,i);o||(o={},di.set(i,o)),o[t]=s}new li({name:"ADOPTED_STYLE_SHEET",detect(){let t=document.createElement("div");if(document.body.append(t),t.attachShadow({mode:"open"}),Object.isFrozen(t.shadowRoot.adoptedStyleSheets))return t.remove(),!1;ui("--style-observer-adopted-style-sheet-bug",{syntax:"<number>",inherits:!0,initialValue:0});let e=new CSSStyleSheet;e.insertRule("\n\t\t\t:host {\n\t\t\t\t/* This declaration shouldn't be empty for the bug to trigger */\n\t\t\t\tcolor: transparent;\n\t\t\t}\n\t\t"),t.shadowRoot.adoptedStyleSheets.push(e);let i=e.cssRules[0].style;i.setProperty("--style-observer-adopted-style-sheet-bug","1");let o=getComputedStyle(t),a=o.getPropertyValue("--style-observer-adopted-style-sheet-bug");i.removeProperty("--style-observer-adopted-style-sheet-bug"),o=getComputedStyle(t);let s=o.getPropertyValue("--style-observer-adopted-style-sheet-bug");return t.remove(),a===s}});class pi extends WeakMap{has(t,e){if(1===arguments.length)return super.has(t);let i=super.get(t);return i?.has(e)||!1}add(t,e){let i=super.get(t)??new Set;i.add(e),super.set(t,i)}delete(t,...e){let i=super.get(t);if(i){for(let t of e)i.delete(t);0===i.size&&super.delete(t)}}}function mi(t){return null==t?[]:Array.isArray(t)?t:"string"!=typeof t&&"function"==typeof t[Symbol.iterator]?Array.from(t):[t]}let fi;function gi(t){fi??=document.createElement("div");let e=fi.style;e[t]="inherit";let i=[...e];return 0===i.length&&(i=[t]),e.cssText="",i}function bi(t,e){let i;if(e=function(t){let e=[],i=0,o=[];for(let a of t.matchAll(/[,()]/g)){let s=a[0];if(","===s){if(0===o.length){let o=t.slice(i,a.index);e.push(o.trim()),i=a.index+1}}else"("===s?o.push("("):")"===s&&o.pop()}if(i<t.length){let o=t.slice(i);e.push(o.trim())}return e}(e),"all"===t)i=/\b\w+\b/g;else{let e=[...new Set([...gi(t),t,"all"])];i=RegExp(`(?:^|\\s)(${e.join("|")})\\b`)}let o=e.findLast(t=>i.test(t)),a=o?function(t){let e=t.matchAll(/(?:^|\s)([+-]?(?:\d+|\d*\.\d+))\s*(ms|s)?(?=\s|$)/g),i=[];for(let t of e){let[,e,o]=t;e=parseFloat(e),"s"===o&&(e*=1e3),i.push(e)}return i}(o):[0,0];0===a.length?a=[0,0]:1===a.length&&a.push(0);let[s,n]=a;return{duration:s,delay:n}}class vi{#i=new Set;#o=new WeakMap;constructor(t){this.callback=t}observe(t){if(this.#i.has(t))return;let e=t.ownerDocument,i=this.#o.get(e);i||(i=new IntersectionObserver(t=>{this.callback(t.map(({target:t})=>({target:t})))},{root:e.documentElement}),this.#o.set(e,i)),this.#i.add(t),i.observe(t)}unobserve(t){if(!t){for(const t of this.#i)this.unobserve(t);return}let e=t.ownerDocument,i=this.#o.get(e);i?.unobserve(t),this.#i.delete(t)}}const wi=globalThis.CSS?.supports?.("transition-behavior","allow-discrete")?" allow-discrete":"";globalThis.document&&(ui("--style-observer-transition",{inherits:!1}),li.detectAll());class yi{properties;get propertyNames(){return[...this.properties.keys()]}target;callback;options;#a=!1;constructor(t,e,i={}){this.constructor.all.add(t,this),this.properties=new Map,this.target=t,this.callback=e,this.options={properties:[],...i};let o=mi(i.properties);this.renderedObserver=new vi(t=>{this.propertyNames.length>0&&this.handleEvent()}),o.length>0&&this.observe(o)}#s(){if(this.#a)return;let t=1===this.constructor.all.get(this.target).size;this.updateTransition({firstTime:t}),this.#a=!0}resolveOptions(t){return Object.assign(xi(t),this.options)}async handleEvent(t){if(t&&!this.properties.has(t.propertyName))return;if(li.TRANSITIONRUN_EVENT_LOOP&&"transitionrun"===t?.type||this.options.throttle>0){let i=li.TRANSITIONRUN_EVENT_LOOP?"transitionrun":"transitionstart",o=Math.max(this.options.throttle,50);if(li.TRANSITIONRUN_EVENT_LOOP){let e=bi(t.propertyName,getComputedStyle(this.target).transition);o=Math.max(o,e.duration+e.delay+16)}this.target.removeEventListener(i,this),await(e=o,new Promise(e?t=>setTimeout(t,e):t=>requestAnimationFrame(t))),this.target.addEventListener(i,this)}var e;let i=getComputedStyle(this.target),o=[];for(let t of this.propertyNames){let e=i.getPropertyValue(t),a=this.properties.get(t);e!==a&&(o.push({target:this.target,property:t,value:e,oldValue:a}),this.properties.set(t,e))}o.length>0&&this.callback(o)}observe(t){if(0===(t=(t=mi(t)).filter(t=>!this.properties.has(t))).length)return;this.#s();let e=getComputedStyle(this.target);for(let i of t){li.UNREGISTERED_TRANSITION&&!this.constructor.properties.has(i)&&(ui(i,void 0,this.target.ownerDocument),this.constructor.properties.add(i));let t=e.getPropertyValue(i);this.properties.set(i,t)}li.TRANSITIONRUN_EVENT_LOOP&&(this.target.addEventListener("transitionrun",this),li.all.TRANSITIONRUN_EVENT_LOOP.valuePending?.then(t=>{t||this.target.removeEventListener("transitionrun",this)})),this.target.addEventListener("transitionstart",this),this.target.addEventListener("transitionend",this),this.updateTransitionProperties(),this.renderedObserver.observe(this.target)}updateTransitionProperties(){this.setProperty("--style-observer-transition","");let t=new Set(getComputedStyle(this.target).transitionProperty.split(", ")),e=[];for(let t of this.constructor.all.get(this.target))e.push(...t.propertyNames);e=[...new Set(e)];let i=e.filter(e=>!t.has(e)).map(t=>`${t} 1ms step-start${wi}`).join(", ");this.setProperty("--style-observer-transition",i)}#n;updateTransition({firstTime:t}={}){const e="var(--style-observer-transition, --style-observer-noop)",i=this.getProperty("transition");let o;(t?i:!i.includes(e))&&(o=this.#n=i),void 0!==o||!t&&this.#n||(i.includes(e)&&this.setProperty("transition",""),o=getComputedStyle(this.target).transition),o="all"===o?"":o.replace(/^none\b/,"");const a=o?o+", ":"";this.setProperty("transition",a+e),this.updateTransitionProperties()}get _isHost(){return this.target.shadowRoot&&!li.ADOPTED_STYLE_SHEET&&!Object.isFrozen(this.target.shadowRoot.adoptedStyleSheets)}_shadowSheet;_styles={};setProperty(t,e,i){let o=this.target.style,a=o;if(this._isHost){if(!this._shadowSheet&&(this._shadowSheet=new CSSStyleSheet,this._shadowSheet.insertRule(":host { }"),this.target.shadowRoot.adoptedStyleSheets.push(this._shadowSheet),Object.keys(this._styles).length>0))for(let t in this._styles){let e=this._styles[t];this.setProperty(t,e),o.getPropertyValue(t)===e&&o.removeProperty(t)}a=this._shadowSheet.cssRules[0].style}a.setProperty(t,e,i),this._styles[t]=this.getProperty(t)}getProperty(t){return(this._shadowSheet?.cssRules[0]?.style??this.target.style).getPropertyValue(t)}unobserve(t){t=(t=mi(t)).filter(t=>this.properties.has(t));for(let e of t)this.properties.delete(e);0===this.properties.size&&(this.target.removeEventListener("transitionrun",this),this.target.removeEventListener("transitionstart",this),this.target.removeEventListener("transitionend",this),this.renderedObserver.unobserve(this.target)),this.updateTransitionProperties()}static properties=new Set;static all=new pi}function xi(t){return t?("string"==typeof t||Array.isArray(t)?t={properties:mi(t)}:"object"==typeof t&&(t={properties:[],...t}),t):{}}class ki{elementObservers=new WeakMap;constructor(t,e){this.callback=t,e=xi(e),e.targets??=[],e.target&&e.targets.push(e.target),this.options=e,this.options.targets.length>0&&this.options.properties.length>0&&this.observe(this.options.targets,this.options.properties)}changed(t){this.callback(t)}observe(...t){let{targets:e,properties:i}=Ci(...t);if(0===e.length&&(e=this.options.targets),0!==e.length)for(let t of e){let e=this.elementObservers.get(t);e||(e=new yi(t,t=>this.changed(t),this.options),this.elementObservers.set(t,e)),e.observe(i)}}unobserve(...t){let{targets:e,properties:i}=Ci(...t);if(0===e.length&&(e=this.options.targets),0!==e.length){0===i.length&&(i=this.options.properties);for(let t of e){let e=this.elementObservers.get(t);e&&e.unobserve(i)}}}updateTransition(t){for(let e of mi(t)){let t=this.elementObservers.get(e);t&&t.updateTransition()}}}function Ci(t,e){let i=[...mi(t),...mi(e)];t=[],e=[];for(let o of i){("string"==typeof o||o instanceof String?e:t).push(o)}return{targets:t,properties:e}}function Si(t){return t+.5|0}const _i=(t,e,i)=>Math.max(Math.min(t,i),e);function Ei(t){return _i(Si(2.55*t),0,255)}function Ai(t){return _i(Si(255*t),0,255)}function $i(t){return _i(Si(t/2.55)/100,0,1)}function Li(t){return _i(Si(100*t),0,100)}const Di={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Mi=[..."0123456789ABCDEF"],zi=t=>Mi[15&t],Ti=t=>Mi[(240&t)>>4]+Mi[15&t],Oi=t=>(240&t)>>4==(15&t);function Pi(t){var e=(t=>Oi(t.r)&&Oi(t.g)&&Oi(t.b)&&Oi(t.a))(t)?zi:Ti;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const Fi=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ii(t,e,i){const o=e*Math.min(i,1-i),a=(e,a=(e+t/30)%12)=>i-o*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function Ri(t,e,i){const o=(o,a=(o+t/60)%6)=>i-i*e*Math.max(Math.min(a,4-a,1),0);return[o(5),o(3),o(1)]}function Vi(t,e,i){const o=Ii(t,1,.5);let a;for(e+i>1&&(a=1/(e+i),e*=a,i*=a),a=0;a<3;a++)o[a]*=1-e-i,o[a]+=e;return o}function Bi(t){const e=t.r/255,i=t.g/255,o=t.b/255,a=Math.max(e,i,o),s=Math.min(e,i,o),n=(a+s)/2;let r,l,h;return a!==s&&(h=a-s,l=n>
vendor: 3,612 bytes, line 1880
1880.5?h/(2-a-s):h/(a+s),r=function(t,e,i,o,a){return t===a?(e-i)/o+(e<i?6:0):e===a?(i-t)/o+2:(t-e)/o+4}(e,i,o,h,a),r=60*r+.5),[0|r,l||0,n]}function Ni(t,e,i,o){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,o)).map(Ai)}function Hi(t,e,i){return Ni(Ii,t,e,i)}function qi(t){return(t%360+360)%360}function Ui(t){const e=Fi.exec(t);let i,o=255;if(!e)return;e[5]!==i&&(o=e[6]?Ei(+e[5]):Ai(+e[5]));const a=qi(+e[2]),s=+e[3]/100,n=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return Ni(Vi,t,e,i)}(a,s,n):"hsv"===e[1]?function(t,e,i){return Ni(Ri,t,e,i)}(a,s,n):Hi(a,s,n),{r:i[0],g:i[1],b:i[2],a:o}}const Wi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ji={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let Yi;function Ki(t){Yi||(Yi=function(){const t={},e=Object.keys(ji),i=Object.keys(Wi);let o,a,s,n,r;for(o=0;o<e.length;o++){for(n=r=e[o],a=0;a<i.length;a++)s=i[a],r=r.replace(s,Wi[s]);s=parseInt(ji[n],16),t[r]=[s>>16&255,s>>8&255,255&s]}return t}(),Yi.transparent=[0,0,0,0]);const e=Yi[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const Xi=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const Gi=t=>
vendor: 5,523 bytes, line 1880
1880t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,Qi=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Ji(t,e,i){if(t){let o=Bi(t);o[e]=Math.max(0,Math.min(o[e]+o[e]*i,0===e?360:1)),o=Hi(o),t.r=o[0],t.g=o[1],t.b=o[2]}}function Zi(t,e){return t?Object.assign(e||{},t):t}function to(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=Ai(t[3]))):(e=Zi(t,{r:0,g:0,b:0,a:1})).a=Ai(e.a),e}function eo(t){return"r"===t.charAt(0)?function(t){const e=Xi.exec(t);let i,o,a,s=255;if(e){if(e[7]!==i){const t=+e[7];s=e[8]?Ei(t):_i(255*t,0,255)}return i=+e[1],o=+e[3],a=+e[5],i=255&(e[2]?Ei(i):_i(i,0,255)),o=255&(e[4]?Ei(o):_i(o,0,255)),a=255&(e[6]?Ei(a):_i(a,0,255)),{r:i,g:o,b:a,a:s}}}(t):Ui(t)}class io{constructor(t){if(t instanceof io)return t;const e=typeof t;let i;var o,a,s;"object"===e?i=to(t):"string"===e&&(s=(o=t).length,"#"===o[0]&&(4===s||5===s?a={r:255&17*Di[o[1]],g:255&17*Di[o[2]],b:255&17*Di[o[3]],a:5===s?17*Di[o[4]]:255}:7!==s&&9!==s||(a={r:Di[o[1]]<<4|Di[o[2]],g:Di[o[3]]<<4|Di[o[4]],b:Di[o[5]]<<4|Di[o[6]],a:9===s?Di[o[7]]<<4|Di[o[8]]:255})),i=a||Ki(t)||eo(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Zi(this._rgb);return t&&(t.a=$i(t.a)),t}set rgb(t){this._rgb=to(t)}rgbString(){return this._valid?function(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${$i(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}(this._rgb):void 0}hexString(){return this._valid?Pi(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=Bi(t),i=e[0],o=Li(e[1]),a=Li(e[2]);return t.a<255?`hsla(${i}, ${o}%, ${a}%, ${$i(t.a)})`:`hsl(${i}, ${o}%, ${a}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,o=t.rgb;let a;const s=e===a?.5:e,n=2*s-1,r=i.a-o.a,l=((n*r===-1?n:(n+r)/(1+n*r))+1)/2;a=1-l,i.r=255&l*i.r+a*o.r+.5,i.g=255&l*i.g+a*o.g+.5,i.b=255&l*i.b+a*o.b+.5,i.a=s*i.a+(1-s)*o.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const o=Qi($i(t.r)),a=Qi($i(t.g)),s=Qi($i(t.b));return{r:Ai(Gi(o+i*(Qi($i(e.r))-o))),g:Ai(Gi(a+i*(Qi($i(e.g))-a))),b:Ai(Gi(s+i*(Qi($i(e.b))-s))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new io(this.rgb)}alpha(t){return this._rgb.a=Ai(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=Si(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ji(this._rgb,2,t),this}darken(t){return Ji(this._rgb,2,-t),this}saturate(t){return Ji(this._rgb,1,t),this}desaturate(t){return Ji(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=Bi(t);i[0]=qi(i[0]+e),i=Hi(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function oo(){}const ao=(()=>{let t=0;return()=>t++})();function so(t){return null==t}function no(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function ro(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}function lo(t){return("number"==typeof t||t instanceof Number)&&isFinite(+t)}function ho(t,e){return lo(t)?t:e}function co(t,e){return void 0===t?e:t}const uo=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function po(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function mo(t,e,i,o){let a,s,n;if(no(t))if(s=t.length,o)for(a=s-1;a>=0;a--)e.call(i,t[a],a);else for(a=0;a<s;a++)e.call(i,t[a],a);else if(ro(t))for(n=Object.keys(t),s=n.length,a=0;a<s;a++)e.call(i,t[n[a]],n[a])}function fo(t,e){let i,o,a,s;if(!t||!e||t.length!==e.length)return!1;for(i=0,o=t.length;i<o;++i)if(a=t[i],s=e[i],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function go(t){if(no(t))return t.map(go);if(ro(t)){const e=Object.create(null),i=Object.keys(t),o=i.length;let a=0;for(;a<o;++a)e[i[a]]=go(t[i[a]]);return e}return t}function bo(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function vo(t,e,i,o){if(!bo(t))return;const a=e[t],s=i[t];ro(a)&&ro(s)?wo(a,s,o):e[t]=go(s)}function wo(t,e,i){const o=no(e)?e:[e],a=o.length;if(!ro(t))return t;const s=(i=i||{}).merger||vo;let n;for(let e=0;e<a;++e){if(n=o[e],!ro(n))continue;const a=Object.keys(n);for(let e=0,o=a.length;e<o;++e)s(a[e],t,n,i)}return t}function yo(t,e){return wo(t,e,{merger:xo})}function xo(t,e,i){if(!bo(t))return;const o=e[t],a=i[t];ro(o)&&ro(a)?yo(o,a):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=go(a))}const ko={"":t=>t,x:t=>t.x,y:t=>t.y};function Co(t,e){const i=ko[e]||(ko[e]=function(t){const e=function(t){const e=t.split("."),i=[];let o="";for(const t of e)o+=t,o.endsWith("\\")?o=o.slice(0,-1)+".":(i.push(o),o="");return i}(t);return t=>{for(const i of e){if(""===i)break;t=t&&t[i]}return t}}(e));return i(t)}function So(t){return t.charAt(0).toUpperCase()+t.slice(1)}const _o=t=>void 0!==t,Eo=t=>"function"==typeof t,Ao=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};const $o=Math.PI,Lo=2*$o,Do=Lo+$o,Mo=Number.POSITIVE_INFINITY,zo=$o/180,To=$o/2,Oo=$o/4,Po=2*$o/3,Fo=Math.log10,Io=Math.sign;function Ro(t,e,i){return Math.abs(t-e)<i}function Vo(t){const e=Math.round(t);t=Ro(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Fo(t))),o=t/i;return(o<=1?1:o<=2?2:o<=5?5:10)*i}function Bo(t){return!function(t){return"symbol"==typeof t||"object"==typeof t&&null!==t&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(t)&&!isNaN(parseFloat(t))&&isFinite(t)}
vendor: 6,198 bytes, line 1880
1880function No(t,e,i){let o,a,s;for(o=0,a=t.length;o<a;o++)s=t[o][i],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Ho(t){return t*($o/180)}function qo(t){return t*(180/$o)}function Uo(t){if(!lo(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Wo(t,e){const i=e.x-t.x,o=e.y-t.y,a=Math.sqrt(i*i+o*o);let s=Math.atan2(o,i);return s<-.5*$o&&(s+=Lo),{angle:s,distance:a}}function jo(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yo(t,e){return(t-e+Do)%Lo-$o}function Ko(t){return(t%Lo+Lo)%Lo}function Xo(t,e,i,o){const a=Ko(t),s=Ko(e),n=Ko(i),r=Ko(s-a),l=Ko(n-a),h=Ko(a-s),c=Ko(a-n);return a===s||a===n||o&&s===n||r>l&&h<c}function Go(t,e,i){return Math.max(e,Math.min(i,t))}function Qo(t,e,i,o=1e-6){return t>=Math.min(e,i)-o&&t<=Math.max(e,i)+o}function Jo(t,e,i){i=i||(i=>t[i]<e);let o,a=t.length-1,s=0;for(;a-s>1;)o=s+a>>1,i(o)?s=o:a=o;return{lo:s,hi:a}}const Zo=(t,e,i,o)=>Jo(t,i,o?o=>{const a=t[o][e];return a<i||a===i&&t[o+1][e]===i}:o=>t[o][e]<i),ta=(t,e,i)=>Jo(t,i,o=>t[o][e]>=i);const ea=["push","pop","shift","splice","unshift"];function ia(t,e){const i=t._chartjs;if(!i)return;const o=i.listeners,a=o.indexOf(e);-1!==a&&o.splice(a,1),o.length>0||(ea.forEach(e=>{delete t[e]}),delete t._chartjs)}function oa(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const aa="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function sa(t,e){let i=[],o=!1;return function(...a){i=a,o||(o=!0,aa.call(window,()=>{o=!1,t.apply(e,i)}))}}const na=t=>"start"===t?"left":"end"===t?"right":"center",ra=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function la(t,e,i){const o=e.length;let a=0,s=o;if(t._sorted){const{iScale:n,vScale:r,_parsed:l}=t,h=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,c=n.axis,{min:d,max:u,minDefined:p,maxDefined:m}=n.getUserBounds();if(p){if(a=Math.min(Zo(l,c,d).lo,i?o:Zo(e,c,n.getPixelForValue(d)).lo),h){const t=l.slice(0,a+1).reverse().findIndex(t=>!so(t[r.axis]));a-=Math.max(0,t)}a=Go(a,0,o-1)}if(m){let t=Math.max(Zo(l,n.axis,u,!0).hi+1,i?0:Zo(e,c,n.getPixelForValue(u),!0).hi+1);if(h){const e=l.slice(t-1).findIndex(t=>!so(t[r.axis]));t+=Math.max(0,e)}s=Go(t,a,o)-a}else s=o-a}return{start:a,count:s}}function ha(t){const{xScale:e,yScale:i,_scaleRanges:o}=t,a={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!o)return t._scaleRanges=a,!0;const s=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==i.min||o.ymax!==i.max;return Object.assign(o,a),s}const ca=t=>0===t||1===t,da=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*Lo/i),ua=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*Lo/i)+1,pa={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*To),easeOutSine:t=>Math.sin(t*To),easeInOutSine:t=>-.5*(Math.cos($o*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>ca(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>ca(t)?t:da(t,.075,.3),easeOutElastic:t=>ca(t)?t:ua(t,.075,.3),easeInOutElastic(t){const e=.1125;return ca(t)?t:t<.5?.5*da(2*t,e,.45):.5+.5*ua(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-pa.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*pa.easeInBounce(2*t):.5*pa.easeOutBounce(2*t-1)+.5};function ma(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function fa(t){return ma(t)?t:new io(t)}function ga(t){return ma(t)?t:new io(t).saturate(.5).darken(.1).hexString()}const ba=["x","y","borderWidth","radius","tension"],va=["color","borderColor","backgroundColor"];const wa=new Map;function ya(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let o=wa.get(i);return o||(o=new Intl.NumberFormat(t,e),wa.set(i,o)),o}(e,i).format(t)}const xa={values:t=>no(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const o=this.chart.options.locale;let a,s=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(a="scientific"),s=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const n=Fo(Math.abs(s)),r=isNaN(n)?1:Math.max(Math.min(-1*Math.floor(n),20),0),l={notation:a,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ya(t,o,l)},logarithmic(t,e,i){if(0===t)return"0";const o=i[e].significand||t/Math.pow(10,Math.floor(Fo(t)));return[1,2,3,5,10,15].includes(o)||e>.8*i.length?xa.numeric.call(this,t,e,i):""}};var ka={formatters:xa};const Ca=Object.create(null),Sa=Object.create(null);function _a(t,e){if(!e)return t;const i=e.split(".");for(let e=0,o=i.length;e<o;++e){const o=i[e];t=t[o]||(t[o]=Object.create(null))}return t}function Ea(t,e,i){return"string"==typeof e?wo(_a(t,e),i):wo(_a(t,""),e)}class Aa{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
vendor: 3,706 bytes, line 1880
1880,this.hoverBackgroundColor=(t,e)=>ga(e.backgroundColor),this.hoverBorderColor=(t,e)=>ga(e.borderColor),this.hoverColor=(t,e)=>ga(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ea(this,t,e)}get(t){return _a(this,t)}describe(t,e){return Ea(Sa,t,e)}override(t,e){return Ea(Ca,t,e)}route(t,e,i,o){const a=_a(this,t),s=_a(this,i),n="_"+e;Object.defineProperties(a,{[n]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[n],e=s[o];return ro(t)?Object.assign({},e,t):co(t,e)},set(t){this[n]=t}}})}apply(t){t.forEach(t=>t(this))}}var $a=new Aa({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),t.set("animations",{colors:{type:"color",properties:va},numbers:{type:"number",properties:ba}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ka.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t&&"dash"!==t}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t})}]);function La(t,e,i,o,a){let s=e[a];return s||(s=e[a]=t.measureText(a).width,i.push(a)),s>o&&(o=s),o}function Da(t,e,i,o){let a=(o=o||{}).data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(a=o.data={},s=o.garbageCollect=[],o.font=e),t.save(),t.font=e;let n=0;const r=i.length;let l,h,c,d,u;for(l=0;l<r;l++)if(d=i[l],null==d||no(d)){if(no(d))for(h=0,c=d.length;h<c;h++)u=d[h],null==u||no(u)||(n=La(t,a,s,n,u))}else n=La(t,a,s,n,d);t.restore();const p=s.length/2;if(p>i.length){for(l=0;l<p;l++)delete a[s[l]];s.splice(0,p)}return n}function Ma(t,e,i){const o=t.currentDevicePixelRatio,a=0!==i?Math.max(i/2,.5):0;return Math.round((e-a)*o)/o+a}function za(t,e){(e||t)&&((e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}
vendor: 20,433 bytes, line 1880
1880function Ta(t,e,i,o){Oa(t,e,i,o,null)}function Oa(t,e,i,o,a){let s,n,r,l,h,c,d,u;const p=e.pointStyle,m=e.rotation,f=e.radius;let g=(m||0)*zo;if(p&&"object"==typeof p&&(s=p.toString(),"[object HTMLImageElement]"===s||"[object HTMLCanvasElement]"===s))return t.save(),t.translate(i,o),t.rotate(g),t.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),void t.restore();if(!(isNaN(f)||f<=0)){switch(t.beginPath(),p){default:a?t.ellipse(i,o,a/2,f,0,0,Lo):t.arc(i,o,f,0,Lo),t.closePath();break;case"triangle":c=a?a/2:f,t.moveTo(i+Math.sin(g)*c,o-Math.cos(g)*f),g+=Po,t.lineTo(i+Math.sin(g)*c,o-Math.cos(g)*f),g+=Po,t.lineTo(i+Math.sin(g)*c,o-Math.cos(g)*f),t.closePath();break;case"rectRounded":h=.516*f,l=f-h,n=Math.cos(g+Oo)*l,d=Math.cos(g+Oo)*(a?a/2-h:l),r=Math.sin(g+Oo)*l,u=Math.sin(g+Oo)*(a?a/2-h:l),t.arc(i-d,o-r,h,g-$o,g-To),t.arc(i+u,o-n,h,g-To,g),t.arc(i+d,o+r,h,g,g+To),t.arc(i-u,o+n,h,g+To,g+$o),t.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*f,c=a?a/2:l,t.rect(i-c,o-l,2*c,2*l);break}g+=Oo;case"rectRot":d=Math.cos(g)*(a?a/2:f),n=Math.cos(g)*f,r=Math.sin(g)*f,u=Math.sin(g)*(a?a/2:f),t.moveTo(i-d,o-r),t.lineTo(i+u,o-n),t.lineTo(i+d,o+r),t.lineTo(i-u,o+n),t.closePath();break;case"crossRot":g+=Oo;case"cross":d=Math.cos(g)*(a?a/2:f),n=Math.cos(g)*f,r=Math.sin(g)*f,u=Math.sin(g)*(a?a/2:f),t.moveTo(i-d,o-r),t.lineTo(i+d,o+r),t.moveTo(i+u,o-n),t.lineTo(i-u,o+n);break;case"star":d=Math.cos(g)*(a?a/2:f),n=Math.cos(g)*f,r=Math.sin(g)*f,u=Math.sin(g)*(a?a/2:f),t.moveTo(i-d,o-r),t.lineTo(i+d,o+r),t.moveTo(i+u,o-n),t.lineTo(i-u,o+n),g+=Oo,d=Math.cos(g)*(a?a/2:f),n=Math.cos(g)*f,r=Math.sin(g)*f,u=Math.sin(g)*(a?a/2:f),t.moveTo(i-d,o-r),t.lineTo(i+d,o+r),t.moveTo(i+u,o-n),t.lineTo(i-u,o+n);break;case"line":n=a?a/2:Math.cos(g)*f,r=Math.sin(g)*f,t.moveTo(i-n,o-r),t.lineTo(i+n,o+r);break;case"dash":t.moveTo(i,o),t.lineTo(i+Math.cos(g)*(a?a/2:f),o+Math.sin(g)*f);break;case!1:t.closePath()}t.fill(),e.borderWidth>0&&t.stroke()}}function Pa(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function Fa(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ia(t){t.restore()}function Ra(t,e,i,o,a){if(!e)return t.lineTo(i.x,i.y);if("middle"===a){const o=(e.x+i.x)/2;t.lineTo(o,e.y),t.lineTo(o,i.y)}else"after"===a!=!!o?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Va(t,e,i,o){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(o?e.cp1x:e.cp2x,o?e.cp1y:e.cp2y,o?i.cp2x:i.cp1x,o?i.cp2y:i.cp1y,i.x,i.y)}function Ba(t,e,i,o,a){if(a.strikethrough||a.underline){const s=t.measureText(o),n=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,l=i-s.actualBoundingBoxAscent,h=i+s.actualBoundingBoxDescent,c=a.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(n,c),t.lineTo(r,c),t.stroke()}}function Na(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Ha(t,e,i,o,a,s={}){const n=no(e)?e:[e],r=s.strokeWidth>0&&""!==s.strokeColor;let l,h;for(t.save(),t.font=a.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),so(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,s),l=0;l<n.length;++l)h=n[l],s.backdrop&&Na(t,s.backdrop),r&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),so(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(h,i,o,s.maxWidth)),t.fillText(h,i,o,s.maxWidth),Ba(t,i,o,h,s),o+=Number(a.lineHeight);t.restore()}function qa(t,e){const{x:i,y:o,w:a,h:s,radius:n}=e;t.arc(i+n.topLeft,o+n.topLeft,n.topLeft,1.5*$o,$o,!0),t.lineTo(i,o+s-n.bottomLeft),t.arc(i+n.bottomLeft,o+s-n.bottomLeft,n.bottomLeft,$o,To,!0),t.lineTo(i+a-n.bottomRight,o+s),t.arc(i+a-n.bottomRight,o+s-n.bottomRight,n.bottomRight,To,0,!0),t.lineTo(i+a,o+n.topRight),t.arc(i+a-n.topRight,o+n.topRight,n.topRight,0,-To,!0),t.lineTo(i+n.topLeft,o)}const Ua=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Wa=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ja(t,e){const i=(""+t).match(Ua);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}const Ya=t=>+t||0;function Ka(t,e){const i={},o=ro(e),a=o?Object.keys(e):e,s=ro(t)?o?i=>co(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of a)i[t]=Ya(s(t));return i}function Xa(t){return Ka(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ga(t){return Ka(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Qa(t){const e=Xa(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ja(t,e){t=t||{},e=e||$a.font;let i=co(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let o=co(t.style,e.style);o&&!(""+o).match(Wa)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const a={family:co(t.family,e.family),lineHeight:ja(co(t.lineHeight,e.lineHeight),i),size:i,style:o,weight:co(t.weight,e.weight),string:""};return a.string=function(t){return!t||so(t.size)||so(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(a),a}function Za(t,e,i,o){let a,s,n,r=!0;for(a=0,s=t.length;a<s;++a)if(n=t[a],void 0!==n&&(void 0!==e&&"function"==typeof n&&(n=n(e),r=!1),void 0!==i&&no(n)&&(n=n[i%n.length],r=!1),void 0!==n))return o&&!r&&(o.cacheable=!1),n}function ts(t,e){return Object.assign(Object.create(t),e)}function es(t,e=[""],i,o,a=()=>t[0]){const s=i||t;void 0===o&&(o=us("_fallback",t));const n={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:o,_getTarget:a,override:i=>es([i,...t],e,s,o)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,o)=>ns(i,o,()=>function(t,e,i,o){let a;for(const s of e)if(a=us(as(s,t),i),void 0!==a)return ss(t,a)?cs(i,o,t,a):a}(o,e,t,i)),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>ps(t).includes(e),ownKeys:t=>ps(t),set(t,e,i){const o=t._storage||(t._storage=a());return t[e]=o[e]=i,delete t._keys,!0}})}function is(t,e,i,o){const a={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:os(t,o),setContext:e=>is(t,e,i,o),override:a=>is(t.override(a),e,i,o)};return new Proxy(a,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ns(t,e,()=>function(t,e,i){const{_proxy:o,_context:a,_subProxy:s,_descriptors:n}=t;let r=o[e];Eo(r)&&n.isScriptable(e)&&(r=function(t,e,i,o){const{_proxy:a,_context:s,_subProxy:n,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t);let l=e(s,n||o);r.delete(t),ss(t,l)&&(l=cs(a._scopes,a,t,l));return l}(e,r,t,i));no(r)&&r.length&&(r=function(t,e,i,o){const{_proxy:a,_context:s,_subProxy:n,_descriptors:r}=i;if(void 0!==s.index&&o(t))return e[s.index%e.length];if(ro(e[0])){const i=e,o=a._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=cs(o,a,t,l);e.push(is(i,s,n&&n[t],r))}}return e}(e,r,t,n.isIndexable));ss(e,r)&&(r=is(r,a,s&&s[e],n));return r}(t,e,i)),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,o)=>(t[i]=o,delete e[i],!0)})}function os(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:o=e.indexable,_allKeys:a=e.allKeys}=t;return{allKeys:a,scriptable:i,indexable:o,isScriptable:Eo(i)?i:()=>i,isIndexable:Eo(o)?o:()=>o}}const as=(t,e)=>t?t+So(e):e,ss=(t,e)=>ro(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ns(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||"constructor"===e)return t[e];const o=i();return t[e]=o,o}function rs(t,e,i){return Eo(t)?t(e,i):t}const ls=(t,e)=>!0===t?e:"string"==typeof t?Co(e,t):void 0;function hs(t,e,i,o,a){for(const s of e){const e=ls(i,s);if(e){t.add(e);const s=rs(e._fallback,i,a);if(void 0!==s&&s!==i&&s!==o)return s}else if(!1===e&&void 0!==o&&i!==o)return null}return!1}function cs(t,e,i,o){const a=e._rootScopes,s=rs(e._fallback,i,o),n=[...t,...a],r=new Set;r.add(o);let l=ds(r,n,i,s||i,o);return null!==l&&((void 0===s||s===i||(l=ds(r,n,s,l,o),null!==l))&&es(Array.from(r),[""],a,s,()=>function(t,e,i){const o=t._getTarget();e in o||(o[e]={});const a=o[e];if(no(a)&&ro(i))return i;return a||{}}(e,i,o)))}function ds(t,e,i,o,a){for(;i;)i=hs(t,e,i,o,a);return i}function us(t,e){for(const i of e){if(!i)continue;const e=i[t];if(void 0!==e)return e}}function ps(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}(t._scopes)),e}function ms(t,e,i,o){const{iScale:a}=t,{key:s="r"}=this._parsing,n=new Array(o);let r,l,h,c;for(r=0,l=o;r<l;++r)h=r+i,c=e[h],n[r]={r:a.parse(Co(c,s),h)};return n}const fs=Number.EPSILON||1e-14,gs=(t,e)=>e<t.length&&!t[e].skip&&t[e],bs=t=>"x"===t?"y":"x";function vs(t,e,i,o){const a=t.skip?e:t,s=e,n=i.skip?e:i,r=jo(s,a),l=jo(n,s);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=o*h,u=o*c;return{previous:{x:s.x-d*(n.x-a.x),y:s.y-d*(n.y-a.y)},next:{x:s.x+u*(n.x-a.x),y:s.y+u*(n.y-a.y)}}}function ws(t,e="x"){const i=bs(e),o=t.length,a=Array(o).fill(0),s=Array(o);let n,r,l,h=gs(t,0);for(n=0;n<o;++n)if(r=l,l=h,h=gs(t,n+1),l){if(h){const t=h[e]-l[e];a[n]=0!==t?(h[i]-l[i])/t:0}s[n]=r?h?Io(a[n-1])!==Io(a[n])?0:(a[n-1]+a[n])/2:a[n-1]:a[n]}!function(t,e,i){const o=t.length;let a,s,n,r,l,h=gs(t,0);for(let c=0;c<o-1;++c)l=h,h=gs(t,c+1),l&&h&&(Ro(e[c],0,fs)?i[c]=i[c+1]=0:(a=i[c]/e[c],s=i[c+1]/e[c],r=Math.pow(a,2)+Math.pow(s,2),r<=9||(n=3/Math.sqrt(r),i[c]=a*n*e[c],i[c+1]=s*n*e[c])))}(t,a,s),function(t,e,i="x"){const o=bs(i),a=t.length;let s,n,r,l=gs(t,0);for(let h=0;h<a;++h){if(n=r,r=l,l=gs(t,h+1),!r)continue;const a=r[i],c=r[o];n&&(s=(a-n[i])/3,r[`cp1${i}`]=a-s,r[`cp1${o}`]=c-s*e[h]),l&&(s=(l[i]-a)/3,r[`cp2${i}`]=a+s,r[`cp2${o}`]=c+s*e[h])}}(t,s,e)}function ys(t,e,i){return Math.max(Math.min(t,i),e)}function xs(t,e,i,o,a){let s,n,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)ws(t,a);else{let i=o?t[t.length-1]:t[0];for(s=0,n=t.length;s<n;++s)r=t[s],l=vs(i,r,t[Math.min(s+1,n-(o?0:1))%n],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,o,a,s,n,r=Pa(t[0],e);for(i=0,o=t.length;i<o;++i)n=s,s=r,r=i<o-1&&Pa(t[i+1],e),s&&(a=t[i],n&&(a.cp1x=ys(a.cp1x,e.left,e.right),a.cp1y=ys(a.cp1y,e.top,e.bottom)),r&&(a.cp2x=ys(a.cp2x,e.left,e.right),a.cp2y=ys(a.cp2y,e.top,e.bottom)))}(t,i)}function ks(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Cs(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function Ss(t,e,i){let o;return"string"==typeof t?(o=parseInt(t,10),-1!==t.indexOf("%")&&(o=o/100*e.parentNode[i])):o=t,o}const _s=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);const Es=["top","right","bottom","left"];function As(t,e,i){const o={};i=i?"-"+i:"";for(let a=0;a<4;a++){const s=Es[a];o[s]=parseFloat(t[e+"-"+s+i])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}function $s(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:o}=e,a=_s(i),s="border-box"===a.boxSizing,n=As(a,"padding"),r=As(a,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,o=i&&i.length?i[0]:t,{offsetX:a,offsetY:s}=o;let n,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(a,s,t.target))n=a,r=s;else{const t=e.getBoundingClientRect();n=o.clientX-t.left,r=o.clientY-t.top,l=!0}return{x:n,y:r,box:l}}(t,i),d=n.left+(c&&r.left),u=n.top+(c&&r.top);let{width:p,height:m}=e;return s&&(p-=n.width+r.width,m-=n.height+r.height),{x:Math.round((l-d)/p*i.width/o),y:Math.round((h-u)/m*i.height/o)}}const Ls=t=>Math.round(10*t)/10;function Ds(t,e,i,o){const a=_s(t),s=As(a,"margin"),n=Ss(a.maxWidth,t,"clientWidth")||Mo,r=Ss(a.maxHeight,t,"clientHeight")||Mo,l=function(t,e,i){let o,a;if(void 0===e||void 0===i){const s=t&&Cs(t);if(s){const t=s.getBoundingClientRect(),n=_s(s),r=As(n,"border","width"),l=As(n,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,o=Ss(n.maxWidth,s,"clientWidth"),a=Ss(n.maxHeight,s,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:o||Mo,maxHeight:a||Mo}}(t,e,i);let{width:h,height:c}=l;if("content-box"===a.boxSizing){const t=As(a,"border","width"),e=As(a,"padding");h-=e.width+t.width,c-=e.height+t.height}h=Math.max(0,h-s.width),c=Math.max(0,o?h/o:c-s.height),h=Ls(Math.min(h,n,l.maxWidth)),c=Ls(Math.min(c,r,l.maxHeight)),h&&!c&&(c=Ls(h/2));return(void 0!==e||void 0!==i)&&o&&l.height&&c>l.height&&(c=l.height,h=Ls(Math.floor(c*o))),{width:h,height:c}}function Ms(t,e,i){const o=e||1,a=Ls(t.height*o),s=Ls(t.width*o);t.height=Ls(t.height),t.width=Ls(t.width);const n=t.canvas;return n.style&&(i||!n.style.height&&!n.style.width)&&(n.style.height=`${t.height}px`,n.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==o||n.height!==a||n.width!==s)&&(t.currentDevicePixelRatio=o,n.height=a,n.width=s,t.ctx.setTransform(o,0,0,o,0,0),!0)}const zs=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};ks()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch(t){}return t}();function Ts(t,e){const i=function(t,e){return _s(t).getPropertyValue(e)}(t,e),o=i&&i.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function Os(t,e,i,o){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ps(t,e,i,o){return{x:t.x+i*(e.x-t.x),y:"middle"===o?i<.5?t.y:e.y:"after"===o?i<1?t.y:e.y:i>0?e.y:t.y}}function Fs(t,e,i,o){const a={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},n=Os(t,a,i),r=Os(a,s,i),l=Os(s,e,i),h=Os(n,r,i),c=Os(r,l,i);return Os(h,c,i)}function Is(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Rs(t,e){let i,o;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,o=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=o)}function Vs(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Bs(t){return"angle"===t?{between:Xo,compare:Yo,normalize:Ko}:{between:Qo,compare:(t,e)=>t-e,normalize:t=>t}}function Ns({start:t,end:e,count:i,loop:o,style:a}){return{start:t%i,end:e%i,loop:o&&(e-t+1)%i==0,style:a}}function Hs(t,e,i){if(!i)return[t];const{property:o,start:a,end:s}=i,n=e.length,{compare:r,between:l,normalize:h}=Bs(o),{start:c,end:d,loop:u,style:p}=function(t,e,i){const{property:o,start:a,end:s}=i,{between:n,normalize:r}=Bs(o),l=e.length;let h,c,{start:d,end:u,loop:p}=t;if(p){for(d+=l,u+=l,h=0,c=l;h<c&&n(r(e[d%l][o]),a,s);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:p,style:t.style}}(t,e,i),m=[];let f,g,b,v=!1,w=null;const y=()=>v||l(a,b,f)&&0!==r(a,b),x=()=>!v||0===r(s,f)||l(s,b,f);for(let t=c,i=c;t<=d;++t)g=e[t%n],g.skip||(f=h(g[o]),f!==b&&(v=l(f,a,s),null===w&&y()&&(w=0===r(f,a)?t:i),null!==w&&x()&&(m.push(Ns({start:w,end:t,loop:u,count:n,style:p})),w=null),i=t,b=f));return null!==w&&m.push(Ns({start:w,end:d,loop:u,count:n,style:p})),m}function qs(t,e){const i=[],o=t.segments;for(let a=0;a<o.length;a++){const s=Hs(o[a],t.points,e);s.length&&i.push(...s)}return i}function Us(t,e,i,o){return o&&o.setContext&&i?function(t,e,i,o){const a=t._chart.getContext(),s=Ws(t.options),{_datasetIndex:n,options:{spanGaps:r}}=t,l=i.length,h=[];let c=s,d=e[0].start,u=d;function p(t,e,o,a){const s=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=s;for(;i[e%l].skip;)e+=s;t%l!==e%l&&(h.push({start:t%l,end:e%l,loop:o,style:a}),c=a,d=e%l)}}for(const t of e){d=r?d:t.start;let e,s=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Ws(o.setContext(ts(a,{type:"segment",p0:s,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:n}))),js(e,c)&&p(d,u-1,t.loop,c),s=r,c=e}d<u-1&&p(d,u-1,t.loop,c)}return h}(t,e,i,o):e}function Ws(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function js(t,e){if(!e)return!1;const i=[],o=function(t,e){return ma(e)?(i.includes(e)||i.push(e),i.indexOf(e)):e};return JSON.stringify(t,o)!==JSON.stringify(e,o)}function Ys(t,e,i){return t.options.clip?t[i]:e[i]}function Ks(t,e){const i=e._clip;if(i.disabled)return!1;const o=function(t,e){const{xScale:i,yScale:o}=t;return i&&o?{left:Ys(i,e,"left"),right:Ys(i,e,"right"),top:Ys(o,e,"top"),bottom:Ys(o,e,"bottom")}:e}(e,t.chartArea);return{left:!1===i.left?0:o.left-(!0===i.left?0:i.left),right:!1===i.right?t.width:o.right+(!0===i.right?0:i.right),top:!1===i.top?0:o.top-(!0===i.top?0:i.top),bottom:!1===i.bottom?t.height:o.bottom+(!0===i.bottom?0:i.bottom)}}class Xs{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,o){const a=e.listeners[o],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=aa.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,o)=>{if(!i.running||!i.items.length)return;const a=i.items;let s,n=a.length-1,r=!1;for(;n>=0;--n)s=a[n],s._active?(s._total>i.duration&&(i.duration=s._total),s.tick(t),r=!0):(a[n]=a[a.length-1],a.pop());r&&(o.draw(),this._notify(o,i,t,"progress")),a.length||(i.running=!1,this._notify(o,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let o=i.length-1;for(;o>=0;--o)i[o].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Gs=new Xs;const Qs="transparent",Js={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const o=fa(t||Qs),a=o.valid&&fa(e||Qs);return a&&a.valid?a.mix(o,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class Zs{constructor(t,e,i,o){const a=e[i];o=Za([t.to,o,a,t.from]);const s=Za([t.from,a,o]);this._active=!0,this._fn=t.fn||Js[t.type||typeof s],this._easing=pa[t.easing]||pa.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const o=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Za([t.to,e,o,t.from]),this._from=Za([t.from,o,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,o=this._prop,a=this._from,s=this._loop,n=this._to;let r;if(this._active=a!==n&&(s||e<i),!this._active)return this._target[o]=n,void this._notify(!0);e<0?this._target[o]=a:(r=e/i%2,r=s&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[o]=this._fn(a,n,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}class tn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ro(t))return;const e=Object.keys($a.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const a=t[o];if(!ro(a))return;const s={};for(const t of e)s[t]=a[t];
vendor: 4,980 bytes, line 1880
1880(no(a.properties)&&a.properties||[o]).forEach(t=>{t!==o&&i.has(t)||i.set(t,s)})})}_animateOptions(t,e){const i=e.options,o=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!o)return[];const a=this._createAnimations(o,i);return i.$shared&&function(t,e){const i=[],o=Object.keys(e);for(let e=0;e<o.length;e++){const a=t[o[e]];a&&a.active()&&i.push(a.wait())}return Promise.all(i)}(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,o=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),n=Date.now();let r;for(r=s.length-1;r>=0;--r){const l=s[r];if("$"===l.charAt(0))continue;if("options"===l){o.push(...this._animateOptions(t,e));continue}const h=e[l];let c=a[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,n);continue}c.cancel()}d&&d.duration?(a[l]=c=new Zs(d,t,l,h),o.push(c)):t[l]=h}return o}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(Gs.add(this._chart,i),!0):void 0}}function en(t,e){const i=t&&t.options||{},o=i.reverse,a=void 0===i.min?e:0,s=void 0===i.max?e:0;return{start:o?s:a,end:o?a:s}}function on(t,e){const i=[],o=t._getSortedDatasetMetas(e);let a,s;for(a=0,s=o.length;a<s;++a)i.push(o[a].index);return i}function an(t,e,i,o={}){const a=t.keys,s="single"===o.mode;let n,r,l,h;if(null===e)return;let c=!1;for(n=0,r=a.length;n<r;++n){if(l=+a[n],l===i){if(c=!0,o.all)continue;break}h=t.values[l],lo(h)&&(s||0===e||Io(e)===Io(h))&&(e+=h)}return c||o.all?e:0}function sn(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function nn(t,e,i){const o=t[e]||(t[e]={});return o[i]||(o[i]={})}function rn(t,e,i,o){for(const a of e.getMatchingVisibleMetas(o).reverse()){const e=t[a.index];if(i&&e>0||!i&&e<0)return a.index}return null}function ln(t,e){const{chart:i,_cachedMeta:o}=t,a=i._stacks||(i._stacks={}),{iScale:s,vScale:n,index:r}=o,l=s.axis,h=n.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(s,n,o),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:s,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=nn(a,c,s),u[r]=d,u._top=rn(u,n,!0,o.type),u._bottom=rn(u,n,!1,o.type);(u._visualValues||(u._visualValues={}))[r]=d}}function hn(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function cn(t,e){const i=t.controller.index,o=t.vScale&&t.vScale.axis;if(o){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[o]||void 0===e[o][i])return;delete e[o][i],void 0!==e[o]._visualValues&&void 0!==e[o]._visualValues[i]&&delete e[o]._visualValues[i]}}}const dn=t=>"reset"===t||"none"===t,un=(t,e)=>e?t:Object.assign({},t);class pn{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=sn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&cn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),o=(t,e,i,o)=>"x"===t?e:"r"===t?o:i,a=e.xAxisID=co(i.xAxisID,hn(t,"x")),s=e.yAxisID=co(i.yAxisID,hn(t,"y")),n=e.rAxisID=co(i.rAxisID,hn(t,"r")),r=e.indexAxis,l=e.iAxisID=o(r,a,s,n),h=e.vAxisID=o(r,s,a,n);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(n),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ia(this._data,this),t._stacked&&cn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ro(e)){const t=this._cachedMeta;this._data=function(t,e){const{iScale:i,vScale:o}=e,a="x"===i.axis?"x":"y",s="x"===o.axis?"x":"y",n=Object.keys(t),r=new Array(n.length);let l,h,c;for(l=0,h=n.length;l<h;++l)c=n[l],r[l]={[a]:c,[s]:t[c]};return r}(e,t)}else if(i!==e){if(i){ia(i,this);const t=this._cachedMeta;cn(t),t._parsed=[]}
vendor: 8,843 bytes, line 1880
1880e&&Object.isExtensible(e)&&(a=this,(o=e)._chartjs?o._chartjs.listeners.push(a):(Object.defineProperty(o,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[a]}}),ea.forEach(t=>{const e="_onData"+So(t),i=o[t];Object.defineProperty(o,t,{configurable:!0,enumerable:!1,value(...t){const a=i.apply(this,t);return o._chartjs.listeners.forEach(i=>{"function"==typeof i[e]&&i[e](...t)}),a}})}))),this._syncList=[],this._data=e}var o,a}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let o=!1;this._dataCheck();const a=e._stacked;e._stacked=sn(e.vScale,e),e.stack!==i.stack&&(o=!0,cn(e),e.stack=i.stack),this._resyncElements(t),(o||a!==e._stacked)&&(ln(this,e._parsed),e._stacked=sn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:o}=this,{iScale:a,_stacked:s}=i,n=a.axis;let r,l,h,c=0===t&&e===o.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=o,i._sorted=!0,h=o;else{h=no(o[t])?this.parseArrayData(i,o,t,e):ro(o[t])?this.parseObjectData(i,o,t,e):this.parsePrimitiveData(i,o,t,e);const a=()=>null===l[n]||d&&l[n]<d[n];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(a()&&(c=!1),d=l);i._sorted=c}s&&ln(this,h)}parsePrimitiveData(t,e,i,o){const{iScale:a,vScale:s}=t,n=a.axis,r=s.axis,l=a.getLabels(),h=a===s,c=new Array(o);let d,u,p;for(d=0,u=o;d<u;++d)p=d+i,c[d]={[n]:h||a.parse(l[p],p),[r]:s.parse(e[p],p)};return c}parseArrayData(t,e,i,o){const{xScale:a,yScale:s}=t,n=new Array(o);let r,l,h,c;for(r=0,l=o;r<l;++r)h=r+i,c=e[h],n[r]={x:a.parse(c[0],h),y:s.parse(c[1],h)};return n}parseObjectData(t,e,i,o){const{xScale:a,yScale:s}=t,{xAxisKey:n="x",yAxisKey:r="y"}=this._parsing,l=new Array(o);let h,c,d,u;for(h=0,c=o;h<c;++h)d=h+i,u=e[d],l[h]={x:a.parse(Co(u,n),d),y:s.parse(Co(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const o=this.chart,a=this._cachedMeta,s=e[t.axis];return an({keys:on(o,!0),values:e._stacks[t.axis]._visualValues},s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,o){const a=i[e.axis];let s=null===a?NaN:a;const n=o&&i._stacks[e.axis];o&&n&&(o.values=n,s=an(o,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,o=i._parsed,a=i._sorted&&t===i.iScale,s=o.length,n=this._getOtherScale(t),r=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:on(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:o,maxDefined:a}=t.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:a?i:Number.POSITIVE_INFINITY}}(n);let d,u;function p(){u=o[d];const e=u[n.axis];return!lo(u[t.axis])||h>e||c<e}for(d=0;d<s&&(p()||(this.updateRangeFromParsed(l,t,u,r),!a));++d);if(a)for(d=s-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let o,a,s;for(o=0,a=e.length;o<a;++o)s=e[o][t.axis],lo(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,o=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:o?""+o.getLabelForValue(a[o.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,o,a;return ro(t)?(e=t.top,i=t.right,o=t.bottom,a=t.left):e=i=o=a=t,{top:e,right:i,bottom:o,left:a,disabled:!1===t}}(co(this.options.clip,function(t,e,i){if(!1===i)return!1;const o=en(t,i),a=en(e,i);return{top:a.end,right:o.end,bottom:a.start,left:o.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,o=i.data||[],a=e.chartArea,s=[],n=this._drawStart||0,r=this._drawCount||o.length-n,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,a,n,r),h=n;h<n+r;++h){const e=o[h];e.hidden||(e.active&&l?s.push(e):e.draw(t,a))}for(h=0;h<s.length;++h)s[h].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const o=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];a=e.$context||(e.$context=function(t,e,i){return ts(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),a.parsed=this.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=function(t,e){return ts(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),a.dataset=o,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const o="active"===e,a=this._cachedDataOpts,s=t+"-"+e,n=a[s],r=this.enableOptionSharing&&_o(i);if(n)return un(n,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=o?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys($a.elements[t]),p=l.resolveNamedOptions(d,u,()=>this.getContext(i,o,e),c);return p.$shared&&(p.$shared=r,a[s]=Object.freeze(un(p,r))),p}_resolveAnimations(t,e,i){const o=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,n=a[s];if(n)return n;let r;if(!1!==o.options.animation){const o=this.chart.config,a=o.datasetAnimationScopeKeys(this._type,e),s=o.getOptionScopes(this.getDataset(),a);r=o.createResolver(s,this.getContext(t,i,e))}const l=new tn(o,r&&r.animations);return r&&r._cacheable&&(a[s]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||dn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),o=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==o;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,o){dn(o)?Object.assign(t,i):this._resolveAnimations(e,o).update(t,i)}updateSharedOptions(t,e,i){t&&!dn(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,o){t.active=o;const a=this.getStyle(e,o);this._resolveAnimations(e,i,o).update(t,{options:!o&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const o=i.length,a=e.length,s=Math.min(a,o);s&&this.parse(0,s),a>o?this._insertElements(o,a-o,t):a<o&&this._removeElements(a,o-a)}_insertElements(t,e,i=!0){const o=this._cachedMeta,a=o.data,s=t+e;let n;const r=t=>{for(t.length+=e,n=t.length-1;n>=s;n--)t[n]=t[n-e]};for(r(a),n=t;n<s;++n)a[n]=new this.dataElementType;this._parsing&&r(o._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,o){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const o=i._parsed.splice(t,e);i._stacked&&cn(i,o)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,o]=t;this[e](i,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function mn(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let o=[];for(let e=0,a=i.length;e<a;e++)o=o.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=oa(o.sort((t,e)=>t-e))}return t._cache.$bar}(e,t.type);let o,a,s,n,r=e._length;const l=()=>{32767!==s&&-32768!==s&&(_o(n)&&(r=Math.min(r,Math.abs(s-n)||r)),n=s)};for(o=0,a=i.length;o<a;++o)s=e.getPixelForValue(i[o]),l();for(n=void 0,o=0,a=e.ticks.length;o<a;++o)s=e.getPixelForTick(o),l();return r}
vendor: 11,064 bytes, line 1880
1880function fn(t,e,i,o){return no(t)?function(t,e,i,o){const a=i.parse(t[0],o),s=i.parse(t[1],o),n=Math.min(a,s),r=Math.max(a,s);let l=n,h=r;Math.abs(n)>Math.abs(r)&&(l=r,h=n),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:a,end:s,min:n,max:r}}(t,e,i,o):e[i.axis]=i.parse(t,o),e}function gn(t,e,i,o){const a=t.iScale,s=t.vScale,n=a.getLabels(),r=a===s,l=[];let h,c,d,u;for(h=i,c=i+o;h<c;++h)u=e[h],d={},d[a.axis]=r||a.parse(n[h],h),l.push(fn(u,d,s,h));return l}function bn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function vn(t,e,i,o){let a=e.borderSkipped;const s={};if(!a)return void(t.borderSkipped=s);if(!0===a)return void(t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0});const{start:n,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,o,a,s;return t.horizontal?(e=t.base>t.x,i="left",o="right"):(e=t.base<t.y,i="bottom",o="top"),e?(a="end",s="start"):(a="start",s="end"),{start:i,end:o,reverse:e,top:a,bottom:s}}(t);"middle"===a&&i&&(t.enableBorderRadius=!0,(i._top||0)===o?a=h:(i._bottom||0)===o?a=c:(s[wn(c,n,r,l)]=!0,a=h)),s[wn(a,n,r,l)]=!0,t.borderSkipped=s}function wn(t,e,i,o){var a,s,n;return o?(n=i,t=yn(t=(a=t)===(s=e)?n:a===n?s:a,i,e)):t=yn(t,e,i),t}function yn(t,e,i){return"start"===t?e:"end"===t?i:t}function xn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class kn extends pn{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,e,i,o){return gn(t,e,i,o)}parseArrayData(t,e,i,o){return gn(t,e,i,o)}parseObjectData(t,e,i,o){const{iScale:a,vScale:s}=t,{xAxisKey:n="x",yAxisKey:r="y"}=this._parsing,l="x"===a.axis?n:r,h="x"===s.axis?n:r,c=[];let d,u,p,m;for(d=i,u=i+o;d<u;++d)m=e[d],p={},p[a.axis]=a.parse(Co(m,l),d),c.push(fn(Co(m,h),p,s,d));return c}updateRangeFromParsed(t,e,i,o){super.updateRangeFromParsed(t,e,i,o);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:o}=e,a=this.getParsed(t),s=a._custom,n=bn(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(a[o.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:n}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,o){const a="reset"===o,{index:s,_cachedMeta:{vScale:n}}=this,r=n.getBasePixel(),l=n.isHorizontal(),h=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,o);for(let u=e;u<e+i;u++){const e=this.getParsed(u),i=a||so(e[n.axis])?{base:r,head:r}:this._calculateBarValuePixels(u),p=this._calculateBarIndexPixels(u,h),m=(e._stacks||{})[n.axis],f={horizontal:l,base:i.base,enableBorderRadius:!m||bn(e._custom)||s===m._top||s===m._bottom,x:l?i.head:p.center,y:l?p.center:i.head,height:l?p.size:Math.abs(i.size),width:l?Math.abs(i.size):p.size};d&&(f.options=c||this.resolveDataElementOptions(u,t[u].active?"active":o));const g=f.options||t[u].options;vn(f,g,m,s),xn(f,g,h.ratio),this.updateElement(t[u],u,f,o)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,o=i.getMatchingVisibleMetas(this._type).filter(t=>t.controller.options.grouped),a=i.options.stacked,s=[],n=this._cachedMeta.controller.getParsed(e),r=n&&n[i.axis],l=t=>{const e=t._parsed.find(t=>t[i.axis]===r),o=e&&e[t.vScale.axis];if(so(o)||isNaN(o))return!0};for(const i of o)if((void 0===e||!l(i))&&((!1===a||-1===s.indexOf(i.stack)||void 0===a&&void 0===i.stack)&&s.push(i.stack),i.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[co("x"===this.chart.options.indexAxis?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const o=this._getStacks(t,i),a=void 0!==e?o.indexOf(e):-1;return-1===a?o.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,o=[];let a,s;for(a=0,s=e.data.length;a<s;++a)o.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const n=t.barThickness;return{min:n||mn(e),pixels:o,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:n?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:o},options:{base:a,minBarLength:s}}=this,n=a||0,r=this.getParsed(t),l=r._custom,h=bn(l);let c,d,u=r[e.axis],p=0,m=i?this.applyStack(e,r,i):u;m!==u&&(p=m-u,m=u),h&&(u=l.barStart,m=l.barEnd-l.barStart,0!==u&&Io(u)!==Io(l.barEnd)&&(p=0),p+=u);const f=so(a)||h?p:a;let g=e.getPixelForValue(f);if(c=this.chart.getDataVisibility(t)?e.getPixelForValue(p+m):g,d=c-g,Math.abs(d)<s){d=function(t,e,i){return 0!==t?Io(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(d,e,n)*s,u===n&&(g-=d/2);const t=e.getPixelForDecimal(0),a=e.getPixelForDecimal(1),l=Math.min(t,a),p=Math.max(t,a);g=Math.max(Math.min(g,p),l),c=g+d,i&&!h&&(r._stacks[e.axis]._visualValues[o]=e.getValueForPixel(c)-e.getValueForPixel(g))}if(g===e.getPixelForValue(n)){const t=Io(d)*e.getLineWidthForValue(n)/2;g+=t,d-=t}return{size:d,base:g,head:c,center:c+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,o=this.options,a=o.skipNull,s=co(o.maxBarThickness,1/0);let n,r;const l=this._getAxisCount();if(e.grouped){const i=a?this._getStackCount(t):e.stackCount,h="flex"===o.barThickness?function(t,e,i,o){const a=e.pixels,s=a[t];let n=t>0?a[t-1]:null,r=t<a.length-1?a[t+1]:null;const l=i.categoryPercentage;null===n&&(n=s-(null===r?e.end-e.start:r-s)),null===r&&(r=s+s-n);const h=s-(s-Math.min(n,r))/2*l;return{chunk:Math.abs(r-n)/2*l/o,ratio:i.barPercentage,start:h}}(t,e,o,i*l):function(t,e,i,o){const a=i.barThickness;let s,n;return so(a)?(s=e.min*i.categoryPercentage,n=i.barPercentage):(s=a*o,n=1),{chunk:s/o,ratio:n,start:e.pixels[t]-s/2}}(t,e,o,i*l),c="x"===this.chart.options.indexAxis?this.getDataset().xAxisID:this.getDataset().yAxisID,d=this._getAxis().indexOf(co(c,this.getFirstScaleIdForIndexAxis())),u=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+d;n=h.start+h.chunk*u+h.chunk/2,r=Math.min(s,h.chunk*h.ratio)}else n=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(s,e.min*e.ratio);return{base:n-r/2,head:n+r/2,center:n,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,o=i.length;let a=0;for(;a<o;++a)null===this.getParsed(a)[e.axis]||i[a].hidden||i[a].draw(this._ctx)}}class Cn extends pn{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,o){const a=super.parsePrimitiveData(t,e,i,o);for(let t=0;t<a.length;t++)a[t]._custom=this.resolveDataElementOptions(t+i).radius;return a}parseArrayData(t,e,i,o){const a=super.parseArrayData(t,e,i,o);for(let t=0;t<a.length;t++){const o=e[i+t];a[t]._custom=co(o[2],this.resolveDataElementOptions(t+i).radius)}return a}parseObjectData(t,e,i,o){const a=super.parseObjectData(t,e,i,o);for(let t=0;t<a.length;t++){const o=e[i+t];a[t]._custom=co(o&&o.r&&+o.r,this.resolveDataElementOptions(t+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:o,yScale:a}=e,s=this.getParsed(t),n=o.getLabelForValue(s.x),r=a.getLabelForValue(s.y),l=s._custom;return{label:i[t]||"",value:"("+n+", "+r+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,o){const a="reset"===o,{iScale:s,vScale:n}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(e,o),h=s.axis,c=n.axis;for(let d=e;d<e+i;d++){const e=t[d],i=!a&&this.getParsed(d),u={},p=u[h]=a?s.getPixelForDecimal(.5):s.getPixelForValue(i[h]),m=u[c]=a?n.getBasePixel():n.getPixelForValue(i[c]);u.skip=isNaN(p)||isNaN(m),l&&(u.options=r||this.resolveDataElementOptions(d,e.active?"active":o),a&&(u.options.radius=0)),this.updateElement(e,d,u,o)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let o=super.resolveDataElementOptions(t,e);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const a=o.radius;return"active"!==e&&(o.radius=0),o.radius+=co(i&&i._custom,a),o}}class Sn extends pn{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:o,color:a,useBorderRadius:s,borderRadius:n}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((e,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:l.backgroundColor,fontColor:a,hidden:!t.getDataVisibility(r),lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:l.borderWidth,strokeStyle:l.borderColor,textAlign:o,pointStyle:i,borderRadius:s&&(n||l.borderRadius),index:r}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,o=this._cachedMeta;if(!1===this._parsing)o._parsed=i;else{let a,s,n=t=>+i[t];if(ro(i[t])){const{key:t="value"}=this._parsing;n=e=>+Co(i[e],t)}for(a=t,s=t+e;a<s;++a)o._parsed[a]=n(a)}}_getRotation(){return Ho(this.options.rotation-90)}_getCircumference(){return Ho(this.options.circumference)}_getRotationExtents(){let t=Lo,e=-Lo;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const o=this.chart.getDatasetMeta(i).controller,a=o._getRotation(),s=o._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,o=this._cachedMeta,a=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a
vendor: 19,404 bytes, line 1880
1880)+this.options.spacing,n=Math.max((Math.min(i.width,i.height)-s)/2,0),r=Math.min((l=this.options.cutout,h=n,"string"==typeof l&&l.endsWith("%")?parseFloat(l)/100:+l/h),1);var l,h;const c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:p,ratioY:m,offsetX:f,offsetY:g}=function(t,e,i){let o=1,a=1,s=0,n=0;if(e<Lo){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),p=(t,e,o)=>Xo(t,r,l,!0)?1:Math.max(e,e*i,o,o*i),m=(t,e,o)=>Xo(t,r,l,!0)?-1:Math.min(e,e*i,o,o*i),f=p(0,h,d),g=p(To,c,u),b=m($o,h,d),v=m($o+To,c,u);o=(f-b)/2,a=(g-v)/2,s=-(f+b)/2,n=-(g+v)/2}return{ratioX:o,ratioY:a,offsetX:s,offsetY:n}}(u,d,r),b=(i.width-s)/p,v=(i.height-s)/m,w=Math.max(Math.min(b,v)/2,0),y=uo(this.options.radius,w),x=(y-Math.max(y*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*y,this.offsetY=g*y,o.total=this.calculateTotal(),this.outerRadius=y-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,o=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===o._parsed[t]||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*a/Lo)}updateElements(t,e,i,o){const a="reset"===o,s=this.chart,n=s.chartArea,r=s.options.animation,l=(n.left+n.right)/2,h=(n.top+n.bottom)/2,c=a&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(e,o);let f,g=this._getRotation();for(f=0;f<e;++f)g+=this._circumference(f,a);for(f=e;f<e+i;++f){const e=this._circumference(f,a),i=t[f],s={x:l+this.offsetX,y:h+this.offsetY,startAngle:g,endAngle:g+e,circumference:e,outerRadius:u,innerRadius:d};m&&(s.options=p||this.resolveDataElementOptions(f,i.active?"active":o)),g+=e,this.updateElement(i,f,s,o)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,o=0;for(i=0;i<e.length;i++){const a=t._parsed[i];null===a||isNaN(a)||!this.chart.getDataVisibility(i)||e[i].hidden||(o+=Math.abs(a))}return o}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Lo*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,o=i.data.labels||[],a=ya(e._parsed[t],i.options.locale);return{label:o[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let o,a,s,n,r;if(!t)for(o=0,a=i.data.datasets.length;o<a;++o)if(i.isDatasetVisible(o)){s=i.getDatasetMeta(o),t=s.data,n=s.controller;break}if(!t)return 0;for(o=0,a=t.length;o<a;++o)r=n.resolveDataElementOptions(o),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,o=t.length;i<o;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(co(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class _n extends pn{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:o=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:n,count:r}=la(e,o,s);this._drawStart=n,this._drawCount=r,ha(e)&&(n=0,r=o.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=o;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:l},t),this.updateElements(o,n,r,t)}updateElements(t,e,i,o){const a="reset"===o,{iScale:s,vScale:n,_stacked:r,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:c}=this._getSharedOptions(e,o),d=s.axis,u=n.axis,{spanGaps:p,segment:m}=this.options,f=Bo(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||a||"none"===o,b=e+i,v=t.length;let w=e>0&&this.getParsed(e-1);for(let i=0;i<v;++i){const p=t[i],v=g?p:{};if(i<e||i>=b){v.skip=!0;continue}const y=this.getParsed(i),x=so(y[u]),k=v[d]=s.getPixelForValue(y[d],i),C=v[u]=a||x?n.getBasePixel():n.getPixelForValue(r?this.applyStack(n,y,r):y[u],i);v.skip=isNaN(k)||isNaN(C)||x,v.stop=i>0&&Math.abs(y[d]-w[d])>f,m&&(v.parsed=y,v.raw=l.data[i]),c&&(v.options=h||this.resolveDataElementOptions(i,p.active?"active":o)),g||this.updateElement(p,i,v,o),w=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,o=t.data||[];if(!o.length)return i;const a=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class En extends pn{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:o}}=t.legend.options;return e.labels.map((e,a)=>{const s=t.getDatasetMeta(0).controller.getStyle(a);return{text:e,fillStyle:s.backgroundColor,strokeStyle:s.borderColor,fontColor:o,lineWidth:s.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,o=i.data.labels||[],a=ya(e._parsed[t].r,i.options.locale);return{label:o[t]||"",value:a}}parseObjectData(t,e,i,o){return ms.bind(this)(t,e,i,o)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((t,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,o=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(o/2,0),s=(a-Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=a-s*this.index,this.innerRadius=this.outerRadius-s}updateElements(t,e,i,o){const a="reset"===o,s=this.chart,n=s.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*$o;let d,u=c;const p=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,o,p);for(d=e;d<e+i;d++){const e=t[d];let i=u,m=u+this._computeAngle(d,o,p),f=s.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=m,a&&(n.animateScale&&(f=0),n.animateRotate&&(i=m=c));const g={x:l,y:h,innerRadius:0,outerRadius:f,startAngle:i,endAngle:m,options:this.resolveDataElementOptions(d,e.active?"active":o)};this.updateElement(e,d,g,o)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Ho(this.resolveDataElementOptions(t,e).angle||i):0}}class An extends Sn{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class $n extends pn{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,o){return ms.bind(this)(t,e,i,o)}update(t){const e=this._cachedMeta,i=e.dataset,o=e.data||[],a=e.iScale.getLabels();if(i.points=o,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const s={_loop:!0,_fullLoop:a.length===o.length,options:e};this.updateElement(i,void 0,s,t)}this.updateElements(o,0,o.length,t)}updateElements(t,e,i,o){const a=this._cachedMeta.rScale,s="reset"===o;for(let n=e;n<e+i;n++){const e=t[n],i=this.resolveDataElementOptions(n,e.active?"active":o),r=a.getPointPositionForValue(n,this.getParsed(n).r),l=s?a.xCenter:r.x,h=s?a.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,n,c,o)}}}class Ln extends pn{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:o,yScale:a}=e,s=this.getParsed(t),n=o.getLabelForValue(s.x),r=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+n+", "+r+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=la(e,i,o);if(this._drawStart=a,this._drawCount=s,ha(e)&&(a=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:s}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=i;const n=this.resolveDatasetElementOptions(t);n.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:n},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,o){const a="reset"===o,{iScale:s,vScale:n,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,o),c=this.getSharedOptions(h),d=this.includeOptions(o,c),u=s.axis,p=n.axis,{spanGaps:m,segment:f}=this.options,g=Bo(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||a||"none"===o;let v=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),m=b?e:{},w=so(i[p]),y=m[u]=s.getPixelForValue(i[u],h),x=m[p]=a||w?n.getBasePixel():n.getPixelForValue(r?this.applyStack(n,i,r):i[p],h);m.skip=isNaN(y)||isNaN(x)||w,m.stop=h>0&&Math.abs(i[u]-v[u])>g,f&&(m.parsed=i,m.raw=l.data[h]),d&&(m.options=c||this.resolveDataElementOptions(h,e.active?"active":o)),b||this.updateElement(e,h,m,o),v=i}this.updateSharedOptions(c,o,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}const i=t.dataset,o=i.options&&i.options.borderWidth||0;if(!e.length)return o;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(o,a,s)/2}}function Dn(t,e,i,o){const{controller:a,data:s,_sorted:n}=t,r=a._cachedMeta.iScale,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(r&&e===r.axis&&"r"!==e&&n&&s.length){const n=r._reversePixels?ta:Zo;if(!o){const o=n(s,e,i);if(l){const{vScale:e}=a._cachedMeta,{_parsed:i}=t,s=i.slice(0,o.lo+1).reverse().findIndex(t=>!so(t[e.axis]));o.lo-=Math.max(0,s);const n=i.slice(o.hi).findIndex(t=>!so(t[e.axis]));o.hi+=Math.max(0,n)}return o}if(a._sharedOptions){const t=s[0],o="function"==typeof t.getRange&&t.getRange(e);if(o){const t=n(s,e,i-o),a=n(s,e,i+o);return{lo:t.lo,hi:a.hi}}}}return{lo:0,hi:s.length-1}}function Mn(t,e,i,o,a){const s=t.getSortedVisibleDatasetMetas(),n=i[e];for(let t=0,i=s.length;t<i;++t){const{index:i,data:r}=s[t],{lo:l,hi:h}=Dn(s[t],e,n,a);for(let t=l;t<=h;++t){const e=r[t];e.skip||o(e,i,t)}}}function zn(t,e,i,o,a){const s=[];if(!a&&!t.isPointInArea(e))return s;return Mn(t,i,e,function(i,n,r){(a||Pa(i,t.chartArea,0))&&i.inRange(e.x,e.y,o)&&s.push({element:i,datasetIndex:n,index:r})},!0),s}function Tn(t,e,i,o,a,s){let n=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,o){const a=e?Math.abs(t.x-o.x):0,s=i?Math.abs(t.y-o.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}(i);let l=Number.POSITIVE_INFINITY;return Mn(t,i,e,function(i,h,c){const d=i.inRange(e.x,e.y,a);if(o&&!d)return;const u=i.getCenterPoint(a);if(!(!!s||t.isPointInArea(u))&&!d)return;const p=r(e,u);p<l?(n=[{element:i,datasetIndex:h,index:c}],l=p):p===l&&n.push({element:i,datasetIndex:h,index:c})}),n}function On(t,e,i,o,a,s){return s||t.isPointInArea(e)?"r"!==i||o?Tn(t,e,i,o,a,s):function(t,e,i,o){let a=[];return Mn(t,i,e,function(t,i,s){const{startAngle:n,endAngle:r}=t.getProps(["startAngle","endAngle"],o),{angle:l}=Wo(t,{x:e.x,y:e.y});Xo(l,n,r)&&a.push({element:t,datasetIndex:i,index:s})}),a}(t,e,i,a):[]}function Pn(t,e,i,o,a){const s=[],n="x"===i?"inXRange":"inYRange";let r=!1;return Mn(t,i,e,(t,o,l)=>{t[n]&&t[n](e[i],a)&&(s.push({element:t,datasetIndex:o,index:l}),r=r||t.inRange(e.x,e.y,a))}),o&&!r?[]:s}var Fn={evaluateInteractionItems:Mn,modes:{index(t,e,i,o){const a=$s(e,t),s=i.axis||"x",n=i.includeInvisible||!1,r=i.intersect?zn(t,a,s,o,n):On(t,a,s,!1,o,n),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})}),l):[]},dataset(t,e,i,o){const a=$s(e,t),s=i.axis||"xy",n=i.includeInvisible||!1;let r=i.intersect?zn(t,a,s,o,n):On(t,a,s,!1,o,n);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,o)=>zn(t,$s(e,t),i.axis||"xy",o,i.includeInvisible||!1),nearest(t,e,i,o){const a=$s(e,t),s=i.axis||"xy",n=i.includeInvisible||!1;return On(t,a,s,i.intersect,o,n)},x:(t,e,i,o)=>Pn(t,$s(e,t),"x",i.intersect,o),y:(t,e,i,o)=>Pn(t,$s(e,t),"y",i.intersect,o)}};const In=["left","top","right","bottom"];function Rn(t,e){return t.filter(t=>t.pos===e)}function Vn(t,e){return t.filter(t=>-1===In.indexOf(t.pos)&&t.box.axis===e)}function Bn(t,e){return t.sort((t,i)=>{const o=e?i:t,a=e?t:i;return o.weight===a.weight?o.index-a.index:o.weight-a.weight})}function Nn(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:o,stackWeight:a}=i;if(!t||!In.includes(o))continue;const s=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return e}(t),{vBoxMaxWidth:o,hBoxMaxHeight:a}=e;let s,n,r;for(s=0,n=t.length;s<n;++s){r=t[s];const{fullSize:n}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*o:n&&e.availableWidth,r.height=a):(r.width=o,r.height=h?h*a:n&&e.availableHeight)}return i}function Hn(t,e,i,o){return Math.max(t[i],e[i])+Math.max(t[o],e[o])}function qn(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Un(t,e,i,o){const{pos:a,box:s}=i,n=t.maxPadding;if(!ro(a)){i.size&&(t[a]-=i.size);const e=o[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?s.height:s.width),i.size=e.size/e.count,t[a]+=i.size}s.getPadding&&qn(n,s.getPadding());const r=Math.max(0,e.outerWidth-Hn(n,t,"left","right")),l=Math.max(0,e.outerHeight-Hn(n,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function Wn(t,e){const i=e.maxPadding;function o(t){const o={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{o[t]=Math.max(e[t],i[t])}),o}return o(t?["left","right"]:["top","bottom"])}function jn(t,e,i,o){const a=[];let s,n,r,l,h,c;for(s=0,n=t.length,h=0;s<n;++s){r=t[s],l=r.box,l.update(r.width||e.w,r.height||e.h,Wn(r.horizontal,e));const{same:n,other:d}=Un(e,i,r,o);h|=n&&a.length,c=c||d,l.fullSize||a.push(r)}return h&&jn(a,e,i,o)||c}function Yn(t,e,i,o,a){t.top=i,t.left=e,t.right=e+o,t.bottom=i+a,t.width=o,t.height=a}function Kn(t,e,i,o){const a=i.padding;let{x:s,y:n}=e;for(const r of t){const t=r.box,l=o[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const o=e.w*h,s=l.size||t.height;_o(l.start)&&(n=l.start),t.fullSize?Yn(t,a.left,n,i.outerWidth-a.right-a.left,s):Yn(t,e.left+l.placed,n,o,s),l.start=n,l.placed+=o,n=t.bottom}else{const o=e.h*h,n=l.size||t.width;_o(l.start)&&(s=l.start),t.fullSize?Yn(t,s,a.top,n,i.outerHeight-a.bottom-a.top):Yn(t,s,e.top+l.placed,n,o),l.start=s,l.placed+=o,s=t.right}}e.x=s,e.y=n}var Xn={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,o){if(!t)return;const a=Qa(t.options.layout.padding),s=Math.max(e-a.width,0),n=Math.max(i-a.height,0),r=function(t){const e=function(t){const e=[];let i,o,a,s,n,r;for(i=0,o=(t||[]).length;i<o;++i)a=t[i],({position:s,options:{stack:n,stackWeight:r=1}}=a),e.push({index:i,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:n&&s+n,stackWeight:r});return e}(t),i=Bn(e.filter(t=>t.box.fullSize),!0),o=Bn(Rn(e,"left"),!0),a=Bn(Rn(e,"right")),s=Bn(Rn(e,"top"),!0),n=Bn(Rn(e,"bottom")),r=Vn(e,"x"),l=Vn(e,"y");return{fullSize:i,leftAndTop:o.concat(s),rightAndBottom:a.concat(l).concat(n).concat(r),chartArea:Rn(e,"chartArea"),vertical:o.concat(a).concat(l),horizontal:s.concat(n).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;mo(t.boxes,t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()});const c=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:a,availableWidth:s,availableHeight:n,vBoxMaxWidth:s/2/c,hBoxMaxHeight:n/2}),u=Object.assign({},a);qn(u,Qa(o));const p=Object.assign({maxPadding:u,w:s,h:n,x:a.left,y:a.top},a),m=Nn(l.concat(h),d);jn(r.fullSize,p,d,m),jn(l,p,d,m),jn(h,p,d,m)&&jn(l,p,d,m),function(t){const e=t.maxPadding;function i(i){const o=Math.max(e[i]-t[i],0);return t[i]+=o,o}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(p),Kn(r.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,Kn(r.rightAndBottom,p,d,m),t.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},mo(r.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Gn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,o){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,o?Math.floor(e/o):i)}}isAttached(t){return!0}updateConfig(t){}}class Qn extends Gn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Jn="$chartjs",Zn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mou
1880seout",pointerout:"mouseout"},tr=t=>null===t||""===t;const er=!!zs&&{passive:!0};function ir(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,er)}function or(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function ar(t,e,i){const o=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||or(i.addedNodes,o),e=e&&!or(i.removedNodes,o);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}function sr(t,e,i){const o=t.canvas,a=new MutationObserver(t=>{let e=!1;for(const i of t)e=e||or(i.removedNodes,o),e=e&&!or(i.addedNodes,o);e&&i()});return a.observe(document,{childList:!0,subtree:!0}),a}const nr=new Map;let rr=0;function lr(){const t=window.devicePixelRatio;t!==rr&&(rr=t,nr.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function hr(t,e,i){const o=t.canvas,a=o&&Cs(o);if(!a)return;const s=sa((t,e)=>{const o=a.clientWidth;i(t,e),o<a.clientWidth&&i()},window),n=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,o=e.contentRect.height;0===i&&0===o||s(i,o)});return n.observe(a),function(t,e){nr.size||window.addEventListener("resize",lr),nr.set(t,e)}(t,s),n}function cr(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){nr.delete(t),nr.size||window.removeEventListener("resize",lr)}(t)}function dr(t,e,i){const o=t.canvas,a=sa(e=>{null!==t.ctx&&i(function(t,e){const i=Zn[t.type]||t.type,{x:o,y:a}=$s(t,e);return{type:i,chart:e,native:t,x:void 0!==o?o:null,y:void 0!==a?a:null}}(e,t))},t);return function(t,e,i){t&&t.addEventListener(e,i,er)}(o,e,a),a}class ur extends Gn{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,o=t.getAttribute("height"),a=t.getAttribute("width");if(t[Jn]={initial:{height:o,width:a,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",tr(a)){const e=Ts(t,"width");void 0!==e&&(t.width=e)}if(tr(o))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ts(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Jn])return!1;const i=e[Jn].initial;["height","width"].forEach(t=>{const o=i[t];so(o)?e.removeAttribute(t):e.setAttribute(t,o)});const o=i.style||{};return Object.keys(o).forEach(t=>{e.style[t]=o[t]}),e.width=e.width,delete e[Jn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const o=t.$proxies||(t.$proxies={}),a={attach:ar,detach:sr,resize:hr}[e]||dr;o[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),o=i[e];if(!o)return;({attach:cr,detach:cr,resize:cr}[e]||ir)(t,e,o),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,o){return Ds(t,e,i,o)}isAttached(t){const e=t&&Cs(t);return!(!e||!e.isConnected)}}class pr{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Bo(this.x)&&Bo(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const o={};return t.forEach(t=>{o[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),o}}function mr(t,e){const i=t.options.ticks,o=function(t){const e=t.options.offset,i=t._tickSize(),o=t._length/i+(e?0:1),a=t._maxLength/i;return Math.floor(Math.min(o,a))}(t),a=Math.min(i.maxTicksLimit||o,o),s=i.major.enabled?function(t){const e=[];let i,o;for(i=0,o=t.length;i<o;i++)t[i].major&&e.push(i);return e}(e):[],n=s.length,r=s[0],l=s[n-1],h=[];if(n>a)return function(t,e,i,o){let a,s=0,n=i[0];for(o=Math.ceil(o),a=0;a<t.length;a++)a===n&&(e.push(t[a]),s++,n=i[s*o])}(e,h,s,n/a),h;const c=function(t,e,i){const o=function(t){const e=t.length;let i,o;if(e<2)return!1;for(o=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==o)return!1;return o}(t),a=e.length/i;if(!o)return Math.max(a,1);const s=function(t){const e=[],i=Math.sqrt(t);let o;for(o=1;o<i;o++)t%o===0&&(e.push(o),e.push(t/o));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}(o);for(let t=0,e=s.length-1;t<e;t++){const e=s[t];if(e>a)return e}return Math.max(a,1)}(s,e,a);if(n>0){let t,i;const o=n>1?Math.round((l-r)/(n-1)):null;for(fr(e,h,c,so(o)?0:r-o,r),t=0,i=n-1;t<i;
vendor: 10,572 bytes, line 1880
1880t++)fr(e,h,c,s[t],s[t+1]);return fr(e,h,c,l,so(o)?e.length:l+o),h}return fr(e,h,c),h}function fr(t,e,i,o,a){const s=co(o,0),n=Math.min(co(a,t.length),t.length);let r,l,h,c=0;for(i=Math.ceil(i),a&&(r=a-o,i=r/Math.floor(r/i)),h=s;h<0;)c++,h=Math.round(s+c*i);for(l=Math.max(s,0);l<n;l++)l===h&&(e.push(t[l]),c++,h=Math.round(s+c*i))}const gr=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i,br=(t,e)=>Math.min(e||t,t);function vr(t,e){const i=[],o=t.length/e,a=t.length;let s=0;for(;s<a;s+=o)i.push(t[Math.floor(s)]);return i}function wr(t,e,i){const o=t.ticks.length,a=Math.min(e,o-1),s=t._startPixel,n=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(a);if(!(i&&(l=1===o?Math.max(h-s,n-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(a-1))/2,h+=a<e?l:-l,h<s-r||h>n+r)))return h}function yr(t){return t.drawTicks?t.tickLength:0}function xr(t,e){if(!t.display)return 0;const i=Ja(t.font,e),o=Qa(t.padding);return(no(t.text)?t.text.length:1)*i.lineHeight+o.height}function kr(t,e,i){let o=na(t);return(i&&"right"!==e||!i&&"right"===e)&&(o=(t=>"left"===t?"right":"right"===t?"left":t)(o)),o}class Cr extends pr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:o}=this;return t=ho(t,Number.POSITIVE_INFINITY),e=ho(e,Number.NEGATIVE_INFINITY),i=ho(i,Number.POSITIVE_INFINITY),o=ho(o,Number.NEGATIVE_INFINITY),{min:ho(t,i),max:ho(e,o),minDefined:lo(t),maxDefined:lo(e)}}getMinMax(t){let e,{min:i,max:o,minDefined:a,maxDefined:s}=this.getUserBounds();if(a&&s)return{min:i,max:o};const n=this.getMatchingVisibleMetas();for(let r=0,l=n.length;r<l;++r)e=n[r].controller.getMinMax(this,t),a||(i=Math.min(i,e.min)),s||(o=Math.max(o,e.max));return i=s&&i>o?o:i,o=a&&i>o?i:o,{min:ho(i,ho(o,i)),max:ho(o,ho(i,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){po(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:o,grace:a,ticks:s}=this.options,n=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,i){const{min:o,max:a}=t,s=uo(e,(a-o)/2),n=(t,e)=>i&&0===t?0:t+e;return{min:n(o,-Math.abs(s)),max:n(a,s)}}(this,a,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=n<this.ticks.length;this._convertTicksToLabels(r?vr(this.ticks,n):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||"auto"===s.source)&&(this.ticks=mr(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){po(this.options.afterUpdate,[this])}beforeSetDimensions(){po(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){po(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),po(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){po(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,o,a;for(i=0,o=t.length;i<o;i++)a=t[i],a.label=po(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){po(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){po(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=br(this.ticks.length,t.ticks.maxTicksLimit),o=e.minRotation||0,a=e.maxRotation;let s,n,r,l=o;if(!this._isVisible()||!e.display||o>=a||i<=1||!this.isHorizontal())return void(this.labelRotation=o);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Go(this.chart.width-c,0,this.maxWidth);s=t.offset?this.maxWidth/i:u/(i-1),c+6>s&&(s=u/(i-(t.offset?.5:1)),n=this.maxHeight-yr(t.grid)-e.padding-xr(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=qo(Math.min(Math.asin(Go((h.highest.height+6)/s,-1,1)),Math.asin(Go(n/r,-1,1))-Math.asin(Go(d/r,-1,1)))),l=Math.max(o,Math.min(a,l))),this.labelRotation=l}afterCalculateLabelRotation(){po(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){po(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:o,grid:a}}=this,s=this._isVisible(),n=this.isHorizontal();if(s){const s=xr(o,e.options.font);if(n?(t.width=this.maxWidth,t.height=yr(a)+s):(t.height=this.maxHeight,t.width=yr(a)+s),i.display&&this.ticks.length){const{first:e,last:o,widest:a,highest:s}=this._getLabelSizes(),r=2*i.padding,l=Ho(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(n){const e=i.mirror?0:c*a.width+h*s.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*a.width+c*s.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,o,c,h)}}this._handleMargins(),n?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,o){const{ticks:{align:a,padding:s},position:n}=this.options,r=0!==this.labelRotation,l="top"!==n&&"x"===this.axis;if(this.isHorizontal()){const n=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=o*t.width,d=i*e.height):(c=i*t.height,d=o*e.width):"start"===a?d=e.width:"end"===a?c=t.width:"inner"!==a&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-n+s)*this.width/(this.width-n),0),this.paddingRight=Math.max((d-h+s)*this.width/(this.width-h),0)}else{let i=e.height/2,o=t.height/2;"start"===a?(i=0,o=t.height):"end"===a&&(i=e.height,o=0),this.paddingTop=i+s,this.paddingBottom=o+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){po(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)so(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=vr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:o,_longestTextCache:a}=this,s=[],n=[],r=Math.floor(e/br(e,i));let l,h,c,d,u,p,m,f,g,b,v,w=0,y=0;for(l=0;l<e;l+=r){if(d=t[l].label,u=this._resolveTickFontOptions(l),o.font=p=u.string,m=a[p]=a[p]||{data:{},gc:[]},f=u.lineHeight,g=b=0,so(d)||no(d)){if(no(d))for(h=0,c=d.length;h<c;++h)v=d[h],so(v)||no(v)||(g=La(o,m.data,m.gc,g,v),b+=f)}else g=La(o,m.data,m.gc,g,d),b=f;s.push(g),n.push(b),w=Math.max(g,w),y=Math.max(b,y)}!function(t,e){mo(t,t=>{const i=t.gc,o=i.length/2;let a;if(o>e){for(a=0;a<o;++a)delete t.data[i[a]];i.splice(0,o)}})}(a,e);const x=s.indexOf(w),k=n.indexOf(y),C=t=>({width:s[t]||0,height:n[t]||0});return{first:C(0),last:C(e-1),widest:C(x),highest:C(k),widths:s,heights:n}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Go(this._alignToPixels?Ma(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];
vendor: 5,229 bytes, line 1880
1880return i.$context||(i.$context=function(t,e,i){return ts(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=ts(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Ho(this.labelRotation),i=Math.abs(Math.cos(e)),o=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,n=a?a.widest.width+s:0,r=a?a.highest.height+s:0;return this.isHorizontal()?r*i>n*o?n/i:r/o:r*o<n*i?r/i:n/o}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,o=this.options,{grid:a,position:s,border:n}=o,r=a.offset,l=this.isHorizontal(),h=this.ticks.length+(r?1:0),c=yr(a),d=[],u=n.setContext(this.getContext()),p=u.display?u.width:0,m=p/2,f=function(t){return Ma(i,t,p)};let g,b,v,w,y,x,k,C,S,_,E,A;if("top"===s)g=f(this.bottom),x=this.bottom-c,C=g-m,_=f(t.top)+m,A=t.bottom;else if("bottom"===s)g=f(this.top),_=t.top,A=f(t.bottom)-m,x=g+m,C=this.top+c;else if("left"===s)g=f(this.right),y=this.right-c,k=g-m,S=f(t.left)+m,E=t.right;else if("right"===s)g=f(this.left),S=t.left,E=f(t.right)-m,y=g+m,k=this.left+c;else if("x"===e){if("center"===s)g=f((t.top+t.bottom)/2+.5);else if(ro(s)){const t=Object.keys(s)[0],e=s[t];g=f(this.chart.scales[t].getPixelForValue(e))}_=t.top,A=t.bottom,x=g+m,C=x+c}else if("y"===e){if("center"===s)g=f((t.left+t.right)/2);else if(ro(s)){const t=Object.keys(s)[0],e=s[t];g=f(this.chart.scales[t].getPixelForValue(e))}y=g-m,k=y-c,S=t.left,E=t.right}const $=co(o.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/$));for(b=0;b<h;b+=L){const t=this.getContext(b),e=a.setContext(t),o=n.setContext(t),s=e.lineWidth,h=e.color,c=o.dash||[],u=o.dashOffset,p=e.tickWidth,m=e.tickColor,f=e.tickBorderDash||[],g=e.tickBorderDashOffset;v=wr(this,b,r),void 0!==v&&(w=Ma(i,v,s),l?y=k=S=E=w:x=C=_=A=w,d.push({tx1:y,ty1:x,tx2:k,ty2:C,x1:S,y1:_,x2:E,y2:A,width:s,color:h,borderDash:c,borderDashOffset:u,tickWidth:p,tickColor:m,tickBorderDash:f,tickBorderDashOffset:g}))}return this._ticksLength=h,this._borderValue=g,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:o,ticks:a}=i,s=this.isHorizontal(),n=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=a,d=yr(i.grid),u=d+h,p=c?-h:u,m=-Ho(this.labelRotation),f=[];let g,b,v,w,y,x,k,C,S,_,E,A,$="middle";if("top"===o)x=this.bottom-p,k=this._getXAxisLabelAlignment();else if("bottom"===o)x=this.top+p,k=this._getXAxisLabelAlignment();else if("left"===o){const t=this._getYAxisLabelAlignment(d);k=t.textAlign,y=t.x}else if("right"===o){const t=this._getYAxisLabelAlignment(d);k=t.textAlign,y=t.x}else if("x"===e){if("center"===o)x=(t.top+t.bottom)/2+u;else if(ro(o)){const t=Object.keys(o)[0],e=o[t];x=this.chart.scales[t].getPixelForValue(e)+u}k=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===o)y=(t.left+t.right)/2-u;else if(ro(o)){const t=Object.keys(o)[0],e=o[t];y=this.chart.scales[t].getPixelForValue(e)}k=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===r?$="top":"end"===r&&($="bottom"));const L=this._getLabelSizes();for(g=0,b=n.length;g<b;++g){v=n[g],w=v.label;const t=a.setContext(this.getContext(g));C=this.getPixelForTick(g)+a.labelOffset,S=this._resolveTickFontOptions(g),_=S.lineHeight,E=no(w)?w.length:1;const e=E/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let d,u=k;if(s?(y=C,"inner"===k&&(u=g===b-1?this.options.reverse?"left":"right":0===g?this.options.reverse?"right":"left":"center"),A="top"===o?"near"===l||0!==m?-E*_+_/2:"center"===l?-L.highest.height/2-e*_+_:-L.highest.height+_/2:"near"===l||0!==m?_/2:"center"===l?L.highest.height/2-e*_:L.highest.height-E*_,c&&(A*=-1),0===m||t.showLabelBackdrop||(y+=_/2*Math.sin(m))):(x=C,A=(1-E)*_/2),t.showLabelBackdrop){const e=Qa(t.backdropPadding),i=L.heights[g],o=L.widths[g];let a=A-e.top,s=0-e.left;switch($){case"middle":a-=i/2;break;case"bottom":a-=i}switch(k){case"center":s-=o/2;break;case"right":s-=o;break;case"inner":g===b-1?s-=o:g>0&&(s-=o/2)}d={left:s,top:a,width:o+e.width,height:i+e.height,color:t.backdropColor}}f.push({label:w,font:S,textOffset:A,options:{rotation:m,color:i,strokeColor:r,strokeWidth:h,textAlign:u,textBaseline:$,translation:[y,x],backdrop:d}})}return f}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ho(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:o,padding:a}}=this.options,s=t+a,n=this._getLabelSizes().widest.width;let r,l;return"left"===e?o?(l=this.right+a,"near"===i?r="left":"center"===i?(r="center",l+=n/2):(r="right",l+=n)):(l=this.right-s,"near"===i?r="right":"center"===i?(r="center",l-=n/2):(r="left",l=this.left)):"right"===e?o?(l=this.left+a,"near"===i?r="right":"center"===i?(r="center",l-=n/2):(r="left",l-=n)):(l=this.left+s,"near"===i?r="left":"center"===i?(r="center",l+=n/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}
vendor: 26,268 bytes, line 1880
1880:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:o,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,o,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(e=>e.value===t);if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const n=(t,e,o)=>{o.width&&o.color&&(i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.setLineDash(o.borderDash||[]),i.lineDashOffset=o.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=o.length;a<s;++a){const t=o[a];e.drawOnChartArea&&n({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&n({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:o}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const n=o.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let l,h,c,d;this.isHorizontal()?(l=Ma(t,this.left,s)-s/2,h=Ma(t,this.right,n)+n/2,c=d=r):(c=Ma(t,this.top,s)-s/2,d=Ma(t,this.bottom,n)+n/2,l=h=r),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(l,c),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&Fa(e,i);const o=this.getLabelItems(t);for(const t of o){const i=t.options,o=t.font;Ha(e,t.label,0,t.textOffset,o,i)}i&&Ia(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:o}}=this;if(!i.display)return;const a=Ja(i.font),s=Qa(i.padding),n=i.align;let r=a.lineHeight/2;"bottom"===e||"center"===e||ro(e)?(r+=s.bottom,no(i.text)&&(r+=a.lineHeight*(i.text.length-1))):r+=s.top;const{titleX:l,titleY:h,maxWidth:c,rotation:d}=function(t,e,i,o){const{top:a,left:s,bottom:n,right:r,chart:l}=t,{chartArea:h,scales:c}=l;let d,u,p,m=0;const f=n-a,g=r-s;if(t.isHorizontal()){if(u=ra(o,s,r),ro(i)){const t=Object.keys(i)[0],o=i[t];p=c[t].getPixelForValue(o)+f-e}else p="center"===i?(h.bottom+h.top)/2+f-e:gr(t,i,e);d=r-s}else{if(ro(i)){const t=Object.keys(i)[0],o=i[t];u=c[t].getPixelForValue(o)-g+e}else u="center"===i?(h.left+h.right)/2-g+e:gr(t,i,e);p=ra(o,n,a),m="left"===i?-To:To}return{titleX:u,titleY:p,maxWidth:d,rotation:m}}(this,r,e,n);Ha(t,i.text,0,0,a,{color:i.color,maxWidth:c,rotation:d,textAlign:kr(n,e,o),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=co(t.grid&&t.grid.z,-1),o=co(t.border&&t.border.z,0);return this._isVisible()&&this.draw===Cr.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",o=[];let a,s;for(a=0,s=e.length;a<s;++a){const s=e[a];s[i]!==this.id||t&&s.type!==t||o.push(s)}return o}_resolveTickFontOptions(t){return Ja(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Sr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const o=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in o||(o[a]=t,function(t,e,i){const o=wo(Object.create(null),[i?$a.get(i):{},$a.get(e),t.defaults]);$a.set(e,o),t.defaultRoutes&&function(t,e){Object.keys(e).forEach(i=>{const o=i.split("."),a=o.pop(),s=[t].concat(o).join("."),n=e[i].split("."),r=n.pop(),l=n.join(".");$a.route(s,a,l,r)})}(e,t.defaultRoutes);t.descriptors&&$a.describe(e,t.descriptors)}(t,s,i),this.override&&$a.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,o=this.scope;i in e&&delete e[i],o&&i in $a[o]&&(delete $a[o][i],this.override&&delete Ca[i])}}class _r{constructor(){this.controllers=new Sr(pn,"datasets",!0),this.elements=new Sr(pr,"elements"),this.plugins=new Sr(Object,"plugins"),this.scales=new Sr(Cr,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(e=>{const o=i||this._getRegistryForType(e);i||o.isForType(e)||o===this.plugins&&e.id?this._exec(t,o,e):mo(e,e=>{const o=i||this._getRegistryForType(e);this._exec(t,o,e)})})}_exec(t,e,i){const o=So(t);po(i["before"+o],[],i),e[t](i),po(i["after"+o],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const o=e.get(t);if(void 0===o)throw new Error('"'+t+'" is not a registered '+i+".");return o}}var Er=new _r;class Ar{constructor(){this._init=void 0}notify(t,e,i,o){if("beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),void 0===this._init)return;const a=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(a,t,e,i);return"afterDestroy"===e&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),s}_notify(t,e,i,o){o=o||{};for(const a of t){const t=a.plugin;if(!1===po(t[i],[e,o,a.options],t)&&o.cancelable)return!1}return!0}invalidate(){so(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,o=co(i.options&&i.options.plugins,{}),a=function(t){const e={},i=[],o=Object.keys(Er.plugins.items);for(let t=0;t<o.length;t++)i.push(Er.getPlugin(o[t]));const a=t.plugins||[];for(let t=0;t<a.length;t++){const o=a[t];-1===i.indexOf(o)&&(i.push(o),e[o.id]=!0)}return{plugins:i,localIds:e}}(i);return!1!==o||e?function(t,{plugins:e,localIds:i},o,a){const s=[],n=t.getContext();for(const r of e){const e=r.id,l=$r(o[e],a);null!==l&&s.push({plugin:r,options:Lr(t.config,{plugin:r,local:i[e]},l,n)})}return s}(t,a,o,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,o=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(o(e,i),t,"stop"),this._notify(o(i,e),t,"start")}}function $r(t,e){return e||!1!==t?!0===t?{}:t:null}function Lr(t,{plugin:e,local:i},o,a){const s=t.pluginScopeKeys(e),n=t.getOptionScopes(o,s);return i&&e.defaults&&n.push(e.defaults),t.createResolver(n,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Dr(t,e){const i=$a.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Mr(t){if("x"===t||"y"===t||"r"===t)return t}function zr(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Tr(t,...e){if(Mr(t))return t;for(const i of e){const e=i.axis||zr(i.position)||t.length>1&&Mr(t[0].toLowerCase());if(e)return e}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Or(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function Pr(t,e){const i=Ca[t.type]||{scales:{}},o=e.scales||{},a=Dr(t.type,e),s=Object.create(null);return Object.keys(o).forEach(e=>{const n=o[e];if(!ro(n))return console.error(`Invalid scale configuration for scale: ${e}`);if(n._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${e}`);const r=Tr(e,n,function(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(e=>e.xAxisID===t||e.yAxisID===t);if(i.length)return Or(t,"x",i[0])||Or(t,"y",i[0])}return{}}(e,t),$a.scales[n.type]),l=function(t,e){return t===e?"_index_":"_value_"}(r,a),h=i.scales||{};s[e]=yo(Object.create(null),[{axis:r},n,h[r],h[l]])}),t.data.datasets.forEach(i=>{const a=i.type||t.type,n=i.indexAxis||Dr(a,e),r=(Ca[a]||{}).scales||{};Object.keys(r).forEach(t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,n),a=i[e+"AxisID"]||e;s[a]=s[a]||Object.create(null),yo(s[a],[{axis:e},o[a],r[t]])})}),Object.keys(s).forEach(t=>{const e=s[t];yo(e,[$a.scales[e.type],$a.scale])}),s}function Fr(t){const e=t.options||(t.options={});e.plugins=co(e.plugins,{}),e.scales=Pr(t,e)}function Ir(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Rr=new Map,Vr=new Set;function Br(t,e){let i=Rr.get(t);return i||(i=e(),Rr.set(t,i),Vr.add(i)),i}const Nr=(t,e,i)=>{const o=Co(e,i);void 0!==o&&t.add(o)};class Hr{constructor(t){this._config=function(t){return(t=t||{}).data=Ir(t.data),Fr(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ir(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Fr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Br(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Br(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Br(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id;return Br(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let o=i.get(t);return o&&!e||(o=new Map,i.set(t,o)),o}getOptionScopes(t,e,i){const{options:o,type:a}=this,s=this._cachedScopes(t,i),n=s.get(e);if(n)return n;const r=new Set;e.forEach(e=>{t&&(r.add(t),e.forEach(e=>Nr(r,t,e))),e.forEach(t=>Nr(r,o,t)),e.forEach(t=>Nr(r,Ca[a]||{},t)),e.forEach(t=>Nr(r,$a,t)),e.forEach(t=>Nr(r,Sa,t))});const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Vr.has(e)&&s.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ca[e]||{},$a.datasets[e]||{},{type:e},$a,Sa]}resolveNamedOptions(t,e,i,o=[""]){const a={$shared:!0},{resolver:s,subPrefixes:n}=qr(this._resolverCache,t,o);let r=s;if(function(t,e){const{isScriptable:i,isIndexable:o}=os(t);for(const a of e){const e=i(a),s=o(a),n=(s||e)&&t[a];if(e&&(Eo(n)||Ur(n))||s&&no(n))return!0}return!1}(s,e)){a.$shared=!1;r=is(s,i=Eo(i)?i():i,this.createResolver(t,i,n))}for(const t of e)a[t]=r[t];return a}createResolver(t,e,i=[""],o){const{resolver:a}=qr(this._resolverCache,t,i);return ro(e)?is(a,e,void 0,o):a}}function qr(t,e,i){let o=t.get(e);o||(o=new Map,t.set(e,o));const a=i.join();let s=o.get(a);if(!s){s={resolver:es(e,i),subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},o.set(a,s)}return s}const Ur=t=>ro(t)&&Object.getOwnPropertyNames(t).some(e=>Eo(t[e]));const Wr=["top","bottom","left","right","chartArea"];function jr(t,e){return"top"===t||"bottom"===t||-1===Wr.indexOf(t)&&"x"===e}function Yr(t,e){return function(i,o){return i[t]===o[t]?i[e]-o[e]:i[t]-o[t]}}function Kr(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),po(i&&i.onComplete,[t],e)}function Xr(t){const e=t.chart,i=e.options.animation;po(i&&i.onProgress,[t],e)}function Gr(t){return ks()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Qr={},Jr=t=>{const e=Gr(t);return Object.values(Qr).filter(t=>t.canvas===e).pop()};function Zr(t,e,i){const o=Object.keys(t);for(const a of o){const o=+a;if(o>=e){const s=t[a];delete t[a],(i>0||o>e)&&(t[o+i]=s)}}}class tl{static defaults=$a;static instances=Qr;static overrides=Ca;static registry=Er;static version="4.5.1";static getChart=Jr;static register(...t){Er.add(...t),el()}static unregister(...t){Er.remove(...t),el()}constructor(t,e){const i=this.config=new Hr(e),o=Gr(t),a=Jr(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||function(t){return!ks()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Qn:ur}(o)),this.platform.updateConfig(i);const n=this.platform.acquireContext(o,s.aspectRatio),r=n&&n.canvas,l=r&&r.height,h=r&&r.width;this.id=ao(),this.ctx=n,this.canvas=r,this.width=h,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ar,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let i;return function(...o){return e?(clearTimeout(i),i=setTimeout(t,e,o)):t.apply(this,o),e}}(t=>this.update(t),s.resizeDelay||0),this._dataChanges=[],Qr[this.id]=this,n&&r?(Gs.listen(this,"complete",Kr),Gs.listen(this,"progress",Xr),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:o,_aspectRatio:a}=this;return so(t)?e&&a?a:o?i/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Er}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ms(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return za(this.canvas,this.ctx),this}stop(){return Gs.stop(this),this}resize(t,e){Gs.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,o=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,e,a),n=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Ms(this,n,!0)&&(this.notifyPlugins("resize",{size:s}),po(i.onResize,[this,s],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){mo(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,o=Object.keys(i).reduce((t,e)=>(t[e]=!1,t),{});let a=[];e&&(a=a.concat(Object.keys(e).map(t=>{const i=e[t],o=Tr(t,i),a="r"===o,s="x"===o;return{options:i,dposition:a?"chartArea":s?"bottom":"left",dtype:a?"radialLinear":s?"category":"linear"}}))),mo(a,e=>{const a=e.options,s=a.id,n=Tr(s,a),r=co(a.type,e.dtype);void 0!==a.position&&jr(a.position,n)===jr(e.dposition)||(a.position=e.dposition),o[s]=!0;let l=null;if(s in i&&i[s].type===r)l=i[s];else{l=new(Er.getScale(r))({id:s,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(a,t)}),mo(o,(t,e)=>{t||delete i[e]}),mo(i,t=>{Xn.configure(this,t,t.options),Xn.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Yr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,o;for(this._removeUnreferencedMetasets(),i=0,o=e.length;i<o;i++){const o=e[i];let a=this.getDatasetMeta(i);const s=o.type||this.config.type;if(a.type&&a.type!==s&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=s,a.indexAxis=o.indexAxis||Dr(s,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const e=Er.getController(s),{datasetElementType:o,dataElementType:n}=$a.datasets[s];Object.assign(e,{dataElementType:Er.getElement(n),datasetElementType:o&&Er.getElement(o)}),a.controller=new e(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){mo(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!o&&-1===a.indexOf(e);e.buildOrUpdateElements(i),s=Math.max(+e.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),o||mo(a,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Yr("z","_idx"));const{_active:n,_lastEvent:r}=this;r?this._eventHandler(r,!0):n.length&&this._updateHoverStyles(n,n,!0),this.render()}_updateScales(){mo(this.scales,t=>{Xn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);Ao(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:o,count:a}of e){Zr(t,o,"_removeElements"===i?-a:a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter(t=>t[0]===e).map((t,e)=>e+","+t.splice(1).join(","))),o=i(0);for(let t=1;t<e;t++)if(!Ao(o,i(t)))return;return Array.from(o).map(t=>t.split(",")).map(t=>({method:t[1],start:+t[2],count:+t[3]}))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Xn.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],mo(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Eo(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),o={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",o)&&(i.controller._update(e),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(Gs.has(this)?this.attached&&!Gs.running(this)&&Gs.start(this):(this.draw(),Kr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(t,e)}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let o,a;for(o=0,a=e.length;o<a;++o){const a=e[o];t&&!a.visible||i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},o=Ks(this,t);!1!==this.notifyPlugins("beforeDatasetDraw",i)&&(o&&Fa(e,o),t.controller.draw(),o&&Ia(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Pa(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,o){const a=Fn.modes[e];return"function"==typeof a?a(this,t,i,o):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let o=i.filter(t=>t&&t._dataset===e).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(o)),o}getContext(){return this.$context||(this.$context=ts(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const o=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,o);_o(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(e=>e.datasetIndex===t?o:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Gs.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),za(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,o)=>{e.addEventListener(this,i,o),t[i]=o},o=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};mo(this.options.events,t=>i(t,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,o)=>{e.addEventListener(this,i,o),t[i]=o},o=(i,o)=>{t[i]&&(e.removeEventListener(this,i,o),delete t[i])},a=(t,e)=>{this.canvas&&this.resize(t,e)};let s;const n=()=>{o("attach",n),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,o("resize",a),this._stop(),this._resize(0,0),i("attach",n)},e.isAttached(this.canvas)?n():s()}unbindEvents(){mo(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},mo(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const o=i?"set":"remove";let a,s,n,r;for("dataset"===e&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+o+"DatasetHoverStyle"]()),n=0,r=t.length;n<r;++n){s=t[n];const e=s&&this.getDatasetMeta(s.datasetIndex).controller;e&&e[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}});!fo(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return 1===this._plugins._cache.filter(e=>e.plugin.id===t).length}_updateHoverStyles(t,e,i){const o=this.options.hover,a=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),s=a(e,t),n=i?t:a(t,e);s.length&&this.updateHoverStyle(s,o.mode,!1),n.length&&o.mode&&this.updateHoverStyle(n,o.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},o=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,o))return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,o),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:o=[],options:a}=this,s=e,n=this._getActiveElements(t,o,i,s),r=function(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}(t),l=function(t,e,i,o){return i&&"mouseout"!==t.type?o?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,po(a.onHover,[t,n,this],this),r&&po(a.onClick,[t,n,this],this));const h=!fo(n,o);
vendor: 4,790 bytes, line 1880
1880return(h||e)&&(this._active=n,this._updateHoverStyles(n,o,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,o){if("mouseout"===t.type)return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,o)}}function el(){return mo(tl.instances,t=>t._plugins.invalidate())}function il(t,e,i,o){const a=Ka(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const s=(i-e)/2,n=Math.min(s,o*e/2),r=t=>{const e=(i-Math.min(s,t))*o/2;return Go(t,0,Math.min(s,e))};return{outerStart:r(a.outerStart),outerEnd:r(a.outerEnd),innerStart:Go(a.innerStart,0,n),innerEnd:Go(a.innerEnd,0,n)}}function ol(t,e,i,o){return{x:i+t*Math.cos(e),y:o+t*Math.sin(e)}}function al(t,e,i,o,a,s){const{x:n,y:r,startAngle:l,pixelMargin:h,innerRadius:c}=e,d=Math.max(e.outerRadius+o+i-h,0),u=c>0?c+o+i+h:0;let p=0;const m=a-l;if(o){const t=((c>0?c-o:0)+(d>0?d-o:0))/2;p=(m-(0!==t?m*t/(t+o):m))/2}const f=(m-Math.max(.001,m*d-i/$o)/d)/2,g=l+f+p,b=a-f-p,{outerStart:v,outerEnd:w,innerStart:y,innerEnd:x}=il(e,u,d,b-g),k=d-v,C=d-w,S=g+v/k,_=b-w/C,E=u+y,A=u+x,$=g+y/E,L=b-x/A;if(t.beginPath(),s){const e=(S+_)/2;if(t.arc(n,r,d,S,e),t.arc(n,r,d,e,_),w>0){const e=ol(C,_,n,r);t.arc(e.x,e.y,w,_,b+To)}const i=ol(A,b,n,r);if(t.lineTo(i.x,i.y),x>0){const e=ol(A,L,n,r);t.arc(e.x,e.y,x,b+To,L+Math.PI)}const o=(b-x/u+(g+y/u))/2;if(t.arc(n,r,u,b-x/u,o,!0),t.arc(n,r,u,o,g+y/u,!0),y>0){const e=ol(E,$,n,r);t.arc(e.x,e.y,y,$+Math.PI,g-To)}const a=ol(k,g,n,r);if(t.lineTo(a.x,a.y),v>0){const e=ol(k,S,n,r);t.arc(e.x,e.y,v,g-To,S)}}else{t.moveTo(n,r);const e=Math.cos(S)*d+n,i=Math.sin(S)*d+r;t.lineTo(e,i);const o=Math.cos(_)*d+n,a=Math.sin(_)*d+r;t.lineTo(o,a)}t.closePath()}function sl(t,e,i,o,a){const{fullCircles:s,startAngle:n,circumference:r,options:l}=e,{borderWidth:h,borderJoinStyle:c,borderDash:d,borderDashOffset:u,borderRadius:p}=l,m="inner"===l.borderAlign;if(!h)return;t.setLineDash(d||[]),t.lineDashOffset=u,m?(t.lineWidth=2*h,t.lineJoin=c||"round"):(t.lineWidth=h,t.lineJoin=c||"bevel");let f=e.endAngle;if(s){al(t,e,i,o,f,a);for(let e=0;e<s;++e)t.stroke();isNaN(r)||(f=n+(r%Lo||Lo))}m&&function(t,e,i){const{startAngle:o,pixelMargin:a,x:s,y:n,outerRadius:r,innerRadius:l}=e;let h=a/r;t.beginPath(),t.arc(s,n,r,o-h,i+h),l>a?(h=a/l,t.arc(s,n,l,i+h,o-h,!0)):t.arc(s,n,a,i+To,o-To),t.closePath(),t.clip()}(t,e,f),l.selfJoin&&f-n>=$o&&0===p&&"miter"!==c&&function(t,e,i){const{startAngle:o,x:a,y:s,outerRadius:n,innerRadius:r,options:l}=e,{borderWidth:h,borderJoinStyle:c}=l,d=Math.min(h/n,Ko(o-i));if(t.beginPath(),t.arc(a,s,n-h/2,o+d/2,i-d/2),r>0){const e=Math.min(h/r,Ko(o-i));t.arc(a,s,r+h/2,i-e/2,o+e/2,!0)}else{const e=Math.min(h/2,n*Ko(o-i));if("round"===c)t.arc(a,s,e,i-$o/2,o+$o/2,!0);else if("bevel"===c){const n=2*e*e,r=-n*Math.cos(i+$o/2)+a,l=-n*Math.sin(i+$o/2)+s,h=n*Math.cos(o+$o/2)+a,c=n*Math.sin(o+$o/2)+s;t.lineTo(r,l),t.lineTo(h,c)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}(t,e,f),s||(al(t,e,i,o,f,a),t.stroke())}class nl extends pr{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const o=this.getProps(["x","y"],i),{angle:a,distance:s}=Wo(o,{x:t,y:e}),{startAngle:n,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=(this.options.spacing+this.options.borderWidth)/2,u=co(c,r-n),p=Xo(a,n,r)&&n!==r,m=u>=Lo||p,f=Qo(s,l+d,h+d);return m&&f}getCenterPoint(t){const{x:e,y:i,startAngle:o,endAngle:a,innerRadius:s,outerRadius:n}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:r,spacing:l}=this.options,h=(o+a)/2,c=(s+n+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,o=(e.offset||0)/4,a=(e.spacing||0)/2,s=e.circular;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>Lo?Math.floor(i/Lo):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();const n=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(n)*o,Math.sin(n)*o);const r=o*(1-Math.sin(Math.min($o,i||0)));t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,function(t,e,
vendor: 9,023 bytes, line 1880
1880i,o,a){const{fullCircles:s,startAngle:n,circumference:r}=e;let l=e.endAngle;if(s){al(t,e,i,o,l,a);for(let e=0;e<s;++e)t.fill();isNaN(r)||(l=n+(r%Lo||Lo))}al(t,e,i,o,l,a),t.fill()}(t,this,r,a,s),sl(t,this,r,a,s),t.restore()}}function rl(t,e,i=e){t.lineCap=co(i.borderCapStyle,e.borderCapStyle),t.setLineDash(co(i.borderDash,e.borderDash)),t.lineDashOffset=co(i.borderDashOffset,e.borderDashOffset),t.lineJoin=co(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=co(i.borderWidth,e.borderWidth),t.strokeStyle=co(i.borderColor,e.borderColor)}function ll(t,e,i){t.lineTo(i.x,i.y)}function hl(t,e,i={}){const o=t.length,{start:a=0,end:s=o-1}=i,{start:n,end:r}=e,l=Math.max(a,n),h=Math.min(s,r),c=a<n&&s<n||a>r&&s>r;return{count:o,start:l,loop:e.loop,ilen:h<l&&!c?o+h-l:h-l}}function cl(t,e,i,o){const{points:a,options:s}=e,{count:n,start:r,loop:l,ilen:h}=hl(a,i,o),c=function(t){return t.stepped?Ra:t.tension||"monotone"===t.cubicInterpolationMode?Va:ll}(s);let d,u,p,{move:m=!0,reverse:f}=o||{};for(d=0;d<=h;++d)u=a[(r+(f?h-d:d))%n],u.skip||(m?(t.moveTo(u.x,u.y),m=!1):c(t,p,u,f,s.stepped),p=u);return l&&(u=a[(r+(f?h:0))%n],c(t,p,u,f,s.stepped)),!!l}function dl(t,e,i,o){const a=e.points,{count:s,start:n,ilen:r}=hl(a,i,o),{move:l=!0,reverse:h}=o||{};let c,d,u,p,m,f,g=0,b=0;const v=t=>(n+(h?r-t:t))%s,w=()=>{p!==m&&(t.lineTo(g,m),t.lineTo(g,p),t.lineTo(g,f))};for(l&&(d=a[v(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=a[v(c)],d.skip)continue;const e=d.x,i=d.y,o=0|e;o===u?(i<p?p=i:i>m&&(m=i),g=(b*g+e)/++b):(w(),t.lineTo(e,i),u=o,b=0,p=m=i),f=i}w()}function ul(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?dl:cl}const pl="function"==typeof Path2D;function ml(t,e,i,o){pl&&!e.options.segment?function(t,e,i,o){let a=e._path;a||(a=e._path=new Path2D,e.path(a,i,o)&&a.closePath()),rl(t,e.options),t.stroke(a)}(t,e,i,o):function(t,e,i,o){const{segments:a,options:s}=e,n=ul(e);for(const r of a)rl(t,s,r.style),t.beginPath(),n(t,e,r,{start:i,end:i+o-1})&&t.closePath(),t.stroke()}(t,e,i,o)}class fl extends pr{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const o=i.spanGaps?this._loop:this._fullLoop;xs(this._points,i,t,o,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const i=t.points,o=t.options.spanGaps,a=i.length;if(!a)return[];const s=!!t._loop,{start:n,end:r}=function(t,e,i,o){let a=0,s=e-1;if(i&&!o)for(;a<e&&!t[a].skip;)a++;for(;a<e&&t[a].skip;)a++;for(a%=e,i&&(s+=a);s>a&&t[s%e].skip;)s--;return s%=e,{start:a,end:s}}(i,a,s,o);return Us(t,!0===o?[{start:n,end:r,loop:s}]:function(t,e,i,o){const a=t.length,s=[];let n,r=e,l=t[e];for(n=e+1;n<=i;++n){const i=t[n%a];i.skip||i.stop?l.skip||(o=!1,s.push({start:e%a,end:(n-1)%a,loop:o}),e=r=i.stop?n:null):(r=n,l.skip&&(e=n)),l=i}return null!==r&&s.push({start:e%a,end:r%a,loop:o}),s}(i,n,r<n?r+a:r,!!t._fullLoop&&0===n&&r===a-1),i,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,o=t[e],a=this.points,s=qs(this,{property:e,start:o,end:o});if(!s.length)return;const n=[],r=function(t){return t.stepped?Ps:t.tension||"monotone"===t.cubicInterpolationMode?Fs:Os}(i);let l,h;for(l=0,h=s.length;l<h;++l){const{start:h,end:c}=s[l],d=a[h],u=a[c];if(d===u){n.push(d);continue}const p=r(d,u,Math.abs((o-d[e])/(u[e]-d[e])),i.stepped);p[e]=t[e],n.push(p)}return 1===n.length?n[0]:n}pathSegment(t,e,i){return ul(this)(t,this,e,i)}path(t,e,i){const o=this.segments,a=ul(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const n of o)s&=a(t,this,n,{start:e,end:e+i-1});return!!s}draw(t,e,i,o){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),ml(t,this,i,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function gl(t,e,i,o){const a=t.options,{[i]:s}=t.getProps([i],o);return Math.abs(e-s)<a.radius+a.hitRadius}class bl extends pr{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const o=this.options,{x:a,y:s}=this.getProps(["x","y"],i);return Math.pow(t-a,2)+Math.pow(e-s,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,e){return gl(this,t,"x",e)}inYRange(t,e){return gl(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!Pa(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,Ta(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function vl(t,e){const{x:i,y:o,base:a,width:s,height:n}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=n/2,r=Math.min(i,a),l=Math.max(i,a),h=o-d,c=o+d):(d=s/2,r=i-d,l=i+d,h=Math.min(o,a),c=Math.max(o,a)),{left:r,top:h,right:l,bottom:c}}function wl(t,e,i,o){return t?0:Go(e,i,o)}function yl(t){const e=vl(t),i=e.right-e.left,o=e.bottom-e.top,a=function(t,e,i){const o=t.options.borderWidth,a=t.borderSkipped,s=Xa(o);return{t:wl(a.top,s.top,0,i),r:wl(a.right,s.right,0,e),b:wl(a.bottom,s.bottom,0,i),l:wl(a.left,s.left,0,e)}}(t,i/2,o/2),s=function(t,e,i){const{enableBorderRadius:o}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Ga(a),n=Math.min(e,i),r=t.borderSkipped,l=o||ro(a);return{topLeft:wl(!l||r.top||r.left,s.topLeft,0,n),topRight:wl(!l||r.top||r.right,s.topRight,0,n),bottomLeft:wl(!l||r.bottom||r.left,s.bottomLeft,0,n),bottomRight:wl(!l||r.bottom||r.right,s.bottomRight,0,n)}}(t,i/2,o/2);return{outer:{x:e.left,y:e.top,w:i,h:o,radius:s},inner:{x:e.left+a.l,y:e.top+a.t,w:i-a.l-a.r,h:o-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function xl(t,e,i,o){const a=null===e,s=null===i,n=t&&!(a&&s)&&vl(t,o);return n&&(a||Qo(e,n.left,n.right))&&(s||Qo(i,n.top,n.bottom))}function kl(t,e){t.rect(e.x,e.y,e.w,e.h)}function Cl(t,e,i={}){const o=t.x!==i.x?-e:0,a=t.y!==i.y?-e:0,s=(t.x+t.w!==i.x+i.w?e:0)-o,n=(t.y+t.h!==i.y+i.h?e:0)-a;return{x:t.x+o,y:t.y+a,w:t.w+s,h:t.h+n,radius:t.radius}}class Sl extends pr{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:o}}=this,{inner:a,outer:s}=yl(this),n=(r=s.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?qa:kl;var r;t.save(),s.w===a.w&&s.h===a.h||(t.beginPath(),n(t,Cl(s,e,a)),t.clip(),n(t,Cl(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),n(t,Cl(a,e)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,e,i){return xl(this,t,e,i)}inXRange(t,e){return xl(this,t,null,e)}inYRange(t,e){return xl(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:o,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+o)/2:e,y:a?i:(i+o)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}function _l(t,e,i,o){if(o)return;let a=e[t],s=i[t];return"angle"===t&&(a=Ko(a),s=Ko(s)),{property:t,start:a,end:s}}function El(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function Al(t,e,i,o){return t&&e?o(t[i],e[i]):t?t[i]:e?e[i]:0}function $l(t,e){let i=[],o=!1;return no(t)?(o=!0,i=t):i=function(t,e){const{x:i=null,y:o=null}=t||{},a=e.points,s=[];
vendor: 8,878 bytes, line 1880
1880return e.segments.forEach(({start:t,end:e})=>{e=El(t,e,a);const n=a[t],r=a[e];null!==o?(s.push({x:n.x,y:o}),s.push({x:r.x,y:o})):null!==i&&(s.push({x:i,y:n.y}),s.push({x:i,y:r.y}))}),s}(t,e),i.length?new fl({points:i,options:{tension:0},_loop:o,_fullLoop:o}):null}function Ll(t){return t&&!1!==t.fill}function Dl(t,e,i){let o=t[e].fill;const a=[e];let s;if(!i)return o;for(;!1!==o&&-1===a.indexOf(o);){if(!lo(o))return o;if(s=t[o],!s)return!1;if(s.visible)return o;a.push(o),o=s.fill}return!1}function Ml(t,e,i){const o=function(t){const e=t.options,i=e.fill;let o=co(i&&i.target,i);void 0===o&&(o=!!e.backgroundColor);if(!1===o||null===o)return!1;if(!0===o)return"origin";return o}(t);if(ro(o))return!isNaN(o.value)&&o;let a=parseFloat(o);return lo(a)&&Math.floor(a)===a?function(t,e,i,o){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=o)return!1;return i}(o[0],e,a,i):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function zl(t,e,i){const o=[];for(let a=0;a<i.length;a++){const s=i[a],{first:n,last:r,point:l}=Tl(s,e,"x");if(!(!l||n&&r))if(n)o.unshift(l);else if(t.push(l),!r)break}t.push(...o)}function Tl(t,e,i){const o=t.interpolate(e,i);if(!o)return{};const a=o[i],s=t.segments,n=t.points;let r=!1,l=!1;for(let t=0;t<s.length;t++){const e=s[t],o=n[e.start][i],h=n[e.end][i];if(Qo(a,o,h)){r=a===o,l=a===h;break}}return{first:r,last:l,point:o}}class Ol{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:o,y:a,radius:s}=this;return e=e||{start:0,end:Lo},t.arc(o,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:o}=this,a=t.angle;return{x:e+Math.cos(a)*o,y:i+Math.sin(a)*o,angle:a}}}function Pl(t){const{chart:e,fill:i,line:o}=t;if(lo(i))return function(t,e){const i=t.getDatasetMeta(e),o=i&&t.isDatasetVisible(e);return o?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:o}=t,a=[],s=o.segments,n=o.points,r=function(t,e){const i=[],o=t.getMatchingVisibleMetas("line");for(let t=0;t<o.length;t++){const a=o[t];if(a.index===e)break;a.hidden||i.unshift(a.dataset)}return i}(e,i);r.push($l({x:null,y:e.bottom},o));for(let t=0;t<s.length;t++){const e=s[t];for(let t=e.start;t<=e.end;t++)zl(a,n[t],r)}return new fl({points:a,options:{}})}(t);if("shape"===i)return!0;const a=function(t){const e=t.scale||{};if(e.getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,o=e.options,a=e.getLabels().length,s=o.reverse?e.max:e.min,n=function(t,e,i){let o;return o="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:ro(t)?t.value:e.getBaseValue(),o}(i,e,s),r=[];if(o.grid.circular){const t=e.getPointPositionForValue(0,s);return new Ol({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(n)})}for(let t=0;t<a;++t)r.push(e.getPointPositionForValue(t,n));return r}(t);return function(t){const{scale:e={},fill:i}=t,o=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:ro(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(lo(o)){const t=e.isHorizontal();return{x:t?o:null,y:t?null:o}}return null}(t)}(t);return a instanceof Ol?a:$l(a,o)}function Fl(t,e,i){const o=Pl(e),{chart:a,index:s,line:n,scale:r,axis:l}=e,h=n.options,c=h.fill,d=h.backgroundColor,{above:u=d,below:p=d}=c||{},m=a.getDatasetMeta(s),f=Ks(a,m);o&&n.points.length&&(Fa(t,i),function(t,e){const{line:i,target:o,above:a,below:s,area:n,scale:r,clip:l}=e,h=i._loop?"angle":e.axis;t.save();let c=s;s!==a&&("x"===h?(Il(t,o,n.top),Vl(t,{line:i,target:o,color:a,scale:r,property:h,clip:l}),t.restore(),t.save(),Il(t,o,n.bottom)):"y"===h&&(Rl(t,o,n.left),Vl(t,{line:i,target:o,color:s,scale:r,property:h,clip:l}),t.restore(),t.save(),Rl(t,o,n.right),c=a));Vl(t,{line:i,target:o,color:c,scale:r,property:h,clip:l}),t.restore()}(t,{line:n,target:o,above:u,below:p,area:i,scale:r,axis:l,clip:f}),Ia(t))}function Il(t,e,i){const{segments:o,points:a}=e;let s=!0,n=!1;t.beginPath();for(const r of o){const{start:o,end:l}=r,h=a[o],c=a[El(o,l,a)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),n=!!e.pathSegment(t,r,{move:n}),n?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Rl(t,e,i){const{segments:o,points:a}=e;let s=!0,n=!1;t.beginPath();for(const r of o){const{start:o,end:l}=r,h=a[o],c=a[El(o,l,a)];s?(t.moveTo(h.x,h.y),s=!1):(t.lineTo(i,h.y),t.lineTo(h.x,h.y)),n=!!e.pathSegment(t,r,{move:n}),n?t.closePath():t.lineTo(i,c.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function Vl(t,e){const{line:i,target:o,property:a,color:s,scale:n,clip:r}=e,l=function(t,e,i){const o=t.segments,a=t.points,s=e.points,n=[];for(const t of o){let{start:o,end:r}=t;r=El(o,r,a);const l=_l(i,a[o],a[r],t.loop);if(!e.segments){n.push({source:t,target:l,start:a[o],end:a[r]});continue}const h=qs(e,l);for(const e of h){const o=_l(i,s[e.start],s[e.end],e.loop),r=Hs(t,a,o);for(const t of r)n.push({source:t,target:e,start:{[i]:Al(l,o,"start",Math.max)},end:{[i]:Al(l,o,"end",Math.min)}})}}return n}(i,o,a);for(const{source:e,target:h,start:c,end:d}of l){const{style:{backgroundColor:l=s}={}}=e,u=!0!==o;t.save(),t.fillStyle=l,Bl(t,n,r,u&&_l(a,c,d)),t.beginPath();const p=!!i.pathSegment(t,e);let m;if(u){p?t.closePath():Nl(t,o,d,a);const e=!!o.pathSegment(t,h,{move:p,reverse:!0});m=p&&e,m||Nl(t,o,c,a)}t.closePath(),t.fill(m?"evenodd":"nonzero"),t.restore()}}function Bl(t,e,i,o){const a=e.chart.chartArea,{property:s,start:n,end:r}=o||{};if("x"===s||"y"===s){let e,o,l,h;"x"===s?(e=n,o=a.top,l=r,h=a.bottom):(e=a.left,o=n,l=a.right,h=r),t.beginPath(),i&&(e=Math.max(e,i.left),l=Math.min(l,i.right),o=Math.max(o,i.top),h=Math.min(h,i.bottom)),t.rect(e,o,l-e,h-o),t.clip()}}function Nl(t,e,i,o){const a=e.interpolate(i,o);a&&t.lineTo(a.x,a.y)}var Hl={id:"filler",afterDatasetsUpdate(t,e,i){const o=(t.data.datasets||[]).length,a=[];let s,n,r,l;for(n=0;n<o;++n)s=t.getDatasetMeta(n),r=s.dataset,l=null,r&&r.options&&r instanceof fl&&(l={visible:t.isDatasetVisible(n),index:n,fill:Ml(r,n,o),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=l,a.push(l);for(n=0;n<o;++n)l=a[n],l&&!1!==l.fill&&(l.fill=Dl(a,n,i.propagate))},beforeDraw(t,e,i){const o="beforeDraw"===i.drawTime,a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let e=a.length-1;e>=0;--e){const i=a[e].$filler;i&&(i.line.updateControlPoints(s,i.axis),o&&i.fill&&Fl(t.ctx,i,s))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const o=t.getSortedVisibleDatasetMetas();for(let e=o.length-1;e>=0;--e){const i=o[e].$filler;Ll(i)&&Fl(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const o=e.meta.$filler;Ll(o)&&"beforeDatasetDraw"===i.drawTime&&Fl(t.ctx,o,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ql=(t,e)=>{let{boxHeight:i=e,boxWidth:o=e}=t;return t.usePointStyle&&(i=Math.min(i,e),o=t.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:i,itemHeight:Math.max(e,i)}};class Ul extends pr{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=po(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(e=>t.filter(e,this.chart.data))),t.sort&&(e=e.sort((e,i)=>t.sort(e,i,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,o=Ja(i.font),a=o.size,s=this._computeTitleHeight(),{boxWidth:n,itemHeight:r}=ql(i,a);let l,h;e.font=o.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(s,a,n,r)+10):(h=this.maxHeight,l=this._fitCols(s,o,n,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,o){const{ctx:a,maxWidth:s,options:{labels:{padding:n}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=o+n;let c=t;a.textAlign="left",a.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach((t,p)=>{const m=i+e/2+a.measureText(t.text).width;(0===p||l[l.length-1]+m+2*n>s)&&(c+=h,l[l.length-(p>0?0:1)]=0,u+=h,d++),r[p]={left:0,top:u,row:d,width:m,height:o},l[l.length-1]+=m+n}),c}_fitCols(t,e,i,o){const{ctx:a,maxHeight:s,options:{labels:{padding:n}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=s-t;
vendor: 35,311 bytes, line 1880
1880let c=n,d=0,u=0,p=0,m=0;return this.legendItems.forEach((t,s)=>{const{itemWidth:f,itemHeight:g}=function(t,e,i,o,a){const s=function(t,e,i,o){let a=t.text;a&&"string"!=typeof a&&(a=a.reduce((t,e)=>t.length>e.length?t:e));return e+i.size/2+o.measureText(a).width}(o,t,e,i),n=function(t,e,i){let o=t;"string"!=typeof e.text&&(o=Wl(e,i));return o}(a,o,e.lineHeight);return{itemWidth:s,itemHeight:n}}(i,e,a,t,o);s>0&&u+g+2*n>h&&(c+=d+n,l.push({width:d,height:u}),p+=d+n,m++,d=u=0),r[s]={left:p,top:u,col:m,width:f,height:g},d=Math.max(d,f),u+=g+n}),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:o},rtl:a}}=this,s=Is(a,this.left,this.width);if(this.isHorizontal()){let a=0,n=ra(i,this.left+o,this.right-this.lineWidths[a]);for(const r of e)a!==r.row&&(a=r.row,n=ra(i,this.left+o,this.right-this.lineWidths[a])),r.top+=this.top+t+o,r.left=s.leftForLtr(s.x(n),r.width),n+=r.width+o}else{let a=0,n=ra(i,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const r of e)r.col!==a&&(a=r.col,n=ra(i,this.top+t+o,this.bottom-this.columnSizes[a].height)),r.top=n,r.left+=this.left+o,r.left=s.leftForLtr(s.x(r.left),r.width),n+=r.height+o}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Fa(t,this),this._draw(),Ia(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:o}=this,{align:a,labels:s}=t,n=$a.color,r=Is(t.rtl,this.left,this.width),l=Ja(s.font),{padding:h}=s,c=l.size,d=c/2;let u;this.drawTitle(),o.textAlign=r.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=l.string;const{boxWidth:p,boxHeight:m,itemHeight:f}=ql(s,c),g=this.isHorizontal(),b=this._computeTitleHeight();u=g?{x:ra(a,this.left+h,this.right-i[0]),y:this.top+h+b,line:0}:{x:this.left+h,y:ra(a,this.top+b+h,this.bottom-e[0].height),line:0},Rs(this.ctx,t.textDirection);const v=f+h;this.legendItems.forEach((w,y)=>{o.strokeStyle=w.fontColor,o.fillStyle=w.fontColor;const x=o.measureText(w.text).width,k=r.textAlign(w.textAlign||(w.textAlign=s.textAlign)),C=p+d+x;let S=u.x,_=u.y;r.setWidth(this.width),g?y>0&&S+C+h>this.right&&(_=u.y+=v,u.line++,S=u.x=ra(a,this.left+h,this.right-i[u.line])):y>0&&_+v>this.bottom&&(S=u.x=S+e[u.line].width+h,u.line++,_=u.y=ra(a,this.top+b+h,this.bottom-e[u.line].height));if(function(t,e,i){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;o.save();const a=co(i.lineWidth,1);if(o.fillStyle=co(i.fillStyle,n),o.lineCap=co(i.lineCap,"butt"),o.lineDashOffset=co(i.lineDashOffset,0),o.lineJoin=co(i.lineJoin,"miter"),o.lineWidth=a,o.strokeStyle=co(i.strokeStyle,n),o.setLineDash(co(i.lineDash,[])),s.usePointStyle){const n={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:a},l=r.xPlus(t,p/2);Oa(o,n,l,e+d,s.pointStyleWidth&&p)}else{const s=e+Math.max((c-m)/2,0),n=r.leftForLtr(t,p),l=Ga(i.borderRadius);o.beginPath(),Object.values(l).some(t=>0!==t)?qa(o,{x:n,y:s,w:p,h:m,radius:l}):o.rect(n,s,p,m),o.fill(),0!==a&&o.stroke()}o.restore()}(r.x(S),_,w),S=((t,e,i,o)=>t===(o?"left":"right")?i:"center"===t?(e+i)/2:e)(k,S+p+d,g?S+C:this.right,t.rtl),function(t,e,i){Ha(o,i.text,t,e+f/2,l,{strikethrough:i.hidden,textAlign:r.textAlign(i.textAlign)})}(r.x(S),_,w),g)u.x+=C+h;else if("string"!=typeof w.text){const t=l.lineHeight;u.y+=Wl(w,t)+h}else u.y+=v}),Vs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Ja(e.font),o=Qa(e.padding);if(!e.display)return;const a=Is(t.rtl,this.left,this.width),s=this.ctx,n=e.position,r=i.size/2,l=o.top+r;let h,c=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+l,c=ra(t.align,c,this.right-d);else{const e=this.columnSizes.reduce((t,e)=>Math.max(t,e.height),0);h=l+ra(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const u=ra(n,c,c+d);s.textAlign=a.textAlign(na(n)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,Ha(s,e.text,u,h,i)}_computeTitleHeight(){const t=this.options.title,e=Ja(t.font),i=Qa(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,o,a;if(Qo(t,this.left,this.right)&&Qo(e,this.top,this.bottom))for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(o=a[i],Qo(t,o.left,o.left+o.width)&&Qo(e,o.top,o.top+o.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(o,i);o&&!a&&po(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&po(e.onHover,[t,i,this],this)}else i&&po(e.onClick,[t,i,this],this)}}function Wl(t,e){return e*(t.text?t.text.length:0)}var jl={id:"legend",_element:Ul,start(t,e,i){const o=t.legend=new Ul({ctx:t.ctx,options:i,chart:t});Xn.configure(t,o,i),Xn.addBox(t,o)},stop(t){Xn.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const o=t.legend;Xn.configure(t,o,i),o.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const o=e.datasetIndex,a=i.chart;a.isDatasetVisible(o)?(a.hide(o),e.hidden=!0):(a.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:o,textAlign:a,color:s,useBorderRadius:n,borderRadius:r}}=t.legend.options;return t._getSortedDatasetMetas().map(t=>{const l=t.controller.getStyle(i?0:void 0),h=Qa(l.borderWidth);return{text:e[t.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!t.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:l.borderColor,pointStyle:o||l.pointStyle,rotation:l.rotation,textAlign:a||l.textAlign,borderRadius:n&&(r||l.borderRadius),datasetIndex:t.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Yl extends pr{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const o=no(i.text)?i.text.length:1;this._padding=Qa(i.padding);const a=o*Ja(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:o,right:a,options:s}=this,n=s.align;let r,l,h,c=0;return this.isHorizontal()?(l=ra(n,i,a),h=e+t,r=a-i):("left"===s.position?(l=i+t,h=ra(n,o,e),c=-.5*$o):(l=a-t,h=ra(n,e,o),c=.5*$o),r=o-e),{titleX:l,titleY:h,maxWidth:r,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Ja(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:s,maxWidth:n,rotation:r}=this._drawArgs(o);Ha(t,e.text,0,0,i,{color:e.color,maxWidth:n,rotation:r,textAlign:na(e.align),textBaseline:"middle",translation:[a,s]})}}var Kl={id:"title",_element:Yl,start(t,e,i){!function(t,e){const i=new Yl({ctx:t.ctx,options:e,chart:t});Xn.configure(t,i,e),Xn.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Xn.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const o=t.titleBlock;Xn.configure(t,o,i),o.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};new WeakMap;const Xl={average(t){if(!t.length)return!1;let e,i,o=new Set,a=0,s=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();o.add(t.x),a+=t.y,++s}}if(0===s||0===o.size)return!1;const n=[...o].reduce((t,e)=>t+e)/o.size;return{x:n,y:a/s}},nearest(t,e){if(!t.length)return!1;let i,o,a,s=e.x,n=e.y,r=Number.POSITIVE_INFINITY;for(i=0,o=t.length;i<o;++i){const o=t[i].element;if(o&&o.hasValue()){const t=jo(e,o.getCenterPoint());t<r&&(r=t,a=o)}}if(a){const t=a.tooltipPosition();s=t.x,n=t.y}return{x:s,y:n}}};function Gl(t,e){return e&&(no(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ql(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Jl(t,e){const{element:i,datasetIndex:o,index:a}=e,s=t.getDatasetMeta(o).controller,{label:n,value:r}=s.getLabelAndValue(a);return{chart:t,label:n,parsed:s.getParsed(a),raw:t.data.datasets[o].data[a],formattedValue:r,dataset:s.getDataset(),dataIndex:a,datasetIndex:o,element:i}}function Zl(t,e){const i=t.chart.ctx,{body:o,footer:a,title:s}=t,{boxWidth:n,boxHeight:r}=e,l=Ja(e.bodyFont),h=Ja(e.titleFont),c=Ja(e.footerFont),d=s.length,u=a.length,p=o.length,m=Qa(e.padding);let f=m.height,g=0,b=o.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(f+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){f+=p*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-p)*l.lineHeight+(b-1)*e.bodySpacing}u&&(f+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let v=0;const w=function(t){g=Math.max(g,i.measureText(t).width+v)};return i.save(),i.font=h.string,mo(t.title,w),i.font=l.string,mo(t.beforeBody.concat(t.afterBody),w),v=e.displayColors?n+2+e.boxPadding:0,mo(o,t=>{mo(t.before,w),mo(t.lines,w),mo(t.after,w)}),v=0,i.font=c.string,mo(t.footer,w),i.restore(),g+=m.width,{width:g,height:f}}function th(t,e,i,o){const{x:a,width:s}=i,{width:n,chartArea:{left:r,right:l}}=t;let h="center";return"center"===o?h=a<=(r+l)/2?"left":"right":a<=s/2?h="left":a>=n-s/2&&(h="right"),function(t,e,i,o){const{x:a,width:s}=o,n=i.caretSize+i.caretPadding;return"left"===t&&a+s+n>e.width||"right"===t&&a-s-n<0||void 0}(h,t,e,i)&&(h="center"),h}function eh(t,e,i){const o=i.yAlign||e.yAlign||function(t,e){const{y:i,height:o}=e;return i<o/2?"top":i>t.height-o/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||th(t,e,i,o),yAlign:o}}function ih(t,e,i,o){const{caretSize:a,caretPadding:s,cornerRadius:n}=t,{xAlign:r,yAlign:l}=i,h=a+s,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=Ga(n);let m=function(t,e){let{x:i,width:o}=t;return"right"===e?i-=o:"center"===e&&(i-=o/2),i}(e,r);const f=function(t,e,i){let{y:o,height:a}=t;return"top"===e?o+=i:o-="bottom"===e?a+i:a/2,o}(e,l,h);return"center"===l?"left"===r?m+=h:"right"===r&&(m-=h):"left"===r?m-=Math.max(c,u)+a:"right"===r&&(m+=Math.max(d,p)+a),{x:Go(m,0,o.width-e.width),y:Go(f,0,o.height-e.height)}}function oh(t,e,i){const o=Qa(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-o.right:t.x+o.left}function ah(t){return Gl([],Ql(t))}function sh(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const nh={beforeTitle:oo,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,o=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return i[e.dataIndex]}return""},afterTitle:oo,beforeBody:oo,beforeLabel:oo,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return so(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:oo,afterBody:oo,beforeFooter:oo,footer:oo,afterFooter:oo};function rh(t,e,i,o){const a=t[e].call(i,o);return void 0===a?nh[e].call(i,o):a}class lh extends pr{static positioners=Xl;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),o=i.enabled&&e.options.animation&&i.animations,a=new tn(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,ts(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,o=rh(i,"beforeTitle",this,t),a=rh(i,"title",this,t),s=rh(i,"afterTitle",this,t);let n=[];return n=Gl(n,Ql(o)),n=Gl(n,Ql(a)),n=Gl(n,Ql(s)),n}getBeforeBody(t,e){return ah(rh(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,o=[];return mo(t,t=>{const e={before:[],lines:[],after:[]},a=sh(i,t);Gl(e.before,Ql(rh(a,"beforeLabel",this,t))),Gl(e.lines,rh(a,"label",this,t)),Gl(e.after,Ql(rh(a,"afterLabel",this,t))),o.push(e)}),o}getAfterBody(t,e){return ah(rh(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,o=rh(i,"beforeFooter",this,t),a=rh(i,"footer",this,t),s=rh(i,"afterFooter",this,t);let n=[];return n=Gl(n,Ql(o)),n=Gl(n,Ql(a)),n=Gl(n,Ql(s)),n}_createItems(t){const e=this._active,i=this.chart.data,o=[],a=[],s=[];let n,r,l=[];for(n=0,r=e.length;n<r;++n)l.push(Jl(this.chart,e[n]));return t.filter&&(l=l.filter((e,o,a)=>t.filter(e,o,a,i))),t.itemSort&&(l=l.sort((e,o)=>t.itemSort(e,o,i))),mo(l,e=>{const i=sh(t.callbacks,e);o.push(rh(i,"labelColor",this,e)),a.push(rh(i,"labelPointStyle",this,e)),s.push(rh(i,"labelTextColor",this,e))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),o=this._active;let a,s=[];if(o.length){const t=Xl[i.position].call(this,o,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const e=this._size=Zl(this,i),n=Object.assign({},t,e),r=eh(this.chart,i,n),l=ih(i,n,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,a={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(a={opacity:0});this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,o){const a=this.getCaretPosition(t,i,o);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:o,yAlign:a}=this,{caretSize:s,cornerRadius:n}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=Ga(n),{x:d,y:u}=t,{width:p,height:m}=e;let f,g,b,v,w,y;return"center"===a?(w=u+m/2,"left"===o?(f=d,g=f-s,v=w+s,y=w-s):(f=d+p,g=f+s,v=w-s,y=w+s),b=f):(g="left"===o?d+Math.max(r,h)+s:"right"===o?d+p-Math.max(l,c)-s:this.caretX,"top"===a?(v=u,w=v-s,f=g-s,b=g+s):(v=u+m,w=v+s,f=g+s,b=g-s),y=v),{x1:f,x2:g,x3:b,y1:v,y2:w,y3:y}}drawTitle(t,e,i){const o=this.title,a=o.length;let s,n,r;if(a){const l=Is(i.rtl,this.x,this.width);for(t.x=oh(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",s=Ja(i.titleFont),n=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,r=0;r<a;++r)e.fillText(o[r],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+n,r+1===a&&(t.y+=i.titleMarginBottom-n)}}_drawColorBox(t,e,i,o,a){const s=this.labelColors[i],n=this.labelPointStyles[i],{boxHeight:r,boxWidth:l}=a,h=Ja(a.bodyFont),c=oh(this,"left",a),d=o.x(c),u=r<h.lineHeight?(h.lineHeight-r)/2:0,p=e.y+u;if(a.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:1},i=o.leftForLtr(d,l)+l/2,h=p+r/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Ta(t,e,i,h),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ta(t,e,i,h)}else{t.lineWidth=ro(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const e=o.leftForLtr(d,l),i=o.leftForLtr(o.xPlus(d,1),l-2),n=Ga(s.borderRadius);Object.values(n).some(t=>0!==t)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,qa(t,{x:e,y:p,w:l,h:r,radius:n}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),qa(t,{x:i,y:p+1,w:l-2,h:r-2,radius:n}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(e,p,l,r),t.strokeRect(e,p,l,r),t.fillStyle=s.backgroundColor,t.fillRect(i,p+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:o}=this,{bodySpacing:a,bodyAlign:s,displayColors:n,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Ja(i.bodyFont);let d=c.lineHeight,u=0;const p=Is(i.rtl,this.x,this.width),m=function(i){e.fillText(i,p.x(t.x+u),t.y+d/2),t.y+=d+a},f=p.textAlign(s);let g,b,v,w,y,x,k;for(e.textAlign=s,e.textBaseline="middle",e.font=c.string,t.x=oh(this,f,i),e.fillStyle=i.bodyColor,mo(this.beforeBody,m),u=n&&"right"!==f?"center"===s?l/2+h:l+2+h:0,w=0,x=o.length;w<x;++w){for(g=o[w],b=this.labelTextColors[w],e.fillStyle=b,mo(g.before,m),v=g.lines,n&&v.length&&(this._drawColorBox(e,t,w,p,i),d=Math.max(c.lineHeight,r)),y=0,k=v.length;y<k;++y)m(v[y]),d=c.lineHeight;mo(g.after,m)}u=0,d=c.lineHeight,mo(this.afterBody,m),t.y-=a}drawFooter(t,e,i){const o=this.footer,a=o.length;let s,n;if(a){const r=Is(i.rtl,this.x,this.width);for(t.x=oh(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",s=Ja(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,n=0;n<a;++n)e.fillText(o[n],r.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,o){const{xAlign:a,yAlign:s}=this,{x:n,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:p}=Ga(o.cornerRadius);e.fillStyle=o.backgroundColor,e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.beginPath(),e.moveTo(n+c,r),"top"===s&&this.drawCaret(t,e,i,o),e.lineTo(n+l-d,r),e.quadraticCurveTo(n+l,r,n+l,r+d),"center"===s&&"right"===a&&this.drawCaret(t,e,i,o),e.lineTo(n+l,r+h-p),e.quadraticCurveTo(n+l,r+h,n+l-p,r+h),"bottom"===s&&this.drawCaret(t,e,i,o),e.lineTo(n+u,r+h),e.quadraticCurveTo(n,r+h,n,r+h-u),"center"===s&&"left"===a&&this.drawCaret(t,e,i,o),e.lineTo(n,r+c),e.quadraticCurveTo(n,r,n+c,r),e.closePath(),e.fill(),o.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,o=i&&i.x,a=i&&i.y;if(o||a){const i=Xl[t.position].call(this,this._active,this._eventPosition);if(!i)return;const s=this._size=Zl(this,t),n=Object.assign({},i,this._size),r=eh(e,t,n),l=ih(t,n,r,e);o._to===l.x&&a._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=s.width,this.height=s.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const o={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=Qa(e.padding),n=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&n&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,o,e),Rs(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Vs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,o=t.map(({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),a=!fo(i,o),s=this._positionChanged(o,e);(a||s)&&(this._active=o,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),n=this._positionChanged(s,t),r=e||!fo(s,a)||n;return r&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,o){const a=this.options;if("mouseout"===t.type)return[];if(!o)return e.filter(t=>this.chart.data.datasets[t.datasetIndex]&&void 0!==this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index));const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:o,options:a}=this,s=Xl[a.position].call(this,t,e);return!1!==s&&(i!==s.x||o!==s.y)}}var hh={id:"tooltip",_element:lh,positioners:Xl,afterInit(t,e,i){i&&(t.tooltip=new lh({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0}))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nh},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};function ch(t,e,i,o){const a=t.indexOf(e);if(-1===a)return((t,e,i,o)=>("string"==typeof e?(i=t.push(e)-1,o.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,o);return a!==t.lastIndexOf(e)?i:a}function dh(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class uh extends Cr{static id="category";static defaults={ticks:{callback:dh}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:o}of e)t[i]===o&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(so(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Go(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:ch(i,t,co(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:o}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(o=this.getLabels().length-1)),this.min=i,this.max=o}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,o=[];let a=this.getLabels();a=0===t&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)o.push({value:i});return o}getLabelForValue(t){return dh.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ph(t,e){const i=[],{bounds:o,step:a,min:s,max:n,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=a||1,p=h-1,{min:m,max:f}=e,g=!so(s),b=!so(n),v=!so(l),w=(f-m)/(c+1);let y,x,k,C,S=Vo((f-m)/p/u)*u;if(S<1e-14&&!g&&!b)return[{value:m},{value:f}];C=Math.ceil(f/S)-Math.floor(m/S),C>p&&(S=Vo(C*S/p/u)*u),so(r)||(y=Math.pow(10,r),S=Math.ceil(S*y)/y),"ticks"===o?(x=Math.floor(m/S)*S,k=Math.ceil(f/S)*S):(x=m,k=f),g&&b&&a&&function(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}((n-s)/a,S/1e3)?(C=Math.round(Math.min((n-s)/S,h)),S=(n-s)/C,x=s,k=n):v?(x=g?s:x,k=b?n:k,C=l-1,S=(k-x)/C):(C=(k-x)/S,C=Ro(C,Math.round(C),S/1e3)?Math.round(C):Math.ceil(C));const _=Math.max(Uo(S),Uo(x));y=Math.pow(10,so(r)?_:r),x=Math.round(x*y)/y,k=Math.round(k*y)/y;let E=0;for(g&&(d&&x!==s?(i.push({value:s}),x<s&&E++,Ro(Math.round((x+E*S)*y)/y,s,mh(s,w,t))&&E++):x<s&&E++);E<C;++E){const t=Math.round((x+E*S)*y)/y;if(b&&t>n)break;i.push({value:t})}return b&&d&&k!==n?i.length&&Ro(i[i.length-1].value,n,mh(n,w,t))?i[i.length-1].value=n:i.push({value:n}):b&&k!==n||i.push({value:k}),i}function mh(t,e,{horizontal:i,minRotation:o}){const a=Ho(o),s=(i?Math.sin(a):Math.cos(a))||.001,n=.75*e*(""+t).length;return Math.min(e/s,n)}class fh extends Cr{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return so(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:o,max:a}=this;const s=t=>o=e?o:t,n=t=>a=i?a:t;if(t){const t=Io(o),e=Io(a);t<0&&e<0?n(0):t>0&&e>0&&s(0)}if(o===a){let e=0===a?1:Math.abs(.05*a);n(a+e),t||s(o-e)}this.min=o,this.max=a}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:o}=t;return o?(e=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const o=ph({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&No(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const o=(i-e)/Math.max(t.length-1,1)/2;e-=o,i+=o}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ya(t,this.chart.options.locale,this.options.ticks.format)}}class gh extends fh{static id="linear";static defaults={ticks:{callback:ka.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=lo(t)?t:0,this.max=lo(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ho(this.options.ticks.minRotation),o=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/o))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ka.formatters.logarithmic;function bh(t){const e=t.ticks;if(e.display&&t.display){const t=Qa(e.backdropPadding);return co(e.font&&e.font.size,$a.font.size)+t.height}return 0}function vh(t,e,i){return i=no(i)?i:[i],{w:Da(t,e.string,i),h:i.length*e.lineHeight}}function wh(t,e,i,o,a){return t===o||t===a?{start:e-i/2,end:e+i/2}:t<o||t>a?{start:e-i,end:e}:{start:e,end:e+i}}function yh(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),o=[],a=[],s=t._pointLabels.length,n=t.options.pointLabels,r=n.centerPointLabels?$o/s:0;for(let l=0;l<s;l++){const s=n.setContext(t.getPointLabelContext(l));a[l]=s.padding;const h=t.getPointPosition(l,t.drawingArea+a[l],r),c=Ja(s.font),d=vh(t.ctx,c,t._pointLabels[l]);o[l]=d;const u=Ko(t.getIndexAngle(l)+r),p=Math.round(qo(u));xh(i,e,u,wh(p,h.x,d.w,0,180),wh(p,h.y,d.h,90,270))}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const o=[],a=t._pointLabels.length,s=t.options,{centerPointLabels:n,display:r}=s.pointLabels,l={extra:bh(s)/2,additionalAngle:n?$o/a:0};let h;for(let s=0;s<a;s++){l.padding=i[s],l.size=e[s];const a=kh(t,s,l);o.push(a),"auto"===r&&(a.visible=Ch(a,h),a.visible&&(h=a))}return o}(t,o,a)}function xh(t,e,i,o,a){const s=Math.abs(Math.sin(i)),n=Math.abs(Math.cos(i));let r=0,l=0;o.start<e.l?(r=(e.l-o.start)/s,t.l=Math.min(t.l,e.l-r)):o.end>e.r&&(r=(o.end-e.r)/s,t.r=Math.max(t.r,e.r+r)),a.start<e.t?(l=(e.t-a.start)/n,t.t=Math.min(t.t,e.t-l)):a.end>e.b&&(l=(a.end-e.b)/n,t.b=Math.max(t.b,e.b+l))}function kh(t,e,i){const o=t.drawingArea,{extra:a,additionalAngle:s,padding:n,size:r}=i,l=t.getPointPosition(e,o+a+n,s),h=Math.round(qo(Ko(l.angle+To))),c=function(t,e,i){90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e);return t}(l.y,r.h,h),d=function(t){if(0===t||180===t)return"center";if(t<180)return"left";return"right"}(h),u=function(t,e,i){"right"===i?t-=e:"center"===i&&(t-=e/2);return t}(l.x,r.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:u,top:c,right:u+r.w,bottom:c+r.h}}function Ch(t,e){if(!e)return!0;const{left:i,top:o,right:a,bottom:s}=t;return!(Pa({x:i,y:o},e)||Pa({x:i,y:s},e)||Pa({x:a,y:o},e)||Pa({x:a,y:s},e))}function Sh(t,e,i){const{left:o,top:a,right:s,bottom:n}=i,{backdropColor:r}=e;if(!so(r)){const i=Ga(e.borderRadius),l=Qa(e.backdropPadding);t.fillStyle=r;const h=o-l.left,c=a-l.top,d=s-o+l.width,u=n-a+l.height;Object.values(i).some(t=>0!==t)?(t.beginPath(),qa(t,{x:h,y:c,w:d,h:u,radius:i}),t.fill()):t.fillRect(h,c,d,u)}}function _h(t,e,i,o){const{ctx:a}=t;if(i)a.arc(t.xCenter,t.yCenter,e,0,Lo);else{let i=t.getPointPosition(0,e);a.moveTo(i.x,i.y);for(let s=1;s<o;s++)i=t.getPointPosition(s,e),a.lineTo(i.x,i.y)}}class Eh extends fh{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ka.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Qa(bh(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=lo(t)&&!isNaN(t)?t:0,this.max=lo(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bh(this.options))}generateTickLabels(t){fh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=po(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""}).filter((t,e)=>this.chart.getDataVisibility(e))}fit(){const t=this.options;t.display&&t.pointLabels.display?yh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,o){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,o))}getIndexAngle(t){return Ko(t*(Lo/(this._pointLabels.length||1))+Ho(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(so(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(so(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return ts(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const o=this.getIndexAngle(t)-To+i;return{x:Math.cos(o)*e+this.xCenter,y:Math.sin(o)*e+this.yCenter,angle:o}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:o,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:o,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),_h(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:o,border:a}=e,s=this._pointLabels.length;let n,r,l;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:o}}=t;for(let a=e-1;a>=0;a--){const e=t._pointLabelItems[a];if(!e.visible)continue;const s=o.setContext(t.getPointLabelContext(a));Sh(i,s,e);const n=Ja(s.font),{x:r,y:l,textAlign:h}=e;Ha(i,t._pointLabels[a],r,l+n.lineHeight/2,n,{color:s.color,textAlign:h,textBaseline:"middle"})}}(this,s),o.display&&this.ticks.forEach((t,e)=>{if(0!==e||0===e&&this.min<0){r=this.getDistanceFromCenterForValue(t.value);const i=this.getContext(e),n=o.setContext(i),l=a.setContext(i);!function(t,e,i,o,a){const s=t.ctx,n=e.circular,{color:r,lineWidth:l}=e;!n&&!o||!r||!l||i<0||(s.save(),s.strokeStyle=r,s.lineWidth=l,s.setLineDash(a.dash||[]),s.lineDashOffset=a.dashOffset,s.beginPath(),_h(t,i,n,o),s.closePath(),s.stroke(),s.restore(
1880))}(this,n,r,s,l)}}),i.display){for(t.save(),n=s-1;n>=0;n--){const o=i.setContext(this.getPointLabelContext(n)),{color:a,lineWidth:s}=o;s&&a&&(t.lineWidth=s,t.strokeStyle=a,t.setLineDash(o.borderDash),t.lineDashOffset=o.borderDashOffset,r=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(n,r),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const o=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,n)=>{if(0===n&&this.min>=0&&!e.reverse)return;const r=i.setContext(this.getContext(n)),l=Ja(r.font);if(a=this.getDistanceFromCenterForValue(this.ticks[n].value),r.showLabelBackdrop){t.font=l.string,s=t.measureText(o.label).width,t.fillStyle=r.backdropColor;const e=Qa(r.backdropPadding);t.fillRect(-s/2-e.left,-a-l.size/2-e.top,s+e.width,l.size+e.height)}Ha(t,o.label,0,-a,l,{color:r.color,strokeColor:r.textStrokeColor,strokeWidth:r.textStrokeWidth})}),t.restore()}drawTitle(){}}function Ah(t){return"string"==typeof t||t instanceof String}tl.register(Kl,hh,jl,Sl,uh,gh,kn,_n,bl,fl,Ln,Cn,Sn,nl,An,Eh,En,$n,Hl),tl.defaults.backgroundColor="transparent";var $h=Symbol("leaf");var Lh=class extends Ft{constructor(){super(...arguments),this.watchedProperties=new Set,this.hasRenderedInitialChart=!1,this.label=null,this.description=null,this.type="bar",this.xLabel=null,this.yLabel=null,this.legendPosition="top",this.stacked=!1,this.indexAxis="x",this.grid="both",this.min=null,this.max=null,this.withoutAnimation=!1,this.withoutLegend=!1,this.withoutTooltip=!1,this.plugins=[],this.localize=new Zt(this),this.computedStyle=null,this.chart=null,this.defaultFonts={title:{size:"var(--wa-font-size-m)",family:"var(--wa-font-family-body)",lineHeight:"var(--wa-line-height-condensed)",weight:"var(--wa-font-weight-bold)"},body:{size:"var(--wa-font-size-xs)",family:"var(--wa-font-family-body)",lineHeight:"var(--wa-line-height-normal)",weight:"var(--wa-font-weight-body)"},tooltip:{size:"var(--wa-tooltip-font-size)",family:"var(--wa-font-family-body)",lineHeight:"var(--wa-tooltip-line-height)",weight:"var(--wa-font-weight-body)"},tooltipTitle:{size:"var(--wa-tooltip-font-size)",family:"var(--wa-font-family-body)",lineHeight:"var(--wa-tooltip-line-height)",weight:"var(--wa-font-weight-bold)"}},this.defaultColors={datasets:{backgroundColor:["var(--fill-color-1)","var(--fill-color-2)","var(--fill-color-3)","var(--fill-color-4)","var(--fill-color-5)","var(--fill-color-6)"],borderColor:["var(--border-color-1)","var(--border-color-2)","var(--border-color-3)","var(--border-color-4)","var(--border-color-5)","var(--border-color-6)"]},textColor:"var(--wa-color-text-quiet)",tooltipTextColor:"var(--wa-tooltip-content-color)",tooltipBackgroundColor:"var(--wa-tooltip-background-color)",tooltipBorderColor:"var(--wa-tooltip-border-color)",gridLineColor:"var(--grid-color)",borderColor:"var(--grid-color)"},this.transformableProperties={data:{datasets:this.brand({transform:t=>{const e={borderColor:this.brand({property:"color"}),backgroundColor:this.brand({property:"backgroundColor"}
1880),pointBackgroundColor:this.brand({property:"color"}),borderWidth:this.brand({property:"width",transform:Number}),pointRadius:this.brand({property:"width",transform:Number})};return this.transformProperties(t,e)}})},options:{elements:{line:{borderWidth:this.brand({property:"width",transform:Number})},point:{radius:this.brand({property:"width",transform:Number})}},plugins:{title:{color:this.brand({property:"color"}),font:this.fontBrand(),padding:this.brand({transform:t=>{if(Ah(t))return this.expandProperty(t,this.brand({property:"width",transform:Number}));if(si(t)){const e={top:this.brand({property:"width",transform:Number}),bottom:this.brand({property:"width",transform:Number})};return this.transformProperties(t,e)}return t}})},legend:{color:this.brand({property:"color"}),labels:{color:this.brand({property:"color"}),font:this.fontBrand(),padding:this.brand({property:"width",transform:Number})}},tooltip:{backgroundColor:this.brand({property:"backgroundColor"}),titleColor:this.brand({property:"color"}),bodyColor:this.brand({property:"color"}),footerColor:this.brand({property:"color"}),borderColor:this.brand({property:"color"}),borderWidth:this.brand({property:"width",transform:Number}),cornerRadius:this.brand({property:"width",transform:Number}),caretSize:this.brand({property:"width",transform:Number}),boxBorderColor:this.brand({property:"color"}),titleFont:this.fontBrand(),bodyFont:this.fontBrand(),footerFont:this.fontBrand(),padding:this.brand({transform:t=>{if(Ah(t))return this.expandProperty(t,this.brand({property:"width",transform:Number}));if(si(t)){const e={top:this.brand({property:"width",transform:Number}),bottom:this.brand({property:"width",transform:Number}),right:this.brand({property:"width",transform:Number}),left:this.brand({property:"width",transform:Number})};return this.transformProperties(t,e)}return t}}),boxPadding:this.brand({property:"width",transform:Number}),titleMarginBottom:this.brand({property:"width",transform:Number})}},scales:{x:{ticks:{color:this.brand({property:"color"}),font:this.fontBrand()},grid:{color:this.brand({property:"color"})},title:{color:this.brand({property:"color"}),font:this.fontBrand()},border:{color:this.brand({property:"color"})}},y:{ticks:{color:this.brand({property:"color"}),font:this.fontBrand()},grid:{color:this.brand({property:"color"})},title:{color:this.brand({property:"color"}),font:this.fontBrand()},border:{color:this.brand({property:"color"})}},r:{angleLines:{color:this.brand({property:"color"}),font:this.fontBrand()},grid:{color:this.brand({property:"color"})},pointLabels:{color:this.brand({property:"color"}),font:this.fontBrand()},ticks:{color:this.brand({property:"color"}),backdropColor:this.brand({property:"backgroundColor"}),font:this.fontBrand()},border:{color:this.brand({property:"color"})}}}}},this.styleObserver=new ki(()=>this.scheduleRenderChart()),this.renderScheduled=!1}fontBrand(){return this.brand({transform:t=>{if(!t)return t;const e={size:this.brand({property:"fontSize",transform:Number}),weight:this.brand({property:"fontWeight",transform:Number}),family:this.brand({property:"fontFamily"}),lineHeight:this.brand({property:"lineHeight",transform:Number})};return this.transformProperties(t,e)}})}getDefaultConfig(t){const e=!["pie","doughnut","polarArea","radar"].includes(t),i=["polarArea","radar"].includes(t),o="rtl"===this.localize.dir();let a=this.legendPosition;"start"===a&&(a=o?"right":"left"),"end"===a&&(a=o?"left":"right");const s=this.defaultColors,n={type:t,options:{responsive:!0,maintainAspectRatio:!1,indexAxis:this.indexAxis,animation:!this.withoutAnimation&&{duration:500,easing:"easeOutQuart"},elements:{point:{borderWidth:0,radius:Number(this.resolveCSSWidth("--point-radius",3))},line:{borderWidth:Number(this.resolveCSSWidth("--line-border-width",2))},bar:{borderWidth:Number(this.resolveCSSWidth("--border-width",1)),borderRadius:Number(this.resolveCSSWidth("--border-radius",0))},arc:{borderWidth:Number(this.resolveCSSWidth("--border-width",1))}},plugins:{title:{display:Boolean(this.label),text:this.label||"",color:s.textColor,rtl:o,font:this.defaultFonts.title,padding:"var(--wa-space-xs)"}
1880,legend:{display:!this.withoutLegend,position:a,rtl:o,color:s.textColor,labels:{color:s.textColor,font:this.defaultFonts.body,padding:"var(--wa-space-s)",usePointStyle:!0,pointStyle:"rectRounded"}},tooltip:{enabled:!this.withoutTooltip,rtl:o,backgroundColor:s.tooltipBackgroundColor,titleColor:s.tooltipTextColor,bodyColor:s.tooltipTextColor,footerColor:s.tooltipTextColor,borderColor:s.tooltipBorderColor,borderWidth:"var(--wa-tooltip-border-width)",borderStyle:"var(--wa-tooltip-border-style)",cornerRadius:"var(--wa-tooltip-border-radius)",caretSize:"var(--wa-tooltip-arrow-size)",titleFont:this.defaultFonts.tooltipTitle,footerFont:this.defaultFonts.tooltip,bodyFont:this.defaultFonts.tooltip,padding:{top:"0.25em",right:"0.5em",bottom:"0.25em",left:"0.5em"},boxPadding:"var(--wa-space-2xs)",titleMarginBottom:"0"}}}};return e&&(n.options.scales=this.cartesianScale(o)),i&&(n.options.scales=this.radialScale()),n}transformProperties(t,e){if(Array.isArray(t))return t.map(t=>this.transformProperties(t,e));const i=ai(t);for(const o of Object.keys(e)){const a=e[o],s=t?.[o];this.isLeaf(a)?void 0!==s&&(Array.isArray(s)?i[o]=s.map(t=>this.expandProperty(t,a)):i[o]=this.expandProperty(s,a)):"object"==typeof a&&"object"==typeof s&&null!==s&&(i[o]=this.transformProperties(s,a))}return i}expandProperty(t,e){return this.computedStyle&&Ah(t)&&"property"in e&&e.property&&(this.extractCSSProperties(t).forEach(t=>{this.watchedProperties.add(t)}),t=this.computePropertyValue(t,e.property)),e.transform?e.transform(t):t}radialScale(){return{r:{grace:"5%",angleLines:{color:this.defaultColors.gridLineColor,lineWidth:Number(this.resolveCSSWidth("--grid-border-width",1))},grid:{color:this.defaultColors.gridLineColor,lineWidth:Number(this.resolveCSSWidth("--grid-border-width",1))},pointLabels:{color:this.defaultColors.textColor,font:this.defaultFonts.body},ticks:{color:this.defaultColors.textColor,backdropColor:"transparent",font:this.defaultFonts.body},border:{color:this.defaultColors.borderColor,width:Number(this.resolveCSSWidth("--grid-border-width",1))}}}}cartesianScale(t){const e="y"===this.indexAxis?"x":"y";return{x:{stacked:this.stacked,reverse:t,ticks:{color:this.defaultColors.textColor,font:this.defaultFonts.body},grid:{display:"x"===this.grid||"both"===this.grid,color:this.defaultColors.gridLineColor,lineWidth:Number(this.resolveCSSWidth("--grid-border-width",1))},..."x"===e&&{grace:"5%",min:null!=this.min?Number(this.min):null,max:null!=this.max?Number(this.max):null},title:{display:!!this.xLabel,text:this.xLabel,color:this.defaultColors.textColor,font:this.defaultFonts.title},border:{color:this.defaultColors.borderColor,width:Number(this.resolveCSSWidth("--grid-border-width",1))}},y:{position:t?"right":"left",stacked:this.stacked,beginAtZero:"bar"===this.type,ticks:{color:this.defaultColors.textColor,font:this.defaultFonts.body},grid:{display:"y"===this.grid||"both"===this.grid,color:this.defaultColors.gridLineColor,lineWidth:Number(this.resolveCSSWidth("--grid-border-width",1))},..."y"===e&&{grace:"5%",min:null!=this.min?Number(this.min):null,max:null!=this.max?Number(this.max):null},title:{display:!!this.yLabel,text:this.yLabel,color:this.defaultColors.textColor,font:this.defaultFonts.title},border:{color:this.defaultColors.borderColor,width:Number(this.resolveCSSWidth("--grid-border-width",1))}}}}scheduleRenderChart(){this.renderScheduled||(this.renderScheduled=!0,requestAnimationFrame(()=>{this.renderScheduled=!1,this.renderChart()}))}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.scheduleRenderChart()})}disconnectedCallback(){this.chart&&(this.chart.destroy(),this.chart=null),this.styleObserver?.unobserve(this),super.disconnectedCallback()}renderChart(){const t=this.shadowRoot?.querySelector("canvas");if(!t)return;const e=this.shadowRoot?.querySelector("slot:not([name])")?.assignedElements({flatten:!0}).filter(t=>"script"===t.localName);let i=this.config;if(e&&e.length>0){const t=e[0];i=JSON.parse(t.textContent||"{}")}i&&(i=this.applyDefaultConfig(i),this.chart?(this.chart.data=i.data,this.chart.options=i.options,this.hasRenderedInitialChart?this.chart.update("none"):(this.hasRenderedInitialChart=!0,this.chart.update(
1880))):this.chart=new tl(t,i),this.watchedProperties.size>0&&this.styleObserver?.observe(this,Array.from(this.watchedProperties)))}applyDefaultConfig(t){const e=t?.type||this.type;let i=ni(this.getDefaultConfig(e),t);if(Array.isArray(i.data?.datasets)){const t=i.data.datasets,e=this.defaultColors.datasets.backgroundColor,o=this.defaultColors.datasets.borderColor,a=new Set(["pie","doughnut","polarArea"]),s=new Set(["line","scatter","radar","bubble"]),n=i.type||this.type;t.forEach((t,i)=>{t.type||(t.type=n);const r=a.has(t.type),l=s.has(t.type);void 0===t.backgroundColor&&(t.backgroundColor=r?e:e[i%e.length]),void 0===t.borderColor&&(t.borderColor=r?o:o[i%o.length]),l&&void 0===t.pointBackgroundColor&&(t.pointBackgroundColor=t.borderColor),l&&void 0===t.pointRadius&&(t.pointRadius="var(--point-radius, 3px)")})}return i=this.transformProperties(i,this.transformableProperties),i.plugins||(i.plugins=[]),i.plugins.unshift(...this.plugins),i}resolveCSSWidth(t,e){const i=`var(${t}, ${e}px)`;return this.watchedProperties.add(t),this.computePropertyValue(i,"width")}computePropertyValue(t,e){const i=this.computedStyle;if(!i)return t;const o=this.shadowRoot?.querySelector("#property-calculator");if(!o)return t;const a=["width","height","fontSize","lineHeight"];a.includes(e)&&function(t){return!isNaN(Number(t))&&isFinite(Number(t))}(t)&&(t=t.toString()+"px"),o.style[e]=t;let s=i[e];if(a.includes(e)&&Ah(s)&&(s=s.split(/px/)[0]),"lineHeight"===e){const t=Number(i.fontSize.split(/px/)[0]);return s=Number(s),t&&s?s/t:1.5}if(Ah(s)&&s.startsWith("color(srgb ")){const t=s.match(/[\d.]+/g);if(t){const[e,i,o,a]=t;s=`rgba(${Math.round(255*Number(e))}, ${Math.round(255*Number(i))}, ${Math.round(255*Number(o))}, ${a??1})`}}return s}updated(t){if(super.updated(t),!this.computedStyle){const t=this.shadowRoot?.querySelector("#property-calculator");if(!t)return;this.computedStyle=getComputedStyle(t)}this.scheduleRenderChart()}render(){return K` 1881 <!-- data --> 1882 <slot style="display: none;"></slot> 1883 1884 <!-- Hidden span for doing things like color / css variable calculations. --> 1885 <div id="property-calculator" class="wa-visually-hidden" aria-hidden="true"></div> 1886 1887 <canvas role="img" aria-label="${this.label}" aria-description="${this.description}"></canvas> 1888 `}extractCSSProperties(t){return t.match(/--(\S+?)(?=\s|[), ]|$)/g)||[]}brand(t){return t[$h]=$h,t}isLeaf(t){return"object"==typeof t&&null!==t&&t[$h]===$h}};Lh.css=[ri],Lh.chartJS=tl,kt([At()],Lh.prototype,"label",2),kt([At()],Lh.prototype,"description",2),kt([At()],Lh.prototype,"type",2),kt([At({attribute:"x-label"})],Lh.prototype,"xLabel",2),kt([At({attribute:"y-label"})],Lh.prototype,"yLabel",2),kt([At({attribute:"legend-position"})],Lh.prototype,"legendPosition",2),kt([At({type:Boolean})],Lh.prototype,"stacked",2),kt([At({attribute:"index-axis"})],Lh.prototype,"indexAxis",2),kt([At()],Lh.prototype,"grid",2),kt([At()],Lh.prototype,"min",2),kt([At()],Lh.prototype,"max",2),kt([At({attribute:"without-animation",type:Boolean,reflect:!0})],Lh.prototype,"withoutAnimation",2),kt([At({attribute:"without-legend",type:Boolean,reflect:!0})],Lh.prototype,"withoutLegend",2),kt([At({attribute:"without-tooltip",type:Boolean,reflect:!0})],Lh.prototype,"withoutTooltip",2),kt([At({attribute:!1,hasChanged:()=>!0})],Lh.prototype,"config",2),kt([At({type:Array})],Lh.prototype,"plugins",2),Lh=kt([St("wa-chart")],Lh);var Dh=h` 1889 :host { 1890 --checked-icon-color: var(--wa-color-brand-on-loud); 1891 --checked-icon-scale: 0.8; 1892 1893 display: inline-flex; 1894 color: var(--wa-form-control-value-color); 1895 font-family: inherit; 1896 font-weight: var(--wa-form-control-value-font-weight); 1897 line-height: var(--wa-form-control-value-line-height); 1898 user-select: none; 1899 -webkit-user-select: none; 1900 } 1901 1902 [part~='control'] { 1903 display: inline-flex; 1904 flex: 0 0 auto; 1905 position: relative; 1906 align-items: center; 1907 justify-content: center; 1908 width: var(--wa-form-control-toggle-size); 1909 height: var(--wa-form-control-toggle-size); 1910 border-color: var(--wa-form-control-border-color); 1911 border-radius: min( 1912 calc(var(--wa-form-control-toggle-size) * 0.375), 1913 var(--wa-border-radius-s) 1914 ); /* min prevents entirely circular checkbox */ 1915 border-style: var(--wa-border-style); 1916 border-width: var(--wa-form-control-border-width); 1917 background-color: var(--wa-form-control-background-color); 1918 transition: 1919 background var(--wa-transition-normal), 1920 border-color var(--wa-transition-fast), 1921 box-shadow var(--wa-transition-fast), 1922 color var(--wa-transition-fast); 1923 transition-timing-function: var(--wa-transition-easing); 1924 1925 margin-inline-end: 0.5em; 1926 } 1927 1928 [part~='base'] { 1929 display: flex;
1930 align-items: flex-start; 1931 position: relative; 1932 color: currentColor; 1933 vertical-align: middle; 1934 cursor: pointer; 1935 } 1936 1937 [part~='label'] { 1938 display: inline; 1939 } 1940 1941 /* Checked */ 1942 [part~='control']:has(:checked, :indeterminate) { 1943 color: var(--checked-icon-color); 1944 border-color: var(--wa-form-control-activated-color); 1945 background-color: var(--wa-form-control-activated-color); 1946 } 1947 1948 /* Focus */ 1949 [part~='control']:has(> input:focus-visible:not(:disabled)) { 1950 outline: var(--wa-focus-ring); 1951 outline-offset: var(--wa-focus-ring-offset); 1952 } 1953 1954 /* Disabled */ 1955 :host [part~='base']:has(input:disabled) { 1956 opacity: 0.5; 1957 cursor: not-allowed; 1958 } 1959 1960 input { 1961 position: absolute; 1962 padding: 0; 1963 margin: 0; 1964 height: 100%; 1965 width: 100%; 1966 opacity: 0; 1967 pointer-events: none; 1968 } 1969 1970 [part~='icon'] { 1971 display: flex; 1972 scale: var(--checked-icon-scale); 1973 1974 /* Without this, Safari renders the icon slightly to the left */ 1975 &::part(svg) { 1976 translate: 0.0009765625em; 1977 } 1978 1979 input:not(:checked, :indeterminate) + & { 1980 visibility: hidden; 1981 } 1982 } 1983 1984 :host([required]) [part~='label']::after { 1985 content: var(--wa-form-control-required-content); 1986 color: var(--wa-form-control-required-content-color); 1987 margin-inline-start: var(--wa-form-control-required-content-offset); 1988 } 1989`,Mh=(t={})=>{let{validationElement:e,validationProperty:i}=t;e||"undefined"!=typeof document&&"createElement"in document&&(e=Object.assign(document.createElement("input"),{required:!0})),i||(i="value");const o={observedAttributes:["required"],message:e?.validationMessage,checkValidity(t){const e={message:"",isValid:!0,invalidKeys:[]};if(!(t.required??t.hasAttribute("required")))return e;return!t[i]&&(e.message="function"==typeof o.message?o.message(t):o.message||"",e.isValid=!1,e.invalidKeys.push("valueMissing")),e}};return o},zh=h` 1990 :host { 1991 display: flex; 1992 flex-direction: column; 1993 } 1994 1995 /* Treat wrapped labels, inputs, and hints as direct children of the host element */ 1996 [part~='form-control'] { 1997 display: contents; 1998 } 1999 2000 /* Label */ 2001 :is([part~='form-control-label'], [part~='label']):has(*:not(:empty)), 2002 :is([part~='form-control-label'], [part~='label']).has-label { 2003 display: inline-flex; 2004 color: var(--wa-form-control-label-color); 2005 font-weight: var(--wa-form-control-label-font-weight); 2006 line-height: var(--wa-form-control-label-line-height); 2007 margin-block-end: 0.5em; 2008 } 2009 2010 :host([required]) :is([part~='form-control-label'], [part~='label'])::after { 2011 content: var(--wa-form-control-required-content); 2012 margin-inline-start: var(--wa-form-control-required-content-offset); 2013 color: var(--wa-form-control-required-content-color); 2014 } 2015 2016 /* Help text */ 2017 [part~='hint'] { 2018 display: block; 2019 color: var(--wa-form-control-hint-color); 2020 font-weight: var(--wa-form-control-hint-font-weight); 2021 line-height: var(--wa-form-control-hint-line-height); 2022 margin-block-start: 0.5em; 2023 font-size: var(--wa-font-size-smaller); 2024 2025 &:not(.has-slotted, .has-hint, .has-count) { 2026 display: none; 2027 } 2028 } 2029`;const Th=le(class extends he{constructor(t){if(super(t),t.type!==ne&&t.type!==ae&&t.type!==re)throw Error("The `live` directive is not allowed on child or event bindings");if(!(t=>void 0===t.strings)(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===Q||e===J)return e;const i=t.element,o=t.name;if(t.type===ne){if(e===i[o])return Q}else if(t.type===re){if(!!e===i.hasAttribute(o))return Q}else if(t.type===ae&&i.getAttribute(o)===e+"")return Q;return((t,e=Ae)=>{t._$AH=e})(t),e}});var Oh=class extends Re{constructor(){super(...arguments),this.hasSlotController=new qe(this,"hint"),this.title="",this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this.indeterminate=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint=""}static get validators(){const t=[Mh({validationProperty:"checked",validationElement:Object.assign(document.createElement("input"),{type:"checkbox",required:!0})})];return[...super.validators,...t]}get value(){return this._value??"on"}set value(t){this._value=t}handleSizeChange(){He(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??this.defaultChecked}set checked(t){this._checked=Boolean(t),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.indeterminate=!1,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}connectedCallback(){super.connectedCallback(),!this.didSSR||this.hasUpdated?this.handleDefaultCheckedChange():this.updateComplete.then(()=>{this.handleDefaultCheckedChange()})}handleDefaultCheckedChange(){this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){!this.didSSR||this.hasUpdated?(this.setValue(this.checked?this.value:null,this._value),this.updateV
2029alidity()):this.updateComplete.then(()=>{this.handleValueOrCheckedChange()})}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate),this.customStates.set("checked",this.checked),this.customStates.set("indeterminate",this.indeterminate),this.updateValidity()}handleDisabledChange(){this.customStates.set("disabled",this.disabled)}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("checked")||t.has("defaultChecked")||t.has("disabled"))&&this.handleValueOrCheckedChange()}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}render(){const t=this.hasSlotController.test("hint"),e=!!this.hint||!!t,i=!this.checked&&this.indeterminate,o=i?"indeterminate":"check",a=i?"indeterminate":"checked",s=this.didSSR&&!this.hasUpdated?this.checked:this.defaultChecked,n=this.didSSR&&!this.hasUpdated?null:Th(this.checked);return K` 2030 <label part="base checkbox"> 2031 <span part="control"> 2032 <input 2033 class="input" 2034 type="checkbox" 2035 title=${this.title} 2036 name=${We(this.name)} 2037 value=${We(this.value)} 2038 .indeterminate=${Th(this.indeterminate)} 2039 .checked=${We(n)} 2040 ?checked=${s} 2041 ?disabled=${this.disabled} 2042 ?required=${this.required} 2043 aria-checked=${this.indeterminate?"mixed":this.checked?"true":"false"} 2044 aria-describedby="hint" 2045 @click=${this.handleClick} 2046 /> 2047 2048 <wa-icon part="${a}-icon icon" library="system" name=${o}></wa-icon> 2049 </span> 2050 2051 <slot part="label"></slot> 2052 </label> 2053 2054 <slot 2055 id="hint" 2056 part="hint" 2057 name="hint" 2058 aria-hidden=${e?"false":"true"} 2059 class="${ce({"has-slotted":e})}" 2060 > 2061 ${this.hint} 2062 </slot> 2063 `}};function Ph(t,e){function i(i){const o=t.getBoundingClientRect(),a=t.ownerDocument.defaultView,s=o.left+a.pageXOffset,n=o.top+a.pageYOffset,r=i.pageX-s,l=i.pageY-n;e?.onMove&&e.onMove(r,l)}document.addEventListener("pointermove",i,{passive:!0}),document.addEventListener("pointerup",function t(){document.removeEventListener("pointermove",i),document.removeEventListener("pointerup",t),e?.onStop&&e.onStop()}),e?.initialEvent instanceof PointerEvent&&i(e.initialEvent)}Oh.css=[zh,Ue,Dh],Oh.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt('input[type="checkbox"]')],Oh.prototype,"input",2),kt([At()],Oh.prototype,"title",2),kt([At({reflect:!0})],Oh.prototype,"value",1),kt([At({reflect:!0})],Oh.prototype,"size",2),kt([vt("size")],Oh.prototype,"handleSizeChange",1),kt([At({type:Boolean})],Oh.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],Oh.prototype,"indeterminate",2),kt([At({type:Boolean,attribute:!1})],Oh.prototype,"checked",1),kt([At({type:Boolean,reflect:!0,attribute:"checked"})],Oh.prototype,"defaultChecked",2),kt([At({type:Boolean,reflect:!0})],Oh.prototype,"required",2),kt([At()],Oh.prototype,"hint",2),kt([vt(["checked","defaultChecked"])],Oh.prototype,"handleDefaultCheckedChange",1),kt([vt(["checked","indeterminate"])],Oh.prototype,"handleStateChange",1),kt([vt("disabled")],Oh.prototype,"handleDisabledChange",1),Oh=kt([St("wa-checkbox")],Oh),Oh.disableWarning?.("change-in-update");var Fh="undefined"!=typeof window&&"ontouchstart"in window,Ih=class{constructor(t,e){this.isActive=!1,this.isDragging=!1,this.handleDragStart=t=>{const e="touches"in t?t.touches[0].clientX:t.clientX,i="touches"in t?t.touches[0].clientY:t.clientY;this.isDragging||!Fh&&t.buttons>1||(this.isDragging=!0,document.addEventListener("pointerup",this.handleDragStop),document.addEventListener("pointermove",this.handleDragMove),document.addEventListener("pointercancel",this.handleDragStop),document.addEventListener("touchend",this.handleDragStop),document.addEventListener("touchmove",this.handleDragMove),document.addEventListener("touchcancel",this.handleDragStop),this.options.start(e,i))},this.handleDragStop=t=>{const e="changedTouches"in t?t.changedTouches[0].clientX:t.clientX,i="changedTouches"in t?t.changedTouches[0].clientY:t.clientY;this.isDragging=!1,document.removeEventListener("pointerup",this.handleDragStop),document.removeEventListener("pointermove",this.handleDragMove),document.removeEventListener("pointercancel",this.handleDragStop),document.removeEventListener("touchend",this.handleDragStop),document.removeEventListener("touchmove",this.handleDragMove),document.removeEventListener("touchcancel",this.handleDragStop),this.options.stop(e,i)},this.handleDragMove=t=>{const e="touches"in t?t.touches[0].clientX:t.clientX,i="touches"in t?t.touches[0].clientY:t.clientY;window.getSelection()?.removeAllRanges(),this.options.move(e,i)},this.element=t,this.options={start:()=>{},stop:()=>{},move:()=>{},...e},this.start()}start(){this.isActive||(this.element.addEventListener("pointerdown",this.handleDragStart),Fh&&this.element.addEventListener("touchstart",this.handleDragStart),this.isActive=!0)}stop(){document.removeEventListener("pointerup",this.handleDragStop),document.removeEventListener("pointermove",this.handleDragMove),document.removeEventListener("pointercancel",this.handleDragStop),document.removeEventListener("touchend",this.handleDragStop),document.removeEventListener("touchmove",this.handleDragMove),document.removeEventListener("touchcancel",this.handleDragStop),this.element.removeEventListener("pointerdown",this.handleDragStart),Fh&&this.element.removeEventListener("touchstart",this.handleDragStart),this.isActive=!1,this.isDragging=!1}toggle(t){(void 0!==t?t:!this.isActive)?this.start():this.stop()}},Rh=h` 2064 .wa-visually-hidden:not(:focus-within),
2065 .wa-visually-hidden-force, 2066 .wa-visually-hidden-hint::part(hint), 2067 .wa-visually-hidden-label::part(label), 2068 .wa-visually-hidden-label::part(form-control-label) { 2069 top: 0px !important; 2070 left: 0px !important; 2071 position: absolute !important; 2072 width: 1px !important; 2073 height: 1px !important; 2074 clip: rect(0 0 0 0) !important; 2075 clip-path: inset(50%) !important; 2076 border: none !important; 2077 overflow: hidden !important; 2078 white-space: nowrap !important; 2079 padding: 0 !important; 2080 } 2081`,Vh=h` 2082 :host { 2083 --grid-width: 17em; 2084 --grid-height: 12em; 2085 --grid-handle-size: 1.25em; 2086 --slider-height: 1em; 2087 --slider-handle-size: calc(var(--slider-height) + 0.25em); 2088 } 2089 2090 .color-picker { 2091 background-color: var(--wa-color-surface-raised); 2092 border-radius: var(--wa-border-radius-m); 2093 border-style: var(--wa-border-style); 2094 border-width: var(--wa-border-width-s); 2095 border-color: var(--wa-color-surface-border); 2096 box-shadow: var(--wa-shadow-m); 2097 color: var(--color); 2098 font: inherit; 2099 font-size: inherit; 2100 user-select: none; 2101 width: var(--grid-width); 2102 -webkit-user-select: none; 2103 } 2104 2105 .grid { 2106 position: relative; 2107 height: var(--grid-height); 2108 background-image: 2109 linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%), 2110 linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%); 2111 border-top-left-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s)); 2112 border-top-right-radius: calc(var(--wa-border-radius-m) - var(--wa-border-width-s)); 2113 cursor: crosshair; 2114 forced-color-adjust: none; 2115 } 2116 2117 .grid-handle { 2118 position: absolute; 2119 width: var(--grid-handle-size); 2120 height: var(--grid-handle-size); 2121 border-radius: var(--wa-border-radius-circle); 2122 box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2); 2123 border: solid 0.125rem white; 2124 margin-top: calc(var(--grid-handle-size) / -2); 2125 margin-left: calc(var(--grid-handle-size) / -2); 2126 transition: scale var(--wa-transition-normal) var(--wa-transition-easing); 2127 } 2128 2129 .grid-handle-dragging { 2130 cursor: none; 2131 scale: 1.5; 2132 } 2133 2134 .grid-handle:focus-visible { 2135 outline: var(--wa-focus-ring); 2136 } 2137 2138 .controls { 2139 padding: 0.75em; 2140 display: flex;
2141 align-items: center; 2142 } 2143 2144 .sliders { 2145 flex: 1 1 auto; 2146 } 2147 2148 .slider { 2149 position: relative; 2150 height: var(--slider-height); 2151 border-radius: var(--wa-border-radius-s); 2152 box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2); 2153 forced-color-adjust: none; 2154 } 2155 2156 .slider:not(:last-of-type) { 2157 margin-bottom: 0.75em; 2158 } 2159 2160 .slider-handle { 2161 position: absolute; 2162 top: calc(50% - var(--slider-handle-size) / 2); 2163 width: var(--slider-handle-size); 2164 height: var(--slider-handle-size); 2165 border-radius: var(--wa-border-radius-circle); 2166 border: solid 0.125rem white; 2167 box-shadow: 0 0 0 0.0625rem rgba(0, 0, 0, 0.2); 2168 margin-left: calc(var(--slider-handle-size) / -2); 2169 } 2170 2171 .slider-handle:focus-visible { 2172 outline: var(--wa-focus-ring); 2173 } 2174 2175 .hue { 2176 background-image: linear-gradient( 2177 to right, 2178 rgb(255, 0, 0) 0%, 2179 rgb(255, 255, 0) 17%, 2180 rgb(0, 255, 0) 33%, 2181 rgb(0, 255, 255) 50%, 2182 rgb(0, 0, 255) 67%, 2183 rgb(255, 0, 255) 83%, 2184 rgb(255, 0, 0) 100% 2185 ); 2186 } 2187 2188 .alpha .alpha-gradient { 2189 position: absolute; 2190 top: 0; 2191 left: 0; 2192 width: 100%; 2193 height: 100%; 2194 border-radius: inherit; 2195 } 2196 2197 .preview { 2198 flex: 0 0 auto; 2199 display: inline-flex;
2200 align-items: center; 2201 justify-content: center; 2202 position: relative; 2203 width: 3em; 2204 height: 3em; 2205 border: none; 2206 border-radius: var(--wa-border-radius-circle); 2207 background: none; 2208 font-size: inherit; 2209 margin-inline-start: 0.75em; 2210 cursor: copy; 2211 forced-color-adjust: none; 2212 } 2213 2214 .preview:before { 2215 content: ''; 2216 position: absolute; 2217 top: 0; 2218 left: 0; 2219 width: 100%; 2220 height: 100%; 2221 border-radius: inherit; 2222 box-shadow: inset 0 0 0 0.0625rem rgba(0, 0, 0, 0.2); 2223 2224 /* We use a custom property in lieu of currentColor because of https://bugs.webkit.org/show_bug.cgi?id=216780 */ 2225 background-color: var(--preview-color); 2226 } 2227 2228 .preview:focus-visible { 2229 outline: var(--wa-focus-ring); 2230 outline-offset: var(--wa-focus-ring-offset); 2231 } 2232 2233 .preview-color { 2234 position: absolute; 2235 top: 0; 2236 left: 0; 2237 width: 100%; 2238 height: 100%; 2239 border: solid 0.0625rem rgba(0, 0, 0, 0.125); 2240 } 2241 2242 .preview-color-copied { 2243 animation: pulse 850ms; 2244 } 2245 2246 @keyframes pulse { 2247 0% { 2248 box-shadow: 0 0 0 0 var(--wa-color-brand-fill-loud); 2249 } 2250 70% { 2251 box-shadow: 0 0 0 0.5rem transparent; 2252 } 2253 100% { 2254 box-shadow: 0 0 0 0 transparent; 2255 } 2256 } 2257 2258 .user-input { 2259 display: flex;
2260 align-items: center; 2261 padding: 0 0.75em 0.75em 0.75em; 2262 } 2263 2264 .user-input wa-input { 2265 min-width: 0; /* fix input width in Safari */ 2266 flex: 1 1 auto; 2267 2268 &::part(form-control-label) { 2269 /* Visually hidden */ 2270 position: absolute !important; 2271 width: 1px !important; 2272 height: 1px !important; 2273 clip: rect(0 0 0 0) !important; 2274 clip-path: inset(50%) !important; 2275 border: none !important; 2276 overflow: hidden !important; 2277 white-space: nowrap !important; 2278 padding: 0 !important; 2279 } 2280 } 2281 2282 .user-input wa-button-group { 2283 margin-inline-start: 0.75em; 2284 2285 &::part(base) { 2286 flex-wrap: nowrap; 2287 } 2288 } 2289 2290 .user-input wa-button:first-of-type { 2291 min-width: 3em; 2292 max-width: 3em; 2293 } 2294 2295 .swatches { 2296 display: grid; 2297 grid-template-columns: repeat(auto-fill, minmax(min(1.5em, 100%), 1fr)); 2298 grid-gap: 0.5em; 2299 justify-items: center; 2300 border-block-start: var(--wa-form-control-border-style) var(--wa-form-control-border-width) 2301 var(--wa-color-surface-border); 2302 padding: 0.5em; 2303 forced-color-adjust: none; 2304 } 2305 2306 .swatch { 2307 position: relative; 2308 aspect-ratio: 1 / 1; 2309 width: 100%; 2310 border-radius: var(--wa-border-radius-s); 2311 } 2312 2313 .swatch .swatch-color { 2314 position: absolute; 2315 top: 0; 2316 left: 0; 2317 width: 100%; 2318 height: 100%; 2319 border: solid 0.0625rem rgba(0, 0, 0, 0.125); 2320 border-radius: inherit; 2321 cursor: pointer; 2322 } 2323 2324 .swatch:focus-visible { 2325 outline: var(--wa-focus-ring); 2326 outline-offset: var(--wa-focus-ring-offset); 2327 } 2328 2329 .transparent-bg { 2330 background-image: 2331 linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%), 2332 linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%), 2333 linear-gradient(45deg, transparent 75%, var(--wa-color-neutral-fill-normal) 75%), 2334 linear-gradient(45deg, var(--wa-color-neutral-fill-normal) 25%, transparent 25%); 2335 background-size: 0.5rem 0.5rem; 2336 background-position: 2337 0 0, 2338 0 0, 2339 -0.25rem -0.25rem, 2340 0.25rem 0.25rem; 2341 } 2342 2343 :host([disabled]) { 2344 opacity: 0.5; 2345 cursor: not-allowed; 2346 2347 .grid, 2348 .grid-handle, 2349 .slider, 2350 .slider-handle, 2351 .preview, 2352 .swatch, 2353 .swatch-color { 2354 pointer-events: none; 2355 } 2356 } 2357 2358 /* 2359 * Color dropdown 2360 */ 2361 2362 .color-dropdown { 2363 display: contents; 2364 } 2365 2366 .color-dropdown::part(panel) { 2367 max-height: none; 2368 background-color: var(--wa-color-surface-raised); 2369 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 2370 border-radius: var(--wa-border-radius-m); 2371 overflow: visible; 2372 } 2373 2374 .trigger { 2375 display: block; 2376 position: relative; 2377 background-color: transparent; 2378 border: none; 2379 cursor: pointer; 2380 font-size: inherit; 2381 forced-color-adjust: none; 2382 width: var(--wa-form-control-height); 2383 height: var(--wa-form-control-height); 2384 border-radius: var(--wa-form-control-border-radius); 2385 } 2386 2387 .trigger:before { 2388 content: ''; 2389 position: absolute; 2390 top: 0; 2391 left: 0; 2392 width: 100%; 2393 height: 100%; 2394 border-radius: inherit; 2395 background-color: currentColor; 2396 box-shadow: 2397 inset 0 0 0 var(--wa-form-control-border-width) var(--wa-form-control-border-color), 2398 inset 0 0 0 calc(var(--wa-form-control-border-width) * 3) var(--wa-color-surface-default); 2399 } 2400 2401 .trigger-empty:before { 2402 background-color: transparent; 2403 } 2404 2405 .trigger:focus-visible { 2406 outline: none; 2407 } 2408 2409 .trigger:focus-visible:not(.trigger:disabled) { 2410 outline: var(--wa-focus-ring); 2411 outline-offset: var(--wa-focus-ring-offset); 2412 } 2413 2414 :host([disabled]) :is(.label, .trigger) { 2415 opacity: 0.5; 2416 cursor: not-allowed; 2417 } 2418 2419 .form-control.form-control-has-label .label { 2420 cursor: pointer; 2421 display: inline-block; 2422 } 2423`,Bh=[];function Nh(t){Hh(t),Bh.push(t)}function Hh(t){for(let e=Bh.length-1;e>=0;e--)if(Bh[e]===t){Bh.splice(e,1);break}}function qh(t){return Bh.length>0&&Bh[Bh.length-1]===t}function Uh(t,e,i){const o=t=>Object.is(t,-0)?0:t;return o(t<e?e:t>i?i:t)}function Wh(t=""){return`${t}${((t=21)=>{let e="",i=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[t]];return e})()}`}function jh(t,e){(function(t){return"string"==typeof t&&-1!==t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");const i=function(t){return"string"==typeof t&&-1!==t.indexOf("%")}(t);return t=360===e?t:Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(String(t*e),10)/100),Math.abs(t-e)<1e-6?1:t=360===e?
vendor: 4,120 bytes, line 2423
2423(t<0?t%e+e:t%e)/parseFloat(String(e)):t%e/parseFloat(String(e))}function Yh(t){return Math.min(1,Math.max(0,t))}function Kh(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Xh(t){return Number(t)<=1?100*Number(t)+"%":t}function Gh(t){return 1===t.length?"0"+t:String(t)}function Qh(t,e,i){t=jh(t,255),e=jh(e,255),i=jh(i,255);const o=Math.max(t,e,i),a=Math.min(t,e,i);let s=0,n=0;const r=(o+a)/2;if(o===a)n=0,s=0;else{const l=o-a;switch(n=r>.5?l/(2-o-a):l/(o+a),o){case t:s=(e-i)/l+(e<i?6:0);break;case e:s=(i-t)/l+2;break;case i:s=(t-e)/l+4}s/=6}return{h:s,s:n,l:r}}function Jh(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*i*(e-t):i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function Zh(t,e,i){t=jh(t,255),e=jh(e,255),i=jh(i,255);const o=Math.max(t,e,i),a=Math.min(t,e,i);let s=0;const n=o,r=o-a,l=0===o?0:r/o;if(o===a)s=0;else{switch(o){case t:s=(e-i)/r+(e<i?6:0);break;case e:s=(i-t)/r+2;break;case i:s=(t-e)/r+4}s/=6}return{h:s,s:l,v:n}}function tc(t,e,i,o){const a=[Gh(Math.round(t).toString(16)),Gh(Math.round(e).toString(16)),Gh(Math.round(i).toString(16))];return o&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function ec(t,e,i){let o=1-t/255,a=1-e/255,s=1-i/255,n=Math.min(o,a,s);return 1===n?(o=0,a=0,s=0):(o=(o-n)/(1-n)*100,a=(a-n)/(1-n)*100,s=(s-n)/(1-n)*100),n*=100,{c:Math.round(o),m:Math.round(a),y:Math.round(s),k:Math.round(n)}}function ic(t){return Math.round(255*parseFloat(t)).toString(16)}function oc(t){return ac(t)/255}function ac(t){return parseInt(t,16)}const sc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",s
2423almon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function nc(t){let e={r:0,g:0,b:0},i=1,o=null,a=null,s=null,n=!1,r=!1;return"string"==typeof t&&(t=function(t){if(t=t.trim().toLowerCase(),0===t.length)return!1;let e=!1;if(sc[t])t=sc[t],e=!0;else if("transparent"===t)return{r:0,g:0,b:0,a:0,format:"name"};let i=cc.rgb.exec(t);if(i)return{r:i[1],g:i[2],b:i[3]};if(i=cc.rgba.exec(t),i)return{r:i[1],g:i[2],b:i[3],a:i[4]};if(i=cc.hsl.exec(t),i)return{h:i[1],s:i[2],l:i[3]};if(i=cc.hsla.exec(t),i)return{h:i[1],s:i[2],l:i[3],a:i[4]};if(i=cc.hsv.exec(t),i)return{h:i[1],s:i[2],v:i[3]};if(i=cc.hsva.exec(t),i)return{h:i[1],s:i[2],v:i[3],a:i[4]};if(i=cc.cmyk.exec(t),i)return{c:i[1],m:i[2],y:i[3],k:i[4]};if(i=cc.hex8.exec(t),i)return{r:ac(i[1]),g:ac(i[2]),b:ac(i[3]),a:oc(i[4]),format:e?"name":"hex8"};if(i=cc.hex6.exec(t),i)return{r:ac(i[1]),g:ac(i[2]),b:ac(i[3]),format:e?"name":"hex"};if(i=cc.hex4.exec(t),i)return{r:ac(i[1]+i[1]),g:ac(i[2]+i[2]),b:ac(i[3]+i[3]),a:oc(i[4]+i[4]),format:e?"name":"hex8"};if(i=cc.hex3.exec(t),i)return{r:ac(i[1]+i[1]),g:ac(i[2]+i[2]),b:ac(i[3]+i[3]),format:e?"name":"hex"};return!1}(t)),"object"==typeof t&&(dc(t.r)&&dc(t.g)&&dc(t.b)?(e=function(t,e,i){return{r:255*jh(t,255),g:255*jh(e,255),b:255*jh(i,255)}}(t.r,t.g,t.b),n=!0,r="%"===String(t.r).substr(-1)?"prgb":"rgb"):dc(t.h)&&dc(t.s)&&dc(t.v)?(o=Xh(t.s),a=Xh(t.v),e=function(t,e,i){t=6*jh(t,360),e=jh(e,100),i=jh(i,100);const o=Math.floor(t),a=t-o,s=i*(1-e),n=i*(1-a*e),r=i*(1-(1-a)*e),l=o%6;return{r:255*[i,n,s,s,r,i][l],g:255*[r,i,i,n,s,s][l],b:255*[s,s,r,i,i,n][l]}}(t.h,o,a),n=!0,r="hsv"):dc(t.h)&&dc(t.s)&&dc(t.l)?(o=Xh(t.s),s=Xh(t.l),e=function(t,e,i){let o,a,s;if(t=jh(t,360),e=jh(e,100),i=jh(i,100),0===e)a=i,s=i,o=i;else{const n=i<.5?i*(1+e):i+e-i*e,r=2*i-n;o=Jh(r,n,t+1/3),a=Jh(r,n,t),s=Jh(r,n,t-1/3)}return{r:255*o,g:255*a,b:255*s}}(t.h,o,s),n=!0,r="hsl"):dc(t.c)&&dc(t.m)&&dc(t.y)&&dc(t.k)&&(e=function(t,e,i,o){const a=o/100;return{r:255*(1-t/100)*(1-a),g:255*(1-e/100)*(1-a),b:255*(1-i/100)*(1-a)}}(t.c,t.m,t.y,t.k),n=!0,r="cmyk"),Object.prototype.hasOwnProperty.call(t,"a")&&(i=t.a)),i=Kh(i),{ok:n,format:t.format||r,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:i}}const rc="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",lc="[\\s|\\(]+("+rc+")[,|\\s]+("+rc+")[,|\\s]+("+rc+")\\s*\\)?",hc="[\\s|\\(]+("+rc+")[,|\\s]+("+rc+")[,|\\s]+("+rc+")[,|\\s]+("+rc+")\\s*\\)?",cc={CSS_UNIT:new RegExp(rc),rgb:new RegExp("rgb"+lc),rgba:new RegExp("rgba"+hc),hsl:new RegExp("hsl"+lc),hsla:new RegExp("hsla"+hc),hsv:new RegExp("hsv"+lc),hsva:new RegExp("hsva"
vendor: 4,349 bytes, line 2423
2423+hc),cmyk:new RegExp("cmyk"+hc),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function dc(t){return"number"==typeof t?!Number.isNaN(t):cc.CSS_UNIT.test(t)}class uc{constructor(t="",e={}){if(t instanceof uc)return t;"number"==typeof t&&(t=function(t){return{r:t>>16,g:(65280&t)>>8,b:255&t}}(t)),this.originalInput=t;const i=nc(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=e.format??i.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3}getLuminance(){const t=this.toRgb();let e,i,o;const a=t.r/255,s=t.g/255,n=t.b/255;return e=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),i=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),o=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4),.2126*e+.7152*i+.0722*o}getAlpha(){return this.a}setAlpha(t){return this.a=Kh(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return 0===t}toHsv(){const t=Zh(this.r,this.g,this.b);return{h:360*t.h,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=Zh(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),o=Math.round(100*t.v);return 1===this.a?`hsv(${e}, ${i}%, ${o}%)`:`hsva(${e}, ${i}%, ${o}%, ${this.roundA})`}toHsl(){const t=Qh(this.r,this.g,this.b);return{h:360*t.h,s:t.s,l:t.l,a:this.a}}toHslString(){const t=Qh(this.r,this.g,this.b),e=Math.round(360*t.h),i=Math.round(100*t.s),o=Math.round(100*t.l);return 1===this.a?`hsl(${e}, ${i}%, ${o}%)`:`hsla(${e}, ${i}%, ${o}%, ${this.roundA})`}toHex(t=!1){return tc(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return function(t,e,i,o,a){const s=[Gh(Math.round(t).toString(16)),Gh(Math.round(e).toString(16)),Gh(Math.round(i).toString(16)),Gh(ic(o))];return a&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return 1===this.a?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),e=Math.round(this.g),i=Math.round(this.b);return 1===this.a?`rgb(${t}, ${e}, ${i})`:`rgba(${t}, ${e}, ${i}, ${this.roundA})`}toPercentageRgb(){const t=t=>`${Math.round(100*jh(t,255))}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=t=>Math.round(100*jh(t,255));return 1===this.a?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...ec(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:e,y:i,k:o}=ec(this.r,this.g,this.b);return`cmyk(${t}, ${e}, ${i}, ${o})`}toName(){if(0===this.a)return"transparent";if(this.a<1)return!1;const t="#"+tc(this.r,this.g,this.b,!1);for(const[e,i]of Object.entries(sc))if(t===i)return e;return!1}toString(t){const e=Boolean(t);t=t??this.format;let i=!1;const o=this.a<1&&this.a>=0;return e||!o||!t.startsWith("hex")&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),"hsv"===t&&(i=this.toHsvString()),"cmyk"===t&&(i=this.toCmykString()),i||this.toHexString()):"name"===t&&0===this.a?this.toName():this.toRgbString()}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new uc(this.toString())}lighten(t=10){const e=this.toHsl();return e.l+=t/100,e.l=Yh(e.l),new uc(e)}brighten(t=10){const e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(-t/100*255))),e.g=M
2423ath.max(0,Math.min(255,e.g-Math.round(-t/100*255))),e.b=Math.max(0,Math.min(255,e.b-Math.round(-t/100*255))),new uc(e)}darken(t=10){const e=this.toHsl();return e.l-=t/100,e.l=Yh(e.l),new uc(e)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const e=this.toHsl();return e.s-=t/100,e.s=Yh(e.s),new uc(e)}saturate(t=10){const e=this.toHsl();return e.s+=t/100,e.s=Yh(e.s),new uc(e)}greyscale(){return this.desaturate(100)}spin(t){const e=this.toHsl(),i=(e.h+t)%360;return e.h=i<0?360+i:i,new uc(e)}mix(t,e=50){const i=this.toRgb(),o=new uc(t).toRgb(),a=e/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return new uc(s)}analogous(t=6,e=30){const i=this.toHsl(),o=360/e,a=[this];for(i.h=(i.h-(o*t>>1)+720)%360;--t;)i.h=(i.h+o)%360,a.push(new uc(i));return a}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new uc(t)}monochromatic(t=6){const e=this.toHsv(),{h:i}=e,{s:o}=e;let{v:a}=e;const s=[],n=1/t;for(;t--;)s.push(new uc({h:i,s:o,v:a})),a=(a+n)%1;return s}splitcomplement(){const t=this.toHsl(),{h:e}=t;return[this,new uc({h:(e+72)%360,s:t.s,l:t.l}),new uc({h:(e+216)%360,s:t.s,l:t.l})]}onBackground(t){const e=this.toRgb(),i=new uc(t).toRgb(),o=e.a+i.a*(1-e.a);return new uc({r:(e.r*e.a+i.r*i.a*(1-e.a))/o,g:(e.g*e.a+i.g*i.a*(1-e.a))/o,b:(e.b*e.a+i.b*i.a*(1-e.a))/o,a:o})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const e=this.toHsl(),{h:i}=e,o=[this],a=360/t;for(let s=1;s<t;s++)o.push(new uc({h:(i+s*a)%360,s:e.s,l:e.l}));return o}equals(t){const e=new uc(t);return"cmyk"===this.format||"cmyk"===e.format?this.toCmykString()===e.toCmykString():this.toRgbString()===e.toRgbString()}}const pc="important",mc=" !"+pc,fc=le(class extends he{constructor(t){if(super(t),t.type!==ae||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,i)=>{const o=t[i];return null==o?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const o=e[t];if(null!=o){this.ft.add(t);const e="string"==typeof o&&o.endsWith(mc);t.includes("-")||e?i.setProperty(t,e?o.slice(0,-11):o,e?pc:""):i[t]=o}}return Q}});var gc=class extends Re{constructor(){super(),this.hasSlotController=new qe(this,"hint","label"),this.isSafeValue=!1,this.localize=new ie(this),this.hasFocus=!1,this.isDraggingGridHandle=!1,this.inputValue="",this.hue=0,this.isEmpty=!0,this.saturation=100,this.brightness=100,this.alpha=100,this._value=null,this.defaultValue=this.getAttribute("value")||null,this.withLabel=!1,this.withHint=!1,this.hasEyeDropper=!1,this.label="",this.hint="",this.format="hex",this.size="m",this.placement="bottom-start",this.withoutFormatToggle=!1,this.name=null,this.disabled=!1,this.open=!1,this.opacity=!1,this.uppercase=!1,this.swatches="",this.required=!1,this.handleFocusIn=()=>{this.hasFocus=!0},this.handleFocusOut=()=>{this.hasFocus=!1},this.reportValidityAfterShow=()=>{this.removeEventListener("invalid",this.emitInvalid),this.reportValidity(),this.addEventListener("invalid",this.emitInvalid)},this.handleKeyDown=t=>{this.open&&"Escape"===t.key&&qh(this)&&(t.stopPropagation(),this.hide(),this.focus())},this.handleDocumentKeyDown=t=>{if("Escape"===t.key&&this.open&&qh(this))return t.stopPropagation(),this.focus(),void this.hide();"Tab"===t.key&&setTimeout(()=>{const t=this.getRootNode()instanceof ShadowRoot?document.activeElement?.shadowRoot?.activeElement:document.activeElement;this&&t?.closest(this.tagName.toLowerCase())===this||this.hide()})},this.handleDocumentMouseDown=t=>{const e=t.composedPath().some(t=>t instanceof Element&&(t.closest(".color-picker")||t===this.trigger));this&&!e&&this.hide()},this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.opacity=this.hasAttribute("op
2423acity"),this.uppercase=this.hasAttribute("uppercase");const t=this.getAttribute("format");"rgb"!==t&&"hsl"!==t&&"hsv"!==t||(this.format=t),this.handleValueChange("",this.value||"")}static get validators(){const t=[Mh()];return[...super.validators,...t]}get validationTarget(){return this.popup?.active?this.input:this.trigger}get value(){return this.valueHasChanged?this._value:this._value??this.defaultValue}set value(t){this._value!==t&&(this.valueHasChanged=!0,this._value=t)}handleSizeChange(){He(this.localName,this.size)}updateFormValue(t){null!=t?super.updateFormValue(t):this.setValue("",null)}handleCopy(){this.input.select(),document.execCommand("copy"),this.previewButton.focus(),this.previewButton.classList.add("preview-color-copied"),this.previewButton.addEventListener("animationend",()=>{this.previewButton.classList.remove("preview-color-copied")})}handleFormatToggle(){const t=["hex","rgb","hsl","hsv"],e=(t.indexOf(this.format)+1)%t.length;this.format=t[e],this.setColor(this.value||""),this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})}handleAlphaDrag(t){const e=this.shadowRoot.querySelector(".slider.alpha"),i=e.querySelector(".slider-handle"),{width:o}=e.getBoundingClientRect();let a=this.value,s=this.value;i.focus(),t.preventDefault(),Ph(e,{onMove:t=>{this.alpha=Uh(t/o*100,0,100),this.syncValues(),this.value!==s&&(s=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))},onStop:()=>{this.value!==a&&(a=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))},initialEvent:t})}handleHueDrag(t){const e=this.shadowRoot.querySelector(".slider.hue"),i=e.querySelector(".slider-handle"),{width:o}=e.getBoundingClientRect();let a=this.value,s=this.value;i.focus(),t.preventDefault(),Ph(e,{onMove:t=>{this.hue=Uh(t/o*360,0,360),this.syncValues(),this.value!==s&&(s=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input"))}))},onStop:()=>{this.value!==a&&(a=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))},initialEvent:t})}handleGridDrag(t){const e=this.shadowRoot.querySelector(".grid"),i=e.querySelector(".grid-handle"),{width:o,height:a}=e.getBoundingClientRect();let s=this.value,n=this.value;i.focus(),t.preventDefault(),this.isDraggingGridHandle=!0,Ph(e,{onMove:(t,e)=>{this.saturation=Uh(t/o*100,0,100),this.brightness=Uh(100-e/a*100,0,100),this.syncValues(),this.value!==n&&(n=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))},onStop:()=>{this.isDraggingGridHandle=!1,this.value!==s&&(s=this.value,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))},initialEvent:t})}handleAlphaKeyDown(t){const e=t.shiftKey?10:1,i=this.value;"ArrowLeft"===t.key&&(t.preventDefault(),this.alpha=Uh(this.alpha-e,0,100),this.syncValues()),"ArrowRight"===t.key&&(t.preventDefault(),this.alpha=Uh(this.alpha+e,0,100),this.syncValues()),"Home"===t.key&&(t.preventDefault(),this.alpha=0,this.syncValues()),"End"===t.key&&(t.preventDefault(),this.alpha=100,this.syncValues()),this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleHueKeyDown(t){const e=t.shiftKey?10:1,i=this.value;"ArrowLeft"===t.key&&(t.preventDefault(),this.hue=Uh(this.hue-e,0,360),this.syncValues()),"ArrowRight"===t.key&&(t.preventDefault(),this.hue=Uh(this.hue+e,0,360),this.syncValues()),"Home"===t.key&&(t.preventDefault(),this.hue=0,this.syncValues()),"End"===t.key&&(t.preventDefault(),this.hue=360,this.syncValues()),this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleGridKeyDown(t){const e=t.shiftKey?10:1,i=this.value;"ArrowLeft"===t.key&&(t.preventDefault(),this.saturation=Uh(this.saturation-e,0,100),this.syncValues()),"ArrowRight"===t.key&&(t.preventDefault(),this.saturation=Uh(this.saturation+e,0,100),this.syncValues()),"ArrowUp"===t.key&&(t.preventDefault(),this.brightness=Uh(this.brightness+e,0,100),this.syncValues()),"ArrowDown"===t.key&&(t.preventDefault(),this.brightness=Uh(this.brightness-e,0,100),this.syncValues()),this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleInputChange(t){const e=t.target,i=this.value;t.stopPropagation(),this.input.value?(this.setColor(e.value),e.value=this.value||""):this.value="",this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}
2423handleInputInput(t){this.updateValidity(),t.stopPropagation()}handleInputKeyDown(t){if("Enter"===t.key){const t=this.value;this.input.value?(this.setColor(this.input.value),this.input.value=this.value,this.value!==t&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),setTimeout(()=>this.input.select())):this.hue=0}}handleTouchMove(t){t.preventDefault()}parseColor(t){if(!t||""===t.trim())return null;const e=new uc(t);if(!e.isValid)return null;const i=e.toHsl(),o=e.toRgb(),a=e.toHsv();if(!o||null==o.r||null==o.g||null==o.b)return null;const s={h:i.h||0,s:100*(i.s||0),l:100*(i.l||0),a:i.a||0},n=e.toHexString(),r=e.toHex8String(),l={h:a.h||0,s:100*(a.s||0),v:100*(a.v||0),a:a.a||0};return{hsl:{h:s.h,s:s.s,l:s.l,string:this.setLetterCase(`hsl(${Math.round(s.h)}, ${Math.round(s.s)}%, ${Math.round(s.l)}%)`)},hsla:{h:s.h,s:s.s,l:s.l,a:s.a,string:this.setLetterCase(`hsla(${Math.round(s.h)}, ${Math.round(s.s)}%, ${Math.round(s.l)}%, ${s.a.toFixed(2).toString()})`)},hsv:{h:l.h,s:l.s,v:l.v,string:this.setLetterCase(`hsv(${Math.round(l.h)}, ${Math.round(l.s)}%, ${Math.round(l.v)}%)`)},hsva:{h:l.h,s:l.s,v:l.v,a:l.a,string:this.setLetterCase(`hsva(${Math.round(l.h)}, ${Math.round(l.s)}%, ${Math.round(l.v)}%, ${l.a.toFixed(2).toString()})`)},rgb:{r:o.r,g:o.g,b:o.b,string:this.setLetterCase(`rgb(${Math.round(o.r)}, ${Math.round(o.g)}, ${Math.round(o.b)})`)},rgba:{r:o.r,g:o.g,b:o.b,a:o.a||0,string:this.setLetterCase(`rgba(${Math.round(o.r)}, ${Math.round(o.g)}, ${Math.round(o.b)}, ${(o.a||0).toFixed(2).toString()})`)},hex:this.setLetterCase(n),hexa:this.setLetterCase(r)}}setColor(t){const e=this.parseColor(t);return null!==e&&(this.hue=e.hsva.h,this.saturation=e.hsva.s,this.brightness=e.hsva.v,this.alpha=this.opacity?100*e.hsva.a:100,this.syncValues(),!0)}setLetterCase(t){return"string"!=typeof t?"":this.uppercase?t.toUpperCase():t.toLowerCase()}async syncValues(){const t=this.parseColor(`hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha/100})`);null!==t&&("hsl"===this.format?this.inputValue=this.opacity?t.hsla.string:t.hsl.string:"rgb"===this.format?this.inputValue=this.opacity?t.rgba.string:t.rgb.string:"hsv"===this.format?this.inputValue=this.opacity?t.hsva.string:t.hsv.string:this.inputValue=this.opacity?t.hexa:t.hex,this.isSafeValue=!0,this.value=this.inputValue,await this.updateComplete,this.isSafeValue=!1)}handleAfterHide(){this.previewButton.classList.remove("preview-color-copied"),this.updateValidity()}handleAfterShow(){this.updateValidity()}handleEyeDropper(){if(!this.hasEyeDropper)return;(new EyeDropper).open().then(t=>{const e=this.value;this.setColor(t.sRGBHex),this.value!==e&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}).catch(()=>{})}selectSwatch(t){const e=this.value;this.disabled||(this.setColor(t),this.value!==e&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))}getHexString(t,e,i,o=100){const a=new uc(`hsva(${t}, ${e}%, ${i}%, ${o/100})`);return a.isValid?a.toHex8String():""}stopNestedEventPropagation(t){t.stopImmediatePropagation()}handleFormatChange(){this.syncValues()}handleOpacityChange(){this.alpha=100}willUpdate(t){(t.has("value")||t.has("defaultValue"))&&this.handleValueChange(t.get("value")||"",this.value||""),super.willUpdate(t)}handleValueChange(t,e){if(this.isEmpty=!e,e||(this.hue=0,this.saturation=0,this.brightness=100,this.alpha=100),!this.isSafeValue){const i=this.parseColor(e);null!==i?(this.inputValue=this.value||"",this.hue=i.hsva.h,this.saturation=i.hsva.s,this.brightness=i.hsva.v,this.alpha=this.opacity?100*i.hsva.a:100,this.syncValues()):this.inputValue=t??""}this.requestUpdate()}focus(t){this.trigger.focus(t)}blur(){const t=this.trigger;this.hasFocus&&(t.focus({preventScroll:!0}),t.blur()),this.popup?.active&&this.hide()}getFormattedValue(t="hex"){const e=this.parseColor(`hsva(${this.hue}, ${this.saturation}%, ${this.brightness}%, ${this.alpha/100}
2423)`);if(null===e)return"";switch(t){case"hex":return e.hex;case"hexa":return e.hexa;case"rgb":return e.rgb.string;case"rgba":return e.rgba.string;case"hsl":return e.hsl.string;case"hsla":return e.hsla.string;case"hsv":return e.hsv.string;case"hsva":return e.hsva.string;default:return""}}reportValidity(){return this.validity.valid||this.open?super.reportValidity():(this.addEventListener("wa-after-show",this.reportValidityAfterShow,{once:!0}),this.show(),this.disabled||this.dispatchEvent(new Ie),!1)}formResetCallback(){this.value=this.defaultValue,super.formResetCallback()}firstUpdated(t){super.firstUpdated(t),this.hasEyeDropper="EyeDropper"in window}handleTriggerClick(){this.open?this.hide():(this.show(),this.focus())}async handleTriggerKeyDown(t){if([" ","Enter"].includes(t.key))return t.preventDefault(),void this.handleTriggerClick()}handleTriggerKeyUp(t){" "===t.key&&t.preventDefault()}updateAccessibleTrigger(){const t=this.trigger;t&&(t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this.open?"true":"false"))}async show(){if(!this.open)return this.open=!0,Nt(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,Nt(this,"wa-after-hide")}addOpenListeners(){this.base.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),Nh(this)}removeOpenListeners(){this.base&&this.base.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),Hh(this)}async handleOpenChange(){this.disabled?this.open=!1:(this.updateAccessibleTrigger(),this.open?(this.dispatchEvent(new CustomEvent("wa-show")),this.addOpenListeners(),await this.updateComplete,this.base.hidden=!1,this.popup.active=!0,await qt(this.popup.popup,"show-with-scale"),this.dispatchEvent(new CustomEvent("wa-after-show"))):(this.dispatchEvent(new CustomEvent("wa-hide")),this.removeOpenListeners(),await qt(this.popup.popup,"hide-with-scale"),this.base.hidden=!0,this.popup.active=!1,this.dispatchEvent(new CustomEvent("wa-after-hide"))))}render(){const t=this.isEmpty,e=this.hasSlotController.test("label","withLabel"),i=this.hasSlotController.test("hint","withHint"),o=!!this.label||!!e,a=!!this.hint||!!i,s=this.saturation,n=100-this.brightness,r=Array.isArray(this.swatches)?this.swatches.map(t=>"string"==typeof t?{color:t,label:t}:t):this.swatches.split(";").filter(t=>""!==t.trim()).map(t=>({color:t.trim(),label:t.trim()})),l=K` 2424 <div 2425 part="base color-picker" 2426 class=${ce({"color-picker":!0})} 2427 aria-disabled=${this.disabled?"true":"false"} 2428 tabindex="-1" 2429 > 2430 <div 2431 part="grid" 2432 class="grid" 2433 style=${fc({backgroundColor:this.getHexString(this.hue,100,100)})} 2434 @pointerdown=${this.handleGridDrag} 2435 @touchmove=${this.handleTouchMove} 2436 > 2437 <span 2438 part="grid-handle" 2439 class=${ce({"grid-handle":!0,"grid-handle-dragging":this.isDraggingGridHandle})} 2440 style=${fc({top:`${n}%`,left:`${s}%`,backgroundColor:this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} 2441 role="application" 2442 aria-label="HSV" 2443 tabindex=${We(this.disabled?void 0:"0")} 2444 @keydown=${this.handleGridKeyDown} 2445 ></span> 2446 </div> 2447 2448 <div class="controls"> 2449 <div class="sliders"> 2450 <div 2451 part="slider hue-slider" 2452 class="hue slider" 2453 @pointerdown=${this.handleHueDrag} 2454 @touchmove=${this.handleTouchMove} 2455 > 2456 <span 2457 part="slider-handle hue-slider-handle" 2458 class="slider-handle" 2459 style=${fc({left:(0===this.hue?0:100/(360/this.hue))+"%",backgroundColor:this.getHexString(this.hue,100,100)})} 2460 role="slider" 2461 aria-label="hue" 2462 aria-orientation="horizontal" 2463 aria-valuemin="0" 2464 aria-valuemax="360" 2465 aria-valuenow=${`${Math.round(this.hue)}`} 2466 tabindex=${We(this.disabled?void 0:"0")} 2467 @keydown=${this.handleHueKeyDown} 2468 ></span> 2469 </div> 2470 2471 ${this.opacity?K` 2472 <div 2473 part="slider opacity-slider" 2474 class="alpha slider transparent-bg" 2475 @pointerdown="${this.handleAlphaDrag}" 2476 @touchmove=${this.handleTouchMove} 2477 > 2478 <div 2479 class="alpha-gradient" 2480 style=${fc({backgroundImage:`linear-gradient(\n to right,\n ${this.getHexString(this.hue,this.saturation,this.brightness,0)} 0%,\n ${this.getHexString(this.hue,this.saturation,this.brightness,100)} 100%\n )`})} 2481 ></div>
2482 <span 2483 part="slider-handle opacity-slider-handle" 2484 class="slider-handle" 2485 style=${fc({left:`${this.alpha}%`,backgroundColor:this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} 2486 role="slider" 2487 aria-label="alpha" 2488 aria-orientation="horizontal" 2489 aria-valuemin="0" 2490 aria-valuemax="100" 2491 aria-valuenow=${Math.round(this.alpha)} 2492 tabindex=${We(this.disabled?void 0:"0")} 2493 @keydown=${this.handleAlphaKeyDown} 2494 ></span> 2495 </div> 2496 `:""} 2497 </div> 2498 2499 <button 2500 type="button" 2501 part="preview" 2502 class="preview transparent-bg" 2503 aria-label=${this.localize.term("copy")} 2504 style=${fc({"--preview-color":this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} 2505 @click=${this.handleCopy} 2506 ></button> 2507 </div> 2508 2509 <div class="user-input" aria-live="polite"> 2510 <wa-input 2511 part="input" 2512 type="text" 2513 name=${this.name} 2514 size="s" 2515 autocomplete="off" 2516 autocorrect="off" 2517 autocapitalize="off" 2518 spellcheck="false" 2519 .value=${t?"":this.inputValue} 2520 value=${t?"":this.inputValue} 2521 ?required=${this.required} 2522 ?disabled=${this.disabled} 2523 aria-label=${this.localize.term("currentValue")} 2524 @keydown=${this.handleInputKeyDown} 2525 @change=${this.handleInputChange} 2526 @input=${this.handleInputInput} 2527 @blur=${this.stopNestedEventPropagation} 2528 @focus=${this.stopNestedEventPropagation} 2529 ></wa-input> 2530 2531 <wa-button-group> 2532 ${this.withoutFormatToggle?"":K` 2533 <wa-button 2534 part="format-button" 2535 size="s" 2536 appearance="outlined" 2537 aria-label=${this.localize.term("toggleColorFormat")} 2538 exportparts=" 2539 base:format-button__base, 2540 start:format-button__start, 2541 label:format-button__label, 2542 end:format-button__end, 2543 caret:format-button__caret 2544 " 2545 @click=${this.handleFormatToggle} 2546 @blur=${this.stopNestedEventPropagation} 2547 @focus=${this.stopNestedEventPropagation} 2548 > 2549 ${this.setLetterCase(this.format)} 2550 </wa-button> 2551 `} 2552 ${this.hasEyeDropper?K` 2553 <wa-button 2554 part="eyedropper-button" 2555 size="s" 2556 appearance="outlined" 2557 exportparts=" 2558 base:eyedropper-button__base, 2559 start:eyedropper-button__start, 2560 label:eyedropper-button__label, 2561 end:eyedropper-button__end, 2562 caret:eyedropper-button__caret 2563 " 2564 @click=${this.handleEyeDropper} 2565 @blur=${this.stopNestedEventPropagation} 2566 @focus=${this.stopNestedEventPropagation} 2567 > 2568 <wa-icon 2569 library="system" 2570 name="eyedropper" 2571 variant="solid" 2572 label=${this.localize.term("selectAColorFromTheScreen")} 2573 ></wa-icon> 2574 </wa-button> 2575 `:""} 2576 </wa-button-group> 2577 </div> 2578 2579 ${r.length>0?K` 2580 <div part="swatches" class="swatches"> 2581 ${r.map(t=>{const e=this.parseColor(t.color);return e?K` 2582 <div 2583 part="swatch" 2584 class="swatch transparent-bg" 2585 tabindex=${We(this.disabled?void 0:"0")} 2586 role="button" 2587 aria-label=${t.label} 2588 @click=${()=>this.selectSwatch(t.color)} 2589 @keydown=${e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectSwatch(t.color))}} 2590 > 2591 <div class="swatch-color" style=${fc({backgroundColor:e.hexa})}></div> 2592 </div> 2593 `:""})} 2594 </div> 2595 `:""} 2596 </div> 2597 `;return K` 2598 <div 2599 class=${ce({container:!0,"form-control":!0,"form-control-has-label":o})} 2600 part="trigger-container form-control" 2601 > 2602 <div 2603 part="form-control-label" 2604 class=${ce({label:!0,"has-label":o})} 2605 id="form-control-label" 2606 > 2607 <slot name="label">${this.label}</slot> 2608 </div> 2609 2610 <button 2611 id="trigger" 2612 part="trigger form-control-input" 2613 class=${ce({trigger:!0,"trigger-empty":t,"transparent-bg":!0,"form-control-input":!0})} 2614 style=${fc({color:this.getHexString(this.hue,this.saturation,this.brightness,this.alpha)})} 2615 type="button" 2616 aria-labelledby="form-control-label" 2617 aria-describedby="hint" 2618 .disabled=${this.disabled} 2619 @click=${this.handleTriggerClick} 2620 @keydown=${this.handleTriggerKeyDown} 2621 @keyup=${this.handleTriggerKeyUp} 2622 ></button> 2623 2624 <slot 2625 id="hint" 2626 name="hint" 2627 part="hint" 2628 class=${ce({"has-slotted":a})} 2629 >${this.hint}</slot 2630 > 2631 </div> 2632 2633 <wa-popup 2634 class="color-popup" 2635 anchor="trigger" 2636 placement=${this.placement} 2637 distance="0" 2638 skidding="0" 2639 flip 2640 flip-fallback-strategy="best-fit" 2641 shift 2642 shift-padding="10" 2643 aria-disabled=${this.disabled?"true":"false"} 2644 @wa-after-show=${this.handleAfterShow} 2645 @wa-after-hide=${this.handleAfterHide} 2646 > 2647 ${l} 2648 </wa-popup> 2649 `}};function bc(t,e){const i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey;"Enter"!==t.key||i||setTimeout(()=>{t.defaultPrevented||t.isComposing||function(t){let e=null;"form"in t&&(e=t.form);!e&&"getForm"in t&&(e=t.getForm());if(!e)return;const i=Array.from(e.elements);let o=0;for(const t of i)yc(t)&&(o+=1);if(1===o)return void e.requestSubmit(null);const a=i.find(t=>"submit"===t.type&&!t.matches(":disabled"));if(!a)return;["input","button"].includes(a.localName)?e.requestSubmit(a):a.click()}(e)})}gc.css=[Rh,Ue,zh,Vh],gc.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt('[part~="base"]')],gc.prototype,"base",2),kt([Dt('[part~="input"]')],gc.prototype,"input",2),kt([Dt('[part~="form-control-label"]')],gc.prototype,"triggerLabel",2),kt([Dt('[part~="form-control-input"]')],gc.prototype,"triggerButton",2),kt([Dt(".color-popup")],gc.prototype,"popup",2),kt([Dt('[part~="preview"]')],gc.prototype,"previewButton",2),kt([Dt('[part~="trigger"]')],gc.prototype,"trigger",2),kt([$t()],gc.prototype,"hasFocus",2),kt([$t()],gc.prototype,"isDraggingGridHandle",2),kt([$t()],gc.prototype,"inputValue",2),kt([$t()],gc.prototype,"hue",2),kt([$t()],gc.prototype,"isEmpty",2),kt([$t()],gc.prototype,"saturation",2),kt([$t()],gc.prototype,"brightness",2),kt([$t()],gc.prototype,"alpha",2),kt([$t()],gc.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],gc.prototype,"defaultValue",2),kt([At({attribute:"with-label",reflect:!0,type:Boolean})],gc.prototype,"withLabel",2),kt([At({attribute:"with-hint",reflect:!0,type:Boolean})],gc.prototype,"withHint",2),kt([$t()],gc.prototype,"hasEyeDropper",2),kt([At()],gc.prototype,"label",2),kt([At({attribute:"hint"})],gc.prototype,"hint",2),kt([At()],gc.prototype,"format",2),kt([At({reflect:!0})],gc.prototype,"size",2),kt([vt("size")],gc.prototype,"handleSizeChange",1),kt([At({reflect:!0})],gc.prototype,"placement",2),kt([At({attribute:"without-format-toggle",type:Boolean})],gc.prototype,"withoutFormatToggle",2),kt([At({reflect:!0})],gc.prototype,"name",2),kt([At({type:Boolean})],gc.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],gc.prototype,"open",2),kt([At({type:Boolean})],gc.prototype,"opacity",2),kt([At({type:Boolean})],gc.prototype,"uppercase",2),kt([At()],gc.prototype,"swatches",2),kt([At({type:Boolean,reflect:!0})],gc.prototype,"required",2),kt([function(t){return(e,i)=>{const o="function"==typeof e?e:e[i];Object.assign(o,t)}}({passive:!1})],gc.prototype,"handleTouchMove",1),kt([vt("format",{waitUntilFirstUpdate:!0})],gc.prototype,"handleFormatChange",1),kt([vt("opacity",{waitUntilFirstUpdate:!0})],gc.prototype,"handleOpacityChange",1),kt([vt("value")],gc.prototype,"handleValueChange",1),kt([vt("open",{waitUntilFirstUpdate:!0}
2649)],gc.prototype,"handleOpenChange",1),gc=kt([St("wa-color-picker")],gc),gc.disableWarning?.("change-in-update");var vc=new Map([["input",!0],["wa-input",!0],["wa-tag-input",!0],["wa-number-input",!0],["wa-otp-input",!0],["wa-slider",!0]]),wc=new Map([["button",!1],["checkbox",!1],["color",!1],["date",!1],["datetime-local",!1],["email",!0],["file",!1],["hidden",!1],["image",!1],["month",!1],["number",!0],["password",!0],["radio",!1],["range",!1],["reset",!0],["search",!0],["submit",!1],["tel",!0],["text",!0],["time",!1],["url",!0],["week",!1]]),yc=t=>{const e=t?.localName;if(!e)return!1;if(!Boolean(vc.get(e)))return!1;if("input"!==e&&"wa-input"!==e)return!0;const i=t.type;return Boolean(wc.get(i))};var xc=h` 2650 :host { 2651 border-width: 0; 2652 } 2653 2654 :host(:focus) { 2655 outline: none; 2656 } 2657 2658 .text-field { 2659 display: flex; 2660 align-items: stretch; 2661 justify-content: start; 2662 position: relative; 2663 transition: inherit; 2664 height: var(--wa-form-control-height); 2665 border-color: var(--wa-form-control-border-color); 2666 border-radius: var(--wa-form-control-border-radius); 2667 border-style: var(--wa-form-control-border-style); 2668 border-width: var(--wa-form-control-border-width); 2669 cursor: text; 2670 color: var(--wa-form-control-value-color); 2671 font-size: var(--wa-form-control-value-font-size); 2672 font-family: inherit; 2673 font-weight: var(--wa-form-control-value-font-weight); 2674 line-height: var(--wa-form-control-value-line-height); 2675 vertical-align: middle; 2676 width: 100%; 2677 transition: 2678 background-color var(--wa-transition-normal), 2679 border-color var(--wa-transition-normal), 2680 outline-color var(--wa-transition-fast); 2681 transition-timing-function: var(--wa-transition-easing); 2682 background-color: var(--wa-form-control-background-color);
2683 box-shadow: var(--box-shadow); 2684 padding: 0 var(--wa-form-control-padding-inline); 2685 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 2686 outline-offset: var(--wa-focus-ring-offset); 2687 2688 /* Only ring the field when the text input has focus, not inner buttons */ 2689 &:has(input:focus, textarea:focus) { 2690 outline-color: var(--wa-color-focus); 2691 } 2692 2693 /* Style disabled inputs */ 2694 &:has(:disabled) { 2695 cursor: not-allowed; 2696 opacity: 0.5; 2697 } 2698 } 2699 2700 /* Appearance modifiers */ 2701 :host([appearance='outlined']) .text-field { 2702 background-color: var(--wa-form-control-background-color); 2703 border-color: var(--wa-form-control-border-color); 2704 } 2705 2706 :host([appearance='filled']) .text-field { 2707 background-color: var(--wa-color-neutral-fill-quiet); 2708 border-color: var(--wa-color-neutral-fill-quiet); 2709 } 2710 2711 :host([appearance='filled-outlined']) .text-field { 2712 background-color: var(--wa-color-neutral-fill-quiet); 2713 border-color: var(--wa-form-control-border-color); 2714 } 2715 2716 :host([pill]) .text-field { 2717 border-radius: var(--wa-border-radius-pill) !important; 2718 } 2719 2720 .text-field { 2721 /* Show autofill styles over the entire text field, not just the native <input> */ 2722 &:has(:autofill), 2723 &:has(:-webkit-autofill) { 2724 background-color: var(--wa-color-brand-fill-quiet) !important; 2725 } 2726 2727 input, 2728 textarea { 2729 /* 2730 Fixes an alignment issue with placeholders. 2731 https://github.com/shoelace-style/webawesome/issues/342 2732 */ 2733 height: 100%; 2734 2735 padding: 0; 2736 border: none; 2737 outline: none; 2738 box-shadow: none; 2739 margin: 0; 2740 cursor: inherit; 2741 -webkit-appearance: none; 2742 font: inherit; 2743 2744 /* Turn off Safari's autofill styles */ 2745 &:-webkit-autofill, 2746 &:-webkit-autofill:hover, 2747 &:-webkit-autofill:focus, 2748 &:-webkit-autofill:active { 2749 -webkit-background-clip: text; 2750 background-color: transparent; 2751 -webkit-text-fill-color: inherit; 2752 } 2753 } 2754 } 2755 2756 input { 2757 flex: 1 1 auto; 2758 min-width: 0; 2759 height: 100%; 2760 transition: inherit; 2761 2762 /* prettier-ignore */ 2763 background-color: rgb(118 118 118 / 0); /* ensures proper placeholder styles in webkit's date input */ 2764 height: calc(var(--wa-form-control-height) - var(--border-width) * 2); 2765 padding-block: 0; 2766 color: inherit; 2767 2768 &:autofill { 2769 &, 2770 &:hover, 2771 &:focus, 2772 &:active { 2773 box-shadow: none; 2774 caret-color: var(--wa-form-control-value-color); 2775 } 2776 } 2777 2778 &::placeholder { 2779 color: var(--wa-form-control-placeholder-color); 2780 user-select: none; 2781 -webkit-user-select: none; 2782 } 2783 2784 &::-webkit-search-decoration, 2785 &::-webkit-search-cancel-button, 2786 &::-webkit-search-results-button, 2787 &::-webkit-search-results-decoration { 2788 -webkit-appearance: none; 2789 } 2790 2791 &:focus { 2792 outline: none; 2793 } 2794 } 2795 2796 textarea { 2797 &:autofill { 2798 &, 2799 &:hover, 2800 &:focus, 2801 &:active { 2802 box-shadow: none; 2803 caret-color: var(--wa-form-control-value-color); 2804 } 2805 } 2806 2807 &::placeholder { 2808 color: var(--wa-form-control-placeholder-color); 2809 user-select: none; 2810 -webkit-user-select: none; 2811 } 2812 } 2813 2814 .start, 2815 .end { 2816 display: inline-flex; 2817 flex: 0 0 auto; 2818 align-items: center; 2819 cursor: default; 2820 2821 &::slotted(wa-icon) { 2822 color: var(--wa-color-neutral-on-quiet); 2823 } 2824 } 2825 2826 .start::slotted(*) { 2827 margin-inline-end: var(--wa-form-control-padding-inline); 2828 } 2829 2830 .end::slotted(*) { 2831 margin-inline-start: var(--wa-form-control-padding-inline); 2832 } 2833 2834 /* 2835 * Clearable + Password Toggle 2836 */ 2837 2838 .clear, 2839 .password-toggle { 2840 position: relative; 2841 display: inline-flex;
2842 align-self: center; 2843 align-items: center; 2844 justify-content: center; 2845 aspect-ratio: 1; 2846 height: 1.5em; 2847 font-size: inherit; 2848 color: var(--wa-color-neutral-on-quiet); 2849 border: none; 2850 border-radius: var(--wa-border-radius-s); 2851 background: none; 2852 padding: 0; 2853 transition: var(--wa-transition-normal) color; 2854 cursor: pointer; 2855 /* The box is wider than the glyph, so overhang half of that growth on each side. Keeps the 2856 glyph flush with the field's trailing padding edge, like every other form control. */ 2857 margin-inline-start: calc(var(--wa-form-control-padding-inline) - 0.125em); 2858 margin-inline-end: -0.125em; 2859 2860 &::after { 2861 content: ''; 2862 position: absolute; 2863 inset-inline: 0; 2864 height: var(--wa-form-control-height); 2865 } 2866 2867 @media (hover: hover) { 2868 &:hover { 2869 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 2870 } 2871 } 2872 2873 &:active { 2874 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 2875 } 2876 2877 &:focus { 2878 outline: none; 2879 } 2880 2881 &:focus-visible { 2882 outline: var(--wa-focus-ring); 2883 outline-offset: var(--wa-focus-ring-offset); 2884 } 2885 } 2886 2887 /* Don't show the browser's password toggle in Edge */ 2888 ::-ms-reveal { 2889 display: none; 2890 } 2891 2892 /* Hide the built-in number spinner */ 2893 :host([without-spin-buttons]) input[type='number'] { 2894 -moz-appearance: textfield; 2895 2896 &::-webkit-outer-spin-button, 2897 &::-webkit-inner-spin-button { 2898 -webkit-appearance: none; 2899 display: none; 2900 } 2901 } 2902`,kc=class extends Event{constructor(){super("wa-clear",{bubbles:!0,cancelable:!1,composed:!0})}},Cc=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["blur","input"],this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.title="",this.type="text",this._value=null,this.defaultValue=this.getAttribute("value")||null,this.size="m",this.appearance="outlined",this.pill=!1,this.label="",this.hint="",this.withClear=!1,this.placeholder="",this.readonly=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.required=!1,this.spellcheck=!0,this.withLabel=!1,this.withHint=!1}static get validators(){return[...super.validators,Fe()]}get value(){return this.valueHasChanged?this._value:this._value??this.defaultValue}set value(t){this._value!==t&&(this.valueHasChanged=!0,this._value=t)}updateFormValue(t){null!=t?super.updateFormValue(t):this.setValue("",null)}handleSizeChange(){He(this.localName,this.size)}handleChange(t){this.value=this.input.value,this.relayNativeEvent(t,{bubbles:!0,composed:!0})}handleClearClick(t){t.preventDefault(),""!==this.value&&(this.value="",this.updateComplete.then(()=>{this.dispatchEvent(new kc),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})),this.input.focus()}handleInput(){this.value=this.input.value}handleKeyDown(t){bc(t,this)}handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}updated(t){if(super.updated(t),t.has("value")||t.has("defaultValue")||t.has("type")){const t=["number","date","time","datetime-local"];this.input&&t.includes(this.type)&&this.value&&this.input.value!==this.value&&(this._value=this.input.value),this.customStates.set("blank",!this.value),this.updateValidity()}}handleStepChange(){this.input.step=String(this.step),this.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}setSelectionRange(t,e,i="none"){this.input.setSelectionRange(t,e,i)}setRangeText(t,e,i,o="preserve"){const a=e??this.input.selectionStart,s=i??this.input.selectionEnd;this.input.setRangeText(t,a,s,o),this.value!==this.input.value&&(this.value=this.input.value)}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.input.showPicker()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}formResetCallback(){this.value=null,this.input&&(this.input.value=this.value),super.formResetCallback()}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e,a=this.withClear&&!this.disabled&&!this.readonly,s=(!this.didSSR||this.hasUpdated)&&a&&("number"==typeof this.value||this.value&&this.value.length>0);return K` 2903 <label 2904 part="form-control-label label" 2905 class=${ce({label:!0,"has-label":i})} 2906 for="input" 2907 aria-hidden=${i?"false":"true"} 2908 > 2909 <slot name="label">${this.label}</slot> 2910 </label> 2911 2912 <div part="base input-wrapper" class="text-field"> 2913 <slot name="start" part="start" class="start"></slot> 2914 2915 <input 2916 part="input" 2917 id="input" 2918 class="control" 2919 type=${"password"===this.type&&this.passwordVisible?"text":this.t
2919ype} 2920 title=${this.title} 2921 name=${We(this.name)} 2922 ?disabled=${this.disabled} 2923 ?readonly=${this.readonly} 2924 ?required=${this.required} 2925 placeholder=${We(this.placeholder)} 2926 minlength=${We(this.minlength)} 2927 maxlength=${We(this.maxlength)} 2928 min=${We(this.min)} 2929 max=${We(this.max)} 2930 step=${We(this.step)} 2931 .value=${Th(this.value??"")} 2932 autocapitalize=${We(this.autocapitalize)} 2933 autocomplete=${We(this.autocomplete)} 2934 autocorrect=${this.autocorrect?"on":"off"} 2935 ?autofocus=${this.autofocus} 2936 spellcheck=${this.spellcheck} 2937 pattern=${We(this.pattern)} 2938 enterkeyhint=${We(this.enterkeyhint)} 2939 inputmode=${We(this.inputmode)} 2940 aria-describedby="hint" 2941 @change=${this.handleChange} 2942 @input=${this.handleInput} 2943 @keydown=${this.handleKeyDown} 2944 /> 2945 2946 ${s?K` 2947 <button 2948 part="clear-button" 2949 class="clear" 2950 type="button" 2951 aria-label=${this.localize.term("clearEntry")} 2952 @click=${this.handleClearClick} 2953 tabindex="-1" 2954 > 2955 <slot name="clear-icon"> 2956 <wa-icon name="circle-xmark" library="system" variant="regular"></wa-icon> 2957 </slot> 2958 </button> 2959 `:""} 2960 ${this.passwordToggle&&!this.disabled?K` 2961 <button 2962 part="password-toggle-button" 2963 class="password-toggle" 2964 type="button" 2965 aria-label=${this.localize.term(this.passwordVisible?"hidePassword":"showPassword")} 2966 @click=${this.handlePasswordToggle} 2967 > 2968 ${this.passwordVisible?K` 2969 <slot name="hide-password-icon"> 2970 <wa-icon name="eye-slash" library="system" variant="regular"></wa-icon> 2971 </slot> 2972 `:K` 2973 <slot name="show-password-icon"> 2974 <wa-icon name="eye" library="system" variant="regular"></wa-icon> 2975 </slot> 2976 `} 2977 </button> 2978 `:""} 2979 2980 <slot name="end" part="end" class="end"></slot> 2981 </div> 2982 2983 <slot 2984 id="hint" 2985 part="hint" 2986 name="hint" 2987 class=${ce({"has-slotted":o})} 2988 aria-hidden=${o?"false":"true"} 2989 >${this.hint}</slot 2990 > 2991 `}};Cc.css=[Ue,zh,xc],Cc.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt("input")],Cc.prototype,"input",2),kt([At()],Cc.prototype,"title",2),kt([At({reflect:!0})],Cc.prototype,"type",2),kt([$t()],Cc.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],Cc.prototype,"defaultValue",2),kt([At({reflect:!0})],Cc.prototype,"size",2),kt([vt("size")],Cc.prototype,"handleSizeChange",1),kt([At({reflect:!0})],Cc.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],Cc.prototype,"pill",2),kt([At()],Cc.prototype,"label",2),kt([At({attribute:"hint"})],Cc.prototype,"hint",2),kt([At({attribute:"with-clear",type:Boolean})],Cc.prototype,"withClear",2),kt([At()],Cc.prototype,"placeholder",2),kt([At({type:Boolean,reflect:!0})],Cc.prototype,"readonly",2),kt([At({attribute:"password-toggle",type:Boolean})],Cc.prototype,"passwordToggle",2),kt([At({attribute:"password-visible",type:Boolean})],Cc.prototype,"passwordVisible",2),kt([At({attribute:"without-spin-buttons",type:Boolean,reflect:!0})],Cc.prototype,"withoutSpinButtons",2),kt([At({type:Boolean,reflect:!0})],Cc.prototype,"required",2),kt([At()],Cc.prototype,"pattern",2),kt([At({type:Number})],Cc.prototype,"minlength",2),kt([At({type:Number})],Cc.prototype,"maxlength",2),kt([At()],Cc.prototype,"min",2),kt([At()],Cc.prototype,"max",2),kt([At()],Cc.prototype,"step",2),kt([At()],Cc.prototype,"autocapitalize",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"off"===t),toAttribute:t=>t?"on":"off"}})],Cc.prototype,"autocorrect",2),kt([At()],Cc.prototype,"autocomplete",2),kt([At({type:Boolean})],Cc.prototype,"autofocus",2),kt([At()],Cc.prototype,"enterkeyhint",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],Cc.prototype,"spellcheck",2),kt([At()],Cc.prototype,"inputmode",2),kt([At({attribute:"with-label",type:Boolean})],Cc.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],Cc.prototype,"withHint",2),kt([vt("step",{waitUntilFirstUpdate:!0}
2991)],Cc.prototype,"handleStepChange",1),Cc=kt([St("wa-input")],Cc),Cc.disableWarning?.("change-in-update");var Sc=class extends Event{constructor(){super("wa-reposition",{bubbles:!0,cancelable:!1,composed:!0})}},_c=h` 2992 :host { 2993 --arrow-color: black; 2994 --arrow-size: var(--wa-tooltip-arrow-size); 2995 --popup-border-width: 0px; 2996 --show-duration: var(--wa-transition-fast); 2997 --hide-duration: var(--wa-transition-fast); 2998 2999 /* 3000 * These properties are computed to account for the arrow's dimensions after being rotated 45º. The constant 3001 * 0.7071 is derived from sin(45) to calculate the length of the arrow after rotation. 3002 * 3003 * The diamond will be translated inward by --arrow-base-offset, the border thickness, to centralise it on 3004 * the inner edge of the popup border. This also means we need to increase the size of the arrow by the 3005 * same amount to compensate. 3006 * 3007 * A diamond shaped clipping mask is used to avoid overlap of popup content. This extends slightly
3007inward so 3008 * the popup border is covered with no sub-pixel rounding artifacts. The diamond corners are mitred at 22.5º 3009 * to properly merge any arrow border with the popup border. The constant 1.4142 is derived from 1 + tan(22.5). 3010 * 3011 */ 3012 --arrow-base-offset: var(--popup-border-width); 3013 --arrow-size-diagonal: calc((var(--arrow-size) + var(--arrow-base-offset)) * 0.7071); 3014 --arrow-padding-offset: calc(var(--arrow-size-diagonal) - var(--arrow-size)); 3015 --arrow-size-div: calc(var(--arrow-size-diagonal) * 2); 3016 --arrow-clipping-corner: calc(var(--arrow-base-offset) * 1.4142); 3017 3018 display: contents; 3019 } 3020 3021 .popup { 3022 position: absolute; 3023 isolation: isolate; 3024 max-width: var(--auto-size-available-width, none); 3025 max-height: var(--auto-size-available-height, none); 3026 3027 /* Clear UA styles for [popover] */ 3028 :where(&) { 3029 inset: unset; 3030 padding: unset; 3031 margin: unset; 3032 width: unset; 3033 height: unset; 3034 color: unset; 3035 background: unset; 3036 border: unset; 3037 overflow: unset; 3038 } 3039 } 3040 3041 .popup-fixed { 3042 position: fixed; 3043 } 3044 3045 .popup:not(.popup-active) { 3046 display: none; 3047 } 3048 3049 .arrow { 3050 position: absolute; 3051 width: var(--arrow-size-div); 3052 height: var(--arrow-size-div); 3053 background: var(--arrow-color); 3054 z-index: 3; 3055 clip-path: polygon( 3056 var(--arrow-clipping-corner) 100%, 3057 var(--arrow-base-offset) calc(100% - var(--arrow-base-offset)), 3058 calc(var(--arrow-base-offset) - 2px) calc(100% - var(--arrow-base-offset)), 3059 calc(100% - var(--arrow-base-offset)) calc(var(--arrow-base-offset) - 2px), 3060 calc(100% - var(--arrow-base-offset)) var(--arrow-base-offset), 3061 100% var(--arrow-clipping-corner), 3062 100% 100% 3063 ); 3064 rotate: 45deg; 3065 } 3066 3067 :host([data-current-placement|='left']) .arrow { 3068 rotate: -45deg; 3069 } 3070 3071 :host([data-current-placement|='right']) .arrow { 3072 rotate: 135deg; 3073 } 3074 3075 :host([data-current-placement|='bottom']) .arrow { 3076 rotate: 225deg; 3077 } 3078 3079 /* Hover bridge */ 3080 .popup-hover-bridge:not(.popup-hover-bridge-visible) { 3081 display: none; 3082 } 3083 3084 .popup-hover-bridge { 3085 position: fixed; 3086 z-index: 899; 3087 top: 0; 3088 right: 0; 3089 bottom: 0; 3090 left: 0; 3091 clip-path: polygon( 3092 var(--hover-bridge-top-left-x, 0) var(--hover-bridge-top-left-y, 0), 3093 var(--hover-bridge-top-right-x, 0) var(--hover-bridge-top-right-y, 0), 3094 var(--hover-bridge-bottom-right-x, 0) var(--hover-bridge-bottom-right-y, 0), 3095 var(--hover-bridge-bottom-left-x, 0) var(--hover-bridge-bottom-left-y, 0) 3096 ); 3097 } 3098 3099 /* Built-in animations */ 3100 .show { 3101 animation: show var(--show-duration) ease; 3102 } 3103 3104 .hide { 3105 animation: show var(--hide-duration) ease reverse; 3106 } 3107 3108 @keyframes show { 3109 from { 3110 opacity: 0; 3111 } 3112 to { 3113 opacity: 1; 3114 } 3115 } 3116 3117 .show-with-scale { 3118 animation: show-with-scale var(--show-duration) ease; 3119 } 3120 3121 .hide-with-scale { 3122 animation: show-with-scale var(--hide-duration) ease reverse; 3123 } 3124 3125 @keyframes show-with-scale { 3126 from { 3127 opacity: 0; 3128 scale: 0.8; 3129 } 3130 to { 3131 opacity: 1; 3132 scale: 1; 3133 } 3134 } 3135`;const Ec=Math.min,Ac=Math.max,$c=Math.round,Lc=Math.floor,Dc=t=>({x:t,y:t}),Mc={left:"right",right:"left",bottom:"top",top:"bottom"},zc={start:"end",end:"start"};function Tc(t,e,i){return Ac(t,Ec(e,i))}function Oc(t,e){return"function"==typeof t?t(e):t}function Pc(t){return t.split("-")[0]}function Fc(t){return t.split("-")[1]}function Ic(t){return"x"===t?"y":"x"}function Rc(t){return"y"===t?"height":"width"}function Vc(t){return["top","bottom"].includes(Pc(t))?"y":"x"}function Bc(t){return Ic(Vc(t))}function Nc(t){return t.replace(/start|end/g,t=>zc[t])}function Hc(t){return t.replace(/left|right|bottom|top/g,t=>Mc[t])}function qc(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Uc(t){const{x:e,y:i,width:o,height:a}=t;return{width:o,height:a,top:i,left:e,right:e+o,bottom:i+a,x:e,y:i}}function Wc(t,e,i){let{reference:o,floating:a}=t;const s=Vc(e),n=Bc(e),r=Rc(n),l=Pc(e),h="y"===s,c=o.x+o.width/2-a.width/2,d=o.y+o.height/2-a.height/2,u=o[r]/2-a[r]/2;let p;switch(l){case"top":p={x:c,y:o.y-a.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-a.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Fc(e)){case"start":p[n]-=u*(i&&h?-1:1);break;case"end":p[n]+=u*(i&&h?-1:1)}return p}async function jc(t,e){var i;void 0===e&&(e={});const{x:o,y:a,platform:s,rects:n,elements:r,strategy:l}=t,{boundary:h="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=Oc(e,t),m=qc(p),f=r[u?"floating"===d?"reference":"floating":d],g=Uc(await s.getClippingRect
vendor: 3,698 bytes, line 3135
3135({element:null==(i=await(null==s.isElement?void 0:s.isElement(f)))||i?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:h,rootBoundary:c,strategy:l})),b="floating"===d?{x:o,y:a,width:n.floating.width,height:n.floating.height}:n.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),w=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},y=Uc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:b,offsetParent:v,strategy:l}):b);return{top:(g.top-y.top+m.top)/w.y,bottom:(y.bottom-g.bottom+m.bottom)/w.y,left:(g.left-y.left+m.left)/w.x,right:(y.right-g.right+m.right)/w.x}}function Yc(){return"undefined"!=typeof window}function Kc(t){return Qc(t)?(t.nodeName||"").toLowerCase():"#document"}function Xc(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Gc(t){var e;return null==(e=(Qc(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Qc(t){return!!Yc()&&(t instanceof Node||t instanceof Xc(t).Node)}function Jc(t){return!!Yc()&&(t instanceof Element||t instanceof Xc(t).Element)}function Zc(t){return!!Yc()&&(t instanceof HTMLElement||t instanceof Xc(t).HTMLElement)}function td(t){return!(!Yc()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Xc(t).ShadowRoot)}function ed(t){const{overflow:e,overflowX:i,overflowY:o,display:a}=rd(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+i)&&!["inline","contents"].includes(a)}function id(t){return["table","td","th"].includes(Kc(t))}function od(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch(t){return!1}})}function ad(t){const e=sd(),i=Jc(t)?rd(t):t;return["transform","translate","scale","rotate","perspective"].some(t=>!!i[t]&&"none"!==i[t])||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","translate","scale","rotate","perspective","filter"].some(t=>(i.willChange||"").includes(t))||["paint","layout","strict","content"].some(t=>(i.contain||"").includes(t))}function sd(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function nd(t){return["html","body","#document"].includes(Kc(t))}function rd(t){return Xc(t).getComputedStyle(t)}function ld(t){return Jc(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function hd(t){if("html"===Kc(t))return t;const e=t.assignedSlot||t.parentNode||td(t)&&t.host||Gc(t);return td(e)?e.host:e}function cd(t){const e=hd(t);return nd(e)?t.ownerDocument?t.ownerDocument.body:t.body:Zc(e)&&ed(e)?e:cd(e)}function dd(t,e,i){var o;void 0===e&&(e=[]),void 0===i&&(i=!0);const a=cd(t),s=a===(null==(o=t.ownerDocument)?void 0:o.body),n=Xc(a);if(s){const t=ud(n);return e.concat(n,n.visualViewport||[],ed(a)?a:[],t&&i?dd(t):[])}return e.concat(a,dd(a,[],i))}function ud(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function pd(t){const e=rd(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const a=Zc(t),s=a?t.offsetWidth:i,n=a?t.offsetHeight:o,r=$c(i)!==s||$c(o)!==n;return r&&(i=s,o=n),{width:i,height:o,$:r}}function md(t){return Jc(t)?t:t.contextElement}function fd(t){const e=md(t);if(!Zc(e))return Dc(1);const i=e.getBoundingClientRect(),{width:o,height:a,$:s}=pd(e);let n=(s?$c(i.width):i.width)/o,r=(s?$c(i.height):i.height)/a;return n&&Number.isFinite(n)||(n=1),r&&Number.isFinite(r)||(r=1),{x:n,y:r}}const gd=Dc(0);function bd(t){const e=Xc(t);
vendor: 5,037 bytes, line 3135
3135return sd()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:gd}function vd(t,e,i,o){void 0===e&&(e=!1),void 0===i&&(i=!1);const a=t.getBoundingClientRect(),s=md(t);let n=Dc(1);e&&(o?Jc(o)&&(n=fd(o)):n=fd(t));const r=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Xc(t))&&e}(s,i,o)?bd(s):Dc(0);let l=(a.left+r.x)/n.x,h=(a.top+r.y)/n.y,c=a.width/n.x,d=a.height/n.y;if(s){const t=Xc(s),e=o&&Jc(o)?Xc(o):o;let i=t,a=ud(i);for(;a&&o&&e!==i;){const t=fd(a),e=a.getBoundingClientRect(),o=rd(a),s=e.left+(a.clientLeft+parseFloat(o.paddingLeft))*t.x,n=e.top+(a.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,h*=t.y,c*=t.x,d*=t.y,l+=s,h+=n,i=Xc(a),a=ud(i)}}return Uc({width:c,height:d,x:l,y:h})}function wd(t,e){const i=ld(t).scrollLeft;return e?e.left+i:vd(Gc(t)).left+i}function yd(t,e,i){void 0===i&&(i=!1);const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-(i?0:wd(t,o)),y:o.top+e.scrollTop}}function xd(t,e,i){let o;if("viewport"===e)o=function(t,e){const i=Xc(t),o=Gc(t),a=i.visualViewport;let s=o.clientWidth,n=o.clientHeight,r=0,l=0;if(a){s=a.width,n=a.height;const t=sd();(!t||t&&"fixed"===e)&&(r=a.offsetLeft,l=a.offsetTop)}return{width:s,height:n,x:r,y:l}}(t,i);else if("document"===e)o=function(t){const e=Gc(t),i=ld(t),o=t.ownerDocument.body,a=Ac(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=Ac(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let n=-i.scrollLeft+wd(t);const r=-i.scrollTop;return"rtl"===rd(o).direction&&(n+=Ac(e.clientWidth,o.clientWidth)-a),{width:a,height:s,x:n,y:r}}(Gc(t));else if(Jc(e))o=function(t,e){const i=vd(t,!0,"fixed"===e),o=i.top+t.clientTop,a=i.left+t.clientLeft,s=Zc(t)?fd(t):Dc(1);return{width:t.clientWidth*s.x,height:t.clientHeight*s.y,x:a*s.x,y:o*s.y}}(e,i);else{const i=bd(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Uc(o)}function kd(t,e){const i=hd(t);return!(i===e||!Jc(i)||nd(i))&&("fixed"===rd(i).position||kd(i,e))}function Cd(t,e,i){const o=Zc(e),a=Gc(e),s="fixed"===i,n=vd(t,!0,s,e);let r={scrollLeft:0,scrollTop:0};const l=Dc(0);function h(){l.x=wd(a)}if(o||!o&&!s)if(("body"!==Kc(e)||ed(a))&&(r=ld(e)),o){const t=vd(e,!0,s,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else a&&h();s&&!o&&a&&h();const c=!a||o||s?Dc(0):yd(a,r);return{x:n.left+r.scrollLeft-l.x-c.x,y:n.top+r.scrollTop-l.y-c.y,width:n.width,height:n.height}}function Sd(t){return"static"===rd(t).position}function _d(t,e){if(!Zc(t)||"fixed"===rd(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Gc(t)===i&&(i=i.ownerDocument.body),i}function Ed(t,e){const i=Xc(t);if(od(t))return i;if(!Zc(t)){let e=hd(t);for(;e&&!nd(e);){if(Jc(e)&&!Sd(e))return e;e=hd(e)}return i}let o=_d(t,e);for(;o&&id(o)&&Sd(o);)o=_d(o,e);return o&&nd(o)&&Sd(o)&&!ad(o)?i:o||function(t){let e=hd(t);for(;Zc(e)&&!nd(e);){if(ad(e))return e;if(od(e))return null;e=hd(e)}return null}(t)||i}const Ad={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:o,strategy:a}=t;const s="fixed"===a,n=Gc(o),r=!!e&&od(e.floating);if(o===n||r&&s)return i;let l={scrollLeft:0,scrollTop:0},h=Dc(1);const c=Dc(0),d=Zc(o);if((d||!d&&!s)&&(("body"!==Kc(o)||ed(n))&&(l=ld(o)),Zc(o))){const t=vd(o);h=fd(o),c.x=t.x+o.clientLeft,c.y=t.y+o.clientTop}const u=!n||d||s?Dc(0):yd(n,l,!0);return{width:i.width*h.x,height:i.height*h.y,x:i.x*h.x-l.scrollLeft*h.x+c.x+u.x,y:i.y*h.y-l.scrollTop*h.y+c.y+u.y}},getDocumentElement:Gc,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:o,strategy:a}=t;const s=[..."clippingAncestors"===i?od(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let o=dd(t,[],!1).filter(t=>Jc(t)&&"body"!==Kc(t)),a=null;const s="fixed"===rd(t).position;let n=s?hd(t):t;for(;Jc(n)&&!nd(n);){const e=rd(n),i=ad(n);i||"fixed"!==e.position||(a=null),(s?!i&&!a:!i&&"static"===e.position&&a&&["absolute","fixed"].includes(a.position)||ed(n)&&!i&&kd(t,n))?o=o.filter(t=>t!==n):a=e,n=hd(n)}return e.set(t,o),o}(e,this._c):[].concat(i),o],n=s[0],r=s.reduce((t,i)=>{const o=xd(e,i,a);return t.top=Ac(o.top,t.top),t.right=Ec(o.right,t.right),t.bottom=Ec(o.bottom,t.bottom),t.left=Ac(o.left,t.left),t},xd(e,n,a));return{width:r.right-r.left,height:r.bottom-r.top,x:r.left,y:r.top}},getOffsetParent:Ed,getElementRects:async function(t){const e=this.getOffsetParent||Ed,i=this.getDimensions,o=await i(t.floating);return{reference:Cd(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=pd(t);return{width:e,height:i}},getScale:fd,isElement:Jc,isRTL:function(t){return"rtl"===rd(t).direction}};function $d(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ld(t,e,i,o){void 0===o&&(o={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:n="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,h=md(t),c=a||s?[...h?dd(h):[],...dd(e)]:[];
vendor: 6,056 bytes, line 3135
3135c.forEach(t=>{a&&t.addEventListener("scroll",i,{passive:!0}),s&&t.addEventListener("resize",i)});const d=h&&r?function(t,e){let i,o=null;const a=Gc(t);function s(){var t;clearTimeout(i),null==(t=o)||t.disconnect(),o=null}return function n(r,l){void 0===r&&(r=!1),void 0===l&&(l=1),s();const h=t.getBoundingClientRect(),{left:c,top:d,width:u,height:p}=h;if(r||e(),!u||!p)return;const m={rootMargin:-Lc(d)+"px "+-Lc(a.clientWidth-(c+u))+"px "+-Lc(a.clientHeight-(d+p))+"px "+-Lc(c)+"px",threshold:Ac(0,Ec(1,l))||1};let f=!0;function g(e){const o=e[0].intersectionRatio;if(o!==l){if(!f)return n();o?n(!1,o):i=setTimeout(()=>{n(!1,1e-7)},1e3)}1!==o||$d(h,t.getBoundingClientRect())||n(),f=!1}try{o=new IntersectionObserver(g,{...m,root:a.ownerDocument})}catch(t){o=new IntersectionObserver(g,m)}o.observe(t)}(!0),s}(h,i):null;let u,p=-1,m=null;n&&(m=new ResizeObserver(t=>{let[o]=t;o&&o.target===h&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=m)||t.observe(e)})),i()}),h&&!l&&m.observe(h),m.observe(e));let f=l?vd(t):null;return l&&function e(){const o=vd(t);f&&!$d(f,o)&&i();f=o,u=requestAnimationFrame(e)}(),i(),()=>{var t;c.forEach(t=>{a&&t.removeEventListener("scroll",i),s&&t.removeEventListener("resize",i)}),null==d||d(),null==(t=m)||t.disconnect(),m=null,l&&cancelAnimationFrame(u)}}const Dd=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,o;const{x:a,y:s,placement:n,middlewareData:r}=e,l=await async function(t,e){const{placement:i,platform:o,elements:a}=t,s=await(null==o.isRTL?void 0:o.isRTL(a.floating)),n=Pc(i),r=Fc(i),l="y"===Vc(i),h=["left","top"].includes(n)?-1:1,c=s&&l?-1:1,d=Oc(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return r&&"number"==typeof m&&(p="end"===r?-1*m:m),l?{x:p*c,y:u*h}:{x:u*h,y:p*c}}(e,t);return n===(null==(i=r.offset)?void 0:i.placement)&&null!=(o=r.arrow)&&o.alignmentOffset?{}:{x:a+l.x,y:s+l.y,data:{...l,placement:n}}}}},Md=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:o,placement:a}=e,{mainAxis:s=!0,crossAxis:n=!1,limiter:r={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Oc(t,e),h={x:i,y:o},c=await jc(e,l),d=Vc(Pc(a)),u=Ic(d);let p=h[u],m=h[d];if(s){const t="y"===u?"bottom":"right";p=Tc(p+c["y"===u?"top":"left"],p,p-c[t])}if(n){const t="y"===d?"bottom":"right";m=Tc(m+c["y"===d?"top":"left"],m,m-c[t])}const f=r.fn({...e,[u]:p,[d]:m});return{...f,data:{x:f.x-i,y:f.y-o,enabled:{[u]:s,[d]:n}}}}}},zd=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,o;const{placement:a,middlewareData:s,rects:n,initialPlacement:r,platform:l,elements:h}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...g}=Oc(t,e);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const b=Pc(a),v=Vc(r),w=Pc(r)===r,y=await(null==l.isRTL?void 0:l.isRTL(h.floating)),x=u||(w||!f?[Hc(r)]:function(t){const e=Hc(t);return[Nc(t),e,Nc(e)]}(r)),k="none"!==m;!u&&k&&x.push(...function(t,e,i,o){const a=Fc(t);let s=function(t,e,i){const o=["left","right"],a=["right","left"],s=["top","bottom"],n=["bottom","top"];switch(t){case"top":case"bottom":return i?e?a:o:e?o:a;case"left":case"right":return e?s:n;default:return[]}}(Pc(t),"start"===i,o);return a&&(s=s.map(t=>t+"-"+a),e&&(s=s.concat(s.map(Nc)))),s}(r,f,m,y));const C=[r,...x],S=await jc(e,g),_=[];let E=(null==(o=s.flip)?void 0:o.overflows)||[];if(c&&_.push(S[b]),d){const t=function(t,e,i){void 0===i&&(i=!1);const o=Fc(t),a=Bc(t),s=Rc(a);let n="x"===a?o===(i?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[s]>e.floating[s]&&(n=Hc(n)),[n,Hc(n)]}(a,n,y);_.push(S[t[0]],S[t[1]])}if(E=[...E,{placement:a,overflows:_}],!_.every(t=>t<=0)){var A,$;const t=((null==(A=s.flip)?void 0:A.index)||0)+1,e=C[t];if(e){var L;const i="alignment"===d&&v!==Vc(e),o=(null==(L=E[0])?void 0:L.overflows[0])>0;if(!i||o)return{data:{index:t,overflows:E},reset:{placement:e}}}let i=null==($=E.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:$.placement;if(!i)switch(p){case"bestFit":{var D;const t=null==(D=E.filter(t=>{if(k){const e=Vc(t.placement);return e===v||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:D[0];t&&(i=t);break}case"initialPlacement":i=r}if(a!==i)return{reset:{placement:i}}}return{}}}},Td=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var i,o;const{placement:a,rects:s,platform:n,elements:r}=e,{apply:l=()=>{},...h}=Oc(t,e),c=await jc(e,h),d=Pc(a),u=Fc(a),p="y"===Vc(a),{width:m,height:f}=s.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=u===(await(null==n.isRTL?void 0:n.isRTL(r.floating))?"start":"end")?"left":"right"):(b=d,g="end"===u?"top":"bottom");const v=f-c.top-c.bottom,w=m-c.left-c.right,y=Ec(f-c[g],v),x=Ec(m-c[b],w),k=!e.middlewareData.shift;let C=y,S=x;if(null!=(i=e.middlewareData.shift)&&i.enabled.x&&(S=w),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(C=v),k&&!u){const t=Ac(c.left,0),e=Ac(c.right,0),i=Ac(c.top,0),o=Ac(c.bottom,0);p?S=m-2*(0!==t||0!==e?t+e:Ac(c.left,c.right)):C=f-2*(0!==i||0!==o?i+o:Ac(c.top,c.bottom))}await l({...e,availableWidth:S,availableHeight:C});const _=await n.getDimensions(r.floating);return m!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}},Od=t=>({name:"arrow",options:t,async fn(e){const{x:i,y:o,placement:a,rects:s,platform:n,elements:r,middlewareData:l}=e,{element:h,padding:c=0}=Oc(t,e)||{};if(null==h)return{};const d=qc(c),u={x:i,y:o},p=Bc(a),m=Rc(p),f=await n.getDimensions(h),g="y"===p,b=g?"top":"left",v=g?"bottom":"right",w=g?"clientHeight":"clientWidth",y=s.reference[m]+s.reference[p]-u[p]-s.floating[m],x=u[p]-s.reference[p],k=await(null==n.getOffsetParent?void 0:n.getOffsetParent(h));let C=k?k[w]:0;C&&await(null==n.isElement?void 0:n.isElement(k))||(C=r.floating[w]||s.floating[m]);
3135const S=y/2-x/2,_=C/2-f[m]/2-1,E=Ec(d[b],_),A=Ec(d[v],_),$=E,L=C-f[m]-A,D=C/2-f[m]/2+S,M=Tc($,D,L),z=!l.arrow&&null!=Fc(a)&&D!==M&&s.reference[m]/2-(D<$?E:A)-f[m]/2<0,T=z?D<$?D-$:D-L:0;return{[p]:u[p]+T,data:{[p]:M,centerOffset:D-M-T,...z&&{alignmentOffset:T}},reset:z}}}),Pd=(t,e,i)=>{const o=new Map,a={platform:Ad,...i},s={...a.platform,_c:o};return(async(t,e,i)=>{const{placement:o="bottom",strategy:a="absolute",middleware:s=[],platform:n}=i,r=s.filter(Boolean),l=await(null==n.isRTL?void 0:n.isRTL(e));let h=await n.getElementRects({reference:t,floating:e,strategy:a}),{x:c,y:d}=Wc(h,o,l),u=o,p={},m=0;for(let i=0;i<r.length;i++){const{name:s,fn:f}=r[i],{x:g,y:b,data:v,reset:w}=await f({x:c,y:d,initialPlacement:o,placement:u,strategy:a,middlewareData:p,rects:h,platform:n,elements:{reference:t,floating:e}});c=null!=g?g:c,d=null!=b?b:d,p={...p,[s]:{...p[s],...v}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(u=w.placement),w.rects&&(h=!0===w.rects?await n.getElementRects({reference:t,floating:e,strategy:a}):w.rects),({x:c,y:d}=Wc(h,u,l))),i=-1)}return{x:c,y:d,placement:u,strategy:a,middlewareData:p}})(t,e,{...a,platform:s})};function Fd(t){return Rd(t)}function Id(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Rd(t){for(let e=t;e;e=Id(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Id(t);e;e=Id(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||ad(t))return e;if("BODY"===e.tagName)return e}}return null}function Vd(t){return null!==t&&"object"==typeof t&&"getBoundingClientRect"in t&&(!("contextElement"in t)||t instanceof Element)}var Bd=Boolean(globalThis?.HTMLElement?.prototype.hasOwnProperty("popover")),Nd=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.SUPPORTS_POPOVER=!1,this.active=!1,this.placement="top",this.boundary="viewport",this.distance=0,this.skidding=0,this.arrow=!1,this.arrowPlacement="anchor",this.arrowPadding=10,this.flip=!1,this.flipFallbackPlacements="",this.flipFallbackStrategy="best-fit",this.flipPadding=0,this.shift=!1,this.shiftPadding=0,this.autoSizePadding=0,this.hoverBridge=!1,this.updateHoverBridge=()=>{if(this.hoverBridge&&this.anchorEl&&this.popup){const t=this.anchorEl.getBoundingClientRect(),e=this.popup.getBoundingClientRect();let i=0,o=0,a=0,s=0,n=0,r=0,l=0,h=0;this.placement.includes("top")||this.placement.includes("bottom")?t.top<e.top?(i=t.left,o=t.bottom,a=t.right,s=t.bottom,n=e.left,r=e.top,l=e.right,h=e.top):(i=e.left,o=e.bottom,a=e.right,s=e.bottom,n=t.left,r=t.top,l=t.right,h=t.top):t.left<e.left?(i=t.right,o=t.top,a=e.left,s=e.top,n=t.right,r=t.bottom,l=e.left,h=e.bottom):(i=e.right,o=e.top,a=t.left,s=t.top,n=e.right,r=e.bottom,l=t.left,h=t.bottom),this.style.setProperty("--hover-bridge-top-left-x",`${i}px`),this.style.setProperty("--hover-bridge-top-left-y",`${o}px`),this.style.setProperty("--hover-bridge-top-right-x",`${a}px`),this.style.setProperty("--hover-bridge-top-right-y",`${s}px`),this.style.setProperty("--hover-bridge-bottom-left-x",`${n}px`),this.style.setProperty("--hover-bridge-bottom-left-y",`${r}px`),this.style.setProperty("--hover-bridge-bottom-right-x",`${l}px`),this.style.setProperty("--hover-bridge-bottom-right-y",`${h}px`)}}}async connectedCallback(){super.connectedCallback(),await this.updateComplete,this.SUPPORTS_POPOVER=Bd,this.start()}disconnectedCallback(){super.disconnectedCallback(),this.stop()}async updated(t){super.updated(t),t.has("active")&&(this.active?this.start():this.stop()),t.has("anchor")&&this.handleAnchorChange(),this.active&&(await this.updateComplete,this.reposition())}async handleAnchorChange(){if(await this.stop(),this.anchor&&"string"==typeof this.anchor){const t=this.getRootNode();this.anchorEl=t.getElementById(this.anchor)}else this.anchor instanceof Element||Vd(this.anchor)?this.anchorEl=this.anchor:this.anchorEl=this.querySelector('[slot="anchor"]');this.anchorEl instanceof HTMLSlotElement&&(this.anchorEl=this.anchorEl.assignedElements({flatten:!0})[0]),this.anchorEl&&this.start()}start(){this.anchorEl&&this.active&&this.isConnected&&(this.popup?.showPopover?.(),this.cleanup=Ld(this.anchorEl,this.popup,()=>{this.reposition()}))}async stop(){return new Promise(t=>{this.popup?.hidePopover?.(),this.cleanup?(this.cleanup(),this.cleanup=void 0,this.removeAttribute("data-current-placement"),this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height"),requestAnimationFrame(()=>t())):t()})}reposition(){if(!this.active||!this.anchorEl||!this.popup)return;const t=[Dd({mainAxis:this.distance,crossAxis:this.skidding})];let e;this.sync?t.push(Td({apply:({rects:t})=>{const e="width"===this.sync||"both"===this.sync,i="height"===this.sync||"both"===this.sync;this.popup.style.width=e?`${t.reference.width}px`:"",this.popup.style.height=i?`${t.reference.height}px`:""}})):(this.popup.style.width="",this.popup.style.height=""),this.SUPPORTS_POPOVER&&!Vd(this.anchor)&&"scroll"===this.boundary&&(e=dd(this.anchorEl).filter(t=>t instanceof Element)),this.flip&&t.push(zd({boundary:this.flipBoundary||e,fallbackPlacements:this.flipFallbackPlacements,fallbackStrategy:"best-fit"===this.flipFallbackStrategy?"bestFit":"initialPlacement",padding:this.flipPadding})),this.shift&&t.push(Md({boundary:this.shiftBoundary||e,padding:this.shiftPadding})),this.autoSize?t.push(Td({boundary:this.autoSizeBoundary||e,padding:this.autoSizePadding,apply:({availableWidth:t,availableHeight:e})=>{"vertical"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-height",`${e}px`):this.style.removeProperty("--auto-size-available-height"),"horizontal"===this.autoSize||"both"===this.autoSize?this.style.setProperty("--auto-size-available-width",`${t}px`):this.style.removeProperty("--auto-size-available-width")}})):(this.style.removeProperty("--auto-size-available-width"),this.style.removeProperty("--auto-size-available-height")),this.arrow&&t.push(Od({element:this.arrowEl,padding:this.arrowPadding}));const i=this.SUPPORTS_POPOVER?t=>Ad.getOffsetParent(t,Fd):Ad.getOffsetParent;Pd(this.anchorEl,this.popup,{placement:this.placement,middleware:t,strategy:this.SUPPORTS_POPOVER?"absolute":"fixed",platform:{...Ad,getOffsetParent:i}}).then(({x:t,y:e,middlewareData:i,placement:o})=>{const a="rtl"===this.localize.dir(),s={top:"bottom",right:"left",bottom:"top",left:"r
3135ight"}[o.split("-")[0]];if(this.setAttribute("data-current-placement",o),Object.assign(this.popup.style,{left:`${t}px`,top:`${e}px`}),this.arrow){const t=i.arrow.x,e=i.arrow.y;let o="",n="",r="",l="";if("start"===this.arrowPlacement){const i="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";o="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"",n=a?i:"",l=a?"":i}else if("end"===this.arrowPlacement){const i="number"==typeof t?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:"";n=a?"":i,l=a?i:"",r="number"==typeof e?`calc(${this.arrowPadding}px - var(--arrow-padding-offset))`:""}else"center"===this.arrowPlacement?(l="number"==typeof t?"calc(50% - var(--arrow-size-diagonal))":"",o="number"==typeof e?"calc(50% - var(--arrow-size-diagonal))":""):(l="number"==typeof t?`${t}px`:"",o="number"==typeof e?`${e}px`:"");Object.assign(this.arrowEl.style,{top:o,right:n,bottom:r,left:l,[s]:"calc(var(--arrow-base-offset) - var(--arrow-size-diagonal))"})}}),requestAnimationFrame(()=>this.updateHoverBridge()),this.dispatchEvent(new Sc)}render(){return K` 3136 <slot name="anchor" @slotchange=${this.handleAnchorChange}></slot> 3137
3138 <span 3139 part="hover-bridge" 3140 class=${ce({"popup-hover-bridge":!0,"popup-hover-bridge-visible":this.hoverBridge&&this.active})} 3141 ></span> 3142 3143 <div 3144 popover="manual" 3145 part="popup" 3146 class=${ce({popup:!0,"popup-active":this.active,"popup-fixed":!this.SUPPORTS_POPOVER,"popup-has-arrow":this.arrow})} 3147 > 3148 <slot></slot> 3149 ${this.arrow?K`<div part="arrow" class="arrow" role="presentation"></div>`:""} 3150 </div> 3151 `}};Nd.css=_c,kt([Dt(".popup")],Nd.prototype,"popup",2),kt([Dt(".arrow")],Nd.prototype,"arrowEl",2),kt([At({attribute:!1,type:Boolean})],Nd.prototype,"SUPPORTS_POPOVER",2),kt([At()],Nd.prototype,"anchor",2),kt([At({type:Boolean,reflect:!0})],Nd.prototype,"active",2),kt([At({reflect:!0})],Nd.prototype,"placement",2),kt([At()],Nd.prototype,"boundary",2),kt([At({type:Number})],Nd.prototype,"distance",2),kt([At({type:Number})],Nd.prototype,"skidding",2),kt([At({type:Boolean})],Nd.prototype,"arrow",2),kt([At({attribute:"arrow-placement"})],Nd.prototype,"arrowPlacement",2),kt([At({attribute:"arrow-padding",type:Number})],Nd.prototype,"arrowPadding",2),kt([At({type:Boolean})],Nd.prototype,"flip",2),kt([At({attribute:"flip-fallback-placements",converter:{fromAttribute:t=>t.split(" ").map(t=>t.trim()).filter(t=>""!==t),toAttribute:t=>t.join(" ")}})],Nd.prototype,"flipFallbackPlacements",2),kt([At({attribute:"flip-fallback-strategy"})],Nd.prototype,"flipFallbackStrategy",2),kt([At({type:Object})],Nd.prototype,"flipBoundary",2),kt([At({attribute:"flip-padding",type:Number})],Nd.prototype,"flipPadding",2),kt([At({type:Boolean})],Nd.prototype,"shift",2),kt([At({type:Object})],Nd.prototype,"shiftBoundary",2),kt([At({attribute:"shift-padding",type:Number})],Nd.prototype,"shiftPadding",2),kt([At({attribute:"auto-size"})],Nd.prototype,"autoSize",2),kt([At()],Nd.prototype,"sync",2),kt([At({type:Object})],Nd.prototype,"autoSizeBoundary",2),kt([At({attribute:"auto-size-padding",type:Number})],Nd.prototype,"autoSizePadding",2),kt([At({attribute:"hover-bridge",type:Boolean})],Nd.prototype,"hoverBridge",2),Nd=kt([St("wa-popup")],Nd);var Hd=class extends Event{constructor(t){super("wa-options-error",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},qd=class extends Event{constructor(t){super("wa-options-request",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},Ud=class extends Event{constructor(t){super("wa-create",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=t}};function Wd(t,e,i="vertical",o="smooth"){const a=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left
3151:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),s=a.top+e.scrollTop,n=a.left+e.scrollLeft,r=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,h=e.scrollTop,c=e.scrollTop+e.offsetHeight;"horizontal"!==i&&"both"!==i||(n<r?e.scrollTo({left:n,behavior:o}):n+t.clientWidth>l&&e.scrollTo({left:n-e.offsetWidth+t.clientWidth,behavior:o})),"vertical"!==i&&"both"!==i||(s<h?e.scrollTo({top:s,behavior:o}):s+t.clientHeight>c&&e.scrollTo({top:s-e.offsetHeight+t.clientHeight,behavior:o}))}var jd=null,Yd=null;function Kd(t){const e=document.createElement("div");return e.setAttribute("role","log"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions"),Object.assign(e.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",border:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap"}),e}function Xd(t,e="polite"){if(!t)return;const i=function(t){return"assertive"===t?(Yd??(Yd=document.body.appendChild(Kd("assertive"))),Yd):(jd??(jd=document.body.appendChild(Kd("polite"))),jd)}(e),o=document.createElement("div");o.textContent=t,i.appendChild(o),setTimeout(()=>o.remove(),7e3)}var Gd=class extends Event{constructor(){super("wa-show",{bubbles:!0,cancelable:!0,composed:!0})}},Qd=class extends Event{constructor(t){super("wa-hide",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=t}},Jd=class extends Event{constructor(){super("wa-after-hide",{bubbles:!0,cancelable:!1,composed:!0})}},Zd=class extends Event{constructor(){super("wa-after-show",{bubbles:!0,cancelable:!1,composed:!0})}},tu=h` 3152 :host { 3153 --tag-max-size: 10ch; 3154 --show-duration: var(--wa-transition-fast); 3155 --hide-duration: var(--wa-transition-fast); 3156 3157 /* 3158 * The expand icon and spinner both read their cross-fade from these. The state rules below flip only the delay 3159 * and never re-declare the transition shorthand, so reduced motion can zero the duration in one place. 3160 */ 3161 --_spinner-fade-duration: var(--wa-transition-fast); 3162 --_spinner-fade-delay: 0s; 3163 } 3164 3165 /* Add ellipses to multi select options */ 3166 :host wa-tag::part(content) { 3167 display: initial; 3168 white-space: nowrap; 3169 text-overflow: ellipsis; 3170 overflow: hidden; 3171 max-width: var(--tag-max-size); 3172 } 3173 3174 :host .disabled, 3175 :host .disabled * { 3176 cursor: not-allowed; 3177 } 3178 3179 :host .disabled [part~='combobox'] { 3180 opacity: 0.5; 3181 outline: none; 3182 } 3183 3184 :host .enabled:is(.open, :focus-within) [part~='combobox'] { 3185 outline-color: var(--wa-color-focus); 3186 } 3187 3188 /** The popup */ 3189 .combobox-popup { 3190 flex: 1 1 auto; 3191 display: inline-flex; 3192 width: 100%; 3193 position: relative; 3194 vertical-align: middle; 3195 3196 /* Pass through from combobox to the popup */ 3197 --show-duration: inherit; 3198 --hide-duration: inherit; 3199 3200 &::part(popup) { 3201 z-index: 900; 3202 } 3203 3204 &[data-current-placement^='top']::part(popup) { 3205 transform-origin: bottom; 3206 } 3207 3208 &[data-current-placement^='bottom']::part(popup) { 3209 transform-origin: top; 3210 } 3211 } 3212 3213 /* Combobox container */ 3214 .combobox { 3215 flex: 1; 3216 display: flex; 3217 width: 100%; 3218 min-width: 0; 3219 align-items: center; 3220 justify-content: start; 3221 3222 min-height: var(--wa-form-control-height); 3223 3224 background-color: var(--wa-form-control-background-color); 3225 border-color: var(--wa-form-control-border-color); 3226 border-radius: var(--wa-form-control-border-radius); 3227 border-style: var(--wa-form-control-border-style); 3228 border-width: var(--wa-form-control-border-width); 3229 color: var(--wa-form-control-value-color); 3230 cursor: text; 3231 font-family: inherit; 3232 font-weight: var(--wa-form-control-value-font-weight); 3233 line-height: var(--wa-form-control-value-line-height); 3234 overflow: hidden; 3235 padding: 0 var(--wa-form-control-padding-inline); 3236 position: relative; 3237 vertical-align: middle; 3238 transition: 3239 background-color var(--wa-transition-normal), 3240 border-color var(--wa-transition-normal), 3241 outline-color var(--wa-transition-fast); 3242 transition-timing-function: var(--wa-transition-easing); 3243 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 3244 outline-offset: var(--wa-focus-ring-offset); 3245 3246 /* Pills */ 3247 :host([pill]) & { 3248 border-radius: var(--wa-border-radius-pill); 3249 } 3250 3251 :host([pill][multiple]) & { 3252 border-radius: 1.4em; 3253 } 3254 } 3255 3256 /* Appearance modifiers */ 3257 :host([appearance='outlined']) .combobox { 3258 background-color: var(--wa-form-control-background-color); 3259 border-color: var(--wa-form-control-border-color); 3260 } 3261 3262 :host([appearance='filled']) .combobox { 3263 background-color: var(--wa-color-neutral-fill-quiet); 3264 border-color: var(--wa-color-neutral-fill-quiet); 3265 } 3266 3267 :host([appearance='filled-outlined']) .combobox { 3268 background-color: var(--wa-color-neutral-fill-quiet); 3269 border-color: var(--wa-form-control-border-color); 3270 } 3271 3272 /* The editable input */ 3273 .combobox-input { 3274 position: relative; 3275 flex: 1 1 auto; 3276 width: auto; 3277 min-width: 50px; 3278 min-height: 1.5lh; 3279 font: inherit; 3280 border: none; 3281 background: none; 3282 line-height: var(--wa-form-control-value-line-height); 3283 color: var(--wa-form-control-value-color); 3284 cursor: text; 3285 overflow: hidden; 3286 padding: 0; 3287 margin: 0; 3288 -webkit-appearance: none; 3289 3290 &:focus { 3291 outline: none; 3292 } 3293 3294 &::placeholder { 3295 color: var(--wa-form-control-placeholder-color); 3296 } 3297 } 3298 3299 /* Manage spacing when tags are present */ 3300 :host([multiple]) { 3301 --_padding-with-tags: calc(var(--wa-form-control-height) * 0.1 - var(--wa-form-control-border-width)); 3302 3303 & .combobox:has(.tags wa-tag) { 3304 padding-block: var(--_padding-with-tags); 3305 padding-inline-start: var(--_padding-with-tags); 3306 3307 /* Share input space with tags */ 3308 & .combobox-input { 3309 flex: 1 1 auto; 3310 min-width: 10em; 3311 margin-inline-start: 0.25em; 3312 } 3313 } 3314 } 3315 3316 .value-input { 3317 position: absolute; 3318 z-index: -1; 3319 top: 0; 3320 left: 0; 3321 width: 100%; 3322 height: 100%; 3323 opacity: 0; 3324 padding: 0; 3325 margin: 0; 3326 } 3327 3328 .tags { 3329 display: flex; 3330 flex: 1;
3331 align-items: center; 3332 flex-wrap: wrap; 3333 gap: 0.25em; 3334 } 3335 3336 .tags wa-tag { 3337 cursor: pointer; 3338 } 3339 3340 /* Nested inside the box, so a step down from the box's radius */ 3341 .tags wa-tag:not([pill]) { 3342 border-radius: var(--wa-border-radius-s); 3343 } 3344 3345 .disabled .tags, 3346 .disabled .tags wa-tag { 3347 cursor: not-allowed; 3348 } 3349 3350 /* Start and End */ 3351 .start, 3352 .end { 3353 flex: 0 0 auto; 3354 display: inline-flex; 3355 align-items: center; 3356 color: var(--wa-color-neutral-on-quiet); 3357 } 3358 3359 .end::slotted(*) { 3360 margin-inline-start: var(--wa-form-control-padding-inline); 3361 } 3362 3363 .start::slotted(*) { 3364 margin-inline-end: var(--wa-form-control-padding-inline); 3365 } 3366 3367 :host([multiple]) .combobox:has(.tags wa-tag) .start::slotted(*) { 3368 margin-inline-start: calc(var(--wa-form-control-padding-inline) - var(--_padding-with-tags)); 3369 } 3370 3371 /* Clear button */ 3372 [part~='clear-button'] { 3373 display: inline-flex; 3374 align-items: center; 3375 justify-content: center; 3376 font-size: inherit; 3377 color: var(--wa-color-neutral-on-quiet); 3378 border: none; 3379 background: none; 3380 padding: 0; 3381 transition: color var(--wa-transition-normal); 3382 cursor: pointer; 3383 margin-inline-start: var(--wa-form-control-padding-inline); 3384 3385 &:focus { 3386 outline: none; 3387 } 3388 3389 @media (hover: hover) { 3390 &:hover { 3391 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 3392 } 3393 } 3394 3395 &:active { 3396 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 3397 } 3398 } 3399 3400 /* Expand icon */ 3401 .expand-icon { 3402 flex: 0 0 auto; 3403 display: flex;
3404 align-items: center; 3405 color: var(--wa-color-neutral-on-quiet); 3406 transition: 3407 rotate var(--wa-transition-slow) var(--wa-transition-easing), 3408 opacity var(--_spinner-fade-duration) var(--wa-transition-easing) var(--_spinner-fade-delay); 3409 rotate: 0deg; 3410 3411 .open & { 3412 rotate: -180deg; 3413 } 3414 } 3415 3416 /* The expand icon and spinner share one box and cross-fade, so swapping them can't shift the field's layout */ 3417 .trailing-affordance { 3418 flex: 0 0 auto; 3419 display: flex; 3420 align-items: center; 3421 position: relative; 3422 margin-inline-start: var(--wa-form-control-padding-inline); 3423 } 3424 3425 /* Out of flow, so only the expand icon determines the trailing affordance's size */ 3426 .spinner { 3427 position: absolute; 3428 inset-inline-start: 50%; 3429 inset-block-start: 50%; 3430 translate: -50% -50%; 3431 font-size: 1em; 3432 color: var(--wa-color-neutral-on-quiet); 3433 opacity: 0; 3434 pointer-events: none; 3435 transition: opacity var(--_spinner-fade-duration) var(--wa-transition-easing) var(--_spinner-fade-delay); 3436 } 3437 3438 /* Only the fade IN waits, so a request that resolves quickly never flashes a spinner */ 3439 :host(:state(loading)) { 3440 --_spinner-fade-delay: 300ms; 3441 } 3442 3443 :host(:state(loading)) .spinner { 3444 opacity: 1; 3445 } 3446 3447 :host(:state(loading)) .expand-icon { 3448 opacity: 0; 3449 } 3450 3451 /* The listbox's loading row already has a spinner; a second one in the field reads as two things loading */ 3452 :host(:state(showing-loading-row)) { 3453 --_spinner-fade-delay: 0s; 3454 } 3455 3456 :host(:state(showing-loading-row)) .spinner { 3457 opacity: 0; 3458 } 3459 3460 :host(:state(showing-loading-row)) .expand-icon { 3461 opacity: 1; 3462 } 3463 3464 /* No cross-fade, but keep the delay so quick responses still don't flash a spinner */ 3465 @media (prefers-reduced-motion: reduce) { 3466 :host { 3467 --_spinner-fade-duration: 0s; 3468 } 3469 } 3470 3471 /* Listbox */ 3472 .listbox { 3473 display: block; 3474 position: relative; 3475 font: inherit; 3476 box-shadow: var(--wa-shadow-m); 3477 background: var(--wa-color-surface-raised); 3478 border-color: var(--wa-color-surface-border); 3479 border-radius: var(--wa-border-radius-m); 3480 border-style: var(--wa-border-style); 3481 border-width: var(--wa-border-width-s); 3482 padding: 0.25em; 3483 overflow: auto;
3484 overscroll-behavior: none; 3485 3486 /* Make sure it adheres to the popup's auto size */ 3487 max-width: var(--auto-size-available-width); 3488 max-height: var(--auto-size-available-height); 3489 } 3490 3491 slot:not([name])::slotted(wa-divider) { 3492 --spacing: 0.5em; 3493 } 3494 3495 /* Space options with half the listbox's padding */ 3496 .listbox slot:not([name]) { 3497 display: flex; 3498 flex-direction: column; 3499 gap: 0.125em; 3500 } 3501 3502 /* 3503 * Status rows (loading, no results, empty, error). Outside role="listbox" so it never contains non-option children. 3504 * Padding and line-height mirror wa-option's so the popup keeps its height when options replace the row. Both 3505 * resolve from font-size, not --wa-form-control-height, which themes scale independently of an option's box. 3506 */ 3507 .status { 3508 display: flex; 3509 align-items: center; 3510 gap: 0.5em; 3511 padding-block: 0.5em; 3512 padding-inline: var(--wa-space-m); 3513 line-height: var(--wa-line-height-condensed); 3514 /* Not --wa-color-text-quiet: 3.77:1 on the raised surface fails WCAG AA, and this is the listbox's only content */ 3515 color: var(--wa-color-text-normal); 3516 user-select: none; 3517 -webkit-user-select: none; 3518 } 3519 3520 .status-spinner { 3521 font-size: 1em; 3522 flex: 0 0 auto; 3523 } 3524 3525 slot:not([name])::slotted(small) { 3526 display: block; 3527 font-size: var(--wa-font-size-smaller); 3528 font-weight: var(--wa-font-weight-semibold); 3529 color: var(--wa-color-text-quiet); 3530 padding-block: 0.5em; 3531 padding-inline: 2.25em; 3532 } 3533 3534 /* Hide filtered-out elements */ 3535 slot:not([name])::slotted([hidden]) { 3536 display: none !important; 3537 } 3538 3539 /* The element that actually carries role="listbox" is a transparent wrapper around the default slot. */ 3540 .listbox-options { 3541 display: block; 3542 } 3543`;class eu extends he{constructor(t){if(super(t),this.it=J,t.type!==se)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===J||null==t)return this._t=void 0,this.it=t;if(t===Q)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}eu.directiveName="unsafeHTML",eu.resultType=1;const iu=le(eu);var ou=0,au="data-retained-option",su=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["blur","input"],this.createOptionEl=null,this.hasInputSinceOpening=!1,this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.listboxId="wa-combobox-listbox-"+ ++ou,this.selectionOrder=new Map,this.slotChangePending=!1,this.cachedOptions=null,this.abortController=null,this.requestToken=0,this.lastRequestedQuery=null,this.hasRequestError=!1,this.isComposing=!1,this.appliedMarkup=[],this.selectedOptions=[],this.filteredOptions=[],this.inputValue="",this.name="",this._defaultValue=null,this.size="m",this.placeholder="",this.multiple=!1,this.maxOptionsVisible=3,this.disabled=!1,this.withClear=!1,this.open=!1,this.appearance="outlined",this.pill=!1,this.label="",this.placement="bottom",this.hint="",this.withLabel=!1,this.withHint=!1,this.required=!1,this.allowCustomValue=!1,this.allowCreate=!1,this.filter=null,this.dataSource=null,this.server=!1,this.loading=!1,this.filterDebounce=250,this.spellcheck=!1,this.getTag=t=>K` 3544 <wa-tag 3545 part="tag" 3546 exportparts=" 3547 base:tag__base, 3548 content:tag__content, 3549 remove-button:tag__remove-button, 3550 remove-button__base:tag__remove-button__base 3551 " 3552 ?pill=${this.pill} 3553 size=${this.size} 3554 with-remove 3555 data-value=${t.value} 3556 @wa-remove=${e=>this.handleTagRemove(e,t)} 3557 > 3558 ${t.label} 3559 </wa-tag> 3560 `,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,i=null!==e.closest('[part~="clear-button"]'),o=null!==e.closest("wa-button");if(!i&&!o){if("Escape"===t.key&&this.open&&qh(this))return t.preventDefault(),t.stopPropagation(),this.hide(),!this.multiple&&this.selectedOptions.length>0?this.inputValue=this.selectedOptions[0].label:this.multiple||(this.inputValue=""),void this.comboboxInput.focus({preventScroll:!0});if("Enter"===t.key){if(t.preventDefault(),t.stopImmediatePropagation(),!this.open)return void this.show();if(this.currentOption&&this.handleCreateOptionSelected(this.currentOption))return;const e=this.currentOption;return void(e?(this.valueHasChanged=!0,this.hasInteracted=!0,this.multiple?(this.toggleOptionSelection(e),this.inputValue="",this.updateFilteredOptions()):(this.setSelectedOptions(e),this.inputValue=e.label),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.multiple||(this.hide(),this.comboboxInput.focus({preventScroll:!0}))):this.allowCustomValue&&!this.multiple&&this.inputValue&&(this.value=this.inputValue,this.valueHasChanged=!0,this.hasInteracted=!0,this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hide(),this.comboboxInput.focus({preventScroll:!0})))}if("Backspace"===t.key&&this.multiple&&!this.inputValue&&this.selectedOptions.length>0){t.preventDefault(),this.hasInteracted=!0,this.valueHasChanged=!0;const e=this.selectedOptions[this.selectedOptions.length-1];return this.toggleOptionSelection(e,!1),void this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getVisibleOptions(),i=this.currentOption?e.indexOf(this.currentOption):-1;let o=Math.max(0,i);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;if(0===e.length)return;"ArrowDown"===t.key?(o=i+1,o>e.length-1&&(o=0)):"ArrowUp"===t.key?(o=i-1,o<0&&(o=e.length-1)):"Home"===t.key?o=0:"End"===t.key&&(o=e.length-1),e[o]&&(this.setCurrentOption(e[o]),this.announceOption(e[o]))}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}static get validators(){const t=[Mh({validationElement:Object.assign(document.createElement("select"),{required:!0})})];return[...super.validators,...t]}rawValuesEqual(t,e){return null==t&&null==e||null!=t&&null!=e&&(t.length===e.length&&t.every((t,i)=>t===e[i]))}get validationTarget(){return this.valueInput}get currentOption(){const t=this._currentOption;return!t?.isConnected||t.hidden||t.disabled?void 0:t}set currentOption(t){this._currentOption=t}set defaultValue(t){this._defaultValue=this.convertDefaultValue(t)}get defaultValue(){return this.convertDefaultValue(this._defaultValue)}convertDefaultValue(t){return!(this.multiple||this.hasAttribute("multiple"))&&Array.isArray(t)&&(t=t[0]),t}set value(t){let e=this.value;t instanceof FormData&&(t=t.getAll(this.name)),null==t||Array.isArray(t)||(t=[t]);const i=this._value;this._value=t??null,this.rawValuesEqual(i,this._value)||(this.valueHasChanged=!0,this.requestUpdate("value",e))}get value(){let t=this._value??this.defaultValue??null;null!=t&&(t=Array.isArray(t)?t:[t]),this.optionValues=new Set(this.getRealOptions().filter(t=>!t.disabled).map(t=>t.value));let e=t;return null!=t&&(e=this.allowCustomValue?t:t.filter(t=>this.optionValues.has(t)),e=this.multiple?e:e[0],e=e??null),e}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.processSlotChange(),this.open=!1}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.removeCreateOption(),this.cancelOptionsRequest(),this.cachedOptions=null}updateFormValue(t){null!=t?super.updateFormValue(t):this.setValue("",null)}updateDefaultValue(){const t=this.getRealOptions().filter(t=>t.hasAttribute("selected")||t.defaultSelected);if(t.length>0){const e=t.map(t=>t.value);this._defaultValue=this.multiple?e:e[0]}this.hasAttribute("value")&&(this._defaultValue=this.getAttribute("value")||null)}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),Nh(this),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),Hh(this),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.comboboxInput.select()}handleBlur(){if(!this.multiple)if(this.inputValue)if(this.allowCustomValue){const t=this.value;this.value=this.inputValue,this.hasInteracted=!0,this.value!==t&&(this.valueHasChanged=!0,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}
3560))}else this.selectedOptions.length>0&&(this.inputValue=this.selectedOptions[0].label);else null!==this.value&&(this.selectionOrder.clear(),this.setSelectedOptions([]),this.hasInteracted=!0,this.valueHasChanged=!0,this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}));this.open||(this.removeCreateOption(),this.cancelOptionsRequest())}handleLabelClick(){this.comboboxInput.focus(),this.show()}handleComboboxClick(t){t.preventDefault()}handleComboboxMouseDown(t){const e=t.composedPath().some(t=>t instanceof Element&&"wa-button"===t.tagName.toLowerCase());this.disabled||e||(t.preventDefault(),this.comboboxInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleCompositionStart(){this.isComposing=!0}handleCompositionEnd(){this.isComposing=!1,this.isServerMode&&this.requestOptions({debounce:!0})}handleInputChange(t){t.stopPropagation();const e=t.target;this.inputValue=e.value,this.hasInputSinceOpening=!0,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.updateFilteredOptions();const i=this.getVisibleOptions(),o=i.length>0;this.isServerMode?(!this.inputValue||this.open||this.allowCustomValue||this.show(),this.setCurrentOption(null),this.requestOptions({debounce:!0})):(this.inputValue.length>0&&!this.open?(o||!this.allowCustomValue||this.loading)&&this.show():this.open&&!o&&this.allowCustomValue&&!this.loading&&this.hide(),o&&this.open&&this.setCurrentOption(i[0])),this.announceFilterResults(),!this.isServerMode&&this.open&&this.currentOption&&this.announceOption(this.currentOption)}handleClearClick(t){t.stopPropagation(),this.hasInteracted=!0,(null!==this.value||this.inputValue)&&(this.selectionOrder.clear(),this.setSelectedOptions([]),this.inputValue="",this.updateFilteredOptions(),this.comboboxInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.dispatchEvent(new kc),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("wa-option");if(e&&!e.disabled){if(this.handleCreateOptionSelected(e))return void this.updateComplete.then(()=>this.comboboxInput.focus({preventScroll:!0}));this.hasInteracted=!0,this.valueHasChanged=!0,this.multiple?(this.toggleOptionSelection(e),this.inputValue="",this.updateFilteredOptions()):(this.setSelectedOptions(e),this.inputValue=e.label),this.updateComplete.then(()=>this.comboboxInput.focus({preventScroll:!0})),this.requestUpdate("value"),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.multiple||(this.hide(),this.comboboxInput.focus({preventScroll:!0}))}}handleDefaultSlotChange(){this.slotChangePending||(this.slotChangePending=!0,queueMicrotask(()=>{this.slotChangePending=!1,this.processSlotChange()}))}processSlotChange(){if(!this.querySelectorAll)return;if(!customElements.get("wa-option"))return void customElements.whenDefined?.("wa-option").then(()=>this.handleDefaultSlotChange());const t=this.selectedOptions;this.cachedOptions=null,this.retainSelections(t),this.updateDefaultValue();let e=this.value;if(null==e||!this.valueHasChanged&&!this.hasInteracted)this.pruneStandIns(),this.selectionChanged();else{Array.isArray(e)||(e=[e]);const t=e;this.setSelectedOptions(this.getAllOptions().filter(e=>t.includes(e.value)))}this.open||this.updateFilteredOptions({skipCreateOption:!0}),!this.isServerMode||this.dataSource||!this.open||this.loading||this.currentOption||this.finishOptionsChange()}handleTagRemove(t,e){if(t.stopPropagation(),this.disabled)return;this.hasInteracted=!0,this.valueHasChanged=!0;let i=e;if(!i){const e=t.target.closest("wa-tag[data-value]");if(e){const t=e.dataset.value;i=this.selectedOptions.find(e=>e.value===t)}}i&&(this.toggleOptionSelection(i,!1),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}
3560))}getAllOptions(){return this.cachedOptions?this.cachedOptions:this?.querySelectorAll?(this.cachedOptions=[...this.querySelectorAll("wa-option")],this.cachedOptions):[]}getRealOptions(){return this.getAllOptions().filter(t=>!t.hasAttribute("data-create-option"))}get isServerMode(){return this.server||null!==this.dataSource}get currentQuery(){return this.hasInputSinceOpening?this.inputValue:""}requestOptions({debounce:t=!1,force:e=!1}={}){if(this.isServerMode&&this.isConnected&&!this.disabled&&!this.isComposing&&(e||this.currentQuery!==this.lastRequestedQuery)){if(clearTimeout(this.debounceTimer),this.loading=!0,!(t&&this.filterDebounce>0))return this.sendRequest();this.debounceTimer=setTimeout(()=>{this.sendRequest()},this.filterDebounce)}}async sendRequest(){if(!this.isServerMode||!this.isConnected)return;const t=this.currentQuery;this.lastRequestedQuery=t,this.hasRequestError=!1,this.abortController?.abort();const e=new AbortController;this.abortController=e;const i=++this.requestToken;this.loading=!0,clearTimeout(this.loadingAnnounceTimer),this.loadingAnnounceTimer=setTimeout(()=>{this.loading&&this.announce(this.localize.term("loading"))},1e3);const o={query:t,signal:e.signal};if(this.dispatchEvent(new qd(o)),!this.dataSource)return;let a=[];try{a=this.toElements(await this.dataSource(o))}catch(o){if(i!==this.requestToken||e.signal.aborted)return;this.hasRequestError=!0,this.lastRequestedQuery=null,this.dispatchEvent(new Hd({error:o,request:{query:t}})),console.error("<wa-combobox> dataSource request failed:",o)}i===this.requestToken&&(this.loading=!1,clearTimeout(this.loadingAnnounceTimer),this.applyOptions(a))}async reload(){this.isServerMode&&await this.requestOptions({force:!0})}cancelOptionsRequest(){clearTimeout(this.debounceTimer),clearTimeout(this.loadingAnnounceTimer),this.abortController?.abort(),this.abortController=null,this.requestToken++,this.lastRequestedQuery=null,this.loading=!1}toElements(t){if("string"==typeof t){const e=document.createElement("template");return e.innerHTML=t,[...e.content.children].filter(t=>t instanceof HTMLElement&&"script"!==t.localName)}if(!Array.isArray(t))throw new TypeError("A dataSource must resolve with an array of { value, label } objects, a string of HTML, or an array of elements.");return t.map(t=>{if(t instanceof HTMLElement)return t;const e=document.createElement("wa-option");return e.setAttribute("value",String(t.value)),e.textContent=t.label??"",e.toggleAttribute("disabled",!0===t.disabled),e})}applyOptions(t){const e=new Set,i=[];for(const o of t){if("wa-option"===o.localName){const t=o.getAttribute("value");if(!t||e.has(t)){console.warn(`<wa-combobox> ignored a dataSource option with ${t?`a duplicate value "${t}"`:"no value"}.`);continue}e.add(t)}else"wa-divider"===o.localName?o.setAttribute("aria-hidden","true"):o.hasAttribute("role")||o.setAttribute("role","presentation");i.push(o)}const o=[...this.children].filter(t=>!t.hasAttribute("slot")&&t!==this.createOptionEl&&!t.hasAttribute(au)),a=i.map(t=>t.outerHTML),s=i.length===o.length&&i.every((t,e)=>t===o[e]||a[e]===this.appliedMarkup[e]);if(this.appliedMarkup=a,s)return void this.finishOptionsChange();const n=this.selectedOptions,r=this._currentOption?.value??null;for(const t of o)t.remove();for(const t of i)this.appendChild(t);this.cachedOptions=null;for(const t of this.getRealOptions())n.some(e=>e.value===t.value)&&(t.selected=!0,t.setAttribute("aria-selected","true"));this.retainSelections(n),this.pruneStandIns(),this.selectionChanged(),this.finishOptionsChange(r)}retainSelections(t){if(!this.isServerMode)return;const e=new Set(this.getRealOptions().map(t=>t.value));for(const i of t){if(e.has(i.value))continue;const t=document.createElement("wa-option");t.setAttribute(au,""),t.value=i.value,t.textContent=i.label,t.hidden=!0,t.selected=!0,this.appendChild(t),e.add(i.value),this.cachedOptions=null}}pruneStandIns(){const t=this.getAllOptions();for(const e of t){if(!e.hasAttribute(au))continue;const i=t.find(t=>t.value===e.value&&!t.hasAttribute(au));i&&e.selected&&(i.selected=!0),!i&&e.selected||(e.remove(),this.cachedOptions=null)}}finishOptionsChange(t=this._currentOption?.value??null){this.updateFilteredOptions(),this.announceFilterResults(),this.reseatCurrentOption(t),this.syncOpenStateAfterResponse(),this.requestUpdate()}reseatCurrentOption(t){if(!this.open)return void this.setCurrentOption(null);const e=this.getVisibleOptions(),i=this.hasInputSinceOpening?e[0]:e.find(e=>e.value===t)??e.find(t=>t.selected)??e[0];this.setCurrentOption(i??null),i&&i.value!==t&&this.announceOption(i)}syncOpenStateAfterResponse(){if(!this.isServerMode||!this.allowCustomValue||!this.hasInputSinceOpening||this.hasRequestError)return;const t=this.getVisibleOptions().length>0;this.open?t||!this.currentQuery||this.loading||this.hide():t&&this.matches(":focus-within")&&this.show()}updateCreateOption(){if(!this.allowCreate)return void this.removeCreateOption();const t=this.inputValue.trim(),e=this.getRealOptions().some(e=>e.label.toLowerCase()===t.toLowerCase());t&&!e?(this.createOptionEl||(this.createOptionEl=document.createElement("wa-option"),this.createOptionEl.setAttribute("data-create-option","")),this.createOptionEl.value=t,this.createOptionEl.textContent=this.localize.term("createOption",t),this.createOptionEl.hidden=!1,this.createOptionEl.parentElement!==this&&this.prepend(this.createOptionEl)):this.removeCreateOption()}removeCreateOption(){this.createOptionEl&&(this.createOptionEl.remove(),this.createOptionEl=null)}handleCreateOptionSelected(t){if(!t.hasAttribute("data-create-option"))return!1;const e=this.createOptionEl?.value||this.inputValue.trim(),i=new Ud({inputValue:e});if(this.dispatchEvent(i),i.defaultPrevented)return this.removeCreateOption(),!0;this.removeCreateOption();const o=document.createElement("wa-option");return o.value=e,o.textContent=e,this.prepend(o),this.cachedOptions=null,this.hasInteracted=!0,this.valueHasChanged=!0,this.multiple?(this.toggleOptionSelection(o,!0),this.inputValue="",this.updateFilteredOptions(),this.setCurrentOption(o)):(this.setSelectedOptions(o),this.inputValue=e),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.multiple||(this.hide(),this.comboboxInput.focus({preventScroll:!0})),!0}getVisibleOptions(){const t=t=>t.isConnected&&!t.disabled;if(this.isServerMode)return this.getAllOptions().filter(e=>t(e)&&!e.hidden);return!!this.inputValue&&this.hasInputSinceOpening?this.filteredOptions.filter(t):this.getAllOptions().filter(t)}getFirstVisibleOption(){return this.getVisibleOptions()[0]}updateFilteredOptions({skipCreateOption:t=!1}={}){const e=this.getAllOptions();if(this.isServerMode)return this.filteredOptions=e.filter(t=>!t.hidden),t||this.updateCreateOption(),void(this.createOptionEl&&!this.createOptionEl.hidden&&this.filteredOptions.unshift(this.createOptionEl));const i=!!this.inputValue&&this.hasInputSinceOpening;if(this.querySelectorAll(":scope > :not(wa-option)").forEach(t=>{t.hidden=i}),!i)return this.filteredOptions=e,e.forEach(t=>{t.hidden=!1}),t||this.updateCreateOption(),void(this.createOptionEl&&!this.createOptionEl.hidden&&this.filteredOptions.unshift(this.createOptionEl));const o=this.inputValue.toLowerCase();this.filteredOptions=e.filter(t=>{if(t.hasAttribute("data-create-option"))return!1;let e;return e=this.filter?this.filter(t,this.inputValue):t.label.toLowerCase().includes(o),t.hidden=!e,e}),this.querySelectorAll(":scope > :not(wa-option):not(wa-divider)").forEach(t=>{let e=!1,i=t.nextElementSibling;for(;i&&(i.matches("wa-option")||i.matches("wa-divider"));){if(i.matches("wa-option")&&!i.hidden){e=!0;break}i=i.nextElementSibling}t.hidden=!e}),this.querySelectorAll(":scope > wa-divider").forEach(t=>{let e=!1,i=!1,o=t.previousElementSibling;for(;o;){if(o.matches("wa-option")&&!o.hidden){e=!0;break}o=o.previousElementSibling}for(o=t.nextElementSibling;o;){if(o.matches("wa-option")&&!o.hidden){i=!0;break}o=o.nextElementSibling}t.hidden=!e||!i}),t||this.updateCreateOption(),this.createOptionEl&&!this.createOptionEl.hidden&&this.filteredOptions.unshift(this.createOptionEl)}
3560setCurrentOption(t){this.getAllOptions().forEach(t=>{t.current=!1,t.tabIndex=-1}),t?(this.currentOption=t,t.current=!0,t.tabIndex=0,Wd(t,this.listbox,"vertical","auto")):this.currentOption=void 0}setSelectedOptions(t){const e=this.getAllOptions(),i=Array.isArray(t)?t:[t];e.forEach(t=>{i.includes(t)||(t.selected=!1)}),i.length&&i.forEach(t=>t.selected=!0),this.pruneStandIns(),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.pruneStandIns(),this.selectionChanged()}announceOption(t){const e=this.getVisibleOptions();this.announce(this.localize.term("optionPosition",t.label,e.indexOf(t)+1,e.length))}announce(t){Xd(t)}statusAnnouncement(t){return[...this.querySelectorAll(`:scope > [slot="${t}"]`)].map(t=>t.textContent??"").join(" ").replace(/\s+/g," ").trim()||this.statusText(t)}announceFilterResults(){if(this.loading)return;const t=this.getVisibleOptions().length;t>0?this.announce(this.localize.term("numOptionsAvailable",t)):this.announce(this.statusAnnouncement(this.hasRequestError?"error":this.currentQuery?"no-results":"empty"))}selectionChanged(){const t=this.getAllOptions().filter(t=>{if(!this.hasInteracted&&!this.valueHasChanged){const e=this.defaultValue,i=Array.isArray(e)?e:[e];return t.hasAttribute("selected")||t.defaultSelected||t.selected||i?.includes(t.value)}return t.selected}),e=new Set(t.map(t=>t.value));for(const t of this.selectionOrder.keys())e.has(t)||this.selectionOrder.delete(t);let i=(this.selectionOrder.size>0?Math.max(...this.selectionOrder.values()):-1)+1;for(const e of t)this.selectionOrder.has(e.value)||this.selectionOrder.set(e.value,i++);this.selectedOptions=t.sort((t,e)=>(this.selectionOrder.get(t.value)??0)-(this.selectionOrder.get(e.value)??0));let o=new Set(this.selectedOptions.map(t=>t.value));if(o.size>0||this._value){const t=this._value;if(null==this._value){let t=this.defaultValue??[];this._value=Array.isArray(t)?t:[t]}this._value=this._value?.filter(t=>!this.optionValues?.has(t))??null,this._value?.unshift(...o),this.requestUpdate("value",t)}if(!this.multiple&&this.selectedOptions.length>0&&!this.hasInputSinceOpening){const t=this.comboboxInput&&this.matches(":focus-within");this.hasInteracted&&(this.inputValue||t)||(this.inputValue=this.selectedOptions[0].label)}this.updateComplete.then(()=>{this.updateValidity()})}get tags(){return this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const i=this.getTag(t,e);return i?"string"==typeof i?iu(i):i:null}return e===this.maxOptionsVisible?K` 3561 <wa-tag 3562 part="tag" 3563 exportparts=" 3564 base:tag__base, 3565 content:tag__content, 3566 remove-button:tag__remove-button, 3567 remove-button__base:tag__remove-button__base 3568 " 3569 ?pill=${this.pill} 3570 size=${this.size} 3571 >+${this.selectedOptions.length-e}</wa-tag 3572 > 3573 `:null})}updated(t){super.updated(t),(t.has("value")||t.has("inputValue"))&&this.customStates.set("blank",!this.value&&!this.inputValue),t.has("disabled")&&this.customStates.set("disabled",this.disabled),t.has("loading")&&this.customStates.set("loading",this.loading),this.customStates.set("showing-loading-row",this.open&&"loading"===this.listboxState)}handleDisabledChange(){this.disabled&&this.open&&(this.open=!1),this.disabled&&this.cancelOptionsRequest()}handleDataSourceChange(){this.isServerMode?this.open&&this.requestOptions({force:!0}):(this.cancelOptionsRequest(),this.hasRequestError=!1,this.updateFilteredOptions())}handleLoadingChange(){this.loading||(clearTimeout(this.loadingAnnounceTimer),this.isServerMode&&!this.dataSource&&(this.cachedOptions=null,this.finishOptionsChange()))}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],i=t.filter(t=>e.includes(t.value));this.setSelectedOptions(i),this.updateValidity()}async handleOpenChange(){if(this.open&&!this.disabled){const t=this.isServerMode&&this.hasInputSinceOpening;if(this.isServerMode&&!t&&this.requestOptions({force:!0}),t)this.setCurrentOption(null);else{const t=this.selectedOptions.find(t=>!t.hasAttribute(au));this.setCurrentOption(t||this.getFirstVisibleOption()||null)}this.updateFilteredOptions();const e=new Gd;if(this.dispatchEvent(e),e.defaultPrevented)return void(this.open=!1);this.addOpenListeners(),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.currentOption&&this.setCurrentOption(this.currentOption)}),await qt(this.popup.popup,"show"),this.currentOption&&Wd(this.currentOption,this.listbox,"vertical","auto"),this.isServerMode||this.announceFilterResults(),this.currentOption&&this.announceOption(this.currentOption),this.dispatchEvent(new Zd)}else{const t=new Qd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);this.hasInputSinceOpening=!1,this.cancelOptionsRequest(),this.hasRequestError=!1,this.removeOpenListeners(),await qt(this.popup.popup,"hide"),this.listbox.hidden=!0,this.popup.active=!1,this.setCurrentOption(null),this.removeCreateOption(),this.dispatchEvent(new Jd)}}async show(){if(this.open||this.disabled)this.open=!1;else if(0!==this.getVisibleOptions().length||this.allowCreate&&this.inputValue.trim()||this.isServerMode||!this.allowCustomValue||!this.currentQuery)return this.open=!0,Nt(this,"wa-after-show")}
3573async hide(){if(this.open&&!this.disabled)return this.open=!1,Nt(this,"wa-after-hide");this.open=!1}focus(t){this.comboboxInput.focus(t)}blur(){this.comboboxInput.blur()}formResetCallback(){this.selectionOrder.clear(),this.value=this.defaultValue,super.formResetCallback(),this.handleValueChange(),!this.multiple&&this.selectedOptions.length>0?this.inputValue=this.selectedOptions[0].label:this.inputValue="",this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}get listboxState(){return this.hasUpdated?this.getVisibleOptions().length>0?null:this.loading?"loading":this.hasRequestError?"error":this.currentQuery?"no-results":"empty":null}statusText(t){return this.localize.term({loading:"loading",error:"optionsLoadError","no-results":"noResults",empty:"noOptions"}[t])}render(){const t=this.listboxState,e=this.hasUpdated?this.hasSlotController.test("label"):this.withLabel,i=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,o=!!this.label||!!e,a=!!this.hint||!!i,s=!!this.hasUpdated&&this.withClear&&!this.disabled&&(this.value&&(!Array.isArray(this.value)||this.value.length>0)||this.inputValue);return K` 3574 <div 3575 part="form-control" 3576 class=${ce({"form-control":!0,"form-control-has-label":o})} 3577 > 3578 <label 3579 id="label" 3580 part="form-control-label label" 3581 class=${ce({label:!0,"has-label":o})} 3582 aria-hidden=${o?"false":"true"} 3583 @click=${this.handleLabelClick} 3584 > 3585 <slot name="label">${this.label}</slot> 3586 </label> 3587 3588 <div part="form-control-input" class="form-control-input"> 3589 <wa-popup 3590 class=${ce({"combobox-popup":!0,open:this.open,disabled:this.disabled,enabled:!this.disabled,multiple:this.multiple})} 3591 placement=${this.placement} 3592 flip 3593 shift 3594 sync="width" 3595 auto-size="vertical" 3596 auto-size-padding="10" 3597 > 3598 <div 3599 part="combobox" 3600 class="combobox" 3601 slot="anchor" 3602 @keydown=${this.handleComboboxKeyDown} 3603 @mousedown=${this.handleComboboxMouseDown} 3604 @click=${this.handleComboboxClick} 3605 > 3606 <slot part="start" name="start" class="start"></slot> 3607 3608 ${this.multiple&&this.hasUpdated?K` 3609 <div part="tags" class="tags" @wa-remove=${this.handleTagRemove}> 3610 ${this.tags} 3611 <input 3612 part="combobox-input" 3613 class="combobox-input" 3614 type="text" 3615 placeholder=${this.placeholder} 3616 .disabled=${this.disabled} 3617 .value=${this.inputValue} 3618 ?required=${this.required} 3619 autocomplete="off" 3620 autocapitalize=${We(this.autocapitalize)} 3621 autocorrect=${this.autocorrect?"on":"off"} 3622 spellcheck=${this.spellcheck} 3623 inputmode=${We(this.inputmode)} 3624 enterkeyhint=${We(this.enterkeyhint)} 3625 role="combobox" 3626 aria-autocomplete="list" 3627 aria-controls=${this.listboxId} 3628 aria-expanded=${this.open?"true":"false"} 3629 aria-haspopup="listbox" 3630 aria-labelledby="label" 3631 aria-disabled=${this.disabled?"true":"false"} 3632 aria-describedby="hint" 3633 aria-invalid=${!this.validity.valid} 3634 tabindex="0" 3635 @input=${this.handleInputChange} 3636 @compositionstart=${this.handleCompositionStart} 3637 @compositionend=${this.handleCompositionEnd} 3638 @focus=${this.handleFocus} 3639 @blur=${this.handleBlur} 3640 /> 3641 </div> 3642 `:K` 3643 <input 3644 part="combobox-input" 3645 class="combobox-input" 3646 type="text" 3647 placeholder=${this.placeholder} 3648 .disabled=${this.disabled} 3649 .value=${this.inputValue} 3650 ?required=${this.required} 3651 autocomplete="off" 3652 autocapitalize=${We(this.autocapitalize)} 3653 autocorrect=${this.autocorrect?"on":"off"} 3654 spellcheck=${this.spellcheck} 3655 inputmode=${We(this.inputmode)} 3656 enterkeyhint=${We(this.enterkeyhint)} 3657 role="combobox" 3658 aria-autocomplete="list" 3659 aria-controls=${this.listboxId} 3660 aria-expanded=${this.open?"true":"false"} 3661 aria-haspopup="listbox" 3662 aria-labelledby="label" 3663 aria-disabled=${this.disabled?"true":"false"} 3664 aria-describedby="hint" 3665 aria-invalid=${!this.validity.valid} 3666 tabindex="0"
3667 @input=${this.handleInputChange} 3668 @compositionstart=${this.handleCompositionStart} 3669 @compositionend=${this.handleCompositionEnd} 3670 @focus=${this.handleFocus} 3671 @blur=${this.handleBlur} 3672 /> 3673 `} 3674 3675 <input 3676 class="value-input" 3677 type="text" 3678 ?disabled=${this.disabled} 3679 ?required=${this.required} 3680 .value=${Array.isArray(this.value)?this.value.join(", "):this.value??""} 3681 tabindex="-1" 3682 aria-hidden="true" 3683 @focus=${()=>this.focus()} 3684 /> 3685 3686 ${s?K` 3687 <button 3688 part="clear-button" 3689 type="button" 3690 aria-label=${this.localize.term("clearEntry")} 3691 @mousedown=${this.handleClearMouseDown} 3692 @click=${this.handleClearClick} 3693 tabindex="-1" 3694 > 3695 <slot name="clear-icon"> 3696 <wa-icon name="circle-xmark" library="system" variant="regular"></wa-icon> 3697 </slot> 3698 </button> 3699 `:J} 3700 3701 <slot name="end" part="end" class="end"></slot> 3702
3703 <!-- The spinner is overlaid on the expand icon's box so swapping between them shifts nothing. --> 3704 <div class="trailing-affordance"> 3705 <slot name="expand-icon" part="expand-icon" class="expand-icon"> 3706 <wa-icon library="system" name="chevron-down" variant="solid"></wa-icon> 3707 </slot> 3708 ${this.hasUpdated?K`<wa-spinner part="spinner" class="spinner" aria-hidden="true"></wa-spinner>`:J} 3709 </div> 3710 </div> 3711 3712 <div part="listbox" class="listbox"> 3713 <div 3714 id=${this.listboxId} 3715 role="listbox" 3716 aria-expanded=${this.open?"true":"false"} 3717 aria-multiselectable=${this.multiple?"true":"false"} 3718 aria-labelledby="label" 3719 aria-busy=${this.loading?"true":"false"} 3720 class="listbox-options" 3721 tabindex="-1" 3722 @mouseup=${this.handleOptionClick} 3723 > 3724 <slot @slotchange=${this.handleDefaultSlotChange}></slot> 3725 </div> 3726 3727 <!-- Outside the listbox element, so a role="listbox" never contains non-option children, but inside 3728 the popup so they read as part of it. --> 3729 ${t?K` 3730 <div part="status ${t}" class="status"> 3731 ${"loading"===t?K`<slot name="loading"> 3732 <!-- Hidden from AT: wa-spinner is a role="progressbar" labelled "Loading", which would 3733 be read alongside the visible "Loading" text right next to it. --> 3734 <wa-spinner class="status-spinner" aria-hidden="true"></wa-spinner> 3735 <span>${this.statusText("loading")}</span> 3736 </slot>`:K`<slot name=${t}>${this.statusText(t)}</slot>`} 3737 </div> 3738 `:J} 3739 </div> 3740 </wa-popup> 3741 </div> 3742 3743 <slot 3744 id="hint" 3745 name="hint" 3746 part="hint" 3747 class=${ce({"has-slotted":a})} 3748 aria-hidden=${a?"false":"true"} 3749 >${this.hint}</slot 3750 > 3751 </div> 3752 `}};su.css=[tu,zh,Ue],kt([$t()],su.prototype,"hasRequestError",2),kt([Dt(".combobox-popup")],su.prototype,"popup",2),kt([Dt(".combobox")],su.prototype,"combobox",2),kt([Dt(".combobox-input")],su.prototype,"comboboxInput",2),kt([Dt(".value-input")],su.prototype,"valueInput",2),kt([Dt(".listbox")],su.prototype,"listbox",2),kt([$t()],su.prototype,"selectedOptions",2),kt([$t()],su.prototype,"filteredOptions",2),kt([$t()],su.prototype,"inputValue",2),kt([At({reflect:!0})],su.prototype,"name",2),kt([At({attribute:!1})],su.prototype,"defaultValue",1),kt([At({attribute:"value",reflect:!1})],su.prototype,"value",1),kt([At({reflect:!0})],su.prototype,"size",2),kt([vt("size")],su.prototype,"handleSizeChange",1),kt([At()],su.prototype,"placeholder",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"multiple",2),kt([At({attribute:"max-options-visible",type:Number})],su.prototype,"maxOptionsVisible",2),kt([At({type:Boolean})],su.prototype,"disabled",2),kt([At({attribute:"with-clear",type:Boolean})],su.prototype,"withClear",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"open",2),kt([At({reflect:!0})],su.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"pill",2),kt([At()],su.prototype,"label",2),kt([At({reflect:!0})],su.prototype,"placement",2),kt([At({attribute:"hint"})],su.prototype,"hint",2),kt([At({attribute:"with-label",type:Boolean})],su.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],su.prototype,"withHint",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"required",2),kt([At({attribute:"allow-custom-value",type:Boolean})],su.prototype,"allowCustomValue",2),kt([At({attribute:"allow-create",type:Boolean})],su.prototype,"allowCreate",2),kt([At({attribute:!1})],su.prototype,"filter",2),kt([At({attribute:!1})],su.prototype,"dataSource",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"server",2),kt([At({type:Boolean,reflect:!0})],su.prototype,"loading",2),kt([At({attribute:"filter-debounce",type:Number})],su.prototype,"filterDebounce",2),kt([At()],su.prototype,"autocapitalize",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"off"===t),toAttribute:t=>t?"on":"off"}})],su.prototype,"autocorrect",2),kt([At()],su.prototype,"inputmode",2),kt([At()],su.prototype,"enterkeyhint",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],su.prototype,"spellcheck",2),kt([At({attribute:!1})],su.prototype,"getTag",2),kt([vt("disabled",{waitUntilFirstUpdate:!0})],su.prototype,"handleDisabledChange",1),kt([vt(["dataSource","server"],{waitUntilFirstUpdate:!0})],su.prototype,"handleDataSourceChange",1),kt([vt("loading",{waitUntilFirstUpdate:!0})],su.prototype,"handleLoadingChange",1),kt([vt("value",{waitUntilFirstUpdate:!0})],su.prototype,"handleValueChange",1),kt([vt("open",{waitUntilFirstUpdate:!0})],su.prototype,"handleOpenChange",1),su=kt([St("wa-combobox")],su);
3752var nu=class extends Event{constructor(){super("wa-remove",{bubbles:!0,cancelable:!1,composed:!0})}},ru=h` 3753 @layer wa-component { 3754 :host { 3755 display: inline-flex; 3756 gap: 0.5em; 3757 border-radius: var(--wa-border-radius-m); 3758 align-items: center; 3759 background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)); 3760 border-color: var(--wa-color-border-normal, var(--wa-color-neutral-border-normal)); 3761 border-style: var(--wa-border-style); 3762 border-width: var(--wa-border-width-s); 3763 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 3764 font-size: inherit; 3765 line-height: 1; 3766 white-space: nowrap; 3767 user-select: none; 3768 -webkit-user-select: none; 3769 height: calc(var(--wa-form-control-height) * 0.8); 3770 line-height: calc(var(--wa-form-control-height) - var(--wa-form-control-border-width) * 2); 3771 padding: 0 0.75em; 3772 } 3773 3774 /* Appearance modifiers */ 3775 :host([appearance='outlined']) { 3776 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 3777 background-color: transparent; 3778 border-color: var(--wa-color-border-loud, var(--wa-color-neutral-border-loud)); 3779 } 3780 3781 :host([appearance='filled']) { 3782 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 3783 background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)); 3784 border-color: transparent; 3785 } 3786 3787 :host([appearance='filled-outlined']) { 3788 color: var(--wa-color-on-quiet, var(--wa-color-neutral-on-quiet)); 3789 background-color: var(--wa-color-fill-quiet, var(--wa-color-neutral-fill-quiet)); 3790 border-color: var(--wa-color-border-normal, var(--wa-color-neutral-border-normal)); 3791 } 3792 3793 :host([appearance='accent']) { 3794 color: var(--wa-color-on-loud, var(--wa-color-neutral-on-loud)); 3795 background-color: var(--wa-color-fill-loud, var(--wa-color-neutral-fill-loud)); 3796 border-color: transparent; 3797 } 3798 } 3799 3800 .content { 3801 font-size: var(--wa-font-size-smaller); 3802 } 3803 3804 [part='remove-button'] { 3805 line-height: 1; 3806 } 3807 3808 [part='remove-button']::part(base) { 3809 padding: 0; 3810 height: 1em; 3811 width: 1em; 3812 color: currentColor; 3813 } 3814 3815 @media (hover: hover) { 3816 :host(:hover) > [part='remove-button']::part(base) { 3817 background-color: transparent; 3818 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 3819 } 3820 } 3821 3822 :host(:active) > [part='remove-button']::part(base) { 3823 background-color: transparent; 3824 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 3825 } 3826 3827 /* 3828 * Pill modifier 3829 */ 3830 :host([pill]) { 3831 border-radius: var(--wa-border-radius-pill); 3832 } 3833`,lu=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.variant="neutral",this.appearance="filled-outlined",this.size="m",this.pill=!1,this.withRemove=!1}handleSizeChange(){He(this.localName,this.size)}handleRemoveClick(){this.dispatchEvent(new nu)}render(){return K` 3834 <slot part="content" class="content"></slot> 3835 3836 ${this.withRemove?K` 3837 <wa-button 3838 part="remove-button" 3839 exportparts="base:remove-button__base" 3840 class="remove" 3841 appearance="plain" 3842 size=${this.size} 3843 @click=${this.handleRemoveClick} 3844 tabindex="-1" 3845 > 3846 <wa-icon name="xmark" library="system" variant="solid" label=${this.localize.term("remove")}></wa-icon> 3847 </wa-button> 3848 `:""} 3849 `}};lu.css=[ru,Te,Ue],kt([At({reflect:!0})],lu.prototype,"variant",2),kt([At({reflect:!0})],lu.prototype,"appearance",2),kt([At({reflect:!0})],lu.prototype,"size",2),kt([vt("size")],lu.prototype,"handleSizeChange",1),kt([At({type:Boolean,reflect:!0})],lu.prototype,"pill",2),kt([At({attribute:"with-remove",type:Boolean})],lu.prototype,"withRemove",2),lu=kt([St("wa-tag")],lu);var hu=h` 3850 :host { 3851 --current-text-color: var(--wa-color-brand-on-loud); 3852 3853 display: block; 3854 color: var(--wa-color-text-normal); 3855 -webkit-user-select: none; 3856 user-select: none; 3857 3858 position: relative; 3859 display: flex;
3860 align-items: center; 3861 font: inherit; 3862 padding: 0.5em 1em 0.5em 0.25em; 3863 border-radius: var(--wa-border-radius-s); 3864 line-height: var(--wa-line-height-condensed); 3865 transition: var(--wa-transition-fast) background-color var(--wa-transition-easing); 3866 cursor: pointer; 3867 } 3868 3869 :host(:focus) { 3870 outline: none; 3871 } 3872 3873 @media (hover: hover) { 3874 :host(:not(:state(disabled), :state(current)):is(:state(hover), :hover)) { 3875 background-color: var(--wa-color-neutral-fill-normal); 3876 color: var(--wa-color-neutral-on-normal); 3877 } 3878 } 3879 3880 :host(:state(current)), 3881 :host(:state(disabled):state(current)) { 3882 background-color: var(--wa-form-control-activated-color); 3883 color: var(--current-text-color); 3884 opacity: 1; 3885 } 3886 3887 :host(:state(disabled)) { 3888 outline: none; 3889 opacity: 0.5; 3890 cursor: not-allowed; 3891 } 3892 3893 .label { 3894 flex: 1 1 auto; 3895 display: inline-block; 3896 } 3897 3898 .check { 3899 flex: 0 0 auto; 3900 display: flex; 3901 align-items: center; 3902 justify-content: center; 3903 font-size: var(--wa-font-size-smaller); 3904 visibility: hidden; 3905 width: 2em; 3906 } 3907 3908 :host(:state(selected)) .check { 3909 visibility: visible; 3910 } 3911 3912 .start, 3913 .end { 3914 flex: 0 0 auto; 3915 display: flex;
3916 align-items: center; 3917 } 3918 3919 .start::slotted(*) { 3920 margin-inline-end: 0.5em; 3921 } 3922 3923 .end::slotted(*) { 3924 margin-inline-start: 0.5em; 3925 } 3926 3927 @media (forced-colors: active) { 3928 :host(:hover:not([aria-disabled='true'])) { 3929 outline: dashed 1px SelectedItem; 3930 outline-offset: -1px; 3931 } 3932 } 3933`;function cu(t,e=0){if(!t||!globalThis.Node)return"";if("function"==typeof t[Symbol.iterator]){return(Array.isArray(t)?t:[...t]).map(t=>cu(t,--e)).join("")}let i=t;if(i.nodeType===Node.TEXT_NODE)return i.textContent??"";if(i.nodeType===Node.ELEMENT_NODE){let t=i;if(t.hasAttribute("slot")||t.matches("style, script"))return"";if(t instanceof HTMLSlotElement){let i=t.assignedNodes({flatten:!0});if(i.length>0)return cu(i,--e)}return e>-1?cu(t,--e):t.textContent??""}return i.hasChildNodes()?cu(i.childNodes,--e):""}var du=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.cachedDefaultLabel="",this.isInitialized=!1,this.isDefaultLabelDirty=!0,this.current=!1,this.value="",this.disabled=!1,this.selected=!1,this.defaultSelected=!1,this._label="",this.handleHover=t=>{"mouseenter"===t.type?this.customStates.set("hover",!0):"mouseleave"===t.type&&this.customStates.set("hover",!1)}}set label(t){const e=this._label;this._label=t||"",this._label!==e&&this.requestUpdate("label",e)}get label(){return this._label?this._label:this.defaultLabel}get defaultLabel(){return!this.isDefaultLabelDirty&&this.cachedDefaultLabel||this.updateDefaultLabel(),this.cachedDefaultLabel}connectedCallback(){super.connectedCallback(),this.setAttribute("role","option"),this.setAttribute("aria-selected","false"),this.addEventListener("mouseenter",this.handleHover),this.addEventListener("mouseleave",this.handleHover)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mouseenter",this.handleHover),this.removeEventListener("mouseleave",this.handleHover)}handleDefaultSlotChange(){if(this.isDefaultLabelDirty=!0,!this.isInitialized)return void(this.isInitialized=!0);const t=this.closest("wa-select, wa-combobox");t&&customElements.whenDefined(t.localName).then(()=>t.handleDefaultSlotChange?.())}willUpdate(t){t.has("defaultSelected")&&(this.didSSR&&this.hasUpdated||!this.didSSR)&&this.syncDefaultSelected(),super.willUpdate(t)}syncDefaultSelected(){if("closest"in this&&!this.closest("wa-combobox, wa-select")?.hasInteracted&&this.defaultSelected){const t=this.selected;this.selected=this.defaultSelected,this.requestUpdate("selected",t)}}updated(t){t.has("disabled")&&(this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.customStates.set("disabled",this.disabled)),t.has("selected")&&(this.setAttribute("aria-selected",this.selected?"true":"false"),this.customStates.set("selected",this.selected)),t.has("value")&&("string"!=typeof this.value&&(this.value=String(this.value)),this.handleDefaultSlotChange()),t.has("current")&&this.customStates.set("current",this.current),super.updated(t)}async firstUpdated(t){if(super.firstUpdated(t),this.didSSR&&!this.hasUpdated?(await this.updateComplete,this.syncDefaultSelected()):this.syncDefaultSelected(),this.selected&&!this.defaultSelected){const t=this.closest("wa-select, wa-combobox");t&&!t.hasInteracted&&(await customElements.whenDefined(t?.localName),await t.updateComplete,t.selectionChanged?.())}}updateDefaultLabel(){let t=this.cachedDefaultLabel;this.cachedDefaultLabel=cu(this).trim(),this.isDefaultLabelDirty=!1;let e=this.cachedDefaultLabel!==t;return!this._label&&e&&this.requestUpdate("label",t),e}render(){let t=this.selected;return this.didSSR&&!this.hasUpdated?(this.updateComplete.then(()=>{this.requestUpdate()}),J):K` 3934 ${t?K`<wa-icon 3935 part="checked-icon" 3936 class="check" 3937 name="check" 3938 library="system" 3939 variant="solid" 3940 aria-hidden="true" 3941 ></wa-icon>`:K`<span part="checked-icon" class="check" aria-hidden="true"></span>`} 3942 <slot part="start" name="start" class="start"></slot> 3943 <slot part="label" class="label" @slotchange=${this.handleDefaultSlotChange}></slot> 3944 <slot part="end" name="end" class="end"></slot> 3945 `}};du.css=hu,kt([Dt(".label")],du.prototype,"defaultSlot",2),kt([$t()],du.prototype,"current",2),kt([At({reflect:!0})],du.prototype,"value",2),kt([At({type:Boolean})],du.prototype,"disabled",2),kt([At({type:Boolean,attribute:!1})],du.prototype,"selected",2),kt([At({type:Boolean,attribute:"selected"})],du.prototype,"defaultSelected",2),kt([At()],du.prototype,"label",1),du=kt([St("wa-option")],du);
3945var uu=class extends Event{constructor(t){super("wa-copy",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},pu=h` 3946 :host { 3947 display: inline-block; 3948 color: var(--wa-color-neutral-on-quiet); 3949 } 3950 3951 .copy-button__trigger { 3952 position: relative; 3953 } 3954 3955 .button { 3956 display: inline-flex; 3957 align-items: center; 3958 justify-content: center; 3959 background-color: transparent; 3960 border: none; 3961 border-radius: var(--wa-form-control-border-radius); 3962 color: inherit; 3963 font-size: inherit; 3964 height: calc(var(--wa-form-control-height) * 0.8); 3965 aspect-ratio: 1; 3966 cursor: pointer; 3967 transition-property: background-color, color; 3968 transition-duration: var(--wa-transition-fast); 3969 transition-timing-function: var(--wa-transition-easing); 3970 } 3971 3972 @media (hover: hover) { 3973 .button:hover:not([disabled]) { 3974 background-color: var(--wa-color-neutral-fill-quiet); 3975 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 3976 } 3977 } 3978 3979 .button:focus-visible:not([disabled]) { 3980 background-color: var(--wa-color-neutral-fill-quiet); 3981 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 3982 } 3983 3984 .button:active:not([disabled]) { 3985 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 3986 } 3987 3988 .button:focus-visible { 3989 outline: var(--wa-focus-ring); 3990 outline-offset: var(--wa-focus-ring-offset); 3991 } 3992 3993 .button[disabled] { 3994 opacity: 0.5; 3995 cursor: not-allowed !important; 3996 } 3997 3998 slot { 3999 display: inline-flex; 4000 } 4001 4002 /* Icon swap animation */ 4003 .show { 4004 animation: copy-button-icon-show var(--wa-transition-fast) var(--wa-transition-easing); 4005 } 4006 4007 .hide { 4008 animation: copy-button-icon-show var(--wa-transition-fast) var(--wa-transition-easing) reverse; 4009 } 4010 4011 @keyframes copy-button-icon-show { 4012 from { 4013 scale: 0.25; 4014 opacity: 0.25; 4015 } 4016 to { 4017 scale: 1; 4018 opacity: 1; 4019 } 4020 } 4021 4022 @media (prefers-reduced-motion: reduce) { 4023 .show, 4024 .hide { 4025 animation-duration: 1ms; 4026 } 4027 } 4028`,mu="wa-internal-tooltip",fu="__waCopyButtonAssignedId",gu=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.isCopying=!1,this.status="rest",this.hasCustomTrigger=!1,this.customTriggerEl=null,this.lightTooltip=null,this.feedbackTimeout=null,this.value="",this.from="",this.disabled=!1,this.copyLabel="",this.successLabel="",this.errorLabel="",this.feedbackDuration=1e3,this.tooltipPlacement="top",this.tooltip="full",this.handleDefaultSlotChange=()=>{const t=(this.defaultSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null;t!==this.customTriggerEl&&(this.releaseAssignedId(this.customTriggerEl),this.customTriggerEl=t),this.hasCustomTrigger=null!==t,t&&"none"!==this.tooltip?(t.id||(t.id=Wh("wa-copy-button-trigger-"),t[fu]=!0),this.ensureLightTooltip()):this.removeLightTooltip()}}get activeTooltip(){return this.lightTooltip??this.shadowTooltip??null}get currentLabel(){return"success"===this.status?this.successLabel||this.localize.term("copied"):"error"===this.status?this.errorLabel||this.localize.term("error"):this.copyLabel||this.localize.term("copy")}firstUpdated(t){super.firstUpdated(t),this.didSSR?this.updateComplete.then(()=>{this.handleDefaultSlotChange()}):this.handleDefaultSlotChange()}disconnectedCallback(){super.disconnectedCallback(),this.removeLightTooltip()}handleStatusChange(){this.customStates.set("success","success"===this.status),this.customStates.set("error","error"===this.status),this.syncTooltipText(),"success"!==this.status&&"error"!==this.status||Xd(this.currentLabel,"polite")}handleLabelChange(){this.syncTooltipText()}handleTooltipOptionsChange(){this.lightTooltip&&(this.lightTooltip.placement=this.tooltipPlacement,this.lightTooltip.disabled=this.disabled)}handleTooltipModeChange(t){"none"===this.tooltip?this.removeLightTooltip():"none"===t?this.handleDefaultSlotChange():this.lightTooltip&&this.lightTooltip.setAttribute("trigger","copy"===this.tooltip?"manual":"hover focus")}releaseAssignedId(t){t&&t[fu]&&(t.removeAttribute("id"),delete t[fu])}ensureLightTooltip(){if(!this.customTriggerEl)return;const t="copy"===this.tooltip?"manual":"hover focus";if(this.lightTooltip)this.lightTooltip.setAttribute("for",this.customTriggerEl.id),this.lightTooltip.setAttribute("trigger",t),this.lightTooltip.placement=this.tooltipPlacement,this.lightTooltip.disabled=this.disabled,this.lightTooltip.textContent=this.currentLabel;else{const e=document.createElement("wa-tooltip");e.setAttribute("slot",mu),e.setAttribute("part","feedback"),e.setAttribute("trigger",t),e.dataset.copyButtonTooltip="",e.setAttribute("for",this.customTriggerEl.id),e.placement=this.tooltipPlacement,e.disabled=this.disabled,e.textContent=this.currentLabel,this.appendChild(e),this.lightTooltip=e}}removeLightTooltip(){this.lightTooltip&&(this.releaseAssignedId(this.customTriggerEl),this.lightTooltip.remove(),this.lightTooltip=null)}syncTooltipText(){this.lightTooltip&&(this.lightTooltip.textContent=this.currentLabel)}async handleCopy(){if(this.disabled||this.isCopying)return;this.isCopying=!0;let t=this.value;if(this.from){const e=this.getRootNode(),i=this.from.includes("."),o=this.from.includes("[")&&this.from.includes("]");let a=this.from,s="";i?[a,s]=this.from.trim().split("."):o&&([a,s]=this.from.trim().replace(/\]$/,"").split("["));const n="getElementById"in e?e.getElementById(a):null;
4028n?t=o?n.getAttribute(s)||"":i?n[s]||"":n.textContent||"":(this.showStatus("error"),this.dispatchEvent(new ue))}if(t)try{await navigator.clipboard.writeText(t),this.showStatus("success"),this.dispatchEvent(new uu({value:t}))}catch(t){this.showStatus("error"),this.dispatchEvent(new ue)}else this.showStatus("error"),this.dispatchEvent(new ue)}async showStatus(t){if(this.status=t,this.copyIcon){const e="success"===t?this.successIcon:this.errorIcon;await qt(this.copyIcon,"hide"),this.copyIcon.hidden=!0,e.hidden=!1,await qt(e,"show")}await this.updateComplete;const e="none"===this.tooltip?null:this.activeTooltip;let i=null;e&&(e.show(),i=new Promise(t=>{e.addEventListener("wa-after-hide",()=>{null!==this.feedbackTimeout&&(clearTimeout(this.feedbackTimeout),this.feedbackTimeout=null),t()},{once:!0})}),this.feedbackTimeout=window.setTimeout(async()=>{this.feedbackTimeout=null,await e.hide()},this.feedbackDuration)),setTimeout(async()=>{if(i&&await i,this.copyIcon){const e="success"===t?this.successIcon:this.errorIcon;await qt(e,"hide"),e.hidden=!0,this.copyIcon.hidden=!1,await qt(this.copyIcon,"show")}this.status="rest",this.isCopying=!1},this.feedbackDuration)}render(){let t=!this.hasCustomTrigger&&"none"!==this.tooltip;const e="copy"===this.tooltip?"manual":"hover focus";return this.didSSR&&!this.hasUpdated&&(t=!1),K` 4029 <div class="copy-button__trigger" @click=${this.handleCopy}> 4030 <slot @slotchange=${this.handleDefaultSlotChange}></slot> 4031 <button 4032 class="button" 4033 part="button" 4034 type="button" 4035 id="copy-button" 4036 aria-label=${this.currentLabel} 4037 ?disabled=${this.disabled} 4038 ?hidden=${this.hasCustomTrigger} 4039 > 4040 <slot part="copy-icon" name="copy-icon"> 4041 <wa-icon library="system" name="copy" variant="regular"></wa-icon> 4042 </slot> 4043 <slot part="success-icon" name="success-icon" variant="solid" hidden> 4044 <wa-icon library="system" name="check"></wa-icon> 4045 </slot> 4046 <slot part="error-icon" name="error-icon" variant="solid" hidden> 4047 <wa-icon library="system" name="xmark"></wa-icon> 4048 </slot> 4049 </button> 4050 4051 ${t?K` 4052 <wa-tooltip 4053 part="feedback" 4054 for="copy-button" 4055 placement=${this.tooltipPlacement} 4056 trigger=${e} 4057 class=${ce({"copy-button-tooltip":!0,"copy-button-tooltip-success":"success"===this.status,"copy-button-tooltip-error":"error"===this.status})} 4058 ?disabled=${this.disabled} 4059 >${this.currentLabel}</wa-tooltip 4060 > 4061 `:""} 4062 <slot name="${mu}"></slot> 4063 </div> 4064 `}};gu.css=[zt,Rh,pu],kt([Dt('slot[name="copy-icon"]')],gu.prototype,"copyIcon",2),kt([Dt('slot[name="success-icon"]')],gu.prototype,"successIcon",2),kt([Dt('slot[name="error-icon"]')],gu.prototype,"errorIcon",2),kt([Dt("slot:not([name])")],gu.prototype,"defaultSlot",2),kt([Dt('wa-tooltip[part="feedback"]')],gu.prototype,"shadowTooltip",2),kt([$t()],gu.prototype,"isCopying",2),kt([$t()],gu.prototype,"status",2),kt([$t()],gu.prototype,"hasCustomTrigger",2),kt([At()],gu.prototype,"value",2),kt([At()],gu.prototype,"from",2),kt([At({type:Boolean,reflect:!0})],gu.prototype,"disabled",2),kt([At({attribute:"copy-label"})],gu.prototype,"copyLabel",2),kt([At({attribute:"success-label"})],gu.prototype,"successLabel",2),kt([At({attribute:"error-label"})],gu.prototype,"errorLabel",2),kt([At({attribute:"feedback-duration",type:Number})],gu.prototype,"feedbackDuration",2),kt([At({attribute:"tooltip-placement",reflect:!0})],gu.prototype,"tooltipPlacement",2),kt([At({reflect:!0})],gu.prototype,"tooltip",2),kt([vt("status")],gu.prototype,"handleStatusChange",1),kt([vt(["copyLabel","successLabel","errorLabel"])],gu.prototype,"handleLabelChange",1),kt([vt(["tooltipPlacement","disabled"],{waitUntilFirstUpdate:!0})],gu.prototype,"handleTooltipOptionsChange",1),kt([vt("tooltip",{waitUntilFirstUpdate:!0})],gu.prototype,"handleTooltipModeChange",1),gu=kt([St("wa-copy-button")],gu);var bu=h` 4065 :host { 4066 --max-width: 30ch; 4067 4068 /** These styles are added so we don't interfere in the DOM. */ 4069 display: inline-block; 4070 position: absolute; 4071 4072 /** Defaults for inherited CSS properties */ 4073 color: var(--wa-tooltip-content-color); 4074 font-size: var(--wa-tooltip-font-size); 4075 line-height: var(--wa-tooltip-line-height); 4076 text-align: start; 4077 white-space: normal; 4078 } 4079 4080 .tooltip { 4081 --arrow-size: var(--wa-tooltip-arrow-size); 4082 --arrow-color: var(--wa-tooltip-background-color); 4083 } 4084 4085 .tooltip::part(popup) { 4086 z-index: 1000; 4087 } 4088 4089 .tooltip[placement^='top']::part(popup) { 4090 transform-origin: bottom; 4091 } 4092 4093 .tooltip[placement^='bottom']::part(popup) { 4094 transform-origin: top; 4095 } 4096 4097 .tooltip[placement^='left']::part(popup) { 4098 transform-origin: right; 4099 } 4100 4101 .tooltip[placement^='right']::part(popup) { 4102 transform-origin: left; 4103 } 4104 4105 .body { 4106 display: block; 4107 width: max-content; 4108 max-width: var(--max-width); 4109 border-radius: var(--wa-tooltip-border-radius); 4110 background-color: var(--wa-tooltip-background-color); 4111 border: var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color); 4112 padding: 0.25em 0.5em; 4113 user-select: none; 4114 -webkit-user-select: none; 4115 } 4116 4117 .tooltip { 4118 --popup-border-width: var(--wa-tooltip-border-width); 4119 4120 /* Inset box-shadow, not a border: Safari seams a clip-path edge that runs along a border. */ 4121 &::part(arrow) { 4122 box-shadow: inset calc(-1 * var(--wa-tooltip-border-width)) calc(-1 * var(--wa-tooltip-border-width)) 0 0 4123 var(--wa-tooltip-border-color); 4124 } 4125 } 4126`;function vu(t,e){for(;e;){if(e===t)return!0;e=e instanceof Element&&e.assignedSlot?e.assignedSlot:e.parentNode?e.parentNode:e instanceof ShadowRoot?e.host:null}return!1}var wu=class extends Ft{constructor(){super(...arguments),this.dismissedByPress=!1,this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.showDelay=150,this.hideDelay=0,this.trigger="hover focus",this.withoutArrow=!1,this.for=null,this.anchor=null,this.eventController=new AbortController,this.handleBlur=()=>{this.dismissedByPress=!1,this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")?this.open?this.hide():this.show():this.hasTrigger("manual")||this.lightDismiss()},this.handleFocus=()=>{this.dismissedByPress||this.hasTrigger("focus")&&this.show()},this.handleMouseDown=()=>{this.hasTrigger("click")||this.hasTrigger("manual")||this.lightDismiss()},this.handleDocumentKeyDown=t=>{this.hasTrigger("manual")||"Escape"===t.key&&this.open&&qh(this)&&(t.preventDefault(),t.stopPropagation(),this.hide())},this.handleDocumentClick=t=>{this.hasTrigger("manual")||this.anchor&&t.composedPath().includes(this.anchor)||this.hide()},this.handleMouseOver=()=>{this.dismissedByPress||this.hasTrigger("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),this.showDelay))},this.handleMouseOut=t=>{const e=t.relatedTarget,i=Boolean(e&&this.anchor&&vu(this.anchor,e)),o=Boolean(e&&vu(this,e));i||o||(this.dismissedByPress=!1,this.hasTrigger("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>{this.hide()},this.hideDelay)))}}connectedCallback(){super.connectedCallback();"undefined"!=typeof document&&(this.eventController.signal.aborted&&(this.eventController=new AbortController),this.addEventListener("mouseout",this.handleMouseOut),this.dismissedByPress=!1,this.open&&(this.open=!1,this.updateComplete.then(()=>{this.open=!0})),this.id||(this.id=Wh("wa-tooltip-")),this.for&&this.anchor?(this.anchor=null,this.handleForChange()):this.for&&this.handleForChange())}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("click",this.handleDocumentClick),Hh(this),this.eventController.abort(),this.anchor&&this.removeFromAriaLabelledBy(this.anchor,this.id)}firstUpdated(t){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition()),super.firstUpdated(t)}lightDismiss(){clearTimeout(this.hoverTimeout),this.dismissedByPress=!0,this.hide()}hasTrigger(t){return this.trigger.split(" ").includes(t)}addToAriaLabelledBy(t,e){const i=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(
4126Boolean);i.includes(e)||(i.push(e),t.setAttribute("aria-labelledby",i.join(" ")))}removeFromAriaLabelledBy(t,e){const i=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(Boolean).filter(t=>t!==e);i.length>0?t.setAttribute("aria-labelledby",i.join(" ")):t.removeAttribute("aria-labelledby")}async handleOpenChange(){if(this.open){if(this.disabled)return;const t=new Gd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);this.hasTrigger("manual")||(document.addEventListener("keydown",this.handleDocumentKeyDown,{signal:this.eventController.signal}),document.addEventListener("click",this.handleDocumentClick,{signal:this.eventController.signal}),Nh(this)),this.body.hidden=!1,this.popup.active=!0,await qt(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new Zd)}else{const t=new Qd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("click",this.handleDocumentClick),Hh(this),await qt(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.body.hidden=!0,this.dispatchEvent(new Jd)}}handleForChange(){const t=this.getRootNode?.();if(!t)return;const e=this.for?t.getElementById?.(this.for):null,i=this.anchor;if(e===i)return;this.dismissedByPress=!1;const{signal:o}=this.eventController;e&&(this.addToAriaLabelledBy(e,this.id),e.addEventListener("blur",this.handleBlur,{capture:!0,signal:o}),e.addEventListener("focus",this.handleFocus,{capture:!0,signal:o}),e.addEventListener("click",this.handleClick,{signal:o}),e.addEventListener("mousedown",this.handleMouseDown,{signal:o}),e.addEventListener("mouseover",this.handleMouseOver,{signal:o}),e.addEventListener("mouseout",this.handleMouseOut,{signal:o})),i&&(this.removeFromAriaLabelledBy(i,this.id),i.removeEventListener("blur",this.handleBlur,{capture:!0}),i.removeEventListener("focus",this.handleFocus,{capture:!0}),i.removeEventListener("click",this.handleClick),i.removeEventListener("mousedown",this.handleMouseDown),i.removeEventListener("mouseover",this.handleMouseOver),i.removeEventListener("mouseout",this.handleMouseOut)),this.anchor=e}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,Nt(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,Nt(this,"wa-after-hide")}render(){return K` 4127 <wa-popup 4128 part="base tooltip" 4129 exportparts=" 4130 popup:base__popup, 4131 arrow:base__arrow 4132 " 4133 class=${ce({tooltip:!0,"tooltip-open":this.open})} 4134 placement=${this.placement} 4135 distance=${this.distance} 4136 skidding=${this.skidding} 4137 flip 4138 shift 4139 ?arrow=${!this.withoutArrow} 4140 hover-bridge 4141 .anchor=${this.anchor} 4142 > 4143 <div part="body" class="body"> 4144 <slot></slot> 4145 </div> 4146 </wa-popup> 4147 `}};wu.css=bu,wu.dependencies={"wa-popup":Nd},kt([Dt("slot:not([name])")],wu.prototype,"defaultSlot",2),kt([Dt(".body")],wu.prototype,"body",2),kt([Dt("wa-popup")],wu.prototype,"popup",2),kt([At()],wu.prototype,"placement",2),kt([At({type:Boolean,reflect:!0})],wu.prototype,"disabled",2),kt([At({type:Number})],wu.prototype,"distance",2),kt([At({type:Boolean,reflect:!0})],wu.prototype,"open",2),kt([At({type:Number})],wu.prototype,"skidding",2),kt([At({attribute:"show-delay",type:Number})],wu.prototype,"showDelay",2),kt([At({attribute:"hide-delay",type:Number})],wu.prototype,"hideDelay",2),kt([At()],wu.prototype,"trigger",2),kt([At({attribute:"without-arrow",type:Boolean,reflect:!0})],wu.prototype,"withoutArrow",2),kt([At()],wu.prototype,"for",2),kt([$t()],wu.prototype,"anchor",2),kt([vt("open",{waitUntilFirstUpdate:!0})],wu.prototype,"handleOpenChange",1),kt([vt("for")],wu.prototype,"handleForChange",1),kt([vt(["distance","placement","skidding"])],wu.prototype,"handleOptionsChange",1),kt([vt("disabled")],wu.prototype,"handleDisabledChange",1),wu=kt([St("wa-tooltip")],wu);var yu=/^(\d{4})-(\d{2})-(\d{2})$/;function xu(t){if(!t)return null;const e=yu.exec(t.trim());if(!e)return null;const i=Number(e[1]),o=Number(e[2]),a=Number(e[3]);if(o<1||o>12||a<1||a>31)return null;const s=new Date(i,o-1,a);return s.getFullYear()!==i||s.getMonth()!==o-1||s.getDate()!==a?null:s}function ku(t){if(!t||isNaN(t.getTime()))return"";return`${String(t.getFullYear()).padStart(4,"0")}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`}function Cu(t){return null==t?null:t instanceof Date?isNaN(t.getTime())?null:new Date(t.getFullYear(),t.getMonth(),t.getDate()):xu(t)}function Su(t){if(!t)return{from:null,to:null};const e=t.split("/");if(1===e.length)return{from:xu(e[0]),to:null};const i=xu(e[0]),o=xu(e[1]);return i&&o?i.getTime()<=o.getTime()?{from:i,to:o}:{from:o,to:i}:{from:i,to:o}}function _u(t){if(!t)return"";const{from:e,to:i}=t;return e||i?e&&!i?ku(e):!e&&i?ku(i):`${ku(e)}/${ku(i)}`:""}function Eu(t,e){return!(!t||!e)&&(t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate())}function Au(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+e)}function $u(t,e){const i=new Date(t.getFullYear(),t.getMonth()+e,1),o=Du(i.getFullYear(),i.getMonth());return new Date(i.getFullYear(),i.getMonth(),Math.min(t.getDate(),o))}function Lu(t,e){return $u(t,12*e)}function Du(t,e){return new Date(t,e+1,0).getDate()}function Mu(t,e,i){return e&&t.getTime()<e.getTime()?e:i&&t.getTime()>i.getTime()?i:t}var zu=/[\s\/\.\-,;:Øå¹´ææ¥]+/u,Tu=new Map;function Ou(t){return t.normalize("NFD").replace(/\p{M}+/gu,"").toLocaleLowerCase("en")}function Pu(t){const e=new Map;try{const i=new Intl.NumberFormat(t,{useGrouping:!1});for(let t=0;t<10;t++){const o=[...i.format(t)][0];o&&o!==String(t)&&e.set(o,String(t))}}catch{}return{digitMap:e}}function Fu(t,e,i){if(t<1||t>9999)return null;if(e<0||e>11)return null;if(i<1||i>31)return null;const o=new Date(t,e,i);return o.getFullYear()!==t||o.getMonth()!==e||o.getDate()!==i?null:o}function Iu(t,e){let i=100*Math.floor(e/100)+t;return i-e>49?i-=100:i-e<-50&&(i+=100),i}function Ru(t,e){if(!t)return null;const i=t.trim();if(!i)return null;const o=xu(i);if(o)return o;const a=/^(\d{4}-\d{2}-\d{2})T/.exec(i);if(a){const t=xu(a[1]);if(t)return t}const s=function(t,e){const i=`${t}|${e}`,o=Tu.get(i);if(o)return o;const a=new Intl.DateTimeFormat(t||"en",{year:"numeric",month:e,day:"2-digit",calendar:"gregory",numberingSystem:"latn"}),s=[];for(const t of a.formatToParts(new Date(2026,0,23)))"year"!==t.type&&"month"!==t.type&&"day"!==t.type||s.push(t.type);const n=new Map;for(const e of["long","short"]){const i=new Intl.DateTimeFormat(t||"en",{month:e,calendar:"gregory"});for(let t=0;t<12;t++){const e=i.formatToParts(new Date(2023,t,15)).find(t=>"month"===t.type);if(!e)continue;const o=Ou(e.value);o&&!n.has(o)&&n.set(o,t+1)}}for(const t of["long","short"]){const e=new Intl.DateTimeFormat("en",{month:t,calendar:"gregory"});for(let t=0;t<12;t++){const i=e.formatToParts(new Date(2023,t,15)).find(t=>"month"===t.type);if(!i)continue;const o=Ou(i.value);o&&!n.has(o)&&n.set(o,t+1)}}const r={order:s,monthNames:n,digitMap:Pu(t).digitMap};return Tu.set(i,r),r}(e.locale||"en",e.monthFormat),n=e.referenceYear??(new Date).getFullYear(),r=function(t){return t.replace(/[âââª-â®â¦-â©]/g,"").replace(/[ â¯âââ\t]/g," ").replace(/\s+/g," ").trim()}(function(t,e){if(0===e.size)return t;let i="";for(const o of t)i+=e.get(o)??o;return i}
4147(i,s.digitMap)),l=function(t,e,i){const o=t.split(zu).filter(Boolean);if(3!==o.length)return null;let a=null,s=-1;for(let t=0;t<o.length;t++){const i=Ou(o[t]),n=e.monthNames.get(i);if(null!=n){a=n-1,s=t;break}}if(null==a)return null;const n=o.filter((t,e)=>e!==s);if(!n.every(t=>/^\d+$/.test(t)))return null;let r,l;const h=Number(n[0]),c=Number(n[1]);if(4===n[0].length||h>31)r=h,l=c;else if(4===n[1].length||c>31)r=c,l=h;else{const t=e.order.filter(t=>"month"!==t),i=o.map((t,e)=>({t,i:e})).filter(t=>t.i!==s).map(t=>t.t),a="year"===t[0];r=Number(a?i[0]:i[1]),l=Number(a?i[1]:i[0])}r<100&&(r=Iu(r,i));return Fu(r,a,l)}(r,s,n);if(l)return l;const h=r.split(zu).filter(Boolean);return 3!==h.length?null:h.every(t=>/^\d+$/.test(t))?function(t,e,i){const o={year:0,month:0,day:0};for(let i=0;i<3;i++)o[e[i]]=Number(t[i]);let{year:a,month:s,day:n}=o;t[e.indexOf("year")].length<=2&&(a=Iu(a,i));return Fu(a,s-1,n)}(h,s.order,n):null}var Vu=new Map;function Bu(t){const e=xu(t??"");return e?{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}:{year:null,month:null,day:null}}function Nu(t){return null==t.year&&null==t.month&&null==t.day}function Hu(t){if(!function(t){return null!=t.year&&null!=t.month&&null!=t.day}(t))return"";const{year:e,month:i,day:o}=t;if(e<1||e>9999)return"";if(i<1||i>12)return"";if(o<1||o>31)return"";const a=new Date(2e3,i-1,o);return a.setFullYear(e),a.getFullYear()!==e||a.getMonth()!==i-1||a.getDate()!==o?"":`${String(e).padStart(4,"0")}-${String(i).padStart(2,"0")}-${String(o).padStart(2,"0")}`}function qu(t,e){return"year"===t?{min:1,max:9999}:"month"===t?{min:1,max:12}:null!=e.month&&null!=e.year?{min:1,max:Du(e.year,e.month-1)}:null!=e.month?{min:1,max:Du(2024,e.month-1)}:{min:1,max:31}}function Uu(t){if(null==t.day||null==t.month||null==t.year)return t;const e=Du(t.year,t.month-1);return t.day>e?{...t,day:e}:t}function Wu(t,e,i){return Math.min(i,Math.max(e,t))}function ju(t,e,i,o){const a=Number(e);if(""===t)return 0===a?{value:null,buffer:"0",advance:!1}:10*a>o?{value:Wu(a,i,o),buffer:"",advance:!0}:{value:a,buffer:e,advance:!1};const s=Number(t+e);return s>=i&&s<=o?{value:s,buffer:"",advance:!0}:"0"===t&&0===a?{value:null,buffer:"0",advance:!1}:ju("",e,i,o)}function Yu(t){if(!t)return null;const e=Number(t);return Number.isFinite(e)&&e>0?e:null}var Ku=/^\d{4}-\d{2}-\d{2}$/;function Xu(t,e,i){const o=document.createElement("input");return o.type="date",e&&(o.min=e),i&&(o.max=i),o.value=t,o.checkValidity(),o.validationMessage}var Gu=["/",".","-",":",","," "],Qu=class{constructor(t,e){this.buffers=new Map,this.active=null,this.handleFocus=t=>{const e=t.currentTarget,i=e.dataset.group,o=e.dataset.segment;this.active={group:i,field:o};for(const t of this.segmentElements())t.tabIndex=t===e?0:-1},this.handleBlur=t=>{const e=t.currentTarget,i=e.dataset.group,o=e.dataset.segment;this.getBuffer(i,o)&&this.flushBuffer(i,o)},this.handleKeyDown=t=>{const e=t.currentTarget??t.composedPath().find(t=>t instanceof HTMLElement&&t.dataset.group&&t.dataset.segment)??null;if(!e)return;const i=e.dataset.group,o=e.dataset.segment;if(!i||!o)return;if("ArrowUp"===t.key||"ArrowDown"===t.key){if(t.preventDefault(),this.isReadonlyOrDisabled())return;this.getBuffer(i,o)&&this.flushBuffer(i,o);const e="ArrowUp"===t.key?1:-1,a=this.config.rules.step(i,o,e);return void(a&&this.config.onCommit?.(i,o,a.value))}if("ArrowLeft"===t.key||"ArrowRight"===t.key){t.preventDefault(),this.getBuffer(i,o)&&this.flushBuffer(i,o);const a="ArrowLeft"===t.key,s=this.config.isRtl()?!a:a;return void this.moveFocus(e,s?-1:1)}if("Home"===t.key)return t.preventDefault(),void this.segmentElements()[0]?.focus({preventScroll:!0});if("End"===t.key){t.preventDefault();const e=this.segmentElements();return void e[e.length-1]?.focus({preventScroll:!0})}if("Tab"===t.key)return void(this.getBuffer(i,o)&&this.flushBuffer(i,o));if("Backspace"===t.key||"Delete"===t.key){if(t.preventDefault(),this.isReadonlyOrDisabled())return;if(this.getBuffer(i,o))this.setBuffer(i,o,""),this.config.onCommit?.(i,o,null);else{this.config.rules.clear(i,o)?this.config.onCommit?.(i,o,null):"Backspace"===t.key&&this.moveFocus(e,-1)}return}if(/^[0-9]$/.test(t.key)){if(t.preventDefault(),this.isReadonlyOrDisabled())return;const a=this.getBuffer(i,o),s=this.config.rules.typeDigit(i,o,a,t.key);return this.setBuffer(i,o,s.buffer),this.config.onCommit?.(i,o,s.value),void(s.advance&&this.moveFocus(e,1))}return(this.config.separatorKeys??Gu).includes(t.key)?(t.preventDefault(),this.getBuffer(i,o)&&this.flushBuffer(i,o),void this.moveFocus(e,1)):void 0},this.host=t,this.config=e,t.addController(this)}hostConnected(){}hostDisconnected(){this.buffers.clear(),this.active=null}getBuffer(t,e){return this.buffers.get(this.key(t,e))??""}setBuffer(t,e,i){const o=this.key(t,e);i?this.buffers.set(o,i):this.buffers.delete(o)}clearBuffers(){this.buffers.clear()}getActiveSegment(){return this.active}setActiveSegment(t,e){this.active={group:t,field:e}}segmentElements(){const t=this.host.shadowRoot;return t?Array.from(t.querySelectorAll("[data-segment][data-group]")):[]}segmentElementFor(t,e){const i=this.host.shadowRoot;return i?i.querySelector(`[data-group="${t}"][data-segment="${e}"]`):null}findFocusableSegment(t){const e=this.segmentElements();if(0===e.length)return null;return e.find(e=>{const i=e.dataset.group,o=e.dataset.segment;
4147return t(i,o)&&!this.getBuffer(i,o)})??e[0]}focusActiveSegment(t){if(this.active){const e=this.segmentElementFor(this.active.group,this.active.field);if(e)return void e.focus({preventScroll:!0,...t})}this.segmentElements()[0]?.focus({preventScroll:!0,...t})}moveFocus(t,e,i){const o=this.segmentElements(),a=o.indexOf(t);if(a<0)return;const s=o[a+e];s&&s.focus({preventScroll:!0,...i})}flushBuffer(t,e){const i=this.getBuffer(t,e);if(!i)return!1;const o=this.config.rules.commitBuffer(t,e,i);return this.setBuffer(t,e,""),this.config.onCommit?.(t,e,o),!0}flushAllBuffers(){for(const[t,e]of this.buffers){if(!e)continue;const[i,o]=t.split(":"),a=this.config.rules.commitBuffer(i,o,e);this.config.onCommit?.(i,o,a)}this.buffers.clear()}eventHandlers(){return{keydown:this.handleKeyDown,focus:this.handleFocus,blur:this.handleBlur}}handleKeyDownEvent(t){const e=t.defaultPrevented;return this.handleKeyDown(t),t.defaultPrevented&&!e}key(t,e){return`${t}:${e}`}isReadonlyOrDisabled(){return!(!this.config.isReadonly?.()&&!this.config.isDisabled?.())}},Ju=h` 4148 /* font: inherit lifts the UA default button font-size so children that size with em 4149 (e.g. the expand icon) resolve against the host size-driven font-size instead of ~13px. */ 4150 [part~='clear-button'], 4151 [part~='expand-button'] { 4152 flex: 0 0 auto; 4153 display: inline-flex;
4154 align-items: center; 4155 justify-content: center; 4156 background: transparent; 4157 border: none; 4158 cursor: pointer; 4159 color: var(--wa-color-neutral-on-quiet); 4160 font: inherit; 4161 padding: 0.25em; 4162 /* Trailing padding overhangs the content edge rather than displacing the glyph. */ 4163 margin-inline-end: -0.25em; 4164 border-radius: var(--wa-border-radius-s); 4165 transition: color var(--wa-transition-normal); 4166 4167 @media (hover: hover) { 4168 &:hover { 4169 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 4170 } 4171 } 4172 4173 &:active { 4174 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 4175 } 4176 } 4177 4178 /* Fixed widths (= glyph + 2Ã0.25em padding) keep each glyph centered on the trailing axis 4179 regardless of the slotted icon's intrinsic width. */ 4180 [part~='expand-button'] { 4181 inline-size: 1.75em; 4182 /* Leading gap that lands the clear button on <wa-select>'s clear axis. Scales with the 4183 form-control padding token (like select's own spacing) so it holds across themes; the 4184 0.125em offset accounts for the fixed button widths. */ 4185 margin-inline-start: calc(var(--wa-form-control-padding-inline) - 0.125em); 4186 } 4187 4188 [part~='clear-button'] { 4189 inline-size: 1.5em; 4190 margin-inline-start: var(--wa-form-control-padding-inline); 4191 } 4192 4193 [part~='expand-button']:focus-visible { 4194 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) var(--wa-color-focus); 4195 outline-offset: 2px; 4196 } 4197 4198 /* font-size scales the glyph with the host size attribute; the button width handles centering. 4199 Color is inherited from the button so the glyph follows its state. */ 4200 [part~='expand-icon'] { 4201 display: inline-flex;
4202 align-items: center; 4203 justify-content: center; 4204 font-size: 1.25em; 4205 } 4206 4207 /* Start / end decoration slots. Spaced with the same --wa-form-control-padding-inline gap as 4208 <wa-input>/<wa-select> so slotted icons line up with the rest of the form controls, rather 4209 than the tighter 0.25em the pickers used before. */ 4210 [part~='start'], 4211 [part~='end'] { 4212 display: inline-flex; 4213 align-items: center; 4214 color: var(--wa-color-neutral-on-quiet); 4215 } 4216 4217 [part~='start']::slotted(*) { 4218 margin-inline-end: var(--wa-form-control-padding-inline); 4219 } 4220 4221 [part~='end']::slotted(*) { 4222 margin-inline-start: var(--wa-form-control-padding-inline); 4223 } 4224`,Zu=h` 4225 :host { 4226 --show-duration: var(--wa-transition-fast); 4227 --hide-duration: var(--wa-transition-fast); 4228 } 4229 4230 :host(:state(disabled)) { 4231 cursor: not-allowed; 4232 } 4233 4234 /* Popup */ 4235 .date-input-popup { 4236 flex: 1 1 auto; 4237 display: inline-flex; 4238 width: 100%; 4239 position: relative; 4240 vertical-align: middle; 4241 --show-duration: inherit; 4242 --hide-duration: inherit; 4243 4244 &::part(popup) { 4245 z-index: 900; 4246 } 4247 4248 &[data-current-placement^='top']::part(popup) { 4249 transform-origin: bottom; 4250 } 4251 4252 &[data-current-placement^='bottom']::part(popup) { 4253 transform-origin: top; 4254 } 4255 } 4256 4257 /* Popup body â transparent positioning wrapper. The date picker handles its own border, 4258 background, and padding. We give the date picker a sensible default width per mode; 4259 multi-month layouts widen proportionally because the date picker's internal grids each take 4260 a fraction of the host width. Authors can override via the date-picker part. 4261 4262 Inherit font-size from the host so the content scales with the picker's size attribute via em. */ 4263 .popup-body { 4264 display: inline-block; 4265 font-size: inherit; 4266 } 4267 4268 /* Cap at the requested em width but never exceed the viewport â the popup is positioned in the 4269 viewport, so on narrow screens we let the date picker shrink and its own container query collapse 4270 the multi-month layout to a single column. */ 4271 .popup-body wa-date-picker { 4272 width: min(20em, 100vw - 2 * var(--wa-space-s)); 4273 font-size: inherit; 4274 } 4275 4276 /* Shadow is applied only when the date picker is within the popup â standalone date pickers don't 4277 assume elevation. */ 4278 .popup-body wa-date-picker::part(base) { 4279 box-shadow: var(--wa-shadow-m); 4280 } 4281 4282 /* Multi-month layouts (range mode or months=2) need extra space for side-by-side grids. */ 4283 :host([mode='range']) .popup-body wa-date-picker, 4284 :host([months='2']) .popup-body wa-date-picker { 4285 width: min(40em, 100vw - 2 * var(--wa-space-s)); 4286 } 4287 4288 /* Input wrapper */ 4289 .input-wrapper { 4290 flex: 1; 4291 display: flex; 4292 width: 100%; 4293 min-width: 0; 4294 align-items: center; 4295 min-height: var(--wa-form-control-height); 4296 background-color: var(--wa-form-control-background-color); 4297 border-color: var(--wa-form-control-border-color); 4298 border-radius: var(--wa-form-control-border-radius); 4299 border-style: var(--wa-form-control-border-style); 4300 border-width: var(--wa-form-control-border-width); 4301 color: var(--wa-form-control-value-color); 4302 cursor: text; 4303 font-family: inherit; 4304 font-weight: var(--wa-form-control-value-font-weight); 4305 line-height: var(--wa-form-control-value-line-height); 4306 padding: 0 var(--wa-form-control-padding-inline); 4307 transition: 4308 background-color var(--wa-transition-normal), 4309 border-color var(--wa-transition-normal), 4310 outline-color var(--wa-transition-fast); 4311 transition-timing-function: var(--wa-transition-easing); 4312 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 4313 outline-offset: var(--wa-focus-ring-offset); 4314 } 4315 4316 :host([pill]) .input-wrapper { 4317 border-radius: var(--wa-border-radius-pill); 4318 } 4319 4320 :host(:focus-within) .input-wrapper { 4321 outline-color: var(--wa-color-focus); 4322 } 4323 4324 :host(:state(disabled)) .input-wrapper { 4325 opacity: 0.5;
4326 cursor: not-allowed; 4327 } 4328 4329 /* Appearance variants */ 4330 :host([appearance='filled']) .input-wrapper, 4331 :host([appearance='filled-outlined']) .input-wrapper { 4332 background-color: var(--wa-color-surface-lowered); 4333 } 4334 4335 :host([appearance='filled']) .input-wrapper { 4336 border-color: transparent; 4337 } 4338 4339 /* Segmented input â the role=group container holding all segments + literals. */ 4340 .segments { 4341 flex: 1; 4342 min-width: 0; 4343 display: inline-flex; 4344 align-items: center; 4345 flex-wrap: nowrap; 4346 color: inherit; 4347 font: inherit; 4348 font-variant-numeric: tabular-nums; 4349 /* Caret should look like a text field even though we don't render one. */ 4350 caret-color: transparent; 4351 } 4352 4353 /* Each editable segment is a focusable spinbutton rendered as inline text. tabular-nums on the segments container 4354 keeps all digits the same width; the segment itself uses no width-locking tricks. The placeholder text (mm, dd, 4355 yyyy) and committed digits are visually close enough that the natural width is stable. 4356 */ 4357 .segment { 4358 display: inline-block; 4359 padding: 0 0.15em; 4360 margin: 0; 4361 background: transparent; 4362 border: none; 4363 outline: none; 4364 color: inherit; 4365 font: inherit; 4366 text-align: center; 4367 cursor: text; 4368 user-select: none; 4369 white-space: nowrap; 4370 border-radius: var(--wa-border-radius-s); 4371 transition: 4372 background-color var(--wa-transition-fast), 4373 color var(--wa-transition-fast); 4374 } 4375 4376 .segment.empty { 4377 color: var(--wa-form-control-placeholder-color); 4378 } 4379 4380 /* Focus style â applies to keyboard and pointer focus so a click always shows the selection. Soft brand fill reads 4381 as "selected" without competing with the popup's loud selected items. */ 4382 .segment:focus { 4383 background-color: var(--wa-color-brand-fill-quiet); 4384 color: var(--wa-color-brand-on-quiet); 4385 outline: none; 4386 } 4387 4388 .segment.empty:focus { 4389 color: var(--wa-color-brand-on-quiet); 4390 } 4391 4392 /* Inert literal text between segments â separators like / or . or CJK suffixes. */ 4393 .segment-literal { 4394 display: inline-block; 4395 color: var(--wa-color-text-quiet); 4396 white-space: pre; 4397 user-select: none; 4398 } 4399 4400 /* Disabled / readonly styling for segments. */ 4401 :host([disabled]) .segment, 4402 :host([readonly]) .segment { 4403 cursor: inherit; 4404 } 4405 4406 /* Hidden form value input (for native form validity anchoring) */ 4407 .value-input { 4408 position: absolute; 4409 inset-inline-start: var(--wa-form-control-padding-inline); 4410 inset-block-start: 50%; 4411 transform: translateY(-50%); 4412 width: 1px; 4413 height: 1px; 4414 opacity: 0; 4415 pointer-events: none; 4416 border: none; 4417 padding: 0; 4418 margin: 0; 4419 } 4420 4421 /* Trailing buttons (.clear-button, .expand-button), the .expand-icon box, and the start/end 4422 decoration slots are shared with <wa-time-input> via segmentedFieldStyles so both pickers 4423 stay on <wa-select>'s trailing optical axis. See segmented-field.styles.ts. */ 4424 4425 /* Animations */ 4426 .date-input-popup::part(popup).show { 4427 animation: wa-date-input-show var(--show-duration) var(--wa-transition-easing); 4428 } 4429 4430 .date-input-popup::part(popup).hide { 4431 animation: wa-date-input-hide var(--hide-duration) var(--wa-transition-easing); 4432 } 4433 4434 @keyframes wa-date-input-show { 4435 from { 4436 opacity: 0; 4437 transform: scale(0.97); 4438 } 4439 to { 4440 opacity: 1; 4441 transform: scale(1); 4442 } 4443 } 4444 4445 @keyframes wa-date-input-hide { 4446 from { 4447 opacity: 1; 4448 transform: scale(1); 4449 } 4450 to { 4451 opacity: 0; 4452 transform: scale(0.97); 4453 } 4454 } 4455 4456 /* Visually hidden helper for sr-only content */ 4457 .visually-hidden { 4458 position: absolute; 4459 width: 1px; 4460 height: 1px; 4461 padding: 0; 4462 margin: -1px; 4463 overflow: hidden; 4464 clip: rect(0, 0, 0, 0); 4465 white-space: nowrap; 4466 border: 0; 4467 } 4468 4469 /* Hidden children â used only to receive light-DOM slot changes (per-day named slots). */ 4470 .hidden-children { 4471 display: none; 4472 } 4473`,tp=0,ep=class extends Re{constructor(){super(),this.assumeInteractionOn=["input"],this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.pendingValue=null,this.moveFocusToCalendarOnShow=!1,this.lastEmittedValue="",this.segmentsController=new Qu(this,{getLayout:()=>this.getLayout(),isRtl:()=>this.isRtl,isReadonly:()=>this.readonly,isDisabled:()=>this.disabled,rules:{typeDigit:(t,e,i,o)=>
4473{const a=function(t,e,i){if(!/^[0-9]$/.test(i))return{value:Yu(e),buffer:e,advance:!1};if("year"===t){const t=e.length>=4?i:e+i;return{value:t?Number(t):null,buffer:t,advance:t.length>=4}}return ju(e,i,1,"month"===t?12:31)}(e,i,o);let s={...this.getGroupSegments(t),[e]:a.value};return"year"!==e&&"month"!==e||(s=Uu(s)),this.setGroupSegments(t,s),a},step:(t,e,i)=>{const o=this.today?xu(this.today)??new Date:new Date,a=function(t,e,i,o){const a=t[e],{min:s,max:n}=qu(e,t);let r;if(null==a)r=Wu("year"===e?o.getFullYear():"month"===e?o.getMonth()+1:o.getDate(),s,n);else if("year"===e)r=Wu(a+i,s,n);else{const t=n-s+1;r=((a-s+i)%t+t)%t+s}const l={...t,[e]:r};return"year"===e||"month"===e?Uu(l):l}(this.getGroupSegments(t),e,i,o);return this.setGroupSegments(t,a),{value:a[e]}},bounds:(t,e)=>qu(e,this.getGroupSegments(t)),commitBuffer:(t,e,i)=>{const o=Yu(i);let a={...this.getGroupSegments(t),[e]:o};return"year"!==e&&"month"!==e||(a=Uu(a)),this.setGroupSegments(t,a),o},clear:(t,e)=>{const i=this.getGroupSegments(t);return null!=i[e]&&(this.setGroupSegments(t,{...i,[e]:null}),!0)}},onCommit:()=>{this.recomputeValue(),this.requestUpdate()}}),this.forwardedDaySlots=[],this.segments={year:null,month:null,day:null},this.fromSegments={year:null,month:null,day:null},this.toSegments={year:null,month:null,day:null},this.name="",this._value="",this.defaultValue=this.getAttribute("value")??"",this.disabled=!1,this.required=!1,this.readonly=!1,this.size="m",this.appearance="outlined",this.pill=!1,this.label="",this.hint="",this.autocomplete="",this.withClear=!1,this.withLabel=!1,this.withHint=!1,this.mode="single",this.min="",this.max="",this.today="",this.firstDayOfWeek="auto",this.disabledDates="",this.disabledDaysOfWeek="",this.disablePast=!1,this.disableFuture=!1,this.minRange=0,this.maxRange=0,this.months=1,this.pageBy="months",this.withOutsideDays=!1,this.withWeekNumbers=!1,this.weekdayFormat="short",this.open=!1,this.placement="bottom-start",this.distance=0,this.handleDocumentFocusIn=t=>{t.composedPath().includes(this)||this.hide()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&qh(this)&&(t.stopPropagation(),t.preventDefault(),this.hide())},this.handleDocumentMouseDown=t=>{t.composedPath().includes(this)||this.hide()},this.handleSegmentFocus=t=>{this.segmentsController.eventHandlers().focus(t)},this.handleSegmentBlur=t=>{this.segmentsController.eventHandlers().blur(t)},this.handleInputWrapperPointerDown=t=>{if(!(this.disabled||this.readonly||this.open)){for(const e of t.composedPath()){if(e===this)break;if(!(e instanceof Element))continue;const t=e.tagName;if("BUTTON"===t||"A"===t||"button"===e.getAttribute("role"))return}this.show()}},this.handleSegmentKeyDown=t=>{const e=t.currentTarget,i=e.dataset.group,o=e.dataset.segment;return t.altKey&&"ArrowDown"===t.key?(t.preventDefault(),this.moveFocusToCalendarOnShow=!0,void(this.open?this.calendar?.focus({preventScroll:!0}):this.show())):t.altKey&&"ArrowUp"===t.key?(t.preventDefault(),void this.hide()):"Enter"===t.key?(t.preventDefault(),this.getBuffer(i,o)&&(this.segmentsController.flushBuffer(i,o),this.recomputeValue()),void(this.open&&this.hide())):void this.segmentsController.eventHandlers().keydown(t)},this.handleSegmentPaste=t=>{const e=t.clipboardData?.getData("text");if(!e)return;if(t.preventDefault(),this.readonly)return;const i=t.currentTarget.dataset.group;if("range"===this.mode){const t=function(t,e){if(!t||!t.trim())return{from:null,to:null};const i=t.trim(),o=/^(\d{4}-\d{2}-\d{2})\/(\d{4}-\d{2}-\d{2})$/.exec(i);if(o){const t=xu(o[1]),e=xu(o[2]);return t&&e&&t.getTime()>e.getTime()?{from:e,to:t}:{from:t,to:e}}const a=[/\s+to\s+/i,/\s*[ââ]\s*/,/\s+-\s+/,/\s*\/\s*/,/\s*\.\.\s*/];for(const t of a){const o=i.split(t);if(2===o.length&&o[0]&&o[1]){const t=Ru(o[0],e),i=Ru(o[1],e);if(t||i)return t&&i&&t.getTime()>i.getTime()?{from:i,to:t}:{from:t,to:i}}}return{from:Ru(i,e),to:null}}(e,{locale:this.resolvedLocale,monthFormat:"2-digit"});t.from&&(this.fromSegments=Bu(ku(t.from))),t.to?this.toSegments=Bu(ku(t.to)):t.from&&!t.to&&"to"===i&&(this.toSegments=Bu(ku(t.from)),this.fromSegments=Bu(this._value.split("/")[0]??null))}else{const t=Ru(e,{locale:this.resolvedLocale,monthFormat:"2-digit"});t&&(this.segments=Bu(ku(t)))}this.segmentsController.clearBuffers(),this.recomputeValue(),this.requestUpdate()},this.handleExpandButtonClick=()=>{this.open?this.hide():(this.moveFocusToCalendarOnShow=!0,this.show())},this.handleClearClick=t=>{t.stopPropagation(),this.clearValue()},this.handleClearMouseDown=t=>{t.preventDefault(),t.stopPropagation()},this.handleCalendarChange=t=>{t.stopPropagation();const e=this.calendar.value;this._value=e,this.valueHasChanged=!0,this.segmentsController.clearBuffers(),this.syncSegmentsFromCanonical(),this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),e!==this.lastEmittedValue&&(this.lastEmittedValue=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})));("range"===this.mode?e.includes("/"):!!e)&&this.open&&this.hide()},this.handleCalendarInput=t=>{t.stopPropagation(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))},this.handleDefaultSlotChange=()=>{!this.didSSR||this.hasUpdated?this.updateForwardedDaySlots():this.updateComplete.then(()=>this.handleDefaultSlotChange())};const t=this.shadowRoot?.querySelector?.("[part~='popup']")?.id;
4473this.popupId=t||"wa-date-input-"+ ++tp,this.keyboardHelpId=`${this.popupId}-help`}static get validators(){const t=[Mh({validationElement:Object.assign(document.createElement("input"),{required:!0})}),{observedAttributes:["min","max"],checkValidity(t){const e={message:"",isValid:!0,invalidKeys:[]},{min:i,max:o}=t,a=t.value;if(!a||!i&&!o)return e;const s="range"===t.mode?a.split("/"):[a];for(const t of s)if(Ku.test(t)){if(i&&t<i)return e.isValid=!1,e.invalidKeys.push("rangeUnderflow"),e.message=Xu(t,i,o),e;if(o&&t>o)return e.isValid=!1,e.invalidKeys.push("rangeOverflow"),e.message=Xu(t,i,o),e}return e}}];return[...super.validators,...t]}term(t,e){return this.localize.term(t)||e}get validationTarget(){return this.valueInput}get value(){return this.valueHasChanged?this._value:this._value||this.defaultValue||""}set value(t){const e=this.normalizeIncomingValue(t);if(e===this._value)return;const i=this._value;this._value=e,this.valueHasChanged=!0,this.hasUpdated?this.syncSegmentsFromCanonical():this.pendingValue=this._value,this.requestUpdate("value",i)}handleSizeChange(){He(this.localName,this.size)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners()}firstUpdated(){null!=this.pendingValue?(this._value=this.pendingValue,this.pendingValue=null):!this._value&&this.defaultValue&&(this._value=this.defaultValue),this.syncSegmentsFromCanonical(),this.updateForwardedDaySlots(),this.updateValidity(),this.lastEmittedValue=this._value}updated(t){super.updated?.(t),(t.has("mode")||t.has("value"))&&(this.customStates.set("blank",!this.value),this.customStates.set("range","range"===this.mode)),t.has("open")&&this.customStates.set("open",this.open)}handleDisabledChange(){this.disabled&&this.open&&(this.open=!1)}handleModeChange(){this.hasUpdated&&this.syncSegmentsFromCanonical()}async handleOpenChange(){if(this.open&&!this.disabled){const t=new Gd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);this.addOpenListeners(),this.popup.active=!0,await this.updateComplete,await qt(this.popup.popup,"show"),this.moveFocusToCalendarOnShow&&(this.moveFocusToCalendarOnShow=!1,this.calendar?.focus({preventScroll:!0})),this.dispatchEvent(new Zd)}else{const t=new Qd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);this.removeOpenListeners(),await qt(this.popup.popup,"hide"),this.popup.active=!1,this.dispatchEvent(new Jd);const e=this.shadowRoot?.activeElement;e&&this.popup?.contains(e)&&this.focusActiveSegment()}}focus(t){const e=this.segmentsController.findFocusableSegment((t,e)=>null==this.getGroupSegments(t)[e]);e?.focus(t)}blur(){const t=this.shadowRoot?.activeElement;t?.blur()}async show(){this.open||this.disabled||(this.open=!0,await Nt(this,"wa-after-show"))}async hide(){this.open&&!this.disabled&&(this.open=!1,await Nt(this,"wa-after-hide"))}get valueAsDate(){return"single"!==this.mode?null:xu(this.value)}get valueAsRange(){return"range"!==this.mode?{from:null,to:null}:Su(this.value)}clear(){this.disabled||this.readonly||this.clearValue()}formResetCallback(){this._value=this.defaultValue,this.valueHasChanged=!1,this.segmentsController.clearBuffers(),this.syncSegmentsFromCanonical(),super.formResetCallback(),this.lastEmittedValue=this._value,this.requestUpdate()}formStateRestoreCallback(t){"string"==typeof t&&(this._value=t,this.hasUpdated?this.syncSegmentsFromCanonical():this.pendingValue=t,this.requestUpdate()),this.updateValidity()}get resolvedLocale(){return this.localize.lang()||"en"}get isRtl(){return"rtl"===this.localize.dir()}getLayout(){return function(t){const e=t||"en",i=Vu.get(e);if(i)return i;const o=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit",calendar:"gregory",numberingSystem:"latn"}).formatToParts(new Date(2026,0,23)),a=[],s=[];for(const t of o)"year"===t.type||"month"===t.type||"day"===t.type?(a.push({kind:"segment",field:t.type}
4473),s.push(t.type)):"literal"===t.type&&a.push({kind:"literal",text:t.value});if(3!==s.length){const t={tokens:[{kind:"segment",field:"month"},{kind:"literal",text:"/"},{kind:"segment",field:"day"},{kind:"literal",text:"/"},{kind:"segment",field:"year"}],order:["month","day","year"]};return Vu.set(e,t),t}const n={tokens:a,order:s};return Vu.set(e,n),n}(this.resolvedLocale)}normalizeIncomingValue(t){if(null==t)return"";if("string"==typeof t)return t;if(t instanceof Date)return ku(t);if("object"==typeof t&&null!==t){const e=t,i=e.from?this.normalizeIncomingValue(e.from):"",o=e.to?this.normalizeIncomingValue(e.to):"";return i&&o?`${i}/${o}`:i||o||""}return""}syncSegmentsFromCanonical(){if(this.segmentsController.clearBuffers(),"range"===this.mode){const t=function(t){if(!t)return{from:Bu(null),to:Bu(null)};const[e,i]=t.split("/");return{from:Bu(e),to:Bu(i)}}(this._value);this.fromSegments=t.from,this.toSegments=t.to,this.segments={year:null,month:null,day:null}}else this.segments=Bu(this._value),this.fromSegments={year:null,month:null,day:null},this.toSegments={year:null,month:null,day:null};this.updateHiddenInput()}updateHiddenInput(){this.valueInput&&(this.valueInput.value=this._value),this.setValue(this._value||null)}recomputeValue(){const t=this._value;let e;if(e="range"===this.mode?function(t,e){const i=Hu(t),o=Hu(e);if(i&&o){const t=xu(i),e=xu(o);return t.getTime()<=e.getTime()?`${i}/${o}`:`${o}/${i}`}return i||o||""}(this.fromSegments,this.toSegments):Hu(this.segments),e!==t&&(this._value=e,this.valueHasChanged=!0,this.updateHiddenInput(),this.updateValidity()),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),e!==this.lastEmittedValue&&(this.lastEmittedValue=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))),"single"===this.mode){const t=xu(e);t&&this.calendar?.goToDate(t)}}getGroupSegments(t){return"from"===t?this.fromSegments:"to"===t?this.toSegments:this.segments}setGroupSegments(t,e){"from"===t?this.fromSegments=e:"to"===t?this.toSegments=e:this.segments=e}getBuffer(t,e){return this.segmentsController.getBuffer(t,e)}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),Nh(this)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),Hh(this)}focusActiveSegment(){const t=this.segmentsController.getActiveSegment();if(t){const e=this.segmentsController.segmentElementFor(t.group,t.field);if(e)return void e.focus({preventScroll:!0})}this.segmentsController.findFocusableSegment((t,e)=>null==this.getGroupSegments(t)[e])?.focus({preventScroll:!0})}clearValue(){!this._value&&Nu(this.segments)&&Nu(this.fromSegments)&&Nu(this.toSegments)||(this._value="",this.valueHasChanged=!0,this.segmentsController.clearBuffers(),this.syncSegmentsFromCanonical(),this.updateValidity(),this.dispatchEvent(new kc),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.lastEmittedValue="",this.focus())}updateForwardedDaySlots(){const t=/^day-\d{4}-\d{2}-\d{2}$/,e=new Set;for(const i of Array.from(this.children)){const o=i.getAttribute("slot");o&&t.test(o)&&e.add(o)}const i=Array.from(e).sort();i.join(",")!==this.forwardedDaySlots.join(",")&&(this.forwardedDaySlots=i)}placeholderFor(t){return"year"===t?"yyyy":"month"===t?"mm":"dd"}fieldLabelFor(t){const e="year"===t?"Year":"month"===t?"Month":"Day";return this.term(t,e)}segmentAriaLabel(t,e){const i=this.fieldLabelFor(e);return"from"===t?`${this.term("startDate","Start date")} ${i}`:"to"===t?`${this.term("endDate","End date")} ${i}`:i}segmentAriaValueText(t,e){const i=this.getGroupSegments(t)[e],o=this.getBuffer(t,e);if(o)return o;if(null==i)return this.term("empty","Empty");if("month"===e)try{return new Intl.DateTimeFormat(this.resolvedLocale,{month:"long",calendar:"gregory"}).format(new Date(2026,i-1,1))}catch{return String(i)}return String(i)}render(){const t=this.hasUpdated?this.hasSlotController.test("label"):this.withLabel,e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,i=!!this.label||!!t,o=!!this.hint||!!e,a=!!this._value,s=this.getLayout(),n=this.label||this.term("date","Date");return K` 4474 <div 4475 part="form-control" 4476 class=${ce({"form-control":!0,"form-control-has-label":i})} 4477 > 4478 <label 4479 id="label" 4480 part="form-control-label label" 4481 class=${ce({label:!0,"has-label":i})} 4482 aria-hidden=${i?"false":"true"} 4483 @click=${()=>this.focus()} 4484 > 4485 <slot name="label">${this.label}</slot> 4486 </label> 4487 4488 <div part="form-control-input" class="form-control-input"> 4489 <wa-popup 4490 class=${ce({"date-input-popup":!0,open:this.open})} 4491 placement=${this.placement} 4492 distance=${this.distance} 4493 ?active=${this.open} 4494 flip 4495 shift 4496 > 4497 <div 4498 part="base date-input input-wrapper" 4499 class="input-wrapper" 4500 slot="anchor" 4501 @pointerdown=${this.handleInputWrapperPointerDown} 4502 > 4503 <slot name="start" part="start" class="start"></slot> 4504 4505 <div 4506 part="input" 4507 class="segments" 4508 role="group" 4509 aria-labelledby=${i?"label":J} 4510 aria-label=${i?J:n} 4511 > 4512 ${"range"===this.mode?this.renderRangeSegments(s):this.renderSegmentGroup("single",s)} 4513 </div> 4514
4515 <span id=${this.keyboardHelpId} class="visually-hidden"> 4516 ${this.term("datePickerKeyboardHelp","Use arrow keys to change values; press Alt+Down Arrow to open the calendar.")} 4517 </span> 4518 4519 <input 4520 class="value-input" 4521 type="text" 4522 tabindex="-1" 4523 aria-hidden="true" 4524 .value=${this._value} 4525 value=${this._value} 4526 ?disabled=${this.disabled} 4527 ?required=${this.required} 4528 autocomplete=${We(this.autocomplete||void 0)} 4529 /> 4530 4531 ${this.withClear&&a?K`<button 4532 part="clear-button" 4533 type="button" 4534 class="clear-button" 4535 aria-label=${this.localize.term("clearEntry")} 4536 tabindex="-1" 4537 @mousedown=${this.handleClearMouseDown} 4538 @click=${this.handleClearClick} 4539 > 4540 <slot name="clear-icon"> 4541 <wa-icon name="circle-xmark" library="system" variant="regular"></wa-icon> 4542 </slot> 4543 </button>`:J} 4544 4545 <slot name="end" part="end" class="end"></slot> 4546 4547 <button 4548 part="expand-button" 4549 type="button" 4550 class="expand-button" 4551 aria-label=${this.open?this.term("closeCalendar","Close calendar"):this.term("chooseDate","Choose date")} 4552 aria-haspopup="dialog" 4553 aria-expanded=${this.open?"true":"false"} 4554 aria-controls=${this.popupId} 4555 ?disabled=${this.disabled} 4556 @click=${this.handleExpandButtonClick} 4557 > 4558 <slot name="expand-icon" part="expand-icon" class="expand-icon"> 4559 <wa-icon library="system" name="calendar"></wa-icon> 4560 </slot> 4561 </button> 4562 </div> 4563 4564 <div 4565 id=${this.popupId} 4566 part="popup" 4567 class="popup-body" 4568 role="dialog" 4569 aria-modal="true" 4570 aria-label=${this.term("chooseDate","Choose date")} 4571 > 4572 <wa-date-picker 4573 part="date-picker" 4574 exportparts="base:date-picker__base,header:date-picker__header,title:date-picker__title,nav:date-picker__nav,previous:date-picker__previous,next:date-picker__next,months:date-picker__months,month:date-picker__month,month-label:date-picker__month-label,weekdays:date-picker__weekdays,weekday:date-picker__weekday,weeknumbers:date-picker__weeknumbers,weeknumber:date-picker__weeknumber,grid:date-picker__grid,day:date-picker__day,day-today:date-picker__day-today,day-outside:date-picker__day-outside,day-weekend:date-picker__day-weekend,day-disabled:date-picker__day-disabled,day-selected:date-picker__day-selected,day-range-start:date-picker__day-range-start,day-range-end:date-picker__day-range-end,day-range-inner:date-picker__day-range-inner,day-range-preview:date-picker__day-range-preview,day-label:date-picker__day-label,day-placeholder:date-picker__day-placeholder,view-grid:date-picker__view-grid,view-row:date-picker__view-row,view-cell:date-picker__view-cell,view-item:date-picker__view-item,view-item-today:date-picker__view-item-today,view-item-selected:date-picker__view-item-selected,view-item-disabled:date-picker__view-item-disabled,footer:date-picker__footer" 4575 .mode=${this.mode} 4576 .value=${this._value} 4577 value=${this._value} 4578 min=${this.min} 4579 max=${this.max} 4580 today=${this.today} 4581 first-day-of-week=${this.firstDayOfWeek} 4582 .disabledDates=${this.disabledDates} 4583 disabled-days-of-week=${this.disabledDaysOfWeek} 4584 ?disable-past=${this.disablePast} 4585 ?disable-future=${this.disableFuture} 4586 min-range=${this.minRange} 4587 max-range=${this.maxRange} 4588 .isDateDisabled=${this.isDateDisabled} 4589 .dayContent=${this.dayContent} 4590 months=${this.months} 4591 page-by=${this.pageBy} 4592 ?with-outside-days=${this.withOutsideDays} 4593 ?with-week-numbers=${this.withWeekNumbers} 4594 weekday-format=${this.weekdayFormat} 4595 ?readonly=${this.readonly} 4596 @change=${this.handleCalendarChange}
4597 @input=${this.handleCalendarInput} 4598 > 4599 <slot name="footer" slot="footer"></slot> 4600 <slot name="previous-icon" slot="previous-icon"> 4601 <wa-icon library="system" name="chevron-left" variant="solid"></wa-icon> 4602 </slot> 4603 <slot name="next-icon" slot="next-icon"> 4604 <wa-icon library="system" name="chevron-right" variant="solid"></wa-icon> 4605 </slot> 4606 ${this.forwardedDaySlots.map(t=>K`<slot name=${t} slot=${t}></slot>`)} 4607 </wa-date-picker> 4608 </div> 4609 </wa-popup> 4610 </div> 4611 4612 <slot 4613 id="hint" 4614 name="hint" 4615 part="hint" 4616 class=${ce({"has-slotted":o})} 4617 aria-hidden=${o?"false":"true"} 4618 > 4619 ${this.hint} 4620 </slot> 4621 4622 <slot class="hidden-children" @slotchange=${this.handleDefaultSlotChange}></slot> 4623 </div> 4624 `}renderSegmentGroup(t,e){let i=!1;const o=[];for(let a=0;a<e.tokens.length;a++){const s=e.tokens[a];if("literal"===s.kind)o.push(this.renderLiteral(s.text));else{const e=this.segmentsController.getActiveSegment(),a=!i&&(null==e?t===("range"===this.mode?"from":"single"):e.group===t&&e.field===s.field);a&&(i=!0),o.push(this.renderSegment(t,s.field,a))}}return o}renderRangeSegments(t){return[...this.renderSegmentGroup("from",t),K`<span part="range-separator segment-literal" class="segment-literal range-separator" aria-hidden="true" 4625 > â </span 4626 >`,...this.renderSegmentGroup("to",t)]}renderLiteral(t){return K`<span part="segment-literal" class="segment-literal" aria-hidden="true">${t}</span>`}renderSegment(t,e,i){const o=this.getGroupSegments(t),a=this.getBuffer(t,e),s=o[e],n=function(t,e,i,o){return i?"year"===t?i:i.padStart(2,"0"):null==e?o:"year"===t?String(e).padStart(4,"0"):String(e).padStart(2,"0")}(e,s,a,this.placeholderFor(e)),r=null==s&&!a,l=qu(e,o),h=this.segmentAriaValueText(t,e);return K`<span 4627 part="segment" 4628 class=${ce({segment:!0,empty:r,[`segment-${e}`]:!0})} 4629 data-group=${t} 4630 data-segment=${e} 4631 role="spinbutton" 4632 tabindex=${this.disabled?-1:i?0:-1} 4633 aria-label=${this.segmentAriaLabel(t,e)} 4634 aria-valuemin=${l.min} 4635 aria-valuemax=${l.max} 4636 aria-valuenow=${We(s??void 0)} 4637 aria-valuetext=${h} 4638 aria-readonly=${this.readonly?"true":"false"} 4639 aria-disabled=${this.disabled?"true":"false"} 4640 aria-describedby=${this.keyboardHelpId} 4641 inputmode="numeric" 4642 @keydown=${this.handleSegmentKeyDown} 4643 @focus=${this.handleSegmentFocus} 4644 @blur=${this.handleSegmentBlur} 4645 @paste=${this.handleSegmentPaste} 4646 >${n}</span 4647 >`}};ep.css=[Ue,zh,Ju,Zu],ep.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt(".date-input-popup")],ep.prototype,"popup",2),kt([Dt(".value-input")],ep.prototype,"valueInput",2),kt([Dt('[part~="input"]')],ep.prototype,"inputGroup",2),kt([Dt("wa-date-picker")],ep.prototype,"calendar",2),kt([$t()],ep.prototype,"forwardedDaySlots",2),kt([$t()],ep.prototype,"segments",2),kt([$t()],ep.prototype,"fromSegments",2),kt([$t()],ep.prototype,"toSegments",2),kt([At({reflect:!0})],ep.prototype,"name",2),kt([$t()],ep.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],ep.prototype,"defaultValue",2),kt([At({type:Boolean})],ep.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],ep.prototype,"required",2),kt([At({type:Boolean,reflect:!0})],ep.prototype,"readonly",2),kt([At({reflect:!0})],ep.prototype,"size",2),kt([vt("size")],ep.prototype,"handleSizeChange",1),kt([At({reflect:!0})],ep.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],ep.prototype,"pill",2),kt([At()],ep.prototype,"label",2),kt([At({attribute:"hint"})],ep.prototype,"hint",2),kt([At()],ep.prototype,"autocomplete",2),kt([At({attribute:"with-clear",type:Boolean})],ep.prototype,"withClear",2),kt([At({attribute:"with-label",type:Boolean})],ep.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],ep.prototype,"withHint",2),kt([At({reflect:!0})],ep.prototype,"mode",2),kt([At({reflect:!0})],ep.prototype,"min",2),kt([At({reflect:!0})],ep.prototype,"max",2),kt([At({reflect:!0})],ep.prototype,"today",2),kt([At({attribute:"first-day-of-week",reflect:!0})],ep.prototype,"firstDayOfWeek",2),kt([At({attribute:"disabled-dates"})],ep.prototype,"disabledDates",2),kt([At({attribute:"disabled-days-of-week"})],ep.prototype,"disabledDaysOfWeek",2),kt([At({attribute:"disable-past",type:Boolean,reflect:!0})],ep.prototype,"disablePast",2),kt([At({attribute:"disable-future",type:Boolean,reflect:!0})],ep.prototype,"disableFuture",2),kt([At({attribute:"min-range",type:Number,reflect:!0})],ep.prototype,"minRange",2),kt([At({attribute:"max-range",type:Number,reflect:!0})],ep.prototype,"maxRange",2),kt([At({attribute:!1})],ep.prototype,"isDateDisabled",2),kt([At({attribute:!1})],ep.prototype,"dayContent",2),kt([At({type:Number,reflect:!0})],ep.prototype,"months",2),kt([At({attribute:"page-by",reflect:!0})],ep.prototype,"pageBy",2),kt([At({attribute:"with-outside-days",type:Boolean,reflect:!0})],ep.prototype,"withOutsideDays",2),kt([At({attribute:"with-week-numbers",type:Boolean,reflect:!0})],ep.prototype,"withWeekNumbers",2),kt([At({attribute:"weekday-format",reflect:!0})],ep.prototype,"weekdayFormat",2),kt([At({type:Boolean,reflect:!0})],ep.prototype,"open",2),kt([At({reflect:!0})],ep.prototype,"placement",2),kt([At({type:Number,reflect:!0})],ep.prototype,"distance",2),kt([vt("disabled",{waitUntilFirstUpdate:!0})],ep.prototype,"handleDisabledChange",1),kt([vt("mode")],ep.prototype,"handleModeChange",1),kt([vt("open",{waitUntilFirstUpdate:!0})],ep.prototype,"handleOpenChange",1),ep=kt([St("wa-date-input")],ep);
4647var ip=class extends Event{constructor(t){super("wa-view-change",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},op=class extends Event{constructor(t){super("wa-focus-day",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}};var ap={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function sp(t){if(null==t||""===t)return[];const e=String(t).toLowerCase().split(/\s+/).filter(Boolean),i=new Set;for(const t of e)t in ap&&i.add(ap[t]);return[...i]}var np=new Set(["US","CA","MX","BR","JP","PH","IL","AU","NZ","ZA","CO","VE","PE","EC","GT","HN","NI","SV","CR","PA","DO","PR","JM","TT","BS","BB","BZ","BO","BM","TW","HK","MO","SG","TH","ET","KE"]),rp=new Set(["SA","AE","QA","KW","BH","OM","YE","JO","SY","IQ","EG","SD","DZ","LY"]),lp=new Set(["SA","AE","QA","KW","BH","OM","YE","JO","EG","SD","DZ","LY","SY","IQ","IL"]);function hp(t){const e=function(t){try{return new Intl.Locale(t).maximize().region??null}catch{return null}}(t);let i=1;e&&np.has(e)?i=7:e&&rp.has(e)&&(i=6);return{firstDay:i,weekend:e&&lp.has(e)?[5,6]:[6,7]}}function cp(t){try{const e=new Intl.Locale(t),i="function"==typeof e.getWeekInfo?e.getWeekInfo():e.weekInfo;if(i&&"number"==typeof i.firstDay&&Array.isArray(i.weekend))return{firstDay:i.firstDay,weekend:i.weekend}}catch{}return hp(t)}function dp(t){return 7===t?0:t}
4647var up=h` 4648 :host { 4649 /* @internal Base size of a single cell */ 4650 --cell-size: 2.5em; 4651 4652 /* @internal Height of one day-grid row: the day button's min-height plus its cell padding. The weekday header row 4653 is pinned to the same height below. */ 4654 --row-height: calc(var(--cell-size) + 2 * var(--wa-space-3xs)); 4655 4656 /* @internal Intrinsic height of the day grid: 1 weekday header row + 6 week rows. The months and years views are 4657 pinned to this so switching views never shifts the calendar's height. */ 4658 --grid-height: calc(7 * var(--row-height)); 4659 4660 display: block; 4661 color: var(--wa-color-text-normal); 4662 font-family: var(--wa-font-family-body); 4663 line-height: var(--wa-line-height-normal); 4664 container-type: inline-size; 4665 container-name: date-picker; 4666 } 4667 4668 :host([disabled]) { 4669 pointer-events: none; 4670 opacity: 0.5; 4671 } 4672 4673 [part~='base'] { 4674 display: flex; 4675 flex-direction: column; 4676 gap: var(--wa-space-s); 4677 padding: var(--wa-space-s); 4678 background-color: var(--wa-color-surface-default); 4679 border: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border); 4680 border-radius: var(--wa-border-radius-m); 4681 user-select: none; 4682 -webkit-user-select: none; 4683 } 4684 4685 /* Header */ 4686 [part~='header'] { 4687 display: flex;
4688 align-items: center; 4689 gap: var(--wa-space-2xs); 4690 } 4691 4692 [part~='title'] { 4693 flex: 1 1 auto; 4694 display: inline-flex; 4695 align-items: center; 4696 justify-content: center; 4697 gap: 0.25em; 4698 background: transparent; 4699 border: none; 4700 border-radius: var(--wa-form-control-border-radius); 4701 padding: var(--wa-space-2xs) var(--wa-space-s); 4702 color: inherit; 4703 font: inherit; 4704 font-weight: var(--wa-font-weight-semibold); 4705 cursor: pointer; 4706 text-align: center; 4707 min-height: var(--cell-size); 4708 } 4709 4710 [part~='title']:hover { 4711 background-color: var(--wa-color-neutral-fill-quiet); 4712 } 4713 4714 [part~='title']:focus-visible { 4715 outline: var(--wa-focus-ring); 4716 outline-offset: var(--wa-focus-ring-offset); 4717 } 4718 4719 [part~='nav'] { 4720 display: inline-flex; 4721 gap: var(--wa-space-2xs); 4722 } 4723 4724 [part~='previous'], 4725 [part~='next'] { 4726 display: inline-flex; 4727 align-items: center; 4728 justify-content: center; 4729 background: transparent; 4730 border: none; 4731 border-radius: var(--wa-form-control-border-radius); 4732 padding: 0; 4733 color: inherit; 4734 cursor: pointer; 4735 width: var(--cell-size); 4736 height: var(--cell-size); 4737 font-size: inherit; 4738 } 4739 4740 [part~='previous']:hover:not(:disabled), 4741 [part~='next']:hover:not(:disabled) { 4742 background-color: var(--wa-color-neutral-fill-quiet); 4743 } 4744 4745 [part~='previous']:focus-visible, 4746 [part~='next']:focus-visible { 4747 outline: var(--wa-focus-ring); 4748 outline-offset: var(--wa-focus-ring-offset); 4749 } 4750 4751 [part~='previous']:disabled, 4752 [part~='next']:disabled { 4753 opacity: 0.4; 4754 cursor: not-allowed; 4755 } 4756 4757 /* Months container */ 4758 [part~='months'] { 4759 display: flex; 4760 gap: var(--wa-space-m); 4761 width: 100%; 4762 } 4763 4764 /* When the calendar isn't wide enough to fit two months side-by-side, stack them vertically so each 4765 month still has room to render comfortably. */ 4766 @container date-picker (max-width: 32em) { 4767 [part~='months'] { 4768 flex-direction: column; 4769 } 4770 } 4771 4772 [part~='month'] { 4773 display: flex; 4774 flex-direction: column; 4775 gap: var(--wa-space-2xs); 4776 flex: 1 1 0; 4777 min-width: 0; 4778 } 4779 4780 [part~='month-label'] { 4781 text-align: center; 4782 font-weight: var(--wa-font-weight-semibold); 4783 font-size: 0.875em; 4784 color: var(--wa-color-text-quiet); 4785 } 4786 4787 /* Day grid. Pinned to --grid-height (the same height the months/years view uses) so the calendar never shifts when 4788 switching views. A table given an explicit height distributes it across its rows; the row heights below keep the 4789 distribution predictable. */ 4790 [part~='grid'] { 4791 border-collapse: collapse; 4792 table-layout: fixed; 4793 width: 100%; 4794 height: var(--grid-height); 4795 } 4796 4797 [part~='grid'] th, 4798 [part~='grid'] td { 4799 padding: var(--wa-space-3xs) 0; 4800 text-align: center; 4801 } 4802 4803 [part~='weekday'] { 4804 /* Pinned to the same row height as a day row so the grid is a predictable 7 Ã --row-height. */ 4805 height: var(--row-height); 4806 box-sizing: border-box; 4807 font-size: 0.75em; 4808 font-weight: var(--wa-font-weight-normal); 4809 color: var(--wa-color-text-quiet); 4810 text-transform: uppercase; 4811 letter-spacing: 0.05em; 4812 } 4813 4814 [part~='weeknumber'] { 4815 font-size: 0.75em; 4816 font-weight: var(--wa-font-weight-normal); 4817 color: var(--wa-color-text-quiet); 4818 padding-inline-end: var(--wa-space-2xs) !important; 4819 border-inline-end: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border); 4820 } 4821 4822 /* Day-cell placeholder used by trailing rows so the grid is always 6 rows tall. Matches the day button's vertical 4823 footprint so the overall calendar height never shifts. */ 4824 [part~='day-placeholder'] { 4825 display: block; 4826 min-height: var(--cell-size); 4827 } 4828 4829 /* Day cell button */ 4830 [part~='day'] { 4831 display: flex;
4832 align-items: center; 4833 justify-content: center; 4834 width: 100%; 4835 min-height: var(--cell-size); 4836 background: transparent; 4837 border: none; 4838 border-radius: var(--wa-form-control-border-radius); 4839 color: inherit; 4840 font: inherit; 4841 font-size: inherit; 4842 cursor: pointer; 4843 padding: 0; 4844 } 4845 4846 [part~='day']:hover:not([data-disabled]):not([data-out-of-reach]):not([data-selected]):not([data-range-start]):not( 4847 [data-range-end] 4848 ):not([data-range-inner]):not([data-range-preview]) { 4849 background-color: var(--wa-color-neutral-fill-quiet); 4850 } 4851 4852 [part~='day'][data-out-of-reach] { 4853 cursor: not-allowed; 4854 } 4855 4856 [part~='day']:focus-visible { 4857 outline: var(--wa-focus-ring); 4858 outline-offset: calc(-1 * var(--wa-focus-ring-width, 2px)); 4859 } 4860 4861 [part~='day'][data-today] { 4862 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-neutral-border-quiet); 4863 } 4864 4865 [part~='day'][data-outside] { 4866 color: var(--wa-color-text-quiet); 4867 opacity: 0.6; 4868 } 4869 4870 [part~='day'][data-disabled] { 4871 color: var(--wa-color-text-quiet); 4872 opacity: 0.4; 4873 cursor: not-allowed; 4874 } 4875 4876 /* Selection styling */ 4877 [part~='day'][data-selected], 4878 [part~='day'][data-range-start], 4879 [part~='day'][data-range-end] { 4880 background-color: var(--wa-color-brand-fill-loud); 4881 border: none; 4882 color: var(--wa-color-brand-on-loud); 4883 } 4884 4885 [part~='day'][data-selected]:hover, 4886 [part~='day'][data-range-start]:hover, 4887 [part~='day'][data-range-end]:hover { 4888 background-color: var(--wa-color-brand-fill-loud); 4889 } 4890 4891 /* Range middle + hover preview */ 4892 [part~='day'][data-range-inner], 4893 [part~='day'][data-range-preview] { 4894 background-color: var(--wa-color-brand-fill-quiet); 4895 color: var(--wa-color-brand-on-quiet); 4896 border-radius: 0; 4897 } 4898 4899 /* Interior range cells are square by default; the row-edge and endpoint rules below selectively restore radii. Each 4900 selector here is written with matching specificity so source order alone decides the winner â later rules (row 4901 edges, then endpoints) override earlier ones. */ 4902 td[data-in-range] [part~='day'] { 4903 border-radius: 0; 4904 } 4905 4906 td[data-in-range] [part~='day']:hover:not([data-selected]):not([data-disabled]) { 4907 background-color: var(--wa-color-brand-fill-normal); 4908 } 4909 4910 /* Soften the range fill where it meets a row edge. When a range spans multiple weeks, the fill block ends abruptly at 4911 the first/last cell of a row, leaving sharp corners. Round the leading edge of a range cell that starts a row (or 4912 follows a non-range cell), and the trailing edge of one that ends a row (or precedes a non-range cell). The 4913 "th + td" selector covers the case where the week-numbers column shifts the first day cell off :first-child. */ 4914 td[data-in-range]:first-child [part~='day'], 4915 th + td[data-in-range] [part~='day'], 4916 td:not([data-in-range]) + td[data-in-range] [part~='day'] { 4917 border-start-start-radius: var(--wa-form-control-border-radius); 4918 border-end-start-radius: var(--wa-form-control-border-radius); 4919 } 4920 4921 td[data-in-range]:last-child [part~='day'], 4922 td[data-in-range]:has(+ td:not([data-in-range])) [part~='day'] { 4923 border-start-end-radius: var(--wa-form-control-border-radius); 4924 border-end-end-radius: var(--wa-form-control-border-radius); 4925 } 4926 4927 /* Range endpoints: round the outward-facing side fully, square the side facing the range fill. These
4927come last so 4928 they win over the row-edge rules above at the true endpoints. */ 4929 td[data-range-start] [part~='day'] { 4930 border-start-start-radius: var(--wa-form-control-border-radius); 4931 border-end-start-radius: var(--wa-form-control-border-radius); 4932 border-start-end-radius: 0; 4933 border-end-end-radius: 0; 4934 } 4935 4936 td[data-range-end] [part~='day'] { 4937 border-start-end-radius: var(--wa-form-control-border-radius); 4938 border-end-end-radius: var(--wa-form-control-border-radius); 4939 border-start-start-radius: 0; 4940 border-end-start-radius: 0; 4941 } 4942 4943 /* Single-day range (start === end, e.g. hovering the anchor itself): restore full radius. */ 4944 td[data-range-start][data-range-end] [part~='day'] { 4945 border-radius: var(--wa-form-control-border-radius); 4946 } 4947 4948 /* Year / month grid view. Pinned to the day grid's height (--grid-height) and given equal auto-rows so its 4 rows 4949 stretch to fill that space â switching views never shifts height. min-height keeps it flexible if the grid's content 4950 ever needs more room. */ 4951 [part~='view-grid'] { 4952 display: grid; 4953 grid-template-columns: repeat(3, 1fr); 4954 grid-auto-rows: 1fr; 4955 gap: var(--wa-space-2xs); 4956 min-height: var(--grid-height); 4957 } 4958 4959 /* The row and cell wrappers exist only to satisfy the ARIA grid structure (grid â row â gridcell); 4960 both stay transparent to layout so the view-item buttons remain direct CSS Grid items of view-grid. */ 4961 [part~='view-row'], 4962 [part~='view-cell'] { 4963 display: contents; 4964 } 4965 4966 [part~='view-item'] { 4967 display: inline-flex;
4968 align-items: center; 4969 justify-content: center; 4970 background: transparent; 4971 border: none; 4972 border-radius: var(--wa-form-control-border-radius); 4973 color: inherit; 4974 font: inherit; 4975 cursor: pointer; 4976 padding: var(--wa-space-s); 4977 min-height: 3em; 4978 } 4979 4980 [part~='view-item']:hover:not([data-disabled]):not([data-selected]) { 4981 background-color: var(--wa-color-neutral-fill-quiet); 4982 } 4983 4984 [part~='view-item'][data-selected]:hover { 4985 background-color: var(--wa-color-brand-fill-loud); 4986 color: var(--wa-color-brand-on-loud); 4987 } 4988 4989 [part~='view-item']:focus-visible { 4990 outline: var(--wa-focus-ring); 4991 outline-offset: var(--wa-focus-ring-offset); 4992 } 4993 4994 /* "Today" = the current month/year. Matches today's day in the day grid with a subtle, neutral border. */ 4995 [part~='view-item'][data-today] { 4996 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-neutral-border-quiet); 4997 } 4998 4999 [part~='view-item'][data-selected] { 5000 background-color: var(--wa-color-brand-fill-loud); 5001 color: var(--wa-color-brand-on-loud); 5002 } 5003 5004 [part~='view-item'][data-disabled] { 5005 opacity: 0.4; 5006 cursor: not-allowed; 5007 } 5008 5009 [part~='footer']:not(:empty) { 5010 display: flex;
5011 align-items: center; 5012 gap: var(--wa-space-s); 5013 padding-top: var(--wa-space-s); 5014 border-top: var(--wa-border-width-s) var(--wa-border-style) var(--wa-color-surface-border); 5015 } 5016`,pp=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.mode="single",this._value="",this.min="",this.max="",this.today="",this.focusedDate="",this.view="days",this.months=1,this.pageBy="months",this.firstDayOfWeek="auto",this.withOutsideDays=!1,this.withWeekNumbers=!1,this.weekdayFormat="short",this.disabled=!1,this.readonly=!1,this._disabledDatesRaw="",this._disabledDates=[],this.disabledDaysOfWeek="",this.disablePast=!1,this.disableFuture=!1,this.minRange=0,this.maxRange=0,this.size="m",this.locale="",this.rangeAnchor=null,this.rangeCommittedValue="",this.hoverDate=null,this.viewAnchor=null,this.focusedMonth=null,this.focusedYear=null,this.liveAnnouncement="",this.handleGridMouseLeave=()=>{"range"===this.mode&&this.rangeAnchor&&(this.hoverDate=null)}}get value(){return this._value}set value(t){const e=this.normalizeValue(t);if(e===this._value)return;const i=this._value;this._value=e,this.requestUpdate("value",i)}get disabledDates(){return this._disabledDatesRaw}set disabledDates(t){this._disabledDatesRaw=t??"",this._disabledDates=function(t){if(null==t||""===t)return[];const e=Array.isArray(t)?t:t.split(/\s+/),i=[];for(const t of e){if(t instanceof Date){isNaN(t.getTime())||i.push(new Date(t.getFullYear(),t.getMonth(),t.getDate()));continue}const e=xu(String(t).trim());e&&i.push(e)}return i}(t),this.requestUpdate("disabledDates")}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.updateCustomStates(),this.didSSR&&!this.hasUpdated&&this.updateComplete.then(()=>{this.requestUpdate()})}willUpdate(t){if(super.willUpdate(t),(t.has("disabled")||t.has("readonly")||t.has("mode"))&&this.updateCustomStates(),!this.viewAnchor){const t=this.resolvedFocusedDate();this.viewAnchor=new Date(t.getFullYear(),t.getMonth(),1)}}updateCustomStates(){this.customStates.set("disabled",this.disabled),this.customStates.set("readonly",this.readonly),this.customStates.set("range","range"===this.mode)}handleModeChange(t,e){if(this.rangeAnchor=null,this.hoverDate=null,this.rangeCommittedValue="",this.liveAnnouncement="",this.viewAnchor=null,void 0!==e){const t=this.normalizeValue(this._value);t!==this._value&&(this._value=t)}}focus(t){const e=this.base?.querySelector('[part~="day"][tabindex="0"]');e?e.focus(t):super.focus(t)}goToDate(t){const e=Cu(t);e&&(this.focusedDate=ku(e),this.setViewAnchor(new Date(e.getFullYear(),e.getMonth(),1)))}goToToday(){this.goToDate(this.resolvedToday())}clear(){this.disabled||this.readonly||(this._value||this.rangeAnchor)&&(this._value="",this.rangeAnchor=null,this.hoverDate=null,this.rangeCommittedValue="",this.liveAnnouncement="",this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.announceSelection())}get valueAsDate(){return"single"!==this.mode?null:xu(this._value)}get valueAsRange(){return"range"!==this.mode?{from:null,to:null}:Su(this._value)}normalizeValue(t){if(null==t||""===t)return"";if("single"===this.mode){if(t instanceof Date)return ku(t);if("string"==typeof t){const e=Su(t).from;return e?ku(e):""}return""}if("string"==typeof t){return _u(Su(t))}if(t instanceof Date)return ku(t);if("object"==typeof t){const e=t;return _u({from:Cu(e.from??null),to:Cu(e.to??null)})}return""}resolvedLocale(){return this.didSSR&&!this.hasUpdated?this.locale||this.lang||"en":this.locale||this.lang||("undefined"!=typeof document?document.documentElement.lang:"")||"en"}resolvedToday(){return xu(this.today)??function(){const t=new Date;return new Date(t.getFullYear(),t.getMonth(),t.getDate())}()}resolvedFirstDay(){const t={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},e=String(this.firstDayOfWeek??"").toLowerCase();if(e in t)return t[e];if(this.didSSR&&!this.hasUpdated){const t=this.shadowRoot?.querySelector?.("[data-first-day]")?.getAttribute?.("data-first-day");if(null!=t)return Number(t)}return dp(cp(this.resolvedLocale()).firstDay)}resolvedWeekendDays(){if(this.didSSR&&!this.hasUpdated){const t=this.shadowRoot?.querySelector?.("[data-weekend-days]")?.getAttribute("data-weekend-days");if(t)return t.split(/\s+/).map(Number)}return cp(this.resolvedLocale()).weekend.map(dp)}resolvedFocusedDate(){const t=xu(this.min),e=xu(this.max),i=xu(this.focusedDate);if(i)return Mu(i,t,e);if("single"===this.mode){const i=xu(this._value);if(i)return Mu(i,t,e)}else{const i=Su(this._value);if(i.from)return Mu(i.from,t,e)}return Mu(this.resolvedToday(),t,e)}resolvedViewAnchor(){const t=xu(this.min),e=xu(this.max);return this.viewAnchor?Mu(this.viewAnchor,t,e):this.resolvedFocusedDate()}isInVisibleRange(t){const e=this.resolvedViewAnchor(),i=this.resolvedMonthCount(),o=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+i,0);return t.getTime()>=o.getTime()&&t.getTime()<=a.getTime()}resolvedRovingFocus(){const t=this.resolvedFocusedDate();if(this.isInVisibleRange(t))return t;const e=this.resolvedViewAnchor();return new Date(e.getFullYear(),e.getMonth(),1)}resolvedFocusedMonth(){return null!==this.focusedMonth?this.focusedMonth:this.resolvedFocusedDate().getMonth()}resolvedFocusedYear(){return null!==this.focusedYear?this.focusedYear:this.resolvedFocusedDate().getFullYear()}buildDisabledChecker(){return function(t){const{min:e,max:i,disabledDates:o,disabledDaysOfWeek:a,disablePast:s,disableFuture:n,today:r,
5016isDateDisabled:l}=t,h=e?.getTime()??-1/0,c=i?.getTime()??1/0,d=r.getTime(),u=new Set(a),p=new Set(o.map(t=>t.getTime()));return function(t){const e=t.getTime();return e<h||e>c||!!(s&&e<d)||!!(n&&e>d)||!(!u.size||!u.has(t.getDay()))||!(!p.size||!p.has(e))||!(!l||!l(t))}}({min:xu(this.min),max:xu(this.max),disabledDates:this._disabledDates,disabledDaysOfWeek:sp(this.disabledDaysOfWeek),disablePast:this.disablePast,disableFuture:this.disableFuture,today:this.resolvedToday(),isDateDisabled:this.isDateDisabled})}resolvedMonthCount(t=this.months){return 2===Number(t)?2:1}pageStep(){return"months"===this.pageBy?this.resolvedMonthCount():1}handlePrevious(){if(this.disabled)return;const t=this.resolvedViewAnchor(),e=xu(this.min),i=xu(this.max);e&&this.isPageOutsideRange("previous",t,e,i)||this.setViewAnchor(this.getPageAnchor("previous",t))}handleNext(){if(this.disabled)return;const t=this.resolvedViewAnchor(),e=xu(this.min),i=xu(this.max);i&&this.isPageOutsideRange("next",t,e,i)||this.setViewAnchor(this.getPageAnchor("next",t))}getPageAnchor(t,e){const i="previous"===t?-1:1;return"days"===this.view?$u(e,i*this.pageStep()):"months"===this.view?Lu(e,1*i):Lu(e,12*i)}isPageOutsideRange(t,e,i,o){if("previous"===t&&!i)return!1;if("next"===t&&!o)return!1;if("days"===this.view){const a=this.pageStep();if("previous"===t){const t=Au(new Date(e.getFullYear(),e.getMonth(),1),-1);return!!i&&t.getTime()<i.getTime()}const s=new Date(e.getFullYear(),e.getMonth()+a,1);return!!o&&s.getTime()>o.getTime()}if("months"===this.view){const a=e.getFullYear();if("previous"===t){const t=new Date(a-1,11,31);return!!i&&t.getTime()<i.getTime()}const s=new Date(a+1,0,1);return!!o&&s.getTime()>o.getTime()}const a=12*Math.floor(e.getFullYear()/12);if("previous"===t){const t=new Date(a-1,11,31);return!!i&&t.getTime()<i.getTime()}const s=new Date(a+12,0,1);return!!o&&s.getTime()>o.getTime()}setViewAnchor(t){const e=xu(this.min),i=xu(this.max);this.viewAnchor=Mu(t,e,i)}handleTitleClick(){this.disabled||("days"===this.view?(this.setView("months"),this.queueFocus('[part~="view-item"][tabindex="0"]')):"months"===this.view?(this.setView("years"),this.queueFocus('[part~="view-item"][tabindex="0"]')):(this.setView("days"),this.queueFocus('[part~="day"][tabindex="0"]')))}handleTitleKeydown(t){if(this.disabled)return;["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)&&(t.preventDefault(),"days"===this.view?this.queueFocus('[part~="day"][tabindex="0"]'):(this.view,this.queueFocus('[part~="view-item"][tabindex="0"]')))}setView(t){if(this.view===t)return;const e=this.view;this.view=t,"months"===t?"days"===e&&(this.focusedMonth=this.resolvedFocusedDate().getMonth()):"years"===t?this.focusedYear=this.resolvedViewAnchor().getFullYear():(this.focusedMonth=null,this.focusedYear=null),this.dispatchEvent(new ip({view:t,date:this.resolvedFocusedDate()}))}handleDayClick(t,e){if(this.disabled||this.readonly||e)return;if("single"===this.mode&&!this.isInVisibleRange(t)){const e=xu(this.min),i=xu(this.max);this.viewAnchor=Mu(new Date(t.getFullYear(),t.getMonth(),1),e,i)}if("single"===this.mode){const e=ku(t);return void(e!==this._value&&(this._value=e,this.focusedDate=e,this.requestUpdate(),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.announceSelection()))}if(!this.rangeAnchor)return this.rangeCommittedValue=this._value,this.rangeAnchor=t,this.hoverDate=t,this.liveAnnouncement="",this._value=ku(t),this.focusedDate=this._value,void this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}));const i=this.rangeAnchor,o=t,a=i.getTime()<=o.getTime()?i:o,s=i.getTime()<=o.getTime()?o:i,n=Math.round((s.getTime()-a.getTime())/864e5)+1;if(this.maxRange>0&&n>this.maxRange){this.rangeAnchor=null,this.hoverDate=null;const t=this.rangeCommittedValue;return this.rangeCommittedValue="",this.liveAnnouncement="",void(t!==this._value&&(this._value=t,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))))}if(this.minRange>0&&n<this.minRange)return void this.announce(this.localize.term("rangeTooShort",this.minRange));const r=_u({from:a,to:s});this.rangeAnchor=null,this.hoverDate=null,this.rangeCommittedValue="",this.liveAnnouncement="",this._value=r,this.focusedDate=ku(s),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.announceSelection()}announce(t){this.liveAnnouncement=this.liveAnnouncement.endsWith("â")?t:t+"â"}announceSelection(){const t=this.resolvedLocale();if("range"===this.mode){const{from:e,to:i}=Su(this._value);if(!e&&!i)return void this.announce(this.localize.term("selectionCleared"));const o=new Intl.DateTimeFormat(t,{month:"long",day:"numeric",year:"numeric"}),a=e&&i?`${o.format(e)} â ${o.format(i)}`:o.format(e??i);return void this.announce(this.localize.term("selectedRangeLabel",a))}const e=xu(this._value);if(!e)return void this.announce(this.localize.term("selectionCleared"));const i=new Intl.DateTimeFormat(t,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(e);this.announce(this.localize.term("selectedDateLabel",i))}handleDayHover(t){if("range"!==this.mode)return;if(!this.rangeAnchor)return;const e=this.clampHoverDate(t);this.hoverDate&&Eu(this.hoverDate,e)||(this.hoverDate=e,this.dispatchEvent(new op({date:e})))}clampHoverDate(t){let e=Mu(t,xu(this.min),xu(this.max));if(!this.rangeAnchor)return e;const i=this.rangeAnchor,o=e.getTime()>=i.getTime()?1:-1;if(this.maxRange>0){const t=Au(i,(this.maxRange-1)*o);o>0&&e.getTime()>t.getTime()&&(e=t),o<0&&e.getTime()<t.getTime()&&(e=t)}if(this.minRange>0){const t=Au(i,(this.minRange-1)*o);o>0&&e.getTime()<t.getTime()&&(e=t),o<0&&e.getTime()>t.getTime()&&(e=t)}return Mu(e,xu(this.min),xu(this.max))}isOutOfReach(t){if("range"!==this.mode||!this.rangeAnchor||this.maxRange<=0)return!1;return Math.abs(Math.round((t.getTime()-this.rangeAnchor.getTime())/864e5))+1>this.maxRange}
5016handleEscape(){if("range"===this.mode&&this.rangeAnchor){this.rangeAnchor=null,this.hoverDate=null;const t=this.rangeCommittedValue;this.rangeCommittedValue="",t!==this._value&&(this._value=t,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})))}}handleDayKeydown(t,e,i){if(this.disabled)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"," ","Escape"].includes(t.key))return;if(t.preventDefault(),"Escape"===t.key)return void this.handleEscape();if("Enter"===t.key||" "===t.key)return void this.handleDayClick(e,i);const o="rtl"===this.localize.dir();let a=e;switch(t.key){case"ArrowLeft":a=Au(e,o?1:-1);break;case"ArrowRight":a=Au(e,o?-1:1);break;case"ArrowUp":a=Au(e,-7);break;case"ArrowDown":a=Au(e,7);break;case"Home":{const t=this.resolvedFirstDay(),i=(e.getDay()-t+7)%7;a=Au(e,-i);break}case"End":{const t=this.resolvedFirstDay(),i=6-(e.getDay()-t+7)%7;a=Au(e,i);break}case"PageUp":a=t.shiftKey?Lu(e,-1):$u(e,-1);break;case"PageDown":a=t.shiftKey?Lu(e,1):$u(e,1)}const s=xu(this.min),n=xu(this.max);a=Mu(a,s,n),this.focusedDate=ku(a),this.isInVisibleRange(a)||(this.viewAnchor=new Date(a.getFullYear(),a.getMonth(),1)),this.dispatchEvent(new op({date:a})),this.updateComplete.then(()=>{const t=this.base.querySelector(`[data-date="${ku(a)}"]`);t?.focus()}),"range"===this.mode&&this.rangeAnchor&&(this.hoverDate=a)}render(){const t=this.resolvedViewAnchor(),e=this.buildDisabledChecker(),i=this.resolvedLocale();return K` 5017 <div part="base date-picker" @mouseleave=${this.handleGridMouseLeave}> 5018 <slot name="header"> ${this.renderHeader(t,e)} </slot> 5019 5020 ${"days"===this.view?this.renderDaysView(t,e,i):"months"===this.view?this.renderMonthsView(t,e,i):this.renderYearsView(t,e)} 5021 5022 <slot name="footer" part="footer"></slot> 5023 5024 <span class="wa-visually-hidden" aria-live="polite">${this.liveAnnouncement}</span> 5025 </div> 5026 `}renderHeader(t,e){const i=this.resolvedLocale(),o=xu(this.min),a=xu(this.max);let s="",n="";if("days"===this.view){const e=this.resolvedMonthCount()>1;s=new Intl.DateTimeFormat(i,{month:e?void 0:"long",year:"numeric"}).format(t),n=this.localize.term("chooseMonth")}else if("months"===this.view)s=new Intl.DateTimeFormat(i,{year:"numeric"}).format(t),n=this.localize.term("chooseYear");else{const e=12*Math.floor(t.getFullYear()/12);s=`${e} â ${e+11}`,n=this.localize.term("chooseDecade")}const r=!!o&&this.isPageOutsideRange("previous",t,o,a),l=!!a&&this.isPageOutsideRange("next",t,o,a),h="days"===this.view?this.localize.term("previousMonth")||"Previous month":"months"===this.view?this.localize.term("previousYear")||"Previous year":this.localize.term("previousDecade")||"Previous decade",c="days"===this.view?this.localize.term("nextMonth")||"Next month":"months"===this.view?this.localize.term("nextYear")||"Next year":this.localize.term("nextDecade")||"Next decade";return K` 5027 <div part="header"> 5028 <button 5029 type="button" 5030 part="previous" 5031 aria-label=${h} 5032 ?disabled=${r||this.disabled} 5033 @click=${this.handlePrevious} 5034 > 5035 <slot name="previous-icon"> 5036 <wa-icon name="chevron-left" library="system" variant="solid"></wa-icon> 5037 </slot> 5038 </button> 5039 5040 <button 5041 type="button" 5042 part="title" 5043 aria-live="polite" 5044 aria-label=${n} 5045 ?disabled=${this.disabled} 5046 @click=${this.handleTitleClick} 5047 @keydown=${this.handleTitleKeydown} 5048 > 5049 ${s} 5050 </button> 5051 5052 <button 5053 type="button" 5054 part="next" 5055 aria-label=${c} 5056 ?disabled=${l||this.disabled} 5057 @click=${this.handleNext} 5058 > 5059 <slot name="next-icon"> 5060 <wa-icon name="chevron-right" library="system" variant="solid"></wa-icon> 5061 </slot> 5062 </button> 5063 </div> 5064 `}renderDaysView(t,e,i){let o=this.resolvedMonthCount();if(this.didSSR&&!this.hasUpdated){const t=this.shadowRoot?.querySelector?.("[part~='months']")?.getAttribute("data-month-count");t&&(o=this.resolvedMonthCount(Number(t)))}return K` 5065 <div part="months" data-month-count="${o}"> 5066 ${Array.from({length:o},(a,s)=>this.renderMonth($u(t,s),e,i,o>1))} 5067 </div> 5068 `}renderMonth(t,e,i,o){const a=this.resolvedFirstDay(),s=new Set(this.resolvedWeekendDays()),n=new Date(t.getFullYear(),t.getMonth(),1),r=(n.getDay()-a+7)%7,l=Au(n,-r),h=[];for(let t=0;t<6;t++){const e=[];for(let i=0;i<7;i++)e.push(Au(l,7*t+i));h.push(e)}const c=new Intl.DateTimeFormat(i,{weekday:this.weekdayFormat}),d=[];for(let t=0;t<7;t++){const e=Au(l,t);d.push({label:c.format(e),long:new Intl.DateTimeFormat(i,{weekday:"long"}).format(e)})}const u=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),p=this.readonly?`${u.format(t)}, ${this.localize.term("readonly")}`:u.format(t);return K` 5069 <div part="month" data-first-day="${a}" data-weekend-days="${[...s.values()].join(" ")}"> 5070 ${o?K`<div part="month-label">${u.format(t)}</div>`:J} 5071 <table part="grid" role="grid" aria-label=${p} aria-readonly=${this.readonly?"true":"false"}> 5072 <thead> 5073 <tr part="weekdays"> 5074 ${this.withWeekNumbers?K`<th part="weeknumbers" scope="col" aria-label="Week"></th>`:J} 5075 ${d.map(t=>K`<th part="weekday" scope="col" aria-label=${t.long}>${t.label}</th>`)} 5076 </tr> 5077 </thead> 5078 <tbody> 5079 ${h.map(o=>this.renderWeek(o,t,e,s,i))} 5080 </tbody> 5081 </table> 5082 </div> 5083 `}renderWeek(t,e,i,o,a){const s=this.withWeekNumbers?this.computeIsoWeek(t):null;return K` 5084 <tr role="row"> 5085 ${null!==s?K`<th part="weeknumber" scope="row">${s}</th>`:J} 5086 ${t.map(t=>
5086this.renderDay(t,e,i,o,a))} 5087 </tr> 5088 `}computeIsoWeek(t){const e=t.find(t=>4===t.getDay())??t[3],i=new Date(e.getFullYear(),e.getMonth(),e.getDate()),o=new Date(i.getFullYear(),0,4),a=(o.getDay()+6)%7;o.setDate(o.getDate()-a+3);const s=(i.getDay()+6)%7;return i.setDate(i.getDate()-s+3),1+Math.round((i.getTime()-o.getTime())/6048e5)}renderDay(t,e,i,o,a){const s=!function(t,e){return t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}(t,e),n=s&&!this.withOutsideDays,r=ku(t),l=this.resolvedToday(),h=Eu(t,l),c=i(t),d=this.resolvedRovingFocus(),u=Eu(t,d)&&!s,p=this.computeSelectionState(t),m=this.isOutOfReach(t),f=`day-${r}`,g={"data-in-range":p.inner||p.preview||p.start||p.end?"":void 0,"data-range-start":p.start?"":void 0,"data-range-end":p.end?"":void 0};if(n)return K`<td role="gridcell" aria-hidden="true"><span part="day-placeholder"></span></td>`;const b=["day"];return h&&b.push("day-today"),s&&b.push("day-outside"),o.has(t.getDay())&&b.push("day-weekend"),c&&b.push("day-disabled"),p.selected&&b.push("day-selected"),p.start&&b.push("day-range-start"),p.end&&b.push("day-range-end"),p.inner&&b.push("day-range-inner"),p.preview&&b.push("day-range-preview"),K` 5089 <td 5090 role="gridcell" 5091 aria-selected=${p.selected?"true":"false"} 5092 data-in-range=${We(g["data-in-range"])} 5093 data-range-start=${We(g["data-range-start"])} 5094 data-range-end=${We(g["data-range-end"])} 5095 > 5096 <button 5097 type="button" 5098 part=${b.join(" ")} 5099 data-date=${r} 5100 data-day-of-week=${["sun","mon","tue","wed","thu","fri","sat"][t.getDay()]} 5101 ?data-today=${h} 5102 ?data-outside=${s} 5103 ?data-weekend=${o.has(t.getDay())} 5104 ?data-disabled=${c} 5105 ?data-selected=${p.selected} 5106 ?data-range-start=${p.start} 5107 ?data-range-end=${p.end} 5108 ?data-range-inner=${p.inner} 5109 ?data-range-preview=${p.preview} 5110 ?data-out-of-reach=${m} 5111 aria-label=${this.dayAriaLabel(t,p,h)} 5112 aria-disabled=${c?"true":"false"} 5113 aria-current=${We(h?"date":void 0)} 5114 tabindex=${u?0:-1} 5115 @click=${()=>this.handleDayClick(t,c)} 5116 @mouseenter=${()=>this.handleDayHover(t)} 5117 @keydown=${e=>this.handleDayKeydown(e,t,c)} 5118 > 5119 <span part="day-label"> 5120 <slot name=${f}>${this.renderDayFallback(t)}</slot> 5121 </span> 5122 </button> 5123 </td> 5124 `}dayAriaLabel(t,e,i){const o=this.resolvedLocale(),a=[new Intl.DateTimeFormat(o,{weekday:"long",month:"long",day:"numeric",year:"numeric"}).format(t)];return i&&a.push(this.localize.term("today")),"single"===this.mode&&e.selected&&a.push(this.localize.term("selected")),a.join(", ")}renderDayFallback(t){if(this.dayContent){const e=this.dayContent(t);if(null!=e)return"string"==typeof e?iu(e):e}return t.getDate()}computeSelectionState(t){if("single"===this.mode){const e=xu(this._value);return{selected:!!e&&Eu(e,t),start:!1,end:!1,inner:!1,preview:!1}}if(this.rangeAnchor){const e=this.hoverDate??this.rangeAnchor,i=this.rangeAnchor,o=i.getTime()<=e.getTime()?i:e,a=i.getTime()<=e.getTime()?e:i,s=Eu(o,t),n=Eu(a,t);return{selected:s||n,start:s,end:n,inner:!1,preview:t.getTime()>o.getTime()&&t.getTime()<a.getTime()}}const{from:e,to:i}=Su(this._value),o=!!e&&Eu(e,t),a=!!i&&Eu(i,t);return{selected:o||a,start:o,end:a,inner:!!e&&!!i&&t.getTime()>e.getTime()&&t.getTime()<i.getTime(),preview:!1}}selectedMonthForView(t){const e=this.selectedDateForHighlight();return e&&e.getFullYear()===t?e.getMonth():null}selectedYearForView(){const t=this.selectedDateForHighlight();return t?t.getFullYear():null}selectedDateForHighlight(){if("single"===this.mode)return xu(this._value);return Su(this._value).from}renderMonthsView(t,e,i){const o=t.getFullYear(),a=new Intl.DateTimeFormat(i,{month:"short"}),s=new Intl.DateTimeFormat(i,{month:"long",year:"numeric"}),n=new Intl.DateTimeFormat(i,{year:"numeric"}).format(t),r=this.resolvedFocusedMonth(),l=this.selectedMonthForView(o),h=this.resolvedToday(),c=h.getFullYear()===o?h.getMonth():-1;return K` 5125 <div part="view-grid" role="grid" aria-label="${this.localize.term("chooseMonth")}, ${n}"> 5126 ${this.renderViewRows(12,t=>
5126{const i=new Date(o,t,1),n=this.isMonthFullyDisabled(o,t,e),h=l===t,d=r===t,u=c===t,p=["view-item"];return u&&p.push("view-item-today"),h&&p.push("view-item-selected"),n&&p.push("view-item-disabled"),K` 5127 <div role="gridcell" part="view-cell" aria-selected=${h?"true":"false"}> 5128 <button 5129 type="button" 5130 part=${p.join(" ")} 5131 data-month=${t} 5132 ?data-disabled=${n} 5133 ?data-selected=${h} 5134 ?data-today=${u} 5135 aria-disabled=${n?"true":"false"} 5136 aria-current=${We(u?"date":void 0)} 5137 aria-label=${s.format(i)} 5138 tabindex=${d?0:-1} 5139 @click=${()=>this.handleMonthPick(o,t,n)} 5140 @keydown=${e=>this.handleMonthKeydown(e,o,t,n)} 5141 > 5142 ${a.format(i)} 5143 </button> 5144 </div> 5145 `})} 5146 </div> 5147 `}renderViewRows(t,e){const i=[];for(let o=0;o<t;o+=3){const a=Array.from({length:Math.min(3,t-o)},(t,i)=>e(o+i));i.push(K`<div part="view-row" role="row">${a}</div>`)}return i}renderYearsView(t,e){const i=12*Math.floor(t.getFullYear()/12),o=i+11,a=this.resolvedFocusedYear(),s=this.selectedYearForView(),n=this.resolvedToday().getFullYear();return K` 5148 <div 5149 part="view-grid" 5150 role="grid" 5151 aria-label="${this.localize.term("chooseYear")}, ${i}â${o}" 5152 > 5153 ${this.renderViewRows(12,t=>{const o=i+t,r=this.isYearFullyDisabled(o,e),l=s===o,h=a===o,c=n===o,d=["view-item"];return c&&d.push("view-item-today"),l&&d.push("view-item-selected"),r&&d.push("view-item-disabled"),K` 5154 <div role="gridcell" part="view-cell" aria-selected=${l?"true":"false"}> 5155 <button 5156 type="button" 5157 part=${d.join(" ")} 5158 data-year=${o} 5159 ?data-disabled=${r} 5160 ?data-selected=${l} 5161 ?data-today=${c} 5162 aria-disabled=${r?"true":"false"} 5163 aria-current=${We(c?"date":void 0)} 5164 aria-label=${String(o)} 5165 tabindex=${h?0:-1} 5166 @click=${()=>this.handleYearPick(o,r)} 5167 @keydown=${t=>this.handleYearKeydown(t,o,r)} 5168 > 5169 ${o} 5170 </button> 5171 </div> 5172 `})} 5173 </div> 5174 `}handleMonthKeydown(t,e,i,o){if(this.disabled)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"," ","Escape"].includes(t.key))return;if(t.preventDefault(),"Escape"===t.key)return this.setView("days"),void this.queueFocus('[part~="day"][tabindex="0"]');if("Enter"===t.key||" "===t.key)return void this.handleMonthPick(e,i,o);const a="rtl"===this.localize.dir();let s=e,n=i;switch(t.key){case"ArrowLeft":n=i+(a?1:-1),n<0&&(n=0),n>11&&(n=11);break;case"ArrowRight":n=i+(a?-1:1),n<0&&(n=0),n>11&&(n=11);break;case"ArrowUp":n=Math.max(0,i-3);break;case"ArrowDown":n=Math.min(11,i+3);break;case"Home":{const e=3*Math.floor(i/3);n=t.ctrlKey||t.metaKey?0:e;break}case"End":{const e=3*Math.floor(i/3)+2;n=t.ctrlKey||t.metaKey?11:e;break}case"PageUp":s=e-1;break;case"PageDown":s=e+1}s!==e&&this.setViewAnchor(new Date(s,i,1)),this.focusedMonth=n,this.queueFocus(`[part~="view-item"][data-month="${n}"]`)}handleYearKeydown(t,e,i){if(this.disabled)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown","Enter"," ","Escape"].includes(t.key))return;if(t.preventDefault(),"Escape"===t.key)return this.setView("months"),void this.queueFocus('[part~="view-item"][tabindex="0"]');if("Enter"===t.key||" "===t.key)return void this.handleYearPick(e,i);const o="rtl"===this.localize.dir(),a=12*Math.floor(e/12),s=e-a;let n=e;switch(t.key){case"ArrowLeft":n=e+(o?1:-1);break;case"ArrowRight":n=e+(o?-1:1);break;case"ArrowUp":n=e-3;break;case"ArrowDown":n=e+3;break;case"Home":{const e=a+3*Math.floor(s/3);n=t.ctrlKey||t.metaKey?a:e;break}case"End":{const e=a+3*Math.floor(s/3)+2;n=t.ctrlKey||t.metaKey?a+11:e;break}case"PageUp":n=e-12;break;case"PageDown":n=e+12}if(12*Math.floor(n/12)!==a){const t=this.resolvedViewAnchor();this.setViewAnchor(new Date(n,t.getMonth(),1))}this.focusedYear=n,this.queueFocus(`[part~="view-item"][data-year="${n}"]`)}queueFocus(t){this.updateComplete.then(()=>{const e=this.base.querySelector(t);e?.focus()})}isMonthFullyDisabled(t,e,i){const o=new Date(t,e,1),a=new Date(t,e+1,0);return!this.anyEnabledInRange(o,a,i)}isYearFullyDisabled(t,e){const i=new Date(t,0,1),o=new Date(t,11,31);return!this.anyEnabledInRange(i,o,e)}anyEnabledInRange(t,e,i){const o=new Date(t.getFullYear(),t.getMonth(),t.getDate());for(;o.getTime()<=e.getTime();){if(!i(o))return!0;o.setDate(o.getDate()+1)}return!1}
5174handleMonthPick(t,e,i){if(i||this.disabled)return;this.setViewAnchor(new Date(t,e,1));const o=this.resolvedFocusedDate().getDate(),a=Math.min(o,Du(t,e));this.focusedDate=ku(new Date(t,e,a)),this.setView("days"),this.queueFocus('[part~="day"][tabindex="0"]')}handleYearPick(t,e){if(e||this.disabled)return;const i=this.resolvedFocusedDate(),o=i.getMonth();this.setViewAnchor(new Date(t,o,1));const a=Math.min(i.getDate(),Du(t,o));this.focusedDate=ku(new Date(t,o,a)),this.setView("months"),this.queueFocus('[part~="view-item"][tabindex="0"]')}};pp.css=[up,Rh,Ue],kt([Dt('[part~="base"]')],pp.prototype,"base",2),kt([At({reflect:!0})],pp.prototype,"mode",2),kt([At({reflect:!0})],pp.prototype,"value",1),kt([At({reflect:!0})],pp.prototype,"min",2),kt([At({reflect:!0})],pp.prototype,"max",2),kt([At({reflect:!0})],pp.prototype,"today",2),kt([At({attribute:"focused-date",reflect:!0})],pp.prototype,"focusedDate",2),kt([At({reflect:!0})],pp.prototype,"view",2),kt([At({type:Number,reflect:!0})],pp.prototype,"months",2),kt([At({attribute:"page-by",reflect:!0})],pp.prototype,"pageBy",2),kt([At({attribute:"first-day-of-week",reflect:!0})],pp.prototype,"firstDayOfWeek",2),kt([At({attribute:"with-outside-days",type:Boolean,reflect:!0})],pp.prototype,"withOutsideDays",2),kt([At({attribute:"with-week-numbers",type:Boolean,reflect:!0})],pp.prototype,"withWeekNumbers",2),kt([At({attribute:"weekday-format",reflect:!0})],pp.prototype,"weekdayFormat",2),kt([At({type:Boolean,reflect:!0})],pp.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],pp.prototype,"readonly",2),kt([At({attribute:"disabled-dates"})],pp.prototype,"disabledDates",1),kt([At({attribute:"disabled-days-of-week"})],pp.prototype,"disabledDaysOfWeek",2),kt([At({attribute:"disable-past",type:Boolean,reflect:!0})],pp.prototype,"disablePast",2),kt([At({attribute:"disable-future",type:Boolean,reflect:!0})],pp.prototype,"disableFuture",2),kt([At({attribute:"min-range",type:Number,reflect:!0})],pp.prototype,"minRange",2),kt([At({attribute:"max-range",type:Number,reflect:!0})],pp.prototype,"maxRange",2),kt([At({reflect:!0})],pp.prototype,"size",2),kt([vt("size")],pp.prototype,"handleSizeChange",1),kt([At({reflect:!0})],pp.prototype,"locale",2),kt([At({attribute:!1})],pp.prototype,"isDateDisabled",2),kt([At({attribute:!1})],pp.prototype,"dayContent",2),kt([$t()],pp.prototype,"rangeAnchor",2),kt([$t()],pp.prototype,"hoverDate",2),kt([$t()],pp.prototype,"viewAnchor",2),kt([$t()],pp.prototype,"focusedMonth",2),kt([$t()],pp.prototype,"focusedYear",2),kt([$t()],pp.prototype,"liveAnnouncement",2),kt([vt("mode")],pp.prototype,"handleModeChange",1),pp=kt([St("wa-date-picker")],pp);var mp=h` 5175 :host { 5176 --color: var(--wa-color-surface-border); 5177 --width: var(--wa-border-width-s); 5178 --spacing: var(--wa-space-m); 5179 --label-spacing: var(--wa-space-s); 5180 --label-offset: 0; 5181 } 5182 5183 :host(:not([orientation='vertical'])) { 5184 display: block; 5185 border-top: solid var(--width) var(--color); 5186 margin: var(--spacing) 0; 5187 } 5188 5189 :host([orientation='vertical']) { 5190 display: inline-block; 5191 height: 100%; 5192 border-inline-start: solid var(--width) var(--color); 5193 margin: 0 var(--spacing); 5194 min-block-size: 1lh; 5195 } 5196 5197 /* With a label, the host's border gives way to two lines that flank the label */ 5198 :host([with-label]) { 5199 align-items: center; 5200 gap: var(--label-spacing); 5201 border: none; 5202 } 5203 5204 :host([with-label]:not([orientation='vertical'])) { 5205 display: flex; 5206 } 5207 5208 :host([with-label][orientation='vertical']) { 5209 display: inline-flex; 5210 flex-direction: column; 5211 } 5212 5213 :host([with-label])::before, 5214 :host([with-label])::after { 5215 content: ''; 5216 flex: 1 1 0; 5217 } 5218 5219 :host([with-label]:not([orientation='vertical']))::before, 5220 :host([with-label]:not([orientation='vertical']))::after { 5221 min-inline-size: 1em; 5222 border-top: solid var(--width) var(--color); 5223 } 5224 5225 :host([with-label][orientation='vertical'])::before, 5226 :host([with-label][orientation='vertical'])::after { 5227 min-block-size: 1lh; 5228 border-inline-start: solid var(--width) var(--color); 5229 } 5230 5231 :host([with-label][label-placement='start'])::before, 5232 :host([with-label][label-placement='end'])::after { 5233 flex: 0 0 var(--label-offset); 5234 min-inline-size: 0; 5235 min-block-size: 0; 5236 } 5237 5238 :host(:not([with-label])) .label { 5239 display: none; 5240 } 5241 5242 :host([with-label]) .label { 5243 display: inline-flex;
5244 align-items: center; 5245 gap: var(--wa-space-2xs); 5246 flex: 0 1 auto; 5247 color: var(--wa-color-text-quiet); 5248 font-size: var(--wa-font-size-s); 5249 line-height: var(--wa-line-height-condensed); 5250 text-align: center; 5251 } 5252`,fp=class extends Ft{constructor(){super(...arguments),this.hasSlotController=new qe(this,"[default]"),this.orientation="horizontal",this.withLabel=!1,this.labelPlacement="center"}connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}willUpdate(t){this.withLabel=this.hasSlotController.test("[default]","withLabel"),super.willUpdate(t)}handleVerticalChange(){this.setAttribute("aria-orientation",this.orientation)}handleSlotChange(){this.internals&&(this.internals.ariaLabel=this.textContent?.trim()||null)}render(){return K` 5253 <div part="label" class="label"> 5254 <slot @slotchange=${this.handleSlotChange}></slot> 5255 </div> 5256 `}};fp.css=mp,kt([At({reflect:!0})],fp.prototype,"orientation",2),kt([At({attribute:"with-label",type:Boolean,reflect:!0})],fp.prototype,"withLabel",2),kt([At({attribute:"label-placement",reflect:!0})],fp.prototype,"labelPlacement",2),kt([vt("orientation")],fp.prototype,"handleVerticalChange",1),fp=kt([St("wa-divider")],fp);var gp=class extends Event{constructor(t){super("wa-select",{bubbles:!0,cancelable:!0,composed:!0}),this.detail=t}};function*bp(t=document.activeElement){null!=t&&(yield t,"shadowRoot"in t&&t.shadowRoot&&"closed"!==t.shadowRoot.mode&&(yield*bp(t.shadowRoot.activeElement)))}var vp=h` 5257 :host { 5258 --show-duration: var(--wa-transition-fast); 5259 --hide-duration: var(--wa-transition-fast); 5260 display: contents; 5261 } 5262 5263 #menu { 5264 display: flex; 5265 flex-direction: column; 5266 width: max-content; 5267 margin: 0; 5268 padding: 0.25em; 5269 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 5270 border-radius: var(--wa-border-radius-m); 5271 background-color: var(--wa-color-surface-raised); 5272 box-shadow: var(--wa-shadow-m); 5273 color: var(--wa-color-text-normal); 5274 text-align: start; 5275 user-select: none; 5276 overflow: auto; 5277 max-width: var(--auto-size-available-width) !important; 5278 max-height: var(--auto-size-available-height) !important; 5279 5280 &.show { 5281 animation: show var(--show-duration) ease; 5282 } 5283 5284 &.hide { 5285 animation: show var(--hide-duration) ease reverse; 5286 } 5287 5288 ::slotted(h1), 5289 ::slotted(h2), 5290 ::slotted(h3), 5291 ::slotted(h4), 5292 ::slotted(h5), 5293 ::slotted(h6) { 5294 display: block !important; 5295 margin: 0.25em 0 !important; 5296 padding: 0.25em 0.75em !important; 5297 color: var(--wa-color-text-quiet); 5298 font-family: var(--wa-font-family-body) !important; 5299 font-weight: var(--wa-font-weight-semibold) !important; 5300 font-size: var(--wa-font-size-smaller) !important; 5301 } 5302 5303 ::slotted(wa-divider) { 5304 --spacing: 0.25em; /* Component-specific, left as-is */ 5305 } 5306 } 5307 5308 wa-popup[data-current-placement^='top'] #menu { 5309 transform-origin: bottom; 5310 } 5311 5312 wa-popup[data-current-placement^='bottom'] #menu { 5313 transform-origin: top; 5314 } 5315 5316 wa-popup[data-current-placement^='left'] #menu { 5317 transform-origin: right; 5318 } 5319 5320 wa-popup[data-current-placement^='right'] #menu { 5321 transform-origin: left; 5322 } 5323 5324 wa-popup[data-current-placement='left-start'] #menu { 5325 transform-origin: right top; 5326 } 5327 5328 wa-popup[data-current-placement='left-end'] #menu { 5329 transform-origin: right bottom; 5330 } 5331 5332 wa-popup[data-current-placement='right-start'] #menu { 5333 transform-origin: left top; 5334 } 5335 5336 wa-popup[data-current-placement='right-end'] #menu { 5337 transform-origin: left bottom; 5338 } 5339 5340 @keyframes show { 5341 from { 5342 scale: 0.9; 5343 opacity: 0; 5344 } 5345 to { 5346 scale: 1; 5347 opacity: 1; 5348 } 5349 } 5350`,wp=new Set,yp=class extends Ft{constructor(){super(...arguments),this.submenuCleanups=new Map,this.localize=new ie(this),this.userTypedQuery="",this.openSubmenuStack=[],this.open=!1,this.size="m",this.placement="bottom-start",this.distance=0,this.skidding=0,this.handleDocumentKeyDown=async t=>{const e="rtl"===this.localize.dir();if("Escape"===t.key&&this.open&&qh(this)){const e=this.getTrigger();return t.preventDefault(),t.stopPropagation(),this.open=!1,void e?.focus({preventScroll:!0})}const i=[...bp()].find(t=>"wa-dropdown-item"===t.localName),o="wa-dropdown-item"===i?.localName,a=this.getCurrentSubmenuItem(
5350),s=!!a;let n,r,l,h;if(s?(n=this.getSubmenuItems(a),r=n.find(t=>t.active||t===i),l=r?n.indexOf(r):-1):(n=this.getItems(),r=n.find(t=>t.active||t===i),l=r?n.indexOf(r):-1),"ArrowUp"===t.key&&(t.preventDefault(),t.stopPropagation(),h=l>0?n[l-1]:n[n.length-1]),"ArrowDown"===t.key&&(t.preventDefault(),t.stopPropagation(),h=-1!==l&&l<n.length-1?n[l+1]:n[0]),t.key===(e?"ArrowLeft":"ArrowRight")&&o&&r&&r.hasSubmenu)return t.preventDefault(),t.stopPropagation(),r.submenuOpen=!0,this.addToSubmenuStack(r),void setTimeout(()=>{const t=this.getSubmenuItems(r);t.length>0&&(t.forEach((t,e)=>t.active=0===e),t[0].focus({preventScroll:!0}))},0);if(t.key===(e?"ArrowRight":"ArrowLeft")&&s){t.preventDefault(),t.stopPropagation();const e=this.removeFromSubmenuStack();return void(e&&(e.submenuOpen=!1,setTimeout(()=>{e.focus({preventScroll:!0}),e.active=!0;("submenu"===e.slot?this.getSubmenuItems(e.parentElement):this.getItems()).forEach(t=>{t!==e&&(t.active=!1)})},0)))}if("Home"!==t.key&&"End"!==t.key||(t.preventDefault(),t.stopPropagation(),h="Home"===t.key?n[0]:n[n.length-1]),"Tab"===t.key&&await this.hideMenu(),1!==t.key.length||t.metaKey||t.ctrlKey||t.altKey||" "===t.key&&""===this.userTypedQuery||(clearTimeout(this.userTypedTimeout),this.userTypedTimeout=setTimeout(()=>{this.userTypedQuery=""},1e3),this.userTypedQuery+=t.key,n.some(t=>{const e=(t.textContent||"").trim().toLowerCase(),i=this.userTypedQuery.trim().toLowerCase();return!!e.startsWith(i)&&(h=t,!0)})),h)return t.preventDefault(),t.stopPropagation(),n.forEach(t=>t.active=t===h),h.focus({preventScroll:!0}),void h.scrollIntoView({block:"nearest"});("Enter"===t.key||" "===t.key&&""===this.userTypedQuery)&&o&&r&&(t.preventDefault(),t.stopPropagation(),r.hasSubmenu?(r.submenuOpen=!0,this.addToSubmenuStack(r),setTimeout(()=>{const t=this.getSubmenuItems(r);t.length>0&&(t.forEach((t,e)=>t.active=0===e),t[0].focus({preventScroll:!0}))},0)):this.makeSelection(r,t))},this.handleDocumentPointerDown=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&(t===this||t.closest('wa-dropdown, [part="submenu"]')))||(this.open=!1)},this.handleGlobalMouseMove=t=>{const e=this.getCurrentSubmenuItem();if(!e?.submenuOpen||!e.submenuElement)return;const i=e.submenuElement.getBoundingClientRect(),o="rtl"===this.localize.dir(),a=o?i.right:i.left,s=o?Math.max(t.clientX,a):Math.min(t.clientX,a),n=Math.max(i.top,Math.min(t.clientY,i.bottom));e.submenuElement.style.setProperty("--safe-triangle-cursor-x",`${s}px`),e.submenuElement.style.setProperty("--safe-triangle-cursor-y",`${n}px`);const r=t.composedPath(),l=e.matches(":hover"),h=Boolean(e.submenuElement?.matches(":hover")),c=l||!!r.find(t=>t===e),d=h||!!r.find(t=>t instanceof HTMLElement&&t.closest('[part="submenu"]')===e.submenuElement);c||d||setTimeout(()=>{l||h||(e.submenuOpen=!1)},100)}}handleSizeChange(){He(this.localName,this.size)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this.userTypedTimeout),this.closeAllSubmenus(),this.submenuCleanups.forEach(t=>t()),this.submenuCleanups.clear(),document.removeEventListener("mousemove",this.handleGlobalMouseMove),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("pointerdown",this.handleDocumentPointerDown),Hh(this)}firstUpdated(t){super.firstUpdated(t),this.syncAriaAttributes()}async updated(t){if(t.has("open")){const e=t.get("open");if(e===this.open)return;if(void 0===e&&!1===this.open)return;this.customStates.set("open",this.open),this.open?await this.showMenu():(this.closeAllSubmenus(),await this.hideMenu())}t.has("size")&&this.syncItemSizes()}getItems(t=!1){const e=(this.defaultSlot?.assignedElements({flatten:!0})??[]).filter(t=>"wa-dropdown-item"===t.localName);return t?e:e.filter(t=>!t.disabled)}getSubmenuItems(t,e=!1){const i=t.shadowRoot?.querySelector('slot[name="submenu"]')||t.querySelector('slot[name="submenu"]');if(!i)return[];const o=i.assignedElements({flatten:!0}).filter(t=>"wa-dropdown-item"===t.localName);return e?o:o.filter(t=>!t.disabled)}syncItemSizes(){(this.defaultSlot?.assignedElements({flatten:!0})??[]).filter(t=>"wa-dropdown-item"===t.localName).forEach(t=>t.size=this.size)}addToSubmenuStack(t){const e=this.openSubmenuStack.indexOf(t);-1!==e?this.openSubmenuStack=this.openSubmenuStack.slice(0,e+1):this.openSubmenuStack.push(t)}removeFromSubmenuStack(){return this.openSubmenuStack.pop()}
5350getCurrentSubmenuItem(){return this.openSubmenuStack.length>0?this.openSubmenuStack[this.openSubmenuStack.length-1]:void 0}closeAllSubmenus(){this.getItems(!0).forEach(t=>{t.submenuOpen=!1}),this.openSubmenuStack=[]}closeSiblingSubmenus(t){const e=t.closest('wa-dropdown-item:not([slot="submenu"])');let i;i=e?this.getSubmenuItems(e,!0):this.getItems(!0),i.forEach(e=>{e!==t&&e.submenuOpen&&(e.submenuOpen=!1)}),this.openSubmenuStack.includes(t)||this.openSubmenuStack.push(t)}getTrigger(){return this.querySelector('[slot="trigger"]')}async showMenu(){if(!this.getTrigger()||!this.popup||!this.menu)return;const t=new Gd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);if(this.popup.active)return;wp.forEach(t=>t.open=!1),this.popup.active=!0,this.open=!0,wp.add(this),Nh(this),this.syncAriaAttributes(),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("pointerdown",this.handleDocumentPointerDown),document.addEventListener("mousemove",this.handleGlobalMouseMove),this.menu.classList.remove("hide"),await qt(this.menu,"show");const e=this.getItems();e.length>0&&(e.forEach((t,e)=>t.active=0===e),e[0].focus({preventScroll:!0})),this.dispatchEvent(new Zd)}async hideMenu(){if(!this.popup||!this.menu)return;const t=new Qd({source:this});this.dispatchEvent(t),t.defaultPrevented?this.open=!0:(this.open=!1,wp.delete(this),Hh(this),this.syncAriaAttributes(),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("pointerdown",this.handleDocumentPointerDown),document.removeEventListener("mousemove",this.handleGlobalMouseMove),this.menu.classList.remove("show"),await qt(this.menu,"hide"),this.popup.active=this.open,this.dispatchEvent(new Jd))}handleMenuClick(t){const e=t.target.closest("wa-dropdown-item");if(e&&!e.disabled)return e.hasSubmenu?(e.submenuOpen||(this.closeSiblingSubmenus(e),this.addToSubmenuStack(e),e.submenuOpen=!0),void t.stopPropagation()):void this.makeSelection(e,t)}async handleMenuSlotChange(){const t=this.getItems(!0);await Promise.all(t.map(t=>t.updateComplete)),this.syncItemSizes();const e=t.some(t=>"checkbox"===t.type),i=t.some(t=>t.hasSubmenu);t.forEach((o,a)=>{o.setAttribute("aria-posinset",String(a+1)),o.setAttribute("aria-setsize",String(t.length)),o.active=0===a,o.checkboxAdjacent=e,o.submenuAdjacent=i})}handleTriggerClick(){this.open=!this.open}handleSubmenuOpening(t){const e=t.detail.item;this.closeSiblingSubmenus(e),this.addToSubmenuStack(e),this.setupSubmenuPosition(e),this.processSubmenuItems(e)}setupSubmenuPosition(t){if(!t.submenuElement)return;this.cleanupSubmenuPosition(t);const e=Ld(t,t.submenuElement,()=>{this.positionSubmenu(t),this.updateSafeTriangleCoordinates(t)});this.submenuCleanups.set(t,e);const i=t.submenuElement.querySelector('slot[name="submenu"]');i&&(i.removeEventListener("slotchange",yp.handleSubmenuSlotChange),i.addEventListener("slotchange",yp.handleSubmenuSlotChange),yp.handleSubmenuSlotChange({target:i}))}static handleSubmenuSlotChange(t){const e=t.target;if(!e)return;const i=e.assignedElements().filter(t=>"wa-dropdown-item"===t.localName);if(0===i.length)return;const o=i.some(t=>t.hasSubmenu),a=i.some(t=>"checkbox"===t.type);i.forEach(t=>{t.submenuAdjacent=o,t.checkboxAdjacent=a})}processSubmenuItems(t){if(!t.submenuElement)return;const e=this.getSubmenuItems(t,!0),i=e.some(t=>t.hasSubmenu);e.forEach(t=>{t.submenuAdjacent=i})}cleanupSubmenuPosition(t){const e=this.submenuCleanups.get(t);e&&(e(),this.submenuCleanups.delete(t))}positionSubmenu(t){if(!t.submenuElement)return;const e="rtl"===this.localize.dir()?"left-start":"right-start";Pd(t,t.submenuElement,{placement:e,middleware:[Dd({mainAxis:0,crossAxis:-5}),zd({fallbackStrategy:"bestFit"}),Md({padding:8,crossAxis:!0})]}).then(({x:e,y:i,placement:o})=>{t.submenuElement.setAttribute("data-placement",o),Object.assign(t.submenuElement.style,{left:`${e}px`,top:`${i}px`})})}updateSafeTriangleCoordinates(t){if(!t.submenuElement||!t.submenuOpen)return;const e=document.activeElement?.matches(":focus-visible");if(e)return void t.submenuElement.style.setProperty("--safe-triangle-visible","none");t.submenuElement.style.setProperty("--safe-triangle-visible","block");const i=t.submenuElement.getBoundingClientRect(),o="rtl"===this.localize.dir();t.submenuElement.style.setProperty("--safe-triangle-submenu-start-x",`${o?i.right:i.left}px`),t.submenuElement.style.setProperty("--safe-triangle-submenu-start-y",`${i.top}px`),t.submenuElement.style.setProperty("--safe-triangle-submenu-end-x",`${o?i.right:i.left}px`),t.submenuElement.style.setProperty("--safe-triangle-submenu-end-y",`${i.bottom}px`)}makeSelection(t,e){const i=this.getTrigger();if(t.disabled)return;"checkbox"===t.type&&(t.checked=!t.checked);const o=new gp({item:t});this.dispatchEvent(o),o.defaultPrevented||(t.navigate(e),this.open=!1,i?.focu
5350s({preventScroll:!0}))}async syncAriaAttributes(){const t=this.getTrigger();let e;t&&("wa-button"===t.localName?(await customElements.whenDefined("wa-button"),await t.updateComplete,e=t.shadowRoot.querySelector('[part~="base"]')):e=t,e.hasAttribute("id")||e.setAttribute("id",Wh("wa-dropdown-trigger-")),e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded",this.open?"true":"false"),this.menu?.setAttribute("aria-expanded","false"))}render(){let t=this.didSSR&&!this.hasUpdated?this.open:this.popup?.active;return K` 5351 <wa-popup 5352 placement=${this.placement} 5353 distance=${this.distance} 5354 skidding=${this.skidding} 5355 ?active=${t} 5356 flip 5357 flip-fallback-strategy="best-fit" 5358 shift 5359 shift-padding="10" 5360 auto-size="vertical" 5361 auto-size-padding="10" 5362 > 5363 <slot 5364 name="trigger" 5365 slot="anchor" 5366 @click=${this.handleTriggerClick} 5367 @slotchange=${this.syncAriaAttributes} 5368 ></slot> 5369 <div 5370 id="menu" 5371 part="menu" 5372 role="menu" 5373 tabindex="-1" 5374 aria-orientation="vertical" 5375 @click=${this.handleMenuClick} 5376 @submenu-opening=${this.handleSubmenuOpening} 5377 > 5378 <slot @slotchange=${this.handleMenuSlotChange}></slot> 5379 </div> 5380 </wa-popup> 5381 `}};yp.css=[Ue,vp],kt([Dt("slot:not([name])")],yp.prototype,"defaultSlot",2),kt([Dt("#menu")],yp.prototype,"menu",2),kt([Dt("wa-popup")],yp.prototype,"popup",2),kt([At({type:Boolean,reflect:!0})],yp.prototype,"open",2),kt([At({reflect:!0})],yp.prototype,"size",2),kt([vt("size")],yp.prototype,"handleSizeChange",1),kt([At({reflect:!0})],yp.prototype,"placement",2),kt([At({type:Number})],yp.prototype,"distance",2),kt([At({type:Number})],yp.prototype,"skidding",2),yp=kt([St("wa-dropdown")],yp);var xp=h` 5382 :host { 5383 display: flex; 5384 position: relative; 5385 align-items: center; 5386 padding: 0.5em 1em; 5387 border-radius: var(--wa-border-radius-s); 5388 isolation: isolate; 5389 color: var(--wa-color-text-normal); 5390 line-height: var(--wa-line-height-condensed); 5391 cursor: pointer; 5392 transition: 5393 var(--wa-transition-fast) background-color var(--wa-transition-easing), 5394 var(--wa-transition-fast) color var(--wa-transition-easing); 5395 } 5396 5397 @media (hover: hover) { 5398 :host(:hover:not(:state(disabled))) { 5399 background-color: var(--wa-color-neutral-fill-normal); 5400 } 5401 } 5402 5403 :host(:state(submenu-open)) { 5404 background-color: var(--wa-color-neutral-fill-normal); 5405 } 5406 5407 :host(:focus-visible) { 5408 z-index: 1; 5409 outline: var(--wa-focus-ring); 5410 background-color: var(--wa-color-neutral-fill-normal); 5411 } 5412 5413 :host(:state(disabled)), 5414 :host([disabled]) { 5415 opacity: 0.5; 5416 cursor: not-allowed; 5417 } 5418 5419 /* Danger variant */ 5420 :host([variant='danger']), 5421 :host([variant='danger']) #details { 5422 color: var(--wa-color-danger-on-quiet); 5423 } 5424 5425 @media (hover: hover) { 5426 :host([variant='danger']:hover) { 5427 background-color: var(--wa-color-danger-fill-normal); 5428 color: var(--wa-color-danger-on-normal); 5429 } 5430 } 5431 5432 :host([variant='danger']:state(submenu-open)), 5433 :host([variant='danger']:focus-visible) { 5434 background-color: var(--wa-color-danger-fill-normal); 5435 color: var(--wa-color-danger-on-normal); 5436 } 5437 5438 :host([checkbox-adjacent]) { 5439 padding-inline-start: 2em; 5440 } 5441 5442 /* Only add padding when item actually has a submenu */ 5443 :host([submenu-adjacent]:not(:state(has-submenu))) #details { 5444 padding-inline-end: 0; 5445 } 5446 5447 :host(:state(has-submenu)[submenu-adjacent]) #details { 5448 padding-inline-end: 1.75em; 5449 } 5450 5451 /* The link only exists to be clicked programmatically. */ 5452 #link { 5453 display: none; 5454 } 5455 5456 #check { 5457 visibility: hidden; 5458 margin-inline-start: -1.5em; 5459 margin-inline-end: 0.5em; 5460 font-size: var(--wa-font-size-smaller); 5461 } 5462 5463 :host(:state(checked)) #check { 5464 visibility: visible; 5465 } 5466 5467 #icon ::slotted(*) { 5468 display: flex; 5469 flex: 0 0 auto;
5470 align-items: center; 5471 margin-inline-end: 0.75em !important; 5472 font-size: var(--wa-font-size-smaller); 5473 } 5474 5475 #label { 5476 flex: 1 1 auto; 5477 min-width: 0; 5478 } 5479 5480 #details { 5481 display: flex; 5482 flex: 0 0 auto; 5483 align-items: center; 5484 justify-content: end; 5485 color: var(--wa-color-text-quiet); 5486 font-size: var(--wa-font-size-smaller) !important; 5487 } 5488 5489 #details ::slotted(*) { 5490 margin-inline-start: 2em !important; 5491 } 5492 5493 /* Submenu indicator icon */ 5494 #submenu-indicator { 5495 position: absolute; 5496 inset-inline-end: 1em; 5497 color: var(--wa-color-neutral-on-quiet); 5498 font-size: var(--wa-font-size-smaller); 5499 } 5500 5501 /* Flip chevron icon when RTL */ 5502 :host(:dir(rtl)) #submenu-indicator { 5503 transform: scaleX(-1); 5504 } 5505 5506 /* Submenu styles */ 5507 #submenu { 5508 display: flex; 5509 z-index: 10; 5510 position: absolute; 5511 top: 0; 5512 left: 0; 5513 flex-direction: column; 5514 width: max-content; 5515 margin: 0; 5516 padding: 0.25em; 5517 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 5518 border-radius: var(--wa-border-radius-m); 5519 background-color: var(--wa-color-surface-raised); 5520 box-shadow: var(--wa-shadow-m); 5521 color: var(--wa-color-text-normal); 5522 text-align: start; 5523 user-select: none; 5524 5525 /* Override default popover styles */ 5526 &[popover] { 5527 margin: 0; 5528 inset: auto; 5529 padding: 0.25em; 5530 overflow: visible; 5531 border-radius: var(--wa-border-radius-m); 5532 } 5533 5534 &.show { 5535 animation: submenu-show var(--show-duration, var(--wa-transition-fast)) ease; 5536 } 5537 5538 &.hide { 5539 animation: submenu-show var(--show-duration, var(--wa-transition-fast)) ease reverse; 5540 } 5541 5542 /* Submenu placement transform origins */ 5543 &[data-placement^='top'] { 5544 transform-origin: bottom; 5545 } 5546 5547 &[data-placement^='bottom'] { 5548 transform-origin: top; 5549 } 5550 5551 &[data-placement^='left'] { 5552 transform-origin: right; 5553 } 5554 5555 &[data-placement^='right'] { 5556 transform-origin: left; 5557 } 5558 5559 &[data-placement='left-start'] { 5560 transform-origin: right top; 5561 } 5562 5563 &[data-placement='left-end'] { 5564 transform-origin: right bottom; 5565 } 5566 5567 &[data-placement='right-start'] { 5568 transform-origin: left top; 5569 } 5570 5571 &[data-placement='right-end'] { 5572 transform-origin: left bottom; 5573 } 5574 5575 /* Safe triangle styling */ 5576 &::before { 5577 display: none; 5578 z-index: 9; 5579 position: fixed; 5580 top: 0; 5581 right: 0; 5582 bottom: 0; 5583 left: 0; 5584 background-color: transparent; 5585 content: ''; 5586 clip-path: polygon( 5587 var(--safe-triangle-cursor-x, 0) var(--safe-triangle-cursor-y, 0), 5588 var(--safe-triangle-submenu-start-x, 0) var(--safe-triangle-submenu-start-y, 0), 5589 var(--safe-triangle-submenu-end-x, 0) var(--safe-triangle-submenu-end-y, 0) 5590 ); 5591 pointer-events: auto; /* Enable mouse events on the triangle */ 5592 } 5593 5594 &[data-visible]::before { 5595 display: block; 5596 } 5597 } 5598 5599 ::slotted(wa-dropdown-item) { 5600 font-size: inherit; 5601 } 5602 5603 ::slotted(wa-divider) { 5604 --spacing: 0.25em; 5605 } 5606 5607 @keyframes submenu-show { 5608 from { 5609 scale: 0.9; 5610 opacity: 0; 5611 } 5612 to { 5613 scale: 1; 5614 opacity: 1; 5615 } 5616 } 5617`,kp=class extends Ft{constructor(){super(...arguments),this.hasSlotController=new qe(this,"[default]","start","end"),this.active=!1,this.variant="default",this.size="m",this.checkboxAdjacent=!1,this.submenuAdjacent=!1,this.type="normal",this.checked=!1,this.disabled=!1,this.submenuOpen=!1,this.hasSubmenu=!1,this.handleSlotChange=()=>{this.hasSubmenu=this.hasSlotController.test("submenu"),this.updateHasSubmenuState(),this.hasSubmenu?(this.setAttribute("aria-haspopup","menu"),this.setAttribute("aria-expanded",this.submenuOpen?"true":"false")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"))},this.handleHostClick=t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())},this.handleClick=t=>{this.disabled&&(t.preventDefault(),t.stopImmediatePropagation())},this.handlePointerEnter=t=>{"mouse"===t.pointerType&&this.hasSubmenu&&!this.disabled&&(this.notifyParentOfOpening(),this.submenuOpen=!0)}}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.addEventListener?.("click",this.handleHostClick),this.addEventListener?.("pointerenter",this.handlePointerEnter),this.shadowRoot?.addEventListener?.("click",this.handleClick,{capture:!0}),this.shadowRoot?.addEventListener?.("slotchange",this.handleSlot
5617Change)}disconnectedCallback(){super.disconnectedCallback(),this.closeSubmenu(),this.removeEventListener?.("click",this.handleHostClick),this.removeEventListener?.("pointerenter",this.handlePointerEnter),this.shadowRoot?.removeEventListener?.("click",this.handleClick,{capture:!0}),this.shadowRoot?.removeEventListener?.("slotchange",this.handleSlotChange)}firstUpdated(t){super.firstUpdated(t),this.setAttribute("tabindex","-1"),this.hasSubmenu=this.hasSlotController.test("submenu"),this.updateHasSubmenuState()}updated(t){t.has("active")&&(this.setAttribute("tabindex",this.active?"0":"-1"),this.customStates.set("active",this.active)),t.has("checked")&&("checkbox"===this.type?this.setAttribute("aria-checked",this.checked?"true":"false"):this.removeAttribute("aria-checked"),this.customStates.set("checked",this.checked)),t.has("disabled")&&(this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.customStates.set("disabled",this.disabled)),t.has("type")&&("checkbox"===this.type?(this.setAttribute("role","menuitemcheckbox"),this.setAttribute("aria-checked",this.checked?"true":"false")):(this.setAttribute("role","menuitem"),this.removeAttribute("aria-checked"))),(t.has("href")||t.has("hasSubmenu"))&&this.customStates.set("link",this.isLink()),t.has("submenuOpen")&&(this.customStates.set("submenu-open",this.submenuOpen),this.submenuOpen?this.openSubmenu():this.closeSubmenu())}updateHasSubmenuState(){this.customStates.set("has-submenu",this.hasSubmenu)}async openSubmenu(){const t=this.submenuElement;this.hasSubmenu&&t&&this.isConnected&&(this.notifyParentOfOpening(),t.showPopover?.(),t.hidden=!1,t.setAttribute("data-visible",""),this.submenuOpen=!0,this.setAttribute("aria-expanded","true"),await qt(t,"show"),setTimeout(()=>{const t=this.getSubmenuItems();t.length>0&&(t.forEach((t,e)=>t.active=0===e),t[0].focus({preventScroll:!0}))},0))}notifyParentOfOpening(){const t=new CustomEvent("submenu-opening",{bubbles:!0,composed:!0,detail:{item:this}});this.dispatchEvent(t);const e=this.parentElement;if(e){[...e.children].filter(t=>t!==this&&"wa-dropdown-item"===t.localName&&t.getAttribute("slot")===this.getAttribute("slot")&&t.submenuOpen).forEach(t=>{t.submenuOpen=!1})}}async closeSubmenu(){const t=this.submenuElement;this.hasSubmenu&&t&&(this.submenuOpen=!1,this.setAttribute("aria-expanded","false"),t.hidden||(await qt(t,"hide"),t?.isConnected&&(t.hidden=!0,t.removeAttribute("data-visible"),t.hidePopover?.())))}isLink(){return Boolean(this.href)&&!this.hasSubmenu}navigate(t){const e=this.linkElement;this.isLink()&&!this.disabled&&e&&e.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,composed:!1,altKey:t?.altKey??!1,ctrlKey:t?.ctrlKey??!1,metaKey:t?.metaKey??!1,shiftKey:t?.shiftKey??!1}))}getSubmenuItems(){return[...this.children].filter(t=>"wa-dropdown-item"===t.localName&&"submenu"===t.getAttribute("slot")&&!t.hasAttribute("disabled"))}render(){return K` 5618 ${this.href?K` 5619 <a 5620 id="link" 5621 href=${this.href} 5622 target=${We(this.target)} 5623 rel=${We(this.rel)} 5624 download=${We(this.download)} 5625 tabindex="-1" 5626 aria-hidden="true" 5627 ></a> 5628 `:""} 5629 ${"checkbox"===this.type?K` 5630 <wa-icon 5631 id="check" 5632 part="checkmark" 5633 exportparts="svg:checkmark__svg" 5634 library="system" 5635 name="check" 5636 ></wa-icon> 5637 `:""} 5638
5639 <span id="icon" part="icon"> 5640 <slot name="icon"></slot> 5641 </span> 5642 5643 <span id="label" part="label"> 5644 <slot></slot> 5645 </span> 5646 5647 <span id="details" part="details"> 5648 <slot name="details"></slot> 5649 </span> 5650 5651 ${this.hasSubmenu?K` 5652 <wa-icon 5653 id="submenu-indicator" 5654 part="submenu-icon" 5655 exportparts="svg:submenu-icon__svg" 5656 library="system" 5657 name="chevron-right" 5658 ></wa-icon> 5659 `:""} 5660 ${this.hasSubmenu?K` 5661 <div 5662 id="submenu" 5663 part="submenu" 5664 popover="manual" 5665 role="menu" 5666 tabindex="-1" 5667 aria-orientation="vertical" 5668 hidden 5669 > 5670 <slot name="submenu"></slot> 5671 </div> 5672 `:""} 5673 `}};kp.css=xp,kt([Dt("#submenu")],kp.prototype,"submenuElement",2),kt([Dt("#link")],kp.prototype,"linkElement",2),kt([At({type:Boolean})],kp.prototype,"active",2),kt([At({reflect:!0})],kp.prototype,"variant",2),kt([At({reflect:!0})],kp.prototype,"size",2),kt([vt("size")],kp.prototype,"handleSizeChange",1),kt([At({attribute:"checkbox-adjacent",type:Boolean,reflect:!0})],kp.prototype,"checkboxAdjacent",2),kt([At({attribute:"submenu-adjacent",type:Boolean,reflect:!0})],kp.prototype,"submenuAdjacent",2),kt([At()],kp.prototype,"value",2),kt([At({reflect:!0})],kp.prototype,"type",2),kt([At({type:Boolean})],kp.prototype,"checked",2),kt([At({type:Boolean,reflect:!0})],kp.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],kp.prototype,"submenuOpen",2),kt([At({reflect:!0})],kp.prototype,"href",2),kt([At()],kp.prototype,"target",2),kt([At()],kp.prototype,"rel",2),kt([At()],kp.prototype,"download",2),kt([$t()],kp.prototype,"hasSubmenu",2),kp=kt([St("wa-dropdown-item")],kp);var Cp=h` 5674 :host { 5675 display: block; 5676 } 5677 5678 /* Dropzone */ 5679 .dropzone { 5680 position: relative; 5681 display: flex; 5682 flex-direction: column; 5683 align-items: center; 5684 justify-content: center; 5685 gap: var(--wa-space-m); 5686 padding: var(--wa-space-l); 5687 border: max(1px, var(--wa-form-control-border-width)) dashed var(--wa-form-control-border-color); 5688 border-radius: var(--wa-panel-border-radius); 5689 background: var(--wa-form-control-background-color); 5690 color: var(--wa-color-text-quiet); 5691 text-align: center; 5692 cursor: pointer; 5693 transition: 5694 border-color var(--wa-transition-fast), 5695 background-color var(--wa-transition-fast), 5696 color var(--wa-transition-fast); 5697 5698 &:focus { 5699 outline: none; 5700 } 5701 5702 &:has(input:focus-visible) { 5703 outline: var(--wa-focus-ring); 5704 outline-offset: var(--wa-focus-ring-offset); 5705 } 5706 5707 &.dragging { 5708 border-style: solid; 5709 border-color: var(--wa-color-brand-border-loud); 5710 background-color: var(--wa-color-brand-fill-quiet); 5711 color: var(--wa-color-brand-on-quiet); 5712 } 5713 5714 /* Invisible overlay to prevent dragleave from firing on child elements */ 5715 &::after { 5716 position: absolute; 5717 inset: 0; 5718 content: ''; 5719 } 5720 5721 &.disabled { 5722 opacity: 0.5; 5723 cursor: not-allowed; 5724 } 5725 } 5726 5727 .dropzone-icon { 5728 font-size: 2em; 5729 } 5730 5731 .dropzone-text { 5732 font-weight: var(--wa-font-weight-action); 5733 } 5734 5735 /* Hidden file input - positioned to fill the dropzone for proper validation popup anchoring */ 5736 .hidden-input { 5737 position: absolute; 5738 top: 0; 5739 right: 0; 5740 bottom: 0; 5741 left: 0; 5742 opacity: 0; 5743 pointer-events: none; 5744 } 5745 5746 .hidden-input::file-selector-button { 5747 display: none; 5748 } 5749 5750 /* File list */ 5751 .file-list { 5752 list-style: none; 5753 margin: 0; 5754 padding: 0; 5755 margin-block-start: var(--wa-space-m); 5756 } 5757 5758 .file { 5759 display: flex;
5760 align-items: center; 5761 gap: var(--wa-space-m); 5762 padding: var(--wa-space-m); 5763 border: var(--wa-panel-border-width) var(--wa-panel-border-style) var(--wa-color-surface-border); 5764 border-radius: var(--wa-panel-border-radius); 5765 background: var(--wa-color-surface-default); 5766 } 5767 5768 .file + .file { 5769 margin-block-start: var(--wa-space-xs); 5770 } 5771 5772 /* Thumbnail */ 5773 .file-thumbnail { 5774 flex: 0 0 auto; 5775 display: flex; 5776 align-items: center; 5777 justify-content: center; 5778 width: 3em; 5779 height: 3em; 5780 border-radius: var(--wa-border-radius-s); 5781 overflow: hidden; 5782 background: var(--wa-color-neutral-fill-quiet); 5783 5784 wa-icon { 5785 font-size: 1.25em; 5786 color: var(--wa-color-neutral-on-quiet); 5787 } 5788 } 5789 5790 .file-image { 5791 width: 100%; 5792 height: 100%; 5793 object-fit: cover; 5794 } 5795 5796 /* File details */ 5797 .file-details { 5798 flex: 1 1 auto; 5799 min-width: 0; 5800 display: flex; 5801 flex-direction: column; 5802 } 5803 5804 .file-name { 5805 font-weight: var(--wa-form-control-value-font-weight); 5806 white-space: nowrap; 5807 overflow: hidden; 5808 text-overflow: ellipsis; 5809 } 5810 5811 .file-size { 5812 font-size: var(--wa-font-size-smaller); 5813 color: var(--wa-color-text-quiet); 5814 } 5815 5816 /* Remove button */ 5817 .remove-button { 5818 flex: 0 0 auto; 5819 } 5820 5821 /* Size variants */ 5822 :host([size='xs']) .dropzone { 5823 gap: var(--wa-space-xs); 5824 padding: var(--wa-space-s); 5825 } 5826 5827 :host([size='s']) .dropzone, 5828 :host([size='small']) .dropzone { 5829 gap: var(--wa-space-s); 5830 padding: var(--wa-space-m); 5831 } 5832 5833 :host([size='l']) .dropzone, 5834 :host([size='large']) .dropzone { 5835 gap: var(--wa-space-l); 5836 padding: var(--wa-space-xl); 5837 } 5838 5839 :host([size='xl']) .dropzone { 5840 gap: var(--wa-space-xl); 5841 padding: var(--wa-space-2xl); 5842 } 5843 5844 :host([size='xs']) .file { 5845 gap: var(--wa-space-xs); 5846 padding: var(--wa-space-xs); 5847 } 5848 5849 :host([size='s']) .file, 5850 :host([size='small']) .file { 5851 gap: var(--wa-space-s); 5852 padding: var(--wa-space-s); 5853 } 5854 5855 :host([size='l']) .file, 5856 :host([size='large']) .file { 5857 gap: var(--wa-space-l); 5858 padding: var(--wa-space-l); 5859 } 5860 5861 :host([size='xl']) .file { 5862 gap: var(--wa-space-xl); 5863 padding: var(--wa-space-xl); 5864 } 5865 5866 /* Disabled state */ 5867 :host([disabled]) .file { 5868 opacity: 0.5; 5869 } 5870 5871 /* Hide file list when empty */ 5872 :host(:state(blank)) .file-list { 5873 display: none; 5874 } 5875`,Sp=Object.assign(document.createElement("input"),{type:"file",required:!0}),_p=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["change"],this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.objectUrls=new Map,this.files=[],this.dragging=!1,this.size="m",this.label="",this.hint="",this.multiple=!1,this.accept="",this.required=!1,this.withLabel=!1,this.withHint=!1}static get validators(){const t=[Mh({validationProperty:"fileCount",validationElement:Sp})];return[...super.validators,...t]}handleSizeChange(){He(this.localName,this.size)}get fileCount(){return this.files.length}disconnectedCallback(){super.disconnectedCallback(),this.revokeAllObjectUrls()}updated(t){super.updated(t),t.has("files")&&(this.customStates.set("blank",0===this.files.length),this.updateFormValue()),t.has("dragging")&&this.customStates.set("dragging",this.dragging)}formResetCallback(){this.files=[],this.revokeAllObjectUrls(),super.formResetCallback()}focus(t){this.input?.focus(t)}blur(){this.input?.blur()}revokeAllObjectUrls(){for(const t of this.objectUrls.values())URL.revokeObjectURL(t);this.objectUrls.clear()}getObjectUrl(t){return this.objectUrls.has(t)||this.objectUrls.set(t,URL.createObjectURL(t)),this.objectUrls.get(t)}revokeObjectUrl(t){const e=this.objectUrls.get(t);e&&(URL.revokeObjectURL(e),this.objectUrls.delete(t))}updateFormValue(){if(0===this.files.length)this.setValue(null,null);else if(1!==this.files.length||this.multiple){const t=new FormData;this.files.forEach(e=>{this.name&&t.append(this.name,e)}),this.setValue(t,t)}else this.setValue(this.files[0],this.files[0])}handleDragEnter(t){t.preventDefault(),this.disabled||(this.dragging=!0)}handleDragOver(t){t.preventDefault(),t.stopPropagation(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy")}handleDragLeave(t){t.preventDefault(),this.dragging=!1}handleDrop(t){if(t.preventDefault(),t.stopPropagation(),this.dragging=!1,this.disabled||!t.dataTransfer?.items)return;const e=t.dataTransfer.items,i=[],o=[];for(let t=0;t<e.length;t++)if("file"===e[t].kind){const o=e[t].webkitGetAsEntry();o&&i.push(o)}(async()=>{for(;i.length>0&&(this.multiple||!(o.length>0));){const t=i.shift();if(t.isFile)await new Promise(e=>{t.file(t=>{this.fileMatchesAccept(t)&&o.push(t),e()})});else if(t.isDirectory){const e=t.createReader();let o=[];do{o=await new Promise(t=>{e.readEntries(e=>t(e))}),i.unshift(...o)}while(o.length>0)}}this.addFiles(o)})()}handleInputChange(){if(this.input.files){const t=Array.from(this.input.files).filter(t=>this.fileMatchesAccept(t));this.addFiles(t)}this.input.value=""}addFiles(t){0!==t.length&&(this.multiple?this.files=[...this.files,...t]:(this.revokeAllOb
5875jectUrls(),this.files=[t[0]]),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(t){const e=this.files[t];this.revokeObjectUrl(e),this.files=this.files.filter((e,i)=>i!==t),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}fileMatchesAccept(t){if(!this.accept)return!0;const e=this.accept.split(",").map(t=>t.trim().toLowerCase()),i=t.name.toLowerCase(),o=t.type.toLowerCase();return e.some(t=>{if(t.startsWith("."))return i.endsWith(t);if(t.endsWith("/*")){const e=t.slice(0,-2);return o.startsWith(e+"/")}return o===t})}isImage(t){return t.type.startsWith("image/")}getFileIcon(t){const e=t.type.toLowerCase();return e.startsWith("image/")?"file-image":e.startsWith("audio/")?"file-audio":e.startsWith("video/")?"file-video":e.includes("pdf")?"file-pdf":e.includes("zip")||e.includes("compressed")||e.includes("archive")?"file-zipper":e.includes("word")||e.includes("document")?"file-word":e.includes("excel")||e.includes("spreadsheet")?"file-excel":e.includes("powerpoint")||e.includes("presentation")?"file-powerpoint":e.startsWith("text/")||e.includes("javascript")||e.includes("json")?"file-code":"file"}renderFile(t,e){const i=this.isImage(t),o=this.getFileIcon(t);return K` 5876 <li part="file" class="file"> 5877 <span part="file-thumbnail" class="file-thumbnail"> 5878 ${i?K`<img part="file-image" class="file-image" src=${this.getObjectUrl(t)} alt="" />`:K`<wa-icon part="file-icon" library="system" name=${o}></wa-icon>`} 5879 </span> 5880 5881 <span part="file-details" class="file-details"> 5882 <span part="file-name" class="file-name">${t.name}</span> 5883 <span part="file-size" class="file-size"> 5884 <wa-format-bytes .value=${t.size}></wa-format-bytes> 5885 </span> 5886 </span> 5887 5888 <wa-button 5889 part="remove-button" 5890 exportparts="base:remove-button__base" 5891 class="remove-button" 5892 appearance="plain" 5893 size=${this.size} 5894 @click=${()=>this.removeFile(e)} 5895 ?disabled=${this.disabled} 5896 > 5897 <wa-icon name="xmark" label=${this.localize.term("remove")} library="system"></wa-icon> 5898 </wa-button> 5899 </li> 5900 `}render(){const t=this.hasUpdated?this.hasSlotController.test("label"):this.withLabel,e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,i=!!this.label||!!t,o=!!this.hint||!!e;return K` 5901 <label 5902 part="form-control-label label" 5903 class=${ce({label:!0,"has-label":i})} 5904 aria-hidden=${i?"false":"true"} 5905 > 5906 <slot name="label">${this.label}</slot> 5907 </label> 5908 5909 <div part="base file-input" class="file-input"> 5910 <label 5911 id="dropzone" 5912 part="dropzone" 5913 for="file-input" 5914 class=${ce({dropzone:!0,dragging:this.dragging,disabled:this.disabled})} 5915 @dragenter=${this.handleDragEnter} 5916 @dragover=${this.handleDragOver} 5917 @dragleave=${this.handleDragLeave} 5918 @drop=${this.handleDrop} 5919 > 5920 <slot name="dropzone"> 5921 <wa-icon part="dropzone-icon" class="dropzone-icon" name="upload" library="system"></wa-icon> 5922 <span part="dropzone-text" class="dropzone-text"> 5923 ${this.multiple?this.localize.term("dropFilesHere"):this.localize.term("dropFileHere")} 5924 </span> 5925 </slot> 5926 5927 <input 5928 id="file-input" 5929 type="file" 5930 class="hidden-input" 5931 ?multiple=${this.multiple} 5932 ?disabled=${this.disabled} 5933 accept=${We(this.accept||void 0)} 5934 capture=${We(this.capture)} 5935 aria-describedby="hint" 5936 @change=${this.handleInputChange} 5937 /> 5938 </label> 5939 5940 <slot 5941 id="hint" 5942 part="hint" 5943 name="hint" 5944 class=${ce({hint:!0,"has-hint":o})} 5945 aria-hidden=${o?"false":"true"} 5946 >${this.hint}</slot 5947 > 5948 5949 ${this.files.length>0?K` 5950 <ul part="file-list" class="file-list" role="list"> 5951 ${this.files.map((t,e)=>this.renderFile(t,e))} 5952 </ul> 5953 `:""} 5954 </div> 5955 `}};_p.css=[Ue,zh,Cp],_p.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt("#dropzone")],_p.prototype,"dropzone",2),kt([Dt("#file-input")],_p.prototype,"input",2),kt([$t()],_p.prototype,"files",2),kt([$t()],_p.prototype,"dragging",2),kt([At({reflect:!0})],_p.prototype,"size",2),kt([vt("size")],_p.prototype,"handleSizeChange",1),kt([At()],_p.prototype,"label",2),kt([At()],_p.prototype,"hint",2),kt([At({type:Boolean,reflect:!0})],_p.prototype,"multiple",2),kt([At()],_p.prototype,"accept",2),kt([At({type:Boolean,reflect:!0})],_p.prototype,"required",2),kt([At()],_p.prototype,"capture",2),kt([At({attribute:"with-label",type:Boolean})],_p.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],_p.prototype,"withHint",2),_p=kt([St("wa-file-input")],_p);var Ep=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.value=0,this.unit="byte",this.display="short"}static get styles(){return[]}
5955render(){if(isNaN(this.value))return"";const t="bit"===this.unit?["","kilo","mega","giga","tera"]:["","kilo","mega","giga","tera","peta"],e=Math.max(0,Math.min(Math.floor(Math.log10(this.value)/3),t.length-1)),i=t[e]+this.unit,o=parseFloat((this.value/Math.pow(1e3,e)).toPrecision(3));return this.localize.number(o,{style:"unit",unit:i,unitDisplay:this.display})}};kt([At({type:Number})],Ep.prototype,"value",2),kt([At()],Ep.prototype,"unit",2),kt([At()],Ep.prototype,"display",2),Ep=kt([St("wa-format-bytes")],Ep);var Ap=h` 5956 :host(:focus) { 5957 outline: none; 5958 } 5959 5960 .number-field { 5961 display: flex; 5962 align-items: stretch; 5963 justify-content: start; 5964 position: relative; 5965 height: var(--wa-form-control-height); 5966 border-color: var(--wa-form-control-border-color); 5967 border-radius: var(--wa-form-control-border-radius); 5968 border-style: var(--wa-form-control-border-style); 5969 border-width: var(--wa-form-control-border-width); 5970 cursor: text; 5971 color: var(--wa-form-control-value-color); 5972 font-size: inherit; 5973 font-family: inherit; 5974 font-weight: var(--wa-form-control-value-font-weight); 5975 line-height: var(--wa-form-control-value-line-height); 5976 vertical-align: middle; 5977 width: 100%; 5978 transition: 5979 background-color var(--wa-transition-normal), 5980 border-color var(--wa-transition-normal), 5981 outline-color var(--wa-transition-fast); 5982 transition-timing-function: var(--wa-transition-easing); 5983 background-color: var(--wa-form-control-background-color); 5984 padding: 0; 5985 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 5986 outline-offset: var(--wa-focus-ring-offset); 5987 5988 &:focus-within { 5989 outline-color: var(--wa-color-focus); 5990 } 5991 5992 /* Style disabled inputs */ 5993 &:has(input:disabled) { 5994 cursor: not-allowed; 5995 opacity: 0.5; 5996 } 5997 } 5998 5999 /* Appearance modifiers */ 6000 :host([appearance='outlined']) { 6001 .number-field { 6002 background-color: var(--wa-form-control-background-color); 6003 border-color: var(--wa-form-control-border-color); 6004 } 6005 6006 .stepper { 6007 color: var(--wa-color-neutral-on-quiet); 6008 6009 @media (hover: hover) { 6010 &:hover:not(:disabled) { 6011 color: var(--wa-color-neutral-on-quiet); 6012 background-color: var(--wa-color-neutral-fill-quiet); 6013 } 6014 } 6015 6016 &:active:not(:disabled) { 6017 color: color-mix(in oklab, var(--wa-color-neutral-on-quiet), var(--wa-color-mix-active)); 6018 background-color: color-mix(in oklab, var(--wa-color-neutral-fill-quiet), var(--wa-color-mix-active)); 6019 } 6020 } 6021 } 6022 6023 :host([appearance='filled']) { 6024 .number-field { 6025 background-color: var(--wa-color-neutral-fill-quiet); 6026 border-color: var(--wa-color-neutral-fill-quiet); 6027 } 6028 6029 .stepper { 6030 color: var(--wa-color-neutral-on-quiet); 6031 6032 @media (hover: hover) { 6033 &:hover:not(:disabled) { 6034 color: var(--wa-color-neutral-on-normal); 6035 background-color: var(--wa-color-neutral-fill-normal); 6036 } 6037 } 6038 6039 &:active:not(:disabled) { 6040 color: color-mix(in oklab, var(--wa-color-neutral-on-normal), var(--wa-color-mix-active)); 6041 background-color: color-mix(in oklab, var(--wa-color-neutral-fill-normal), var(--wa-color-mix-active)); 6042 } 6043 } 6044 } 6045 6046 :host([appearance='filled-outlined']) { 6047 .number-field { 6048 background-color: var(--wa-color-neutral-fill-quiet); 6049 border-color: var(--wa-form-control-border-color); 6050 } 6051 6052 .stepper { 6053 color: var(--wa-color-neutral-on-quiet); 6054 6055 @media (hover: hover) { 6056 &:hover:not(:disabled) { 6057 color: var(--wa-color-neutral-on-normal); 6058 background-color: var(--wa-color-neutral-fill-normal); 6059 } 6060 } 6061 6062 &:active:not(:disabled) { 6063 color: color-mix(in oklab, var(--wa-color-neutral-on-normal), var(--wa-color-mix-active)); 6064 background-color: color-mix(in oklab, var(--wa-color-neutral-fill-normal), var(--wa-color-mix-active)); 6065 } 6066 } 6067 } 6068 6069 :host([pill]) { 6070 .number-field, 6071 .stepper { 6072 border-radius: var(--wa-border-radius-pill); 6073 } 6074 } 6075 6076 .number-field { 6077 /* Show autofill styles over the entire number field, not just the native <input> */ 6078 &:has(:autofill), 6079 &:has(:-webkit-autofill) { 6080 background-color: var(--wa-color-brand-fill-quiet) !important; 6081 } 6082 6083 input { 6084 flex: auto; 6085 height: 100%; 6086 width: auto; 6087 min-width: 0; 6088 margin: 0; 6089 padding: 0 var(--wa-form-control-padding-inline); 6090 outline: none; 6091 box-shadow: none; 6092 border: none; 6093 background-color: transparent; 6094 font: inherit; 6095 transition: inherit; 6096 cursor: inherit; 6097 -webkit-appearance: none; 6098 6099 /* Center-align and use tabular numbers for better alignment */ 6100 text-align: center; 6101 font-variant-numeric: tabular-nums; 6102 6103 /* Hide the number spinners in Firefox */ 6104 -moz-appearance: textfield; 6105 6106 /* Hide the number spinners in Chrome/Safari */ 6107 &::-webkit-outer-spin-button, 6108 &::-webkit-inner-spin-button { 6109 -webkit-appearance: none; 6110 margin: 0; 6111 display: none; 6112 } 6113 6114 /* Turn off Safari's autofill styles */ 6115 &:-webkit-autofill, 6116 &:-webkit-autofill:hover, 6117 &:-webkit-autofill:focus, 6118 &:-webkit-autofill:active { 6119 -webkit-background-clip: text; 6120 background-color: transparent; 6121 -webkit-text-fill-color: inherit; 6122 } 6123 } 6124 6125 &:autofill { 6126 &, 6127 &:hover, 6128 &:focus, 6129 &:active { 6130 box-shadow: none; 6131 caret-color: var(--wa-form-control-value-color); 6132 } 6133 } 6134 6135 &::placeholder { 6136 color: var(--wa-form-control-placeholder-color); 6137 user-select: none; 6138 -webkit-user-select: none; 6139 } 6140 6141 &:focus { 6142 outline: none; 6143 } 6144 } 6145 6146 .start, 6147 .end { 6148 display: inline-flex; 6149 flex: 1;
6150 align-items: center; 6151 cursor: default; 6152 6153 &::slotted(wa-icon) { 6154 color: var(--wa-color-neutral-on-quiet); 6155 } 6156 } 6157 6158 .start { 6159 justify-content: start; 6160 margin-inline-start: var(--wa-form-control-padding-inline); 6161 } 6162 6163 .end { 6164 justify-content: end; 6165 margin-inline-end: var(--wa-form-control-padding-inline); 6166 } 6167 6168 /* 6169 * Steppers - horizontal layout with minus on start, plus on end 6170 */ 6171 6172 .stepper { 6173 display: flex; 6174 align-items: center; 6175 justify-content: center; 6176 aspect-ratio: 1 / 1; 6177 height: calc(100% - var(--wa-form-control-border-width) * 2); 6178 flex: 0 0 auto; 6179 border: none; 6180 border-radius: calc(var(--wa-form-control-border-radius) - var(--wa-form-control-border-width) * 2); 6181 background: transparent; 6182 cursor: pointer; 6183 margin: var(--wa-form-control-border-width); 6184 padding: 0; 6185 font-size: inherit; 6186 transition-property: background-color, color; 6187 transition-duration: var(--wa-transition-fast); 6188 transition-timing-function: var(--wa-transition-easing); 6189 6190 &:disabled { 6191 opacity: 0.5; 6192 cursor: not-allowed; 6193 } 6194 6195 &:focus { 6196 outline: none; 6197 } 6198 } 6199 6200 :host([without-steppers]) .stepper { 6201 display: none; 6202 } 6203`,$p=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["blur","input"],this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.title="",this._value=null,this.defaultValue=this.getAttribute("value")||null,this.size="m",this.appearance="outlined",this.pill=!1,this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.step=1,this.withoutSteppers=!1,this.inputmode="numeric",this.withLabel=!1,this.withHint=!1}static get validators(){return[...super.validators,Fe()]}get value(){return this.valueHasChanged?this._value:this._value??this.defaultValue}set value(t){this._value!==t&&(this.valueHasChanged=!0,this._value=t)}handleSizeChange(){He(this.localName,this.size)}updateFormValue(t){null!=t?super.updateFormValue(t):this.setValue("",null)}get isAtMin(){if(void 0===this.min)return!1;const t=parseFloat(this.value||"");return!isNaN(t)&&t<=this.min}get isAtMax(){if(void 0===this.max)return!1;const t=parseFloat(this.value||"");return!isNaN(t)&&t>=this.max}handleChange(t){this.value=this.input.value,this.relayNativeEvent(t,{bubbles:!0,composed:!0})}handleInput(){this.value=this.input.value}handleKeyDown(t){bc(t,this),"ArrowUp"!==t.key&&"ArrowDown"!==t.key||requestAnimationFrame(()=>{this.value!==this.input.value&&(this.value=this.input.value)})}handleStepperPointerUp(t,e){if(this.disabled||this.readonly)return;const i=new InputEvent("beforeinput",{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i),i.defaultPrevented||("up"===t?this.input.stepUp():this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),"touch"!==e.pointerType&&this.input.focus())}handleStepperPointerDown(t){"touch"!==t.pointerType&&(t.preventDefault(),this.input.focus())}updated(t){super.updated(t),(t.has("value")||t.has("defaultValue"))&&(this.input&&this.value&&this.input.value!==this.value&&(this._value=this.input.value),this.customStates.set("blank",!this.value))}handleStepChange(){this.input.step=String(this.step),this.updateValidity()}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}stepUp(){this.input.stepUp(),this.value!==this.input.value&&(this.value=this.input.value)}stepDown(){this.input.stepDown(),this.value!==this.input.value&&(this.value=this.input.value)}formResetCallback(){this.value=this.defaultValue,super.formResetCallback()}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e;return K` 6204 <label 6205 part="form-control-label label" 6206 class=${ce({label:!0,"has-label":i})} 6207 for="input" 6208 aria-hidden=${i?"false":"true"} 6209 > 6210 <slot name="label">${this.label}</slot> 6211 </label> 6212 6213 <div part="base number-input" class="number-field"> 6214 ${this.withoutSteppers?"":K` 6215 <button 6216 part="stepper stepper-decrement" 6217 class="stepper stepper-decrement" 6218 type="button" 6219 tabindex="-1" 6220 aria-label=${this.localize.term("decrement")} 6221 ?disabled=${this.disabled||this.readonly||this.isAtMin} 6222 @pointerdown=${this.handleStepperPointerDown} 6223 @pointerup=${t=>this.handleStepperPointerUp("down",t)} 6224 > 6225 <slot name="decrement-icon"> 6226 <wa-icon name="minus" library="system"></wa-icon> 6227 </slot> 6228 </button> 6229 `} 6230 6231 <slot name="start" part="start" class="start"></slot> 6232 6233 <input 6234 part="input" 6235 id="input" 6236 class="control" 6237 type="number" 6238 inputmode=${We(this.inputmode)} 6239 title=${this.title} 6240 name=${We(this.name)} 6241 ?disabled=${this.disabled} 6242 ?readonly=${this.readonly} 6243 ?required=${this.required} 6244 placeholder=${We(this.placeholder)} 6245 min=${We(this.min)} 6246 max=${We(this.max)} 6247 step=${We(this.step)} 6248 .value=${Th(this.value??"")} 6249 autocomplete=${We(this.autocomplete)} 6250 ?autofocus=${this.autofocus} 6251 enterkeyhint=${We(this.enterkeyhint)} 6252 aria-describedby="hint" 6253 @change=${this.handleChange}
6254 @input=${this.handleInput} 6255 @keydown=${this.handleKeyDown} 6256 /> 6257 6258 <slot name="end" part="end" class="end"></slot> 6259 6260 ${this.withoutSteppers?"":K` 6261 <button 6262 part="stepper stepper-increment" 6263 class="stepper stepper-increment" 6264 type="button" 6265 tabindex="-1" 6266 aria-label=${this.localize.term("increment")} 6267 ?disabled=${this.disabled||this.readonly||this.isAtMax} 6268 @pointerdown=${this.handleStepperPointerDown} 6269 @pointerup=${t=>this.handleStepperPointerUp("up",t)} 6270 > 6271 <slot name="increment-icon"> 6272 <wa-icon name="plus" library="system"></wa-icon> 6273 </slot> 6274 </button> 6275 `} 6276 </div> 6277 6278 <slot 6279 id="hint" 6280 part="hint" 6281 name="hint" 6282 class=${ce({"has-slotted":o})} 6283 aria-hidden=${o?"false":"true"} 6284 >${this.hint}</slot 6285 > 6286 `}};$p.css=[Ue,zh,Ap],$p.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt("input")],$p.prototype,"input",2),kt([At()],$p.prototype,"title",2),kt([$t()],$p.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],$p.prototype,"defaultValue",2),kt([At({reflect:!0})],$p.prototype,"size",2),kt([vt("size")],$p.prototype,"handleSizeChange",1),kt([At({reflect:!0})],$p.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],$p.prototype,"pill",2),kt([At()],$p.prototype,"label",2),kt([At({attribute:"hint"})],$p.prototype,"hint",2),kt([At()],$p.prototype,"placeholder",2),kt([At({type:Boolean,reflect:!0})],$p.prototype,"readonly",2),kt([At({type:Boolean,reflect:!0})],$p.prototype,"required",2),kt([At({type:Number})],$p.prototype,"min",2),kt([At({type:Number})],$p.prototype,"max",2),kt([At()],$p.prototype,"step",2),kt([At({attribute:"without-steppers",type:Boolean})],$p.prototype,"withoutSteppers",2),kt([At()],$p.prototype,"autocomplete",2),kt([At({type:Boolean})],$p.prototype,"autofocus",2),kt([At()],$p.prototype,"enterkeyhint",2),kt([At()],$p.prototype,"inputmode",2),kt([At({attribute:"with-label",type:Boolean})],$p.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],$p.prototype,"withHint",2),kt([vt("step",{waitUntilFirstUpdate:!0}
6286)],$p.prototype,"handleStepChange",1),$p=kt([St("wa-number-input")],$p),$p.disableWarning?.("change-in-update");var Lp=h` 6287 :host { 6288 display: inline-flex; 6289 align-items: center; 6290 justify-content: center; 6291 aspect-ratio: 1; 6292 } 6293 6294 canvas { 6295 width: 100%; 6296 height: 100%; 6297 /* We force a near-instant transition so we can listen for transitionend when the color changes */ 6298 transition: color 1ms; 6299 } 6300 6301 span { 6302 /* We force a near-instant transition so we can listen for transitionend when the color changes */ 6303 transition: color 1ms; 6304 } 6305`,Dp=function(t,e,i){};class Mp{static render(t,e,i){Dp(t,e,i)}}var zp;!function(t){function e(e,i,o,a){var s=t(o,i);s.addData(e),s.make(),a=a||0;var n=s.getModuleCount();return{text:e,level:i,version:o,moduleCount:s.getModuleCount()+2*a,isDark:function(t,e){return e-=a,!((t-=a)<0||t>=n||e<0||e>=n)&&s.isDark(t,e)}}}function i(t,i,o,a,s){o=Math.max(1,o||1),a=Math.min(40,a||40);for(var n=o;n<=a;n+=1)try{return e(t,i,n,s)}catch(t){}}function o(t,e,i,o,a,s,n,r){var l=t.isDark,h=o+s,c=a+s,d=n-1,u=n+1,p=r-1,m=r+1,f=Math.floor(Math.min(.5,Math.max(0,i.radius))*s),g=l(n,r),b=l(d,p),v=l(d,r),w=l(d,m),y=l(n,m),x=l(u,m),k=l(u,r),C=l(u,p),S=l(n,p);o=Math.round(o),a=Math.round(a),h=Math.round(h),c=Math.round(c),g?function(t,e,i,o,a,s,n,r,l,h){function c(e,i,o,a,n,r,l){e?(t.lineTo(i+r,o+l),t.arcTo(i,o,a,n,s)):t.lineTo(i,o)}n?t.moveTo(e+s,i):t.moveTo(e,i),c(r,o,i,o,a,-s,0),c(l,o,a,e,a,0,-s),c(h,e,a,e,i,s,0),c(n,e,i,o,i,0,s)}(e,o,a,h,c,f,!v&&!S,!v&&!y,!k&&!y,!k&&!S):function(t,e,i,o,a,s,n,r,l,h){function c(e,i,o,a){t.moveTo(e+o,i),t.lineTo(e,i),t.lineTo(e,i+a),t.arcTo(e,i,e+o,i,s)}n&&c(e,i,s,s),r&&c(o,i,-s,s),l&&c(o,a,-s,-s),h&&c(e,a,s,-s)}(e,o,a,h,c,f,v&&S&&b,v&&y&&w,k&&y&&x,k&&S&&C)}function a(t,e,i,a){var s=t.moduleCount,n=i.size/s,r=0,l=0;e.beginPath();const h=7+i.quiet;for(r=0;r<s;r+=1)for(l=0;l<s;l+=1){if((l<h&&r<h||l>=s-h&&r<h||l<h&&r>=s-h)===a)o(t,e,i,i.left+l*n,i.top+r*n,n,r,l)}!function(t,e,i){const o=i&&e.cornerFill||e.fill;if("string"==typeof o)return void(t.fillStyle=o);const a=o.type,s=o.position,n=o.colorStops;let r;if("linear-gradient"===a){const i=s.slice(0,4).map(t=>Math.round(t*e.size));r=t.createLinearGradient.apply(t,i)}else{if("radial-gradient"!==a)throw new Error("Unsupported fill");{const i=s.slice(0,6).map(t=>Math.round(t*e.size));r=t.createRadialGradient.apply(t,i)}}n.forEach(([t,e])=>{r.addColorStop(t,e)}),t.fillStyle=r}(e,i,a),e.fill()}
6305function s(t,e,o){if(!(t=i(o.text,o.ecLevel,o.minVersion,o.maxVersion,o.quiet)))return null;var s=e.getContext("2d");return s?(function(t,e,i){i.background&&(e.fillStyle=i.background,e.fillRect(i.left,i.top,i.size,i.size))}(0,s,o),a(t,s,o,!0),a(t,s,o,!1),e):e}var n={minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",cornerFill:null,background:null,text:"no text",radius:.5,quiet:0,image:null,imageEcCover:.5};Dp=function(t,e,o){var a=Object.assign({},n,t);a.minVersion=a.minVersion,a.maxVersion=a.maxVersion,a.ecLevel=a.ecLevel,a.left=a.left,a.top=a.top,a.size=a.size,a.fill=a.fill,a.background=a.background,a.text=a.text,a.radius=a.radius,a.quiet=a.quiet,a.cornerFill=a.cornerFill||a.fill,a.image=a.image,a.imageBackground=a.imageBackground,a.imageEcCover=a.imageEcCover,a.imagePadding=a.imagePadding;var r=i(a.text,a.ecLevel,a.minVersion,a.maxVersion,a.quiet);if(!r)return;o=o||function(){};const l=function(){var t=e;if(e instanceof HTMLCanvasElement){e.width===a.size&&e.height===a.size||(e.width=a.size,e.height=a.size);const t=e.getContext("2d");t&&t.clearRect(0,0,e.width,e.height),s(r,e,a)}else if(r){const i=function(t,e){var i=document.createElement("canvas");return i.width=e.size,i.height=e.size,s(t,i,e)}(r,a);i&&(t=i,e.appendChild(t))}return t};if(a.image){const t=new Image;t.onload=function(){if(!r)return;const e=a.imageEcCover??n.imageEcCover,i=r.moduleCount-2*a.quiet,s=a.size/i,h=t.naturalWidth/t.naturalHeight;let c=a.size*e;c=Math.min(c,c*h);let d=a.size*e;d=Math.min(d,d/h);const u=i*i-172,p={L:.07,M:.15,Q:.25,H:.3}[a.ecLevel]*e*u|0;var m=Math.min(i,0|Math.sqrt(p*h),c),f=m/h|0;f>i&&(m=(f=i)*h|0),f=Math.min(f,d);const g=r.moduleCount/2-m/2|0,b=r.moduleCount/2-f/2|0,v=r.isDark;r.isDark=function(t,e){return!(g<=e&&e<g+m&&b<=t&&t<b+f)&&v(t,e)};const w=Math.min(m,f*h)-a.quiet,y=Math.min(f,m/h)-a.quiet;let x=(g+(m-w)/2-a.quiet)*s,k=(b+(f-y)/2-a.quiet)*s,C=w*s,S=y*s;const _=l().getContext("2d");_&&(_.fillStyle=a.imageBackground||"transparent",_.fillRect(x-4,k-4,C+8,S+8),_.drawImage(t,x,k,C,S)),o()},t.onerror=()=>{l(),o()},t.src=a.image}else l(),o()}}((zp=function(){function t(t,e){var i=t,o=r[e],a=null,s=0,n=null,l=new Array,h={},c=function(t,e){a=function(t){for(var e=new Array(t),i=0;i<t;i+=1){e[i]=new Array(t);for(var o=0;o<t;o+=1)e[i][o]=null}return e}(s=4*i+17),d(0,0),d(s-7,0),d(0,s-7),p(),u(),f(t,e),i>=7&&m(t),null==n&&(n=k(i,o,l)),b(n,e)},d=function(t,e){if(null!=a)for(var i=-1;i<=7;i+=1)if(!(t+i<=-1||s<=t+i))for(var o=-1;o<=7;o+=1)e+o<=-1||s<=e+o||(a[t+i][e+o]=0<=i&&i<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=o&&o<=4)},u=function(){if(a){for(var t=8;t<s-8;t+=1)null==a[t][6]&&(a[t][6]=t%2==0);for(var e=8;e<s-8;e+=1)null==a[6][e]&&(a[6][e]=e%2==0)}},p=function(){if(a)for(var t=g.getPatternPosition(i),e=0;e<t.length;e+=1)for(var o=0;o<t.length;o+=1){var s=t[e],n=t[o];if(null==a[s][n])for(var r=-2;r<=2;r+=1)for(var l=-2;l<=2;l+=1)a[s+r][n+l]=-2==r||2==r||-2==l||2==l||0==r&&0==l}},m=function(t){if(a){for(var e=g.getBCHTypeNumber(i),o=0;o<18;o+=1){var n=!t&&1==(e>>o&1);a[Math.floor(o/3)][o%3+s-8-3]=n}for(o=0;o<18;o+=1)n=!t&&1==(e>>o&1),a[o%3+s-8-3][Math.floor(o/3)]=n}},f=function(t,e){var i=o<<3|e,n=g.getBCHTypeInfo(i);if(a){for(var r=0;r<15;r+=1){let e=!t&&1==(n>>r&1);a[r<6?r:r<8?r+1:s-15+r][8]=e,a[8][r<8?s-r-1:r<9?15-r:14-r]=e}a[s-8][8]=!t}},b=function(t,e){for(var i=-1,o=s-1,n=7,r=0,l=g.getMaskFunction(e),h=s-1;h>0;h-=2)for(6==h&&(h-=1);;){for(var c=0;c<2;c+=1)if(a&&null==a[o][h-c]){var d=!1;r<t.length&&(d=1==(t[r]>>>n&1)),l(o,h-c)&&(d=!d),a[o][h-c]=d,-1==(n-=1)&&(r+=1,n=7)}if((o+=i)<0||s<=o){o-=i,i=-i;break}}},k=function(t,e,i){for(var o=w.getRSBlocks(t,e),a=y(),s=0;s<i.length;s+=1){var n=i[s];a.put(n.getMode(),4),a.put(n.getLength(),g.getLengthInBits(n.getMode(),t)),n.write(a)}var r=0;for(s=0;s<o.length;s+=1)r+=o[s].dataCount;if(a.getLengthInBits()>8*r)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+8*r+")");for(a.getLengthInBits()+4<=8*r&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*r||(a.put(236,8),a.getLengthInBits()>=8*r));)a.put(17,8);return function(t,e){for(var i=0,o=0,a=0,s=new Array(e.length),n=new Array(e.length),r=0;r<e.length;r+=1){var l=e[r].dataCount,h=e[r].totalCount-l;o=Math.max(o,l),a=Math.max(a,h),s[r]=new Array(l);for(var c=0;c<s[r].length;c+=1)s[r][c]=255&t.getBuffer()[c+i];i+=l;var d=g.getErrorCorrectPolynomial(h),u=v(s[r],d.getLength()-1).mod(d);for(n[r]=new Array(d.getLength()-1),c=0;c<n[r].length;c+=1){var p=c+u.getLength()-n[r].length;n[r][c]=p>=0?u.getAt(p):0}}var m=0;for(c=0;c<e.length;c+=1)m+=e[c].totalCount;var f=new Array(m),b=0;for(c=0;c<o;c+=1)for(r=0;r<e.length;r+=1)c<s[r].length&&(f[b]=s[r][c],b+=1);for(c=0;c<a;c+=1)for(r=0;r<e.length;r+=1)c<n[r].length&&(f[b]=n[r][c],b+=1);return f}(a,o)};return h.addData=function(t){var e=x(t);l.push(e),n=null},h.isDark=function(t,e){if(!a)throw new Error("_modules is null");if(t<0||s<=t||e<0||s<=e)throw new Error(t+","+e);return a[t][e]},h.getModuleCount=function(){return s},h.make=function(){c(!1,function(){for(var t=0,e=0,i=0;i<8;i+=1){c(!0,i);var o=g.getLostPoint(h);(0==i||t>o)&&(t=o,e=i)}return e}())},h}t.stringToBytes=function(t){return(new TextEncoder).encode(t)};var e,i,o,a,s,n=4,r={L:1,M:0,Q:3,H:2},l=0,h=1,c=2,d=3,u=4,p=5,m=6,f=7,g=(e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],i=1335,o=7973,s=function(t){for(var e=0;0!=t;)e+=1,t>>>=1;return e},(a={}).getBCHTypeInfo=function(t){for(var e=t<<10;s(e)-s(i)>=0;)e^=i<<s(e)-s(i);return 21522^(t<<10|e)},a.getBCHTypeNumber=function(t){for(var e=t<<12;s(e)-s(o)>=0;)e^=o<<s(e)-s(o);return t<<12|e},a.getPatternPosition=function(t){return e[t-1]},a.getMaskFunction=function(t){switch(t){case l:return function(t,e){return(t+e)%2==0};case h:return function(t,e){return t%2==0};case c:return function(t,e){return e%3==0};case d:return function(t,e){return(t+e)%3==0};case u:return function(t,e){return(Math.floor(t/2)+Math.floor(e/3))%2==0};case p:return function(t,e){return t*e%2+t*e%3==0};case m:return function(t,e){return(t*e%2+t*e%3)%2==0};case f:return function(t,e){return(t*e%3+(t+e)%2)%2==0};default:throw new Error("bad maskPattern:"+t)}},a.getErrorCorrectPolynomial=function(t){for(var e=v([1],0),i=0;i<t;
vendor: 6,183 bytes, line 6305
6305i+=1)e=e.multiply(v([1,b.gexp(i)],0));return e},a.getLengthInBits=function(t,e){if(t!=n||e<1||e>40)throw new Error("mode: "+t+"; type: "+e);return e<10?8:16},a.getLostPoint=function(t){for(var e=t.getModuleCount(),i=0,o=0;o<e;o+=1)for(var a=0;a<e;a+=1){for(var s=0,n=t.isDark(o,a),r=-1;r<=1;r+=1)if(!(o+r<0||e<=o+r))for(var l=-1;l<=1;l+=1)a+l<0||e<=a+l||0==r&&0==l||n==t.isDark(o+r,a+l)&&(s+=1);s>5&&(i+=3+s-5)}for(o=0;o<e-1;o+=1)for(a=0;a<e-1;a+=1){var h=0;t.isDark(o,a)&&(h+=1),t.isDark(o+1,a)&&(h+=1),t.isDark(o,a+1)&&(h+=1),t.isDark(o+1,a+1)&&(h+=1),0!=h&&4!=h||(i+=3)}for(o=0;o<e;o+=1)for(a=0;a<e-6;a+=1)t.isDark(o,a)&&!t.isDark(o,a+1)&&t.isDark(o,a+2)&&t.isDark(o,a+3)&&t.isDark(o,a+4)&&!t.isDark(o,a+5)&&t.isDark(o,a+6)&&(i+=40);for(a=0;a<e;a+=1)for(o=0;o<e-6;o+=1)t.isDark(o,a)&&!t.isDark(o+1,a)&&t.isDark(o+2,a)&&t.isDark(o+3,a)&&t.isDark(o+4,a)&&!t.isDark(o+5,a)&&t.isDark(o+6,a)&&(i+=40);var c=0;for(a=0;a<e;a+=1)for(o=0;o<e;o+=1)t.isDark(o,a)&&(c+=1);return i+=Math.abs(100*c/e/e-50)/5*10},a),b=function(){for(var t=new Array(256),e=new Array(256),i=0;i<8;i+=1)e[i]=1<<i;for(i=8;i<256;i+=1)e[i]=e[i-4]^e[i-5]^e[i-6]^e[i-8];for(i=0;i<255;i+=1)t[e[i]]=i;var o={glog:function(e){if(e<1)throw new Error("glog("+e+")");return t[e]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]}};return o}();function v(t,e){if(void 0===t.length)throw new Error(t.length+"/"+e);var i=function(){for(var i=0;i<t.length&&0==t[i];)i+=1;for(var o=new Array(t.length-i+e),a=0;a<t.length-i;a+=1)o[a]=t[a+i];return o}(),o={getAt:function(t){return i[t]},getLength:function(){return i.length},multiply:function(t){for(var e=new Array(o.getLength()+t.getLength()-1),i=0;i<o.getLength();i+=1)for(var a=0;a<t.getLength();a+=1)e[i+a]^=b.gexp(b.glog(o.getAt(i))+b.glog(t.getAt(a)));return v(e,0)},mod:function(t){if(o.getLength()-t.getLength()<0)return o;for(var e=b.glog(o.getAt(0))-b.glog(t.getAt(0)),i=new Array(o.getLength()),a=0;a<o.getLength();a+=1)i[a]=o.getAt(a);for(a=0;a<t.getLength();a+=1)i[a]^=b.gexp(b.glog(t.getAt(a))+e);return v(i,0).mod(t)}};return o}var w=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],e=function(t,e){var i={};return i.totalCount=t,i.dataCount=e,i},i={getRSBlocks:function(i,o){var a=function(e,i){switch(i){case r.L:return t[4*(e-1)+0];case r.M:return t[4*(e-1)+1];case r.Q:return t[4*(e-1)+2];case r.H:return t[4*(e-1)+3];default:return}}(i,o);if(void 0===a)throw new Error("bad rs block @ typeNumber:"+i+"/errorCorrectLevel:"+o);for(var s=a.length/3,n=new Array,l=0;l<s;l+=1)for(var h=a[3*l+0],c=a[3*l+1],d=a[3*l+2],u=0;u<h;u+=1)n.push(e(c,d));return n}};return i}(),y=function(){var t=new Array,e=0,i={getBuffer:function(){return t},getAt:function(e){var i=Math.floor(e/8);return 1==(t[i]>>>7-e%8&1)},put:function(t,e){for(var o=0;o<e;o+=1)i.putBit(1==(t>>>e-o-1&1))},getLengthInBits:function(){return e},putBit:function(i){var o=Math.floor(e/8);t.length<=o&&t.push(0),i&&(t[o]|=128>>>e%8),e+=1}};return i},x=function(e){var i=n,o=t.stringToBytes(e),a={getMode:function(){return i},getLength:function(t){return o.length},write:function(t){for(var e=0;e<o.length;e+=1)t.put(o[e],8)}};return a};return t}(),zp));var Tp=class extends Ft{constructor(){super(...arguments),this.value="",this.label="",this.size=128,this.fill="",this.background="",this.radius=0,this.errorCorrection="H",this.image=null,this.imageBackgroun
6305d=null,this.imageCoverage=null,this.imagePadding=null,this.computedStyle=null}updated(t){super.updated(t),this.generate()}generate(){if(!this.hasUpdated)return;this.canvas.style.maxWidth=`${this.size}px`,this.canvas.style.maxHeight=`${this.size}px`,this.computedStyle||(this.computedStyle=getComputedStyle(this));const t=this.computedStyle,e=this.shadowRoot?.querySelector("span");e&&(this.spanComputedStyle||(this.spanComputedStyle=getComputedStyle(e))),Mp.render({text:this.value,radius:this.radius,ecLevel:this.errorCorrection,fill:this.fill||t.color,background:this.background||null,size:2*this.size,image:this.image,imageEcCover:this.imageCoverage,imagePadding:this.imagePadding,imageBackground:this.imageBackground||this.background,cornerFill:this.spanComputedStyle?.color},this.canvas)}render(){return K` 6306 <canvas 6307 part="base qr-code" 6308 class="qr-code" 6309 role="img" 6310 aria-label=${this.label?.length>0?this.label:this.value} 6311 style=${fc({maxWidth:`${this.size}px`,maxHeight:`${this.size}px`,minWidth:`${this.size}px`,minHeight:`${this.size}px`})} 6312 @transitionend=${t=>{"color"===t.propertyName&&this.generate()}} 6313 > 6314 <span style="color: var(--corner-color);"></span> 6315 </canvas> 6316 `}};Tp.css=Lp,kt([Dt("canvas")],Tp.prototype,"canvas",2),kt([At()],Tp.prototype,"value",2),kt([At()],Tp.prototype,"label",2),kt([At({type:Number})],Tp.prototype,"size",2),kt([At()],Tp.prototype,"fill",2),kt([At()],Tp.prototype,"background",2),kt([At({type:Number})],Tp.prototype,"radius",2),kt([At({attribute:"error-correction"})],Tp.prototype,"errorCorrection",2),kt([At()],Tp.prototype,"image",2),kt([At({attribute:"image-background"})],Tp.prototype,"imageBackground",2),kt([At({attribute:"image-coverage",type:Number})],Tp.prototype,"imageCoverage",2),kt([At({attribute:"image-padding",type:Number})],Tp.prototype,"imagePadding",2),Tp=kt([St("wa-qr-code")],Tp);var Op=h` 6317 :host { 6318 --checked-icon-color: var(--wa-form-control-activated-color); 6319 --checked-icon-scale: 0.7; 6320 6321 color: var(--wa-form-control-value-color); 6322 display: inline-flex; 6323 flex-direction: row; 6324 align-items: top; 6325 font-family: inherit; 6326 font-weight: var(--wa-form-control-value-font-weight); 6327 line-height: var(--wa-form-control-value-line-height); 6328 cursor: pointer; 6329 user-select: none; 6330 -webkit-user-select: none; 6331 } 6332 6333 :host(:focus) { 6334 outline: none; 6335 } 6336 6337 /* When the control isn't checked, hide the circle for Windows High Contrast mode a11y */ 6338 :host(:not(:state(checked))) svg circle { 6339 opacity: 0; 6340 } 6341 6342 [part~='label'] { 6343 display: inline; 6344 } 6345 6346 [part~='hint'] { 6347 margin-block-start: 0.5em; 6348 } 6349 6350 /* Default spacing for default appearance radios */ 6351 :host([appearance='default']) { 6352 margin-block: 0.375em; /* Half of the original 0.75em gap on each side */ 6353 } 6354 6355 :host([appearance='default'][data-wa-radio-horizontal]) { 6356 margin-block: 0; 6357 margin-inline: 0.5em; /* Half of the original 1em gap on each side */ 6358 } 6359 6360 /* Remove margin from first/last items to prevent extra space */ 6361 :host([appearance='default'][data-wa-radio-first]) { 6362 margin-block-start: 0; 6363 margin-inline-start: 0; 6364 } 6365 6366 :host([appearance='default'][data-wa-radio-last]) { 6367 margin-block-end: 0; 6368 margin-inline-end: 0; 6369 } 6370 6371 /* Button appearance have no spacing, they get handled by the overlap margins below */ 6372 :host([appearance='button']) { 6373 margin: 0; 6374 align-items: center; 6375 min-height: var(--wa-form-control-height); 6376 background-color: var(--wa-color-surface-default); 6377 border: var(--wa-form-control-border-width) var(--wa-form-control-border-style) var(--wa-form-control-border-color); 6378 border-radius: var(--wa-border-radius-m); 6379 padding: 0 var(--wa-form-control-padding-inline); 6380 transition: 6381 background-color var(--wa-transition-fast), 6382 border-color var(--wa-transition-fast); 6383 } 6384 6385 /* Default appearance */ 6386 :host([appearance='default']) { 6387 .control { 6388 flex: 0 0 auto; 6389 position: relative; 6390 display: inline-flex; 6391 align-items: center; 6392 justify-content: center; 6393 width: var(--wa-form-control-toggle-size); 6394 height: var(--wa-form-control-toggle-size); 6395 border-color: var(--wa-form-control-border-color); 6396 border-radius: 50%; 6397 border-style: var(--wa-form-control-border-style); 6398 border-width: var(--wa-form-control-border-width); 6399 background-color: var(--wa-form-control-background-color); 6400 color: transparent; 6401 transition: 6402 background var(--wa-transition-normal), 6403 border-color var(--wa-transition-fast), 6404 box-shadow var(--wa-transition-fast), 6405 color var(--wa-transition-fast); 6406 transition-timing-function: var(--wa-transition-easing); 6407 6408 margin-inline-end: 0.5em; 6409 } 6410 6411 .checked-icon { 6412 display: flex; 6413 fill: currentColor; 6414 width: var(--wa-form-control-toggle-size); 6415 height: var(--wa-form-control-toggle-size); 6416 scale: var(--checked-icon-scale); 6417 } 6418 } 6419 6420 /* Button appearance */ 6421 :host([appearance='button']) { 6422 .control { 6423 display: none; 6424 } 6425 } 6426 6427 /* Checked */ 6428 :host(:state(checked)) .control { 6429 color: var(--checked-icon-color); 6430 border-color: var(--wa-form-control-activated-color); 6431 background-color: var(--wa-form-control-background-color); 6432 } 6433 6434 /* Focus */ 6435 :host(:focus-visible) .control { 6436 outline: var(--wa-focus-ring); 6437 outline-offset: var(--wa-focus-ring-offset); 6438 } 6439 6440 /* Disabled */ 6441 :host(:state(disabled)) { 6442 opacity: 0.5;
6443 cursor: not-allowed; 6444 } 6445 6446 /* Horizontal grouping - remove inner border radius */ 6447 :host([appearance='button'][data-wa-radio-horizontal][data-wa-radio-inner]) { 6448 border-radius: 0; 6449 } 6450 6451 :host([appearance='button'][data-wa-radio-horizontal][data-wa-radio-first]) { 6452 border-start-end-radius: 0; 6453 border-end-end-radius: 0; 6454 } 6455 6456 :host([appearance='button'][data-wa-radio-horizontal][data-wa-radio-last]) { 6457 border-start-start-radius: 0; 6458 border-end-start-radius: 0; 6459 } 6460 6461 /* Vertical grouping - remove inner border radius */ 6462 :host([appearance='button'][data-wa-radio-vertical][data-wa-radio-inner]) { 6463 border-radius: 0; 6464 } 6465 6466 :host([appearance='button'][data-wa-radio-vertical][data-wa-radio-first]) { 6467 border-end-start-radius: 0; 6468 border-end-end-radius: 0; 6469 } 6470 6471 :host([appearance='button'][data-wa-radio-vertical][data-wa-radio-last]) { 6472 border-start-start-radius: 0; 6473 border-start-end-radius: 0; 6474 } 6475 6476 @media (hover: hover) { 6477 :host([appearance='button']:hover:not(:state(disabled), :state(checked))) { 6478 background-color: color-mix(in srgb, var(--wa-color-surface-default) 95%, var(--wa-color-mix-hover)); 6479 } 6480 } 6481 6482 :host([appearance='button']:focus-visible) { 6483 outline: var(--wa-focus-ring); 6484 outline-offset: var(--wa-focus-ring-offset); 6485 } 6486 6487 :host([appearance='button']:state(checked)) { 6488 border-color: var(--wa-form-control-activated-color); 6489 background-color: var(--wa-color-brand-fill-quiet); 6490 } 6491 6492 :host([appearance='button']:state(checked):focus-visible) { 6493 outline: var(--wa-focus-ring); 6494 outline-offset: var(--wa-focus-ring-offset); 6495 } 6496 6497 /* Button overlap margins */ 6498 :host([appearance='button'][data-wa-radio-horizontal]:not([data-wa-radio-first])) { 6499 margin-inline-start: calc(-1 * var(--wa-form-control-border-width)); 6500 } 6501 6502 :host([appearance='button'][data-wa-radio-vertical]:not([data-wa-radio-first])) { 6503 margin-block-start: calc(-1 * var(--wa-form-control-border-width)); 6504 } 6505 6506 /* Ensure interactive states are visible above adjacent buttons */ 6507 :host([appearance='button']:hover), 6508 :host([appearance='button']:state(checked)) { 6509 position: relative; 6510 z-index: 1; 6511 } 6512 6513 :host([appearance='button']:focus-visible) { 6514 z-index: 2; 6515 } 6516`,Pp=class extends Re{constructor(){super(),this.checked=!1,this.forceDisabled=!1,this.appearance="default",this.disabled=!1,this.handleClick=()=>{this.disabled||this.forceDisabled||(this.checked=!0)},this.addEventListener("click",this.handleClick)}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.setInitialAttributes()}setInitialAttributes(){this.setAttribute("role","radio"),this.tabIndex=0,this.setAttribute("aria-disabled",this.disabled||this.forceDisabled?"true":"false")}updated(t){if(super.updated(t),t.has("checked")&&(this.customStates.set("checked",this.checked),this.setAttribute("aria-checked",this.checked?"true":"false"),this.disabled||this.forceDisabled||(this.tabIndex=this.checked?0:-1)),t.has("disabled")||t.has("forceDisabled")){const t=this.disabled||this.forceDisabled;this.customStates.set("disabled",t),this.setAttribute("aria-disabled",t?"true":"false"),this.tabIndex=t?-1:this.checked?0:-1}}setValue(){}render(){return K` 6517 <span part="control" class="control"> 6518 ${this.checked?K` 6519 <svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" part="checked-icon" class="checked-icon"> 6520 <circle cx="8" cy="8" r="8" /> 6521 </svg> 6522 `:""} 6523 </span> 6524 6525 <slot part="label" class="label"></slot> 6526 `}};Pp.css=[zh,Ue,Op],kt([$t()],Pp.prototype,"checked",2),kt([$t()],Pp.prototype,"forceDisabled",2),kt([At({reflect:!0})],Pp.prototype,"value",2),kt([At({reflect:!0})],Pp.prototype,"appearance",2),kt([At({reflect:!0})],Pp.prototype,"size",2),kt([vt("size")],Pp.prototype,"handleSizeChange",1),kt([At({type:Boolean})],Pp.prototype,"disabled",2),Pp=kt([St("wa-radio")],Pp),Pp.disableWarning?.("change-in-update");var Fp=h` 6527 .form-control { 6528 position: relative; 6529 border: none; 6530 padding: 0; 6531 margin: 0; 6532 } 6533 6534 .label { 6535 padding: 0; 6536 } 6537 6538 .radio-group-required .label::after { 6539 content: var(--wa-form-control-required-content); 6540 margin-inline-start: var(--wa-form-control-required-content-offset); 6541 } 6542 6543 [part~='form-control-input'] { 6544 display: flex; 6545 flex-direction: column; 6546 flex-wrap: wrap; 6547 gap: 0; /* Radios handle their own spacing */ 6548 } 6549 6550 /* Horizontal */ 6551 :host([orientation='horizontal']) [part~='form-control-input'] { 6552 flex-direction: row; 6553 } 6554 6555 /* Help text */ 6556 [part~='hint'] { 6557 margin-block-start: 0.5em; 6558 } 6559`,Ip=class extends Re{constructor(){super(),this.hasSlotController=new qe(this,"hint","label"),this.label="",this.hint="",this.name=null,this.disabled=!1,this.orientation="vertical",this._value=null,this.defaultValue=this.getAttribute("value")||null,this.required=!1,this.withLabel=!1,this.withHint=!1,this.handleRadioClick=t=>{const e=t.target.closest("wa-radio");if(!e||e.disabled||e.forceDisabled||this.disabled)return;const i=this.value;this.value=e.value,e.checked=!0;const o=this.getAllRadios();for(const t of o)e!==t&&(t.checked=!1,t.setAttribute("tabindex","-1"));this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})},this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleRadioClick)}static get validators(){const t=[Mh({validationElement:Object.assign(document.createElement("input"),{required:!0,type:"radio",name:Wh("__wa-radio")})})];return[...super.validators,...t]}get value(){return this.valueHasChanged?this._value:this._value??this.defaultValue}set value(t){"number"==typeof t&&(t=String(t)),this.valueHasChanged=!0,this._value=t}handleSizeChange(){He(this.localName,this.size)}get validationTarget(){const t=this.querySelector(":is(wa-radio):not([disabled])");if(t)return t}updated(t){(t.has("disabled")||t.has("size")||t.has("value")||t.has("defaultValue"))&&this.syncRadioElements()}formResetCallback(...t){this._value=null,super.formResetCallback(...t),this.syncRadioElements()}getAllRadios(){return[...this.querySelectorAll("wa-radio")]}handleLabelClick(){this.focus()}async syncRadioElements(){const t=this.getAllRadios();if(t.forEach((e,i)=>{this.size&&e.setAttribute("size",this.size),e.toggleAttribute("data-wa-radio-horizontal","vertical"!==this.orientation),e.toggleAttribute("data-wa-radio-vertical","vertical"===this.orientation),e.toggleAttribute("data-wa-radio-first",0===i),e.toggleAttribute("data-wa-radio-inner",0!==i&&i!==t.length-1),e.toggleAttribute("data-wa-radio-last",i===t.length-1),e.forceDisabled=this.disabled}),await Promise.all(t.map(async t=>{await t.updateComplete,t.disabled||t.value!==this.value?t.checked=!1:t.checked=!0})),this.disabled)t.forEach(t=>{t.tabIndex=-1});else{const e=t.filter(t=>!t.disabled),i=e.find(t=>t.checked);e.length>0&&(i?e.forEach(t=>{t.tabIndex=t.checked?0:-1}):e.forEach((t,e)=>{t.tabIndex=0===e?0:-1})),t.filter(t=>
6559t.disabled).forEach(t=>{t.tabIndex=-1})}}handleKeyDown(t){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"," "].includes(t.key)||this.disabled)return;const e=this.getAllRadios().filter(t=>!t.disabled);if(e.length<=0)return;t.preventDefault();const i=this.value,o=e.find(t=>t.checked)??e[0],a=" "===t.key?0:["ArrowUp","ArrowLeft"].includes(t.key)?-1:1;let s=e.indexOf(o)+a;s||(s=0),s<0&&(s=e.length-1),s>e.length-1&&(s=0);const n=e.some(t=>"wa-radio-button"===t.tagName.toLowerCase());this.getAllRadios().forEach(t=>{t.checked=!1,n||t.setAttribute("tabindex","-1")}),this.value=e[s].value,e[s].checked=!0,n?e[s].shadowRoot.querySelector("button").focus():(e[s].setAttribute("tabindex","0"),e[s].focus()),this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),t.preventDefault()}focus(t){if(this.disabled)return;const e=this.getAllRadios(),i=e.find(t=>t.checked),o=e.find(t=>!t.disabled),a=i||o;a&&a.focus(t)}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e;return K` 6560 <fieldset 6561 part="form-control" 6562 class=${ce({"form-control":!0,"form-control-radio-group":!0,"form-control-has-label":i})} 6563 role="radiogroup" 6564 aria-labelledby="label" 6565 aria-describedby="hint" 6566 aria-errormessage="error-message" 6567 aria-orientation=${this.orientation} 6568 > 6569 <label 6570 part="form-control-label" 6571 id="label" 6572 class=${ce({label:!0,"has-label":i})} 6573 aria-hidden=${i?"false":"true"} 6574 @click=${this.handleLabelClick} 6575 > 6576 <slot name="label">${this.label}</slot> 6577 </label> 6578 6579 <slot part="form-control-input" @slotchange=${this.syncRadioElements}></slot> 6580 6581 <slot 6582 id="hint" 6583 name="hint" 6584 part="hint" 6585 class=${ce({"has-slotted":o})} 6586 aria-hidden=${o?"false":"true"} 6587 >${this.hint}</slot 6588 > 6589 </fieldset> 6590 `}};Ip.css=[Ue,zh,Fp],Ip.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt("slot:not([name])")],Ip.prototype,"defaultSlot",2),kt([At()],Ip.prototype,"label",2),kt([At({attribute:"hint"})],Ip.prototype,"hint",2),kt([At({reflect:!0})],Ip.prototype,"name",2),kt([At({type:Boolean,reflect:!0})],Ip.prototype,"disabled",2),kt([At({reflect:!0})],Ip.prototype,"orientation",2),kt([$t()],Ip.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],Ip.prototype,"defaultValue",2),kt([At({reflect:!0})],Ip.prototype,"size",2),kt([vt("size")],Ip.prototype,"handleSizeChange",1),kt([At({type:Boolean,reflect:!0})],Ip.prototype,"required",2),kt([At({type:Boolean,attribute:"with-label"})],Ip.prototype,"withLabel",2),kt([At({type:Boolean,attribute:"with-hint"})],Ip.prototype,"withHint",2),Ip=kt([St("wa-radio-group")],Ip),Ip.disableWarning?.("change-in-update");var Rp=class extends Event{constructor(t){super("wa-hover",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},Vp=h` 6591 :host { 6592 --symbol-color: var(--wa-color-neutral-on-quiet); 6593 --symbol-color-active: var(--wa-color-yellow-70); 6594 --symbol-spacing: 0.125em; 6595 6596 display: inline-flex; 6597 border-radius: var(--wa-border-radius-m); 6598 vertical-align: middle; 6599 touch-action: none; 6600 } 6601 6602 :host(:focus) { 6603 outline: none; 6604 } 6605 6606 :host(:focus-visible) { 6607 outline: var(--wa-focus-ring); 6608 outline-offset: var(--wa-focus-ring-offset); 6609 } 6610 6611 .rating { 6612 position: relative; 6613 display: inline-flex; 6614 } 6615 6616 .symbols { 6617 display: inline-flex; 6618 gap: 0.125em; 6619 position: relative; 6620 line-height: 0; 6621 color: var(--symbol-color); 6622 white-space: nowrap; 6623 cursor: pointer; 6624 } 6625 6626 .symbols > * { 6627 padding: var(--symbol-spacing); 6628 } 6629 6630 .symbol-active, 6631 .partial-filled { 6632 color: var(--symbol-color-active); 6633 } 6634 6635 .partial-symbol-container { 6636 position: relative; 6637 } 6638 6639 .partial-filled { 6640 position: absolute; 6641 top: var(--symbol-spacing); 6642 left: var(--symbol-spacing); 6643 } 6644 6645 .symbol { 6646 transition: scale var(--wa-transition-normal) var(--wa-transition-easing); 6647 pointer-events: none; 6648 } 6649 6650 .symbol-hover { 6651 scale: 1.2; 6652 } 6653 6654 .rating-readonly .symbols { 6655 cursor: default; 6656 } 6657 6658 :host([disabled]) .symbol-hover, 6659 .rating-readonly .symbol-hover { 6660 scale: none; 6661 } 6662 6663 :host([disabled]) { 6664 opacity: 0.5; 6665 } 6666 6667 :host([disabled]) .symbols {
6668 cursor: not-allowed; 6669 } 6670 6671 /* Forced colors mode */ 6672 @media (forced-colors: active) { 6673 .symbol-active { 6674 color: SelectedItem; 6675 } 6676 } 6677`,Bp=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["change"],this.localize=new ie(this),this.role="slider",this.hoverValue=0,this.isHovering=!1,this.name=null,this.label="",this.value=0,this.defaultValue=0,this.max=5,this.precision=1,this.readonly=!1,this.required=!1,this.getSymbol=(t,e)=>e?'<wa-icon name="star" library="system" variant="solid"></wa-icon>':'<wa-icon name="star" library="system" variant="regular"></wa-icon>',this.size="m",this.handleClick=t=>{this.disabled||(this.setRatingValue(this.getValueFromXCoordinate(t.clientX)),this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))},this.handleKeyDown=t=>{const e=this.matches(":dir(ltr)"),i="rtl"===this.localize.dir(),o=this.value;if(!this.disabled&&!this.readonly){if("ArrowDown"===t.key||e&&"ArrowLeft"===t.key||i&&"ArrowRight"===t.key){const e=t.shiftKey?1:this.precision;this.value=Math.max(0,this.value-e),t.preventDefault()}if("ArrowUp"===t.key||e&&"ArrowRight"===t.key||i&&"ArrowLeft"===t.key){const e=t.shiftKey?1:this.precision;this.value=Math.min(this.max,this.value+e),t.preventDefault()}"Home"===t.key&&(this.value=0,t.preventDefault()),"End"===t.key&&(this.value=this.max,t.preventDefault()),this.value!==o&&this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}},this.handlePointerEnter=t=>{this.isHovering=!0,this.hoverValue=this.getValueFromPointerPosition(t)},this.handlePointerMove=t=>{this.hoverValue=this.getValueFromPointerPosition(t)},this.handlePointerLeave=()=>{this.isHovering=!1},this.handlePointerDown=t=>{0===t.button&&(this.isHovering=!0,this.hoverValue=this.getValueFromPointerPosition(t),this.setPointerCapture(t.pointerId),t.preventDefault())},this.handlePointerUp=t=>{this.releasePointerCapture(t.pointerId),this.isHovering=!1}}static get validators(){return[...super.validators,Mh()]}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-valuenow",String(this.value)),this.setAttribute("aria-valuemin","0"),this.setAttribute("aria-valuemax",String(this.max)),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.setAttribute("aria-readonly",this.readonly?"true":"false"),this.label&&this.setAttribute("aria-label",this.label),this.disabled||this.readonly?this.tabIndex=-1:this.tabIndex=0,this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("pointerenter",this.handlePointerEnter),this.addEventListener("pointermove",this.handlePointerMove),this.addEventListener("pointerleave",this.handlePointerLeave),this.addEventListener("pointerdown",this.handlePointerDown),this.addEventListener("pointerup",this.handlePointerUp)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown),this.removeEventListener("pointerenter",this.handlePointerEnter),this.removeEventListener("pointermove",this.handlePointerMove),this.removeEventListener("pointerleave",this.handlePointerLeave),this.removeEventListener("pointerdown",this.handlePointerDown),this.removeEventListener("pointerup",this.handlePointerUp)}updated(t){super.updated(t),t.has("value")&&this.setAttribute("aria-valuenow",String(this.value)),t.has("max")&&this.setAttribute("aria-valuemax",String(this.max)),t.has("disabled")&&(this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.tabIndex=this.disabled||this.readonly?-1:0),t.has("readonly")&&(this.setAttribute("aria-readonly",this.readonly?"true":"false"),this.tabIndex=this.disabled||this.readonly?-1:0),t.has("label")&&(this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"))}handleSizeChange(){He(this.localName,this.size)}getValueFromPointerPosition(t){return this.getValueFromXCoordinate(t.clientX)}getValueFromXCoordinate(t){const e="rtl"===this.localize.dir(),{left:i,right:o,width:a}=this.getBoundingClientRect();return Uh(e?this.roundToPrecision((o-t)/a*this.max,this.precision):this.roundToPrecision((t-i)/a*this.max,this.precision),0,this.max)}
6677setRatingValue(t){this.disabled||this.readonly||(this.value=t===this.value?0:t,this.isHovering=!1)}roundToPrecision(t,e=.5){const i=1/e;return Math.ceil(t*i)/i}handleHoverValueChange(){this.dispatchEvent(new Rp({phase:"move",value:this.hoverValue}))}handleIsHoveringChange(){this.dispatchEvent(new Rp({phase:this.isHovering?"start":"end",value:this.hoverValue}))}formResetCallback(){this.value=this.defaultValue,super.formResetCallback()}render(){const t=this.didSSR&&!this.hasUpdated?this.dir:"rtl"===this.localize.dir(),e=Array.from(Array(this.max).keys());let i=0;return i=this.disabled||this.readonly?this.value:this.isHovering?this.hoverValue:this.value,K` 6678 <div 6679 part="base rating" 6680 class=${ce({rating:!0,"rating-readonly":this.readonly,"rating-disabled":this.disabled})} 6681 > 6682 <span class="symbols"> 6683 ${e.map(e=>{const o=i>=e+1;return i>e&&i<e+1?K` 6684 <span 6685 class=${ce({symbol:!0,"partial-symbol-container":!0,"symbol-hover":this.isHovering&&Math.ceil(i)===e+1})} 6686 role="presentation" 6687 > 6688 <div 6689 style=${fc({clipPath:t?`inset(0 ${100*(i-e)}% 0 0)`:`inset(0 0 0 ${100*(i-e)}%)`})} 6690 > 6691 ${iu(this.getSymbol(e+1,!1))} 6692 </div> 6693 <div 6694 class="partial-filled" 6695 style=${fc({clipPath:t?`inset(0 0 0 ${100-100*(i-e)}%)`:`inset(0 ${100-100*(i-e)}% 0 0)`})} 6696 > 6697 ${iu(this.getSymbol(e+1,!0))} 6698 </div> 6699 </span> 6700 `:K` 6701 <span 6702 class=${ce({symbol:!0,"symbol-hover":this.isHovering&&Math.ceil(i)===e+1,"symbol-active":i>=e+1})} 6703 role="presentation" 6704 > 6705 ${iu(this.getSymbol(e+1,o))} 6706 </span> 6707 `})} 6708 </span> 6709 </div> 6710 `}};Bp.css=[Ue,Vp],kt([At({reflect:!0})],Bp.prototype,"role",2),kt([$t()],Bp.prototype,"hoverValue",2),kt([$t()],Bp.prototype,"isHovering",2),kt([At()],Bp.prototype,"name",2),kt([At()],Bp.prototype,"label",2),kt([At({type:Number})],Bp.prototype,"value",2),kt([At({type:Number,attribute:"default-value"})],Bp.prototype,"defaultValue",2),kt([At({type:Number})],Bp.prototype,"max",2),kt([At({type:Number})],Bp.prototype,"precision",2),kt([At({type:Boolean,reflect:!0})],Bp.prototype,"readonly",2),kt([At({type:Boolean})],Bp.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],Bp.prototype,"required",2),kt([At()],Bp.prototype,"getSymbol",2),kt([At({reflect:!0})],Bp.prototype,"size",2),kt([vt("size")],Bp.prototype,"handleSizeChange",1),kt([vt("hoverValue")],Bp.prototype,"handleHoverValueChange",1),kt([vt("isHovering")],Bp.prototype,"handleIsHoveringChange",1),Bp=kt([St("wa-rating")],Bp);var Np=h` 6711 :host { 6712 --tag-max-size: 10ch; 6713 --show-duration: var(--wa-transition-fast); 6714 --hide-duration: var(--wa-transition-fast); 6715 } 6716 6717 /* Add ellipses to multi select options */ 6718 :host wa-tag::part(content) { 6719 display: initial; 6720 white-space: nowrap; 6721 text-overflow: ellipsis; 6722 overflow: hidden; 6723 max-width: var(--tag-max-size); 6724 } 6725 6726 :host .disabled [part~='combobox'] { 6727 opacity: 0.5; 6728 cursor: not-allowed; 6729 outline: none; 6730 } 6731 6732 :host .enabled:is(.open, :focus-within) [part~='combobox'] { 6733 outline-color: var(--wa-color-focus); 6734 } 6735 6736 /** The popup */ 6737 .select { 6738 flex: 1 1 auto; 6739 display: inline-flex; 6740 width: 100%; 6741 position: relative; 6742 vertical-align: middle; 6743 6744 /* Pass through from select to the popup */ 6745 --show-duration: inherit; 6746 --hide-duration: inherit; 6747 6748 &::part(popup) { 6749 z-index: 900; 6750 } 6751 6752 &[data-current-placement^='top']::part(popup) { 6753 transform-origin: bottom; 6754 } 6755 6756 &[data-current-placement^='bottom']::part(popup) { 6757 transform-origin: top; 6758 } 6759 } 6760 6761 /* Combobox */ 6762 .combobox { 6763 flex: 1; 6764 display: flex; 6765 width: 100%; 6766 min-width: 0;
6767 align-items: center; 6768 justify-content: start; 6769 6770 min-height: var(--wa-form-control-height); 6771 6772 background-color: var(--wa-form-control-background-color); 6773 border-color: var(--wa-form-control-border-color); 6774 border-radius: var(--wa-form-control-border-radius); 6775 border-style: var(--wa-form-control-border-style); 6776 border-width: var(--wa-form-control-border-width); 6777 color: var(--wa-form-control-value-color); 6778 cursor: pointer; 6779 font-family: inherit; 6780 font-weight: var(--wa-form-control-value-font-weight); 6781 line-height: var(--wa-form-control-value-line-height); 6782 overflow: hidden; 6783 padding: 0 var(--wa-form-control-padding-inline); 6784 position: relative; 6785 vertical-align: middle; 6786 transition: 6787 background-color var(--wa-transition-normal), 6788 border-color var(--wa-transition-normal), 6789 outline-color var(--wa-transition-fast); 6790 transition-timing-function: var(--wa-transition-easing); 6791 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 6792 outline-offset: var(--wa-focus-ring-offset); 6793 6794 /* Pills */ 6795 :host([pill]) & { 6796 border-radius: var(--wa-border-radius-pill); 6797 } 6798 } 6799 6800 /* Appearance modifiers */ 6801 :host([appearance='outlined']) .combobox { 6802 background-color: var(--wa-form-control-background-color); 6803 border-color: var(--wa-form-control-border-color); 6804 } 6805 6806 :host([appearance='filled']) .combobox { 6807 background-color: var(--wa-color-neutral-fill-quiet); 6808 border-color: var(--wa-color-neutral-fill-quiet); 6809 } 6810 6811 :host([appearance='filled-outlined']) .combobox { 6812 background-color: var(--wa-color-neutral-fill-quiet); 6813 border-color: var(--wa-form-control-border-color); 6814 } 6815 6816 .display-input { 6817 position: relative; 6818 width: 100%; 6819 font: inherit; 6820 border: none; 6821 background: none; 6822 line-height: var(--wa-form-control-value-line-height); 6823 color: var(--wa-form-control-value-color); 6824 cursor: inherit; 6825 overflow: hidden; 6826 padding: 0; 6827 margin: 0; 6828 -webkit-appearance: none; 6829 6830 &:focus { 6831 outline: none; 6832 } 6833 6834 &::placeholder { 6835 color: var(--wa-form-control-placeholder-color); 6836 } 6837 } 6838 6839 /* Manage spacing when tags are present */ 6840 :host([multiple]) { 6841 --_padding-with-tags: calc(var(--wa-form-control-height) * 0.1 - var(--wa-form-control-border-width)); 6842 6843 & .combobox:has(.tags wa-tag) { 6844 padding-block: var(--_padding-with-tags); 6845 padding-inline-start: var(--_padding-with-tags); 6846 } 6847 } 6848 6849 /* Visually hide the display input when multiple is enabled */ 6850 :host([multiple]) .combobox:has(.tags wa-tag) .display-input { 6851 position: absolute; 6852 z-index: -1; 6853 top: 0; 6854 left: 0; 6855 width: 100%; 6856 height: 100%; 6857 opacity: 0; 6858 } 6859 6860 .value-input { 6861 position: absolute; 6862 z-index: -1; 6863 top: 0; 6864 left: 0; 6865 width: 100%; 6866 height: 100%; 6867 opacity: 0; 6868 padding: 0; 6869 margin: 0; 6870 } 6871 6872 .tags { 6873 display: flex; 6874 flex: 1; 6875 align-items: center; 6876 flex-wrap: wrap; 6877 gap: 0.25em; 6878 6879 /* Nested inside the box, so a step down from the box's radius */ 6880 & wa-tag:not([pill]) { 6881 border-radius: var(--wa-border-radius-s); 6882 } 6883 6884 .disabled & { 6885 cursor: not-allowed !important; 6886 } 6887 } 6888 6889 /* Start and End */ 6890 6891 .start, 6892 .end { 6893 flex: 0; 6894 display: inline-flex;
6895 align-items: center; 6896 color: var(--wa-color-neutral-on-quiet); 6897 } 6898 6899 .end::slotted(*) { 6900 margin-inline-start: var(--wa-form-control-padding-inline); 6901 } 6902 6903 .start::slotted(*) { 6904 margin-inline-end: var(--wa-form-control-padding-inline); 6905 } 6906 6907 :host([multiple]) .combobox:has(.tags wa-tag) .start::slotted(*) { 6908 margin-inline-start: calc(var(--wa-form-control-padding-inline) - var(--_padding-with-tags)); 6909 } 6910 6911 /* Clear button */ 6912 [part~='clear-button'] { 6913 flex: 0 0 auto; 6914 display: inline-flex; 6915 align-self: stretch; 6916 align-items: center; 6917 justify-content: center; 6918 inline-size: 1.5em; 6919 font-size: inherit; 6920 color: var(--wa-color-neutral-on-quiet); 6921 border: none; 6922 background: none; 6923 padding: 0; 6924 transition: color var(--wa-transition-normal); 6925 cursor: pointer; 6926 /* The box is wider than the glyph, so overhang half that growth on each side. Keeps the glyph 6927 on the same trailing axis as the segmented-field pickers' clear buttons. */ 6928 margin-inline-start: calc(var(--wa-form-control-padding-inline) - 0.125em); 6929 margin-inline-end: -0.125em; 6930 6931 &:focus { 6932 outline: none; 6933 } 6934 6935 @media (hover: hover) { 6936 &:hover { 6937 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 6938 } 6939 } 6940 6941 &:active { 6942 color: color-mix(in oklab, currentColor, var(--wa-color-mix-active)); 6943 } 6944 } 6945 6946 /* Expand icon */ 6947 .expand-icon { 6948 flex: 0 0 auto; 6949 display: flex;
6950 align-items: center; 6951 color: var(--wa-color-neutral-on-quiet); 6952 transition: rotate var(--wa-transition-slow) var(--wa-transition-easing); 6953 rotate: 0deg; 6954 margin-inline-start: var(--wa-form-control-padding-inline); 6955 6956 .open & { 6957 rotate: -180deg; 6958 } 6959 } 6960 6961 /* Listbox */ 6962 .listbox { 6963 display: block; 6964 position: relative; 6965 font: inherit; 6966 box-shadow: var(--wa-shadow-m); 6967 background: var(--wa-color-surface-raised); 6968 border-color: var(--wa-color-surface-border); 6969 border-radius: var(--wa-border-radius-m); 6970 border-style: var(--wa-border-style); 6971 border-width: var(--wa-border-width-s); 6972 padding: 0.25em; 6973 overflow: auto; 6974 overscroll-behavior: none; 6975 6976 /* Make sure it adheres to the popup's auto size */ 6977 max-width: var(--auto-size-available-width); 6978 max-height: var(--auto-size-available-height); 6979 6980 &::slotted(wa-divider) { 6981 --spacing: 0.5em; 6982 } 6983 } 6984 6985 /* Space options with half the listbox's padding */ 6986 .listbox slot:not([name]) { 6987 display: flex; 6988 flex-direction: column; 6989 gap: 0.125em; 6990 } 6991 6992 slot:not([name])::slotted(small) { 6993 display: block; 6994 font-size: var(--wa-font-size-smaller); 6995 font-weight: var(--wa-font-weight-semibold); 6996 color: var(--wa-color-text-quiet); 6997 padding-block: 0.5em; 6998 padding-inline: 2.25em; 6999 } 7000`,Hp=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["blur","input"],this.cachedOptions=null,this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.selectionOrder=new Map,this.typeToSelectString="",this.slotChangePending=!1,this.displayLabel="",this.selectedOptions=[],this.name="",this._defaultValue=null,this.size="m",this.placeholder="",this.multiple=!1,this.maxOptionsVisible=3,this.disabled=!1,this.withClear=!1,this.open=!1,this.appearance="outlined",this.pill=!1,this.label="",this.placement="bottom",this.hint="",this.withLabel=!1,this.withHint=!1,this.required=!1,this.getTag=t=>K` 7001 <wa-tag 7002 part="tag" 7003 exportparts=" 7004 base:tag__base, 7005 content:tag__content, 7006 remove-button:tag__remove-button, 7007 remove-button__base:tag__remove-button__base 7008 " 7009 ?pill=${this.pill} 7010 size=${this.size} 7011 with-remove 7012 data-value=${t.value} 7013 @wa-remove=${e=>this.handleTagRemove(e,t)} 7014 > 7015 ${t.label} 7016 </wa-tag> 7017 `,this.handleDocumentFocusIn=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()},this.handleDocumentKeyDown=t=>{const e=t.target,i=null!==e.closest('[part~="clear-button"]'),o=null!==e.closest("wa-button");if(!i&&!o){if("Escape"===t.key&&this.open&&qh(this)&&(t.preventDefault(),t.stopPropagation(),this.hide(),this.displayInput.focus({preventScroll:!0})),"Enter"===t.key||" "===t.key&&""===this.typeToSelectString)return t.preventDefault(),t.stopImmediatePropagation(),this.open?void(this.currentOption&&!this.currentOption.disabled&&(this.valueHasChanged=!0,this.hasInteracted=!0,this.multiple?this.toggleOptionSelection(this.currentOption):this.setSelectedOptions(this.currentOption),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))):void this.show();if(["ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.getAllOptions(),i=e.indexOf(this.currentOption);let o=Math.max(0,i);if(t.preventDefault(),!this.open&&(this.show(),this.currentOption))return;"ArrowDown"===t.key?(o=i+1,o>e.length-1&&(o=0)):"ArrowUp"===t.key?(o=i-1,o<0&&(o=e.length-1)):"Home"===t.key?o=0:"End"===t.key&&(o=e.length-1),this.setCurrentOption(e[o])}if(1===t.key?.length||"Backspace"===t.key){const e=this.getAllOptions();if(t.metaKey||t.ctrlKey||t.altKey)return;if(!this.open){if("Backspace"===t.key)return;this.show()}t.stopPropagation(),t.preventDefault(),clearTimeout(this.typeToSelectTimeout),this.typeToSelectTimeout=window.setTimeout(()=>
7017this.typeToSelectString="",1e3),"Backspace"===t.key?this.typeToSelectString=this.typeToSelectString.slice(0,-1):this.typeToSelectString+=t.key.toLowerCase();for(const t of e){if(t.label.toLowerCase().startsWith(this.typeToSelectString)){this.setCurrentOption(t);break}}}}},this.handleDocumentMouseDown=t=>{const e=t.composedPath();this&&!e.includes(this)&&this.hide()}}static get validators(){const t=[Mh({validationElement:Object.assign(document.createElement("select"),{required:!0})})];return[...super.validators,...t]}get validationTarget(){return this.valueInput}set defaultValue(t){this._defaultValue=this.convertDefaultValue(t)}get defaultValue(){return this.convertDefaultValue(this._defaultValue)}rawValuesEqual(t,e){return null==t&&null==e||null!=t&&null!=e&&(t.length===e.length&&t.every((t,i)=>t===e[i]))}convertDefaultValue(t){return!(this.multiple||this.hasAttribute("multiple"))&&Array.isArray(t)&&(t=t[0]),t}set value(t){let e=this.value;t instanceof FormData&&(t=t.getAll(this.name)),null==t||Array.isArray(t)||(t=[t]);const i=this._value;this._value=t??null,this.rawValuesEqual(i,this._value)||(this.valueHasChanged=!0,this.requestUpdate("value",e))}get value(){let t=this._value??this.defaultValue??null;null!=t&&(t=Array.isArray(t)?t:[t]),this.optionValues=new Set(this.getAllOptions().filter(t=>!t.disabled).map(t=>t.value));let e=t;return null!=t&&(e=t.filter(t=>this.optionValues.has(t)),e=this.multiple?e:e[0],e=e??null),e}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.processSlotChange(),this.open=!1}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.cachedOptions=null}updateDefaultValue(){const t=this.getAllOptions().filter(t=>t.hasAttribute("selected")||t.defaultSelected);if(t.length>0){const e=t.map(t=>t.value);this._defaultValue=this.multiple?e:e[0]}this.hasAttribute("value")&&(this._defaultValue=this.getAttribute("value")||null)}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),Nh(this),this.getRootNode()!==document&&this.getRootNode().addEventListener("focusin",this.handleDocumentFocusIn)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),Hh(this),this.getRootNode()!==document&&this.getRootNode().removeEventListener("focusin",this.handleDocumentFocusIn)}handleFocus(){this.displayInput.setSelectionRange(0,0)}handleLabelClick(){this.displayInput.focus()}handleComboboxClick(t){t.preventDefault()}handleComboboxMouseDown(t){const e=t.composedPath().some(t=>t instanceof Element&&"wa-button"===t.tagName.toLowerCase());this.disabled||e||(t.preventDefault(),this.displayInput.focus({preventScroll:!0}),this.open=!this.open)}handleComboboxKeyDown(t){t.stopPropagation(),this.handleDocumentKeyDown(t)}handleClearClick(t){t.stopPropagation(),this.hasInteracted=!0,this.valueHasChanged=!0,null!==this.value&&(this.displayLabel="",this.selectionOrder.clear(),this.setSelectedOptions([]),this.displayInput.focus({preventScroll:!0}),this.updateComplete.then(()=>{this.dispatchEvent(new kc),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}))}handleClearMouseDown(t){t.stopPropagation(),t.preventDefault()}handleOptionClick(t){const e=t.target.closest("wa-option");e&&!e.disabled&&(this.hasInteracted=!0,this.valueHasChanged=!0,this.multiple?this.toggleOptionSelection(e):this.setSelectedOptions(e),this.updateComplete.then(()=>this.displayInput.focus({preventScroll:!0})),this.requestUpdate("value"),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.multiple||(this.hide(),this.displayInput.focus({preventScroll:!0})))}handleDefaultSlotChange(){this.slotChangePending||(this.slotChangePending=!0,queueMicrotask(()=>{this.slotChangePending=!1,this.processSlotChange()}))}processSlotChange(){if(customElements.get("wa-option")||customElements.whenDefined("wa-option").then(()=>this.handleDefaultSlotChange()),this.didSSR&&!this.hasUpdated)return void this.updateComplete.then(()=>{this.handleDefaultSlotChange()});this.cachedOptions=null;const t=this.getAllOptions();this.updateDefaultValue();let e=this.value;if(null==e||!this.valueHasChanged&&!this.hasInteracted)return void this.selectionChanged();Array.isArray(e)||(e=[e]);const i=t.filter(t=>e.includes(t.value));this.setSelectedOptions(i)}handleTagRemove(t,e){if(t.stopPropagation(),this.disabled)return;this.hasInteracted=!0,this.valueHasChanged=!0;let i=e;if(!i){const e=t.target.closest("wa-tag[data-value]");if(e){const t=e.dataset.value;i=this.selectedOptions.find(e=>e.value===t)}}i&&(this.toggleOptionSelection(i,!1),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}
7017))}getAllOptions(){return this.cachedOptions?this.cachedOptions:this?.querySelectorAll?(this.cachedOptions=[...this.querySelectorAll("wa-option")],this.cachedOptions):[]}getFirstOption(){return this.querySelector("wa-option")}setCurrentOption(t){this.getAllOptions().forEach(t=>{t.current=!1,t.tabIndex=-1}),t&&(this.currentOption=t,t.current=!0,t.tabIndex=0,t.focus({preventScroll:!0}),this.open&&!this.listbox.hidden&&Wd(t,this.listbox,"vertical","auto"))}setSelectedOptions(t){const e=this.getAllOptions(),i=Array.isArray(t)?t:[t];e.forEach(t=>{i.includes(t)||(t.selected=!1)}),i.length&&i.forEach(t=>t.selected=!0),this.selectionChanged()}toggleOptionSelection(t,e){t.selected=!0===e||!1===e?e:!t.selected,this.selectionChanged()}selectionChanged(){const t=this.getAllOptions().filter(t=>{if(!this.hasInteracted&&!this.valueHasChanged){const e=this.defaultValue,i=Array.isArray(e)?e:[e];return t.hasAttribute("selected")||t.defaultSelected||t.selected||i?.includes(t.value)}return t.selected}),e=new Set(t.map(t=>t.value));for(const t of this.selectionOrder.keys())e.has(t)||this.selectionOrder.delete(t);let i=(this.selectionOrder.size>0?Math.max(...this.selectionOrder.values()):-1)+1;for(const e of t)this.selectionOrder.has(e.value)||this.selectionOrder.set(e.value,i++);this.selectedOptions=t.sort((t,e)=>(this.selectionOrder.get(t.value)??0)-(this.selectionOrder.get(e.value)??0));let o=new Set(this.selectedOptions.map(t=>t.value));if(o.size>0||this._value){const t=this._value;if(null==this._value){let t=this.defaultValue??[];this._value=Array.isArray(t)?t:[t]}this._value=this._value?.filter(t=>!this.optionValues?.has(t))??null,this._value?.unshift(...o),this.requestUpdate("value",t)}if(this.multiple)this.placeholder&&!this.value?.length?this.displayLabel="":this.displayLabel=this.localize.term("numOptionsSelected",this.selectedOptions.length);else{const t=this.selectedOptions[0];this.displayLabel=t?.label??""}this.updateComplete.then(()=>{this.updateValidity()})}get tags(){return this.selectedOptions.map((t,e)=>{if(e<this.maxOptionsVisible||this.maxOptionsVisible<=0){const i=this.getTag(t,e);return i?"string"==typeof i?iu(i):i:null}return e===this.maxOptionsVisible?K` 7018 <wa-tag 7019 part="tag" 7020 exportparts=" 7021 base:tag__base, 7022 content:tag__content, 7023 remove-button:tag__remove-button, 7024 remove-button__base:tag__remove-button__base 7025 " 7026 ?pill=${this.pill} 7027 size=${this.size} 7028 >+${this.selectedOptions.length-e}</wa-tag 7029 > 7030 `:null})}updated(t){super.updated(t),(t.has("value")||t.has("displayLabel"))&&this.customStates.set("blank",!this.value&&!this.displayLabel)}handleDisabledChange(){this.disabled&&this.open&&(this.open=!1)}handleValueChange(){const t=this.getAllOptions(),e=Array.isArray(this.value)?this.value:[this.value],i=t.filter(t=>e.includes(t.value));this.setSelectedOptions(i),this.updateValidity()}async handleOpenChange(){if(this.open&&!this.disabled){this.setCurrentOption(this.selectedOptions[0]||this.getFirstOption());const t=new Gd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);this.addOpenListeners(),this.listbox.hidden=!1,this.popup.active=!0,requestAnimationFrame(()=>{this.setCurrentOption(this.currentOption)}),await qt(this.popup.popup,"show"),this.currentOption&&Wd(this.currentOption,this.listbox,"vertical","auto"),this.dispatchEvent(new Zd)}else{const t=new Qd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);this.removeOpenListeners(),await qt(this.popup.popup,"hide"),this.listbox.hidden=!0,this.popup.active=!1,this.dispatchEvent(new Jd)}}async show(){if(!this.open&&!this.disabled)return this.open=!0,Nt(this,"wa-after-show");this.open=!1}async hide(){if(this.open&&!this.disabled)return this.open=!1,Nt(this,"wa-after-hide");this.open=!1}focus(t){this.displayInput.focus(t)}blur(){this.displayInput.blur()}formResetCallback(){this.selectionOrder.clear(),this.value=this.defaultValue,super.formResetCallback(),this.handleValueChange(),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e,a=!!this.hasUpdated&&this.withClear&&!this.disabled&&(this.displayLabel||this.value&&this.value.length>0);return K` 7031 <div 7032 part="form-control" 7033 class=${ce({"form-control":!0,"form-control-has-label":i})} 7034 > 7035 <label 7036 id="label" 7037 part="form-control-label label" 7038 class=${ce({label:!0,"has-label":i})} 7039 aria-hidden=${i?"false":"true"} 7040 @click=${this.handleLabelClick} 7041 > 7042 <slot name="label">${this.label}</slot> 7043 </label> 7044 7045 <div part="form-control-input" class="form-control-input"> 7046 <wa-popup 7047 class=${ce({select:!0,open:this.open,disabled:this.disabled,enabled:!this.disabled,multiple:this.multiple})} 7048 placement=${this.placement} 7049 flip 7050 shift 7051 sync="width" 7052 auto-size="vertical" 7053 auto-size-padding="10" 7054 > 7055 <div 7056 part="combobox" 7057 class="combobox" 7058 slot="anchor" 7059 @keydown=${this.handleComboboxKeyDown} 7060 @mousedown=${this.handleComboboxMouseDown} 7061 @click=${this.handleComboboxClick} 7062 > 7063 <slot part="start" name="start" class="start"></slot> 7064 7065 <input 7066 part="display-input" 7067 class="display-input" 7068 type="text" 7069 placeholder=${this.placeholder} 7070 .disabled=${this.disabled} 7071 .value=${this.displayLabel} 7072 ?required=${this.required} 7073 autocomplete="off" 7074 spellcheck="false" 7075 autocapitalize="off" 7076 readonly 7077 aria-invalid=${!this.validity.valid} 7078 aria-controls="listbox" 7079 aria-expanded=${this.open?"true":"false"} 7080 aria-haspopup="listbox" 7081 aria-labelledby="label" 7082 aria-disabled=${this.disabled?"true":"false"} 7083 aria-describedby="hint" 7084 role="combobox" 7085 tabindex="0" 7086 @focus=${this.handleFocus} 7087 /> 7088 7089 <!-- Tags need to wait for first hydration before populating otherwise it will create a hydration mismatch. --> 7090 ${this.multiple&&this.hasUpdated?K`<div part="tags" class="tags" @wa-remove=${this.handleTagRemove}>${this.tags}</div>`:""} 7091 7092 <input 7093 class="value-input" 7094 type="text" 7095 ?disabled=${this.disabled} 7096 ?required=${this.required} 7097 .value=${Array.isArray(this.value)?this.value.join(", "):this.value} 7098 tabindex="-1" 7099 aria-hidden="true" 7100 @focus=${()=>this.focus()} 7101 /> 7102 7103 ${a?K` 7104 <button 7105 part="clear-button" 7106 type="button" 7107 aria-label=${this.localize.term("clearEntry")} 7108 @mousedown=${this.handleClearMouseDown} 7109 @click=${this.handleClearClick} 7110 tabindex="-1" 7111 > 7112 <slot name="clear-icon"> 7113 <wa-icon name="circle-xmark" library="system" variant="regular"></wa-icon> 7114 </slot> 7115 </button> 7116 `:""} 7117 7118 <slot name="end" part="end" class="end"></slot> 7119 7120 <slot name="expand-icon" part="expand-icon" class="expand-icon"> 7121 <wa-icon library="system" name="chevron-down" variant="solid"></wa-icon> 7122 </slot> 7123 </div> 7124 7125 <div 7126 id="listbox" 7127 role="listbox" 7128 aria-expanded=${this.open?"true":"false"} 7129 aria-multiselectable=${this.multiple?"true":"false"} 7130 aria-labelledby="label" 7131 part="listbox" 7132 class="listbox" 7133 tabindex="-1" 7134 @mouseup=${this.handleOptionClick} 7135 > 7136 <slot @slotchange=${this.handleDefaultSlotChange}></slot> 7137 </div> 7138 </wa-popup> 7139 </div> 7140 7141 <slot 7142 id="hint" 7143 name="hint" 7144 part="hint" 7145 class=${ce({"has-slotted":o})} 7146 aria-hidden=${o?"false":"true"} 7147 >${this.hint}</slot 7148 > 7149 </div> 7150 `}};Hp.css=[Np,zh,Ue],kt([Dt(".select")],Hp.prototype,"popup",2),kt([Dt(".combobox")],Hp.prototype,"combobox",2),kt([Dt(".display-input")],Hp.prototype,"displayInput",2),kt([Dt(".value-input")],Hp.prototype,"valueInput",2),kt([Dt(".listbox")],Hp.prototype,"listbox",2),kt([$t()],Hp.prototype,"displayLabel",2),kt([$t()],Hp.prototype,"currentOption",2),kt([$t()],Hp.prototype,"selectedOptions",2),kt([At({reflect:!0})],Hp.prototype,"name",2),kt([At({attribute:!1})],Hp.prototype,"defaultValue",1),kt([At({attribute:"value",reflect:!1})],Hp.prototype,"value",1),kt([At({reflect:!0})],Hp.prototype,"size",2),kt([vt("size")],Hp.prototype,"handleSizeChange",1),kt([At()],Hp.prototype,"placeholder",2),kt([At({type:Boolean,reflect:!0})],Hp.prototype,"multiple",2),kt([At({attribute:"max-options-visible",type:Number})],Hp.prototype,"maxOptionsVisible",2),kt([At({type:Boolean})],Hp.prototype,"disabled",2),kt([At({attribute:"with-clear",type:Boolean})],Hp.prototype,"withClear",2),kt([At({type:Boolean,reflect:!0})],Hp.prototype,"open",2),kt([At({reflect:!0})],Hp.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],Hp.prototype,"pill",2),kt([At()],Hp.prototype,"label",2),kt([At({reflect:!0})],Hp.prototype,"placement",2),kt([At({attribute:"hint"})],Hp.prototype,"hint",2),kt([At({attribute:"with-label",type:Boolean})],Hp.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],Hp.prototype,"withHint",2),kt([At({type:Boolean,reflect:!0})],Hp.prototype,"required",2),kt([At({attribute:!1})],Hp.prototype,"getTag",2),kt([vt("disabled",{waitUntilFirstUpdate:!0})],Hp.prototype,"handleDisabledChange",1),kt([vt("value",{waitUntilFirstUpdate:!0})],Hp.prototype,"handleValueChange",1),kt([vt("open",{waitUntilFirstUpdate:!0}
7150)],Hp.prototype,"handleOpenChange",1),Hp=kt([St("wa-select")],Hp),Hp.disableWarning?.("change-in-update");var qp=h` 7151 :host { 7152 --track-size: 0.5em; 7153 --thumb-width: 1.4em; 7154 --thumb-height: 1.4em; 7155 --marker-width: 0.1875em; 7156 --marker-height: 0.1875em; 7157 } 7158 7159 :host([orientation='vertical']) { 7160 width: auto; 7161 } 7162 7163 #label:has(~ .vertical) { 7164 display: block; 7165 order: 2; 7166 max-width: none; 7167 text-align: center; 7168 } 7169 7170 #description:has(~ .vertical) { 7171 order: 3; 7172 text-align: center; 7173 } 7174 7175 /* Add extra space between slider and label, when present */ 7176 #label.has-label ~ #slider { 7177 &.horizontal { 7178 margin-block-start: 0.5em; 7179 } 7180 &.vertical { 7181 margin-block-end: 0.5em; 7182 } 7183 } 7184 7185 #slider { 7186 touch-action: none; 7187 7188 &:focus { 7189 outline: none; 7190 } 7191 7192 &:focus-visible:not(.disabled) #thumb, 7193 &:focus-visible:not(.disabled) #thumb-min, 7194 &:focus-visible:not(.disabled) #thumb-max { 7195 outline: var(--wa-focus-ring); 7196 /* intentionally no offset due to border */ 7197 } 7198 } 7199 7200 #track { 7201 position: relative; 7202 border-radius: 9999px; 7203 background: var(--wa-color-neutral-fill-normal); 7204 isolation: isolate; 7205 } 7206 7207 /* Orientation */ 7208 .horizontal #track { 7209 height: var(--track-size); 7210 } 7211 7212 .vertical #track { 7213 order: 1; 7214 width: var(--track-size); 7215 height: 200px; 7216 } 7217 7218 /* Disabled */ 7219 .disabled #track { 7220 cursor: not-allowed; 7221 opacity: 0.5; 7222 } 7223 7224 /* Indicator */ 7225 #indicator { 7226 position: absolute; 7227 border-radius: inherit; 7228 background-color: var(--wa-form-control-activated-color); 7229 7230 &:dir(ltr) { 7231 right: calc(100% - max(var(--start), var(--end))); 7232 left: min(var(--start), var(--end)); 7233 } 7234 7235 &:dir(rtl) { 7236 right: min(var(--start), var(--end)); 7237 left: calc(100% - max(var(--start), var(--end))); 7238 } 7239 } 7240 7241 .horizontal #indicator { 7242 top: 0; 7243 height: 100%; 7244 } 7245 7246 .vertical #indicator { 7247 top: calc(100% - var(--end)); 7248 bottom: var(--start); 7249 left: 0; 7250 width: 100%; 7251 } 7252 7253 /* Thumbs */ 7254 #thumb, 7255 #thumb-min, 7256 #thumb-max { 7257 z-index: 3; 7258 position: absolute; 7259 width: var(--thumb-width); 7260 height: var(--thumb-height); 7261 border: solid 0.125em var(--wa-color-surface-default); 7262 border-radius: 50%; 7263 background-color: var(--wa-form-control-activated-color); 7264 cursor: pointer; 7265 } 7266 7267 .disabled #thumb, 7268 .disabled #thumb-min, 7269 .disabled #thumb-max { 7270 cursor: inherit; 7271 } 7272 7273 .horizontal #thumb, 7274 .horizontal #thumb-min, 7275 .horizontal #thumb-max { 7276 top: calc(50% - var(--thumb-height) / 2); 7277 7278 &:dir(ltr) { 7279 right: auto; 7280 left: calc(var(--position) - var(--thumb-width) / 2); 7281 } 7282 7283 &:dir(rtl) { 7284 right: calc(var(--position) - var(--thumb-width) / 2); 7285 left: auto; 7286 } 7287 } 7288 7289 .vertical #thumb, 7290 .vertical #thumb-min, 7291 .vertical #thumb-max { 7292 bottom: calc(var(--position) - var(--thumb-height) / 2); 7293 left: calc(50% - var(--thumb-width) / 2); 7294 } 7295 7296 /* Range-specific thumb styles */ 7297 :host([range]) { 7298 #thumb-min:focus-visible, 7299 #thumb-max:focus-visible { 7300 z-index: 4; /* Ensure focused thumb appears on top */ 7301 outline: var(--wa-focus-ring); 7302 /* intentionally no offset due to border */ 7303 } 7304 } 7305 7306 /* Markers */ 7307 #markers { 7308 pointer-events: none; 7309 } 7310 7311 .marker { 7312 z-index: 2; 7313 position: absolute; 7314 width: var(--marker-width); 7315 height: var(--marker-height); 7316 border-radius: 50%; 7317 background-color: var(--wa-color-surface-default); 7318 } 7319 7320 .marker:first-of-type, 7321 .marker:last-of-type { 7322 display: none; 7323 } 7324 7325 .horizontal .marker { 7326 top: calc(50% - var(--marker-height) / 2); 7327 left: calc(var(--position) - var(--marker-width) / 2); 7328 } 7329 7330 .vertical .marker { 7331 top: calc(var(--position) - var(--marker-height) / 2); 7332 left: calc(50% - var(--marker-width) / 2); 7333 } 7334 7335 /* Marker labels */ 7336 #references { 7337 position: relative; 7338 7339 slot { 7340 display: flex; 7341 justify-content: space-between; 7342 height: 100%; 7343 } 7344 7345 ::slotted(*) { 7346 color: var(--wa-color-text-quiet); 7347 font-size: 0.875em; 7348 line-height: 1; 7349 } 7350 } 7351 7352 .horizontal { 7353 #references { 7354 margin-block-start: 0.5em; 7355 } 7356 } 7357 7358 .vertical { 7359 display: flex; 7360 margin-inline: auto; 7361 7362 #track { 7363 order: 1; 7364 } 7365 7366 #references { 7367 order: 2; 7368 width: min-content; 7369 margin-inline-start: 0.75em; 7370 7371 slot { 7372 flex-direction: column; 7373 } 7374 } 7375 } 7376 7377 .vertical #references slot { 7378 flex-direction: column; 7379 } 7380`;function Up(t,e,i){const o=(t-e)/i;return Math.abs(o-Math.round(o))>1e-9}var Wp=class extends Re{constructor(){super(...arguments),this.draggableThumbMin=null,this.draggableThumbMax=null,this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.activeThumb=null,this.lastTrackPosition=null,this.label="",this.hint="",this.minValue=0,this.maxValue=50,this.defaultValue=null==this.getAttribute("value")?this.minValue:Number(this.getAttribute("value")),this._value=null,this.range=!1,this.disabled=!1,this.readonly=!1,this.orientation="horizontal",this.size="m",this.min=0,this.max=100,this.step=1,this.tooltipDistance=8,this.tooltipPlacement="top",this.withMarkers=!1,this.withTooltip=!1,this.withLabel=!1,this.withHint=!1}static get validators(){return[...super.validators,{observedAttributes:["min","max","step"],checkValidity(t){const e={message:"",isValid:!0,invalidKeys:[]},i=(t,e,i,o)=>
7380{if("undefined"==typeof document)return"";const a=document.createElement("input");return a.type="range",a.min=String(e),a.max=String(i),a.step=String(o),a.value=String(t),a.checkValidity(),a.validationMessage};if(t.isRange){const o=t.minValue,a=t.maxValue;if(o<t.min)return e.isValid=!1,e.invalidKeys.push("rangeUnderflow"),e.message=i(o,t.min,t.max,t.step)||`Value must be greater than or equal to ${t.min}.`,e;if(a>t.max)return e.isValid=!1,e.invalidKeys.push("rangeOverflow"),e.message=i(a,t.min,t.max,t.step)||`Value must be less than or equal to ${t.max}.`,e;if(t.step&&1!==t.step){const s=Up(o,t.min,t.step),n=Up(a,t.min,t.step);if(s||n){e.isValid=!1,e.invalidKeys.push("stepMismatch");const n=s?o:a;return e.message=i(n,t.min,t.max,t.step)||`Value must be a multiple of ${t.step}.`,e}}}else{const o=t.value;if(o<t.min)return e.isValid=!1,e.invalidKeys.push("rangeUnderflow"),e.message=i(o,t.min,t.max,t.step)||`Value must be greater than or equal to ${t.min}.`,e;if(o>t.max)return e.isValid=!1,e.invalidKeys.push("rangeOverflow"),e.message=i(o,t.min,t.max,t.step)||`Value must be less than or equal to ${t.max}.`,e;if(t.step&&1!==t.step&&Up(o,t.min,t.step))return e.isValid=!1,e.invalidKeys.push("stepMismatch"),e.message=i(o,t.min,t.max,t.step)||`Value must be a multiple of ${t.step}.`,e}return e}}]}get focusableAnchor(){return this.isRange&&this.thumbMin||this.slider}get validationTarget(){return this.focusableAnchor}get value(){if(this.valueHasChanged){return Uh(this._value??this.minValue??0,this.min,this.max)}return Uh(this._value??this.defaultValue,this.min,this.max)}set value(t){t=Number(t)??this.minValue,this._value!==t&&(this.valueHasChanged=!0,this._value=t)}get isRange(){return this.range}handleSizeChange(){He(this.localName,this.size)}firstUpdated(t){super.firstUpdated(t),this.isRange?(this.draggableThumbMin=new Ih(this.thumbMin,{start:()=>{this.activeThumb="min",this.trackBoundingClientRect=this.track.getBoundingClientRect(),this.valueWhenDraggingStarted=this.minValue,this.customStates.set("dragging",!0),this.showRangeTooltips()},move:(t,e)=>{this.setThumbValueFromCoordinates(t,e,"min")},stop:()=>{this.minValue!==this.valueWhenDraggingStarted&&(this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hasInteracted=!0),this.hideRangeTooltips(),this.customStates.set("dragging",!1),this.valueWhenDraggingStarted=void 0,this.activeThumb=null}}),this.draggableThumbMax=new Ih(this.thumbMax,{start:()=>{this.activeThumb="max",this.trackBoundingClientRect=this.track.getBoundingClientRect(),this.valueWhenDraggingStarted=this.maxValue,this.customStates.set("dragging",!0),this.showRangeTooltips()},move:(t,e)=>{this.setThumbValueFromCoordinates(t,e,"max")},stop:()=>{this.maxValue!==this.valueWhenDraggingStarted&&(this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hasInteracted=!0),this.hideRangeTooltips(),this.customStates.set("dragging",!1),this.valueWhenDraggingStarted=void 0,this.activeThumb=null}}),this.draggableTrack=new Ih(this.track,{start:(t,e)=>{if(this.trackBoundingClientRect=this.track.getBoundingClientRect(),this.activeThumb)this.valueWhenDraggingStarted="min"===this.activeThumb?this.minValue:this.maxValue;else{const i=this.getValueFromCoordinates(t,e),o=Math.abs(i-this.minValue),a=Math.abs(i-this.maxValue);if(o===a)if(i>this.maxValue)this.activeThumb="max";else if(i<this.minValue)this.activeThumb="min";else{const i="rtl"===this.localize.dir(),o="vertical"===this.orientation,a=o?e:t,s=this.lastTrackPosition||a;this.lastTrackPosition=a;const n=a>s!==i&&!o||a<s&&o;this.activeThumb=n?"max":"min"}else this.activeThumb=o<=a?"min":"max";this.valueWhenDraggingStarted="min"===this.activeThumb?this.minValue:this.maxValue}this.customStates.set("dragging",!0),this.setThumbValueFromCoordinates(t,e,this.activeThumb),this.showRangeTooltips()},move:(t,e)=>{this.activeThumb&&this.setThumbValueFromCoordinates(t,e,this.activeThumb)},stop:()=>{if(this.activeThumb){("min"===this.activeThumb?this.minValue:this.maxValue)!==this.valueWhenDraggingStarted&&(this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hasInteracted=!0)}this.hideRangeTooltips(),this.customStates.set("dragging",!1),this.valueWhenDraggingStarted=void 0,this.activeThumb=null}})):this.draggableTrack=new Ih(this.slider,{start:(t,e)=>{this.trackBoundingClientRect=this.track.getBoundingClientRect(),this.valueWhenDraggingStarted=this.value,this.customStates.set("dragging",!0),this.setValueFromCoordinates(t,e),this.showTooltip()},move:(t,e)=>{this.setValueFromCoordinates(t,e)},stop:()=>{this.value!==this.valueWhenDraggingStarted&&(this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hasInteracted=!0),this.hideTooltip(),this.customStates.set("dragging",!1),this.valueWhenDraggingStarted=void 0}})}willUpdate(t){this.isRange&&(t.has("minValue")||t.has("maxValue")||t.has("min")||t.has("max"))&&(this.minValue=Uh(this.minValue,this.min,this.maxValue),this.maxValue=Uh(this.maxValue,this.minValue,this.max)),super.willUpdate(t)}updated(t){if(this.isRange&&(t.has("minValue")||t.has("maxValue"))&&this.updateFormValue(),t.has("disabled")||t.has("readonly")){const t=!(this.disabled||this.readonly);this.isRange&&(this.draggableThumbMin&&this.draggableThumbMin.toggle(t),this.draggableThumbMax&&this.draggableThumbMax.toggle(t)),this.draggableTrack&&this.draggableTrack.toggle(t)}super.updated(t)}formDisabledCallback(t){this.disabled=t}formResetCallback(){this.isRange?(this.minValue=parseFloat(this.getAttribute("min-value")??String(this.min)),this.maxValue=parseFloat(this.getAttribute("max-value")??String(this.max))):(this._value=null,this.defaultValue=this.defaultValue??parseFloat(this.getAttribute("value")??String(this.min))),this.valueHasChanged=!1,this.hasInteracted=!1,super.formResetCallback()}clampAndRoundToStep(t){const e=(String(this.step).split(".")[1]||"").replace(/0+$/g,"").length,i=Number(this.step),o=Number(this.min),a=Number(this.max);return t=Uh(t=Math.round(t/i)*i,o,a),parseFloat(t.toFixed(e))}getPercentageFromValue(t){return(t-this.min)/(this.max-this.min)*100}getValueFromCoordinates(t,e){const i="rtl"===this.localize.dir(),o="vertical"===this.orientation,{top:a,right:s,bottom:n,left:r,height:l,width:h}=this.trackBoundingClientRect,c=o?e:t,d=o?{start:a,end:n,size:l}:{start:r,end:s,size:h},u=(o||i?d.end-c:c-d.start)/d.size;return this.clampAndRoundToStep(this.min+(this.max-this.min)*u)}handleBlur(){this.isRange?requestAnimationFrame(()=>{const t=this.shadowRoot?.activeElement;t===this.thumbMin||t===this.thumbMax||this.hideRangeTooltips()}):this.hideTooltip(),this.customStates.set("focused",!1),this.dispatchEvent(new FocusEvent("blur",{bubbles:!0,composed:!0}))}handleFocus(t){const e=t.target;this.isRange?(e===this.thumbMin?this.activeThumb="min":e===this.thumbMax&&(this.activeThumb="max"),this.showRangeTooltips()):this.showTooltip(),this.customStates.set("focused",!0),this.dispatchEvent(new FocusEvent("focus",{bubbles:!0,composed:!0}))}handleKeyDown(t){const e="rtl"===this.localize.dir(),i=t.target;if(this.disabled||this.readonly)return;if(this.isRange&&(i===this.thumbMin?this.activeThumb="min":i===this.thumbMax&&(this.activeThumb="max"),!this.activeThumb))return;const o=this.isRange?"min"===this.activeThumb?this.minValue:this.maxValue:this.value;let a=o;switch(t.key){case"ArrowUp":case e?"ArrowLeft":"ArrowRight":t.preventDefault(),a=this.clampAndRoundToStep(o+this.step);break;case"ArrowDown":case e?"ArrowRight":"ArrowLeft":t.preventDefault(),a=this.clampAndRoundToStep(o-this.step);break;case"Home":t.preventDefault(),a=this.isRange&&"min"===this.activeThumb?this.min:this.isRange?this.minValue:this.min;break;case"End":t.preventDefault(),a=this.isRange&&"max"===this.activeThumb?this.max:this.isRange?this.maxValue:this.max;break;case"PageUp":t.preventDefault();const i=Math.max(o+(this.max-this.min)/10,o+this.step);a=this.clampAndRoundToStep(i);break;case"PageDown":t.preventDefault();const s=Math.min(o-(this.max-this.min)/10,o-this.step);a=this.clampAndRoundToStep(s);break;case"Enter":return void bc(t,this)}a!==o&&(this.isRange?("min"===this.activeThumb?a>this.maxValue?(this.maxValue=a,this.minValue=a):this.minValue=Math.max(this.min,a):a<this.minValue?(this.minValue=a,this.maxValue=a):this.maxValue=Math.min(this.max,a),this.updateFormValue()):this.value=Uh(a,this.min,this.max),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}),this.hasInteracted=!0)}handleLabelPointerDown(t){t.preventDefault(),this.disabled||(this.isRange?this.thumbMin?.focus():this.slider.focu
7380s())}setValueFromCoordinates(t,e){const i=this.value;this.value=this.getValueFromCoordinates(t,e),this.value!==i&&this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})}setThumbValueFromCoordinates(t,e,i){const o=this.getValueFromCoordinates(t,e),a="min"===i?this.minValue:this.maxValue;"min"===i?o>this.maxValue?(this.maxValue=o,this.minValue=o):this.minValue=Math.max(this.min,o):o<this.minValue?(this.minValue=o,this.maxValue=o):this.maxValue=Math.min(this.max,o),a!==("min"===i?this.minValue:this.maxValue)&&(this.updateFormValue(),this.updateComplete.then(()=>{this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}showTooltip(){this.withTooltip&&this.tooltip&&(this.tooltip.open=!0)}hideTooltip(){this.withTooltip&&this.tooltip&&(this.tooltip.open=!1)}showRangeTooltips(){if(!this.withTooltip)return;const t=this.shadowRoot?.getElementById("tooltip-thumb-min"),e=this.shadowRoot?.getElementById("tooltip-thumb-max");"min"===this.activeThumb?(t&&(t.open=!0),e&&(e.open=!1)):"max"===this.activeThumb&&(e&&(e.open=!0),t&&(t.open=!1))}hideRangeTooltips(){if(!this.withTooltip)return;const t=this.shadowRoot?.getElementById("tooltip-thumb-min"),e=this.shadowRoot?.getElementById("tooltip-thumb-max");t&&(t.open=!1),e&&(e.open=!1)}updateFormValue(t){if(this.isRange){const t=new FormData;return t.append(this.name||"",String(this.minValue)),t.append(this.name||"",String(this.maxValue)),void this.setValue(t,t)}super.updateFormValue(t)}focus(){this.isRange?this.thumbMin?.focus():this.slider.focus()}blur(){if(this.isRange)for(const t of bp()){if(t===this.thumbMin){this.thumbMin.blur();break}if(t===this.thumbMax){this.thumbMax.blur();break}}else this.slider.blur()}stepDown(){if(this.isRange){const t=this.clampAndRoundToStep(this.minValue-this.step);this.minValue=Uh(t,this.min,this.maxValue),this.updateFormValue()}else{const t=this.clampAndRoundToStep(this.value-this.step);this.value=t}}stepUp(){if(this.isRange){const t=this.clampAndRoundToStep(this.maxValue+this.step);this.maxValue=Uh(t,this.minValue,this.max),this.updateFormValue()}else{const t=this.clampAndRoundToStep(this.value+this.step);this.value=t}}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e,a=this.hasSlotController.test("reference"),s=ce({xs:"xs"===this.size,s:"s"===this.size||"small"===this.size,m:"m"===this.size||"medium"===this.size,l:"l"===this.size||"large"===this.size,xl:"xl"===this.size,small:"small"===this.size||"s"===this.size,medium:"medium"===this.size||"m"===this.size,large:"large"===this.size||"l"===this.size,horizontal:"horizontal"===this.orientation,vertical:"vertical"===this.orientation,disabled:this.disabled}),n=[];if(this.withMarkers)for(let t=this.min;t<=this.max;t+=this.step)n.push(this.getPercentageFromValue(t));const r=K` 7381 <label 7382 id="label" 7383 part="label" 7384 for=${this.isRange?"thumb-min":"text-box"} 7385 class=${ce({vh:!i,"has-label":i})} 7386 @pointerdown=${this.handleLabelPointerDown} 7387 > 7388 <slot name="label">${this.label}</slot> 7389 </label> 7390 `,l=K` 7391 <div 7392 id="hint" 7393 part="hint" 7394 class=${ce({"has-slotted":o})} 7395 > 7396 <slot name="hint">${this.hint}</slot> 7397 </div> 7398 `,h=this.withMarkers?K` 7399 <div id="markers" part="markers"> 7400 ${n.map(t=>K`<span part="marker" class="marker" style=${fc({"--position":`${t}%`})}></span>`)} 7401 </div> 7402 `:"",c=a?K` 7403 <div id="references" part="references" aria-hidden="true"> 7404 <slot name="reference"></slot> 7405 </div> 7406 `:"",d=(t,e)=>this.withTooltip?K` 7407 <wa-tooltip 7408 id=${"tooltip"+("thumb"!==t?"-"+t:"")} 7409 part="tooltip" 7410 exportparts=" 7411 base:tooltip__base, 7412 tooltip:tooltip__tooltip, 7413 body:tooltip__body, 7414 arrow:tooltip__arrow 7415 " 7416 trigger="manual" 7417 distance=${this.tooltipDistance} 7418 placement=${this.tooltipPlacement} 7419 for=${t} 7420 activation="manual" 7421 dir=${this.localize.dir()} 7422 >
7423 <span aria-hidden="true"> 7424 ${"function"==typeof this.valueFormatter?this.valueFormatter(e):this.localize.number(e)} 7425 </span> 7426 </wa-tooltip> 7427 `:"";if(this.isRange){const t=Uh(this.getPercentageFromValue(this.minValue),0,100),e=Uh(this.getPercentageFromValue(this.maxValue),0,100);return K` 7428 ${r} 7429 7430 <div id="slider" part="slider" class=${s}> 7431 <div id="track" part="track"> 7432 <div 7433 id="indicator" 7434 part="indicator" 7435 style=${fc({"--start":`${Math.min(t,e)}%`,"--end":`${Math.max(t,e)}%`})} 7436 ></div> 7437 7438 ${h} 7439 7440 <span 7441 id="thumb-min" 7442 part="thumb thumb-min" 7443 style=${fc({"--position":`${t}%`})} 7444 role="slider" 7445 aria-valuemin=${this.min} 7446 aria-valuenow=${this.minValue} 7447 aria-valuetext=${"function"==typeof this.valueFormatter?this.valueFormatter(this.minValue):this.localize.number(this.minValue)} 7448 aria-valuemax=${this.max} 7449 aria-label="${this.label?`${this.label} (minimum value)`:"Minimum value"}" 7450 aria-orientation=${this.orientation} 7451 aria-disabled=${this.disabled?"true":"false"} 7452 aria-readonly=${this.readonly?"true":"false"} 7453 tabindex=${this.disabled?-1:0} 7454 @blur=${this.handleBlur} 7455 @focus=${this.handleFocus} 7456 @keydown=${this.handleKeyDown} 7457 ></span> 7458 7459 <span 7460 id="thumb-max" 7461 part="thumb thumb-max" 7462 style=${fc({"--position":`${e}%`})} 7463 role="slider" 7464 aria-valuemin=${this.min} 7465 aria-valuenow=${this.maxValue} 7466 aria-valuetext=${"function"==typeof this.valueFormatter?this.valueFormatter(this.maxValue):this.localize.number(this.maxValue)} 7467 aria-valuemax=${this.max} 7468 aria-label="${this.label?`${this.label} (maximum value)`:"Maximum value"}" 7469 aria-orientation=${this.orientation} 7470 aria-disabled=${this.disabled?"true":"false"} 7471 aria-readonly=${this.readonly?"true":"false"} 7472 tabindex=${this.disabled?-1:0} 7473 @blur=${this.handleBlur} 7474 @focus=${this.handleFocus} 7475 @keydown=${this.handleKeyDown} 7476 ></span> 7477 </div> 7478 7479 ${c} ${l} 7480 </div> 7481 7482 ${d("thumb-min",this.minValue)} ${d("thumb-max",this.maxValue)} 7483 `}{const t=Uh(this.getPercentageFromValue(this.value),0,100),e=Uh(this.getPercentageFromValue("number"==typeof this.indicatorOffset?this.indicatorOffset:this.min),0,100);return K` 7484 ${r} 7485 7486 <div 7487 id="slider" 7488 part="slider" 7489 class=${s} 7490 role="slider" 7491 aria-disabled=${this.disabled?"true":"false"} 7492 aria-readonly=${this.disabled?"true":"false"} 7493 aria-orientation=${this.orientation} 7494 aria-valuemin=${this.min} 7495 aria-valuenow=${this.value} 7496 aria-valuetext=${"function"==typeof this.valueFormatter?this.valueFormatter(this.value):this.localize.number(this.value)} 7497 aria-valuemax=${this.max} 7498 aria-labelledby="label" 7499 aria-describedby="hint" 7500 tabindex=${this.disabled?-1:0} 7501 @blur=${this.handleBlur} 7502 @focus=${this.handleFocus} 7503 @keydown=${this.handleKeyDown} 7504 > 7505 <div id="track" part="track"> 7506 <div 7507 id="indicator" 7508 part="indicator" 7509 style=${fc({"--start":`${e}%`,"--end":`${t}%`})} 7510 ></div> 7511 7512 ${h} 7513 <span id="thumb" part="thumb" style=${fc({"--position":`${t}%`})}></span> 7514 </div> 7515 7516 ${c} ${l} 7517 </div> 7518 7519 ${d("thumb",this.value)} 7520 `}}};Wp.formAssociated=!0,Wp.observeSlots=!0,Wp.css=[Ue,zh,qp],kt([Dt("#slider")],Wp.prototype,"slider",2),kt([Dt("#thumb")],Wp.prototype,"thumb",2),kt([Dt("#thumb-min")],Wp.prototype,"thumbMin",2),kt([Dt("#thumb-max")],Wp.prototype,"thumbMax",2),kt([Dt("#track")],Wp.prototype,"track",2),kt([Dt("#tooltip")],Wp.prototype,"tooltip",2),kt([At()],Wp.prototype,"label",2),kt([At({attribute:"hint"})],Wp.prototype,"hint",2),kt([At({reflect:!0})],Wp.prototype,"name",2),kt([At({type:Number,attribute:"min-value"})],Wp.prototype,"minValue",2),kt([At({type:Number,attribute:"max-value"})],Wp.prototype,"maxValue",2),kt([At({attribute:"value",reflect:!0,type:Number})],Wp.prototype,"defaultValue",2),kt([$t()],Wp.prototype,"value",1),kt([At({type:Boolean,reflect:!0})],Wp.prototype,"range",2),kt([At({type:Boolean})],Wp.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],Wp.prototype,"readonly",2),kt([At({reflect:!0})],Wp.prototype,"orientation",2),kt([At({reflect:!0})],Wp.prototype,"size",2),kt([vt("size")],Wp.prototype,"handleSizeChange",1),kt([At({attribute:"indicator-offset",type:Number})],Wp.prototype,"indicatorOffset",2),kt([At({type:Number})],Wp.prototype,"min",2),kt([At({type:Number})],Wp.prototype,"max",2),kt([At({type:Number})],Wp.prototype,"step",2),kt([At({type:Boolean})],Wp.prototype,"autofocus",2),kt([At({attribute:"tooltip-distance",type:Number})],Wp.prototype,"tooltipDistance",2),kt([At({attribute:"tooltip-placement",reflect:!0})],Wp.prototype,"tooltipPlacement",2),kt([At({attribute:"with-markers",type:Boolean})],Wp.prototype,"withMarkers",2),kt([At({attribute:"with-tooltip",type:Boolean})],Wp.prototype,"withTooltip",2),kt([At({attribute:"with-label",type:Boolean})],Wp.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],Wp.prototype,"withHint",2),kt([At({attribute:!1})],Wp.prototype,"valueFormatter",2),Wp=kt([St("wa-slider")],Wp);var jp=h` 7521 :host { 7522 --height: var(--wa-form-control-toggle-size);
7523 --width: calc(var(--height) * 1.75); 7524 --thumb-size: 0.75em; 7525 7526 display: inline-flex; 7527 line-height: var(--wa-form-control-value-line-height); 7528 } 7529 7530 label { 7531 position: relative; 7532 display: flex; 7533 align-items: center; 7534 font: inherit; 7535 color: var(--wa-form-control-value-color); 7536 vertical-align: middle; 7537 cursor: pointer; 7538 } 7539 7540 .switch { 7541 flex: 0 0 auto; 7542 position: relative; 7543 display: flex; 7544 align-items: center; 7545 justify-content: center; 7546 width: var(--width); 7547 height: var(--height); 7548 background-color: var(--wa-form-control-background-color); 7549 border-color: var(--wa-form-control-border-color); 7550 border-radius: var(--height); 7551 border-style: var(--wa-form-control-border-style); 7552 border-width: var(--wa-form-control-border-width); 7553 transition-property: translate, background, border-color, box-shadow; 7554 transition-duration: var(--wa-transition-normal); 7555 transition-timing-function: var(--wa-transition-easing); 7556 } 7557 7558 :host([did-ssr]:not(:defined)) .switch { 7559 transition-property: unset; 7560 transition-duration: unset; 7561 transition-timing-function: unset; 7562 } 7563 7564 .switch .thumb { 7565 aspect-ratio: 1 / 1; 7566 width: var(--thumb-size); 7567 height: var(--thumb-size); 7568 background-color: var(--wa-form-control-border-color); 7569 border-radius: 50%; 7570 translate: calc((var(--width) - var(--height)) / -2); 7571 transition: inherit; 7572 } 7573 .switch .thumb:dir(rtl) { 7574 translate: calc((var(--width) - var(--height)) / 2); 7575 } 7576 7577 .input { 7578 position: absolute; 7579 opacity: 0; 7580 padding: 0; 7581 margin: 0; 7582 pointer-events: none; 7583 } 7584 7585 /* Focus */ 7586 label:not(.disabled) .input:focus-visible ~ [part~='control'] { 7587 outline: var(--wa-focus-ring); 7588 outline-offset: var(--wa-focus-ring-offset); 7589 } 7590 7591 /* Checked */ 7592 .checked .switch { 7593 background-color: var(--wa-form-control-activated-color); 7594 border-color: var(--wa-form-control-activated-color); 7595 } 7596 7597 .checked .switch .thumb { 7598 background-color: var(--wa-color-surface-default); 7599 translate: calc((var(--width) - var(--height)) / 2); 7600 } 7601 .checked .switch .thumb:dir(rtl) { 7602 translate: calc((var(--width) - var(--height)) / -2); 7603 } 7604 7605 /* Disabled */ 7606 label:has(> :disabled) { 7607 opacity: 0.5; 7608 cursor: not-allowed; 7609 } 7610 7611 [part~='label'] { 7612 display: inline-block; 7613 line-height: var(--height); 7614 margin-inline-start: 0.5em; 7615 user-select: none; 7616 -webkit-user-select: none; 7617 } 7618 7619 :host([required]) [part~='label']::after { 7620 content: var(--wa-form-control-required-content); 7621 color: var(--wa-form-control-required-content-color); 7622 margin-inline-start: var(--wa-form-control-required-content-offset); 7623 } 7624 7625 @media (forced-colors: active) { 7626 :checked:enabled + .switch:hover .thumb, 7627 :checked + .switch .thumb { 7628 background-color: ButtonText; 7629 } 7630 } 7631`,Yp=class extends Re{constructor(){super(...arguments),this.hasSlotController=new qe(this,"hint"),this.localize=new ie(this),this.title="",this.name=null,this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}static get validators(){return[...super.validators,Fe()]}get value(){return this._value??"on"}set value(t){this._value=t}handleSizeChange(){He(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??this.defaultChecked}set checked(t){this._checked=Boolean(t),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(t){const e="rtl"===this.localize.dir();"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}
7631))}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("checked")||t.has("defaultChecked")||t.has("disabled"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){!this.didSSR||this.hasUpdated?(this.setValue(this.checked?this.value:null,this._value),this.updateValidity()):this.updateComplete.then(()=>{this.handleValueOrCheckedChange()})}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}setValue(t,e){this.checked?this.internals.setFormValue(t??"on",e):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const t=this.hasSlotController.test("hint","withHint"),e=!!this.hint||!!t,i=this.didSSR&&!this.hasUpdated?this.checked:this.defaultChecked,o=this.didSSR&&!this.hasUpdated?null:Th(this.checked);return K` 7632 <label 7633 part="base switch" 7634 class=${ce({checked:this.checked,disabled:this.disabled})} 7635 > 7636 <input 7637 class="input" 7638 type="checkbox" 7639 title=${this.title} 7640 name=${We(this.name)} 7641 value=${We(this.value)} 7642 .checked=${We(o)} 7643 ?checked=${i} 7644 ?disabled=${this.disabled} 7645 ?required=${this.required} 7646 role="switch" 7647 aria-checked=${this.checked?"true":"false"} 7648 aria-describedby="hint" 7649 @click=${this.handleClick} 7650 @keydown=${this.handleKeyDown} 7651 /> 7652 7653 <span part="control" class="switch"> 7654 <span part="thumb" class="thumb"></span> 7655 </span> 7656 7657 <slot part="label" class="label"></slot> 7658 </label> 7659 7660 <slot 7661 id="hint" 7662 name="hint" 7663 part="hint" 7664 class=${ce({"has-slotted":e})} 7665 aria-hidden=${e?"false":"true"} 7666 >${this.hint}</slot 7667 > 7668 `}};Yp.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},Yp.css=[zh,Ue,jp],kt([Dt('input[type="checkbox"]')],Yp.prototype,"input",2),kt([At()],Yp.prototype,"title",2),kt([At({reflect:!0})],Yp.prototype,"name",2),kt([At({reflect:!0})],Yp.prototype,"value",1),kt([At({reflect:!0})],Yp.prototype,"size",2),kt([vt("size")],Yp.prototype,"handleSizeChange",1),kt([At({type:Boolean})],Yp.prototype,"disabled",2),kt([At({type:Boolean,attribute:!1})],Yp.prototype,"checked",1),kt([At({type:Boolean,attribute:"checked",reflect:!0})],Yp.prototype,"defaultChecked",2),kt([At({type:Boolean,reflect:!0})],Yp.prototype,"required",2),kt([At({attribute:"hint"})],Yp.prototype,"hint",2),kt([At({attribute:"with-hint",type:Boolean})],Yp.prototype,"withHint",2),kt([vt(["checked","defaultChecked"])],Yp.prototype,"handleStateChange",1),kt([vt("disabled",{waitUntilFirstUpdate:!0})],Yp.prototype,"handleDisabledChange",1),Yp=kt([St("wa-switch")],Yp),Yp.disableWarning?.("change-in-update");var Kp=h` 7669 :host { 7670 display: inline-block; 7671 color: var(--wa-color-neutral-on-quiet); 7672 font-weight: var(--wa-font-weight-action); 7673 } 7674 7675 .tab { 7676 display: inline-flex;
7677 align-items: center; 7678 font: inherit; 7679 padding: 1em 1.5em; 7680 white-space: nowrap; 7681 user-select: none; 7682 -webkit-user-select: none; 7683 cursor: pointer; 7684 transition: color var(--wa-transition-fast) var(--wa-transition-easing); 7685 7686 ::slotted(wa-icon:first-child) { 7687 margin-inline-end: 0.5em; 7688 } 7689 7690 ::slotted(wa-icon:last-child) { 7691 margin-inline-start: 0.5em; 7692 } 7693 } 7694 7695 @media (hover: hover) { 7696 :host(:hover:not([disabled])) .tab { 7697 color: currentColor; 7698 } 7699 } 7700 7701 :host(:focus) { 7702 outline: transparent; 7703 } 7704 7705 :host(:focus-visible) .tab { 7706 outline: var(--wa-focus-ring); 7707 outline-offset: calc(-1 * var(--wa-border-width-l) - var(--wa-focus-ring-offset)); 7708 } 7709 7710 :host([active]:not([disabled])) { 7711 color: var(--wa-color-brand-on-quiet); 7712 } 7713 7714 :host([disabled]) .tab { 7715 opacity: 0.5; 7716 cursor: not-allowed; 7717 } 7718 7719 @media (forced-colors: active) { 7720 :host([active]:not([disabled])) { 7721 outline: solid 1px transparent; 7722 outline-offset: -3px; 7723 } 7724 } 7725`,Xp=0,Gp=class extends Ft{constructor(){super(...arguments),this.attrId=++Xp,this.componentId=`wa-tab-${this.attrId}`,this.panel="",this.active=!1,this.disabled=!1,this.tabIndex=0,this.slot="nav",this.role="tab"}handleActiveChange(){this.setAttribute("aria-selected",this.active?"true":"false")}handleDisabledChange(){this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled&&!this.active?this.tabIndex=-1:this.tabIndex=0}render(){return this.id=this.id?.length>0?this.id:this.componentId,K` 7726 <div 7727 part="base tab" 7728 class=${ce({tab:!0,"tab-active":this.active})} 7729 > 7730 <slot></slot> 7731 </div> 7732 `}};Gp.css=Kp,kt([Dt(".tab")],Gp.prototype,"tab",2),kt([At({reflect:!0})],Gp.prototype,"panel",2),kt([At({type:Boolean,reflect:!0})],Gp.prototype,"active",2),kt([At({type:Boolean,reflect:!0})],Gp.prototype,"disabled",2),kt([At({type:Number,reflect:!0})],Gp.prototype,"tabIndex",2),kt([At({reflect:!0})],Gp.prototype,"slot",2),kt([At({reflect:!0})],Gp.prototype,"role",2),kt([vt("active")],Gp.prototype,"handleActiveChange",1),kt([vt("disabled")],Gp.prototype,"handleDisabledChange",1),Gp=kt([St("wa-tab")],Gp);var Qp=class extends Event{constructor(t){super("wa-tab-hide",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},Jp=class extends Event{constructor(t){super("wa-tab-show",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},Zp=h` 7733 :host { 7734 --indicator-color: var(--wa-color-brand-fill-loud); 7735 --track-color: var(--wa-color-neutral-fill-normal); 7736 --track-width: 0.125rem; 7737 7738 /* Private */ 7739 --safe-track-width: max(0.5px, round(var(--track-width), 0.5px)); 7740 7741 display: block; 7742 } 7743 7744 .tab-group { 7745 display: flex; 7746 border-radius: 0; 7747 } 7748 7749 .tabs { 7750 display: flex; 7751 position: relative; 7752 } 7753 7754 .indicator { 7755 position: absolute; 7756 } 7757 7758 .tab-group-has-scroll-controls .nav-container { 7759 position: relative; 7760 padding: 0 1.5em; 7761 } 7762 7763 .body { 7764 display: block; 7765 } 7766 7767 .scroll-button { 7768 display: flex;
7769 align-items: center; 7770 justify-content: center; 7771 position: absolute; 7772 top: 0; 7773 bottom: 0; 7774 width: 1.5em; 7775 } 7776 7777 .scroll-button-start { 7778 inset-inline-start: 0; 7779 } 7780 7781 .scroll-button-end { 7782 inset-inline-end: 0; 7783 } 7784 7785 /* 7786 * Top 7787 */ 7788 7789 .tab-group-top { 7790 flex-direction: column; 7791 } 7792 7793 .tab-group-top .nav-container { 7794 order: 1; 7795 } 7796 7797 .tab-group-top .nav { 7798 display: flex; 7799 overflow-x: auto; 7800 7801 /* Hide scrollbar in Firefox */ 7802 scrollbar-width: none; 7803 } 7804 7805 /* Hide scrollbar in Chrome/Safari */ 7806 .tab-group-top .nav::-webkit-scrollbar { 7807 width: 0; 7808 height: 0; 7809 } 7810 7811 .tab-group-top .tabs { 7812 flex: 1 1 auto; 7813 position: relative; 7814 flex-direction: row; 7815 border-bottom: solid var(--safe-track-width) var(--track-color); 7816 } 7817 7818 .tab-group-top .indicator { 7819 bottom: calc(-1 * var(--safe-track-width)); 7820 border-bottom: solid var(--safe-track-width) var(--indicator-color); 7821 } 7822 7823 .tab-group-top .body { 7824 order: 2; 7825 } 7826 7827 .tab-group-top ::slotted(wa-tab[active]) { 7828 border-block-end: solid var(--safe-track-width) var(--indicator-color); 7829 margin-block-end: calc(-1 * var(--safe-track-width)); 7830 } 7831 7832 .tab-group-top .body slot::slotted(wa-tab-panel) { 7833 --padding: var(--wa-space-xl) 0; 7834 } 7835 7836 /* 7837 * Bottom 7838 */ 7839 7840 .tab-group-bottom { 7841 flex-direction: column; 7842 } 7843 7844 .tab-group-bottom .nav-container { 7845 order: 2; 7846 } 7847 7848 .tab-group-bottom .nav { 7849 display: flex; 7850 overflow-x: auto; 7851 7852 /* Hide scrollbar in Firefox */ 7853 scrollbar-width: none; 7854 } 7855 7856 /* Hide scrollbar in Chrome/Safari */ 7857 .tab-group-bottom .nav::-webkit-scrollbar { 7858 width: 0; 7859 height: 0; 7860 } 7861 7862 .tab-group-bottom .tabs { 7863 flex: 1 1 auto; 7864 position: relative; 7865 flex-direction: row; 7866 border-top: solid var(--safe-track-width) var(--track-color); 7867 } 7868 7869 .tab-group-bottom .indicator { 7870 top: calc(-1 * var(--safe-track-width)); 7871 border-top: solid var(--safe-track-width) var(--indicator-color); 7872 } 7873 7874 .tab-group-bottom .body { 7875 order: 1; 7876 } 7877 7878 .tab-group-bottom ::slotted(wa-tab[active]) { 7879 border-block-start: solid var(--safe-track-width) var(--indicator-color); 7880 margin-block-start: calc(-1 * var(--safe-track-width)); 7881 } 7882 7883 .tab-group-bottom .body slot::slotted(wa-tab-panel) { 7884 --padding: var(--wa-space-xl) 0; 7885 } 7886 7887 /* 7888 * Start 7889 */ 7890 7891 .tab-group-start { 7892 flex-direction: row; 7893 } 7894 7895 .tab-group-start .nav-container { 7896 order: 1; 7897 } 7898 7899 .tab-group-start .tabs { 7900 flex: 0 0 auto; 7901 flex-direction: column; 7902 border-inline-end: solid var(--safe-track-width) var(--track-color); 7903 } 7904 7905 .tab-group-start .indicator { 7906 inset-inline-end: calc(-1 * var(--safe-track-width)); 7907 border-right: solid var(--safe-track-width) var(--indicator-color); 7908 } 7909 7910 .tab-group-start .body { 7911 flex: 1 1 auto; 7912 order: 2; 7913 } 7914 7915 .tab-group-start ::slotted(wa-tab[active]) { 7916 border-inline-end: solid var(--safe-track-width) var(--indicator-color); 7917 margin-inline-end: calc(-1 * var(--safe-track-width)); 7918 } 7919 7920 .tab-group-start .body slot::slotted(wa-tab-panel) { 7921 --padding: 0 var(--wa-space-xl); 7922 } 7923 7924 /* 7925 * End 7926 */ 7927 7928 .tab-group-end { 7929 flex-direction: row; 7930 } 7931 7932 .tab-group-end .nav-container { 7933 order: 2; 7934 } 7935 7936 .tab-group-end .tabs { 7937 flex: 0 0 auto; 7938 flex-direction: column; 7939 border-left: solid var(--safe-track-width) var(--track-color); 7940 } 7941 7942 .tab-group-end .indicator { 7943 inset-inline-start: calc(-1 * var(--safe-track-width)); 7944 border-inline-start: solid var(--safe-track-width) var(--indicator-color); 7945 } 7946 7947 .tab-group-end .body { 7948 flex: 1 1 auto; 7949 order: 1; 7950 } 7951 7952 .tab-group-end ::slotted(wa-tab[active]) { 7953 border-inline-start: solid var(--safe-track-width) var(--indicator-color); 7954 margin-inline-start: calc(-1 * var(--safe-track-width)); 7955 } 7956 7957 .tab-group-end .body slot::slotted(wa-tab-panel) { 7958 --padding: 0 var(--wa-space-xl); 7959 } 7960`,tm=class extends Ft{constructor(){super(...arguments),this.tabs=[],this.focusableTabs=[],this.panels=[],this.localize=new ie(this),this.hasScrollControls=!1,this.active="",this.placement="top",this.activation="auto",this.withoutScrollC
7960ontrols=!1}connectedCallback(){super.connectedCallback(),this.resizeObserver=new ResizeObserver(()=>{this.updateScrollControls()}),this.mutationObserver=new MutationObserver(t=>{t.some(t=>!["aria-labelledby","aria-controls"].includes(t.attributeName))&&setTimeout(()=>this.setAriaLabels());const e=t.filter(t=>t.target.closest("wa-tab-group")===this);if(e.some(t=>"disabled"===t.attributeName))this.syncTabsAndPanels();else if(e.some(t=>"active"===t.attributeName)){const t=e.filter(t=>"active"===t.attributeName&&"wa-tab"===t.target.tagName.toLowerCase()).map(t=>t.target),i=t.find(t=>t.active);i&&i.closest("wa-tab-group")===this&&this.setActiveTab(i)}}),this.updateComplete.then(()=>{this.syncTabsAndPanels(),this.mutationObserver.observe(this,{attributes:!0,childList:!0,subtree:!0}),this.resizeObserver.observe(this.nav);const t=new IntersectionObserver((t,e)=>{if(t[0].intersectionRatio>0){if(this.setAriaLabels(),this.active){const t=this.tabs.find(t=>t.panel===this.active);t&&this.setActiveTab(t)}else this.setActiveTab(this.getActiveTab()??this.tabs[0],{emitEvents:!1});e.unobserve(t[0].target)}});t.observe(this.tabGroup)})}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),this.nav&&this.resizeObserver?.unobserve(this.nav)}getAllTabs(){return[...this.shadowRoot.querySelector('slot[name="nav"]').assignedElements()].filter(t=>"wa-tab"===t.tagName.toLowerCase())}getAllPanels(){return[...this.defaultSlot.assignedElements()].filter(t=>"wa-tab-panel"===t.tagName.toLowerCase())}getActiveTab(){return this.tabs.find(t=>t.active)}handleClick(t){const e=t.target.closest("wa-tab"),i=e?.closest("wa-tab-group");i===this&&null!==e&&this.setActiveTab(e,{scrollBehavior:"smooth"})}handleKeyDown(t){const e=t.target.closest("wa-tab"),i=e?.closest("wa-tab-group");if(i===this)if(["Enter"," "].includes(t.key))null!==e&&(this.setActiveTab(e,{scrollBehavior:"smooth"}),t.preventDefault());else if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const e=this.tabs.find(t=>t.matches(":focus")),i="rtl"===this.localize.dir();let o=null;if("wa-tab"===e?.tagName.toLowerCase()){if("Home"===t.key)o=this.focusableTabs[0];else if("End"===t.key)o=this.focusableTabs[this.focusableTabs.length-1];else if(["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowRight":"ArrowLeft")||["start","end"].includes(this.placement)&&"ArrowUp"===t.key){const t=this.tabs.findIndex(t=>t===e);o=this.findNextFocusableTab(t,"backward")}else if(["top","bottom"].includes(this.placement)&&t.key===(i?"ArrowLeft":"ArrowRight")||["start","end"].includes(this.placement)&&"ArrowDown"===t.key){const t=this.tabs.findIndex(t=>t===e);o=this.findNextFocusableTab(t,"forward")}if(!o)return;o.tabIndex=0,o.focus({preventScroll:!0}),"auto"===this.activation?this.setActiveTab(o,{scrollBehavior:"smooth"}
7960):this.tabs.forEach(t=>{t.tabIndex=t===o?0:-1}),["top","bottom"].includes(this.placement)&&Wd(o,this.nav,"horizontal"),t.preventDefault()}}}findNextFocusableTab(t,e){let i=null;const o="forward"===e?1:-1;let a=t+o;for(;t<this.tabs.length;){if(i=this.tabs[a]||null,null===i){i="forward"===e?this.focusableTabs[0]:this.focusableTabs[this.focusableTabs.length-1];break}if(!i.disabled)break;a+=o}return i}handleScrollToStart(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft+this.nav.clientWidth:this.nav.scrollLeft-this.nav.clientWidth,behavior:"smooth"})}handleScrollToEnd(){this.nav.scroll({left:"rtl"===this.localize.dir()?this.nav.scrollLeft-this.nav.clientWidth:this.nav.scrollLeft+this.nav.clientWidth,behavior:"smooth"})}setActiveTab(t,e){if(e={emitEvents:!0,scrollBehavior:"auto",...e},t.closest("wa-tab-group")===this&&t!==this.activeTab&&!t.disabled){const i=this.activeTab;this.active=t.panel,this.activeTab=t,this.tabs.forEach(t=>{t.active=t===this.activeTab,t.tabIndex=t===this.activeTab?0:-1}),this.panels.forEach(t=>t.active=t.name===this.activeTab?.panel),["top","bottom"].includes(this.placement)&&Wd(this.activeTab,this.nav,"horizontal",e.scrollBehavior),e.emitEvents&&(i&&this.dispatchEvent(new Qp({name:i.panel})),this.dispatchEvent(new Jp({name:this.activeTab.panel})))}}
7960setAriaLabels(){this.tabs.forEach(t=>{const e=this.panels.find(e=>e.name===t.panel);e&&(t.setAttribute("aria-controls",e.getAttribute("id")),e.setAttribute("aria-labelledby",t.getAttribute("id")))})}syncTabsAndPanels(){this.tabs=this.getAllTabs(),this.focusableTabs=this.tabs.filter(t=>!t.disabled),this.panels=this.getAllPanels(),this.updateComplete.then(()=>this.updateScrollControls())}updateActiveTab(){const t=this.tabs.find(t=>t.panel===this.active);t&&this.setActiveTab(t,{scrollBehavior:"smooth"})}updateScrollControls(){this.withoutScrollControls?this.hasScrollControls=!1:this.hasScrollControls=["top","bottom"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth+1}render(){const t=this.hasUpdated?"rtl"===this.localize.dir():"rtl"===this.dir;return K` 7961 <div 7962 part="base tab-group" 7963 class=${ce({"tab-group":!0,"tab-group-top":"top"===this.placement,"tab-group-bottom":"bottom"===this.placement,"tab-group-start":"start"===this.placement,"tab-group-end":"end"===this.placement,"tab-group-has-scroll-controls":this.hasScrollControls})} 7964 @click=${this.handleClick} 7965 @keydown=${this.handleKeyDown} 7966 > 7967 <div class="nav-container" part="nav"> 7968 ${this.hasScrollControls?K` 7969 <wa-button 7970 part="scroll-button scroll-button-start" 7971 exportparts="base:scroll-button__base" 7972 class="scroll-button scroll-button-start" 7973 appearance="plain" 7974 @click=${this.handleScrollToStart} 7975 > 7976 <wa-icon 7977 name=${t?"chevron-right":"chevron-left"} 7978 library="system" 7979 variant="solid" 7980 label=${this.localize.term("scrollToStart")} 7981 ></wa-icon> 7982 </wa-button> 7983 `:""} 7984 7985 <!-- We have a focus listener because in Firefox (and soon to be Chrome) overflow containers are focusable. --> 7986 <div class="nav" @focus=${()=>this.activeTab?.focus({preventScroll:!0})}> 7987 <div part="tabs" class="tabs" role="tablist"> 7988 <slot name="nav" @slotchange=${this.syncTabsAndPanels}></slot> 7989 </div> 7990 </div> 7991 7992 ${this.hasScrollControls?K` 7993 <wa-button 7994 part="scroll-button scroll-button-end" 7995 class="scroll-button scroll-button-end" 7996 exportparts="base:scroll-button__base" 7997 appearance="plain" 7998 @click=${this.handleScrollToEnd} 7999 > 8000 <wa-icon 8001 name=${t?"chevron-left":"chevron-right"} 8002 library="system" 8003 variant="solid" 8004 label=${this.localize.term("scrollToEnd")} 8005 ></wa-icon> 8006 </wa-button> 8007 `:""} 8008 </div> 8009 8010 <div part="body" class="body"><slot @slotchange=${this.syncTabsAndPanels}></slot></div> 8011 </div> 8012 `}};tm.css=Zp,kt([Dt(".tab-group")],tm.prototype,"tabGroup",2),kt([Dt(".body slot")],tm.prototype,"defaultSlot",2),kt([Dt(".nav")],tm.prototype,"nav",2),kt([$t()],tm.prototype,"hasScrollControls",2),kt([At({reflect:!0})],tm.prototype,"active",2),kt([At()],tm.prototype,"placement",2),kt([At()],tm.prototype,"activation",2),kt([At({attribute:"without-scroll-controls",type:Boolean})],tm.prototype,"withoutScrollControls",2),kt([vt("active")],tm.prototype,"updateActiveTab",1),kt([vt("withoutScrollControls",{waitUntilFirstUpdate:!0})],tm.prototype,"updateScrollControls",1),tm=kt([St("wa-tab-group")],tm);var em=h` 8013 :host { 8014 --padding: 0; 8015 8016 display: none; 8017 } 8018 8019 :host([active]) { 8020 display: block; 8021 } 8022 8023 .tab-panel { 8024 display: block; 8025 padding: var(--padding); 8026 } 8027`,im=0,om=class extends Ft{constructor(){super(...arguments),this.attrId=++im,this.componentId=`wa-tab-panel-${this.attrId}`,this.name="",this.active=!1,this.role="tabpanel"}connectedCallback(){super.connectedCallback(),this.id=(this.id||"").length>0?this.id:this.componentId}handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true")}render(){return K` 8028 <slot 8029 part="base" 8030 class=${ce({"tab-panel":!0,"tab-panel-active":this.active})} 8031 ></slot> 8032 `}};om.css=em,kt([At({reflect:!0})],om.prototype,"name",2),kt([At({type:Boolean,reflect:!0})],om.prototype,"active",2),kt([At({reflect:!0})],om.prototype,"role",2),kt([vt("active")],om.prototype,"handleActiveChange",1),om=kt([St("wa-tab-panel")],om);var am=h` 8033 :host { 8034 border-width: 0; 8035 } 8036 8037 .textarea { 8038 display: grid;
8039 align-items: center; 8040 margin: 0; 8041 border: none; 8042 outline: none; 8043 cursor: inherit; 8044 font: inherit; 8045 background-color: var(--wa-form-control-background-color); 8046 border-color: var(--wa-form-control-border-color); 8047 border-radius: var(--wa-form-control-border-radius); 8048 border-style: var(--wa-form-control-border-style); 8049 border-width: var(--wa-form-control-border-width); 8050 -webkit-appearance: none; 8051 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 8052 outline-offset: var(--wa-focus-ring-offset); 8053 8054 &:focus-within { 8055 outline-color: var(--wa-color-focus); 8056 } 8057 8058 /* Style disabled textareas */ 8059 &:has(:disabled) { 8060 cursor: not-allowed; 8061 opacity: 0.5; 8062 } 8063 } 8064 8065 /* Appearance modifiers */ 8066 :host([appearance='outlined']) .textarea { 8067 background-color: var(--wa-form-control-background-color); 8068 border-color: var(--wa-form-control-border-color); 8069 } 8070 8071 :host([appearance='filled']) .textarea { 8072 background-color: var(--wa-color-neutral-fill-quiet); 8073 border-color: var(--wa-color-neutral-fill-quiet); 8074 } 8075 8076 :host([appearance='filled-outlined']) .textarea { 8077 background-color: var(--wa-color-neutral-fill-quiet); 8078 border-color: var(--wa-form-control-border-color); 8079 } 8080 8081 textarea { 8082 display: block; 8083 width: 100%; 8084 border: none; 8085 background: transparent; 8086 font: inherit; 8087 color: inherit; 8088 cursor: inherit; 8089 scroll-padding-block: var(--wa-form-control-padding-block); 8090 padding: calc(var(--wa-form-control-padding-block) - ((1lh - 1em) / 2)) var(--wa-form-control-padding-inline); /* accounts for the larger line height of textarea content */ 8091 min-height: calc(var(--wa-form-control-height) - var(--border-width) * 2); 8092 box-shadow: none; 8093 margin: 0; 8094 8095 &::placeholder { 8096 color: var(--wa-form-control-placeholder-color); 8097 user-select: none; 8098 -webkit-user-select: none; 8099 } 8100 8101 &:autofill { 8102 &, 8103 &:hover, 8104 &:focus, 8105 &:active { 8106 box-shadow: none; 8107 caret-color: var(--wa-form-control-value-color); 8108 } 8109 } 8110 8111 &:focus { 8112 outline: none; 8113 } 8114 } 8115 8116 /* Shared textarea and size-adjuster positioning */ 8117 .control, 8118 .size-adjuster { 8119 grid-area: 1 / 1 / 2 / 2; 8120 } 8121 8122 .size-adjuster { 8123 visibility: hidden; 8124 pointer-events: none; 8125 opacity: 0; 8126 padding: 0; 8127 } 8128 8129 textarea::-webkit-search-decoration, 8130 textarea::-webkit-search-cancel-button, 8131 textarea::-webkit-search-results-button, 8132 textarea::-webkit-search-results-decoration { 8133 -webkit-appearance: none; 8134 } 8135 8136 /* 8137 * Resize types 8138 */ 8139 8140 :host([resize='none']) textarea { 8141 resize: none; 8142 } 8143 8144 textarea, 8145 :host([resize='vertical']) textarea { 8146 resize: vertical; 8147 } 8148 8149 :host([resize='horizontal']) textarea { 8150 resize: horizontal; 8151 } 8152 8153 :host([resize='both']) textarea { 8154 resize: both; 8155 } 8156 8157 :host([resize='auto']) textarea { 8158 height: auto; 8159 resize: none; 8160 overflow-y: hidden; 8161 } 8162 8163 /* 8164 * Footer (hint + character count) 8165 */ 8166 8167 /* 8168 * This element carries the hint part, so the shared form control styles apply to it. Those styles set display:block 8169 * and hide the element when it has no hint, both of which have to be undone when a character count is present. 8170 */ 8171 .footer.has-slotted, 8172 .footer.has-count { 8173 display: flex;
8174 align-items: baseline; 8175 gap: 1em; 8176 } 8177 8178 /* Slots default to display:contents, which would leave the hint unable to shrink below its content */ 8179 .footer.has-count .hint { 8180 display: block; 8181 flex: 1 1 auto; 8182 min-width: 0; 8183 } 8184 8185 .count { 8186 flex: 0 0 auto; 8187 color: var(--wa-form-control-hint-color); 8188 font-weight: var(--wa-form-control-hint-font-weight); 8189 line-height: var(--wa-form-control-hint-line-height); 8190 margin-block-start: 0.5em; 8191 font-size: var(--wa-font-size-smaller); 8192 margin-inline-start: auto; 8193 } 8194`,sm=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["blur","input"],this.hasSlotController=new qe(this,"hint","label"),this.localize=new ie(this),this.announcedCountText="",this.title="",this.name=null,this._value=null,this.defaultValue=this.getAttribute("value")??"",this.size="m",this.appearance="outlined",this.label="",this.hint="",this.placeholder="",this.rows=4,this.resize="vertical",this.disabled=!1,this.readonly=!1,this.required=!1,this.spellcheck=!0,this.withLabel=!1,this.withHint=!1,this.withCount=!1,this.lastObservedWidth=0}static get validators(){return[...super.validators,Fe()]}get value(){return this.valueHasChanged?this._value:this._value??this.defaultValue}set value(t){this._value!==t&&(this.valueHasChanged=!0,this._value=t)}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{if(this.setTextareaDimensions(),this.updateResizeObserver(),this.didSSR&&this.input&&this.value!==this.input.value){const t=this.input.value;this.value=t}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.countAnnounceTimeout),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}updateFormValue(t){null!=t?super.updateFormValue(t):this.setValue("",null)}updateResizeObserver(){const t="none"!==this.resize;this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),t&&this.input&&("auto"===this.resize?(this.resizeObserver=new ResizeObserver(t=>{const e=t[0]?.contentRect.width??0;e!==this.lastObservedWidth&&(this.lastObservedWidth=e,requestAnimationFrame(()=>this.setTextareaDimensions()))}),this.resizeObserver.observe(this)):(this.resizeObserver=new ResizeObserver(()=>this.setTextareaDimensions()),this.resizeObserver.observe(this.input)))}handleBlur(){this.checkValidity()}handleChange(t){this.valueHasChanged=!0,this.value=this.input.value,this.setTextareaDimensions(),this.checkValidity(),this.relayNativeEvent(t,{bubbles:!0,composed:!0})}handleInput(t){this.valueHasChanged=!0,this.value=this.input.value,this.relayNativeEvent(t,{bubbles:!0,composed:!0}),this.scheduleCountAnnouncement()}scheduleCountAnnouncement(){clearTimeout(this.countAnnounceTimeout),this.countAnnounceTimeout=setTimeout(()=>{const t=(this.value??"").length;this.announcedCountText=null!=this.maxlength?this.localize.term("numCharactersRemaining",this.maxlength-t):this.localize.term("numCharacters",t)},1e3)}setTextareaDimensions(){if("none"===this.resize)return this.base.style.width="",void(this.base.style.height="");if("auto"===this.resize){this.sizeAdjuster.style.height=`${this.input.clientHeight}px`,this.input.style.height="auto";const t=this.input.scrollHeight;return this.input.style.height=`${t}px`,this.sizeAdjuster.style.height=`${t}px`,this.base.style.width="",void(this.base.style.height="")}if(this.input.style.width){const t=Number(this.input.style.width.split(/px/)[0])+2;this.base.style.width=`${t}px`}if(this.input.style.height){const t=Number(this.input.style.height.split(/px/)[0])+2;this.base.style.height=`${t}px`}}handleRowsChange(){this.setTextareaDimensions()}async handleValueChange(){await this.updateComplete,this.checkValidity(),this.setTextareaDimensions()}updated(t){t.has("resize")&&(this.setTextareaDimensions(),this.updateResizeObserver()),super.updated(t),t.has("value")&&this.customStates.set("blank",!this.value)}focus(t){this.input.focus(t)}blur(){this.input.blur()}select(){this.input.select()}scrollPosition(t){return t?("number"==typeof t.top&&(this.input.scrollTop=t.top),void("number"==typeof t.left&&(this.input.scrollLeft=t.left))):{top:this.input.scrollTop,left:this.input.scrollTop}}setSelectionRange(t,e,i="none"){this.input.setSelectionRange(t,e,i)}setRangeText(t,e,i,o="preserve"){const a=e??this.input.selectionStart,s=i??this.input.selectionEnd;this.input.setRangeText(t,a,s,o),this.value!==this.input.value&&(this.value=this.input.value,this.setTextareaDimensions())}formResetCallback(){this._value=null,this.input&&(this.input.value=this.value||""),super.formResetCallback()}render(){const t=this.hasSlotController.test("label","withLabel"),e=this.hasSlotController.test("hint","withHint"),i=!!this.label||!!t,o=!!this.hint||!!e,a=(this.value??"").length,s=null!=this.maxlength?this.localize.term("numCharactersRemaining",this.maxlength-a):this.localize.term("numCharacters",a);return K` 8195 <label 8196 part="form-control-label label" 8197 class=${ce({label:!0,"has-label":i})} 8198 for="input" 8199 aria-hidden=${i?"false":"true"} 8200 > 8201 <slot name="label">${this.label}</slot> 8202 </label> 8203 8204 <div part="base textarea-wrapper" class="textarea"> 8205 <textarea 8206 part="textarea" 8207 id="input" 8208 class="control" 8209 title=${this.title} 8210 name=${We(this.name)} 8211 .value=${Th(this.value)} 8212 ?disabled=${this.disabled} 8213 ?readonly=${this.readonly} 8214 ?required=${this.required} 8215 placeholder=${We(this.placeholder)} 8216 rows=${We(this.rows)} 8217 minlength=${We(this.minlength)} 8218 maxlength=${We(this.maxlength)} 8219 autocapitalize=${We(this.autocapitalize)} 8220 autocorrect=${We(this.autocorrect)} 8221 ?autofocus=${this.autofocus} 8222 spellcheck=${We(this.spellcheck)} 8223 enterkeyhint=${We(this.enterkeyhint)} 8224 inputmode=${We(this.inputmode)} 8225 aria-describedby="hint" 8226 @change=${this.handleChange}
8227 @input=${this.handleInput} 8228 @blur=${this.handleBlur} 8229 ></textarea> 8230 8231 <!-- This "adjuster" exists to prevent layout shifting. https://github.com/shoelace-style/shoelace/issues/2180 --> 8232 <div part="textarea-adjuster" class="size-adjuster" ?hidden=${"auto"!==this.resize}></div> 8233 </div> 8234 8235 <div 8236 part="hint" 8237 class=${ce({footer:!0,"has-count":this.withCount,"has-slotted":o})} 8238 > 8239 <slot id="hint" name="hint" class="hint" aria-hidden=${o?"false":"true"}>${this.hint}</slot> 8240 8241 ${this.withCount?K` 8242 <div part="count" class="count" aria-hidden="true">${s}</div> 8243 <div class="wa-visually-hidden-force" aria-live="polite">${this.announcedCountText}</div> 8244 `:""} 8245 </div> 8246 `}};sm.css=[am,zh,Ue,Rh],kt([$t()],sm.prototype,"announcedCountText",2),kt([Dt(".control")],sm.prototype,"input",2),kt([Dt('[part~="base"]')],sm.prototype,"base",2),kt([Dt(".size-adjuster")],sm.prototype,"sizeAdjuster",2),kt([At()],sm.prototype,"title",2),kt([At({reflect:!0})],sm.prototype,"name",2),kt([$t()],sm.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],sm.prototype,"defaultValue",2),kt([At({reflect:!0})],sm.prototype,"size",2),kt([vt("size")],sm.prototype,"handleSizeChange",1),kt([At({reflect:!0})],sm.prototype,"appearance",2),kt([At()],sm.prototype,"label",2),kt([At({attribute:"hint"})],sm.prototype,"hint",2),kt([At()],sm.prototype,"placeholder",2),kt([At({type:Number})],sm.prototype,"rows",2),kt([At({reflect:!0})],sm.prototype,"resize",2),kt([At({type:Boolean})],sm.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],sm.prototype,"readonly",2),kt([At({type:Boolean,reflect:!0})],sm.prototype,"required",2),kt([At({type:Number})],sm.prototype,"minlength",2),kt([At({type:Number})],sm.prototype,"maxlength",2),kt([At()],sm.prototype,"autocapitalize",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"off"===t),toAttribute:t=>t?"on":"off"}})],sm.prototype,"autocorrect",2),kt([At()],sm.prototype,"autocomplete",2),kt([At({type:Boolean})],sm.prototype,"autofocus",2),kt([At()],sm.prototype,"enterkeyhint",2),kt([At({type:Boolean,converter:{fromAttribute:t=>!(!t||"false"===t),toAttribute:t=>t?"true":"false"}})],sm.prototype,"spellcheck",2),kt([At()],sm.prototype,"inputmode",2),kt([At({attribute:"with-label",type:Boolean})],sm.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],sm.prototype,"withHint",2),kt([At({attribute:"with-count",type:Boolean,reflect:!0})],sm.prototype,"withCount",2),kt([vt("rows",{waitUntilFirstUpdate:!0})],sm.prototype,"handleRowsChange",1),kt([vt("value",{waitUntilFirstUpdate:!0})],sm.prototype,"handleValueChange",1),sm=kt([St("wa-textarea")],sm),sm.disableWarning?.("change-in-update");var nm=new Map;function rm(t,e){try{const i=new Intl.DateTimeFormat(t||"en",{hour:"numeric",hour12:!0}),o=new Date(2026,0,1,0===e?9:15),a=i.formatToParts(o).find(t=>"dayPeriod"===t.type);return a?.value||(0===e?"AM":"PM")}catch{return 0===e?"AM":"PM"}}function lm(t,e){return"hour"===t?e?{min:1,max:12}:{min:0,max:23}:"minute"===t||"second"===t?{min:0,max:59}:{min:0,max:1}}function hm(t,e,i,o){const a=Number(e);if(""===t)return 0===a&&0===i?{value:0,buffer:"0",advance:!1}:0===a?{value:null,buffer:"0",advance:!1}:10*a>o?{value:cm(a,i,o),buffer:"",advance:!0}:{value:a,buffer:e,advance:!1};const s=Number(t+e);return s>=i&&s<=o?{value:s,buffer:"",advance:!0}:"0"===t&&0===a?{value:0===i?0:null,buffer:"0",advance:!1}:hm("",e,i,o)}function cm(t,e,i){return Math.min(i,Math.max(e,t))}function dm(t){if(!t)return null;const e=Number(t);return Number.isFinite(e)?e:null}function um(t,e){const i={hour:null,minute:null,second:null,dayPeriod:null};if(!t)return i;const o=/^(\d{1,2}):(\d{2})(?::(\d{2}(?:\.\d+)?))?$/.exec(t);if(!o)return i;const a=Number(o[1]),s=Number(o[2]),n=null!=o[3]?Math.trunc(Number(o[3])):null;if(!Number.isFinite(a)||!Number.isFinite(s))return i;if(a<0||a>23||s<0||s>59)return i;if(null!=n&&(n<0||n>59))return i;let r,l=null;return e.hour12?(l=a>=12?1:0,r=a%12||12):r=a,{hour:r,minute:s,second:e.withSeconds?n??0:null,dayPeriod:e.hour12?l:null}}function pm(t){const e=t.now??(()=>new Date);return{typeDigit:(e,i,o,a)=>
8246{const s=function(t,e,i,o){return/^[0-9]$/.test(i)?"dayPeriod"===t?{value:dm(e),buffer:e,advance:!1}:"hour"===t?o?hm(e,i,1,12):hm(e,i,0,23):hm(e,i,0,59):{value:dm(e),buffer:e,advance:!1}}(i,o,a,t.hour12()),n={...t.getSegments(e),[i]:s.value};return t.setSegments(e,n),s},step:(i,o,a)=>{const s=function(t,e,i,o,a=new Date){const s={...t},n=t[e];if("dayPeriod"===e){const t=n??(a.getHours()<12?0:1);return s.dayPeriod=0===t?1:0,s}const{min:r,max:l}=lm(e,o);if(null==n){if("hour"===e){const t=a.getHours();s.hour=o?t%12||12:t}else"minute"===e?s.minute=a.getMinutes():s.second=a.getSeconds();return s}const h=l-r+1,c=((n-r+i)%h+h)%h+r;return"hour"===e?s.hour=c:"minute"===e?s.minute=c:s.second=c,s}(t.getSegments(i),o,a,t.hour12(),e());return t.setSegments(i,s),{value:s[o]}},bounds:(e,i)=>lm(i,t.hour12()),commitBuffer:(e,i,o)=>{const a=dm(o),s=t.getSegments(e);return t.setSegments(e,{...s,[i]:a}),a},clear:(e,i)=>{const o=t.getSegments(e);return null!=o[i]&&(t.setSegments(e,{...o,[i]:null}),!0)}}}var mm=h` 8247 :host { 8248 --show-duration: var(--wa-transition-fast); 8249 --hide-duration: var(--wa-transition-fast); 8250 --column-item-height: 2.25em; 8251 --column-width: 3em; 8252 } 8253 8254 :host(:state(disabled)) { 8255 cursor: not-allowed; 8256 } 8257 8258 /* Popup */ 8259 .time-input-popup { 8260 flex: 1 1 auto; 8261 display: inline-flex; 8262 width: 100%; 8263 position: relative; 8264 vertical-align: middle; 8265 --show-duration: inherit; 8266 --hide-duration: inherit; 8267 8268 &::part(popup) { 8269 z-index: 900; 8270 } 8271 8272 &[data-current-placement^='top']::part(popup) { 8273 transform-origin: bottom; 8274 } 8275 8276 &[data-current-placement^='bottom']::part(popup) { 8277 transform-origin: top; 8278 } 8279 } 8280 8281 /* Popup body â bordered card with the column listboxes. */ 8282 .popup-body { 8283 display: inline-flex; 8284 flex-direction: column; 8285 background-color: var(--wa-color-surface-raised); 8286 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 8287 border-radius: var(--wa-border-radius-m); 8288 box-shadow: var(--wa-shadow-m); 8289 color: var(--wa-color-text-normal); 8290 font-size: inherit; 8291 padding: var(--wa-space-2xs); 8292 } 8293 8294 .columns { 8295 display: inline-flex; 8296 gap: var(--wa-space-2xs); 8297 align-items: stretch; 8298 } 8299 8300 .column { 8301 display: flex; 8302 flex-direction: column; 8303 width: var(--column-width); 8304 max-height: calc(var(--column-item-height) * 7); 8305 overflow-y: auto; 8306 scroll-snap-type: y mandatory; 8307 scrollbar-width: none; 8308 /* Don't let column scroll bubble to the page. */ 8309 overscroll-behavior: contain; 8310 outline: none; 8311 border-radius: var(--wa-border-radius-s); 8312 } 8313 8314 .column::-webkit-scrollbar { 8315 display: none; 8316 } 8317 8318 .column:focus-visible { 8319 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) var(--wa-color-focus); 8320 outline-offset: 2px; 8321 } 8322 8323 .column-item { 8324 flex: 0 0 var(--column-item-height); 8325 display: inline-flex;
8326 align-items: center; 8327 justify-content: center; 8328 font: inherit; 8329 font-variant-numeric: tabular-nums; 8330 cursor: pointer; 8331 scroll-snap-align: center; 8332 border-radius: var(--wa-border-radius-s); 8333 color: var(--wa-color-text-normal); 8334 background: transparent; 8335 border: none; 8336 padding: 0; 8337 user-select: none; 8338 transition: 8339 background-color var(--wa-transition-fast), 8340 color var(--wa-transition-fast); 8341 } 8342 8343 .column-item:hover:not([aria-disabled='true']):not([aria-selected='true']) { 8344 background-color: var(--wa-color-neutral-fill-quiet); 8345 } 8346 8347 .column-item[aria-selected='true'] { 8348 background-color: var(--wa-color-brand-fill-loud); 8349 color: var(--wa-color-brand-on-loud); 8350 } 8351 8352 .column-item[aria-disabled='true'] { 8353 color: var(--wa-color-text-quiet); 8354 cursor: not-allowed; 8355 } 8356 8357 /* Footer / Now button */ 8358 .popup-footer { 8359 display: flex; 8360 align-items: center; 8361 justify-content: flex-end; 8362 gap: var(--wa-space-xs); 8363 margin-top: var(--wa-space-xs); 8364 padding-top: var(--wa-space-xs); 8365 border-top: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 8366 } 8367 8368 .now-button { 8369 appearance: none; 8370 background: transparent; 8371 border: var(--wa-border-style) var(--wa-border-width-s) var(--wa-color-surface-border); 8372 border-radius: var(--wa-border-radius-s); 8373 padding: var(--wa-space-2xs) var(--wa-space-s); 8374 font: inherit; 8375 color: inherit; 8376 cursor: pointer; 8377 transition: background-color var(--wa-transition-fast); 8378 } 8379 8380 .now-button:hover { 8381 background-color: var(--wa-color-neutral-fill-quiet); 8382 } 8383 8384 .now-button:focus-visible { 8385 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) var(--wa-color-focus); 8386 outline-offset: 2px; 8387 } 8388 8389 /* Input wrapper */ 8390 .input-wrapper { 8391 flex: 1; 8392 display: flex; 8393 width: 100%; 8394 min-width: 0; 8395 align-items: center; 8396 min-height: var(--wa-form-control-height); 8397 background-color: var(--wa-form-control-background-color); 8398 border-color: var(--wa-form-control-border-color); 8399 border-radius: var(--wa-form-control-border-radius); 8400 border-style: var(--wa-form-control-border-style); 8401 border-width: var(--wa-form-control-border-width); 8402 color: var(--wa-form-control-value-color); 8403 cursor: text; 8404 font-family: inherit; 8405 font-weight: var(--wa-form-control-value-font-weight); 8406 line-height: var(--wa-form-control-value-line-height); 8407 padding: 0 var(--wa-form-control-padding-inline); 8408 transition: 8409 background-color var(--wa-transition-normal), 8410 border-color var(--wa-transition-normal), 8411 outline-color var(--wa-transition-fast); 8412 transition-timing-function: var(--wa-transition-easing); 8413 outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) transparent; 8414 outline-offset: var(--wa-focus-ring-offset); 8415 } 8416 8417 :host([pill]) .input-wrapper { 8418 border-radius: var(--wa-border-radius-pill); 8419 } 8420 8421 :host(:focus-within) .input-wrapper { 8422 outline-color: var(--wa-color-focus); 8423 } 8424 8425 :host(:state(disabled)) .input-wrapper { 8426 opacity: 0.5; 8427 cursor: not-allowed; 8428 } 8429 8430 /* Appearance variants */ 8431 :host([appearance='filled']) .input-wrapper, 8432 :host([appearance='filled-outlined']) .input-wrapper { 8433 background-color: var(--wa-color-surface-lowered); 8434 } 8435 8436 :host([appearance='filled']) .input-wrapper { 8437 border-color: transparent; 8438 } 8439 8440 /* Segmented input â same patterns as wa-date-input. */ 8441 .segments { 8442 flex: 1; 8443 min-width: 0; 8444 display: inline-flex;
8445 align-items: center; 8446 flex-wrap: nowrap; 8447 color: inherit; 8448 font: inherit; 8449 font-variant-numeric: tabular-nums; 8450 caret-color: transparent; 8451 } 8452 8453 .segment { 8454 display: inline-block; 8455 padding: 0 0.15em; 8456 margin: 0; 8457 background: transparent; 8458 border: none; 8459 outline: none; 8460 color: inherit; 8461 font: inherit; 8462 text-align: center; 8463 cursor: text; 8464 user-select: none; 8465 white-space: nowrap; 8466 border-radius: var(--wa-border-radius-s); 8467 transition: 8468 background-color var(--wa-transition-fast), 8469 color var(--wa-transition-fast); 8470 } 8471 8472 .segment.empty { 8473 color: var(--wa-color-text-quiet); 8474 } 8475 8476 /* Focus style â applies to keyboard *and* pointer focus so a click always shows the selection. Soft brand fill 8477 reads as "selected" without competing with the popup's loud selected items. */ 8478 .segment:focus { 8479 background-color: var(--wa-color-brand-fill-quiet); 8480 color: var(--wa-color-brand-on-quiet); 8481 outline: none; 8482 } 8483 8484 .segment.empty:focus { 8485 color: var(--wa-color-brand-on-quiet); 8486 } 8487 8488 .segment-literal { 8489 display: inline-block; 8490 color: var(--wa-color-text-quiet); 8491 white-space: pre; 8492 user-select: none; 8493 } 8494 8495 :host([disabled]) .segment, 8496 :host([readonly]) .segment { 8497 cursor: inherit; 8498 } 8499 8500 /* Hidden form-value input (anchored under the wrapper for native validity tooltips). */ 8501 .value-input { 8502 position: absolute; 8503 inset-inline-start: var(--wa-form-control-padding-inline); 8504 inset-block-start: 50%; 8505 transform: translateY(-50%); 8506 width: 1px; 8507 height: 1px; 8508 opacity: 0; 8509 pointer-events: none; 8510 border: none; 8511 padding: 0; 8512 margin: 0; 8513 } 8514 8515 /* Trailing buttons (.clear-button, .expand-button), the .expand-icon box, and the start/end 8516 decoration slots are shared with <wa-date-input> via segmentedFieldStyles so both pickers 8517 stay on <wa-select>'s trailing optical axis. See segmented-field.styles.ts. */ 8518 8519 /* Animations */ 8520 .time-input-popup::part(popup).show { 8521 animation: wa-time-input-show var(--show-duration) var(--wa-transition-easing); 8522 } 8523 8524 .time-input-popup::part(popup).hide { 8525 animation: wa-time-input-hide var(--hide-duration) var(--wa-transition-easing); 8526 } 8527 8528 @keyframes wa-time-input-show { 8529 from { 8530 opacity: 0; 8531 transform: scale(0.97); 8532 } 8533 to { 8534 opacity: 1; 8535 transform: scale(1); 8536 } 8537 } 8538 8539 @keyframes wa-time-input-hide { 8540 from { 8541 opacity: 1; 8542 transform: scale(1); 8543 } 8544 to { 8545 opacity: 0; 8546 transform: scale(0.97); 8547 } 8548 } 8549 8550 @media (prefers-reduced-motion: reduce) { 8551 :host { 8552 --show-duration: 0ms; 8553 --hide-duration: 0ms; 8554 } 8555 .column { 8556 scroll-behavior: auto; 8557 } 8558 } 8559 8560 /* Visually hidden helper */ 8561 .visually-hidden { 8562 position: absolute; 8563 width: 1px; 8564 height: 1px; 8565 padding: 0; 8566 margin: -1px; 8567 overflow: hidden; 8568 clip: rect(0, 0, 0, 0); 8569 white-space: nowrap; 8570 border: 0; 8571 } 8572`,fm=0,gm="single",bm=class extends Re{constructor(){super(...arguments),this.assumeInteractionOn=["input"],this.hasSlotController=new qe(this,"hint","label","footer"),this.localize=new ie(this),this.popupId="wa-time-input-"+ ++fm,this.keyboardHelpId=`${this.popupId}-help`,this.pendingValue=null,this.moveFocusToColumnOnShow=!1,this.lastEmittedValue="",this.segments={hour:null,minute:null,second:null,dayPeriod:null},this.segmentsController=new Qu(this,{getLayout:()=>this.getLayout(),isRtl:()=>this.isRtl,isReadonly:()=>this.readonly,isDisabled:()=>this.disabled,rules:pm({getSegments:()=>this.segments,setSegments:(t,e)=>{this.segments=e},hour12:()=>this.resolvedHour12}),onCommit:()=>{this.recomputeValue(),this.requestUpdate()}}),this.name="",this._value="",this.defaultValue=this.getAttribute("value")??"",this.disabled=!1,this.required=!1,this.readonly=!1,this.size="m",this.appearance="outlined",this.pill=!1,this.label="",this.hint="",this.autocomplete="",this.withClear=!1,this.withNow=!1,this.withLabel=!1,this.withHint=!1,this.min="",this.max="",this.step=60,this.hourFormat="auto",this.open=!1,this.placement="bottom-start",this.distance=0,this.handleDocumentFocusIn=t=>{t.composedPath().includes(this)||this.hide()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&qh(this)&&(t.stopPropagation(),t.preventDefault(),this.hide())},this.handleDocumentMouseDown=t=>{t.composedPath().includes(this)||this.hide()},this.handleSegmentFocus=t=>{this.segmentsController.eventHandlers().focus(t)},this.handleSegmentBlur=t=>{this.segmentsController.eventHandlers().blur(t)},this.handleInputWrapperPointerDown=t=>{if(!(this.disabled||this.readonly||this.open)){for(const e of t.composedPath()){if(e===this)break;if(!(e instanceof Element))continue;const t=e.tagName;if("BUTTON"===t||"A"===t||"button"===e.getAttribute("role"))return}this.show()}},this.handleSegmentKeyDown=t=>{const e=t.currentTarget,i=e.dataset.segment;if(t.altKey&&"ArrowDown"===t.key)return t.preventDefault(),this.moveFocusToColumnOnShow=!0,void(this.open?this.focusFirstC
8572olumn():this.show());if(t.altKey&&"ArrowUp"===t.key)return t.preventDefault(),void this.hide();if("Enter"===t.key)return t.preventDefault(),this.segmentsController.getBuffer(gm,i)&&(this.segmentsController.flushBuffer(gm,i),this.recomputeValue()),void(this.open&&this.hide());if("dayPeriod"===i){const i="a"===(o=t.key)||"A"===o?0:"p"===o||"P"===o?1:null;if(null!=i){if(t.preventDefault(),this.readonly)return;return this.segments={...this.segments,dayPeriod:i},this.recomputeValue(),this.requestUpdate(),void this.segmentsController.moveFocus(e,1)}}var o;this.segmentsController.eventHandlers().keydown(t)},this.handleExpandButtonClick=()=>{this.open?this.hide():(this.moveFocusToColumnOnShow=!0,this.show())},this.handleClearClick=t=>{var e;(t.stopPropagation(),this._value||(null!=(e=this.segments).hour||null!=e.minute||null!=e.second||null!=e.dayPeriod))&&(this._value="",this.valueHasChanged=!0,this.segmentsController.clearBuffers(),this.syncSegmentsFromCanonical(),this.updateValidity(),this.dispatchEvent(new kc),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.lastEmittedValue="",this.focus())},this.handleClearMouseDown=t=>{t.preventDefault(),t.stopPropagation()},this.handleNowClick=()=>{const t=new Date;this.value=t,this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.lastEmittedValue=this._value,this.hide()},this.handleColumnItemClick=t=>{const e=t.target.closest(".column-item");if(!e||"true"===e.getAttribute("aria-disabled"))return;const i=e.dataset.field,o=Number(e.dataset.value);Number.isNaN(o)||(this.segments={...this.segments,[i]:o},this.recomputeValue(),this.requestUpdate())},this.handleColumnKeyDown=t=>{const e=t.currentTarget,i=e.dataset.field;if("Escape"===t.key)return t.preventDefault(),void this.hide();if("Enter"===t.key)return t.preventDefault(),void this.hide();if("ArrowLeft"===t.key||"ArrowRight"===t.key){t.preventDefault();const e=this.columnFields;if(e.length<2)return;const o="ArrowLeft"===t.key?-1:1,a=e.indexOf(i),s=e[((a+o)%e.length+e.length)%e.length],n=this.shadowRoot?.querySelector(`.column[data-field="${s}"]`);return void n?.focus({preventScroll:!0})}if("ArrowUp"===t.key||"ArrowDown"===t.key||"PageUp"===t.key||"PageDown"===t.key){t.preventDefault();const o="ArrowUp"===t.key||"PageUp"===t.key?-1:1,a="PageUp"===t.key||"PageDown"===t.key?5:1,s=this.columnItemsFor(i);if(0===s.length)return;const n=this.segments[i],r=null==n?0:Math.max(0,s.findIndex(t=>t.value===n)),l=s[((r+o*a)%s.length+s.length)%s.length];return this.segments={...this.segments,[i]:l.value},this.recomputeValue(),this.requestUpdate(),void requestAnimationFrame(()=>{const t=e.querySelector(`[data-value="${l.value}"]`);t&&this.keepItemInView(e,t)})}if("Home"===t.key){t.preventDefault();const e=this.columnItemsFor(i);if(0===e.length)return;return this.segments={...this.segments,[i]:e[0].value},this.recomputeValue(),void this.requestUpdate()}if("End"===t.key){t.preventDefault();const e=this.columnItemsFor(i);if(0===e.length)return;const o=e[e.length-1];return this.segments={...this.segments,[i]:o.value},this.recomputeValue(),void this.requestUpdate()}}}static get validators(){const t=[Mh({validationElement:Object.assign(document.createElement("input"),{required:!0})}),Fe()];return[...super.validators,...t]}term(t,e){return this.localize.term(t)||e}get validationTarget(){return this.valueInput}get value(){return this.valueHasChanged?this._value:this._value||this.defaultValue||""}set value(t){const e=this.normalizeIncomingValue(t);if(e===this._value)return;const i=this._value;this._value=e,this.valueHasChanged=!0,this.hasUpdated?this.syncSegmentsFromCanonical():this.pendingValue=this._value,this.requestUpdate("value",i)}handleSizeChange(){He(this.localName,this.size)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners()}firstUpdated(t){super.firstUpdated(t),null!=this.pendingValue?(this._value=this.pendingValue,this.pendingValue=null):!this._value&&this.defaultValue&&(this._value=this.defaultValue),this.syncSegmentsFromCanonical(),this.input=this.valueInput,this.updateV
8572alidity(),this.lastEmittedValue=this._value}updated(t){super.updated?.(t),t.has("value")&&this.customStates.set("blank",!this.value),t.has("disabled")&&this.customStates.set("disabled",this.disabled),t.has("open")&&this.customStates.set("open",this.open),(t.has("step")||t.has("hourFormat"))&&this.syncSegmentsFromCanonical(),(t.has("min")||t.has("max")||t.has("step"))&&this.updateValidity()}handleDisabledChange(){this.disabled&&this.open&&(this.open=!1)}async handleOpenChange(){if(this.open&&!this.disabled){const t=new Gd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);this.addOpenListeners(),this.popup.active=!0,await this.updateComplete,await qt(this.popup.popup,"show"),this.scrollColumnsToCurrent(),this.moveFocusToColumnOnShow&&(this.moveFocusToColumnOnShow=!1,this.focusFirstColumn()),this.dispatchEvent(new Zd)}else{const t=new Qd;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!0);this.removeOpenListeners(),await qt(this.popup.popup,"hide"),this.popup.active=!1,this.dispatchEvent(new Jd);const e=this.shadowRoot?.activeElement;e&&this.popup?.contains(e)&&this.focusActiveSegment()}}focus(t){const e=this.segmentsController.findFocusableSegment((t,e)=>null==this.segments[e]);e?.focus(t)}blur(){const t=this.shadowRoot?.activeElement;t?.blur()}async show(){this.open||this.disabled||(this.open=!0,await Nt(this,"wa-after-show"))}async hide(){this.open&&!this.disabled&&(this.open=!1,await Nt(this,"wa-after-hide"))}get valueAsDate(){const t=this.value;if(!t)return null;const e=um(t,{hour12:!1,withSeconds:this.resolvedWithSeconds});if(null==e.hour||null==e.minute)return null;const i=new Date;return i.setHours(e.hour,e.minute,e.second??0,0),i}get valueAsNumber(){const t=this.valueAsDate;return t?36e5*t.getHours()+6e4*t.getMinutes()+1e3*t.getSeconds():Number.NaN}formResetCallback(){this._value=this.defaultValue,this.valueHasChanged=!1,this.segmentsController.clearBuffers(),this.syncSegmentsFromCanonical(),super.formResetCallback(),this.lastEmittedValue=this._value,this.requestUpdate()}formStateRestoreCallback(t){"string"==typeof t&&(this._value=t,this.hasUpdated?this.syncSegmentsFromCanonical():this.pendingValue=t,this.requestUpdate()),this.updateValidity()}get resolvedLocale(){return this.localize.lang()||"en"}get isRtl(){return"rtl"===this.localize.dir()}get resolvedHour12(){return"12"===this.hourFormat||"24"!==this.hourFormat&&function(t){try{return new Intl.DateTimeFormat(t||"en",{hour:"numeric"}).resolvedOptions().hour12??!1}catch{return!1}}(this.resolvedLocale)}get resolvedWithSeconds(){return function(t){return"any"===t||!(!Number.isFinite(t)||t<=0)&&(t<60||t%60!=0)}(this.step)}getLayout(){return function(t,e){const i=`${t||"en"}|${e.hour12?12:24}|${e.withSeconds?1:0}`,o=nm.get(i);if(o)return o;const a=new Intl.DateTimeFormat(t||"en",{hour:"2-digit",minute:"2-digit",second:e.withSeconds?"2-digit":void 0,hour12:e.hour12,calendar:"gregory",numberingSystem:"latn"}),s=new Date(2026,0,1,13,45,30),n=a.formatToParts(s),r=[],l=[];for(const t of n)"hour"===t.type?(r.push({kind:"segment",field:"hour"}),l.push("hour")):"minute"===t.type?(r.push({kind:"segment",field:"minute"}),l.push("minute")):"second"===t.type?(r.push({kind:"segment",field:"second"}),l.push("second")):"dayPeriod"===t.type?(r.push({kind:"segment",field:"dayPeriod"}
8572),l.push("dayPeriod")):"literal"===t.type&&r.push({kind:"literal",text:t.value});const h=2+(e.withSeconds?1:0)+(e.hour12?1:0);if(l.length!==h){const t=[{kind:"segment",field:"hour"},{kind:"literal",text:":"},{kind:"segment",field:"minute"}],o=["hour","minute"];e.withSeconds&&(t.push({kind:"literal",text:":"}),t.push({kind:"segment",field:"second"}),o.push("second")),e.hour12&&(t.push({kind:"literal",text:" "}),t.push({kind:"segment",field:"dayPeriod"}),o.push("dayPeriod"));const a={tokens:t,order:o};return nm.set(i,a),a}const c={tokens:r,order:l};return nm.set(i,c),c}(this.resolvedLocale,{hour12:this.resolvedHour12,withSeconds:this.resolvedWithSeconds})}normalizeIncomingValue(t){if(null==t)return"";if("string"==typeof t)return t;if(t instanceof Date){const e=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return this.resolvedWithSeconds?`${e}:${i}:${o}`:`${e}:${i}`}return""}syncSegmentsFromCanonical(){this.segmentsController.clearBuffers(),this.segments=um(this._value,{hour12:this.resolvedHour12,withSeconds:this.resolvedWithSeconds}),this.updateHiddenInput()}updateHiddenInput(){this.valueInput&&(this.valueInput.value=this._value),this.setValue(this._value||null)}recomputeValue(){const t=this._value,e=function(t,e){if(!function(t,e){return!(null==t.hour||null==t.minute||e.withSeconds&&null==t.second||e.hour12&&null==t.dayPeriod)}(t,e))return"";let i=t.hour;if(e.hour12){const e=t.dayPeriod;i=12===i?0===e?0:12:1===e?i+12:i}if(i<0||i>23)return"";const o=t.minute;if(o<0||o>59)return"";const a=String(i).padStart(2,"0"),s=String(o).padStart(2,"0");if(!e.withSeconds)return`${a}:${s}`;const n=t.second;return n<0||n>59?"":`${a}:${s}:${String(n).padStart(2,"0")}`}(this.segments,{hour12:this.resolvedHour12,withSeconds:this.resolvedWithSeconds});e!==t&&(this._value=e,this.valueHasChanged=!0,this.updateHiddenInput(),this.updateValidity()),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0})),e!==this.lastEmittedValue&&(this.lastEmittedValue=e,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}addOpenListeners(){document.addEventListener("focusin",this.handleDocumentFocusIn),document.addEventListener("keydown",this.handleDocumentKeyDown),document.addEventListener("mousedown",this.handleDocumentMouseDown),Nh(this)}removeOpenListeners(){document.removeEventListener("focusin",this.handleDocumentFocusIn),document.removeEventListener("keydown",this.handleDocumentKeyDown),document.removeEventListener("mousedown",this.handleDocumentMouseDown),Hh(this)}focusActiveSegment(){const t=this.segmentsController.getActiveSegment();if(t){const e=this.segmentsController.segmentElementFor(t.group,t.field);if(e)return void e.focus({preventScroll:!0})}this.segmentsController.findFocusableSegment((t,e)=>null==this.segments[e])?.focus({preventScroll:!0})}get columnFields(){return this.getLayout().order.filter(t=>void 0!==t)}columnItemsFor(t){if("dayPeriod"===t)return[{label:this.term("am",rm(this.resolvedLocale,0)),value:0,disabled:!1},{label:this.term("pm",rm(this.resolvedLocale,1)),value:1,disabled:!1}];if("hour"===t){const t=[];if(this.resolvedHour12)for(let e=1;e<=12;e++)t.push({label:String(e).padStart(2,"0"),value:e,disabled:!1});else for(let e=0;e<=23;e++)t.push({label:String(e).padStart(2,"0"),value:e,disabled:!1});return t}const e="number"==typeof this.step&&Number.isFinite(this.step)&&this.step>0?this.step:1,i="minute"===t?e<60?1:Math.max(1,Math.floor(e/60)):Math.max(1,Math.floor(e)),o=[];for(let t=0;t<60;t+=i)o.push({label:String(t).padStart(2,"0"),value:t,disabled:!1});return o}focusFirstColumn(){if(!this.shadowRoot)return;const t=this.shadowRoot.querySelector(".column");t?.focus({preventScroll:!0})}scrollColumnsToCurrent(){if(this.shadowRoot)for(const t of this.shadowRoot.querySelectorAll(".column")){const e=t.dataset.field,i=this.segments[e];if(null==i)continue;const o=t.querySelector(`[data-value="${i}"]`);o&&this.keepItemInView(t,o)}}keepItemInView(t,e){const i=t.getBoundingClientRect(),o=e.getBoundingClientRect();o.top<i.top?t.scrollTop+=o.top-i.top:o.bottom>i.bottom&&(t.scrollTop+=o.bottom-i.bottom)}placeholderFor(t){return"--"}fieldLabelFor(t){const e="hour"===t?"Hour":"minute"===t?"Minute":"second"===t?"Second":"AM/PM";return this.term(t,e)}segmentAriaValueText(t){const e=this.segments[t],i=this.segmentsController.getBuffer(gm,t);
8572return i||(null==e?this.term("empty","Empty"):"dayPeriod"===t?0===e?this.term("am","AM"):this.term("pm","PM"):String(e))}render(){const t=this.hasUpdated?this.hasSlotController.test("label"):this.withLabel,e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,i=!!this.hasUpdated&&this.hasSlotController.test("footer"),o=!!this.label||!!t,a=!!this.hint||!!e,s=!!this._value,n=this.getLayout(),r=this.label||this.term("time","Time");return K` 8573 <div 8574 part="form-control" 8575 class=${ce({"form-control":!0,"form-control-has-label":o})} 8576 > 8577 <label 8578 id="label" 8579 part="form-control-label label" 8580 class=${ce({label:!0,"has-label":o})} 8581 aria-hidden=${o?"false":"true"} 8582 @click=${()=>this.focus()} 8583 > 8584 <slot name="label">${this.label}</slot> 8585 </label> 8586 8587 <div part="form-control-input" class="form-control-input"> 8588 <wa-popup 8589 class=${ce({"time-input-popup":!0,open:this.open})} 8590 placement=${this.placement} 8591 distance=${this.distance} 8592 ?active=${this.open} 8593 flip 8594 shift 8595 > 8596 <div 8597 part="base time-input input-wrapper" 8598 class="input-wrapper" 8599 slot="anchor" 8600 @pointerdown=${this.handleInputWrapperPointerDown} 8601 > 8602 <slot name="start" part="start" class="start"></slot> 8603 8604 <div 8605 part="input" 8606 class="segments" 8607 role="group" 8608 aria-labelledby=${o?"label":J} 8609 aria-label=${o?J:r} 8610 > 8611 ${this.renderSegmentGroup(n)} 8612 </div> 8613 8614 <span id=${this.keyboardHelpId} class="visually-hidden"> 8615 ${this.term("timeInputKeyboardHelp","Use arrow keys to change values; press Alt+Down Arrow to open the time picker.")} 8616 </span> 8617 8618 <input 8619 class="value-input" 8620 type="time" 8621 tabindex="-1" 8622 aria-hidden="true" 8623 .value=${this._value} 8624 min=${We(this.min||void 0)} 8625 max=${We(this.max||void 0)} 8626 step=${We("any"===this.step?"any":String(this.step))} 8627 ?disabled=${this.disabled} 8628 ?required=${this.required} 8629 autocomplete=${We(this.autocomplete||void 0)} 8630 /> 8631 8632 ${this.withClear&&s?K`<button 8633 part="clear-button" 8634 type="button" 8635 class="clear-button" 8636 aria-label=${this.localize.term("clearEntry")} 8637 tabindex="-1" 8638 @mousedown=${this.handleClearMouseDown} 8639 @click=${this.handleClearClick} 8640 > 8641 <slot name="clear-icon"> 8642 <wa-icon name="circle-xmark" library="system" variant="regular"></wa-icon> 8643 </slot> 8644 </button>`:J} 8645 8646 <slot name="end" part="end" class="end"></slot> 8647 8648 <button 8649 part="expand-button" 8650 type="button" 8651 class="expand-button" 8652 aria-label=${this.open?this.term("closeTimeInput","Close time picker"):this.term("chooseTime","Choose time")} 8653 aria-haspopup="dialog" 8654 aria-expanded=${this.open?"true":"false"} 8655 aria-controls=${this.popupId} 8656 ?disabled=${this.disabled} 8657 @click=${this.handleExpandButtonClick} 8658 > 8659 <slot name="expand-icon" part="expand-icon" class="expand-icon"> 8660 <wa-icon library="system" name="clock"></wa-icon> 8661 </slot> 8662 </button> 8663 </div> 8664 8665 <div 8666 id=${this.popupId} 8667 part="popup" 8668 class="popup-body" 8669 role="dialog" 8670 aria-modal="true" 8671 aria-label=${this.term("chooseTime","Choose time")} 8672 > 8673 <div part="columns" class="columns">${this.columnFields.map(t=>this.renderColumn(t))}</div> 8674 ${i?K`<div class="popup-footer"><slot name="footer"></slot></div>`:this.withNow?K`<div class="popup-footer"> 8675 <button part="now-button" type="button" class="now-button" @click=${this.handleNowClick}> 8676 ${this.term("now","Now")} 8677 </button> 8678 </div>`:J} 8679 </div> 8680 </wa-popup> 8681 </div> 8682 8683 <slot 8684 id="hint" 8685 name="hint" 8686 part="hint" 8687 class=${ce({"has-slotted":a})} 8688 aria-hidden=${a?"false":"true"} 8689 > 8690 ${this.hint} 8691 </slot> 8692 </div> 8693 `}renderSegmentGroup(t){const e=this.segmentsController.getActiveSegment();let i=!1;const o=[];
8693for(const a of t.tokens)if("literal"===a.kind)o.push(K`<span part="segment-literal" class="segment-literal" aria-hidden="true">${a.text}</span>`);else{const t=a.field,s=!i&&(null==e||e.field===t);s&&(i=!0),o.push(this.renderSegment(t,s))}return o}renderSegment(t,e){const i=this.segments[t],o=this.segmentsController.getBuffer(gm,t),a=function(t,e,i,o,a){return"dayPeriod"===t?null==e?o:rm(a,e):i?i.padStart(2,"0"):null==e?o:String(e).padStart(2,"0")}(t,i,o,this.placeholderFor(t),this.resolvedLocale),s=null==i&&!o,n="hour"===t?this.resolvedHour12?{min:1,max:12}:{min:0,max:23}:"minute"===t||"second"===t?{min:0,max:59}:{min:0,max:1},r=this.segmentAriaValueText(t);return K`<span 8694 part="segment" 8695 class=${ce({segment:!0,empty:s,[`segment-${t}`]:!0})} 8696 data-group=${gm} 8697 data-segment=${t} 8698 role="spinbutton" 8699 tabindex=${this.disabled?-1:e?0:-1} 8700 aria-label=${this.fieldLabelFor(t)} 8701 aria-valuemin=${n.min} 8702 aria-valuemax=${n.max} 8703 aria-valuenow=${We(i??void 0)} 8704 aria-valuetext=${r} 8705 aria-readonly=${this.readonly?"true":"false"} 8706 aria-disabled=${this.disabled?"true":"false"} 8707 aria-describedby=${this.keyboardHelpId} 8708 inputmode=${"dayPeriod"===t?"text":"numeric"} 8709 @keydown=${this.handleSegmentKeyDown} 8710 @focus=${this.handleSegmentFocus} 8711 @blur=${this.handleSegmentBlur} 8712 >${a}</span 8713 >`}renderColumn(t){const e=this.columnItemsFor(t),i=this.segments[t],o=null!=i?`${this.popupId}-${t}-${i}`:void 0;return K`<div 8714 part="column column-${t}" 8715 class=${ce({column:!0,[`column-${t}`]:!0})} 8716 data-field=${t} 8717 role="listbox" 8718 tabindex="0" 8719 aria-label=${this.fieldLabelFor(t)} 8720 aria-orientation="vertical" 8721 aria-activedescendant=${We(o)} 8722 @click=${this.handleColumnItemClick} 8723 @keydown=${this.handleColumnKeyDown} 8724 > 8725 ${e.map(e=>{const o=`${this.popupId}-${t}-${e.value}`,a=e.value===i;return K`<button 8726 id=${o} 8727 part="column-item ${a?"column-item-selected":""}" 8728 class="column-item" 8729 data-field=${t} 8730 data-value=${e.value} 8731 type="button" 8732 role="option" 8733 aria-selected=${a?"true":"false"} 8734 aria-disabled=${e.disabled?"true":"false"} 8735 tabindex="-1" 8736 > 8737 ${e.label} 8738 </button>`})} 8739 </div>`}};bm.css=[Ue,zh,Ju,mm],bm.shadowRootOptions={...Re.shadowRootOptions,delegatesFocus:!0},kt([Dt(".time-input-popup")],bm.prototype,"popup",2),kt([Dt(".value-input")],bm.prototype,"valueInput",2),kt([$t()],bm.prototype,"segments",2),kt([At({reflect:!0})],bm.prototype,"name",2),kt([$t()],bm.prototype,"value",1),kt([At({attribute:"value",reflect:!0})],bm.prototype,"defaultValue",2),kt([At({type:Boolean})],bm.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],bm.prototype,"required",2),kt([At({type:Boolean,reflect:!0})],bm.prototype,"readonly",2),kt([At({reflect:!0})],bm.prototype,"size",2),kt([vt("size")],bm.prototype,"handleSizeChange",1),kt([At({reflect:!0})],bm.prototype,"appearance",2),kt([At({type:Boolean,reflect:!0})],bm.prototype,"pill",2),kt([At()],bm.prototype,"label",2),kt([At({attribute:"hint"})],bm.prototype,"hint",2),kt([At()],bm.prototype,"autocomplete",2),kt([At({attribute:"with-clear",type:Boolean})],bm.prototype,"withClear",2),kt([At({attribute:"with-now",type:Boolean})],bm.prototype,"withNow",2),kt([At({attribute:"with-label",type:Boolean})],bm.prototype,"withLabel",2),kt([At({attribute:"with-hint",type:Boolean})],bm.prototype,"withHint",2),kt([At({reflect:!0})],bm.prototype,"min",2),kt([At({reflect:!0})],bm.prototype,"max",2),kt([At({converter:{fromAttribute:function(t){if(null==t)return 60;if("any"===t)return"any";const e=Number(t);return Number.isFinite(e)&&e>0?e:60},toAttribute:function(t){return"any"===t?"any":String(t)}}})],bm.prototype,"step",2),kt([At({attribute:"hour-format",reflect:!0})],bm.prototype,"hourFormat",2),kt([At({type:Boolean,reflect:!0})],bm.prototype,"open",2),kt([At({reflect:!0})],bm.prototype,"placement",2),kt([At({type:Number,reflect:!0})],bm.prototype,"distance",2),kt([vt("disabled",{waitUntilFirstUpdate:!0})],bm.prototype,"handleDisabledChange",1),kt([vt("open",{waitUntilFirstUpdate:!0})],bm.prototype,"handleOpenChange",1),bm=kt([St("wa-time-input")],bm);var vm=h` 8740 :host { 8741 --gap: var(--wa-space-s); 8742 --width: 28rem; 8743 --reorder-duration: var(--wa-transition-normal); 8744 8745 display: flex; 8746 flex-direction: column; 8747 position: fixed; 8748 width: var(--width); 8749 height: 100dvh; 8750 max-height: 100dvh; 8751 margin: 0; 8752 padding: var(--wa-space-m); 8753 overflow-y: auto; 8754 gap: var(--gap); 8755 border: none; 8756 background: transparent; 8757 pointer-events: none; 8758 scrollbar-width: thin; 8759 8760 /* Reset inset properties so placement changes work correctly */ 8761 inset-block-start: auto; 8762 inset-block-end: auto; 8763 inset-inline-start: auto; 8764 inset-inline-end: auto; 8765 translate: none;
8766 align-content: normal; 8767 justify-content: normal; 8768 } 8769 8770 :host(:not(:popover-open)) { 8771 display: none; 8772 } 8773 8774 /* Placement positioning using logical properties for RTL support */ 8775 :host([placement='top-start']) { 8776 inset-block-start: 0; 8777 inset-inline-start: 0; 8778 } 8779 8780 :host([placement='top-center']) { 8781 inset-block-start: 0; 8782 inset-inline-start: 50%; 8783 translate: -50% 0; 8784 } 8785 8786 :host([placement='top-end']) { 8787 inset-block-start: 0; 8788 inset-inline-start: auto; 8789 inset-inline-end: 0; 8790 } 8791 8792 :host([placement='bottom-start']) { 8793 inset-block-end: 0; 8794 inset-inline-start: 0; 8795 align-content: end; 8796 } 8797 8798 :host([placement='bottom-center']) { 8799 inset-block-end: 0; 8800 inset-inline-start: 50%; 8801 translate: -50% 0; 8802 align-content: end; 8803 } 8804 8805 :host([placement='bottom-end']) { 8806 inset-block-end: 0; 8807 inset-inline-start: auto; 8808 inset-inline-end: 0; 8809 align-content: end; 8810 } 8811 8812 /* Bottom placements: justify content to end */ 8813 :host([placement^='bottom']) { 8814 justify-content: end; 8815 } 8816 8817 .stack { 8818 display: flex; 8819 flex-direction: column; 8820 gap: var(--gap); 8821 width: 100%; 8822 pointer-events: auto; 8823 } 8824 8825 /* Bottom placements: reverse stack order so newest appears at bottom */ 8826 :host([placement^='bottom']) .stack { 8827 flex-direction: column-reverse; 8828 } 8829 8830 /* Mobile: full width */ 8831 @media (max-width: 480px) { 8832 :host { 8833 width: 100%; 8834 padding: var(--wa-space-s); 8835 } 8836 } 8837`,wm=null,ym=0;var xm=class extends Ft{constructor(){super(...arguments),this.activatedToastItems=new WeakSet,this.positionCache=new Map,this.placement="top-end",this.handleDocumentKeyDown=async t=>{if(await new Promise(t=>setTimeout(t)),"Escape"===t.key&&!t.defaultPrevented){const e=this.getToastItems();if(e.length>0){t.preventDefault();const i=e[e.length-1];i?.hide()}}},this.handleAfterHide=async t=>{const e=t.target;e.parentElement===this&&(this.capturePositions(),e.remove(),await this.animatePositions()),0===this.getToastItems().length&&this.hideStack()}}connectedCallback(){super.connectedCallback(),this.popover="manual",function(){if(ym+=1,wm||"undefined"==typeof document)return;const t=document.createElement("div");t.id=Wh("wa-toast-live-region-"),t.setAttribute("data-wa-toast-live-region",""),t.style.cssText="\n position: absolute;\n width: 1px;\n height: 1px;\n overflow: hidden;\n white-space: nowrap;\n clip-path: inset(50%);\n pointer-events: none;\n top: 0;\n left: 0;\n ",document.body.append(t),wm=t}(),document.addEventListener("keydown",this.handleDocumentKeyDown)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener?.("keydown",this.handleDocumentKeyDown),(ym=Math.max(0,ym-1))>0||(wm?.remove(),wm=null)}handleSlotChange(){const t=this.getToastItems(),e=[];t.forEach(t=>{this.activatedToastItems.has(t)||e.push(t)}),e.length>0&&(this.capturePositions(),e.forEach(t=>{this.activatedToastItems.add(t),this.showStack(),t.startTimer(),this.announceToastItem(t)}),requestAnimationFrame(()=>this.animatePositions()))}announceToastItem(t){!function(t,e){if("undefined"==typeof document)return;const i=wm;if(!i)return;const o=t.trim();if(!o)return;const a=document.createElement("div");a.setAttribute("role","danger"===e?"alert":"status"),a.setAttribute("aria-live","danger"===e?"assertive":"polite"),a.setAttribute("aria-atomic","true"),i.append(a),requestAnimationFrame(()=>{requestAnimationFrame(()=>{a.textContent=o})}),setTimeout(()=>a.remove(),1e3)}(t.textContent??"",t.variant)}getToastItems(){return[...this.querySelectorAll(":scope > wa-toast-item")]}capturePositions(){this.positionCache.clear();for(const t of this.getToastItems())this.positionCache.set(t,t.getBoundingClientRect())}async animatePositions(){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return void this.positionCache.clear();const t=[];for(const e of this.getToastItems()){const i=this.positionCache.get(e);if(!i)continue;const o=e.getBoundingClientRect(),a=i.top-o.top;if(Math.abs(a)>1){const i=Ht(e,[{transform:`translateY(${a}px)`},{transform:"translateY(0)"}],{duration:200,easing:"cubic-bezier(0.2, 0, 0, 1)"});t.push(i)}}this.positionCache.clear(),await Promise.all(t)}showStack(){this.matches(":popover-open")||(this.showPopover(),this.customStates.set("visible",!0))}hideStack(){this.matches(":popover-open")&&(this.hidePopover(),this.customStates.set("visible",!1))}async create(t,e){const i={allowHtml:!1,duration:5e3,variant:"neutral",size:"m",...e},o=document.createElement("wa-toast-item");if(o.variant=i.variant,o.size=i.size,o.duration=i.duration,i.allowHtml?o.innerHTML=t:o.textContent=t,i.icon){const t=document.createElement("wa-icon");t.setAttribute("slot","icon"),"string"==typeof i.icon?t.setAttribute("name",i.icon):(t.setAttribute("name",i.icon.name),i.icon.library&&t.setAttribute("library",i.icon.library),i.icon.family&&t.setAttribute("family",i.icon.family),i.icon.variant&&t.setAttribute("variant",i.icon.variant)),o.prepend(t)}return this.activatedToastItems.add(o),this.capturePositions(),this.showStack(),this.prepend(o),await o.updateComplete,this.animatePositions(),o.startTimer(),this.announceToastItem(o),o}render(){return K` 8838 <div part="stack" class="stack" @wa-after-hide=${this.handleAfterHide}>
8839 <slot @slotchange=${this.handleSlotChange}></slot> 8840 </div> 8841 `}};xm.css=vm,kt([Dt(".stack")],xm.prototype,"stack",2),kt([At({reflect:!0})],xm.prototype,"placement",2),xm=kt([St("wa-toast")],xm);var km=h` 8842 :host { 8843 --accent-width: 4px; 8844 --show-duration: var(--wa-transition-normal); 8845 --hide-duration: var(--wa-transition-normal); 8846 --accent-color: var(--wa-color-fill-loud); 8847 8848 display: block; 8849 pointer-events: auto; 8850 } 8851 8852 /* Sizes */ 8853 :host([size='xs']) { 8854 --padding: var(--wa-space-xs); 8855 } 8856 :host([size='s']), 8857 :host([size='small']) { 8858 --padding: var(--wa-space-s); 8859 } 8860 :host([size='m']), 8861 :host([size='medium']) { 8862 --padding: var(--wa-space-m); 8863 } 8864 :host([size='l']), 8865 :host([size='large']) { 8866 --padding: var(--wa-space-l); 8867 } 8868 :host([size='xl']) { 8869 --padding: var(--wa-space-xl); 8870 } 8871 8872 .toast-item { 8873 display: flex; 8874 align-items: stretch; 8875 background: var(--wa-color-surface-raised); 8876 border: var(--wa-border-width-s) solid var(--wa-color-surface-border); 8877 border-radius: var(--wa-border-radius-m); 8878 box-shadow: var(--wa-shadow-l); 8879 overflow: hidden; 8880 } 8881 8882 /* Animations */ 8883 .toast-item.show { 8884 animation: toast-show var(--show-duration) var(--wa-transition-easing) forwards; 8885 } 8886 8887 .toast-item.hide { 8888 animation: toast-hide var(--hide-duration) var(--wa-transition-easing) forwards; 8889 } 8890 8891 @keyframes toast-show { 8892 from { 8893 opacity: 0; 8894 translate: 0 -0.5rem; 8895 } 8896 to { 8897 opacity: 1; 8898 translate: 0; 8899 } 8900 } 8901 8902 @keyframes toast-hide { 8903 from { 8904 opacity: 1; 8905 translate: 0; 8906 } 8907 to { 8908 opacity: 0; 8909 translate: 0 -0.5rem; 8910 } 8911 } 8912 8913 /* Accent line */ 8914 .accent { 8915 flex: 0 0 auto; 8916 width: var(--accent-width); 8917 background: var(--accent-color); 8918 } 8919 8920 /* Icon - only show if slot has content */ 8921 .icon { 8922 display: flex;
8923 align-items: center; 8924 padding: var(--padding); 8925 padding-inline-end: 0; 8926 color: var(--accent-color); 8927 font-size: 1.25em; 8928 } 8929 8930 .toast-item:not(.toast-item--has-icon) .icon { 8931 display: none; 8932 } 8933 8934 /* Content */ 8935 .content { 8936 flex: 1 1 auto; 8937 align-self: center; 8938 min-width: 0; 8939 padding: var(--padding); 8940 color: var(--wa-color-text-normal); 8941 } 8942 8943 /* Close button */ 8944 .close-button { 8945 flex: 0 0 auto; 8946 display: flex; 8947 align-items: center; 8948 justify-content: center; 8949 align-self: stretch; 8950 padding-inline: var(--padding); 8951 background: transparent; 8952 border: none; 8953 border-start-end-radius: var(--border-radius); 8954 border-end-end-radius: var(--border-radius); 8955 color: var(--wa-color-neutral-on-quiet); 8956 font-size: inherit; 8957 cursor: pointer; 8958 transition: background-color var(--wa-transition-fast); 8959 8960 @media (hover: hover) { 8961 &:hover { 8962 color: color-mix(in oklab, currentColor, var(--wa-color-mix-hover)); 8963 } 8964 } 8965 8966 &:focus { 8967 outline: none; 8968 } 8969 8970 &:focus-visible { 8971 outline: var(--wa-focus-ring); 8972 outline-offset: calc(var(--wa-focus-ring-width) * -1); 8973 } 8974 } 8975 8976 /* Progress ring styling */ 8977 wa-progress-ring { 8978 --size: var(--wa-form-control-height); 8979 --track-width: 0.125rem; 8980 --indicator-width: 0.125rem; 8981 --track-color: var(--wa-color-neutral-fill-quiet); 8982 --indicator-color: var(--accent-color); 8983 --indicator-transition-duration: 50ms; 8984 } 8985 8986 /* Hide progress ring indicator when no duration */ 8987 .toast-item:not(.toast-item--has-duration) wa-progress-ring { 8988 --track-color: transparent; 8989 --indicator-color: transparent; 8990 } 8991 8992 /* Reduced motion */ 8993 @media (prefers-reduced-motion: reduce) { 8994 .toast-item.show, 8995 .toast-item.hide { 8996 animation: none; 8997 } 8998 } 8999`,Cm=class extends Ft{constructor(){super(...arguments),this.hasSlotController=new qe(this,"icon"),this.localize=new ie(this),this.animationFrame=null,this.startTime=null,this.isHovering=!1,this.isFocused=!1,this.timeLeft=100,this.variant="neutral",this.size="m",this.duration=5e3,this.withIcon=!1,this.tick=()=>{if(!this.startTime)return;const t=performance.now()-this.startTime,e=Math.min(t/this.duration,1);this.timeLeft=100*(1-e),e<1?this.animationFrame=requestAnimationFrame(this.tick):this.hide()},this.handlePointerEnter=t=>{"mouse"!==t.pointerType&&"pen"!==t.pointerType||(this.isHovering=!0,this.pauseTimer())},this.handlePointerLeave=()=>{this.isHovering&&(this.isHovering=!1,this.resumeTimer())},this.handleFocusIn=()=>{this.isFocused=!0,this.pauseTimer()},this.handleFocusOut=()=>{this.isFocused=!1,this.resumeTimer()}}handleSizeChange(){He(this.localName,this.size)}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",this.handlePointerEnter),this.addEventListener("pointerleave",this.handlePointerLeave)}disconnectedCallback(){super.disconnectedCallback(),this.stopTimer(),this.removeEventListener("pointerenter",this.handlePointerEnter),this.removeEventListener("pointerleave",this.handlePointerLeave)}async startTimer(){const t=new Gd;this.dispatchEvent(t),t.defaultPrevented||(await this.updateComplete,await qt(this.toastItemElement,"show"),this.dispatchEvent(new Zd),this.duration>0&&Number.isFinite(this.duration)&&(this.startTime=performance.now(),this.timeLeft=100,this.tick()))}stopTimer(){null!==this.animationFrame&&(cancelAnimationFrame(this.animationFrame),this.animationFrame=null)}async hide(){this.stopTimer();const t=new Qd;this.dispatchEvent(t),t.defaultPrevented||(await qt(this.toastItemElement,"hide"),this.dispatchEvent(new Jd),this.remove())}handleCloseClick(){this.hide()}pauseTimer(){this.stopTimer(),this.timeLeft=100}resumeTimer(){!this.isHovering&&!this.isFocused&&this.duration>0&&(this.startTime=performance.now(),this.tick())}render(){const t=this.hasUpdated?this.hasSlotController.test("icon"):this.withIcon,e=this.duration>0;return K` 9000 <div 9001 part="toast-item" 9002 class=${ce({"toast-item":!0,"toast-item--has-icon":t,"toast-item--has-duration":e})} 9003 > 9004 <div part="accent" class="accent"></div> 9005 9006 <div part="icon" class="icon"> 9007 <slot name="icon"></slot> 9008 </div> 9009
9010 <div part="content" class="content"> 9011 <slot></slot> 9012 </div> 9013 9014 <button 9015 part="close-button" 9016 class="close-button" 9017 type="button" 9018 aria-label=${this.localize.term("close")} 9019 @click=${this.handleCloseClick} 9020 @focusin=${this.handleFocusIn} 9021 @focusout=${this.handleFocusOut} 9022 > 9023 <wa-progress-ring 9024 part="progress-ring" 9025 exportparts=" 9026 base:progress-ring__base, 9027 label:progress-ring__label, 9028 track:progress-ring__track, 9029 indicator:progress-ring__indicator 9030 " 9031 value=${this.timeLeft} 9032 aria-hidden="true" 9033 > 9034 <wa-icon 9035 part="close-icon" 9036 exportparts="svg:close-icon__svg" 9037 name="xmark" 9038 library="system" 9039 variant="solid" 9040 ></wa-icon> 9041 </wa-progress-ring> 9042 </button> 9043 </div> 9044 `}};Cm.css=[km,Te,Ue],kt([Dt(".toast-item")],Cm.prototype,"toastItemElement",2),kt([$t()],Cm.prototype,"timeLeft",2),kt([At({reflect:!0})],Cm.prototype,"variant",2),kt([At({reflect:!0})],Cm.prototype,"size",2),kt([vt("size")],Cm.prototype,"handleSizeChange",1),kt([At({type:Number})],Cm.prototype,"duration",2),kt([At({attribute:"with-icon",type:Boolean})],Cm.prototype,"withIcon",2),Cm=kt([St("wa-toast-item")],Cm);var Sm=h` 9045 :host { 9046 --size: 8rem; 9047 --track-width: 0.25em; /* avoid using rems here */ 9048 --track-color: var(--wa-color-neutral-fill-normal); 9049 --indicator-width: var(--track-width); 9050 --indicator-color: var(--wa-color-brand-fill-loud); 9051 --indicator-transition-duration: 0.35s; 9052 9053 display: inline-flex; 9054 } 9055 9056 .progress-ring { 9057 display: inline-flex;
9058 align-items: center; 9059 justify-content: center; 9060 position: relative; 9061 } 9062 9063 .image { 9064 width: var(--size); 9065 height: var(--size); 9066 rotate: -90deg; 9067 transform-origin: 50% 50%; 9068 } 9069 9070 .track, 9071 .indicator { 9072 --radius: calc(var(--size) / 2 - max(var(--track-width), var(--indicator-width)) * 0.5); 9073 --circumference: calc(var(--radius) * 2 * 3.141592654); 9074 9075 fill: none; 9076 r: var(--radius); 9077 cx: calc(var(--size) / 2); 9078 cy: calc(var(--size) / 2); 9079 } 9080 9081 .track { 9082 stroke: var(--track-color); 9083 stroke-width: var(--track-width); 9084 } 9085 9086 .indicator { 9087 stroke: var(--indicator-color); 9088 stroke-width: var(--indicator-width); 9089 stroke-linecap: round; 9090 transition-property: stroke-dashoffset; 9091 transition-duration: var(--indicator-transition-duration); 9092 stroke-dasharray: var(--circumference) var(--circumference); 9093 stroke-dashoffset: calc(var(--circumference) - var(--percentage) * var(--circumference)); 9094 } 9095 9096 .label { 9097 display: flex; 9098 align-items: center; 9099 justify-content: center; 9100 position: absolute; 9101 top: 0; 9102 left: 0; 9103 width: 100%; 9104 height: 100%; 9105 text-align: center; 9106 user-select: none; 9107 -webkit-user-select: none; 9108 } 9109`,_m=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.value=0,this.label=""}updated(t){if(super.updated(t),t.has("value")){const t=parseFloat(getComputedStyle(this.indicator).getPropertyValue("r")),e=2*Math.PI*t,i=e-this.value/100*e;this.indicatorOffset=`${i}px`}}render(){return K` 9110 <div 9111 part="base progress-ring" 9112 class="progress-ring" 9113 role="progressbar" 9114 aria-label=${this.label.length>0?this.label:this.localize.term("progress")} 9115 aria-describedby="label" 9116 aria-valuemin="0" 9117 aria-valuemax="100" 9118 aria-valuenow="${this.value}" 9119 style=${fc({"--percentage":this.value/100})} 9120 > 9121 <svg class="image"> 9122 <circle part="track" class="track"></circle> 9123 <circle 9124 part="indicator" 9125 class="indicator" 9126 style=${fc({"stroke-dashoffset":this.indicatorOffset})} 9127 ></circle> 9128 </svg> 9129 9130 <slot id="label" part="label" class="label"></slot> 9131 </div> 9132 `}};_m.css=Sm,kt([Dt(".indicator")],_m.prototype,"indicator",2),kt([$t()],_m.prototype,"indicatorOffset",2),kt([At({type:Number,reflect:!0})],_m.prototype,"value",2),kt([At()],_m.prototype,"label",2),_m=kt([St("wa-progress-ring")],_m),_m.disableWarning?.("change-in-update");var Em=class extends Event{constructor(t){super("wa-selection-change",{bubbles:!0,cancelable:!1,composed:!0}),this.detail=t}},Am=class extends Event{constructor(){super("wa-lazy-load",{bubbles:!0,cancelable:!1,composed:!0})}},$m=class extends Event{constructor(){super("wa-lazy-change",{bubbles:!0,cancelable:!1,composed:!0})}},Lm=class extends Event{constructor(){super("wa-expand",{bubbles:!0,cancelable:!1,composed:!0})}},Dm=class extends Event{constructor(){super("wa-collapse",{bubbles:!0,cancelable:!1,composed:!0})}},Mm=class extends Event{constructor(){super("wa-after-collapse",{bubbles:!0,cancelable:!1,composed:!0})}},zm=class extends Event{constructor(){super("wa-after-expand",{bubbles:!0,cancelable:!1,composed:!0})}},Tm=h` 9133 :host { 9134 /* Private - set by the component to control indentation depth */ 9135 --indent: 0px; 9136 --show-duration: var(--wa-transition-normal); 9137 --hide-duration: var(--wa-transition-normal); 9138 9139 display: block; 9140 color: var(--wa-color-text-normal); 9141 outline: 0; 9142 z-index: 0; 9143 } 9144 9145 :host(:focus) { 9146 outline: none; 9147 } 9148 9149 slot:not([name])::slotted(wa-icon) { 9150 margin-inline-end: 0.5em; 9151 } 9152 9153 .tree-item { 9154 position: relative; 9155 display: flex;
9156 align-items: stretch; 9157 flex-direction: column; 9158 cursor: default; 9159 user-select: none; 9160 -webkit-user-select: none; 9161 } 9162 9163 .checkbox { 9164 line-height: var(--wa-form-control-value-line-height); 9165 pointer-events: none; 9166 } 9167 9168 .expand-button, 9169 .checkbox, 9170 .label { 9171 font-family: inherit; 9172 font-size: inherit; 9173 font-weight: inherit; 9174 } 9175 9176 .checkbox::part(base) { 9177 display: flex; 9178 align-items: center; 9179 } 9180 9181 .indentation { 9182 display: block; 9183 width: var(--indent); 9184 flex-shrink: 0; 9185 } 9186 9187 .expand-button { 9188 display: flex; 9189 align-items: center; 9190 justify-content: center; 9191 color: var(--wa-color-text-quiet); 9192 width: 2em; 9193 height: 2em; 9194 flex-shrink: 0; 9195 cursor: pointer; 9196 } 9197 9198 .expand-button { 9199 transition: rotate var(--wa-transition-normal) var(--wa-transition-easing); 9200 } 9201 9202 .tree-item-expanded .expand-button { 9203 rotate: 90deg; 9204 } 9205 9206 .tree-item-expanded:dir(rtl) .expand-button { 9207 rotate: -90deg; 9208 } 9209 9210 .tree-item-expanded:not(.tree-item-loading) slot[name='expand-icon'], 9211 .tree-item:not(.tree-item-expanded) slot[name='collapse-icon'] { 9212 display: none; 9213 } 9214 9215 .tree-item:not(.tree-item-has-expand-button):not(.tree-item-loading) .expand-icon-slot { 9216 display: none; 9217 } 9218 9219 .tree-item:not(.tree-item-has-expand-button):not(.tree-item-loading) .expand-button { 9220 cursor: default; 9221 } 9222 9223 .tree-item-loading .expand-icon-slot wa-icon { 9224 display: none; 9225 } 9226 9227 .expand-button-visible { 9228 cursor: pointer; 9229 } 9230 9231 .item { 9232 display: flex;
9233 align-items: center; 9234 border-inline-start: solid 0.1875em transparent; 9235 } 9236 9237 :host([disabled]) .item { 9238 opacity: 0.5; 9239 outline: none; 9240 cursor: not-allowed; 9241 } 9242 9243 :host(:focus-visible) .item { 9244 outline: var(--wa-focus-ring); 9245 outline-offset: var(--wa-focus-ring-offset); 9246 z-index: 2; 9247 } 9248 9249 :host(:not([aria-disabled='true'])) .tree-item-selected .item { 9250 background-color: var(--wa-color-neutral-fill-quiet); 9251 border-inline-start-color: var(--wa-color-brand-fill-loud); 9252 } 9253 9254 :host(:not([aria-disabled='true'])) .expand-button { 9255 color: var(--wa-color-text-quiet); 9256 } 9257 9258 .label { 9259 display: flex; 9260 align-items: center; 9261 transition: color var(--wa-transition-normal) var(--wa-transition-easing); 9262 } 9263 9264 .children { 9265 display: block; 9266 } 9267 9268 /* Indentation lines */ 9269 .children { 9270 position: relative; 9271 } 9272 9273 .children::before { 9274 content: ''; 9275 position: absolute; 9276 top: var(--indent-guide-offset); 9277 bottom: var(--indent-guide-offset); 9278 inset-inline-start: calc(0.1875em + var(--indent) + 1em - (var(--indent-guide-width) / 2)); 9279 border-inline-end: var(--indent-guide-width) var(--indent-guide-style) var(--indent-guide-color); 9280 z-index: 1; 9281 } 9282 9283 @media (forced-colors: active) { 9284 :host(:not([aria-disabled='true'])) .tree-item-selected .item { 9285 outline: dashed 1px SelectedItem; 9286 } 9287 } 9288`;class Om extends Event{constructor(t,e,i,o){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=i,this.subscribe=o??!1}}class Pm{constructor(t,e,i,o){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,e)=>{this.unsubscribe&&(this.unsubscribe!==e&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,e)),this.unsubscribe=e},this.host=t,void 0!==e.context){const t=e;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=e,this.callback=i,this.subscribe=o??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Om(this.context,this.host,this.t,this.subscribe))}}class Fm{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const i=e||!Object.is(t,this.o);this.o=t,i&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:e}]of this.subscriptions)t(this.o,e)},void 0!==t&&(this.value=t)}addCallback(t,e,i){if(!i)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:o}=this.subscriptions.get(t);t(this.value,o)}clearCallbacks(){this.subscriptions.clear()}}class Im extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}}class Rm extends Fm{constructor(t,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const e=t.contextTarget??t.composedPath()[0];e!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,e,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context)return;if((t.contextTarget??t.composedPath()[0])===this.host)return;const e=new Set;for(const[t,{consumerHost:i}]of this.subscriptions)e.has(t)||(e.add(t),i.dispatchEvent(new Om(this.context,i,t,!0)));t.stopPropagation()},this.host=t,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new Im(this.context,this.host))}}function Vm(t,e,i){return t?e(t):i?.(t)}var Bm="wa-tree-item",Nm=class extends Ft{constructor(){super(...arguments),this.localize=new ie(this),this.indeterminate=!1,this.isLeaf=!1,this.loading=!1,this.selectable=!1,this.expanded=!1,this.selected=!1,this.disabled=!1,this.lazy=!1,this._treeItemContext={depth:0,expanded:this.expanded},this._parentTreeContext=null,this.animationGeneration=0,this.tabIndex=-1,this.role="treeitem"}static isTreeItem(t){const e=t;return e&&("treeitem"===e.role||"treeitem"===e.getAttribute?.("role"))}connectedCallback(){super.connectedCallback(),this.setAttribute("role","treeitem"),this.setAttribute("tabIndex",this.tabIndex.toString()),this.isNestedItem()&&(this.setAttribute("slot","children"),this._parentTreeContext?.expanded||(this.expanded=!1)),this._parentTreeContext&&(this._treeItemContext={depth:this._parentTreeContext.depth+1,expanded:this.expanded}),this.updateIndentation()}firstUpdated(t){super.firstUpdated(t),this.childrenContainer.hidden=!this.expanded,this.childrenContainer.style.height=this.expanded?"auto":"0",this.isLeaf=!this.lazy&&0===this.getChildrenItems().length,this.handleExpandedChange()}async animateCollapse(t){this.dispatchEvent(new Dm);const e=Ut(getComputedStyle(this.childrenContainer).getPropertyValue("--hide-duration"));await Ht(this.childrenContainer,[{height:`${this.childrenContainer.scrollHeight}px`,opacity:"1",overflow:"hidden"},{height:"0",opacity:"0",overflow:"hidden"}],{duration:e,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}),this.animationGeneration===t&&(this.childrenContainer.hidden=!0,this.dispatchEvent(new Mm))}isNestedItem(){if(null!==this._parentTreeContext)return!0;const t=this.parentElement;return!!t&&Nm.isTreeItem(t)}updateIndentation(){const t=Math.max(this._treeItemContext?.depth||0,this.getDepth());this.setStyleProperty("--indent",`calc(${t} * var(--indent-size, 2em))`)}getDepth(){let t=0,e=this.parentElement;for(;e;)Nm.isTreeItem(e)&&t++,e=e.parentElement;return t}handleChildrenSlotChange(){this.loading=!1,this.isLeaf=!this.lazy&&0===this.getChildrenItems().length}willUpdate(t){t.has("selected")&&!t.has("indeterminate")&&(this.indeterminate=!1),super.willUpdate(t)}async animateExpand(t){this.dispatchEvent(new Lm),this.childrenContainer.hidden=!1;const e=Ut(getComputedStyle(this.childrenContainer).getPropertyValue("--show-duration"));await Ht(this.childrenContainer,[{height:"0",opacity:"0",overflow:"hidden"},{height:`${this.childrenContainer.scrollHeight}px`,opacity:"1",overflow:"hidden"}],{duration:e,easing:"cubic-bezier(0.4, 0.0, 0.2, 1)"}),this.animationGeneration===t&&(this.childrenContainer.style.height="auto",this.dispatchEvent(new zm))}handleLoadingChange(){this.setAttribute("aria-busy",this.loading?"true":"false"),this.loading||this.animateExpand(this.animationGeneration)}handleDisabledChange(){this.customStates.set("disabled",this.disabled),this.setAttribute("aria-disabled",this.disabled?"true":"false")}handleExpandedState(){this.customStates.set("expanded",this.expanded)}handleIndeterminateStateChange(){this.customStates.set("indeterminate",this.indeterminate)}handleSelectedChange(){this.customStates.set("selected",this.selected),this.setAttribute("aria-selected",this.selected?"true":"false")}handleExpandedChange(){this.isLeaf?this.removeAttribute("aria-expanded"):this.setAttribute("aria-expanded",this.expanded?"true":"false")}handleExpandAnimation(){this.animationGeneration++;const t=this.animationGeneration;this.expanded?this.lazy?(this.loading=!0,this.dispatchEvent(new Am)):this.animateExpand(t):this.animateCollapse(t)}handleLazyChange(){this.dispatchEvent(new $m)}
9288getChildrenItems({includeDisabled:t=!0}={}){return this.childrenSlot?[...this.childrenSlot.assignedElements({flatten:!0})].filter(e=>Nm.isTreeItem(e)&&(t||!e.disabled)):[]}render(){const t="rtl"===this.localize.dir(),e=!this.loading&&(!this.isLeaf||this.lazy);return K` 9289 <div 9290 part="base tree-item" 9291 class="${ce({"tree-item":!0,"tree-item-expanded":this.expanded,"tree-item-selected":this.selected,"tree-item-leaf":this.isLeaf,"tree-item-loading":this.loading,"tree-item-has-expand-button":e})}" 9292 > 9293 <div class="item" part="item"> 9294 <div class="indentation" part="indentation"></div> 9295 9296 <div 9297 part="expand-button" 9298 class=${ce({"expand-button":!0,"expand-button-visible":e})} 9299 aria-hidden="true" 9300 > 9301 <slot class="expand-icon-slot" name="expand-icon"> 9302 ${Vm(this.loading,()=>K` <wa-spinner part="spinner" exportparts="base:spinner__base"></wa-spinner> `,()=>K` 9303 <wa-icon name=${t?"chevron-left":"chevron-right"} library="system" variant="solid"></wa-icon> 9304 `)} 9305 </slot> 9306 <slot class="expand-icon-slot" name="collapse-icon"> 9307 <wa-icon name=${t?"chevron-left":"chevron-right"} library="system" variant="solid"></wa-icon> 9308 </slot> 9309 </div> 9310 9311 ${Vm(this.selectable,()=>K` 9312 <wa-checkbox 9313 part="checkbox" 9314 exportparts=" 9315 base:checkbox__base, 9316 control:checkbox__control, 9317 checked-icon:checkbox__checked-icon, 9318 indeterminate-icon:checkbox__indeterminate-icon, 9319 label:checkbox__label 9320 " 9321 class="checkbox" 9322 ?disabled="${this.disabled}" 9323 ?checked="${Th(this.selected)}" 9324 ?indeterminate="${this.indeterminate}" 9325 tabindex="-1" 9326 ></wa-checkbox> 9327 `)} 9328 9329 <slot class="label" part="label"></slot> 9330 </div> 9331 9332 <div class="children" part="children" role="group" ?hidden=${!this.expanded&&!this.isConnected}> 9333 <slot name="children" @slotchange="${this.handleChildrenSlotChange}"></slot> 9334 </div> 9335 </div> 9336 `}};Nm.css=Tm,kt([$t()],Nm.prototype,"indeterminate",2),kt([$t()],Nm.prototype,"isLeaf",2),kt([$t()],Nm.prototype,"loading",2),kt([$t()],Nm.prototype,"selectable",2),kt([At({type:Boolean,reflect:!0})],Nm.prototype,"expanded",2),kt([At({type:Boolean,reflect:!0})],Nm.prototype,"selected",2),kt([At({type:Boolean,reflect:!0})],Nm.prototype,"disabled",2),kt([At({type:Boolean,reflect:!0})],Nm.prototype,"lazy",2),kt([function({context:t}){return(e,i)=>{const o=new WeakMap;if("object"==typeof i)return{get(){return e.get.call(this)},set(t){return o.get(this).setValue(t),e.set.call(this,t)},init(e){return o.set(this,new Rm(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(e=>{o.set(e,new Rm(e,{context:t}))});const a=Object.getOwnPropertyDescriptor(e,i);let s;if(void 0===a){const t=new WeakMap;s={get(){return t.get(this)},set(e){o.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=a.set;s={...a,set(e){o.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(e,i,s)}}}({context:Bm})],Nm.prototype,"_treeItemContext",2),kt([function({context:t,subscribe:e}){return(i,o)=>{"object"==typeof o?o.addInitializer(function(){new Pm(this,{context:t,callback:t=>{i.set.call(this,t)},subscribe:e})}):i.constructor.addInitializer(i=>{new Pm(i,{context:t,callback:t=>{i[o]=t},subscribe:e})})}}({context:Bm,subscribe:!1})],Nm.prototype,"_parentTreeContext",2),kt([Dt("slot:not([name])")],Nm.prototype,"defaultSlot",2),kt([Dt("slot[name=children]")],Nm.prototype,"childrenSlot",2),kt([Dt(".item")],Nm.prototype,"itemElement",2),kt([Dt(".children")],Nm.prototype,"childrenContainer",2),kt([Dt(".expand-button slot")],Nm.prototype,"expandButtonSlot",2),kt([At({reflect:!0,type:Number,attribute:"tabindex"})],Nm.prototype,"tabIndex",2),kt([At({reflect:!0})],Nm.prototype,"role",2),kt([vt("loading",{waitUntilFirstUpdate:!0})],Nm.prototype,"handleLoadingChange",1),kt([vt("disabled")],Nm.prototype,"handleDisabledChange",1),kt([vt("expanded")],Nm.prototype,"handleExpandedState",1),kt([vt("indeterminate")],Nm.prototype,"handleIndeterminateStateChange",1),kt([vt("selected")],Nm.prototype,"handleSelectedChange",1),kt([vt("expanded",{waitUntilFirstUpdate:!0})],Nm.prototype,"handleExpandedChange",1),kt([vt("expanded",{waitUntilFirstUpdate:!0})],Nm.prototype,"handleExpandAnimation",1),kt([vt("lazy",{waitUntilFirstUpdate:!0})],Nm.prototype,"handleLazyChange",1),Nm=kt([St("wa-tree-item")],Nm),Nm.disableWarning?.("change-in-update");var Hm=h` 9337 :host { 9338 /* 9339 * These are actually used by tree item, but we define them here so they can more easily be set and all tree items 9340 * stay consistent. 9341 */ 9342 --indent-guide-color: var(--wa-color-surface-border); 9343 --indent-guide-offset: 0; 9344 --indent-guide-style: solid; 9345 --indent-guide-width: 0; 9346 --indent-size: 2em; 9347 9348 display: block; 9349 } 9350`;function qm(t,e=!1){function i(t){const e=t.getChildrenItems({includeDisabled:!1});if(e.length){const i=e.every(t=>t.selected),o=e.every(t=>!t.selected&&!t.indeterminate);t.selected=i,t.indeterminate=!i&&!o}}!function t(o){for(const i of o.getChildrenItems())i.selected=e?o.selected||i.selected:!i.disabled&&o.selected,t(i);e&&i(o)}(t),function t(e){const o=e.parentElement;Nm.isTreeItem(o)&&(i(o),t(o))}(t)}var Um=class extends Ft{constructor(){super(),this.selection="single",this.clickTarget=null,this.localize=new ie(this),this.tabIndex=0,this.role="tree",this.initTreeItem=t=>{t.updateComplete.then(()=>{t.selectable="multiple"===this.selection||"leaf-multiple"===this.selection&&t.isLeaf,["expand","collapse"].filter(t=>!!this.querySelector(`[slot="${t}
9350-icon"]`)).forEach(e=>{const i=t.querySelector(`[slot="${e}-icon"]`),o=this.getExpandButtonIcon(e);o&&(null===i?t.append(o):i.hasAttribute("data-default")&&i.replaceWith(o))})})},this.handleTreeChanged=t=>{for(const e of t){const t=[...e.addedNodes].filter(Nm.isTreeItem),i=[...e.removedNodes].filter(Nm.isTreeItem);t.forEach(this.initTreeItem),this.lastFocusedItem&&i.includes(this.lastFocusedItem)&&(this.lastFocusedItem=null)}},this.handleFocusOut=t=>{const e=t.relatedTarget;e&&this.contains(e)||(this.tabIndex=0)},this.handleFocusIn=t=>{const e=t.target;t.target===this&&this.focusItem(this.lastFocusedItem||this.getAllTreeItems()[0]),Nm.isTreeItem(e)&&!e.disabled&&(this.lastFocusedItem&&(this.lastFocusedItem.tabIndex=-1),this.lastFocusedItem=e,this.tabIndex=-1,e.tabIndex=0)},"addEventListener"in this&&(this.addEventListener("focusin",this.handleFocusIn),this.addEventListener("focusout",this.handleFocusOut),this.addEventListener("wa-lazy-change",this.handleSlotChange))}async connectedCallback(){super.connectedCallback(),"undefined"!=typeof MutationObserver&&(await this.updateComplete,this.mutationObserver=new MutationObserver(this.handleTreeChanged),this.mutationObserver.observe(this,{childList:!0,subtree:!0})),this.setAttribute("tabindex","0"),this.setAttribute("role","tree")}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect()}getExpandButtonIcon(t){const e=("expand"===t?this.expandedIconSlot:this.collapsedIconSlot).assignedElements({flatten:!0})[0];if(e){const i=e.cloneNode(!0);return[i,...i.querySelectorAll("[id]")].forEach(t=>t.removeAttribute("id")),i.setAttribute("data-default",""),i.slot=`${t}-icon`,i}return null}selectItem(t){const e=[...this.selectedItems];if("multiple"===this.selection)t.selected=!t.selected,t.lazy&&(t.expanded=!0),qm(t);else if("leaf-multiple"===this.selection)t.isLeaf?t.selected=!t.selected:t.expanded=!t.expanded;else if("single"===this.selection||t.isLeaf){const e=this.getAllTreeItems();for(const i of e)i.selected=i===t}else"leaf"===this.selection&&(t.expanded=!t.expanded);const i=this.selectedItems;(e.length!==i.length||i.some(t=>!e.includes(t)))&&Promise.all(i.map(t=>t.updateComplete)).then(()=>{this.dispatchEvent(new Em({selection:i}))})}getAllTreeItems(){return[...this.querySelectorAll("wa-tree-item")]}focusItem(t){t?.focus()}handleKeyDown(t){if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","End","Enter"," "].includes(t.key))return;if(t.composedPath().some(t=>["input","textarea"].includes(t?.tagName?.toLowerCase())))return;const e=this.getFocusableItems(),i=this.matches(":dir(ltr)"),o="rtl"===this.localize.dir();if(e.length>0){const a=e.findIndex(t=>t.matches(":focus")),s=e[a];if(!s&&("Enter"===t.key||" "===t.key))return;t.preventDefault();const n=t=>{const i=e[Uh(t,0,e.length-1)];this.focusItem(i)},r=t=>{s.expanded=t};"ArrowDown"===t.key?n(a+1):"ArrowUp"===t.key?n(a-1):i&&"ArrowRight"===t.key||o&&"ArrowLeft"===t.key?!s||s.disabled||s.expanded||s.isLeaf&&!s.lazy?n(a+1):r(!0):i&&"ArrowLeft"===t.key||o&&"ArrowRight"===t.key?!s||s.disabled||s.isLeaf||!s.expanded?n(a-1):r(!1):"Home"===t.key?n(0):"End"===t.key?n(e.length-1):"Enter"!==t.key&&" "!==t.key||s&&!s.disabled&&this.selectItem(s)}}handleClick(t){const e=t.target,i=e.closest("wa-tree-item"),o=t.composedPath().some(t=>t?.classList?.contains("expand-button"));i&&!i.disabled&&e===this.clickTarget&&(o?i.expanded=!i.expanded:this.selectItem(i))}handleMouseDown(t){this.clickTarget=t.target}
9350handleSlotChange(){this.getAllTreeItems().forEach(this.initTreeItem)}async handleSelectionChange(){const t="multiple"===this.selection,e="leaf-multiple"===this.selection,i=this.getAllTreeItems();this.setAttribute("aria-multiselectable",t||e?"true":"false");for(const o of i)o.updateComplete.then(()=>{o.selectable=t||e&&o.isLeaf});t&&(await this.updateComplete,[...this.querySelectorAll(":scope > wa-tree-item")].forEach(t=>{t.updateComplete.then(()=>{qm(t,!0)})}))}get selectedItems(){return this.getAllTreeItems().filter(t=>t.selected)}getFocusableItems(){const t=this.getAllTreeItems(),e=new Set;return t.filter(t=>{if(t.disabled)return!1;const i=t.parentElement?.closest("[role=treeitem]");return i&&(!i.expanded||i.loading||e.has(i))&&e.add(t),!e.has(t)})}render(){return K` 9351 <div 9352 part="base tree" 9353 class="tree" 9354 @click=${this.handleClick} 9355 @keydown=${this.handleKeyDown} 9356 @mousedown=${this.handleMouseDown} 9357 > 9358 <slot @slotchange=${this.handleSlotChange}></slot> 9359 <span hidden aria-hidden="true"><slot name="expand-icon"></slot></span> 9360 <span hidden aria-hidden="true"><slot name="collapse-icon"></slot></span> 9361 </div> 9362 `}};Um.css=Hm,kt([Dt("slot:not([name])")],Um.prototype,"defaultSlot",2),kt([Dt("slot[name=expand-icon]")],Um.prototype,"expandedIconSlot",2),kt([Dt("slot[name=collapse-icon]")],Um.prototype,"collapsedIconSlot",2),kt([At()],Um.prototype,"selection",2),kt([At({attribute:"tabindex",reflect:!0,type:Number})],Um.prototype,"tabIndex",2),kt([At({reflect:!0})],Um.prototype,"role",2),kt([vt("selection")],Um.prototype,"handleSelectionChange",1),Um=kt([St("wa-tree")],Um);var Wm=class extends Lh{constructor(){super(...arguments),this.type="doughnut"}};kt([At()],Wm.prototype,"type",2),Wm=kt([St("wa-doughnut-chart")],Wm)})(); 9363//# sourceMappingURL=webawesome.custom.min.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.