@aurodesignsystem-dev/auro-formkit 0.0.0-pr1471.2 → 0.0.0-pr1471.3

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.
Files changed (47) hide show
  1. package/components/checkbox/demo/customize.min.js +1 -1
  2. package/components/checkbox/demo/getting-started.min.js +1 -1
  3. package/components/checkbox/demo/index.min.js +1 -1
  4. package/components/checkbox/dist/index.js +1 -1
  5. package/components/checkbox/dist/registered.js +1 -1
  6. package/components/combobox/demo/customize.min.js +3 -3
  7. package/components/combobox/demo/getting-started.min.js +3 -3
  8. package/components/combobox/demo/index.min.js +3 -3
  9. package/components/combobox/dist/index.js +3 -3
  10. package/components/combobox/dist/registered.js +3 -3
  11. package/components/counter/demo/customize.min.js +2 -2
  12. package/components/counter/demo/index.min.js +2 -2
  13. package/components/counter/dist/index.js +1 -1
  14. package/components/counter/dist/registered.js +1 -1
  15. package/components/datepicker/demo/index.min.js +3 -3
  16. package/components/datepicker/dist/index.js +3 -3
  17. package/components/datepicker/dist/registered.js +3 -3
  18. package/components/dropdown/demo/customize.min.js +1 -1
  19. package/components/dropdown/demo/getting-started.min.js +1 -1
  20. package/components/dropdown/demo/index.min.js +1 -1
  21. package/components/dropdown/dist/index.js +1 -1
  22. package/components/dropdown/dist/registered.js +1 -1
  23. package/components/form/demo/customize.min.js +13 -13
  24. package/components/form/demo/getting-started.min.js +13 -13
  25. package/components/form/demo/index.md +4 -5
  26. package/components/form/demo/index.min.js +13 -13
  27. package/components/form/demo/readme.md +4 -5
  28. package/components/form/demo/registerDemoDeps.min.js +13 -13
  29. package/components/input/demo/customize.min.js +1 -1
  30. package/components/input/demo/getting-started.min.js +1 -1
  31. package/components/input/demo/index.min.js +1 -1
  32. package/components/input/dist/index.js +1 -1
  33. package/components/input/dist/registered.js +1 -1
  34. package/components/radio/demo/customize.js +14 -0
  35. package/components/radio/demo/getting-started.js +3 -1
  36. package/components/radio/demo/index.min.js +1 -1
  37. package/components/radio/dist/index.js +1 -1
  38. package/components/radio/dist/registered.js +1 -1
  39. package/components/select/demo/customize.min.js +2 -2
  40. package/components/select/demo/getting-started.min.js +2 -2
  41. package/components/select/demo/index.min.js +2 -2
  42. package/components/select/dist/index.js +2 -2
  43. package/components/select/dist/registered.js +2 -2
  44. package/package.json +1 -1
  45. package/components/radio/demo/customize.min.js +0 -2181
  46. package/components/radio/demo/demo-support.min.js +0 -55807
  47. package/components/radio/demo/getting-started.min.js +0 -2186
@@ -1,2181 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2019 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- const t$2=globalThis,e$4=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$3=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$3)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$4&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$2=t=>new n$3("string"==typeof t?t:t+"",void 0,s$3),i$5=(t,...e)=>{const o=1===t.length?t[0]:e.reduce((e,s,o)=>e+(t=>{if(true===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1],t[0]);return new n$3(o,t,s$3)},S$1=(s,o)=>{if(e$4)s.adoptedStyleSheets=o.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$4?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$2(e)})(t):t;
7
-
8
- /**
9
- * @license
10
- * Copyright 2017 Google LLC
11
- * SPDX-License-Identifier: BSD-3-Clause
12
- */const{is:i$4,defineProperty:e$3,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$1,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$2=globalThis,c$1=a$2.trustedTypes,l$2=c$1?c$1.emptyScript:"",p$1=a$2.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$2={toAttribute(t,s){switch(s){case Boolean:t=t?l$2:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){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}},f$1=(t,s)=>!i$4(t,s),b$1={attribute:true,type:String,converter:u$2,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$2.litPropertyMetadata??=new WeakMap;let y$1 = class y 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,s=b$1){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$3(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b$1}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$1(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,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?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.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 S$1(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach(t=>t.hostConnected?.());}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.());}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$2).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$2;this._$Em=e;const r=h.fromAttribute(s,t.type);this[e]=r??this._$Ej?.get(e)??r,this._$Em=null;}}requestUpdate(t,s,i,e=false,h){if(void 0!==t){const r=this.constructor;if(false===e&&(h=this[t]),i??=r.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;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,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$2.reactiveElementVersions??=[]).push("2.1.2");
13
-
14
- /**
15
- * @license
16
- * Copyright 2017 Google LLC
17
- * SPDX-License-Identifier: BSD-3-Clause
18
- */
19
- const t$1=globalThis,i$3=t=>t,s$2=t$1.trustedTypes,e$2=s$2?s$2.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",o$3=`lit$${Math.random().toFixed(9).slice(2)}$`,n$1="?"+o$3,r=`<${n$1}>`,l$1=document,c=()=>l$1.createComment(""),a$1=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u$1=Array.isArray,d=t=>u$1(t)||"function"==typeof t?.[Symbol.iterator],f="[ \t\n\f\r]",v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_=/-->/g,m=/>/g,p=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,$=/"/g,y=/^(?:script|style|textarea|title)$/i,x=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),b=x(1),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,P=l$1.createTreeWalker(l$1,129);function V(t,i){if(!u$1(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==e$2?e$2.createHTML(i):i}const N=(t,i)=>{const s=t.length-1,e=[];let n,l=2===i?"<svg>":3===i?"<math>":"",c=v;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,f=0;for(;f<s.length&&(c.lastIndex=f,u=c.exec(s),null!==u);)f=c.lastIndex,c===v?"!--"===u[1]?c=_:void 0!==u[1]?c=m:void 0!==u[2]?(y.test(u[2])&&(n=RegExp("</"+u[2],"g")),c=p):void 0!==u[3]&&(c=p):c===p?">"===u[0]?(c=n??v,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?p:'"'===u[3]?$:g):c===$||c===g?c=p:c===_||c===m?c=v:(c=p,n=void 0);const x=c===p&&t[i+1].startsWith("/>")?" ":"";l+=c===v?s+r:d>=0?(e.push(a),s.slice(0,d)+h+s.slice(d)+o$3+x):s+o$3+(-2===d?i:x);}return [V(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),e]};class S{constructor({strings:t,_$litType$:i},e){let r;this.parts=[];let l=0,a=0;const u=t.length-1,d=this.parts,[f,v]=N(t,i);if(this.el=S.createElement(f,e),P.currentNode=this.el.content,2===i||3===i){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=P.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(h)){const i=v[a++],s=r.getAttribute(t).split(o$3),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:l,name:e[2],strings:s,ctor:"."===e[1]?I:"?"===e[1]?L:"@"===e[1]?z:H}),r.removeAttribute(t);}else t.startsWith(o$3)&&(d.push({type:6,index:l}),r.removeAttribute(t));if(y.test(r.tagName)){const t=r.textContent.split(o$3),i=t.length-1;if(i>0){r.textContent=s$2?s$2.emptyScript:"";for(let s=0;s<i;s++)r.append(t[s],c()),P.nextNode(),d.push({type:2,index:++l});r.append(t[i],c());}}}else if(8===r.nodeType)if(r.data===n$1)d.push({type:2,index:l});else {let t=-1;for(;-1!==(t=r.data.indexOf(o$3,t+1));)d.push({type:7,index:l}),t+=o$3.length-1;}l++;}}static createElement(t,i){const s=l$1.createElement("template");return s.innerHTML=t,s}}function M(t,i,s=t,e){if(i===E)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=a$1(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=M(t,h._$AS(t,i.values),h,e)),i}class R{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??l$1).importNode(i,true);P.currentNode=e;let h=P.nextNode(),o=0,n=0,r=s[0];for(;void 0!==r;){if(o===r.index){let i;2===r.type?i=new k(h,h.nextSibling,this,t):1===r.type?i=new r.ctor(h,r.name,r.strings,this,t):6===r.type&&(i=new Z(h,this,t)),this._$AV.push(i),r=s[++n];}o!==r?.index&&(h=P.nextNode(),o++);}return P.currentNode=l$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class k{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=M(this,t,i),a$1(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):d(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!==A&&a$1(this._$AH)?this._$AA.nextSibling.data=t:this.T(l$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=S.createElement(V(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new R(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=C.get(t.strings);return void 0===i&&C.set(t.strings,i=new S(t)),i}k(t){u$1(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new k(this.O(c()),this.O(c()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,s){for(this._$AP?.(false,true,s);t!==this._$AB;){const s=i$3(t).nextSibling;i$3(t).remove(),t=s;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}}class H{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=A;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=M(this,t,i,0),o=!a$1(t)||t!==this._$AH&&t!==E,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=M(this,e[s+n],i,n),r===E&&(r=this._$AH[n]),o||=!a$1(r)||r!==this._$AH[n],r===A?t=A:t!==A&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}class I extends H{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===A?void 0:t;}}class L extends H{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A);}}class z extends H{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=M(this,t,i,0)??A)===E)return;const s=this._$AH,e=t===A&&s!==A||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==A&&(s===A||e);e&&this.element.removeEventListener(this.name,this,s),h&&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 Z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t);}}const B=t$1.litHtmlPolyfillSupport;B?.(S,k),(t$1.litHtmlVersions??=[]).push("3.3.2");const D=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new k(i.insertBefore(c(),t),t,void 0,s??{});}return h._$AI(t),h};
20
-
21
- /**
22
- * @license
23
- * Copyright 2017 Google LLC
24
- * SPDX-License-Identifier: BSD-3-Clause
25
- */const s$1=globalThis;let i$2 = class i extends y$1{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 r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=D(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return E}};i$2._$litElement$=true,i$2["finalized"]=true,s$1.litElementHydrateSupport?.({LitElement:i$2});const o$2=s$1.litElementPolyfillSupport;o$2?.({LitElement:i$2});(s$1.litElementVersions??=[]).push("4.2.2");
26
-
27
- /**
28
- * @license
29
- * Copyright 2017 Google LLC
30
- * SPDX-License-Identifier: BSD-3-Clause
31
- */
32
- const t={ATTRIBUTE:1},e$1=t=>(...e)=>({_$litDirective$:t,values:e});let i$1 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
33
-
34
- /**
35
- * @license
36
- * Copyright 2018 Google LLC
37
- * SPDX-License-Identifier: BSD-3-Clause
38
- */const e=e$1(class extends i$1{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.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(s=>t[s]).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return E}});
39
-
40
- /**
41
- * @license
42
- * Copyright 2018 Google LLC
43
- * SPDX-License-Identifier: BSD-3-Clause
44
- */const o$1=o=>o??A;
45
-
46
- var focusVisible_min = {exports: {}};
47
-
48
- var hasRequiredFocusVisible_min;
49
-
50
- function requireFocusVisible_min () {
51
- if (hasRequiredFocusVisible_min) return focusVisible_min.exports;
52
- hasRequiredFocusVisible_min = 1;
53
- (function (module, exports) {
54
- !function(e,t){t();}(0,function(){function e(e){var t=true,n=false,o=null,d={text:true,search:true,url:true,tel:true,email:true,password:true,number:true,date:true,month:true,week:true,time:true,datetime:true,"datetime-local":true};function i(e){return !!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""));}function u(e){t=false;}function a(){document.addEventListener("mousemove",c),document.addEventListener("mousedown",c),document.addEventListener("mouseup",c),document.addEventListener("pointermove",c),document.addEventListener("pointerdown",c),document.addEventListener("pointerup",c),document.addEventListener("touchmove",c),document.addEventListener("touchstart",c),document.addEventListener("touchend",c);}function c(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=false,document.removeEventListener("mousemove",c),document.removeEventListener("mousedown",c),document.removeEventListener("mouseup",c),document.removeEventListener("pointermove",c),document.removeEventListener("pointerdown",c),document.removeEventListener("pointerup",c),document.removeEventListener("touchmove",c),document.removeEventListener("touchstart",c),document.removeEventListener("touchend",c));}document.addEventListener("keydown",function(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=true);},true),document.addEventListener("mousedown",u,true),document.addEventListener("pointerdown",u,true),document.addEventListener("touchstart",u,true),document.addEventListener("visibilitychange",function(e){"hidden"===document.visibilityState&&(n&&(t=true),a());},true),a(),e.addEventListener("focus",function(e){var n,o,u;i(e.target)&&(t||(n=e.target,o=n.type,"INPUT"===(u=n.tagName)&&d[o]&&!n.readOnly||"TEXTAREA"===u&&!n.readOnly||n.isContentEditable))&&s(e.target);},true),e.addEventListener("blur",function(e){var t;i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=true,window.clearTimeout(o),o=window.setTimeout(function(){n=false;},100),(t=e.target).hasAttribute("data-focus-visible-added")&&(t.classList.remove("focus-visible"),t.removeAttribute("data-focus-visible-added")));},true),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""));}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready");}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",false,false,{});}window.dispatchEvent(t);}"undefined"!=typeof document&&e(document);});
55
-
56
- } ());
57
- return focusVisible_min.exports;
58
- }
59
-
60
- requireFocusVisible_min();
61
-
62
- var styleCss$2 = i$5`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, 0.875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, 0.75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;outline:unset}:host(.focus-visible) .displayFlex .inputGroup:focus-within{width:auto}:host(.focus-visible) .rdoGroup{display:block;padding-right:var(--ds-size-100, 0.5rem);outline:3px solid transparent}:host(.focus-visible) .rdoGroup .label:after{outline-width:1px;outline-style:solid}.rdoGroup{position:relative;padding-right:var(--ds-size-100, 0.5rem);padding-left:var(--ds-size-100, 0.5rem);padding-top:var(--ds-size-50, 0.25rem);padding-bottom:var(--ds-size-75, 0.375rem)}.rdoGroup:has(:enabled) .label:hover{cursor:pointer}.label{display:block;margin-left:var(--ds-size-300, 1.5rem)}.label:after{position:absolute;z-index:1;top:var(--ds-size-50, 0.25rem);left:var(--ds-size-50, 0.25rem);width:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));height:calc(var(--ds-size-200, 1rem) + var(--ds-size-50, 0.25rem));content:"";border-radius:50%;border:1px solid}.slotContent{display:block;margin-left:var(--ds-size-400, 2rem);padding-left:var(--ds-size-100, 0.5rem)}`;
63
-
64
- var colorCss$2 = i$5`.label{color:var(--ds-auro-radio-label-color)}.label:after{background-color:var(--ds-auro-radio-btn-fill-color);border-color:var(--ds-auro-radio-btn-border-color);box-shadow:inset 0 0 0 3px var(--ds-auro-radio-btn-inset-color);outline-color:var(--ds-auro-radio-btn-border-color);-webkit-tap-highlight-color:var(--ds-auro-radio-tap-color)}:host([checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator, #ffffff);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue, #01426a);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue, #01426a)}:host([error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error, #e31f26)}:host([disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-disabled, #dddddd);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-disabled, #dddddd)}:host(.focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused, #01426a)}:host([onDark]),:host([appearance=inverse]){--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-inverse, #ffffff)}:host([onDark][checked]),:host([appearance=inverse][checked]){--ds-auro-radio-btn-inset-color: var(--ds-advanced-color-boolean-indicator-inverse, #00274a);--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff);--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-istrue-inverse, #ffffff)}:host([onDark][error]),:host([appearance=inverse][error]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][checked][error]),:host([appearance=inverse][checked][error]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-boolean-error-inverse, #f9a4a8)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894);--ds-auro-radio-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][checked][disabled]),:host([appearance=inverse][checked][disabled]){--ds-auro-radio-btn-fill-color: var(--ds-advanced-color-state-background-inverse-disabled, #7e8894)}:host([onDark].focus-visible),:host([appearance=inverse].focus-visible){--ds-auro-radio-btn-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}`;
65
-
66
- var tokenCss = i$5`:host{--ds-auro-radio-group-label-color: inherit;--ds-auro-radio-btn-border-color: var(--ds-basic-color-border-bold, #585e67);--ds-auro-radio-btn-fill-color: transparent;--ds-auro-radio-btn-inset-color: transparent;--ds-auro-radio-label-color: inherit;--ds-auro-radio-tap-color: transparent}`;
67
-
68
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
69
- // See LICENSE in the project root for license information.
70
-
71
- // ---------------------------------------------------------------------
72
-
73
- /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
74
-
75
- let AuroLibraryRuntimeUtils$1 = class AuroLibraryRuntimeUtils {
76
-
77
- /* eslint-disable jsdoc/require-param */
78
-
79
- /**
80
- * This will register a new custom element with the browser.
81
- * @param {String} name - The name of the custom element.
82
- * @param {Object} componentClass - The class to register as a custom element.
83
- * @returns {void}
84
- */
85
- registerComponent(name, componentClass) {
86
- if (!customElements.get(name)) {
87
- customElements.define(name, class extends componentClass {});
88
- }
89
- }
90
-
91
- /**
92
- * Finds and returns the closest HTML Element based on a selector.
93
- * @returns {void}
94
- */
95
- closestElement(
96
- selector, // selector like in .closest()
97
- base = this, // extra functionality to skip a parent
98
- __Closest = (el, found = el && el.closest(selector)) =>
99
- !el || el === document || el === window
100
- ? null // standard .closest() returns null for non-found selectors also
101
- : found
102
- ? found // found a selector INside this element
103
- : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
104
- ) {
105
- return __Closest(base);
106
- }
107
- /* eslint-enable jsdoc/require-param */
108
-
109
- /**
110
- * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
111
- * @param {Object} elem - The element to check.
112
- * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
113
- * @returns {void}
114
- */
115
- handleComponentTagRename(elem, tagName) {
116
- const tag = tagName.toLowerCase();
117
- const elemTag = elem.tagName.toLowerCase();
118
-
119
- if (elemTag !== tag) {
120
- elem.setAttribute(tag, true);
121
- }
122
- }
123
-
124
- /**
125
- * Validates if an element is a specific Auro component.
126
- * @param {Object} elem - The element to validate.
127
- * @param {String} tagName - The name of the Auro component to check against.
128
- * @returns {Boolean} - Returns true if the element is the specified Auro component.
129
- */
130
- elementMatch(elem, tagName) {
131
- const tag = tagName.toLowerCase();
132
- const elemTag = elem.tagName.toLowerCase();
133
-
134
- return elemTag === tag || elem.hasAttribute(tag);
135
- }
136
-
137
- /**
138
- * Gets the text content of a named slot.
139
- * @returns {String}
140
- * @private
141
- */
142
- getSlotText(elem, name) {
143
- const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
144
- const nodes = slot?.assignedNodes({ flatten: true }) || [];
145
- const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
146
-
147
- return text || null;
148
- }
149
- };
150
-
151
- /* eslint-disable max-lines, no-underscore-dangle */
152
- // Copyright (c) 2026 Alaska Airlines. All rights reserved. Licensed under the Apache-2.0 license
153
- // See LICENSE in the project root for license information.
154
-
155
-
156
- /**
157
- * The `auro-radio` element is used to a button that allows the user to select one option from a set.
158
- * @customElement auro-radio
159
- *
160
- * @event toggleSelected - Notifies that the component has toggled the checked/selected state.
161
- * @event {CustomEvent<any>} change - (Deprecated) Notifies when checked value is changed.
162
- * @event {InputEvent} input - Notifies when when checked value is changed by user's interface.
163
- * @event focusSelected - Notifies that the component has gained focus.
164
- * @event auroRadio-blur - Notifies that the component has lost focus.
165
- * @event resetRadio - Notifies that the component has reset the checked/selected state.
166
- * @event auroRadio-selected - Notifies that the component has been marked as checked/selected.
167
- *
168
- * @csspart radio - apply css to a specific checkbox.
169
- * @csspart radio-input - apply css to a specific checkbox's input.
170
- * @csspart radio-label - apply css to a specific checkbox's label.
171
- */
172
- class AuroRadio extends i$2 {
173
- constructor() {
174
- super();
175
-
176
- this._initializeDefaults();
177
- }
178
-
179
- _initializeDefaults() {
180
- this.appearance = "default";
181
- this.checked = false;
182
- this.disabled = false;
183
- this.required = false;
184
- this.error = false;
185
- this.onDark = false;
186
- this.touched = false;
187
- this.role = 'radio';
188
-
189
- /**
190
- * @private
191
- */
192
- this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
193
- }
194
-
195
- static get styles() {
196
- return [
197
- styleCss$2,
198
- colorCss$2,
199
- tokenCss
200
- ];
201
- }
202
-
203
- // function to define props used within the scope of this component
204
- static get properties() {
205
- return {
206
-
207
- /**
208
- * Defines whether the component will be on lighter or darker backgrounds.
209
- * @type {'default' | 'inverse'}
210
- * @default 'default'
211
- */
212
- appearance: {
213
- type: String,
214
- reflect: true
215
- },
216
-
217
- /**
218
- * If set to true, the radio button will be filled.
219
- */
220
- checked: {
221
- type: Boolean,
222
- reflect: true
223
- },
224
-
225
- /**
226
- * If set to true, the radio button will be non-clickable.
227
- */
228
- disabled: {
229
- type: Boolean,
230
- reflect: true
231
- },
232
-
233
- /**
234
- * If set to true, sets an error state on the radio button.
235
- */
236
- error: {
237
- type: Boolean,
238
- reflect: true
239
- },
240
-
241
- /**
242
- * The id global attribute defines an identifier (ID) which must be unique in the whole document.
243
- */
244
- id: {
245
- type: String,
246
- reflect: true
247
- },
248
-
249
- /**
250
- * ID for input node.
251
- * @private
252
- */
253
- inputId: {
254
- type: String,
255
- reflect: false,
256
- attribute: false
257
- },
258
-
259
- /**
260
- * Label for the radio button.
261
- */
262
- label: { type: String },
263
-
264
- /**
265
- * Name for the radio button group.
266
- */
267
- name: { type: String },
268
-
269
- /**
270
- * DEPRECATED - use `appearance="inverse"` instead.
271
- */
272
- onDark: {
273
- type: Boolean,
274
- reflect: true
275
- },
276
-
277
- /**
278
- * Defines element as required.
279
- */
280
- required: {
281
- type: Boolean,
282
- reflect: true
283
- },
284
-
285
- /**
286
- * Don't add to api.md since changing of this can easily break a11y.
287
- * @private
288
- */
289
- role: {
290
- type: String,
291
- reflect: true
292
- },
293
-
294
- /**
295
- * Whether or not the radio button has been touched by the user.
296
- * @private
297
- */
298
- touched: {
299
- type: Boolean,
300
- reflect: true,
301
- attribute: false
302
- },
303
-
304
- /**
305
- * The value of the radio button.
306
- */
307
- value: { type: String }
308
- };
309
- }
310
-
311
- /**
312
- * This will register this element with the browser.
313
- * @param {string} [name="auro-radio"] - The name of the element that you want to register.
314
- *
315
- * @example
316
- * AuroRadio.register("custom-radio") // This will resgiter this element to <custom-radio/>
317
- *
318
- */
319
- static register(name = "auro-radio") {
320
- AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadio);
321
- }
322
-
323
- /**
324
- * Method for handling content when change event is fired.
325
- * @private
326
- * @param {Event} event - The trigger event tied to this function.
327
- * @returns {void}
328
- */
329
- handleChange(event) {
330
- this.checked = event.target.checked;
331
- const customEvent = new CustomEvent(event.type, event);
332
- this.dispatchEvent(customEvent);
333
- }
334
-
335
- /**
336
- * Method for handling content when input event is fired.
337
- * @private
338
- * @param {Event} event - The trigger event tied to this function.
339
- * @returns {void}
340
- */
341
- handleInput(event) {
342
- this.checked = event.target.checked;
343
- this.dispatchEvent(new CustomEvent('toggleSelected', {
344
- bubbles: true,
345
- composed: true,
346
- target: this
347
- }));
348
- }
349
-
350
- /**
351
- * Method for handling focus event.
352
- * @private
353
- * @param {Event} event - The trigger event tied to this function.
354
- * @returns {void}
355
- */
356
- handleFocus(event) {
357
- this.touched = true;
358
- this.dispatchEvent(new CustomEvent('focusSelected', {
359
- bubbles: true,
360
- composed: true,
361
- target: event.target
362
- }));
363
- }
364
-
365
- /**
366
- * Method for handling blur event.
367
- * @private
368
- * @param {Event} event - The trigger event tied to this function.
369
- * @returns {void}
370
- */
371
- handleBlur(event) {
372
- this.dispatchEvent(new CustomEvent('auroRadio-blur', {
373
- bubbles: true,
374
- composed: true,
375
- target: event.target
376
- }));
377
- }
378
-
379
- /**
380
- * Resets component to initial state.
381
- * @returns {void}
382
- */
383
- reset() {
384
- this.touched = false;
385
- this.checked = false;
386
- this.error = false;
387
- }
388
-
389
- updated(changedProperties) {
390
- if (changedProperties.has('required')) {
391
- this.setAttribute('aria-required', this.isRequired(this.required));
392
- }
393
-
394
- if (changedProperties.has('disabled')) {
395
- if (this.disabled) {
396
- this.setAttribute('aria-disabled', '');
397
- } else {
398
- this.removeAttribute('aria-disabled');
399
- }
400
- }
401
-
402
- if (changedProperties.has('checked')) {
403
- this.setAttribute('aria-checked', this.checked ? 'true' : 'false');
404
- // eslint-disable-next-line no-magic-numbers
405
- this.setAttribute('tabindex', this.checked ? 0 : -1);
406
-
407
- this.dispatchEvent(new CustomEvent('resetRadio', {
408
- bubbles: true,
409
- composed: true
410
- }));
411
-
412
- if (this.checked) {
413
- this.dispatchEvent(new CustomEvent('auroRadio-selected', {
414
- bubbles: true,
415
- composed: true
416
- }));
417
- }
418
- }
419
- }
420
-
421
- /**
422
- * Method for handling passing the required status to aria.
423
- * @private
424
- * @param {Boolean} required - The element's required attribute.
425
- * @returns {void}
426
- */
427
- isRequired(required) {
428
- if (required) {
429
- return 'true';
430
- }
431
-
432
- return 'false';
433
- }
434
-
435
- firstUpdated() {
436
- // Add the tag name as an attribute if it is different than the component name
437
- this.runtimeUtils.handleComponentTagRename(this, 'auro-radio');
438
-
439
- this.addEventListener('focus', this.handleFocus);
440
- this.addEventListener('blur', this.handleBlur);
441
-
442
- this.input = this.shadowRoot.querySelector('input');
443
-
444
- this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
445
-
446
- this.addEventListener('click', () => {
447
- this.input.click();
448
- });
449
- }
450
-
451
- // function that renders the HTML and CSS into the scope of the component
452
- render() {
453
- const labelClasses = {
454
- 'ods-inputLabel': true,
455
- 'ods-inputLabel--radio': true,
456
- 'label': true,
457
- 'label--rdo': true,
458
- 'errorBorder': this.error
459
- };
460
-
461
- return b`
462
- <div class="ods-inputGroup rdoGroup body-default" part="radio">
463
- <input
464
- class="util_displayHidden ods-inputOption rdo--input"
465
- part="radio-input"
466
- @input="${this.handleInput}"
467
- @change="${this.handleChange}"
468
- ?disabled="${this.disabled}"
469
- .checked="${this.checked}"
470
- id="${this.inputId}"
471
- name="${o$1(this.name)}"
472
- type="radio"
473
- .value="${this.value}"
474
- aria-hidden="true"
475
- tabindex="-1"
476
- />
477
-
478
- <label for="${this.inputId}" class="${e(labelClasses)}" part="radio-label">
479
- <slot>${this.label}</slot>
480
- </label>
481
- </div>
482
- <slot name="content" class="slotContent"></slot>
483
- `;
484
- }
485
- }
486
-
487
- /**
488
- * @license
489
- * Copyright 2020 Google LLC
490
- * SPDX-License-Identifier: BSD-3-Clause
491
- */
492
- const a=Symbol.for(""),o=t=>{if(t?.r===a)return t?._$litStatic$},s=t=>({_$litStatic$:t,r:a}),i=(t,...r)=>({_$litStatic$:r.reduce((r,e,a)=>r+(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.`)})(e)+t[a+1],t[0]),r:a}),l=new Map,n=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=false;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o(i));)c+=s+r[++$],f=true;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l.get(t))&&(n.raw=n,l.set(t,r=n)),e=u;}return t(r,...e)},u=n(b);
493
-
494
- var styleCss$1 = i$5`:host{display:block;padding-bottom:var(--ds-size-150, 0.75rem)}fieldset{all:unset}.displayFlex legend+slot{display:flex;white-space:nowrap}legend{margin-bottom:var(--ds-size-150, 0.75rem)}.hidden{display:none}[auro-helptext]{margin-top:var(--ds-size-150, 0.75rem)}`;
495
-
496
- var colorCss$1 = i$5`:host legend{color:var(--ds-auro-radio-group-label-color)}:host([disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host([onDark]),:host([appearance=inverse]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-radio-group-label-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}`;
497
-
498
- class DateFormatter {
499
-
500
- constructor() {
501
-
502
- /**
503
- * @description Parses a date string into its components.
504
- * @param {string} dateStr - Date string to parse.
505
- * @param {string} format - Date format to parse.
506
- * @returns {Object<key["month" | "day" | "year"]: number>|undefined}
507
- */
508
- this.parseDate = (dateStr, format = 'mm/dd/yyyy') => {
509
-
510
- // Guard Clause: Date string is defined
511
- if (!dateStr) {
512
- return undefined;
513
- }
514
-
515
- // Assume the separator is a "/" a defined in our code base
516
- const separator = '/';
517
-
518
- // Get the parts of the date and format
519
- const valueParts = dateStr.split(separator);
520
- const formatParts = format.split(separator);
521
-
522
- // Check if the value and format have the correct number of parts
523
- if (valueParts.length !== formatParts.length) {
524
- throw new Error('AuroDatepickerUtilities | parseDate: Date string and format length do not match');
525
- }
526
-
527
- // Holds the result to be returned
528
- const result = formatParts.reduce((acc, part, index) => {
529
- const value = valueParts[index];
530
-
531
- if ((/m/iu).test(part)) {
532
- acc.month = value;
533
- } else if ((/d/iu).test(part)) {
534
- acc.day = value;
535
- } else if ((/y/iu).test(part)) {
536
- acc.year = value;
537
- }
538
-
539
- return acc;
540
- }, {});
541
-
542
- // If we found all the parts, return the result
543
- if (result.month && result.year) {
544
- return result;
545
- }
546
-
547
- // Throw an error to let the dev know we were unable to parse the date string
548
- throw new Error('AuroDatepickerUtilities | parseDate: Unable to parse date string');
549
- };
550
-
551
- /**
552
- * Convert a date object to string format.
553
- * @param {Object} date - Date to convert to string.
554
- * @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
555
- * @returns {String} Returns the date as a string.
556
- */
557
- this.getDateAsString = (date, locale = undefined) => date.toLocaleDateString(locale, {
558
- year: "numeric",
559
- month: "2-digit",
560
- day: "2-digit",
561
- });
562
-
563
- /**
564
- * Converts a date string to a North American date format.
565
- * @param {String} dateStr - Date to validate.
566
- * @param {String} format - Date format to validate against.
567
- * @returns {Boolean}
568
- */
569
- this.toNorthAmericanFormat = (dateStr, format) => {
570
-
571
- if (format === 'mm/dd/yyyy') {
572
- return dateStr;
573
- }
574
-
575
- const parsedDate = this.parseDate(dateStr, format);
576
-
577
- if (!parsedDate) {
578
- throw new Error('AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string');
579
- }
580
-
581
- const { month, day, year } = parsedDate;
582
-
583
- const dateParts = [];
584
- if (month) {
585
- dateParts.push(month);
586
- }
587
-
588
- if (day) {
589
- dateParts.push(day);
590
- }
591
-
592
- if (year) {
593
- dateParts.push(year);
594
- }
595
-
596
- return dateParts.join('/');
597
- };
598
- }
599
- }
600
- const dateFormatter = new DateFormatter();
601
-
602
- // filepath: dateConstraints.mjs
603
- const DATE_UTIL_CONSTRAINTS = {
604
- maxDay: 31,
605
- maxMonth: 12,
606
- maxYear: 2400,
607
- minDay: 1,
608
- minMonth: 1,
609
- minYear: 1900,
610
- };
611
-
612
- class AuroDateUtilitiesBase {
613
-
614
- /**
615
- * @description The maximum day value allowed by the various utilities in this class.
616
- * @readonly
617
- * @type {Number}
618
- */
619
- get maxDay() {
620
- return DATE_UTIL_CONSTRAINTS.maxDay;
621
- }
622
-
623
- /**
624
- * @description The maximum month value allowed by the various utilities in this class.
625
- * @readonly
626
- * @type {Number}
627
- */
628
- get maxMonth() {
629
- return DATE_UTIL_CONSTRAINTS.maxMonth;
630
- }
631
-
632
- /**
633
- * @description The maximum year value allowed by the various utilities in this class.
634
- * @readonly
635
- * @type {Number}
636
- */
637
- get maxYear() {
638
- return DATE_UTIL_CONSTRAINTS.maxYear;
639
- }
640
-
641
- /**
642
- * @description The minimum day value allowed by the various utilities in this class.
643
- * @readonly
644
- * @type {Number}
645
- */
646
- get minDay() {
647
- return DATE_UTIL_CONSTRAINTS.minDay;
648
- }
649
-
650
- /**
651
- * @description The minimum month value allowed by the various utilities in this class.
652
- * @readonly
653
- * @type {Number}
654
- */
655
- get minMonth() {
656
- return DATE_UTIL_CONSTRAINTS.minMonth;
657
- }
658
-
659
- /**
660
- * @description The minimum year value allowed by the various utilities in this class.
661
- * @readonly
662
- * @type {Number}
663
- */
664
- get minYear() {
665
- return DATE_UTIL_CONSTRAINTS.minYear;
666
- }
667
- }
668
-
669
- /* eslint-disable no-magic-numbers */
670
-
671
- class AuroDateUtilities extends AuroDateUtilitiesBase {
672
-
673
- /**
674
- * Returns the current century.
675
- * @returns {String} The current century.
676
- */
677
- getCentury () {
678
- return String(new Date().getFullYear()).slice(0, 2);
679
- }
680
-
681
- /**
682
- * Returns a four digit year.
683
- * @param {String} year - The year to convert to four digits.
684
- * @returns {String} The four digit year.
685
- */
686
- getFourDigitYear (year) {
687
-
688
- const strYear = String(year).trim();
689
- return strYear.length <= 2 ? this.getCentury() + strYear : strYear;
690
- }
691
-
692
- constructor() {
693
-
694
- super();
695
-
696
- /**
697
- * Compares two dates to see if they match.
698
- * @param {Object} date1 - First date to compare.
699
- * @param {Object} date2 - Second date to compare.
700
- * @returns {Boolean} Returns true if the dates match.
701
- */
702
- this.datesMatch = (date1, date2) => new Date(date1).getTime() === new Date(date2).getTime();
703
-
704
- /**
705
- * Returns true if value passed in is a valid date.
706
- * @param {String} date - Date to validate.
707
- * @param {String} format - Date format to validate against.
708
- * @returns {Boolean}
709
- */
710
- this.validDateStr = (date, format) => {
711
-
712
- // The length we expect the date string to be
713
- const dateStrLength = format.length;
714
-
715
- // Guard Clause: Date and format are defined
716
- if (typeof date === "undefined" || typeof format === "undefined") {
717
- throw new Error('AuroDatepickerUtilities | validateDateStr: Date and format are required');
718
- }
719
-
720
- // Guard Clause: Date should be of type string
721
- if (typeof date !== "string") {
722
- throw new Error('AuroDatepickerUtilities | validateDateStr: Date must be a string');
723
- }
724
-
725
- // Guard Clause: Format should be of type string
726
- if (typeof format !== "string") {
727
- throw new Error('AuroDatepickerUtilities | validateDateStr: Format must be a string');
728
- }
729
-
730
- // Guard Clause: Length is what we expect it to be
731
- if (date.length !== dateStrLength) {
732
- return false;
733
- }
734
- // Get a formatted date string and parse it
735
- const dateParts = dateFormatter.parseDate(date, format);
736
-
737
- // Guard Clause: Date parse succeeded
738
- if (!dateParts) {
739
- return false;
740
- }
741
-
742
- // Create the expected date string based on the date parts
743
- const expectedDateStr = `${dateParts.month}/${dateParts.day || "01"}/${this.getFourDigitYear(dateParts.year)}`;
744
-
745
- // Generate a date object that we will extract a string date from to compare to the passed in date string
746
- const dateObj = new Date(this.getFourDigitYear(dateParts.year), dateParts.month - 1, dateParts.day || 1);
747
-
748
- // Get the date string of the date object we created from the string date
749
- const actualDateStr = dateFormatter.getDateAsString(dateObj, "en-US");
750
-
751
- // Guard Clause: Generated date matches date string input
752
- if (expectedDateStr !== actualDateStr) {
753
- return false;
754
- }
755
-
756
- // If we passed all other checks, we can assume the date is valid
757
- return true;
758
- };
759
-
760
- /**
761
- * Determines if a string date value matches the format provided.
762
- * @param {string} value = The date string value.
763
- * @param { string} format = The date format to match against.
764
- * @returns {boolean}
765
- */
766
- this.dateAndFormatMatch = (value, format) => {
767
-
768
- // Ensure we have both values we need to do the comparison
769
- if (!value || !format) {
770
- throw new Error('AuroFormValidation | dateFormatMatch: value and format are required');
771
- }
772
-
773
- // If the lengths are different, they cannot match
774
- if (value.length !== format.length) {
775
- return false;
776
- }
777
-
778
- // Get the parts of the date
779
- const dateParts = dateFormatter.parseDate(value, format);
780
-
781
- // Validator for day
782
- const dayValueIsValid = (day) => {
783
-
784
- // Guard clause: if there is no day in the dateParts, we can ignore this check.
785
- if (!dateParts.day) {
786
- return true;
787
- }
788
-
789
- // Guard clause: ensure day exists.
790
- if (!day) {
791
- return false;
792
- }
793
-
794
- // Convert day to number
795
- const numDay = Number.parseInt(day, 10);
796
-
797
- // Guard clause: ensure day is a valid integer
798
- if (Number.isNaN(numDay)) {
799
- throw new Error('AuroDatepickerUtilities | dayValueIsValid: Unable to parse day value integer');
800
- }
801
-
802
- // Guard clause: ensure day is within the valid range
803
- if (numDay < this.minDay || numDay > this.maxDay) {
804
- return false;
805
- }
806
-
807
- // Default return
808
- return true;
809
- };
810
-
811
- // Validator for month
812
- const monthValueIsValid = (month) => {
813
-
814
- // Guard clause: ensure month exists.
815
- if (!month) {
816
- return false;
817
- }
818
-
819
- // Convert month to number
820
- const numMonth = Number.parseInt(month, 10);
821
-
822
- // Guard clause: ensure month is a valid integer
823
- if (Number.isNaN(numMonth)) {
824
- throw new Error('AuroDatepickerUtilities | monthValueIsValid: Unable to parse month value integer');
825
- }
826
-
827
- // Guard clause: ensure month is within the valid range
828
- if (numMonth < this.minMonth || numMonth > this.maxMonth) {
829
- return false;
830
- }
831
-
832
- // Default return
833
- return true;
834
- };
835
-
836
- // Validator for year
837
- const yearIsValid = (_year) => {
838
-
839
- // Guard clause: ensure year exists.
840
- if (!_year) {
841
- return false;
842
- }
843
-
844
- // Get the full year
845
- const year = this.getFourDigitYear(_year);
846
-
847
- // Convert year to number
848
- const numYear = Number.parseInt(year, 10);
849
-
850
- // Guard clause: ensure year is a valid integer
851
- if (Number.isNaN(numYear)) {
852
- throw new Error('AuroDatepickerUtilities | yearValueIsValid: Unable to parse year value integer');
853
- }
854
-
855
- // Guard clause: ensure year is within the valid range
856
- if (numYear < this.minYear || numYear > this.maxYear) {
857
- return false;
858
- }
859
-
860
- // Default return
861
- return true;
862
- };
863
-
864
- // Self-contained checks for month, day, and year
865
- const checks = [
866
- monthValueIsValid(dateParts.month),
867
- dayValueIsValid(dateParts.day),
868
- yearIsValid(dateParts.year)
869
- ];
870
-
871
- // If any of the checks failed, the date format does not match and the result is invalid
872
- const isValid = checks.every((check) => check === true);
873
-
874
- // If the check is invalid, return false
875
- if (!isValid) {
876
- return false;
877
- }
878
-
879
- // Default case
880
- return true;
881
- };
882
- }
883
- }
884
-
885
- // Export a class instance
886
- const dateUtilities = new AuroDateUtilities();
887
-
888
- // Export the class instance methods individually
889
- const {
890
- datesMatch,
891
- validDateStr,
892
- dateAndFormatMatch,
893
- minDay,
894
- minMonth,
895
- minYear,
896
- maxDay,
897
- maxMonth,
898
- maxYear
899
- } = dateUtilities;
900
-
901
- const {
902
- toNorthAmericanFormat,
903
- parseDate,
904
- getDateAsString
905
- } = dateFormatter;
906
-
907
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
908
- // See LICENSE in the project root for license information.
909
-
910
-
911
- class AuroFormValidation {
912
-
913
- constructor() {
914
- this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
915
- }
916
-
917
- /**
918
- * Resets the element to its initial state.
919
- * @private
920
- * @param {object} elem - HTML element to reset.
921
- * @returns {void}
922
- */
923
- reset(elem) {
924
- elem.validity = undefined;
925
- elem.value = undefined;
926
- elem.touched = false;
927
-
928
- // Resets the second value of the datepicker in range state
929
- if (elem.valueEnd) {
930
- elem.valueEnd = undefined;
931
- }
932
-
933
- // Resets selected option of element
934
- if (elem.optionSelected) {
935
- elem.optionSelected = undefined;
936
- }
937
-
938
- // Runs validation to handle error attribute
939
- this.validate(elem);
940
- }
941
-
942
- /**
943
- * Validates the attributes of a given element based on predefined validation rules.
944
- *
945
- * @param {HTMLElement} elem - The element to be validated.
946
- * @returns {void}
947
- *
948
- * @example
949
- * // Assuming `inputElement` is a reference to an input element in the DOM
950
- * validateElementAttributes(inputElement);
951
- *
952
- * The function checks the element's attributes against the validation rules defined for 'input' and 'counter' types.
953
- * If a validation rule is violated, it sets the element's validity state and error message accordingly.
954
- *
955
- * Validation rules:
956
- * - input:
957
- * - length:
958
- * - tooShort: Checks if the value length is less than the minimum length.
959
- * - tooLong: Checks if the value length exceeds the maximum length.
960
- * - pattern:
961
- * - patternMismatch: Checks if the value does not match the specified pattern.
962
- * - counter:
963
- * - range:
964
- * - rangeOverflow: Checks if the value exceeds the maximum value.
965
- * - rangeUnderflow: Checks if the value is less than the minimum value.
966
- */
967
- validateElementAttributes(elem) {
968
- const validationRules = {
969
- input: {
970
- length: [
971
- {
972
- check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
973
- validity: 'tooShort',
974
- message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
975
- },
976
- {
977
- check: (e) => e.value?.length > e.maxLength,
978
- validity: 'tooLong',
979
- message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
980
- }
981
- ],
982
- pattern: [
983
- {
984
- check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
985
- validity: 'patternMismatch',
986
- message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
987
- }
988
- ]
989
- },
990
- counter: {
991
- range: [
992
- {
993
- check: (e) => e.max !== undefined && Number(e.max) < Number(e.value),
994
- validity: 'rangeOverflow',
995
- message: e => e.getAttribute('setCustomValidityRangeOverflow') || ''
996
- },
997
- {
998
- check: (e) => e.min !== undefined && Number(e.min) > Number(e.value),
999
- validity: 'rangeUnderflow',
1000
- message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
1001
- }
1002
- ]
1003
- },
1004
- combobox: {
1005
- filter: [
1006
- {
1007
- check: (e) => {
1008
-
1009
- // Guard Clause: If the behavior is not 'filter', skip this validation
1010
- if (e.behavior !== 'filter') return false;
1011
-
1012
- // Get the current input value
1013
- const currentInputValue = e.input.value;
1014
-
1015
- // Skip validation if the input has no value
1016
- if (!currentInputValue) return false;
1017
-
1018
- /**
1019
- * Let's check if the option selected and combobox value match.
1020
- */
1021
-
1022
- // Guard Clause: If there is no option selected fail the validation
1023
- if (!e.optionSelected) return true;
1024
-
1025
- // Guard Clause: If there is no value fail the validation
1026
- if (!e.value) return true;
1027
-
1028
- // Guard Clause: If the selected option's value doesn't match the input value fail the validation
1029
- if (e.optionSelected.value !== e.value) return true;
1030
-
1031
- /**
1032
- * Now let's make sure the user hasn't change the value in the input after selecting an option.
1033
- * This is to make sure there's no user confusion if they select an option but then change the value to something else.
1034
- */
1035
-
1036
- // Guard Clause: If the current input value doesn't match the option selected value fail the validation
1037
- if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
1038
-
1039
- // Guard Clause: If the current input value doesn't match the combobox value fail the validation
1040
- if (currentInputValue && currentInputValue !== e.value) return true;
1041
-
1042
- // If all the checks passed the validation passes
1043
- return false;
1044
- },
1045
- validity: 'valueMissing',
1046
- message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
1047
- }
1048
- ]
1049
- }
1050
- };
1051
-
1052
- let elementType;
1053
- if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1054
- elementType = 'input';
1055
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
1056
- elementType = 'counter';
1057
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
1058
- elementType = 'combobox';
1059
- }
1060
-
1061
- if (elementType) {
1062
- const rules = validationRules[elementType];
1063
-
1064
- if (rules) {
1065
- Object.values(rules).flat().forEach(rule => {
1066
- if (rule.check(elem)) {
1067
- elem.validity = rule.validity;
1068
- elem.errorMessage = rule.message(elem);
1069
- }
1070
- });
1071
- }
1072
- }
1073
- }
1074
-
1075
- /**
1076
- * Determines the validity state of the element based on the type attribute.
1077
- * @private
1078
- * @param {object} elem - HTML element to validate.
1079
- * @returns {void}
1080
- */
1081
- validateType(elem) {
1082
- if (elem.hasAttribute('type')) {
1083
- if (elem.type === 'email') {
1084
- const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
1085
-
1086
- if (!elem.value.match(emailRegex)) {
1087
- elem.validity = 'patternMismatch';
1088
- elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1089
- return;
1090
- }
1091
- } else if (elem.type === 'credit-card') {
1092
- if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
1093
- elem.validity = 'tooShort';
1094
- elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1095
- return;
1096
- }
1097
- } else if (elem.type === 'number') {
1098
- if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
1099
- elem.validity = 'rangeOverflow';
1100
- elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1101
- return;
1102
- }
1103
-
1104
- if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
1105
- elem.validity = 'rangeUnderflow';
1106
- elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1107
- return;
1108
- }
1109
- } else if (elem.type === 'date' && elem.value?.length > 0) {
1110
-
1111
- // Guard Clause: if the value is too short
1112
- if (elem.value?.length < elem.lengthForType) {
1113
-
1114
- elem.validity = 'tooShort';
1115
- elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1116
- return;
1117
- }
1118
-
1119
- // Guard Clause: If the value is too long for the type
1120
- if (elem.value?.length > elem.lengthForType) {
1121
-
1122
- elem.validity = 'tooLong';
1123
- elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
1124
- return;
1125
- }
1126
-
1127
- // Validate that the date passed was the correct format
1128
- if (!dateAndFormatMatch(elem.value, elem.format)) {
1129
- elem.validity = 'patternMismatch';
1130
- elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || 'Invalid Date Format Entered';
1131
- return;
1132
- }
1133
-
1134
- // Validate that the date passed was a valid date
1135
- if (!validDateStr(elem.value, elem.format)) {
1136
- elem.validity = 'invalidDate';
1137
- elem.errorMessage = elem.setCustomValidityInvalidDate || elem.setCustomValidity || 'Invalid Date Entered';
1138
- return;
1139
- }
1140
-
1141
- // Perform the rest of the validation
1142
- const formattedValue = toNorthAmericanFormat(elem.value, elem.format);
1143
- const valueDate = new Date(formattedValue);
1144
-
1145
- // // Validate max date
1146
- if (elem.max?.length === elem.lengthForType) {
1147
-
1148
- const maxDate = new Date(toNorthAmericanFormat(elem.max, elem.format));
1149
-
1150
- if (valueDate > maxDate) {
1151
- elem.validity = 'rangeOverflow';
1152
- elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
1153
- return;
1154
- }
1155
- }
1156
-
1157
- // Validate min date
1158
- if (elem.min?.length === elem.lengthForType) {
1159
- const minDate = new Date(toNorthAmericanFormat(elem.min, elem.format));
1160
-
1161
- if (valueDate < minDate) {
1162
- elem.validity = 'rangeUnderflow';
1163
- elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
1164
- return;
1165
- }
1166
- }
1167
- }
1168
- }
1169
- }
1170
-
1171
- /**
1172
- * Determines the validity state of the element.
1173
- * @param {object} elem - HTML element to validate.
1174
- * @param {boolean} force - Boolean that forces validation to run.
1175
- * @returns {void}
1176
- */
1177
- validate(elem, force) {
1178
- this.getInputElements(elem);
1179
- this.getAuroInputs(elem);
1180
-
1181
- // Check if validation should run
1182
- let validationShouldRun =
1183
-
1184
- // If the validation was forced
1185
- force ||
1186
-
1187
- // If the validation should run on input
1188
- elem.validateOnInput ||
1189
-
1190
- // State-based checks
1191
- (
1192
- // Element is not currently focused
1193
- !elem.contains(document.activeElement) && // native input is not focused directly
1194
- !document.activeElement.shadowRoot?.contains(elem) && // native input is not focused in the shadow DOM of another component
1195
-
1196
- // And element has been touched or is untouched but has a value
1197
- ( elem.touched || (!elem.touched && typeof elem.value !== "undefined") )
1198
- );
1199
-
1200
- if (elem.hasAttribute('error')) {
1201
- elem.validity = 'customError';
1202
- elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
1203
- validationShouldRun = false;
1204
- } else if (validationShouldRun) {
1205
- elem.validity = 'valid';
1206
- elem.errorMessage = '';
1207
-
1208
- /**
1209
- * Only validate once we interact with the datepicker
1210
- * elem.value === undefined is the initial state pre-interaction.
1211
- *
1212
- * The validityState definitions are located at https://developer.mozilla.org/en-US/docs/Web/API/ValidityState.
1213
- */
1214
-
1215
- let hasValue = false;
1216
-
1217
- // Check string for having a value
1218
- if (typeof elem.value === "string") {
1219
- hasValue = elem.value && elem.value.length > 0;
1220
- }
1221
-
1222
- if (typeof elem.value === "boolean") {
1223
- hasValue = elem.value || elem.value === false;
1224
- }
1225
-
1226
- if (typeof elem.value === "number") {
1227
- hasValue = !isNaN(elem.value) && elem.value !== null;
1228
- }
1229
-
1230
- // Check array value types for having a value
1231
- if (Array.isArray(elem.value)) {
1232
- hasValue = Boolean(
1233
- elem.value.length > 0 &&
1234
- elem.value.some((value) => typeof value === "string" && value.length > 0)
1235
- );
1236
- }
1237
-
1238
- // If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
1239
- if (this.auroInputElements?.length === 2) {
1240
- if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
1241
- hasValue = false;
1242
- }
1243
- }
1244
-
1245
- const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
1246
-
1247
- if (isCombobox) {
1248
-
1249
- if (!elem.persistInput || elem.behavior === "filter") {
1250
- hasValue = elem.input.value?.length > 0;
1251
- }
1252
- }
1253
-
1254
- if (!hasValue && elem.required && (force || elem.touched)) {
1255
- elem.validity = 'valueMissing';
1256
- elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
1257
- } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
1258
- this.validateType(elem);
1259
- this.validateElementAttributes(elem);
1260
- } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
1261
- this.validateElementAttributes(elem);
1262
- } else if (isCombobox) {
1263
- this.validateElementAttributes(elem);
1264
-
1265
- // Don't run extra validation for cases where the combobox is not being used as a filter
1266
- validationShouldRun = elem.behavior !== 'filter';
1267
- }
1268
- }
1269
-
1270
- if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing" && elem.validity !== "customError") {
1271
-
1272
- const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
1273
-
1274
- // Don't reset combobox validity if persistInput is set since we can't use the input value to validate
1275
- if (!isCombobox || isCombobox && !elem.persistInput) {
1276
-
1277
- // run validation on all inputs since we're going to use them to set the validity of this component
1278
- this.auroInputElements.forEach(input => input.validate(force));
1279
-
1280
- // Reset element validity to the validity of the input
1281
- elem.validity = this.auroInputElements[0].validity;
1282
- elem.errorMessage = this.auroInputElements[0].errorMessage;
1283
- }
1284
-
1285
- // multiple input in one components (datepicker)
1286
- // combobox has 2 inputs but no need to check validity on the 2nd one which is in fullscreen bib.
1287
- if (elem.validity === 'valid' && this.auroInputElements.length > 1 && !isCombobox) {
1288
- elem.validity = this.auroInputElements[1].validity;
1289
- elem.errorMessage = this.auroInputElements[1].errorMessage;
1290
- }
1291
- }
1292
-
1293
- if (validationShouldRun || elem.hasAttribute('error')) {
1294
- // Use the validity message override if it is declared
1295
- if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
1296
- elem.errorMessage = elem.ValidityMessageOverride;
1297
- }
1298
-
1299
- this.getErrorMessage(elem);
1300
- }
1301
-
1302
- elem.dispatchEvent(new CustomEvent('auroFormElement-validated', {
1303
- bubbles: true,
1304
- composed: true,
1305
- detail: {
1306
- validity: elem.validity,
1307
- message: elem.errorMessage
1308
- }
1309
- }));
1310
- }
1311
-
1312
- /**
1313
- * Gets all the HTML5 `inputs` in the element shadow DOM.
1314
- * @private
1315
- * @param {object} elem - HTML element to validate.
1316
- * @returns {void}
1317
- */
1318
- getInputElements(elem) {
1319
- this.inputElements = elem.renderRoot.querySelectorAll('input');
1320
- }
1321
-
1322
- /**
1323
- * Gets all the `auro-inputs` in the element shadow DOM.
1324
- * @private
1325
- * @param {object} elem - HTML element to validate.
1326
- * @returns {void}
1327
- */
1328
- getAuroInputs(elem) {
1329
- this.auroInputElements = elem.shadowRoot.querySelectorAll('auro-input, [auro-input]');
1330
- }
1331
-
1332
- /**
1333
- * Return appropriate error message.
1334
- * @private
1335
- * @param {object} elem - HTML element to validate.
1336
- * @returns {void}
1337
- */
1338
- getErrorMessage(elem) {
1339
- if (elem.validity !== 'valid') {
1340
- if (elem.setCustomValidity) {
1341
- elem.errorMessage = elem.setCustomValidity;
1342
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
1343
- const input = elem.renderRoot.querySelector('input');
1344
-
1345
- if (input.validationMessage.length > 0) {
1346
- elem.errorMessage = input.validationMessage;
1347
- }
1348
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
1349
- elem.errorMessage = elem.input?.inputElement?.validationMessage;
1350
- } else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
1351
- const firstInput = this.inputElements[0];
1352
-
1353
- if (firstInput.validationMessage.length > 0) {
1354
- elem.errorMessage = firstInput.validationMessage;
1355
- } else if (this.inputElements?.length === 2) {
1356
- const secondInput = this.inputElements[1];
1357
-
1358
- if (secondInput.validationMessage.length > 0) {
1359
- elem.errorMessage = secondInput.validationMessage;
1360
- }
1361
- }
1362
- }
1363
- } else {
1364
- elem.errorMessage = '';
1365
- }
1366
- }
1367
- }
1368
-
1369
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1370
- // See LICENSE in the project root for license information.
1371
-
1372
-
1373
- class AuroDependencyVersioning {
1374
-
1375
- /**
1376
- * Generates a unique string to be used for child auro element naming.
1377
- * @private
1378
- * @param {string} baseName - Defines the first part of the unique element name.
1379
- * @param {string} version - Version of the component that will be appended to the baseName.
1380
- * @returns {string} - Unique string to be used for naming.
1381
- */
1382
- generateElementName(baseName, version) {
1383
- let result = baseName;
1384
-
1385
- result += '-';
1386
- result += version.replace(/[.]/g, '_');
1387
-
1388
- return result;
1389
- }
1390
-
1391
- /**
1392
- * Generates a unique string to be used for child auro element naming.
1393
- * @param {string} baseName - Defines the first part of the unique element name.
1394
- * @param {string} version - Version of the component that will be appended to the baseName.
1395
- * @returns {string} - Unique string to be used for naming.
1396
- */
1397
- generateTag(baseName, version, tagClass) {
1398
- const elementName = this.generateElementName(baseName, version);
1399
- const tag = i`${s(elementName)}`;
1400
-
1401
- if (!customElements.get(elementName)) {
1402
- customElements.define(elementName, class extends tagClass {});
1403
- }
1404
-
1405
- return tag;
1406
- }
1407
- }
1408
-
1409
- var colorCss = i$5`:host([error]){--ds-auro-helptext-color: var(--ds-basic-color-status-error, #e31f26)}:host([onDark]),:host([appearance=inverse]){--ds-auro-helptext-color: var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][error]),:host([appearance=inverse][error]){--ds-auro-helptext-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}.helptext-wrapper{color:var(--ds-auro-helptext-color)}`;
1410
-
1411
- var styleCss = i$5`.body-default{font-size:var(--wcss-body-default-font-size, 1rem);font-weight:var(--wcss-body-default-weight, );line-height:var(--wcss-body-default-line-height, 1.5rem)}.body-default,.body-default-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-default-emphasized{font-size:var(--wcss-body-default-emphasized-font-size, 1rem);font-weight:var(--wcss-body-default-emphasized-weight, );line-height:var(--wcss-body-default-emphasized-line-height, 1.5rem)}.body-lg{font-size:var(--wcss-body-lg-font-size, 1.125rem);font-weight:var(--wcss-body-lg-weight, );line-height:var(--wcss-body-lg-line-height, 1.625rem)}.body-lg,.body-lg-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-lg-emphasized{font-size:var(--wcss-body-lg-emphasized-font-size, 1.125rem);font-weight:var(--wcss-body-lg-emphasized-weight, );line-height:var(--wcss-body-lg-emphasized-line-height, 1.625rem)}.body-sm{font-size:var(--wcss-body-sm-font-size, 0.875rem);font-weight:var(--wcss-body-sm-weight, );line-height:var(--wcss-body-sm-line-height, 1.25rem)}.body-sm,.body-sm-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-sm-emphasized{font-size:var(--wcss-body-sm-emphasized-font-size, 0.875rem);font-weight:var(--wcss-body-sm-emphasized-weight, );line-height:var(--wcss-body-sm-emphasized-line-height, 1.25rem)}.body-xs{font-size:var(--wcss-body-xs-font-size, 0.75rem);font-weight:var(--wcss-body-xs-weight, );line-height:var(--wcss-body-xs-line-height, 1rem)}.body-xs,.body-xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-xs-emphasized{font-size:var(--wcss-body-xs-emphasized-font-size, 0.75rem);font-weight:var(--wcss-body-xs-emphasized-weight, );line-height:var(--wcss-body-xs-emphasized-line-height, 1rem)}.body-2xs{font-size:var(--wcss-body-2xs-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-weight, );line-height:var(--wcss-body-2xs-line-height, 0.875rem)}.body-2xs,.body-2xs-emphasized{font-family:var(--wcss-body-family, "AS Circular"),system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;letter-spacing:var(--wcss-body-letter-spacing, 0)}.body-2xs-emphasized{font-size:var(--wcss-body-2xs-emphasized-font-size, 0.625rem);font-weight:var(--wcss-body-2xs-emphasized-weight, );line-height:var(--wcss-body-2xs-emphasized-line-height, 0.875rem)}.display-2xl{font-family:var(--wcss-display-2xl-family, "AS Circular"),var(--wcss-display-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-2xl-font-size, clamp(3.5rem, 6vw, 5.375rem));font-weight:var(--wcss-display-2xl-weight, 300);letter-spacing:var(--wcss-display-2xl-letter-spacing, 0);line-height:var(--wcss-display-2xl-line-height, 1.3)}.display-xl{font-family:var(--wcss-display-xl-family, "AS Circular"),var(--wcss-display-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xl-font-size, clamp(3rem, 5.3333333333vw, 4.5rem));font-weight:var(--wcss-display-xl-weight, 300);letter-spacing:var(--wcss-display-xl-letter-spacing, 0);line-height:var(--wcss-display-xl-line-height, 1.3)}.display-lg{font-family:var(--wcss-display-lg-family, "AS Circular"),var(--wcss-display-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-lg-font-size, clamp(2.75rem, 4.6666666667vw, 4rem));font-weight:var(--wcss-display-lg-weight, 300);letter-spacing:var(--wcss-display-lg-letter-spacing, 0);line-height:var(--wcss-display-lg-line-height, 1.3)}.display-md{font-family:var(--wcss-display-md-family, "AS Circular"),var(--wcss-display-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-md-font-size, clamp(2.5rem, 4vw, 3.5rem));font-weight:var(--wcss-display-md-weight, 300);letter-spacing:var(--wcss-display-md-letter-spacing, 0);line-height:var(--wcss-display-md-line-height, 1.3)}.display-sm{font-family:var(--wcss-display-sm-family, "AS Circular"),var(--wcss-display-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-sm-font-size, clamp(2rem, 3.6666666667vw, 3rem));font-weight:var(--wcss-display-sm-weight, 300);letter-spacing:var(--wcss-display-sm-letter-spacing, 0);line-height:var(--wcss-display-sm-line-height, 1.3)}.display-xs{font-family:var(--wcss-display-xs-family, "AS Circular"),var(--wcss-display-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-display-xs-font-size, clamp(1.75rem, 3vw, 2.375rem));font-weight:var(--wcss-display-xs-weight, 300);letter-spacing:var(--wcss-display-xs-letter-spacing, 0);line-height:var(--wcss-display-xs-line-height, 1.3)}.heading-xl{font-family:var(--wcss-heading-xl-family, "AS Circular"),var(--wcss-heading-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xl-font-size, clamp(2rem, 3vw, 2.5rem));font-weight:var(--wcss-heading-xl-weight, 300);letter-spacing:var(--wcss-heading-xl-letter-spacing, 0);line-height:var(--wcss-heading-xl-line-height, 1.3)}.heading-lg{font-family:var(--wcss-heading-lg-family, "AS Circular"),var(--wcss-heading-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-lg-font-size, clamp(1.75rem, 2.6666666667vw, 2.25rem));font-weight:var(--wcss-heading-lg-weight, 300);letter-spacing:var(--wcss-heading-lg-letter-spacing, 0);line-height:var(--wcss-heading-lg-line-height, 1.3)}.heading-md{font-family:var(--wcss-heading-md-family, "AS Circular"),var(--wcss-heading-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-md-font-size, clamp(1.625rem, 2.3333333333vw, 1.75rem));font-weight:var(--wcss-heading-md-weight, 300);letter-spacing:var(--wcss-heading-md-letter-spacing, 0);line-height:var(--wcss-heading-md-line-height, 1.3)}.heading-sm{font-family:var(--wcss-heading-sm-family, "AS Circular"),var(--wcss-heading-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-sm-font-size, clamp(1.375rem, 2vw, 1.5rem));font-weight:var(--wcss-heading-sm-weight, 300);letter-spacing:var(--wcss-heading-sm-letter-spacing, 0);line-height:var(--wcss-heading-sm-line-height, 1.3)}.heading-xs{font-family:var(--wcss-heading-xs-family, "AS Circular"),var(--wcss-heading-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-xs-font-size, clamp(1.25rem, 1.6666666667vw, 1.25rem));font-weight:var(--wcss-heading-xs-weight, 300);letter-spacing:var(--wcss-heading-xs-letter-spacing, 0);line-height:var(--wcss-heading-xs-line-height, 1.3)}.heading-2xs{font-family:var(--wcss-heading-2xs-family, "AS Circular"),var(--wcss-heading-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-heading-2xs-font-size, clamp(1.125rem, 1.5vw, 1.125rem));font-weight:var(--wcss-heading-2xs-weight, 300);letter-spacing:var(--wcss-heading-2xs-letter-spacing, 0);line-height:var(--wcss-heading-2xs-line-height, 1.3)}.accent-2xl{font-family:var(--wcss-accent-2xl-family, "Good OT"),var(--wcss-accent-2xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xl-font-size, clamp(2rem, 3.1666666667vw, 2.375rem));font-weight:var(--wcss-accent-2xl-weight, 450);letter-spacing:var(--wcss-accent-2xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-2xl-line-height, 1)}.accent-2xl,.accent-xl{text-transform:uppercase}.accent-xl{font-family:var(--wcss-accent-xl-family, "Good OT"),var(--wcss-accent-xl-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xl-font-size, clamp(1.625rem, 2.3333333333vw, 2rem));font-weight:var(--wcss-accent-xl-weight, 450);letter-spacing:var(--wcss-accent-xl-letter-spacing, 0.05em);line-height:var(--wcss-accent-xl-line-height, 1.3)}.accent-lg{font-family:var(--wcss-accent-lg-family, "Good OT"),var(--wcss-accent-lg-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-lg-font-size, clamp(1.5rem, 2.1666666667vw, 1.75rem));font-weight:var(--wcss-accent-lg-weight, 450);letter-spacing:var(--wcss-accent-lg-letter-spacing, 0.05em);line-height:var(--wcss-accent-lg-line-height, 1.3)}.accent-lg,.accent-md{text-transform:uppercase}.accent-md{font-family:var(--wcss-accent-md-family, "Good OT"),var(--wcss-accent-md-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-md-font-size, clamp(1.375rem, 1.8333333333vw, 1.5rem));font-weight:var(--wcss-accent-md-weight, 500);letter-spacing:var(--wcss-accent-md-letter-spacing, 0.05em);line-height:var(--wcss-accent-md-line-height, 1.3)}.accent-sm{font-family:var(--wcss-accent-sm-family, "Good OT"),var(--wcss-accent-sm-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-sm-font-size, clamp(1.125rem, 1.5vw, 1.25rem));font-weight:var(--wcss-accent-sm-weight, 500);letter-spacing:var(--wcss-accent-sm-letter-spacing, 0.05em);line-height:var(--wcss-accent-sm-line-height, 1.3)}.accent-sm,.accent-xs{text-transform:uppercase}.accent-xs{font-family:var(--wcss-accent-xs-family, "Good OT"),var(--wcss-accent-xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-xs-font-size, clamp(1rem, 1.3333333333vw, 1rem));font-weight:var(--wcss-accent-xs-weight, 500);letter-spacing:var(--wcss-accent-xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-xs-line-height, 1.3)}.accent-2xs{font-family:var(--wcss-accent-2xs-family, "Good OT"),var(--wcss-accent-2xs-family-fallback, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);font-size:var(--wcss-accent-2xs-font-size, clamp(0.875rem, 1.1666666667vw, 0.875rem));font-weight:var(--wcss-accent-2xs-weight, 450);letter-spacing:var(--wcss-accent-2xs-letter-spacing, 0.1em);line-height:var(--wcss-accent-2xs-line-height, 1.3);text-transform:uppercase}:host{position:relative;display:block}.helptext-wrapper{display:none}.helptext-wrapper[visible]{display:block}::slotted(*:not(:empty)){margin-top:var(--ds-size-50, 0.25rem);margin-bottom:0}::slotted(p){margin-block:0}`;
1412
-
1413
- var tokensCss = i$5`:host{--ds-auro-helptext-color: var(--ds-basic-color-texticon-muted, #676767)}`;
1414
-
1415
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1416
- // See LICENSE in the project root for license information.
1417
-
1418
- // ---------------------------------------------------------------------
1419
-
1420
- /* eslint-disable line-comment-position, no-inline-comments, no-confusing-arrow, no-nested-ternary, implicit-arrow-linebreak */
1421
-
1422
- class AuroLibraryRuntimeUtils {
1423
-
1424
- /* eslint-disable jsdoc/require-param */
1425
-
1426
- /**
1427
- * This will register a new custom element with the browser.
1428
- * @param {String} name - The name of the custom element.
1429
- * @param {Object} componentClass - The class to register as a custom element.
1430
- * @returns {void}
1431
- */
1432
- registerComponent(name, componentClass) {
1433
- if (!customElements.get(name)) {
1434
- customElements.define(name, class extends componentClass {});
1435
- }
1436
- }
1437
-
1438
- /**
1439
- * Finds and returns the closest HTML Element based on a selector.
1440
- * @returns {void}
1441
- */
1442
- closestElement(
1443
- selector, // selector like in .closest()
1444
- base = this, // extra functionality to skip a parent
1445
- __Closest = (el, found = el && el.closest(selector)) =>
1446
- !el || el === document || el === window
1447
- ? null // standard .closest() returns null for non-found selectors also
1448
- : found
1449
- ? found // found a selector INside this element
1450
- : __Closest(el.getRootNode().host) // recursion!! break out to parent DOM
1451
- ) {
1452
- return __Closest(base);
1453
- }
1454
- /* eslint-enable jsdoc/require-param */
1455
-
1456
- /**
1457
- * If the element passed is registered with a different tag name than what is passed in, the tag name is added as an attribute to the element.
1458
- * @param {Object} elem - The element to check.
1459
- * @param {String} tagName - The name of the Auro component to check for or add as an attribute.
1460
- * @returns {void}
1461
- */
1462
- handleComponentTagRename(elem, tagName) {
1463
- const tag = tagName.toLowerCase();
1464
- const elemTag = elem.tagName.toLowerCase();
1465
-
1466
- if (elemTag !== tag) {
1467
- elem.setAttribute(tag, true);
1468
- }
1469
- }
1470
-
1471
- /**
1472
- * Validates if an element is a specific Auro component.
1473
- * @param {Object} elem - The element to validate.
1474
- * @param {String} tagName - The name of the Auro component to check against.
1475
- * @returns {Boolean} - Returns true if the element is the specified Auro component.
1476
- */
1477
- elementMatch(elem, tagName) {
1478
- const tag = tagName.toLowerCase();
1479
- const elemTag = elem.tagName.toLowerCase();
1480
-
1481
- return elemTag === tag || elem.hasAttribute(tag);
1482
- }
1483
-
1484
- /**
1485
- * Gets the text content of a named slot.
1486
- * @returns {String}
1487
- * @private
1488
- */
1489
- getSlotText(elem, name) {
1490
- const slot = elem.shadowRoot?.querySelector(`slot[name="${name}"]`);
1491
- const nodes = slot?.assignedNodes({ flatten: true }) || [];
1492
- const text = nodes.map(n => n.textContent?.trim()).join(' ').trim();
1493
-
1494
- return text || null;
1495
- }
1496
- }
1497
-
1498
- // Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
1499
- // See LICENSE in the project root for license information.
1500
-
1501
-
1502
- /**
1503
- * Displays help text or error messages within form elements - Internal Use Only.
1504
- */
1505
- class AuroHelpText extends i$2 {
1506
-
1507
- constructor() {
1508
- super();
1509
-
1510
- this.error = false;
1511
- this.appearance = "default";
1512
- this.onDark = false;
1513
- this.hasTextContent = false;
1514
-
1515
- AuroLibraryRuntimeUtils.prototype.handleComponentTagRename(this, 'auro-helptext');
1516
- }
1517
-
1518
- static get styles() {
1519
- return [
1520
- colorCss,
1521
- styleCss,
1522
- tokensCss
1523
- ];
1524
- }
1525
-
1526
- // function to define props used within the scope of this component
1527
- static get properties() {
1528
- return {
1529
-
1530
- /**
1531
- * Defines whether the component will be on lighter or darker backgrounds.
1532
- * @property {'default', 'inverse'} - The appearance of the help text, either default (for light backgrounds) or inverse (for dark backgrounds).
1533
- * @default 'default'
1534
- */
1535
- appearance: {
1536
- type: String,
1537
- reflect: true
1538
- },
1539
-
1540
- /**
1541
- * @private
1542
- */
1543
- slotNodes: {
1544
- type: Boolean,
1545
- },
1546
-
1547
- /**
1548
- * @private
1549
- */
1550
- hasTextContent: {
1551
- type: Boolean,
1552
- },
1553
-
1554
- /**
1555
- * If declared, make font color red.
1556
- */
1557
- error: {
1558
- type: Boolean,
1559
- reflect: true,
1560
- },
1561
-
1562
- /**
1563
- * DEPRECATED - use `appearance` instead.
1564
- */
1565
- onDark: {
1566
- type: Boolean,
1567
- reflect: true
1568
- }
1569
- };
1570
- }
1571
-
1572
- /**
1573
- * This will register this element with the browser.
1574
- * @param {string} [name="auro-helptext"] - The name of element that you want to register to.
1575
- *
1576
- * @example
1577
- * AuroCheckbox.register("custom-helptext") // this will register this element to <custom-helptext/>
1578
- *
1579
- */
1580
- static register(name = "auro-helptext") {
1581
- AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroHelpText);
1582
- }
1583
-
1584
- updated() {
1585
- this.handleSlotChange();
1586
- }
1587
-
1588
- handleSlotChange(event) {
1589
- if (event) {
1590
- this.slotNodes = event.target.assignedNodes();
1591
- }
1592
-
1593
- this.hasTextContent = this.checkSlotsForContent(this.slotNodes);
1594
- }
1595
-
1596
- /**
1597
- * Checks if any of the provided nodes or their nested slot nodes contain non-empty text content.
1598
- *
1599
- * @param {NodeList|Array} nodes - The list of nodes to check for content.
1600
- * @returns {boolean} - Returns true if any node or nested slot node contains non-empty text content, otherwise false.
1601
- * @private
1602
- */
1603
- checkSlotsForContent(nodes) {
1604
- if (!nodes) {
1605
- return false;
1606
- }
1607
-
1608
- return nodes.some((node) => {
1609
- if (node.textContent.trim()) {
1610
- return true;
1611
- }
1612
-
1613
- if (!node.querySelector) {
1614
- return false;
1615
- }
1616
-
1617
- const nestedSlot = node.tagName === 'SLOT' ? node : node.querySelector('slot');
1618
- if (!nestedSlot) {
1619
- return false;
1620
- }
1621
-
1622
- const nestedSlotNodes = nestedSlot.assignedNodes();
1623
- return this.checkSlotsForContent(nestedSlotNodes);
1624
- });
1625
- }
1626
-
1627
- // function that renders the HTML and CSS into the scope of the component
1628
- render() {
1629
- return b`
1630
- <div class="helptext-wrapper body-xs" ?visible="${this.hasTextContent}">
1631
- <slot @slotchange=${this.handleSlotChange}></slot>
1632
- </div>
1633
- `;
1634
- }
1635
- }
1636
-
1637
- var formkitVersion = '202605111804';
1638
-
1639
- // Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
1640
- // See LICENSE in the project root for license information.
1641
- // ---------------------------------------------------------------------
1642
-
1643
-
1644
- /* eslint no-magic-numbers: ["error", { "ignore": [0, 1, -1] }] */
1645
- /* eslint-disable max-lines, lit/binding-positions, lit/no-invalid-html, no-underscore-dangle */
1646
-
1647
- /**
1648
- * The `auro-radio-group` element is used to group a set `auro-radio` elements.
1649
- * @customElement auro-radio-group
1650
- *
1651
- * @csspart radio-group - Apply css to the fieldset element in the shadow DOM
1652
- * @slot {HTMLSlotElement} legend - Allows for the legend to be overridden.
1653
- * @slot {HTMLSlotElement} optionalLabel - Allows overriding the optional display text "(optional)", which appears next to the label.
1654
- * @slot {HTMLSlotElement} helpText - Allows for the helper text to be overridden.
1655
- * @event auroFormElement-validated - Notifies that the element has been validated.
1656
- * @event input - Notifies every time the value prop of the element is changed.
1657
- */
1658
-
1659
- class AuroRadioGroup extends i$2 {
1660
- constructor() {
1661
- super();
1662
-
1663
- this._initializeDefaults();
1664
- }
1665
-
1666
- _initializeDefaults() {
1667
- this.appearance = "default";
1668
- this.disabled = false;
1669
- this.horizontal = false;
1670
- this.required = false;
1671
- this.validity = undefined;
1672
- this.value = undefined;
1673
- this.optionSelected = undefined;
1674
- this.onDark = false;
1675
- this.touched = false;
1676
- this.hasLegend = false;
1677
-
1678
- /**
1679
- * @private
1680
- */
1681
- this.validation = new AuroFormValidation();
1682
-
1683
- /**
1684
- * @private
1685
- */
1686
- this.index = 0;
1687
-
1688
- /**
1689
- * @private
1690
- */
1691
- this.max = 3;
1692
-
1693
- /**
1694
- * @private
1695
- */
1696
- this.runtimeUtils = new AuroLibraryRuntimeUtils$1();
1697
-
1698
- /**
1699
- * Generate unique names for dependency components.
1700
- */
1701
- const versioning = new AuroDependencyVersioning();
1702
-
1703
- /**
1704
- * @private
1705
- */
1706
- this.helpTextTag = versioning.generateTag('auro-formkit-radio-helptext', formkitVersion, AuroHelpText);
1707
- }
1708
-
1709
- static get styles() {
1710
- return [
1711
- styleCss$1,
1712
- colorCss$1,
1713
- tokenCss
1714
- ];
1715
- }
1716
-
1717
- static get properties() {
1718
- return {
1719
-
1720
- /**
1721
- * Defines whether the component will be on lighter or darker backgrounds.
1722
- * @type {'default' | 'inverse'}
1723
- * @default 'default'
1724
- */
1725
- appearance: {
1726
- type: String,
1727
- reflect: true
1728
- },
1729
-
1730
- /**
1731
- * If true, all radio buttons will be disabled.
1732
- */
1733
- disabled: {
1734
- type: Boolean,
1735
- reflect: true
1736
- },
1737
-
1738
- /**
1739
- * If true, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
1740
- */
1741
- error: {
1742
- type: String,
1743
- reflect: true
1744
- },
1745
-
1746
- /**
1747
- * Indicates whether the legend slot is set or not.
1748
- * @private
1749
- */
1750
- hasLegend: {
1751
- type: Boolean,
1752
- reflect: false,
1753
- attribute: false
1754
- },
1755
-
1756
- /**
1757
- * If true, displays radio buttons horizontally.
1758
- */
1759
- horizontal: { type: Boolean },
1760
-
1761
- /**
1762
- * If true, disables auto-validation on blur.
1763
- */
1764
- noValidate: {
1765
- type: Boolean,
1766
- reflect: true
1767
- },
1768
-
1769
- /**
1770
- * DEPRECATED - use `appearance="inverse"` instead.
1771
- */
1772
- onDark: {
1773
- type: Boolean,
1774
- reflect: true
1775
- },
1776
-
1777
- /**
1778
- * Specifies the current selected radio button.
1779
- */
1780
- optionSelected: {
1781
- type: Object
1782
- },
1783
-
1784
- /**
1785
- * Populates the `required` attribute on the element. Used for client-side validation.
1786
- */
1787
- required: {
1788
- type: Boolean,
1789
- reflect: true
1790
- },
1791
-
1792
- /**
1793
- * Sets a custom help text message to display for all validityStates.
1794
- */
1795
- setCustomValidity: {
1796
- type: String
1797
- },
1798
-
1799
- /**
1800
- * Custom help text message to display when validity = `customError`.
1801
- */
1802
- setCustomValidityCustomError: {
1803
- type: String
1804
- },
1805
-
1806
- /**
1807
- * Custom help text message to display when validity = `valueMissing`.
1808
- */
1809
- setCustomValidityValueMissing: {
1810
- type: String
1811
- },
1812
-
1813
- /**
1814
- * Indicates whether the radio group is in a dirty state (has been interacted with).
1815
- * @private
1816
- */
1817
- touched: {
1818
- type: Boolean,
1819
- reflect: true,
1820
- attribute: false
1821
- },
1822
-
1823
- /**
1824
- * Specifies the `validityState` this element is in.
1825
- */
1826
- validity: {
1827
- type: String,
1828
- reflect: true
1829
- },
1830
-
1831
- /**
1832
- * Specifies the current value of the selected radio button.
1833
- */
1834
- value: {
1835
- type: String
1836
- }
1837
- };
1838
- }
1839
-
1840
- /**
1841
- * This will register this element with the browser.
1842
- * @param {string} [name="auro-radio-group"] - The name of the element that you want to register.
1843
- *
1844
- * @example
1845
- * AuroRadioGroup.register("custom-radio-group") // This will register this element to <custom-radio-group/>
1846
- *
1847
- */
1848
- static register(name = "auro-radio-group") {
1849
- AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroRadioGroup);
1850
- }
1851
-
1852
- connectedCallback() {
1853
- super.connectedCallback();
1854
- this.handleItems();
1855
- this.addEventListener('toggleSelected', this.handleToggleSelected);
1856
- this.addEventListener('keydown', this.handleKeyDown);
1857
- this.addEventListener('resetRadio', this.resetRadio);
1858
- this.addEventListener('auroRadio-blur', this.handleRadioBlur);
1859
- this.addEventListener('auroRadio-selected', this.handleSelection);
1860
- }
1861
-
1862
- firstUpdated() {
1863
- // Add the tag name as an attribute if it is different than the component name
1864
- this.runtimeUtils.handleComponentTagRename(this, 'auro-radio-group');
1865
- }
1866
-
1867
- /**
1868
- * Method for handling of selection of a radio element.
1869
- * @private
1870
- * @param {Event} event - The trigger event tied to this function.
1871
- * @returns {void}
1872
- */
1873
- handleSelection(event) {
1874
- // specifically check null and undefined in case if the value is false or 0
1875
- if (event.target.value !== null && event.target.value !== undefined) {
1876
- this.value = event.target.value;
1877
- } else {
1878
- this.value = '';
1879
- }
1880
-
1881
- this.optionSelected = event.target;
1882
-
1883
- this.validation.validate(this, this.optionSelected !== undefined);
1884
- }
1885
-
1886
- /**
1887
- * Method handles radio element blur.
1888
- * @private
1889
- * @returns {void}
1890
- */
1891
- handleRadioBlur() {
1892
- this.touched = true;
1893
- this.validation.validate(this);
1894
- }
1895
-
1896
- /**
1897
- * LitElement lifecycle method. Called after the DOM has been updated.
1898
- * @param {Map<string, any>} changedProperties - Keys are the names of changed properties, values are the corresponding previous values.
1899
- * @returns {void}
1900
- */
1901
- updated(changedProperties) {
1902
- if (changedProperties.has('disabled')) {
1903
- // only change the children if we are making everything disabled, or if we are making everything enabled and there are no individually-disabled radio buttons
1904
- if (this.disabled || this.items.every((el) => el.disabled)) {
1905
- this.items.forEach((el) => {
1906
- el.disabled = this.disabled;
1907
- });
1908
- }
1909
- }
1910
-
1911
- if (changedProperties.has('value')) {
1912
- this.dispatchEvent(new CustomEvent('input', {
1913
- bubbles: true,
1914
- cancelable: true,
1915
- composed: true,
1916
- }));
1917
- }
1918
-
1919
- if (changedProperties.has('required')) {
1920
- this.items.forEach((el) => {
1921
- el.required = this.required;
1922
- });
1923
- }
1924
-
1925
- if (changedProperties.has('onDark')) {
1926
- this.items.forEach((el) => {
1927
- el.onDark = this.onDark;
1928
- });
1929
- }
1930
-
1931
- if (changedProperties.has('appearance')) {
1932
- this.items.forEach((el) => {
1933
- el.appearance = this.appearance;
1934
- });
1935
- }
1936
-
1937
- if (changedProperties.has('error')) {
1938
- this.validate(true);
1939
- }
1940
-
1941
- if (changedProperties.has('validity')) {
1942
- if (this.validity && this.validity !== 'valid') {
1943
- this.setAttribute('aria-invalid', 'true');
1944
-
1945
- this.items.forEach((el) => {
1946
- el.setAttribute('error', true);
1947
- });
1948
- } else {
1949
- this.removeAttribute('aria-invalid');
1950
-
1951
- this.items.forEach((el) => {
1952
- el.removeAttribute('error');
1953
- });
1954
- }
1955
- }
1956
- }
1957
-
1958
- /**
1959
- * Resets component to initial state.
1960
- * @returns {void}
1961
- */
1962
- reset() {
1963
- // Sets first radio button to receive focus during keyboard navigation
1964
- this.index = 0;
1965
-
1966
- const buttons = this.querySelectorAll('auro-radio, [auro-radio]');
1967
-
1968
- buttons.forEach((button) => {
1969
- button.reset();
1970
- });
1971
-
1972
- this.validation.reset(this);
1973
- }
1974
-
1975
- /**
1976
- * Validates value.
1977
- * @param {boolean} [force=false] - Whether to force validation.
1978
- */
1979
- validate(force = false) {
1980
- this.validation.validate(this, force);
1981
- }
1982
-
1983
- /**
1984
- * Method handles the reset event from a radio element.
1985
- * @private
1986
- * @returns {void}
1987
- */
1988
- resetRadio() {
1989
- if (this.items.length === 0) {
1990
- this.handleItems();
1991
- }
1992
- }
1993
-
1994
- /**
1995
- * Method for handling the attributes of each radio input.
1996
- * @private
1997
- * @returns {void}
1998
- */
1999
- handleItems() {
2000
- this.items = [...this.querySelectorAll(':scope auro-radio, :scope [auro-radio]')];
2001
- this.initializeIndex();
2002
-
2003
- if (this.disabled) {
2004
- this.items.forEach((el) => {
2005
- el.disabled = this.disabled;
2006
- });
2007
- }
2008
-
2009
- this.items.forEach((el) => {
2010
- el.required = this.required;
2011
- el.error = Boolean(this.error);
2012
- });
2013
- }
2014
-
2015
- /**
2016
- * Method for handling slot content changes.
2017
- * @private
2018
- * @returns {void}
2019
- */
2020
- handleSlotChange() {
2021
- this.handleItems();
2022
- }
2023
-
2024
- /**
2025
- * Method for handling legend slot changes.
2026
- * @private
2027
- * @returns {void}
2028
- */
2029
- handleLegendSlotChange() {
2030
- const slot = this.shadowRoot.querySelector('slot[name="legend"]');
2031
- if (slot) {
2032
- this.hasLegend = slot.assignedNodes().length > 0;
2033
- }
2034
- }
2035
-
2036
- /**
2037
- * Method for initializing the tab index of the checked radio input.
2038
- * @private
2039
- * @returns {void}
2040
- */
2041
- initializeIndex() {
2042
- if (!this.disabled && this.items && this.items.length > 0) {
2043
- const index = this.items.findIndex((item) => item.hasAttribute('checked') && !item.hasAttribute('disabled'));
2044
- const nextEnabledIndex = this.items.findIndex((item) => !item.hasAttribute('disabled'));
2045
-
2046
- this.index = index >= 0 ? index : nextEnabledIndex;
2047
-
2048
- if (this.items[this.index]) {
2049
- this.items[this.index].setAttribute('tabindex', 0);
2050
- } }
2051
- }
2052
-
2053
- /**
2054
- * Method for handling a newly selected radio input.
2055
- * @private
2056
- * @param {Event} event - The trigger event tied to this function.
2057
- * @returns {void}
2058
- */
2059
- handleToggleSelected(event) {
2060
- this.index = this.items.indexOf(event.target);
2061
-
2062
- this.items.forEach((item) => {
2063
- item.checked = item === event.target;
2064
- });
2065
-
2066
- this.value = event.target.value;
2067
- this.optionSelected = event.target;
2068
-
2069
- this.validation.validate(this);
2070
- }
2071
-
2072
- /**
2073
- * Method for selecting a radio input.
2074
- * @private
2075
- * @param {Number} index - The value of the element's index attribute.
2076
- * @returns {void}
2077
- */
2078
- selectItem(index) {
2079
- const sdItem = this.items[index];
2080
-
2081
- sdItem.click();
2082
- sdItem.focus();
2083
- this.index = index;
2084
- }
2085
-
2086
- /**
2087
- * Method for selecting the next radio input.
2088
- * @private
2089
- * @param {Number} index - The value of the element's index attribute.
2090
- * @param {String} moveDirection - Arrow key pressed by user.
2091
- * @returns {void}
2092
- */
2093
- selectNextItem(index, moveDirection) {
2094
- let currIndex = index;
2095
-
2096
- for (currIndex; currIndex < this.items.length; moveDirection === "Down" ? currIndex += 1 : currIndex -= 1) {
2097
- currIndex = currIndex === -1 ? this.items.length - 1 : currIndex;
2098
- const sdItem = this.items[currIndex];
2099
- if (sdItem) {
2100
- if (this.disabled || this.items.every((item) => item.disabled === true)) {
2101
- sdItem.focus();
2102
- break;
2103
- }
2104
- if (!sdItem.disabled) {
2105
- sdItem.click();
2106
- sdItem.focus();
2107
- this.index = currIndex;
2108
- break;
2109
- }
2110
- }
2111
- }
2112
- }
2113
-
2114
- /**
2115
- * Method for handling a keydown event.
2116
- * @private
2117
- * @param {Event} event - The trigger event tied to this function.
2118
- * @returns {void}
2119
- */
2120
- handleKeyDown(event) {
2121
- switch (event.key) {
2122
- case " ":
2123
- event.preventDefault();
2124
- this.selectItem(this.index);
2125
- break;
2126
-
2127
- case "Down":
2128
- case "ArrowDown":
2129
- case "Right":
2130
- case "ArrowRight":
2131
- event.preventDefault();
2132
- this.selectNextItem(this.index === this.items.length - 1 ? 0 : this.index + 1, "Down");
2133
- break;
2134
-
2135
- case "Up":
2136
- case "ArrowUp":
2137
- case "Left":
2138
- case "ArrowLeft":
2139
- event.preventDefault();
2140
- this.selectNextItem(this.index === 0 ? this.items.length - 1 : this.index - 1, "Up");
2141
- break;
2142
- }
2143
- }
2144
-
2145
- // function that renders the HTML and CSS into the scope of the component
2146
- render() {
2147
- const groupClasses = {
2148
- 'displayFlex': this.horizontal && this.items.length <= this.max
2149
- };
2150
- const legendClasses = {
2151
- 'hidden': !this.hasLegend && this.required
2152
- };
2153
-
2154
- return u`
2155
- <fieldset class="${e(groupClasses)}" part="radio-group" role="radiogroup">
2156
- <legend class="${e(legendClasses)}">
2157
- <slot name="legend" @slotchange=${this.handleLegendSlotChange}></slot>
2158
- ${this.required ? undefined : u`<slot name="optionalLabel"> (optional)</slot>`}
2159
- </legend>
2160
- <slot @slotchange=${this.handleSlotChange}></slot>
2161
- </fieldset>
2162
-
2163
- ${!this.validity || this.validity === undefined || this.validity === 'valid'
2164
- ? u`
2165
- <${this.helpTextTag} appearance="${this.onDark ? 'inverse' : this.appearance}" part="helpText">
2166
- <slot name="helpText"></slot>
2167
- </${this.helpTextTag}>`
2168
- : u`
2169
- <${this.helpTextTag} appearance="${this.onDark ? 'inverse' : this.appearance}" role="alert" error aria-live="assertive" part="helpText">
2170
- ${this.errorMessage}
2171
- </${this.helpTextTag}>`
2172
- }
2173
- `;
2174
- }
2175
- }
2176
-
2177
- AuroRadio.register();
2178
- AuroRadioGroup.register();
2179
-
2180
- AuroRadio.register('custom-radio');
2181
- AuroRadioGroup.register('custom-radio-group');