@commmerce/ui 1.2.0 → 1.3.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 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`
1
+ var Id=n=>{throw TypeError(n)};var Pl=(n,r,e)=>r.has(n)||Id("Cannot "+e);var s=(n,r,e)=>(Pl(n,r,"read from private field"),e?e.call(n):r.get(n)),p=(n,r,e)=>r.has(n)?Id("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(n):r.set(n,e),f=(n,r,e,t)=>(Pl(n,r,"write to private field"),t?t.call(n,e):r.set(n,e),e),o=(n,r,e)=>(Pl(n,r,"access private method"),e);var Dn=globalThis,Nn=Dn.ShadowRoot&&(Dn.ShadyCSS===void 0||Dn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bl=Symbol(),Od=new WeakMap,jr=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==Bl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Nn&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=Od.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&Od.set(e,r))}return r}toString(){return this.cssText}},Rn=n=>new jr(typeof n=="string"?n:n+"",void 0,Bl),b=(n,...r)=>{let e=n.length===1?n[0]:r.reduce((t,i,a)=>t+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+n[a+1],n[0]);return new jr(e,n,Bl)},qd=(n,r)=>{if(Nn)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Dn.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,n.appendChild(t)}},jl=Nn?n=>n:n=>n instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return Rn(e)})(n):n;var{is:gu,defineProperty:vu,getOwnPropertyDescriptor:xu,getOwnPropertyNames:yu,getOwnPropertySymbols:wu,getPrototypeOf:$u}=Object,Hn=globalThis,Pd=Hn.trustedTypes,ku=Pd?Pd.emptyScript:"",Eu=Hn.reactiveElementPolyfillSupport,Fr=(n,r)=>n,Fl={toAttribute(n,r){switch(r){case Boolean:n=n?ku:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,r){let e=n;switch(r){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},jd=(n,r)=>!gu(n,r),Bd={attribute:!0,type:String,converter:Fl,reflect:!1,useDefault:!1,hasChanged:jd};Symbol.metadata??=Symbol("metadata"),Hn.litPropertyMetadata??=new WeakMap;var Ye=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=Bd){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&vu(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=xu(this.prototype,r)??{get(){return this[e]},set(c){this[e]=c}};return{get:i,set(c){let h=i?.call(this);a?.call(this,c),this.requestUpdate(r,h,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??Bd}static _$Ei(){if(this.hasOwnProperty(Fr("elementProperties")))return;let r=$u(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Fr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fr("properties"))){let e=this.properties,t=[...yu(e),...wu(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);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(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(jl(i))}else r!==void 0&&e.push(jl(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.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(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return qd(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(r=>r.hostConnected?.())}enableUpdating(r){}disconnectedCallback(){this._$EO?.forEach(r=>r.hostDisconnected?.())}attributeChangedCallback(r,e,t){this._$AK(r,t)}_$ET(r,e){let t=this.constructor.elementProperties.get(r),i=this.constructor._$Eu(r,t);if(i!==void 0&&t.reflect===!0){let a=(t.converter?.toAttribute!==void 0?t.converter:Fl).toAttribute(e,t.type);this._$Em=r,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(r,e){let t=this.constructor,i=t._$Eh.get(r);if(i!==void 0&&this._$Em!==i){let a=t.getPropertyOptions(i),c=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Fl;this._$Em=i;let h=c.fromAttribute(e,a.type);this[i]=h??this._$Ej?.get(i)??h,this._$Em=null}}requestUpdate(r,e,t,i=!1,a){if(r!==void 0){let c=this.constructor;if(i===!1&&(a=this[r]),t??=c.getPropertyOptions(r),!((t.hasChanged??jd)(a,e)||t.useDefault&&t.reflect&&a===this._$Ej?.get(r)&&!this.hasAttribute(c._$Eu(r,t))))return;this.C(r,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(r,e,{useDefault:t,reflect:i,wrapped:a},c){t&&!(this._$Ej??=new Map).has(r)&&(this._$Ej.set(r,c??e??this[r]),a!==!0||c!==void 0)||(this._$AL.has(r)||(this.hasUpdated||t||(e=void 0),this._$AL.set(r,e)),i===!0&&this._$Em!==r&&(this._$Eq??=new Set).add(r))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,a]of t){let{wrapped:c}=a,h=this[i];c!==!0||this._$AL.has(i)||h===void 0||this.C(i,void 0,a,h)}}let r=!1,e=this._$AL;try{r=this.shouldUpdate(e),r?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw r=!1,this._$EM(),t}r&&this._$AE(e)}willUpdate(r){}_$AE(r){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(r){}firstUpdated(r){}};Ye.elementStyles=[],Ye.shadowRootOptions={mode:"open"},Ye[Fr("elementProperties")]=new Map,Ye[Fr("finalized")]=new Map,Eu?.({ReactiveElement:Ye}),(Hn.reactiveElementVersions??=[]).push("2.1.2");var Ul=globalThis,Fd=n=>n,In=Ul.trustedTypes,Vd=In?In.createPolicy("lit-html",{createHTML:n=>n}):void 0,Kl="$lit$",We=`lit$${Math.random().toFixed(9).slice(2)}$`,Gl="?"+We,Mu=`<${Gl}>`,jt=document,Ur=()=>jt.createComment(""),Kr=n=>n===null||typeof n!="object"&&typeof n!="function",Yl=Array.isArray,Xd=n=>Yl(n)||typeof n?.[Symbol.iterator]=="function",Vl=`[
2
+ \f\r]`,Vr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ud=/-->/g,Kd=/>/g,Pt=RegExp(`>|${Vl}(?:([^\\s"'>=/]+)(${Vl}*=${Vl}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Gd=/'/g,Yd=/"/g,Jd=/^(?:script|style|textarea|title)$/i,Wl=n=>(r,...e)=>({_$litType$:n,strings:r,values:e}),l=Wl(1),Yr=Wl(2),um=Wl(3),ae=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),Wd=new WeakMap,Bt=jt.createTreeWalker(jt,129);function Zd(n,r){if(!Yl(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Vd!==void 0?Vd.createHTML(r):r}var Qd=(n,r)=>{let e=n.length-1,t=[],i,a=r===2?"<svg>":r===3?"<math>":"",c=Vr;for(let h=0;h<e;h++){let u=n[h],m,y,v=-1,E=0;for(;E<u.length&&(c.lastIndex=E,y=c.exec(u),y!==null);)E=c.lastIndex,c===Vr?y[1]==="!--"?c=Ud:y[1]!==void 0?c=Kd:y[2]!==void 0?(Jd.test(y[2])&&(i=RegExp("</"+y[2],"g")),c=Pt):y[3]!==void 0&&(c=Pt):c===Pt?y[0]===">"?(c=i??Vr,v=-1):y[1]===void 0?v=-2:(v=c.lastIndex-y[2].length,m=y[1],c=y[3]===void 0?Pt:y[3]==='"'?Yd:Gd):c===Yd||c===Gd?c=Pt:c===Ud||c===Kd?c=Vr:(c=Pt,i=void 0);let $=c===Pt&&n[h+1].startsWith("/>")?" ":"";a+=c===Vr?u+Mu:v>=0?(t.push(m),u.slice(0,v)+Kl+u.slice(v)+We+$):u+We+(v===-2?h:$)}return[Zd(n,a+(n[e]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),t]},Gr=class n{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,c=0,h=r.length-1,u=this.parts,[m,y]=Qd(r,e);if(this.el=n.createElement(m,t),Bt.currentNode=this.el.content,e===2||e===3){let v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(i=Bt.nextNode())!==null&&u.length<h;){if(i.nodeType===1){if(i.hasAttributes())for(let v of i.getAttributeNames())if(v.endsWith(Kl)){let E=y[c++],$=i.getAttribute(v).split(We),T=/([.?@])?(.*)/.exec(E);u.push({type:1,index:a,name:T[2],strings:$,ctor:T[1]==="."?qn:T[1]==="?"?Pn:T[1]==="@"?Bn:Vt}),i.removeAttribute(v)}else v.startsWith(We)&&(u.push({type:6,index:a}),i.removeAttribute(v));if(Jd.test(i.tagName)){let v=i.textContent.split(We),E=v.length-1;if(E>0){i.textContent=In?In.emptyScript:"";for(let $=0;$<E;$++)i.append(v[$],Ur()),Bt.nextNode(),u.push({type:2,index:++a});i.append(v[E],Ur())}}}else if(i.nodeType===8)if(i.data===Gl)u.push({type:2,index:a});else{let v=-1;for(;(v=i.data.indexOf(We,v+1))!==-1;)u.push({type:7,index:a}),v+=We.length-1}a++}}static createElement(r,e){let t=jt.createElement("template");return t.innerHTML=r,t}};function Ft(n,r,e=n,t){if(r===ae)return r;let i=t!==void 0?e._$Co?.[t]:e._$Cl,a=Kr(r)?void 0:r._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(n),i._$AT(n,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(r=Ft(n,i._$AS(n,r.values),i,t)),r}var On=class{constructor(r,e){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){let{el:{content:e},parts:t}=this._$AD,i=(r?.creationScope??jt).importNode(e,!0);Bt.currentNode=i;let a=Bt.nextNode(),c=0,h=0,u=t[0];for(;u!==void 0;){if(c===u.index){let m;u.type===2?m=new Ci(a,a.nextSibling,this,r):u.type===1?m=new u.ctor(a,u.name,u.strings,this,r):u.type===6&&(m=new jn(a,this,r)),this._$AV.push(m),u=t[++h]}c!==u?.index&&(a=Bt.nextNode(),c++)}return Bt.currentNode=jt,i}p(r){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(r,t,e),e+=t.strings.length-2):t._$AI(r[e])),e++}},Ci=class n{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(r,e,t,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=r,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let r=this._$AA.parentNode,e=this._$AM;return e!==void 0&&r?.nodeType===11&&(r=e.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,e=this){r=Ft(this,r,e),Kr(r)?r===d||r==null||r===""?(this._$AH!==d&&this._$AR(),this._$AH=d):r!==this._$AH&&r!==ae&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):Xd(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==d&&Kr(this._$AH)?this._$AA.nextSibling.data=r:this.T(jt.createTextNode(r)),this._$AH=r}$(r){let{values:e,_$litType$:t}=r,i=typeof t=="number"?this._$AC(r):(t.el===void 0&&(t.el=Gr.createElement(Zd(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let a=new On(i,this),c=a.u(this.options);a.p(e),this.T(c),this._$AH=a}}_$AC(r){let e=Wd.get(r.strings);return e===void 0&&Wd.set(r.strings,e=new Gr(r)),e}k(r){Yl(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let a of r)i===e.length?e.push(t=new n(this.O(Ur()),this.O(Ur()),this,this.options)):t=e[i],t._$AI(a),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(r=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);r!==this._$AB;){let t=Fd(r).nextSibling;Fd(r).remove(),r=t}}setConnected(r){this._$AM===void 0&&(this._$Cv=r,this._$AP?.(r))}},Vt=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,e,t,i,a){this.type=1,this._$AH=d,this._$AN=void 0,this.element=r,this.name=e,this._$AM=i,this.options=a,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=d}_$AI(r,e=this,t,i){let a=this.strings,c=!1;if(a===void 0)r=Ft(this,r,e,0),c=!Kr(r)||r!==this._$AH&&r!==ae,c&&(this._$AH=r);else{let h=r,u,m;for(r=a[0],u=0;u<a.length-1;u++)m=Ft(this,h[t+u],e,u),m===ae&&(m=this._$AH[u]),c||=!Kr(m)||m!==this._$AH[u],m===d?r=d:r!==d&&(r+=(m??"")+a[u+1]),this._$AH[u]=m}c&&!i&&this.j(r)}j(r){r===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}},qn=class extends Vt{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===d?void 0:r}},Pn=class extends Vt{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==d)}},Bn=class extends Vt{constructor(r,e,t,i,a){super(r,e,t,i,a),this.type=5}_$AI(r,e=this){if((r=Ft(this,r,e,0)??d)===ae)return;let t=this._$AH,i=r===d&&t!==d||r.capture!==t.capture||r.once!==t.once||r.passive!==t.passive,a=r!==d&&(t===d||i);i&&this.element.removeEventListener(this.name,this,t),a&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,r):this._$AH.handleEvent(r)}},jn=class{constructor(r,e,t){this.element=r,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(r){Ft(this,r)}},eh={M:Kl,P:We,A:Gl,C:1,L:Qd,R:On,D:Xd,V:Ft,I:Ci,H:Vt,N:Pn,U:Bn,B:qn,F:jn},Tu=Ul.litHtmlPolyfillSupport;Tu?.(Gr,Ci),(Ul.litHtmlVersions??=[]).push("3.3.3");var th=(n,r,e)=>{let t=e?.renderBefore??r,i=t._$litPart$;if(i===void 0){let a=e?.renderBefore??null;t._$litPart$=i=new Ci(r.insertBefore(Ur(),a),a,void 0,e??{})}return i._$AI(n),i};var Xl=globalThis,_=class extends Ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let r=super.createRenderRoot();return this.renderOptions.renderBefore??=r.firstChild,r}update(r){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=th(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ae}};_._$litElement$=!0,_.finalized=!0,Xl.litElementHydrateSupport?.({LitElement:_});var _u=Xl.litElementPolyfillSupport;_u?.({LitElement:_});(Xl.litElementVersions??=[]).push("4.2.2");var w=b`
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 gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
8
8
  }
9
9
  :host([hidden]) { display: none !important; }
10
10
  *, *::before, *::after { box-sizing: inherit; }
11
- `,Tp=u`
11
+ `,_m=b`
12
12
  outline: 2px solid var(--cm-border-strong);
13
13
  outline-offset: 2px;
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"
14
+ `,Cu=0,L=n=>`${n}-${++Cu}`;function g(n,r){customElements.get(n)||customElements.define(n,r)}function ne(n,r){let e=n.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(r).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var zu={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Fn={common:{...zu}},Wr={},Xr={},Vn;function M(n,r){return Fn[n]={...Fn[n],...r},r}function Lu(){return Object.fromEntries(Object.entries(Fn).map(([n,r])=>[n,{...r}]))}function Un(n,r){for(let[e,t]of Object.entries(r??{}))t&&typeof t=="object"&&(n[e]={...n[e],...t})}function Su(n,r){Un(r?Xr[r.toLowerCase()]??={}:Wr,n),Gn()}function Au(n={}){"locale"in n&&(Vn=n.locale||void 0),n.strings&&Un(Wr,n.strings);for(let[r,e]of Object.entries(n.translations??{}))Un(Xr[r.toLowerCase()]??={},e);Gn()}function Du(){Vn=void 0;for(let n of Object.keys(Wr))delete Wr[n];for(let n of Object.keys(Xr))delete Xr[n];Gn()}function Jr(n){if(Vn)return Vn;let r=n;for(;r;){if(r instanceof Element&&r.hasAttribute("lang")&&r.getAttribute("lang"))return r.getAttribute("lang");r=r.parentNode??(r instanceof ShadowRoot?r.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var ih=new Map;function Ql(n,r,e,t){let i=`${n}|${r??""}|${JSON.stringify(e)}`,a=ih.get(i);if(!a){try{a=t(r)}catch{a=t(void 0)}ih.set(i,a)}return a}function ec(n,r={},e){return Ql("n",e,r,t=>new Intl.NumberFormat(t,r)).format(n)}function Z(n,r={},e){return Ql("d",e,r,t=>new Intl.DateTimeFormat(t,r)).format(n)}function Kn(n,r){return Ql("p",r,{},e=>new Intl.PluralRules(e)).select(n)}function sh(n,r={},e){if(n==null)return"";if(typeof n=="function")return String(n(r));let t;if(typeof n=="object"){let i=Number(r.count??0);t=n[Kn(i,e)]??n.other??""}else t=String(n);return t.replace(/\{(\w+)\}/g,(i,a)=>{let c=r[a];return c===void 0?i:typeof c=="number"?ec(c,{},e):String(c)})}function Nu(n,r,e,t){if(t&&t[r]!==void 0)return t[r];let i=[];if(e){let a=e.toLowerCase().split("-");for(let c=a.length;c>0;c--)i.push(a.slice(0,c).join("-"))}for(let a of n==="common"?["common"]:[n,"common"]){for(let h of i){let u=Xr[h]?.[a]?.[r];if(u!==void 0)return u}let c=Wr[a]?.[r]??Fn[a]?.[r];if(c!==void 0)return c}}function rh(n,r,e,t,i){let a=Jr(t);return sh(Nu(n,r,a,i),e,a)}var Zl=new Set,Jl;function Gn(){for(let n of Zl)n.requestUpdate()}function Ru(){Jl||typeof MutationObserver>"u"||typeof document>"u"||(Jl=new MutationObserver(Gn),Jl.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Hu=n=>n.replace(/^cm-/,"").replace(/-([a-z])/g,(r,e)=>e.toUpperCase()),k=class extends _{static finalize(){let r=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!r(this,"finalized")&&r(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||r(this.prototype,e))continue;let a=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[a]??this.t(i)},set(c){this[a]=c},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Hu(this.localName)}t(r,e){return rh(this.stringsNamespace,r,e,this,this.strings)}get locale(){return Jr(this)}formatNumber(r,e){return ec(r,e,this.locale)}connectedCallback(){super.connectedCallback(),Zl.add(this),Ru()}disconnectedCallback(){super.disconnectedCallback(),Zl.delete(this)}};k.properties={strings:{type:Object}};var Yn={"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",camera:"M3 8.5A1.5 1.5 0 0 1 4.5 7h3L9 4.5h6L16.5 7h3A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5zM12 16.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",image:"M4 5h16v14H4zM4 16l4.5-4.5 4 4 2.5-2.5 5 5M15.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z","id-card":"M3 6h18v12H3zM8.5 11.5a1.75 1.75 0 1 0 0-3.5 1.75 1.75 0 0 0 0 3.5zM5.5 16a3 3 0 0 1 6 0M14 9.5h4M14 12.5h4M14 15.5h2.5",navigation:"M20 4l-6.5 16-2.5-7-7-2.5z","wifi-off":"M8.9 16.9a4 4 0 0 1 3.3-1.4M5.9 14.4a8 8 0 0 1 3-2.3M15.6 12.4a8 8 0 0 1 2.5 2M2.8 11.8a12 12 0 0 1 3-2.6M10.8 7.6a12 12 0 0 1 10.4 4.2M12 19.5h.01M3 3l18 18"},ah=["more","drag"],Sm=Object.keys(Yn);var nh=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],zi=class extends _{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=Yn[this.name]??Yn.more,t=ah.includes(this.name)?3:1.6;return Yr`<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
- role=${this.label?"img":c} aria-label=${this.label||c} aria-hidden=${this.label?c:"true"}
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`
16
+ role=${this.label?"img":d} aria-label=${this.label||d} aria-hidden=${this.label?d:"true"}
17
+ part="svg" class=${(this.mirror==="auto"?nh.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};zi.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},zi.styles=b`
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
- `;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
- ?disabled=${this.disabled} aria-disabled=${this.loading?"true":c}
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`
21
+ `;g("cm-icon",zi);var oh=99,Pm=M("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),Wn,Xn,Zr,Ut=class extends k{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;p(this,Wn,this.attachInternals());p(this,Xn,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=s(this,Wn).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});p(this,Zr,!1);this.addEventListener("click",s(this,Xn),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!s(this,Zr)&&(f(this,Zr,!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?l`<span class="spinner" aria-hidden="true"></span>`:l`<slot name="icon">${this.icon?l`<cm-icon name=${this.icon} size=${t}></cm-icon>`:d}</slot>`,a=this.iconOnly?l`<span class="vh"><slot></slot></span>`:l`<slot></slot>`,c=e?l`<span class="count" part="count" aria-hidden="true">${e>oh?this.t("countOverflow",{max:oh}):this.formatNumber(e)}</span>${this.iconOnly?d:l`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:d,h=this.iconOnly&&(this.label||this.textContent?.trim())||"",u=!this.iconOnly||!h?d:e?this.t("labelWithCount",{label:h,count:e}):this.label||d,m=l`${i}${a}${c}`;return this.href&&!this.disabled?l`<a class="btn" part="control" href=${this.href} target=${this.target??d}
22
+ rel=${this.target==="_blank"?"noopener noreferrer":d} aria-label=${u}>${m}</a>`:l`<button class="btn" part="control" type="button"
23
+ ?disabled=${this.disabled} aria-disabled=${this.loading?"true":d}
24
+ aria-busy=${this.loading?"true":d} aria-label=${u}>${m}</button>`}};Wn=new WeakMap,Xn=new WeakMap,Zr=new WeakMap,Ut.formAssociated=!0,Ut.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}},Ut.styles=[w,b`
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;
@@ -92,22 +92,22 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
92
92
  position: absolute; inset-block-start: -7px; inset-inline-end: -7px;
93
93
  box-shadow: 0 0 0 2px var(--cm-bg-surface); pointer-events: none;
94
94
  }
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}
95
+ `];g("cm-button",Ut);var Re={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Li=n=>(...r)=>({_$litDirective$:n,values:r}),ut=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,e,t){this._$Ct=r,this._$AM=e,this._$Ci=t}_$AS(r,e){return this.update(r,e)}update(r,e){return this.render(...e)}};var{I:Iu}=eh,lh=n=>n;var dh=n=>n.strings===void 0,ch=()=>document.createComment(""),Si=(n,r,e)=>{let t=n._$AA.parentNode,i=r===void 0?n._$AB:r._$AA;if(e===void 0){let a=t.insertBefore(ch(),i),c=t.insertBefore(ch(),i);e=new Iu(a,c,n,n.options)}else{let a=e._$AB.nextSibling,c=e._$AM,h=c!==n;if(h){let u;e._$AQ?.(n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==c._$AU&&e._$AP(u)}if(a!==i||h){let u=e._$AA;for(;u!==a;){let m=lh(u).nextSibling;lh(t).insertBefore(u,i),u=m}}}return e},mt=(n,r,e=n)=>(n._$AI(r,e),n),Ou={},Jn=(n,r=Ou)=>n._$AH=r,hh=n=>n._$AH,Zn=n=>{n._$AR(),n._$AA.remove()};var se=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.PROPERTY&&n.type!==Re.ATTRIBUTE&&n.type!==Re.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!dh(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[r]){if(r===ae||r===d)return r;let e=n.element,t=n.name;if(n.type===Re.PROPERTY){if(r===e[t])return ae}else if(n.type===Re.BOOLEAN_ATTRIBUTE){if(!!r===e.hasAttribute(t))return ae}else if(n.type===Re.ATTRIBUTE&&e.getAttribute(t)===r+"")return ae;return Jn(n),r}});var rf=M("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."}),oe,Xe,ea,K,Qr,Qn,ph,tc,uh,ic,ft=class extends k{constructor(){super(...arguments);p(this,K);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";p(this,oe,this.attachInternals());p(this,Xe,L("cm-tf"));p(this,ea,"")}connectedCallback(){super.connectedCallback(),f(this,ea,this.value)}get form(){return s(this,oe).form}get validity(){return s(this,oe).validity}get validationMessage(){return s(this,oe).validationMessage}checkValidity(){return o(this,K,Qr).call(this),s(this,oe).checkValidity()}reportValidity(){return o(this,K,Qr).call(this),s(this,oe).reportValidity()}formResetCallback(){this.value=s(this,ea),this.error=""}formDisabledCallback(e){this.disabled=e}updated(){s(this,oe).setFormValue(this.value),o(this,K,Qr).call(this)}render(){let e=[this.error&&`${s(this,Xe)}-err`,this.helpText&&`${s(this,Xe)}-help`].filter(Boolean).join(" ")||d,t={id:s(this,Xe),invalid:this.error?"true":d},i=this.multiline?l`<textarea class="input" part="input" id=${t.id} rows=${this.rows}
96
+ .value=${se(this.value)} placeholder=${this.placeholder||d}
97
97
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
98
98
  aria-invalid=${t.invalid} aria-describedby=${e}
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}
101
- autocomplete=${this.autocomplete??c}
102
- min=${this.min||c} max=${this.max||c} step=${this.step||c}
99
+ @input=${o(this,K,tc)} @change=${o(this,K,ic)}></textarea>`:l`<input class="input" part="input" id=${t.id} type=${this.type}
100
+ .value=${se(this.value)} placeholder=${this.placeholder||d}
101
+ autocomplete=${this.autocomplete??d}
102
+ min=${this.min||d} max=${this.max||d} step=${this.step||d}
103
103
  ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly}
104
104
  aria-invalid=${t.invalid} aria-describedby=${e}
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}
105
+ @input=${o(this,K,tc)} @change=${o(this,K,ic)} @blur=${o(this,K,uh)} />`;return l`<div class="field">
106
+ ${this.label?l`<label for=${s(this,Xe)} part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}${this.hint?l`<span class="hint">[${this.hint}]</span>`:d}</label>`:d}
107
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`
108
+ ${this.error?l`<p class="error" id="${s(this,Xe)}-err" role="alert">${this.error}</p>`:d}
109
+ ${this.helpText?l`<p class="help" id="${s(this,Xe)}-help">${this.helpText}</p>`:d}
110
+ </div>`}};oe=new WeakMap,Xe=new WeakMap,ea=new WeakMap,K=new WeakSet,Qr=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,oe).setValidity({customError:!0},this.error,e??void 0):i&&t?.badInput?s(this,oe).setValidity({badInput:!0},this.t(this.type==="time"?"badTime":"badDateTime"),e??void 0):this.required&&!this.value?s(this,oe).setValidity({valueMissing:!0},this.t("required"),e??void 0):!this.multiline&&t?.rangeUnderflow?s(this,oe).setValidity({rangeUnderflow:!0},this.t(this.type==="number"?"numberUnderflow":"rangeUnderflow",{min:o(this,K,Qn).call(this,this.min??"")}),e??void 0):!this.multiline&&t?.rangeOverflow?s(this,oe).setValidity({rangeOverflow:!0},this.t(this.type==="number"?"numberOverflow":"rangeOverflow",{max:o(this,K,Qn).call(this,this.max??"")}),e??void 0):!this.multiline&&this.step&&t?.stepMismatch?s(this,oe).setValidity({stepMismatch:!0},this.t("stepMismatch",o(this,K,ph).call(this,e)),e??void 0):s(this,oe).setValidity({})},Qn=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 c=/^(\d{2}):(\d{2})/.exec(e);return c?Z(new Date(2e3,0,1,+c[1],+c[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 a=new Date(+i[1],+i[2]-1,+i[3],+(i[4]??0),+(i[5]??0));return this.type==="datetime-local"?Z(a,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"},t):Z(a,{day:"numeric",month:"short",year:"numeric"},t)},ph=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),a=e.valueAsNumber,c=document.createElement("input");c.type=this.type,c.value=this.min??"";let h=Number.isFinite(c.valueAsNumber)?c.valueAsNumber:0,u=h+Math.floor((a-h)/i)*i,m=y=>{if(this.type==="number")return this.formatNumber(Number(y.toPrecision(12)));let E=new Date(y).toISOString();return o(this,K,Qn).call(this,this.type==="time"?E.slice(11,16):this.type==="date"?E.slice(0,10):E.slice(0,16))};return{lower:m(u),upper:m(u+i)}},tc=function(e){this.value=e.target.value},uh=function(){o(this,K,Qr).call(this)},ic=function(){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},ft.formAssociated=!0,ft.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},ft.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:{}},ft.styles=[w,b`
111
111
  :host { display: block; }
112
112
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
113
113
  label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -130,13 +130,13 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
130
130
  :host([size='small']) .field { gap: 6px; }
131
131
  :host([size='small']) label { font-size: 12px; }
132
132
  :host([size='small']) .input { font-size: 14px; }
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}
133
+ `];g("cm-text-field",ft);var df=M("checkbox",{required:"Please tick this box."}),gt,Kt,ta,eo,mh,bt=class extends k{constructor(){super(...arguments);p(this,eo);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;p(this,gt,this.attachInternals());p(this,Kt,L("cm-cb"));p(this,ta,!1)}connectedCallback(){super.connectedCallback(),f(this,ta,this.checked)}get form(){return s(this,gt).form}checkValidity(){return s(this,gt).checkValidity()}formResetCallback(){this.checked=s(this,ta)}formDisabledCallback(e){this.disabled=e}updated(){s(this,gt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?s(this,gt).setValidity({valueMissing:!0},this.t("required")):s(this,gt).setValidity({})}render(){let e=this.indeterminate?l`<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>`:l`<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 l`<label for=${s(this,Kt)}>
134
+ <input type="checkbox" id=${s(this,Kt)} .checked=${this.checked} .indeterminate=${this.indeterminate}
135
135
  ?disabled=${this.disabled} ?required=${this.required}
136
- aria-describedby=${this.description?`${s(this,zt)}-d`:c} @change=${n(this,Zr,Kc)} />
136
+ aria-describedby=${this.description?`${s(this,Kt)}-d`:d} @change=${o(this,eo,mh)} />
137
137
  <span class="box" part="box">${e}</span>
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`
138
+ ${this.label||this.description?l`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?l`<span class="desc" id="${s(this,Kt)}-d">${this.description}</span>`:d}</span>`:l`<slot></slot>`}
139
+ </label>`}};gt=new WeakMap,Kt=new WeakMap,ta=new WeakMap,eo=new WeakSet,mh=function(e){let t=e.target;this.checked=t.checked,this.indeterminate=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},bt.formAssociated=!0,bt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},bt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},indeterminate:{type:Boolean},disabled:{type:Boolean,reflect:!0},required:{type:Boolean}},bt.styles=[w,b`
140
140
  :host { display: inline-flex; }
141
141
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
142
142
  input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: inherit; }
@@ -153,12 +153,12 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
153
153
  :host([disabled]) label { cursor: not-allowed; }
154
154
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
155
155
  :host([disabled]) .label { color: var(--cm-text-secondary); }
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)}
157
- aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":c}
158
- aria-describedby=${e??c} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
156
+ `];g("cm-checkbox",bt);var ia,Yt=class extends _{constructor(){super(...arguments);this.label="";this.description="";this.value="";this.checked=!1;this.disabled=!1;this.groupDisabled=!1;this._tabbable=!1;p(this,ia,L("cm-radio"))}render(){let e=this.description?`${s(this,ia)}-d`:null;return l`<div class="radio" part="radio" role="radio" id=${s(this,ia)}
157
+ aria-checked=${this.checked?"true":"false"} aria-disabled=${this.disabled||this.groupDisabled?"true":d}
158
+ aria-describedby=${e??d} tabindex=${this._tabbable&&!this.disabled&&!this.groupDisabled?"0":"-1"}>
159
159
  <span class="dot" part="dot"></span>
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`
160
+ <span class="text"><span class="label">${this.label}<slot></slot></span>${e?l`<span class="desc" id=${e}>${this.description}</span>`:d}</span>
161
+ </div>`}};ia=new WeakMap,Yt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},Yt.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}},Yt.styles=[w,b`
162
162
  :host { display: inline-flex; }
163
163
  .radio { display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; outline: none; }
164
164
  .dot {
@@ -178,16 +178,16 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
178
178
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
179
179
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-default); }
180
180
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
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}
183
- aria-describedby=${e||c}
184
- aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
185
- aria-disabled=${this.disabled?"true":c}>
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`
181
+ `];g("cm-radio",Yt);var bf=M("radioGroup",{required:"Please select one of these options."}),ze,Je,sa,ra,aa,Ai,U,sc,io,Gt,rc,Di,ac,so,ro,to,Wt=class extends k{constructor(){super();p(this,U);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;p(this,ze,this.attachInternals());p(this,Je,L("cm-rg"));p(this,sa,"");p(this,ra,!0);p(this,aa,!1);p(this,Ai,!1);p(this,io,()=>{o(this,U,sc).call(this),s(this,Di).call(this)});p(this,Di,()=>{let e=o(this,U,Gt).call(this),t=!1;for(let a of e)a.checked=!!this.value&&a.value===this.value&&!t,a.checked&&(t=!0),a.groupDisabled=this.disabled;let i=e.find(a=>a.checked&&!a.disabled)??o(this,U,rc).call(this)[0];for(let a of e)a._tabbable=a===i&&!this.disabled});p(this,so,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||o(this,U,ac).call(this,t,!0)});p(this,ro,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=o(this,U,rc).call(this),a=i.indexOf(t),c=ne(e,this),h;if(e.key==="ArrowDown"||c==="ArrowRight")h=i[(a+1)%i.length];else if(e.key==="ArrowUp"||c==="ArrowLeft")h=i[(a-1+i.length)%i.length];else if(e.key===" ")h=t.disabled?void 0:t;else return;e.preventDefault(),h&&o(this,U,ac).call(this,h,!0)});this.addEventListener("keydown",s(this,ro)),this.addEventListener("click",s(this,so))}connectedCallback(){super.connectedCallback(),o(this,U,sc).call(this)}get form(){return s(this,ze).form}get validity(){return s(this,ze).validity}get validationMessage(){return s(this,ze).validationMessage}checkValidity(){return s(this,ze).checkValidity()}reportValidity(){return s(this,ze).reportValidity()}formResetCallback(){this.value=s(this,sa)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(o(this,U,Gt).call(this).find(t=>t._tabbable)??o(this,U,Gt).call(this)[0])?.focus(e)}updated(e){e.has("value")&&s(this,aa)&&!s(this,Ai)&&f(this,ra,!1),f(this,aa,!0),s(this,Di).call(this),s(this,ze).setFormValue(this.value||null,this.value);let t=o(this,U,Gt).call(this)[0];this.error?s(this,ze).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,ze).setValidity({valueMissing:!0},this.t("required"),t):s(this,ze).setValidity({})}render(){let e=[this.error&&`${s(this,Je)}-err`,this.helpText&&`${s(this,Je)}-help`].filter(Boolean).join(" ");return l`<div class="group" role="radiogroup" part="group"
182
+ aria-labelledby=${o(this,U,to).call(this)?`${s(this,Je)}-l`:d} aria-label=${o(this,U,to).call(this)?d:this.getAttribute("aria-label")??d}
183
+ aria-describedby=${e||d}
184
+ aria-required=${this.required?"true":d} aria-invalid=${this.error?"true":d}
185
+ aria-disabled=${this.disabled?"true":d}>
186
+ <span class="label" id="${s(this,Je)}-l" part="label" ?hidden=${!o(this,U,to).call(this)}>${this.label}<slot name="label"></slot>${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>
187
+ ${this.helpText?l`<p class="help" id="${s(this,Je)}-help">${this.helpText}</p>`:d}
188
+ ${this.error?l`<p class="error" id="${s(this,Je)}-err" role="alert">${this.error}</p>`:d}
189
+ <div class="options" part="options"><slot @slotchange=${s(this,io)}></slot></div>
190
+ </div>`}};ze=new WeakMap,Je=new WeakMap,sa=new WeakMap,ra=new WeakMap,aa=new WeakMap,Ai=new WeakMap,U=new WeakSet,sc=function(){s(this,ra)&&(this.value||(f(this,Ai,!0),this.value=o(this,U,Gt).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>f(this,Ai,!1))),f(this,sa,this.value))},io=new WeakMap,Gt=function(){return[...this.querySelectorAll("cm-radio")]},rc=function(){return o(this,U,Gt).call(this).filter(e=>!e.disabled&&!this.disabled)},Di=new WeakMap,ac=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,s(this,Di).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},so=new WeakMap,ro=new WeakMap,to=function(){return!!this.label||!!this.querySelector("[slot=label]")},Wt.formAssociated=!0,Wt.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}},Wt.styles=[w,b`
191
191
  :host { display: block; }
192
192
  .group { display: flex; flex-direction: column; gap: var(--cm-space-10); }
193
193
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -196,13 +196,13 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
196
196
  .error { color: var(--cm-text-critical); }
197
197
  .options { display: flex; flex-direction: column; align-items: flex-start; gap: var(--cm-space-20); padding-top: var(--cm-space-10); }
198
198
  :host([orientation='horizontal']) .options { flex-direction: row; flex-wrap: wrap; column-gap: var(--cm-space-30); }
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}
201
- aria-label=${e?c:this.getAttribute("aria-label")??c}
202
- aria-describedby=${this.description?`${s(this,Ct)}-d`:c} @change=${n(this,an,Wc)} />
199
+ `];g("cm-radio-group",Wt);var Ni,Xt,na,ao,fh,vt=class extends _{constructor(){super(...arguments);p(this,ao);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.disabled=!1;p(this,Ni,this.attachInternals());p(this,Xt,L("cm-tg"));p(this,na,!1)}connectedCallback(){super.connectedCallback(),f(this,na,this.checked)}get form(){return s(this,Ni).form}checkValidity(){return s(this,Ni).checkValidity()}formResetCallback(){this.checked=s(this,na)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.checked=e!=null}updated(){s(this,Ni).setFormValue(this.checked?this.value:null)}render(){let e=this.label||this.description||this.textContent?.trim();return l`<label for=${s(this,Xt)}>
200
+ <input type="checkbox" role="switch" id=${s(this,Xt)} .checked=${this.checked} ?disabled=${this.disabled}
201
+ aria-label=${e?d:this.getAttribute("aria-label")??d}
202
+ aria-describedby=${this.description?`${s(this,Xt)}-d`:d} @change=${o(this,ao,fh)} />
203
203
  <span class="track" part="track"><span class="thumb" part="thumb"></span></span>
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`
204
+ ${e?l`<span class="text"><span class="label">${this.label}<slot></slot></span>${this.description?l`<span class="desc" id="${s(this,Xt)}-d">${this.description}</span>`:d}</span>`:d}
205
+ </label>`}};Ni=new WeakMap,Xt=new WeakMap,na=new WeakMap,ao=new WeakSet,fh=function(e){this.checked=e.target.checked,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},vt.formAssociated=!0,vt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},vt.properties={label:{},description:{},name:{reflect:!0},value:{},checked:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0}},vt.styles=[w,b`
206
206
  :host { display: inline-flex; }
207
207
  label { position: relative; display: inline-flex; align-items: flex-start; gap: var(--cm-space-10); cursor: pointer; }
208
208
  input { position: absolute; opacity: 0; width: 38px; height: 20px; margin: 0; cursor: inherit; }
@@ -227,32 +227,54 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
227
227
  :host([disabled]) .track { opacity: .5; }
228
228
  :host([disabled]) .label { color: var(--cm-text-secondary); }
229
229
  @media (prefers-reduced-motion: reduce) { .track, .thumb { transition: none; } }
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}
230
+ `];g("cm-toggle",vt);var no=b`
231
+ .pop {
232
+ position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
233
+ background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
234
+ border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-100); overflow: hidden;
235
+ }
236
+ .pop[hidden] { display: none; }
237
+ .message { display: flex; align-items: center; gap: var(--cm-space-10); margin: 0; padding: var(--cm-space-15) var(--cm-space-20); font-size: 14px; color: var(--cm-text-tertiary); }
238
+ .vh {
239
+ position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
240
+ clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
241
+ }
242
+ `;function oo(n,r,e){let t=i=>{r()&&!i.composedPath().includes(n)&&e()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)}var Ri=b`
243
+ [role='group'] + [role='group'] { margin-block-start: 6px; padding-block-start: 6px; border-top: var(--cm-border-1) solid var(--cm-border-default); }
244
+ [role='option'] + [role='group'], [role='group'] + [role='option'] { margin-block-start: 6px; padding-block-start: 6px; border-top: var(--cm-border-1) solid var(--cm-border-default); }
245
+ .gh {
246
+ display: flex; align-items: baseline; gap: var(--cm-space-10); padding: 6px var(--cm-space-20) 2px;
247
+ font-size: 12px; line-height: 16px; font-weight: 600; color: var(--cm-text-default);
248
+ }
249
+ .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
250
+ .gopts { list-style: none; margin: 0; padding: 0; }
251
+ `;function Hi(n){if(!n.some(t=>t.group))return n;let r=[],e=new Map;for(let t of n)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let a=[t];e.set(t.group,a),r.push({key:t.group,items:a})}}else{let i=r[r.length-1];i&&!i.key?i.items.push(t):r.push({key:"",items:[t]})}return r.flatMap(t=>t.items)}function lo(n){let r=[];return n.forEach((e,t)=>{let i=e.group||"",a=r[r.length-1];a&&a.group===i?a.rows.push({row:e,index:t}):r.push({group:i,rows:[{row:e,index:t}]})}),r}var zf=M("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),Le,Q,Oi,He,qi,la,A,nc,oc,oa,Ii,Jt,xt,co,ho,ca,po,bh,uo,yt=class extends k{constructor(){super(...arguments);p(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.showGroup=!1;this._active=-1;this._slotted=[];p(this,Le,this.attachInternals());p(this,Q,L("cm-sel"));p(this,Oi,"");p(this,He,"");p(this,qi,0);p(this,la,new MutationObserver(()=>o(this,A,nc).call(this)));p(this,ho,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),o(this,A,oa).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),o(this,A,oa).call(this),o(this,A,xt).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=o(this,A,co).call(this,t);o(this,A,oa).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?o(this,A,Jt).call(this,this._active):o(this,A,xt).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?o(this,A,Jt).call(this,this._active):o(this,A,xt).call(this,-1);break;case"Home":e.preventDefault(),o(this,A,xt).call(this,"first");break;case"End":e.preventDefault(),o(this,A,xt).call(this,"last");break;case"PageDown":e.preventDefault(),o(this,A,xt).call(this,10);break;case"PageUp":e.preventDefault(),o(this,A,xt).call(this,-10);break;case"Enter":e.preventDefault(),o(this,A,Jt).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),o(this,A,Ii).call(this);break;case"Tab":o(this,A,Jt).call(this,this._active);break;case" ":if(e.preventDefault(),s(this,He)&&Date.now()-s(this,qi)<500){let i=o(this,A,co).call(this," ");i>=0&&(this._active=i)}else o(this,A,Jt).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=o(this,A,co).call(this,t);i>=0&&(this._active=i)}}});p(this,ca,e=>{this.open&&!e.composedPath().includes(this)&&o(this,A,Ii).call(this)});p(this,po,()=>{this.disabled||(this.open?o(this,A,Ii).call(this):o(this,A,oa).call(this))});p(this,uo,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),o(this,A,nc).call(this),s(this,la).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",s(this,ca),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,la).disconnect(),document.removeEventListener("pointerdown",s(this,ca),!0)}get form(){return s(this,Le).form}get validity(){return s(this,Le).validity}get validationMessage(){return s(this,Le).validationMessage}checkValidity(){return s(this,Le).checkValidity()}reportValidity(){return s(this,Le).reportValidity()}formResetCallback(){this.value=s(this,Oi),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?Hi(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):Hi(this._slotted)}firstUpdated(){s(this,Oi)||f(this,Oi,this.value)}updated(e){s(this,Le).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?s(this,Le).setValidity({customError:!0},this.error,t):this.required&&!this.value?s(this,Le).setValidity({valueMissing:!0},this.t("required"),t):s(this,Le).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${s(this,Q)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(h=>h.value===this.value),i=[this.error&&`${s(this,Q)}-err`,this.helpText&&`${s(this,Q)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),c=(h,u)=>l`<li role="option" id="${s(this,Q)}-o${u}" class=${u===this._active?"active":""}
252
+ aria-selected=${h.value===this.value?"true":"false"} aria-disabled=${h.disabled?"true":d}
253
+ @pointerenter=${()=>!h.disabled&&(this._active=u)} @click=${()=>o(this,A,Jt).call(this,u)}>${h.label}</li>`;return l`<div class="field">
254
+ ${this.label?l`<span class="label" id="${s(this,Q)}-l" part="label" @click=${s(this,uo)}>${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
232
255
  <div class="wrap">
233
256
  <div class="box" part="box" role="combobox" tabindex=${this.disabled?"-1":"0"}
234
- aria-labelledby=${this.label?`${s(this,G)}-l`:c}
235
- aria-label=${!this.label&&l?l: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}
238
- aria-required=${this.required?"true":c} aria-invalid=${this.error?"true":c}
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>
257
+ aria-labelledby=${this.label?`${s(this,Q)}-l`:d}
258
+ aria-label=${!this.label&&a?a:d}
259
+ aria-haspopup="listbox" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Q)}-list"
260
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,Q)}-o${this._active}`:d}
261
+ aria-required=${this.required?"true":d} aria-invalid=${this.error?"true":d}
262
+ aria-disabled=${this.disabled?"true":d} aria-describedby=${i||d}
263
+ @click=${s(this,po)} @keydown=${s(this,ho)} @blur=${()=>o(this,A,Ii).call(this)}>
264
+ <span class="text ${t?"":"placeholder"}" id="${s(this,Q)}-v">${t?o(this,A,bh).call(this,t):this.placeholder}</span>
242
265
  <cm-icon class="chev" name="chevron-down" size="16"></cm-icon>
243
266
  </div>
244
- <ul role="listbox" id="${s(this,G)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,G)}-l`:c}
245
- aria-label=${!this.label&&l?l:c} ?hidden=${!this.open}
246
- @pointerdown=${d=>d.preventDefault()}>
247
- ${e.map((d,p)=>o`<li role="option" id="${s(this,G)}-o${p}" class=${p===this._active?"active":""}
248
- aria-selected=${d.value===this.value?"true":"false"} aria-disabled=${d.disabled?"true":c}
249
- @pointerenter=${()=>!d.disabled&&(this._active=p)} @click=${()=>n(this,A,At).call(this,p)}>${d.label}</li>`)}
267
+ <ul role="listbox" id="${s(this,Q)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${s(this,Q)}-l`:d}
268
+ aria-label=${!this.label&&a?a:d} ?hidden=${!this.open}
269
+ @pointerdown=${h=>h.preventDefault()}>
270
+ ${lo(e).map((h,u)=>h.group?l`<li role="group" aria-labelledby="${s(this,Q)}-g${u}"><div role="presentation" class="gh" id="${s(this,Q)}-g${u}">${h.group}</div>
271
+ <ul role="none" class="gopts">${h.rows.map(({row:m,index:y})=>c(m,y))}</ul></li>`:h.rows.map(({row:m,index:y})=>c(m,y)))}
250
272
  </ul>
251
273
  </div>
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}
274
+ ${this.error?l`<p class="error" id="${s(this,Q)}-err" role="alert">${this.error}</p>`:d}
275
+ ${this.helpText?l`<p class="help" id="${s(this,Q)}-help">${this.helpText}</p>`:d}
254
276
  <slot></slot>
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`
277
+ </div>`}};Le=new WeakMap,Q=new WeakMap,Oi=new WeakMap,He=new WeakMap,qi=new WeakMap,la=new WeakMap,A=new WeakSet,nc=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,a={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(a.group=i.label),a}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,Oi,this.value))},oc=function(){return this.items.flatMap((e,t)=>e.disabled?[]:[t])},oa=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:o(this,A,oc).call(this)[0]??-1)},Ii=function(){this.open=!1},Jt=function(e){let t=this.items[e];!t||t.disabled||(o(this,A,Ii).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}))))},xt=function(e){let t=o(this,A,oc).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))]},co=function(e){let t=Date.now();f(this,He,t-s(this,qi)>500?e:s(this,He)+e),f(this,qi,t);let i=this.items,a=this._active<0?0:this._active,c=s(this,He).split("").every(m=>m===s(this,He)[0]),h=c?s(this,He)[0]:s(this,He),u=c||s(this,He).length===1?a+1:a;for(let m=0;m<i.length;m++){let y=(u+m)%i.length;if(!i[y].disabled&&i[y].label.toLowerCase().startsWith(h.toLowerCase()))return y}return-1},ho=new WeakMap,ca=new WeakMap,po=new WeakMap,bh=function(e){return this.showGroup&&e.group?this.t("grouped",{group:e.group,label:e.label}):e.label},uo=new WeakMap,yt.formAssociated=!0,yt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},yt.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},showGroup:{type:Boolean,attribute:"show-group"},_active:{state:!0},_slotted:{state:!0}},yt.styles=[w,Ri,b`
256
278
  :host { display: block; position: relative; }
257
279
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
258
280
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); cursor: default; }
@@ -284,21 +306,22 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
284
306
  [role='option'][aria-selected='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
285
307
  [role='option'][aria-selected='true'].active { background: var(--cm-action-primary-hover); }
286
308
  [role='option'][aria-disabled='true'] { color: var(--cm-text-secondary); cursor: not-allowed; }
309
+ [role='group'] { display: block; }
287
310
  .help, .error { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
288
311
  .error { color: var(--cm-text-critical); }
289
312
  slot { display: none; }
290
313
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
291
314
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
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">
315
+ `];g("cm-select",yt);var Hf=M("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),Bi,mo,da,de,Pi,gh,vh,lc,wt=class extends k{constructor(){super(...arguments);p(this,de);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;p(this,Bi,this.attachInternals());p(this,mo,L("cm-search"));p(this,da,"")}connectedCallback(){super.connectedCallback(),f(this,da,this.value)}get form(){return s(this,Bi).form}checkValidity(){return s(this,Bi).checkValidity()}formResetCallback(){this.value=s(this,da)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){s(this,Bi).setFormValue(this.value)}render(){let e=this.size==="large";return l`<div class="box" part="box">
293
316
  <cm-icon class="icon" name="search" size=${e?16:14}></cm-icon>
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}
317
+ <input id=${s(this,mo)} part="input" type="search" enterkeyhint="search" autocomplete="off"
318
+ aria-label=${this.label} .value=${se(this.value)} placeholder=${this.placeholder||d} ?disabled=${this.disabled}
319
+ @input=${o(this,de,gh)} @change=${()=>o(this,de,Pi).call(this,"change")} @keydown=${o(this,de,vh)} />
320
+ ${this.value&&!this.disabled?l`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${o(this,de,lc)}><cm-icon name="close" size="14"></cm-icon></button>`:d}
321
+ ${this.filter?l`<button type="button" class="filter" part="filter" ?disabled=${this.disabled}
299
322
  aria-label=${this.filterCount>0?this.t("filterApplied",{label:this.filterLabel,count:this.filterCount}):this.filterLabel}
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`
323
+ @click=${()=>o(this,de,Pi).call(this,"cm-filter")}><cm-icon name="filter" size="18"></cm-icon>${this.filterCount>0?l`<span class="count" aria-hidden="true">${this.filterCount}</span>`:d}</button>`:d}
324
+ </div>`}};Bi=new WeakMap,mo=new WeakMap,da=new WeakMap,de=new WeakSet,Pi=function(e,t){this.dispatchEvent(t===void 0?new Event(e,{bubbles:!0,composed:!0}):new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},gh=function(e){this.value=e.target.value},vh=function(e){e.key==="Enter"?o(this,de,Pi).call(this,"cm-search",{value:this.value}):e.key==="Escape"&&this.value&&(e.preventDefault(),o(this,de,lc).call(this))},lc=function(){this.value="",this.renderRoot.querySelector("input")?.focus(),o(this,de,Pi).call(this,"input"),o(this,de,Pi).call(this,"change")},wt.formAssociated=!0,wt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},wt.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}},wt.styles=[w,b`
302
325
  :host { display: block; }
303
326
  .box {
304
327
  display: flex; align-items: center; gap: var(--cm-space-10); height: 42px; padding: 0 var(--cm-space-10);
@@ -328,19 +351,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
328
351
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-default); }
329
352
  :host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
330
353
  :host([disabled]) button { cursor: not-allowed; }
331
- `];f("cm-search",nt);var dn=u`
332
- .pop {
333
- position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline: 0;
334
- background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-default);
335
- border-radius: var(--cm-radius-md); box-shadow: var(--cm-shadow-100); overflow: hidden;
336
- }
337
- .pop[hidden] { display: none; }
338
- .message { display: flex; align-items: center; gap: var(--cm-space-10); margin: 0; padding: var(--cm-space-15) var(--cm-space-20); font-size: 14px; color: var(--cm-text-tertiary); }
339
- .vh {
340
- position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
341
- clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
342
- }
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`
354
+ `];g("cm-search",wt);var Ff=M("tag",{remove:"Remove {label}"}),fo,xh,ji=class extends k{constructor(){super(...arguments);p(this,fo);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return l`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?l`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${o(this,fo,xh)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:d}</span>`}};fo=new WeakSet,xh=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},ji.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},ji.styles=[w,b`
344
355
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
345
356
  .tag {
346
357
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 26px; padding: 0 var(--cm-space-10);
@@ -358,13 +369,13 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
358
369
  :host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-default); }
359
370
  :host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); }
360
371
  @media (max-width: 640px) { .tag { height: 22px; } button { width: 18px; height: 18px; } }
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">
372
+ `];g("cm-tag",ji);var Fi=class extends k{constructor(){super(...arguments);this.size="large"}render(){let e=this.size==="small"?2.5:3;return l`<span class="spinner" part="spinner" role="status">
362
373
  <svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
363
374
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
364
375
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
365
376
  </svg>
366
377
  <span class="vh">${this.accessibleLabel||this.t("loading")}</span>
367
- </span>`}};fi.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},fi.styles=[v,u`
378
+ </span>`}};Fi.properties={size:{reflect:!0},accessibleLabel:{attribute:"accessible-label",string:"loading"}},Fi.styles=[w,b`
368
379
  :host { display: inline-flex; vertical-align: middle; color: var(--cm-border-strong); }
369
380
  .spinner { display: inline-flex; }
370
381
  svg { inline-size: 44px; block-size: 44px; animation: spin 0.8s linear infinite; }
@@ -377,42 +388,43 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
377
388
  }
378
389
  @keyframes spin { to { transform: rotate(360deg); } }
379
390
  @media (prefers-reduced-motion: reduce) { svg { animation-duration: 2.4s; } }
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}
391
+ `];g("cm-spinner",Fi);var ib=M("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.",grouped:"{group}: {label}"}),be,ee,fa,Ki,ba,ga,va,C,cc,yh,ha,bo,pa,Vi,Ui,$t,wh,ua,dc,hc,ma,go,vo,xo,$h,kt=class extends k{constructor(){super(...arguments);p(this,C);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.showGroup=!1;this._query="";this._active=-1;this._slotted=[];this._typing=!1;p(this,be,this.attachInternals());p(this,ee,L("cm-cb"));p(this,fa,null);p(this,Ki,new Map);p(this,ba,new Map);p(this,ga,new MutationObserver(()=>o(this,C,cc).call(this)));p(this,va);p(this,go,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,o(this,C,Ui).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});p(this,vo,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?o(this,C,ua).call(this,1):(o(this,C,Ui).call(this),e.altKey||o(this,C,ua).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?o(this,C,ua).call(this,-1):(o(this,C,Ui).call(this),o(this,C,ua).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),o(this,C,dc).call(this,this._active)):s(this,C,bo)&&(e.preventDefault(),o(this,C,hc).call(this,s(this,C,bo)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),o(this,C,$t).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",o(this,C,Vi).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,C,$t).call(this);break;default:}});p(this,xo,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(o(this,C,$t).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?o(this,C,ha).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),o(this,C,cc).call(this),s(this,ga).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),f(this,va,oo(this,()=>this.open,()=>o(this,C,$t).call(this)))}disconnectedCallback(){var e;super.disconnectedCallback(),s(this,ga).disconnect(),(e=s(this,va))==null||e.call(this)}get form(){return s(this,be).form}get validity(){return s(this,be).validity}get validationMessage(){return s(this,be).validationMessage}checkValidity(){return s(this,be).checkValidity()}reportValidity(){return s(this,be).reportValidity()}formResetCallback(){let e=s(this,fa)??{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(`
392
+ `):[]:this.value=e)}get items(){return this.options?.length?Hi(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):Hi(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(){f(this,fa,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)s(this,Ki).set(t.value,t.label),t.group&&s(this,ba).set(t.value,t.group);if((e.has("value")||e.has("options")||e.has("_slotted")||e.has("showGroup"))&&!this.multiple&&!this._typing&&(this._query=this.value?o(this,C,ha).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=o(this,C,pa).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 a=new FormData;for(let c of this.values)a.append(this.name,c);s(this,be).setFormValue(a,this.values.join(`
393
+ `))}else s(this,be).setFormValue(null);else s(this,be).setFormValue(this.value||null,this.value);let i=this.multiple?!this.values.length:!this.value;this.error?s(this,be).setValidity({customError:!0},this.error,t):this.required&&i?s(this,be).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),t):s(this,be).setValidity({}),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,ee)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),o(this,C,Vi).call(this))}render(){let e=o(this,C,pa).call(this),t=[this.error&&`${s(this,ee)}-err`,this.helpText&&`${s(this,ee)}-help`].filter(Boolean).join(" "),i=this.getAttribute("aria-label"),a=u=>this.multiple?this.values.includes(u):u===this.value,c=(u,m)=>l`<li role="option" id="${s(this,ee)}-o${m}" class=${m===this._active?"active":""}
394
+ aria-selected=${u.create?"false":a(u.value)?"true":"false"} aria-disabled=${u.disabled?"true":d}
395
+ @pointerenter=${()=>!u.disabled&&(this._active=m)} @click=${()=>o(this,C,dc).call(this,m)}>
396
+ ${u.create?l`<cm-icon name="plus" size="16"></cm-icon><span class="create">${this.t("add",{value:u.label})}</span>`:l`${this.multiple?l`<cm-icon class="check" name="check" size="16"></cm-icon>`:d}<span>${o(this,C,$h).call(this,u.label)}</span>`}</li>`,h=this.loading?this.loadingText||this.t("loading"):this.open?e.length?this.t("results",{count:e.length}):this.emptyText||this.t("noResults"):"";return l`<div class="field">
397
+ ${this.label?l`<label class="label" id="${s(this,ee)}-l" for="${s(this,ee)}-in" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</label>`:d}
384
398
  <div class="wrap">
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}
393
- aria-invalid=${this.error?"true":c} aria-describedby=${t||c}
394
- aria-required=${this.required?"true":c} ?disabled=${this.disabled}
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>
399
+ <div class="box" part="box" @click=${u=>{u.target.closest("cm-tag")||o(this,C,ma).call(this)}}>
400
+ ${this.multiple?this.values.map(u=>l`<cm-tag removable ?disabled=${this.disabled} remove-label=${this.t("remove",{label:o(this,C,ha).call(this,u)})}
401
+ @cm-remove=${()=>{this.removeValue(u),o(this,C,ma).call(this)}}>${o(this,C,ha).call(this,u)}</cm-tag>`):d}
402
+ <input id="${s(this,ee)}-in" part="input" type="text" role="combobox" autocomplete="off" spellcheck="false"
403
+ .value=${se(this._query)} placeholder=${this.multiple&&this.values.length?d:this.placeholder||d}
404
+ aria-label=${!this.label&&i?i:d}
405
+ aria-autocomplete="list" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,ee)}-list"
406
+ aria-activedescendant=${this.open&&this._active>=0?`${s(this,ee)}-o${this._active}`:d}
407
+ aria-invalid=${this.error?"true":d} aria-describedby=${t||d}
408
+ aria-required=${this.required?"true":d} ?disabled=${this.disabled}
409
+ @input=${s(this,go)} @keydown=${s(this,vo)} @blur=${s(this,xo)}
410
+ @click=${()=>{this.open||o(this,C,Ui).call(this)}} @change=${u=>u.stopPropagation()} />
411
+ <cm-icon class="chev" name="chevron-down" size="16" @click=${()=>{this.open?o(this,C,$t).call(this):(o(this,C,Ui).call(this),o(this,C,ma).call(this))}}></cm-icon>
398
412
  </div>
399
- <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${p=>p.preventDefault()}>
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}
402
- aria-multiselectable=${this.multiple?"true":c}>
403
- ${e.map((p,m)=>o`<li role="option" id="${s(this,X)}-o${m}" class=${m===this._active?"active":""}
404
- aria-selected=${p.create?"false":l(p.value)?"true":"false"} aria-disabled=${p.disabled?"true":c}
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>`)}
413
+ <div class="pop" part="popover" ?hidden=${!this.open} @pointerdown=${u=>u.preventDefault()}>
414
+ <ul role="listbox" id="${s(this,ee)}-list" part="listbox" ?hidden=${!e.length}
415
+ aria-labelledby=${this.label?`${s(this,ee)}-l`:d} aria-label=${!this.label&&i?i:d}
416
+ aria-multiselectable=${this.multiple?"true":d}>
417
+ ${lo(e).map((u,m)=>u.group?l`<li role="group" aria-labelledby="${s(this,ee)}-g${m}"><div role="presentation" class="gh" id="${s(this,ee)}-g${m}">${u.group}</div>
418
+ <ul role="none" class="gopts">${u.rows.map(({row:y,index:v})=>c(y,v))}</ul></li>`:u.rows.map(({row:y,index:v})=>c(y,v)))}
407
419
  </ul>
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>`}
420
+ ${this.loading?l`<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?d:l`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
409
421
  </div>
410
422
  </div>
411
- <span class="vh" role="status" aria-live="polite">${d}</span>
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}
423
+ <span class="vh" role="status" aria-live="polite">${h}</span>
424
+ ${this.error?l`<p class="error" id="${s(this,ee)}-err" role="alert">${this.error}</p>`:d}
425
+ ${this.helpText?l`<p class="help" id="${s(this,ee)}-help">${this.helpText}</p>`:d}
414
426
  <slot></slot>
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`
427
+ </div>`}};be=new WeakMap,ee=new WeakMap,fa=new WeakMap,Ki=new WeakMap,ba=new WeakMap,ga=new WeakMap,va=new WeakMap,C=new WeakSet,cc=function(){let e=[...this.querySelectorAll("option")];if(this._slotted=e.map(t=>{let i=t.parentElement?.localName==="optgroup"?t.parentElement:null,a={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled||!!i?.disabled};return i?.label&&(a.group=i.label),a}),!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])}},yh=function(e){return this.items.find(t=>t.value===e)?.label??s(this,Ki).get(e)??e},ha=function(e){let t=o(this,C,yh).call(this,e);if(!this.showGroup)return t;let i=this.items.find(a=>a.value===e)?.group??s(this,ba).get(e);return i?this.t("grouped",{group:i,label:t}):t},bo=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},pa=function(){let e=this.loading?[]:[...this.filteredItems],t=s(this,C,bo);return t&&!this.loading&&e.push({value:t,label:t,create:!0}),e},Vi=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ui=function(){this.disabled||(this.open=!0)},$t=function(){this.open=!1,this._active=-1},wh=function(e=o(this,C,pa).call(this)){return e.flatMap((t,i)=>t.disabled?[]:[i])},ua=function(e){let t=o(this,C,wh).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]},dc=function(e){let t=o(this,C,pa).call(this)[e];if(!(!t||t.disabled)){if(t.create){o(this,C,hc).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,o(this,C,Vi).call(this),o(this,C,ma).call(this);return}o(this,C,$t).call(this),this._typing=!1,this._query=this.showGroup&&t.group?this.t("grouped",{group:t.group,label:t.label}):t.label,t.value!==this.value&&(this.value=t.value,o(this,C,Vi).call(this))}},hc=function(e){this.dispatchEvent(new CustomEvent("cm-create",{detail:{value:e},bubbles:!0,composed:!0,cancelable:!0}))&&(s(this,Ki).set(e,e),this.multiple?(this.values=[...this.values,e],this._query="",this._typing=!1,this._active=-1):(o(this,C,$t).call(this),this.value=e,this._typing=!1,this._query=e),o(this,C,Vi).call(this))},ma=function(){this.renderRoot.querySelector("input")?.focus()},go=new WeakMap,vo=new WeakMap,xo=new WeakMap,$h=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:l`${e.slice(0,i)}<mark>${e.slice(i,i+t.length)}</mark>${e.slice(i+t.length)}`},kt.formAssociated=!0,kt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},kt.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},showGroup:{type:Boolean,attribute:"show-group"},_query:{state:!0},_active:{state:!0},_slotted:{state:!0},_typing:{state:!0}},kt.styles=[w,no,Ri,b`
416
428
  :host { display: block; position: relative; }
417
429
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
418
430
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -454,32 +466,32 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
454
466
  slot { display: none; }
455
467
  @media (max-width: 640px) { [role='option'] { font-size: 14px; min-height: 30px; padding-inline: var(--cm-space-15); } }
456
468
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
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()}}>
469
+ `];g("cm-combobox",kt);var db=M("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),Se,xa,B,yo,wo,Gi,pc,$o,kh,ko,ya,uc,Eh,Zt=class extends k{constructor(){super(...arguments);p(this,B);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;p(this,Se,L("cm-gs"));p(this,xa);p(this,$o,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),o(this,B,pc).call(this)});p(this,ko,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),o(this,B,kh).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":s(this,B,wo)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${s(this,Se)}-o${this._active}`)?.click());break;case"Escape":s(this,B,wo)?(e.preventDefault(),e.stopPropagation(),o(this,B,Gi).call(this)):this.value&&(e.preventDefault(),o(this,B,uc).call(this,!1));break;case"Tab":o(this,B,Gi).call(this);break;default:}});p(this,ya,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,xa,oo(this,()=>this.open,()=>o(this,B,Gi).call(this))),document.addEventListener("keydown",s(this,ya))}disconnectedCallback(){var e;super.disconnectedCallback(),(e=s(this,xa))==null||e.call(this),document.removeEventListener("keydown",s(this,ya))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=o(this,B,yo).call(this).length&&(this._active=-1)}updated(e){(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${s(this,Se)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=o(this,B,yo).call(this),t=s(this,B,wo),i=e.filter(m=>m.item).length,a=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",c=-1,h=(this.results??[]).filter(m=>m?.items?.length),u=(m,y,v="")=>{c++;let E=c;return l`<a role="option" id="${s(this,Se)}-o${E}" class="${v}${E===this._active?" active":""}" href=${m.href} tabindex="-1"
470
+ aria-selected=${E===this._active?"true":"false"} @pointerenter=${()=>this._active=E}
471
+ @click=${$=>o(this,B,Eh).call(this,$,m)}>${y}</a>`};return l`<div class="wrap">
472
+ <div class="box" part="box" @click=${m=>{m.target===m.currentTarget&&this.focus()}}>
461
473
  <cm-icon class="icon" name="search" size="14"></cm-icon>
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}
466
- aria-keyshortcuts=${this.shortcut||c}
467
- @input=${s(this,xn)} @keydown=${s(this,yn)}
474
+ <input id="${s(this,Se)}-in" part="input" type="search" role="combobox" enterkeyhint="search" autocomplete="off" spellcheck="false"
475
+ aria-label=${this.label} placeholder=${this.placeholder||d} .value=${se(this.value)}
476
+ aria-autocomplete="list" aria-expanded=${t?"true":"false"} aria-controls="${s(this,Se)}-list"
477
+ aria-activedescendant=${t&&this._active>=0?`${s(this,Se)}-o${this._active}`:d}
478
+ aria-keyshortcuts=${this.shortcut||d}
479
+ @input=${s(this,$o)} @keydown=${s(this,ko)}
468
480
  @focus=${()=>{this.value.trim()&&(this.open=!0)}} @click=${()=>{this.value.trim()&&(this.open=!0)}} />
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}
481
+ ${this.value?l`<button type="button" class="clear" part="clear" aria-label=${this.t("clear")} @click=${()=>o(this,B,uc).call(this)}><cm-icon name="close" size="14"></cm-icon></button>`:this.shortcut?l`<kbd aria-hidden="true">${this.shortcut}</kbd>`:d}
470
482
  </div>
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}
483
+ <div class="pop" part="popover" ?hidden=${!t} @pointerdown=${m=>m.preventDefault()}>
484
+ <div role="listbox" id="${s(this,Se)}-list" part="listbox" aria-label=${this.label} ?hidden=${!e.length}>
485
+ ${h.map((m,y)=>{let v=m.total??m.items.length;return l`<div role="group" aria-labelledby="${s(this,Se)}-g${y}">
486
+ <div role="presentation" class="gh" id="${s(this,Se)}-g${y}"><span>${m.label}</span><span class="count" aria-hidden="true">${this.formatNumber(v)}</span><span class="vh">, ${this.t("results",{count:v})}</span></div>
487
+ ${m.items.map(E=>u({group:m,item:E,href:E.href},l`${E.icon?l`<cm-icon name=${E.icon} size="16"></cm-icon>`:d}<span class="text"><span class="title">${E.title}</span>${E.description?l`<span class="vh">, </span><span class="desc">${E.description}</span>`:d}</span>`))}
488
+ ${m.href?u({group:m,href:m.href},l`<span class="text">${m.seeAllLabel||this.seeAllLabel}</span>`,"all"):d}
477
489
  </div>`})}
478
490
  </div>
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>`}
491
+ ${this.loading?l`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?d:l`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
480
492
  </div>
481
- <span class="vh" role="status" aria-live="polite">${l}</span>
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`
493
+ <span class="vh" role="status" aria-live="polite">${a}</span>
494
+ </div>`}};Se=new WeakMap,xa=new WeakMap,B=new WeakSet,yo=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}]:[]])},wo=function(){return this.open&&!!this.value.trim()},Gi=function(){this.open=!1,this._active=-1},pc=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},$o=new WeakMap,kh=function(e){let t=o(this,B,yo).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},ko=new WeakMap,ya=new WeakMap,uc=function(e=!0){this.value="",o(this,B,Gi).call(this),e&&this.renderRoot.querySelector("input")?.focus(),o(this,B,pc).call(this)},Eh=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,B,Gi).call(this)},Zt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},Zt.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}},Zt.styles=[w,no,Ri,b`
483
495
  :host { display: block; position: relative; }
484
496
  .wrap { position: relative; }
485
497
  .box {
@@ -514,12 +526,6 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
514
526
  }
515
527
  [role='listbox'] { padding-block: 6px; }
516
528
  [role='listbox'][hidden] { display: none; }
517
- [role='group'] + [role='group'] { margin-block-start: 6px; padding-block-start: 6px; border-top: var(--cm-border-1) solid var(--cm-border-default); }
518
- .gh {
519
- display: flex; align-items: baseline; gap: var(--cm-space-10); padding: 6px var(--cm-space-20) 2px;
520
- font-size: 12px; line-height: 16px; font-weight: 600; color: var(--cm-text-default);
521
- }
522
- .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
523
529
  [role='option'] {
524
530
  display: flex; align-items: center; gap: var(--cm-space-10); min-height: 40px; padding: 6px var(--cm-space-20);
525
531
  font-size: 14px; line-height: 20px; color: var(--cm-text-default); text-decoration: none; cursor: pointer;
@@ -531,20 +537,20 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
531
537
  .title, .desc { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
532
538
  .desc { font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); }
533
539
  .all { font-size: 13px; text-decoration: underline; }
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>
540
+ `];g("cm-global-search",Zt);var qu=/^(\d{4})-(\d{2})-(\d{2})$/;function R(n){let r=qu.exec(n??"");if(!r)return null;let e=new Date(+r[1],+r[2]-1,+r[3]);return e.getFullYear()===+r[1]&&e.getMonth()===+r[2]-1&&e.getDate()===+r[3]?e:null}var Be=(n,r=2)=>String(n).padStart(r,"0"),he=n=>`${Be(n.getFullYear(),4)}-${Be(n.getMonth()+1)}-${Be(n.getDate())}`,Pu=()=>he(new Date),ge=(n,r)=>new Date(n.getFullYear(),n.getMonth(),n.getDate()+r);function je(n,r){let e=new Date(n.getFullYear(),n.getMonth()+r,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(n.getDate(),t))}var Qt=n=>new Date(n.getFullYear(),n.getMonth(),1),Eo=n=>new Date(n.getFullYear(),n.getMonth()+1,0);var Bu=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function ei(n){let r=Bu.exec(n??"");return r?+r[1]*60+ +r[2]:null}var wa=n=>{let r=(Math.round(n)%1440+1440)%1440;return`${Be(Math.floor(r/60))}:${Be(r%60)}`};function ti(n){let[r="",e=""]=(n??"").split("T"),t=ei(e);return{date:R(r)?r:"",time:t===null?"":wa(t)}}function $a(n,r=!1){let{date:e,time:t}=ti(n),i=R(e);if(!i)return null;let a=t?ei(t):r?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(a/60),a%60)}var _h=()=>{let n=new Date;return`${he(n)}T${Be(n.getHours())}:${Be(n.getMinutes())}`},Mh=new Map;function Ch(n,r){let e=r==="h12"||r==="h23"?r:void 0,t=`${n}|${e??""}`,i=Mh.get(t);if(i)return i;let a={hour:"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},c=new Intl.DateTimeFormat(n,a),h=c.resolvedOptions().hourCycle,u=T=>new Date(2e3,0,1,T,30),m=T=>(new Intl.DateTimeFormat(n,{hour:"numeric",hourCycle:"h12"}).formatToParts(u(T)).find(D=>D.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),y=(T,D)=>[...new Set([T,...D].filter(Boolean))],v=T=>T.replace(/[\u202f\u00a0]/g," "),E=v(c.formatToParts(u(9)).map(T=>T.type==="hour"?"{h}":T.type==="minute"?"{m}":T.value).join("")),$={format:T=>v(c.format(new Date(2e3,0,1,Math.floor(T/60),T%60))),dateTime:T=>Z(T,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},n),pattern:E,hour12:h==="h12"||h==="h11",am:y(m(9),["am","a"]),pm:y(m(15),["pm","p"])};return Mh.set(t,$),$}var zh=(n,r)=>n.pattern.replace(/\{([hm])\}/g,(e,t)=>r[t]);function mc(n,r){let e=n.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&r.pm.includes(t),a=!!t&&r.am.includes(t);if(t&&!i&&!a)return null;let c=e.match(/\d+/g)??[],h,u;if(c.length===1){let m=c[0];if(m.length<=2)h=+m,u=0;else if(m.length<=4)h=+m.slice(0,-2),u=+m.slice(-2);else return null}else if(c.length===2||c.length===3){if(c[0].length>2||c[1].length!==2)return null;h=+c[0],u=+c[1]}else return null;if(u>59)return null;if(a||i){if(h<1||h>12)return null;h=h%12+(i?12:0)}else if(h>23)return null;return wa(h*60+u)}var Yi={fromAttribute:n=>n?n.split(/[\s,]+/).filter(Boolean):[],toAttribute:n=>Array.isArray(n)?n.join(" "):n},ka=n=>Array.isArray(n)?n:typeof n=="string"?Yi.fromAttribute(n):[];function Mo(n,r){let e=[r,Jr(n)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function To(n){try{let r=new Intl.Locale(n),e=r.getWeekInfo?.()??r.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var Th=new Map;function _o(n){let r=Th.get(n);if(r)return r;let e=$=>new Intl.DateTimeFormat(n,$),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),a=e({weekday:"long"}),c=new Date(2024,0,7),h=t.formatToParts(new Date(2026,10,15)),u=h.filter($=>$.type==="day"||$.type==="month"||$.type==="year").map($=>$.type),m=h.map($=>$.type==="day"?"{d}":$.type==="month"?"{m}":$.type==="year"?"{y}":$.value).join(""),y=($,T)=>Array.from({length:12},(D,P)=>new Intl.DateTimeFormat($,{month:T}).format(new Date(2024,P,1)).toLowerCase().replace(/\./g,"")),v=Array.from({length:12},($,T)=>[...new Set([y(n,"long")[T],y(n,"short")[T],y("en","long")[T],y("en","short")[T]])]),E={short:$=>t.format($),long:$=>Z($,{weekday:"long",day:"numeric",month:"long",year:"numeric"},n),medium:$=>Z($,{day:"numeric",month:"short",year:"numeric"},n),monthYear:$=>Z($,{month:"long",year:"numeric"},n),day:$=>Z($,{day:"numeric"},n),weekdaysShort:Array.from({length:7},($,T)=>i.format(ge(c,T))),weekdaysLong:Array.from({length:7},($,T)=>a.format(ge(c,T))),pattern:u.length===3?m:"{y}-{m}-{d}",order:u.length===3?u:["year","month","day"],months:v};return Th.set(n,E),E}var Co=(n,r)=>n.pattern.replace(/\{([dmy])\}/g,(e,t)=>r[t]);function zo(n,r){let e=n.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,a,c,h=t.findIndex(m=>/\p{L}/u.test(m));if(h>=0){let m=t[h];a=r.months.findIndex($=>$.some(T=>T===m||m.length>=3&&T.startsWith(m)))+1;let y=t.filter(($,T)=>T!==h);if(!a||y.some($=>!/^\d+$/.test($)))return null;let v=y.findIndex($=>$.length===4),E=v>=0?v:1;i=+y[E],c=+y[1-E],y[E].length<=2&&(i+=2e3)}else{if(t.some(v=>!/^\d+$/.test(v)))return null;let m=t[0].length===4?["year","month","day"]:r.order,y=v=>t[m.indexOf(v)];if(i=+y("year"),a=+y("month"),c=+y("day"),y("year").length<=2)i+=2e3;else if(y("year").length!==4)return null}let u=`${Be(i,4)}-${Be(a)}-${Be(c)}`;return R(u)?u:null}function Lo(n,r,e,t){let i=(e.getDay()-t+7)%7;switch(n){case"ArrowRight":return ge(e,1);case"ArrowLeft":return ge(e,-1);case"ArrowDown":return ge(e,7);case"ArrowUp":return ge(e,-7);case"Home":return ge(e,-i);case"End":return ge(e,6-i);case"PageDown":return je(e,r.shiftKey?12:1);case"PageUp":return je(e,r.shiftKey?-12:-1);default:return null}}var Et=(n,r,e)=>r&&n<r?r:e&&n>e?e:n;function So(n){let{fmt:r,firstDay:e,month:t,focus:i,min:a,max:c}=n,h=Qt(t),u=(h.getDay()-e+7)%7,m=Eo(t).getDate(),y=[],v=Array(u).fill(null);for(let P=1;P<=m;P++)v.push(new Date(t.getFullYear(),t.getMonth(),P)),v.length===7&&(y.push(v),v=[]);v.length&&y.push([...v,...Array(7-v.length).fill(null)]);let E=Array.from({length:7},(P,j)=>(j+e)%7),$=Pu(),T=!!a&&Eo(je(h,-1))<a,D=!!c&&je(h,1)>c;return l`<div class="cal-head">
541
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${n.previousLabel} ?disabled=${T} @click=${()=>n.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>
542
+ <h2 id="${n.id}-month" class="cal-title" aria-live="polite">${r.monthYear(t)}</h2>
543
+ <button type="button" class="cal-nav" part="calendar-nav" aria-label=${n.nextLabel} ?disabled=${D} @click=${()=>n.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>
538
544
  </div>
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`
545
+ <table role="grid" class="cal-grid" part="calendar" aria-labelledby="${n.id}-month" @keydown=${n.onKey}>
546
+ <thead><tr>${E.map(P=>l`<th scope="col" abbr=${r.weekdaysLong[P]}><span aria-hidden="true">${r.weekdaysShort[P]}</span><span class="vh">${r.weekdaysLong[P]}</span></th>`)}</tr></thead>
547
+ <tbody>${y.map(P=>l`<tr>${P.map(j=>{if(!j)return l`<td class="empty"></td>`;let Ti=he(j),_i=n.isDisabled(j)||!!a&&j<a||!!c&&j>c,Rd=n.mark(j),Hd=n.note?.(j);return l`<td class="day ${Rd} ${Ti===$?"today":""}" data-date=${Ti}
548
+ tabindex=${Ti===he(i)?"0":"-1"}
549
+ aria-selected=${Rd?"true":"false"} aria-disabled=${_i?"true":d}
550
+ aria-current=${Ti===$?"date":d}
551
+ aria-label="${r.long(j)}${Hd?`, ${Hd}`:""}"
552
+ @click=${()=>!_i&&n.onPick(j)} @pointerenter=${()=>n.onHover?.(j)}><span aria-hidden="true">${r.day(j)}</span></td>`})}</tr>`)}</tbody>
553
+ </table>`}var Ao=b`
548
554
  .pop {
549
555
  position: absolute; z-index: 20; inset-block-start: calc(100% + var(--cm-space-10)); inset-inline-start: 0;
550
556
  width: max-content; max-width: calc(100vw - 32px); padding: var(--cm-space-15);
@@ -576,7 +582,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
576
582
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
577
583
  }
578
584
  @media (max-width: 640px) { .day, .empty { height: 36px; } }
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`
585
+ `;function Do(n,r){if(n.key!=="Tab")return;let e=[...r.querySelectorAll('button:not([disabled]), [role=grid] td[tabindex="0"]')];if(!e.length)return;let t=r.getRootNode(),i=e.indexOf(t.activeElement);n.preventDefault(),e[(i+(n.shiftKey?-1:1)+e.length)%e.length].focus()}var No=b`
580
586
  :host { display: block; position: relative; }
581
587
  .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
582
588
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -611,69 +617,69 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
611
617
  .wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); }
612
618
  .wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
613
619
  .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}
620
+ `;var wb=M("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."}}),Zi,J,Ae,Qi,tt,Ct,ve,ke,es,ts,x,Ea,Mt,is,Ro,ii,Wi,Ze,Tt,Qe,et,Ho,fc,bc,Xi,si,gc,vc,Lh,Io,Sh,xc,Ji,Ma,Ta,yc,Ah,Oo,wc,$c,qo,Po,Bo,jo,Fo,_a,_t=class extends k{constructor(){super(...arguments);p(this,x);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";p(this,Zi,"");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;p(this,J,this.attachInternals());p(this,Ae,L("cm-dp"));p(this,Qi,null);p(this,tt,!1);p(this,Ct,!1);p(this,ve,"");p(this,ke,"");p(this,es,!1);p(this,ts,"");p(this,is,!1);p(this,Oo,e=>{e.key==="Enter"?o(this,x,yc).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),o(this,x,Ah).call(this,e.key==="ArrowUp"?1:-1))});p(this,qo,()=>{this.disabled||(this.open?this.open=!1:(o(this,x,Ta).call(this),this.show()))});p(this,Po,e=>{e.key==="Enter"?o(this,x,Ta).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),o(this,x,Ta).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});p(this,Bo,e=>{let t=Lo(ne(e,this),e,this._focus,s(this,x,fc));if(t){e.preventDefault(),this._focus=Et(t,s(this,x,Qe),s(this,x,et)),f(this,Ct,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,x,wc).call(this,this._focus))});p(this,jo,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,x,$c).call(this);return}Do(e,e.currentTarget)});p(this,Fo,e=>{this._focus=Et(je(this._focus,e),s(this,x,Qe),s(this,x,et))});p(this,_a,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,Zi)}set locale(e){let t=s(this,Zi);f(this,Zi,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,Qi)===null&&f(this,Qi,this.value),document.addEventListener("pointerdown",s(this,_a),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,_a),!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?$a(this.value):null:R(this.value)}checkValidity(){return o(this,x,Io).call(this),s(this,J).checkValidity()}reportValidity(){return o(this,x,Io).call(this),s(this,J).reportValidity()}formResetCallback(){this.value=s(this,Qi)??"",this.time&&(o(this,x,vc).call(this,this.value),f(this,x,o(this,x,si).call(this,s(this,ke)),Mt)),this._text=o(this,x,Xi).call(this,s(this,x,Ze)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(o(this,x,Lh).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=s(this,x,Qe),a=s(this,x,et);return i&&t<i||a&&t>a?!0:ka(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!s(this,is)?(o(this,x,vc).call(this,this.value),s(this,es)||f(this,x,o(this,x,si).call(this,s(this,ke)),Mt)):this.time&&(e.has("locale")||e.has("hourCycle"))&&s(this,ke)&&f(this,x,o(this,x,si).call(this,s(this,ke)),Mt),(e.has("value")||e.has("time"))&&!s(this,tt)?this._text=o(this,x,Xi).call(this,s(this,x,Ze)):e.has("locale")&&R(s(this,x,Ze))&&(this._text=o(this,x,Xi).call(this,s(this,x,Ze))),f(this,tt,!1),f(this,es,!1),f(this,is,!1)}updated(e){s(this,J).setFormValue(this.value||null,this.time?this.value:this._text),o(this,x,Io).call(this),this.open&&s(this,Ct)&&(f(this,Ct,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&f(this,Ct,!1)}render(){let e=s(this,x,ii),t=R(s(this,x,Ze)),i=[this.error&&`${s(this,Ae)}-err`,this.helpText&&`${s(this,Ae)}-help`].filter(Boolean).join(" "),a=this.getAttribute("aria-label"),c=this.label||a||"",h=Qt(this._focus);return l`<div class="field">
621
+ ${this.label?l`<label class="label" for="${s(this,Ae)}-in" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</label>`:d}
616
622
  <div class="wrap ${this.time?"timed":""}">
617
623
  <div class="box" part="box">
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)}
620
- aria-label=${!this.label&&l?l:c}
624
+ <input id="${s(this,Ae)}-in" part="input" type="text" autocomplete="off" spellcheck="false"
625
+ .value=${se(this._text)} placeholder=${this.placeholder||s(this,x,bc)}
626
+ aria-label=${!this.label&&a?a:d}
621
627
  ?required=${this.required} ?disabled=${this.disabled}
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)} />
628
+ aria-invalid=${this.error?"true":d} aria-describedby=${i||d}
629
+ @input=${u=>{u.stopPropagation(),this._text=u.target.value}}
630
+ @change=${()=>o(this,x,Ta).call(this)} @keydown=${s(this,Po)} />
625
631
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
626
- aria-label=${t?this.t(d?"changeFor":"change",{label:d,date:e.long(t)}):this.t(d?"chooseFor":"choose",{label:d})}
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>
632
+ aria-label=${t?this.t(c?"changeFor":"change",{label:c,date:e.long(t)}):this.t(c?"chooseFor":"choose",{label:c})}
633
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ae)}-pop"
634
+ @click=${s(this,qo)}><cm-icon name="calendar" size="18"></cm-icon></button>
629
635
  </div>
630
- ${this.time?o`<div class="box time" part="time-box">
636
+ ${this.time?l`<div class="box time" part="time-box">
631
637
  <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})}
638
+ .value=${se(s(this,x,Ea))} placeholder=${s(this,x,gc)}
639
+ aria-label=${this.t(c?"timeFor":"time",{label:c})}
634
640
  ?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}
641
+ aria-invalid=${this.error?"true":d} aria-describedby=${i||d}
642
+ @input=${u=>{u.stopPropagation(),f(this,x,u.target.value,Mt)}}
643
+ @change=${()=>o(this,x,yc).call(this)} @keydown=${s(this,Oo)} />
644
+ </div>`:d}
645
+ <div class="pop" id="${s(this,Ae)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
646
+ ?hidden=${!this.open} @keydown=${s(this,jo)}>
647
+ ${this.open?l`<div class="cal">${So({id:s(this,Ae),fmt:e,firstDay:s(this,x,fc),month:h,focus:this._focus,min:s(this,x,Qe),max:s(this,x,et),isDisabled:u=>this.isUnavailable(he(u)),mark:u=>t&&he(u)===s(this,x,Ze)?"selected":"",onPick:u=>o(this,x,wc).call(this,u),onKey:s(this,Bo),onMonth:s(this,Fo),previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth")})}</div>`:d}
642
648
  </div>
643
649
  </div>
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")}
650
+ ${this.error?l`<p class="error" id="${s(this,Ae)}-err" role="alert">${this.error}</p>`:d}
651
+ ${this.helpText?l`<p class="help" id="${s(this,Ae)}-help">${this.helpText}</p>`:d}
652
+ </div>`}};Zi=new WeakMap,J=new WeakMap,Ae=new WeakMap,Qi=new WeakMap,tt=new WeakMap,Ct=new WeakMap,ve=new WeakMap,ke=new WeakMap,es=new WeakMap,ts=new WeakMap,x=new WeakSet,Ea=function(){return s(this,ts)},Mt=function(e){e!==s(this,ts)&&(f(this,ts,e),this.requestUpdate())},is=new WeakMap,Ro=function(){return Mo(this,this.locale)},ii=function(){return _o(s(this,x,Ro))},Wi=function(){return Ch(s(this,x,Ro),this.hourCycle)},Ze=function(){return this.time?s(this,ve):this.value},Tt=function(e){return this.time&&e.trim().toLowerCase()==="now"?_h():e},Qe=function(){return R(ti(o(this,x,Tt).call(this,this.min)).date||this.min)},et=function(){return R(ti(o(this,x,Tt).call(this,this.max)).date||this.max)},Ho=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},fc=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?To(s(this,x,Ro)):(Math.trunc(e)%7+7)%7},bc=function(){return Co(s(this,x,ii),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},Xi=function(e){let t=R(e);return t?s(this,x,ii).short(t):e},si=function(e){let t=ei(e);return t===null?"":s(this,x,Wi).format(t)},gc=function(){return zh(s(this,x,Wi),{h:this.t("patternHour"),m:this.t("patternMinute")})},vc=function(e){let{date:t,time:i}=ti(e);f(this,ve,t),f(this,ke,t?i:"")},Lh=function(){let e=new Date,t=R(s(this,x,Ze))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=Et(t,s(this,x,Qe),s(this,x,et)),f(this,Ct,!0)},Io=function(){let e=this.renderRoot.querySelector("input")??void 0,t=R(s(this,x,Ze)),i=s(this,x,ii);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,x,bc)}),e):this.time?o(this,x,Sh).call(this,t,e):this.required&&!t?s(this,J).setValidity({valueMissing:!0},this.t("required"),e):t&&s(this,x,Qe)&&t<s(this,x,Qe)?s(this,J).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(s(this,x,Qe))}),e):t&&s(this,x,et)&&t>s(this,x,et)?s(this,J).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(s(this,x,et))}),e):t&&this.isUnavailable(this.value)?s(this,J).setValidity({customError:!0},this.t("unavailable"),e):s(this,J).setValidity({})},Sh=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,a=(v,E,$,T=t)=>s(this,J).setValidity(v,this.t(E,$),T),c=ei(s(this,ke));if(s(this,x,Ea).trim()&&c===null)return a({badInput:!0},"badTime",{pattern:s(this,x,gc)},i);if(!e&&c===null)return this.required?a({valueMissing:!0},"required"):s(this,J).setValidity({});if(!e)return a({badInput:!0},"required");if(c===null)return a({badInput:!0},"timeMissing",void 0,i);let h=$a(`${s(this,ve)}T${s(this,ke)}`),u=$a(o(this,x,Tt).call(this,this.min)),m=$a(o(this,x,Tt).call(this,this.max),!0),y=(v,E)=>ti(v).time?s(this,x,Wi).dateTime(E):s(this,x,ii).medium(E);if(u&&h<u)return a({rangeUnderflow:!0},"rangeUnderflow",{date:y(o(this,x,Tt).call(this,this.min),u)},i);if(m&&h>m)return a({rangeOverflow:!0},"rangeOverflow",{date:y(o(this,x,Tt).call(this,this.max),m)},i);if(c%s(this,x,Ho))return a({stepMismatch:!0},"stepMismatch",{count:s(this,x,Ho)},i);if(this.isUnavailable(s(this,ve)))return a({customError:!0},"unavailable");s(this,J).setValidity({})},xc=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})))},Ji=function(e,t){f(this,ve,e),f(this,ke,t);let i=e&&t?`${e}T${t}`:"";f(this,is,!0),this.requestUpdate(),o(this,x,xc).call(this,i)},Ma=function(e){this.time?o(this,x,Ji).call(this,e,s(this,ke)):o(this,x,xc).call(this,e)},Ta=function(){let e=this._text.trim();if(!e){o(this,x,Ma).call(this,"");return}let t=zo(e,s(this,x,ii));t?(o(this,x,Ma).call(this,t),this._text=o(this,x,Xi).call(this,t)):(f(this,tt,!0),o(this,x,Ma).call(this,""))},yc=function(){let e=s(this,x,Ea).trim(),t=e?mc(e,s(this,x,Wi)):"";if(f(this,tt,!0),t===null){f(this,es,!0),o(this,x,Ji).call(this,s(this,ve),"");return}o(this,x,Ji).call(this,s(this,ve),t),f(this,x,o(this,x,si).call(this,t),Mt)},Ah=function(e){let t=s(this,x,Ho),i=mc(s(this,x,Ea),s(this,x,Wi));if(!i){let u=ti(o(this,x,Tt).call(this,this.min)),m=new Date;if(i=u.time&&(!s(this,ve)||s(this,ve)===u.date)?u.time:wa(m.getHours()*60+m.getMinutes()),ei(i)%t===0){f(this,tt,!0),o(this,x,Ji).call(this,s(this,ve),i),f(this,x,o(this,x,si).call(this,i),Mt);return}e=1}let a=ei(i),c=e>0?(Math.floor(a/t)+1)*t:(Math.ceil(a/t)-1)*t,h=wa(c>=1440?0:c<0?Math.floor(1439/t)*t:c);f(this,tt,!0),o(this,x,Ji).call(this,s(this,ve),h),f(this,x,o(this,x,si).call(this,h),Mt)},Oo=new WeakMap,wc=function(e){let t=he(e);this.isUnavailable(t)||(this.open=!1,o(this,x,Ma).call(this,t),this._text=o(this,x,Xi).call(this,t),this.time&&!s(this,ke)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):o(this,x,$c).call(this))},$c=function(){this.renderRoot.querySelector(".trigger")?.focus()},qo=new WeakMap,Po=new WeakMap,Bo=new WeakMap,jo=new WeakMap,Fo=new WeakMap,_a=new WeakMap,_t.formAssociated=!0,_t.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},_t.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:Yi},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}},_t.styles=[w,No,Ao,b`.pop { min-width: 0; }`];g("cm-date-picker",_t);var zb=M("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"}),ju={today:["Today",n=>[n,n]],yesterday:["Yesterday",n=>[ge(n,-1),ge(n,-1)]],"last-7-days":["Last 7 days",n=>[ge(n,-6),n]],"last-30-days":["Last 30 days",n=>[ge(n,-29),n]],"last-90-days":["Last 90 days",n=>[ge(n,-89),n]],"this-month":["This month",n=>[Qt(n),n]],"last-month":["Last month",n=>[Qt(je(n,-1)),Eo(je(n,-1))]]},Fu=n=>n.replace(/-([a-z0-9])/g,(r,e)=>e.toUpperCase());function Dh(n,r=new Date,e){if(typeof n=="object"&&n)return n;let t=ju[n];if(!t)return null;let i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),[a,c]=t[1](i);return{label:e?.(Fu(n))||t[0],start:he(a),end:he(c)}}var as,te,Ee,ns,os,Lt,S,kc,ss,Ec,st,Vo,it,Nh,Uo,rs,Mc,Rh,Ko,Go,Yo,Wo,Xo,Ca,Tc,zt=class extends k{constructor(){super(...arguments);p(this,S);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";p(this,as,"");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;p(this,te,this.attachInternals());p(this,Ee,L("cm-drp"));p(this,ns,null);p(this,os,!1);p(this,Lt,!1);p(this,st,"start");p(this,Go,()=>{this.disabled||(this.open?this.open=!1:(o(this,S,rs).call(this,"start"),o(this,S,rs).call(this,"end"),this.show()))});p(this,Yo,e=>t=>{t.key==="Enter"?o(this,S,rs).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),o(this,S,rs).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});p(this,Wo,e=>{let t=Lo(ne(e,this),e,this._focus,s(this,S,Ec));if(t){e.preventDefault(),this._focus=Et(t,R(this.min),R(this.max)),f(this,Lt,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),o(this,S,Mc).call(this,this._focus))});p(this,Xo,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,o(this,S,Ko).call(this);return}Do(e,e.currentTarget)});p(this,Ca,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return s(this,as)}set locale(e){let t=s(this,as);f(this,as,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),s(this,ns)||f(this,ns,[this.start,this.end]),document.addEventListener("pointerdown",s(this,Ca),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",s(this,Ca),!0)}get form(){return s(this,te).form}get validity(){return s(this,te).validity}get validationMessage(){return s(this,te).validationMessage}checkValidity(){return s(this,te).checkValidity()}reportValidity(){return s(this,te).reportValidity()}formResetCallback(){[this.start,this.end]=s(this,ns)??["",""],this._startText=o(this,S,it).call(this,this.start),this._endText=o(this,S,it).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=R(this.start)?this.start:"",this._draftEnd=R(this.end)?this.end:"",this._hover=null;let e=new Date;this._focus=Et(R(this.start)??new Date(e.getFullYear(),e.getMonth(),e.getDate()),R(this.min),R(this.max)),f(this,st,"start"),f(this,Lt,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=R(e);if(!t)return!0;let i=R(this.min),a=R(this.max);return i&&t<i||a&&t>a?!0:ka(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){s(this,os)||(e.has("start")&&(this._startText=o(this,S,it).call(this,this.start)),e.has("end")&&(this._endText=o(this,S,it).call(this,this.end))),f(this,os,!1),e.has("locale")&&(R(this.start)&&(this._startText=o(this,S,it).call(this,this.start)),R(this.end)&&(this._endText=o(this,S,it).call(this,this.end)))}updated(){let e=R(this.start),t=R(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,te).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let a=this.renderRoot.querySelectorAll("input"),[c,h]=[a[0]??void 0,a[1]??void 0],u=s(this,S,ss),m=R(this.min),y=R(this.max);this.error?s(this,te).setValidity({customError:!0},this.error,c):this._startText.trim()&&!e?s(this,te).setValidity({badInput:!0},this.t("badStart",{pattern:s(this,S,Vo)}),c):this._endText.trim()&&!t?s(this,te).setValidity({badInput:!0},this.t("badEnd",{pattern:s(this,S,Vo)}),h):this.required&&(!e||!t)?s(this,te).setValidity({valueMissing:!0},this.t("required"),e?h:c):e&&t&&t<e?s(this,te).setValidity({badInput:!0},this.t("endBeforeStart"),h):e&&m&&e<m||t&&m&&t<m?s(this,te).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:u.medium(m)}),c):e&&y&&e>y||t&&y&&t>y?s(this,te).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:u.medium(y)}),h):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?s(this,te).setValidity({customError:!0},this.t("unavailable"),c):s(this,te).setValidity({}),this.open&&s(this,Lt)&&(f(this,Lt,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=s(this,S,ss),t=R(this.start),i=R(this.end),a=[this.error&&`${s(this,Ee)}-err`,this.helpText&&`${s(this,Ee)}-help`].filter(Boolean).join(" "),c=this.getAttribute("aria-label"),h=this.label||c||"",u=ka(this.presets).map(v=>Dh(v,new Date,E=>this.t(E))).filter(v=>!!v),m=s(this,st)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(R(this._draftStart))}):this.t("chooseStart"),y=v=>{let E=v==="start"?this._startText:this._endText;return l`<input id="${s(this,Ee)}-${v}" type="text" autocomplete="off" spellcheck="false"
653
+ .value=${se(E)} placeholder=${s(this,S,Vo)}
654
+ aria-label=${v==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
649
655
  ?required=${this.required} ?disabled=${this.disabled}
650
- aria-invalid=${this.error?"true":c} aria-describedby=${l||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}
656
+ aria-invalid=${this.error?"true":d} aria-describedby=${a||d}
657
+ @input=${$=>{$.stopPropagation();let T=$.target.value;v==="start"?this._startText=T:this._endText=T}}
658
+ @change=${()=>o(this,S,rs).call(this,v)} @keydown=${s(this,Yo).call(this,v)} />`};return l`<div class="field" role="group" aria-labelledby=${this.label?`${s(this,Ee)}-l`:d} aria-label=${!this.label&&c?c:d}>
659
+ ${this.label?l`<span class="label" id="${s(this,Ee)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
654
660
  <div class="wrap">
655
661
  <div class="box" part="box">
656
- ${$("start")}<span class="sep" aria-hidden="true">–</span>${$("end")}
662
+ ${y("start")}<span class="sep" aria-hidden="true">–</span>${y("end")}
657
663
  <button type="button" class="trigger" part="trigger" ?disabled=${this.disabled}
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>
664
+ aria-label=${t&&i?this.t(h?"changeFor":"change",{label:h,start:e.long(t),end:e.long(i)}):this.t(h?"chooseFor":"choose",{label:h})}
665
+ aria-haspopup="dialog" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Ee)}-pop"
666
+ @click=${s(this,Go)}><cm-icon name="calendar" size="18"></cm-icon></button>
661
667
  </div>
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>
668
+ <div class="pop" id="${s(this,Ee)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
669
+ ?hidden=${!this.open} @keydown=${s(this,Xo)}>
670
+ ${this.open?l`<div class="body">
671
+ ${u.length?l`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(v=>l`<li>
672
+ <button type="button" class="preset" aria-pressed=${v.start===this.start&&v.end===this.end?"true":"false"}
673
+ @click=${()=>o(this,S,Rh).call(this,v)}>${v.label}</button></li>`)}</ul>`:d}
674
+ <div class="cal">${So({id:s(this,Ee),fmt:e,firstDay:s(this,S,Ec),month:Qt(this._focus),focus:this._focus,min:R(this.min),max:R(this.max),isDisabled:v=>this.isUnavailable(he(v)),mark:v=>o(this,S,Tc).call(this,v),note:v=>{let E=o(this,S,Tc).call(this,v);return E==="start"?this.t("startNote"):E==="end"?this.t("endNote"):""},onPick:v=>o(this,S,Mc).call(this,v),onKey:s(this,Wo),onMonth:v=>{this._focus=Et(je(this._focus,v),R(this.min),R(this.max))},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:v=>{s(this,st)==="end"&&(this._hover=v)}})}
675
+ <p class="status" aria-live="polite">${m}</p>
670
676
  </div>
671
- </div>`:c}
677
+ </div>`:d}
672
678
  </div>
673
679
  </div>
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`
680
+ ${this.error?l`<p class="error" id="${s(this,Ee)}-err" role="alert">${this.error}</p>`:d}
681
+ ${this.helpText?l`<p class="help" id="${s(this,Ee)}-help">${this.helpText}</p>`:d}
682
+ </div>`}};as=new WeakMap,te=new WeakMap,Ee=new WeakMap,ns=new WeakMap,os=new WeakMap,Lt=new WeakMap,S=new WeakSet,kc=function(){return Mo(this,this.locale)},ss=function(){return _o(s(this,S,kc))},Ec=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?To(s(this,S,kc)):(Math.trunc(e)%7+7)%7},st=new WeakMap,Vo=function(){return Co(s(this,S,ss),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},it=function(e){let t=R(e);return t?s(this,S,ss).short(t):e},Nh=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Uo=function(e,t){e===this.start&&t===this.end||(this.start=e,this.end=t,o(this,S,Nh).call(this))},rs=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?zo(t,s(this,S,ss)):"";t&&!i&&f(this,os,!0);let a=e==="start"?[i??"",this.end]:[this.start,i??""];o(this,S,Uo).call(this,...a),i&&(e==="start"?this._startText=o(this,S,it).call(this,i):this._endText=o(this,S,it).call(this,i))},Mc=function(e){let t=he(e);if(!this.isUnavailable(t)){if(s(this,st)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",f(this,st,"end"),this._focus=e,f(this,Lt,!0);return}this._draftEnd=t,this.open=!1,o(this,S,Uo).call(this,this._draftStart,t),o(this,S,Ko).call(this)}},Rh=function(e){this.open=!1,o(this,S,Uo).call(this,e.start,e.end),o(this,S,Ko).call(this)},Ko=function(){this.renderRoot.querySelector(".trigger")?.focus()},Go=new WeakMap,Yo=new WeakMap,Wo=new WeakMap,Xo=new WeakMap,Ca=new WeakMap,Tc=function(e){let t=he(e),i=this._draftStart,a=this._draftEnd||(s(this,st)==="end"&&i?he(this._hover??this._focus):"");return t===i?"start":t===a&&a>i?"end":i&&a&&t>i&&t<a?"in-range":""},zt.formAssociated=!0,zt.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},zt.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:Yi},isDateDisabled:{attribute:!1},presets:{converter:Yi},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}},zt.styles=[w,No,Ao,b`
677
683
  .sep { flex: none; color: var(--cm-text-tertiary); }
678
684
  input { flex: 0 1 6.6em; }
679
685
  :host([size='small']) input { flex-basis: 6.6em; }
@@ -693,29 +699,49 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
693
699
  .presets li { flex: 0 0 auto; }
694
700
  .preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-full); min-height: 32px; }
695
701
  }
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}
700
- </div>`:c}
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>`}
702
+ `];g("cm-date-range-picker",zt);var Rb=M("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",takePhoto:"Take a photo",retake:"Retake",removePhoto:"Remove",retakeName:"Retake {name}",removeName:"Remove {name}",photo:"photo"});function Vu(n,r){if(!r.trim())return!0;let e=n.name.toLowerCase(),t=n.type.toLowerCase();return r.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 De,Y,rt,H,za,_c,Jo,Zo,Cc,zc,ri,Lc,Hh,Ih,St=class extends k{constructor(){super(...arguments);p(this,H);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="";p(this,De,this.attachInternals());p(this,Y,L("cm-fu"));p(this,rt,new Map)}get form(){return s(this,De).form}get validity(){return s(this,De).validity}get validationMessage(){return s(this,De).validationMessage}checkValidity(){return s(this,De).checkValidity()}reportValidity(){return s(this,De).reportValidity()}formResetCallback(){this.files=[],this._rejected=""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of s(this,rt).values())URL.revokeObjectURL(e);s(this,rt).clear()}updated(e){if(e.has("files"))for(let[c,h]of s(this,rt))this.files.includes(c)||(URL.revokeObjectURL(h),s(this,rt).delete(c));let t=new FormData;for(let c of this.files)t.append(this.name||"file",c);s(this,De).setFormValue(this.files.length?t:null);let i=(s(this,H,za)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,a=this.error||this._rejected;a?s(this,De).setValidity({customError:!0},a,i):this.required&&!this.files.length?s(this,De).setValidity({valueMissing:!0},this.t("required"),i):s(this,De).setValidity({})}addFiles(e){let t=[...e],i=[],a=[],c=[];for(let u of t)Vu(u,s(this,H,_c))?this.maxSize&&u.size>this.maxSize?(a.push(u),c.push(this.t("tooLarge",{name:u.name,size:o(this,H,Zo).call(this,this.maxSize)}))):i.push(u):(a.push(u),c.push(this.t("wrongType",{name:u.name})));let h=s(this,H,Jo)?[...this.files,...i]:i.slice(-1);!s(this,H,Jo)&&!i.length&&(h=this.files),s(this,H,Jo)&&this.maxFiles&&h.length>this.maxFiles&&(a.push(...h.slice(this.maxFiles)),c.push(this.t("tooMany",{max:this.maxFiles})),h=h.slice(0,this.maxFiles)),this._rejected=c.join(". "),a.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:a}})),h!==this.files&&(h.length!==this.files.length||h.some((u,m)=>u!==this.files[m]))&&(this.files=h,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(){if(s(this,H,za))return o(this,H,Ih).call(this);let e=this.error||this._rejected,t=!this.files.length||this.multiple,i=this.files.length>0;return l`
703
+ ${this.label||this.hint?l`<div class="head">
704
+ ${this.label?l`<span class="label" id="${s(this,Y)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
705
+ ${this.hint?l`<span class="hint" id="${s(this,Y)}-hint">${this.hint}</span>`:d}
706
+ </div>`:d}
707
+ ${i?l`<ul class="grid" part="files" role="list" style="list-style:none;margin:0;padding:0" aria-label=${this.t("files")}>
708
+ ${this.files.map(a=>l`<li class="file">
709
+ ${a.type.startsWith("image/")?l`<img src=${o(this,H,Cc).call(this,a)} alt=${a.name} />`:l`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${a.name}</span><span class="size">${o(this,H,Zo).call(this,a.size)}</span></div>`}
710
+ ${this.disabled?d:l`<button type="button" class="remove" aria-label=${this.t("remove",{name:a.name})} @click=${()=>this.removeFile(a)}><cm-icon name="close" size="12"></cm-icon></button>`}
705
711
  </li>`)}
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}
712
+ ${t?l`<li>${o(this,H,Lc).call(this,!0)}</li>`:d}
713
+ </ul>`:o(this,H,Lc).call(this,!1)}
714
+ ${e?l`<p class="msg" id="${s(this,Y)}-msg" role="alert">${e}</p>`:d}
715
+ `}};De=new WeakMap,Y=new WeakMap,rt=new WeakMap,H=new WeakSet,za=function(){return this.variant==="photo"},_c=function(){return this.accept||(s(this,H,za)?"image/*":"")},Jo=function(){return this.multiple&&!s(this,H,za)},Zo=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})})},Cc=function(e){let t=s(this,rt).get(e);return t||(t=URL.createObjectURL(e),s(this,rt).set(e,t)),t},zc=function(e){e.stopPropagation();let t=e.target;this.addFiles(t.files??[]),t.value=""},ri=function(e){this.toggleAttribute("data-over",e)},Lc=function(e){let t=[this.hint&&`${s(this,Y)}-hint`,(this.error||this._rejected)&&`${s(this,Y)}-msg`].filter(Boolean).join(" ");return l`<label class="zone ${e?"tile":""}" part="zone"
716
+ @dragenter=${()=>o(this,H,ri).call(this,!0)} @dragleave=${()=>o(this,H,ri).call(this,!1)} @drop=${()=>o(this,H,ri).call(this,!1)}>
717
+ <input type="file" id=${s(this,Y)} accept=${this.accept||d} capture=${this.capture||d} ?multiple=${this.multiple} ?disabled=${this.disabled}
712
718
  ?required=${this.required&&!this.files.length}
713
- aria-labelledby=${[this.label&&`${s(this,$e)}-l`,`${s(this,$e)}-p`].filter(Boolean).join(" ")}
714
- aria-describedby=${t||c} aria-invalid=${this.error||this._rejected?"true":c}
715
- @change=${n(this,J,md)} @cancel=${i=>i.stopPropagation()} />
719
+ aria-labelledby=${[this.label&&`${s(this,Y)}-l`,`${s(this,Y)}-p`].filter(Boolean).join(" ")}
720
+ aria-describedby=${t||d} aria-invalid=${this.error||this._rejected?"true":d}
721
+ @change=${o(this,H,zc)} @cancel=${i=>i.stopPropagation()} />
716
722
  <cm-icon name=${e?"plus":"upload"} size=${e?24:38}></cm-icon>
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`
723
+ <span id="${s(this,Y)}-p">${e?this.t("addMore"):this.prompt}</span>
724
+ </label>`},Hh=function(){this.renderRoot.querySelector("input[type=file]")?.click()},Ih=function(){let e=this.error||this._rejected,t=this.files[0],i=this.label||this.t("photo"),a=[this.hint&&`${s(this,Y)}-hint`,e&&`${s(this,Y)}-msg`].filter(Boolean).join(" "),c=u=>l`<input type="file" id=${s(this,Y)} accept=${s(this,H,_c)} capture=${this.capture||d}
725
+ ?disabled=${this.disabled} ?required=${this.required&&!t} tabindex=${u?"-1":d} aria-hidden=${u?"true":d}
726
+ ?hidden=${u} aria-labelledby=${u?d:`${s(this,Y)}-p`} aria-describedby=${!u&&a||d} aria-invalid=${e?"true":d}
727
+ @change=${o(this,H,zc)} @cancel=${m=>m.stopPropagation()} />`,h=this.hint?l`<span class="hint" id="${s(this,Y)}-hint">${this.hint}</span>`:d;return l`
728
+ ${t?l`<div class="shot" part="photo">
729
+ ${t.type.startsWith("image/")?l`<img src=${o(this,H,Cc).call(this,t)} alt=${i} />`:l`<div class="doc"><cm-icon name="book" size="24"></cm-icon><span class="name">${t.name}</span><span class="size">${o(this,H,Zo).call(this,t.size)}</span></div>`}
730
+ </div>
731
+ <p class="caption" aria-hidden="true">${this.label}</p>
732
+ ${c(!0)}
733
+ ${this.disabled?d:l`<div class="actions" part="actions">
734
+ <button type="button" class="action retake" aria-label=${this.t("retakeName",{name:i})} aria-describedby=${e?`${s(this,Y)}-msg`:d} @click=${o(this,H,Hh)}><cm-icon name="camera" size="16"></cm-icon>${this.t("retake")}</button>
735
+ <button type="button" class="action" aria-label=${this.t("removeName",{name:i})} @click=${()=>this.removeFile(t)}><cm-icon name="trash" size="16"></cm-icon>${this.t("removePhoto")}</button>
736
+ </div>`}`:l`<label class="zone photo ${e?"invalid":""}" part="zone photo"
737
+ @dragenter=${()=>o(this,H,ri).call(this,!0)} @dragleave=${()=>o(this,H,ri).call(this,!1)} @drop=${()=>o(this,H,ri).call(this,!1)}>
738
+ ${c(!1)}
739
+ <cm-icon name="camera" size="32"></cm-icon>
740
+ <span class="photo-label" id="${s(this,Y)}-p" part="label">${this.label||this.t("takePhoto")}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>
741
+ ${h}
742
+ </label>`}
743
+ ${e?l`<p class="msg" id="${s(this,Y)}-msg" role="alert">${e}</p>`:d}
744
+ `},St.formAssociated=!0,St.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},St.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},variant:{reflect:!0},capture:{reflect:!0},_rejected:{state:!0}},St.styles=[w,b`
719
745
  :host { display: block; }
720
746
  .head { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: var(--cm-space-10); margin-bottom: var(--cm-space-20); }
721
747
  .label { font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
@@ -748,21 +774,110 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
748
774
  .msg { margin: var(--cm-space-10) 0 0; font-size: 12px; color: var(--cm-text-critical); }
749
775
  :host([disabled]) .zone { cursor: not-allowed; background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-default); }
750
776
  :host([disabled]) .remove { display: none; }
777
+ /* variant="photo" (1.3) */
778
+ .zone.photo { min-height: 0; aspect-ratio: 4 / 3; border-radius: var(--cm-radius-md); font-size: 14px; }
779
+ .zone.photo.invalid { border-color: var(--cm-border-critical); }
780
+ .photo-label { font-weight: 500; overflow-wrap: anywhere; }
781
+ .shot {
782
+ aspect-ratio: 4 / 3; border-radius: var(--cm-radius-md); overflow: hidden;
783
+ background: var(--cm-bg-inset); border: var(--cm-border-1) solid var(--cm-border-card);
784
+ }
785
+ .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
786
+ .caption { margin: var(--cm-space-10) 0 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
787
+ .caption:empty { display: none; }
788
+ .actions { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); margin-top: var(--cm-space-10); }
789
+ .action {
790
+ display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 1 0; min-width: max-content;
791
+ min-height: 40px; padding: 0 var(--cm-space-15); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
792
+ background: var(--cm-bg-hover); color: var(--cm-text-default);
793
+ border: var(--cm-border-1) solid var(--cm-border-strong); border-radius: var(--cm-radius-sm);
794
+ }
795
+ .action:hover { background: var(--cm-bg-surface); }
796
+ .action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
751
797
  @media (max-width: 640px) {
752
- .zone:not(.tile) { min-height: 100px; font-size: 14px; }
798
+ .zone:not(.tile):not(.photo) { min-height: 100px; font-size: 14px; }
753
799
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
754
800
  }
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}
801
+ `];g("cm-file-upload",St);var jb=M("colorField",{swatch:"{name}, {hex}",hex:"Hex code",hexNamed:"{label}, hex code",placeholder:"#RRGGBB",picker:"Choose a custom colour",pickerNamed:"Choose a custom colour for {label}",required:"Please choose a colour.",invalid:"Enter a colour as #RRGGBB, for example #2e6faf.",black:"Black",grey:"Grey",lightGrey:"Light grey",red:"Red",darkOrange:"Dark orange",orange:"Orange",yellow:"Yellow",lightGreen:"Light green",green:"Green",lightBlue:"Light blue",blue:"Blue",indigo:"Indigo"}),Uu=[{value:"#000000",key:"black"},{value:"#707070",key:"grey"},{value:"#c9c9c9",key:"lightGrey"},{value:"#de0000",key:"red"},{value:"#ad5500",key:"darkOrange"},{value:"#f1a953",key:"orange"},{value:"#ffc107",key:"yellow"},{value:"#81bb47",key:"lightGreen"},{value:"#3c7c00",key:"green"},{value:"#5394d9",key:"lightBlue"},{value:"#2e6faf",key:"blue"},{value:"#446beb",key:"indigo"}];function at(n){let r=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(n.trim());return r?`#${(r[1].length===3?[...r[1]].map(t=>t+t).join(""):r[1]).toLowerCase()}`:null}var Ku=n=>{let r=parseInt(n.slice(1),16);return[r>>16&255,r>>8&255,r&255].map(e=>e/255).map(e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4).reduce((e,t,i)=>e+t*[.2126,.7152,.0722][i],0)};function Gu(n){let r=Ku(n);return(r+.05)/.05>=1.05/(r+.05)?"#000000":"#ffffff"}var Me,Fe,La,ls,O,ai,Sc,Oh,qh,Ac,Ph,Bh,jh,Fh,At=class extends k{constructor(){super(...arguments);p(this,O);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.required=!1;this.disabled=!1;this._invalid=!1;p(this,Me,this.attachInternals());p(this,Fe,L("cm-cf"));p(this,La,"");p(this,ls)}connectedCallback(){super.connectedCallback(),f(this,La,at(this.value)??this.value)}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,La),this._draft=void 0,this._invalid=!1}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get items(){return this.swatches?this.swatches.flatMap(e=>{let t=typeof e=="string"?{value:e}:e,i=at(t?.value??"");return i?[{value:i,name:t.name}]:[]}):Uu.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=at(this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==s(this,ls)&&(this._draft=void 0,this._invalid=!1),f(this,ls,void 0)}}updated(){let e=!this.value||at(this.value)!==null;s(this,Me).setFormValue(this.value&&e?this.value:null,this.value);let t=this.renderRoot.querySelector(".input")??void 0;this.error?s(this,Me).setValidity({customError:!0},this.error,t):this._invalid||!e?s(this,Me).setValidity({patternMismatch:!0},this.t("invalid"),t):this.required&&!this.value?s(this,Me).setValidity({valueMissing:!0},this.t("required"),t):s(this,Me).setValidity({})}render(){let e=this.items,t=at(this.value??""),i=e.findIndex(m=>m.value===t),a=this.error||(this._invalid||this.value&&!t?this.t("invalid"):""),c=[a&&`${s(this,Fe)}-err`,this.helpText&&`${s(this,Fe)}-help`].filter(Boolean).join(" ")||d,h=this.getAttribute("aria-label"),u=this.label||h||"";return l`<div class="field">
802
+ ${this.label?l`<span class="label" id="${s(this,Fe)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}${this.hint?l`<span class="hint">[${this.hint}]</span>`:d}</span>`:d}
803
+ ${e.length?l`<div class="swatches" part="swatches" role="radiogroup"
804
+ aria-labelledby=${this.label?`${s(this,Fe)}-l`:d} aria-label=${!this.label&&h?h:d}
805
+ aria-required=${this.required?"true":d} aria-describedby=${c}>
806
+ ${e.map((m,y)=>{let v=m.name?this.t("swatch",{name:m.name,hex:m.value}):m.value;return l`<button type="button" class="swatch" part="swatch" role="radio" aria-checked=${y===i?"true":"false"}
807
+ aria-label=${v} title=${m.name||m.value} tabindex=${y===(i>=0?i:0)?"0":"-1"} ?disabled=${this.disabled}
808
+ style="background-color:${m.value};color:${Gu(m.value)}"
809
+ @click=${()=>o(this,O,Sc).call(this,y)} @keydown=${E=>o(this,O,Oh).call(this,E,y)}><cm-icon name="check" size="18"></cm-icon></button>`})}
810
+ </div>`:d}
811
+ <div class="row">
812
+ ${this.picker?l`<label class="pick" part="picker" style=${t?`background-color:${t}`:d}>
813
+ <input type="color" .value=${se(t??"#000000")} ?disabled=${this.disabled}
814
+ aria-label=${u?this.t("pickerNamed",{label:u}):this.t("picker")}
815
+ @input=${o(this,O,jh)} @change=${o(this,O,Fh)} />
816
+ <cm-icon name="edit" size="12" aria-hidden="true"></cm-icon>
817
+ </label>`:l`<span class="preview" part="preview" aria-hidden="true" style=${t?`background-color:${t}`:d}></span>`}
818
+ <input class="input" part="input" id=${s(this,Fe)} type="text" inputmode="text" autocomplete="off" spellcheck="false"
819
+ maxlength="7" .value=${se(this._draft??this.value??"")} placeholder=${this.t("placeholder")}
820
+ aria-label=${u?this.t("hexNamed",{label:u}):this.t("hex")}
821
+ ?required=${this.required} ?disabled=${this.disabled}
822
+ aria-invalid=${a?"true":d} aria-describedby=${c}
823
+ @input=${o(this,O,qh)} @change=${o(this,O,Ph)} @keydown=${o(this,O,Bh)} />
824
+ </div>
825
+ ${a?l`<p class="error" id="${s(this,Fe)}-err" role="alert">${a}</p>`:d}
826
+ ${this.helpText?l`<p class="help" id="${s(this,Fe)}-help">${this.helpText}</p>`:d}
827
+ </div>`}};Me=new WeakMap,Fe=new WeakMap,La=new WeakMap,ls=new WeakMap,O=new WeakSet,ai=function(...e){for(let t of e)this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))},Sc=function(e){let t=this.items[e];!t||this.disabled||(this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".swatch")[e]?.focus()),this._draft=void 0,this._invalid=!1,t.value!==this.value&&(this.value=t.value,o(this,O,ai).call(this,"input","change")))},Oh=function(e,t){let i=this.items.length,a=ne(e,this),c;if(a==="ArrowRight"||e.key==="ArrowDown")c=(t+1)%i;else if(a==="ArrowLeft"||e.key==="ArrowUp")c=(t-1+i)%i;else if(e.key==="Home")c=0;else if(e.key==="End")c=i-1;else if(e.key===" "||e.key==="Enter")c=t;else return;e.preventDefault(),o(this,O,Sc).call(this,c)},qh=function(e){e.stopPropagation();let t=e.target.value;this._draft=t;let i=/^#?[0-9a-f]{6}$/i.test(t.trim())?at(t):null;i&&i!==this.value&&(f(this,ls,i),this.value=i,o(this,O,ai).call(this,"input")),this._invalid&&(i||!t.trim())&&(this._invalid=!1)},Ac=function(){if(this._draft===void 0)return;let e=this._draft.trim(),t=e?at(e):"";if(t===null){this._invalid=!0;return}let i=this.value;this.value=t,this._draft=void 0,this._invalid=!1,t!==i&&o(this,O,ai).call(this,"input"),o(this,O,ai).call(this,"change")},Ph=function(e){e.stopPropagation(),o(this,O,Ac).call(this)},Bh=function(e){e.key==="Enter"&&o(this,O,Ac).call(this)},jh=function(e){e.stopPropagation();let t=at(e.target.value);!t||t===this.value||(this.value=t,this._draft=void 0,this._invalid=!1,o(this,O,ai).call(this,"input"))},Fh=function(e){e.stopPropagation(),o(this,O,ai).call(this,"change")},At.formAssociated=!0,At.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},At.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},swatches:{type:Array},picker:{type:Boolean},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_draft:{state:!0},_invalid:{state:!0}},At.styles=[w,b`
828
+ :host { display: block; }
829
+ .field { display: flex; flex-direction: column; gap: var(--cm-space-10); }
830
+ .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
831
+ .req { color: var(--cm-text-critical); margin-inline-start: 2px; }
832
+ .hint { margin-inline-start: var(--cm-space-10); font-size: 12px; color: var(--cm-text-tertiary); text-transform: lowercase; }
833
+ .swatches { display: flex; flex-wrap: wrap; gap: var(--cm-space-10); padding: 4px; margin: -4px; }
834
+ .swatch {
835
+ position: relative; display: inline-flex; align-items: center; justify-content: center;
836
+ width: 32px; height: 32px; padding: 0; cursor: pointer; border-radius: var(--cm-radius-full);
837
+ border: var(--cm-border-1) solid var(--cm-border-input);
838
+ }
839
+ .swatch cm-icon { visibility: hidden; }
840
+ .swatch[aria-checked='true'] { box-shadow: 0 0 0 2px var(--cm-bg-surface), 0 0 0 4px var(--cm-border-strong); }
841
+ .swatch[aria-checked='true'] cm-icon { visibility: visible; }
842
+ .swatch:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 6px; }
843
+ .swatch:disabled { cursor: not-allowed; opacity: 0.4; }
844
+ .row { display: flex; align-items: center; gap: var(--cm-space-10); }
845
+ .preview, .pick {
846
+ position: relative; flex: none; width: 42px; height: 42px; border-radius: var(--cm-radius-sm);
847
+ border: var(--cm-border-1) solid var(--cm-border-input); background: var(--cm-bg-inset);
848
+ }
849
+ .pick { cursor: pointer; }
850
+ .pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; padding: 0; border: 0; }
851
+ .pick:focus-within { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
852
+ .pick cm-icon {
853
+ position: absolute; inset-inline-end: -6px; bottom: -6px; padding: 2px; border-radius: var(--cm-radius-full);
854
+ background: var(--cm-bg-surface); color: var(--cm-text-default); border: var(--cm-border-1) solid var(--cm-border-input);
855
+ }
856
+ .input {
857
+ width: 11ch; min-width: 0; flex: 0 1 auto; height: 42px; padding: 0 var(--cm-space-10);
858
+ font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--cm-text-default);
859
+ background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-input);
860
+ border-radius: var(--cm-radius-sm); outline: none; box-sizing: content-box;
861
+ }
862
+ .input::placeholder { color: var(--cm-text-tertiary); }
863
+ .input:focus { border-color: var(--cm-border-strong); box-shadow: 0 0 0 1px var(--cm-border-strong); }
864
+ .input[aria-invalid='true'] { border-color: var(--cm-border-critical); }
865
+ .input:disabled { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-default); cursor: not-allowed; }
866
+ :host([disabled]) .pick { cursor: not-allowed; opacity: 0.4; }
867
+ :host([disabled]) .preview { opacity: 0.4; }
868
+ .help { margin: 0; font-size: 12px; color: var(--cm-text-tertiary); }
869
+ .error { margin: 0; font-size: 12px; color: var(--cm-text-critical); }
870
+ `];g("cm-color-field",At);var Wb=M("optionGroup",{required:"Please select one of these options."}),Ie,Sa,cs,Aa,Ve,Dc,Nc,Vh,ni=class extends k{constructor(){super(...arguments);p(this,Ve);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];p(this,Ie,this.attachInternals());p(this,Sa,L("cm-og"));p(this,cs,"");p(this,Aa,new MutationObserver(()=>o(this,Ve,Dc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,Ve,Dc).call(this),s(this,Aa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Aa).disconnect()}get form(){return s(this,Ie).form}get validity(){return s(this,Ie).validity}get validationMessage(){return s(this,Ie).validationMessage}checkValidity(){return s(this,Ie).checkValidity()}reportValidity(){return s(this,Ie).reportValidity()}formResetCallback(){this.value=s(this,cs)}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,cs)||f(this,cs,this.value)}updated(){s(this,Ie).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?s(this,Ie).setValidity({valueMissing:!0},this.t("required"),e):s(this,Ie).setValidity({})}render(){let e=this.items,t=e.findIndex(c=>c.value===this.value&&!c.disabled),i=t>=0?t:e.findIndex(c=>!c.disabled),a=this.getAttribute("aria-label");return l`
871
+ ${this.label?l`<span class="label" id="${s(this,Sa)}-l" part="label">${this.label}${this.required?l`<span class="req" aria-hidden="true">*</span>`:d}</span>`:d}
757
872
  <div class="options" part="options" role="radiogroup"
758
- aria-labelledby=${this.label?`${s(this,Ka)}-l`:c} aria-label=${!this.label&&l?l:c}
759
- aria-required=${this.required?"true":c}>
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>`)}
873
+ aria-labelledby=${this.label?`${s(this,Sa)}-l`:d} aria-label=${!this.label&&a?a:d}
874
+ aria-required=${this.required?"true":d}>
875
+ ${e.map((c,h)=>l`<button type="button" role="radio" part="option" class=${c.tone==="critical"||c.tone==="success"?`tone-${c.tone}`:d} aria-checked=${c.value===this.value?"true":"false"}
876
+ tabindex=${h===i?"0":"-1"} ?disabled=${this.disabled||!!c.disabled}
877
+ @click=${()=>o(this,Ve,Nc).call(this,h)} @keydown=${u=>o(this,Ve,Vh).call(this,u,h)}>${c.label}</button>`)}
763
878
  </div>
764
879
  <slot></slot>
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`
880
+ `}};Ie=new WeakMap,Sa=new WeakMap,cs=new WeakMap,Aa=new WeakMap,Ve=new WeakSet,Dc=function(){let e=[...this.querySelectorAll("option")];this._slotted=e.map(t=>{let i={value:t.value,label:t.label||t.textContent.trim(),disabled:t.disabled},a=t.getAttribute("tone");return(a==="critical"||a==="success")&&(i.tone=a),i}),!this.hasUpdated&&!this.value&&(this.value=e.find(t=>t.hasAttribute("selected"))?.value??"",f(this,cs,this.value))},Nc=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}))))},Vh=function(e,t){let i=ne(e,this),a=this.items.flatMap((u,m)=>u.disabled?[]:[m]),c=a.indexOf(t),h;if(i==="ArrowRight"||e.key==="ArrowDown")h=a[(c+1)%a.length];else if(i==="ArrowLeft"||e.key==="ArrowUp")h=a[(c-1+a.length)%a.length];else if(e.key==="Home")h=a[0];else if(e.key==="End")h=a[a.length-1];else return;e.preventDefault(),h!==void 0&&o(this,Ve,Nc).call(this,h)},ni.formAssociated=!0,ni.properties={label:{},name:{reflect:!0},value:{},options:{type:Array},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_slotted:{state:!0}},ni.styles=[w,b`
766
881
  :host { display: block; }
767
882
  .label { display: block; margin-bottom: var(--cm-space-20); font-size: var(--cm-type-heading-sm-size); font-weight: 600; }
768
883
  .req { color: var(--cm-text-critical); margin-inline-start: 2px; }
@@ -777,31 +892,43 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
777
892
  button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
778
893
  button:disabled { background: var(--cm-bg-input-filled); color: var(--cm-text-secondary); border-color: var(--cm-border-default); cursor: not-allowed; }
779
894
  button[aria-checked='true']:disabled { background: var(--cm-action-disabled); color: var(--cm-action-disabled-text); }
895
+ /* Tones (1.3), the same token pairs as cm-button's tones (packages/tokens/scripts/contrast.mjs). Unselected: tone
896
+ text and outline on bg-surface (text-critical on bg-hover is under 4.5:1 in dark), hover tints it. Selected:
897
+ filled with the tone's text colour under action-primary-text; hover darkens it towards text-default. Selected
898
+ and unselected differ by fill, not only hue; disabled options look like any disabled option. */
899
+ button.tone-critical:not(:disabled) { --_tone: var(--cm-text-critical); --_edge: var(--cm-border-critical); --_tint: var(--cm-bg-critical); }
900
+ button.tone-success:not(:disabled) { --_tone: var(--cm-text-success); --_edge: var(--cm-text-success); --_tint: var(--cm-bg-success-soft); }
901
+ button[class^='tone-']:not(:disabled) { background: var(--cm-bg-surface); color: var(--_tone); border-color: var(--_edge); }
902
+ button[class^='tone-']:not(:disabled):hover { background: linear-gradient(var(--_tint), var(--_tint)) var(--cm-bg-surface); }
903
+ button[class^='tone-'][aria-checked='true']:not(:disabled) { background: var(--_tone); border-color: var(--_tone); color: var(--cm-action-primary-text); }
904
+ button[class^='tone-'][aria-checked='true']:not(:disabled):hover {
905
+ background: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default)); border-color: color-mix(in srgb, var(--_tone) 80%, var(--cm-text-default));
906
+ }
780
907
  slot { display: none; }
781
908
  @media (max-width: 640px) {
782
909
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
783
910
  .options { gap: var(--cm-space-10); }
784
911
  button { height: 42px; padding: 0 var(--cm-space-15); font-size: 14px; }
785
912
  }
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">
913
+ `];g("cm-option-group",ni);var ig=M("pageHeader",{back:"Back to {label}",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),Da,Rc,ds=class extends k{constructor(){super(...arguments);p(this,Da);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 l`<header part="header">
787
914
  <div class="lead">
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}
915
+ ${t?l`<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>`:d}
789
916
  <div class="titles">
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>`)}
917
+ ${e.length?l`<nav aria-label=${this.t("breadcrumbs")} part="breadcrumbs"><ol>
918
+ ${e.map(i=>l`<li>${i.href?l`<a href=${i.href}>${i.label}</a>`:i.label}</li>`)}
792
919
  <li><span aria-current="page">${this.heading}</span></li>
793
- </ol></nav>`:c}
920
+ </ol></nav>`:d}
794
921
  <h1 part="title"><span class="text">${this.heading}</span><slot name="title-adornment"></slot></h1>
795
922
  </div>
796
923
  </div>
797
924
  <div class="actions">
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>
801
- </div>`:c}
925
+ ${this.pagination?l`<div class="arrows" role="group" aria-label=${this.t("records")}>
926
+ <button class="arrow" type="button" aria-label=${this.t("previous")} ?disabled=${!this.hasPrevious} @click=${()=>o(this,Da,Rc).call(this,"cm-previous")}><cm-icon name="chevron-left" size="16"></cm-icon></button>
927
+ <button class="arrow" type="button" aria-label=${this.t("next")} ?disabled=${!this.hasNext} @click=${()=>o(this,Da,Rc).call(this,"cm-next")}><cm-icon name="chevron-right" size="16"></cm-icon></button>
928
+ </div>`:d}
802
929
  <slot name="actions"></slot>
803
930
  </div>
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`
931
+ </header>`}};Da=new WeakSet,Rc=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},ds.properties={heading:{},breadcrumbs:{type:Array},pagination:{type:Boolean,reflect:!0},hasPrevious:{type:Boolean,attribute:"has-previous"},hasNext:{type:Boolean,attribute:"has-next"}},ds.styles=[w,b`
805
932
  :host { display: block; }
806
933
  header {
807
934
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--cm-space-20);
@@ -843,17 +970,17 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
843
970
  h1 { font-size: 18px; font-weight: 600; }
844
971
  .actions { gap: var(--cm-space-10); }
845
972
  }
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")}>
973
+ `];g("cm-page-header",ds);var cg=M("actionBar",{label:"Actions"}),hs=class extends k{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return l`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
847
974
  <div class="lead">
848
- ${e?o`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:c}
975
+ ${e?l`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:d}
849
976
  <div class="text">
850
977
  <div class="eyebrow" ?hidden=${!this.eyebrow}>${this.eyebrow}<slot name="adornment"></slot></div>
851
- ${this.heading?o`<p class="heading" part="heading" role=${e?"alert":c}>${this.heading}</p>`:c}
978
+ ${this.heading?l`<p class="heading" part="heading" role=${e?"alert":d}>${this.heading}</p>`:d}
852
979
  <slot></slot>
853
980
  </div>
854
981
  </div>
855
982
  <div class="actions"><slot name="actions"></slot></div>
856
- </div>`}};Ri.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},Ri.styles=[v,u`
983
+ </div>`}};hs.properties={eyebrow:{},heading:{},tone:{reflect:!0},sticky:{type:Boolean,reflect:!0},label:{}},hs.styles=[w,b`
857
984
  :host { display: block; }
858
985
  :host([sticky]) { position: sticky; bottom: 0; z-index: 10; }
859
986
  .bar {
@@ -884,13 +1011,13 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
884
1011
  .icon { width: 30px; height: 30px; }
885
1012
  .actions { gap: var(--cm-space-10); }
886
1013
  }
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}>
1014
+ `];g("cm-action-bar",hs);var fg=M("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Ue,oi,Na,pe,Hc,Ic,Oc,Uh,Kh,ps=class extends k{constructor(){super(...arguments);p(this,pe);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";p(this,Ue,null);p(this,oi,()=>{this.open=!0});p(this,Na,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>o(this,pe,Hc).call(this))}disconnectedCallback(){super.disconnectedCallback(),o(this,pe,Ic).call(this)}updated(e){e.has("form")&&this.isConnected&&o(this,pe,Hc).call(this)}render(){return l`<div class="bar" part="bar" role="region" aria-label=${this.message}>
888
1015
  <p class="message" part="message" role="status">${this.open?this.message:""}</p>
889
1016
  <div class="actions">
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>
1017
+ <cm-button size="large" ?disabled=${this.loading} @click=${o(this,pe,Kh)}>${this.discardLabel}</cm-button>
1018
+ <cm-button size="large" variant="primary" ?loading=${this.loading} ?disabled=${this.saveDisabled} @click=${o(this,pe,Uh)}>${this.saveLabel}</cm-button>
892
1019
  </div>
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`
1020
+ </div>`}};Ue=new WeakMap,oi=new WeakMap,Na=new WeakMap,pe=new WeakSet,Hc=function(){o(this,pe,Ic).call(this);let e=this.form?this.getRootNode().getElementById?.(this.form):null;e instanceof HTMLFormElement&&(f(this,Ue,e),e.addEventListener("input",s(this,oi)),e.addEventListener("change",s(this,oi)),e.addEventListener("reset",s(this,Na)))},Ic=function(){let e=s(this,Ue);e&&(e.removeEventListener("input",s(this,oi)),e.removeEventListener("change",s(this,oi)),e.removeEventListener("reset",s(this,Na)),f(this,Ue,null))},Oc=function(e){return this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,cancelable:!0}))},Uh=function(){this.loading||this.saveDisabled||o(this,pe,Oc).call(this,"cm-save")&&s(this,Ue)&&s(this,Ue).requestSubmit()},Kh=function(){this.loading||o(this,pe,Oc).call(this,"cm-discard")&&s(this,Ue)&&(s(this,Ue).reset(),this.open=!1)},ps.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:{}},ps.styles=[w,b`
894
1021
  :host { display: block; position: sticky; bottom: 0; z-index: 20; }
895
1022
  :host(:not([open])) { display: none; }
896
1023
  .bar {
@@ -906,14 +1033,14 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
906
1033
  .message { font-size: 14px; font-weight: 500; }
907
1034
  .actions { gap: var(--cm-space-10); }
908
1035
  }
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>
1036
+ `];g("cm-save-bar",ps);var us=class extends _{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 l`<section part="panel" aria-label=${this.heading||d}>
1037
+ ${this.heading||this.action?l`<header>
911
1038
  <div class="title" role="heading" aria-level=${e} part="title">${this.heading}</div>
912
- ${this.action?o`<button class="action" type="button" part="action" aria-label=${this.actionLabel||c}
913
- @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:c}
914
- </header>`:c}
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`
1039
+ ${this.action?l`<button class="action" type="button" part="action" aria-label=${this.actionLabel||d}
1040
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:d}
1041
+ </header>`:d}
1042
+ <div class="items" role=${this._list?"list":d}><slot @slotchange=${t=>{this._list=t.target.assignedElements().every(i=>i.localName==="cm-info-item")}}></slot></div>
1043
+ </section>`}};us.properties={heading:{},action:{},actionLabel:{attribute:"action-label"},headingLevel:{type:Number,attribute:"heading-level"},_list:{state:!0}},us.styles=[w,b`
917
1044
  :host { display: block; }
918
1045
  section {
919
1046
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
@@ -929,7 +1056,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
929
1056
  .action:hover { text-decoration: underline; }
930
1057
  .action:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
931
1058
  .items { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cm-space-15) var(--cm-space-20); }
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`
1059
+ `];g("cm-info-panel",us);var ms=class extends _{constructor(){super(...arguments);this.label="";this.half=!1}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){return l`<div class="label" part="label">${this.label}</div><div class="value" part="value"><slot></slot></div>`}};ms.properties={label:{},half:{type:Boolean,reflect:!0}},ms.styles=[w,b`
933
1060
  :host { display: block; grid-column: 1 / -1; min-width: 0; }
934
1061
  :host([half]) { grid-column: auto; }
935
1062
  .label { font-size: 16px; }
@@ -937,16 +1064,16 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
937
1064
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-10);
938
1065
  margin-top: 6px; font-size: 16px; font-weight: 500; overflow-wrap: anywhere;
939
1066
  }
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">
1067
+ `];g("cm-info-item",ms);var li,fs=class extends _{constructor(){super(...arguments);this.heading="";this.open=!1;this.disabled=!1;this.headingLevel=3;p(this,li,L("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 l`<div class="wrap" part="accordion">
941
1068
  <div class="h" role="heading" aria-level=${e}>
942
- <button type="button" part="toggle" id="${s(this,Bt)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,Bt)}-body"
1069
+ <button type="button" part="toggle" id="${s(this,li)}-btn" aria-expanded=${this.open?"true":"false"} aria-controls="${s(this,li)}-body"
943
1070
  ?disabled=${this.disabled} @click=${this.toggle}>
944
1071
  <span>${this.heading}</span>
945
1072
  <span class="chev" aria-hidden="true"><cm-icon name="chevron-down" size="16"></cm-icon></span>
946
1073
  </button>
947
1074
  </div>
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`
1075
+ <div class="body" part="body" id="${s(this,li)}-body" role="region" aria-labelledby="${s(this,li)}-btn" ?hidden=${!this.open}><slot></slot></div>
1076
+ </div>`}};li=new WeakMap,fs.properties={heading:{},open:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},fs.styles=[w,b`
950
1077
  :host { display: block; }
951
1078
  .wrap { border: var(--cm-border-1) solid var(--cm-border-default); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface); }
952
1079
  .h { margin: 0; font: inherit; }
@@ -968,24 +1095,24 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
968
1095
  .body { padding: var(--cm-space-15) var(--cm-space-20); border-top: var(--cm-border-1) solid var(--cm-border-default); font-size: 14px; }
969
1096
  .body[hidden] { display: none; }
970
1097
  @media (max-width: 640px) { button { min-height: 50px; font-size: 14px; } .chev { width: 28px; height: 28px; } }
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">
972
- <div class="circle" part="circle" aria-hidden=${this.hasImage?c:"true"}>
973
- <slot name="image" @slotchange=${i=>n(this,ce,Ft).call(this,i,"hasImage")}>${t}</slot>
1098
+ `];g("cm-accordion",fs);var xe,ci,qc,Gh,bs=class extends _{constructor(){super(...arguments);p(this,xe);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 o(this,xe,Gh).call(this,e);let t=this.image?l`<img src=${this.image} alt="" part="image">`:this.icon?l`<cm-icon name=${this.icon} size="96"></cm-icon>`:d;return l`<div class="wrap" part="empty-state">
1099
+ <div class="circle" part="circle" aria-hidden=${this.hasImage?d:"true"}>
1100
+ <slot name="image" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasImage")}>${t}</slot>
974
1101
  </div>
975
1102
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
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>
1103
+ <div class="text" ?hidden=${!this.hasText}><slot @slotchange=${i=>o(this,xe,ci).call(this,i,"hasText")}></slot></div>
1104
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasActions")}></slot></div>${this.action?l`<div class="actions">${o(this,xe,qc).call(this)}</div>`:d}
1105
+ </div>`}};xe=new WeakSet,ci=function(e,t){let i=e.target;this[t]=i.assignedNodes({flatten:!0}).some(a=>a.nodeType===1||a.textContent.trim()),this.requestUpdate()},qc=function(){return this.action?this.actionHref?l`<a class="text-action" part="action" href=${this.actionHref}>${this.action}</a>`:l`<button class="text-action" type="button" part="action"
1106
+ @click=${()=>this.dispatchEvent(new CustomEvent("cm-action",{bubbles:!0,composed:!0}))}>${this.action}</button>`:d},Gh=function(e){let t=this.image?l`<img src=${this.image} alt="" part="image">`:this.icon?l`<cm-icon name=${this.icon} size="20"></cm-icon>`:d;return l`<div class="wrap inline" part="empty-state">
1107
+ <span class="icon" part="circle" aria-hidden=${this.hasImage?d:"true"} ?hidden=${!this.hasImage&&!this.image&&!this.icon}>
1108
+ <slot name="image" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasImage")}>${t}</slot>
982
1109
  </span>
983
1110
  <div class="line">
984
1111
  <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>
1112
+ <span class="text" ?hidden=${!this.hasText}> <slot @slotchange=${i=>o(this,xe,ci).call(this,i,"hasText")}></slot></span>${o(this,xe,qc).call(this)}
1113
+ <span class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${i=>o(this,xe,ci).call(this,i,"hasActions")}></slot></span>
987
1114
  </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`
1115
+ </div>`},bs.properties={heading:{},image:{},icon:{},headingLevel:{type:Number,attribute:"heading-level"},size:{reflect:!0},action:{},actionHref:{attribute:"action-href"}},bs.styles=[w,b`
989
1116
  :host { display: block; }
990
1117
  .wrap {
991
1118
  display: flex; flex-direction: column; align-items: center; text-align: center;
@@ -1027,7 +1154,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1027
1154
  .title { margin-top: 30px; font-size: 14px; }
1028
1155
  .actions { gap: var(--cm-space-10); }
1029
1156
  }
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`
1157
+ `];g("cm-empty-state",bs);var Yh={small:34,medium:40,large:50,xlarge:186},gs=class extends _{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=Yh[this.size]??Yh.large;return l`<span class="bone" part="bone" style="width:${t}px;height:${t}px"></span>`}if(this.variant==="block")return l`<span class="bone block" part="bone"></span>`;let e=Math.max(1,Math.floor(this.lines||1));return l`${Array.from({length:e},(t,i)=>l`<span class="bone line ${e>1&&i===e-1?"short":""}" part="bone"></span>`)}`}};gs.properties={variant:{reflect:!0},lines:{type:Number},size:{reflect:!0}},gs.styles=[w,b`
1031
1158
  :host { display: block; --cm-skeleton-height: 120px; }
1032
1159
  :host([variant='thumbnail']) { display: inline-block; vertical-align: middle; }
1033
1160
  .bone {
@@ -1042,17 +1169,17 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1042
1169
  .bone { animation: none; background: var(--cm-thumb-bg); }
1043
1170
  }
1044
1171
  @media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
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">
1172
+ `];g("cm-skeleton",gs);var Yu=[472,90,90,251],Wu=[94,266,134,191,138],vs=class extends k{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>l`<span class="bone" style="height:${i}px"></span>`);return l`<div class="wrap" part="skeleton-display" aria-busy="true">
1046
1173
  <span class="sr" role="status">${this.label}</span>
1047
1174
  <div class="page" aria-hidden="true">
1048
- ${this.navigation?o`<span class="bone nav"></span>`:c}
1175
+ ${this.navigation?l`<span class="bone nav"></span>`:d}
1049
1176
  <span class="bone head"></span>
1050
1177
  <div class="body">
1051
- <div class="col main">${e(this.layout==="one-column"?[472,251]:Xh)}</div>
1052
- <div class="col side">${e(Jh)}</div>
1178
+ <div class="col main">${e(this.layout==="one-column"?[472,251]:Yu)}</div>
1179
+ <div class="col side">${e(Wu)}</div>
1053
1180
  </div>
1054
1181
  </div>
1055
- </div>`}};Vi.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},Vi.styles=[v,u`
1182
+ </div>`}};vs.properties={layout:{reflect:!0},navigation:{type:Boolean,reflect:!0},label:{string:"loading"}},vs.styles=[w,b`
1056
1183
  :host { display: block; }
1057
1184
  .page { display: grid; grid-template-columns: 1fr; gap: var(--cm-space-10); }
1058
1185
  :host([navigation]) .page { grid-template-columns: 250px minmax(0, 1fr); }
@@ -1076,11 +1203,11 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1076
1203
  .body { grid-template-columns: minmax(0, 1fr); }
1077
1204
  .head { height: 60px; }
1078
1205
  }
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}
1206
+ `];g("cm-skeleton-display",vs);var Bg=M("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Qo,Wh,xs=class extends k{constructor(){super(...arguments);p(this,Qo);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,Qo,Wh).call(this);return l`<article part="comment">
1207
+ ${e?l`<time class="meta" part="time" datetime=${this.datetime||d}>${e}</time>`:d}
1081
1208
  <div class="body" part="body"><slot></slot></div>
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`
1209
+ ${this.author?l`<div class="meta" part="author">– ${this.author}</div>`:d}
1210
+ </article>`}};Qo=new WeakSet,Wh=function(){if(this.time)return this.time;if(!this.datetime)return"";let e=new Date(this.datetime);return Number.isNaN(e.getTime())?this.datetime:Z(e,{dateStyle:"medium",timeStyle:"short"},this.locale)},xs.properties={author:{},datetime:{},time:{}},xs.styles=[w,b`
1084
1211
  :host { display: block; }
1085
1212
  article {
1086
1213
  display: flex; flex-direction: column; gap: 6px; padding: var(--cm-space-10);
@@ -1088,16 +1215,16 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1088
1215
  }
1089
1216
  .meta { font-size: 12px; color: var(--cm-text-tertiary); }
1090
1217
  .body { font-size: 14px; line-height: 16px; overflow-wrap: anywhere; }
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>
1093
- <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||c} .value=${this.value}
1218
+ `];g("cm-comment",xs);var Ra,el,Xh,ys=class extends k{constructor(){super(...arguments);p(this,el);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;p(this,Ra,L("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 l`<section part="comment-box" aria-labelledby="${s(this,Ra)}-h">
1219
+ <div class="title" id="${s(this,Ra)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1220
+ <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||d} .value=${this.value}
1094
1221
  ?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
1095
- @keydown=${n(this,Xn,yd)}></textarea>
1222
+ @keydown=${o(this,el,Xh)}></textarea>
1096
1223
  <div class="actions"><cm-button variant="primary" size="large" ?disabled=${this.disabled} @click=${()=>this.submit()}>${this.action}</cm-button></div>
1097
1224
  <div class="list" role="list" ?hidden=${!this.hasComments}>
1098
1225
  <slot @slotchange=${t=>{this.hasComments=t.target.assignedElements().length>0,this.requestUpdate()}}></slot>
1099
1226
  </div>
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`
1227
+ </section>`}};Ra=new WeakMap,el=new WeakSet,Xh=function(e){e.key==="Enter"&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())},ys.properties={heading:{string:"heading"},label:{string:"label"},placeholder:{},action:{string:"action"},value:{},disabled:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},ys.styles=[w,b`
1101
1228
  :host { display: block; }
1102
1229
  section { display: flex; flex-direction: column; gap: var(--cm-space-20); }
1103
1230
  .title { margin: 0; font-size: 20px; font-weight: 600; }
@@ -1118,8 +1245,8 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1118
1245
  textarea { min-height: 100px; }
1119
1246
  .actions { justify-content: flex-end; }
1120
1247
  }
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`
1248
+ `];g("cm-comment-box",ys);var tl='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',ie,$s,Dt,Nt,Ke,ks,Es,Te,Pc,il,sl,rl,al,Ms,Jh,di,Bc,jc,nt,ws=class extends _{constructor(){super(...arguments);p(this,Te);this.content="";this.placement="top";this.delay=300;this.open=!1;this.visualOnly=!1;this._side="top";p(this,ie);p(this,$s);p(this,Dt,[]);p(this,Nt);p(this,Ke);p(this,ks,!1);p(this,Es,!1);p(this,il,()=>{f(this,ks,!0),clearTimeout(s(this,Ke)),this.open||f(this,Ke,setTimeout(()=>this.show(),this.delay))});p(this,sl,()=>{f(this,ks,!1),clearTimeout(s(this,Ke)),s(this,Es)||f(this,Ke,setTimeout(()=>this.hide(),100))});p(this,rl,()=>{f(this,Es,!0),this.show()});p(this,al,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(f(this,Es,!1),s(this,ks)||this.hide())});p(this,Ms,e=>{e.key==="Escape"&&this.open&&this.hide()});p(this,di,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(o(this,Te,jc).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(tl)&&i.then(()=>{t.shadowRoot?.querySelector(tl)&&s(this,di).call(this)}),s(this,ie)||(f(this,ie,document.createElement("span")),s(this,ie).id=L("cm-tooltip"),s(this,ie).hidden=!0,s(this,ie).slot="description"),s(this,ie).textContent=this.content,s(this,ie).isConnected||this.append(s(this,ie));let a=o(this,Te,Jh).call(this,t);if(f(this,$s,a),a.getRootNode()===s(this,ie).getRootNode()){let c=(a.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);c.includes(s(this,ie).id)||a.setAttribute("aria-describedby",[...c,s(this,ie).id].join(" "))}else"ariaDescribedByElements"in a?(o(this,Te,Bc).call(this,a),f(this,Nt,new MutationObserver(()=>{a.getAttribute("aria-describedby")!==""&&o(this,Te,Bc).call(this,a)})),s(this,Nt).observe(a,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",s(this,ie).id)});p(this,nt,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let a=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),c=e.getBoundingClientRect(),h=8,u=8,m=innerWidth,y=innerHeight,v=getComputedStyle(this).direction==="rtl",E=_i=>_i==="start"?v?"right":"left":_i==="end"?v?"left":"right":_i,$={top:a.top-h-c.height>=u,bottom:a.bottom+h+c.height<=y-u,left:a.left-h-c.width>=u,right:a.right+h+c.width<=m-u},T={top:"bottom",bottom:"top",left:"right",right:"left"},D=E(this.placement);!$[D]&&$[T[D]]&&(D=T[D]);let P,j;D==="top"||D==="bottom"?(P=a.left+a.width/2-c.width/2,j=D==="top"?a.top-h-c.height:a.bottom+h):(j=a.top+a.height/2-c.height/2,P=D==="left"?a.left-h-c.width:a.right+h),P=Math.min(Math.max(u,P),m-u-c.width),j=Math.min(Math.max(u,j),y-u-c.height),e.style.transform=`translate(${Math.round(P)}px, ${Math.round(j)}px)`;let Ti={top:"top",bottom:"bottom",left:v?"end":"start",right:v?"start":"end"};this._side=Ti[D]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",s(this,il)),this.addEventListener("pointerleave",s(this,sl)),this.addEventListener("focusin",s(this,rl)),this.addEventListener("focusout",s(this,al)),this.addEventListener("keydown",s(this,Ms)),this.hasUpdated&&s(this,di).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),o(this,Te,jc).call(this),o(this,Te,Pc).call(this),clearTimeout(s(this,Ke))}show(){clearTimeout(s(this,Ke)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",s(this,Ms),!0),addEventListener("scroll",s(this,nt),!0),addEventListener("resize",s(this,nt)),this.updateComplete.then(s(this,nt)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(s(this,Ke)),this.open&&(this.open=!1,o(this,Te,Pc).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(s(this,di).call(this),this.content?this.open&&s(this,nt).call(this):this.hide())}render(){return l`<slot @slotchange=${s(this,di)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1249
+ data-side=${this._side}>${this.content}</div>`}};ie=new WeakMap,$s=new WeakMap,Dt=new WeakMap,Nt=new WeakMap,Ke=new WeakMap,ks=new WeakMap,Es=new WeakMap,Te=new WeakSet,Pc=function(){document.removeEventListener("keydown",s(this,Ms),!0),removeEventListener("scroll",s(this,nt),!0),removeEventListener("resize",s(this,nt))},il=new WeakMap,sl=new WeakMap,rl=new WeakMap,al=new WeakMap,Ms=new WeakMap,Jh=function(e){return e.matches(tl)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(tl)??e},di=new WeakMap,Bc=function(e){f(this,Dt,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=s(this,Dt).map(a=>t.getElementById(a)).filter(a=>!!a);e.ariaDescribedByElements=[...i,s(this,ie)]},jc=function(){let e=s(this,$s);if(!(!e||!s(this,ie))){if(s(this,Nt))s(this,Nt).disconnect(),f(this,Nt,void 0),s(this,Dt).length?e.setAttribute("aria-describedby",s(this,Dt).join(" ")):e.removeAttribute("aria-describedby"),f(this,Dt,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==s(this,ie).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}f(this,$s,void 0)}},nt=new WeakMap,ws.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},ws.styles=[w,b`
1123
1250
  :host { display: inline-block; position: relative; }
1124
1251
  .tip {
1125
1252
  position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
@@ -1133,22 +1260,22 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1133
1260
  :host([open]) .tip { opacity: 1; visibility: visible; }
1134
1261
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
1135
1262
  @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>
1263
+ `];g("cm-tooltip",ws);var Jg=M("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"}),Zg=M("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),Xu=7,Ha=new Set,Ia;function Zh(n,r){r?Ha.add(n):Ha.delete(n),Ha.size&&!Ia&&(Ia=setInterval(()=>Ha.forEach(e=>e.requestUpdate()),6e4)),!Ha.size&&Ia&&(clearInterval(Ia),Ia=void 0)}var Oa,pi,Oe,Fc,nl,Qh,Ts=class extends k{constructor(){super(...arguments);p(this,Oe);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;p(this,Oa,L("cm-tl"));p(this,pi)}connectedCallback(){super.connectedCallback(),Zh(this,!0)}disconnectedCallback(){super.disconnectedCallback(),Zh(this,!1),s(this,pi)?.disconnect(),f(this,pi,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(f(this,pi,new ResizeObserver(()=>o(this,Oe,Fc).call(this))),s(this,pi).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&o(this,Oe,Fc).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,a=Math.floor(Math.abs(t)/6e4);if(a<1)return this.t("justNow");if(a<60)return this.t(i?"inMinutes":"minutesAgo",{count:a});let c=Math.floor(a/60);if(c<24)return this.t(i?"inHours":"hoursAgo",{count:c});let h=Math.floor(c/24);return h<Xu?this.t(i?"inDays":"daysAgo",{count:h}):Z(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?Z(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",a=this.lines>0&&!this.expanded,c=e?t?l`<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>`:l`<time class="when" part="time" datetime=${this.datetime||d}>${e}</time>`:d;return l`<div class="item">
1264
+ <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?l`<cm-icon name=${this.icon} size="16"></cm-icon>`:l`<span class="dot"></span>`}</span>
1138
1265
  <div class="main">
1139
1266
  <div class="head">
1140
1267
  <span class="title" part="title"><slot name="heading">${this.heading}</slot></span>
1141
1268
  <slot name="badge"></slot>
1142
- ${d}
1269
+ ${c}
1143
1270
  </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>
1271
+ <div class="meta" part="meta" ?hidden=${!this.meta&&!this._meta}><slot name="meta" @slotchange=${h=>o(this,Oe,nl).call(this,h,"_meta")}>${this.meta}</slot></div>
1272
+ <div class="body ${a?"clamp":""}" id="${s(this,Oa)}-body" part="body" ?hidden=${!this._body}
1273
+ style="--_lines: ${Math.max(1,this.lines||1)}"><slot @slotchange=${h=>o(this,Oe,nl).call(this,h,"_body")}></slot></div>
1274
+ ${this._body&&this._overflow?l`<button type="button" class="toggle" part="toggle" aria-expanded=${this.expanded?"true":"false"}
1275
+ aria-controls="${s(this,Oa)}-body" @click=${o(this,Oe,Qh)}>${this.expanded?this.t("showLess"):this.t("showAll")}</button>`:d}
1276
+ <div class="actions" part="actions" ?hidden=${!this._actions}><slot name="actions" @slotchange=${h=>o(this,Oe,nl).call(this,h,"_actions")}></slot></div>
1150
1277
  </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`
1278
+ </div>`}};Oa=new WeakMap,pi=new WeakMap,Oe=new WeakSet,Fc=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},nl=function(e,t){let i=e.target.assignedNodes({flatten:!0});this[t]=i.some(a=>a.nodeType===Node.ELEMENT_NODE||(a.textContent??"").trim())},Qh=function(){this.expanded=!this.expanded},Ts.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}},Ts.styles=[w,b`
1152
1279
  :host { display: block; min-width: 0; font-size: 14px; line-height: 20px; }
1153
1280
  .item { display: flex; gap: var(--cm-space-15); align-items: flex-start; }
1154
1281
  .icon {
@@ -1184,16 +1311,16 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1184
1311
  [hidden] { display: none !important; }
1185
1312
  .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
1313
  ::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}
1314
+ `];g("cm-timeline-item",Ts);var qa,_s,ui,Vc,ep,hi=class extends k{constructor(){super(...arguments);p(this,ui);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];p(this,qa,new MutationObserver(()=>o(this,ui,Vc).call(this)));p(this,_s,!1)}connectedCallback(){super.connectedCallback(),o(this,ui,Vc).call(this),s(this,qa).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,qa).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){f(this,_s,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,a)=>{this._items[a]&&i.assign(this._items[a])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),s(this,_s)&&!this.renderRoot.querySelector(".more cm-button")&&(f(this,_s,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?l`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>l`<div class="sk">
1315
+ <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:d;return l`
1316
+ ${e.length?l`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
1317
+ ${e.map(()=>l`<li><slot></slot></li>`)}
1318
+ </ol>`:d}
1192
1319
  ${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}
1320
+ ${!e.length&&!t?l`<slot class="empty"></slot>`:d}
1321
+ ${this.hasMore&&e.length?l`<div class="more"><cm-button part="more" size="medium" ?loading=${t} @click=${o(this,ui,ep)}>${this.moreLabel}</cm-button></div>`:d}
1195
1322
  <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`
1323
+ `}};qa=new WeakMap,_s=new WeakMap,ui=new WeakSet,Vc=function(){this._items=this.items,this._empty=[...this.children].filter(e=>e.getAttribute("slot")==="empty")},ep=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{bubbles:!0,composed:!0}))},hi.shadowRootOptions={..._.shadowRootOptions,slotAssignment:"manual"},hi.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}},hi.styles=[w,b`
1197
1324
  :host { display: block; }
1198
1325
  ol { margin: 0; padding: 0; list-style: none; }
1199
1326
  ol:focus { outline: none; }
@@ -1215,14 +1342,14 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1215
1342
  @media (max-width: 640px) {
1216
1343
  .more { padding-inline-start: 0; }
1217
1344
  }
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}>
1345
+ `];g("cm-timeline",hi);var av=M("smartTip",{newTab:"(opens in a new tab)"}),nv=M("smartTips",{heading:"Smart tips",tourAction:"Start"}),Cs=class extends k{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 l`<a part="tip" href=${this.href||d} target=${this.target||d} rel=${e?"noopener noreferrer":d}>
1219
1346
  <span class="text">
1220
1347
  <span class="title" part="heading">${this.heading}</span>
1221
1348
  <span class="desc" part="description"><slot></slot></span>
1222
- ${e?o`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:c}
1349
+ ${e?l`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:d}
1223
1350
  </span>
1224
1351
  <span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
1225
- </a>`}};es.properties={heading:{},href:{},target:{}},es.styles=[v,u`
1352
+ </a>`}};Cs.properties={heading:{},href:{},target:{}},Cs.styles=[w,b`
1226
1353
  :host { display: block; }
1227
1354
  a {
1228
1355
  display: flex; align-items: flex-start; gap: var(--cm-space-10); padding: var(--cm-space-20) var(--cm-space-10);
@@ -1239,17 +1366,17 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1239
1366
  }
1240
1367
  a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
1241
1368
  a:hover .title { text-decoration: underline; }
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">
1369
+ `];g("cm-smart-tip",Cs);var zs=class extends k{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return l`<div class="card" part="smart-tips">
1370
+ ${this.tourHeading?l`<div class="tour" part="tour">
1244
1371
  <span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="18"></cm-icon></span>
1245
1372
  <span class="tour-text">${this.tourHeading}</span>
1246
1373
  <cm-button size="medium" @click=${()=>this.dispatchEvent(new CustomEvent("cm-tour",{bubbles:!0,composed:!0}))}>${this.tourAction}</cm-button>
1247
- </div>`:c}
1374
+ </div>`:d}
1248
1375
  <section class="panel" part="panel" aria-label=${this.heading}>
1249
1376
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1250
1377
  <div class="list" role="list"><slot></slot></div>
1251
1378
  </section>
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`
1379
+ </div>`}};zs.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},zs.styles=[w,b`
1253
1380
  :host { display: block; }
1254
1381
  .card { display: flex; flex-direction: column; gap: var(--cm-space-10); }
1255
1382
  .tour {
@@ -1267,24 +1394,24 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1267
1394
  letter-spacing: var(--cm-tracking-caps); text-transform: uppercase;
1268
1395
  }
1269
1396
  .list { display: flex; flex-direction: column; gap: var(--cm-space-10); }
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`
1397
+ `];g("cm-smart-tips",zs);var pv=M("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"}),ot,Ss,tp,ip,Ls=class extends k{constructor(){super(...arguments);p(this,Ss);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;p(this,ot,L("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,a=Math.min(this.total,t*this.pageSize),c=this.pageSizes??[];return l`
1271
1398
  <nav part="bar" aria-label=${this.label}>
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>`)}
1399
+ ${c.length?l`<div class="rows" part="rows">
1400
+ <label for="${s(this,ot)}-s">${this.t("rows")}</label>
1401
+ <span class="field"><select id="${s(this,ot)}-s" @change=${o(this,Ss,tp)}>
1402
+ ${(c.includes(this.pageSize)?c:[...c,this.pageSize].sort((h,u)=>h-u)).map(h=>l`<option value=${h} ?selected=${h===this.pageSize}>${h}</option>`)}
1276
1403
  </select><cm-icon name="chevron-down" size="12"></cm-icon></span>
1277
- </div>`:c}
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>
1404
+ </div>`:d}
1405
+ <div class="summary" part="summary" role="status">${this.total?this.t("summary",{from:i,to:a,total:this.total,resource:this.resourceName}).replace(/\s+/g," ").trim():d}</div>
1279
1406
  <div class="pages" part="pages">
1280
1407
  <span class="counter">
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"
1284
- @input=${p=>this._draft=p.target.value}
1285
- @keydown=${n(this,ss,_d)}
1286
- @change=${p=>this.goTo(Number(p.target.value))} />
1287
- <span id="${s(this,We)}-of">${this.t("of",{count:e})}</span>
1408
+ <label for="${s(this,ot)}-p">${this.t("page")}</label>
1409
+ <input id="${s(this,ot)}-p" type="number" inputmode="numeric" min="1" max=${e}
1410
+ .value=${this._draft??String(t)} aria-describedby="${s(this,ot)}-of"
1411
+ @input=${h=>this._draft=h.target.value}
1412
+ @keydown=${o(this,Ss,ip)}
1413
+ @change=${h=>this.goTo(Number(h.target.value))} />
1414
+ <span id="${s(this,ot)}-of">${this.t("of",{count:e})}</span>
1288
1415
  </span>
1289
1416
  <span class="arrows">
1290
1417
  <button class="prev" type="button" part="previous" aria-label=${this.t("previous")} ?disabled=${t<=1}
@@ -1294,7 +1421,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1294
1421
  </span>
1295
1422
  </div>
1296
1423
  </nav>
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`
1424
+ `}};ot=new WeakMap,Ss=new WeakSet,tp=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})))},ip=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))},Ls.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}},Ls.styles=[w,b`
1298
1425
  :host { display: block; }
1299
1426
  nav {
1300
1427
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1328,14 +1455,14 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1328
1455
  .arrows { display: contents; }
1329
1456
  .prev { order: -1; }
1330
1457
  }
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`
1458
+ `];g("cm-pagination",Ls);var xv=M("statusTabs",{label:"Status"}),Pa,Ne,Uc,sp,Kc,rp,As=class extends k{constructor(){super(...arguments);p(this,Ne);this.value="";this.tabs=[];this.controls="";this.size="large";this._slotted=[];p(this,Pa,new MutationObserver(()=>o(this,Ne,Uc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,Ne,Uc).call(this),s(this,Pa).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,Pa).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=o(this,Ne,sp).call(this,e);return l`
1332
1459
  <div class="tabs" part="tabs" role="tablist" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
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>`)}
1460
+ ${e.map((i,a)=>l`<button type="button" role="tab" part="tab" aria-selected=${a===t?"true":"false"}
1461
+ tabindex=${a===t?"0":"-1"} ?disabled=${!!i.disabled}
1462
+ @click=${()=>o(this,Ne,Kc).call(this,a)} @keydown=${c=>o(this,Ne,rp).call(this,c,a)}>${i.label}${i.count!==void 0&&!Number.isNaN(i.count)?l` <span class="count">(</span> ${this.formatNumber(i.count)} <span class="count">)</span>`:d}</button>`)}
1336
1463
  </div>
1337
1464
  <slot></slot>
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`
1465
+ `}};Pa=new WeakMap,Ne=new WeakSet,Uc=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??"")},sp=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},Kc=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}))))},rp=function(e,t){let i=ne(e,this),a=this.items.flatMap((u,m)=>u.disabled?[]:[m]),c=a.indexOf(t),h;if(i==="ArrowRight")h=a[(c+1)%a.length];else if(i==="ArrowLeft")h=a[(c-1+a.length)%a.length];else if(e.key==="Home")h=a[0];else if(e.key==="End")h=a[a.length-1];else return;e.preventDefault(),h!==void 0&&o(this,Ne,Kc).call(this,h)},As.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},_slotted:{state:!0}},As.styles=[w,b`
1339
1466
  :host { display: block; }
1340
1467
  .tabs {
1341
1468
  display: flex; gap: 28px; overflow-x: auto; scrollbar-width: thin; padding: 2px 2px 0;
@@ -1359,20 +1486,20 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1359
1486
  @media (max-width: 640px) {
1360
1487
  .tabs { gap: 18px; font-size: 14px; }
1361
1488
  }
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`
1363
- <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":c}
1489
+ `];g("cm-status-tabs",As);var Tv=M("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),ol,Ba,lt,Gc,ap,np,Ds=class extends k{constructor(){super(...arguments);p(this,lt);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;p(this,ol,L("cm-th"));p(this,Ba,new MutationObserver(()=>o(this,lt,Gc).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),o(this,lt,Gc).call(this),s(this,Ba).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,Ba).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 l`
1490
+ <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":d}
1364
1491
  style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
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>
1369
- </span></span>`:c}
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
1372
- name=${l&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:p}</span>`})}
1492
+ ${this.selectable?l`<span class="cell" role=${e?"columnheader":d}><span class="check">
1493
+ <input id="${s(this,ol)}-all" type="checkbox" aria-label=${this.t("selectAll")} .checked=${this.checked} .indeterminate=${this.indeterminate}
1494
+ @change=${o(this,lt,np)} />
1495
+ <span class="box" aria-hidden="true">${this.indeterminate?l`<span class="dash"></span>`:this.checked?l`<cm-icon name="check" size="14"></cm-icon>`:d}</span>
1496
+ </span></span>`:d}
1497
+ ${t.map(i=>{let a=this.sort===i.key,c=a?this.direction==="descending"?"descending":"ascending":"none",h=i.hidden?l`<span class="sr">${i.label}</span>`:i.label;return l`<span class="cell" part="cell" data-align=${i.align??"start"} role=${e?"columnheader":d}
1498
+ aria-sort=${e&&i.sortable?c:d}>${i.sortable?l`<button type="button" class=${a?"on":""} @click=${()=>o(this,lt,ap).call(this,i)}>${h}${e?d:l`<span class="sr">${a?this.t("sorted",{direction:this.t(c)}):this.t("sortable")}</span>`}<cm-icon
1499
+ name=${a&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:h}</span>`})}
1373
1500
  </div>
1374
1501
  <slot></slot>
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`
1502
+ `}};ol=new WeakMap,Ba=new WeakMap,lt=new WeakSet,Gc=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"}})},ap=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}))},np=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}))},Ds.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}},Ds.styles=[w,b`
1376
1503
  :host { display: block; }
1377
1504
  slot { display: none; } /* <option> children are column data, not content */
1378
1505
  .bar {
@@ -1418,7 +1545,7 @@ var gc=r=>{throw TypeError(r)};var No=(r,a,e)=>a.has(r)||gc("Cannot "+e);var s=(
1418
1545
  :host([resource-rows='selectable']) .bar:not(.sel) { padding-inline-start: calc(var(--cm-space-10) + 18px + var(--cm-space-10)); }
1419
1546
  :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
1547
  }
1421
- `];f("cm-table-header",rs);var zf=k("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),Cd=!1,Qh=`
1548
+ `];g("cm-table-header",Ds);var Dv=M("dataTable",{empty:"No data",sorted:"Sorted by {column}, {direction}"}),op=!1,Ju=`
1422
1549
  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); }
1423
1550
  cm-data-table > table caption { text-align: start; font-weight: 500; font-size: 16px; padding-block-end: var(--cm-space-10); }
1424
1551
  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; }
@@ -1434,22 +1561,22 @@ cm-data-table > table th > button.cm-sort:hover cm-icon, cm-data-table > table t
1434
1561
  cm-data-table > table th > button.cm-sort:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1435
1562
  @media (forced-colors: active) { cm-data-table > table th > button.cm-sort cm-icon { opacity: 1; } }
1436
1563
  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; }
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`
1438
- <div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":c}
1439
- role=${this.stickyHeader||this.stickyFirstColumn?"region":c}
1440
- aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:c}>
1564
+ `;function Zu(){if(op||typeof document>"u")return;op=!0;let n=new CSSStyleSheet;n.replaceSync(Ju),document.adoptedStyleSheets=[...document.adoptedStyleSheets,n]}var Qu=n=>(n.align??(n.type==="numeric"||n.type==="money"?"end":"start"))==="end";function lp(n){if(typeof n=="number")return n;let r=String(n??"").trim(),e=/^\(.*\)$/.test(r)||/^-|^[^\d]*-\s*\d/.test(r),t=r.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var cp=n=>n instanceof Date?n.getTime():typeof n=="number"?n:Date.parse(String(n??"")),dp=new Map;function em(n){let r=dp.get(n??"");if(!r){try{r=new Intl.Collator(n,{numeric:!0,sensitivity:"base"})}catch{r=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}dp.set(n??"",r)}return r}function hp(n,r,e,t){let i=a=>a==null||a==="";return i(n)||i(r)?i(n)===i(r)?0:i(n)?1:-1:e==="numeric"||e==="money"?(lp(n)||0)-(lp(r)||0):e==="date"?(cp(n)||0)-(cp(r)||0):em(t).compare(String(n),String(r))}var Hs,ja,q,Yc,Wc,pp,Xc,up,mp,ll,Ns,Rs=class extends k{constructor(){super(...arguments);p(this,q);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="";p(this,Hs,!1);p(this,ja,new MutationObserver(()=>o(this,q,Yc).call(this)))}connectedCallback(){super.connectedCallback(),o(this,q,Yc).call(this),s(this,ja).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,ja).disconnect()}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(a=>a.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((a,c)=>[a,c]).sort(([a,c],[h,u])=>{let m=a[t.key],y=h[t.key],v=m==null||m==="",E=y==null||y==="";return v||E?v===E?c-u:v?1:-1:i*hp(m,y,t.type,this.locale)||c-u}).map(([a])=>a)}updated(e){if(s(this,Hs)&&(e.has("sort")||e.has("direction"))&&this.sort){f(this,Hs,!1);let t=this.columns.find(i=>i.key===this.sort);t&&o(this,q,Wc).call(this,t.label,this.direction)}}render(){let e=l`<span class="sr" role="status">${this._announce}</span>`;if(this._light)return l`<div class="scroll" part="scroll"><slot></slot></div>${e}`;let t=this.columns??[],i=this.sortedRows,a=Math.max(1,t.length),c=!this.loading&&i.length===0;return l`
1565
+ <div class="scroll" part="scroll" tabindex=${this.stickyHeader||this.stickyFirstColumn?"0":d}
1566
+ role=${this.stickyHeader||this.stickyFirstColumn?"region":d}
1567
+ aria-label=${(this.stickyHeader||this.stickyFirstColumn)&&this.caption?this.caption:d}>
1441
1568
  <table part="table" aria-busy=${this.loading?"true":"false"}>
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>
1569
+ ${this.caption?l`<caption part="caption">${this.caption}</caption>`:d}
1570
+ <thead><tr>${t.map(h=>{let u=this.sort===h.key,m=u?this.direction:"none",y=h.hidden?l`<span class="sr">${h.label}</span>`:h.label;return l`<th scope="col" class=${o(this,q,Ns).call(this,h)} aria-sort=${h.sortable?m:d}>${h.sortable?l`<button type="button" class=${u?"on":""} @click=${()=>o(this,q,mp).call(this,h)}>${y}<cm-icon
1571
+ name=${u&&this.direction==="descending"?"chevron-down":"chevron-up"} size="12"></cm-icon></button>`:y}</th>`})}</tr></thead>
1445
1572
  <tbody>
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}
1573
+ ${this.loading?Array.from({length:Math.max(1,this.loadingRows)},()=>l`<tr>${t.map(h=>l`<td class=${o(this,q,Ns).call(this,h)}><cm-skeleton></cm-skeleton></td>`)}</tr>`):i.map(h=>l`<tr part="row">${t.map((u,m)=>m===0?l`<th scope="row" class=${o(this,q,Ns).call(this,u)} part="cell">${o(this,q,ll).call(this,h[u.key])}</th>`:l`<td class=${o(this,q,Ns).call(this,u)} part="cell">${o(this,q,ll).call(this,h[u.key])}</td>`)}</tr>`)}
1574
+ ${c?l`<tr class="empty"><td colspan=${a}><slot name="empty">${this.t("empty")}</slot></td></tr>`:d}
1448
1575
  </tbody>
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}
1576
+ ${this.totals&&!this.loading&&!c?l`<tfoot><tr part="totals">${t.map(h=>l`<td class=${o(this,q,Ns).call(this,h)}>${o(this,q,ll).call(this,this.totals[h.key])}</td>`)}</tr></tfoot>`:d}
1450
1577
  </table>
1451
1578
  </div>${e}
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`
1579
+ `}};Hs=new WeakMap,ja=new WeakMap,q=new WeakSet,Yc=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(Zu(),o(this,q,pp).call(this))},Wc=function(e,t){this._announce=this.t("sorted",{column:e,direction:this.t(t)})},pp=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;t&&[...t].forEach((i,a)=>{if(!i.dataset.sort||i.querySelector(":scope > button.cm-sort"))return;i.dataset.type=i.dataset.sort;let c=document.createElement("button");c.type="button",c.className="cm-sort",c.append(...i.childNodes);let h=document.createElement("cm-icon");h.setAttribute("size","12"),c.append(h),i.append(c),i.hasAttribute("aria-sort")||i.setAttribute("aria-sort","none"),o(this,q,Xc).call(this,i),c.addEventListener("click",()=>o(this,q,up).call(this,e,i,a))})},Xc=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},up=function(e,t,i){let a=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),c=t.dataset.key||a,h=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",u=new CustomEvent("cm-sort",{detail:{key:c,direction:h},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(u)||this.sortMode==="manual")return;let m=t.dataset.sort,y=h==="descending"?-1:1;for(let v of e.tBodies){let E=T=>{let D=T.cells[i];return D?(D.dataset.value??D.textContent??"").trim():""},$=[...v.rows].map((T,D)=>[T,E(T),D]).sort(([,T,D],[,P,j])=>T===""||P===""?T===P?D-j:T===""?1:-1:y*hp(T,P,m,this.locale)||D-j);v.append(...$.map(([T])=>T))}for(let v of e.tHead.rows[0].cells)v.dataset.sort&&(v.setAttribute("aria-sort",v===t?h:"none"),o(this,q,Xc).call(this,v));o(this,q,Wc).call(this,a,h)},mp=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}),a=this.dispatchEvent(i);f(this,Hs,a),a&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},ll=function(e){return e==null?"":e instanceof Date?Z(e,{},this.locale):String(e)},Ns=function(e){return`${Qu(e)?"end":""} ${e.type==="numeric"||e.type==="money"?"num":""}`},Rs.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}},Rs.styles=[w,b`
1453
1580
  :host { display: block; font-size: 14px; line-height: 1.5; }
1454
1581
  .scroll { overflow: auto; max-block-size: var(--cm-data-table-max-height, none); }
1455
1582
  .scroll:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
@@ -1486,18 +1613,18 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1486
1613
  .empty td { padding: var(--cm-space-20); border-block-end: 0; }
1487
1614
  .light { display: contents; }
1488
1615
  @media (forced-colors: active) { button cm-icon { opacity: 1; } }
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}
1616
+ `];g("cm-data-table",Rs);var Is=class extends _{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}}};Is.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0}},Is.styles=b`:host { display: none; }`;g("cm-menu-item",Is);function Fa(n){let r=[];for(let e of Array.from(n.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=a=>e.getAttribute(a)||void 0;r.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"&&r.push({divider:!0});return r}function cl(n,r){let e=new MutationObserver(r);return e.observe(n,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Vv=M("actionMenu",{label:"Actions"}),Va,Ps,mi,Ua,I,dl,Ka,Jc,hl,pl,ul,Ga,Ya,Os,ml,fp,bp,qs=class extends k{constructor(){super(...arguments);p(this,I);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;p(this,Va);p(this,Ps,L("cm-menu"));p(this,mi,"");p(this,Ua,0);p(this,Ka,e=>{this.open&&!e.composedPath().includes(this)&&o(this,I,pl).call(this,!1)});p(this,Ga,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))});p(this,Ya,()=>{this.open?this.hide():this.show()});p(this,ml,e=>{let t=o(this,I,hl).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),o(this,I,Os).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),o(this,I,Os).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),o(this,I,Os).call(this,t[0]);break;case"End":e.preventDefault(),o(this,I,Os).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 a=Date.now();f(this,mi,(a-s(this,Ua)<600?s(this,mi):"")+e.key.toLowerCase()),f(this,Ua,a);let c=this.menuItems,h=s(this,mi).length>1?i:i+1,m=[...t.slice(Math.max(h,0)),...t.slice(0,Math.max(h,0))].find(y=>(c[y].label??"").toLowerCase().startsWith(s(this,mi)));m!==void 0&&o(this,I,Os).call(this,m)}}})}connectedCallback(){super.connectedCallback(),o(this,I,dl).call(this),f(this,Va,cl(this,()=>o(this,I,dl).call(this))),document.addEventListener("pointerdown",s(this,Ka),!0)}disconnectedCallback(){super.disconnectedCallback(),s(this,Va)?.disconnect(),document.removeEventListener("pointerdown",s(this,Ka),!0)}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=o(this,I,hl).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,o(this,I,pl).call(this,!0),this.updateComplete.then(()=>o(this,I,ul).call(this))}hide(e=!1){o(this,I,pl).call(this,!1),e&&o(this,I,Jc).call(this)?.focus()}updated(e){if(this._custom){let t=o(this,I,Jc).call(this);if(t){let i=(a,c)=>{t.getAttribute(a)!==c&&t.setAttribute(a,c)};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=o(this,I,hl).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>o(this,I,ul).call(this))}}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?l`<slot name="trigger" @click=${s(this,Ya)} @keydown=${s(this,Ga)} @slotchange=${()=>o(this,I,dl).call(this)}></slot>`:l`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
1617
+ aria-expanded=${String(this.open)} aria-controls="${s(this,Ps)}-m" aria-label=${this.iconOnly?t:d}
1618
+ @click=${s(this,Ya)} @keydown=${s(this,Ga)}>${this.iconOnly?l`<cm-icon name=${this.icon} size="18"></cm-icon>`:l`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return l`${i}
1492
1619
  <div class="pop" part="menu" ?hidden=${!this.open}>
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))}
1620
+ ${this.heading?l`<div class="head" part="heading"><strong>${this.heading}</strong>${this.subheading?l`<span>${this.subheading}</span>`:d}</div>`:d}
1621
+ <div role="menu" id="${s(this,Ps)}-m" aria-label=${this.heading||this.label} @keydown=${s(this,ml)}>
1622
+ ${e.map((a,c)=>o(this,I,bp).call(this,a,c))}
1496
1623
  </div>
1497
1624
  </div>
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`
1625
+ <slot hidden></slot>`}};Va=new WeakMap,Ps=new WeakMap,mi=new WeakMap,Ua=new WeakMap,I=new WeakSet,dl=function(){this._slotted=Fa(this),this._custom=!!this.querySelector(':scope > [slot="trigger"]')},Ka=new WeakMap,Jc=function(){return this._custom?this.querySelector(':scope > [slot="trigger"]'):this.renderRoot.querySelector(".trigger")},hl=function(){return this.menuItems.map((e,t)=>!e.divider&&!e.disabled?t:-1).filter(e=>e>=0)},pl=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})))},ul=function(){this.renderRoot.querySelector(`[data-i="${this._active}"]`)?.focus()},Ga=new WeakMap,Ya=new WeakMap,Os=function(e){this._active=e,this.updateComplete.then(()=>o(this,I,ul).call(this))},ml=new WeakMap,fp=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)},bp=function(e,t){if(e.divider)return l`<div role="separator"></div>`;let i=`item${e.critical?" critical":""}${t===this._active?" active":""}`,a=l`${e.icon?l`<cm-icon name=${e.icon} size="16"></cm-icon>`:d}<span>${e.label}</span>`,c={over:()=>{e.disabled||(this._active=t)},click:h=>o(this,I,fp).call(this,h,e)};return e.href&&!e.disabled?l`<a class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t} href=${e.href}
1626
+ @pointerenter=${c.over} @click=${c.click}>${a}</a>`:l`<button type="button" class=${i} part="item" role="menuitem" tabindex="-1" data-i=${t}
1627
+ aria-disabled=${e.disabled?"true":d} @pointerenter=${c.over} @click=${c.click}>${a}</button>`},qs.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}},qs.styles=[w,b`
1501
1628
  :host { display: inline-block; position: relative; vertical-align: middle; }
1502
1629
  .trigger {
1503
1630
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 500;
@@ -1530,7 +1657,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1530
1657
  }
1531
1658
  .item.active:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 1px; }
1532
1659
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-default); }
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`
1660
+ `];g("cm-action-menu",qs);var Jv=M("resourceItem",{select:"Select {name}"}),Zv=M("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}"}),gp=b`
1534
1661
  .check { position: relative; display: inline-flex; flex: none; width: 20px; height: 20px; }
1535
1662
  .check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
1536
1663
  .check input:disabled { cursor: not-allowed; }
@@ -1542,17 +1669,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1542
1669
  .dash { width: 50%; height: 2px; background: currentColor; }
1543
1670
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1544
1671
  .check input:disabled + .box { border-color: var(--cm-border-default); background: var(--cm-bg-input-filled); }
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}
1672
+ `,bl,gl,vp,js=class extends k{constructor(){super();p(this,gl);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;p(this,bl,this.attachInternals());s(this,bl).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 l`
1673
+ ${this.href&&!this.disabled?l`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:d}
1674
+ <div class="row" part="row" @click=${o(this,gl,vp)}>
1675
+ ${this.selectable?l`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
1549
1676
  ?disabled=${this.disabled} @change=${e=>this.toggle(e.target.checked)} />
1550
- <span class="box" aria-hidden="true">${this.selected?o`<cm-icon name="check" size="14"></cm-icon>`:c}</span></span>`:c}
1677
+ <span class="box" aria-hidden="true">${this.selected?l`<cm-icon name="check" size="14"></cm-icon>`:d}</span></span>`:d}
1551
1678
  <span class="media"><slot name="media"></slot></span>
1552
1679
  <div class="content" part="content"><slot></slot></div>
1553
1680
  <div class="actions" part="actions"><slot name="actions"></slot></div>
1554
1681
  </div>
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`
1682
+ `}};bl=new WeakMap,gl=new WeakSet,vp=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()},js.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}},js.styles=[w,gp,b`
1556
1683
  :host { display: block; position: relative; border-bottom: var(--cm-border-1) solid var(--cm-border-default); }
1557
1684
  :host(:last-child) { border-bottom: 0; }
1558
1685
  .row {
@@ -1583,29 +1710,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1583
1710
  ::slotted([slot='media']) { width: 34px; height: 34px; }
1584
1711
  ::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 34px; }
1585
1712
  }
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">
1713
+ `];g("cm-resource-item",js);var Wa,Xa,re,xp,Zc,vl,Bs,fl,xl,Fs=class extends k{constructor(){super();p(this,re);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;p(this,Wa,L("cm-rl"));p(this,Xa,new Set);p(this,vl,e=>{let t=e.target;t.parentElement.classList.toggle("has",t.assignedElements().length>0),o(this,re,Zc).call(this,t)});p(this,xl,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,re,Bs).call(this),o(this,re,fl).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,re,Bs).call(this),o(this,re,fl).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,o(this,re,Bs).call(this),o(this,re,fl).call(this)}clearSelection(){this.selectPage(!1)}updated(e){e.has("selectable")&&(o(this,re,Bs).call(this),o(this,re,Zc).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(y=>!y.disabled).length,a=i>0&&e>=i,c=o(this,re,xp).call(this),h=y=>Kn(y,this.locale)==="one"?this.resourceName:c,u=this.total>t,m=d;return this.allSelected?m=l`${this.t("allSelected",{count:Math.max(this.total,e),resource:c})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(m=l`${this.t("selected",{count:e,resource:h(e)})}${a&&u?l` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:c})}</button>`:d}`),l`
1714
+ ${this.selectable?l`<div class="toolbar" part="toolbar">
1588
1715
  <span class="select" part="select">
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>`}
1716
+ <span class="check"><input id="${s(this,Wa)}-all" type="checkbox" .checked=${a} .indeterminate=${e>0&&!a}
1717
+ ?disabled=${!i} @change=${y=>this.selectPage(y.target.checked)} />
1718
+ <span class="box" aria-hidden="true">${e>0&&!a?l`<span class="dash"></span>`:a?l`<cm-icon name="check" size="12"></cm-icon>`:d}</span></span>
1719
+ <label for="${s(this,Wa)}-all">${this.t("select")}<span class="sr"> ${this.t("selectPageHidden",{count:t,resource:h(t)})}</span></label>
1720
+ ${this.hideSelectMenu?d:l`<cm-action-menu icon-only icon="chevron-down" part="select-menu" label=${this.t("selectionOptions")}
1721
+ .items=${[{label:this.t("selectPage",{count:i}),value:"page",disabled:!i},...u?[{label:this.t("selectAll",{count:this.total,resource:c}),value:"all"}]:[],{label:this.t("selectNone"),value:"none",disabled:!e&&!this.allSelected}]} @cm-select=${s(this,xl)}></cm-action-menu>`}
1595
1722
  </span>
1596
1723
  <span class="bulk" ?hidden=${!e}><slot name="bulk-actions"></slot></span>
1597
- <span class="status" part="status" role="status">${x}</span>
1724
+ <span class="status" part="status" role="status">${m}</span>
1598
1725
  <span class="actions"><slot name="actions"></slot></span>
1599
- </div>`:c}
1600
- <div class="header"><slot name="header" @slotchange=${s(this,bo)}></slot></div>
1726
+ </div>`:d}
1727
+ <div class="header"><slot name="header" @slotchange=${s(this,vl)}></slot></div>
1601
1728
  <div class="body">
1602
- <div class="list" part="list" role="list" aria-label=${this.label||d.replace(/^./,$=>$.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
1603
- <slot @slotchange=${()=>n(this,W,ms).call(this)}></slot>
1729
+ <div class="list" part="list" role="list" aria-label=${this.label||c.replace(/^./,y=>y.toUpperCase())} aria-busy=${this.loading?"true":"false"}>
1730
+ <slot @slotchange=${()=>o(this,re,Bs).call(this)}></slot>
1604
1731
  </div>
1605
- ${this.loading?o`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:d})}></span>`:c}
1732
+ ${this.loading?l`<span class="spinner" part="spinner" role="progressbar" aria-label=${this.t("loading",{resource:c})}></span>`:d}
1606
1733
  </div>
1607
1734
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
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`
1735
+ `}};Wa=new WeakMap,Xa=new WeakMap,re=new WeakSet,xp=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},Zc=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(a=>t.add(a));for(let i of s(this,Xa))t.has(i)||i.removeAttribute("resource-rows");for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain");f(this,Xa,t)},vl=new WeakMap,Bs=function(){let e=this.items;e.forEach(t=>t.selectable=this.selectable),this._rows=e.length,this._count=e.filter(t=>t.selected).length},fl=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},xl=new WeakMap,Fs.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}},Fs.styles=[w,gp,b`
1609
1736
  :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1610
1737
  .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-20); padding: var(--cm-space-20) var(--cm-space-20) 0; }
1611
1738
  .select {
@@ -1643,20 +1770,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1643
1770
  .list { padding: 0 var(--cm-space-10); }
1644
1771
  .spinner { width: 30px; height: 30px; margin: -15px; border-width: 3px; }
1645
1772
  }
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})}
1773
+ `];g("cm-resource-list",Fs);var ax=M("nestedItem",{reorder:"Reorder {label}",hint:"Press up or down arrow to move.",hintGroup:"Press up or down arrow to move. At either end of the list, the arrow moves it into the list before or after.",moved:"{label} moved to position {position} of {total}.",movedTo:"{label} moved to {list}, position {position} of {total}."}),nx=M("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),wl,V,Qc,ed,yp,wp,Rt,$p,kp,Ep,td,Mp,qe=class qe extends k{constructor(){super();p(this,V);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;p(this,wl,this.attachInternals());p(this,Rt,!1);s(this,wl).role="listitem"}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}get list(){let e=this.parentElement;return e?.localName==="cm-nested-list"?e:null}moveToList(e,t){let i=this.list;if(!i||!e)return!1;if(e===i)return t===void 0?!1:this.moveTo(t);if(!i.group||e.group!==i.group)return!1;let a=e.items,c=Math.max(0,Math.min(a.length,t??a.length)),h={item:this,from:i.items.indexOf(this),to:c,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:h,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,a[c]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:c+1,total:a.length+1})),!0):!1}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 a=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(a))return!1;let c=t[e];return c.parentElement.insertBefore(this,e>i?c.nextSibling:c),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return l`
1774
+ <div class="row" part="row" @dragover=${o(this,V,Ep)} @dragleave=${o(this,V,td)} @drop=${o(this,V,Mp)}>
1775
+ ${this.sortable?l`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
1649
1776
  aria-describedby="hint"
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}
1777
+ @keydown=${o(this,V,yp)} @dragstart=${o(this,V,wp)} @pointerdown=${o(this,V,$p)}
1778
+ @dragend=${()=>{this.classList.remove("dragging"),qe.dragged=null,Ja(this,null)}}><cm-icon name="drag" size="18"></cm-icon></button>`:d}
1779
+ ${this.sortable?l`<span class="sr" id="hint">${this.t(this.list?.group?"hintGroup":"hint")}</span>`:d}
1653
1780
  <span class="label" part="label">${this.label}</span>
1654
1781
  <span class="actions" part="actions"><slot name="actions"></slot></span>
1655
1782
  </div>
1656
1783
  <div class="children ${this._hasChildren?"has":""}" role="list" aria-label=${this.label}>
1657
1784
  <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>
1658
1785
  </div>
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`
1786
+ `}updated(e){e.has("sortable")&&[...this.children].forEach(t=>{t.localName==="cm-nested-item"&&(t.sortable=this.sortable)})}};wl=new WeakMap,V=new WeakSet,Qc=function(){let e=this.list;return e?.group?[...e.getRootNode().querySelectorAll("cm-nested-list")].filter(i=>i===e||i.group===e.group&&i.sortable&&(!i.collapsible||i.open)):[]},ed=function(){let e=()=>this.renderRoot.querySelector(".handle")?.focus();e(),requestAnimationFrame(e)},yp=function(e){let t=this.siblings.indexOf(this),i=e.key==="ArrowUp",a=e.key==="ArrowDown";if(i&&t===0||a&&t===this.siblings.length-1){let h=s(this,V,Qc),u=h[h.indexOf(this.list)+(i?-1:1)];if(u){e.preventDefault(),this.moveToList(u,i?u.items.length:0)&&o(this,V,ed).call(this);return}}let c;if(e.key==="ArrowUp")c=t-1;else if(e.key==="ArrowDown")c=t+1;else if(e.key==="Home")c=0;else if(e.key==="End")c=this.siblings.length-1;else return;e.preventDefault(),this.moveTo(c)&&o(this,V,ed).call(this)},wp=function(e){if(e.stopPropagation(),s(this,Rt)){e.preventDefault();return}qe.dragged=this,this.classList.add("dragging"),e.dataTransfer?.setData("text/plain",this.label),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")},Rt=new WeakMap,$p=function(e){if(e.pointerType==="mouse"||!e.isPrimary)return;let t=e.clientY,i=null,a=h=>{if(h.pointerId===e.pointerId){if(!s(this,Rt)){if(Math.abs(h.clientY-t)<6)return;f(this,Rt,!0),qe.dragged=this,this.classList.add("dragging")}h.preventDefault(),i=o(this,V,kp).call(this,h.clientX,h.clientY),Ja(this,i)}},c=h=>{if(h.pointerId!==e.pointerId)return;document.removeEventListener("pointermove",a,!0),document.removeEventListener("pointerup",c,!0),document.removeEventListener("pointercancel",c,!0);let u=s(this,Rt);f(this,Rt,!1),qe.dragged=null,this.classList.remove("dragging"),Ja(this,null),!(!u||h.type==="pointercancel"||!i)&&(i.list?this.moveToList(i.list,i.index):this.moveTo(i.index))};document.addEventListener("pointermove",a,!0),document.addEventListener("pointerup",c,!0),document.addEventListener("pointercancel",c,!0)},kp=function(e,t){for(let i of s(this,V,Qc)){if(i===this.list)continue;let a=i.getBoundingClientRect();if(e>=a.left&&e<=a.right&&t>=a.top&&t<=a.bottom)return{list:i,index:yl(i.items,this,t)}}return{index:yl(this.siblings,this,t)}},Ep=function(e){let t=qe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.renderRoot.querySelector(".row").getBoundingClientRect(),a=e.clientY>i.top+i.height/2;this.classList.toggle("drop-after",a),this.classList.toggle("drop-before",!a)},td=function(){this.classList.remove("drop-before","drop-after")},Mp=function(e){let t=qe.dragged;if(!t||t===this||t.parentElement!==this.parentElement)return;e.preventDefault(),e.stopPropagation();let i=this.classList.contains("drop-after");o(this,V,td).call(this);let a=this.siblings,c=a.indexOf(t),h=a.indexOf(this)+(i?1:0);h>c&&(h-=1),t.moveTo(h)},qe.properties={label:{},value:{reflect:!0},sortable:{type:Boolean,reflect:!0},_hasChildren:{state:!0}},qe.styles=[w,b`
1660
1787
  :host { display: block; }
1661
1788
  .row {
1662
1789
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 60px; padding: 0 var(--cm-space-20);
@@ -1673,6 +1800,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1673
1800
  color: var(--cm-icon-selected); background: none; border: 0; border-radius: var(--cm-radius-xs); cursor: grab;
1674
1801
  }
1675
1802
  .handle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1803
+ /* Touch: a drag that starts on the handle moves the row instead of scrolling the page. */
1804
+ .handle { touch-action: none; }
1676
1805
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1677
1806
  .children { margin-block: var(--cm-space-10) 0; margin-inline: 50px 0; display: flex; flex-direction: column; gap: var(--cm-space-10); }
1678
1807
  .children:not(.has) { display: none; }
@@ -1681,19 +1810,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1681
1810
  .actions { gap: var(--cm-space-10); }
1682
1811
  .children { margin-inline-start: var(--cm-space-20); }
1683
1812
  }
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`
1813
+ `],qe.dragged=null;var Us=qe;g("cm-nested-item",Us);function yl(n,r,e){return n.filter(t=>{if(t===r)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function Ja(n,r){if((n.list??n).getRootNode().querySelectorAll("cm-nested-item.drop-before, cm-nested-item.drop-after, cm-nested-list.drop-target").forEach(i=>i.classList.remove("drop-before","drop-after","drop-target")),!r)return;let t=(r.list?r.list.items:n.siblings).filter(i=>i!==n);t.length?r.index<t.length?t[r.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):r.list?.classList.add("drop-target")}var fi,ye,Tp,id,sd,_p,Cp,Vs=class extends k{constructor(){super(...arguments);p(this,ye);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;p(this,fi,L("cm-nl"))}get items(){return[...this.children].filter(e=>e.localName==="cm-nested-item")}announce(e){this._msg="",requestAnimationFrame(()=>this._msg=e)}willUpdate(){this.hasUpdated||(this._empty=!this.items.length)}updated(e){(e.has("sortable")||e.has("group"))&&o(this,ye,id).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return l`
1685
1814
  <div class="bar" part="bar">
1686
- <div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,Yt)}-h">${this.heading}</div>
1815
+ <div class="title" part="heading" role="heading" aria-level=${e} id="${s(this,fi)}-h">${this.heading}</div>
1687
1816
  <span class="actions"><slot name="actions"></slot></span>
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)}>
1690
- <cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:c}
1817
+ ${this.collapsible?l`<button class="toggle" type="button" part="toggle" aria-expanded=${t?"true":"false"} aria-controls="${s(this,fi)}-rows"
1818
+ aria-label=${this.t(t?"hide":"show",{heading:this.heading})} @click=${o(this,ye,Tp)}>
1819
+ <cm-icon name=${t?"chevron-up":"chevron-down"} size="14"></cm-icon></button>`:d}
1691
1820
  </div>
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>
1821
+ <div class="rows ${this.group&&this._empty?"empty":""}" id="${s(this,fi)}-rows" role="list" aria-labelledby="${s(this,fi)}-h" ?hidden=${!t}
1822
+ @dragover=${o(this,ye,_p)} @drop=${o(this,ye,Cp)}>
1823
+ <slot @slotchange=${()=>{o(this,ye,id).call(this),this._empty=!this.items.length}}></slot>
1694
1824
  </div>
1695
1825
  <span class="sr" role="status">${this._msg}</span>
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`
1826
+ `}};fi=new WeakMap,ye=new WeakSet,Tp=function(){this.open=!this.open,this.dispatchEvent(new CustomEvent("cm-toggle",{detail:{open:this.open},bubbles:!0,composed:!0}))},id=function(){this.items.forEach(t=>{t.sortable=this.sortable,t.requestUpdate()})},sd=function(e){let t=e?.list;return!!e&&!!t&&t!==this&&!!this.group&&t.group===this.group&&this.sortable&&(!this.collapsible||this.open)},_p=function(e){let t=Us.dragged;o(this,ye,sd).call(this,t)&&(e.preventDefault(),Ja(t,{list:this,index:yl(this.items,t,e.clientY)}))},Cp=function(e){let t=Us.dragged;if(!o(this,ye,sd).call(this,t))return;e.preventDefault();let i=yl(this.items,t,e.clientY);Ja(t,null),t.moveToList(this,i)},Vs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"},sortable:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},group:{reflect:!0},_msg:{state:!0},_empty:{state:!0}},Vs.styles=[w,b`
1697
1827
  :host { display: block; }
1698
1828
  .bar {
1699
1829
  display: flex; align-items: center; gap: var(--cm-space-15); min-height: 90px; padding: 0 var(--cm-space-20);
@@ -1709,6 +1839,8 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1709
1839
  .toggle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1710
1840
  .rows { display: flex; flex-direction: column; gap: var(--cm-space-10); margin-block: var(--cm-space-15) 0; margin-inline: 50px 0; }
1711
1841
  .rows[hidden] { display: none; }
1842
+ .rows.empty { min-height: 60px; border: var(--cm-border-1) dashed var(--cm-border-default); border-radius: var(--cm-radius-md); }
1843
+ :host(.drop-target) .rows.empty { border: 2px solid var(--cm-border-strong); }
1712
1844
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1713
1845
  @media (max-width: 640px) {
1714
1846
  .bar { min-height: 60px; padding: 0 var(--cm-space-10); gap: var(--cm-space-10); }
@@ -1716,11 +1848,118 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1716
1848
  .rows { margin-inline-start: var(--cm-space-10); }
1717
1849
  .toggle { width: 30px; height: 30px; }
1718
1850
  }
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`
1851
+ `];g("cm-nested-list",Vs);var zp=(n,r,e)=>{let t=new Map;for(let i=r;i<=e;i++)t.set(n[i],i);return t},Lp=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,r,e){let t;e===void 0?e=r:r!==void 0&&(t=r);let i=[],a=[],c=0;for(let h of n)i[c]=t?t(h,c):c,a[c]=e(h,c),c++;return{values:a,keys:i}}render(n,r,e){return this.dt(n,r,e).values}update(n,[r,e,t]){let i=hh(n),{values:a,keys:c}=this.dt(r,e,t);if(!Array.isArray(i))return this.ut=c,a;let h=this.ut??=[],u=[],m,y,v=0,E=i.length-1,$=0,T=a.length-1;for(;v<=E&&$<=T;)if(i[v]===null)v++;else if(i[E]===null)E--;else if(h[v]===c[$])u[$]=mt(i[v],a[$]),v++,$++;else if(h[E]===c[T])u[T]=mt(i[E],a[T]),E--,T--;else if(h[v]===c[T])u[T]=mt(i[v],a[T]),Si(n,u[T+1],i[v]),v++,T--;else if(h[E]===c[$])u[$]=mt(i[E],a[$]),Si(n,i[v],i[E]),E--,$++;else if(m===void 0&&(m=zp(c,$,T),y=zp(h,v,E)),m.has(h[v]))if(m.has(h[E])){let D=y.get(c[$]),P=D!==void 0?i[D]:null;if(P===null){let j=Si(n,i[v]);mt(j,a[$]),u[$]=j}else u[$]=mt(P,a[$]),Si(n,i[v],P),i[D]=null;$++}else Zn(i[E]),E--;else Zn(i[v]),v++;for(;$<=T;){let D=Si(n,u[T+1]);mt(D,a[$]),u[$++]=D}for(;v<=E;){let D=i[v++];D!==null&&Zn(D)}return this.ut=c,Jn(n,u),ae}});function Sp(n,r,e){let t=c=>e.slotCount(c),i=c=>Math.max(0,t(c)-1),a=c=>{for(let h=r.group+c;h>=0&&h<e.groupCount();h+=c)if(t(h)>0)return{group:h,index:Math.min(r.index,i(h))};return{...r}};switch(n){case"ArrowRight":return a(1);case"ArrowLeft":return a(-1);case"ArrowDown":return{group:r.group,index:Math.min(r.index+1,i(r.group))};case"ArrowUp":return{group:r.group,index:Math.max(r.index-1,0)};case"Home":return{group:r.group,index:0};case"End":return{group:r.group,index:i(r.group)};default:return null}}var G,_e,Ce,Za=class{constructor(r){p(this,G);p(this,_e,null);p(this,Ce,null);f(this,G,r)}get active(){return s(this,_e)!==null}get from(){return s(this,_e)&&{...s(this,_e)}}get target(){return s(this,Ce)&&{...s(this,Ce)}}groupCount(){return s(this,G).groupCount()}slotCount(r){return r>=0&&r<s(this,G).groupCount()?s(this,G).slotCount(r):0}pickUp(r){this.active&&this.cancel(),f(this,_e,{...r}),f(this,Ce,{...r}),s(this,G).onTarget?.(this.target),s(this,G).announce(s(this,G).messages.pickedUp(this.target))}moveTo(r){if(!s(this,Ce))return;let e=Math.max(0,Math.min(r.group,s(this,G).groupCount()-1)),t=this.slotCount(e);t<=0||(f(this,Ce,{group:e,index:Math.max(0,Math.min(r.index,t-1))}),s(this,G).onTarget?.(this.target),s(this,G).announce(s(this,G).messages.over(this.target)))}drop(){if(!s(this,_e)||!s(this,Ce))return;let r=s(this,_e),e=s(this,Ce);f(this,_e,f(this,Ce,null)),s(this,G).onTarget?.(null),s(this,G).onDrop(r,e)}cancel(r=!1){if(!s(this,_e))return;let e=s(this,_e),t=r?"":s(this,G).messages.cancelled(e);f(this,_e,f(this,Ce,null)),s(this,G).onTarget?.(null),s(this,G).onCancel?.(e),t&&s(this,G).announce(t)}handleKey(r,e=r.key){if(!this.active||r.altKey||r.ctrlKey||r.metaKey)return!1;if(e===" "||e==="Enter")return this.drop(),!0;if(e==="Escape")return this.cancel(),!0;if(e==="Tab")return this.cancel(),!1;let t=(s(this,G).navigate??Sp)(e,s(this,Ce),this);return t?(this.moveTo(t),!0):!1}};G=new WeakMap,_e=new WeakMap,Ce=new WeakMap;var en,bi,Qa=class{constructor(r=document,e="assertive"){p(this,en);p(this,bi);let t=r.createElement("div");t.setAttribute("aria-live",e),t.setAttribute("aria-atomic","true"),t.className="cm-announcer",Object.assign(t.style,{position:"absolute",width:"1px",height:"1px",margin:"-1px",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",border:"0"}),this.element=t}get text(){return s(this,bi)??this.element.textContent??""}announce(r){clearTimeout(s(this,en)),this.element.textContent===r?(this.element.textContent="",f(this,bi,r),f(this,en,setTimeout(()=>{this.element.textContent=r,f(this,bi,void 0)},50))):(f(this,bi,void 0),this.element.textContent=r)}};en=new WeakMap,bi=new WeakMap;var kx=M("boardCard",{roleDescription:"movable card",instructions:"Press Space to pick up. Then use the arrow keys to choose a column and a position, Space or Enter to drop, and Escape to cancel.",openHint:"Press Enter to open.",saving:"Saving"}),Ex=M("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),Mx=M("board",{label:"Board",pickedUp:"Picked up {card}. Column {column}, position {position} of {count}.",over:"Column {column}, position {position} of {count}.",moved:"Moved {card} to {column}, position {position} of {count}.",sameSpot:"{card} dropped where it started.",cancelled:"Move cancelled. {card} is back in {column}.",refused:"{card} can't be moved to {column}.",reverted:"Couldn't move {card}. It is back in {column}."});var tm="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",tn,Ml,Ap,gi=class extends k{constructor(){super(...arguments);p(this,Ml);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";p(this,tn,L("cm-bc"))}get name(){let e=i=>(i??"").replace(/\s+/g," ").trim();if(this.label)return this.label;if(this.heading)return this.heading;let t=this.querySelector(':scope > [slot="heading"]');return t?e(t.textContent):e(this.textContent).slice(0,80)}get key(){return this.value||this.name}get opener(){if(this.href)return this.renderRoot?.querySelector(".title a")??null;let e=this.querySelector(':scope > [slot="heading"]');return e?e.matches("a[href], button, cm-button")?e:e.querySelector("a[href], button, cm-button"):null}focusHandle(e){let t=this.renderRoot?.querySelector(".handle");t?t.focus(e):this.focus(e)}open(){let e=this.opener;return e?(e.click(),!0):!1}render(){let e=!!(this.href||this.querySelector(':scope > [slot="heading"] a[href], :scope > [slot="heading"] button, :scope > a[slot="heading"][href], :scope > button[slot="heading"]')),t=this.pending;return l`<div class="card" part="card">
1852
+ ${this.locked?d:l`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
1853
+ aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${s(this,tn)}-help"></div>`}
1854
+ <div class="content">
1855
+ <div class="head">
1856
+ <div class="title" part="title"><slot name="heading" @slotchange=${()=>this.requestUpdate()}>${this.href?l`<a href=${this.href} tabindex="-1">${this.heading}</a>`:this.heading}</slot></div>
1857
+ <slot name="avatar"></slot>
1858
+ <slot name="actions"></slot>
1859
+ </div>
1860
+ <div class="lines"><slot></slot></div>
1861
+ <div class="badges" ?hidden=${!this._badges}><slot name="badges" @slotchange=${i=>o(this,Ml,Ap).call(this,i,"_badges")}></slot></div>
1862
+ </div>
1863
+ ${t?l`<cm-spinner class="spin" size="small" accessible-label=${this.t("saving")} aria-hidden="true"></cm-spinner>`:d}
1864
+ <span id="${s(this,tn)}-help" hidden>${e?`${this.t("openHint")} `:""}${this.t("instructions")}</span>
1865
+ </div>`}};tn=new WeakMap,Ml=new WeakSet,Ap=function(e,t){this[t]=e.target.assignedElements({flatten:!0}).length>0},gi.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},gi.properties={value:{reflect:!0},label:{},heading:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0},_badges:{state:!0},_slottedTitle:{state:!0}},gi.styles=[w,b`
1866
+ :host { display: block; position: relative; -webkit-touch-callout: none; font-size: 14px; line-height: 20px; }
1867
+ .card {
1868
+ position: relative; display: block; padding: var(--cm-space-12) var(--cm-space-15); background: var(--cm-bg-surface);
1869
+ border: var(--cm-border-1) solid var(--cm-border-card); border-radius: var(--cm-radius-md); cursor: grab;
1870
+ }
1871
+ :host([locked]) .card { cursor: default; }
1872
+ .handle { position: absolute; inset: 0; z-index: 0; border-radius: inherit; outline: none; }
1873
+ .handle:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
1874
+ .content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
1875
+ .head { display: flex; align-items: flex-start; gap: var(--cm-space-10); }
1876
+ .title { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
1877
+ .title a { color: inherit; text-decoration: none; }
1878
+ .title a:hover { text-decoration: underline; }
1879
+ .lines { display: flex; flex-direction: column; font-size: 12px; line-height: 16px; color: var(--cm-text-tertiary); overflow-wrap: anywhere; }
1880
+ .badges { display: flex; flex-wrap: wrap; gap: 4px; margin-block-start: 6px; }
1881
+ .badges[hidden] { display: none; }
1882
+ ::slotted([slot='avatar']), ::slotted([slot='actions']) { flex: none; }
1883
+ .spin { position: absolute; z-index: 2; inset-block-start: var(--cm-space-10); inset-inline-end: var(--cm-space-10); }
1884
+ :host([pending]) .card { background: var(--cm-bg-page); cursor: progress; }
1885
+ :host([pending]) .content { padding-inline-end: 24px; }
1886
+ :host([moving]) .card { border-style: dashed; border-color: var(--cm-border-strong); background: var(--cm-bg-page); }
1887
+ :host([moving]) .content { opacity: 0.5; }
1888
+ :host([ghost]) .card { cursor: grabbing; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); border-color: var(--cm-border-default); }
1889
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1890
+ `];g("cm-board-card",gi);var Ys,sn,Ws,Xs,It,$l,Dp,vi=class extends k{constructor(){super(...arguments);p(this,It);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;p(this,Ys,!1);this._cards=[];this._drop=null;p(this,sn,new MutationObserver(()=>o(this,It,$l).call(this)));p(this,Ws,L("cm-col"));p(this,Xs,!1)}get collapsed(){return s(this,Ys)}connectedCallback(){super.connectedCallback(),o(this,It,$l).call(this),s(this,sn).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),s(this,sn).disconnect()}get cards(){return[...this.children].filter(e=>e.localName==="cm-board-card"&&!e.hasAttribute("slot"))}get key(){return this.value||this.heading}get count(){return typeof this.total=="number"&&!Number.isNaN(this.total)?this.total:this._cards.length}get scrollElement(){return this.renderRoot?.querySelector(".scroll")??null}_sync(){return o(this,It,$l).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");f(this,Ys,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",s(this,Ys)),f(this,Xs,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let a=this._cards[Number(i.dataset.i)];a?i.assign(a):i.assign()});let t=i=>[...this.children].filter(a=>a.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),s(this,Xs)&&!this.renderRoot.querySelector(".more cm-button")&&(f(this,Xs,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,a=t?e.filter($=>$!==t.card):e,c=t?e.indexOf(t.card):-1,h=!!t&&!this.collapsed&&!(c>=0&&t.index===c),u=[];e.forEach(($,T)=>{h&&$!==t.card&&a.indexOf($)===t.index&&u.push({key:"drop"}),u.push({key:$,card:$,i:T})}),h&&t.index>=a.length&&u.push({key:"drop"});let m=this.hasMore||i>e.length,y=this.loading,v=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),E=this.t("count",{count:i});return l`<section aria-labelledby="${s(this,Ws)}-h" class=${t&&this.collapsed?"over":""}>
1891
+ <header part="header">
1892
+ <div class="title" id="${s(this,Ws)}-h" role="heading" aria-level=${v}>${this.heading}<span class="sr">, ${E}</span></div>
1893
+ <span class="count" part="count" aria-hidden="true">${this.formatNumber(i)}</span>
1894
+ <span class="actions"><slot class="actions"></slot></span>
1895
+ </header>
1896
+ <div class="scroll">
1897
+ <ul part="list" role="list" aria-labelledby="${s(this,Ws)}-h" aria-busy=${y?"true":"false"} tabindex="-1" ?hidden=${this.collapsed}>
1898
+ ${Lp(u,$=>$.key,$=>$.card?l`<li><slot data-i=${$.i}></slot></li>`:l`<li class="drop" aria-hidden="true"><div style="min-height:${Math.max(40,t.height)}px">${t.card.name}</div></li>`)}
1899
+ </ul>
1900
+ ${y&&!e.length&&!this.collapsed?l`<div class="loading" aria-hidden="true"><cm-skeleton variant="block"></cm-skeleton><cm-skeleton variant="block"></cm-skeleton></div>`:d}
1901
+ <div class="empty" ?hidden=${e.length>0||y||m||this.collapsed||h}><slot class="empty">${this.t("empty")}</slot></div>
1902
+ ${m&&!this.collapsed?l`<div class="more"><cm-button part="more" size="medium" ?loading=${y} @click=${o(this,It,Dp)}>${this.t("loadMore")}</cm-button></div>`:d}
1903
+ </div>
1904
+ <span class="sr" role="status">${y?this.t("loading",{column:this.heading}):""}</span>
1905
+ </section>`}};Ys=new WeakMap,sn=new WeakMap,Ws=new WeakMap,Xs=new WeakMap,It=new WeakSet,$l=function(){this._cards=this.cards},Dp=function(){this.loading||this.dispatchEvent(new CustomEvent("cm-load-more",{detail:{column:this,value:this.key},bubbles:!0,composed:!0}))},vi.shadowRootOptions={..._.shadowRootOptions,slotAssignment:"manual"},vi.properties={value:{reflect:!0},heading:{},total:{type:Number},hasMore:{type:Boolean,attribute:"has-more",reflect:!0},loading:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"},_cards:{state:!0},_drop:{state:!0}},vi.styles=[w,b`
1906
+ :host {
1907
+ display: flex; flex-direction: column; flex: none; min-height: 0; max-height: 100%;
1908
+ inline-size: var(--cm-board-column-width, 272px);
1909
+ }
1910
+ :host([collapsed]) { inline-size: 48px; }
1911
+ section {
1912
+ position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--cm-bg-page);
1913
+ border: var(--cm-border-1) solid var(--cm-border-card); border-radius: var(--cm-radius-md);
1914
+ }
1915
+ header { display: flex; align-items: center; gap: var(--cm-space-10); min-height: 48px; padding: var(--cm-space-10) var(--cm-space-15); }
1916
+ .title { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; overflow-wrap: anywhere; }
1917
+ .count {
1918
+ flex: none; min-width: 24px; padding: 0 8px; font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums;
1919
+ background: var(--cm-bg-surface); color: var(--cm-text-default); border-radius: var(--cm-radius-full);
1920
+ }
1921
+ .scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--cm-space-10) var(--cm-space-10); }
1922
+ ul { display: flex; flex-direction: column; gap: var(--cm-space-10); margin: 0; padding: 0; list-style: none; }
1923
+ ul:focus { outline: none; }
1924
+ li { display: block; min-width: 0; }
1925
+ .drop > div {
1926
+ display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 var(--cm-space-15);
1927
+ border: 2px dashed var(--cm-border-strong); border-radius: var(--cm-radius-md); background: var(--cm-bg-surface);
1928
+ color: var(--cm-text-tertiary); font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
1929
+ }
1930
+ .empty { padding: var(--cm-space-15) var(--cm-space-10); font-size: 12px; color: var(--cm-text-tertiary); text-align: center; }
1931
+ .loading { display: grid; gap: var(--cm-space-10); }
1932
+ .loading cm-skeleton { --cm-skeleton-height: 72px; }
1933
+ .more { display: flex; justify-content: center; padding-block-start: var(--cm-space-10); }
1934
+ .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
1935
+ [hidden] { display: none !important; }
1936
+ /* Rail: the heading turned on its side, the count on top. Still a drop target. */
1937
+ :host([collapsed]) header { flex-direction: column; justify-content: flex-start; padding: var(--cm-space-10) 0; gap: var(--cm-space-10); }
1938
+ :host([collapsed]) .title { flex: none; writing-mode: vertical-rl; white-space: nowrap; overflow-wrap: normal; }
1939
+ :host([collapsed]) .scroll { padding: 0; overflow: hidden; }
1940
+ :host([collapsed]) .actions { display: none; }
1941
+ :host([collapsed]) section.over { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; }
1942
+ `];g("cm-board-column",vi);var ue,le,W,xi,F,z,rd,Ks,Np,ad,Rp,Hp,Ip,Op,rn,qp,an,nd,od,ld,kl,Pp,nn,on,ln,cn,dn,hn,pn,cd,dd,El,Bp,Ht,Gs=class extends k{constructor(){super();p(this,z);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;p(this,ue,new Qa);p(this,le);p(this,W,null);p(this,xi,new WeakMap);p(this,F,null);p(this,rn,e=>{if(s(this,F)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=ne(e,this);if(s(this,le).active){s(this,le).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=o(this,z,Op).call(this,e.composedPath());if(!(!i||e.altKey||e.ctrlKey||e.metaKey)){if(e.key===" ")e.preventDefault(),this.pickUp(i);else if(e.key==="Enter")i.open()&&e.preventDefault();else if(t.startsWith("Arrow")){let a=o(this,z,qp).call(this,i,t);a&&(e.preventDefault(),a.focusHandle())}}});p(this,an,e=>{if(!s(this,le).active||!s(this,W))return;let t=e.relatedTarget;t&&(t===s(this,W).card||s(this,W).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{s(this,le).active&&s(this,W)&&!s(this,W).card.matches(":focus-within")&&s(this,le).cancel()})});p(this,nn,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});p(this,on,e=>{if(s(this,F)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(h=>h.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(h=>h instanceof Element&&h!==i&&h.matches?.(tm)))return;let a=o(this,z,Ks).call(this,i);if(!a)return;s(this,le).active&&s(this,le).cancel();let c=i.getBoundingClientRect();f(this,F,{card:i,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,dx:e.clientX-c.left,dy:e.clientY-c.top,width:c.width,height:c.height,from:a.column,fromIndex:a.index}),e.pointerType!=="mouse"&&(s(this,F).timer=setTimeout(()=>{s(this,F)&&!s(this,F).started&&o(this,z,cd).call(this)},300)),window.addEventListener("pointermove",s(this,dn),!0),window.addEventListener("pointerup",s(this,hn),!0),window.addEventListener("pointercancel",s(this,pn),!0),window.addEventListener("touchmove",s(this,ln),{capture:!0,passive:!1}),window.addEventListener("contextmenu",s(this,cn),!0)});p(this,ln,e=>{s(this,F)?.started&&e.cancelable&&e.preventDefault()});p(this,cn,e=>{s(this,F)&&e.preventDefault()});p(this,dn,e=>{let t=s(this,F);if(!(!t||e.pointerId!==t.pointerId)){if(t.x=e.clientX,t.y=e.clientY,!t.started){let i=Math.hypot(t.x-t.x0,t.y-t.y0);(t.type==="mouse"?i>4:i>8)&&(t.type==="mouse"?o(this,z,cd).call(this):o(this,z,Ht).call(this,!1));return}e.preventDefault(),o(this,z,dd).call(this),o(this,z,El).call(this)}});p(this,hn,e=>{let t=s(this,F);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){o(this,z,Ht).call(this,!1);return}let i=a=>{a.stopPropagation(),a.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),o(this,z,Ht).call(this,!0)});p(this,pn,e=>{s(this,F)&&e.pointerId===s(this,F).pointerId&&o(this,z,Ht).call(this,!1)});f(this,le,new Za({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!s(this,W)?0:t.cards.filter(i=>i!==s(this,W).card).length+1},onTarget:e=>o(this,z,Rp).call(this,e),onDrop:(e,t)=>o(this,z,Ip).call(this,e,t),onCancel:()=>o(this,z,ad).call(this),messages:{pickedUp:e=>o(this,z,rd).call(this,"pickedUp",e),over:e=>o(this,z,rd).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:s(this,W)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>s(this,ue).announce(e)}))}get columns(){return[...this.children].filter(e=>e.localName==="cm-board-column")}column(e){return this.columns.find(t=>t.key===e)}card(e){for(let t of this.columns){let i=t.cards.find(a=>a.key===e);if(i)return i}}get heldCard(){return s(this,W)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",s(this,rn)),this.addEventListener("focusout",s(this,an)),this.addEventListener("pointerdown",s(this,on)),this.addEventListener("dragstart",s(this,nn))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",s(this,rn)),this.removeEventListener("focusout",s(this,an)),this.removeEventListener("pointerdown",s(this,on)),this.removeEventListener("dragstart",s(this,nn)),s(this,le).cancel(!0),o(this,z,Ht).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(s(this,ue).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return s(this,ue).text}announce(e){s(this,ue).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=o(this,z,Ks).call(this,t);return i?(o(this,z,Ht).call(this,!1),s(this,le).cancel(!0),f(this,W,{card:t,column:i.column,index:i.index}),t.moving=!0,o(this,z,Np).call(this,t),s(this,le).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=s(this,F);e?.started&&(o(this,z,Ht).call(this,!1),s(this,ue).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),s(this,le).cancel()}moveCard(e,t,i){let a=typeof e=="string"?this.card(e):e,c=typeof t=="string"?this.column(t):t;if(!a||!c)return!1;let h=o(this,z,Ks).call(this,a);if(!h)return!1;let u=c.cards.filter(y=>y!==a).length,m=Math.max(0,Math.min(i??u,u));return o(this,z,kl).call(this,a,h.column,h.index,c,m,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=s(this,xi).get(t);if(this.controlled||!i||(s(this,xi).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let a=t.matches(":focus-within");return o(this,z,od).call(this,t,i.from,i.fromIndex),i.totals&&o(this,z,ld).call(this,i.to,i.from),o(this,z,nd).call(this,i.to,i.from,a?t:null),s(this,ue).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return l`<div class="board" role="group" aria-label=${this.label}>
1943
+ <div class="columns" part="columns"><slot @slotchange=${()=>this.requestUpdate()}></slot></div>
1944
+ </div>`}};ue=new WeakMap,le=new WeakMap,W=new WeakMap,xi=new WeakMap,F=new WeakMap,z=new WeakSet,rd=function(e,t){let i=this.columns[t.group];return this.t(e,{card:s(this,W)?.card.name??"",column:i?.heading??"",position:t.index+1,count:s(this,le).slotCount(t.group)})},Ks=function(e){let t=this.columns,i=t.findIndex(a=>a.contains(e)&&e.parentElement===a);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},Np=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{s(this,W)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},ad=function(){s(this,W)&&(s(this,W).card.moving=!1),f(this,W,null)},Rp=function(e){let t=s(this,W);if(this.columns.forEach((i,a)=>{i._drop=t&&e&&a===e.group?{card:t.card,index:e.index,height:t.card.getBoundingClientRect().height}:null}),e){let i=this.columns[e.group];i?.updateComplete.then(()=>{let a=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);o(this,z,Hp).call(this,i,a)})}},Hp=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let c=i.getBoundingClientRect(),h=e.getBoundingClientRect();h.left<c.left?i.scrollLeft-=c.left-h.left+8:h.right>c.right&&(i.scrollLeft+=h.right-c.right+8)}let a=e.scrollElement;if(a){let c=a.getBoundingClientRect(),h=t.getBoundingClientRect();h.top<c.top?a.scrollTop-=c.top-h.top+8:h.bottom>c.bottom&&(a.scrollTop+=h.bottom-c.bottom+8)}},Ip=function(e,t){let i=s(this,W);if(o(this,z,ad).call(this),!i)return;let a=this.columns[t.group];o(this,z,kl).call(this,i.card,i.column,e.index,a,t.index,"keyboard")},Op=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(a=>a.localName==="cm-board-card");return i&&o(this,z,Ks).call(this,i)?i:null},rn=new WeakMap,qp=function(e,t){let i=o(this,z,Ks).call(this,e);if(!i)return null;let a=i.column.cards;if(t==="ArrowDown")return a[i.index+1]??null;if(t==="ArrowUp")return a[i.index-1]??null;let c=t==="ArrowRight"?1:-1,h=this.columns;for(let u=i.group+c;u>=0&&u<h.length;u+=c){let m=h[u].cards;if(m.length)return m[Math.min(i.index,m.length-1)]}return null},an=new WeakMap,nd=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},od=function(e,t,i){let a=t.cards.filter(h=>h!==e),c=a[i];c?c.before(e):a.length?a[a.length-1].after(e):t.append(e)},ld=function(e,t){e!==t&&(typeof e.total=="number"&&(e.total=Math.max(0,e.total-1)),typeof t.total=="number"&&(t.total=t.total+1))},kl=function(e,t,i,a,c,h){let u=e.name;if(t===a&&i===c)return h!=="api"&&s(this,ue).announce(this.t("sameSpot",{card:u})),h==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let m=[],y={value:e.key,card:e,from:t.key,to:a.key,fromColumn:t,toColumn:a,fromIndex:i,toIndex:c,source:h,waitUntil:$=>{m.push(Promise.resolve($))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:y,bubbles:!0,composed:!0,cancelable:!0})))return s(this,ue).announce(this.t("refused",{card:u,column:a.heading})),h==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let E=a.cards.filter($=>$!==e).length+1;if(this.controlled)h==="keyboard"&&o(this,z,Pp).call(this,e.key,a);else{let $=h==="keyboard"||e.matches(":focus-within");o(this,z,od).call(this,e,a,c);let T=t!==a;T&&o(this,z,ld).call(this,t,a),s(this,xi).set(e,{card:e,from:t,fromIndex:i,to:a,toIndex:c,totals:T}),o(this,z,nd).call(this,t,a,$?e:null)}return s(this,ue).announce(this.t("moved",{card:u,column:a.heading,position:c+1,count:E})),m.length&&(e.pending=!0,Promise.all(m).then(()=>{e.pending=!1,this.controlled||s(this,xi).delete(e)},()=>{e.pending=!1,this.controlled?s(this,ue).announce(this.t("reverted",{card:u,column:t.heading})):this.revert(e)})),!0},Pp=function(e,t){let i=()=>t.isConnected?t.cards.find(h=>h.key===e):void 0,a=()=>{let h=i(),u=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!h||!(u||this.contains(document.activeElement))?!1:(t._sync().then(()=>h.updateComplete).then(()=>{h.isConnected&&h.focusHandle({preventScroll:!0})}),!0)},c=new MutationObserver(()=>{a()&&c.disconnect()});c.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>c.disconnect(),1e3)},nn=new WeakMap,on=new WeakMap,ln=new WeakMap,cn=new WeakMap,dn=new WeakMap,hn=new WeakMap,pn=new WeakMap,cd=function(){let e=s(this,F);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges();let t=e.card.cloneNode(!0);t.removeAttribute("id"),t.removeAttribute("moving"),t.setAttribute("ghost",""),t.setAttribute("aria-hidden","true"),t.setAttribute("inert",""),Object.assign(t.style,{position:"fixed",zIndex:"2147483000",left:"0",top:"0",width:`${e.width}px`,margin:"0",pointerEvents:"none",willChange:"transform"}),(this.ownerDocument.body??this.ownerDocument.documentElement).appendChild(t),e.ghost=t,e.card.moving=!0,this.dragging=!0,e.to=e.from,e.toIndex=e.fromIndex,s(this,ue).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),o(this,z,dd).call(this),o(this,z,El).call(this);let i=()=>{s(this,F)?.started&&(o(this,z,Bp).call(this),s(this,F).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},dd=function(){let e=s(this,F);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},El=function(){let e=s(this,F);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],a=1/0;for(let m of t){let y=m.getBoundingClientRect(),v=e.x<y.left?y.left-e.x:e.x>y.right?e.x-y.right:0;v<a&&(i=m,a=v)}let c=i.cards.filter(m=>m!==e.card),h=c.length;if(i.collapsed)h=0;else for(let m=0;m<c.length;m++){let y=c[m].getBoundingClientRect();if(e.y<y.top+y.height/2){h=m;break}}if(i===e.to&&h===e.toIndex)return;let u=i!==e.to;e.to=i,e.toIndex=h,t.forEach(m=>{m._drop=m===i?{card:e.card,index:h,height:e.height}:null}),u&&s(this,ue).announce(this.t("over",{column:i.heading,position:h+1,count:c.length+1}))},Bp=function(){let e=s(this,F);if(!e)return;let t=48,i=16,a=E=>E<t?Math.ceil((t-Math.max(E,0))/t*i):0,c=!1,h=this.renderRoot.querySelector(".columns");if(h){let E=h.getBoundingClientRect(),$=a(e.x-E.left),T=a(E.right-e.x),D=h.scrollLeft;$?h.scrollLeft-=$:T&&(h.scrollLeft+=T),c||=h.scrollLeft!==D}let u=e.to?.scrollElement;if(u&&u.scrollHeight>u.clientHeight){let E=u.getBoundingClientRect();if(e.x>=E.left&&e.x<=E.right){let $=a(e.y-E.top),T=a(E.bottom-e.y),D=u.scrollTop;$?u.scrollTop-=$:T&&(u.scrollTop+=T),c||=u.scrollTop!==D}}let m=window.innerHeight,y=a(e.y),v=a(m-e.y);if(y||v){let E=window.scrollY;window.scrollBy(0,y?-y:v),c||=window.scrollY!==E}c&&o(this,z,El).call(this)},Ht=function(e){let t=s(this,F);t&&(f(this,F,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",s(this,dn),!0),window.removeEventListener("pointerup",s(this,hn),!0),window.removeEventListener("pointercancel",s(this,pn),!0),window.removeEventListener("touchmove",s(this,ln),!0),window.removeEventListener("contextmenu",s(this,cn),!0),t.ghost?.remove(),t.started&&(t.card.moving=!1,this.dragging=!1,this.columns.forEach(i=>{i._drop=null}),e&&t.to&&t.toIndex!==void 0&&o(this,z,kl).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},Gs.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},Gs.styles=[w,b`
1945
+ :host { position: relative; display: block; container-type: inline-size; container-name: cm-board; min-width: 0; }
1946
+ .board { height: 100%; }
1947
+ .columns {
1948
+ position: relative; display: flex; align-items: stretch; gap: var(--cm-space-15); height: 100%; overflow-x: auto; overflow-y: hidden;
1949
+ padding-block-end: var(--cm-space-10); overscroll-behavior-x: contain;
1950
+ }
1951
+ :host([dragging]) .columns { scroll-snap-type: none !important; }
1952
+ :host([dragging]) { cursor: grabbing; user-select: none; -webkit-user-select: none; }
1953
+ @container cm-board (max-width: 480px) {
1954
+ .columns { scroll-snap-type: x mandatory; scroll-padding-inline: 0; gap: var(--cm-space-10); }
1955
+ ::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
1956
+ ::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
1957
+ }
1958
+ `];g("cm-board",Gs);var Sx=M("reportTile",{pinned:", pinned"}),yi=class extends k{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=l`
1720
1959
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="58"></cm-icon></slot></span>
1721
1960
  <span class="label">${this.label}</span>
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`
1961
+ ${this.pinned?l`<span class="pin" part="pin"><cm-icon name="pin" size="18"></cm-icon><span class="sr">${this.t("pinned")}</span></span>`:d}
1962
+ `;return this.href?l`<a class="tile" part="tile" href=${this.href}>${e}</a>`:l`<button class="tile" part="tile" type="button">${e}</button>`}};yi.properties={label:{},icon:{},href:{},pinned:{type:Boolean,reflect:!0}},yi.shadowRootOptions={..._.shadowRootOptions,delegatesFocus:!0},yi.styles=[w,b`
1724
1963
  :host { display: block; }
1725
1964
  .tile {
1726
1965
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--cm-space-20);
@@ -1740,10 +1979,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1740
1979
  ::slotted([slot='icon']) { width: 38px; height: 38px; }
1741
1980
  .pin { top: 8px; inset-inline-end: 8px; }
1742
1981
  }
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}
1745
- <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":c}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
1746
- `}};gs.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},gs.styles=[v,u`
1982
+ `];g("cm-report-tile",yi);var Js=class extends _{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 l`
1983
+ ${this.heading?l`<div class="title" part="heading" role="heading" aria-level=${e} id="h">${this.heading}</div>`:d}
1984
+ <div class="grid" part="grid" role="list" aria-labelledby=${this.heading?"h":d}><slot @slotchange=${()=>this.firstUpdated()}></slot></div>
1985
+ `}};Js.properties={heading:{},headingLevel:{type:Number,attribute:"heading-level"}},Js.styles=[w,b`
1747
1986
  :host { display: block; padding: var(--cm-space-20); background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); }
1748
1987
  .title { margin: 0 0 var(--cm-space-20); font-size: 16px; font-weight: 500; }
1749
1988
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: var(--cm-space-15); }
@@ -1753,16 +1992,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1753
1992
  .title { margin-bottom: var(--cm-space-10); font-size: 14px; }
1754
1993
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-10); }
1755
1994
  }
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`
1995
+ `];g("cm-report-tiles",Js);var Hx=M("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),jp=/^\s*-?\d+(\.\d+)?\s*$/,Zs=class extends k{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:jp.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 d;if(!e)return l`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),a=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return l`<span class="change ${e} ${t}" part="change">
1996
+ <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${a}</span>
1997
+ </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?l`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),a=i!==d||e,c=l`
1759
1998
  <span class="label" id="label" part="label">${this.label}</span>
1760
1999
  <span class="value" id="value" part="value">${t}</span>
1761
- <span class="foot ${l?"on":""}" id="foot" part="footer">
2000
+ <span class="foot ${a?"on":""}" id="foot" part="footer">
1762
2001
  ${i}
1763
2002
  <span class="hint ${e?"on":""}" part="hint"><slot name="hint" @slotchange=${this.onHintSlot}>${this.hint}</slot></span>
1764
2003
  </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`
2004
+ `,h=l`<span class="sr" role="status">${this.loading?this.t("loadingValue",{label:this.label}):""}</span>`,u=this.loading?"true":d;return this.href?l`<a class="tile" part="tile" href=${this.href} aria-labelledby="label value" aria-describedby=${a?"foot":d} aria-busy=${u}>${c}</a>${h}`:l`<div class="tile" part="tile" aria-busy=${u}>${c}</div>${h}`}};Zs.properties={label:{},value:{converter:{fromAttribute:e=>e!==null&&jp.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}},Zs.styles=[w,b`
1766
2005
  :host { display: block; align-self: stretch; min-inline-size: 0; }
1767
2006
  .tile {
1768
2007
  display: flex; flex-direction: column; gap: 4px; block-size: 100%; min-inline-size: 0;
@@ -1798,29 +2037,29 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1798
2037
  .value { font-size: var(--cm-type-heading-lg-resp-size); }
1799
2038
  }
1800
2039
  @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)}>
2040
+ `];g("cm-metric",Zs);var Qs=class extends _{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 Fp(this)}};Qs.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}},Qs.styles=b`:host { display: none !important; }`;g("cm-nav-item",Qs);function Fp(n){let r=i=>n.getAttribute(i),e={label:r("label")||""};r("icon")&&(e.icon=r("icon")),r("href")&&(e.href=r("href")),r("value")&&(e.value=r("value")),n.hasAttribute("current")&&(e.current=!0),r("badge")&&(e.badge=r("badge")),n.hasAttribute("expanded")&&(e.expanded=!0),n.hasAttribute("primary")&&(e.primary=!0);let t=ct(n);return t.length&&(e.items=t),e}var ct=n=>[...n.children].filter(r=>r.localName==="cm-nav-item").map(Fp),hd=n=>n.value||n.href||n.label,Tl=n=>!!n.current||!!n.items?.some(Tl),Ot=(n,r)=>{let e=new MutationObserver(r);return e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},qt=(n,r)=>n.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:r,value:hd(r),href:r.href??""}}));var Kx=M("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),un,mn,zl,N,pd,_l,ud,Vp,Up,md,fd,Kp,bd,gd,Cl,vd,Gp,er=class extends k{constructor(){super(...arguments);p(this,N);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;p(this,un,new Set);p(this,mn);p(this,zl,L("cm-sidenav"))}connectedCallback(){super.connectedCallback(),o(this,N,pd).call(this),f(this,mn,Ot(this,()=>o(this,N,pd).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,mn)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=o(this,N,_l).call(this,e,t);s(this,un).has(i)||!e.items?.length||(s(this,un).add(i),(e.expanded||Tl(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let a=o(this,N,_l).call(this,i,e),c=t??!this._open.has(a);if(c===this._open.has(a))return;let h=new Set(this._open);c?h.add(a):h.delete(a),this._open=h,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:c}}))}render(){let e=this.collapsed;return l`
2041
+ <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${o(this,N,Up)}>
1803
2042
  <slot name="header"></slot>
1804
2043
  <ul part="list">
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>`}
2044
+ ${this.navItems.map((t,i)=>{if(!t.items?.length)return l`<li>${o(this,N,vd).call(this,t,"",{index:i})}</li>`;let a=!e&&this._open.has(o(this,N,_l).call(this,t,i)),c=`${s(this,zl)}-${i}`;return l`<li>
2045
+ ${o(this,N,Cl).call(this,t,l`<button type="button" class="item parent ${Tl(t)?"has-current":""}" part="item" data-index=${i}
2046
+ aria-expanded=${a?"true":"false"} aria-controls=${c} @click=${()=>e?o(this,N,Kp).call(this,i):this.toggle(i)}>
2047
+ ${o(this,N,bd).call(this,t)}${o(this,N,gd).call(this,t)}
2048
+ ${e?d:l`<cm-icon class="chev" name="chevron-down" size="18"></cm-icon>`}
1810
2049
  </button>`)}
1811
- <ul class="sub" id=${d} ?hidden=${!l} aria-label=${t.label}>
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>`)}
2050
+ <ul class="sub" id=${c} ?hidden=${!a} aria-label=${t.label}>
2051
+ ${o(this,N,md).call(this,t.items).map(([h,u])=>l`<li>${o(this,N,vd).call(this,{...h,icon:void 0},u?"deep":"",{parent:i})}</li>`)}
1813
2052
  </ul>
1814
2053
  </li>`})}
1815
2054
  </ul>
1816
- ${n(this,C,eh).call(this)}
2055
+ ${o(this,N,Gp).call(this)}
1817
2056
  <slot name="footer"></slot>
1818
2057
  <slot hidden></slot>
1819
2058
  </nav>
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`
2059
+ `}};un=new WeakMap,mn=new WeakMap,zl=new WeakMap,N=new WeakSet,pd=function(){this._slotted=ct(this)},_l=function(e,t){return`${t}:${hd(e)}`},ud=function(e,t){qt(this,t)||e.preventDefault()},Vp=function(){return[...this.renderRoot.querySelectorAll(".item")].filter(e=>!e.closest("[hidden]"))},Up=function(e){let t=e.composedPath()[0]?.closest?.(".item");if(!t)return;let i=o(this,N,Vp).call(this),a=i.indexOf(t),c=Number(t.dataset.index),h=ne(e,this),u;if(e.key==="ArrowDown")u=i[(a+1)%i.length];else if(e.key==="ArrowUp")u=i[(a-1+i.length)%i.length];else if(e.key==="Home")u=i[0];else if(e.key==="End")u=i[i.length-1];else{if(this.collapsed&&(h==="ArrowRight"||h==="ArrowLeft"))return;if(h==="ArrowRight"&&t.classList.contains("parent")){this.toggle(c,!0),e.preventDefault();return}else if(h==="ArrowLeft"){if(t.classList.contains("parent")?this.toggle(c,!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()},md=function(e,t=0){return e.flatMap(i=>[[i,t],...o(this,N,md).call(this,i.items??[],t+1)])},fd=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},Kp=function(e){let t=this.navItems[e];o(this,N,fd).call(this,!1)&&(this.toggle(e,!0),this.updateComplete.then(()=>this.renderRoot.querySelector(`.parent[data-index="${e}"]`)?.focus()))},bd=function(e){return e.icon?l`<cm-icon name=${e.icon} size="20"></cm-icon>`:this.collapsed?l`<span class="initial" aria-hidden="true">${[...e.label.trim()][0]??""}</span>`:d},gd=function(e){if(!this.collapsed)return l`<span class="label">${e.label}</span>${e.badge?l`<span class="badge">${e.badge}</span>`:d}`;let t=e.badge&&/^\d{1,2}\+?$/.test(e.badge.trim());return l`<span class="sr">${e.label}${e.badge?` (${e.badge})`:""}</span>${e.badge?l`<span class="dot ${t?"count":""}" aria-hidden="true">${t?e.badge:d}</span>`:d}`},Cl=function(e,t){return this.collapsed?l`<cm-tooltip content=${e.label} placement="end" visual-only>${t}</cm-tooltip>`:t},vd=function(e,t,i={}){let a=l`${o(this,N,bd).call(this,e)}${o(this,N,gd).call(this,e)}`;return o(this,N,Cl).call(this,e,e.href?l`<a class="item ${t}" part="item" href=${e.href} aria-current=${e.current?"page":d}
2060
+ data-index=${i.index??d} data-parent=${i.parent??d} @click=${c=>o(this,N,ud).call(this,c,e)}>${a}</a>`:l`<button type="button" class="item ${t}" part="item" aria-current=${e.current?"page":d}
2061
+ data-index=${i.index??d} data-parent=${i.parent??d} @click=${c=>o(this,N,ud).call(this,c,e)}>${a}</button>`)},Gp=function(){if(!this.collapsible)return d;let e=this.t(this.collapsed?"expand":"collapse"),t=l`<cm-icon name=${this.collapsed?"chevron-right":"chevron-left"} size="20"></cm-icon>${this.collapsed?l`<span class="sr">${e}</span>`:l`<span class="label">${e}</span>`}`;return l`<div class="toggle-row">${o(this,N,Cl).call(this,{label:e},l`<button type="button" class="item toggle" part="collapse-button"
2062
+ @click=${()=>o(this,N,fd).call(this,!this.collapsed)}>${t}</button>`)}</div>`},er.properties={items:{type:Array},label:{string:"label"},collapsed:{type:Boolean,reflect:!0},collapsible:{type:Boolean,reflect:!0},_slotted:{state:!0},_open:{state:!0}},er.styles=[w,b`
1824
2063
  :host { display: block; width: var(--cm-side-navigation-width, 250px); }
1825
2064
  nav {
1826
2065
  background: var(--cm-bg-dashboard); color: var(--cm-text-on-dark-secondary); border-radius: 16px;
@@ -1860,15 +2099,15 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1860
2099
  background: var(--cm-nav-badge); box-shadow: 0 0 0 2px var(--cm-bg-dashboard);
1861
2100
  }
1862
2101
  .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); }
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">
2102
+ `];g("cm-side-navigation",er);var xd=0,Yp="";function wd(){xd++===0&&(Yp=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function fn(){xd>0&&--xd===0&&(document.documentElement.style.overflow=Yp)}function $d(){let n=document.activeElement;for(;n?.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;return n}var tr,dt,ir,bn,yd,Ll,Sl,Al,Dl,Nl,X=class extends k{constructor(){super(...arguments);p(this,bn);this.open=!1;this.label="";this.uid=L("cm-ovl");p(this,tr,null);p(this,dt,!1);p(this,ir,!1);p(this,Ll,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});p(this,Sl,e=>{e.preventDefault(),this.requestClose("escape")});p(this,Al,()=>{this.open&&!this.dialog?.open&&(this.open=!1,o(this,bn,yd).call(this))});p(this,Dl,e=>{f(this,ir,e.target===e.currentTarget)});p(this,Nl,e=>{if(e.target===e.currentTarget&&s(this,ir)){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,ir,!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,tr,$d()),!this.isConnected)return;t.showModal(),s(this,dt)||(wd(),f(this,dt,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),o(this,bn,yd).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),s(this,dt)&&(fn(),f(this,dt,!1))}renderHeader(e=d){return l`<header class="head" part="header">
1864
2103
  <h2 id="${this.uid}-h">${this.heading}</h2>${e}
1865
2104
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
1866
2105
  <cm-icon name="close" size="18"></cm-icon></button>
1867
- </header>`}renderDialog(e,t=""){return o`<dialog part="dialog" class=${t}
1868
- aria-labelledby=${this.heading?`${this.uid}-h`:c}
1869
- aria-label=${!this.heading&&this.label?this.label:c}
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`
2106
+ </header>`}renderDialog(e,t=""){return l`<dialog part="dialog" class=${t}
2107
+ aria-labelledby=${this.heading?`${this.uid}-h`:d}
2108
+ aria-label=${!this.heading&&this.label?this.label:d}
2109
+ @keydown=${s(this,Ll)} @cancel=${s(this,Sl)} @close=${s(this,Al)}
2110
+ @pointerdown=${s(this,Dl)} @click=${s(this,Nl)}>${e}</dialog>`}};tr=new WeakMap,dt=new WeakMap,ir=new WeakMap,bn=new WeakSet,yd=function(){s(this,dt)&&(fn(),f(this,dt,!1));let e=s(this,tr);f(this,tr,null),e?.isConnected&&e.focus(),this.dispatchEvent(new CustomEvent("cm-closed",{bubbles:!0,composed:!0}))},Ll=new WeakMap,Sl=new WeakMap,Al=new WeakMap,Dl=new WeakMap,Nl=new WeakMap,X.properties={open:{type:Boolean,reflect:!0},heading:{string:"heading"},label:{},closeLabel:{attribute:"close-label",string:"close"}},X.overlayStyles=[w,b`
1872
2111
  :host { display: contents; }
1873
2112
  dialog {
1874
2113
  padding: 0; border: 0; margin: 0; max-width: none; max-height: none; background: transparent; color: inherit;
@@ -1899,7 +2138,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1899
2138
  dialog[open] .panel { animation: cm-ovl-in 160ms ease-out; }
1900
2139
  }
1901
2140
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
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`
2141
+ `];function Wp(n){let r=n.trim().split(/[\s._@-]+/).filter(Boolean);if(!r.length)return"";let e=[...r[0]][0]??"",t=r.length>1&&!/[.@]/.test(n)?[...r[r.length-1]][0]??"":"";return(e+t).toLocaleUpperCase()}var sr=class extends _{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=Wp(this.name),t=this.decorative||!this.name?d:this.name,i=this.decorative||!this.name?"true":d,a,c="avatar";return this.src&&!this._failed?a=l`<img src=${this.src} alt="" @error=${()=>{this._failed=!0}}>`:e?a=l`<span aria-hidden="true">${e}</span>`:(c+=" icon",a=l`<cm-icon name=${this.shape==="square"?"store":"user"} size="18"></cm-icon>`),l`<span class=${c} part="avatar" role=${t===d?d:"img"} aria-label=${t} aria-hidden=${i}>${a}</span>`}};sr.properties={name:{},src:{},size:{reflect:!0},shape:{reflect:!0},decorative:{type:Boolean,reflect:!0},_failed:{state:!0}},sr.styles=[w,b`
1903
2142
  :host { --_size: var(--cm-avatar-size, 36px); display: inline-flex; vertical-align: middle; flex: none; }
1904
2143
  :host([size='small']) { --_size: var(--cm-avatar-size, 24px); }
1905
2144
  :host([size='large']) { --_size: var(--cm-avatar-size, 48px); }
@@ -1912,34 +2151,34 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
1912
2151
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
1913
2152
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
1914
2153
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
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`
1916
- <header part="bar" role="banner" aria-label=${this.label||c}>
2154
+ `];g("cm-avatar",sr);var oy=M("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),nr,ht,or,ce,gn,kd,rr,ar=class extends k{constructor(){super();p(this,ce);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;p(this,nr);p(this,ht,!1);p(this,or,null);this.addEventListener("cm-select",e=>{let t=o(this,ce,gn).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){o(this,ce,gn).call(this)?.focus();return}this._searchOpen||(f(this,or,$d()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),f(this,nr,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),s(this,nr).observe(this)}disconnectedCallback(){super.disconnectedCallback(),s(this,nr)?.disconnect(),s(this,ht)&&(fn(),f(this,ht,!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,ht)||(wd(),f(this,ht,!0)),o(this,ce,gn).call(this)?.focus(),o(this,ce,rr).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),s(this,ht)&&(fn(),f(this,ht,!1));let i=s(this,or)??this.renderRoot.querySelector(".search-btn");f(this,or,null),i?.isConnected&&i.focus(),o(this,ce,rr).call(this,"cm-search-toggle",{open:!1})}}render(){return l`
2155
+ <header part="bar" role="banner" aria-label=${this.label||d}>
1917
2156
  <div class="logo"><slot name="logo"></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>`}
2157
+ ${this.store?l`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
2158
+ @click=${()=>o(this,ce,rr).call(this,"cm-store-switch")}><span>${this.store}</span><cm-icon name="chevron-down" size="20"></cm-icon></button>`:d}
2159
+ ${this._narrow?d:l`<div class="search${this._hasSearch?" has":""}" part="search"><slot name="search" @slotchange=${o(this,ce,kd)}></slot></div>`}
1921
2160
  <span class="grow"></span>
1922
2161
  <div class="end">
1923
- ${this._narrow&&this._hasSearch?o`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
1924
- aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:c}
2162
+ ${this._narrow&&this._hasSearch?l`<button type="button" class="search-btn" part="search-button" aria-label=${this.searchLabel}
2163
+ aria-haspopup="dialog" aria-expanded=${this._searchOpen?"true":"false"} @click=${()=>this.openSearch()}><cm-icon name="search" size="20"></cm-icon></button>`:d}
1925
2164
  <div class="actions"><slot name="actions"></slot></div>
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>
1930
- <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:c}
2165
+ ${this.balance?l`<button type="button" class="pill" part="balance" aria-label=${this.t("balance",{balance:this.balance})}
2166
+ @click=${()=>o(this,ce,rr).call(this,"cm-wallet")}>${this.balance}</button>`:d}
2167
+ ${this.userName?l`<button type="button" class="user" part="user" aria-haspopup="true" aria-label=${this.t("account",{name:this.userName})}
2168
+ @click=${()=>o(this,ce,rr).call(this,"cm-account")}><span class="name">${this.userName}</span>
2169
+ <cm-avatar class="avatar" name=${this.userName} src=${this.avatarSrc} decorative></cm-avatar></button>`:d}
1931
2170
  <slot name="end"></slot>
1932
2171
  </div>
1933
2172
  </header>
1934
- ${this._narrow?o`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
2173
+ ${this._narrow?l`<dialog class="layer" part="search-layer" aria-label=${this.searchLabel}
1935
2174
  @keydown=${e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),this.closeSearch())}}
1936
2175
  @cancel=${e=>{e.preventDefault(),this.closeSearch()}} @close=${()=>this.closeSearch()}>
1937
2176
  <div class="layer-bar">
1938
- <div class="layer-search"><slot name="search" @slotchange=${n(this,Z,sc)}></slot></div>
2177
+ <div class="layer-search"><slot name="search" @slotchange=${o(this,ce,kd)}></slot></div>
1939
2178
  <button type="button" class="layer-close" aria-label=${this.t("close")} @click=${()=>this.closeSearch()}><cm-icon name="close" size="20"></cm-icon></button>
1940
2179
  </div>
1941
- </dialog>`:c}
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`
2180
+ </dialog>`:d}
2181
+ `}};nr=new WeakMap,ht=new WeakMap,or=new WeakMap,ce=new WeakSet,gn=function(){return this.querySelector(':scope > [slot="search"]')},kd=function(){this._hasSearch=!!o(this,ce,gn).call(this)},rr=function(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))},ar.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}},ar.styles=[w,b`
1943
2182
  :host { display: block; background: var(--cm-bg-surface); container-type: inline-size; }
1944
2183
  header {
1945
2184
  display: flex; align-items: center; gap: var(--cm-space-20); min-height: 70px; padding-block: 10px; padding-inline: 27px var(--cm-space-20);
@@ -2009,10 +2248,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2009
2248
  /* The controls on the right keep their 44px touch areas, so they need no gap between them; the logo gives way first. */
2010
2249
  .end { gap: 0; }
2011
2250
  }
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>
2251
+ `];g("cm-header-bar",ar);var fy=M("bottomNavigation",{label:"Main"}),vn,wi,Ed,Xp,lr=class extends k{constructor(){super(...arguments);p(this,wi);this.items=[];this.fixed=!1;this._slotted=[];p(this,vn)}connectedCallback(){super.connectedCallback(),o(this,wi,Ed).call(this),f(this,vn,Ot(this,()=>o(this,wi,Ed).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,vn)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2252
+ <ul>${this.navItems.slice(0,5).map(e=>l`<li>${o(this,wi,Xp).call(this,e)}</li>`)}</ul>
2014
2253
  <slot hidden></slot>
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`
2254
+ </nav>`}};vn=new WeakMap,wi=new WeakSet,Ed=function(){this._slotted=ct(this)},Xp=function(e){let t=`item ${e.primary?"primary":""}`,i=l`<span class="icon">${e.icon?l`<cm-icon name=${e.icon} size=${e.primary?16:24}></cm-icon>`:d}</span><span class="label">${e.label}</span>`,a=c=>{qt(this,e)||c.preventDefault()};return e.href?l`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":d} @click=${a}>${i}</a>`:l`<button type="button" class=${t} part="item" aria-current=${e.current?"page":d} @click=${a}>${i}</button>`},lr.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},lr.styles=[w,b`
2016
2255
  :host { display: block; }
2017
2256
  :host([fixed]) { position: fixed; inset-inline: 0; bottom: 0; z-index: 20; }
2018
2257
  nav {
@@ -2032,31 +2271,31 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2032
2271
  .icon { display: grid; place-items: center; width: 26px; height: 26px; }
2033
2272
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
2034
2273
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
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"
2274
+ `];g("cm-bottom-navigation",lr);var ky=M("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),xn,$i,me,Md,Jp,Td,_d,Zp,cr=class extends k{constructor(){super(...arguments);p(this,me);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;p(this,xn);p(this,$i,L("cm-mmenu"))}connectedCallback(){super.connectedCallback(),o(this,me,Md).call(this),f(this,xn,Ot(this,()=>o(this,me,Md).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,xn)?.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?l`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${s(this,$i)}-sub"
2036
2275
  @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
2037
2276
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="18"></cm-icon>${t.label}</button>
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>
2277
+ <ul class="card" aria-label=${t.label}>${t.items.map(i=>l`<li>${o(this,me,_d).call(this,i,0,0,!0)}</li>`)}</ul>
2039
2278
  <slot hidden></slot>
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>
2279
+ </nav>`:l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2280
+ ${o(this,me,Zp).call(this)}
2281
+ ${e.map((i,a)=>{let c=`${s(this,$i)}-s${a}`;return l`<section aria-labelledby=${i.label?c:d}>
2282
+ ${i.label?l`<h2 class="heading" id=${c}>${i.label}</h2>`:d}
2283
+ <ul class="card">${(i.items??[]).map((h,u)=>l`<li>${o(this,me,_d).call(this,h,a,u)}</li>`)}</ul>
2045
2284
  </section>`})}
2046
2285
  <slot hidden></slot>
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>
2286
+ </nav>`}};xn=new WeakMap,$i=new WeakMap,me=new WeakSet,Md=function(){this._slotted=ct(this)},Jp=function(e,t){this._page=[e,t],this.updateComplete.then(()=>this.renderRoot.querySelector(".back")?.focus())},Td=function(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))},_d=function(e,t,i,a=!1){let c=y=>{qt(this,e)||y.preventDefault()};if(e.primary&&!a)return l`<button type="button" class="row action" part="row" @click=${c}>${e.label}</button>`;let h=e.icon&&!a?l`<cm-icon class="icon" name=${e.icon} size="24"></cm-icon>`:d,u=e.badge?l`<span class="badge">${e.badge}</span>`:d;if(e.items?.length&&!a)return l`<button type="button" class="row" part="row" data-row="${t}-${i}"
2287
+ @click=${()=>o(this,me,Jp).call(this,t,i)}>${h}<span class="label">${e.label}</span>${u}<cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button>`;let m=l`${h}<span class="label">${e.label}</span>${u}${e.href&&!a?l`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:d}`;return e.href?l`<a class="row" part="row" href=${e.href} aria-current=${e.current?"page":d} @click=${c}>${m}</a>`:l`<button type="button" class="row" part="row" aria-current=${e.current?"page":d} @click=${c}>${m}</button>`},Zp=function(){if(!this.store&&!this.userName)return d;let e=this.userName.trim().charAt(0).toUpperCase();return l`<section aria-labelledby="${s(this,$i)}-profile">
2288
+ <h2 class="heading" id="${s(this,$i)}-profile">${this.t("profile")}</h2>
2050
2289
  <ul class="card">
2051
- ${this.store?o`<li><button type="button" class="row" part="row" @click=${()=>n(this,ie,nc).call(this,"cm-store-switch")}>
2290
+ ${this.store?l`<li><button type="button" class="row" part="row" @click=${()=>o(this,me,Td).call(this,"cm-store-switch")}>
2052
2291
  <span class="stack"><span class="eyebrow">${this.t("store")}</span><span>${this.store}</span></span>
2053
- <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
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>
2057
- <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:c}
2292
+ <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:d}
2293
+ ${this.userName?l`<li><button type="button" class="row" part="row" @click=${()=>o(this,me,Td).call(this,"cm-account")}>
2294
+ <span class="avatar">${this.avatarSrc?l`<img src=${this.avatarSrc} alt="">`:l`<span aria-hidden="true">${e}</span>`}</span>
2295
+ <span class="stack"><span>${this.userName}</span>${this.userEmail?l`<span class="email">${this.userEmail}</span>`:d}</span>
2296
+ <cm-icon class="chev" name="chevron-right" size="16"></cm-icon></button></li>`:d}
2058
2297
  </ul>
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`
2298
+ </section>`},cr.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}},cr.styles=[w,b`
2060
2299
  :host { display: block; background: var(--cm-bg-page); }
2061
2300
  nav { padding: var(--cm-space-20); display: flex; flex-direction: column; gap: var(--cm-space-20); }
2062
2301
  .heading {
@@ -2093,11 +2332,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2093
2332
  }
2094
2333
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2095
2334
  .sub .row { font-size: 16px; min-height: 48px; }
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>
2335
+ `];g("cm-mobile-menu",cr);var Ly=M("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Rl,Qp,dr=class extends k{constructor(){super(...arguments);p(this,Rl);this.icon="send";this.dismissible=!1}render(){return l`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
2336
+ <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?l`<cm-icon name=${this.icon} size="20"></cm-icon>`:d}</slot></span>
2098
2337
  <span class="text"><slot></slot></span>
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`
2338
+ ${this.dismissible?l`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${o(this,Rl,Qp)}><cm-icon name="close" size="18"></cm-icon></button>`:d}
2339
+ </div>`}};Rl=new WeakSet,Qp=function(){this.dispatchEvent(new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0}))&&(this.hidden=!0)},dr.properties={icon:{},dismissible:{type:Boolean,reflect:!0},label:{string:"label"}},dr.styles=[w,b`
2101
2340
  :host { display: block; }
2102
2341
  .bar {
2103
2342
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
@@ -2119,11 +2358,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2119
2358
  @media (max-width: 640px) {
2120
2359
  .bar { font-size: 14px; min-height: 44px; justify-content: flex-start; text-align: start; }
2121
2360
  }
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>
2361
+ `];g("cm-flash-offer-bar",dr);var Oy=M("linkTabs",{label:"Sections"}),yn,wn,Cd,hr=class extends k{constructor(){super(...arguments);p(this,wn);this.items=[];this._slotted=[];p(this,yn)}connectedCallback(){super.connectedCallback(),o(this,wn,Cd).call(this),f(this,yn,Ot(this,()=>o(this,wn,Cd).call(this)))}disconnectedCallback(){super.disconnectedCallback(),s(this,yn)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return l`<nav part="nav" aria-label=${this.label||this.t("label")}>
2362
+ <ul part="tabs">${this.tabs.map(e=>l`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":d}
2363
+ @click=${t=>{qt(this,e)||t.preventDefault()}}>${e.label}${e.badge?l`<span class="badge">(${e.badge})</span>`:d}</a></li>`)}</ul>
2125
2364
  <slot hidden></slot>
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`
2365
+ </nav>`}};yn=new WeakMap,wn=new WeakSet,Cd=function(){this._slotted=ct(this)},hr.properties={items:{type:Array},label:{string:"label"},_slotted:{state:!0}},hr.styles=[w,b`
2127
2366
  :host { display: block; }
2128
2367
  ul {
2129
2368
  display: flex; gap: 28px; margin: 0; padding: 2px 2px 0; list-style: none; overflow-x: auto; scrollbar-width: thin;
@@ -2141,19 +2380,19 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2141
2380
  a:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; border-radius: var(--cm-radius-xs); }
2142
2381
  .badge { font-size: 12px; color: var(--cm-text-tertiary); }
2143
2382
  @media (max-width: 640px) { ul { gap: 18px; } a { font-size: 14px; } }
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">
2383
+ `];g("cm-link-tabs",hr);var Uy=M("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}"}),pr=class extends k{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}):"",a=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return l`<article part="card" aria-labelledby="name">
2145
2384
  <div class="logo" part="logo"><slot name="logo"></slot></div>
2146
2385
  <div class="status"><slot name="status"></slot></div>
2147
2386
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
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>
2150
- <span aria-hidden="true">${l}</span><span class="sr">${this.t("rating",{rating:l})}</span>
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}
2155
- aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:c}</div>
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`
2387
+ ${this.developer?l`<p class="by">${this.t("developer",{developer:this.developer})}</p>`:d}
2388
+ ${t?l`<p class="rating"><cm-icon class="star" name="star" size="12"></cm-icon>
2389
+ <span aria-hidden="true">${a}</span><span class="sr">${this.t("rating",{rating:a})}</span>
2390
+ ${i?this.reviewsHref?l`<a href=${this.reviewsHref}>${i}</a>`:l`<span>${i}</span>`:d}</p>`:d}
2391
+ ${this.pricing?l`<p class="pricing">${this.pricing}</p>`:d}
2392
+ ${this.offer?l`<p class="offer"><cm-icon name="percent" size="12"></cm-icon><span><span class="sr">${this.t("offer")}</span>${this.offer}</span></p>`:d}
2393
+ <div class="actions"><slot name="actions"></slot>${this.href?l`<a class="details" part="details" href=${this.href}
2394
+ aria-label=${this.t("detailsLabel",{name:this.name})}>${this.t("details")}</a>`:d}</div>
2395
+ </article>`}};pr.properties={name:{},developer:{},rating:{type:Number},reviews:{type:Number},reviewsHref:{attribute:"reviews-href"},pricing:{},offer:{},href:{},headingLevel:{type:Number,attribute:"heading-level"}},pr.styles=[w,b`
2157
2396
  :host { display: block; container-type: inline-size; }
2158
2397
  article {
2159
2398
  position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; padding: var(--cm-space-20);
@@ -2189,20 +2428,20 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2189
2428
  .actions { gap: var(--cm-space-10); }
2190
2429
  .details { margin-inline-start: auto; }
2191
2430
  }
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">
2431
+ `];g("cm-app-card",pr);var Hl,eu,ur=class extends X{constructor(){super(...arguments);p(this,Hl);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}render(){return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2193
2432
  ${this.renderHeader()}
2194
2433
  <div class="body" part="body"><slot></slot></div>
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`
2434
+ <footer class="foot" part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${o(this,Hl,eu)}></slot></footer>
2435
+ </div>`)}};Hl=new WeakSet,eu=function(e){this._hasFooter=e.target.assignedElements().length>0},ur.properties={...X.properties,size:{reflect:!0},_hasFooter:{state:!0}},ur.styles=[...X.overlayStyles,b`
2197
2436
  dialog { position: fixed; inset: 0; margin: auto; width: min(var(--cm-modal-width, 620px), calc(100vw - 32px)); }
2198
2437
  :host([size='small']) dialog { --cm-modal-width: 400px; }
2199
2438
  :host([size='large']) dialog { --cm-modal-width: 900px; }
2200
2439
  .panel { max-height: calc(100dvh - 64px); border-radius: var(--cm-radius-sm); box-shadow: var(--cm-shadow-100); }
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">
2440
+ `];g("cm-modal",ur);var Il,tu,Ge=class extends X{constructor(){super(...arguments);p(this,Il);this.size="medium";this._hasFooter=!1}connectedCallback(){super.connectedCallback(),this._hasFooter=!!this.querySelector(':scope > [slot="footer"]')}renderBody(){return l`<slot></slot>`}renderFooter(){return l`<slot name="footer" @slotchange=${o(this,Il,tu)}></slot>`}get showFooter(){return this._hasFooter}render(){return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2202
2441
  ${this.renderHeader()}
2203
2442
  <div class="body" part="body">${this.renderBody()}</div>
2204
2443
  <footer class="foot" part="footer" ?hidden=${!this.showFooter}>${this.renderFooter()}</footer>
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`
2444
+ </div>`)}};Il=new WeakSet,tu=function(e){this._hasFooter=e.target.assignedElements().length>0},Ge.properties={...X.properties,size:{reflect:!0},_hasFooter:{state:!0}},Ge.styles=[...X.overlayStyles,b`
2206
2445
  dialog {
2207
2446
  position: fixed; inset-block: 0; inset-inline: auto 0; height: 100dvh; width: min(var(--cm-side-panel-width, 450px), 100vw);
2208
2447
  }
@@ -2219,25 +2458,25 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2219
2458
  dialog { inset: 16px; width: auto; height: auto; }
2220
2459
  .panel { border-radius: var(--cm-radius-sm); }
2221
2460
  }
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}
2461
+ `];g("cm-side-panel",Ge);var o0=M("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),fr,Ol,mr=class extends Ge{constructor(){super(...arguments);this.search=!1;this.query="";p(this,fr,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});p(this,Ol,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(a,c)=>{if(c==="")return;let h=e[a];e[a]=h===void 0?c:Array.isArray(h)?[...h,c]:[h,c]},i=this.form;if(i){for(let[a,c]of new FormData(i))typeof c=="string"&&t(a,c);return e}return this.querySelectorAll("[name]").forEach(a=>{let c=a.getAttribute("name");"checked"in a&&(a.type==="checkbox"||a.type==="radio"||a.localName.match(/^cm-(checkbox|radio|toggle)$/))?a.checked&&t(c,a.value||"on"):typeof a.value=="string"&&t(c,a.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return l`${this.search?l`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
2223
2462
  placeholder=${this.searchPlaceholder}
2224
2463
  @input=${e=>{this.query=e.target.value}}
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`
2464
+ @cm-search=${e=>{e.stopPropagation(),s(this,fr).call(this)}}></cm-search>`:d}
2465
+ <slot @submit=${e=>{e.preventDefault(),s(this,fr).call(this)}}></slot>`}renderFooter(){return l`<cm-button part="reset" @click=${s(this,Ol)}>${this.resetLabel}</cm-button>
2466
+ <cm-button part="apply" variant="primary" @click=${s(this,fr)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};fr=new WeakMap,Ol=new WeakMap,mr.properties={...Ge.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"}},mr.styles=[...Ge.styles,b`
2228
2467
  .search { display: block; margin-bottom: var(--cm-space-20); }
2229
2468
  .foot { justify-content: center; }
2230
2469
  ::slotted(form) { display: grid; gap: var(--cm-space-15); }
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">
2470
+ `];g("cm-filter-panel",mr);var $n,ki,zd,iu,br=class extends X{constructor(){super(...arguments);p(this,ki);this.heading="";this.items=[];this._slotted=[];p(this,$n)}get sheetItems(){return this.items.length?this.items:this._slotted}connectedCallback(){super.connectedCallback(),this._slotted=Fa(this),f(this,$n,cl(this,()=>{this._slotted=Fa(this)}))}disconnectedCallback(){super.disconnectedCallback(),s(this,$n)?.disconnect()}render(){let e=this.sheetItems.filter(i=>!i.divider),t=e.some(i=>i.icon);return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2232
2471
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
2233
2472
  <cm-icon name="close" size="16"></cm-icon></button>
2234
- ${this.heading?o`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:c}
2473
+ ${this.heading?l`<h2 class="vh" id="${this.uid}-h">${this.heading}</h2>`:d}
2235
2474
  <div class="content">
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}
2475
+ ${e.length?l`<ul class=${t?"icons":""} part="list">${e.map(i=>l`<li>${o(this,ki,iu).call(this,i)}</li>`)}</ul>`:d}
2237
2476
  <slot ?hidden=${this._slotted.length>0}></slot>
2238
2477
  </div>
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`
2478
+ </div>`)}};$n=new WeakMap,ki=new WeakSet,zd=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")},iu=function(e){let t=`row${e.critical?" critical":""}`,i=l`${e.icon?l`<cm-icon class="lead" name=${e.icon} size="18"></cm-icon>`:d}<span class="label">${e.label}</span>${e.icon?l`<cm-icon name="chevron-right" size="16"></cm-icon>`:d}`;return e.href&&!e.disabled?l`<a class=${t} part="row" href=${e.href} @click=${a=>o(this,ki,zd).call(this,a,e)}>${i}</a>`:l`<button type="button" class=${t} part="row" aria-disabled=${e.disabled?"true":d}
2479
+ @click=${a=>o(this,ki,zd).call(this,a,e)}>${i}</button>`},br.properties={...X.properties,items:{type:Array},_slotted:{state:!0}},br.styles=[...X.overlayStyles,b`
2241
2480
  dialog {
2242
2481
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: min(600px, 100vw); padding-top: 22px;
2243
2482
  }
@@ -2271,17 +2510,17 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2271
2510
  }
2272
2511
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
2273
2512
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
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">
2513
+ `];g("cm-bottom-sheet",br);var y0=M("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),im={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},gr=class extends _{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};gr.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},gr.styles=b`:host { display: none; }`;g("cm-notification-item",gr);var xr,we,Ld,Sd,su,ru,au,vr=class extends X{constructor(){super(...arguments);p(this,we);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;p(this,xr)}connectedCallback(){super.connectedCallback(),o(this,we,Ld).call(this),f(this,xr,new MutationObserver(()=>o(this,we,Ld).call(this))),s(this,xr).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),s(this,xr)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(a=>a.unread)?l`<button type="button" class="mark" part="mark-all-read" @click=${o(this,we,ru)}>${this.markAllLabel}</button>`:d,i=this.loading?l`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>l`<li>
2514
+ <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?l`<ul class="list" part="list">${e.map(a=>l`<li>${o(this,we,su).call(this,a)}</li>`)}</ul>`:l`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(l`<div class="panel" part="panel" tabindex="-1">
2276
2515
  ${this.renderHeader(t)}
2277
2516
  ${i}
2278
2517
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
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>
2518
+ ${this.moreHref?l`<a class="more" part="more" href=${this.moreHref}>${this.moreLabel}</a>`:d}
2519
+ <div class="footer" part="footer" ?hidden=${!this._footer}><slot name="footer" @slotchange=${o(this,we,au)}></slot></div>
2281
2520
  <slot hidden></slot>
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`
2521
+ </div>`)}};xr=new WeakMap,we=new WeakSet,Ld=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")}})},Sd=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")},su=function(e){let t=e.tone??"information",i=e.description?l`<span class="title">${e.label}</span><span class="vh">, </span><span class="desc">${e.description}</span>`:e.label,a=l`<span class="ic ${t}" aria-hidden="true"><cm-icon name=${e.icon||im[t]||"bell"} size="14"></cm-icon></span>
2522
+ <span class="label">${e.unread?l`<span class="vh">${this.t("unread")}</span>`:d}${i}</span>
2523
+ ${e.time?l`<time>${e.time}</time>`:d}`,c=`row${e.unread?" unread":""}`;return e.href?l`<a class=${c} part="row" href=${e.href} @click=${h=>o(this,we,Sd).call(this,h,e)}>${a}</a>`:l`<button type="button" class=${c} part="row" @click=${h=>o(this,we,Sd).call(this,h,e)}>${a}</button>`},ru=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()},au=function(e){this._footer=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||(t.textContent??"").trim())},vr.properties={...X.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}},vr.styles=[...X.overlayStyles,b`
2285
2524
  dialog {
2286
2525
  position: fixed; inset-block: var(--cm-notification-panel-top, 64px) auto; inset-inline: auto var(--cm-notification-panel-end, 20px);
2287
2526
  width: min(380px, calc(100vw - 32px));
@@ -2330,14 +2569,14 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2330
2569
  @media (max-width: 599px) {
2331
2570
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
2332
2571
  }
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}
2572
+ `];g("cm-notification-panel",vr);var _0=M("toastRegion",{label:"Notifications"}),sm=2e3,nu=1e4,ou=150,kn,Pe,pt,En,kr,Er,fe,lu,yr,Ad,Mn,Tn,_n,Cn,cu,wr=class extends k{constructor(){super(...arguments);p(this,fe);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;p(this,kn);p(this,Pe);p(this,pt,0);p(this,En,0);p(this,kr,!1);p(this,Er,!1);p(this,Mn,()=>{f(this,kr,!0),o(this,fe,Ad).call(this)});p(this,Tn,()=>{f(this,kr,!1),o(this,fe,yr).call(this)});p(this,_n,()=>{f(this,Er,!0),o(this,fe,Ad).call(this)});p(this,Cn,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(f(this,Er,!1),o(this,fe,yr).call(this))})}get effectiveDuration(){let e=this.duration??(this.actionLabel?nu:5e3);return Math.min(nu,Math.max(sm,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&f(this,kn,setTimeout(()=>{this._primed=!0},ou)),this.addEventListener("pointerenter",s(this,Mn)),this.addEventListener("pointerleave",s(this,Tn)),this.addEventListener("focusin",s(this,_n)),this.addEventListener("focusout",s(this,Cn))}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(s(this,Pe)),clearTimeout(s(this,kn)),this.removeEventListener("pointerenter",s(this,Mn)),this.removeEventListener("pointerleave",s(this,Tn)),this.removeEventListener("focusin",s(this,_n)),this.removeEventListener("focusout",s(this,Cn))}updated(e){(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(s(this,Pe)),this.open&&(this._inRegion||this._primed)&&(f(this,pt,this.effectiveDuration),o(this,fe,yr).call(this)))}show(){this.open?(f(this,pt,this.effectiveDuration),o(this,fe,yr).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,Pe)),this.open=!1,!0):(e==="timeout"&&(f(this,pt,this.effectiveDuration),o(this,fe,yr).call(this)),!1)}render(){let e=l`<div class="toast" part="toast">
2573
+ ${this.tone==="critical"?l`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:d}
2335
2574
  <div class="message" part="message">${this.message}<slot></slot></div>
2336
- ${this.actionLabel?o`<button class="action" part="action" @click=${n(this,se,fh)}>${this.actionLabel}</button>`:c}
2575
+ ${this.actionLabel?l`<button class="action" part="action" @click=${o(this,fe,cu)}>${this.actionLabel}</button>`:d}
2337
2576
  <button class="close" part="close" aria-label=${this.t("dismiss")} @click=${()=>this.dismiss("close")}>
2338
2577
  <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>
2339
2578
  </button>
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`
2579
+ </div>`;return this._inRegion?e:l`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:d}</div>`}};kn=new WeakMap,Pe=new WeakMap,pt=new WeakMap,En=new WeakMap,kr=new WeakMap,Er=new WeakMap,fe=new WeakSet,lu=function(){return s(this,kr)||s(this,Er)},yr=function(){clearTimeout(s(this,Pe)),!(!this.open||s(this,fe,lu))&&(f(this,En,Date.now()),f(this,Pe,setTimeout(()=>this.dismiss("timeout"),s(this,pt))))},Ad=function(){s(this,Pe)!==void 0&&(clearTimeout(s(this,Pe)),f(this,Pe,void 0),f(this,pt,Math.max(1e3,s(this,pt)-(Date.now()-s(this,En)))))},Mn=new WeakMap,Tn=new WeakMap,_n=new WeakMap,Cn=new WeakMap,cu=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},wr.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},wr.styles=[w,b`
2341
2580
  :host { display: block; pointer-events: auto; }
2342
2581
  :host(:not([open])) { display: none; }
2343
2582
  .toast {
@@ -2362,23 +2601,23 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2362
2601
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
2363
2602
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
2364
2603
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
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`
2604
+ `];g("cm-toast",wr);var zn,Ln,$r=class extends k{constructor(){super(...arguments);this.max=3;p(this,zn,!1);p(this,Ln,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,zn,!0)),this.addEventListener("cm-dismiss",s(this,Ln))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",s(this,Ln))}updated(){s(this,zn)&&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 l`<slot></slot>`}};zn=new WeakMap,Ln=new WeakMap,$r.properties={max:{type:Number}},$r.styles=[w,b`
2366
2605
  :host {
2367
2606
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
2368
2607
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-10);
2369
2608
  padding-inline: var(--cm-space-15); pointer-events: none;
2370
2609
  }
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`
2610
+ `];g("cm-toast-region",$r);function rm(n,r={}){let e=r.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let a=document.createElement("cm-toast");if(a.message=String(n),r.tone&&(a.tone=r.tone),r.duration!==void 0&&(a.duration=r.duration),r.action){a.actionLabel=r.action.label;let c=r.action.onAction;a.addEventListener("cm-action",()=>c())}if(i){let c=t;return setTimeout(()=>c.add(a),ou),a}return t.add(a)}var N0=M("progressBar",{inProgress:"In progress"}),ql,Mr=class extends k{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";p(this,ql,L("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,ql)}-label`;return l`
2372
2611
  <div class="head ${this.labelHidden?"vh":""}">
2373
2612
  <span id=${t} part="label">${this.label}</span>
2374
- ${this.showValue&&e!==null?o`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:c}
2613
+ ${this.showValue&&e!==null?l`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:d}
2375
2614
  </div>
2376
2615
  <div class="track ${e===null?"indeterminate":""}" part="track" role="progressbar"
2377
2616
  aria-labelledby=${t} aria-valuemin="0" aria-valuemax="100"
2378
- aria-valuenow=${e===null?c:Math.round(e)}
2617
+ aria-valuenow=${e===null?d:Math.round(e)}
2379
2618
  aria-valuetext=${e===null?this.t("inProgress"):this.formatNumber(Math.round(e)/100,{style:"percent"})}>
2380
2619
  <div class="fill" part="fill" style=${e===null?"":`inline-size:${e}%`}></div>
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`
2620
+ </div>`}};ql=new WeakMap,Mr.properties={value:{type:Number},label:{},labelHidden:{type:Boolean,attribute:"label-hidden"},showValue:{type:Boolean,attribute:"show-value"},size:{reflect:!0}},Mr.styles=[w,b`
2382
2621
  :host { display: block; }
2383
2622
  .head { display: flex; justify-content: space-between; gap: var(--cm-space-10); margin-block-end: 6px; font-size: 14px; line-height: 20px; }
2384
2623
  .value { color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
@@ -2395,7 +2634,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2395
2634
  .fill { transition: none; }
2396
2635
  .indeterminate .fill { animation-duration: 4s; }
2397
2636
  }
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`
2637
+ `];g("cm-progress-bar",Mr);var Tr=class extends _{constructor(){super(...arguments);this.tone="neutral"}render(){return l`<span part="badge"><slot></slot></span>`}};Tr.properties={tone:{reflect:!0}},Tr.styles=[w,b`
2399
2638
  :host { display: inline-flex; vertical-align: middle; }
2400
2639
  span {
2401
2640
  display: inline-flex; align-items: center; height: 28px; padding: 0 var(--cm-space-10);
@@ -2407,11 +2646,11 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2407
2646
  :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); }
2408
2647
  :host([tone='critical']) span { background: linear-gradient(var(--cm-bg-critical), var(--cm-bg-critical)), var(--cm-bg-surface); color: var(--cm-text-critical); }
2409
2648
  :host([tone='attention']) span { background: linear-gradient(var(--cm-bg-attention), var(--cm-bg-attention)), var(--cm-bg-surface); color: var(--cm-text-attention); }
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>
2412
- <div class="actions"><slot name="actions"></slot></div></header>`:c}
2649
+ `];g("cm-badge",Tr);var Cr,zr,Lr,du,hu,_r=class extends _{constructor(){super(...arguments);p(this,Lr);this.heading="";this.description="";this.flush=!1;this.headingLevel=2;p(this,Cr,!1);p(this,zr,!1)}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2)),t=this.heading?l`<div role="heading" aria-level=${e} class="title" part="title"><span class="text">${this.heading}</span><span class="adornment" ?hidden=${!s(this,Cr)}><slot name="title-adornment" @slotchange=${o(this,Lr,du)}></slot></span></div>`:d;return l`<section part="card" aria-label=${this.heading||d}>
2650
+ ${this.heading||this.description?l`<header><div class="main">${this.heading?l`<span class="strut" aria-hidden="true">${this.heading}</span>`:d}${t}${this.description?l`<p class="desc">${this.description}</p>`:d}</div>
2651
+ <div class="actions"><slot name="actions"></slot></div></header>`:l`<div class="bare" ?hidden=${!s(this,zr)}><div class="actions"><slot name="actions" @slotchange=${o(this,Lr,hu)}></slot></div></div>`}
2413
2652
  <slot></slot>
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`
2653
+ </section>`}};Cr=new WeakMap,zr=new WeakMap,Lr=new WeakSet,du=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,Cr)&&(f(this,Cr,t),this.requestUpdate())},hu=function(e){let t=e.target.assignedNodes().some(i=>i.nodeType===Node.ELEMENT_NODE||i.textContent?.trim());t!==s(this,zr)&&(f(this,zr,t),this.requestUpdate())},_r.properties={heading:{},description:{},flush:{type:Boolean,reflect:!0},headingLevel:{type:Number,attribute:"heading-level"}},_r.styles=[w,b`
2415
2654
  :host { display: block; }
2416
2655
  section {
2417
2656
  background: var(--cm-bg-surface); border: var(--cm-border-1) solid var(--cm-border-card);
@@ -2437,8 +2676,12 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2437
2676
  .adornment[hidden] { display: none; }
2438
2677
  .desc { margin: 6px 0 0; font-size: 16px; color: var(--cm-text-tertiary); }
2439
2678
  .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`
2679
+ /* Actions on a card without a heading or description: a row of their own, at the end. */
2680
+ .bare { display: flex; justify-content: flex-end; margin-bottom: var(--cm-space-20); }
2681
+ .bare[hidden] { display: none; }
2682
+ :host([flush]) .bare { padding: var(--cm-space-20) var(--cm-space-20) 0; }
2683
+ `];g("cm-card",_r);var am=["0","10","12","15","20","22","30"];function Sr(n,r){return Rn(am.map(e=>`:host([${n}='${e}']) { ${r}: ${e==="0"?"0px":`var(--cm-space-${e})`}; }`).join(`
2684
+ `))}var Ar=class extends _{constructor(){super(...arguments);this.direction="block";this.gap="20";this.wrap=!1}render(){return l`<slot></slot>`}};Ar.properties={direction:{reflect:!0},gap:{reflect:!0},align:{reflect:!0},justify:{reflect:!0},wrap:{type:Boolean,reflect:!0}},Ar.styles=[w,b`
2442
2685
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
2443
2686
  :host([direction='inline']) { flex-direction: row; align-items: center; }
2444
2687
  :host([wrap]) { flex-wrap: wrap; }
@@ -2451,13 +2694,13 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2451
2694
  :host([justify='center']) { justify-content: center; }
2452
2695
  :host([justify='end']) { justify-content: flex-end; }
2453
2696
  :host([justify='space-between']) { justify-content: space-between; }
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`
2697
+ `,Sr("gap","gap")];g("cm-stack",Ar);var pu="important",nm=" !"+pu,uu=Li(class extends ut{constructor(n){if(super(n),n.type!==Re.ATTRIBUTE||n.name!=="style"||n.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(n){return Object.keys(n).reduce((r,e)=>{let t=n[e];return t==null?r:r+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${t};`},"")}update(n,[r]){let{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(let t of this.ft)r[t]==null&&(this.ft.delete(t),t.includes("-")?e.removeProperty(t):e[t]=null);for(let t in r){let i=r[t];if(i!=null){this.ft.add(t);let a=typeof i=="string"&&i.endsWith(nm);t.includes("-")||a?e.setProperty(t,a?i.slice(0,-11):i,a?pu:""):e[t]=i}}return ae}});var Dr=class extends _{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 l`<div class="grid ${t?"fit":"fixed"}" part="grid" style=${uu({gridTemplateColumns:i})}><slot></slot></div>`}};Dr.properties={columns:{type:Number,reflect:!0},minColumnWidth:{attribute:"min-column-width",reflect:!0},gap:{reflect:!0}},Dr.styles=[w,b`
2455
2698
  :host { display: block; container: cm-grid / inline-size; --_gap: var(--cm-space-20); }
2456
2699
  .grid { display: grid; gap: var(--_gap); align-items: start; }
2457
2700
  @container cm-grid (max-width: 640px) {
2458
2701
  .grid.fixed { grid-template-columns: minmax(0, 1fr) !important; }
2459
2702
  }
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`
2703
+ `,Sr("gap","--_gap")];g("cm-grid",Dr);var Nr=class extends _{constructor(){super(...arguments);this.gap="20"}render(){return l`<div class="layout" part="layout"><slot></slot></div>`}};Nr.properties={gap:{reflect:!0}},Nr.styles=[w,b`
2461
2704
  :host { display: block; container: cm-layout / inline-size; --_gap: var(--cm-space-20); }
2462
2705
  .layout { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--_gap); align-items: start; }
2463
2706
  @container cm-layout (max-width: 767px) {
@@ -2471,9 +2714,9 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2471
2714
  ::slotted([variant='one-third']) { grid-column: span 2; }
2472
2715
  ::slotted([variant='two-thirds']) { grid-column: span 4; }
2473
2716
  }
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`
2717
+ `,Sr("gap","--_gap")];var Rr=class extends _{constructor(){super(...arguments);this.variant="full"}render(){return l`<slot></slot>`}};Rr.properties={variant:{reflect:!0}},Rr.styles=[w,b`
2475
2718
  :host { display: flex; flex-direction: column; gap: var(--cm-space-20); min-inline-size: 0; }
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">
2719
+ `];g("cm-layout",Nr);g("cm-layout-section",Rr);var Dd=1024,om=()=>{let n=document.activeElement;for(;n?.shadowRoot?.activeElement;)n=n.shadowRoot.activeElement;return n},Mi,Ir,$e,Nd,Ei,mu,Sn,An,Hr=class extends _{constructor(){super(...arguments);p(this,$e);this.menuOpen=!1;this.menuItem="";this._wide=!1;p(this,Mi);p(this,Ir,null);p(this,Sn,e=>{if(!this.menuItem)return;let t=o(this,$e,mu).call(this,e),i=e.detail?.value;t==="bottom-navigation"&&i===this.menuItem?o(this,$e,Ei).call(this,!this.menuOpen):(t==="mobile-menu"||t==="bottom-navigation")&&o(this,$e,Ei).call(this,!1,!1)});p(this,An,e=>{e.key!=="Escape"||e.defaultPrevented||!this.menuItem||!this.menuOpen||this._wide||(e.preventDefault(),o(this,$e,Ei).call(this,!1))})}connectedCallback(){super.connectedCallback(),this.addEventListener("cm-navigate",s(this,Sn)),this.addEventListener("keydown",s(this,An));let e=this.getBoundingClientRect().width;e>0&&(this._wide=e>=Dd)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-navigate",s(this,Sn)),this.removeEventListener("keydown",s(this,An)),s(this,Mi)?.disconnect(),f(this,Mi,void 0)}get wide(){return this._wide}firstUpdated(){let e=0;f(this,Mi,new ResizeObserver(()=>{o(this,$e,Nd).call(this);let t=this.renderRoot.querySelector(".probe").getBoundingClientRect().width;t>0&&t>=Dd!==this._wide&&(cancelAnimationFrame(e),e=requestAnimationFrame(()=>{this._wide=t>=Dd}))})),this.renderRoot.querySelectorAll(".probe, .header, .bottom").forEach(t=>s(this,Mi).observe(t))}updated(e){e.has("_wide")&&o(this,$e,Nd).call(this)}openMenu(){o(this,$e,Ei).call(this,!0)}closeMenu(){o(this,$e,Ei).call(this,!1)}toggleMenu(){o(this,$e,Ei).call(this,!this.menuOpen)}render(){let e=this._wide,t=this.menuOpen&&!e&&!!this.querySelector(':scope > [slot="mobile-menu"]');return l`<div class="frame ${e?"wide":""}" part="frame">
2477
2720
  <div class="probe"></div>
2478
2721
  <div class="header" part="header" ?inert=${t}><slot name="header"></slot></div>
2479
2722
  <div class="body">
@@ -2482,7 +2725,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2482
2725
  </div>
2483
2726
  <div class="menu" part="mobile-menu" ?hidden=${!t}><slot name="mobile-menu" @slotchange=${()=>this.requestUpdate()}></slot></div>
2484
2727
  <div class="bottom" part="bottom-navigation" ?hidden=${e}><slot name="bottom-navigation"></slot></div>
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`
2728
+ </div>`}};Mi=new WeakMap,Ir=new WeakMap,$e=new WeakSet,Nd=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&&f(this,Ir,om()),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,Ir)?.focus(),f(this,Ir,null))}))},mu=function(e){return e.composedPath().find(i=>i.parentElement===this)?.getAttribute("slot")??""},Sn=new WeakMap,An=new WeakMap,Hr.properties={menuOpen:{type:Boolean,attribute:"menu-open",reflect:!0},menuItem:{attribute:"menu-item"},_wide:{state:!0}},Hr.styles=[w,b`
2486
2729
  :host { display: block; min-block-size: var(--cm-app-frame-height, 100dvh); background: var(--cm-bg-page); --_header: 0px; --_bottom: 0px; }
2487
2730
  .header { position: sticky; inset-block-start: 0; z-index: 30; padding-block-start: env(safe-area-inset-top, 0px); background: var(--cm-bg-surface); }
2488
2731
  .body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
@@ -2503,7 +2746,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2503
2746
  }
2504
2747
  .probe { block-size: 0; }
2505
2748
  [hidden] { display: none !important; }
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`
2749
+ `];g("cm-app-frame",Hr);var Or=class extends _{constructor(){super(...arguments);this.fullWidth=!1;this.narrow=!1}render(){return l`<slot name="header"></slot><div class="content" part="content"><slot></slot></div><slot name="footer"></slot>`}};Or.properties={fullWidth:{type:Boolean,attribute:"full-width",reflect:!0},narrow:{type:Boolean,reflect:!0}},Or.styles=[w,b`
2507
2750
  :host { display: block; container: cm-page / inline-size; background: var(--cm-bg-page); min-block-size: 100%; }
2508
2751
  .content {
2509
2752
  box-sizing: content-box; max-inline-size: 1600px; margin-inline: auto;
@@ -2512,16 +2755,16 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2512
2755
  :host([narrow]) .content { max-inline-size: 800px; }
2513
2756
  :host([full-width]) .content { max-inline-size: none; }
2514
2757
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-10); } }
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}>
2758
+ `];g("cm-page",Or);var Pr,fu,bu,qr=class extends k{constructor(){super(...arguments);p(this,Pr);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?Yr`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:Yr`<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 l`<div class="banner" part="banner" role=${e}>
2516
2759
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
2517
2760
  <div class="body">
2518
- ${this.heading?o`<p class="title">${this.heading}</p>`:c}
2761
+ ${this.heading?l`<p class="title">${this.heading}</p>`:d}
2519
2762
  <div><slot></slot></div>
2520
- <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${n(this,aa,wh)}></slot></div>
2763
+ <div class="actions" ?hidden=${!this.hasActions}><slot name="actions" @slotchange=${o(this,Pr,fu)}></slot></div>
2521
2764
  </div>
2522
- ${this.dismissible?o`<button class="close" aria-label=${this.t("dismiss")} @click=${n(this,aa,$h)}>
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}
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`
2765
+ ${this.dismissible?l`<button class="close" aria-label=${this.t("dismiss")} @click=${o(this,Pr,bu)}>
2766
+ <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>`:d}
2767
+ </div>`}};Pr=new WeakSet,fu=function(e){this.hasActions=e.target.assignedElements().length>0,this.requestUpdate()},bu=function(){let e=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&(this.hidden=!0)},qr.properties={tone:{reflect:!0},heading:{},dismissible:{type:Boolean}},qr.styles=[w,b`
2525
2768
  :host { display: block; }
2526
2769
  .banner {
2527
2770
  display: flex; gap: var(--cm-space-15); align-items: flex-start;
@@ -2544,10 +2787,10 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2544
2787
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
2545
2788
  }
2546
2789
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
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}
2549
- aria-label=${this.alt?this.t("noImage",{alt:this.alt}):c} aria-hidden=${this.alt?c:"true"}>
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`
2790
+ `];g("cm-banner",qr);var C1=M("thumbnail",{noImage:"{alt} (no image)"}),Br=class extends k{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 l`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
2791
+ @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return l`<span class="box" part="thumbnail" role=${this.alt?"img":d}
2792
+ aria-label=${this.alt?this.t("noImage",{alt:this.alt}):d} aria-hidden=${this.alt?d:"true"}>
2793
+ <cm-icon name="box" size=${e}></cm-icon></span>`}};Br.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},Br.styles=[w,b`
2551
2794
  :host { --_size: var(--cm-thumbnail-size, 60px); display: inline-flex; vertical-align: middle; flex: none; }
2552
2795
  :host([size='small']) { --_size: var(--cm-thumbnail-size, 40px); }
2553
2796
  :host([size='large']) { --_size: var(--cm-thumbnail-size, 80px); }
@@ -2557,7 +2800,7 @@ cm-data-table > table .numeric, cm-data-table > table [data-type='numeric'], cm-
2557
2800
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
2558
2801
  }
2559
2802
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
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};
2803
+ `];g("cm-thumbnail",Br);export{Qa as Announcer,fs as CmAccordion,hs as CmActionBar,qs as CmActionMenu,pr as CmAppCard,Hr as CmAppFrame,sr as CmAvatar,Tr as CmBadge,qr as CmBanner,Gs as CmBoard,gi as CmBoardCard,vi as CmBoardColumn,lr as CmBottomNavigation,br as CmBottomSheet,Ut as CmButton,_r as CmCard,bt as CmCheckbox,At as CmColorField,kt as CmCombobox,xs as CmComment,ys as CmCommentBox,Rs as CmDataTable,_t as CmDatePicker,zt as CmDateRangePicker,bs as CmEmptyState,St as CmFileUpload,mr as CmFilterPanel,dr as CmFlashOfferBar,Zt as CmGlobalSearch,Dr as CmGrid,ar as CmHeaderBar,zi as CmIcon,ms as CmInfoItem,us as CmInfoPanel,Nr as CmLayout,Rr as CmLayoutSection,hr as CmLinkTabs,k as CmLocalizedElement,Is as CmMenuItem,Zs as CmMetric,cr as CmMobileMenu,ur as CmModal,Qs as CmNavItem,Us as CmNestedItem,Vs as CmNestedList,gr as CmNotificationItem,vr as CmNotificationPanel,ni as CmOptionGroup,Or as CmPage,ds as CmPageHeader,Ls as CmPagination,Mr as CmProgressBar,Yt as CmRadio,Wt as CmRadioGroup,yi as CmReportTile,Js as CmReportTiles,js as CmResourceItem,Fs as CmResourceList,ps as CmSaveBar,wt as CmSearch,yt as CmSelect,er as CmSideNavigation,Ge as CmSidePanel,gs as CmSkeleton,vs as CmSkeletonDisplay,Cs as CmSmartTip,zs as CmSmartTips,Fi as CmSpinner,Ar as CmStack,As as CmStatusTabs,Ds as CmTableHeader,ji as CmTag,ft as CmTextField,Br as CmThumbnail,hi as CmTimeline,Ts as CmTimelineItem,wr as CmToast,$r as CmToastRegion,vt as CmToggle,ws as CmTooltip,Za as MoveModel,Au as configure,M as defineStrings,nh as directionalIcons,Z as formatDate,sh as formatMessage,ec as formatNumber,Lu as getDefaultStrings,Wp as initials,Sp as listNavigation,Jr as localeFor,at as normalizeHex,Kn as pluralCategory,Du as resetStrings,Dh as resolvePreset,Su as setStrings,rm as showToast,rh as translate};
2561
2804
  /*! Bundled license information:
2562
2805
 
2563
2806
  @lit/reactive-element/css-tag.js:
@@ -2616,6 +2859,13 @@ lit-html/directives/live.js:
2616
2859
  * SPDX-License-Identifier: BSD-3-Clause
2617
2860
  *)
2618
2861
 
2862
+ lit-html/directives/repeat.js:
2863
+ (**
2864
+ * @license
2865
+ * Copyright 2017 Google LLC
2866
+ * SPDX-License-Identifier: BSD-3-Clause
2867
+ *)
2868
+
2619
2869
  lit-html/directives/style-map.js:
2620
2870
  (**
2621
2871
  * @license