@warp-ds/elements 2.7.0 → 2.8.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -175,6 +175,39 @@ test('valueFormatter formats tooltip display value', async () => {
175
175
  const tooltipMessage = thumb.shadowRoot.querySelector('w-attention span[slot="message"]');
176
176
  expect(tooltipMessage.textContent.trim()).toBe('50000 formatted');
177
177
  });
178
+ // tooltipFormatter tests
179
+ test('tooltipFormatter formats tooltip display value', async () => {
180
+ const component = html `
181
+ <w-slider label="Hestekrefter" min="50" max="300" open-ended suffix="hk">
182
+ <w-slider-thumb slot="from" name="from-power" value="50"></w-slider-thumb>
183
+ <w-slider-thumb slot="to" name="to-power" value=""></w-slider-thumb>
184
+ </w-slider>
185
+ `;
186
+ render(component);
187
+ const slider = document.querySelector('w-slider');
188
+ slider.valueFormatter = (value, slot) => {
189
+ if (slot === 'from' && value === '') {
190
+ return 'Min';
191
+ }
192
+ if (slot === 'to' && value === '') {
193
+ return 'Max';
194
+ }
195
+ return value;
196
+ };
197
+ // Use 300+ hk in the tooltip
198
+ slider.tooltipFormatter = (value, slot) => {
199
+ if (slot === 'to' && value === '') {
200
+ return `${300}+`;
201
+ }
202
+ return value;
203
+ };
204
+ await slider.updateComplete;
205
+ const thumb = document.querySelector('w-slider-thumb[slot="to"]');
206
+ await thumb.updateComplete;
207
+ // Check the tooltip message content in w-attention
208
+ const tooltipMessage = thumb.shadowRoot.querySelector('w-attention span[slot="message"]');
209
+ expect(tooltipMessage.textContent.trim()).toBe('300+ hk');
210
+ });
178
211
  // WCAG 2.1 Accessibility Tests
179
212
  // Fieldset and legend tests (WCAG 1.3.1 Info and Relationships, 4.1.2 Name, Role, Value)
180
213
  test('slider uses fieldset with legend for proper grouping', async () => {
@@ -41,6 +41,8 @@ declare class WarpSliderThumb extends WarpSliderThumb_base {
41
41
  suffix: string;
42
42
  /** @internal Formatter for the tooltip and input mask values. Set by `<w-slider>`. */
43
43
  valueFormatter: (value: string, slot: SliderSlot) => string;
44
+ /** @internal Replaces {@link valueFormatter} for the tooltip. Use in open-ended sliders to show for example "300+ hk" instead of "Max" in the tooltip. Set by `<w-slider>`. */
45
+ tooltipFormatter: (value: string, slot: SliderSlot) => string;
44
46
  /** @internal Formatter for the min and max labels below the range. Set by `<w-slider>`. */
45
47
  labelFormatter: (slot: SliderSlot) => string;
46
48
  range: HTMLInputElement;
@@ -1,5 +1,5 @@
1
- var Ye=Object.create;var ie=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ue=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var ve=t=>{throw TypeError(t)};var we=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var He=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Re(e))!Xe.call(t,a)&&a!==r&&ie(t,a,{get:()=>e[a],enumerable:!(o=fe(e,a))||o.enumerable});return t};var qe=(t,e,r)=>(r=t!=null?Ye(Ue(t)):{},He(e||!t||!t.__esModule?ie(r,"default",{value:t,enumerable:!0}):r,t));var p=(t,e,r,o)=>{for(var a=o>1?void 0:o?fe(e,r):e,s=t.length-1,n;s>=0;s--)(n=t[s])&&(a=(o?n(e,r,a):n(a))||a);return o&&a&&ie(e,r,a),a};var se=(t,e,r)=>e.has(t)||ve("Cannot "+r);var xe=(t,e,r)=>(se(t,e,"read from private field"),r?r.call(t):e.get(t)),ne=(t,e,r)=>e.has(t)?ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),ke=(t,e,r,o)=>(se(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),g=(t,e,r)=>(se(t,e,"access private method"),r);var ye=we(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.errorMessages=A.ErrorType=void 0;var j;(function(t){t.MalformedUnicode="MALFORMED_UNICODE",t.MalformedHexadecimal="MALFORMED_HEXADECIMAL",t.CodePointLimit="CODE_POINT_LIMIT",t.OctalDeprecation="OCTAL_DEPRECATION",t.EndOfString="END_OF_STRING"})(j=A.ErrorType||(A.ErrorType={}));A.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var ze=we(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.unraw=T.errorMessages=T.ErrorType=void 0;var _=ye();Object.defineProperty(T,"ErrorType",{enumerable:!0,get:function(){return _.ErrorType}});Object.defineProperty(T,"errorMessages",{enumerable:!0,get:function(){return _.errorMessages}});function Ze(t){return!t.match(/[^a-f0-9]/i)?parseInt(t,16):NaN}function G(t,e,r){let o=Ze(t);if(Number.isNaN(o)||r!==void 0&&r!==t.length)throw new SyntaxError(_.errorMessages.get(e));return o}function Be(t){let e=G(t,_.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function _e(t,e){let r=G(t,_.ErrorType.MalformedUnicode,4);if(e!==void 0){let o=G(e,_.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,o)}return String.fromCharCode(r)}function Ge(t){return t.charAt(0)==="{"&&t.charAt(t.length-1)==="}"}function Ke(t){if(!Ge(t))throw new SyntaxError(_.errorMessages.get(_.ErrorType.MalformedUnicode));let e=t.slice(1,-1),r=G(e,_.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(o){throw o instanceof RangeError?new SyntaxError(_.errorMessages.get(_.ErrorType.CodePointLimit)):o}}function Je(t,e=!1){if(e)throw new SyntaxError(_.errorMessages.get(_.ErrorType.OctalDeprecation));let r=parseInt(t,8);return String.fromCharCode(r)}var We=new Map([["b","\b"],["f","\f"],["n",`
2
- `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function Qe(t){return We.get(t)||t}var er=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function Ce(t,e=!1){return t.replace(er,function(r,o,a,s,n,i,d,m,k){if(o!==void 0)return"\\";if(a!==void 0)return Be(a);if(s!==void 0)return Ke(s);if(n!==void 0)return _e(n,i);if(d!==void 0)return _e(d);if(m==="0")return"\0";if(m!==void 0)return Je(m,!e);if(k!==void 0)return Qe(k);throw new SyntaxError(_.errorMessages.get(_.ErrorType.EndOfString))})}T.unraw=Ce;T.default=Ce});var Fe=qe(ze(),1);var D=t=>typeof t=="string",rr=t=>typeof t=="function",Ee=new Map,Se="en";function he(t){return[...Array.isArray(t)?t:[t],Se]}function ue(t,e,r){let o=he(t);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return K(()=>J("date",o,r),()=>new Intl.DateTimeFormat(o,a)).format(D(e)?new Date(e):e)}function tr(t,e,r){let o;if(r||(r="default"),typeof r=="string")switch(o={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":o.timeZoneName="short";break;case"short":delete o.second}else o=r;return ue(t,e,o)}function le(t,e,r){let o=he(t);return K(()=>J("number",o,r),()=>new Intl.NumberFormat(o,r)).format(e)}function Me(t,e,r,{offset:o=0,...a}){var i,d;let s=he(t),n=e?K(()=>J("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):K(()=>J("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[n.select(r-o)])!=null?d:a.other}function K(t,e){let r=t(),o=Ee.get(r);return o||(o=e(),Ee.set(r,o)),o}function J(t,e,r){let o=e.join("-");return`${t}-${o}-${JSON.stringify(r)}`}var $e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ve="%__lingui_octothorpe__%",or=(t,e,r={})=>{let o=e||t,a=n=>typeof n=="object"?n:r[n],s=(n,i)=>{let d=Object.keys(r).length?a("number"):void 0,m=le(o,n,d);return i.replace(new RegExp(Ve,"g"),m)};return{plural:(n,i)=>{let{offset:d=0}=i,m=Me(o,!1,n,i);return s(n-d,m)},selectordinal:(n,i)=>{let{offset:d=0}=i,m=Me(o,!0,n,i);return s(n-d,m)},select:ar,number:(n,i)=>le(o,n,a(i)||{style:i}),date:(n,i)=>ue(o,n,a(i)||i),time:(n,i)=>tr(o,n,a(i)||i)}},ar=(t,e)=>{var r;return(r=e[t])!=null?r:e.other};function ir(t,e,r){return(o={},a)=>{let s=or(e,r,a),n=(d,m=!1)=>Array.isArray(d)?d.reduce((k,E)=>{if(E==="#"&&m)return k+Ve;if(D(E))return k+E;let[S,y,M]=E,F={};y==="plural"||y==="selectordinal"||y==="select"?Object.entries(M).forEach(([L,R])=>{F[L]=n(R,y==="plural"||y==="selectordinal")}):F=M;let f;if(y){let L=s[y];f=L(o[S],F)}else f=o[S];return f==null?k:k+f},""):d,i=n(t);return D(i)&&$e.test(i)?(0,Fe.unraw)(i):D(i)?i:i?String(i):""}}var sr=Object.defineProperty,nr=(t,e,r)=>e in t?sr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lr=(t,e,r)=>(nr(t,typeof e!="symbol"?e+"":e,r),r),de=class{constructor(){lr(this,"_events",{})}on(e,r){var a;var o;return(a=(o=this._events)[e])!=null||(o[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let o=this._getListeners(e);if(!o)return;let a=o.indexOf(r);~a&&o.splice(a,1)}emit(e,...r){let o=this._getListeners(e);o&&o.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},dr=Object.defineProperty,cr=(t,e,r)=>e in t?dr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O=(t,e,r)=>(cr(t,typeof e!="symbol"?e+"":e,r),r),ce=class extends de{constructor(e){var r;super(),O(this,"_locale",""),O(this,"_locales"),O(this,"_localeData",{}),O(this,"_messages",{}),O(this,"_missing"),O(this,"_messageCompiler"),O(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:Se,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let o=this._localeData[e];o?Object.assign(o,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(o=>this._loadLocaleData(o,e[o])),this.emit("change")}_load(e,r){let o=this._messages[e];o?Object.assign(o,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([o,a])=>this._load(o,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:o}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=o,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,o){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=o==null?void 0:o.message;e||(e=""),D(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],n=s===void 0,i=this._missing;if(i&&n)return rr(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let d=s||a||e;return D(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
1
+ var Ye=Object.create;var ie=Object.defineProperty;var fe=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var Ue=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var ve=o=>{throw TypeError(o)};var we=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var He=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Re(e))!Xe.call(o,a)&&a!==r&&ie(o,a,{get:()=>e[a],enumerable:!(t=fe(e,a))||t.enumerable});return o};var qe=(o,e,r)=>(r=o!=null?Ye(Ue(o)):{},He(e||!o||!o.__esModule?ie(r,"default",{value:o,enumerable:!0}):r,o));var p=(o,e,r,t)=>{for(var a=t>1?void 0:t?fe(e,r):e,s=o.length-1,n;s>=0;s--)(n=o[s])&&(a=(t?n(e,r,a):n(a))||a);return t&&a&&ie(e,r,a),a};var se=(o,e,r)=>e.has(o)||ve("Cannot "+r);var xe=(o,e,r)=>(se(o,e,"read from private field"),r?r.call(o):e.get(o)),ne=(o,e,r)=>e.has(o)?ve("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(o):e.set(o,r),ke=(o,e,r,t)=>(se(o,e,"write to private field"),t?t.call(o,r):e.set(o,r),r),g=(o,e,r)=>(se(o,e,"access private method"),r);var ye=we(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.errorMessages=A.ErrorType=void 0;var j;(function(o){o.MalformedUnicode="MALFORMED_UNICODE",o.MalformedHexadecimal="MALFORMED_HEXADECIMAL",o.CodePointLimit="CODE_POINT_LIMIT",o.OctalDeprecation="OCTAL_DEPRECATION",o.EndOfString="END_OF_STRING"})(j=A.ErrorType||(A.ErrorType={}));A.errorMessages=new Map([[j.MalformedUnicode,"malformed Unicode character escape sequence"],[j.MalformedHexadecimal,"malformed hexadecimal character escape sequence"],[j.CodePointLimit,"Unicode codepoint must not be greater than 0x10FFFF in escape sequence"],[j.OctalDeprecation,'"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'],[j.EndOfString,"malformed escape sequence at end of string"]])});var ze=we(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});T.unraw=T.errorMessages=T.ErrorType=void 0;var _=ye();Object.defineProperty(T,"ErrorType",{enumerable:!0,get:function(){return _.ErrorType}});Object.defineProperty(T,"errorMessages",{enumerable:!0,get:function(){return _.errorMessages}});function Ze(o){return!o.match(/[^a-f0-9]/i)?parseInt(o,16):NaN}function G(o,e,r){let t=Ze(o);if(Number.isNaN(t)||r!==void 0&&r!==o.length)throw new SyntaxError(_.errorMessages.get(e));return t}function Be(o){let e=G(o,_.ErrorType.MalformedHexadecimal,2);return String.fromCharCode(e)}function _e(o,e){let r=G(o,_.ErrorType.MalformedUnicode,4);if(e!==void 0){let t=G(e,_.ErrorType.MalformedUnicode,4);return String.fromCharCode(r,t)}return String.fromCharCode(r)}function Ge(o){return o.charAt(0)==="{"&&o.charAt(o.length-1)==="}"}function Ke(o){if(!Ge(o))throw new SyntaxError(_.errorMessages.get(_.ErrorType.MalformedUnicode));let e=o.slice(1,-1),r=G(e,_.ErrorType.MalformedUnicode);try{return String.fromCodePoint(r)}catch(t){throw t instanceof RangeError?new SyntaxError(_.errorMessages.get(_.ErrorType.CodePointLimit)):t}}function Je(o,e=!1){if(e)throw new SyntaxError(_.errorMessages.get(_.ErrorType.OctalDeprecation));let r=parseInt(o,8);return String.fromCharCode(r)}var Qe=new Map([["b","\b"],["f","\f"],["n",`
2
+ `],["r","\r"],["t"," "],["v","\v"],["0","\0"]]);function We(o){return Qe.get(o)||o}var er=/\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;function Ce(o,e=!1){return o.replace(er,function(r,t,a,s,n,i,d,m,k){if(t!==void 0)return"\\";if(a!==void 0)return Be(a);if(s!==void 0)return Ke(s);if(n!==void 0)return _e(n,i);if(d!==void 0)return _e(d);if(m==="0")return"\0";if(m!==void 0)return Je(m,!e);if(k!==void 0)return We(k);throw new SyntaxError(_.errorMessages.get(_.ErrorType.EndOfString))})}T.unraw=Ce;T.default=Ce});var Fe=qe(ze(),1);var D=o=>typeof o=="string",rr=o=>typeof o=="function",Ee=new Map,Se="en";function he(o){return[...Array.isArray(o)?o:[o],Se]}function ue(o,e,r){let t=he(o);r||(r="default");let a;if(typeof r=="string")switch(a={day:"numeric",month:"short",year:"numeric"},r){case"full":a.weekday="long";case"long":a.month="long";break;case"short":a.month="numeric";break}else a=r;return K(()=>J("date",t,r),()=>new Intl.DateTimeFormat(t,a)).format(D(e)?new Date(e):e)}function tr(o,e,r){let t;if(r||(r="default"),typeof r=="string")switch(t={second:"numeric",minute:"numeric",hour:"numeric"},r){case"full":case"long":t.timeZoneName="short";break;case"short":delete t.second}else t=r;return ue(o,e,t)}function le(o,e,r){let t=he(o);return K(()=>J("number",t,r),()=>new Intl.NumberFormat(t,r)).format(e)}function Me(o,e,r,{offset:t=0,...a}){var i,d;let s=he(o),n=e?K(()=>J("plural-ordinal",s),()=>new Intl.PluralRules(s,{type:"ordinal"})):K(()=>J("plural-cardinal",s),()=>new Intl.PluralRules(s,{type:"cardinal"}));return(d=(i=a[r])!=null?i:a[n.select(r-t)])!=null?d:a.other}function K(o,e){let r=o(),t=Ee.get(r);return t||(t=e(),Ee.set(r,t)),t}function J(o,e,r){let t=e.join("-");return`${o}-${t}-${JSON.stringify(r)}`}var $e=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,Ve="%__lingui_octothorpe__%",or=(o,e,r={})=>{let t=e||o,a=n=>typeof n=="object"?n:r[n],s=(n,i)=>{let d=Object.keys(r).length?a("number"):void 0,m=le(t,n,d);return i.replace(new RegExp(Ve,"g"),m)};return{plural:(n,i)=>{let{offset:d=0}=i,m=Me(t,!1,n,i);return s(n-d,m)},selectordinal:(n,i)=>{let{offset:d=0}=i,m=Me(t,!0,n,i);return s(n-d,m)},select:ar,number:(n,i)=>le(t,n,a(i)||{style:i}),date:(n,i)=>ue(t,n,a(i)||i),time:(n,i)=>tr(t,n,a(i)||i)}},ar=(o,e)=>{var r;return(r=e[o])!=null?r:e.other};function ir(o,e,r){return(t={},a)=>{let s=or(e,r,a),n=(d,m=!1)=>Array.isArray(d)?d.reduce((k,E)=>{if(E==="#"&&m)return k+Ve;if(D(E))return k+E;let[$,y,M]=E,F={};y==="plural"||y==="selectordinal"||y==="select"?Object.entries(M).forEach(([L,R])=>{F[L]=n(R,y==="plural"||y==="selectordinal")}):F=M;let f;if(y){let L=s[y];f=L(t[$],F)}else f=t[$];return f==null?k:k+f},""):d,i=n(o);return D(i)&&$e.test(i)?(0,Fe.unraw)(i):D(i)?i:i?String(i):""}}var sr=Object.defineProperty,nr=(o,e,r)=>e in o?sr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,lr=(o,e,r)=>(nr(o,typeof e!="symbol"?e+"":e,r),r),de=class{constructor(){lr(this,"_events",{})}on(e,r){var a;var t;return(a=(t=this._events)[e])!=null||(t[e]=[]),this._events[e].push(r),()=>this.removeListener(e,r)}removeListener(e,r){let t=this._getListeners(e);if(!t)return;let a=t.indexOf(r);~a&&t.splice(a,1)}emit(e,...r){let t=this._getListeners(e);t&&t.map(a=>a.apply(this,r))}_getListeners(e){let r=this._events[e];return Array.isArray(r)?r:!1}},dr=Object.defineProperty,cr=(o,e,r)=>e in o?dr(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r,O=(o,e,r)=>(cr(o,typeof e!="symbol"?e+"":e,r),r),ce=class extends de{constructor(e){var r;super(),O(this,"_locale",""),O(this,"_locales"),O(this,"_localeData",{}),O(this,"_messages",{}),O(this,"_missing"),O(this,"_messageCompiler"),O(this,"t",this._.bind(this)),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),e.localeData!=null&&this.loadLocaleData(e.localeData),(typeof e.locale=="string"||e.locales)&&this.activate((r=e.locale)!=null?r:Se,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){var e;return(e=this._messages[this._locale])!=null?e:{}}get localeData(){var e;return(e=this._localeData[this._locale])!=null?e:{}}_loadLocaleData(e,r){let t=this._localeData[e];t?Object.assign(t,r):this._localeData[e]=r}setMessagesCompiler(e){return this._messageCompiler=e,this}loadLocaleData(e,r){typeof e=="string"?this._loadLocaleData(e,r):Object.keys(e).forEach(t=>this._loadLocaleData(t,e[t])),this.emit("change")}_load(e,r){let t=this._messages[e];t?Object.assign(t,r):this._messages[e]=r}load(e,r){typeof e=="string"&&typeof r=="object"?this._load(e,r):Object.entries(e).forEach(([t,a])=>this._load(t,a)),this.emit("change")}loadAndActivate({locale:e,locales:r,messages:t}){this._locale=e,this._locales=r||void 0,this._messages[this._locale]=t,this.emit("change")}activate(e,r){this._locale=e,this._locales=r,this.emit("change")}_(e,r,t){if(!this.locale)throw new Error("Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic.");let a=t==null?void 0:t.message;e||(e=""),D(e)||(r=e.values||r,a=e.message,e=e.id);let s=this.messages[e],n=s===void 0,i=this._missing;if(i&&n)return rr(i)?i(this._locale,e):i;n&&this.emit("missing",{id:e,locale:this._locale});let d=s||a||e;return D(d)&&(this._messageCompiler?d=this._messageCompiler(d):console.warn(`Uncompiled message detected! Message:
3
3
 
4
4
  > ${d}
5
5
 
@@ -7,7 +7,7 @@ That means you use raw catalog or your catalog doesn't have a translation for th
7
7
  ICU features such as interpolation and plurals will not work properly for that message.
8
8
 
9
9
  Please compile your catalog first.
10
- `)),D(d)&&$e.test(d)?JSON.parse(`"${d}"`):D(d)?d:ir(d,this._locale,this._locales)(r,o==null?void 0:o.formats)}date(e,r){return ue(this._locales||this._locale,e,r)}number(e,r){return le(this._locales||this._locale,e,r)}};function hr(t={}){return new ce(t)}var z=hr();var h=function(t,e,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(t):o?o.value:e.get(t)},w=function(t,e,r,o,a){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r};function Te(t){var e,r,o,a,s,n,i,d,m,k,E,S,y,M,F,f,L,R,te;class je extends t{constructor(...l){var c,v,x;super(...l),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),o.set(this,!1),a.set(this,!1),s.set(this,void 0),n.set(this,void 0),i.set(this,!0),m.set(this,""),k.set(this,()=>{w(this,a,!0,"f"),w(this,r,!0,"f"),h(this,e,"m",f).call(this)}),E.set(this,()=>{w(this,r,!1,"f"),h(this,e,"m",L).call(this,this.shouldFormValueUpdate()?h(this,m,"f"):""),!this.validity.valid&&h(this,a,"f")&&w(this,o,!0,"f");let V=h(this,e,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(V?this.internals.validationMessage:"")}),S.set(this,()=>{var V;h(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),w(this,i,!1,"f")),w(this,a,!0,"f"),w(this,o,!0,"f"),h(this,e,"m",f).call(this),(V=this===null||this===void 0?void 0:this.validationMessageCallback)===null||V===void 0||V.call(this,this.showError?this.internals.validationMessage:"")}),y.set(this,void 0),M.set(this,!1),F.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,k,"f")),(v=this.addEventListener)===null||v===void 0||v.call(this,"blur",h(this,E,"f")),(x=this.addEventListener)===null||x===void 0||x.call(this,"invalid",h(this,S,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(x=>x.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...l])]}static getValidator(l){return this.validators.find(c=>c.attribute===l)||null}static getValidators(l){return this.validators.filter(c=>{var v;if(c.attribute===l||!((v=c.attribute)===null||v===void 0)&&v.includes(l))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,c,v){var x;(x=super.attributeChangedCallback)===null||x===void 0||x.call(this,l,c,v);let X=this.constructor.getValidators(l);X!=null&&X.length&&this.validationTarget&&this.setValue(h(this,m,"f"))}setValue(l){var c;w(this,o,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),w(this,m,l,"f");let x=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(x),h(this,e,"m",L).call(this,x),this.valueChangedCallback&&this.valueChangedCallback(x),h(this,e,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(h(this,F,"f")))}formResetCallback(){var l,c;w(this,a,!1,"f"),w(this,o,!1,"f"),h(this,e,"m",f).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",f).call(this)?this.validationMessage:"")}}return r=new WeakMap,o=new WeakMap,a=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakMap,m=new WeakMap,k=new WeakMap,E=new WeakMap,S=new WeakMap,y=new WeakMap,M=new WeakMap,F=new WeakMap,e=new WeakSet,d=function(){let l=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(c)},f=function(){if(this.hasAttribute("disabled"))return!1;let l=h(this,o,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},L=function(l){let c=this.constructor,v={},x=c.validators,V=[],X=x.some(C=>C.isValid instanceof Promise);h(this,M,"f")||(w(this,F,new Promise(C=>{w(this,y,C,"f")}),"f"),w(this,M,!0,"f")),h(this,s,"f")&&(h(this,s,"f").abort(),w(this,n,h(this,s,"f"),"f"));let H=new AbortController;w(this,s,H,"f");let q,ge=!1;x.length&&(x.forEach(C=>{let oe=C.key||"customError",I=C.isValid(this,l,H.signal);I instanceof Promise?(V.push(I),I.then(ae=>{ae!=null&&(v[oe]=!ae,q=h(this,e,"m",te).call(this,C,l),h(this,e,"m",R).call(this,v,q))})):(v[oe]=!I,this.validity[oe]!==!I&&(ge=!0),!I&&!q&&(q=h(this,e,"m",te).call(this,C,l)))}),Promise.allSettled(V).then(()=>{var C;H!=null&&H.signal.aborted||(w(this,M,!1,"f"),(C=h(this,y,"f"))===null||C===void 0||C.call(this))}),(ge||!X)&&h(this,e,"m",R).call(this,v,q))},R=function(l,c){if(this.validationTarget)this.internals.setValidity(l,c,this.validationTarget),w(this,i,!1,"f");else{if(this.internals.setValidity(l,c),this.internals.validity.valid)return;w(this,i,!0,"f")}},te=function(l,c){if(this.validityCallback){let v=this.validityCallback(l.key||"customError");if(v)return v}return l.message instanceof Function?l.message(this,c):l.message},je}import{html as Z,LitElement as Ae,nothing as P}from"lit";import{property as $,query as be,state as N}from"lit/decorators.js";import{classMap as pr}from"lit/directives/class-map.js";import{ifDefined as W}from"lit/directives/if-defined.js";import{css as ur}from"lit";var Pe=ur`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;import{css as Ne}from"lit";var De=Ne`
10
+ `)),D(d)&&$e.test(d)?JSON.parse(`"${d}"`):D(d)?d:ir(d,this._locale,this._locales)(r,t==null?void 0:t.formats)}date(e,r){return ue(this._locales||this._locale,e,r)}number(e,r){return le(this._locales||this._locale,e,r)}};function hr(o={}){return new ce(o)}var z=hr();var h=function(o,e,r,t){if(r==="a"&&!t)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?o!==e||!t:!e.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?t:r==="a"?t.call(o):t?t.value:e.get(o)},w=function(o,e,r,t,a){if(t==="m")throw new TypeError("Private method is not writable");if(t==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?o!==e||!a:!e.has(o))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t==="a"?a.call(o,r):a?a.value=r:e.set(o,r),r};function Te(o){var e,r,t,a,s,n,i,d,m,k,E,$,y,M,F,f,L,R,te;class je extends o{constructor(...l){var c,v,x;super(...l),e.add(this),this.internals=this.attachInternals(),r.set(this,!1),t.set(this,!1),a.set(this,!1),s.set(this,void 0),n.set(this,void 0),i.set(this,!0),m.set(this,""),k.set(this,()=>{w(this,a,!0,"f"),w(this,r,!0,"f"),h(this,e,"m",f).call(this)}),E.set(this,()=>{w(this,r,!1,"f"),h(this,e,"m",L).call(this,this.shouldFormValueUpdate()?h(this,m,"f"):""),!this.validity.valid&&h(this,a,"f")&&w(this,t,!0,"f");let V=h(this,e,"m",f).call(this);this.validationMessageCallback&&this.validationMessageCallback(V?this.internals.validationMessage:"")}),$.set(this,()=>{var V;h(this,i,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),w(this,i,!1,"f")),w(this,a,!0,"f"),w(this,t,!0,"f"),h(this,e,"m",f).call(this),(V=this===null||this===void 0?void 0:this.validationMessageCallback)===null||V===void 0||V.call(this,this.showError?this.internals.validationMessage:"")}),y.set(this,void 0),M.set(this,!1),F.set(this,Promise.resolve()),(c=this.addEventListener)===null||c===void 0||c.call(this,"focus",h(this,k,"f")),(v=this.addEventListener)===null||v===void 0||v.call(this,"blur",h(this,E,"f")),(x=this.addEventListener)===null||x===void 0||x.call(this,"invalid",h(this,$,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let l=this.validators.map(x=>x.attribute).flat(),c=super.observedAttributes||[];return[...new Set([...c,...l])]}static getValidator(l){return this.validators.find(c=>c.attribute===l)||null}static getValidators(l){return this.validators.filter(c=>{var v;if(c.attribute===l||!((v=c.attribute)===null||v===void 0)&&v.includes(l))return!0})}get form(){return this.internals.form}get showError(){return h(this,e,"m",f).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(l,c,v){var x;(x=super.attributeChangedCallback)===null||x===void 0||x.call(this,l,c,v);let X=this.constructor.getValidators(l);X!=null&&X.length&&this.validationTarget&&this.setValue(h(this,m,"f"))}setValue(l){var c;w(this,t,!1,"f"),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,""),w(this,m,l,"f");let x=this.shouldFormValueUpdate()?l:null;this.internals.setFormValue(x),h(this,e,"m",L).call(this,x),this.valueChangedCallback&&this.valueChangedCallback(x),h(this,e,"m",f).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(l=>l(h(this,F,"f")))}formResetCallback(){var l,c;w(this,a,!1,"f"),w(this,t,!1,"f"),h(this,e,"m",f).call(this),(l=this.resetFormControl)===null||l===void 0||l.call(this),(c=this.validationMessageCallback)===null||c===void 0||c.call(this,h(this,e,"m",f).call(this)?this.validationMessage:"")}}return r=new WeakMap,t=new WeakMap,a=new WeakMap,s=new WeakMap,n=new WeakMap,i=new WeakMap,m=new WeakMap,k=new WeakMap,E=new WeakMap,$=new WeakMap,y=new WeakMap,M=new WeakMap,F=new WeakMap,e=new WeakSet,d=function(){let l=this.getRootNode(),c=`${this.localName}[name="${this.getAttribute("name")}"]`;return l.querySelectorAll(c)},f=function(){if(this.hasAttribute("disabled"))return!1;let l=h(this,t,"f")||h(this,a,"f")&&!this.validity.valid&&!h(this,r,"f");return l&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),l},L=function(l){let c=this.constructor,v={},x=c.validators,V=[],X=x.some(C=>C.isValid instanceof Promise);h(this,M,"f")||(w(this,F,new Promise(C=>{w(this,y,C,"f")}),"f"),w(this,M,!0,"f")),h(this,s,"f")&&(h(this,s,"f").abort(),w(this,n,h(this,s,"f"),"f"));let H=new AbortController;w(this,s,H,"f");let q,ge=!1;x.length&&(x.forEach(C=>{let oe=C.key||"customError",I=C.isValid(this,l,H.signal);I instanceof Promise?(V.push(I),I.then(ae=>{ae!=null&&(v[oe]=!ae,q=h(this,e,"m",te).call(this,C,l),h(this,e,"m",R).call(this,v,q))})):(v[oe]=!I,this.validity[oe]!==!I&&(ge=!0),!I&&!q&&(q=h(this,e,"m",te).call(this,C,l)))}),Promise.allSettled(V).then(()=>{var C;H!=null&&H.signal.aborted||(w(this,M,!1,"f"),(C=h(this,y,"f"))===null||C===void 0||C.call(this))}),(ge||!X)&&h(this,e,"m",R).call(this,v,q))},R=function(l,c){if(this.validationTarget)this.internals.setValidity(l,c,this.validationTarget),w(this,i,!1,"f");else{if(this.internals.setValidity(l,c),this.internals.validity.valid)return;w(this,i,!0,"f")}},te=function(l,c){if(this.validityCallback){let v=this.validityCallback(l.key||"customError");if(v)return v}return l.message instanceof Function?l.message(this,c):l.message},je}import{html as Z,LitElement as Ae,nothing as P}from"lit";import{property as S,query as be,state as N}from"lit/decorators.js";import{classMap as pr}from"lit/directives/class-map.js";import{ifDefined as Q}from"lit/directives/if-defined.js";import{css as ur}from"lit";var Pe=ur`*,:before,:after{--w-rotate:0;--w-rotate-x:0;--w-rotate-y:0;--w-rotate-z:0;--w-scale-x:1;--w-scale-y:1;--w-scale-z:1;--w-skew-x:0;--w-skew-y:0;--w-translate-x:0;--w-translate-y:0;--w-translate-z:0}.hidden{display:none}.absolute{position:absolute}.relative{position:relative}.static{position:static}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}`;import{css as Ne}from"lit";var De=Ne`
11
11
  *,
12
12
  :before,
13
13
  :after {
@@ -2637,7 +2637,7 @@ Please compile your catalog first.
2637
2637
  w-textfield {
2638
2638
  --w-textfield-placeholder-color-text: var(--w-s-color-text);
2639
2639
  }
2640
- `;var Oe={};var B,u,Q,ee,pe,Y,re,me,Ie,b=class extends Te(Ae){constructor(){super(...arguments);ne(this,u);this.invalid=!1;this.openEnded=!1;this.suffix="";this._showTooltip=!1;this._inputHasFocus=!1;this._hiddenTextfield=!1;ne(this,B,null);this.anchorPositioningStyleElement=null}resetFormControl(){this.value=xe(this,B)}async updateFieldAfterValidation(){let r=this.shadowRoot.querySelector("w-textfield");await g(this,u,re).call(this,r.value,!0)}async connectedCallback(){if(super.connectedCallback(),ke(this,B,this.value),this.setValue(this.value),this.slot&&!this.ariaDescription&&(this.slot==="from"?this.ariaDescription=z.t({id:"slider.label.from",comment:"Accessible label for the 'from value' input field in a range slider",message:"From"}):this.slot==="to"&&(this.ariaDescription=z.t({id:"slider.label.to",comment:"Accessible label for the 'to value' input field in a range slider",message:"To"}))),"anchorName"in document.documentElement.style)await this.updateComplete;else{let a=Oe.url.substring(0,Oe.url.lastIndexOf("/"));try{let[{default:s}]=await Promise.all([import(`${a}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2640
+ `;var Oe={};var B,b,W,ee,pe,Y,re,me,Ie,u=class extends Te(Ae){constructor(){super(...arguments);ne(this,b);this.invalid=!1;this.openEnded=!1;this.suffix="";this._showTooltip=!1;this._inputHasFocus=!1;this._hiddenTextfield=!1;ne(this,B,null);this.anchorPositioningStyleElement=null}resetFormControl(){this.value=xe(this,B)}async updateFieldAfterValidation(){let r=this.shadowRoot.querySelector("w-textfield");await g(this,b,re).call(this,r.value,!0)}async connectedCallback(){if(super.connectedCallback(),ke(this,B,this.value),this.setValue(this.value),this.slot&&!this.ariaDescription&&(this.slot==="from"?this.ariaDescription=z.t({id:"slider.label.from",comment:"Accessible label for the 'from value' input field in a range slider",message:"From"}):this.slot==="to"&&(this.ariaDescription=z.t({id:"slider.label.to",comment:"Accessible label for the 'to value' input field in a range slider",message:"To"}))),"anchorName"in document.documentElement.style)await this.updateComplete;else{let a=Oe.url.substring(0,Oe.url.lastIndexOf("/"));try{let[{default:s}]=await Promise.all([import(`${a}/oddbird-css-anchor-positioning.js`),this.updateComplete]);this.anchorPositioningStyleElement||(this.anchorPositioningStyleElement=document.createElement("style"),this.shadowRoot.prepend(this.anchorPositioningStyleElement)),this.anchorPositioningStyleElement.textContent=`
2641
2641
  /*
2642
2642
  * The polyfill can only anchor to ::before and ::after pseudo elements, not the pseudo element slider thumb.
2643
2643
  * We work around that by recreating a transparent version of the active range
@@ -2686,7 +2686,7 @@ Please compile your catalog first.
2686
2686
  left: anchor(--polyfilled-thumb left);
2687
2687
  margin-left: 38px;
2688
2688
  }
2689
- `,await s({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(s){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:s}))}}let r=window.navigator.userAgent;/WebKit/.test(r)&&!/Chrome/.test(r)&&this.tooltipTarget&&this.tooltipTarget.style.setProperty("--transform-offset","var(--w-slider-thumb-size, 28px)"),g(this,u,pe).call(this)}get boundaryValue(){return this.slot==="from"?this.min:this.max}get textFieldDisplayValue(){var r;return this._inputHasFocus?this.value!==""?this.value:(r=this.range)!=null&&r.value?Math.min(Math.max(Number(this.range.value),Number(this.min)+1),Number(this.max)-1).toString():"":this.value}get tooltipDisplayValue(){var o,a;let r=0;return this.valueFormatter?r=this.valueFormatter(this.value,this.slot):this.value===""?r=(a=(o=this.range)==null?void 0:o.value)!=null?a:this.boundaryValue:r=this.value||0,r}get ariaDescriptionText(){let r="",o=this.ariaDescription||"",a=this.value==="";return this.openEnded&&a&&(r=this.slot==="from"?z.t({id:"slider.placeholder.from",message:"Min"}):z.t({id:"slider.placeholder.to",message:"Max"})),r?`${r}, ${o}`:o}updated(r){r.has("openEnded")&&this.openEnded&&!this.placeholder&&(this.slot==="to"||this.slot===""?this.placeholder=z.t({id:"slider.placeholder.to",message:"Max",comment:"Max as in short for Maximum"}):this.slot==="from"&&(this.placeholder=z.t({id:"slider.placeholder.from",message:"Min",comment:"Min as in short for Minimum"}))),r.has("value")&&(this.setValue(this.value),g(this,u,pe).call(this))}render(){return Z`
2689
+ `,await s({roots:[this.shadowRoot],elements:[this.anchorPositioningStyleElement]})}catch(s){console.error(new Error("Error registering the CSS anchor positioning polyfill. The UI will look broken.",{cause:s}))}}let r=window.navigator.userAgent;/WebKit/.test(r)&&!/Chrome/.test(r)&&this.tooltipTarget&&this.tooltipTarget.style.setProperty("--transform-offset","var(--w-slider-thumb-size, 28px)"),g(this,b,pe).call(this)}get boundaryValue(){return this.slot==="from"?this.min:this.max}get textFieldDisplayValue(){var r;return this._inputHasFocus?this.value!==""?this.value:(r=this.range)!=null&&r.value?Math.min(Math.max(Number(this.range.value),Number(this.min)+1),Number(this.max)-1).toString():"":this.value}get tooltipDisplayValue(){var t,a;let r=0;return this.tooltipFormatter?r=this.tooltipFormatter(this.value,this.slot):this.valueFormatter?r=this.valueFormatter(this.value,this.slot):this.value===""?r=(a=(t=this.range)==null?void 0:t.value)!=null?a:this.boundaryValue:r=this.value||0,r}get ariaDescriptionText(){let r="",t=this.ariaDescription||"",a=this.value==="";return this.openEnded&&a&&(r=this.slot==="from"?z.t({id:"slider.placeholder.from",message:"Min"}):z.t({id:"slider.placeholder.to",message:"Max"})),r?`${r}, ${t}`:t}updated(r){r.has("openEnded")&&this.openEnded&&!this.placeholder&&(this.slot==="to"||this.slot===""?this.placeholder=z.t({id:"slider.placeholder.to",message:"Max",comment:"Max as in short for Maximum"}):this.slot==="from"&&(this.placeholder=z.t({id:"slider.placeholder.from",message:"Min",comment:"Min as in short for Minimum"}))),r.has("value")&&(this.setValue(this.value),g(this,b,pe).call(this))}render(){let r=this.placeholder&&!this.value;return Z`
2690
2690
  <div class="w-slider-thumb">
2691
2691
  ${"anchorName"in document.documentElement.style?P:Z`<div class="polyfill-range">
2692
2692
  <div class="polyfill-active-range"></div>
@@ -2694,22 +2694,22 @@ Please compile your catalog first.
2694
2694
  <input
2695
2695
  id="range"
2696
2696
  aria-label="${this.ariaLabel}"
2697
- aria-describedby="${W(this.ariaDescription?"aria-description":void 0)}"
2697
+ aria-describedby="${Q(this.ariaDescription?"aria-description":void 0)}"
2698
2698
  class="w-slider-thumb__range"
2699
2699
  type="range"
2700
2700
  .value="${this.value}"
2701
2701
  min="${this.min}"
2702
2702
  max="${this.max}"
2703
- step="${W(!this.openEnded&&this.step?this.step:void 0)}"
2703
+ step="${Q(!this.openEnded&&this.step?this.step:void 0)}"
2704
2704
  ?disabled="${this.disabled}"
2705
- @mousedown="${g(this,u,Q)}"
2706
- @mouseup="${g(this,u,ee)}"
2707
- @touchstart="${g(this,u,Q)}"
2708
- @touchend="${g(this,u,ee)}"
2709
- @focus="${g(this,u,Q)}"
2710
- @blur="${g(this,u,ee)}"
2711
- @input="${g(this,u,me)}"
2712
- @keydown="${this.openEnded?g(this,u,Ie):P}"
2705
+ @mousedown="${g(this,b,W)}"
2706
+ @mouseup="${g(this,b,ee)}"
2707
+ @touchstart="${g(this,b,W)}"
2708
+ @touchend="${g(this,b,ee)}"
2709
+ @focus="${g(this,b,W)}"
2710
+ @blur="${g(this,b,ee)}"
2711
+ @input="${g(this,b,me)}"
2712
+ @keydown="${this.openEnded?g(this,b,Ie):P}"
2713
2713
  />
2714
2714
 
2715
2715
  ${this.slot==="from"||!this.slot?Z`
@@ -2732,18 +2732,18 @@ Please compile your catalog first.
2732
2732
 
2733
2733
  <w-textfield
2734
2734
  aria-label="${this.ariaLabel}"
2735
- aria-description="${W(this.ariaDescriptionText)}"
2735
+ aria-description="${Q(this.ariaDescriptionText)}"
2736
2736
  class="${pr({"w-slider-thumb__textfield":!0,"sr-only":this._hiddenTextfield})}"
2737
2737
  type="number"
2738
2738
  tabindex="${this._hiddenTextfield?-1:P}"
2739
2739
  placeholder="${this.placeholder}"
2740
2740
  .value="${this.textFieldDisplayValue}"
2741
- .formatter=${this.valueFormatter?r=>this.valueFormatter(r,this.slot):P}
2741
+ .formatter=${this.valueFormatter&&!r?t=>this.valueFormatter(t,this.slot):P}
2742
2742
  min="${this.openEnded?P:this.min}"
2743
2743
  max="${this.openEnded?P:this.max}"
2744
- step="${W(this.step)}"
2744
+ step="${Q(this.step)}"
2745
2745
  ?invalid="${!!this.invalid}"
2746
- @input="${g(this,u,me)}"
2746
+ @input="${g(this,b,me)}"
2747
2747
  ?disabled="${this.disabled}"
2748
2748
  >
2749
2749
  ${this.suffix?Z`<w-affix slot="suffix" label="${this.suffix}"></w-affix>`:P}
@@ -2770,5 +2770,5 @@ Please compile your catalog first.
2770
2770
  ${this.ariaDescriptionText}
2771
2771
  </span>
2772
2772
  </div>
2773
- `}};B=new WeakMap,u=new WeakSet,Q=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},ee=function(){this._showTooltip=!1},pe=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},Y=function(r){this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:r,slot:this.slot}}))},re=async function(r,o){let a=Number.parseInt(r);if(this.openEnded&&!o&&this.step&&!(this.slot==="to"&&a>=Number(this.max)-1||this.slot==="from"&&a<=Number(this.min)+1)){let k=1/this.step;a=Math.round(a*k)/k,r=a.toString()}let s=Number.parseInt(this.max),n=Number.parseInt(this.min);if(!this.openEnded&&(a>s||a<n))return g(this,u,Y).call(this,z.t({id:"slider.error.out_of_bounds",message:"Value must be between {min} and {max}",values:{min:`${this.min} ${this.suffix}`.trim(),max:`${this.max} ${this.suffix}`.trim()}})),{shouldCancel:!0};r===""&&this.required&&g(this,u,Y).call(this,z.t({id:"slider.error.required",message:"This field is required"})),this.value=r;let i=r===this.max||r===this.min,d=!1;if(this.slot){let m=this.parentElement.querySelector('w-slider-thumb[slot="to"]'),k=this.parentElement.querySelector('w-slider-thumb[slot="from"]'),E=m.textfield.value||this.max,S=k.textfield.value||this.min,y=Number.parseInt(E),M=Number.parseInt(S),F=z.t({id:"slider.error.overlap",message:"The maximum value cannot be less than the minimum"});if(this.slot==="from"){let f=this.openEnded&&y>s?y:Math.min(y,this.openEnded?s-1:s);a>f&&(d=!0,this.openEnded&&i?this.value=String(f):this.value=E,o&&(g(this,u,Y).call(this,F),await this.updateComplete,this.textfield.value=r))}else{let f=this.openEnded&&M<n?M:Math.max(Number.parseInt(S),this.openEnded?n+1:n);a<f&&(d=!0,this.openEnded&&i?this.value=String(f):this.value=S,o&&(g(this,u,Y).call(this,F),await this.updateComplete,this.textfield.value=r))}}return d?{shouldCancel:!0}:(g(this,u,Y).call(this,""),this.range.value=Math.min(Math.max(Number(r),Number(this.min)),Number(this.max)).toString(),this.value=this.openEnded&&!o&&i?"":r,this.shadowRoot.querySelector("w-attention").handleDone(),{shouldCancel:!1})},me=async function(r){let o=r.currentTarget.tagName==="W-TEXTFIELD";if(r instanceof CustomEvent)return;let a=r.currentTarget.value;return(await g(this,u,re).call(this,a,o)).shouldCancel?(r.preventDefault(),!1):!0},Ie=async function(r){if(r.key!=="ArrowLeft"&&r.key!=="ArrowRight")return;let o=Number(this.range.value),a=this.step||1,s;r.key==="ArrowLeft"?s=o-a:s=o+a,s=Math.min(Math.max(s,Number(this.min)),Number(this.max)),(await g(this,u,re).call(this,s.toString(),!1)).shouldCancel&&r.preventDefault()},b.shadowRootOptions={...Ae.shadowRootOptions,delegatesFocus:!0},b.styles=[De,Pe,Le],p([$({attribute:"aria-label",reflect:!0})],b.prototype,"ariaLabel",2),p([$({attribute:"aria-description",reflect:!0})],b.prototype,"ariaDescription",2),p([$({reflect:!0})],b.prototype,"name",2),p([$({reflect:!0})],b.prototype,"value",2),p([$({type:Boolean,reflect:!0})],b.prototype,"disabled",2),p([$({type:Boolean,reflect:!0})],b.prototype,"invalid",2),p([$({attribute:!1,reflect:!1})],b.prototype,"openEnded",2),p([$({reflect:!0})],b.prototype,"placeholder",2),p([N()],b.prototype,"markers",2),p([N()],b.prototype,"required",2),p([N()],b.prototype,"step",2),p([N()],b.prototype,"min",2),p([N()],b.prototype,"max",2),p([N()],b.prototype,"suffix",2),p([$({attribute:!1})],b.prototype,"valueFormatter",2),p([$({attribute:!1})],b.prototype,"labelFormatter",2),p([be('input[type="range"]')],b.prototype,"range",2),p([be(".w-slider-thumb__tooltip-target")],b.prototype,"tooltipTarget",2),p([be("w-textfield")],b.prototype,"textfield",2),p([N()],b.prototype,"_showTooltip",2),p([N()],b.prototype,"_inputHasFocus",2),p([N()],b.prototype,"_hiddenTextfield",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",b);export{b as WarpSliderThumb};
2773
+ `}};B=new WeakMap,b=new WeakSet,W=function(){this._showTooltip=!0,this.shadowRoot.querySelector("w-attention").handleDone()},ee=function(){this._showTooltip=!1},pe=function(){this.range&&(this.value===""?this.range.value=this.boundaryValue:this.value&&(this.range.value=this.value))},Y=function(r){this.dispatchEvent(new CustomEvent("slidervalidity",{bubbles:!0,detail:{invalid:r,slot:this.slot}}))},re=async function(r,t){let a=Number.parseInt(r);if(this.openEnded&&!t&&this.step&&!(this.slot==="to"&&a>=Number(this.max)-1||this.slot==="from"&&a<=Number(this.min)+1)){let k=1/this.step;a=Math.round(a*k)/k,r=a.toString()}let s=Number.parseInt(this.max),n=Number.parseInt(this.min);if(!this.openEnded&&(a>s||a<n))return g(this,b,Y).call(this,z.t({id:"slider.error.out_of_bounds",message:"Value must be between {min} and {max}",values:{min:`${this.min} ${this.suffix}`.trim(),max:`${this.max} ${this.suffix}`.trim()}})),{shouldCancel:!0};r===""&&this.required&&g(this,b,Y).call(this,z.t({id:"slider.error.required",message:"This field is required"})),this.value=r;let i=r===this.max||r===this.min,d=!1;if(this.slot){let m=this.parentElement.querySelector('w-slider-thumb[slot="to"]'),k=this.parentElement.querySelector('w-slider-thumb[slot="from"]'),E=m.textfield.value||this.max,$=k.textfield.value||this.min,y=Number.parseInt(E),M=Number.parseInt($),F=z.t({id:"slider.error.overlap",message:"The maximum value cannot be less than the minimum"});if(this.slot==="from"){let f=this.openEnded&&y>s?y:Math.min(y,this.openEnded?s-1:s);a>f&&(d=!0,this.openEnded&&i?this.value=String(f):this.value=E,t&&(g(this,b,Y).call(this,F),await this.updateComplete,this.textfield.value=r))}else{let f=this.openEnded&&M<n?M:Math.max(Number.parseInt($),this.openEnded?n+1:n);a<f&&(d=!0,this.openEnded&&i?this.value=String(f):this.value=$,t&&(g(this,b,Y).call(this,F),await this.updateComplete,this.textfield.value=r))}}return d?{shouldCancel:!0}:(g(this,b,Y).call(this,""),this.range.value=Math.min(Math.max(Number(r),Number(this.min)),Number(this.max)).toString(),this.value=this.openEnded&&!t&&i?"":r,this.shadowRoot.querySelector("w-attention").handleDone(),{shouldCancel:!1})},me=async function(r){let t=r.currentTarget.tagName==="W-TEXTFIELD";if(r instanceof CustomEvent)return;let a=r.currentTarget.value;return(await g(this,b,re).call(this,a,t)).shouldCancel?(r.preventDefault(),!1):!0},Ie=async function(r){if(r.key!=="ArrowLeft"&&r.key!=="ArrowRight")return;let t=Number(this.range.value),a=this.step||1,s;r.key==="ArrowLeft"?s=t-a:s=t+a,s=Math.min(Math.max(s,Number(this.min)),Number(this.max)),(await g(this,b,re).call(this,s.toString(),!1)).shouldCancel&&r.preventDefault()},u.shadowRootOptions={...Ae.shadowRootOptions,delegatesFocus:!0},u.styles=[De,Pe,Le],p([S({attribute:"aria-label",reflect:!0})],u.prototype,"ariaLabel",2),p([S({attribute:"aria-description",reflect:!0})],u.prototype,"ariaDescription",2),p([S({reflect:!0})],u.prototype,"name",2),p([S({reflect:!0})],u.prototype,"value",2),p([S({type:Boolean,reflect:!0})],u.prototype,"disabled",2),p([S({type:Boolean,reflect:!0})],u.prototype,"invalid",2),p([S({attribute:!1,reflect:!1})],u.prototype,"openEnded",2),p([S({reflect:!0})],u.prototype,"placeholder",2),p([N()],u.prototype,"markers",2),p([N()],u.prototype,"required",2),p([N()],u.prototype,"step",2),p([N()],u.prototype,"min",2),p([N()],u.prototype,"max",2),p([N()],u.prototype,"suffix",2),p([S({attribute:!1})],u.prototype,"valueFormatter",2),p([S({attribute:!1})],u.prototype,"tooltipFormatter",2),p([S({attribute:!1})],u.prototype,"labelFormatter",2),p([be('input[type="range"]')],u.prototype,"range",2),p([be(".w-slider-thumb__tooltip-target")],u.prototype,"tooltipTarget",2),p([be("w-textfield")],u.prototype,"textfield",2),p([N()],u.prototype,"_showTooltip",2),p([N()],u.prototype,"_inputHasFocus",2),p([N()],u.prototype,"_hiddenTextfield",2);customElements.get("w-slider-thumb")||customElements.define("w-slider-thumb",u);export{u as WarpSliderThumb};
2774
2774
  //# sourceMappingURL=slider-thumb.js.map