@commmerce/ui 1.1.0 → 1.2.0

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.
package/dist/cdn.js CHANGED
@@ -1,6 +1,6 @@
1
- var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(a,i,e)=>(Wn(a,i,"read from private field"),e?e.call(a):i.get(a)),h=(a,i,e)=>i.has(a)?kl("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,e),f=(a,i,e,t)=>(Wn(a,i,"write to private field"),t?t.call(a,e):i.set(a,e),e),o=(a,i,e)=>(Wn(a,i,"access private method"),e);var Qr=globalThis,ea=Qr.ShadowRoot&&(Qr.ShadyCSS===void 0||Qr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Yn=Symbol(),El=new WeakMap,Is=class{constructor(i,e,t){if(this._$cssResult$=!0,t!==Yn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=i,this.t=e}get styleSheet(){let i=this.o,e=this.t;if(ea&&i===void 0){let t=e!==void 0&&e.length===1;t&&(i=El.get(e)),i===void 0&&((this.o=i=new CSSStyleSheet).replaceSync(this.cssText),t&&El.set(e,i))}return i}toString(){return this.cssText}},ta=a=>new Is(typeof a=="string"?a:a+"",void 0,Yn),m=(a,...i)=>{let e=a.length===1?a[0]:i.reduce((t,s,l)=>t+(d=>{if(d._$cssResult$===!0)return d.cssText;if(typeof d=="number")return d;throw Error("Value passed to 'css' function must be a 'css' function result: "+d+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+a[l+1],a[0]);return new Is(e,a,Yn)},Ml=(a,i)=>{if(ea)a.adoptedStyleSheets=i.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of i){let t=document.createElement("style"),s=Qr.litNonce;s!==void 0&&t.setAttribute("nonce",s),t.textContent=e.cssText,a.appendChild(t)}},Gn=ea?a=>a:a=>a instanceof CSSStyleSheet?(i=>{let e="";for(let t of i.cssRules)e+=t.cssText;return ta(e)})(a):a;var{is:bd,defineProperty:fd,getOwnPropertyDescriptor:gd,getOwnPropertyNames:vd,getOwnPropertySymbols:xd,getPrototypeOf:yd}=Object,ia=globalThis,_l=ia.trustedTypes,$d=_l?_l.emptyScript:"",wd=ia.reactiveElementPolyfillSupport,Hs=(a,i)=>a,Xn={toAttribute(a,i){switch(i){case Boolean:a=a?$d:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,i){let e=a;switch(i){case Boolean:e=a!==null;break;case Number:e=a===null?null:Number(a);break;case Object:case Array:try{e=JSON.parse(a)}catch{e=null}}return e}},Sl=(a,i)=>!bd(a,i),zl={attribute:!0,type:String,converter:Xn,reflect:!1,useDefault:!1,hasChanged:Sl};Symbol.metadata??=Symbol("metadata"),ia.litPropertyMetadata??=new WeakMap;var Se=class extends HTMLElement{static addInitializer(i){this._$Ei(),(this.l??=[]).push(i)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(i,e=zl){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(i)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(i,e),!e.noAccessor){let t=Symbol(),s=this.getPropertyDescriptor(i,t,e);s!==void 0&&fd(this.prototype,i,s)}}static getPropertyDescriptor(i,e,t){let{get:s,set:l}=gd(this.prototype,i)??{get(){return this[e]},set(d){this[e]=d}};return{get:s,set(d){let p=s?.call(this);l?.call(this,d),this.requestUpdate(i,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(i){return this.elementProperties.get(i)??zl}static _$Ei(){if(this.hasOwnProperty(Hs("elementProperties")))return;let i=yd(this);i.finalize(),i.l!==void 0&&(this.l=[...i.l]),this.elementProperties=new Map(i.elementProperties)}static finalize(){if(this.hasOwnProperty(Hs("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Hs("properties"))){let e=this.properties,t=[...vd(e),...xd(e)];for(let s of t)this.createProperty(s,e[s])}let i=this[Symbol.metadata];if(i!==null){let e=litPropertyMetadata.get(i);if(e!==void 0)for(let[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let s=this._$Eu(e,t);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(i){let e=[];if(Array.isArray(i)){let t=new Set(i.flat(1/0).reverse());for(let s of t)e.unshift(Gn(s))}else i!==void 0&&e.push(Gn(i));return e}static _$Eu(i,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof i=="string"?i.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(i=>i(this))}addController(i){(this._$EO??=new Set).add(i),this.renderRoot!==void 0&&this.isConnected&&i.hostConnected?.()}removeController(i){this._$EO?.delete(i)}_$E_(){let i=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(i.set(t,this[t]),delete this[t]);i.size>0&&(this._$Ep=i)}createRenderRoot(){let i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ml(i,this.constructor.elementStyles),i}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(i=>i.hostConnected?.())}enableUpdating(i){}disconnectedCallback(){this._$EO?.forEach(i=>i.hostDisconnected?.())}attributeChangedCallback(i,e,t){this._$AK(i,t)}_$ET(i,e){let t=this.constructor.elementProperties.get(i),s=this.constructor._$Eu(i,t);if(s!==void 0&&t.reflect===!0){let l=(t.converter?.toAttribute!==void 0?t.converter:Xn).toAttribute(e,t.type);this._$Em=i,l==null?this.removeAttribute(s):this.setAttribute(s,l),this._$Em=null}}_$AK(i,e){let t=this.constructor,s=t._$Eh.get(i);if(s!==void 0&&this._$Em!==s){let l=t.getPropertyOptions(s),d=typeof l.converter=="function"?{fromAttribute:l.converter}:l.converter?.fromAttribute!==void 0?l.converter:Xn;this._$Em=s;let p=d.fromAttribute(e,l.type);this[s]=p??this._$Ej?.get(s)??p,this._$Em=null}}requestUpdate(i,e,t,s=!1,l){if(i!==void 0){let d=this.constructor;if(s===!1&&(l=this[i]),t??=d.getPropertyOptions(i),!((t.hasChanged??Sl)(l,e)||t.useDefault&&t.reflect&&l===this._$Ej?.get(i)&&!this.hasAttribute(d._$Eu(i,t))))return;this.C(i,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(i,e,{useDefault:t,reflect:s,wrapped:l},d){t&&!(this._$Ej??=new Map).has(i)&&(this._$Ej.set(i,d??e??this[i]),l!==!0||d!==void 0)||(this._$AL.has(i)||(this.hasUpdated||t||(e=void 0),this._$AL.set(i,e)),s===!0&&this._$Em!==i&&(this._$Eq??=new Set).add(i))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let i=this.scheduleUpdate();return i!=null&&await i,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[s,l]of this._$Ep)this[s]=l;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[s,l]of t){let{wrapped:d}=l,p=this[s];d!==!0||this._$AL.has(s)||p===void 0||this.C(s,void 0,l,p)}}let i=!1,e=this._$AL;try{i=this.shouldUpdate(e),i?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw i=!1,this._$EM(),t}i&&this._$AE(e)}willUpdate(i){}_$AE(i){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(i)),this.updated(i)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(i){return!0}update(i){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(i){}firstUpdated(i){}};Se.elementStyles=[],Se.shadowRootOptions={mode:"open"},Se[Hs("elementProperties")]=new Map,Se[Hs("finalized")]=new Map,wd?.({ReactiveElement:Se}),(ia.reactiveElementVersions??=[]).push("2.1.2");var Zn=globalThis,Ll=a=>a,sa=Zn.trustedTypes,Tl=sa?sa.createPolicy("lit-html",{createHTML:a=>a}):void 0,Qn="$lit$",Le=`lit$${Math.random().toFixed(9).slice(2)}$`,eo="?"+Le,kd=`<${eo}>`,pt=document,qs=()=>pt.createComment(""),Ps=a=>a===null||typeof a!="object"&&typeof a!="function",to=Array.isArray,Il=a=>to(a)||typeof a?.[Symbol.iterator]=="function",Jn=`[
2
- \f\r]`,Os=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Cl=/-->/g,Al=/>/g,dt=RegExp(`>|${Jn}(?:([^\\s"'>=/]+)(${Jn}*=${Jn}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Dl=/'/g,Nl=/"/g,Hl=/^(?:script|style|textarea|title)$/i,io=a=>(i,...e)=>({_$litType$:a,strings:i,values:e}),n=io(1),js=io(2),rh=io(3),Q=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Rl=new WeakMap,ht=pt.createTreeWalker(pt,129);function Ol(a,i){if(!to(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return Tl!==void 0?Tl.createHTML(i):i}var ql=(a,i)=>{let e=a.length-1,t=[],s,l=i===2?"<svg>":i===3?"<math>":"",d=Os;for(let p=0;p<e;p++){let u=a[p],v,$,x=-1,L=0;for(;L<u.length&&(d.lastIndex=L,$=d.exec(u),$!==null);)L=d.lastIndex,d===Os?$[1]==="!--"?d=Cl:$[1]!==void 0?d=Al:$[2]!==void 0?(Hl.test($[2])&&(s=RegExp("</"+$[2],"g")),d=dt):$[3]!==void 0&&(d=dt):d===dt?$[0]===">"?(d=s??Os,x=-1):$[1]===void 0?x=-2:(x=d.lastIndex-$[2].length,v=$[1],d=$[3]===void 0?dt:$[3]==='"'?Nl:Dl):d===Nl||d===Dl?d=dt:d===Cl||d===Al?d=Os:(d=dt,s=void 0);let M=d===dt&&a[p+1].startsWith("/>")?" ":"";l+=d===Os?u+kd:x>=0?(t.push(v),u.slice(0,x)+Qn+u.slice(x)+Le+M):u+Le+(x===-2?p:M)}return[Ol(a,l+(a[e]||"<?>")+(i===2?"</svg>":i===3?"</math>":"")),t]},Bs=class a{constructor({strings:i,_$litType$:e},t){let s;this.parts=[];let l=0,d=0,p=i.length-1,u=this.parts,[v,$]=ql(i,e);if(this.el=a.createElement(v,t),ht.currentNode=this.el.content,e===2||e===3){let x=this.el.content.firstChild;x.replaceWith(...x.childNodes)}for(;(s=ht.nextNode())!==null&&u.length<p;){if(s.nodeType===1){if(s.hasAttributes())for(let x of s.getAttributeNames())if(x.endsWith(Qn)){let L=$[d++],M=s.getAttribute(x).split(Le),C=/([.?@])?(.*)/.exec(L);u.push({type:1,index:l,name:C[2],strings:M,ctor:C[1]==="."?aa:C[1]==="?"?na:C[1]==="@"?oa:ut}),s.removeAttribute(x)}else x.startsWith(Le)&&(u.push({type:6,index:l}),s.removeAttribute(x));if(Hl.test(s.tagName)){let x=s.textContent.split(Le),L=x.length-1;if(L>0){s.textContent=sa?sa.emptyScript:"";for(let M=0;M<L;M++)s.append(x[M],qs()),ht.nextNode(),u.push({type:2,index:++l});s.append(x[L],qs())}}}else if(s.nodeType===8)if(s.data===eo)u.push({type:2,index:l});else{let x=-1;for(;(x=s.data.indexOf(Le,x+1))!==-1;)u.push({type:7,index:l}),x+=Le.length-1}l++}}static createElement(i,e){let t=pt.createElement("template");return t.innerHTML=i,t}};function mt(a,i,e=a,t){if(i===Q)return i;let s=t!==void 0?e._$Co?.[t]:e._$Cl,l=Ps(i)?void 0:i._$litDirective$;return s?.constructor!==l&&(s?._$AO?.(!1),l===void 0?s=void 0:(s=new l(a),s._$AT(a,e,t)),t!==void 0?(e._$Co??=[])[t]=s:e._$Cl=s),s!==void 0&&(i=mt(a,s._$AS(a,i.values),s,t)),i}var ra=class{constructor(i,e){this._$AV=[],this._$AN=void 0,this._$AD=i,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(i){let{el:{content:e},parts:t}=this._$AD,s=(i?.creationScope??pt).importNode(e,!0);ht.currentNode=s;let l=ht.nextNode(),d=0,p=0,u=t[0];for(;u!==void 0;){if(d===u.index){let v;u.type===2?v=new qt(l,l.nextSibling,this,i):u.type===1?v=new u.ctor(l,u.name,u.strings,this,i):u.type===6&&(v=new la(l,this,i)),this._$AV.push(v),u=t[++p]}d!==u?.index&&(l=ht.nextNode(),d++)}return ht.currentNode=pt,s}p(i){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(i,t,e),e+=t.strings.length-2):t._$AI(i[e])),e++}},qt=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(i,e,t,s){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=i,this._$AB=e,this._$AM=t,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let i=this._$AA.parentNode,e=this._$AM;return e!==void 0&&i?.nodeType===11&&(i=e.parentNode),i}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(i,e=this){i=mt(this,i,e),Ps(i)?i===c||i==null||i===""?(this._$AH!==c&&this._$AR(),this._$AH=c):i!==this._$AH&&i!==Q&&this._(i):i._$litType$!==void 0?this.$(i):i.nodeType!==void 0?this.T(i):Il(i)?this.k(i):this._(i)}O(i){return this._$AA.parentNode.insertBefore(i,this._$AB)}T(i){this._$AH!==i&&(this._$AR(),this._$AH=this.O(i))}_(i){this._$AH!==c&&Ps(this._$AH)?this._$AA.nextSibling.data=i:this.T(pt.createTextNode(i)),this._$AH=i}$(i){let{values:e,_$litType$:t}=i,s=typeof t=="number"?this._$AC(i):(t.el===void 0&&(t.el=Bs.createElement(Ol(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===s)this._$AH.p(e);else{let l=new ra(s,this),d=l.u(this.options);l.p(e),this.T(d),this._$AH=l}}_$AC(i){let e=Rl.get(i.strings);return e===void 0&&Rl.set(i.strings,e=new Bs(i)),e}k(i){to(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,s=0;for(let l of i)s===e.length?e.push(t=new a(this.O(qs()),this.O(qs()),this,this.options)):t=e[s],t._$AI(l),s++;s<e.length&&(this._$AR(t&&t._$AB.nextSibling,s),e.length=s)}_$AR(i=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);i!==this._$AB;){let t=Ll(i).nextSibling;Ll(i).remove(),i=t}}setConnected(i){this._$AM===void 0&&(this._$Cv=i,this._$AP?.(i))}},ut=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(i,e,t,s,l){this.type=1,this._$AH=c,this._$AN=void 0,this.element=i,this.name=e,this._$AM=s,this.options=l,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(i,e=this,t,s){let l=this.strings,d=!1;if(l===void 0)i=mt(this,i,e,0),d=!Ps(i)||i!==this._$AH&&i!==Q,d&&(this._$AH=i);else{let p=i,u,v;for(i=l[0],u=0;u<l.length-1;u++)v=mt(this,p[t+u],e,u),v===Q&&(v=this._$AH[u]),d||=!Ps(v)||v!==this._$AH[u],v===c?i=c:i!==c&&(i+=(v??"")+l[u+1]),this._$AH[u]=v}d&&!s&&this.j(i)}j(i){i===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,i??"")}},aa=class extends ut{constructor(){super(...arguments),this.type=3}j(i){this.element[this.name]=i===c?void 0:i}},na=class extends ut{constructor(){super(...arguments),this.type=4}j(i){this.element.toggleAttribute(this.name,!!i&&i!==c)}},oa=class extends ut{constructor(i,e,t,s,l){super(i,e,t,s,l),this.type=5}_$AI(i,e=this){if((i=mt(this,i,e,0)??c)===Q)return;let t=this._$AH,s=i===c&&t!==c||i.capture!==t.capture||i.once!==t.once||i.passive!==t.passive,l=i!==c&&(t===c||s);s&&this.element.removeEventListener(this.name,this,t),l&&this.element.addEventListener(this.name,this,i),this._$AH=i}handleEvent(i){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,i):this._$AH.handleEvent(i)}},la=class{constructor(i,e,t){this.element=i,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(i){mt(this,i)}},Pl={M:Qn,P:Le,A:eo,C:1,L:ql,R:ra,D:Il,V:mt,I:qt,H:ut,N:na,U:oa,B:aa,F:la},Ed=Zn.litHtmlPolyfillSupport;Ed?.(Bs,qt),(Zn.litHtmlVersions??=[]).push("3.3.3");var Bl=(a,i,e)=>{let t=e?.renderBefore??i,s=t._$litPart$;if(s===void 0){let l=e?.renderBefore??null;t._$litPart$=s=new qt(i.insertBefore(qs(),l),l,void 0,e??{})}return s._$AI(a),s};var so=globalThis,k=class extends Se{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let i=super.createRenderRoot();return this.renderOptions.renderBefore??=i.firstChild,i}update(i){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(i),this._$Do=Bl(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Q}};k._$litElement$=!0,k.finalized=!0,so.litElementHydrateSupport?.({LitElement:k});var Md=so.litElementPolyfillSupport;Md?.({LitElement:k});(so.litElementVersions??=[]).push("4.2.2");var g=m`
1
+ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(r,a,e)=>(No(r,a,"read from private field"),e?e.call(r):a.get(r)),h=(r,a,e)=>a.has(r)?gc("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(r):a.set(r,e),b=(r,a,e,t)=>(No(r,a,"write to private field"),t?t.call(r,e):a.set(r,e),e),n=(r,a,e)=>(No(r,a,"access private method"),e);var Ar=globalThis,Dr=Ar.ShadowRoot&&(Ar.ShadyCSS===void 0||Ar.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Io=Symbol(),vc=new WeakMap,na=class{constructor(a,e,t){if(this._$cssResult$=!0,t!==Io)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=a,this.t=e}get styleSheet(){let a=this.o,e=this.t;if(Dr&&a===void 0){let t=e!==void 0&&e.length===1;t&&(a=vc.get(e)),a===void 0&&((this.o=a=new CSSStyleSheet).replaceSync(this.cssText),t&&vc.set(e,a))}return a}toString(){return this.cssText}},Nr=r=>new na(typeof r=="string"?r:r+"",void 0,Io),u=(r,...a)=>{let e=r.length===1?r[0]:a.reduce((t,i,l)=>t+(d=>{if(d._$cssResult$===!0)return d.cssText;if(typeof d=="number")return d;throw Error("Value passed to 'css' function must be a 'css' function result: "+d+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[l+1],r[0]);return new na(e,r,Io)},xc=(r,a)=>{if(Dr)r.adoptedStyleSheets=a.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of a){let t=document.createElement("style"),i=Ar.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,r.appendChild(t)}},Ho=Dr?r=>r:r=>r instanceof CSSStyleSheet?(a=>{let e="";for(let t of a.cssRules)e+=t.cssText;return Nr(e)})(r):r;var{is:kh,defineProperty:Eh,getOwnPropertyDescriptor:Mh,getOwnPropertyNames:_h,getOwnPropertySymbols:zh,getPrototypeOf:Th}=Object,Ir=globalThis,yc=Ir.trustedTypes,Sh=yc?yc.emptyScript:"",Lh=Ir.reactiveElementPolyfillSupport,oa=(r,a)=>r,Ro={toAttribute(r,a){switch(a){case Boolean:r=r?Sh:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,a){let e=r;switch(a){case Boolean:e=r!==null;break;case Number:e=r===null?null:Number(r);break;case Object:case Array:try{e=JSON.parse(r)}catch{e=null}}return e}},$c=(r,a)=>!kh(r,a),wc={attribute:!0,type:String,converter:Ro,reflect:!1,useDefault:!1,hasChanged:$c};Symbol.metadata??=Symbol("metadata"),Ir.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(a){this._$Ei(),(this.l??=[]).push(a)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(a,e=wc){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(a)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(a,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(a,t,e);i!==void 0&&Eh(this.prototype,a,i)}}static getPropertyDescriptor(a,e,t){let{get:i,set:l}=Mh(this.prototype,a)??{get(){return this[e]},set(d){this[e]=d}};return{get:i,set(d){let p=i?.call(this);l?.call(this,d),this.requestUpdate(a,p,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(a){return this.elementProperties.get(a)??wc}static _$Ei(){if(this.hasOwnProperty(oa("elementProperties")))return;let a=Th(this);a.finalize(),a.l!==void 0&&(this.l=[...a.l]),this.elementProperties=new Map(a.elementProperties)}static finalize(){if(this.hasOwnProperty(oa("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(oa("properties"))){let e=this.properties,t=[..._h(e),...zh(e)];for(let i of t)this.createProperty(i,e[i])}let a=this[Symbol.metadata];if(a!==null){let e=litPropertyMetadata.get(a);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(a){let e=[];if(Array.isArray(a)){let t=new Set(a.flat(1/0).reverse());for(let i of t)e.unshift(Ho(i))}else a!==void 0&&e.push(Ho(a));return e}static _$Eu(a,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof a=="string"?a.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(a=>this.enableUpdating=a),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(a=>a(this))}addController(a){(this._$EO??=new Set).add(a),this.renderRoot!==void 0&&this.isConnected&&a.hostConnected?.()}removeController(a){this._$EO?.delete(a)}_$E_(){let a=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(a.set(t,this[t]),delete this[t]);a.size>0&&(this._$Ep=a)}createRenderRoot(){let a=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xc(a,this.constructor.elementStyles),a}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(a=>a.hostConnected?.())}enableUpdating(a){}disconnectedCallback(){this._$EO?.forEach(a=>a.hostDisconnected?.())}attributeChangedCallback(a,e,t){this._$AK(a,t)}_$ET(a,e){let t=this.constructor.elementProperties.get(a),i=this.constructor._$Eu(a,t);if(i!==void 0&&t.reflect===!0){let l=(t.converter?.toAttribute!==void 0?t.converter:Ro).toAttribute(e,t.type);this._$Em=a,l==null?this.removeAttribute(i):this.setAttribute(i,l),this._$Em=null}}_$AK(a,e){let t=this.constructor,i=t._$Eh.get(a);if(i!==void 0&&this._$Em!==i){let l=t.getPropertyOptions(i),d=typeof l.converter=="function"?{fromAttribute:l.converter}:l.converter?.fromAttribute!==void 0?l.converter:Ro;this._$Em=i;let p=d.fromAttribute(e,l.type);this[i]=p??this._$Ej?.get(i)??p,this._$Em=null}}requestUpdate(a,e,t,i=!1,l){if(a!==void 0){let d=this.constructor;if(i===!1&&(l=this[a]),t??=d.getPropertyOptions(a),!((t.hasChanged??$c)(l,e)||t.useDefault&&t.reflect&&l===this._$Ej?.get(a)&&!this.hasAttribute(d._$Eu(a,t))))return;this.C(a,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(a,e,{useDefault:t,reflect:i,wrapped:l},d){t&&!(this._$Ej??=new Map).has(a)&&(this._$Ej.set(a,d??e??this[a]),l!==!0||d!==void 0)||(this._$AL.has(a)||(this.hasUpdated||t||(e=void 0),this._$AL.set(a,e)),i===!0&&this._$Em!==a&&(this._$Eq??=new Set).add(a))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let a=this.scheduleUpdate();return a!=null&&await a,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,l]of this._$Ep)this[i]=l;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,l]of t){let{wrapped:d}=l,p=this[i];d!==!0||this._$AL.has(i)||p===void 0||this.C(i,void 0,l,p)}}let a=!1,e=this._$AL;try{a=this.shouldUpdate(e),a?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw a=!1,this._$EM(),t}a&&this._$AE(e)}willUpdate(a){}_$AE(a){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(a)),this.updated(a)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(a){return!0}update(a){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(a){}firstUpdated(a){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[oa("elementProperties")]=new Map,Ne[oa("finalized")]=new Map,Lh?.({ReactiveElement:Ne}),(Ir.reactiveElementVersions??=[]).push("2.1.2");var qo=globalThis,kc=r=>r,Hr=qo.trustedTypes,Ec=Hr?Hr.createPolicy("lit-html",{createHTML:r=>r}):void 0,Po="$lit$",Ie=`lit$${Math.random().toFixed(9).slice(2)}$`,Bo="?"+Ie,Ch=`<${Bo}>`,kt=document,ca=()=>kt.createComment(""),da=r=>r===null||typeof r!="object"&&typeof r!="function",Fo=Array.isArray,Lc=r=>Fo(r)||typeof r?.[Symbol.iterator]=="function",Oo=`[
2
+ \f\r]`,la=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Mc=/-->/g,_c=/>/g,wt=RegExp(`>|${Oo}(?:([^\\s"'>=/]+)(${Oo}*=${Oo}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),zc=/'/g,Tc=/"/g,Cc=/^(?:script|style|textarea|title)$/i,jo=r=>(a,...e)=>({_$litType$:r,strings:a,values:e}),o=jo(1),pa=jo(2),up=jo(3),ae=Symbol.for("lit-noChange"),c=Symbol.for("lit-nothing"),Sc=new WeakMap,$t=kt.createTreeWalker(kt,129);function Ac(r,a){if(!Fo(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ec!==void 0?Ec.createHTML(a):a}var Dc=(r,a)=>{let e=r.length-1,t=[],i,l=a===2?"<svg>":a===3?"<math>":"",d=la;for(let p=0;p<e;p++){let m=r[p],x,$,y=-1,T=0;for(;T<m.length&&(d.lastIndex=T,$=d.exec(m),$!==null);)T=d.lastIndex,d===la?$[1]==="!--"?d=Mc:$[1]!==void 0?d=_c:$[2]!==void 0?(Cc.test($[2])&&(i=RegExp("</"+$[2],"g")),d=wt):$[3]!==void 0&&(d=wt):d===wt?$[0]===">"?(d=i??la,y=-1):$[1]===void 0?y=-2:(y=d.lastIndex-$[2].length,x=$[1],d=$[3]===void 0?wt:$[3]==='"'?Tc:zc):d===Tc||d===zc?d=wt:d===Mc||d===_c?d=la:(d=wt,i=void 0);let M=d===wt&&r[p+1].startsWith("/>")?" ":"";l+=d===la?m+Ch:y>=0?(t.push(x),m.slice(0,y)+Po+m.slice(y)+Ie+M):m+Ie+(y===-2?p:M)}return[Ac(r,l+(r[e]||"<?>")+(a===2?"</svg>":a===3?"</math>":"")),t]},ha=class r{constructor({strings:a,_$litType$:e},t){let i;this.parts=[];let l=0,d=0,p=a.length-1,m=this.parts,[x,$]=Dc(a,e);if(this.el=r.createElement(x,t),$t.currentNode=this.el.content,e===2||e===3){let y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=$t.nextNode())!==null&&m.length<p;){if(i.nodeType===1){if(i.hasAttributes())for(let y of i.getAttributeNames())if(y.endsWith(Po)){let T=$[d++],M=i.getAttribute(y).split(Ie),_=/([.?@])?(.*)/.exec(T);m.push({type:1,index:l,name:_[2],strings:M,ctor:_[1]==="."?Or:_[1]==="?"?qr:_[1]==="@"?Pr:Mt}),i.removeAttribute(y)}else y.startsWith(Ie)&&(m.push({type:6,index:l}),i.removeAttribute(y));if(Cc.test(i.tagName)){let y=i.textContent.split(Ie),T=y.length-1;if(T>0){i.textContent=Hr?Hr.emptyScript:"";for(let M=0;M<T;M++)i.append(y[M],ca()),$t.nextNode(),m.push({type:2,index:++l});i.append(y[T],ca())}}}else if(i.nodeType===8)if(i.data===Bo)m.push({type:2,index:l});else{let y=-1;for(;(y=i.data.indexOf(Ie,y+1))!==-1;)m.push({type:7,index:l}),y+=Ie.length-1}l++}}static createElement(a,e){let t=kt.createElement("template");return t.innerHTML=a,t}};function Et(r,a,e=r,t){if(a===ae)return a;let i=t!==void 0?e._$Co?.[t]:e._$Cl,l=da(a)?void 0:a._$litDirective$;return i?.constructor!==l&&(i?._$AO?.(!1),l===void 0?i=void 0:(i=new l(r),i._$AT(r,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(a=Et(r,i._$AS(r,a.values),i,t)),a}var Rr=class{constructor(a,e){this._$AV=[],this._$AN=void 0,this._$AD=a,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(a){let{el:{content:e},parts:t}=this._$AD,i=(a?.creationScope??kt).importNode(e,!0);$t.currentNode=i;let l=$t.nextNode(),d=0,p=0,m=t[0];for(;m!==void 0;){if(d===m.index){let x;m.type===2?x=new ai(l,l.nextSibling,this,a):m.type===1?x=new m.ctor(l,m.name,m.strings,this,a):m.type===6&&(x=new Br(l,this,a)),this._$AV.push(x),m=t[++p]}d!==m?.index&&(l=$t.nextNode(),d++)}return $t.currentNode=kt,i}p(a){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(a,t,e),e+=t.strings.length-2):t._$AI(a[e])),e++}},ai=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(a,e,t,i){this.type=2,this._$AH=c,this._$AN=void 0,this._$AA=a,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let a=this._$AA.parentNode,e=this._$AM;return e!==void 0&&a?.nodeType===11&&(a=e.parentNode),a}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(a,e=this){a=Et(this,a,e),da(a)?a===c||a==null||a===""?(this._$AH!==c&&this._$AR(),this._$AH=c):a!==this._$AH&&a!==ae&&this._(a):a._$litType$!==void 0?this.$(a):a.nodeType!==void 0?this.T(a):Lc(a)?this.k(a):this._(a)}O(a){return this._$AA.parentNode.insertBefore(a,this._$AB)}T(a){this._$AH!==a&&(this._$AR(),this._$AH=this.O(a))}_(a){this._$AH!==c&&da(this._$AH)?this._$AA.nextSibling.data=a:this.T(kt.createTextNode(a)),this._$AH=a}$(a){let{values:e,_$litType$:t}=a,i=typeof t=="number"?this._$AC(a):(t.el===void 0&&(t.el=ha.createElement(Ac(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let l=new Rr(i,this),d=l.u(this.options);l.p(e),this.T(d),this._$AH=l}}_$AC(a){let e=Sc.get(a.strings);return e===void 0&&Sc.set(a.strings,e=new ha(a)),e}k(a){Fo(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let l of a)i===e.length?e.push(t=new r(this.O(ca()),this.O(ca()),this,this.options)):t=e[i],t._$AI(l),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(a=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);a!==this._$AB;){let t=kc(a).nextSibling;kc(a).remove(),a=t}}setConnected(a){this._$AM===void 0&&(this._$Cv=a,this._$AP?.(a))}},Mt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(a,e,t,i,l){this.type=1,this._$AH=c,this._$AN=void 0,this.element=a,this.name=e,this._$AM=i,this.options=l,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=c}_$AI(a,e=this,t,i){let l=this.strings,d=!1;if(l===void 0)a=Et(this,a,e,0),d=!da(a)||a!==this._$AH&&a!==ae,d&&(this._$AH=a);else{let p=a,m,x;for(a=l[0],m=0;m<l.length-1;m++)x=Et(this,p[t+m],e,m),x===ae&&(x=this._$AH[m]),d||=!da(x)||x!==this._$AH[m],x===c?a=c:a!==c&&(a+=(x??"")+l[m+1]),this._$AH[m]=x}d&&!i&&this.j(a)}j(a){a===c?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,a??"")}},Or=class extends Mt{constructor(){super(...arguments),this.type=3}j(a){this.element[this.name]=a===c?void 0:a}},qr=class extends Mt{constructor(){super(...arguments),this.type=4}j(a){this.element.toggleAttribute(this.name,!!a&&a!==c)}},Pr=class extends Mt{constructor(a,e,t,i,l){super(a,e,t,i,l),this.type=5}_$AI(a,e=this){if((a=Et(this,a,e,0)??c)===ae)return;let t=this._$AH,i=a===c&&t!==c||a.capture!==t.capture||a.once!==t.once||a.passive!==t.passive,l=a!==c&&(t===c||i);i&&this.element.removeEventListener(this.name,this,t),l&&this.element.addEventListener(this.name,this,a),this._$AH=a}handleEvent(a){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,a):this._$AH.handleEvent(a)}},Br=class{constructor(a,e,t){this.element=a,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(a){Et(this,a)}},Nc={M:Po,P:Ie,A:Bo,C:1,L:Dc,R:Rr,D:Lc,V:Et,I:ai,H:Mt,N:qr,U:Pr,B:Or,F:Br},Ah=qo.litHtmlPolyfillSupport;Ah?.(ha,ai),(qo.litHtmlVersions??=[]).push("3.3.3");var Ic=(r,a,e)=>{let t=e?.renderBefore??a,i=t._$litPart$;if(i===void 0){let l=e?.renderBefore??null;t._$litPart$=i=new ai(a.insertBefore(ca(),l),l,void 0,e??{})}return i._$AI(r),i};var Vo=globalThis,E=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let a=super.createRenderRoot();return this.renderOptions.renderBefore??=a.firstChild,a}update(a){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(a),this._$Do=Ic(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};E._$litElement$=!0,E.finalized=!0,Vo.litElementHydrateSupport?.({LitElement:E});var Dh=Vo.litElementPolyfillSupport;Dh?.({LitElement:E});(Vo.litElementVersions??=[]).push("4.2.2");var v=u`
4
4
  :host {
5
5
  font-family: var(--cm-font-sans, 'Poppins', system-ui, sans-serif);
6
6
  color: var(--cm-text-default, #000);
@@ -8,20 +8,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
8
8
  }
9
9
  :host([hidden]) { display: none !important; }
10
10
  *, *::before, *::after { box-sizing: inherit; }
11
- `,vh=m`
11
+ `,Tp=u`
12
12
  outline: 2px solid var(--cm-border-strong);
13
13
  outline-offset: 2px;
14
- `,_d=0,S=a=>`${a}-${++_d}`;function b(a,i){customElements.get(a)||customElements.define(a,i)}function de(a,i){let e=a.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(i).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var zd={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},ca={common:{...zd}},Fs={},Vs={},da;function w(a,i){return ca[a]={...ca[a],...i},i}function Sd(){return Object.fromEntries(Object.entries(ca).map(([a,i])=>[a,{...i}]))}function ha(a,i){for(let[e,t]of Object.entries(i??{}))t&&typeof t=="object"&&(a[e]={...a[e],...t})}function Ld(a,i){ha(i?Vs[i.toLowerCase()]??={}:Fs,a),ma()}function Td(a={}){"locale"in a&&(da=a.locale||void 0),a.strings&&ha(Fs,a.strings);for(let[i,e]of Object.entries(a.translations??{}))ha(Vs[i.toLowerCase()]??={},e);ma()}function Cd(){da=void 0;for(let a of Object.keys(Fs))delete Fs[a];for(let a of Object.keys(Vs))delete Vs[a];ma()}function Us(a){if(da)return da;let i=a;for(;i;){if(i instanceof Element&&i.hasAttribute("lang")&&i.getAttribute("lang"))return i.getAttribute("lang");i=i.parentNode??(i instanceof ShadowRoot?i.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var jl=new Map;function no(a,i,e,t){let s=`${a}|${i??""}|${JSON.stringify(e)}`,l=jl.get(s);if(!l){try{l=t(i)}catch{l=t(void 0)}jl.set(s,l)}return l}function oo(a,i={},e){return no("n",e,i,t=>new Intl.NumberFormat(t,i)).format(a)}function we(a,i={},e){return no("d",e,i,t=>new Intl.DateTimeFormat(t,i)).format(a)}function pa(a,i){return no("p",i,{},e=>new Intl.PluralRules(e)).select(a)}function Fl(a,i={},e){if(a==null)return"";if(typeof a=="function")return String(a(i));let t;if(typeof a=="object"){let s=Number(i.count??0);t=a[pa(s,e)]??a.other??""}else t=String(a);return t.replace(/\{(\w+)\}/g,(s,l)=>{let d=i[l];return d===void 0?s:typeof d=="number"?oo(d,{},e):String(d)})}function Ad(a,i,e,t){if(t&&t[i]!==void 0)return t[i];let s=[];if(e){let l=e.toLowerCase().split("-");for(let d=l.length;d>0;d--)s.push(l.slice(0,d).join("-"))}for(let l of a==="common"?["common"]:[a,"common"]){for(let p of s){let u=Vs[p]?.[l]?.[i];if(u!==void 0)return u}let d=Fs[l]?.[i]??ca[l]?.[i];if(d!==void 0)return d}}function Vl(a,i,e,t,s){let l=Us(t);return Fl(Ad(a,i,l,s),e,l)}var ao=new Set,ro;function ma(){for(let a of ao)a.requestUpdate()}function Dd(){ro||typeof MutationObserver>"u"||typeof document>"u"||(ro=new MutationObserver(ma),ro.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Nd=a=>a.replace(/^cm-/,"").replace(/-([a-z])/g,(i,e)=>e.toUpperCase()),y=class extends k{static finalize(){let i=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!i(this,"finalized")&&i(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let s=t.string;if(!s||i(this.prototype,e))continue;let l=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[l]??this.t(s)},set(d){this[l]=d},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Nd(this.localName)}t(i,e){return Vl(this.stringsNamespace,i,e,this,this.strings)}get locale(){return Us(this)}formatNumber(i,e){return oo(i,e,this.locale)}connectedCallback(){super.connectedCallback(),ao.add(this),Dd()}disconnectedCallback(){super.disconnectedCallback(),ao.delete(this)}};y.properties={strings:{type:Object}};var ua={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5"},Ul=["more","drag"],wh=Object.keys(ua);var Kl=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],Pt=class extends k{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=ua[this.name]??ua.more,t=Ul.includes(this.name)?3:1.6;return js`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
14
+ `,Nh=0,S=r=>`${r}-${++Nh}`;function f(r,a){customElements.get(r)||customElements.define(r,a)}function fe(r,a){let e=r.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(a).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var Ih={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Fr={common:{...Ih}},ma={},ua={},jr;function k(r,a){return Fr[r]={...Fr[r],...a},a}function Hh(){return Object.fromEntries(Object.entries(Fr).map(([r,a])=>[r,{...a}]))}function Vr(r,a){for(let[e,t]of Object.entries(a??{}))t&&typeof t=="object"&&(r[e]={...r[e],...t})}function Rh(r,a){Vr(a?ua[a.toLowerCase()]??={}:ma,r),Kr()}function Oh(r={}){"locale"in r&&(jr=r.locale||void 0),r.strings&&Vr(ma,r.strings);for(let[a,e]of Object.entries(r.translations??{}))Vr(ua[a.toLowerCase()]??={},e);Kr()}function qh(){jr=void 0;for(let r of Object.keys(ma))delete ma[r];for(let r of Object.keys(ua))delete ua[r];Kr()}function ba(r){if(jr)return jr;let a=r;for(;a;){if(a instanceof Element&&a.hasAttribute("lang")&&a.getAttribute("lang"))return a.getAttribute("lang");a=a.parentNode??(a instanceof ShadowRoot?a.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var Hc=new Map;function Wo(r,a,e,t){let i=`${r}|${a??""}|${JSON.stringify(e)}`,l=Hc.get(i);if(!l){try{l=t(a)}catch{l=t(void 0)}Hc.set(i,l)}return l}function Yo(r,a={},e){return Wo("n",e,a,t=>new Intl.NumberFormat(t,a)).format(r)}function V(r,a={},e){return Wo("d",e,a,t=>new Intl.DateTimeFormat(t,a)).format(r)}function Ur(r,a){return Wo("p",a,{},e=>new Intl.PluralRules(e)).select(r)}function Rc(r,a={},e){if(r==null)return"";if(typeof r=="function")return String(r(a));let t;if(typeof r=="object"){let i=Number(a.count??0);t=r[Ur(i,e)]??r.other??""}else t=String(r);return t.replace(/\{(\w+)\}/g,(i,l)=>{let d=a[l];return d===void 0?i:typeof d=="number"?Yo(d,{},e):String(d)})}function Ph(r,a,e,t){if(t&&t[a]!==void 0)return t[a];let i=[];if(e){let l=e.toLowerCase().split("-");for(let d=l.length;d>0;d--)i.push(l.slice(0,d).join("-"))}for(let l of r==="common"?["common"]:[r,"common"]){for(let p of i){let m=ua[p]?.[l]?.[a];if(m!==void 0)return m}let d=ma[l]?.[a]??Fr[l]?.[a];if(d!==void 0)return d}}function Oc(r,a,e,t,i){let l=ba(t);return Rc(Ph(r,a,l,i),e,l)}var Ko=new Set,Uo;function Kr(){for(let r of Ko)r.requestUpdate()}function Bh(){Uo||typeof MutationObserver>"u"||typeof document>"u"||(Uo=new MutationObserver(Kr),Uo.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Fh=r=>r.replace(/^cm-/,"").replace(/-([a-z])/g,(a,e)=>e.toUpperCase()),w=class extends E{static finalize(){let a=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!a(this,"finalized")&&a(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||a(this.prototype,e))continue;let l=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[l]??this.t(i)},set(d){this[l]=d},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Fh(this.localName)}t(a,e){return Oc(this.stringsNamespace,a,e,this,this.strings)}get locale(){return ba(this)}formatNumber(a,e){return Yo(a,e,this.locale)}connectedCallback(){super.connectedCallback(),Ko.add(this),Bh()}disconnectedCallback(){super.disconnectedCallback(),Ko.delete(this)}};w.properties={strings:{type:Object}};var Wr={"chevron-down":"M6 9l6 6 6-6","chevron-up":"M6 15l6-6 6 6","chevron-right":"M9 6l6 6-6 6","chevron-left":"M15 6l-6 6 6 6",close:"M6 6l12 12M18 6L6 18",search:"M11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14zM16 16l4 4",filter:"M4 7h16M7 12h10M10 17h4",edit:"M4 20h4L19 9l-4-4L4 16v4zM14 6l4 4",trash:"M5 7h14M10 7V5h4v2M7 7l1 13h8l1-13M10 11v6M14 11v6","arrow-up-right":"M7 17L17 7M9 7h8v8",calendar:"M5 6h14v14H5zM5 10h14M9 4v4M15 4v4",upload:"M12 16V6M8 10l4-4 4 4M5 18h14",plus:"M12 5v14M5 12h14",check:"M5 12.5l4.5 4.5L19 7",bell:"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15zM10 20h4",help:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6M12 17h.01",rocket:"M14 4c3 0 6 3 6 6l-6 6-6-6c0-3 3-6 6-6zM8 16l-3 3M10 18l-2 3M6 14l-3 2",home:"M4 11l8-7 8 7v9h-5v-6H9v6H4z",box:"M4 8l8-4 8 4v8l-8 4-8-4zM4 8l8 4 8-4M12 12v8",cart:"M5 8h14l-1 12H6zM9 8V6a3 3 0 0 1 6 0v2",more:"M6 12h.01M12 12h.01M18 12h.01",drag:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01","eye-off":"M3 3l18 18M10.6 6.1A9 9 0 0 1 21 12a14 14 0 0 1-2.2 2.9M6.6 6.6A14 14 0 0 0 3 12s3 6 9 6a8 8 0 0 0 4-1",external:"M14 5h5v5M19 5l-8 8M18 14v5H5V6h5",users:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21v-1a7 7 0 0 1 14 0v1M17 11a3 3 0 1 0 0-6M22 21v-1a5 5 0 0 0-4-5",chart:"M5 20V10M12 20V4M19 20v-7",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM4 12h2M18 12h2M12 4v2M12 18v2M6.3 6.3l1.4 1.4M16.3 16.3l1.4 1.4M6.3 17.7l1.4-1.4M16.3 7.7l1.4-1.4",store:"M4 9l1-5h14l1 5M4 9h16v11H4zM9 20v-6h6v6",pin:"M15 4l5 5-3 1-4 4 1 4-2 2-4-4-4 4M8 12l4-4 1-3",clock:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM12 7v5l3 2",alert:"M12 4l9 16H3zM12 10v4M12 17h.01","check-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM8 12l3 3 5-6","x-circle":"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM9 9l6 6M15 9l-6 6",bag:"M6 8h12l1 12H5zM9 8a3 3 0 0 1 6 0",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2.5v2M12 19.5v2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M2.5 12h2M19.5 12h2M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4",moon:"M19.5 14.5A8 8 0 0 1 9.5 4.5a8 8 0 1 0 10 10z",menu:"M4 7h16M4 12h16M4 17h16",copy:"M9 9h11v11H9zM5 15H4V4h11v1",code:"M8 8l-4 4 4 4M16 8l4 4-4 4M14 5l-4 14",download:"M12 4v11M7.5 10.5L12 15l4.5-4.5M5 19h14",book:"M5 5a2 2 0 0 1 2-2h12v15H7a2 2 0 0 0-2 2zM5 20a2 2 0 0 0 2 2h12v-4",pos:"M5 4h14v8H5zM3 16h18v4H3zM8 8h4M12 12v4",website:"M3 5h18v14H3zM3 9h18M9 13h6M9 16h4",apps:"M4 4h6v6H4zM14 4h6v6h-6zM4 14h6v6H4zM14 14h6v6h-6z",megaphone:"M4 10v4h3l8 5V5l-8 5zM18.5 9a4 4 0 0 1 0 6M7 14l1 5h3l-1-4",staff:"M5 4h14v17H5zM9 4V2h6v2M12 13a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM8 18a4 4 0 0 1 8 0",repeat:"M17 3l3 3-3 3M4 11V9a3 3 0 0 1 3-3h13M7 21l-3-3 3-3M20 13v2a3 3 0 0 1-3 3H4",wallet:"M4 6h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4zM4 6V5a1 1 0 0 1 1-1h11v2M15 13h2",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0",star:"M12 3l2.8 5.7 6.2.9-4.5 4.4 1 6.2-5.5-2.9-5.5 2.9 1-6.2L3 9.6l6.2-.9z",percent:"M19 5L5 19M7 9a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM17 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4z","arrow-left":"M19 12H5M11 6l-6 6 6 6",send:"M21 3L10 14M21 3l-7 18-4-7-7-4z",link:"M10 14a4 4 0 0 0 6 0l3-3a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6 0l-3 3a4 4 0 0 0 6 6l1-1",share:"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 22a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM8.6 13.5l6.8 4M15.4 6.5l-6.8 4",globe:"M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zM3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18",gift:"M4 11h16v9H4zM3 7h18v4H3zM12 7v13M12 7c-2 0-4-1-4-3s3-1 4 3c1-4 4-5 4-3s-2 3-4 3",mail:"M3 6h18v12H3zM3 6l9 7 9-7",chat:"M4 5h16v11h-9l-4 4v-4H4zM8 9.5h8M8 12.5h5",tag:"M4 4h7l9 9-7 7-9-9zM8.5 10a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z",building:"M3 21h18M5 21V4h9v17M14 10h5v11M8 8h3M8 12h3M8 16h3",map:"M3 6l6-2 6 2 6-2v14l-6 2-6-2-6 2zM9 4v14M15 6v14",note:"M6 3h8l4 4v14H6zM14 3v4h4M9 12h6M9 15h6M9 18h4",eye:"M3 12s3-6 9-6 9 6 9 6-3 6-9 6-9-6-9-6zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",inbox:"M3 13l3-8h12l3 8v6H3zM3 13h5l1 3h6l1-3h5",handshake:"M3 7v8M21 7v8M3 9l5-3h4l-3 3.5a1.5 1.5 0 0 0 2.2 2L13 9.5l5 5M21 9l-4-3h-5M3 15h2l5 4a1.4 1.4 0 0 0 2-2M10 15l3.5 3a1.4 1.4 0 0 0 2-2l-1.5-1.5","log-out":"M10 4H5v16h5M14 8l4 4-4 4M18 12H9",refresh:"M20 12a8 8 0 0 0-14.9-4M4 12a8 8 0 0 0 14.9 4M5 3.5V8h4.5M19 20.5V16h-4.5",tasks:"M5 5h14v14H5zM8.5 12l2.5 2.5 4.5-5",phone:"M5 4h3.5l1.5 4.5-2 1.5a11 11 0 0 0 6 6l1.5-2 4.5 1.5V19a1.5 1.5 0 0 1-1.5 1.5A15.5 15.5 0 0 1 3.5 5.5 1.5 1.5 0 0 1 5 4z"},qc=["more","drag"],Ap=Object.keys(Wr);var Pc=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],ri=class extends E{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=Wr[this.name]??Wr.more,t=qc.includes(this.name)?3:1.6;return pa`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
15
15
  stroke-width=${t} stroke-linecap="round" stroke-linejoin="round"
16
16
  role=${this.label?"img":c} aria-label=${this.label||c} aria-hidden=${this.label?c:"true"}
17
- part="svg" class=${(this.mirror==="auto"?Kl.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};Pt.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},Pt.styles=m`
17
+ part="svg" class=${(this.mirror==="auto"?Pc.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};ri.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},ri.styles=u`
18
18
  :host { display: inline-flex; flex: none; color: inherit; line-height: 0; }
19
19
  svg { display: block; }
20
20
  :host(:dir(rtl)) svg.flip { transform: scaleX(-1); }
21
- `;b("cm-icon",Pt);var Wl=99,Ch=w("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),ba,fa,Ks,bt=class extends y{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;h(this,ba,this.attachInternals());h(this,fa,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,ba).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});h(this,Ks,!1);this.addEventListener("click",r(this,fa),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,Ks)&&(f(this,Ks,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.size==="large"?20:16,s=this.loading?n`<span class="spinner" aria-hidden="true"></span>`:n`<slot name="icon">${this.icon?n`<cm-icon name=${this.icon} size=${t}></cm-icon>`:c}</slot>`,l=this.iconOnly?n`<span class="vh"><slot></slot></span>`:n`<slot></slot>`,d=e?n`<span class="count" part="count" aria-hidden="true">${e>Wl?this.t("countOverflow",{max:Wl}):this.formatNumber(e)}</span>${this.iconOnly?c:n`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:c,p=this.iconOnly&&(this.label||this.textContent?.trim())||"",u=!this.iconOnly||!p?c:e?this.t("labelWithCount",{label:p,count:e}):this.label||c,v=n`${s}${l}${d}`;return this.href&&!this.disabled?n`<a class="btn" part="control" href=${this.href} target=${this.target??c}
22
- rel=${this.target==="_blank"?"noopener noreferrer":c} aria-label=${u}>${v}</a>`:n`<button class="btn" part="control" type="button"
21
+ `;f("cm-icon",ri);var Bc=99,Bp=k("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),Yr,Gr,fa,_t=class extends w{constructor(){super();this.variant="secondary";this.size="medium";this.type="button";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.icon="";this.label="";this.count=0;h(this,Yr,this.attachInternals());h(this,Gr,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=s(this,Yr).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});h(this,fa,!1);this.addEventListener("click",s(this,Gr),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!s(this,fa)&&(b(this,fa,!0),console.warn("cm-button: an icon-only button needs a `label` (its accessible name).",this))}render(){let e=Number.isFinite(this.count)&&this.count>0?Math.floor(this.count):0,t=this.size==="large"?20:16,i=this.loading?o`<span class="spinner" aria-hidden="true"></span>`:o`<slot name="icon">${this.icon?o`<cm-icon name=${this.icon} size=${t}></cm-icon>`:c}</slot>`,l=this.iconOnly?o`<span class="vh"><slot></slot></span>`:o`<slot></slot>`,d=e?o`<span class="count" part="count" aria-hidden="true">${e>Bc?this.t("countOverflow",{max:Bc}):this.formatNumber(e)}</span>${this.iconOnly?c:o`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:c,p=this.iconOnly&&(this.label||this.textContent?.trim())||"",m=!this.iconOnly||!p?c:e?this.t("labelWithCount",{label:p,count:e}):this.label||c,x=o`${i}${l}${d}`;return this.href&&!this.disabled?o`<a class="btn" part="control" href=${this.href} target=${this.target??c}
22
+ rel=${this.target==="_blank"?"noopener noreferrer":c} aria-label=${m}>${x}</a>`:o`<button class="btn" part="control" type="button"
23
23
  ?disabled=${this.disabled} aria-disabled=${this.loading?"true":c}
24
- aria-busy=${this.loading?"true":c} aria-label=${u}>${v}</button>`}};ba=new WeakMap,fa=new WeakMap,Ks=new WeakMap,bt.formAssociated=!0,bt.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number}},bt.styles=[g,m`
24
+ aria-busy=${this.loading?"true":c} aria-label=${m}>${x}</button>`}};Yr=new WeakMap,Gr=new WeakMap,fa=new WeakMap,_t.formAssociated=!0,_t.properties={variant:{reflect:!0},size:{reflect:!0},type:{},disabled:{type:Boolean,reflect:!0},loading:{type:Boolean,reflect:!0},href:{},target:{},iconOnly:{type:Boolean,reflect:!0,attribute:"icon-only"},icon:{},label:{},count:{type:Number},tone:{reflect:!0}},_t.styles=[v,u`
25
25
  :host { display: inline-flex; vertical-align: middle; }
26
26
  .btn {
27
27
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
@@ -41,6 +41,29 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
41
41
  :host([disabled]) .btn, :host([loading]) .btn {
42
42
  background: var(--cm-action-disabled); border-color: var(--cm-action-disabled); color: var(--cm-action-disabled-text); cursor: not-allowed;
43
43
  }
44
+ /* Tones (1.2). Secondary sits on bg-surface, not bg-hover: text-critical on bg-hover is under 4.5:1 in dark.
45
+ Success has no border token: its outline is text-success (4.8:1 or more on every surface; icon-success is 2.9:1 on bg-page).
46
+ Primary fills with the tone's text colour and takes action-primary-text, like the black primary (5.1:1 or more).
47
+ Hover darkens it towards text-default, which only raises the label's contrast. Pairs: packages/tokens/scripts/contrast.mjs. */
48
+ :host([tone='critical']:not([variant='primary']):not([disabled]):not([loading])) .btn {
49
+ background: var(--cm-bg-surface); color: var(--cm-text-critical); border-color: var(--cm-border-critical);
50
+ }
51
+ :host([tone='critical']:not([variant='primary']):not([disabled]):not([loading])) .btn:hover { background: var(--cm-bg-critical); }
52
+ :host([tone='success']:not([variant='primary']):not([disabled]):not([loading])) .btn {
53
+ background: var(--cm-bg-surface); color: var(--cm-text-success); border-color: var(--cm-text-success);
54
+ }
55
+ :host([tone='success']:not([variant='primary']):not([disabled]):not([loading])) .btn:hover {
56
+ background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)) var(--cm-bg-surface);
57
+ }
58
+ :host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn { --_tone: var(--cm-text-critical); }
59
+ :host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn { --_tone: var(--cm-text-success); }
60
+ :host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn, :host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn {
61
+ background: var(--_tone); border-color: var(--_tone); color: var(--cm-action-primary-text);
62
+ }
63
+ :host([tone='critical'][variant='primary']:not([disabled]):not([loading])) .btn:hover, :host([tone='success'][variant='primary']:not([disabled]):not([loading])) .btn:hover {
64
+ background: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default));
65
+ border-color: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default));
66
+ }
44
67
  .btn:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
45
68
  .spinner {
46
69
  width: 1em; height: 1em; border-radius: 50%;
@@ -69,21 +92,22 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
69
92
  position: absolute; inset-block-start: -7px; inset-inline-end: -7px;
70
93
  box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
71
94
  }
72
- `];b("cm-button",bt);var Te={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ga=a=>(...i)=>({_$litDirective$:a,values:i}),Bt=class{constructor(i){}get _$AU(){return this._$AM._$AU}_$AT(i,e,t){this._$Ct=i,this._$AM=e,this._$Ci=t}_$AS(i,e){return this.update(i,e)}update(i,e){return this.render(...e)}};var{I:Ih}=Pl;var Yl=a=>a.strings===void 0;var Rd={},Gl=(a,i=Rd)=>a._$AH=i;var ne=ga(class extends Bt{constructor(a){if(super(a),a.type!==Te.PROPERTY&&a.type!==Te.ATTRIBUTE&&a.type!==Te.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Yl(a))throw Error("`live` bindings can only contain a single expression")}render(a){return a}update(a,[i]){if(i===Q||i===c)return i;let e=a.element,t=a.name;if(a.type===Te.PROPERTY){if(i===e[t])return Q}else if(a.type===Te.BOOLEAN_ATTRIBUTE){if(!!i===e.hasAttribute(t))return Q}else if(a.type===Te.ATTRIBUTE&&e.getAttribute(t)===i+"")return Q;return Gl(a),i}});var Gh=w("textField",{required:"Please fill in this field."}),he,Ce,Ws,Ue,lo,co,Ve=class extends y{constructor(){super(...arguments);h(this,Ue);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";h(this,he,this.attachInternals());h(this,Ce,S("cm-tf"));h(this,Ws,"")}connectedCallback(){super.connectedCallback(),f(this,Ws,this.value)}get form(){return r(this,he).form}get validity(){return r(this,he).validity}get validationMessage(){return r(this,he).validationMessage}checkValidity(){return r(this,he).checkValidity()}reportValidity(){return r(this,he).reportValidity()}formResetCallback(){this.value=r(this,Ws),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){r(this,he).setFormValue(this.value);let e=this.renderRoot.querySelector(".input");this.error?r(this,he).setValidity({customError:!0},this.error,e??void 0):this.required&&!this.value?r(this,he).setValidity({valueMissing:!0},this.t("required"),e??void 0):r(this,he).setValidity({})}render(){let e=[this.error&&`${r(this,Ce)}-err`,this.helpText&&`${r(this,Ce)}-help`].filter(Boolean).join(" ")||c,t={id:r(this,Ce),invalid:this.error?"true":c},s=this.multiline?n`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
73
- .value=${ne(this.value)} placeholder=${this.placeholder||c}
95
+ `];f("cm-button",_t);var He={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Xr=r=>(...a)=>({_$litDirective$:r,values:a}),ni=class{constructor(a){}get _$AU(){return this._$AM._$AU}_$AT(a,e,t){this._$Ct=a,this._$AM=e,this._$Ci=t}_$AS(a,e){return this.update(a,e)}update(a,e){return this.render(...e)}};var{I:Kp}=Nc;var Fc=r=>r.strings===void 0;var jh={},jc=(r,a=jh)=>r._$AH=a;var re=Xr(class extends ni{constructor(r){if(super(r),r.type!==He.PROPERTY&&r.type!==He.ATTRIBUTE&&r.type!==He.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Fc(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[a]){if(a===ae||a===c)return a;let e=r.element,t=r.name;if(r.type===He.PROPERTY){if(a===e[t])return ae}else if(r.type===He.BOOLEAN_ATTRIBUTE){if(!!a===e.hasAttribute(t))return ae}else if(r.type===He.ATTRIBUTE&&e.getAttribute(t)===a+"")return ae;return jc(r),a}});var rm=k("textField",{required:"Please fill in this field.",rangeUnderflow:"Enter {min} or later.",rangeOverflow:"Enter {max} or earlier.",numberUnderflow:"Enter {min} or more.",numberOverflow:"Enter {max} or less.",stepMismatch:"Enter a valid value. The two nearest are {lower} and {upper}.",badTime:"Enter a complete time.",badDateTime:"Enter a complete date and time."}),Y,Re,va,B,ga,Jr,Vc,Go,Uc,Xo,et=class extends w{constructor(){super(...arguments);h(this,B);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.type="text";this.multiline=!1;this.rows=4;this.required=!1;this.disabled=!1;this.readonly=!1;this.size="default";h(this,Y,this.attachInternals());h(this,Re,S("cm-tf"));h(this,va,"")}connectedCallback(){super.connectedCallback(),b(this,va,this.value)}get form(){return s(this,Y).form}get validity(){return s(this,Y).validity}get validationMessage(){return s(this,Y).validationMessage}checkValidity(){return n(this,B,ga).call(this),s(this,Y).checkValidity()}reportValidity(){return n(this,B,ga).call(this),s(this,Y).reportValidity()}formResetCallback(){this.value=s(this,va),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){s(this,Y).setFormValue(this.value),n(this,B,ga).call(this)}render(){let e=[this.error&&`${s(this,Re)}-err`,this.helpText&&`${s(this,Re)}-help`].filter(Boolean).join(" ")||c,t={id:s(this,Re),invalid:this.error?"true":c},i=this.multiline?o`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
96
+ .value=${re(this.value)} placeholder=${this.placeholder||c}
74
97
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
75
98
  aria-invalid=${t.invalid} aria-describedby=${e}
76
- @input=${o(this,Ue,lo)} @change=${o(this,Ue,co)}></textarea>`:n`<input class="input" part="input" id=${t.id} type=${this.type}
77
- .value=${ne(this.value)} placeholder=${this.placeholder||c}
99
+ @input=${n(this,B,Go)} @change=${n(this,B,Xo)}></textarea>`:o`<input class="input" part="input" id=${t.id} type=${this.type}
100
+ .value=${re(this.value)} placeholder=${this.placeholder||c}
78
101
  autocomplete=${this.autocomplete??c}
102
+ min=${this.min||c} max=${this.max||c} step=${this.step||c}
79
103
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
80
104
  aria-invalid=${t.invalid} aria-describedby=${e}
81
- @input=${o(this,Ue,lo)} @change=${o(this,Ue,co)} />`;return n`<div class="field">
82
- ${this.label?n`<label for=${r(this,Ce)} part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}${this.hint?n`<span class="hint">[${this.hint}]</span>`:c}</label>`:c}
83
- ${s}
84
- ${this.error?n`<p class="error" id="${r(this,Ce)}-err" role="alert">${this.error}</p>`:c}
85
- ${this.helpText?n`<p class="help" id="${r(this,Ce)}-help">${this.helpText}</p>`:c}
86
- </div>`}};he=new WeakMap,Ce=new WeakMap,Ws=new WeakMap,Ue=new WeakSet,lo=function(e){this.value=e.target.value},co=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ve.formAssociated=!0,Ve.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Ve.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0}},Ve.styles=[g,m`
105
+ @input=${n(this,B,Go)} @change=${n(this,B,Xo)} @blur=${n(this,B,Uc)} />`;return o`<div class="field">
106
+ ${this.label?o`<label for=${s(this,Re)} part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}${this.hint?o`<span class="hint">[${this.hint}]</span>`:c}</label>`:c}
107
+ ${i}
108
+ ${this.error?o`<p class="error" id="${s(this,Re)}-err" role="alert">${this.error}</p>`:c}
109
+ ${this.helpText?o`<p class="help" id="${s(this,Re)}-help">${this.helpText}</p>`:c}
110
+ </div>`}};Y=new WeakMap,Re=new WeakMap,va=new WeakMap,B=new WeakSet,ga=function(){let e=this.renderRoot.querySelector(".input"),t=e instanceof HTMLInputElement?e.validity:null,i=this.type==="time"||this.type==="datetime-local";this.error?s(this,Y).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?s(this,Y).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.required&&!this.value?s(this,Y).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.rangeUnderflow?s(this,Y).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:n(this,B,Jr).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?s(this,Y).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:n(this,B,Jr).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?s(this,Y).setValidity({stepMismatch:!0},this.t("stepMismatch",n(this,B,Vc).call(this,e)),e??void 0):s(this,Y).setValidity({})},Jr=function(e){let t=this.locale;if(this.type==="number"&&e!==""&&Number.isFinite(Number(e)))return this.formatNumber(Number(e));if(this.type==="time"){let d=/^(\d{2}):(\d{2})/.exec(e);return d?V(new Date(2e3,0,1,+d[1],+d[2]),{hour:"numeric",minute:"2-digit"},t):e}let i=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2}))?/.exec(e);if(!i)return e;let l=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?V(l,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):V(l,{day:"numeric",month:"short",year:"numeric"},t)},Vc=function(e){let t=this.type==="date"?864e5:this.type==="time"||this.type==="datetime-local"?1e3:1,i=Number(this.step)*t||(this.type==="date"?864e5:this.type==="number"?1:6e4),l=e.valueAsNumber,d=document.createElement("input");d.type=this.type,d.value=this.min??"";let p=Number.isFinite(d.valueAsNumber)?d.valueAsNumber:0,m=p+Math.floor((l-p)/i)*i,x=$=>{if(this.type==="number")return this.formatNumber(Number($.toPrecision(12)));let T=new Date($).toISOString();return n(this,B,Jr).call(this,this.type==="time"?T.slice(11,16):this.type==="date"?T.slice(0,10):T.slice(0,16))};return{lower:x(m),upper:x(m+i)}},Go=function(e){this.value=e.target.value},Uc=function(){n(this,B,ga).call(this)},Xo=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},et.formAssociated=!0,et.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},et.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},type:{},multiline:{type:Boolean},rows:{type:Number},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},readonly:{type:Boolean,reflect:!0},autocomplete:{},size:{reflect:!0},min:{},max:{},step:{}},et.styles=[v,u`
87
111
  :host { display: block; }
88
112
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
89
113
  label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -106,13 +130,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
106
130
  :host([size='small']) .field { gap: 6px; }
107
131
  :host([size='small']) label { font-size: 12px; }
108
132
  :host([size='small']) .input { font-size: 14px; }
109
- `];b("cm-text-field",Ve);var tp=w("checkbox",{required:"Please tick this box."}),We,ft,Ys,va,Xl,Ke=class extends y{constructor(){super(...arguments);h(this,va);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;h(this,We,this.attachInternals());h(this,ft,S("cm-cb"));h(this,Ys,!1)}connectedCallback(){super.connectedCallback(),f(this,Ys,this.checked)}get form(){return r(this,We).form}checkValidity(){return r(this,We).checkValidity()}formResetCallback(){this.checked=r(this,Ys)}formDisabledCallback(e){this.disabled=e}updated(){r(this,We).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,We).setValidity({valueMissing:!0},this.t("required")):r(this,We).setValidity({})}render(){let e=this.indeterminate?n`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:n`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return n`<label for=${r(this,ft)}>
110
- <input type="checkbox" id=${r(this,ft)} .checked=${this.checked} .indeterminate=${this.indeterminate}
133
+ `];f("cm-text-field",et);var hm=k("checkbox",{required:"Please tick this box."}),it,zt,xa,Zr,Kc,tt=class extends w{constructor(){super(...arguments);h(this,Zr);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;h(this,it,this.attachInternals());h(this,zt,S("cm-cb"));h(this,xa,!1)}connectedCallback(){super.connectedCallback(),b(this,xa,this.checked)}get form(){return s(this,it).form}checkValidity(){return s(this,it).checkValidity()}formResetCallback(){this.checked=s(this,xa)}formDisabledCallback(e){this.disabled=e}updated(){s(this,it).setFormValue(this.checked?this.value:null),this.required&&!this.checked?s(this,it).setValidity({valueMissing:!0},this.t("required")):s(this,it).setValidity({})}render(){let e=this.indeterminate?o`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6h8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>`:o`<svg width="12" height="12" viewBox="0 0 12 12" aria-hidden="true"><path d="M2 6.2 4.8 9 10 3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return o`<label for=${s(this,zt)}>
134
+ <input type="checkbox" id=${s(this,zt)} .checked=${this.checked} .indeterminate=${this.indeterminate}
111
135
  ?disabled=${this.disabled} ?required=${this.required}
112
- aria-describedby=${this.description?`${r(this,ft)}-d`:c} @change=${o(this,va,Xl)} />
136
+ aria-describedby=${this.description?`${s(this,zt)}-d`:c} @change=${n(this,Zr,Kc)} />
113
137
  <span class="box" part="box">${e}</span>
114
- ${this.label||this.description?n`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?n`<span class="desc" id="${r(this,ft)}-d">${this.description}</span>`:c}</span>`:n`<slot></slot>`}
115
- </label>`}};We=new WeakMap,ft=new WeakMap,Ys=new WeakMap,va=new WeakSet,Xl=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ke.formAssociated=!0,Ke.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Ke.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},Ke.styles=[g,m`
138
+ ${this.label||this.description?o`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?o`<span class="desc" id="${s(this,zt)}-d">${this.description}</span>`:c}</span>`:o`<slot></slot>`}
139
+ </label>`}};it=new WeakMap,zt=new WeakMap,xa=new WeakMap,Zr=new WeakSet,Kc=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},tt.formAssociated=!0,tt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},tt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},tt.styles=[v,u`
116
140
  :host { display: inline-flex; }
117
141
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
118
142
  input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: inherit; }
@@ -129,12 +153,12 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
129
153
  :host([disabled]) label { cursor: not-allowed; }
130
154
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
131
155
  :host([disabled]) .label { color: var(--cm-text-secondary); }
132
- `];b("cm-checkbox",Ke);var Gs,vt=class extends k{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;h(this,Gs,S("cm-radio"))}render(){let e=this.description?`${r(this,Gs)}-d`:null;return n`<div class="radio" part="radio" role="radio" id=${r(this,Gs)}
156
+ `];f("cm-checkbox",tt);var ya,St=class extends E{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;h(this,ya,S("cm-radio"))}render(){let e=this.description?`${s(this,ya)}-d`:null;return o`<div class="radio" part="radio" role="radio" id=${s(this,ya)}
133
157
  aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":c}
134
158
  aria-describedby=${e??c} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
135
159
  <span class="dot" part="dot"></span>
136
- <span class="text"><span class="label">${this.label}<slot></slot></span>${e?n`<span class="desc" id=${e}>${this.description}</span>`:c}</span>
137
- </div>`}};Gs=new WeakMap,vt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},vt.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},vt.styles=[g,m`
160
+ <span class="text"><span class="label">${this.label}<slot></slot></span>${e?o`<span class="desc" id=${e}>${this.description}</span>`:c}</span>
161
+ </div>`}};ya=new WeakMap,St.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},St.properties={label:{},description:{},value:{reflect:!0},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},groupDisabled:{type:Boolean,reflect:!0,attribute:"group-disabled"},_tabbable:{state:!0}},St.styles=[v,u`
138
162
  :host { display: inline-flex; }
139
163
  .radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; outline: none; }
140
164
  .dot {
@@ -154,16 +178,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
154
178
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
155
179
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-default); }
156
180
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
157
- `];b("cm-radio",vt);var op=w("radioGroup",{required:"Please select one of these options."}),pe,Ae,Xs,Js,Zs,jt,q,ho,ya,gt,po,Ft,mo,$a,wa,xa,xt=class extends y{constructor(){super();h(this,q);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;h(this,pe,this.attachInternals());h(this,Ae,S("cm-rg"));h(this,Xs,"");h(this,Js,!0);h(this,Zs,!1);h(this,jt,!1);h(this,ya,()=>{o(this,q,ho).call(this),r(this,Ft).call(this)});h(this,Ft,()=>{let e=o(this,q,gt).call(this),t=!1;for(let l of e)l.checked=!!this.value&&l.value===this.value&&!t,l.checked&&(t=!0),l.groupDisabled=this.disabled;let s=e.find(l=>l.checked&&!l.disabled)??o(this,q,po).call(this)[0];for(let l of e)l._tabbable=l===s&&!this.disabled});h(this,$a,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||o(this,q,mo).call(this,t,!0)});h(this,wa,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let s=o(this,q,po).call(this),l=s.indexOf(t),d=de(e,this),p;if(e.key==="ArrowDown"||d==="ArrowRight")p=s[(l+1)%s.length];else if(e.key==="ArrowUp"||d==="ArrowLeft")p=s[(l-1+s.length)%s.length];else if(e.key===" ")p=t.disabled?void 0:t;else return;e.preventDefault(),p&&o(this,q,mo).call(this,p,!0)});this.addEventListener("keydown",r(this,wa)),this.addEventListener("click",r(this,$a))}connectedCallback(){super.connectedCallback(),o(this,q,ho).call(this)}get form(){return r(this,pe).form}get validity(){return r(this,pe).validity}get validationMessage(){return r(this,pe).validationMessage}checkValidity(){return r(this,pe).checkValidity()}reportValidity(){return r(this,pe).reportValidity()}formResetCallback(){this.value=r(this,Xs)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(o(this,q,gt).call(this).find(t=>t._tabbable)??o(this,q,gt).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,Zs)&&!r(this,jt)&&f(this,Js,!1),f(this,Zs,!0),r(this,Ft).call(this),r(this,pe).setFormValue(this.value||null,this.value);let t=o(this,q,gt).call(this)[0];this.error?r(this,pe).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,pe).setValidity({valueMissing:!0},this.t("required"),t):r(this,pe).setValidity({})}render(){let e=[this.error&&`${r(this,Ae)}-err`,this.helpText&&`${r(this,Ae)}-help`].filter(Boolean).join(" ");return n`<div class="group" role="radiogroup" part="group"
158
- aria-labelledby=${o(this,q,xa).call(this)?`${r(this,Ae)}-l`:c} aria-label=${o(this,q,xa).call(this)?c:this.getAttribute("aria-label")??c}
181
+ `];f("cm-radio",St);var gm=k("radioGroup",{required:"Please select one of these options."}),ge,Oe,wa,$a,ka,oi,P,Jo,en,Tt,Zo,li,Qo,tn,sn,Qr,Lt=class extends w{constructor(){super();h(this,P);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;h(this,ge,this.attachInternals());h(this,Oe,S("cm-rg"));h(this,wa,"");h(this,$a,!0);h(this,ka,!1);h(this,oi,!1);h(this,en,()=>{n(this,P,Jo).call(this),s(this,li).call(this)});h(this,li,()=>{let e=n(this,P,Tt).call(this),t=!1;for(let l of e)l.checked=!!this.value&&l.value===this.value&&!t,l.checked&&(t=!0),l.groupDisabled=this.disabled;let i=e.find(l=>l.checked&&!l.disabled)??n(this,P,Zo).call(this)[0];for(let l of e)l._tabbable=l===i&&!this.disabled});h(this,tn,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||n(this,P,Qo).call(this,t,!0)});h(this,sn,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=n(this,P,Zo).call(this),l=i.indexOf(t),d=fe(e,this),p;if(e.key==="ArrowDown"||d==="ArrowRight")p=i[(l+1)%i.length];else if(e.key==="ArrowUp"||d==="ArrowLeft")p=i[(l-1+i.length)%i.length];else if(e.key===" ")p=t.disabled?void 0:t;else return;e.preventDefault(),p&&n(this,P,Qo).call(this,p,!0)});this.addEventListener("keydown",s(this,sn)),this.addEventListener("click",s(this,tn))}connectedCallback(){super.connectedCallback(),n(this,P,Jo).call(this)}get form(){return s(this,ge).form}get validity(){return s(this,ge).validity}get validationMessage(){return s(this,ge).validationMessage}checkValidity(){return s(this,ge).checkValidity()}reportValidity(){return s(this,ge).reportValidity()}formResetCallback(){this.value=s(this,wa)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(n(this,P,Tt).call(this).find(t=>t._tabbable)??n(this,P,Tt).call(this)[0])?.focus(e)}updated(e){e.has("value")&&s(this,ka)&&!s(this,oi)&&b(this,$a,!1),b(this,ka,!0),s(this,li).call(this),s(this,ge).setFormValue(this.value||null,this.value);let t=n(this,P,Tt).call(this)[0];this.error?s(this,ge).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ge).setValidity({valueMissing:!0},this.t("required"),t):s(this,ge).setValidity({})}render(){let e=[this.error&&`${s(this,Oe)}-err`,this.helpText&&`${s(this,Oe)}-help`].filter(Boolean).join(" ");return o`<div class="group" role="radiogroup" part="group"
182
+ aria-labelledby=${n(this,P,Qr).call(this)?`${s(this,Oe)}-l`:c} aria-label=${n(this,P,Qr).call(this)?c:this.getAttribute("aria-label")??c}
159
183
  aria-describedby=${e||c}
160
184
  aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
161
185
  aria-disabled=${this.disabled?"true":c}>
162
- <span class="label" id="${r(this,Ae)}-l" part="label" ?hidden=${!o(this,q,xa).call(this)}>${this.label}<slot name="label"></slot>${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</span>
163
- ${this.helpText?n`<p class="help" id="${r(this,Ae)}-help">${this.helpText}</p>`:c}
164
- ${this.error?n`<p class="error" id="${r(this,Ae)}-err" role="alert">${this.error}</p>`:c}
165
- <div class="options" part="options"><slot @slotchange=${r(this,ya)}></slot></div>
166
- </div>`}};pe=new WeakMap,Ae=new WeakMap,Xs=new WeakMap,Js=new WeakMap,Zs=new WeakMap,jt=new WeakMap,q=new WeakSet,ho=function(){r(this,Js)&&(this.value||(f(this,jt,!0),this.value=o(this,q,gt).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>f(this,jt,!1))),f(this,Xs,this.value))},ya=new WeakMap,gt=function(){return[...this.querySelectorAll("cm-radio")]},po=function(){return o(this,q,gt).call(this).filter(e=>!e.disabled&&!this.disabled)},Ft=new WeakMap,mo=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,Ft).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},$a=new WeakMap,wa=new WeakMap,xa=function(){return!!this.label||!!this.querySelector("[slot=label]")},xt.formAssociated=!0,xt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},xt.styles=[g,m`
186
+ <span class="label" id="${s(this,Oe)}-l" part="label" ?hidden=${!n(this,P,Qr).call(this)}>${this.label}<slot name="label"></slot>${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>
187
+ ${this.helpText?o`<p class="help" id="${s(this,Oe)}-help">${this.helpText}</p>`:c}
188
+ ${this.error?o`<p class="error" id="${s(this,Oe)}-err" role="alert">${this.error}</p>`:c}
189
+ <div class="options" part="options"><slot @slotchange=${s(this,en)}></slot></div>
190
+ </div>`}};ge=new WeakMap,Oe=new WeakMap,wa=new WeakMap,$a=new WeakMap,ka=new WeakMap,oi=new WeakMap,P=new WeakSet,Jo=function(){s(this,$a)&&(this.value||(b(this,oi,!0),this.value=n(this,P,Tt).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>b(this,oi,!1))),b(this,wa,this.value))},en=new WeakMap,Tt=function(){return[...this.querySelectorAll("cm-radio")]},Zo=function(){return n(this,P,Tt).call(this).filter(e=>!e.disabled&&!this.disabled)},li=new WeakMap,Qo=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,s(this,li).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},tn=new WeakMap,sn=new WeakMap,Qr=function(){return!!this.label||!!this.querySelector("[slot=label]")},Lt.formAssociated=!0,Lt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{reflect:!0},orientation:{reflect:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Lt.styles=[v,u`
167
191
  :host { display: block; }
168
192
  .group { display: flex; flex-direction: column; gap: var(--cm-space-10); }
169
193
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -172,13 +196,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
172
196
  .error { color: var(--cm-text-critical); }
173
197
  .options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-20); padding-top: var(--cm-space-10); }
174
198
  :host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-30); }
175
- `];b("cm-radio-group",xt);var Vt,yt,Qs,ka,Jl,Ye=class extends k{constructor(){super(...arguments);h(this,ka);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;h(this,Vt,this.attachInternals());h(this,yt,S("cm-tg"));h(this,Qs,!1)}connectedCallback(){super.connectedCallback(),f(this,Qs,this.checked)}get form(){return r(this,Vt).form}checkValidity(){return r(this,Vt).checkValidity()}formResetCallback(){this.checked=r(this,Qs)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){r(this,Vt).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return n`<label for=${r(this,yt)}>
176
- <input type="checkbox" role="switch" id=${r(this,yt)} .checked=${this.checked} ?disabled=${this.disabled}
199
+ `];f("cm-radio-group",Lt);var ci,Ct,Ea,an,Wc,st=class extends E{constructor(){super(...arguments);h(this,an);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;h(this,ci,this.attachInternals());h(this,Ct,S("cm-tg"));h(this,Ea,!1)}connectedCallback(){super.connectedCallback(),b(this,Ea,this.checked)}get form(){return s(this,ci).form}checkValidity(){return s(this,ci).checkValidity()}formResetCallback(){this.checked=s(this,Ea)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){s(this,ci).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return o`<label for=${s(this,Ct)}>
200
+ <input type="checkbox" role="switch" id=${s(this,Ct)} .checked=${this.checked} ?disabled=${this.disabled}
177
201
  aria-label=${e?c:this.getAttribute("aria-label")??c}
178
- aria-describedby=${this.description?`${r(this,yt)}-d`:c} @change=${o(this,ka,Jl)} />
202
+ aria-describedby=${this.description?`${s(this,Ct)}-d`:c} @change=${n(this,an,Wc)} />
179
203
  <span class="track" part="track"><span class="thumb" part="thumb"></span></span>
180
- ${e?n`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?n`<span class="desc" id="${r(this,yt)}-d">${this.description}</span>`:c}</span>`:c}
181
- </label>`}};Vt=new WeakMap,yt=new WeakMap,Qs=new WeakMap,ka=new WeakSet,Jl=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ye.formAssociated=!0,Ye.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Ye.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},Ye.styles=[g,m`
204
+ ${e?o`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?o`<span class="desc" id="${s(this,Ct)}-d">${this.description}</span>`:c}</span>`:c}
205
+ </label>`}};ci=new WeakMap,Ct=new WeakMap,Ea=new WeakMap,an=new WeakSet,Wc=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},st.formAssociated=!0,st.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},st.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},st.styles=[v,u`
182
206
  :host { display: inline-flex; }
183
207
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
184
208
  input { position: absolute; opacity: 0; width: 38px; height: 20px; margin: 0; cursor: inherit; }
@@ -203,32 +227,32 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
203
227
  :host([disabled]) .track { opacity: .5; }
204
228
  :host([disabled]) .label { color: var(--cm-text-secondary); }
205
229
  @media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
206
- `];b("cm-toggle",Ye);var gp=w("select",{required:"Please select an item in the list."}),me,V,Kt,xe,Wt,tr,D,uo,bo,er,Ut,$t,Ge,Ea,Ma,ir,_a,za,Xe=class extends y{constructor(){super(...arguments);h(this,D);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this._active=-1;this._slotted=[];h(this,me,this.attachInternals());h(this,V,S("cm-sel"));h(this,Kt,"");h(this,xe,"");h(this,Wt,0);h(this,tr,new MutationObserver(()=>o(this,D,uo).call(this)));h(this,Ma,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),o(this,D,er).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),o(this,D,er).call(this),o(this,D,Ge).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let s=o(this,D,Ea).call(this,t);o(this,D,er).call(this,s>=0?s:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?o(this,D,$t).call(this,this._active):o(this,D,Ge).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?o(this,D,$t).call(this,this._active):o(this,D,Ge).call(this,-1);break;case"Home":e.preventDefault(),o(this,D,Ge).call(this,"first");break;case"End":e.preventDefault(),o(this,D,Ge).call(this,"last");break;case"PageDown":e.preventDefault(),o(this,D,Ge).call(this,10);break;case"PageUp":e.preventDefault(),o(this,D,Ge).call(this,-10);break;case"Enter":e.preventDefault(),o(this,D,$t).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),o(this,D,Ut).call(this);break;case"Tab":o(this,D,$t).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,xe)&&Date.now()-r(this,Wt)<500){let s=o(this,D,Ea).call(this," ");s>=0&&(this._active=s)}else o(this,D,$t).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let s=o(this,D,Ea).call(this,t);s>=0&&(this._active=s)}}});h(this,ir,e=>{this.open&&!e.composedPath().includes(this)&&o(this,D,Ut).call(this)});h(this,_a,()=>{this.disabled||(this.open?o(this,D,Ut).call(this):o(this,D,er).call(this))});h(this,za,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),o(this,D,uo).call(this),r(this,tr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,ir),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,tr).disconnect(),document.removeEventListener("pointerdown",r(this,ir),!0)}get form(){return r(this,me).form}get validity(){return r(this,me).validity}get validationMessage(){return r(this,me).validationMessage}checkValidity(){return r(this,me).checkValidity()}reportValidity(){return r(this,me).reportValidity()}formResetCallback(){this.value=r(this,Kt),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,Kt)||f(this,Kt,this.value)}updated(e){r(this,me).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,me).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,me).setValidity({valueMissing:!0},this.t("required"),t):r(this,me).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,V)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(d=>d.value===this.value),s=[this.error&&`${r(this,V)}-err`,this.helpText&&`${r(this,V)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label");return n`<div class="field">
207
- ${this.label?n`<span class="label" id="${r(this,V)}-l" part="label" @click=${r(this,za)}>${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
230
+ `];f("cm-toggle",st);var zm=k("select",{required:"Please select an item in the list."}),ve,G,hi,Ee,pi,_a,A,el,tl,Ma,di,At,at,rn,nn,za,on,ln,rt=class extends w{constructor(){super(...arguments);h(this,A);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.options=[];this.required=!1;this.disabled=!1;this.open=!1;this._active=-1;this._slotted=[];h(this,ve,this.attachInternals());h(this,G,S("cm-sel"));h(this,hi,"");h(this,Ee,"");h(this,pi,0);h(this,_a,new MutationObserver(()=>n(this,A,el).call(this)));h(this,nn,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),n(this,A,Ma).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),n(this,A,Ma).call(this),n(this,A,at).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=n(this,A,rn).call(this,t);n(this,A,Ma).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?n(this,A,At).call(this,this._active):n(this,A,at).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?n(this,A,At).call(this,this._active):n(this,A,at).call(this,-1);break;case"Home":e.preventDefault(),n(this,A,at).call(this,"first");break;case"End":e.preventDefault(),n(this,A,at).call(this,"last");break;case"PageDown":e.preventDefault(),n(this,A,at).call(this,10);break;case"PageUp":e.preventDefault(),n(this,A,at).call(this,-10);break;case"Enter":e.preventDefault(),n(this,A,At).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),n(this,A,di).call(this);break;case"Tab":n(this,A,At).call(this,this._active);break;case" ":if(e.preventDefault(),s(this,Ee)&&Date.now()-s(this,pi)<500){let i=n(this,A,rn).call(this," ");i>=0&&(this._active=i)}else n(this,A,At).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=n(this,A,rn).call(this,t);i>=0&&(this._active=i)}}});h(this,za,e=>{this.open&&!e.composedPath().includes(this)&&n(this,A,di).call(this)});h(this,on,()=>{this.disabled||(this.open?n(this,A,di).call(this):n(this,A,Ma).call(this))});h(this,ln,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),n(this,A,el).call(this),s(this,_a).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",s(this,za),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,_a).disconnect(),document.removeEventListener("pointerdown",s(this,za),!0)}get form(){return s(this,ve).form}get validity(){return s(this,ve).validity}get validationMessage(){return s(this,ve).validationMessage}checkValidity(){return s(this,ve).checkValidity()}reportValidity(){return s(this,ve).reportValidity()}formResetCallback(){this.value=s(this,hi),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,hi)||b(this,hi,this.value)}updated(e){s(this,ve).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?s(this,ve).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ve).setValidity({valueMissing:!0},this.t("required"),t):s(this,ve).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${s(this,G)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(d=>d.value===this.value),i=[this.error&&`${s(this,G)}-err`,this.helpText&&`${s(this,G)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label");return o`<div class="field">
231
+ ${this.label?o`<span class="label" id="${s(this,G)}-l" part="label" @click=${s(this,ln)}>${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
208
232
  <div class="wrap">
209
233
  <div class="box" part="box" role="combobox" tabindex=${this.disabled?"-1":"0"}
210
- aria-labelledby=${this.label?`${r(this,V)}-l`:c}
234
+ aria-labelledby=${this.label?`${s(this,G)}-l`:c}
211
235
  aria-label=${!this.label&&l?l:c}
212
- aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,V)}-list"
213
- aria-activedescendant=${this.open&&this._active>=0?`${r(this,V)}-o${this._active}`:c}
236
+ aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,G)}-list"
237
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,G)}-o${this._active}`:c}
214
238
  aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
215
- aria-disabled=${this.disabled?"true":c} aria-describedby=${s||c}
216
- @click=${r(this,_a)} @keydown=${r(this,Ma)} @blur=${()=>o(this,D,Ut).call(this)}>
217
- <span class="text ${t?"":"placeholder"}" id="${r(this,V)}-v">${t?t.label:this.placeholder}</span>
239
+ aria-disabled=${this.disabled?"true":c} aria-describedby=${i||c}
240
+ @click=${s(this,on)} @keydown=${s(this,nn)} @blur=${()=>n(this,A,di).call(this)}>
241
+ <span class="text ${t?"":"placeholder"}" id="${s(this,G)}-v">${t?t.label:this.placeholder}</span>
218
242
  <cm-icon class="chev" name="chevron-down" size="16"></cm-icon>
219
243
  </div>
220
- <ul role="listbox" id="${r(this,V)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${r(this,V)}-l`:c}
244
+ <ul role="listbox" id="${s(this,G)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,G)}-l`:c}
221
245
  aria-label=${!this.label&&l?l:c} ?hidden=${!this.open}
222
246
  @pointerdown=${d=>d.preventDefault()}>
223
- ${e.map((d,p)=>n`<li role="option" id="${r(this,V)}-o${p}" class=${p===this._active?"active":""}
247
+ ${e.map((d,p)=>o`<li role="option" id="${s(this,G)}-o${p}" class=${p===this._active?"active":""}
224
248
  aria-selected=${d.value===this.value?"true":"false"} aria-disabled=${d.disabled?"true":c}
225
- @pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>o(this,D,$t).call(this,p)}>${d.label}</li>`)}
249
+ @pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>n(this,A,At).call(this,p)}>${d.label}</li>`)}
226
250
  </ul>
227
251
  </div>
228
- ${this.error?n`<p class="error" id="${r(this,V)}-err" role="alert">${this.error}</p>`:c}
229
- ${this.helpText?n`<p class="help" id="${r(this,V)}-help">${this.helpText}</p>`:c}
252
+ ${this.error?o`<p class="error" id="${s(this,G)}-err" role="alert">${this.error}</p>`:c}
253
+ ${this.helpText?o`<p class="help" id="${s(this,G)}-help">${this.helpText}</p>`:c}
230
254
  <slot></slot>
231
- </div>`}};me=new WeakMap,V=new WeakMap,Kt=new WeakMap,xe=new WeakMap,Wt=new WeakMap,tr=new WeakMap,D=new WeakSet,uo=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,Kt,this.value))},bo=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},er=function(e){if(this.disabled)return;let t=this.items.findIndex(s=>s.value===this.value);this.open=!0,this._active=e??(t>=0?t:o(this,D,bo).call(this)[0]??-1)},Ut=function(){this.open=!1},$t=function(e){let t=this.items[e];!t||t.disabled||(o(this,D,Ut).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Ge=function(e){let t=o(this,D,bo).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let s=t.indexOf(this._active);this._active=s<0?t[0]:t[Math.min(t.length-1,Math.max(0,s+e))]},Ea=function(e){let t=Date.now();f(this,xe,t-r(this,Wt)>500?e:r(this,xe)+e),f(this,Wt,t);let s=this.items,l=this._active<0?0:this._active,d=r(this,xe).split("").every(v=>v===r(this,xe)[0]),p=d?r(this,xe)[0]:r(this,xe),u=d||r(this,xe).length===1?l+1:l;for(let v=0;v<s.length;v++){let $=(u+v)%s.length;if(!s[$].disabled&&s[$].label.toLowerCase().startsWith(p.toLowerCase()))return $}return-1},Ma=new WeakMap,ir=new WeakMap,_a=new WeakMap,za=new WeakMap,Xe.formAssociated=!0,Xe.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Xe.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_active:{state:!0},_slotted:{state:!0}},Xe.styles=[g,m`
255
+ </div>`}};ve=new WeakMap,G=new WeakMap,hi=new WeakMap,Ee=new WeakMap,pi=new WeakMap,_a=new WeakMap,A=new WeakSet,el=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",b(this,hi,this.value))},tl=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},Ma=function(e){if(this.disabled)return;let t=this.items.findIndex(i=>i.value===this.value);this.open=!0,this._active=e??(t>=0?t:n(this,A,tl).call(this)[0]??-1)},di=function(){this.open=!1},At=function(e){let t=this.items[e];!t||t.disabled||(n(this,A,di).call(this),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},at=function(e){let t=n(this,A,tl).call(this);if(!t.length)return;if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);this._active=i<0?t[0]:t[Math.min(t.length-1,Math.max(0,i+e))]},rn=function(e){let t=Date.now();b(this,Ee,t-s(this,pi)>500?e:s(this,Ee)+e),b(this,pi,t);let i=this.items,l=this._active<0?0:this._active,d=s(this,Ee).split("").every(x=>x===s(this,Ee)[0]),p=d?s(this,Ee)[0]:s(this,Ee),m=d||s(this,Ee).length===1?l+1:l;for(let x=0;x<i.length;x++){let $=(m+x)%i.length;if(!i[$].disabled&&i[$].label.toLowerCase().startsWith(p.toLowerCase()))return $}return-1},nn=new WeakMap,za=new WeakMap,on=new WeakMap,ln=new WeakMap,rt.formAssociated=!0,rt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},rt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_active:{state:!0},_slotted:{state:!0}},rt.styles=[v,u`
232
256
  :host { display: block; position: relative; }
233
257
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
234
258
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); cursor: default; }
@@ -265,16 +289,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
265
289
  slot { display: none; }
266
290
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
267
291
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
268
- `];b("cm-select",Xe);var Ep=w("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Gt,Sa,sr,G,Yt,Zl,Ql,fo,Je=class extends y{constructor(){super(...arguments);h(this,G);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;h(this,Gt,this.attachInternals());h(this,Sa,S("cm-search"));h(this,sr,"")}connectedCallback(){super.connectedCallback(),f(this,sr,this.value)}get form(){return r(this,Gt).form}checkValidity(){return r(this,Gt).checkValidity()}formResetCallback(){this.value=r(this,sr)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,Gt).setFormValue(this.value)}render(){let e=this.size==="large";return n`<div class="box" part="box">
292
+ `];f("cm-select",rt);var Nm=k("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),ui,cn,Ta,Q,mi,Yc,Gc,il,nt=class extends w{constructor(){super(...arguments);h(this,Q);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;h(this,ui,this.attachInternals());h(this,cn,S("cm-search"));h(this,Ta,"")}connectedCallback(){super.connectedCallback(),b(this,Ta,this.value)}get form(){return s(this,ui).form}checkValidity(){return s(this,ui).checkValidity()}formResetCallback(){this.value=s(this,Ta)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){s(this,ui).setFormValue(this.value)}render(){let e=this.size==="large";return o`<div class="box" part="box">
269
293
  <cm-icon class="icon" name="search" size=${e?16:14}></cm-icon>
270
- <input id=${r(this,Sa)} part="input" type="search" enterkeyhint="search" autocomplete="off"
271
- aria-label=${this.label} .value=${ne(this.value)} placeholder=${this.placeholder||c} ?disabled=${this.disabled}
272
- @input=${o(this,G,Zl)} @change=${()=>o(this,G,Yt).call(this,"change")} @keydown=${o(this,G,Ql)} />
273
- ${this.value&&!this.disabled?n`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${o(this,G,fo)}><cm-icon name="close" size="14"></cm-icon></button>`:c}
274
- ${this.filter?n`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
294
+ <input id=${s(this,cn)} part="input" type="search" enterkeyhint="search" autocomplete="off"
295
+ aria-label=${this.label} .value=${re(this.value)} placeholder=${this.placeholder||c} ?disabled=${this.disabled}
296
+ @input=${n(this,Q,Yc)} @change=${()=>n(this,Q,mi).call(this,"change")} @keydown=${n(this,Q,Gc)} />
297
+ ${this.value&&!this.disabled?o`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${n(this,Q,il)}><cm-icon name="close" size="14"></cm-icon></button>`:c}
298
+ ${this.filter?o`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
275
299
  aria-label=${this.filterCount>0?this.t("filterApplied",{label:this.filterLabel,count:this.filterCount}):this.filterLabel}
276
- @click=${()=>o(this,G,Yt).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?n`<span class="count" aria-hidden="true">${this.filterCount}</span>`:c}</button>`:c}
277
- </div>`}};Gt=new WeakMap,Sa=new WeakMap,sr=new WeakMap,G=new WeakSet,Yt=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Zl=function(e){this.value=e.target.value},Ql=function(e){e.key==="Enter"?o(this,G,Yt).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),o(this,G,fo).call(this))},fo=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),o(this,G,Yt).call(this,"input"),o(this,G,Yt).call(this,"change")},Je.formAssociated=!0,Je.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Je.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},Je.styles=[g,m`
300
+ @click=${()=>n(this,Q,mi).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?o`<span class="count" aria-hidden="true">${this.filterCount}</span>`:c}</button>`:c}
301
+ </div>`}};ui=new WeakMap,cn=new WeakMap,Ta=new WeakMap,Q=new WeakSet,mi=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Yc=function(e){this.value=e.target.value},Gc=function(e){e.key==="Enter"?n(this,Q,mi).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),n(this,Q,il).call(this))},il=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),n(this,Q,mi).call(this,"input"),n(this,Q,mi).call(this,"change")},nt.formAssociated=!0,nt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},nt.properties={label:{string:"label"},name:{reflect:!0},value:{},placeholder:{string:"placeholder"},filter:{type:Boolean},filterLabel:{attribute:"filter-label",string:"filter"},filterCount:{type:Number,attribute:"filter-count"},size:{reflect:!0},disabled:{type:Boolean,reflect:!0}},nt.styles=[v,u`
278
302
  :host { display: block; }
279
303
  .box {
280
304
  display: flex; align-items: center; gap: var(--cm-space-10); height: 42px; padding: 0 var(--cm-space-10);
@@ -304,7 +328,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
304
328
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
305
329
  :host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
306
330
  :host([disabled]) button { cursor: not-allowed; }
307
- `];b("cm-search",Je);var La=m`
331
+ `];f("cm-search",nt);var dn=u`
308
332
  .pop {
309
333
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
310
334
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
@@ -316,7 +340,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
316
340
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
317
341
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
318
342
  }
319
- `;function Ta(a,i,e){let t=s=>{i()&&!s.composedPath().includes(a)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Dp=w("tag",{remove:"Remove {label}"}),Ca,ec,Xt=class extends y{constructor(){super(...arguments);h(this,Ca);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return n`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?n`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${o(this,Ca,ec)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:c}</span>`}};Ca=new WeakSet,ec=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Xt.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Xt.styles=[g,m`
343
+ `;function hn(r,a,e){let t=i=>{a()&&!i.composedPath().includes(r)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var jm=k("tag",{remove:"Remove {label}"}),pn,Xc,bi=class extends w{constructor(){super(...arguments);h(this,pn);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return o`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?o`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${n(this,pn,Xc)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:c}</span>`}};pn=new WeakSet,Xc=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},bi.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},bi.styles=[v,u`
320
344
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
321
345
  .tag {
322
346
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 var(--cm-space-10);
@@ -334,13 +358,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
334
358
  :host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-default); }
335
359
  :host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); }
336
360
  @media (max-width: 640px) { .tag { height: 22px; } button { width: 18px; height: 18px; } }
337
- `];b("cm-tag",Xt);var Jt=class extends y{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return n`<span class="spinner" part="spinner" role="status">
361
+ `];f("cm-tag",bi);var fi=class extends w{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return o`<span class="spinner" part="spinner" role="status">
338
362
  <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
339
363
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
340
364
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
341
365
  </svg>
342
366
  <span class="vh">${this.accessibleLabel||this.t("loading")}</span>
343
- </span>`}};Jt.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},Jt.styles=[g,m`
367
+ </span>`}};fi.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},fi.styles=[v,u`
344
368
  :host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
345
369
  .spinner { display: inline-flex; }
346
370
  svg { inline-size: 44px; block-size: 44px; animation: spin 0.8s linear infinite; }
@@ -353,42 +377,42 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
353
377
  }
354
378
  @keyframes spin { to { transform: rotate(360deg); } }
355
379
  @media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
356
- `];b("cm-spinner",Jt);var Kp=w("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item."}),ee,U,lr,ei,cr,dr,E,go,rr,Aa,ar,Zt,Qt,Ze,tc,nr,vo,xo,or,Da,Na,Ra,ic,Qe=class extends y{constructor(){super(...arguments);h(this,E);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;h(this,ee,this.attachInternals());h(this,U,S("cm-cb"));h(this,lr,null);h(this,ei,new Map);h(this,cr,new MutationObserver(()=>o(this,E,go).call(this)));h(this,dr);h(this,Da,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,o(this,E,Qt).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});h(this,Na,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?o(this,E,nr).call(this,1):(o(this,E,Qt).call(this),e.altKey||o(this,E,nr).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?o(this,E,nr).call(this,-1):(o(this,E,Qt).call(this),o(this,E,nr).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),o(this,E,vo).call(this,this._active)):r(this,E,Aa)&&(e.preventDefault(),o(this,E,xo).call(this,r(this,E,Aa)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),o(this,E,Ze).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",o(this,E,Zt).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":o(this,E,Ze).call(this);break;default:}});h(this,Ra,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(o(this,E,Ze).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?o(this,E,rr).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),o(this,E,go).call(this),r(this,cr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),f(this,dr,Ta(this,()=>this.open,()=>o(this,E,Ze).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,cr).disconnect(),(e=r(this,dr))==null||e.call(this)}get form(){return r(this,ee).form}get validity(){return r(this,ee).validity}get validationMessage(){return r(this,ee).validationMessage}checkValidity(){return r(this,ee).checkValidity()}reportValidity(){return r(this,ee).reportValidity()}formResetCallback(){let e=r(this,lr)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
357
- `):[]:this.value=e)}get items(){return this.options?.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let s=t.label.toLowerCase();return this.filter==="starts-with"?s.startsWith(e):s.includes(e)})}firstUpdated(){f(this,lr,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,ei).set(t.value,t.label);if((e.has("value")||e.has("options")||e.has("_slotted"))&&!this.multiple&&!this._typing&&(this._query=this.value?o(this,E,rr).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=o(this,E,ar).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);r(this,ee).setFormValue(l,this.values.join(`
358
- `))}else r(this,ee).setFormValue(null);else r(this,ee).setFormValue(this.value||null,this.value);let s=this.multiple?!this.values.length:!this.value;this.error?r(this,ee).setValidity({customError:!0},this.error,t):this.required&&s?r(this,ee).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):r(this,ee).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,U)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),o(this,E,Zt).call(this))}render(){let e=o(this,E,ar).call(this),t=[this.error&&`${r(this,U)}-err`,this.helpText&&`${r(this,U)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=p=>this.multiple?this.values.includes(p):p===this.value,d=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return n`<div class="field">
359
- ${this.label?n`<label class="label" id="${r(this,U)}-l" for="${r(this,U)}-in" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
380
+ `];f("cm-spinner",fi);var iu=k("combobox",{noResults:"No results",results:{one:"{count} result",other:"{count} results"},add:"Add \u201C{value}\u201D",remove:"Remove {label}",required:"Please select an item in the list.",requiredMultiple:"Choose at least one item."}),ne,X,Da,xi,Na,Ia,z,sl,Sa,mn,La,gi,vi,ot,Jc,Ca,al,rl,Aa,un,bn,fn,Zc,lt=class extends w{constructor(){super(...arguments);h(this,z);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;h(this,ne,this.attachInternals());h(this,X,S("cm-cb"));h(this,Da,null);h(this,xi,new Map);h(this,Na,new MutationObserver(()=>n(this,z,sl).call(this)));h(this,Ia);h(this,un,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,n(this,z,vi).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});h(this,bn,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?n(this,z,Ca).call(this,1):(n(this,z,vi).call(this),e.altKey||n(this,z,Ca).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?n(this,z,Ca).call(this,-1):(n(this,z,vi).call(this),n(this,z,Ca).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),n(this,z,al).call(this,this._active)):s(this,z,mn)&&(e.preventDefault(),n(this,z,rl).call(this,s(this,z,mn)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),n(this,z,ot).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",n(this,z,gi).call(this)));break;case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":n(this,z,ot).call(this);break;default:}});h(this,fn,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(n(this,z,ot).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?n(this,z,Sa).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),n(this,z,sl).call(this),s(this,Na).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),b(this,Ia,hn(this,()=>this.open,()=>n(this,z,ot).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),s(this,Na).disconnect(),(e=s(this,Ia))==null||e.call(this)}get form(){return s(this,ne).form}get validity(){return s(this,ne).validity}get validationMessage(){return s(this,ne).validationMessage}checkValidity(){return s(this,ne).checkValidity()}reportValidity(){return s(this,ne).reportValidity()}formResetCallback(){let e=s(this,Da)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
381
+ `):[]:this.value=e)}get items(){return this.options?.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}get filteredItems(){let e=this._typing?this._query.trim().toLowerCase():"";return!e||this.filter==="none"?this.items:this.items.filter(t=>{let i=t.label.toLowerCase();return this.filter==="starts-with"?i.startsWith(e):i.includes(e)})}firstUpdated(){b(this,Da,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)s(this,xi).set(t.value,t.label);if((e.has("value")||e.has("options")||e.has("_slotted"))&&!this.multiple&&!this._typing&&(this._query=this.value?n(this,z,Sa).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=n(this,z,La).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);s(this,ne).setFormValue(l,this.values.join(`
382
+ `))}else s(this,ne).setFormValue(null);else s(this,ne).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?s(this,ne).setValidity({customError:!0},this.error,t):this.required&&i?s(this,ne).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):s(this,ne).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,X)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),n(this,z,gi).call(this))}render(){let e=n(this,z,La).call(this),t=[this.error&&`${s(this,X)}-err`,this.helpText&&`${s(this,X)}-help`].filter(Boolean).join(" "),i=this.getAttribute("aria-label"),l=p=>this.multiple?this.values.includes(p):p===this.value,d=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return o`<div class="field">
383
+ ${this.label?o`<label class="label" id="${s(this,X)}-l" for="${s(this,X)}-in" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
360
384
  <div class="wrap">
361
- <div class="box" part="box" @click=${p=>{p.target.closest("cm-tag")||o(this,E,or).call(this)}}>
362
- ${this.multiple?this.values.map(p=>n`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:o(this,E,rr).call(this,p)})}
363
- @cm-remove=${()=>{this.removeValue(p),o(this,E,or).call(this)}}>${o(this,E,rr).call(this,p)}</cm-tag>`):c}
364
- <input id="${r(this,U)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
365
- .value=${ne(this._query)} placeholder=${this.multiple&&this.values.length?c:this.placeholder||c}
366
- aria-label=${!this.label&&s?s:c}
367
- aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,U)}-list"
368
- aria-activedescendant=${this.open&&this._active>=0?`${r(this,U)}-o${this._active}`:c}
385
+ <div class="box" part="box" @click=${p=>{p.target.closest("cm-tag")||n(this,z,Aa).call(this)}}>
386
+ ${this.multiple?this.values.map(p=>o`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:n(this,z,Sa).call(this,p)})}
387
+ @cm-remove=${()=>{this.removeValue(p),n(this,z,Aa).call(this)}}>${n(this,z,Sa).call(this,p)}</cm-tag>`):c}
388
+ <input id="${s(this,X)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
389
+ .value=${re(this._query)} placeholder=${this.multiple&&this.values.length?c:this.placeholder||c}
390
+ aria-label=${!this.label&&i?i:c}
391
+ aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,X)}-list"
392
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,X)}-o${this._active}`:c}
369
393
  aria-invalid=${this.error?"true":c} aria-describedby=${t||c}
370
394
  aria-required=${this.required?"true":c} ?disabled=${this.disabled}
371
- @input=${r(this,Da)} @keydown=${r(this,Na)} @blur=${r(this,Ra)}
372
- @click=${()=>{this.open||o(this,E,Qt).call(this)}} @change=${p=>p.stopPropagation()} />
373
- <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?o(this,E,Ze).call(this):(o(this,E,Qt).call(this),o(this,E,or).call(this))}}></cm-icon>
395
+ @input=${s(this,un)} @keydown=${s(this,bn)} @blur=${s(this,fn)}
396
+ @click=${()=>{this.open||n(this,z,vi).call(this)}} @change=${p=>p.stopPropagation()} />
397
+ <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?n(this,z,ot).call(this):(n(this,z,vi).call(this),n(this,z,Aa).call(this))}}></cm-icon>
374
398
  </div>
375
399
  <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${p=>p.preventDefault()}>
376
- <ul role="listbox" id="${r(this,U)}-list" part="listbox" ?hidden=${!e.length}
377
- aria-labelledby=${this.label?`${r(this,U)}-l`:c} aria-label=${!this.label&&s?s:c}
400
+ <ul role="listbox" id="${s(this,X)}-list" part="listbox" ?hidden=${!e.length}
401
+ aria-labelledby=${this.label?`${s(this,X)}-l`:c} aria-label=${!this.label&&i?i:c}
378
402
  aria-multiselectable=${this.multiple?"true":c}>
379
- ${e.map((p,u)=>n`<li role="option" id="${r(this,U)}-o${u}" class=${u===this._active?"active":""}
403
+ ${e.map((p,m)=>o`<li role="option" id="${s(this,X)}-o${m}" class=${m===this._active?"active":""}
380
404
  aria-selected=${p.create?"false":l(p.value)?"true":"false"} aria-disabled=${p.disabled?"true":c}
381
- @pointerenter=${()=>!p.disabled&&(this._active=u)} @click=${()=>o(this,E,vo).call(this,u)}>
382
- ${p.create?n`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:p.label})}</span>`:n`${this.multiple?n`<cm-icon class="check" name="check" size="16"></cm-icon>`:c}<span>${o(this,E,ic).call(this,p.label)}</span>`}</li>`)}
405
+ @pointerenter=${()=>!p.disabled&&(this._active=m)} @click=${()=>n(this,z,al).call(this,m)}>
406
+ ${p.create?o`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:p.label})}</span>`:o`${this.multiple?o`<cm-icon class="check" name="check" size="16"></cm-icon>`:c}<span>${n(this,z,Zc).call(this,p.label)}</span>`}</li>`)}
383
407
  </ul>
384
- ${this.loading?n`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?c:n`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
408
+ ${this.loading?o`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText||this.t("loading")}</span></p>`:e.length?c:o`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
385
409
  </div>
386
410
  </div>
387
411
  <span class="vh" role="status" aria-live="polite">${d}</span>
388
- ${this.error?n`<p class="error" id="${r(this,U)}-err" role="alert">${this.error}</p>`:c}
389
- ${this.helpText?n`<p class="help" id="${r(this,U)}-help">${this.helpText}</p>`:c}
412
+ ${this.error?o`<p class="error" id="${s(this,X)}-err" role="alert">${this.error}</p>`:c}
413
+ ${this.helpText?o`<p class="help" id="${s(this,X)}-help">${this.helpText}</p>`:c}
390
414
  <slot></slot>
391
- </div>`}};ee=new WeakMap,U=new WeakMap,lr=new WeakMap,ei=new WeakMap,cr=new WeakMap,dr=new WeakMap,E=new WeakSet,go=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated){let t=e.filter(s=>s.hasAttribute("selected")).map(s=>s.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},rr=function(e){return this.items.find(t=>t.value===e)?.label??r(this,ei).get(e)??e},Aa=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(s=>s.label.toLowerCase()===t||s.value.toLowerCase()===t)||(this.multiple?this.values.some(s=>s.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},ar=function(){let e=this.loading?[]:[...this.filteredItems],t=r(this,E,Aa);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Zt=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Qt=function(){this.disabled||(this.open=!0)},Ze=function(){this.open=!1,this._active=-1},tc=function(e=o(this,E,ar).call(this)){return e.flatMap((t,s)=>t.disabled?[]:[s])},nr=function(e){let t=o(this,E,tc).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let s=t.indexOf(this._active);if(s<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(s+e+t.length)%t.length]},vo=function(e){let t=o(this,E,ar).call(this)[e];if(!(!t||t.disabled)){if(t.create){o(this,E,xo).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(s=>s!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,o(this,E,Zt).call(this),o(this,E,or).call(this);return}o(this,E,Ze).call(this),this._typing=!1,this._query=t.label,t.value!==this.value&&(this.value=t.value,o(this,E,Zt).call(this))}},xo=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(r(this,ei).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(o(this,E,Ze).call(this),this.value=e,this._typing=!1,this._query=e),o(this,E,Zt).call(this))},or=function(){this.renderRoot.querySelector("input")?.focus()},Da=new WeakMap,Na=new WeakMap,Ra=new WeakMap,ic=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let s=e.toLowerCase().indexOf(t.toLowerCase());return s<0||this.filter==="starts-with"&&s!==0?e:n`${e.slice(0,s)}<mark>${e.slice(s,s+t.length)}</mark>${e.slice(s+t.length)}`},Qe.formAssociated=!0,Qe.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Qe.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},Qe.styles=[g,La,m`
415
+ </div>`}};ne=new WeakMap,X=new WeakMap,Da=new WeakMap,xi=new WeakMap,Na=new WeakMap,Ia=new WeakMap,z=new WeakSet,sl=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated){let t=e.filter(i=>i.hasAttribute("selected")).map(i=>i.value);this.multiple&&!this.values.length&&t.length&&(this.values=t),!this.multiple&&!this.value&&t.length&&(this.value=t[0])}},Sa=function(e){return this.items.find(t=>t.value===e)?.label??s(this,xi).get(e)??e},mn=function(){if(!this.allowCustom||!this._typing)return"";let e=this._query.trim();if(!e)return"";let t=e.toLowerCase();return this.items.some(i=>i.label.toLowerCase()===t||i.value.toLowerCase()===t)||(this.multiple?this.values.some(i=>i.toLowerCase()===t):this.value.toLowerCase()===t)?"":e},La=function(){let e=this.loading?[]:[...this.filteredItems],t=s(this,z,mn);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},gi=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vi=function(){this.disabled||(this.open=!0)},ot=function(){this.open=!1,this._active=-1},Jc=function(e=n(this,z,La).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},Ca=function(e){let t=n(this,z,Jc).call(this);if(!t.length){this._active=-1;return}if(e==="first")return void(this._active=t[0]);if(e==="last")return void(this._active=t[t.length-1]);let i=t.indexOf(this._active);if(i<0){this._active=e>0?t[0]:t[t.length-1];return}this._active=t[(i+e+t.length)%t.length]},al=function(e){let t=n(this,z,La).call(this)[e];if(!(!t||t.disabled)){if(t.create){n(this,z,rl).call(this,t.value);return}if(this.multiple){this.values=this.values.includes(t.value)?this.values.filter(i=>i!==t.value):[...this.values,t.value],this._query="",this._typing=!1,this._active=-1,n(this,z,gi).call(this),n(this,z,Aa).call(this);return}n(this,z,ot).call(this),this._typing=!1,this._query=t.label,t.value!==this.value&&(this.value=t.value,n(this,z,gi).call(this))}},rl=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(s(this,xi).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(n(this,z,ot).call(this),this.value=e,this._typing=!1,this._query=e),n(this,z,gi).call(this))},Aa=function(){this.renderRoot.querySelector("input")?.focus()},un=new WeakMap,bn=new WeakMap,fn=new WeakMap,Zc=function(e){let t=this._typing?this._query.trim():"";if(!t||this.filter==="none")return e;let i=e.toLowerCase().indexOf(t.toLowerCase());return i<0||this.filter==="starts-with"&&i!==0?e:o`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},lt.formAssociated=!0,lt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},lt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},values:{type:Array},placeholder:{},options:{type:Array},multiple:{type:Boolean,reflect:!0},allowCustom:{type:Boolean,attribute:"allow-custom"},filter:{},loading:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},lt.styles=[v,dn,u`
392
416
  :host { display: block; position: relative; }
393
417
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
394
418
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -430,32 +454,32 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
430
454
  slot { display: none; }
431
455
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
432
456
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
433
- `];b("cm-combobox",Qe);var em=w("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),ue,hr,I,Ia,Ha,ti,yo,Oa,sc,qa,pr,$o,rc,wt=class extends y{constructor(){super(...arguments);h(this,I);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;h(this,ue,S("cm-gs"));h(this,hr);h(this,Oa,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),o(this,I,yo).call(this)});h(this,qa,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),o(this,I,sc).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,I,Ha)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.click());break;case"Escape":r(this,I,Ha)?(e.preventDefault(),e.stopPropagation(),o(this,I,ti).call(this)):this.value&&(e.preventDefault(),o(this,I,$o).call(this,!1));break;case"Tab":o(this,I,ti).call(this);break;default:}});h(this,pr,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),f(this,hr,Ta(this,()=>this.open,()=>o(this,I,ti).call(this))),document.addEventListener("keydown",r(this,pr))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=r(this,hr))==null||e.call(this),document.removeEventListener("keydown",r(this,pr))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=o(this,I,Ia).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,ue)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=o(this,I,Ia).call(this),t=r(this,I,Ha),s=e.filter(v=>v.item).length,l=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:s}):this.emptyText:"",d=-1,p=(this.results??[]).filter(v=>v?.items?.length),u=(v,$,x="")=>{d++;let L=d;return n`<a role="option" id="${r(this,ue)}-o${L}" class="${x}${L===this._active?" active":""}" href=${v.href} tabindex="-1"
434
- aria-selected=${L===this._active?"true":"false"} @pointerenter=${()=>this._active=L}
435
- @click=${M=>o(this,I,rc).call(this,M,v)}>${$}</a>`};return n`<div class="wrap">
436
- <div class="box" part="box" @click=${v=>{v.target===v.currentTarget&&this.focus()}}>
457
+ `];f("cm-combobox",lt);var du=k("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),xe,Ha,H,gn,vn,yi,nl,xn,Qc,yn,Ra,ol,ed,Dt=class extends w{constructor(){super(...arguments);h(this,H);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;h(this,xe,S("cm-gs"));h(this,Ha);h(this,xn,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),n(this,H,nl).call(this)});h(this,yn,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),n(this,H,Qc).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":s(this,H,vn)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${s(this,xe)}-o${this._active}`)?.click());break;case"Escape":s(this,H,vn)?(e.preventDefault(),e.stopPropagation(),n(this,H,yi).call(this)):this.value&&(e.preventDefault(),n(this,H,ol).call(this,!1));break;case"Tab":n(this,H,yi).call(this);break;default:}});h(this,Ra,e=>{if(!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented)return;let t=e.composedPath()[0];t&&(t.isContentEditable||/^(input|textarea|select)$/i.test(t.localName??""))||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),b(this,Ha,hn(this,()=>this.open,()=>n(this,H,yi).call(this))),document.addEventListener("keydown",s(this,Ra))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=s(this,Ha))==null||e.call(this),document.removeEventListener("keydown",s(this,Ra))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=n(this,H,gn).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,xe)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=n(this,H,gn).call(this),t=s(this,H,vn),i=e.filter(x=>x.item).length,l=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",d=-1,p=(this.results??[]).filter(x=>x?.items?.length),m=(x,$,y="")=>{d++;let T=d;return o`<a role="option" id="${s(this,xe)}-o${T}" class="${y}${T===this._active?" active":""}" href=${x.href} tabindex="-1"
458
+ aria-selected=${T===this._active?"true":"false"} @pointerenter=${()=>this._active=T}
459
+ @click=${M=>n(this,H,ed).call(this,M,x)}>${$}</a>`};return o`<div class="wrap">
460
+ <div class="box" part="box" @click=${x=>{x.target===x.currentTarget&&this.focus()}}>
437
461
  <cm-icon class="icon" name="search" size="14"></cm-icon>
438
- <input id="${r(this,ue)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
439
- aria-label=${this.label} placeholder=${this.placeholder||c} .value=${ne(this.value)}
440
- aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${r(this,ue)}-list"
441
- aria-activedescendant=${t&&this._active>=0?`${r(this,ue)}-o${this._active}`:c}
462
+ <input id="${s(this,xe)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
463
+ aria-label=${this.label} placeholder=${this.placeholder||c} .value=${re(this.value)}
464
+ aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${s(this,xe)}-list"
465
+ aria-activedescendant=${t&&this._active>=0?`${s(this,xe)}-o${this._active}`:c}
442
466
  aria-keyshortcuts=${this.shortcut||c}
443
- @input=${r(this,Oa)} @keydown=${r(this,qa)}
467
+ @input=${s(this,xn)} @keydown=${s(this,yn)}
444
468
  @focus=${()=>{this.value.trim()&&(this.open=!0)}} @click=${()=>{this.value.trim()&&(this.open=!0)}} />
445
- ${this.value?n`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>o(this,I,$o).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?n`<kbd aria-hidden="true">${this.shortcut}</kbd>`:c}
469
+ ${this.value?o`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>n(this,H,ol).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?o`<kbd aria-hidden="true">${this.shortcut}</kbd>`:c}
446
470
  </div>
447
- <div class="pop" part="popover" ?hidden=${!t} @pointerdown=${v=>v.preventDefault()}>
448
- <div role="listbox" id="${r(this,ue)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
449
- ${p.map((v,$)=>{let x=v.total??v.items.length;return n`<div role="group" aria-labelledby="${r(this,ue)}-g${$}">
450
- <div role="presentation" class="gh" id="${r(this,ue)}-g${$}"><span>${v.label}</span><span class="count" aria-hidden="true">${this.formatNumber(x)}</span><span class="vh">, ${this.t("results",{count:x})}</span></div>
451
- ${v.items.map(L=>u({group:v,item:L,href:L.href},n`${L.icon?n`<cm-icon name=${L.icon} size="16"></cm-icon>`:c}<span class="text"><span class="title">${L.title}</span>${L.description?n`<span class="vh">, </span><span class="desc">${L.description}</span>`:c}</span>`))}
452
- ${v.href?u({group:v,href:v.href},n`<span class="text">${v.seeAllLabel||this.seeAllLabel}</span>`,"all"):c}
471
+ <div class="pop" part="popover" ?hidden=${!t} @pointerdown=${x=>x.preventDefault()}>
472
+ <div role="listbox" id="${s(this,xe)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
473
+ ${p.map((x,$)=>{let y=x.total??x.items.length;return o`<div role="group" aria-labelledby="${s(this,xe)}-g${$}">
474
+ <div role="presentation" class="gh" id="${s(this,xe)}-g${$}"><span>${x.label}</span><span class="count" aria-hidden="true">${this.formatNumber(y)}</span><span class="vh">, ${this.t("results",{count:y})}</span></div>
475
+ ${x.items.map(T=>m({group:x,item:T,href:T.href},o`${T.icon?o`<cm-icon name=${T.icon} size="16"></cm-icon>`:c}<span class="text"><span class="title">${T.title}</span>${T.description?o`<span class="vh">, </span><span class="desc">${T.description}</span>`:c}</span>`))}
476
+ ${x.href?m({group:x,href:x.href},o`<span class="text">${x.seeAllLabel||this.seeAllLabel}</span>`,"all"):c}
453
477
  </div>`})}
454
478
  </div>
455
- ${this.loading?n`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?c:n`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
479
+ ${this.loading?o`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?c:o`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
456
480
  </div>
457
481
  <span class="vh" role="status" aria-live="polite">${l}</span>
458
- </div>`}};ue=new WeakMap,hr=new WeakMap,I=new WeakSet,Ia=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},Ha=function(){return this.open&&!!this.value.trim()},ti=function(){this.open=!1,this._active=-1},yo=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Oa=new WeakMap,sc=function(e){let t=o(this,I,Ia).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},qa=new WeakMap,pr=new WeakMap,$o=function(e=!0){this.value="",o(this,I,ti).call(this),e&&this.renderRoot.querySelector("input")?.focus(),o(this,I,yo).call(this)},rc=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),o(this,I,ti).call(this)},wt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},wt.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},wt.styles=[g,La,m`
482
+ </div>`}};xe=new WeakMap,Ha=new WeakMap,H=new WeakSet,gn=function(){return this.loading?[]:(this.results??[]).filter(e=>e?.items?.length).flatMap(e=>[...e.items.map(t=>({group:e,item:t,href:t.href})),...e.href?[{group:e,href:e.href}]:[]])},vn=function(){return this.open&&!!this.value.trim()},yi=function(){this.open=!1,this._active=-1},nl=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},xn=new WeakMap,Qc=function(e){let t=n(this,H,gn).call(this).length;if(!t){this._active=-1;return}this._active<0?this._active=e>0?0:t-1:this._active=(this._active+e+t)%t},yn=new WeakMap,Ra=new WeakMap,ol=function(e=!0){this.value="",n(this,H,yi).call(this),e&&this.renderRoot.querySelector("input")?.focus(),n(this,H,nl).call(this)},ed=function(e,t){this.dispatchEvent(new CustomEvent("cm-select",{detail:{href:t.href,item:t.item,group:t.group},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault(),n(this,H,yi).call(this)},Dt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},Dt.properties={label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},loading:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},shortcut:{},_active:{state:!0}},Dt.styles=[v,dn,u`
459
483
  :host { display: block; position: relative; }
460
484
  .wrap { position: relative; }
461
485
  .box {
@@ -507,20 +531,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
507
531
  .title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
508
532
  .desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
509
533
  .all { font-size: 13px; text-decoration: underline; }
510
- `];b("cm-global-search",wt);var Id=/^(\d{4})-(\d{2})-(\d{2})$/;function z(a){let i=Id.exec(a??"");if(!i)return null;let e=new Date(+i[1],+i[2]-1,+i[3]);return e.getFullYear()===+i[1]&&e.getMonth()===+i[2]-1&&e.getDate()===+i[3]?e:null}var ii=(a,i=2)=>String(a).padStart(i,"0"),ie=a=>`${ii(a.getFullYear(),4)}-${ii(a.getMonth()+1)}-${ii(a.getDate())}`,Hd=()=>ie(new Date),te=(a,i)=>new Date(a.getFullYear(),a.getMonth(),a.getDate()+i);function ke(a,i){let e=new Date(a.getFullYear(),a.getMonth()+i,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(a.getDate(),t))}var kt=a=>new Date(a.getFullYear(),a.getMonth(),1),Pa=a=>new Date(a.getFullYear(),a.getMonth()+1,0);var si={fromAttribute:a=>a?a.split(/[\s,]+/).filter(Boolean):[],toAttribute:a=>Array.isArray(a)?a.join(" "):a},mr=a=>Array.isArray(a)?a:typeof a=="string"?si.fromAttribute(a):[];function Ba(a,i){let e=[i,Us(a)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function ja(a){try{let i=new Intl.Locale(a),e=i.getWeekInfo?.()??i.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var ac=new Map;function Fa(a){let i=ac.get(a);if(i)return i;let e=M=>new Intl.DateTimeFormat(a,M),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),s=e({weekday:"short"}),l=e({weekday:"long"}),d=new Date(2024,0,7),p=t.formatToParts(new Date(2026,10,15)),u=p.filter(M=>M.type==="day"||M.type==="month"||M.type==="year").map(M=>M.type),v=p.map(M=>M.type==="day"?"{d}":M.type==="month"?"{m}":M.type==="year"?"{y}":M.value).join(""),$=(M,C)=>Array.from({length:12},(P,H)=>new Intl.DateTimeFormat(M,{month:C}).format(new Date(2024,H,1)).toLowerCase().replace(/\./g,"")),x=Array.from({length:12},(M,C)=>[...new Set([$(a,"long")[C],$(a,"short")[C],$("en","long")[C],$("en","short")[C]])]),L={short:M=>t.format(M),long:M=>we(M,{weekday:"long",day:"numeric",month:"long",year:"numeric"},a),medium:M=>we(M,{day:"numeric",month:"short",year:"numeric"},a),monthYear:M=>we(M,{month:"long",year:"numeric"},a),day:M=>we(M,{day:"numeric"},a),weekdaysShort:Array.from({length:7},(M,C)=>s.format(te(d,C))),weekdaysLong:Array.from({length:7},(M,C)=>l.format(te(d,C))),pattern:u.length===3?v:"{y}-{m}-{d}",order:u.length===3?u:["year","month","day"],months:x};return ac.set(a,L),L}var Va=(a,i)=>a.pattern.replace(/\{([dmy])\}/g,(e,t)=>i[t]);function Ua(a,i){let e=a.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let s,l,d,p=t.findIndex(v=>/\p{L}/u.test(v));if(p>=0){let v=t[p];l=i.months.findIndex(M=>M.some(C=>C===v||v.length>=3&&C.startsWith(v)))+1;let $=t.filter((M,C)=>C!==p);if(!l||$.some(M=>!/^\d+$/.test(M)))return null;let x=$.findIndex(M=>M.length===4),L=x>=0?x:1;s=+$[L],d=+$[1-L],$[L].length<=2&&(s+=2e3)}else{if(t.some(x=>!/^\d+$/.test(x)))return null;let v=t[0].length===4?["year","month","day"]:i.order,$=x=>t[v.indexOf(x)];if(s=+$("year"),l=+$("month"),d=+$("day"),$("year").length<=2)s+=2e3;else if($("year").length!==4)return null}let u=`${ii(s,4)}-${ii(l)}-${ii(d)}`;return z(u)?u:null}function Ka(a,i,e,t){let s=(e.getDay()-t+7)%7;switch(a){case"ArrowRight":return te(e,1);case"ArrowLeft":return te(e,-1);case"ArrowDown":return te(e,7);case"ArrowUp":return te(e,-7);case"Home":return te(e,-s);case"End":return te(e,6-s);case"PageDown":return ke(e,i.shiftKey?12:1);case"PageUp":return ke(e,i.shiftKey?-12:-1);default:return null}}var et=(a,i,e)=>i&&a<i?i:e&&a>e?e:a;function Wa(a){let{fmt:i,firstDay:e,month:t,focus:s,min:l,max:d}=a,p=kt(t),u=(p.getDay()-e+7)%7,v=Pa(t).getDate(),$=[],x=Array(u).fill(null);for(let H=1;H<=v;H++)x.push(new Date(t.getFullYear(),t.getMonth(),H)),x.length===7&&($.push(x),x=[]);x.length&&$.push([...x,...Array(7-x.length).fill(null)]);let L=Array.from({length:7},(H,O)=>(O+e)%7),M=Hd(),C=!!l&&Pa(ke(p,-1))<l,P=!!d&&ke(p,1)>d;return n`<div class="cal-head">
511
- <button type="button" class="cal-nav" part="calendar-nav" aria-label=${a.previousLabel} ?disabled=${C} @click=${()=>a.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
512
- <h2 id="${a.id}-month" class="cal-title" aria-live="polite">${i.monthYear(t)}</h2>
513
- <button type="button" class="cal-nav" part="calendar-nav" aria-label=${a.nextLabel} ?disabled=${P} @click=${()=>a.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
534
+ `];f("cm-global-search",Dt);var Vh=/^(\d{4})-(\d{2})-(\d{2})$/;function D(r){let a=Vh.exec(r??"");if(!a)return null;let e=new Date(+a[1],+a[2]-1,+a[3]);return e.getFullYear()===+a[1]&&e.getMonth()===+a[2]-1&&e.getDate()===+a[3]?e:null}var Te=(r,a=2)=>String(r).padStart(a,"0"),ee=r=>`${Te(r.getFullYear(),4)}-${Te(r.getMonth()+1)}-${Te(r.getDate())}`,Uh=()=>ee(new Date),oe=(r,a)=>new Date(r.getFullYear(),r.getMonth(),r.getDate()+a);function Se(r,a){let e=new Date(r.getFullYear(),r.getMonth()+a,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(r.getDate(),t))}var Nt=r=>new Date(r.getFullYear(),r.getMonth(),1),wn=r=>new Date(r.getFullYear(),r.getMonth()+1,0);var Kh=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function It(r){let a=Kh.exec(r??"");return a?+a[1]*60+ +a[2]:null}var Oa=r=>{let a=(Math.round(r)%1440+1440)%1440;return`${Te(Math.floor(a/60))}:${Te(a%60)}`};function Ht(r){let[a="",e=""]=(r??"").split("T"),t=It(e);return{date:D(a)?a:"",time:t===null?"":Oa(t)}}function qa(r,a=!1){let{date:e,time:t}=Ht(r),i=D(e);if(!i)return null;let l=t?It(t):a?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(l/60),l%60)}var sd=()=>{let r=new Date;return`${ee(r)}T${Te(r.getHours())}:${Te(r.getMinutes())}`},td=new Map;function ad(r,a){let e=a==="h12"||a==="h23"?a:void 0,t=`${r}|${e??""}`,i=td.get(t);if(i)return i;let l={hour:"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},d=new Intl.DateTimeFormat(r,l),p=d.resolvedOptions().hourCycle,m=_=>new Date(2e3,0,1,_,30),x=_=>(new Intl.DateTimeFormat(r,{hour:"numeric",hourCycle:"h12"}).formatToParts(m(_)).find(R=>R.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),$=(_,R)=>[...new Set([_,...R].filter(Boolean))],y=_=>_.replace(/[\u202f\u00a0]/g," "),T=y(d.formatToParts(m(9)).map(_=>_.type==="hour"?"{h}":_.type==="minute"?"{m}":_.value).join("")),M={format:_=>y(d.format(new Date(2e3,0,1,Math.floor(_/60),_%60))),dateTime:_=>V(_,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},r),pattern:T,hour12:p==="h12"||p==="h11",am:$(x(9),["am","a"]),pm:$(x(15),["pm","p"])};return td.set(t,M),M}var rd=(r,a)=>r.pattern.replace(/\{([hm])\}/g,(e,t)=>a[t]);function ll(r,a){let e=r.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&a.pm.includes(t),l=!!t&&a.am.includes(t);if(t&&!i&&!l)return null;let d=e.match(/\d+/g)??[],p,m;if(d.length===1){let x=d[0];if(x.length<=2)p=+x,m=0;else if(x.length<=4)p=+x.slice(0,-2),m=+x.slice(-2);else return null}else if(d.length===2||d.length===3){if(d[0].length>2||d[1].length!==2)return null;p=+d[0],m=+d[1]}else return null;if(m>59)return null;if(l||i){if(p<1||p>12)return null;p=p%12+(i?12:0)}else if(p>23)return null;return Oa(p*60+m)}var wi={fromAttribute:r=>r?r.split(/[\s,]+/).filter(Boolean):[],toAttribute:r=>Array.isArray(r)?r.join(" "):r},Pa=r=>Array.isArray(r)?r:typeof r=="string"?wi.fromAttribute(r):[];function $n(r,a){let e=[a,ba(r)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function kn(r){try{let a=new Intl.Locale(r),e=a.getWeekInfo?.()??a.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var id=new Map;function En(r){let a=id.get(r);if(a)return a;let e=M=>new Intl.DateTimeFormat(r,M),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),l=e({weekday:"long"}),d=new Date(2024,0,7),p=t.formatToParts(new Date(2026,10,15)),m=p.filter(M=>M.type==="day"||M.type==="month"||M.type==="year").map(M=>M.type),x=p.map(M=>M.type==="day"?"{d}":M.type==="month"?"{m}":M.type==="year"?"{y}":M.value).join(""),$=(M,_)=>Array.from({length:12},(R,O)=>new Intl.DateTimeFormat(M,{month:_}).format(new Date(2024,O,1)).toLowerCase().replace(/\./g,"")),y=Array.from({length:12},(M,_)=>[...new Set([$(r,"long")[_],$(r,"short")[_],$("en","long")[_],$("en","short")[_]])]),T={short:M=>t.format(M),long:M=>V(M,{weekday:"long",day:"numeric",month:"long",year:"numeric"},r),medium:M=>V(M,{day:"numeric",month:"short",year:"numeric"},r),monthYear:M=>V(M,{month:"long",year:"numeric"},r),day:M=>V(M,{day:"numeric"},r),weekdaysShort:Array.from({length:7},(M,_)=>i.format(oe(d,_))),weekdaysLong:Array.from({length:7},(M,_)=>l.format(oe(d,_))),pattern:m.length===3?x:"{y}-{m}-{d}",order:m.length===3?m:["year","month","day"],months:y};return id.set(r,T),T}var Mn=(r,a)=>r.pattern.replace(/\{([dmy])\}/g,(e,t)=>a[t]);function _n(r,a){let e=r.trim().toLowerCase();if(!e)return null;let t=e.split(/[^\p{L}\p{N}]+/u).filter(Boolean);if(t.length!==3)return null;let i,l,d,p=t.findIndex(x=>/\p{L}/u.test(x));if(p>=0){let x=t[p];l=a.months.findIndex(M=>M.some(_=>_===x||x.length>=3&&_.startsWith(x)))+1;let $=t.filter((M,_)=>_!==p);if(!l||$.some(M=>!/^\d+$/.test(M)))return null;let y=$.findIndex(M=>M.length===4),T=y>=0?y:1;i=+$[T],d=+$[1-T],$[T].length<=2&&(i+=2e3)}else{if(t.some(y=>!/^\d+$/.test(y)))return null;let x=t[0].length===4?["year","month","day"]:a.order,$=y=>t[x.indexOf(y)];if(i=+$("year"),l=+$("month"),d=+$("day"),$("year").length<=2)i+=2e3;else if($("year").length!==4)return null}let m=`${Te(i,4)}-${Te(l)}-${Te(d)}`;return D(m)?m:null}function zn(r,a,e,t){let i=(e.getDay()-t+7)%7;switch(r){case"ArrowRight":return oe(e,1);case"ArrowLeft":return oe(e,-1);case"ArrowDown":return oe(e,7);case"ArrowUp":return oe(e,-7);case"Home":return oe(e,-i);case"End":return oe(e,6-i);case"PageDown":return Se(e,a.shiftKey?12:1);case"PageUp":return Se(e,a.shiftKey?-12:-1);default:return null}}var ct=(r,a,e)=>a&&r<a?a:e&&r>e?e:r;function Tn(r){let{fmt:a,firstDay:e,month:t,focus:i,min:l,max:d}=r,p=Nt(t),m=(p.getDay()-e+7)%7,x=wn(t).getDate(),$=[],y=Array(m).fill(null);for(let O=1;O<=x;O++)y.push(new Date(t.getFullYear(),t.getMonth(),O)),y.length===7&&($.push(y),y=[]);y.length&&$.push([...y,...Array(7-y.length).fill(null)]);let T=Array.from({length:7},(O,q)=>(q+e)%7),M=Uh(),_=!!l&&wn(Se(p,-1))<l,R=!!d&&Se(p,1)>d;return o`<div class="cal-head">
535
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${r.previousLabel} ?disabled=${_} @click=${()=>r.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
536
+ <h2 id="${r.id}-month" class="cal-title" aria-live="polite">${a.monthYear(t)}</h2>
537
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${r.nextLabel} ?disabled=${R} @click=${()=>r.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
514
538
  </div>
515
- <table role="grid" class="cal-grid" part="calendar" aria-labelledby="${a.id}-month" @keydown=${a.onKey}>
516
- <thead><tr>${L.map(H=>n`<th scope="col" abbr=${i.weekdaysLong[H]}><span aria-hidden="true">${i.weekdaysShort[H]}</span><span class="vh">${i.weekdaysLong[H]}</span></th>`)}</tr></thead>
517
- <tbody>${$.map(H=>n`<tr>${H.map(O=>{if(!O)return n`<td class="empty"></td>`;let Ht=ie(O),Ot=a.isDisabled(O)||!!l&&O<l||!!d&&O>d,$l=a.mark(O),wl=a.note?.(O);return n`<td class="day ${$l} ${Ht===M?"today":""}" data-date=${Ht}
518
- tabindex=${Ht===ie(s)?"0":"-1"}
519
- aria-selected=${$l?"true":"false"} aria-disabled=${Ot?"true":c}
520
- aria-current=${Ht===M?"date":c}
521
- aria-label="${i.long(O)}${wl?`, ${wl}`:""}"
522
- @click=${()=>!Ot&&a.onPick(O)} @pointerenter=${()=>a.onHover?.(O)}><span aria-hidden="true">${i.day(O)}</span></td>`})}</tr>`)}</tbody>
523
- </table>`}var Ya=m`
539
+ <table role="grid" class="cal-grid" part="calendar" aria-labelledby="${r.id}-month" @keydown=${r.onKey}>
540
+ <thead><tr>${T.map(O=>o`<th scope="col" abbr=${a.weekdaysLong[O]}><span aria-hidden="true">${a.weekdaysShort[O]}</span><span class="vh">${a.weekdaysLong[O]}</span></th>`)}</tr></thead>
541
+ <tbody>${$.map(O=>o`<tr>${O.map(q=>{if(!q)return o`<td class="empty"></td>`;let ii=ee(q),si=r.isDisabled(q)||!!l&&q<l||!!d&&q>d,bc=r.mark(q),fc=r.note?.(q);return o`<td class="day ${bc} ${ii===M?"today":""}" data-date=${ii}
542
+ tabindex=${ii===ee(i)?"0":"-1"}
543
+ aria-selected=${bc?"true":"false"} aria-disabled=${si?"true":c}
544
+ aria-current=${ii===M?"date":c}
545
+ aria-label="${a.long(q)}${fc?`, ${fc}`:""}"
546
+ @click=${()=>!si&&r.onPick(q)} @pointerenter=${()=>r.onHover?.(q)}><span aria-hidden="true">${a.day(q)}</span></td>`})}</tr>`)}</tbody>
547
+ </table>`}var Sn=u`
524
548
  .pop {
525
549
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline-start: 0;
526
550
  width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-15);
@@ -552,7 +576,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
552
576
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
553
577
  }
554
578
  @media (max-width: 640px) { .day, .empty { height: 36px; } }
555
- `;function Ga(a,i){if(a.key!=="Tab")return;let e=[...i.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=i.getRootNode(),s=e.indexOf(t.activeElement);a.preventDefault(),e[(s+(a.shiftKey?-1:1)+e.length)%e.length].focus()}var Xa=m`
579
+ `;function Ln(r,a){if(r.key!=="Tab")return;let e=[...a.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=a.getRootNode(),i=e.indexOf(t.activeElement);r.preventDefault(),e[(i+(r.shiftKey?-1:1)+e.length)%e.length].focus()}var Cn=u`
556
580
  :host { display: block; position: relative; }
557
581
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
558
582
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -583,60 +607,73 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
583
607
  :host([size='small']) .field { gap: 6px; }
584
608
  :host([size='small']) .label { font-size: 12px; }
585
609
  :host([size='small']) input { font-size: 14px; }
586
- `;var hm=w("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date."}),ni,K,be,oi,li,it,T,wo,ri,ko,Eo,ai,nc,ur,br,Mo,_o,Ja,Za,Qa,en,tn,fr,tt=class extends y{constructor(){super(...arguments);h(this,T);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";h(this,ni,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._focus=new Date;h(this,K,this.attachInternals());h(this,be,S("cm-dp"));h(this,oi,null);h(this,li,!1);h(this,it,!1);h(this,Ja,()=>{this.disabled||(this.open?this.open=!1:(o(this,T,br).call(this),this.show()))});h(this,Za,e=>{e.key==="Enter"?o(this,T,br).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),o(this,T,br).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});h(this,Qa,e=>{let t=Ka(de(e,this),e,this._focus,r(this,T,ko));if(t){e.preventDefault(),this._focus=et(t,z(this.min),z(this.max)),f(this,it,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,T,Mo).call(this,this._focus))});h(this,en,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,T,_o).call(this);return}Ga(e,e.currentTarget)});h(this,tn,e=>{this._focus=et(ke(this._focus,e),z(this.min),z(this.max))});h(this,fr,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,ni)}set locale(e){let t=r(this,ni);f(this,ni,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,oi)===null&&f(this,oi,this.value),document.addEventListener("pointerdown",r(this,fr),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,fr),!0)}get form(){return r(this,K).form}get validity(){return r(this,K).validity}get validationMessage(){return r(this,K).validationMessage}get valueAsDate(){return z(this.value)}checkValidity(){return r(this,K).checkValidity()}reportValidity(){return r(this,K).reportValidity()}formResetCallback(){this.value=r(this,oi)??"",this._text=o(this,T,ai).call(this,this.value),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(o(this,T,nc).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=z(e);if(!t)return!0;let s=z(this.min),l=z(this.max);return s&&t<s||l&&t>l?!0:mr(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){e.has("value")&&!r(this,li)?this._text=o(this,T,ai).call(this,this.value):e.has("locale")&&z(this.value)&&(this._text=o(this,T,ai).call(this,this.value)),f(this,li,!1)}updated(e){r(this,K).setFormValue(this.value||null,this._text);let t=this.renderRoot.querySelector("input")??void 0,s=z(this.value),l=r(this,T,ri);this.error?r(this,K).setValidity({customError:!0},this.error,t):this._text.trim()&&!s?r(this,K).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,T,Eo)}),t):this.required&&!s?r(this,K).setValidity({valueMissing:!0},this.t("required"),t):s&&z(this.min)&&s<z(this.min)?r(this,K).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:l.medium(z(this.min))}),t):s&&z(this.max)&&s>z(this.max)?r(this,K).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:l.medium(z(this.max))}),t):s&&this.isUnavailable(this.value)?r(this,K).setValidity({customError:!0},this.t("unavailable"),t):r(this,K).setValidity({}),this.open&&r(this,it)&&(f(this,it,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&f(this,it,!1)}render(){let e=r(this,T,ri),t=z(this.value),s=[this.error&&`${r(this,be)}-err`,this.helpText&&`${r(this,be)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",p=kt(this._focus);return n`<div class="field">
587
- ${this.label?n`<label class="label" for="${r(this,be)}-in" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
588
- <div class="wrap">
610
+ /* cm-date-picker with \`time\`: the date box and a time box side by side, wrapping onto two rows when narrow. */
611
+ .wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); }
612
+ .wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
613
+ .wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--cm-space-10); }
614
+ `;var wu=k("datePicker",{choose:"Choose date",chooseFor:"Choose date for {label}",change:"Change date, {date}",changeFor:"Change date for {label}, {date}",dialog:"Choose date",previousMonth:"Previous month",nextMonth:"Next month",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badInput:"Enter a date like {pattern}.",required:"Enter or choose a date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"This date isn't available. Choose another date.",time:"Time",timeFor:"Time for {label}",patternHour:"hh",patternMinute:"mm",badTime:"Enter a time like {pattern}.",timeMissing:"Enter a time.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Mi,j,ye,_i,Fe,mt,le,pe,zi,Ti,g,Ba,dt,Si,An,Rt,$i,qe,ht,Pe,Be,Dn,cl,dl,ki,Ot,hl,pl,nd,Nn,od,ml,Ei,Fa,ja,ul,ld,In,bl,fl,Hn,Rn,On,qn,Pn,Va,pt=class extends w{constructor(){super(...arguments);h(this,g);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";h(this,Mi,"");this.disabledDates=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this.time=!1;this.step=1;this.hourCycle="";this._text="";this._focus=new Date;h(this,j,this.attachInternals());h(this,ye,S("cm-dp"));h(this,_i,null);h(this,Fe,!1);h(this,mt,!1);h(this,le,"");h(this,pe,"");h(this,zi,!1);h(this,Ti,"");h(this,Si,!1);h(this,In,e=>{e.key==="Enter"?n(this,g,ul).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),n(this,g,ld).call(this,e.key==="ArrowUp"?1:-1))});h(this,Hn,()=>{this.disabled||(this.open?this.open=!1:(n(this,g,ja).call(this),this.show()))});h(this,Rn,e=>{e.key==="Enter"?n(this,g,ja).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),n(this,g,ja).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});h(this,On,e=>{let t=zn(fe(e,this),e,this._focus,s(this,g,cl));if(t){e.preventDefault(),this._focus=ct(t,s(this,g,Pe),s(this,g,Be)),b(this,mt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n(this,g,bl).call(this,this._focus))});h(this,qn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,n(this,g,fl).call(this);return}Ln(e,e.currentTarget)});h(this,Pn,e=>{this._focus=ct(Se(this._focus,e),s(this,g,Pe),s(this,g,Be))});h(this,Va,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Mi)}set locale(e){let t=s(this,Mi);b(this,Mi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,_i)===null&&b(this,_i,this.value),document.addEventListener("pointerdown",s(this,Va),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Va),!0)}get form(){return s(this,j).form}get validity(){return s(this,j).validity}get validationMessage(){return s(this,j).validationMessage}get valueAsDate(){return this.time?this.value?qa(this.value):null:D(this.value)}checkValidity(){return n(this,g,Nn).call(this),s(this,j).checkValidity()}reportValidity(){return n(this,g,Nn).call(this),s(this,j).reportValidity()}formResetCallback(){this.value=s(this,_i)??"",this.time&&(n(this,g,pl).call(this,this.value),b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt)),this._text=n(this,g,ki).call(this,s(this,g,qe)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(n(this,g,nd).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=D(e);if(!t)return!0;let i=s(this,g,Pe),l=s(this,g,Be);return i&&t<i||l&&t>l?!0:Pa(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!s(this,Si)?(n(this,g,pl).call(this,this.value),s(this,zi)||b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt)):this.time&&(e.has("locale")||e.has("hourCycle"))&&s(this,pe)&&b(this,g,n(this,g,Ot).call(this,s(this,pe)),dt),(e.has("value")||e.has("time"))&&!s(this,Fe)?this._text=n(this,g,ki).call(this,s(this,g,qe)):e.has("locale")&&D(s(this,g,qe))&&(this._text=n(this,g,ki).call(this,s(this,g,qe))),b(this,Fe,!1),b(this,zi,!1),b(this,Si,!1)}updated(e){s(this,j).setFormValue(this.value||null,this.time?this.value:this._text),n(this,g,Nn).call(this),this.open&&s(this,mt)&&(b(this,mt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&b(this,mt,!1)}render(){let e=s(this,g,Rt),t=D(s(this,g,qe)),i=[this.error&&`${s(this,ye)}-err`,this.helpText&&`${s(this,ye)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=this.label||l||"",p=Nt(this._focus);return o`<div class="field">
615
+ ${this.label?o`<label class="label" for="${s(this,ye)}-in" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</label>`:c}
616
+ <div class="wrap ${this.time?"timed":""}">
589
617
  <div class="box" part="box">
590
- <input id="${r(this,be)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
591
- .value=${ne(this._text)} placeholder=${this.placeholder||r(this,T,Eo)}
618
+ <input id="${s(this,ye)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
619
+ .value=${re(this._text)} placeholder=${this.placeholder||s(this,g,dl)}
592
620
  aria-label=${!this.label&&l?l:c}
593
621
  ?required=${this.required} ?disabled=${this.disabled}
594
- aria-invalid=${this.error?"true":c} aria-describedby=${s||c}
595
- @input=${u=>{u.stopPropagation(),this._text=u.target.value}}
596
- @change=${()=>o(this,T,br).call(this)} @keydown=${r(this,Za)} />
622
+ aria-invalid=${this.error?"true":c} aria-describedby=${i||c}
623
+ @input=${m=>{m.stopPropagation(),this._text=m.target.value}}
624
+ @change=${()=>n(this,g,ja).call(this)} @keydown=${s(this,Rn)} />
597
625
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
598
626
  aria-label=${t?this.t(d?"changeFor":"change",{label:d,date:e.long(t)}):this.t(d?"chooseFor":"choose",{label:d})}
599
- aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,be)}-pop"
600
- @click=${r(this,Ja)}><cm-icon name="calendar" size="18"></cm-icon></button>
627
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,ye)}-pop"
628
+ @click=${s(this,Hn)}><cm-icon name="calendar" size="18"></cm-icon></button>
601
629
  </div>
602
- <div class="pop" id="${r(this,be)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
603
- ?hidden=${!this.open} @keydown=${r(this,en)}>
604
- ${this.open?n`<div class="cal">${Wa({id:r(this,be),fmt:e,firstDay:r(this,T,ko),month:p,focus:this._focus,min:z(this.min),max:z(this.max),isDisabled:u=>this.isUnavailable(ie(u)),mark:u=>t&&ie(u)===this.value?"selected":"",onPick:u=>o(this,T,Mo).call(this,u),onKey:r(this,Qa),onMonth:r(this,tn),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:c}
630
+ ${this.time?o`<div class="box time" part="time-box">
631
+ <input class="time-in" part="time-input" type="text" autocomplete="off" spellcheck="false"
632
+ .value=${re(s(this,g,Ba))} placeholder=${s(this,g,hl)}
633
+ aria-label=${this.t(d?"timeFor":"time",{label:d})}
634
+ ?required=${this.required} ?disabled=${this.disabled}
635
+ aria-invalid=${this.error?"true":c} aria-describedby=${i||c}
636
+ @input=${m=>{m.stopPropagation(),b(this,g,m.target.value,dt)}}
637
+ @change=${()=>n(this,g,ul).call(this)} @keydown=${s(this,In)} />
638
+ </div>`:c}
639
+ <div class="pop" id="${s(this,ye)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
640
+ ?hidden=${!this.open} @keydown=${s(this,qn)}>
641
+ ${this.open?o`<div class="cal">${Tn({id:s(this,ye),fmt:e,firstDay:s(this,g,cl),month:p,focus:this._focus,min:s(this,g,Pe),max:s(this,g,Be),isDisabled:m=>this.isUnavailable(ee(m)),mark:m=>t&&ee(m)===s(this,g,qe)?"selected":"",onPick:m=>n(this,g,bl).call(this,m),onKey:s(this,On),onMonth:s(this,Pn),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:c}
605
642
  </div>
606
643
  </div>
607
- ${this.error?n`<p class="error" id="${r(this,be)}-err" role="alert">${this.error}</p>`:c}
608
- ${this.helpText?n`<p class="help" id="${r(this,be)}-help">${this.helpText}</p>`:c}
609
- </div>`}};ni=new WeakMap,K=new WeakMap,be=new WeakMap,oi=new WeakMap,li=new WeakMap,it=new WeakMap,T=new WeakSet,wo=function(){return Ba(this,this.locale)},ri=function(){return Fa(r(this,T,wo))},ko=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?ja(r(this,T,wo)):(Math.trunc(e)%7+7)%7},Eo=function(){return Va(r(this,T,ri),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},ai=function(e){let t=z(e);return t?r(this,T,ri).short(t):e},nc=function(){let e=new Date,t=z(this.value)??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=et(t,z(this.min),z(this.max)),f(this,it,!0)},ur=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},br=function(){let e=this._text.trim();if(!e){o(this,T,ur).call(this,"");return}let t=Ua(e,r(this,T,ri));t?(o(this,T,ur).call(this,t),this._text=o(this,T,ai).call(this,t)):(f(this,li,!0),o(this,T,ur).call(this,""))},Mo=function(e){let t=ie(e);this.isUnavailable(t)||(this.open=!1,o(this,T,ur).call(this,t),this._text=o(this,T,ai).call(this,t),o(this,T,_o).call(this))},_o=function(){this.renderRoot.querySelector(".trigger")?.focus()},Ja=new WeakMap,Za=new WeakMap,Qa=new WeakMap,en=new WeakMap,tn=new WeakMap,fr=new WeakMap,tt.formAssociated=!0,tt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},tt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:si},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_focus:{state:!0}},tt.styles=[g,Xa,Ya,m`.pop { min-width: 0; }`];b("cm-date-picker",tt);var xm=w("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month"}),Od={today:["Today",a=>[a,a]],yesterday:["Yesterday",a=>[te(a,-1),te(a,-1)]],"last-7-days":["Last 7 days",a=>[te(a,-6),a]],"last-30-days":["Last 30 days",a=>[te(a,-29),a]],"last-90-days":["Last 90 days",a=>[te(a,-89),a]],"this-month":["This month",a=>[kt(a),a]],"last-month":["Last month",a=>[kt(ke(a,-1)),Pa(ke(a,-1))]]},qd=a=>a.replace(/-([a-z0-9])/g,(i,e)=>e.toUpperCase());function oc(a,i=new Date,e){if(typeof a=="object"&&a)return a;let t=Od[a];if(!t)return null;let s=new Date(i.getFullYear(),i.getMonth(),i.getDate()),[l,d]=t[1](s);return{label:e?.(qd(a))||t[0],start:ie(l),end:ie(d)}}var hi,j,oe,pi,mi,rt,_,zo,ci,So,Ne,sn,De,lc,rn,di,Lo,cc,an,nn,on,ln,cn,gr,To,st=class extends y{constructor(){super(...arguments);h(this,_);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";h(this,hi,"");this.disabledDates=[];this.presets=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;h(this,j,this.attachInternals());h(this,oe,S("cm-drp"));h(this,pi,null);h(this,mi,!1);h(this,rt,!1);h(this,Ne,"start");h(this,nn,()=>{this.disabled||(this.open?this.open=!1:(o(this,_,di).call(this,"start"),o(this,_,di).call(this,"end"),this.show()))});h(this,on,e=>t=>{t.key==="Enter"?o(this,_,di).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),o(this,_,di).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});h(this,ln,e=>{let t=Ka(de(e,this),e,this._focus,r(this,_,So));if(t){e.preventDefault(),this._focus=et(t,z(this.min),z(this.max)),f(this,rt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,_,Lo).call(this,this._focus))});h(this,cn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,_,an).call(this);return}Ga(e,e.currentTarget)});h(this,gr,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,hi)}set locale(e){let t=r(this,hi);f(this,hi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,pi)||f(this,pi,[this.start,this.end]),document.addEventListener("pointerdown",r(this,gr),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,gr),!0)}get form(){return r(this,j).form}get validity(){return r(this,j).validity}get validationMessage(){return r(this,j).validationMessage}checkValidity(){return r(this,j).checkValidity()}reportValidity(){return r(this,j).reportValidity()}formResetCallback(){[this.start,this.end]=r(this,pi)??["",""],this._startText=o(this,_,De).call(this,this.start),this._endText=o(this,_,De).call(this,this.end),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=z(this.start)?this.start:"",this._draftEnd=z(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=et(z(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),z(this.min),z(this.max)),f(this,Ne,"start"),f(this,rt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=z(e);if(!t)return!0;let s=z(this.min),l=z(this.max);return s&&t<s||l&&t>l?!0:mr(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){r(this,mi)||(e.has("start")&&(this._startText=o(this,_,De).call(this,this.start)),e.has("end")&&(this._endText=o(this,_,De).call(this,this.end))),f(this,mi,!1),e.has("locale")&&(z(this.start)&&(this._startText=o(this,_,De).call(this,this.start)),z(this.end)&&(this._endText=o(this,_,De).call(this,this.end)))}updated(){let e=z(this.start),t=z(this.end),s=new FormData;(this.name||this.startName)&&e&&s.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&s.append(this.endName||`${this.name}-end`,this.end),r(this,j).setFormValue(e||t?s:null,`${this.start}/${this.end}`);let l=this.renderRoot.querySelectorAll("input"),[d,p]=[l[0]??void 0,l[1]??void 0],u=r(this,_,ci),v=z(this.min),$=z(this.max);this.error?r(this,j).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?r(this,j).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,_,sn)}),d):this._endText.trim()&&!t?r(this,j).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,_,sn)}),p):this.required&&(!e||!t)?r(this,j).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?r(this,j).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&v&&e<v||t&&v&&t<v?r(this,j).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(v)}),d):e&&$&&e>$||t&&$&&t>$?r(this,j).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium($)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,j).setValidity({customError:!0},this.t("unavailable"),d):r(this,j).setValidity({}),this.open&&r(this,rt)&&(f(this,rt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,_,ci),t=z(this.start),s=z(this.end),l=[this.error&&`${r(this,oe)}-err`,this.helpText&&`${r(this,oe)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=mr(this.presets).map(x=>oc(x,new Date,L=>this.t(L))).filter(x=>!!x),v=r(this,Ne)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(z(this._draftStart))}):this.t("chooseStart"),$=x=>{let L=x==="start"?this._startText:this._endText;return n`<input id="${r(this,oe)}-${x}" type="text" autocomplete="off" spellcheck="false"
610
- .value=${ne(L)} placeholder=${r(this,_,sn)}
611
- aria-label=${x==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
644
+ ${this.error?o`<p class="error" id="${s(this,ye)}-err" role="alert">${this.error}</p>`:c}
645
+ ${this.helpText?o`<p class="help" id="${s(this,ye)}-help">${this.helpText}</p>`:c}
646
+ </div>`}};Mi=new WeakMap,j=new WeakMap,ye=new WeakMap,_i=new WeakMap,Fe=new WeakMap,mt=new WeakMap,le=new WeakMap,pe=new WeakMap,zi=new WeakMap,Ti=new WeakMap,g=new WeakSet,Ba=function(){return s(this,Ti)},dt=function(e){e!==s(this,Ti)&&(b(this,Ti,e),this.requestUpdate())},Si=new WeakMap,An=function(){return $n(this,this.locale)},Rt=function(){return En(s(this,g,An))},$i=function(){return ad(s(this,g,An),this.hourCycle)},qe=function(){return this.time?s(this,le):this.value},ht=function(e){return this.time&&e.trim().toLowerCase()==="now"?sd():e},Pe=function(){return D(Ht(n(this,g,ht).call(this,this.min)).date||this.min)},Be=function(){return D(Ht(n(this,g,ht).call(this,this.max)).date||this.max)},Dn=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},cl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?kn(s(this,g,An)):(Math.trunc(e)%7+7)%7},dl=function(){return Mn(s(this,g,Rt),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},ki=function(e){let t=D(e);return t?s(this,g,Rt).short(t):e},Ot=function(e){let t=It(e);return t===null?"":s(this,g,$i).format(t)},hl=function(){return rd(s(this,g,$i),{h:this.t("patternHour"),m:this.t("patternMinute")})},pl=function(e){let{date:t,time:i}=Ht(e);b(this,le,t),b(this,pe,t?i:"")},nd=function(){let e=new Date,t=D(s(this,g,qe))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=ct(t,s(this,g,Pe),s(this,g,Be)),b(this,mt,!0)},Nn=function(){let e=this.renderRoot.querySelector("input")??void 0,t=D(s(this,g,qe)),i=s(this,g,Rt);this.error?s(this,j).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?s(this,j).setValidity({badInput:!0},this.t("badInput",{pattern:s(this,g,dl)}),e):this.time?n(this,g,od).call(this,t,e):this.required&&!t?s(this,j).setValidity({valueMissing:!0},this.t("required"),e):t&&s(this,g,Pe)&&t<s(this,g,Pe)?s(this,j).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(s(this,g,Pe))}),e):t&&s(this,g,Be)&&t>s(this,g,Be)?s(this,j).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(s(this,g,Be))}),e):t&&this.isUnavailable(this.value)?s(this,j).setValidity({customError:!0},this.t("unavailable"),e):s(this,j).setValidity({})},od=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,l=(y,T,M,_=t)=>s(this,j).setValidity(y,this.t(T,M),_),d=It(s(this,pe));if(s(this,g,Ba).trim()&&d===null)return l({badInput:!0},"badTime",{pattern:s(this,g,hl)},i);if(!e&&d===null)return this.required?l({valueMissing:!0},"required"):s(this,j).setValidity({});if(!e)return l({badInput:!0},"required");if(d===null)return l({badInput:!0},"timeMissing",void 0,i);let p=qa(`${s(this,le)}T${s(this,pe)}`),m=qa(n(this,g,ht).call(this,this.min)),x=qa(n(this,g,ht).call(this,this.max),!0),$=(y,T)=>Ht(y).time?s(this,g,$i).dateTime(T):s(this,g,Rt).medium(T);if(m&&p<m)return l({rangeUnderflow:!0},"rangeUnderflow",{date:$(n(this,g,ht).call(this,this.min),m)},i);if(x&&p>x)return l({rangeOverflow:!0},"rangeOverflow",{date:$(n(this,g,ht).call(this,this.max),x)},i);if(d%s(this,g,Dn))return l({stepMismatch:!0},"stepMismatch",{count:s(this,g,Dn)},i);if(this.isUnavailable(s(this,le)))return l({customError:!0},"unavailable");s(this,j).setValidity({})},ml=function(e){e!==this.value&&(this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Ei=function(e,t){b(this,le,e),b(this,pe,t);let i=e&&t?`${e}T${t}`:"";b(this,Si,!0),this.requestUpdate(),n(this,g,ml).call(this,i)},Fa=function(e){this.time?n(this,g,Ei).call(this,e,s(this,pe)):n(this,g,ml).call(this,e)},ja=function(){let e=this._text.trim();if(!e){n(this,g,Fa).call(this,"");return}let t=_n(e,s(this,g,Rt));t?(n(this,g,Fa).call(this,t),this._text=n(this,g,ki).call(this,t)):(b(this,Fe,!0),n(this,g,Fa).call(this,""))},ul=function(){let e=s(this,g,Ba).trim(),t=e?ll(e,s(this,g,$i)):"";if(b(this,Fe,!0),t===null){b(this,zi,!0),n(this,g,Ei).call(this,s(this,le),"");return}n(this,g,Ei).call(this,s(this,le),t),b(this,g,n(this,g,Ot).call(this,t),dt)},ld=function(e){let t=s(this,g,Dn),i=ll(s(this,g,Ba),s(this,g,$i));if(!i){let m=Ht(n(this,g,ht).call(this,this.min)),x=new Date;if(i=m.time&&(!s(this,le)||s(this,le)===m.date)?m.time:Oa(x.getHours()*60+x.getMinutes()),It(i)%t===0){b(this,Fe,!0),n(this,g,Ei).call(this,s(this,le),i),b(this,g,n(this,g,Ot).call(this,i),dt);return}e=1}let l=It(i),d=e>0?(Math.floor(l/t)+1)*t:(Math.ceil(l/t)-1)*t,p=Oa(d>=1440?0:d<0?Math.floor(1439/t)*t:d);b(this,Fe,!0),n(this,g,Ei).call(this,s(this,le),p),b(this,g,n(this,g,Ot).call(this,p),dt)},In=new WeakMap,bl=function(e){let t=ee(e);this.isUnavailable(t)||(this.open=!1,n(this,g,Fa).call(this,t),this._text=n(this,g,ki).call(this,t),this.time&&!s(this,pe)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):n(this,g,fl).call(this))},fl=function(){this.renderRoot.querySelector(".trigger")?.focus()},Hn=new WeakMap,Rn=new WeakMap,On=new WeakMap,qn=new WeakMap,Pn=new WeakMap,Va=new WeakMap,pt.formAssociated=!0,pt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},pt.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},min:{},max:{},placeholder:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:wi},isDateDisabled:{attribute:!1},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},time:{type:Boolean,reflect:!0},step:{type:Number},hourCycle:{attribute:"hour-cycle"},_text:{state:!0},_focus:{state:!0}},pt.styles=[v,Cn,Sn,u`.pop { min-width: 0; }`];f("cm-date-picker",pt);var Su=k("dateRangePicker",{choose:"Choose dates",chooseFor:"Choose dates for {label}",change:"Change dates, {start} to {end}",changeFor:"Change dates for {label}, {start} to {end}",dialog:"Choose dates",previousMonth:"Previous month",nextMonth:"Next month",start:"Start date",end:"End date",presets:"Preset ranges",chooseStart:"Choose the start date.",chooseEnd:"Start date {date}. Choose the end date.",startNote:"start date",endNote:"end date",patternDay:"dd",patternMonth:"mm",patternYear:"yyyy",badStart:"Enter a start date like {pattern}.",badEnd:"Enter an end date like {pattern}.",required:"Enter or choose a start and end date.",endBeforeStart:"The end date is before the start date.",rangeUnderflow:"Choose {date} or later.",rangeOverflow:"Choose {date} or earlier.",unavailable:"A chosen date isn't available. Choose another date.",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",thisMonth:"This month",lastMonth:"Last month"}),Wh={today:["Today",r=>[r,r]],yesterday:["Yesterday",r=>[oe(r,-1),oe(r,-1)]],"last-7-days":["Last 7 days",r=>[oe(r,-6),r]],"last-30-days":["Last 30 days",r=>[oe(r,-29),r]],"last-90-days":["Last 90 days",r=>[oe(r,-89),r]],"this-month":["This month",r=>[Nt(r),r]],"last-month":["Last month",r=>[Nt(Se(r,-1)),wn(Se(r,-1))]]},Yh=r=>r.replace(/-([a-z0-9])/g,(a,e)=>e.toUpperCase());function cd(r,a=new Date,e){if(typeof r=="object"&&r)return r;let t=Wh[r];if(!t)return null;let i=new Date(a.getFullYear(),a.getMonth(),a.getDate()),[l,d]=t[1](i);return{label:e?.(Yh(r))||t[0],start:ee(l),end:ee(d)}}var Ai,U,me,Di,Ni,bt,L,gl,Li,vl,Ve,Bn,je,dd,Fn,Ci,xl,hd,jn,Vn,Un,Kn,Wn,Ua,yl,ut=class extends w{constructor(){super(...arguments);h(this,L);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";h(this,Ai,"");this.disabledDates=[];this.presets=[];this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._startText="";this._endText="";this._focus=new Date;this._draftStart="";this._draftEnd="";this._hover=null;h(this,U,this.attachInternals());h(this,me,S("cm-drp"));h(this,Di,null);h(this,Ni,!1);h(this,bt,!1);h(this,Ve,"start");h(this,Vn,()=>{this.disabled||(this.open?this.open=!1:(n(this,L,Ci).call(this,"start"),n(this,L,Ci).call(this,"end"),this.show()))});h(this,Un,e=>t=>{t.key==="Enter"?n(this,L,Ci).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),n(this,L,Ci).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});h(this,Kn,e=>{let t=zn(fe(e,this),e,this._focus,s(this,L,vl));if(t){e.preventDefault(),this._focus=ct(t,D(this.min),D(this.max)),b(this,bt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),n(this,L,xl).call(this,this._focus))});h(this,Wn,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,n(this,L,jn).call(this);return}Ln(e,e.currentTarget)});h(this,Ua,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Ai)}set locale(e){let t=s(this,Ai);b(this,Ai,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,Di)||b(this,Di,[this.start,this.end]),document.addEventListener("pointerdown",s(this,Ua),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Ua),!0)}get form(){return s(this,U).form}get validity(){return s(this,U).validity}get validationMessage(){return s(this,U).validationMessage}checkValidity(){return s(this,U).checkValidity()}reportValidity(){return s(this,U).reportValidity()}formResetCallback(){[this.start,this.end]=s(this,Di)??["",""],this._startText=n(this,L,je).call(this,this.start),this._endText=n(this,L,je).call(this,this.end),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=D(this.start)?this.start:"",this._draftEnd=D(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=ct(D(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),D(this.min),D(this.max)),b(this,Ve,"start"),b(this,bt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=D(e);if(!t)return!0;let i=D(this.min),l=D(this.max);return i&&t<i||l&&t>l?!0:Pa(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){s(this,Ni)||(e.has("start")&&(this._startText=n(this,L,je).call(this,this.start)),e.has("end")&&(this._endText=n(this,L,je).call(this,this.end))),b(this,Ni,!1),e.has("locale")&&(D(this.start)&&(this._startText=n(this,L,je).call(this,this.start)),D(this.end)&&(this._endText=n(this,L,je).call(this,this.end)))}updated(){let e=D(this.start),t=D(this.end),i=new FormData;(this.name||this.startName)&&e&&i.append(this.startName||`${this.name}-start`,this.start),(this.name||this.endName)&&t&&i.append(this.endName||`${this.name}-end`,this.end),s(this,U).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let l=this.renderRoot.querySelectorAll("input"),[d,p]=[l[0]??void 0,l[1]??void 0],m=s(this,L,Li),x=D(this.min),$=D(this.max);this.error?s(this,U).setValidity({customError:!0},this.error,d):this._startText.trim()&&!e?s(this,U).setValidity({badInput:!0},this.t("badStart",{pattern:s(this,L,Bn)}),d):this._endText.trim()&&!t?s(this,U).setValidity({badInput:!0},this.t("badEnd",{pattern:s(this,L,Bn)}),p):this.required&&(!e||!t)?s(this,U).setValidity({valueMissing:!0},this.t("required"),e?p:d):e&&t&&t<e?s(this,U).setValidity({badInput:!0},this.t("endBeforeStart"),p):e&&x&&e<x||t&&x&&t<x?s(this,U).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:m.medium(x)}),d):e&&$&&e>$||t&&$&&t>$?s(this,U).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:m.medium($)}),p):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?s(this,U).setValidity({customError:!0},this.t("unavailable"),d):s(this,U).setValidity({}),this.open&&s(this,bt)&&(b(this,bt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=s(this,L,Li),t=D(this.start),i=D(this.end),l=[this.error&&`${s(this,me)}-err`,this.helpText&&`${s(this,me)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",m=Pa(this.presets).map(y=>cd(y,new Date,T=>this.t(T))).filter(y=>!!y),x=s(this,Ve)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(D(this._draftStart))}):this.t("chooseStart"),$=y=>{let T=y==="start"?this._startText:this._endText;return o`<input id="${s(this,me)}-${y}" type="text" autocomplete="off" spellcheck="false"
647
+ .value=${re(T)} placeholder=${s(this,L,Bn)}
648
+ aria-label=${y==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
612
649
  ?required=${this.required} ?disabled=${this.disabled}
613
650
  aria-invalid=${this.error?"true":c} aria-describedby=${l||c}
614
- @input=${M=>{M.stopPropagation();let C=M.target.value;x==="start"?this._startText=C:this._endText=C}}
615
- @change=${()=>o(this,_,di).call(this,x)} @keydown=${r(this,on).call(this,x)} />`};return n`<div class="field" role="group" aria-labelledby=${this.label?`${r(this,oe)}-l`:c} aria-label=${!this.label&&d?d:c}>
616
- ${this.label?n`<span class="label" id="${r(this,oe)}-l" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
651
+ @input=${M=>{M.stopPropagation();let _=M.target.value;y==="start"?this._startText=_:this._endText=_}}
652
+ @change=${()=>n(this,L,Ci).call(this,y)} @keydown=${s(this,Un).call(this,y)} />`};return o`<div class="field" role="group" aria-labelledby=${this.label?`${s(this,me)}-l`:c} aria-label=${!this.label&&d?d:c}>
653
+ ${this.label?o`<span class="label" id="${s(this,me)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
617
654
  <div class="wrap">
618
655
  <div class="box" part="box">
619
656
  ${$("start")}<span class="sep" aria-hidden="true">–</span>${$("end")}
620
657
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
621
- aria-label=${t&&s?this.t(p?"changeFor":"change",{label:p,start:e.long(t),end:e.long(s)}):this.t(p?"chooseFor":"choose",{label:p})}
622
- aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,oe)}-pop"
623
- @click=${r(this,nn)}><cm-icon name="calendar" size="18"></cm-icon></button>
658
+ aria-label=${t&&i?this.t(p?"changeFor":"change",{label:p,start:e.long(t),end:e.long(i)}):this.t(p?"chooseFor":"choose",{label:p})}
659
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,me)}-pop"
660
+ @click=${s(this,Vn)}><cm-icon name="calendar" size="18"></cm-icon></button>
624
661
  </div>
625
- <div class="pop" id="${r(this,oe)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
626
- ?hidden=${!this.open} @keydown=${r(this,cn)}>
627
- ${this.open?n`<div class="body">
628
- ${u.length?n`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(x=>n`<li>
629
- <button type="button" class="preset" aria-pressed=${x.start===this.start&&x.end===this.end?"true":"false"}
630
- @click=${()=>o(this,_,cc).call(this,x)}>${x.label}</button></li>`)}</ul>`:c}
631
- <div class="cal">${Wa({id:r(this,oe),fmt:e,firstDay:r(this,_,So),month:kt(this._focus),focus:this._focus,min:z(this.min),max:z(this.max),isDisabled:x=>this.isUnavailable(ie(x)),mark:x=>o(this,_,To).call(this,x),note:x=>{let L=o(this,_,To).call(this,x);return L==="start"?this.t("startNote"):L==="end"?this.t("endNote"):""},onPick:x=>o(this,_,Lo).call(this,x),onKey:r(this,ln),onMonth:x=>{this._focus=et(ke(this._focus,x),z(this.min),z(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:x=>{r(this,Ne)==="end"&&(this._hover=x)}})}
632
- <p class="status" aria-live="polite">${v}</p>
662
+ <div class="pop" id="${s(this,me)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
663
+ ?hidden=${!this.open} @keydown=${s(this,Wn)}>
664
+ ${this.open?o`<div class="body">
665
+ ${m.length?o`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${m.map(y=>o`<li>
666
+ <button type="button" class="preset" aria-pressed=${y.start===this.start&&y.end===this.end?"true":"false"}
667
+ @click=${()=>n(this,L,hd).call(this,y)}>${y.label}</button></li>`)}</ul>`:c}
668
+ <div class="cal">${Tn({id:s(this,me),fmt:e,firstDay:s(this,L,vl),month:Nt(this._focus),focus:this._focus,min:D(this.min),max:D(this.max),isDisabled:y=>this.isUnavailable(ee(y)),mark:y=>n(this,L,yl).call(this,y),note:y=>{let T=n(this,L,yl).call(this,y);return T==="start"?this.t("startNote"):T==="end"?this.t("endNote"):""},onPick:y=>n(this,L,xl).call(this,y),onKey:s(this,Kn),onMonth:y=>{this._focus=ct(Se(this._focus,y),D(this.min),D(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:y=>{s(this,Ve)==="end"&&(this._hover=y)}})}
669
+ <p class="status" aria-live="polite">${x}</p>
633
670
  </div>
634
671
  </div>`:c}
635
672
  </div>
636
673
  </div>
637
- ${this.error?n`<p class="error" id="${r(this,oe)}-err" role="alert">${this.error}</p>`:c}
638
- ${this.helpText?n`<p class="help" id="${r(this,oe)}-help">${this.helpText}</p>`:c}
639
- </div>`}};hi=new WeakMap,j=new WeakMap,oe=new WeakMap,pi=new WeakMap,mi=new WeakMap,rt=new WeakMap,_=new WeakSet,zo=function(){return Ba(this,this.locale)},ci=function(){return Fa(r(this,_,zo))},So=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?ja(r(this,_,zo)):(Math.trunc(e)%7+7)%7},Ne=new WeakMap,sn=function(){return Va(r(this,_,ci),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},De=function(e){let t=z(e);return t?r(this,_,ci).short(t):e},lc=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},rn=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,o(this,_,lc).call(this))},di=function(e){let t=(e==="start"?this._startText:this._endText).trim(),s=t?Ua(t,r(this,_,ci)):"";t&&!s&&f(this,mi,!0);let l=e==="start"?[s??"",this.end]:[this.start,s??""];o(this,_,rn).call(this,...l),s&&(e==="start"?this._startText=o(this,_,De).call(this,s):this._endText=o(this,_,De).call(this,s))},Lo=function(e){let t=ie(e);if(!this.isUnavailable(t)){if(r(this,Ne)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",f(this,Ne,"end"),this._focus=e,f(this,rt,!0);return}this._draftEnd=t,this.open=!1,o(this,_,rn).call(this,this._draftStart,t),o(this,_,an).call(this)}},cc=function(e){this.open=!1,o(this,_,rn).call(this,e.start,e.end),o(this,_,an).call(this)},an=function(){this.renderRoot.querySelector(".trigger")?.focus()},nn=new WeakMap,on=new WeakMap,ln=new WeakMap,cn=new WeakMap,gr=new WeakMap,To=function(e){let t=ie(e),s=this._draftStart,l=this._draftEnd||(r(this,Ne)==="end"&&s?ie(this._hover??this._focus):"");return t===s?"start":t===l&&l>s?"end":s&&l&&t>s&&t<l?"in-range":""},st.formAssociated=!0,st.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},st.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:si},isDateDisabled:{attribute:!1},presets:{converter:si},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0}},st.styles=[g,Xa,Ya,m`
674
+ ${this.error?o`<p class="error" id="${s(this,me)}-err" role="alert">${this.error}</p>`:c}
675
+ ${this.helpText?o`<p class="help" id="${s(this,me)}-help">${this.helpText}</p>`:c}
676
+ </div>`}};Ai=new WeakMap,U=new WeakMap,me=new WeakMap,Di=new WeakMap,Ni=new WeakMap,bt=new WeakMap,L=new WeakSet,gl=function(){return $n(this,this.locale)},Li=function(){return En(s(this,L,gl))},vl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?kn(s(this,L,gl)):(Math.trunc(e)%7+7)%7},Ve=new WeakMap,Bn=function(){return Mn(s(this,L,Li),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},je=function(e){let t=D(e);return t?s(this,L,Li).short(t):e},dd=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Fn=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,n(this,L,dd).call(this))},Ci=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?_n(t,s(this,L,Li)):"";t&&!i&&b(this,Ni,!0);let l=e==="start"?[i??"",this.end]:[this.start,i??""];n(this,L,Fn).call(this,...l),i&&(e==="start"?this._startText=n(this,L,je).call(this,i):this._endText=n(this,L,je).call(this,i))},xl=function(e){let t=ee(e);if(!this.isUnavailable(t)){if(s(this,Ve)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",b(this,Ve,"end"),this._focus=e,b(this,bt,!0);return}this._draftEnd=t,this.open=!1,n(this,L,Fn).call(this,this._draftStart,t),n(this,L,jn).call(this)}},hd=function(e){this.open=!1,n(this,L,Fn).call(this,e.start,e.end),n(this,L,jn).call(this)},jn=function(){this.renderRoot.querySelector(".trigger")?.focus()},Vn=new WeakMap,Un=new WeakMap,Kn=new WeakMap,Wn=new WeakMap,Ua=new WeakMap,yl=function(e){let t=ee(e),i=this._draftStart,l=this._draftEnd||(s(this,Ve)==="end"&&i?ee(this._hover??this._focus):"");return t===i?"start":t===l&&l>i?"end":i&&l&&t>i&&t<l?"in-range":""},ut.formAssociated=!0,ut.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},ut.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},startName:{attribute:"start-name"},endName:{attribute:"end-name"},start:{},end:{},min:{},max:{},locale:{noAccessor:!0},firstDayOfWeek:{type:Number,attribute:"first-day-of-week"},disabledDates:{attribute:"disabled-dates",converter:wi},isDateDisabled:{attribute:!1},presets:{converter:wi},startLabel:{attribute:"start-label",string:"start"},endLabel:{attribute:"end-label",string:"end"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_startText:{state:!0},_endText:{state:!0},_focus:{state:!0},_draftStart:{state:!0},_draftEnd:{state:!0},_hover:{state:!0}},ut.styles=[v,Cn,Sn,u`
640
677
  .sep { flex: none; color: var(--cm-text-tertiary); }
641
678
  input { flex: 0 1 6.6em; }
642
679
  :host([size='small']) input { flex-basis: 6.6em; }
@@ -656,29 +693,29 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
656
693
  .presets li { flex: 0 0 auto; }
657
694
  .preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-full); min-height: 32px; }
658
695
  }
659
- `];b("cm-date-range-picker",st);var Mm=w("fileUpload",{prompt:"Click here to upload",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files"});function Pd(a,i){if(!i.trim())return!0;let e=a.name.toLowerCase(),t=a.type.toLowerCase();return i.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean).some(s=>s.startsWith(".")?e.endsWith(s):s.endsWith("/*")?t.startsWith(s.slice(0,-1)):t===s)}var fe,ge,Re,W,Co,dc,hc,dn,Ao,at=class extends y{constructor(){super(...arguments);h(this,W);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";h(this,fe,this.attachInternals());h(this,ge,S("cm-fu"));h(this,Re,new Map)}get form(){return r(this,fe).form}get validity(){return r(this,fe).validity}get validationMessage(){return r(this,fe).validationMessage}checkValidity(){return r(this,fe).checkValidity()}reportValidity(){return r(this,fe).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,Re).values())URL.revokeObjectURL(e);r(this,Re).clear()}updated(e){if(e.has("files"))for(let[d,p]of r(this,Re))this.files.includes(d)||(URL.revokeObjectURL(p),r(this,Re).delete(d));let t=new FormData;for(let d of this.files)t.append(this.name||"file",d);r(this,fe).setFormValue(this.files.length?t:null);let s=this.renderRoot.querySelector("input")??void 0,l=this.error||this._rejected;l?r(this,fe).setValidity({customError:!0},l,s):this.required&&!this.files.length?r(this,fe).setValidity({valueMissing:!0},this.t("required"),s):r(this,fe).setValidity({})}addFiles(e){let t=[...e],s=[],l=[],d=[];for(let u of t)Pd(u,this.accept)?this.maxSize&&u.size>this.maxSize?(l.push(u),d.push(this.t("tooLarge",{name:u.name,size:o(this,W,Co).call(this,this.maxSize)}))):s.push(u):(l.push(u),d.push(this.t("wrongType",{name:u.name})));let p=this.multiple?[...this.files,...s]:s.slice(-1);!this.multiple&&!s.length&&(p=this.files),this.multiple&&this.maxFiles&&p.length>this.maxFiles&&(l.push(...p.slice(this.maxFiles)),d.push(this.t("tooMany",{max:this.maxFiles})),p=p.slice(0,this.maxFiles)),this._rejected=d.join(". "),l.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:l}})),p!==this.files&&(p.length!==this.files.length||p.some((u,v)=>u!==this.files[v]))&&(this.files=p,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){let e=this.error||this._rejected,t=!this.files.length||this.multiple,s=this.files.length>0;return n`
660
- ${this.label||this.hint?n`<div class="head">
661
- ${this.label?n`<span class="label" id="${r(this,ge)}-l" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
662
- ${this.hint?n`<span class="hint" id="${r(this,ge)}-hint">${this.hint}</span>`:c}
696
+ `];f("cm-date-range-picker",ut);var Iu=k("fileUpload",{prompt:"Click here to upload",addMore:"Add more",files:"Chosen files",remove:"Remove {name}",kilobytes:"{size} KB",megabytes:"{size} MB",required:"Please choose a file.",wrongType:"{name} is not an allowed file type",tooLarge:"{name} is larger than {size}",tooMany:"You can add up to {max} files"});function Gh(r,a){if(!a.trim())return!0;let e=r.name.toLowerCase(),t=r.type.toLowerCase();return a.split(",").map(i=>i.trim().toLowerCase()).filter(Boolean).some(i=>i.startsWith(".")?e.endsWith(i):i.endsWith("/*")?t.startsWith(i.slice(0,-1)):t===i)}var we,$e,Ue,J,wl,pd,md,Yn,$l,ft=class extends w{constructor(){super(...arguments);h(this,J);this.label="";this.hint="";this.name="";this.accept="";this.multiple=!1;this.maxSize=0;this.maxFiles=0;this.required=!1;this.disabled=!1;this.error="";this.files=[];this._rejected="";h(this,we,this.attachInternals());h(this,$e,S("cm-fu"));h(this,Ue,new Map)}get form(){return s(this,we).form}get validity(){return s(this,we).validity}get validationMessage(){return s(this,we).validationMessage}checkValidity(){return s(this,we).checkValidity()}reportValidity(){return s(this,we).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of s(this,Ue).values())URL.revokeObjectURL(e);s(this,Ue).clear()}updated(e){if(e.has("files"))for(let[d,p]of s(this,Ue))this.files.includes(d)||(URL.revokeObjectURL(p),s(this,Ue).delete(d));let t=new FormData;for(let d of this.files)t.append(this.name||"file",d);s(this,we).setFormValue(this.files.length?t:null);let i=this.renderRoot.querySelector("input")??void 0,l=this.error||this._rejected;l?s(this,we).setValidity({customError:!0},l,i):this.required&&!this.files.length?s(this,we).setValidity({valueMissing:!0},this.t("required"),i):s(this,we).setValidity({})}addFiles(e){let t=[...e],i=[],l=[],d=[];for(let m of t)Gh(m,this.accept)?this.maxSize&&m.size>this.maxSize?(l.push(m),d.push(this.t("tooLarge",{name:m.name,size:n(this,J,wl).call(this,this.maxSize)}))):i.push(m):(l.push(m),d.push(this.t("wrongType",{name:m.name})));let p=this.multiple?[...this.files,...i]:i.slice(-1);!this.multiple&&!i.length&&(p=this.files),this.multiple&&this.maxFiles&&p.length>this.maxFiles&&(l.push(...p.slice(this.maxFiles)),d.push(this.t("tooMany",{max:this.maxFiles})),p=p.slice(0,this.maxFiles)),this._rejected=d.join(". "),l.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:l}})),p!==this.files&&(p.length!==this.files.length||p.some((m,x)=>m!==this.files[x]))&&(this.files=p,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return o`
697
+ ${this.label||this.hint?o`<div class="head">
698
+ ${this.label?o`<span class="label" id="${s(this,$e)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
699
+ ${this.hint?o`<span class="hint" id="${s(this,$e)}-hint">${this.hint}</span>`:c}
663
700
  </div>`:c}
664
- ${s?n`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
665
- ${this.files.map(l=>n`<li class="file">
666
- ${l.type.startsWith("image/")?n`<img src=${o(this,W,dc).call(this,l)} alt=${l.name} />`:n`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${l.name}</span><span class="size">${o(this,W,Co).call(this,l.size)}</span></div>`}
667
- ${this.disabled?c:n`<button type="button" class="remove" aria-label=${this.t("remove",{name:l.name})} @click=${()=>this.removeFile(l)}><cm-icon name="close" size="12"></cm-icon></button>`}
701
+ ${i?o`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
702
+ ${this.files.map(l=>o`<li class="file">
703
+ ${l.type.startsWith("image/")?o`<img src=${n(this,J,pd).call(this,l)} alt=${l.name} />`:o`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${l.name}</span><span class="size">${n(this,J,wl).call(this,l.size)}</span></div>`}
704
+ ${this.disabled?c:o`<button type="button" class="remove" aria-label=${this.t("remove",{name:l.name})} @click=${()=>this.removeFile(l)}><cm-icon name="close" size="12"></cm-icon></button>`}
668
705
  </li>`)}
669
- ${t?n`<li>${o(this,W,Ao).call(this,!0)}</li>`:c}
670
- </ul>`:o(this,W,Ao).call(this,!1)}
671
- ${e?n`<p class="msg" id="${r(this,ge)}-msg" role="alert">${e}</p>`:c}
672
- `}};fe=new WeakMap,ge=new WeakMap,Re=new WeakMap,W=new WeakSet,Co=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},dc=function(e){let t=r(this,Re).get(e);return t||(t=URL.createObjectURL(e),r(this,Re).set(e,t)),t},hc=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},dn=function(e){this.toggleAttribute("data-over",e)},Ao=function(e){let t=[this.hint&&`${r(this,ge)}-hint`,(this.error||this._rejected)&&`${r(this,ge)}-msg`].filter(Boolean).join(" ");return n`<label class="zone ${e?"tile":""}" part="zone"
673
- @dragenter=${()=>o(this,W,dn).call(this,!0)} @dragleave=${()=>o(this,W,dn).call(this,!1)} @drop=${()=>o(this,W,dn).call(this,!1)}>
674
- <input type="file" id=${r(this,ge)} accept=${this.accept||c} ?multiple=${this.multiple} ?disabled=${this.disabled}
706
+ ${t?o`<li>${n(this,J,$l).call(this,!0)}</li>`:c}
707
+ </ul>`:n(this,J,$l).call(this,!1)}
708
+ ${e?o`<p class="msg" id="${s(this,$e)}-msg" role="alert">${e}</p>`:c}
709
+ `}};we=new WeakMap,$e=new WeakMap,Ue=new WeakMap,J=new WeakSet,wl=function(e){return e>=1024*1024?this.t("megabytes",{size:this.formatNumber(+(e/1024/1024).toFixed(1),{useGrouping:!1})}):this.t("kilobytes",{size:this.formatNumber(Math.max(1,Math.round(e/1024)),{useGrouping:!1})})},pd=function(e){let t=s(this,Ue).get(e);return t||(t=URL.createObjectURL(e),s(this,Ue).set(e,t)),t},md=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},Yn=function(e){this.toggleAttribute("data-over",e)},$l=function(e){let t=[this.hint&&`${s(this,$e)}-hint`,(this.error||this._rejected)&&`${s(this,$e)}-msg`].filter(Boolean).join(" ");return o`<label class="zone ${e?"tile":""}" part="zone"
710
+ @dragenter=${()=>n(this,J,Yn).call(this,!0)} @dragleave=${()=>n(this,J,Yn).call(this,!1)} @drop=${()=>n(this,J,Yn).call(this,!1)}>
711
+ <input type="file" id=${s(this,$e)} accept=${this.accept||c} ?multiple=${this.multiple} ?disabled=${this.disabled}
675
712
  ?required=${this.required&&!this.files.length}
676
- aria-labelledby=${[this.label&&`${r(this,ge)}-l`,`${r(this,ge)}-p`].filter(Boolean).join(" ")}
713
+ aria-labelledby=${[this.label&&`${s(this,$e)}-l`,`${s(this,$e)}-p`].filter(Boolean).join(" ")}
677
714
  aria-describedby=${t||c} aria-invalid=${this.error||this._rejected?"true":c}
678
- @change=${o(this,W,hc)} @cancel=${s=>s.stopPropagation()} />
715
+ @change=${n(this,J,md)} @cancel=${i=>i.stopPropagation()} />
679
716
  <cm-icon name=${e?"plus":"upload"} size=${e?24:38}></cm-icon>
680
- <span id="${r(this,ge)}-p">${e?this.t("addMore"):this.prompt}</span>
681
- </label>`},at.formAssociated=!0,at.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},at.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},_rejected:{state:!0}},at.styles=[g,m`
717
+ <span id="${s(this,$e)}-p">${e?this.t("addMore"):this.prompt}</span>
718
+ </label>`},ft.formAssociated=!0,ft.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},ft.properties={label:{},hint:{},prompt:{string:"prompt"},name:{reflect:!0},accept:{},multiple:{type:Boolean},maxSize:{type:Number,attribute:"max-size"},maxFiles:{type:Number,attribute:"max-files"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},error:{reflect:!0},files:{attribute:!1},_rejected:{state:!0}},ft.styles=[v,u`
682
719
  :host { display: block; }
683
720
  .head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-10); margin-bottom: var(--cm-space-20); }
684
721
  .label { font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
@@ -715,17 +752,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
715
752
  .zone:not(.tile) { min-height: 100px; font-size: 14px; }
716
753
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
717
754
  }
718
- `];b("cm-file-upload",at);var Am=w("optionGroup",{required:"Please select one of these options."}),ye,vr,ui,xr,Ee,Do,No,pc,Et=class extends y{constructor(){super(...arguments);h(this,Ee);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];h(this,ye,this.attachInternals());h(this,vr,S("cm-og"));h(this,ui,"");h(this,xr,new MutationObserver(()=>o(this,Ee,Do).call(this)))}connectedCallback(){super.connectedCallback(),o(this,Ee,Do).call(this),r(this,xr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,xr).disconnect()}get form(){return r(this,ye).form}get validity(){return r(this,ye).validity}get validationMessage(){return r(this,ye).validationMessage}checkValidity(){return r(this,ye).checkValidity()}reportValidity(){return r(this,ye).reportValidity()}formResetCallback(){this.value=r(this,ui)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,ui)||f(this,ui,this.value)}updated(){r(this,ye).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,ye).setValidity({valueMissing:!0},this.t("required"),e):r(this,ye).setValidity({})}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),s=t>=0?t:e.findIndex(d=>!d.disabled),l=this.getAttribute("aria-label");return n`
719
- ${this.label?n`<span class="label" id="${r(this,vr)}-l" part="label">${this.label}${this.required?n`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
755
+ `];f("cm-file-upload",ft);var Fu=k("optionGroup",{required:"Please select one of these options."}),Me,Ka,Ii,Wa,Le,kl,El,ud,qt=class extends w{constructor(){super(...arguments);h(this,Le);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];h(this,Me,this.attachInternals());h(this,Ka,S("cm-og"));h(this,Ii,"");h(this,Wa,new MutationObserver(()=>n(this,Le,kl).call(this)))}connectedCallback(){super.connectedCallback(),n(this,Le,kl).call(this),s(this,Wa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Wa).disconnect()}get form(){return s(this,Me).form}get validity(){return s(this,Me).validity}get validationMessage(){return s(this,Me).validationMessage}checkValidity(){return s(this,Me).checkValidity()}reportValidity(){return s(this,Me).reportValidity()}formResetCallback(){this.value=s(this,Ii)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){s(this,Ii)||b(this,Ii,this.value)}updated(){s(this,Me).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?s(this,Me).setValidity({valueMissing:!0},this.t("required"),e):s(this,Me).setValidity({})}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),l=this.getAttribute("aria-label");return o`
756
+ ${this.label?o`<span class="label" id="${s(this,Ka)}-l" part="label">${this.label}${this.required?o`<span class="req" aria-hidden="true">*</span>`:c}</span>`:c}
720
757
  <div class="options" part="options" role="radiogroup"
721
- aria-labelledby=${this.label?`${r(this,vr)}-l`:c} aria-label=${!this.label&&l?l:c}
758
+ aria-labelledby=${this.label?`${s(this,Ka)}-l`:c} aria-label=${!this.label&&l?l:c}
722
759
  aria-required=${this.required?"true":c}>
723
- ${e.map((d,p)=>n`<button type="button" role="radio" part="option" aria-checked=${d.value===this.value?"true":"false"}
724
- tabindex=${p===s?"0":"-1"} ?disabled=${this.disabled||!!d.disabled}
725
- @click=${()=>o(this,Ee,No).call(this,p)} @keydown=${u=>o(this,Ee,pc).call(this,u,p)}>${d.label}</button>`)}
760
+ ${e.map((d,p)=>o`<button type="button" role="radio" part="option" aria-checked=${d.value===this.value?"true":"false"}
761
+ tabindex=${p===i?"0":"-1"} ?disabled=${this.disabled||!!d.disabled}
762
+ @click=${()=>n(this,Le,El).call(this,p)} @keydown=${m=>n(this,Le,ud).call(this,m,p)}>${d.label}</button>`)}
726
763
  </div>
727
764
  <slot></slot>
728
- `}};ye=new WeakMap,vr=new WeakMap,ui=new WeakMap,xr=new WeakMap,Ee=new WeakSet,Do=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,ui,this.value))},No=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},pc=function(e,t){let s=de(e,this),l=this.items.flatMap((u,v)=>u.disabled?[]:[v]),d=l.indexOf(t),p;if(s==="ArrowRight"||e.key==="ArrowDown")p=l[(d+1)%l.length];else if(s==="ArrowLeft"||e.key==="ArrowUp")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&o(this,Ee,No).call(this,p)},Et.formAssociated=!0,Et.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},Et.styles=[g,m`
765
+ `}};Me=new WeakMap,Ka=new WeakMap,Ii=new WeakMap,Wa=new WeakMap,Le=new WeakSet,kl=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>({value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled})),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",b(this,Ii,this.value))},El=function(e){let t=this.items[e];!t||t.disabled||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll("button")[e]?.focus()),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},ud=function(e,t){let i=fe(e,this),l=this.items.flatMap((m,x)=>m.disabled?[]:[x]),d=l.indexOf(t),p;if(i==="ArrowRight"||e.key==="ArrowDown")p=l[(d+1)%l.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&n(this,Le,El).call(this,p)},qt.formAssociated=!0,qt.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},qt.styles=[v,u`
729
766
  :host { display: block; }
730
767
  .label { display: block; margin-bottom: var(--cm-space-20); font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
731
768
  .req { color: var(--cm-text-critical); margin-inline-start: 2px; }
@@ -746,25 +783,25 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
746
783
  .options { gap: var(--cm-space-10); }
747
784
  button { height: 42px; padding: 0 var(--cm-space-15); font-size: 14px; }
748
785
  }
749
- `];b("cm-option-group",Et);var qm=w("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),yr,Ro,bi=class extends y{constructor(){super(...arguments);h(this,yr);this.heading="";this.breadcrumbs=[];this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=[...e].reverse().find(s=>s.href);return n`<header part="header">
786
+ `];f("cm-option-group",qt);var Gu=k("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Ya,Ml,Hi=class extends w{constructor(){super(...arguments);h(this,Ya);this.heading="";this.breadcrumbs=[];this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=[...e].reverse().find(i=>i.href);return o`<header part="header">
750
787
  <div class="lead">
751
- ${t?n`<a class="back" part="back" href=${t.href} aria-label=${this.t("back",{label:t.label})}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:c}
788
+ ${t?o`<a class="back" part="back" href=${t.href} aria-label=${this.t("back",{label:t.label})}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:c}
752
789
  <div class="titles">
753
- ${e.length?n`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
754
- ${e.map(s=>n`<li>${s.href?n`<a href=${s.href}>${s.label}</a>`:s.label}</li>`)}
790
+ ${e.length?o`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
791
+ ${e.map(i=>o`<li>${i.href?o`<a href=${i.href}>${i.label}</a>`:i.label}</li>`)}
755
792
  <li><span aria-current="page">${this.heading}</span></li>
756
793
  </ol></nav>`:c}
757
794
  <h1 part="title"><span class="text">${this.heading}</span><slot name="title-adornment"></slot></h1>
758
795
  </div>
759
796
  </div>
760
797
  <div class="actions">
761
- ${this.pagination?n`<div class="arrows" role="group" aria-label=${this.t("records")}>
762
- <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>o(this,yr,Ro).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
763
- <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>o(this,yr,Ro).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
798
+ ${this.pagination?o`<div class="arrows" role="group" aria-label=${this.t("records")}>
799
+ <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>n(this,Ya,Ml).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
800
+ <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>n(this,Ya,Ml).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
764
801
  </div>`:c}
765
802
  <slot name="actions"></slot>
766
803
  </div>
767
- </header>`}};yr=new WeakSet,Ro=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},bi.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},bi.styles=[g,m`
804
+ </header>`}};Ya=new WeakSet,Ml=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},Hi.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},Hi.styles=[v,u`
768
805
  :host { display: block; }
769
806
  header {
770
807
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-20);
@@ -781,10 +818,11 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
781
818
  nav a:focus-visible, .back:focus-visible, .arrow:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
782
819
  nav [aria-current] { color: var(--cm-text-default); }
783
820
  h1 {
784
- display: flex; align-items: center; gap: var(--cm-space-10); margin: 0; min-width: 0;
821
+ display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--cm-space-10); margin: 0; min-width: 0;
785
822
  font-size: 26px; font-weight: 500; line-height: 1.2;
786
823
  }
787
- .text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
824
+ /* The title keeps at least about 12 characters; badges in title-adornment wrap below it instead of pushing the page wider. */
825
+ .text { flex: 0 1 auto; min-width: min(12ch, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
788
826
  .actions { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); margin-inline-start: auto; }
789
827
  .arrows { display: flex; gap: var(--cm-space-10); }
790
828
  .arrow, .back {
@@ -805,17 +843,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
805
843
  h1 { font-size: 18px; font-weight: 600; }
806
844
  .actions { gap: var(--cm-space-10); }
807
845
  }
808
- `];b("cm-page-header",bi);var Km=w("actionBar",{label:"Actions"}),fi=class extends y{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return n`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
846
+ `];f("cm-page-header",Hi);var ib=k("actionBar",{label:"Actions"}),Ri=class extends w{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return o`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
809
847
  <div class="lead">
810
- ${e?n`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:c}
848
+ ${e?o`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:c}
811
849
  <div class="text">
812
850
  <div class="eyebrow" ?hidden=${!this.eyebrow}>${this.eyebrow}<slot name="adornment"></slot></div>
813
- ${this.heading?n`<p class="heading" part="heading" role=${e?"alert":c}>${this.heading}</p>`:c}
851
+ ${this.heading?o`<p class="heading" part="heading" role=${e?"alert":c}>${this.heading}</p>`:c}
814
852
  <slot></slot>
815
853
  </div>
816
854
  </div>
817
855
  <div class="actions"><slot name="actions"></slot></div>
818
- </div>`}};fi.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},fi.styles=[g,m`
856
+ </div>`}};Ri.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},Ri.styles=[v,u`
819
857
  :host { display: block; }
820
858
  :host([sticky]) { position: sticky; bottom: 0; z-index: 10; }
821
859
  .bar {
@@ -846,13 +884,13 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
846
884
  .icon { width: 30px; height: 30px; }
847
885
  .actions { gap: var(--cm-space-10); }
848
886
  }
849
- `];b("cm-action-bar",fi);var Zm=w("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Me,Mt,$r,X,Io,Ho,Oo,mc,uc,gi=class extends y{constructor(){super(...arguments);h(this,X);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";h(this,Me,null);h(this,Mt,()=>{this.open=!0});h(this,$r,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>o(this,X,Io).call(this))}disconnectedCallback(){super.disconnectedCallback(),o(this,X,Ho).call(this)}updated(e){e.has("form")&&this.isConnected&&o(this,X,Io).call(this)}render(){return n`<div class="bar" part="bar" role="region" aria-label=${this.message}>
887
+ `];f("cm-action-bar",Ri);var lb=k("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Ce,Pt,Ga,te,_l,zl,Tl,bd,fd,Oi=class extends w{constructor(){super(...arguments);h(this,te);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";h(this,Ce,null);h(this,Pt,()=>{this.open=!0});h(this,Ga,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>n(this,te,_l).call(this))}disconnectedCallback(){super.disconnectedCallback(),n(this,te,zl).call(this)}updated(e){e.has("form")&&this.isConnected&&n(this,te,_l).call(this)}render(){return o`<div class="bar" part="bar" role="region" aria-label=${this.message}>
850
888
  <p class="message" part="message" role="status">${this.open?this.message:""}</p>
851
889
  <div class="actions">
852
- <cm-button size="large" ?disabled=${this.loading} @click=${o(this,X,uc)}>${this.discardLabel}</cm-button>
853
- <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${o(this,X,mc)}>${this.saveLabel}</cm-button>
890
+ <cm-button size="large" ?disabled=${this.loading} @click=${n(this,te,fd)}>${this.discardLabel}</cm-button>
891
+ <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${n(this,te,bd)}>${this.saveLabel}</cm-button>
854
892
  </div>
855
- </div>`}};Me=new WeakMap,Mt=new WeakMap,$r=new WeakMap,X=new WeakSet,Io=function(){o(this,X,Ho).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(f(this,Me,e),e.addEventListener("input",r(this,Mt)),e.addEventListener("change",r(this,Mt)),e.addEventListener("reset",r(this,$r)))},Ho=function(){let e=r(this,Me);e&&(e.removeEventListener("input",r(this,Mt)),e.removeEventListener("change",r(this,Mt)),e.removeEventListener("reset",r(this,$r)),f(this,Me,null))},Oo=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},mc=function(){this.loading||this.saveDisabled||o(this,X,Oo).call(this,"cm-save")&&r(this,Me)&&r(this,Me).requestSubmit()},uc=function(){this.loading||o(this,X,Oo).call(this,"cm-discard")&&r(this,Me)&&(r(this,Me).reset(),this.open=!1)},gi.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},gi.styles=[g,m`
893
+ </div>`}};Ce=new WeakMap,Pt=new WeakMap,Ga=new WeakMap,te=new WeakSet,_l=function(){n(this,te,zl).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(b(this,Ce,e),e.addEventListener("input",s(this,Pt)),e.addEventListener("change",s(this,Pt)),e.addEventListener("reset",s(this,Ga)))},zl=function(){let e=s(this,Ce);e&&(e.removeEventListener("input",s(this,Pt)),e.removeEventListener("change",s(this,Pt)),e.removeEventListener("reset",s(this,Ga)),b(this,Ce,null))},Tl=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},bd=function(){this.loading||this.saveDisabled||n(this,te,Tl).call(this,"cm-save")&&s(this,Ce)&&s(this,Ce).requestSubmit()},fd=function(){this.loading||n(this,te,Tl).call(this,"cm-discard")&&s(this,Ce)&&(s(this,Ce).reset(),this.open=!1)},Oi.properties={open:{type:Boolean,reflect:!0},message:{string:"message"},saveLabel:{attribute:"save-label",string:"save"},discardLabel:{attribute:"discard-label",string:"discard"},loading:{type:Boolean,reflect:!0},saveDisabled:{type:Boolean,attribute:"save-disabled"},form:{}},Oi.styles=[v,u`
856
894
  :host { display: block; position: sticky; bottom: 0; z-index: 20; }
857
895
  :host(:not([open])) { display: none; }
858
896
  .bar {
@@ -868,14 +906,14 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
868
906
  .message { font-size: 14px; font-weight: 500; }
869
907
  .actions { gap: var(--cm-space-10); }
870
908
  }
871
- `];b("cm-save-bar",gi);var vi=class extends k{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return n`<section part="panel" aria-label=${this.heading||c}>
872
- ${this.heading||this.action?n`<header>
909
+ `];f("cm-save-bar",Oi);var qi=class extends E{constructor(){super(...arguments);this.heading="";this.action="";this.actionLabel="";this.headingLevel=2;this._list=!0}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<section part="panel" aria-label=${this.heading||c}>
910
+ ${this.heading||this.action?o`<header>
873
911
  <div class="title" role="heading" aria-level=${e} part="title">${this.heading}</div>
874
- ${this.action?n`<button class="action" type="button" part="action" aria-label=${this.actionLabel||c}
912
+ ${this.action?o`<button class="action" type="button" part="action" aria-label=${this.actionLabel||c}
875
913
  @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:c}
876
914
  </header>`:c}
877
- <div class="items" role=${this._list?"list":c}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(s=>s.localName==="cm-info-item")}}></slot></div>
878
- </section>`}};vi.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},vi.styles=[g,m`
915
+ <div class="items" role=${this._list?"list":c}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
916
+ </section>`}};qi.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},qi.styles=[v,u`
879
917
  :host { display: block; }
880
918
  section {
881
919
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
@@ -891,7 +929,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
891
929
  .action:hover { text-decoration: underline; }
892
930
  .action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
893
931
  .items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-15) var(--cm-space-20); }
894
- `];b("cm-info-panel",vi);var xi=class extends k{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return n`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};xi.properties={label:{},half:{type:Boolean,reflect:!0}},xi.styles=[g,m`
932
+ `];f("cm-info-panel",qi);var Pi=class extends E{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return o`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};Pi.properties={label:{},half:{type:Boolean,reflect:!0}},Pi.styles=[v,u`
895
933
  :host { display: block; grid-column: 1 / -1; min-width: 0; }
896
934
  :host([half]) { grid-column: auto; }
897
935
  .label { font-size: 16px; }
@@ -899,16 +937,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
899
937
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10);
900
938
  margin-top: 6px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere;
901
939
  }
902
- `];b("cm-info-item",xi);var _t,yi=class extends k{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;h(this,_t,S("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return n`<div class="wrap" part="accordion">
940
+ `];f("cm-info-item",Pi);var Bt,Bi=class extends E{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;h(this,Bt,S("cm-accordion"))}toggle(){this.disabled||(this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{bubbles:!0,composed:!0,detail:{open:this.open}})))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||3));return o`<div class="wrap" part="accordion">
903
941
  <div class="h" role="heading" aria-level=${e}>
904
- <button type="button" part="toggle" id="${r(this,_t)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${r(this,_t)}-body"
942
+ <button type="button" part="toggle" id="${s(this,Bt)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Bt)}-body"
905
943
  ?disabled=${this.disabled} @click=${this.toggle}>
906
944
  <span>${this.heading}</span>
907
945
  <span class="chev" aria-hidden="true"><cm-icon name="chevron-down" size="16"></cm-icon></span>
908
946
  </button>
909
947
  </div>
910
- <div class="body" part="body" id="${r(this,_t)}-body" role="region" aria-labelledby="${r(this,_t)}-btn" ?hidden=${!this.open}><slot></slot></div>
911
- </div>`}};_t=new WeakMap,yi.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},yi.styles=[g,m`
948
+ <div class="body" part="body" id="${s(this,Bt)}-body" role="region" aria-labelledby="${s(this,Bt)}-btn" ?hidden=${!this.open}><slot></slot></div>
949
+ </div>`}};Bt=new WeakMap,Bi.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Bi.styles=[v,u`
912
950
  :host { display: block; }
913
951
  .wrap { border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
914
952
  .h { margin: 0; font: inherit; }
@@ -930,14 +968,24 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
930
968
  .body { padding: var(--cm-space-15) var(--cm-space-20); border-top: var(--cm-border-1) solid var(--cm-border-default); font-size: 14px; }
931
969
  .body[hidden] { display: none; }
932
970
  @media (max-width: 640px) { button { min-height: 50px; font-size: 14px; } .chev { width: 28px; height: 28px; } }
933
- `];b("cm-accordion",yi);var wi,hn,$i=class extends k{constructor(){super(...arguments);h(this,wi);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="large";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.image?n`<img src=${this.image} alt="" part="image">`:this.icon?n`<cm-icon name=${this.icon} size="96"></cm-icon>`:c;return n`<div class="wrap" part="empty-state">
971
+ `];f("cm-accordion",Bi);var ce,Ft,Sl,gd,Fi=class extends E{constructor(){super(...arguments);h(this,ce);this.heading="";this.image="";this.icon="box";this.headingLevel=2;this.size="large";this.action="";this.actionHref="";this.hasText=!1;this.hasActions=!1;this.hasImage=!1}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));if(this.size==="inline")return n(this,ce,gd).call(this,e);let t=this.image?o`<img src=${this.image} alt="" part="image">`:this.icon?o`<cm-icon name=${this.icon} size="96"></cm-icon>`:c;return o`<div class="wrap" part="empty-state">
934
972
  <div class="circle" part="circle" aria-hidden=${this.hasImage?c:"true"}>
935
- <slot name="image" @slotchange=${s=>o(this,wi,hn).call(this,s,"hasImage")}>${t}</slot>
973
+ <slot name="image" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasImage")}>${t}</slot>
936
974
  </div>
937
975
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
938
- <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${s=>o(this,wi,hn).call(this,s,"hasText")}></slot></div>
939
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${s=>o(this,wi,hn).call(this,s,"hasActions")}></slot></div>
940
- </div>`}};wi=new WeakSet,hn=function(e,t){let s=e.target;this[t]=s.assignedNodes({flatten:!0}).some(l=>l.nodeType===1||l.textContent.trim()),this.requestUpdate()},$i.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0}},$i.styles=[g,m`
976
+ <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasText")}></slot></div>
977
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasActions")}></slot></div>${this.action?o`<div class="actions">${n(this,ce,Sl).call(this)}</div>`:c}
978
+ </div>`}};ce=new WeakSet,Ft=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(l=>l.nodeType===1||l.textContent.trim()),this.requestUpdate()},Sl=function(){return this.action?this.actionHref?o`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:o`<button class="text-action" type="button" part="action"
979
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:c},gd=function(e){let t=this.image?o`<img src=${this.image} alt="" part="image">`:this.icon?o`<cm-icon name=${this.icon} size="20"></cm-icon>`:c;return o`<div class="wrap inline" part="empty-state">
980
+ <span class="icon" part="circle" aria-hidden=${this.hasImage?c:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
981
+ <slot name="image" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasImage")}>${t}</slot>
982
+ </span>
983
+ <div class="line">
984
+ <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
985
+ <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasText")}></slot></span>${n(this,ce,Sl).call(this)}
986
+ <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasActions")}></slot></span>
987
+ </div>
988
+ </div>`},Fi.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},Fi.styles=[v,u`
941
989
  :host { display: block; }
942
990
  .wrap {
943
991
  display: flex; flex-direction: column; align-items: center; text-align: center;
@@ -956,12 +1004,30 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
956
1004
  :host([size='small']) .circle { width: 200px; height: 200px; }
957
1005
  :host([size='small']) .title { margin-top: 30px; font-size: 14px; }
958
1006
  :host([size='small']) .actions { gap: var(--cm-space-10); }
1007
+ /* Inline (1.2): a line of text with an optional 20px icon, no circle, no extra height. */
1008
+ .inline { flex-direction: row; align-items: flex-start; gap: var(--cm-space-10); padding: 0; text-align: start; font-size: 14px; line-height: 20px; }
1009
+ .inline .icon { display: inline-flex; flex: none; width: 20px; height: 20px; overflow: hidden; color: var(--cm-icon-default); }
1010
+ .inline .icon img, .inline ::slotted([slot='image']) { width: 20px; height: 20px; max-width: none; max-height: none; object-fit: contain; }
1011
+ .inline .line { min-width: 0; text-align: start; }
1012
+ .inline .title { display: inline; margin: 0; font-size: inherit; font-weight: 500; color: var(--cm-text-default); }
1013
+ .inline .text { display: inline; margin: 0; font-size: inherit; color: var(--cm-text-tertiary); }
1014
+ .inline .actions { display: inline-flex; vertical-align: middle; margin: 0; margin-inline-start: var(--cm-space-10); }
1015
+ .inline .text[hidden], .inline .actions[hidden], .inline .icon[hidden] { display: none; }
1016
+ .text-action {
1017
+ display: inline-flex; align-items: center; min-height: 24px; vertical-align: middle;
1018
+ margin: -2px 0; padding: 0 2px; border: 0; background: none; cursor: pointer;
1019
+ font: inherit; font-weight: 500; color: var(--cm-text-default);
1020
+ text-decoration: underline; text-underline-offset: 3px; border-radius: var(--cm-radius-xs);
1021
+ }
1022
+ .text-action:hover { text-decoration-thickness: 2px; }
1023
+ .text-action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1024
+ .inline .text-action { display: inline; min-height: 0; vertical-align: baseline; margin: 0; margin-inline-start: var(--cm-space-10); padding-block: 2px; }
959
1025
  @media (max-width: 640px) {
960
1026
  .circle { width: 200px; height: 200px; }
961
1027
  .title { margin-top: 30px; font-size: 14px; }
962
1028
  .actions { gap: var(--cm-space-10); }
963
1029
  }
964
- `];b("cm-empty-state",$i);var bc={small:34,medium:40,large:50,xlarge:186},ki=class extends k{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=bc[this.size]??bc.large;return n`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return n`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return n`${Array.from({length:e},(t,s)=>n`<span class="bone line ${e>1&&s===e-1?"short":""}" part="bone"></span>`)}`}};ki.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},ki.styles=[g,m`
1030
+ `];f("cm-empty-state",Fi);var vd={small:34,medium:40,large:50,xlarge:186},ji=class extends E{constructor(){super(...arguments);this.variant="text";this.lines=1;this.size="large"}connectedCallback(){super.connectedCallback(),this.setAttribute("aria-hidden","true")}render(){if(this.variant==="thumbnail"){let t=vd[this.size]??vd.large;return o`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return o`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return o`${Array.from({length:e},(t,i)=>o`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};ji.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},ji.styles=[v,u`
965
1031
  :host { display: block; --cm-skeleton-height: 120px; }
966
1032
  :host([variant='thumbnail']) { display: inline-block; vertical-align: middle; }
967
1033
  .bone {
@@ -976,17 +1042,17 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
976
1042
  .bone { animation: none; background: var(--cm-thumb-bg); }
977
1043
  }
978
1044
  @media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
979
- `];b("cm-skeleton",ki);var Bd=[472,90,90,251],jd=[94,266,134,191,138],Ei=class extends y{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(s=>n`<span class="bone" style="height:${s}px"></span>`);return n`<div class="wrap" part="skeleton-display" aria-busy="true">
1045
+ `];f("cm-skeleton",ji);var Xh=[472,90,90,251],Jh=[94,266,134,191,138],Vi=class extends w{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>o`<span class="bone" style="height:${i}px"></span>`);return o`<div class="wrap" part="skeleton-display" aria-busy="true">
980
1046
  <span class="sr" role="status">${this.label}</span>
981
1047
  <div class="page" aria-hidden="true">
982
- ${this.navigation?n`<span class="bone nav"></span>`:c}
1048
+ ${this.navigation?o`<span class="bone nav"></span>`:c}
983
1049
  <span class="bone head"></span>
984
1050
  <div class="body">
985
- <div class="col main">${e(this.layout==="one-column"?[472,251]:Bd)}</div>
986
- <div class="col side">${e(jd)}</div>
1051
+ <div class="col main">${e(this.layout==="one-column"?[472,251]:Xh)}</div>
1052
+ <div class="col side">${e(Jh)}</div>
987
1053
  </div>
988
1054
  </div>
989
- </div>`}};Ei.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Ei.styles=[g,m`
1055
+ </div>`}};Vi.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Vi.styles=[v,u`
990
1056
  :host { display: block; }
991
1057
  .page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-10); }
992
1058
  :host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
@@ -1010,11 +1076,11 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1010
1076
  .body { grid-template-columns: minmax(0, 1fr); }
1011
1077
  .head { height: 60px; }
1012
1078
  }
1013
- `];b("cm-skeleton-display",Ei);var Eu=w("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),pn,fc,Mi=class extends y{constructor(){super(...arguments);h(this,pn);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=o(this,pn,fc).call(this);return n`<article part="comment">
1014
- ${e?n`<time class="meta" part="time" datetime=${this.datetime||c}>${e}</time>`:c}
1079
+ `];f("cm-skeleton-display",Vi);var Nb=k("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Gn,xd,Ui=class extends w{constructor(){super(...arguments);h(this,Gn);this.author="";this.datetime="";this.time=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-comment-box"&&this.setAttribute("role","listitem")}render(){let e=n(this,Gn,xd).call(this);return o`<article part="comment">
1080
+ ${e?o`<time class="meta" part="time" datetime=${this.datetime||c}>${e}</time>`:c}
1015
1081
  <div class="body" part="body"><slot></slot></div>
1016
- ${this.author?n`<div class="meta" part="author">– ${this.author}</div>`:c}
1017
- </article>`}};pn=new WeakSet,fc=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:we(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},Mi.properties={author:{},datetime:{},time:{}},Mi.styles=[g,m`
1082
+ ${this.author?o`<div class="meta" part="author">– ${this.author}</div>`:c}
1083
+ </article>`}};Gn=new WeakSet,xd=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:V(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},Ui.properties={author:{},datetime:{},time:{}},Ui.styles=[v,u`
1018
1084
  :host { display: block; }
1019
1085
  article {
1020
1086
  display: flex; flex-direction: column; gap: 6px; padding: var(--cm-space-10);
@@ -1022,16 +1088,16 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1022
1088
  }
1023
1089
  .meta { font-size: 12px; color: var(--cm-text-tertiary); }
1024
1090
  .body { font-size: 14px; line-height: 16px; overflow-wrap: anywhere; }
1025
- `];b("cm-comment",Mi);var wr,mn,gc,_i=class extends y{constructor(){super(...arguments);h(this,mn);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;h(this,wr,S("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let s=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(s)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return n`<section part="comment-box" aria-labelledby="${r(this,wr)}-h">
1026
- <div class="title" id="${r(this,wr)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1091
+ `];f("cm-comment",Ui);var Xa,Xn,yd,Ki=class extends w{constructor(){super(...arguments);h(this,Xn);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;h(this,Xa,S("cm-comment-box"));this.hasComments=!1}submit(){let e=this.renderRoot.querySelector("textarea"),t=(e?.value??this.value).trim();if(this.disabled)return;if(!t){e?.focus();return}let i=new CustomEvent("cm-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{value:t}});this.dispatchEvent(i)&&(this.value="",e&&(e.value=""))}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<section part="comment-box" aria-labelledby="${s(this,Xa)}-h">
1092
+ <div class="title" id="${s(this,Xa)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1027
1093
  <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||c} .value=${this.value}
1028
1094
  ?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
1029
- @keydown=${o(this,mn,gc)}></textarea>
1095
+ @keydown=${n(this,Xn,yd)}></textarea>
1030
1096
  <div class="actions"><cm-button variant="primary" size="large" ?disabled=${this.disabled} @click=${()=>this.submit()}>${this.action}</cm-button></div>
1031
1097
  <div class="list" role="list" ?hidden=${!this.hasComments}>
1032
1098
  <slot @slotchange=${t=>{this.hasComments=t.target.assignedElements().length>0,this.requestUpdate()}}></slot>
1033
1099
  </div>
1034
- </section>`}};wr=new WeakMap,mn=new WeakSet,gc=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},_i.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},_i.styles=[g,m`
1100
+ </section>`}};Xa=new WeakMap,Xn=new WeakSet,yd=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},Ki.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Ki.styles=[v,u`
1035
1101
  :host { display: block; }
1036
1102
  section { display: flex; flex-direction: column; gap: var(--cm-space-20); }
1037
1103
  .title { margin: 0; font-size: 20px; font-weight: 600; }
@@ -1052,14 +1118,111 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1052
1118
  textarea { min-height: 100px; }
1053
1119
  .actions { justify-content: flex-end; }
1054
1120
  }
1055
- `];b("cm-comment-box",_i);var Cu=w("smartTip",{newTab:"(opens in a new tab)"}),Au=w("smartTips",{heading:"Smart tips",tourAction:"Start"}),zi=class extends y{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return n`<a part="tip" href=${this.href||c} target=${this.target||c} rel=${e?"noopener noreferrer":c}>
1121
+ `];f("cm-comment-box",Ki);var Jn='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',K,Yi,gt,vt,Ae,Gi,Xi,ue,Ll,Zn,Qn,eo,to,Ji,wd,jt,Cl,Al,Ke,Wi=class extends E{constructor(){super(...arguments);h(this,ue);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";h(this,K);h(this,Yi);h(this,gt,[]);h(this,vt);h(this,Ae);h(this,Gi,!1);h(this,Xi,!1);h(this,Zn,()=>{b(this,Gi,!0),clearTimeout(s(this,Ae)),this.open||b(this,Ae,setTimeout(()=>this.show(),this.delay))});h(this,Qn,()=>{b(this,Gi,!1),clearTimeout(s(this,Ae)),s(this,Xi)||b(this,Ae,setTimeout(()=>this.hide(),100))});h(this,eo,()=>{b(this,Xi,!0),this.show()});h(this,to,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(b(this,Xi,!1),s(this,Gi)||this.hide())});h(this,Ji,e=>{e.key==="Escape"&&this.open&&this.hide()});h(this,jt,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(n(this,ue,Al).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(Jn)&&i.then(()=>{t.shadowRoot?.querySelector(Jn)&&s(this,jt).call(this)}),s(this,K)||(b(this,K,document.createElement("span")),s(this,K).id=S("cm-tooltip"),s(this,K).hidden=!0,s(this,K).slot="description"),s(this,K).textContent=this.content,s(this,K).isConnected||this.append(s(this,K));let l=n(this,ue,wd).call(this,t);if(b(this,Yi,l),l.getRootNode()===s(this,K).getRootNode()){let d=(l.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);d.includes(s(this,K).id)||l.setAttribute("aria-describedby",[...d,s(this,K).id].join(" "))}else"ariaDescribedByElements"in l?(n(this,ue,Cl).call(this,l),b(this,vt,new MutationObserver(()=>{l.getAttribute("aria-describedby")!==""&&n(this,ue,Cl).call(this,l)})),s(this,vt).observe(l,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",s(this,K).id)});h(this,Ke,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let l=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),d=e.getBoundingClientRect(),p=8,m=8,x=innerWidth,$=innerHeight,y=getComputedStyle(this).direction==="rtl",T=si=>si==="start"?y?"right":"left":si==="end"?y?"left":"right":si,M={top:l.top-p-d.height>=m,bottom:l.bottom+p+d.height<=$-m,left:l.left-p-d.width>=m,right:l.right+p+d.width<=x-m},_={top:"bottom",bottom:"top",left:"right",right:"left"},R=T(this.placement);!M[R]&&M[_[R]]&&(R=_[R]);let O,q;R==="top"||R==="bottom"?(O=l.left+l.width/2-d.width/2,q=R==="top"?l.top-p-d.height:l.bottom+p):(q=l.top+l.height/2-d.height/2,O=R==="left"?l.left-p-d.width:l.right+p),O=Math.min(Math.max(m,O),x-m-d.width),q=Math.min(Math.max(m,q),$-m-d.height),e.style.transform=`translate(${Math.round(O)}px, ${Math.round(q)}px)`;let ii={top:"top",bottom:"bottom",left:y?"end":"start",right:y?"start":"end"};this._side=ii[R]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",s(this,Zn)),this.addEventListener("pointerleave",s(this,Qn)),this.addEventListener("focusin",s(this,eo)),this.addEventListener("focusout",s(this,to)),this.addEventListener("keydown",s(this,Ji)),this.hasUpdated&&s(this,jt).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),n(this,ue,Al).call(this),n(this,ue,Ll).call(this),clearTimeout(s(this,Ae))}show(){clearTimeout(s(this,Ae)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",s(this,Ji),!0),addEventListener("scroll",s(this,Ke),!0),addEventListener("resize",s(this,Ke)),this.updateComplete.then(s(this,Ke)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(s(this,Ae)),this.open&&(this.open=!1,n(this,ue,Ll).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(s(this,jt).call(this),this.content?this.open&&s(this,Ke).call(this):this.hide())}render(){return o`<slot @slotchange=${s(this,jt)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1122
+ data-side=${this._side}>${this.content}</div>`}};K=new WeakMap,Yi=new WeakMap,gt=new WeakMap,vt=new WeakMap,Ae=new WeakMap,Gi=new WeakMap,Xi=new WeakMap,ue=new WeakSet,Ll=function(){document.removeEventListener("keydown",s(this,Ji),!0),removeEventListener("scroll",s(this,Ke),!0),removeEventListener("resize",s(this,Ke))},Zn=new WeakMap,Qn=new WeakMap,eo=new WeakMap,to=new WeakMap,Ji=new WeakMap,wd=function(e){return e.matches(Jn)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Jn)??e},jt=new WeakMap,Cl=function(e){b(this,gt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=s(this,gt).map(l=>t.getElementById(l)).filter(l=>!!l);e.ariaDescribedByElements=[...i,s(this,K)]},Al=function(){let e=s(this,Yi);if(!(!e||!s(this,K))){if(s(this,vt))s(this,vt).disconnect(),b(this,vt,void 0),s(this,gt).length?e.setAttribute("aria-describedby",s(this,gt).join(" ")):e.removeAttribute("aria-describedby"),b(this,gt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==s(this,K).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}b(this,Yi,void 0)}},Ke=new WeakMap,Wi.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Wi.styles=[v,u`
1123
+ :host { display: inline-block; position: relative; }
1124
+ .tip {
1125
+ position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
1126
+ max-width: min(280px, calc(100vw - 16px)); width: max-content;
1127
+ padding: 6px var(--cm-space-10); border-radius: var(--cm-radius-sm);
1128
+ background: var(--cm-bg-panel-header); color: var(--cm-text-on-dark);
1129
+ font-size: 12px; line-height: 16px; font-weight: 400; white-space: normal; overflow-wrap: anywhere;
1130
+ box-shadow: var(--cm-shadow-100); pointer-events: auto;
1131
+ opacity: 0; visibility: hidden; transition: opacity 120ms ease;
1132
+ }
1133
+ :host([open]) .tip { opacity: 1; visibility: visible; }
1134
+ @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
1135
+ @media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
1136
+ `];f("cm-tooltip",Wi);var Vb=k("timelineItem",{justNow:"Just now",minutesAgo:{one:"{count} minute ago",other:"{count} minutes ago"},hoursAgo:{one:"{count} hour ago",other:"{count} hours ago"},daysAgo:{one:"{count} day ago",other:"{count} days ago"},inMinutes:{one:"In {count} minute",other:"In {count} minutes"},inHours:{one:"In {count} hour",other:"In {count} hours"},inDays:{one:"In {count} day",other:"In {count} days"},showAll:"Show all",showLess:"Show less"}),Ub=k("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),Zh=7,Ja=new Set,Za;function $d(r,a){a?Ja.add(r):Ja.delete(r),Ja.size&&!Za&&(Za=setInterval(()=>Ja.forEach(e=>e.requestUpdate()),6e4)),!Ja.size&&Za&&(clearInterval(Za),Za=void 0)}var Qa,Ut,_e,Dl,io,kd,Zi=class extends w{constructor(){super(...arguments);h(this,_e);this.icon="";this.tone="neutral";this.heading="";this.datetime="";this.time="";this.meta="";this.lines=3;this.expanded=!1;this._overflow=!1;this._body=!1;this._meta=!1;this._actions=!1;h(this,Qa,S("cm-tl"));h(this,Ut)}connectedCallback(){super.connectedCallback(),$d(this,!0)}disconnectedCallback(){super.disconnectedCallback(),$d(this,!1),s(this,Ut)?.disconnect(),b(this,Ut,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(b(this,Ut,new ResizeObserver(()=>n(this,_e,Dl).call(this))),s(this,Ut).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&n(this,_e,Dl).call(this)}get date(){if(!this.datetime)return;let e=new Date(this.datetime);return Number.isNaN(e.getTime())?void 0:e}get relativeTime(){if(this.time)return this.time;let e=this.date;if(!e)return this.datetime;let t=Date.now()-e.getTime(),i=t<0,l=Math.floor(Math.abs(t)/6e4);if(l<1)return this.t("justNow");if(l<60)return this.t(i?"inMinutes":"minutesAgo",{count:l});let d=Math.floor(l/60);if(d<24)return this.t(i?"inHours":"hoursAgo",{count:d});let p=Math.floor(d/24);return p<Zh?this.t(i?"inDays":"daysAgo",{count:p}):V(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?V(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",l=this.lines>0&&!this.expanded,d=e?t?o`<cm-tooltip class="when" content=${t} visual-only placement="top"><time part="time" tabindex="0" datetime=${this.datetime}>${e}<span class="sr">, ${t}</span></time></cm-tooltip>`:o`<time class="when" part="time" datetime=${this.datetime||c}>${e}</time>`:c;return o`<div class="item">
1137
+ <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?o`<cm-icon name=${this.icon} size="16"></cm-icon>`:o`<span class="dot"></span>`}</span>
1138
+ <div class="main">
1139
+ <div class="head">
1140
+ <span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
1141
+ <slot name="badge"></slot>
1142
+ ${d}
1143
+ </div>
1144
+ <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${p=>n(this,_e,io).call(this,p,"_meta")}>${this.meta}</slot></div>
1145
+ <div class="body ${l?"clamp":""}" id="${s(this,Qa)}-body" part="body" ?hidden=${!this._body}
1146
+ style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${p=>n(this,_e,io).call(this,p,"_body")}></slot></div>
1147
+ ${this._body&&this._overflow?o`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
1148
+ aria-controls="${s(this,Qa)}-body" @click=${n(this,_e,kd)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:c}
1149
+ <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${p=>n(this,_e,io).call(this,p,"_actions")}></slot></div>
1150
+ </div>
1151
+ </div>`}};Qa=new WeakMap,Ut=new WeakMap,_e=new WeakSet,Dl=function(){let e=this.renderRoot.querySelector(".body");if(!e||!this._body||!(this.lines>0)){this._overflow=!1;return}let t=parseFloat(getComputedStyle(e).lineHeight)||20;this._overflow=e.scrollHeight>this.lines*t+1},io=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(l=>l.nodeType===Node.ELEMENT_NODE||(l.textContent??"").trim())},kd=function(){this.expanded=!this.expanded},Zi.properties={icon:{reflect:!0},tone:{reflect:!0},heading:{},datetime:{reflect:!0},time:{},meta:{},lines:{type:Number},expanded:{type:Boolean,reflect:!0},_overflow:{state:!0},_body:{state:!0},_meta:{state:!0},_actions:{state:!0}},Zi.styles=[v,u`
1152
+ :host { display: block; min-width: 0; font-size: 14px; line-height: 20px; }
1153
+ .item { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
1154
+ .icon {
1155
+ position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--cm-radius-full);
1156
+ background: var(--cm-bg-inset); color: var(--cm-icon-default); border: var(--cm-border-1) solid var(--cm-border-default);
1157
+ }
1158
+ .icon.information { background: var(--cm-bg-information-soft); color: var(--cm-text-information); border-color: transparent; }
1159
+ .icon.attention { background: var(--cm-bg-attention); color: var(--cm-text-attention); border-color: transparent; }
1160
+ .icon.success { background: var(--cm-bg-success-soft); color: var(--cm-text-success); border-color: transparent; }
1161
+ .icon.critical { background: var(--cm-bg-critical); color: var(--cm-text-critical); border-color: transparent; }
1162
+ .dot { width: 10px; height: 10px; border-radius: var(--cm-radius-full); background: currentColor; }
1163
+ .main { flex: 1; min-width: 0; padding-block-start: 6px; }
1164
+ .head { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--cm-space-10); row-gap: 4px; }
1165
+ .title { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
1166
+ .when { margin-inline-start: auto; }
1167
+ time {
1168
+ position: relative; display: inline-block; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); white-space: nowrap;
1169
+ border-radius: var(--cm-radius-xs);
1170
+ }
1171
+ time:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1172
+ .meta { margin-block-start: 2px; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); overflow-wrap: anywhere; }
1173
+ .body { margin-block-start: var(--cm-space-10); overflow-wrap: anywhere; }
1174
+ .body.clamp {
1175
+ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--_lines); overflow: hidden;
1176
+ max-height: calc(var(--_lines) * 20px);
1177
+ }
1178
+ .toggle {
1179
+ margin-block-start: 4px; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--cm-text-default);
1180
+ text-decoration: underline; background: none; border: 0; cursor: pointer; min-height: 24px;
1181
+ }
1182
+ .toggle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
1183
+ .actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); margin-block-start: var(--cm-space-10); }
1184
+ [hidden] { display: none !important; }
1185
+ .sr { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1186
+ ::slotted([slot='badge']) { flex: none; }
1187
+ `];f("cm-timeline-item",Zi);var er,Qi,Kt,Nl,Ed,Vt=class extends w{constructor(){super(...arguments);h(this,Kt);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];h(this,er,new MutationObserver(()=>n(this,Kt,Nl).call(this)));h(this,Qi,!1)}connectedCallback(){super.connectedCallback(),n(this,Kt,Nl).call(this),s(this,er).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,er).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){b(this,Qi,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,l)=>{this._items[l]&&i.assign(this._items[l])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),s(this,Qi)&&!this.renderRoot.querySelector(".more cm-button")&&(b(this,Qi,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?o`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>o`<div class="sk">
1188
+ <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:c;return o`
1189
+ ${e.length?o`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
1190
+ ${e.map(()=>o`<li><slot></slot></li>`)}
1191
+ </ol>`:c}
1192
+ ${i}
1193
+ ${!e.length&&!t?o`<slot class="empty"></slot>`:c}
1194
+ ${this.hasMore&&e.length?o`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${n(this,Kt,Ed)}>${this.moreLabel}</cm-button></div>`:c}
1195
+ <span class="sr" role="status">${t?this.t("loading"):""}</span>
1196
+ `}};er=new WeakMap,Qi=new WeakMap,Kt=new WeakSet,Nl=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},Ed=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},Vt.shadowRootOptions={...E.shadowRootOptions,slotAssignment:"manual"},Vt.properties={label:{string:"label"},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},moreLabel:{attribute:"more-label",string:"showMore"},_items:{state:!0},_empty:{state:!0}},Vt.styles=[v,u`
1197
+ :host { display: block; }
1198
+ ol { margin: 0; padding: 0; list-style: none; }
1199
+ ol:focus { outline: none; }
1200
+ li { position: relative; padding-block-end: var(--cm-space-20); }
1201
+ /* The line joining the icons (16px is half the 32px icon). Decorative: a pseudo-element, nothing to read. */
1202
+ li::before {
1203
+ content: ''; position: absolute; inset-inline-start: 15px; inset-block: 32px 0; width: 2px; background: var(--cm-border-default);
1204
+ }
1205
+ li:last-child::before { display: none; }
1206
+ :host([has-more]) li:last-child::before { display: block; }
1207
+ li:last-child { padding-block-end: 0; }
1208
+ :host([has-more]) li:last-child { padding-block-end: var(--cm-space-20); }
1209
+ .more { display: flex; padding-inline-start: 47px; }
1210
+ .loading { display: grid; gap: var(--cm-space-20); }
1211
+ .sk { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
1212
+ .sk .ic { flex: none; width: 32px; --cm-skeleton-height: 32px; }
1213
+ .sk .tx { flex: 1; }
1214
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1215
+ @media (max-width: 640px) {
1216
+ .more { padding-inline-start: 0; }
1217
+ }
1218
+ `];f("cm-timeline",Vt);var Zb=k("smartTip",{newTab:"(opens in a new tab)"}),Qb=k("smartTips",{heading:"Smart tips",tourAction:"Start"}),es=class extends w{constructor(){super(...arguments);this.heading="";this.href="";this.target=""}connectedCallback(){super.connectedCallback(),!this.hasAttribute("role")&&this.parentElement?.localName==="cm-smart-tips"&&this.setAttribute("role","listitem")}render(){let e=this.target==="_blank";return o`<a part="tip" href=${this.href||c} target=${this.target||c} rel=${e?"noopener noreferrer":c}>
1056
1219
  <span class="text">
1057
1220
  <span class="title" part="heading">${this.heading}</span>
1058
1221
  <span class="desc" part="description"><slot></slot></span>
1059
- ${e?n`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:c}
1222
+ ${e?o`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:c}
1060
1223
  </span>
1061
1224
  <span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
1062
- </a>`}};zi.properties={heading:{},href:{},target:{}},zi.styles=[g,m`
1225
+ </a>`}};es.properties={heading:{},href:{},target:{}},es.styles=[v,u`
1063
1226
  :host { display: block; }
1064
1227
  a {
1065
1228
  display: flex; align-items: flex-start; gap: var(--cm-space-10); padding: var(--cm-space-20) var(--cm-space-10);
@@ -1076,8 +1239,8 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1076
1239
  }
1077
1240
  a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
1078
1241
  a:hover .title { text-decoration: underline; }
1079
- `];b("cm-smart-tip",zi);var Si=class extends y{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return n`<div class="card" part="smart-tips">
1080
- ${this.tourHeading?n`<div class="tour" part="tour">
1242
+ `];f("cm-smart-tip",es);var ts=class extends w{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return o`<div class="card" part="smart-tips">
1243
+ ${this.tourHeading?o`<div class="tour" part="tour">
1081
1244
  <span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="18"></cm-icon></span>
1082
1245
  <span class="tour-text">${this.tourHeading}</span>
1083
1246
  <cm-button size="medium" @click=${()=>this.dispatchEvent(new CustomEvent("cm-tour",{bubbles:!0,composed:!0}))}>${this.tourAction}</cm-button>
@@ -1086,7 +1249,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1086
1249
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1087
1250
  <div class="list" role="list"><slot></slot></div>
1088
1251
  </section>
1089
- </div>`}};Si.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},Si.styles=[g,m`
1252
+ </div>`}};ts.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},ts.styles=[v,u`
1090
1253
  :host { display: block; }
1091
1254
  .card { display: flex; flex-direction: column; gap: var(--cm-space-10); }
1092
1255
  .tour {
@@ -1104,24 +1267,24 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1104
1267
  letter-spacing: var(--cm-tracking-caps); text-transform: uppercase;
1105
1268
  }
1106
1269
  .list { display: flex; flex-direction: column; gap: var(--cm-space-10); }
1107
- `];b("cm-smart-tips",Si);var Ou=w("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),Ie,Ti,vc,xc,Li=class extends y{constructor(){super(...arguments);h(this,Ti);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;h(this,Ie,S("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),s=this.total?(t-1)*this.pageSize+1:0,l=Math.min(this.total,t*this.pageSize),d=this.pageSizes??[];return n`
1270
+ `];f("cm-smart-tips",ts);var nf=k("pagination",{label:"Pagination",rows:"Number of rows",summary:"Showing {from}\u2013{to} of {total} {resource}",page:"Page",of:"of {count}",previous:"Previous page",next:"Next page"}),We,ss,Md,_d,is=class extends w{constructor(){super(...arguments);h(this,ss);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;h(this,We,S("cm-pg"))}get pageCount(){return Math.max(1,Math.ceil((this.total||0)/Math.max(1,this.pageSize)))}goTo(e){let t=Math.min(this.pageCount,Math.max(1,Math.round(e)||1));if(this._draft=null,t===this.page){this.requestUpdate();return}this.page=t,this.dispatchEvent(new CustomEvent("cm-page-change",{detail:{page:t},bubbles:!0,composed:!0}))}render(){let e=this.pageCount,t=Math.min(e,Math.max(1,this.page)),i=this.total?(t-1)*this.pageSize+1:0,l=Math.min(this.total,t*this.pageSize),d=this.pageSizes??[];return o`
1108
1271
  <nav part="bar" aria-label=${this.label}>
1109
- ${d.length?n`<div class="rows" part="rows">
1110
- <label for="${r(this,Ie)}-s">${this.t("rows")}</label>
1111
- <span class="field"><select id="${r(this,Ie)}-s" @change=${o(this,Ti,vc)}>
1112
- ${(d.includes(this.pageSize)?d:[...d,this.pageSize].sort((p,u)=>p-u)).map(p=>n`<option value=${p} ?selected=${p===this.pageSize}>${p}</option>`)}
1272
+ ${d.length?o`<div class="rows" part="rows">
1273
+ <label for="${s(this,We)}-s">${this.t("rows")}</label>
1274
+ <span class="field"><select id="${s(this,We)}-s" @change=${n(this,ss,Md)}>
1275
+ ${(d.includes(this.pageSize)?d:[...d,this.pageSize].sort((p,m)=>p-m)).map(p=>o`<option value=${p} ?selected=${p===this.pageSize}>${p}</option>`)}
1113
1276
  </select><cm-icon name="chevron-down" size="12"></cm-icon></span>
1114
1277
  </div>`:c}
1115
- <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:s,to:l,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():c}</div>
1278
+ <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:l,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():c}</div>
1116
1279
  <div class="pages" part="pages">
1117
1280
  <span class="counter">
1118
- <label for="${r(this,Ie)}-p">${this.t("page")}</label>
1119
- <input id="${r(this,Ie)}-p" type="number" inputmode="numeric" min="1" max=${e}
1120
- .value=${this._draft??String(t)} aria-describedby="${r(this,Ie)}-of"
1281
+ <label for="${s(this,We)}-p">${this.t("page")}</label>
1282
+ <input id="${s(this,We)}-p" type="number" inputmode="numeric" min="1" max=${e}
1283
+ .value=${this._draft??String(t)} aria-describedby="${s(this,We)}-of"
1121
1284
  @input=${p=>this._draft=p.target.value}
1122
- @keydown=${o(this,Ti,xc)}
1285
+ @keydown=${n(this,ss,_d)}
1123
1286
  @change=${p=>this.goTo(Number(p.target.value))} />
1124
- <span id="${r(this,Ie)}-of">${this.t("of",{count:e})}</span>
1287
+ <span id="${s(this,We)}-of">${this.t("of",{count:e})}</span>
1125
1288
  </span>
1126
1289
  <span class="arrows">
1127
1290
  <button class="prev" type="button" part="previous" aria-label=${this.t("previous")} ?disabled=${t<=1}
@@ -1131,7 +1294,7 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1131
1294
  </span>
1132
1295
  </div>
1133
1296
  </nav>
1134
- `}};Ie=new WeakMap,Ti=new WeakSet,vc=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},xc=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},Li.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},Li.styles=[g,m`
1297
+ `}};We=new WeakMap,ss=new WeakSet,Md=function(e){let t=Number(e.target.value);t!==this.pageSize&&(this.pageSize=t,this.page=1,this.dispatchEvent(new CustomEvent("cm-page-size-change",{detail:{pageSize:t},bubbles:!0,composed:!0})))},_d=function(e){e.key==="Enter"?(e.preventDefault(),this.goTo(Number(e.target.value))):e.key==="Escape"&&(this._draft=null,e.target.value=String(this.page))},is.properties={page:{type:Number,reflect:!0},total:{type:Number},pageSize:{type:Number,attribute:"page-size"},pageSizes:{type:Array,attribute:"page-sizes"},label:{string:"label"},resourceName:{attribute:"resource-name"},_draft:{state:!0}},is.styles=[v,u`
1135
1298
  :host { display: block; }
1136
1299
  nav {
1137
1300
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1165,14 +1328,14 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1165
1328
  .arrows { display: contents; }
1166
1329
  .prev { order: -1; }
1167
1330
  }
1168
- `];b("cm-pagination",Li);var Uu=w("statusTabs",{label:"Status"}),kr,ve,qo,yc,Po,$c,Ci=class extends y{constructor(){super(...arguments);h(this,ve);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];h(this,kr,new MutationObserver(()=>o(this,ve,qo).call(this)))}connectedCallback(){super.connectedCallback(),o(this,ve,qo).call(this),r(this,kr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,kr).disconnect()}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(){if(!("ariaControlsElements"in Element.prototype))return;let e=this.getRootNode(),t=this.controls?e.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button"))s.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=o(this,ve,yc).call(this,e);return n`
1331
+ `];f("cm-pagination",is);var mf=k("statusTabs",{label:"Status"}),tr,ke,Il,zd,Hl,Td,as=class extends w{constructor(){super(...arguments);h(this,ke);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];h(this,tr,new MutationObserver(()=>n(this,ke,Il).call(this)))}connectedCallback(){super.connectedCallback(),n(this,ke,Il).call(this),s(this,tr).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,tr).disconnect()}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(){if(!("ariaControlsElements"in Element.prototype))return;let e=this.getRootNode(),t=this.controls?e.getElementById?.(this.controls):null;for(let i of this.renderRoot.querySelectorAll("button"))i.ariaControlsElements=t?[t]:null}render(){let e=this.items,t=n(this,ke,zd).call(this,e);return o`
1169
1332
  <div class="tabs" part="tabs" role="tablist" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1170
- ${e.map((s,l)=>n`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
1171
- tabindex=${l===t?"0":"-1"} ?disabled=${!!s.disabled}
1172
- @click=${()=>o(this,ve,Po).call(this,l)} @keydown=${d=>o(this,ve,$c).call(this,d,l)}>${s.label}${s.count!==void 0&&!Number.isNaN(s.count)?n` <span class="count">(</span> ${this.formatNumber(s.count)} <span class="count">)</span>`:c}</button>`)}
1333
+ ${e.map((i,l)=>o`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
1334
+ tabindex=${l===t?"0":"-1"} ?disabled=${!!i.disabled}
1335
+ @click=${()=>n(this,ke,Hl).call(this,l)} @keydown=${d=>n(this,ke,Td).call(this,d,l)}>${i.label}${i.count!==void 0&&!Number.isNaN(i.count)?o` <span class="count">(</span> ${this.formatNumber(i.count)} <span class="count">)</span>`:c}</button>`)}
1173
1336
  </div>
1174
1337
  <slot></slot>
1175
- `}};kr=new WeakMap,ve=new WeakSet,qo=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let s=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:s===null||s===""?void 0:Number(s),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},yc=function(e){let t=e.findIndex(s=>s.value===this.value&&!s.disabled);return t>=0?t:e.findIndex(s=>!s.disabled)},Po=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let s=this.renderRoot.querySelectorAll("button")[e];s?.focus(),s?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},$c=function(e,t){let s=de(e,this),l=this.items.flatMap((u,v)=>u.disabled?[]:[v]),d=l.indexOf(t),p;if(s==="ArrowRight")p=l[(d+1)%l.length];else if(s==="ArrowLeft")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&o(this,ve,Po).call(this,p)},Ci.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},Ci.styles=[g,m`
1338
+ `}};tr=new WeakMap,ke=new WeakSet,Il=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.getAttribute("count");return{value:t.value,label:t.label||t.textContent.trim(),count:i===null||i===""?void 0:Number(i),disabled:t.disabled}}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"")},zd=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},Hl=function(e){let t=this.items[e];!t||t.disabled||(this.updateComplete.then(()=>{let i=this.renderRoot.querySelectorAll("button")[e];i?.focus(),i?.scrollIntoView?.({block:"nearest",inline:"nearest"})}),t.value!==this.value&&(this.value=t.value,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))))},Td=function(e,t){let i=fe(e,this),l=this.items.flatMap((m,x)=>m.disabled?[]:[x]),d=l.indexOf(t),p;if(i==="ArrowRight")p=l[(d+1)%l.length];else if(i==="ArrowLeft")p=l[(d-1+l.length)%l.length];else if(e.key==="Home")p=l[0];else if(e.key==="End")p=l[l.length-1];else return;e.preventDefault(),p!==void 0&&n(this,ke,Hl).call(this,p)},as.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},as.styles=[v,u`
1176
1339
  :host { display: block; }
1177
1340
  .tabs {
1178
1341
  display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 0;
@@ -1196,20 +1359,20 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1196
1359
  @media (max-width: 640px) {
1197
1360
  .tabs { gap: 18px; font-size: 14px; }
1198
1361
  }
1199
- `];b("cm-status-tabs",Ci);var Zu=w("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),un,Er,He,Bo,wc,kc,Ai=class extends y{constructor(){super(...arguments);h(this,He);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;h(this,un,S("cm-th"));h(this,Er,new MutationObserver(()=>o(this,He,Bo).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),o(this,He,Bo).call(this),r(this,Er).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Er).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return n`
1362
+ `];f("cm-status-tabs",as);var yf=k("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),so,ir,Ye,Rl,Sd,Ld,rs=class extends w{constructor(){super(...arguments);h(this,Ye);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;h(this,so,S("cm-th"));h(this,ir,new MutationObserver(()=>n(this,Ye,Rl).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),n(this,Ye,Rl).call(this),s(this,ir).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,ir).disconnect()}get items(){return this.columns.length?this.columns.map(e=>typeof e=="string"?{key:e,label:e}:{...e,key:e.key??e.label}):this._slotted}render(){let e=this._inTable,t=this.items;return o`
1200
1363
  <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":c}
1201
1364
  style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
1202
- ${this.selectable?n`<span class="cell" role=${e?"columnheader":c}><span class="check">
1203
- <input id="${r(this,un)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
1204
- @change=${o(this,He,kc)} />
1205
- <span class="box" aria-hidden="true">${this.indeterminate?n`<span class="dash"></span>`:this.checked?n`<cm-icon name="check" size="14"></cm-icon>`:c}</span>
1365
+ ${this.selectable?o`<span class="cell" role=${e?"columnheader":c}><span class="check">
1366
+ <input id="${s(this,so)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
1367
+ @change=${n(this,Ye,Ld)} />
1368
+ <span class="box" aria-hidden="true">${this.indeterminate?o`<span class="dash"></span>`:this.checked?o`<cm-icon name="check" size="14"></cm-icon>`:c}</span>
1206
1369
  </span></span>`:c}
1207
- ${t.map(s=>{let l=this.sort===s.key,d=l?this.direction==="descending"?"descending":"ascending":"none",p=s.hidden?n`<span class="sr">${s.label}</span>`:s.label;return n`<span class="cell" part="cell" data-align=${s.align??"start"} role=${e?"columnheader":c}
1208
- aria-sort=${e&&s.sortable?d:c}>${s.sortable?n`<button type="button" class=${l?"on":""} @click=${()=>o(this,He,wc).call(this,s)}>${p}${e?c:n`<span class="sr">${l?this.t("sorted",{direction:this.t(d)}):this.t("sortable")}</span>`}<cm-icon
1370
+ ${t.map(i=>{let l=this.sort===i.key,d=l?this.direction==="descending"?"descending":"ascending":"none",p=i.hidden?o`<span class="sr">${i.label}</span>`:i.label;return o`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":c}
1371
+ aria-sort=${e&&i.sortable?d:c}>${i.sortable?o`<button type="button" class=${l?"on":""} @click=${()=>n(this,Ye,Sd).call(this,i)}>${p}${e?c:o`<span class="sr">${l?this.t("sorted",{direction:this.t(d)}):this.t("sortable")}</span>`}<cm-icon
1209
1372
  name=${l&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:p}</span>`})}
1210
1373
  </div>
1211
1374
  <slot></slot>
1212
- `}};un=new WeakMap,Er=new WeakMap,He=new WeakSet,Bo=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},wc=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},kc=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},Ai.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},Ai.styles=[g,m`
1375
+ `}};so=new WeakMap,ir=new WeakMap,Ye=new WeakSet,Rl=function(){this._slotted=[...this.querySelectorAll("option")].map(e=>{let t=e.label||e.textContent.trim();return{key:e.getAttribute("value")??t,label:t,sortable:e.hasAttribute("sortable"),hidden:e.hasAttribute("hidden"),align:e.getAttribute("align")??"start"}})},Sd=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending";this.dispatchEvent(new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0}))},Ld=function(e){let t=e.target.checked;this.checked=t,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("cm-select-all",{detail:{checked:t},bubbles:!0,composed:!0}))},rs.properties={columns:{type:Array},sort:{reflect:!0},direction:{reflect:!0},selectable:{type:Boolean,reflect:!0},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean,reflect:!0},resourceRows:{attribute:"resource-rows",reflect:!0},_slotted:{state:!0},_inTable:{state:!0}},rs.styles=[v,u`
1213
1376
  :host { display: block; }
1214
1377
  slot { display: none; } /* <option> children are column data, not content */
1215
1378
  .bar {
@@ -1239,7 +1402,23 @@ var kl=a=>{throw TypeError(a)};var Wn=(a,i,e)=>i.has(a)||kl("Cannot "+e);var r=(
1239
1402
  .dash { width: 10px; height: 2px; background: var(--cm-icon-selected); }
1240
1403
  input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1241
1404
  slot { display: none; }
1242
- `];b("cm-table-header",Ai);var ab=w("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),Ec=!1,Fd=`
1405
+ /* In a cm-resource-list (resource-rows): the bar's content box matches a row's content box, so the same
1406
+ --cm-table-columns grid (with column-gap space-20) lands on the same x positions. Rows are padded space-10
1407
+ inline, start with a 20px checkbox and a space-20 gap when selectable, and end with the gap before their
1408
+ (possibly empty) actions; on phones: no padding, an 18px checkbox, space-10 gaps.
1409
+ The bar reaches out to the list's edges; its border is drawn inside so it takes no room. */
1410
+ :host([resource-rows]) .bar {
1411
+ margin-inline: calc(-1 * var(--cm-space-10)); padding-inline: var(--cm-space-20) calc(2 * var(--cm-space-20));
1412
+ border: 0; box-shadow: inset 0 0 0 var(--cm-border-1) var(--cm-border-subtle);
1413
+ }
1414
+ :host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-20) + 20px + var(--cm-space-20)); }
1415
+ :host([resource-rows]) .bar.sel > .cell:first-child { overflow: visible; }
1416
+ @media (max-width: 640px) {
1417
+ :host([resource-rows]) .bar { padding-inline: var(--cm-space-10) calc(2 * var(--cm-space-10)); }
1418
+ :host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-10) + 18px + var(--cm-space-10)); }
1419
+ :host([resource-rows]) .bar.sel { grid-template-columns: calc(18px + var(--cm-space-10) - var(--cm-space-20)) var(--cm-table-columns, var(--_cols)); }
1420
+ }
1421
+ `];f("cm-table-header",rs);var zf=k("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),Cd=!1,Qh=`
1243
1422
  cm-data-table > table { width: 100%; border-collapse: separate; border-spacing: 0; font: inherit; font-size: 14px; line-height: 1.5; color: var(--cm-text-default); }
1244
1423
  cm-data-table > table caption { text-align: start; font-weight: 500; font-size: 16px; padding-block-end: var(--cm-space-10); }
1245
1424
  cm-data-table > table th { font-size: 12px; font-weight: 400; text-align: start; padding: 7px var(--cm-space-20); background: var(--cm-bg-hover); border-block: var(--cm-border-1) solid var(--cm-border-subtle); white-space: nowrap; }
@@ -1255,22 +1434,22 @@ cm-data-table > table th > button.cm-sort:hover cm-icon, cm-data-table > table t
1255
1434
  cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1256
1435
  @media (forced-colors: active) { cm-data-table > table th > button.cm-sort cm-icon { opacity: 1; } }
1257
1436
  cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-data-table > table [data-type='money'] { text-align: end; font-variant-numeric: tabular-nums; }
1258
- `;function Vd(){if(Ec||typeof document>"u")return;Ec=!0;let a=new CSSStyleSheet;a.replaceSync(Fd),document.adoptedStyleSheets=[...document.adoptedStyleSheets,a]}var Ud=a=>(a.align??(a.type==="numeric"||a.type==="money"?"end":"start"))==="end";function Mc(a){if(typeof a=="number")return a;let i=String(a??"").trim(),e=/^\(.*\)$/.test(i)||/^-|^[^\d]*-\s*\d/.test(i),t=i.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let s=Number(t[0].replace(/,/g,""));return e?-s:s}var _c=a=>a instanceof Date?a.getTime():typeof a=="number"?a:Date.parse(String(a??"")),zc=new Map;function Kd(a){let i=zc.get(a??"");if(!i){try{i=new Intl.Collator(a,{numeric:!0,sensitivity:"base"})}catch{i=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}zc.set(a??"",i)}return i}function Sc(a,i,e,t){let s=l=>l==null||l==="";return s(a)||s(i)?s(a)===s(i)?0:s(a)?1:-1:e==="numeric"||e==="money"?(Mc(a)||0)-(Mc(i)||0):e==="date"?(_c(a)||0)-(_c(i)||0):Kd(t).compare(String(a),String(i))}var Ri,Mr,R,jo,Fo,Lc,Vo,Tc,Cc,bn,Di,Ni=class extends y{constructor(){super(...arguments);h(this,R);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this._light=!1;this._announce="";h(this,Ri,!1);h(this,Mr,new MutationObserver(()=>o(this,R,jo).call(this)))}connectedCallback(){super.connectedCallback(),o(this,R,jo).call(this),r(this,Mr).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Mr).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(l=>l.key===this.sort);if(!t||this.sortMode==="manual")return e;let s=this.direction==="descending"?-1:1;return e.map((l,d)=>[l,d]).sort(([l,d],[p,u])=>{let v=l[t.key],$=p[t.key],x=v==null||v==="",L=$==null||$==="";return x||L?x===L?d-u:x?1:-1:s*Sc(v,$,t.type,this.locale)||d-u}).map(([l])=>l)}updated(e){if(r(this,Ri)&&(e.has("sort")||e.has("direction"))&&this.sort){f(this,Ri,!1);let t=this.columns.find(s=>s.key===this.sort);t&&o(this,R,Fo).call(this,t.label,this.direction)}}render(){let e=n`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return n`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],s=this.sortedRows,l=Math.max(1,t.length),d=!this.loading&&s.length===0;return n`
1437
+ `;function ep(){if(Cd||typeof document>"u")return;Cd=!0;let r=new CSSStyleSheet;r.replaceSync(Qh),document.adoptedStyleSheets=[...document.adoptedStyleSheets,r]}var tp=r=>(r.align??(r.type==="numeric"||r.type==="money"?"end":"start"))==="end";function Ad(r){if(typeof r=="number")return r;let a=String(r??"").trim(),e=/^\(.*\)$/.test(a)||/^-|^[^\d]*-\s*\d/.test(a),t=a.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var Dd=r=>r instanceof Date?r.getTime():typeof r=="number"?r:Date.parse(String(r??"")),Nd=new Map;function ip(r){let a=Nd.get(r??"");if(!a){try{a=new Intl.Collator(r,{numeric:!0,sensitivity:"base"})}catch{a=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Nd.set(r??"",a)}return a}function Id(r,a,e,t){let i=l=>l==null||l==="";return i(r)||i(a)?i(r)===i(a)?0:i(r)?1:-1:e==="numeric"||e==="money"?(Ad(r)||0)-(Ad(a)||0):e==="date"?(Dd(r)||0)-(Dd(a)||0):ip(t).compare(String(r),String(a))}var ls,sr,I,Ol,ql,Hd,Pl,Rd,Od,ao,ns,os=class extends w{constructor(){super(...arguments);h(this,I);this.columns=[];this.rows=[];this.totals=null;this.caption="";this.captionHidden=!1;this.sort="";this.direction="ascending";this.sortMode="auto";this.stickyHeader=!1;this.stickyFirstColumn=!1;this.loading=!1;this.loadingRows=5;this._light=!1;this._announce="";h(this,ls,!1);h(this,sr,new MutationObserver(()=>n(this,I,Ol).call(this)))}connectedCallback(){super.connectedCallback(),n(this,I,Ol).call(this),s(this,sr).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,sr).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(l=>l.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((l,d)=>[l,d]).sort(([l,d],[p,m])=>{let x=l[t.key],$=p[t.key],y=x==null||x==="",T=$==null||$==="";return y||T?y===T?d-m:y?1:-1:i*Id(x,$,t.type,this.locale)||d-m}).map(([l])=>l)}updated(e){if(s(this,ls)&&(e.has("sort")||e.has("direction"))&&this.sort){b(this,ls,!1);let t=this.columns.find(i=>i.key===this.sort);t&&n(this,I,ql).call(this,t.label,this.direction)}}render(){let e=o`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return o`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],i=this.sortedRows,l=Math.max(1,t.length),d=!this.loading&&i.length===0;return o`
1259
1438
  <div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":c}
1260
1439
  role=${this.stickyHeader||this.stickyFirstColumn?"region":c}
1261
1440
  aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:c}>
1262
1441
  <table part="table" aria-busy=${this.loading?"true":"false"}>
1263
- ${this.caption?n`<caption part="caption">${this.caption}</caption>`:c}
1264
- <thead><tr>${t.map(p=>{let u=this.sort===p.key,v=u?this.direction:"none",$=p.hidden?n`<span class="sr">${p.label}</span>`:p.label;return n`<th scope="col" class=${o(this,R,Di).call(this,p)} aria-sort=${p.sortable?v:c}>${p.sortable?n`<button type="button" class=${u?"on":""} @click=${()=>o(this,R,Cc).call(this,p)}>${$}<cm-icon
1265
- name=${u&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:$}</th>`})}</tr></thead>
1442
+ ${this.caption?o`<caption part="caption">${this.caption}</caption>`:c}
1443
+ <thead><tr>${t.map(p=>{let m=this.sort===p.key,x=m?this.direction:"none",$=p.hidden?o`<span class="sr">${p.label}</span>`:p.label;return o`<th scope="col" class=${n(this,I,ns).call(this,p)} aria-sort=${p.sortable?x:c}>${p.sortable?o`<button type="button" class=${m?"on":""} @click=${()=>n(this,I,Od).call(this,p)}>${$}<cm-icon
1444
+ name=${m&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:$}</th>`})}</tr></thead>
1266
1445
  <tbody>
1267
- ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>n`<tr>${t.map(p=>n`<td class=${o(this,R,Di).call(this,p)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):s.map(p=>n`<tr part="row">${t.map((u,v)=>v===0?n`<th scope="row" class=${o(this,R,Di).call(this,u)} part="cell">${o(this,R,bn).call(this,p[u.key])}</th>`:n`<td class=${o(this,R,Di).call(this,u)} part="cell">${o(this,R,bn).call(this,p[u.key])}</td>`)}</tr>`)}
1268
- ${d?n`<tr class="empty"><td colspan=${l}><slot name="empty">${this.t("empty")}</slot></td></tr>`:c}
1446
+ ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>o`<tr>${t.map(p=>o`<td class=${n(this,I,ns).call(this,p)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):i.map(p=>o`<tr part="row">${t.map((m,x)=>x===0?o`<th scope="row" class=${n(this,I,ns).call(this,m)} part="cell">${n(this,I,ao).call(this,p[m.key])}</th>`:o`<td class=${n(this,I,ns).call(this,m)} part="cell">${n(this,I,ao).call(this,p[m.key])}</td>`)}</tr>`)}
1447
+ ${d?o`<tr class="empty"><td colspan=${l}><slot name="empty">${this.t("empty")}</slot></td></tr>`:c}
1269
1448
  </tbody>
1270
- ${this.totals&&!this.loading&&!d?n`<tfoot><tr part="totals">${t.map(p=>n`<td class=${o(this,R,Di).call(this,p)}>${o(this,R,bn).call(this,this.totals[p.key])}</td>`)}</tr></tfoot>`:c}
1449
+ ${this.totals&&!this.loading&&!d?o`<tfoot><tr part="totals">${t.map(p=>o`<td class=${n(this,I,ns).call(this,p)}>${n(this,I,ao).call(this,this.totals[p.key])}</td>`)}</tr></tfoot>`:c}
1271
1450
  </table>
1272
1451
  </div>${e}
1273
- `}};Ri=new WeakMap,Mr=new WeakMap,R=new WeakSet,jo=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Vd(),o(this,R,Lc).call(this))},Fo=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},Lc=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),o(this,R,Vo).call(this,s),d.addEventListener("click",()=>o(this,R,Tc).call(this,e,s,l))})},Vo=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Tc=function(e,t,s){let l=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),d=t.dataset.key||l,p=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",u=new CustomEvent("cm-sort",{detail:{key:d,direction:p},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(u)||this.sortMode==="manual")return;let v=t.dataset.sort,$=p==="descending"?-1:1;for(let x of e.tBodies){let L=C=>{let P=C.cells[s];return P?(P.dataset.value??P.textContent??"").trim():""},M=[...x.rows].map((C,P)=>[C,L(C),P]).sort(([,C,P],[,H,O])=>C===""||H===""?C===H?P-O:C===""?1:-1:$*Sc(C,H,v,this.locale)||P-O);x.append(...M.map(([C])=>C))}for(let x of e.tHead.rows[0].cells)x.dataset.sort&&(x.setAttribute("aria-sort",x===t?p:"none"),o(this,R,Vo).call(this,x));o(this,R,Fo).call(this,l,p)},Cc=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",s=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),l=this.dispatchEvent(s);f(this,Ri,l),l&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},bn=function(e){return e==null?"":e instanceof Date?we(e,{},this.locale):String(e)},Di=function(e){return`${Ud(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},Ni.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},_light:{state:!0},_announce:{state:!0}},Ni.styles=[g,m`
1452
+ `}};ls=new WeakMap,sr=new WeakMap,I=new WeakSet,Ol=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(ep(),n(this,I,Hd).call(this))},ql=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},Hd=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((i,l)=>{if(!i.dataset.sort||i.querySelector(":scope > button.cm-sort"))return;i.dataset.type=i.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...i.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),i.append(d),i.hasAttribute("aria-sort")||i.setAttribute("aria-sort","none"),n(this,I,Pl).call(this,i),d.addEventListener("click",()=>n(this,I,Rd).call(this,e,i,l))})},Pl=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Rd=function(e,t,i){let l=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),d=t.dataset.key||l,p=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",m=new CustomEvent("cm-sort",{detail:{key:d,direction:p},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(m)||this.sortMode==="manual")return;let x=t.dataset.sort,$=p==="descending"?-1:1;for(let y of e.tBodies){let T=_=>{let R=_.cells[i];return R?(R.dataset.value??R.textContent??"").trim():""},M=[...y.rows].map((_,R)=>[_,T(_),R]).sort(([,_,R],[,O,q])=>_===""||O===""?_===O?R-q:_===""?1:-1:$*Id(_,O,x,this.locale)||R-q);y.append(...M.map(([_])=>_))}for(let y of e.tHead.rows[0].cells)y.dataset.sort&&(y.setAttribute("aria-sort",y===t?p:"none"),n(this,I,Pl).call(this,y));n(this,I,ql).call(this,l,p)},Od=function(e){let t=this.sort===e.key&&this.direction==="ascending"?"descending":"ascending",i=new CustomEvent("cm-sort",{detail:{key:e.key,direction:t},bubbles:!0,composed:!0,cancelable:!0}),l=this.dispatchEvent(i);b(this,ls,l),l&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},ao=function(e){return e==null?"":e instanceof Date?V(e,{},this.locale):String(e)},ns=function(e){return`${tp(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},os.properties={columns:{type:Array},rows:{type:Array},totals:{type:Object},caption:{},captionHidden:{type:Boolean,attribute:"caption-hidden",reflect:!0},sort:{reflect:!0},direction:{reflect:!0},sortMode:{attribute:"sort-mode",reflect:!0},stickyHeader:{type:Boolean,attribute:"sticky-header",reflect:!0},stickyFirstColumn:{type:Boolean,attribute:"sticky-first-column",reflect:!0},loading:{type:Boolean,reflect:!0},loadingRows:{type:Number,attribute:"loading-rows"},_light:{state:!0},_announce:{state:!0}},os.styles=[v,u`
1274
1453
  :host { display: block; font-size: 14px; line-height: 1.5; }
1275
1454
  .scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
1276
1455
  .scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
@@ -1307,18 +1486,18 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1307
1486
  .empty td { padding: var(--cm-space-20); border-block-end: 0; }
1308
1487
  .light { display: contents; }
1309
1488
  @media (forced-colors: active) { button cm-icon { opacity: 1; } }
1310
- `];b("cm-data-table",Ni);var Ii=class extends k{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};Ii.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Ii.styles=m`:host { display: none; }`;b("cm-menu-item",Ii);function _r(a){let i=[];for(let e of Array.from(a.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),s=l=>e.getAttribute(l)||void 0;i.push({label:t,value:s("value")??t,icon:s("icon"),href:s("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&i.push({divider:!0});return i}function fn(a,i){let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var fb=w("actionMenu",{label:"Actions"}),zr,qi,zt,Sr,N,gn,Lr,Uo,vn,xn,yn,Tr,Cr,Hi,$n,Ac,Dc,Oi=class extends y{constructor(){super(...arguments);h(this,N);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this._slotted=[];this._active=-1;this._custom=!1;h(this,zr);h(this,qi,S("cm-menu"));h(this,zt,"");h(this,Sr,0);h(this,Lr,e=>{this.open&&!e.composedPath().includes(this)&&o(this,N,xn).call(this,!1)});h(this,Tr,e=>{e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0))});h(this,Cr,()=>{this.open?this.hide():this.show()});h(this,$n,e=>{let t=o(this,N,vn).call(this),s=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),o(this,N,Hi).call(this,t[(s+1)%t.length]);break;case"ArrowUp":e.preventDefault(),o(this,N,Hi).call(this,t[(s-1+t.length)%t.length]);break;case"Home":e.preventDefault(),o(this,N,Hi).call(this,t[0]);break;case"End":e.preventDefault(),o(this,N,Hi).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let l=Date.now();f(this,zt,(l-r(this,Sr)<600?r(this,zt):"")+e.key.toLowerCase()),f(this,Sr,l);let d=this.menuItems,p=r(this,zt).length>1?s:s+1,v=[...t.slice(Math.max(p,0)),...t.slice(0,Math.max(p,0))].find($=>(d[$].label??"").toLowerCase().startsWith(r(this,zt)));v!==void 0&&o(this,N,Hi).call(this,v)}}})}connectedCallback(){super.connectedCallback(),o(this,N,gn).call(this),f(this,zr,fn(this,()=>o(this,N,gn).call(this))),document.addEventListener("pointerdown",r(this,Lr),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,zr)?.disconnect(),document.removeEventListener("pointerdown",r(this,Lr),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=o(this,N,vn).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,o(this,N,xn).call(this,!0),this.updateComplete.then(()=>o(this,N,yn).call(this))}hide(e=!1){o(this,N,xn).call(this,!1),e&&o(this,N,Uo).call(this)?.focus()}updated(e){if(this._custom){let t=o(this,N,Uo).call(this);if(t){let s=(l,d)=>{t.getAttribute(l)!==d&&t.setAttribute(l,d)};s("aria-haspopup","menu"),s("aria-expanded",String(this.open)),s("aria-controls",`${r(this,qi)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=o(this,N,vn).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>o(this,N,yn).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,s=this._custom?n`<slot name="trigger" @click=${r(this,Cr)} @keydown=${r(this,Tr)} @slotchange=${()=>o(this,N,gn).call(this)}></slot>`:n`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
1311
- aria-expanded=${String(this.open)} aria-controls="${r(this,qi)}-m" aria-label=${this.iconOnly?t:c}
1312
- @click=${r(this,Cr)} @keydown=${r(this,Tr)}>${this.iconOnly?n`<cm-icon name=${this.icon} size="18"></cm-icon>`:n`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return n`${s}
1489
+ `];f("cm-data-table",os);var cs=class extends E{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1}render(){return null}toItem(){let e=(this.textContent??"").trim();return{label:e,value:this.value||e,icon:this.icon||void 0,href:this.href||void 0,disabled:this.disabled||void 0,critical:this.critical||void 0}}};cs.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},cs.styles=u`:host { display: none; }`;f("cm-menu-item",cs);function ar(r){let a=[];for(let e of Array.from(r.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=l=>e.getAttribute(l)||void 0;a.push({label:t,value:i("value")??t,icon:i("icon"),href:i("href"),disabled:e.hasAttribute("disabled")||void 0,critical:e.hasAttribute("critical")||void 0})}else e.localName==="hr"&&a.push({divider:!0});return a}function ro(r,a){let e=new MutationObserver(a);return e.observe(r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Of=k("actionMenu",{label:"Actions"}),rr,ps,Wt,nr,N,no,or,Bl,oo,lo,co,lr,cr,ds,ho,qd,Pd,hs=class extends w{constructor(){super(...arguments);h(this,N);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this._slotted=[];this._active=-1;this._custom=!1;h(this,rr);h(this,ps,S("cm-menu"));h(this,Wt,"");h(this,nr,0);h(this,or,e=>{this.open&&!e.composedPath().includes(this)&&n(this,N,lo).call(this,!1)});h(this,lr,e=>{e.key==="ArrowDown"?(e.preventDefault(),this.show("first")):e.key==="ArrowUp"?(e.preventDefault(),this.show("last")):e.key==="Escape"&&this.open&&(e.preventDefault(),e.stopPropagation(),this.hide(!0))});h(this,cr,()=>{this.open?this.hide():this.show()});h(this,ho,e=>{let t=n(this,N,oo).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),n(this,N,ds).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),n(this,N,ds).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),n(this,N,ds).call(this,t[0]);break;case"End":e.preventDefault(),n(this,N,ds).call(this,t[t.length-1]);break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hide(!0);break;case"Tab":this.hide();break;default:if(e.key.length===1&&/\S/.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let l=Date.now();b(this,Wt,(l-s(this,nr)<600?s(this,Wt):"")+e.key.toLowerCase()),b(this,nr,l);let d=this.menuItems,p=s(this,Wt).length>1?i:i+1,x=[...t.slice(Math.max(p,0)),...t.slice(0,Math.max(p,0))].find($=>(d[$].label??"").toLowerCase().startsWith(s(this,Wt)));x!==void 0&&n(this,N,ds).call(this,x)}}})}connectedCallback(){super.connectedCallback(),n(this,N,no).call(this),b(this,rr,ro(this,()=>n(this,N,no).call(this))),document.addEventListener("pointerdown",s(this,or),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,rr)?.disconnect(),document.removeEventListener("pointerdown",s(this,or),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=n(this,N,oo).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,n(this,N,lo).call(this,!0),this.updateComplete.then(()=>n(this,N,co).call(this))}hide(e=!1){n(this,N,lo).call(this,!1),e&&n(this,N,Bl).call(this)?.focus()}updated(e){if(this._custom){let t=n(this,N,Bl).call(this);if(t){let i=(l,d)=>{t.getAttribute(l)!==d&&t.setAttribute(l,d)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${s(this,ps)}-m`)}}if(e.has("open")&&this.open&&this._active<0){let t=n(this,N,oo).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>n(this,N,co).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?o`<slot name="trigger" @click=${s(this,cr)} @keydown=${s(this,lr)} @slotchange=${()=>n(this,N,no).call(this)}></slot>`:o`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
1490
+ aria-expanded=${String(this.open)} aria-controls="${s(this,ps)}-m" aria-label=${this.iconOnly?t:c}
1491
+ @click=${s(this,cr)} @keydown=${s(this,lr)}>${this.iconOnly?o`<cm-icon name=${this.icon} size="18"></cm-icon>`:o`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return o`${i}
1313
1492
  <div class="pop" part="menu" ?hidden=${!this.open}>
1314
- ${this.heading?n`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?n`<span>${this.subheading}</span>`:c}</div>`:c}
1315
- <div role="menu" id="${r(this,qi)}-m" aria-label=${this.heading||this.label} @keydown=${r(this,$n)}>
1316
- ${e.map((l,d)=>o(this,N,Dc).call(this,l,d))}
1493
+ ${this.heading?o`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?o`<span>${this.subheading}</span>`:c}</div>`:c}
1494
+ <div role="menu" id="${s(this,ps)}-m" aria-label=${this.heading||this.label} @keydown=${s(this,ho)}>
1495
+ ${e.map((l,d)=>n(this,N,Pd).call(this,l,d))}
1317
1496
  </div>
1318
1497
  </div>
1319
- <slot hidden></slot>`}};zr=new WeakMap,qi=new WeakMap,zt=new WeakMap,Sr=new WeakMap,N=new WeakSet,gn=function(){this._slotted=_r(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Lr=new WeakMap,Uo=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},vn=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},xn=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},yn=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Tr=new WeakMap,Cr=new WeakMap,Hi=function(e){this._active=e,this.updateComplete.then(()=>o(this,N,yn).call(this))},$n=new WeakMap,Ac=function(e,t){if(t.disabled){e.preventDefault();return}let s=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));s||e.preventDefault(),this.hide(!t.href||!s)},Dc=function(e,t){if(e.divider)return n`<div role="separator"></div>`;let s=`item${e.critical?" critical":""}${t===this._active?" active":""}`,l=n`${e.icon?n`<cm-icon name=${e.icon} size="16"></cm-icon>`:c}<span>${e.label}</span>`,d={over:()=>{e.disabled||(this._active=t)},click:p=>o(this,N,Ac).call(this,p,e)};return e.href&&!e.disabled?n`<a class=${s} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
1320
- @pointerenter=${d.over} @click=${d.click}>${l}</a>`:n`<button type="button" class=${s} part="item" role="menuitem" tabindex="-1" data-i=${t}
1321
- aria-disabled=${e.disabled?"true":c} @pointerenter=${d.over} @click=${d.click}>${l}</button>`},Oi.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},Oi.styles=[g,m`
1498
+ <slot hidden></slot>`}};rr=new WeakMap,ps=new WeakMap,Wt=new WeakMap,nr=new WeakMap,N=new WeakSet,no=function(){this._slotted=ar(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},or=new WeakMap,Bl=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},oo=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},lo=function(e){this.open!==e&&(this.open=e,e||(this._active=-1),this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:e},bubbles:!0,composed:!0})))},co=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},lr=new WeakMap,cr=new WeakMap,ds=function(e){this._active=e,this.updateComplete.then(()=>n(this,N,co).call(this))},ho=new WeakMap,qd=function(e,t){if(t.disabled){e.preventDefault();return}let i=this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}));i||e.preventDefault(),this.hide(!t.href||!i)},Pd=function(e,t){if(e.divider)return o`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,l=o`${e.icon?o`<cm-icon name=${e.icon} size="16"></cm-icon>`:c}<span>${e.label}</span>`,d={over:()=>{e.disabled||(this._active=t)},click:p=>n(this,N,qd).call(this,p,e)};return e.href&&!e.disabled?o`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
1499
+ @pointerenter=${d.over} @click=${d.click}>${l}</a>`:o`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
1500
+ aria-disabled=${e.disabled?"true":c} @pointerenter=${d.over} @click=${d.click}>${l}</button>`},hs.properties={items:{type:Array},open:{type:Boolean,reflect:!0},label:{string:"label"},triggerLabel:{attribute:"trigger-label"},iconOnly:{type:Boolean,attribute:"icon-only"},icon:{},align:{reflect:!0},heading:{},subheading:{},_slotted:{state:!0},_active:{state:!0},_custom:{state:!0}},hs.styles=[v,u`
1322
1501
  :host { display: inline-block; position: relative; vertical-align: middle; }
1323
1502
  .trigger {
1324
1503
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 500;
@@ -1351,7 +1530,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1351
1530
  }
1352
1531
  .item.active:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; }
1353
1532
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-default); }
1354
- `];b("cm-action-menu",Oi);var kb=w("resourceItem",{select:"Select {name}"}),Eb=w("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),Nc=m`
1533
+ `];f("cm-action-menu",hs);var Uf=k("resourceItem",{select:"Select {name}"}),Kf=k("resourceList",{resourceName:"item",resourceNamePlural:"items",select:"Select",selectPageHidden:"all {count} {resource} on this page",selectionOptions:"Selection options",selectPage:"Select all {count} on this page",selectAll:"Select all {count} {resource}",selectNone:"Select none",selected:"{count} {resource} selected.",allSelected:"All {count} {resource} selected.",clearSelection:"Clear selection",loading:"Loading {resource}"}),Bd=u`
1355
1534
  .check { position: relative; display: inline-flex; flex: none; width: 20px; height: 20px; }
1356
1535
  .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
1357
1536
  .check input:disabled { cursor: not-allowed; }
@@ -1363,17 +1542,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1363
1542
  .dash { width: 50%; height: 2px; background: currentColor; }
1364
1543
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1365
1544
  .check input:disabled + .box { border-color: var(--cm-border-default); background: var(--cm-bg-input-filled); }
1366
- `,kn,En,Rc,Bi=class extends y{constructor(){super();h(this,En);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;h(this,kn,this.attachInternals());r(this,kn).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return n`
1367
- ${this.href&&!this.disabled?n`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:c}
1368
- <div class="row" part="row" @click=${o(this,En,Rc)}>
1369
- ${this.selectable?n`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
1545
+ `,mo,uo,Fd,us=class extends w{constructor(){super();h(this,uo);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;h(this,mo,this.attachInternals());s(this,mo).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get name(){return this.label||this.textContent.replace(/\s+/g," ").trim()}toggle(e){if(this.disabled)return;let t=e??!this.selected;t!==this.selected&&(this.selected=t,this.dispatchEvent(new CustomEvent("cm-resource-select",{detail:{value:this.value,selected:t},bubbles:!0,composed:!0})))}render(){return o`
1546
+ ${this.href&&!this.disabled?o`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:c}
1547
+ <div class="row" part="row" @click=${n(this,uo,Fd)}>
1548
+ ${this.selectable?o`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
1370
1549
  ?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
1371
- <span class="box" aria-hidden="true">${this.selected?n`<cm-icon name="check" size="14"></cm-icon>`:c}</span></span>`:c}
1550
+ <span class="box" aria-hidden="true">${this.selected?o`<cm-icon name="check" size="14"></cm-icon>`:c}</span></span>`:c}
1372
1551
  <span class="media"><slot name="media"></slot></span>
1373
1552
  <div class="content" part="content"><slot></slot></div>
1374
1553
  <div class="actions" part="actions"><slot name="actions"></slot></div>
1375
1554
  </div>
1376
- `}};kn=new WeakMap,En=new WeakSet,Rc=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(s=>s instanceof HTMLElement&&s!==this&&s.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},Bi.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0}},Bi.styles=[g,Nc,m`
1555
+ `}};mo=new WeakMap,uo=new WeakSet,Fd=function(e){!this.selectable||this.href||this.disabled||e.composedPath().some(i=>i instanceof HTMLElement&&i!==this&&i.matches('a, button, input, select, textarea, label, [role="button"], cm-button'))||getSelection()?.toString()||this.toggle()},us.properties={value:{reflect:!0},selected:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},href:{},label:{},selectable:{type:Boolean,reflect:!0},columns:{type:Boolean,reflect:!0}},us.styles=[v,Bd,u`
1377
1556
  :host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-default); }
1378
1557
  :host(:last-child) { border-bottom: 0; }
1379
1558
  .row {
@@ -1389,6 +1568,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1389
1568
  }
1390
1569
  ::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 50px; background: none; }
1391
1570
  .content { flex: 1; min-width: 0; }
1571
+ :host([columns]) .content {
1572
+ display: grid; grid-template-columns: var(--cm-table-columns, minmax(0, 1fr)); column-gap: var(--cm-space-20); align-items: center;
1573
+ }
1574
+ :host([columns]) ::slotted(*) { min-width: 0; overflow-wrap: anywhere; }
1392
1575
  a { position: absolute; inset: 0; z-index: 0; border-radius: var(--cm-radius-xs); }
1393
1576
  a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: -2px; }
1394
1577
  .check, .actions { position: relative; z-index: 1; }
@@ -1400,29 +1583,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1400
1583
  ::slotted([slot='media']) { width: 34px; height: 34px; }
1401
1584
  ::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 34px; }
1402
1585
  }
1403
- `];b("cm-resource-item",Bi);var Ar,se,Ic,Pi,wn,Mn,ji=class extends y{constructor(){super();h(this,se);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this._count=0;this._rows=0;h(this,Ar,S("cm-rl"));h(this,Mn,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,o(this,se,Pi).call(this),o(this,se,wn).call(this))})}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),o(this,se,Pi).call(this),o(this,se,wn).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,o(this,se,Pi).call(this),o(this,se,wn).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&o(this,se,Pi).call(this)}render(){let e=this._count,t=this._rows,s=this.items.filter($=>!$.disabled).length,l=s>0&&e>=s,d=o(this,se,Ic).call(this),p=$=>pa($,this.locale)==="one"?this.resourceName:d,u=this.total>t,v=c;return this.allSelected?v=n`${this.t("allSelected",{count:Math.max(this.total,e),resource:d})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(v=n`${this.t("selected",{count:e,resource:p(e)})}${l&&u?n` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:d})}</button>`:c}`),n`
1404
- ${this.selectable?n`<div class="toolbar" part="toolbar">
1586
+ `];f("cm-resource-item",us);var dr,hr,W,jd,Fl,bo,ms,po,fo,bs=class extends w{constructor(){super();h(this,W);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this._count=0;this._rows=0;h(this,dr,S("cm-rl"));h(this,hr,new Set);h(this,bo,e=>{let t=e.target;t.parentElement.classList.toggle("has",t.assignedElements().length>0),n(this,W,Fl).call(this,t)});h(this,fo,e=>{e.stopPropagation();let t=e.detail.value;t==="page"?this.selectPage(!0):t==="all"?this.selectAll():t==="none"&&this.clearSelection()});this.addEventListener("cm-resource-select",e=>{e.target!==this&&(this.allSelected=!1,n(this,W,ms).call(this),n(this,W,po).call(this))})}get items(){return[...this.querySelectorAll(":scope > cm-resource-item")]}get selected(){return this.items.filter(e=>e.selected).map(e=>e.value)}selectPage(e=!0){this.items.forEach(t=>{t.disabled||(t.selected=e)}),e||(this.allSelected=!1),n(this,W,ms).call(this),n(this,W,po).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,n(this,W,ms).call(this),n(this,W,po).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&(n(this,W,ms).call(this),n(this,W,Fl).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter($=>!$.disabled).length,l=i>0&&e>=i,d=n(this,W,jd).call(this),p=$=>Ur($,this.locale)==="one"?this.resourceName:d,m=this.total>t,x=c;return this.allSelected?x=o`${this.t("allSelected",{count:Math.max(this.total,e),resource:d})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(x=o`${this.t("selected",{count:e,resource:p(e)})}${l&&m?o` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:d})}</button>`:c}`),o`
1587
+ ${this.selectable?o`<div class="toolbar" part="toolbar">
1405
1588
  <span class="select" part="select">
1406
- <span class="check"><input id="${r(this,Ar)}-all" type="checkbox" .checked=${l} .indeterminate=${e>0&&!l}
1407
- ?disabled=${!s} @change=${$=>this.selectPage($.target.checked)} />
1408
- <span class="box" aria-hidden="true">${e>0&&!l?n`<span class="dash"></span>`:l?n`<cm-icon name="check" size="12"></cm-icon>`:c}</span></span>
1409
- <label for="${r(this,Ar)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:p(t)})}</span></label>
1410
- ${this.hideSelectMenu?c:n`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
1411
- .items=${[{label:this.t("selectPage",{count:s}),value:"page",disabled:!s},...u?[{label:this.t("selectAll",{count:this.total,resource:d}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${r(this,Mn)}></cm-action-menu>`}
1589
+ <span class="check"><input id="${s(this,dr)}-all" type="checkbox" .checked=${l} .indeterminate=${e>0&&!l}
1590
+ ?disabled=${!i} @change=${$=>this.selectPage($.target.checked)} />
1591
+ <span class="box" aria-hidden="true">${e>0&&!l?o`<span class="dash"></span>`:l?o`<cm-icon name="check" size="12"></cm-icon>`:c}</span></span>
1592
+ <label for="${s(this,dr)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:p(t)})}</span></label>
1593
+ ${this.hideSelectMenu?c:o`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
1594
+ .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...m?[{label:this.t("selectAll",{count:this.total,resource:d}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${s(this,fo)}></cm-action-menu>`}
1412
1595
  </span>
1413
1596
  <span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
1414
- <span class="status" part="status" role="status">${v}</span>
1597
+ <span class="status" part="status" role="status">${x}</span>
1415
1598
  <span class="actions"><slot name="actions"></slot></span>
1416
1599
  </div>`:c}
1417
- <div class="header"><slot name="header" @slotchange=${$=>$.target.parentElement.classList.toggle("has",$.target.assignedElements().length>0)}></slot></div>
1600
+ <div class="header"><slot name="header" @slotchange=${s(this,bo)}></slot></div>
1418
1601
  <div class="body">
1419
1602
  <div class="list" part="list" role="list" aria-label=${this.label||d.replace(/^./,$=>$.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
1420
- <slot @slotchange=${()=>o(this,se,Pi).call(this)}></slot>
1603
+ <slot @slotchange=${()=>n(this,W,ms).call(this)}></slot>
1421
1604
  </div>
1422
- ${this.loading?n`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:d})}></span>`:c}
1605
+ ${this.loading?o`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:d})}></span>`:c}
1423
1606
  </div>
1424
1607
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
1425
- `}};Ar=new WeakMap,se=new WeakSet,Ic=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Pi=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},wn=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},Mn=new WeakMap,ji.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},_count:{state:!0},_rows:{state:!0}},ji.styles=[g,Nc,m`
1608
+ `}};dr=new WeakMap,hr=new WeakMap,W=new WeakSet,jd=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Fl=function(e=this.renderRoot?.querySelector('slot[name="header"]')){if(!e)return;let t=new Set;for(let i of e.assignedElements())i.localName==="cm-table-header"&&t.add(i),i.querySelectorAll("cm-table-header").forEach(l=>t.add(l));for(let i of s(this,hr))t.has(i)||i.removeAttribute("resource-rows");for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain");b(this,hr,t)},bo=new WeakMap,ms=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},po=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},fo=new WeakMap,bs.properties={selectable:{type:Boolean,reflect:!0},total:{type:Number},resourceName:{attribute:"resource-name",string:"resourceName"},resourceNamePlural:{attribute:"resource-name-plural"},loading:{type:Boolean,reflect:!0},allSelected:{type:Boolean,attribute:"all-selected",reflect:!0},hideSelectMenu:{type:Boolean,attribute:"hide-select-menu"},label:{},_count:{state:!0},_rows:{state:!0}},bs.styles=[v,Bd,u`
1426
1609
  :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1427
1610
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); padding: var(--cm-space-20) var(--cm-space-20) 0; }
1428
1611
  .select {
@@ -1460,20 +1643,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1460
1643
  .list { padding: 0 var(--cm-space-10); }
1461
1644
  .spinner { width: 30px; height: 30px; margin: -15px; border-width: 3px; }
1462
1645
  }
1463
- `];b("cm-resource-list",ji);var Cb=w("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",moved:"{label} moved to position {position} of {total}."}),Ab=w("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),zn,le,Hc,Oc,qc,Ko,Pc,Oe=class Oe extends y{constructor(){super();h(this,le);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;h(this,zn,this.attachInternals());r(this,zn).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,s=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===s)return!1;let l=new CustomEvent("cm-reorder",{detail:{item:this,from:s,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(l))return!1;let d=t[e];return d.parentElement.insertBefore(this,e>s?d.nextSibling:d),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return n`
1464
- <div class="row" part="row" @dragover=${o(this,le,qc)} @dragleave=${o(this,le,Ko)} @drop=${o(this,le,Pc)}>
1465
- ${this.sortable?n`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
1646
+ `];f("cm-resource-list",bs);var Qf=k("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",moved:"{label} moved to position {position} of {total}."}),eg=k("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),vo,be,Vd,Ud,Kd,jl,Wd,Ge=class Ge extends w{constructor(){super();h(this,be);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;h(this,vo,this.attachInternals());s(this,vo).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get siblings(){return[...this.parentElement.children].filter(e=>e.localName==="cm-nested-item")}moveTo(e){let t=this.siblings,i=t.indexOf(this);if(e=Math.max(0,Math.min(t.length-1,e)),e===i)return!1;let l=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(l))return!1;let d=t[e];return d.parentElement.insertBefore(this,e>i?d.nextSibling:d),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return o`
1647
+ <div class="row" part="row" @dragover=${n(this,be,Kd)} @dragleave=${n(this,be,jl)} @drop=${n(this,be,Wd)}>
1648
+ ${this.sortable?o`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
1466
1649
  aria-describedby="hint"
1467
- @keydown=${o(this,le,Hc)} @dragstart=${o(this,le,Oc)}
1468
- @dragend=${()=>{this.classList.remove("dragging"),Oe.dragged=null}}><cm-icon name="drag" size="18"></cm-icon></button>`:c}
1469
- ${this.sortable?n`<span class="sr" id="hint">${this.t("hint")}</span>`:c}
1650
+ @keydown=${n(this,be,Vd)} @dragstart=${n(this,be,Ud)}
1651
+ @dragend=${()=>{this.classList.remove("dragging"),Ge.dragged=null}}><cm-icon name="drag" size="18"></cm-icon></button>`:c}
1652
+ ${this.sortable?o`<span class="sr" id="hint">${this.t("hint")}</span>`:c}
1470
1653
  <span class="label" part="label">${this.label}</span>
1471
1654
  <span class="actions" part="actions"><slot name="actions"></slot></span>
1472
1655
  </div>
1473
1656
  <div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
1474
- <slot @slotchange=${e=>{let t=e.target.assignedElements().filter(s=>s.localName==="cm-nested-item");t.forEach(s=>s.sortable=this.sortable),this._hasChildren=t.length>0}}></slot>
1657
+ <slot @slotchange=${e=>{let t=e.target.assignedElements().filter(i=>i.localName==="cm-nested-item");t.forEach(i=>i.sortable=this.sortable),this._hasChildren=t.length>0}}></slot>
1475
1658
  </div>
1476
- `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};zn=new WeakMap,le=new WeakSet,Hc=function(e){let t=this.siblings.indexOf(this),s;if(e.key==="ArrowUp")s=t-1;else if(e.key==="ArrowDown")s=t+1;else if(e.key==="Home")s=0;else if(e.key==="End")s=this.siblings.length-1;else return;if(e.preventDefault(),this.moveTo(s)){let l=()=>this.renderRoot.querySelector(".handle")?.focus();l(),requestAnimationFrame(l)}},Oc=function(e){e.stopPropagation(),Oe.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},qc=function(e){let t=Oe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let s=this.renderRoot.querySelector(".row").getBoundingClientRect(),l=e.clientY>s.top+s.height/2;this.classList.toggle("drop-after",l),this.classList.toggle("drop-before",!l)},Ko=function(){this.classList.remove("drop-before","drop-after")},Pc=function(e){let t=Oe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let s=this.classList.contains("drop-after");o(this,le,Ko).call(this);let l=this.siblings,d=l.indexOf(t),p=l.indexOf(this)+(s?1:0);p>d&&(p-=1),t.moveTo(p)},Oe.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},Oe.styles=[g,m`
1659
+ `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};vo=new WeakMap,be=new WeakSet,Vd=function(e){let t=this.siblings.indexOf(this),i;if(e.key==="ArrowUp")i=t-1;else if(e.key==="ArrowDown")i=t+1;else if(e.key==="Home")i=0;else if(e.key==="End")i=this.siblings.length-1;else return;if(e.preventDefault(),this.moveTo(i)){let l=()=>this.renderRoot.querySelector(".handle")?.focus();l(),requestAnimationFrame(l)}},Ud=function(e){e.stopPropagation(),Ge.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},Kd=function(e){let t=Ge.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),l=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",l),this.classList.toggle("drop-before",!l)},jl=function(){this.classList.remove("drop-before","drop-after")},Wd=function(e){let t=Ge.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");n(this,be,jl).call(this);let l=this.siblings,d=l.indexOf(t),p=l.indexOf(this)+(i?1:0);p>d&&(p-=1),t.moveTo(p)},Ge.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},Ge.styles=[v,u`
1477
1660
  :host { display: block; }
1478
1661
  .row {
1479
1662
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1498,19 +1681,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1498
1681
  .actions { gap: var(--cm-space-10); }
1499
1682
  .children { margin-inline-start: var(--cm-space-20); }
1500
1683
  }
1501
- `],Oe.dragged=null;var _n=Oe;b("cm-nested-item",_n);var St,Lt,Bc,Wo,Fi=class extends y{constructor(){super(...arguments);h(this,Lt);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this._msg="";h(this,St,S("cm-nl"))}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}updated(e){e.has("sortable")&&o(this,Lt,Wo).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return n`
1684
+ `],Ge.dragged=null;var go=Ge;f("cm-nested-item",go);var Yt,Gt,Yd,Vl,fs=class extends w{constructor(){super(...arguments);h(this,Gt);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this._msg="";h(this,Yt,S("cm-nl"))}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}updated(e){e.has("sortable")&&n(this,Gt,Vl).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return o`
1502
1685
  <div class="bar" part="bar">
1503
- <div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,St)}-h">${this.heading}</div>
1686
+ <div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,Yt)}-h">${this.heading}</div>
1504
1687
  <span class="actions"><slot name="actions"></slot></span>
1505
- ${this.collapsible?n`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${r(this,St)}-rows"
1506
- aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${o(this,Lt,Bc)}>
1688
+ ${this.collapsible?o`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Yt)}-rows"
1689
+ aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${n(this,Gt,Yd)}>
1507
1690
  <cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:c}
1508
1691
  </div>
1509
- <div class="rows" id="${r(this,St)}-rows" role="list" aria-labelledby="${r(this,St)}-h" ?hidden=${!t}>
1510
- <slot @slotchange=${()=>o(this,Lt,Wo).call(this)}></slot>
1692
+ <div class="rows" id="${s(this,Yt)}-rows" role="list" aria-labelledby="${s(this,Yt)}-h" ?hidden=${!t}>
1693
+ <slot @slotchange=${()=>n(this,Gt,Vl).call(this)}></slot>
1511
1694
  </div>
1512
1695
  <span class="sr" role="status">${this._msg}</span>
1513
- `}};St=new WeakMap,Lt=new WeakSet,Bc=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Wo=function(){[...this.children].forEach(e=>{e.localName==="cm-nested-item"&&(e.sortable=this.sortable)})},Fi.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_msg:{state:!0}},Fi.styles=[g,m`
1696
+ `}};Yt=new WeakMap,Gt=new WeakSet,Yd=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},Vl=function(){[...this.children].forEach(e=>{e.localName==="cm-nested-item"&&(e.sortable=this.sortable)})},fs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},_msg:{state:!0}},fs.styles=[v,u`
1514
1697
  :host { display: block; }
1515
1698
  .bar {
1516
1699
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 90px; padding: 0 var(--cm-space-20);
@@ -1533,11 +1716,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1533
1716
  .rows { margin-inline-start: var(--cm-space-10); }
1534
1717
  .toggle { width: 30px; height: 30px; }
1535
1718
  }
1536
- `];b("cm-nested-list",Fi);var Ob=w("reportTile",{pinned:", pinned"}),Tt=class extends y{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=n`
1719
+ `];f("cm-nested-list",fs);var ng=k("reportTile",{pinned:", pinned"}),Xt=class extends w{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=o`
1537
1720
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="58"></cm-icon></slot></span>
1538
1721
  <span class="label">${this.label}</span>
1539
- ${this.pinned?n`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:c}
1540
- `;return this.href?n`<a class="tile" part="tile" href=${this.href}>${e}</a>`:n`<button class="tile" part="tile" type="button">${e}</button>`}};Tt.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Tt.shadowRootOptions={...k.shadowRootOptions,delegatesFocus:!0},Tt.styles=[g,m`
1722
+ ${this.pinned?o`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:c}
1723
+ `;return this.href?o`<a class="tile" part="tile" href=${this.href}>${e}</a>`:o`<button class="tile" part="tile" type="button">${e}</button>`}};Xt.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},Xt.shadowRootOptions={...E.shadowRootOptions,delegatesFocus:!0},Xt.styles=[v,u`
1541
1724
  :host { display: block; }
1542
1725
  .tile {
1543
1726
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-20);
@@ -1557,10 +1740,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1557
1740
  ::slotted([slot='icon']) { width: 38px; height: 38px; }
1558
1741
  .pin { top: 8px; inset-inline-end: 8px; }
1559
1742
  }
1560
- `];b("cm-report-tile",Tt);var Vi=class extends k{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return n`
1561
- ${this.heading?n`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:c}
1743
+ `];f("cm-report-tile",Xt);var gs=class extends E{constructor(){super(...arguments);this.heading="";this.headingLevel=2}firstUpdated(){for(let e of this.querySelectorAll(":scope > cm-report-tile"))e.hasAttribute("role")||e.setAttribute("role","listitem")}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2));return o`
1744
+ ${this.heading?o`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:c}
1562
1745
  <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":c}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
1563
- `}};Vi.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},Vi.styles=[g,m`
1746
+ `}};gs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},gs.styles=[v,u`
1564
1747
  :host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1565
1748
  .title { margin: 0 0 var(--cm-space-20); font-size: 16px; font-weight: 500; }
1566
1749
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-15); }
@@ -1570,44 +1753,74 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1570
1753
  .title { margin-bottom: var(--cm-space-10); font-size: 14px; }
1571
1754
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-10); }
1572
1755
  }
1573
- `];b("cm-report-tiles",Vi);var Ui=class extends k{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return jc(this)}};Ui.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},Ui.styles=m`:host { display: none !important; }`;b("cm-nav-item",Ui);function jc(a){let i=s=>a.getAttribute(s),e={label:i("label")||""};i("icon")&&(e.icon=i("icon")),i("href")&&(e.href=i("href")),i("value")&&(e.value=i("value")),a.hasAttribute("current")&&(e.current=!0),i("badge")&&(e.badge=i("badge")),a.hasAttribute("expanded")&&(e.expanded=!0),a.hasAttribute("primary")&&(e.primary=!0);let t=qe(a);return t.length&&(e.items=t),e}var qe=a=>[...a.children].filter(i=>i.localName==="cm-nav-item").map(jc),Yo=a=>a.value||a.href||a.label,Sn=a=>!!a.current||!!a.items?.some(Sn),nt=(a,i)=>{let e=new MutationObserver(i);return e.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},ot=(a,i)=>a.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:i,value:Yo(i),href:i.href??""}}));var Ln='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',F,Wi,lt,ct,_e,Yi,Gi,ce,Go,Tn,Cn,An,Dn,Xi,Fc,Ct,Xo,Jo,Pe,Ki=class extends k{constructor(){super(...arguments);h(this,ce);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";h(this,F);h(this,Wi);h(this,lt,[]);h(this,ct);h(this,_e);h(this,Yi,!1);h(this,Gi,!1);h(this,Tn,()=>{f(this,Yi,!0),clearTimeout(r(this,_e)),this.open||f(this,_e,setTimeout(()=>this.show(),this.delay))});h(this,Cn,()=>{f(this,Yi,!1),clearTimeout(r(this,_e)),r(this,Gi)||f(this,_e,setTimeout(()=>this.hide(),100))});h(this,An,()=>{f(this,Gi,!0),this.show()});h(this,Dn,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(f(this,Gi,!1),r(this,Yi)||this.hide())});h(this,Xi,e=>{e.key==="Escape"&&this.open&&this.hide()});h(this,Ct,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(o(this,ce,Jo).call(this),!t||!this.content||this.visualOnly)return;let s=t.updateComplete;t.localName.includes("-")&&s&&!t.shadowRoot?.querySelector(Ln)&&s.then(()=>{t.shadowRoot?.querySelector(Ln)&&r(this,Ct).call(this)}),r(this,F)||(f(this,F,document.createElement("span")),r(this,F).id=S("cm-tooltip"),r(this,F).hidden=!0,r(this,F).slot="description"),r(this,F).textContent=this.content,r(this,F).isConnected||this.append(r(this,F));let l=o(this,ce,Fc).call(this,t);if(f(this,Wi,l),l.getRootNode()===r(this,F).getRootNode()){let d=(l.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);d.includes(r(this,F).id)||l.setAttribute("aria-describedby",[...d,r(this,F).id].join(" "))}else"ariaDescribedByElements"in l?(o(this,ce,Xo).call(this,l),f(this,ct,new MutationObserver(()=>{l.getAttribute("aria-describedby")!==""&&o(this,ce,Xo).call(this,l)})),r(this,ct).observe(l,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,F).id)});h(this,Pe,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let l=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),d=e.getBoundingClientRect(),p=8,u=8,v=innerWidth,$=innerHeight,x=getComputedStyle(this).direction==="rtl",L=Ot=>Ot==="start"?x?"right":"left":Ot==="end"?x?"left":"right":Ot,M={top:l.top-p-d.height>=u,bottom:l.bottom+p+d.height<=$-u,left:l.left-p-d.width>=u,right:l.right+p+d.width<=v-u},C={top:"bottom",bottom:"top",left:"right",right:"left"},P=L(this.placement);!M[P]&&M[C[P]]&&(P=C[P]);let H,O;P==="top"||P==="bottom"?(H=l.left+l.width/2-d.width/2,O=P==="top"?l.top-p-d.height:l.bottom+p):(O=l.top+l.height/2-d.height/2,H=P==="left"?l.left-p-d.width:l.right+p),H=Math.min(Math.max(u,H),v-u-d.width),O=Math.min(Math.max(u,O),$-u-d.height),e.style.transform=`translate(${Math.round(H)}px, ${Math.round(O)}px)`;let Ht={top:"top",bottom:"bottom",left:x?"end":"start",right:x?"start":"end"};this._side=Ht[P]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,Tn)),this.addEventListener("pointerleave",r(this,Cn)),this.addEventListener("focusin",r(this,An)),this.addEventListener("focusout",r(this,Dn)),this.addEventListener("keydown",r(this,Xi)),this.hasUpdated&&r(this,Ct).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),o(this,ce,Jo).call(this),o(this,ce,Go).call(this),clearTimeout(r(this,_e))}show(){clearTimeout(r(this,_e)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,Xi),!0),addEventListener("scroll",r(this,Pe),!0),addEventListener("resize",r(this,Pe)),this.updateComplete.then(r(this,Pe)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,_e)),this.open&&(this.open=!1,o(this,ce,Go).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,Ct).call(this),this.content?this.open&&r(this,Pe).call(this):this.hide())}render(){return n`<slot @slotchange=${r(this,Ct)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1574
- data-side=${this._side}>${this.content}</div>`}};F=new WeakMap,Wi=new WeakMap,lt=new WeakMap,ct=new WeakMap,_e=new WeakMap,Yi=new WeakMap,Gi=new WeakMap,ce=new WeakSet,Go=function(){document.removeEventListener("keydown",r(this,Xi),!0),removeEventListener("scroll",r(this,Pe),!0),removeEventListener("resize",r(this,Pe))},Tn=new WeakMap,Cn=new WeakMap,An=new WeakMap,Dn=new WeakMap,Xi=new WeakMap,Fc=function(e){return e.matches(Ln)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Ln)??e},Ct=new WeakMap,Xo=function(e){f(this,lt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),s=r(this,lt).map(l=>t.getElementById(l)).filter(l=>!!l);e.ariaDescribedByElements=[...s,r(this,F)]},Jo=function(){let e=r(this,Wi);if(!(!e||!r(this,F))){if(r(this,ct))r(this,ct).disconnect(),f(this,ct,void 0),r(this,lt).length?e.setAttribute("aria-describedby",r(this,lt).join(" ")):e.removeAttribute("aria-describedby"),f(this,lt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(s=>s&&s!==r(this,F).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}f(this,Wi,void 0)}},Pe=new WeakMap,Ki.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},Ki.styles=[g,m`
1575
- :host { display: inline-block; position: relative; }
1576
- .tip {
1577
- position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
1578
- max-width: min(280px, calc(100vw - 16px)); width: max-content;
1579
- padding: 6px var(--cm-space-10); border-radius: var(--cm-radius-sm);
1580
- background: var(--cm-bg-panel-header); color: var(--cm-text-on-dark);
1581
- font-size: 12px; line-height: 16px; font-weight: 400; white-space: normal; overflow-wrap: anywhere;
1582
- box-shadow: var(--cm-shadow-100); pointer-events: auto;
1583
- opacity: 0; visibility: hidden; transition: opacity 120ms ease;
1756
+ `];f("cm-report-tiles",gs);var hg=k("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Gd=/^\s*-?\d+(\.\d+)?\s*$/,vs=class extends w{constructor(){super(...arguments);this.label="";this.value="";this.hint="";this.change="";this.trendSentiment="auto";this.href="";this.loading=!1;this._hasHint=!1;this.onHintSlot=e=>{this._hasHint=e.target.assignedNodes({flatten:!1}).some(t=>t.nodeType===1||t.textContent?.trim())}}connectedCallback(){super.connectedCallback(),this._hasHint=!!this.querySelector(':scope > [slot="hint"]')}figure(){let e=this.value;if(e===""||e===null||e===void 0)return"";let t=typeof e=="number"?e:Gd.test(String(e))?Number(e):NaN;return Number.isNaN(t)?String(e):this.formatNumber(t)}sentiment(){let e=this.trendSentiment;return e==="positive"||e==="negative"||e==="neutral"?e:this.trend==="up"?"positive":this.trend==="down"?"negative":"neutral"}renderChange(){let e=this.trend&&["up","down","flat"].includes(this.trend)?this.trend:void 0;if(!this.change&&!e)return c;if(!e)return o`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),l=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return o`<span class="change ${e} ${t}" part="change">
1757
+ <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${l}</span>
1758
+ </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?o`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),l=i!==c||e,d=o`
1759
+ <span class="label" id="label" part="label">${this.label}</span>
1760
+ <span class="value" id="value" part="value">${t}</span>
1761
+ <span class="foot ${l?"on":""}" id="foot" part="footer">
1762
+ ${i}
1763
+ <span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
1764
+ </span>
1765
+ `,p=o`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,m=this.loading?"true":c;return this.href?o`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${l?"foot":c} aria-busy=${m}>${d}</a>${p}`:o`<div class="tile" part="tile" aria-busy=${m}>${d}</div>${p}`}};vs.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&Gd.test(e)?Number(e):e??"",toAttribute:e=>e==null?e:String(e)}},hint:{},change:{},trend:{reflect:!0},trendSentiment:{attribute:"trend-sentiment",reflect:!0},href:{},loading:{type:Boolean,reflect:!0},_hasHint:{state:!0}},vs.styles=[v,u`
1766
+ :host { display: block; align-self: stretch; min-inline-size: 0; }
1767
+ .tile {
1768
+ display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
1769
+ padding: var(--cm-space-20); color: var(--cm-text-default); text-decoration: none; text-align: start;
1770
+ background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card); border-radius: var(--cm-radius-md);
1584
1771
  }
1585
- :host([open]) .tip { opacity: 1; visibility: visible; }
1586
- @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
1587
- @media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
1588
- `];b("cm-tooltip",Ki);var Zb=w("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),Dr,Nr,In,A,Zo,Nn,Qo,Vc,Uc,el,tl,Kc,il,sl,Rn,rl,Wc,Ji=class extends y{constructor(){super(...arguments);h(this,A);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;h(this,Dr,new Set);h(this,Nr);h(this,In,S("cm-sidenav"))}connectedCallback(){super.connectedCallback(),o(this,A,Zo).call(this),f(this,Nr,nt(this,()=>o(this,A,Zo).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Nr)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let s=o(this,A,Nn).call(this,e,t);r(this,Dr).has(s)||!e.items?.length||(r(this,Dr).add(s),(e.expanded||Sn(e))&&this._open.add(s))})}toggle(e,t){let s=this.navItems[e];if(!s?.items?.length)return;let l=o(this,A,Nn).call(this,s,e),d=t??!this._open.has(l);if(d===this._open.has(l))return;let p=new Set(this._open);d?p.add(l):p.delete(l),this._open=p,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:s,expanded:d}}))}render(){let e=this.collapsed;return n`
1589
- <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${o(this,A,Uc)}>
1772
+ a.tile { cursor: pointer; }
1773
+ a.tile:hover { border-color: var(--cm-border-strong); }
1774
+ a.tile:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1775
+ .label { font-size: var(--cm-type-body-md-size); font-weight: 500; line-height: var(--cm-type-body-md-line-height); overflow-wrap: anywhere; }
1776
+ .value {
1777
+ font-size: var(--cm-type-heading-lg-size); font-weight: var(--cm-type-heading-lg-weight); line-height: 1.25;
1778
+ font-variant-numeric: tabular-nums; overflow-wrap: anywhere; min-block-size: 1.25em;
1779
+ }
1780
+ .value cm-skeleton { inline-size: 6ch; max-inline-size: 100%; --cm-skeleton-height: 0.9em; margin-block: 0.175em; }
1781
+ .foot { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--cm-space-10); row-gap: 2px; }
1782
+ .foot:not(.on) { display: none; }
1783
+ .change {
1784
+ display: inline-flex; align-items: center; gap: 2px; font-size: var(--cm-type-body-sm-size); font-weight: 500;
1785
+ font-variant-numeric: tabular-nums; color: var(--cm-text-tertiary);
1786
+ }
1787
+ .change.positive { color: var(--cm-text-success); }
1788
+ .change.negative { color: var(--cm-text-critical); }
1789
+ .change cm-icon { align-self: center; }
1790
+ .change.down cm-icon { transform: rotate(90deg); }
1791
+ :host(:dir(rtl)) .change.down cm-icon { transform: rotate(-90deg); }
1792
+ .change.flat cm-icon { transform: rotate(180deg); }
1793
+ .hint { font-size: var(--cm-type-body-sm-size); line-height: var(--cm-type-body-sm-line-height); color: var(--cm-text-tertiary); overflow-wrap: anywhere; }
1794
+ .hint:not(.on) { display: none; }
1795
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
1796
+ @media (max-width: 640px) {
1797
+ .tile { padding: var(--cm-space-15); }
1798
+ .value { font-size: var(--cm-type-heading-lg-resp-size); }
1799
+ }
1800
+ @media (forced-colors: active) { .change { color: CanvasText; } }
1801
+ `];f("cm-metric",vs);var xs=class extends E{constructor(){super(...arguments);this.label="";this.icon="";this.href="";this.value="";this.current=!1;this.badge="";this.expanded=!1;this.primary=!1}render(){return null}toItem(){return Xd(this)}};xs.properties={label:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},value:{reflect:!0},current:{type:Boolean,reflect:!0},badge:{reflect:!0},expanded:{type:Boolean,reflect:!0},primary:{type:Boolean,reflect:!0}},xs.styles=u`:host { display: none !important; }`;f("cm-nav-item",xs);function Xd(r){let a=i=>r.getAttribute(i),e={label:a("label")||""};a("icon")&&(e.icon=a("icon")),a("href")&&(e.href=a("href")),a("value")&&(e.value=a("value")),r.hasAttribute("current")&&(e.current=!0),a("badge")&&(e.badge=a("badge")),r.hasAttribute("expanded")&&(e.expanded=!0),r.hasAttribute("primary")&&(e.primary=!0);let t=Xe(r);return t.length&&(e.items=t),e}var Xe=r=>[...r.children].filter(a=>a.localName==="cm-nav-item").map(Xd),Ul=r=>r.value||r.href||r.label,xo=r=>!!r.current||!!r.items?.some(xo),xt=(r,a)=>{let e=new MutationObserver(a);return e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},yt=(r,a)=>r.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:a,value:Ul(a),href:a.href??""}}));var wg=k("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),pr,mr,$o,C,Kl,yo,Wl,Jd,Zd,Yl,Gl,Qd,Xl,Jl,wo,Zl,eh,ys=class extends w{constructor(){super(...arguments);h(this,C);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;h(this,pr,new Set);h(this,mr);h(this,$o,S("cm-sidenav"))}connectedCallback(){super.connectedCallback(),n(this,C,Kl).call(this),b(this,mr,xt(this,()=>n(this,C,Kl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,mr)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=n(this,C,yo).call(this,e,t);s(this,pr).has(i)||!e.items?.length||(s(this,pr).add(i),(e.expanded||xo(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let l=n(this,C,yo).call(this,i,e),d=t??!this._open.has(l);if(d===this._open.has(l))return;let p=new Set(this._open);d?p.add(l):p.delete(l),this._open=p,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:d}}))}render(){let e=this.collapsed;return o`
1802
+ <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${n(this,C,Zd)}>
1590
1803
  <slot name="header"></slot>
1591
1804
  <ul part="list">
1592
- ${this.navItems.map((t,s)=>{if(!t.items?.length)return n`<li>${o(this,A,rl).call(this,t,"",{index:s})}</li>`;let l=!e&&this._open.has(o(this,A,Nn).call(this,t,s)),d=`${r(this,In)}-${s}`;return n`<li>
1593
- ${o(this,A,Rn).call(this,t,n`<button type="button" class="item parent ${Sn(t)?"has-current":""}" part="item" data-index=${s}
1594
- aria-expanded=${l?"true":"false"} aria-controls=${d} @click=${()=>e?o(this,A,Kc).call(this,s):this.toggle(s)}>
1595
- ${o(this,A,il).call(this,t)}${o(this,A,sl).call(this,t)}
1596
- ${e?c:n`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
1805
+ ${this.navItems.map((t,i)=>{if(!t.items?.length)return o`<li>${n(this,C,Zl).call(this,t,"",{index:i})}</li>`;let l=!e&&this._open.has(n(this,C,yo).call(this,t,i)),d=`${s(this,$o)}-${i}`;return o`<li>
1806
+ ${n(this,C,wo).call(this,t,o`<button type="button" class="item parent ${xo(t)?"has-current":""}" part="item" data-index=${i}
1807
+ aria-expanded=${l?"true":"false"} aria-controls=${d} @click=${()=>e?n(this,C,Qd).call(this,i):this.toggle(i)}>
1808
+ ${n(this,C,Xl).call(this,t)}${n(this,C,Jl).call(this,t)}
1809
+ ${e?c:o`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
1597
1810
  </button>`)}
1598
1811
  <ul class="sub" id=${d} ?hidden=${!l} aria-label=${t.label}>
1599
- ${o(this,A,el).call(this,t.items).map(([p,u])=>n`<li>${o(this,A,rl).call(this,{...p,icon:void 0},u?"deep":"",{parent:s})}</li>`)}
1812
+ ${n(this,C,Yl).call(this,t.items).map(([p,m])=>o`<li>${n(this,C,Zl).call(this,{...p,icon:void 0},m?"deep":"",{parent:i})}</li>`)}
1600
1813
  </ul>
1601
1814
  </li>`})}
1602
1815
  </ul>
1603
- ${o(this,A,Wc).call(this)}
1816
+ ${n(this,C,eh).call(this)}
1604
1817
  <slot name="footer"></slot>
1605
1818
  <slot hidden></slot>
1606
1819
  </nav>
1607
- `}};Dr=new WeakMap,Nr=new WeakMap,In=new WeakMap,A=new WeakSet,Zo=function(){this._slotted=qe(this)},Nn=function(e,t){return`${t}:${Yo(e)}`},Qo=function(e,t){ot(this,t)||e.preventDefault()},Vc=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Uc=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let s=o(this,A,Vc).call(this),l=s.indexOf(t),d=Number(t.dataset.index),p=de(e,this),u;if(e.key==="ArrowDown")u=s[(l+1)%s.length];else if(e.key==="ArrowUp")u=s[(l-1+s.length)%s.length];else if(e.key==="Home")u=s[0];else if(e.key==="End")u=s[s.length-1];else{if(this.collapsed&&(p==="ArrowRight"||p==="ArrowLeft"))return;if(p==="ArrowRight"&&t.classList.contains("parent")){this.toggle(d,!0),e.preventDefault();return}else if(p==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(d,!1):t.dataset.parent&&(u=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!u){e.preventDefault();return}}else return}e.preventDefault(),u?.focus()},el=function(e,t=0){return e.flatMap(s=>[[s,t],...o(this,A,el).call(this,s.items??[],t+1)])},tl=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},Kc=function(e){let t=this.navItems[e];o(this,A,tl).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},il=function(e){return e.icon?n`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?n`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:c},sl=function(e){if(!this.collapsed)return n`<span class="label">${e.label}</span>${e.badge?n`<span class="badge">${e.badge}</span>`:c}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return n`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?n`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:c}</span>`:c}`},Rn=function(e,t){return this.collapsed?n`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},rl=function(e,t,s={}){let l=n`${o(this,A,il).call(this,e)}${o(this,A,sl).call(this,e)}`;return o(this,A,Rn).call(this,e,e.href?n`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":c}
1608
- data-index=${s.index??c} data-parent=${s.parent??c} @click=${d=>o(this,A,Qo).call(this,d,e)}>${l}</a>`:n`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":c}
1609
- data-index=${s.index??c} data-parent=${s.parent??c} @click=${d=>o(this,A,Qo).call(this,d,e)}>${l}</button>`)},Wc=function(){if(!this.collapsible)return c;let e=this.t(this.collapsed?"expand":"collapse"),t=n`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?n`<span class="sr">${e}</span>`:n`<span class="label">${e}</span>`}`;return n`<div class="toggle-row">${o(this,A,Rn).call(this,{label:e},n`<button type="button" class="item toggle" part="collapse-button"
1610
- @click=${()=>o(this,A,tl).call(this,!this.collapsed)}>${t}</button>`)}</div>`},Ji.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},Ji.styles=[g,m`
1820
+ `}};pr=new WeakMap,mr=new WeakMap,$o=new WeakMap,C=new WeakSet,Kl=function(){this._slotted=Xe(this)},yo=function(e,t){return`${t}:${Ul(e)}`},Wl=function(e,t){yt(this,t)||e.preventDefault()},Jd=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Zd=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=n(this,C,Jd).call(this),l=i.indexOf(t),d=Number(t.dataset.index),p=fe(e,this),m;if(e.key==="ArrowDown")m=i[(l+1)%i.length];else if(e.key==="ArrowUp")m=i[(l-1+i.length)%i.length];else if(e.key==="Home")m=i[0];else if(e.key==="End")m=i[i.length-1];else{if(this.collapsed&&(p==="ArrowRight"||p==="ArrowLeft"))return;if(p==="ArrowRight"&&t.classList.contains("parent")){this.toggle(d,!0),e.preventDefault();return}else if(p==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(d,!1):t.dataset.parent&&(m=this.renderRoot.querySelector(`.parent[data-index="${t.dataset.parent}"]`)??void 0),!m){e.preventDefault();return}}else return}e.preventDefault(),m?.focus()},Yl=function(e,t=0){return e.flatMap(i=>[[i,t],...n(this,C,Yl).call(this,i.items??[],t+1)])},Gl=function(e){if(e===this.collapsed)return!0;let t=this.dispatchEvent(new CustomEvent("cm-collapse",{bubbles:!0,composed:!0,cancelable:!0,detail:{collapsed:e}}));return t&&(this.collapsed=e),t},Qd=function(e){let t=this.navItems[e];n(this,C,Gl).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},Xl=function(e){return e.icon?o`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?o`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:c},Jl=function(e){if(!this.collapsed)return o`<span class="label">${e.label}</span>${e.badge?o`<span class="badge">${e.badge}</span>`:c}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return o`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?o`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:c}</span>`:c}`},wo=function(e,t){return this.collapsed?o`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},Zl=function(e,t,i={}){let l=o`${n(this,C,Xl).call(this,e)}${n(this,C,Jl).call(this,e)}`;return n(this,C,wo).call(this,e,e.href?o`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":c}
1821
+ data-index=${i.index??c} data-parent=${i.parent??c} @click=${d=>n(this,C,Wl).call(this,d,e)}>${l}</a>`:o`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":c}
1822
+ data-index=${i.index??c} data-parent=${i.parent??c} @click=${d=>n(this,C,Wl).call(this,d,e)}>${l}</button>`)},eh=function(){if(!this.collapsible)return c;let e=this.t(this.collapsed?"expand":"collapse"),t=o`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?o`<span class="sr">${e}</span>`:o`<span class="label">${e}</span>`}`;return o`<div class="toggle-row">${n(this,C,wo).call(this,{label:e},o`<button type="button" class="item toggle" part="collapse-button"
1823
+ @click=${()=>n(this,C,Gl).call(this,!this.collapsed)}>${t}</button>`)}</div>`},ys.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},ys.styles=[v,u`
1611
1824
  :host { display: block; width: var(--cm-side-navigation-width, 250px); }
1612
1825
  nav {
1613
1826
  background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: 16px;
@@ -1647,15 +1860,15 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1647
1860
  background: var(--cm-nav-badge); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
1648
1861
  }
1649
1862
  .dot.count { inset-block-start: 3px; height: 16px; padding: 0 4px; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center; color: var(--cm-text-on-dark); }
1650
- `];b("cm-side-navigation",Ji);var al=0,Yc="";function ol(){al++===0&&(Yc=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function Rr(){al>0&&--al===0&&(document.documentElement.style.overflow=Yc)}function ll(){let a=document.activeElement;for(;a?.shadowRoot?.activeElement;)a=a.shadowRoot.activeElement;return a}var Zi,Be,Qi,Ir,nl,Hn,On,qn,Pn,Bn,B=class extends y{constructor(){super(...arguments);h(this,Ir);this.open=!1;this.label="";this.uid=S("cm-ovl");h(this,Zi,null);h(this,Be,!1);h(this,Qi,!1);h(this,Hn,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});h(this,On,e=>{e.preventDefault(),this.requestClose("escape")});h(this,qn,()=>{this.open&&!this.dialog?.open&&(this.open=!1,o(this,Ir,nl).call(this))});h(this,Pn,e=>{f(this,Qi,e.target===e.currentTarget)});h(this,Bn,e=>{if(e.target===e.currentTarget&&r(this,Qi)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}f(this,Qi,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(f(this,Zi,ll()),!this.isConnected)return;t.showModal(),r(this,Be)||(ol(),f(this,Be,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),o(this,Ir,nl).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),r(this,Be)&&(Rr(),f(this,Be,!1))}renderHeader(e=c){return n`<header class="head" part="header">
1863
+ `];f("cm-side-navigation",ys);var Ql=0,th="";function tc(){Ql++===0&&(th=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function ur(){Ql>0&&--Ql===0&&(document.documentElement.style.overflow=th)}function ic(){let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;return r}var ws,Je,$s,br,ec,ko,Eo,Mo,_o,zo,F=class extends w{constructor(){super(...arguments);h(this,br);this.open=!1;this.label="";this.uid=S("cm-ovl");h(this,ws,null);h(this,Je,!1);h(this,$s,!1);h(this,ko,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});h(this,Eo,e=>{e.preventDefault(),this.requestClose("escape")});h(this,Mo,()=>{this.open&&!this.dialog?.open&&(this.open=!1,n(this,br,ec).call(this))});h(this,_o,e=>{b(this,$s,e.target===e.currentTarget)});h(this,zo,e=>{if(e.target===e.currentTarget&&s(this,$s)){let t=e.currentTarget.getBoundingClientRect();(!(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>=t.top&&e.clientY<=t.bottom)||this.backdropFillsDialog)&&this.requestClose("backdrop")}b(this,$s,!1)});this.backdropFillsDialog=!1}show(){this.open=!0}close(){this.open=!1}requestClose(e="method"){let t=this.dispatchEvent(new CustomEvent("cm-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0}));return t&&(this.open=!1),t}get dialog(){return this.renderRoot?.querySelector("dialog")}updated(e){if(super.updated(e),!e.has("open"))return;let t=this.dialog;if(t)if(this.open&&!t.open){if(b(this,ws,ic()),!this.isConnected)return;t.showModal(),s(this,Je)||(tc(),b(this,Je,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),n(this,br,ec).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),s(this,Je)&&(ur(),b(this,Je,!1))}renderHeader(e=c){return o`<header class="head" part="header">
1651
1864
  <h2 id="${this.uid}-h">${this.heading}</h2>${e}
1652
1865
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
1653
1866
  <cm-icon name="close" size="18"></cm-icon></button>
1654
- </header>`}renderDialog(e,t=""){return n`<dialog part="dialog" class=${t}
1867
+ </header>`}renderDialog(e,t=""){return o`<dialog part="dialog" class=${t}
1655
1868
  aria-labelledby=${this.heading?`${this.uid}-h`:c}
1656
1869
  aria-label=${!this.heading&&this.label?this.label:c}
1657
- @keydown=${r(this,Hn)} @cancel=${r(this,On)} @close=${r(this,qn)}
1658
- @pointerdown=${r(this,Pn)} @click=${r(this,Bn)}>${e}</dialog>`}};Zi=new WeakMap,Be=new WeakMap,Qi=new WeakMap,Ir=new WeakSet,nl=function(){r(this,Be)&&(Rr(),f(this,Be,!1));let e=r(this,Zi);f(this,Zi,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},Hn=new WeakMap,On=new WeakMap,qn=new WeakMap,Pn=new WeakMap,Bn=new WeakMap,B.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},B.overlayStyles=[g,m`
1870
+ @keydown=${s(this,ko)} @cancel=${s(this,Eo)} @close=${s(this,Mo)}
1871
+ @pointerdown=${s(this,_o)} @click=${s(this,zo)}>${e}</dialog>`}};ws=new WeakMap,Je=new WeakMap,$s=new WeakMap,br=new WeakSet,ec=function(){s(this,Je)&&(ur(),b(this,Je,!1));let e=s(this,ws);b(this,ws,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},ko=new WeakMap,Eo=new WeakMap,Mo=new WeakMap,_o=new WeakMap,zo=new WeakMap,F.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},F.overlayStyles=[v,u`
1659
1872
  :host { display: contents; }
1660
1873
  dialog {
1661
1874
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: inherit;
@@ -1686,7 +1899,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1686
1899
  dialog[open] .panel { animation: cm-ovl-in 160ms ease-out; }
1687
1900
  }
1688
1901
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
1689
- `];function Gc(a){let i=a.trim().split(/[\s._@-]+/).filter(Boolean);if(!i.length)return"";let e=[...i[0]][0]??"",t=i.length>1&&!/[.@]/.test(a)?[...i[i.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var es=class extends k{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=Gc(this.name),t=this.decorative||!this.name?c:this.name,s=this.decorative||!this.name?"true":c,l,d="avatar";return this.src&&!this._failed?l=n`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?l=n`<span aria-hidden="true">${e}</span>`:(d+=" icon",l=n`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),n`<span class=${d} part="avatar" role=${t===c?c:"img"} aria-label=${t} aria-hidden=${s}>${l}</span>`}};es.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},es.styles=[g,m`
1902
+ `];function ih(r){let a=r.trim().split(/[\s._@-]+/).filter(Boolean);if(!a.length)return"";let e=[...a[0]][0]??"",t=a.length>1&&!/[.@]/.test(r)?[...a[a.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var ks=class extends E{constructor(){super(...arguments);this.name="";this.src="";this.size="medium";this.shape="round";this.decorative=!1;this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){let e=ih(this.name),t=this.decorative||!this.name?c:this.name,i=this.decorative||!this.name?"true":c,l,d="avatar";return this.src&&!this._failed?l=o`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?l=o`<span aria-hidden="true">${e}</span>`:(d+=" icon",l=o`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),o`<span class=${d} part="avatar" role=${t===c?c:"img"} aria-label=${t} aria-hidden=${i}>${l}</span>`}};ks.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},ks.styles=[v,u`
1690
1903
  :host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
1691
1904
  :host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
1692
1905
  :host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
@@ -1699,40 +1912,40 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1699
1912
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
1700
1913
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
1701
1914
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
1702
- `];b("cm-avatar",es);var uf=w("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),ss,je,rs,Y,Hr,cl,ts,is=class extends y{constructor(){super();h(this,Y);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;h(this,ss);h(this,je,!1);h(this,rs,null);this.addEventListener("cm-select",e=>{let t=o(this,Y,Hr).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){o(this,Y,Hr).call(this)?.focus();return}this._searchOpen||(f(this,rs,ll()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),f(this,ss,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,ss).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,ss)?.disconnect(),r(this,je)&&(Rr(),f(this,je,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,je)||(ol(),f(this,je,!0)),o(this,Y,Hr).call(this)?.focus(),o(this,Y,ts).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,je)&&(Rr(),f(this,je,!1));let s=r(this,rs)??this.renderRoot.querySelector(".search-btn");f(this,rs,null),s?.isConnected&&s.focus(),o(this,Y,ts).call(this,"cm-search-toggle",{open:!1})}}render(){return n`
1915
+ `];f("cm-avatar",ks);var Hg=k("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),_s,Ze,zs,Z,fr,sc,Es,Ms=class extends w{constructor(){super();h(this,Z);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;h(this,_s);h(this,Ze,!1);h(this,zs,null);this.addEventListener("cm-select",e=>{let t=n(this,Z,fr).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){n(this,Z,fr).call(this)?.focus();return}this._searchOpen||(b(this,zs,ic()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),b(this,_s,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),s(this,_s).observe(this)}disconnectedCallback(){super.disconnectedCallback(),s(this,_s)?.disconnect(),s(this,Ze)&&(ur(),b(this,Ze,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),s(this,Ze)||(tc(),b(this,Ze,!0)),n(this,Z,fr).call(this)?.focus(),n(this,Z,Es).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),s(this,Ze)&&(ur(),b(this,Ze,!1));let i=s(this,zs)??this.renderRoot.querySelector(".search-btn");b(this,zs,null),i?.isConnected&&i.focus(),n(this,Z,Es).call(this,"cm-search-toggle",{open:!1})}}render(){return o`
1703
1916
  <header part="bar" role="banner" aria-label=${this.label||c}>
1704
1917
  <div class="logo"><slot name="logo"></slot></div>
1705
- ${this.store?n`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
1706
- @click=${()=>o(this,Y,ts).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:c}
1707
- ${this._narrow?c:n`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${o(this,Y,cl)}></slot></div>`}
1918
+ ${this.store?o`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
1919
+ @click=${()=>n(this,Z,Es).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:c}
1920
+ ${this._narrow?c:o`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${n(this,Z,sc)}></slot></div>`}
1708
1921
  <span class="grow"></span>
1709
1922
  <div class="end">
1710
- ${this._narrow&&this._hasSearch?n`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
1923
+ ${this._narrow&&this._hasSearch?o`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
1711
1924
  aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:c}
1712
1925
  <div class="actions"><slot name="actions"></slot></div>
1713
- ${this.balance?n`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
1714
- @click=${()=>o(this,Y,ts).call(this,"cm-wallet")}>${this.balance}</button>`:c}
1715
- ${this.userName?n`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
1716
- @click=${()=>o(this,Y,ts).call(this,"cm-account")}><span class="name">${this.userName}</span>
1926
+ ${this.balance?o`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
1927
+ @click=${()=>n(this,Z,Es).call(this,"cm-wallet")}>${this.balance}</button>`:c}
1928
+ ${this.userName?o`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
1929
+ @click=${()=>n(this,Z,Es).call(this,"cm-account")}><span class="name">${this.userName}</span>
1717
1930
  <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:c}
1718
1931
  <slot name="end"></slot>
1719
1932
  </div>
1720
1933
  </header>
1721
- ${this._narrow?n`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
1934
+ ${this._narrow?o`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
1722
1935
  @keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
1723
1936
  @cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
1724
1937
  <div class="layer-bar">
1725
- <div class="layer-search"><slot name="search" @slotchange=${o(this,Y,cl)}></slot></div>
1938
+ <div class="layer-search"><slot name="search" @slotchange=${n(this,Z,sc)}></slot></div>
1726
1939
  <button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
1727
1940
  </div>
1728
1941
  </dialog>`:c}
1729
- `}};ss=new WeakMap,je=new WeakMap,rs=new WeakMap,Y=new WeakSet,Hr=function(){return this.querySelector(':scope > [slot="search"]')},cl=function(){this._hasSearch=!!o(this,Y,Hr).call(this)},ts=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},is.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},is.styles=[g,m`
1942
+ `}};_s=new WeakMap,Ze=new WeakMap,zs=new WeakMap,Z=new WeakSet,fr=function(){return this.querySelector(':scope > [slot="search"]')},sc=function(){this._hasSearch=!!n(this,Z,fr).call(this)},Es=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},Ms.properties={store:{},balance:{},userName:{attribute:"user-name"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},searchLabel:{attribute:"search-label",string:"search"},_narrow:{state:!0},_hasSearch:{state:!0},_searchOpen:{state:!0}},Ms.styles=[v,u`
1730
1943
  :host { display: block; background: var(--cm-bg-surface); container-type: inline-size; }
1731
1944
  header {
1732
1945
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
1733
1946
  }
1734
- .logo { display: flex; align-items: center; flex: none; }
1735
- ::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; }
1947
+ .logo { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
1948
+ ::slotted([slot='logo']) { display: block; max-height: 24px; width: auto; max-width: 100%; object-fit: contain; }
1736
1949
  .store, .pill, .user {
1737
1950
  display: inline-flex; align-items: center; gap: 8px; font: inherit; color: var(--cm-text-default);
1738
1951
  background: none; cursor: pointer;
@@ -1793,11 +2006,13 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1793
2006
  .user { padding: 2px; min-height: 0; border-color: transparent; }
1794
2007
  .user .name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1795
2008
  .avatar { --cm-avatar-size: 32px; }
2009
+ /* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
2010
+ .end { gap: 0; }
1796
2011
  }
1797
- `];b("cm-header-bar",is);var wf=w("bottomNavigation",{label:"Main"}),Or,At,dl,Xc,as=class extends y{constructor(){super(...arguments);h(this,At);this.items=[];this.fixed=!1;this._slotted=[];h(this,Or)}connectedCallback(){super.connectedCallback(),o(this,At,dl).call(this),f(this,Or,nt(this,()=>o(this,At,dl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Or)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return n`<nav part="nav" aria-label=${this.label||this.t("label")}>
1798
- <ul>${this.navItems.slice(0,5).map(e=>n`<li>${o(this,At,Xc).call(this,e)}</li>`)}</ul>
2012
+ `];f("cm-header-bar",Ms);var Vg=k("bottomNavigation",{label:"Main"}),gr,Jt,ac,sh,Ts=class extends w{constructor(){super(...arguments);h(this,Jt);this.items=[];this.fixed=!1;this._slotted=[];h(this,gr)}connectedCallback(){super.connectedCallback(),n(this,Jt,ac).call(this),b(this,gr,xt(this,()=>n(this,Jt,ac).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,gr)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return o`<nav part="nav" aria-label=${this.label||this.t("label")}>
2013
+ <ul>${this.navItems.slice(0,5).map(e=>o`<li>${n(this,Jt,sh).call(this,e)}</li>`)}</ul>
1799
2014
  <slot hidden></slot>
1800
- </nav>`}};Or=new WeakMap,At=new WeakSet,dl=function(){this._slotted=qe(this)},Xc=function(e){let t=`item ${e.primary?"primary":""}`,s=n`<span class="icon">${e.icon?n`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:c}</span><span class="label">${e.label}</span>`,l=d=>{ot(this,e)||d.preventDefault()};return e.href?n`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":c} @click=${l}>${s}</a>`:n`<button type="button" class=${t} part="item" aria-current=${e.current?"page":c} @click=${l}>${s}</button>`},as.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},as.styles=[g,m`
2015
+ </nav>`}};gr=new WeakMap,Jt=new WeakSet,ac=function(){this._slotted=Xe(this)},sh=function(e){let t=`item ${e.primary?"primary":""}`,i=o`<span class="icon">${e.icon?o`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:c}</span><span class="label">${e.label}</span>`,l=d=>{yt(this,e)||d.preventDefault()};return e.href?o`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":c} @click=${l}>${i}</a>`:o`<button type="button" class=${t} part="item" aria-current=${e.current?"page":c} @click=${l}>${i}</button>`},Ts.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},Ts.styles=[v,u`
1801
2016
  :host { display: block; }
1802
2017
  :host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
1803
2018
  nav {
@@ -1817,31 +2032,31 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1817
2032
  .icon { display: grid; place-items: center; width: 26px; height: 26px; }
1818
2033
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
1819
2034
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1820
- `];b("cm-bottom-navigation",as);var Tf=w("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),qr,Dt,J,hl,Jc,pl,ml,Zc,ns=class extends y{constructor(){super(...arguments);h(this,J);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;h(this,qr);h(this,Dt,S("cm-mmenu"))}connectedCallback(){super.connectedCallback(),o(this,J,hl).call(this),f(this,qr,nt(this,()=>o(this,J,hl).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,qr)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?n`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Dt)}-sub"
1821
- @keydown=${s=>{s.key==="Escape"&&(s.preventDefault(),this.back())}}>
2035
+ `];f("cm-bottom-navigation",Ts);var Zg=k("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),vr,Zt,ie,rc,ah,nc,oc,rh,Ss=class extends w{constructor(){super(...arguments);h(this,ie);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;h(this,vr);h(this,Zt,S("cm-mmenu"))}connectedCallback(){super.connectedCallback(),n(this,ie,rc).call(this),b(this,vr,xt(this,()=>n(this,ie,rc).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,vr)?.disconnect()}get sections(){return this.items.length?this.items:this._slotted}back(){if(!this._page)return;let[e,t]=this._page;this._page=null,this.updateComplete.then(()=>this.renderRoot.querySelector(`[data-row="${e}-${t}"]`)?.focus())}render(){let e=this.sections,t=this._page?e[this._page[0]]?.items?.[this._page[1]]:void 0;return t?o`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${s(this,Zt)}-sub"
2036
+ @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
1822
2037
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="18"></cm-icon>${t.label}</button>
1823
- <ul class="card" aria-label=${t.label}>${t.items.map(s=>n`<li>${o(this,J,ml).call(this,s,0,0,!0)}</li>`)}</ul>
2038
+ <ul class="card" aria-label=${t.label}>${t.items.map(i=>o`<li>${n(this,ie,oc).call(this,i,0,0,!0)}</li>`)}</ul>
1824
2039
  <slot hidden></slot>
1825
- </nav>`:n`<nav part="nav" aria-label=${this.label||this.t("label")}>
1826
- ${o(this,J,Zc).call(this)}
1827
- ${e.map((s,l)=>{let d=`${r(this,Dt)}-s${l}`;return n`<section aria-labelledby=${s.label?d:c}>
1828
- ${s.label?n`<h2 class="heading" id=${d}>${s.label}</h2>`:c}
1829
- <ul class="card">${(s.items??[]).map((p,u)=>n`<li>${o(this,J,ml).call(this,p,l,u)}</li>`)}</ul>
2040
+ </nav>`:o`<nav part="nav" aria-label=${this.label||this.t("label")}>
2041
+ ${n(this,ie,rh).call(this)}
2042
+ ${e.map((i,l)=>{let d=`${s(this,Zt)}-s${l}`;return o`<section aria-labelledby=${i.label?d:c}>
2043
+ ${i.label?o`<h2 class="heading" id=${d}>${i.label}</h2>`:c}
2044
+ <ul class="card">${(i.items??[]).map((p,m)=>o`<li>${n(this,ie,oc).call(this,p,l,m)}</li>`)}</ul>
1830
2045
  </section>`})}
1831
2046
  <slot hidden></slot>
1832
- </nav>`}};qr=new WeakMap,Dt=new WeakMap,J=new WeakSet,hl=function(){this._slotted=qe(this)},Jc=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},pl=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},ml=function(e,t,s,l=!1){let d=$=>{ot(this,e)||$.preventDefault()};if(e.primary&&!l)return n`<button type="button" class="row action" part="row" @click=${d}>${e.label}</button>`;let p=e.icon&&!l?n`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:c,u=e.badge?n`<span class="badge">${e.badge}</span>`:c;if(e.items?.length&&!l)return n`<button type="button" class="row" part="row" data-row="${t}-${s}"
1833
- @click=${()=>o(this,J,Jc).call(this,t,s)}>${p}<span class="label">${e.label}</span>${u}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let v=n`${p}<span class="label">${e.label}</span>${u}${e.href&&!l?n`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:c}`;return e.href?n`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":c} @click=${d}>${v}</a>`:n`<button type="button" class="row" part="row" aria-current=${e.current?"page":c} @click=${d}>${v}</button>`},Zc=function(){if(!this.store&&!this.userName)return c;let e=this.userName.trim().charAt(0).toUpperCase();return n`<section aria-labelledby="${r(this,Dt)}-profile">
1834
- <h2 class="heading" id="${r(this,Dt)}-profile">${this.t("profile")}</h2>
2047
+ </nav>`}};vr=new WeakMap,Zt=new WeakMap,ie=new WeakSet,rc=function(){this._slotted=Xe(this)},ah=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},nc=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},oc=function(e,t,i,l=!1){let d=$=>{yt(this,e)||$.preventDefault()};if(e.primary&&!l)return o`<button type="button" class="row action" part="row" @click=${d}>${e.label}</button>`;let p=e.icon&&!l?o`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:c,m=e.badge?o`<span class="badge">${e.badge}</span>`:c;if(e.items?.length&&!l)return o`<button type="button" class="row" part="row" data-row="${t}-${i}"
2048
+ @click=${()=>n(this,ie,ah).call(this,t,i)}>${p}<span class="label">${e.label}</span>${m}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let x=o`${p}<span class="label">${e.label}</span>${m}${e.href&&!l?o`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:c}`;return e.href?o`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":c} @click=${d}>${x}</a>`:o`<button type="button" class="row" part="row" aria-current=${e.current?"page":c} @click=${d}>${x}</button>`},rh=function(){if(!this.store&&!this.userName)return c;let e=this.userName.trim().charAt(0).toUpperCase();return o`<section aria-labelledby="${s(this,Zt)}-profile">
2049
+ <h2 class="heading" id="${s(this,Zt)}-profile">${this.t("profile")}</h2>
1835
2050
  <ul class="card">
1836
- ${this.store?n`<li><button type="button" class="row" part="row" @click=${()=>o(this,J,pl).call(this,"cm-store-switch")}>
2051
+ ${this.store?o`<li><button type="button" class="row" part="row" @click=${()=>n(this,ie,nc).call(this,"cm-store-switch")}>
1837
2052
  <span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
1838
2053
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
1839
- ${this.userName?n`<li><button type="button" class="row" part="row" @click=${()=>o(this,J,pl).call(this,"cm-account")}>
1840
- <span class="avatar">${this.avatarSrc?n`<img src=${this.avatarSrc} alt="">`:n`<span aria-hidden="true">${e}</span>`}</span>
1841
- <span class="stack"><span>${this.userName}</span>${this.userEmail?n`<span class="email">${this.userEmail}</span>`:c}</span>
2054
+ ${this.userName?o`<li><button type="button" class="row" part="row" @click=${()=>n(this,ie,nc).call(this,"cm-account")}>
2055
+ <span class="avatar">${this.avatarSrc?o`<img src=${this.avatarSrc} alt="">`:o`<span aria-hidden="true">${e}</span>`}</span>
2056
+ <span class="stack"><span>${this.userName}</span>${this.userEmail?o`<span class="email">${this.userEmail}</span>`:c}</span>
1842
2057
  <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
1843
2058
  </ul>
1844
- </section>`},ns.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},ns.styles=[g,m`
2059
+ </section>`},Ss.properties={items:{type:Array},store:{},userName:{attribute:"user-name"},userEmail:{attribute:"user-email"},avatarSrc:{attribute:"avatar-src"},label:{string:"label"},_slotted:{state:!0},_page:{state:!0}},Ss.styles=[v,u`
1845
2060
  :host { display: block; background: var(--cm-bg-page); }
1846
2061
  nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
1847
2062
  .heading {
@@ -1878,11 +2093,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1878
2093
  }
1879
2094
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1880
2095
  .sub .row { font-size: 16px; min-height: 48px; }
1881
- `];b("cm-mobile-menu",ns);var Hf=w("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),jn,Qc,os=class extends y{constructor(){super(...arguments);h(this,jn);this.icon="send";this.dismissible=!1}render(){return n`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
1882
- <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?n`<cm-icon name=${this.icon} size="20"></cm-icon>`:c}</slot></span>
2096
+ `];f("cm-mobile-menu",Ss);var rv=k("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),To,nh,Ls=class extends w{constructor(){super(...arguments);h(this,To);this.icon="send";this.dismissible=!1}render(){return o`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
2097
+ <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?o`<cm-icon name=${this.icon} size="20"></cm-icon>`:c}</slot></span>
1883
2098
  <span class="text"><slot></slot></span>
1884
- ${this.dismissible?n`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${o(this,jn,Qc)}><cm-icon name="close" size="18"></cm-icon></button>`:c}
1885
- </div>`}};jn=new WeakSet,Qc=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},os.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},os.styles=[g,m`
2099
+ ${this.dismissible?o`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${n(this,To,nh)}><cm-icon name="close" size="18"></cm-icon></button>`:c}
2100
+ </div>`}};To=new WeakSet,nh=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},Ls.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},Ls.styles=[v,u`
1886
2101
  :host { display: block; }
1887
2102
  .bar {
1888
2103
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
@@ -1904,11 +2119,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1904
2119
  @media (max-width: 640px) {
1905
2120
  .bar { font-size: 14px; min-height: 44px; justify-content: flex-start; text-align: start; }
1906
2121
  }
1907
- `];b("cm-flash-offer-bar",os);var Uf=w("linkTabs",{label:"Sections"}),Pr,Br,ul,ls=class extends y{constructor(){super(...arguments);h(this,Br);this.items=[];this._slotted=[];h(this,Pr)}connectedCallback(){super.connectedCallback(),o(this,Br,ul).call(this),f(this,Pr,nt(this,()=>o(this,Br,ul).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,Pr)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return n`<nav part="nav" aria-label=${this.label||this.t("label")}>
1908
- <ul part="tabs">${this.tabs.map(e=>n`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":c}
1909
- @click=${t=>{ot(this,e)||t.preventDefault()}}>${e.label}${e.badge?n`<span class="badge">(${e.badge})</span>`:c}</a></li>`)}</ul>
2122
+ `];f("cm-flash-offer-bar",Ls);var mv=k("linkTabs",{label:"Sections"}),xr,yr,lc,Cs=class extends w{constructor(){super(...arguments);h(this,yr);this.items=[];this._slotted=[];h(this,xr)}connectedCallback(){super.connectedCallback(),n(this,yr,lc).call(this),b(this,xr,xt(this,()=>n(this,yr,lc).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,xr)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return o`<nav part="nav" aria-label=${this.label||this.t("label")}>
2123
+ <ul part="tabs">${this.tabs.map(e=>o`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":c}
2124
+ @click=${t=>{yt(this,e)||t.preventDefault()}}>${e.label}${e.badge?o`<span class="badge">(${e.badge})</span>`:c}</a></li>`)}</ul>
1910
2125
  <slot hidden></slot>
1911
- </nav>`}};Pr=new WeakMap,Br=new WeakSet,ul=function(){this._slotted=qe(this)},ls.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},ls.styles=[g,m`
2126
+ </nav>`}};xr=new WeakMap,yr=new WeakSet,lc=function(){this._slotted=Xe(this)},Cs.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},Cs.styles=[v,u`
1912
2127
  :host { display: block; }
1913
2128
  ul {
1914
2129
  display: flex; gap: 28px; margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto; scrollbar-width: thin;
@@ -1926,19 +2141,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1926
2141
  a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
1927
2142
  .badge { font-size: 12px; color: var(--cm-text-tertiary); }
1928
2143
  @media (max-width: 640px) { ul { gap: 18px; } a { font-size: 14px; } }
1929
- `];b("cm-link-tabs",ls);var Zf=w("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),cs=class extends y{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),s=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",l=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return n`<article part="card" aria-labelledby="name">
2144
+ `];f("cm-link-tabs",Cs);var yv=k("appCard",{developer:"By {developer}",rating:"Rated {rating} out of 5",reviews:{one:"{count} Review",other:"{count} Reviews"},offer:"Offer: ",details:"View Details",detailsLabel:"View details of {name}"}),As=class extends w{constructor(){super(...arguments);this.name="";this.developer="";this.reviewsHref="";this.pricing="";this.offer="";this.href="";this.headingLevel=3}render(){let e=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),t=typeof this.rating=="number"&&!Number.isNaN(this.rating),i=typeof this.reviews=="number"?this.t("reviews",{count:this.reviews}):"",l=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return o`<article part="card" aria-labelledby="name">
1930
2145
  <div class="logo" part="logo"><slot name="logo"></slot></div>
1931
2146
  <div class="status"><slot name="status"></slot></div>
1932
2147
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
1933
- ${this.developer?n`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:c}
1934
- ${t?n`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
2148
+ ${this.developer?o`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:c}
2149
+ ${t?o`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
1935
2150
  <span aria-hidden="true">${l}</span><span class="sr">${this.t("rating",{rating:l})}</span>
1936
- ${s?this.reviewsHref?n`<a href=${this.reviewsHref}>${s}</a>`:n`<span>${s}</span>`:c}</p>`:c}
1937
- ${this.pricing?n`<p class="pricing">${this.pricing}</p>`:c}
1938
- ${this.offer?n`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:c}
1939
- <div class="actions"><slot name="actions"></slot>${this.href?n`<a class="details" part="details" href=${this.href}
2151
+ ${i?this.reviewsHref?o`<a href=${this.reviewsHref}>${i}</a>`:o`<span>${i}</span>`:c}</p>`:c}
2152
+ ${this.pricing?o`<p class="pricing">${this.pricing}</p>`:c}
2153
+ ${this.offer?o`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:c}
2154
+ <div class="actions"><slot name="actions"></slot>${this.href?o`<a class="details" part="details" href=${this.href}
1940
2155
  aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:c}</div>
1941
- </article>`}};cs.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},cs.styles=[g,m`
2156
+ </article>`}};As.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},As.styles=[v,u`
1942
2157
  :host { display: block; container-type: inline-size; }
1943
2158
  article {
1944
2159
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: var(--cm-space-20);
@@ -1974,20 +2189,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1974
2189
  .actions { gap: var(--cm-space-10); }
1975
2190
  .details { margin-inline-start: auto; }
1976
2191
  }
1977
- `];b("cm-app-card",cs);var Fn,ed,ds=class extends B{constructor(){super(...arguments);h(this,Fn);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(n`<div class="panel" part="panel" tabindex="-1">
2192
+ `];f("cm-app-card",As);var So,oh,Ds=class extends F{constructor(){super(...arguments);h(this,So);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
1978
2193
  ${this.renderHeader()}
1979
2194
  <div class="body" part="body"><slot></slot></div>
1980
- <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${o(this,Fn,ed)}></slot></footer>
1981
- </div>`)}};Fn=new WeakSet,ed=function(e){this._hasFooter=e.target.assignedElements().length>0},ds.properties={...B.properties,size:{reflect:!0},_hasFooter:{state:!0}},ds.styles=[...B.overlayStyles,m`
2195
+ <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${n(this,So,oh)}></slot></footer>
2196
+ </div>`)}};So=new WeakSet,oh=function(e){this._hasFooter=e.target.assignedElements().length>0},Ds.properties={...F.properties,size:{reflect:!0},_hasFooter:{state:!0}},Ds.styles=[...F.overlayStyles,u`
1982
2197
  dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
1983
2198
  :host([size='small']) dialog { --cm-modal-width: 400px; }
1984
2199
  :host([size='large']) dialog { --cm-modal-width: 900px; }
1985
2200
  .panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-sm); box-shadow: var(--cm-shadow-100); }
1986
- `];b("cm-modal",ds);var Vn,td,ze=class extends B{constructor(){super(...arguments);h(this,Vn);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return n`<slot></slot>`}renderFooter(){return n`<slot name="footer" @slotchange=${o(this,Vn,td)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(n`<div class="panel" part="panel" tabindex="-1">
2201
+ `];f("cm-modal",Ds);var Lo,lh,De=class extends F{constructor(){super(...arguments);h(this,Lo);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return o`<slot></slot>`}renderFooter(){return o`<slot name="footer" @slotchange=${n(this,Lo,lh)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
1987
2202
  ${this.renderHeader()}
1988
2203
  <div class="body" part="body">${this.renderBody()}</div>
1989
2204
  <footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
1990
- </div>`)}};Vn=new WeakSet,td=function(e){this._hasFooter=e.target.assignedElements().length>0},ze.properties={...B.properties,size:{reflect:!0},_hasFooter:{state:!0}},ze.styles=[...B.overlayStyles,m`
2205
+ </div>`)}};Lo=new WeakSet,lh=function(e){this._hasFooter=e.target.assignedElements().length>0},De.properties={...F.properties,size:{reflect:!0},_hasFooter:{state:!0}},De.styles=[...F.overlayStyles,u`
1991
2206
  dialog {
1992
2207
  position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
1993
2208
  }
@@ -2004,25 +2219,25 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2004
2219
  dialog { inset: 16px; width: auto; height: auto; }
2005
2220
  .panel { border-radius: var(--cm-radius-sm); }
2006
2221
  }
2007
- `];b("cm-side-panel",ze);var ug=w("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),ps,Un,hs=class extends ze{constructor(){super(...arguments);this.search=!1;this.query="";h(this,ps,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});h(this,Un,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(l,d)=>{if(d==="")return;let p=e[l];e[l]=p===void 0?d:Array.isArray(p)?[...p,d]:[p,d]},s=this.form;if(s){for(let[l,d]of new FormData(s))typeof d=="string"&&t(l,d);return e}return this.querySelectorAll("[name]").forEach(l=>{let d=l.getAttribute("name");"checked"in l&&(l.type==="checkbox"||l.type==="radio"||l.localName.match(/^cm-(checkbox|radio|toggle)$/))?l.checked&&t(d,l.value||"on"):typeof l.value=="string"&&t(d,l.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return n`${this.search?n`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
2222
+ `];f("cm-side-panel",De);var Hv=k("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),Is,Co,Ns=class extends De{constructor(){super(...arguments);this.search=!1;this.query="";h(this,Is,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});h(this,Co,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(l,d)=>{if(d==="")return;let p=e[l];e[l]=p===void 0?d:Array.isArray(p)?[...p,d]:[p,d]},i=this.form;if(i){for(let[l,d]of new FormData(i))typeof d=="string"&&t(l,d);return e}return this.querySelectorAll("[name]").forEach(l=>{let d=l.getAttribute("name");"checked"in l&&(l.type==="checkbox"||l.type==="radio"||l.localName.match(/^cm-(checkbox|radio|toggle)$/))?l.checked&&t(d,l.value||"on"):typeof l.value=="string"&&t(d,l.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return o`${this.search?o`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
2008
2223
  placeholder=${this.searchPlaceholder}
2009
2224
  @input=${e=>{this.query=e.target.value}}
2010
- @cm-search=${e=>{e.stopPropagation(),r(this,ps).call(this)}}></cm-search>`:c}
2011
- <slot @submit=${e=>{e.preventDefault(),r(this,ps).call(this)}}></slot>`}renderFooter(){return n`<cm-button part="reset" @click=${r(this,Un)}>${this.resetLabel}</cm-button>
2012
- <cm-button part="apply" variant="primary" @click=${r(this,ps)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};ps=new WeakMap,Un=new WeakMap,hs.properties={...ze.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},hs.styles=[...ze.styles,m`
2225
+ @cm-search=${e=>{e.stopPropagation(),s(this,Is).call(this)}}></cm-search>`:c}
2226
+ <slot @submit=${e=>{e.preventDefault(),s(this,Is).call(this)}}></slot>`}renderFooter(){return o`<cm-button part="reset" @click=${s(this,Co)}>${this.resetLabel}</cm-button>
2227
+ <cm-button part="apply" variant="primary" @click=${s(this,Is)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};Is=new WeakMap,Co=new WeakMap,Ns.properties={...De.properties,search:{type:Boolean},query:{},heading:{string:"heading"},searchLabel:{attribute:"search-label",string:"searchLabel"},searchPlaceholder:{attribute:"search-placeholder",string:"searchPlaceholder"},applyLabel:{attribute:"apply-label",string:"apply"},resetLabel:{attribute:"reset-label",string:"reset"}},Ns.styles=[...De.styles,u`
2013
2228
  .search { display: block; margin-bottom: var(--cm-space-20); }
2014
2229
  .foot { justify-content: center; }
2015
2230
  ::slotted(form) { display: grid; gap: var(--cm-space-15); }
2016
- `];b("cm-filter-panel",hs);var jr,Nt,bl,id,ms=class extends B{constructor(){super(...arguments);h(this,Nt);this.heading="";this.items=[];this._slotted=[];h(this,jr)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=_r(this),f(this,jr,fn(this,()=>{this._slotted=_r(this)}))}disconnectedCallback(){super.disconnectedCallback(),r(this,jr)?.disconnect()}render(){let e=this.sheetItems.filter(s=>!s.divider),t=e.some(s=>s.icon);return this.renderDialog(n`<div class="panel" part="panel" tabindex="-1">
2231
+ `];f("cm-filter-panel",Ns);var wr,Qt,cc,ch,Hs=class extends F{constructor(){super(...arguments);h(this,Qt);this.heading="";this.items=[];this._slotted=[];h(this,wr)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=ar(this),b(this,wr,ro(this,()=>{this._slotted=ar(this)}))}disconnectedCallback(){super.disconnectedCallback(),s(this,wr)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider),t=e.some(i=>i.icon);return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
2017
2232
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
2018
2233
  <cm-icon name="close" size="16"></cm-icon></button>
2019
- ${this.heading?n`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:c}
2234
+ ${this.heading?o`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:c}
2020
2235
  <div class="content">
2021
- ${e.length?n`<ul class=${t?"icons":""} part="list">${e.map(s=>n`<li>${o(this,Nt,id).call(this,s)}</li>`)}</ul>`:c}
2236
+ ${e.length?o`<ul class=${t?"icons":""} part="list">${e.map(i=>o`<li>${n(this,Qt,ch).call(this,i)}</li>`)}</ul>`:c}
2022
2237
  <slot ?hidden=${this._slotted.length>0}></slot>
2023
2238
  </div>
2024
- </div>`)}};jr=new WeakMap,Nt=new WeakSet,bl=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},id=function(e){let t=`row${e.critical?" critical":""}`,s=n`${e.icon?n`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:c}<span class="label">${e.label}</span>${e.icon?n`<cm-icon name="chevron-right" size="16"></cm-icon>`:c}`;return e.href&&!e.disabled?n`<a class=${t} part="row" href=${e.href} @click=${l=>o(this,Nt,bl).call(this,l,e)}>${s}</a>`:n`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":c}
2025
- @click=${l=>o(this,Nt,bl).call(this,l,e)}>${s}</button>`},ms.properties={...B.properties,items:{type:Array},_slotted:{state:!0}},ms.styles=[...B.overlayStyles,m`
2239
+ </div>`)}};wr=new WeakMap,Qt=new WeakSet,cc=function(e,t){if(t.disabled){e.preventDefault();return}if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},ch=function(e){let t=`row${e.critical?" critical":""}`,i=o`${e.icon?o`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:c}<span class="label">${e.label}</span>${e.icon?o`<cm-icon name="chevron-right" size="16"></cm-icon>`:c}`;return e.href&&!e.disabled?o`<a class=${t} part="row" href=${e.href} @click=${l=>n(this,Qt,cc).call(this,l,e)}>${i}</a>`:o`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":c}
2240
+ @click=${l=>n(this,Qt,cc).call(this,l,e)}>${i}</button>`},Hs.properties={...F.properties,items:{type:Array},_slotted:{state:!0}},Hs.styles=[...F.overlayStyles,u`
2026
2241
  dialog {
2027
2242
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: 22px;
2028
2243
  }
@@ -2056,17 +2271,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2056
2271
  }
2057
2272
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
2058
2273
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
2059
- `];b("cm-bottom-sheet",ms);var zg=w("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),Wd={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},us=class extends k{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};us.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},us.styles=m`:host { display: none; }`;b("cm-notification-item",us);var fs,re,fl,gl,sd,rd,ad,bs=class extends B{constructor(){super(...arguments);h(this,re);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;h(this,fs)}connectedCallback(){super.connectedCallback(),o(this,re,fl).call(this),f(this,fs,new MutationObserver(()=>o(this,re,fl).call(this))),r(this,fs).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,fs)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(l=>l.unread)?n`<button type="button" class="mark" part="mark-all-read" @click=${o(this,re,rd)}>${this.markAllLabel}</button>`:c,s=this.loading?n`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>n`<li>
2060
- <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?n`<ul class="list" part="list">${e.map(l=>n`<li>${o(this,re,sd).call(this,l)}</li>`)}</ul>`:n`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(n`<div class="panel" part="panel" tabindex="-1">
2274
+ `];f("cm-bottom-sheet",Hs);var Gv=k("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),sp={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},Rs=class extends E{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};Rs.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},Rs.styles=u`:host { display: none; }`;f("cm-notification-item",Rs);var qs,de,dc,hc,dh,hh,ph,Os=class extends F{constructor(){super(...arguments);h(this,de);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;h(this,qs)}connectedCallback(){super.connectedCallback(),n(this,de,dc).call(this),b(this,qs,new MutationObserver(()=>n(this,de,dc).call(this))),s(this,qs).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,qs)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(l=>l.unread)?o`<button type="button" class="mark" part="mark-all-read" @click=${n(this,de,hh)}>${this.markAllLabel}</button>`:c,i=this.loading?o`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>o`<li>
2275
+ <cm-skeleton class="sk-ic" variant="block" style="--cm-skeleton-height:22px"></cm-skeleton><cm-skeleton class="sk-text"></cm-skeleton></li>`)}</ul>`:e.length?o`<ul class="list" part="list">${e.map(l=>o`<li>${n(this,de,dh).call(this,l)}</li>`)}</ul>`:o`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(o`<div class="panel" part="panel" tabindex="-1">
2061
2276
  ${this.renderHeader(t)}
2062
- ${s}
2277
+ ${i}
2063
2278
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
2064
- ${this.moreHref?n`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:c}
2065
- <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${o(this,re,ad)}></slot></div>
2279
+ ${this.moreHref?o`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:c}
2280
+ <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${n(this,de,ph)}></slot></div>
2066
2281
  <slot hidden></slot>
2067
- </div>`)}};fs=new WeakMap,re=new WeakSet,fl=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=s=>e.getAttribute(s)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},gl=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},sd=function(e){let t=e.tone??"information",s=e.description?n`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,l=n`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||Wd[t]||"bell"} size="14"></cm-icon></span>
2068
- <span class="label">${e.unread?n`<span class="vh">${this.t("unread")}</span>`:c}${s}</span>
2069
- ${e.time?n`<time>${e.time}</time>`:c}`,d=`row${e.unread?" unread":""}`;return e.href?n`<a class=${d} part="row" href=${e.href} @click=${p=>o(this,re,gl).call(this,p,e)}>${l}</a>`:n`<button type="button" class=${d} part="row" @click=${p=>o(this,re,gl).call(this,p,e)}>${l}</button>`},rd=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(s=>setTimeout(s)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},ad=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},bs.properties={...B.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},bs.styles=[...B.overlayStyles,m`
2282
+ </div>`)}};qs=new WeakMap,de=new WeakSet,dc=function(){this._slotted=Array.from(this.querySelectorAll(":scope > cm-notification-item")).map(e=>{let t=i=>e.getAttribute(i)||void 0;return{label:(e.textContent??"").trim(),time:t("time"),tone:t("tone")??"information",href:t("href"),unread:e.hasAttribute("unread")||void 0,value:t("value"),description:t("description"),icon:t("icon")}})},hc=function(e,t){if(!this.dispatchEvent(new CustomEvent("cm-select",{detail:{value:t.value??t.href??t.label,item:t},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}this.requestClose("action")},dh=function(e){let t=e.tone??"information",i=e.description?o`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,l=o`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||sp[t]||"bell"} size="14"></cm-icon></span>
2283
+ <span class="label">${e.unread?o`<span class="vh">${this.t("unread")}</span>`:c}${i}</span>
2284
+ ${e.time?o`<time>${e.time}</time>`:c}`,d=`row${e.unread?" unread":""}`;return e.href?o`<a class=${d} part="row" href=${e.href} @click=${p=>n(this,de,hc).call(this,p,e)}>${l}</a>`:o`<button type="button" class=${d} part="row" @click=${p=>n(this,de,hc).call(this,p,e)}>${l}</button>`},hh=async function(e){let t=e.currentTarget;this.dispatchEvent(new CustomEvent("cm-mark-all-read",{bubbles:!0,composed:!0})),await new Promise(i=>setTimeout(i)),await this.updateComplete,!t.isConnected&&this.open&&this.renderRoot.querySelector(".panel")?.focus()},ph=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},Os.properties={...F.properties,items:{type:Array},moreHref:{attribute:"more-href"},heading:{string:"heading"},moreLabel:{attribute:"more-label",string:"more"},emptyText:{attribute:"empty-text",string:"empty"},markAllRead:{type:Boolean,attribute:"mark-all-read"},markAllLabel:{attribute:"mark-all-label",string:"markAllRead"},loading:{type:Boolean,reflect:!0},_slotted:{state:!0},_footer:{state:!0}},Os.styles=[...F.overlayStyles,u`
2070
2285
  dialog {
2071
2286
  position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
2072
2287
  width: min(380px, calc(100vw - 32px));
@@ -2115,14 +2330,14 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2115
2330
  @media (max-width: 599px) {
2116
2331
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
2117
2332
  }
2118
- `];b("cm-notification-panel",bs);var Ng=w("toastRegion",{label:"Notifications"}),Yd=2e3,nd=1e4,od=150,Fr,$e,Fe,Vr,ys,$s,Z,ld,gs,vl,Ur,Kr,Wr,Yr,cd,vs=class extends y{constructor(){super(...arguments);h(this,Z);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;h(this,Fr);h(this,$e);h(this,Fe,0);h(this,Vr,0);h(this,ys,!1);h(this,$s,!1);h(this,Ur,()=>{f(this,ys,!0),o(this,Z,vl).call(this)});h(this,Kr,()=>{f(this,ys,!1),o(this,Z,gs).call(this)});h(this,Wr,()=>{f(this,$s,!0),o(this,Z,vl).call(this)});h(this,Yr,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(f(this,$s,!1),o(this,Z,gs).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?nd:5e3);return Math.min(nd,Math.max(Yd,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&f(this,Fr,setTimeout(()=>{this._primed=!0},od)),this.addEventListener("pointerenter",r(this,Ur)),this.addEventListener("pointerleave",r(this,Kr)),this.addEventListener("focusin",r(this,Wr)),this.addEventListener("focusout",r(this,Yr))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(r(this,$e)),clearTimeout(r(this,Fr)),this.removeEventListener("pointerenter",r(this,Ur)),this.removeEventListener("pointerleave",r(this,Kr)),this.removeEventListener("focusin",r(this,Wr)),this.removeEventListener("focusout",r(this,Yr))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,$e)),this.open&&(this._inRegion||this._primed)&&(f(this,Fe,this.effectiveDuration),o(this,Z,gs).call(this)))}show(){this.open?(f(this,Fe,this.effectiveDuration),o(this,Z,gs).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(r(this,$e)),this.open=!1,!0):(e==="timeout"&&(f(this,Fe,this.effectiveDuration),o(this,Z,gs).call(this)),!1)}render(){let e=n`<div class="toast" part="toast">
2119
- ${this.tone==="critical"?n`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:c}
2333
+ `];f("cm-notification-panel",Os);var ix=k("toastRegion",{label:"Notifications"}),ap=2e3,mh=1e4,uh=150,$r,ze,Qe,kr,js,Vs,se,bh,Ps,pc,Er,Mr,_r,zr,fh,Bs=class extends w{constructor(){super(...arguments);h(this,se);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;h(this,$r);h(this,ze);h(this,Qe,0);h(this,kr,0);h(this,js,!1);h(this,Vs,!1);h(this,Er,()=>{b(this,js,!0),n(this,se,pc).call(this)});h(this,Mr,()=>{b(this,js,!1),n(this,se,Ps).call(this)});h(this,_r,()=>{b(this,Vs,!0),n(this,se,pc).call(this)});h(this,zr,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(b(this,Vs,!1),n(this,se,Ps).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?mh:5e3);return Math.min(mh,Math.max(ap,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&b(this,$r,setTimeout(()=>{this._primed=!0},uh)),this.addEventListener("pointerenter",s(this,Er)),this.addEventListener("pointerleave",s(this,Mr)),this.addEventListener("focusin",s(this,_r)),this.addEventListener("focusout",s(this,zr))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(s(this,ze)),clearTimeout(s(this,$r)),this.removeEventListener("pointerenter",s(this,Er)),this.removeEventListener("pointerleave",s(this,Mr)),this.removeEventListener("focusin",s(this,_r)),this.removeEventListener("focusout",s(this,zr))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(s(this,ze)),this.open&&(this._inRegion||this._primed)&&(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)))}show(){this.open?(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(s(this,ze)),this.open=!1,!0):(e==="timeout"&&(b(this,Qe,this.effectiveDuration),n(this,se,Ps).call(this)),!1)}render(){let e=o`<div class="toast" part="toast">
2334
+ ${this.tone==="critical"?o`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:c}
2120
2335
  <div class="message" part="message">${this.message}<slot></slot></div>
2121
- ${this.actionLabel?n`<button class="action" part="action" @click=${o(this,Z,cd)}>${this.actionLabel}</button>`:c}
2336
+ ${this.actionLabel?o`<button class="action" part="action" @click=${n(this,se,fh)}>${this.actionLabel}</button>`:c}
2122
2337
  <button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
2123
2338
  <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>
2124
2339
  </button>
2125
- </div>`;return this._inRegion?e:n`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:c}</div>`}};Fr=new WeakMap,$e=new WeakMap,Fe=new WeakMap,Vr=new WeakMap,ys=new WeakMap,$s=new WeakMap,Z=new WeakSet,ld=function(){return r(this,ys)||r(this,$s)},gs=function(){clearTimeout(r(this,$e)),!(!this.open||r(this,Z,ld))&&(f(this,Vr,Date.now()),f(this,$e,setTimeout(()=>this.dismiss("timeout"),r(this,Fe))))},vl=function(){r(this,$e)!==void 0&&(clearTimeout(r(this,$e)),f(this,$e,void 0),f(this,Fe,Math.max(1e3,r(this,Fe)-(Date.now()-r(this,Vr)))))},Ur=new WeakMap,Kr=new WeakMap,Wr=new WeakMap,Yr=new WeakMap,cd=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},vs.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},vs.styles=[g,m`
2340
+ </div>`;return this._inRegion?e:o`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:c}</div>`}};$r=new WeakMap,ze=new WeakMap,Qe=new WeakMap,kr=new WeakMap,js=new WeakMap,Vs=new WeakMap,se=new WeakSet,bh=function(){return s(this,js)||s(this,Vs)},Ps=function(){clearTimeout(s(this,ze)),!(!this.open||s(this,se,bh))&&(b(this,kr,Date.now()),b(this,ze,setTimeout(()=>this.dismiss("timeout"),s(this,Qe))))},pc=function(){s(this,ze)!==void 0&&(clearTimeout(s(this,ze)),b(this,ze,void 0),b(this,Qe,Math.max(1e3,s(this,Qe)-(Date.now()-s(this,kr)))))},Er=new WeakMap,Mr=new WeakMap,_r=new WeakMap,zr=new WeakMap,fh=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Bs.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Bs.styles=[v,u`
2126
2341
  :host { display: block; pointer-events: auto; }
2127
2342
  :host(:not([open])) { display: none; }
2128
2343
  .toast {
@@ -2147,23 +2362,23 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2147
2362
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
2148
2363
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
2149
2364
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
2150
- `];b("cm-toast",vs);var Gr,Xr,xs=class extends y{constructor(){super(...arguments);this.max=3;h(this,Gr,!1);h(this,Xr,e=>{let t=e.target;queueMicrotask(()=>{t.localName==="cm-toast"&&!t.open&&t.remove()})})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),f(this,Gr,!0)),this.addEventListener("cm-dismiss",r(this,Xr))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,Xr))}updated(){r(this,Gr)&&this.setAttribute("aria-label",this.t("label"))}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")];return t.slice(0,Math.max(0,t.length-Math.max(1,this.max))).forEach(s=>s.remove()),e}render(){return n`<slot></slot>`}};Gr=new WeakMap,Xr=new WeakMap,xs.properties={max:{type:Number}},xs.styles=[g,m`
2365
+ `];f("cm-toast",Bs);var Tr,Sr,Fs=class extends w{constructor(){super(...arguments);this.max=3;h(this,Tr,!1);h(this,Sr,e=>{let t=e.target;queueMicrotask(()=>{t.localName==="cm-toast"&&!t.open&&t.remove()})})}connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.setAttribute("aria-atomic","false"),this.hasAttribute("aria-label")||(this.setAttribute("aria-label",this.t("label")),b(this,Tr,!0)),this.addEventListener("cm-dismiss",s(this,Sr))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",s(this,Sr))}updated(){s(this,Tr)&&this.setAttribute("aria-label",this.t("label"))}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")];return t.slice(0,Math.max(0,t.length-Math.max(1,this.max))).forEach(i=>i.remove()),e}render(){return o`<slot></slot>`}};Tr=new WeakMap,Sr=new WeakMap,Fs.properties={max:{type:Number}},Fs.styles=[v,u`
2151
2366
  :host {
2152
2367
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
2153
2368
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-10);
2154
2369
  padding-inline: var(--cm-space-15); pointer-events: none;
2155
2370
  }
2156
- `];b("cm-toast-region",xs);function Gd(a,i={}){let e=i.root??document.body,t=e.querySelector(":scope > cm-toast-region"),s=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let l=document.createElement("cm-toast");if(l.message=String(a),i.tone&&(l.tone=i.tone),i.duration!==void 0&&(l.duration=i.duration),i.action){l.actionLabel=i.action.label;let d=i.action.onAction;l.addEventListener("cm-action",()=>d())}if(s){let d=t;return setTimeout(()=>d.add(l),od),l}return t.add(l)}var Bg=w("progressBar",{inProgress:"In progress"}),Kn,ws=class extends y{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";h(this,Kn,S("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${r(this,Kn)}-label`;return n`
2371
+ `];f("cm-toast-region",Fs);function rp(r,a={}){let e=a.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let l=document.createElement("cm-toast");if(l.message=String(r),a.tone&&(l.tone=a.tone),a.duration!==void 0&&(l.duration=a.duration),a.action){l.actionLabel=a.action.label;let d=a.action.onAction;l.addEventListener("cm-action",()=>d())}if(i){let d=t;return setTimeout(()=>d.add(l),uh),l}return t.add(l)}var cx=k("progressBar",{inProgress:"In progress"}),Ao,Us=class extends w{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";h(this,Ao,S("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${s(this,Ao)}-label`;return o`
2157
2372
  <div class="head ${this.labelHidden?"vh":""}">
2158
2373
  <span id=${t} part="label">${this.label}</span>
2159
- ${this.showValue&&e!==null?n`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:c}
2374
+ ${this.showValue&&e!==null?o`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:c}
2160
2375
  </div>
2161
2376
  <div class="track ${e===null?"indeterminate":""}" part="track" role="progressbar"
2162
2377
  aria-labelledby=${t} aria-valuemin="0" aria-valuemax="100"
2163
2378
  aria-valuenow=${e===null?c:Math.round(e)}
2164
2379
  aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
2165
2380
  <div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
2166
- </div>`}};Kn=new WeakMap,ws.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},ws.styles=[g,m`
2381
+ </div>`}};Ao=new WeakMap,Us.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Us.styles=[v,u`
2167
2382
  :host { display: block; }
2168
2383
  .head { display: flex; justify-content: space-between; gap: var(--cm-space-10); margin-block-end: 6px; font-size: 14px; line-height: 20px; }
2169
2384
  .value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
@@ -2180,7 +2395,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2180
2395
  .fill { transition: none; }
2181
2396
  .indeterminate .fill { animation-duration: 4s; }
2182
2397
  }
2183
- `];b("cm-progress-bar",ws);var ks=class extends k{constructor(){super(...arguments);this.tone="neutral"}render(){return n`<span part="badge"><slot></slot></span>`}};ks.properties={tone:{reflect:!0}},ks.styles=[g,m`
2398
+ `];f("cm-progress-bar",Us);var Ks=class extends E{constructor(){super(...arguments);this.tone="neutral"}render(){return o`<span part="badge"><slot></slot></span>`}};Ks.properties={tone:{reflect:!0}},Ks.styles=[v,u`
2184
2399
  :host { display: inline-flex; vertical-align: middle; }
2185
2400
  span {
2186
2401
  display: inline-flex; align-items: center; height: 28px; padding: 0 var(--cm-space-10);
@@ -2192,24 +2407,38 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2192
2407
  :host([tone='success']) span { background: linear-gradient(var(--cm-bg-success-soft), var(--cm-bg-success-soft)), var(--cm-bg-surface); color: var(--cm-text-success); }
2193
2408
  :host([tone='critical']) span { background: linear-gradient(var(--cm-bg-critical), var(--cm-bg-critical)), var(--cm-bg-surface); color: var(--cm-text-critical); }
2194
2409
  :host([tone='attention']) span { background: linear-gradient(var(--cm-bg-attention), var(--cm-bg-attention)), var(--cm-bg-surface); color: var(--cm-text-attention); }
2195
- `];b("cm-badge",ks);var Es=class extends k{constructor(){super(...arguments);this.heading="";this.description="";this.flush=!1;this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?n`<div role="heading" aria-level=${e} class="title" part="title">${this.heading}<slot name="title-adornment"></slot></div>`:c;return n`<section part="card" aria-label=${this.heading||c}>
2196
- ${this.heading||this.description?n`<header><div>${t}${this.description?n`<p class="desc">${this.description}</p>`:c}</div>
2410
+ `];f("cm-badge",Ks);var Ys,Do,gh,Ws=class extends E{constructor(){super(...arguments);h(this,Do);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;h(this,Ys,!1)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?o`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${this.heading}</span><span class="adornment" ?hidden=${!s(this,Ys)}><slot name="title-adornment" @slotchange=${n(this,Do,gh)}></slot></span></div>`:c;return o`<section part="card" aria-label=${this.heading||c}>
2411
+ ${this.heading||this.description?o`<header><div class="main">${this.heading?o`<span class="strut" aria-hidden="true">${this.heading}</span>`:c}${t}${this.description?o`<p class="desc">${this.description}</p>`:c}</div>
2197
2412
  <div class="actions"><slot name="actions"></slot></div></header>`:c}
2198
2413
  <slot></slot>
2199
- </section>`}};Es.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Es.styles=[g,m`
2414
+ </section>`}};Ys=new WeakMap,Do=new WeakSet,gh=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,Ys)&&(b(this,Ys,t),this.requestUpdate())},Ws.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},Ws.styles=[v,u`
2200
2415
  :host { display: block; }
2201
2416
  section {
2202
2417
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
2203
2418
  border-radius: var(--cm-radius-md); padding: var(--cm-space-20);
2204
2419
  }
2205
2420
  :host([flush]) section { padding: 0; }
2206
- header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--cm-space-20); margin-bottom: var(--cm-space-20); }
2421
+ /* Wraps only on narrow cards. .main grows from a 0 basis (wide cards look exactly as before: its content stays
2422
+ at the start), and its minimum width comes from .strut: the heading on one line, capped at 12 characters. So
2423
+ the actions move under the title only when the heading would get less than that. */
2424
+ header {
2425
+ display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
2426
+ gap: var(--cm-space-10) var(--cm-space-20); margin-bottom: var(--cm-space-20);
2427
+ }
2207
2428
  :host([flush]) header { padding: var(--cm-space-20) var(--cm-space-20) 0; }
2208
- .title { margin: 0; font-size: var(--cm-type-heading-sm-size); font-weight: 600; display: flex; align-items: center; gap: var(--cm-space-10); }
2429
+ .main { flex: 1 1 0%; max-inline-size: 100%; }
2430
+ .strut {
2431
+ display: block; block-size: 0; overflow: hidden; visibility: hidden; white-space: nowrap;
2432
+ max-inline-size: 12ch; font-size: var(--cm-type-heading-sm-size); font-weight: 600;
2433
+ }
2434
+ .title { margin: 0; font-size: var(--cm-type-heading-sm-size); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10); }
2435
+ /* Flex-wrap moves the badges under the heading before the heading itself would wrap. */
2436
+ .adornment { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10); }
2437
+ .adornment[hidden] { display: none; }
2209
2438
  .desc { margin: 6px 0 0; font-size: 16px; color: var(--cm-text-tertiary); }
2210
- .actions { display: flex; gap: var(--cm-space-20); align-items: center; }
2211
- `];b("cm-card",Es);var Xd=["0","10","12","15","20","22","30"];function Ms(a,i){return ta(Xd.map(e=>`:host([${a}='${e}']) { ${i}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
2212
- `))}var _s=class extends k{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return n`<slot></slot>`}};_s.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},_s.styles=[g,m`
2439
+ .actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-20); align-items: center; }
2440
+ `];f("cm-card",Ws);var np=["0","10","12","15","20","22","30"];function Gs(r,a){return Nr(np.map(e=>`:host([${r}='${e}']) { ${a}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
2441
+ `))}var Xs=class extends E{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return o`<slot></slot>`}};Xs.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},Xs.styles=[v,u`
2213
2442
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
2214
2443
  :host([direction='inline']) { flex-direction: row; align-items: center; }
2215
2444
  :host([wrap]) { flex-wrap: wrap; }
@@ -2222,13 +2451,13 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2222
2451
  :host([justify='center']) { justify-content: center; }
2223
2452
  :host([justify='end']) { justify-content: flex-end; }
2224
2453
  :host([justify='space-between']) { justify-content: space-between; }
2225
- `,Ms("gap","gap")];b("cm-stack",_s);var dd="important",Jd=" !"+dd,hd=ga(class extends Bt{constructor(a){if(super(a),a.type!==Te.ATTRIBUTE||a.name!=="style"||a.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(a){return Object.keys(a).reduce((i,e)=>{let t=a[e];return t==null?i:i+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(a,[i]){let{style:e}=a.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(i)),this.render(i);for(let t of this.ft)i[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in i){let s=i[t];if(s!=null){this.ft.add(t);let l=typeof s=="string"&&s.endsWith(Jd);t.includes("-")||l?e.setProperty(t,l?s.slice(0,-11):s,l?dd:""):e[t]=s}}return Q}});var zs=class extends k{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),s=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return n`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${hd({gridTemplateColumns:s})}><slot></slot></div>`}};zs.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},zs.styles=[g,m`
2454
+ `,Gs("gap","gap")];f("cm-stack",Xs);var vh="important",op=" !"+vh,xh=Xr(class extends ni{constructor(r){if(super(r),r.type!==He.ATTRIBUTE||r.name!=="style"||r.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce((a,e)=>{let t=r[e];return t==null?a:a+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(r,[a]){let{style:e}=r.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(a)),this.render(a);for(let t of this.ft)a[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in a){let i=a[t];if(i!=null){this.ft.add(t);let l=typeof i=="string"&&i.endsWith(op);t.includes("-")||l?e.setProperty(t,l?i.slice(0,-11):i,l?vh:""):e[t]=i}}return ae}});var Js=class extends E{constructor(){super(...arguments);this.columns=2;this.gap="20"}render(){let e=Math.max(1,Math.floor(Number(this.columns)||1)),t=this.minColumnWidth?.trim(),i=t?`repeat(auto-fit, minmax(min(100%, ${t}), 1fr))`:`repeat(${e}, minmax(0, 1fr))`;return o`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${xh({gridTemplateColumns:i})}><slot></slot></div>`}};Js.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},Js.styles=[v,u`
2226
2455
  :host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
2227
2456
  .grid { display: grid; gap: var(--_gap); align-items: start; }
2228
2457
  @container cm-grid (max-width: 640px) {
2229
2458
  .grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
2230
2459
  }
2231
- `,Ms("gap","--_gap")];b("cm-grid",zs);var Ss=class extends k{constructor(){super(...arguments);this.gap="20"}render(){return n`<div class="layout" part="layout"><slot></slot></div>`}};Ss.properties={gap:{reflect:!0}},Ss.styles=[g,m`
2460
+ `,Gs("gap","--_gap")];f("cm-grid",Js);var Zs=class extends E{constructor(){super(...arguments);this.gap="20"}render(){return o`<div class="layout" part="layout"><slot></slot></div>`}};Zs.properties={gap:{reflect:!0}},Zs.styles=[v,u`
2232
2461
  :host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-20); }
2233
2462
  .layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
2234
2463
  @container cm-layout (max-width: 767px) {
@@ -2242,9 +2471,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2242
2471
  ::slotted([variant='one-third']) { grid-column: span 2; }
2243
2472
  ::slotted([variant='two-thirds']) { grid-column: span 4; }
2244
2473
  }
2245
- `,Ms("gap","--_gap")];var Ls=class extends k{constructor(){super(...arguments);this.variant="full"}render(){return n`<slot></slot>`}};Ls.properties={variant:{reflect:!0}},Ls.styles=[g,m`
2474
+ `,Gs("gap","--_gap")];var Qs=class extends E{constructor(){super(...arguments);this.variant="full"}render(){return o`<slot></slot>`}};Qs.properties={variant:{reflect:!0}},Qs.styles=[v,u`
2246
2475
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
2247
- `];b("cm-layout",Ss);b("cm-layout-section",Ls);var xl=1024,Zd=()=>{let a=document.activeElement;for(;a?.shadowRoot?.activeElement;)a=a.shadowRoot.activeElement;return a},It,Cs,ae,yl,Rt,pd,Jr,Zr,Ts=class extends k{constructor(){super(...arguments);h(this,ae);this.menuOpen=!1;this.menuItem="";this._wide=!1;h(this,It);h(this,Cs,null);h(this,Jr,e=>{if(!this.menuItem)return;let t=o(this,ae,pd).call(this,e),s=e.detail?.value;t==="bottom-navigation"&&s===this.menuItem?o(this,ae,Rt).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&o(this,ae,Rt).call(this,!1,!1)});h(this,Zr,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),o(this,ae,Rt).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",r(this,Jr)),this.addEventListener("keydown",r(this,Zr));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=xl)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",r(this,Jr)),this.removeEventListener("keydown",r(this,Zr)),r(this,It)?.disconnect(),f(this,It,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;f(this,It,new ResizeObserver(()=>{o(this,ae,yl).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=xl!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=xl}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>r(this,It).observe(t))}updated(e){e.has("_wide")&&o(this,ae,yl).call(this)}openMenu(){o(this,ae,Rt).call(this,!0)}closeMenu(){o(this,ae,Rt).call(this,!1)}toggleMenu(){o(this,ae,Rt).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return n`<div class="frame ${e?"wide":""}" part="frame">
2476
+ `];f("cm-layout",Zs);f("cm-layout-section",Qs);var mc=1024,lp=()=>{let r=document.activeElement;for(;r?.shadowRoot?.activeElement;)r=r.shadowRoot.activeElement;return r},ti,ta,he,uc,ei,yh,Lr,Cr,ea=class extends E{constructor(){super(...arguments);h(this,he);this.menuOpen=!1;this.menuItem="";this._wide=!1;h(this,ti);h(this,ta,null);h(this,Lr,e=>{if(!this.menuItem)return;let t=n(this,he,yh).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?n(this,he,ei).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&n(this,he,ei).call(this,!1,!1)});h(this,Cr,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),n(this,he,ei).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",s(this,Lr)),this.addEventListener("keydown",s(this,Cr));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=mc)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",s(this,Lr)),this.removeEventListener("keydown",s(this,Cr)),s(this,ti)?.disconnect(),b(this,ti,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;b(this,ti,new ResizeObserver(()=>{n(this,he,uc).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=mc!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=mc}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>s(this,ti).observe(t))}updated(e){e.has("_wide")&&n(this,he,uc).call(this)}openMenu(){n(this,he,ei).call(this,!0)}closeMenu(){n(this,he,ei).call(this,!1)}toggleMenu(){n(this,he,ei).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return o`<div class="frame ${e?"wide":""}" part="frame">
2248
2477
  <div class="probe"></div>
2249
2478
  <div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
2250
2479
  <div class="body">
@@ -2253,7 +2482,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2253
2482
  </div>
2254
2483
  <div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
2255
2484
  <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation"></slot></div>
2256
- </div>`}};It=new WeakMap,Cs=new WeakMap,ae=new WeakSet,yl=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=s=>Math.round(this.renderRoot.querySelector(s)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},Rt=function(e,t=!0){e!==this.menuOpen&&(e&&f(this,Cs,Zd()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let s=this.querySelector(':scope > [slot="mobile-menu"]');(s?.shadowRoot??s)?.querySelector("a[href], button")?.focus()}else t&&(r(this,Cs)?.focus(),f(this,Cs,null))}))},pd=function(e){return e.composedPath().find(s=>s.parentElement===this)?.getAttribute("slot")??""},Jr=new WeakMap,Zr=new WeakMap,Ts.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},Ts.styles=[g,m`
2485
+ </div>`}};ti=new WeakMap,ta=new WeakMap,he=new WeakSet,uc=function(){let e=this.renderRoot.querySelector(".frame");if(!e)return;let t=i=>Math.round(this.renderRoot.querySelector(i)?.getBoundingClientRect().height??0);e.style.setProperty("--_header",`${t(".header")}px`),e.style.setProperty("--_bottom",`${this._wide?0:t(".bottom")}px`)},ei=function(e,t=!0){e!==this.menuOpen&&(e&&b(this,ta,lp()),this.menuOpen=e,this.dispatchEvent(new CustomEvent("cm-menu-toggle",{bubbles:!0,composed:!0,detail:{open:e}})),this.updateComplete.then(()=>{if(e){let i=this.querySelector(':scope > [slot="mobile-menu"]');(i?.shadowRoot??i)?.querySelector("a[href], button")?.focus()}else t&&(s(this,ta)?.focus(),b(this,ta,null))}))},yh=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},Lr=new WeakMap,Cr=new WeakMap,ea.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},ea.styles=[v,u`
2257
2486
  :host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
2258
2487
  .header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
2259
2488
  .body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
@@ -2274,7 +2503,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2274
2503
  }
2275
2504
  .probe { block-size: 0; }
2276
2505
  [hidden] { display: none !important; }
2277
- `];b("cm-app-frame",Ts);var As=class extends k{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return n`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};As.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},As.styles=[g,m`
2506
+ `];f("cm-app-frame",ea);var ia=class extends E{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return o`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};ia.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},ia.styles=[v,u`
2278
2507
  :host { display: block; container: cm-page / inline-size; background: var(--cm-bg-page); min-block-size: 100%; }
2279
2508
  .content {
2280
2509
  box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
@@ -2283,16 +2512,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2283
2512
  :host([narrow]) .content { max-inline-size: 800px; }
2284
2513
  :host([full-width]) .content { max-inline-size: none; }
2285
2514
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-10); } }
2286
- `];b("cm-page",As);var Ns,md,ud,Ds=class extends y{constructor(){super(...arguments);h(this,Ns);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?js`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:js`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return n`<div class="banner" part="banner" role=${e}>
2515
+ `];f("cm-page",ia);var aa,wh,$h,sa=class extends w{constructor(){super(...arguments);h(this,aa);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?pa`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:pa`<circle cx="10" cy="10" r="7.5" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M10 6v5M10 13.6v.2" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>`;return o`<div class="banner" part="banner" role=${e}>
2287
2516
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
2288
2517
  <div class="body">
2289
- ${this.heading?n`<p class="title">${this.heading}</p>`:c}
2518
+ ${this.heading?o`<p class="title">${this.heading}</p>`:c}
2290
2519
  <div><slot></slot></div>
2291
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${o(this,Ns,md)}></slot></div>
2520
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${n(this,aa,wh)}></slot></div>
2292
2521
  </div>
2293
- ${this.dismissible?n`<button class="close" aria-label=${this.t("dismiss")} @click=${o(this,Ns,ud)}>
2522
+ ${this.dismissible?o`<button class="close" aria-label=${this.t("dismiss")} @click=${n(this,aa,$h)}>
2294
2523
  <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true"><path d="m4 4 8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg></button>`:c}
2295
- </div>`}};Ns=new WeakSet,md=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},ud=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},Ds.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},Ds.styles=[g,m`
2524
+ </div>`}};aa=new WeakSet,wh=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},$h=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},sa.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},sa.styles=[v,u`
2296
2525
  :host { display: block; }
2297
2526
  .banner {
2298
2527
  display: flex; gap: var(--cm-space-15); align-items: flex-start;
@@ -2315,10 +2544,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2315
2544
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
2316
2545
  }
2317
2546
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2318
- `];b("cm-banner",Ds);var Nv=w("thumbnail",{noImage:"{alt} (no image)"}),Rs=class extends y{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return n`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
2319
- @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return n`<span class="box" part="thumbnail" role=${this.alt?"img":c}
2547
+ `];f("cm-banner",sa);var sy=k("thumbnail",{noImage:"{alt} (no image)"}),ra=class extends w{constructor(){super(...arguments);this.src="";this.alt="";this.size="medium";this.loading="eager";this._failed=!1}willUpdate(e){e.has("src")&&(this._failed=!1)}render(){if(this.src&&!this._failed)return o`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
2548
+ @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return o`<span class="box" part="thumbnail" role=${this.alt?"img":c}
2320
2549
  aria-label=${this.alt?this.t("noImage",{alt:this.alt}):c} aria-hidden=${this.alt?c:"true"}>
2321
- <cm-icon name="box" size=${e}></cm-icon></span>`}};Rs.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},Rs.styles=[g,m`
2550
+ <cm-icon name="box" size=${e}></cm-icon></span>`}};ra.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},ra.styles=[v,u`
2322
2551
  :host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
2323
2552
  :host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
2324
2553
  :host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
@@ -2328,7 +2557,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2328
2557
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
2329
2558
  }
2330
2559
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
2331
- `];b("cm-thumbnail",Rs);export{yi as CmAccordion,fi as CmActionBar,Oi as CmActionMenu,cs as CmAppCard,Ts as CmAppFrame,es as CmAvatar,ks as CmBadge,Ds as CmBanner,as as CmBottomNavigation,ms as CmBottomSheet,bt as CmButton,Es as CmCard,Ke as CmCheckbox,Qe as CmCombobox,Mi as CmComment,_i as CmCommentBox,Ni as CmDataTable,tt as CmDatePicker,st as CmDateRangePicker,$i as CmEmptyState,at as CmFileUpload,hs as CmFilterPanel,os as CmFlashOfferBar,wt as CmGlobalSearch,zs as CmGrid,is as CmHeaderBar,Pt as CmIcon,xi as CmInfoItem,vi as CmInfoPanel,Ss as CmLayout,Ls as CmLayoutSection,ls as CmLinkTabs,y as CmLocalizedElement,Ii as CmMenuItem,ns as CmMobileMenu,ds as CmModal,Ui as CmNavItem,_n as CmNestedItem,Fi as CmNestedList,us as CmNotificationItem,bs as CmNotificationPanel,Et as CmOptionGroup,As as CmPage,bi as CmPageHeader,Li as CmPagination,ws as CmProgressBar,vt as CmRadio,xt as CmRadioGroup,Tt as CmReportTile,Vi as CmReportTiles,Bi as CmResourceItem,ji as CmResourceList,gi as CmSaveBar,Je as CmSearch,Xe as CmSelect,Ji as CmSideNavigation,ze as CmSidePanel,ki as CmSkeleton,Ei as CmSkeletonDisplay,zi as CmSmartTip,Si as CmSmartTips,Jt as CmSpinner,_s as CmStack,Ci as CmStatusTabs,Ai as CmTableHeader,Xt as CmTag,Ve as CmTextField,Rs as CmThumbnail,vs as CmToast,xs as CmToastRegion,Ye as CmToggle,Ki as CmTooltip,Td as configure,w as defineStrings,Kl as directionalIcons,we as formatDate,Fl as formatMessage,oo as formatNumber,Sd as getDefaultStrings,Gc as initials,Us as localeFor,pa as pluralCategory,Cd as resetStrings,oc as resolvePreset,Ld as setStrings,Gd as showToast,Vl as translate};
2560
+ `];f("cm-thumbnail",ra);export{Bi as CmAccordion,Ri as CmActionBar,hs as CmActionMenu,As as CmAppCard,ea as CmAppFrame,ks as CmAvatar,Ks as CmBadge,sa as CmBanner,Ts as CmBottomNavigation,Hs as CmBottomSheet,_t as CmButton,Ws as CmCard,tt as CmCheckbox,lt as CmCombobox,Ui as CmComment,Ki as CmCommentBox,os as CmDataTable,pt as CmDatePicker,ut as CmDateRangePicker,Fi as CmEmptyState,ft as CmFileUpload,Ns as CmFilterPanel,Ls as CmFlashOfferBar,Dt as CmGlobalSearch,Js as CmGrid,Ms as CmHeaderBar,ri as CmIcon,Pi as CmInfoItem,qi as CmInfoPanel,Zs as CmLayout,Qs as CmLayoutSection,Cs as CmLinkTabs,w as CmLocalizedElement,cs as CmMenuItem,vs as CmMetric,Ss as CmMobileMenu,Ds as CmModal,xs as CmNavItem,go as CmNestedItem,fs as CmNestedList,Rs as CmNotificationItem,Os as CmNotificationPanel,qt as CmOptionGroup,ia as CmPage,Hi as CmPageHeader,is as CmPagination,Us as CmProgressBar,St as CmRadio,Lt as CmRadioGroup,Xt as CmReportTile,gs as CmReportTiles,us as CmResourceItem,bs as CmResourceList,Oi as CmSaveBar,nt as CmSearch,rt as CmSelect,ys as CmSideNavigation,De as CmSidePanel,ji as CmSkeleton,Vi as CmSkeletonDisplay,es as CmSmartTip,ts as CmSmartTips,fi as CmSpinner,Xs as CmStack,as as CmStatusTabs,rs as CmTableHeader,bi as CmTag,et as CmTextField,ra as CmThumbnail,Vt as CmTimeline,Zi as CmTimelineItem,Bs as CmToast,Fs as CmToastRegion,st as CmToggle,Wi as CmTooltip,Oh as configure,k as defineStrings,Pc as directionalIcons,V as formatDate,Rc as formatMessage,Yo as formatNumber,Hh as getDefaultStrings,ih as initials,ba as localeFor,Ur as pluralCategory,qh as resetStrings,cd as resolvePreset,Rh as setStrings,rp as showToast,Oc as translate};
2332
2561
  /*! Bundled license information:
2333
2562
 
2334
2563
  @lit/reactive-element/css-tag.js: