@commmerce/ui 1.17.0 → 1.17.1

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,4 +1,4 @@
1
- var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(o,n,e)=>(Km(o,n,"read from private field"),e?e.call(o):n.get(o)),m=(o,n,e)=>n.has(o)?Qf("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(Km(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(Km(o,n,"access private method"),e);var Id=globalThis,qd=Id.ShadowRoot&&(Id.ShadyCSS===void 0||Id.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gm=Symbol(),eb=new WeakMap,il=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==Gm)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(qd&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=eb.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&eb.set(e,n))}return n}toString(){return this.cssText}},Od=o=>new il(typeof o=="string"?o:o+"",void 0,Gm),w=(o,...n)=>{let e=o.length===1?o[0]:n.reduce((t,i,s)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new il(e,o,Gm)},tb=(o,n)=>{if(qd)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=Id.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},Wm=qd?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return Od(e)})(o):o;var{is:kw,defineProperty:Ew,getOwnPropertyDescriptor:Mw,getOwnPropertyNames:Tw,getOwnPropertySymbols:_w,getPrototypeOf:Cw}=Object,Bd=globalThis,ib=Bd.trustedTypes,zw=ib?ib.emptyScript:"",Sw=Bd.reactiveElementPolyfillSupport,rl=(o,n)=>o,Ym={toAttribute(o,n){switch(n){case Boolean:o=o?zw:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,n){let e=o;switch(n){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},sb=(o,n)=>!kw(o,n),rb={attribute:!0,type:String,converter:Ym,reflect:!1,useDefault:!1,hasChanged:sb};Symbol.metadata??=Symbol("metadata"),Bd.litPropertyMetadata??=new WeakMap;var Wt=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=rb){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(n,t,e);i!==void 0&&Ew(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:s}=Mw(this.prototype,n)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);s?.call(this,l),this.requestUpdate(n,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??rb}static _$Ei(){if(this.hasOwnProperty(rl("elementProperties")))return;let n=Cw(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(rl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rl("properties"))){let e=this.properties,t=[...Tw(e),..._w(e)];for(let i of t)this.createProperty(i,e[i])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);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(n){let e=[];if(Array.isArray(n)){let t=new Set(n.flat(1/0).reverse());for(let i of t)e.unshift(Wm(i))}else n!==void 0&&e.push(Wm(n));return e}static _$Eu(n,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.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(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(n=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(n.set(t,this[t]),delete this[t]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return tb(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(n=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach(n=>n.hostDisconnected?.())}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$ET(n,e){let t=this.constructor.elementProperties.get(n),i=this.constructor._$Eu(n,t);if(i!==void 0&&t.reflect===!0){let s=(t.converter?.toAttribute!==void 0?t.converter:Ym).toAttribute(e,t.type);this._$Em=n,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(n,e){let t=this.constructor,i=t._$Eh.get(n);if(i!==void 0&&this._$Em!==i){let s=t.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ym;this._$Em=i;let d=l.fromAttribute(e,s.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(n,e,t,i=!1,s){if(n!==void 0){let l=this.constructor;if(i===!1&&(s=this[n]),t??=l.getPropertyOptions(n),!((t.hasChanged??sb)(s,e)||t.useDefault&&t.reflect&&s===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,t))))return;this.C(n,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:t,reflect:i,wrapped:s},l){t&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,l??e??this[n]),s!==!0||l!==void 0)||(this._$AL.has(n)||(this.hasUpdated||t||(e=void 0),this._$AL.set(n,e)),i===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,s]of t){let{wrapped:l}=s,d=this[i];l!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,s,d)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}};Wt.elementStyles=[],Wt.shadowRootOptions={mode:"open"},Wt[rl("elementProperties")]=new Map,Wt[rl("finalized")]=new Map,Sw?.({ReactiveElement:Wt}),(Bd.reactiveElementVersions??=[]).push("2.1.2");var Jm=globalThis,ab=o=>o,Fd=Jm.trustedTypes,nb=Fd?Fd.createPolicy("lit-html",{createHTML:o=>o}):void 0,Zm="$lit$",Yt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qm="?"+Yt,Lw=`<${Qm}>`,br=document,al=()=>br.createComment(""),nl=o=>o===null||typeof o!="object"&&typeof o!="function",eu=Array.isArray,pb=o=>eu(o)||typeof o?.[Symbol.iterator]=="function",Xm=`[
1
+ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(o,n,e)=>(Km(o,n,"read from private field"),e?e.call(o):n.get(o)),m=(o,n,e)=>n.has(o)?Qf("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,e),g=(o,n,e,t)=>(Km(o,n,"write to private field"),t?t.call(o,e):n.set(o,e),e),a=(o,n,e)=>(Km(o,n,"access private method"),e);var Id=globalThis,qd=Id.ShadowRoot&&(Id.ShadyCSS===void 0||Id.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gm=Symbol(),eb=new WeakMap,il=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==Gm)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o,e=this.t;if(qd&&n===void 0){let t=e!==void 0&&e.length===1;t&&(n=eb.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&eb.set(e,n))}return n}toString(){return this.cssText}},Od=o=>new il(typeof o=="string"?o:o+"",void 0,Gm),w=(o,...n)=>{let e=o.length===1?o[0]:n.reduce((t,i,s)=>t+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new il(e,o,Gm)},tb=(o,n)=>{if(qd)o.adoptedStyleSheets=n.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of n){let t=document.createElement("style"),i=Id.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,o.appendChild(t)}},Wm=qd?o=>o:o=>o instanceof CSSStyleSheet?(n=>{let e="";for(let t of n.cssRules)e+=t.cssText;return Od(e)})(o):o;var{is:kw,defineProperty:Ew,getOwnPropertyDescriptor:Mw,getOwnPropertyNames:_w,getOwnPropertySymbols:Tw,getPrototypeOf:Cw}=Object,Bd=globalThis,ib=Bd.trustedTypes,zw=ib?ib.emptyScript:"",Sw=Bd.reactiveElementPolyfillSupport,rl=(o,n)=>o,Ym={toAttribute(o,n){switch(n){case Boolean:o=o?zw:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,n){let e=o;switch(n){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},sb=(o,n)=>!kw(o,n),rb={attribute:!0,type:String,converter:Ym,reflect:!1,useDefault:!1,hasChanged:sb};Symbol.metadata??=Symbol("metadata"),Bd.litPropertyMetadata??=new WeakMap;var Wt=class extends HTMLElement{static addInitializer(n){this._$Ei(),(this.l??=[]).push(n)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(n,e=rb){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(n)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(n,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(n,t,e);i!==void 0&&Ew(this.prototype,n,i)}}static getPropertyDescriptor(n,e,t){let{get:i,set:s}=Mw(this.prototype,n)??{get(){return this[e]},set(l){this[e]=l}};return{get:i,set(l){let d=i?.call(this);s?.call(this,l),this.requestUpdate(n,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(n){return this.elementProperties.get(n)??rb}static _$Ei(){if(this.hasOwnProperty(rl("elementProperties")))return;let n=Cw(this);n.finalize(),n.l!==void 0&&(this.l=[...n.l]),this.elementProperties=new Map(n.elementProperties)}static finalize(){if(this.hasOwnProperty(rl("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(rl("properties"))){let e=this.properties,t=[..._w(e),...Tw(e)];for(let i of t)this.createProperty(i,e[i])}let n=this[Symbol.metadata];if(n!==null){let e=litPropertyMetadata.get(n);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(n){let e=[];if(Array.isArray(n)){let t=new Set(n.flat(1/0).reverse());for(let i of t)e.unshift(Wm(i))}else n!==void 0&&e.push(Wm(n));return e}static _$Eu(n,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof n=="string"?n.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(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(n=>n(this))}addController(n){(this._$EO??=new Set).add(n),this.renderRoot!==void 0&&this.isConnected&&n.hostConnected?.()}removeController(n){this._$EO?.delete(n)}_$E_(){let n=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(n.set(t,this[t]),delete this[t]);n.size>0&&(this._$Ep=n)}createRenderRoot(){let n=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return tb(n,this.constructor.elementStyles),n}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(n=>n.hostConnected?.())}enableUpdating(n){}disconnectedCallback(){this._$EO?.forEach(n=>n.hostDisconnected?.())}attributeChangedCallback(n,e,t){this._$AK(n,t)}_$ET(n,e){let t=this.constructor.elementProperties.get(n),i=this.constructor._$Eu(n,t);if(i!==void 0&&t.reflect===!0){let s=(t.converter?.toAttribute!==void 0?t.converter:Ym).toAttribute(e,t.type);this._$Em=n,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(n,e){let t=this.constructor,i=t._$Eh.get(n);if(i!==void 0&&this._$Em!==i){let s=t.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Ym;this._$Em=i;let d=l.fromAttribute(e,s.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(n,e,t,i=!1,s){if(n!==void 0){let l=this.constructor;if(i===!1&&(s=this[n]),t??=l.getPropertyOptions(n),!((t.hasChanged??sb)(s,e)||t.useDefault&&t.reflect&&s===this._$Ej?.get(n)&&!this.hasAttribute(l._$Eu(n,t))))return;this.C(n,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(n,e,{useDefault:t,reflect:i,wrapped:s},l){t&&!(this._$Ej??=new Map).has(n)&&(this._$Ej.set(n,l??e??this[n]),s!==!0||l!==void 0)||(this._$AL.has(n)||(this.hasUpdated||t||(e=void 0),this._$AL.set(n,e)),i===!0&&this._$Em!==n&&(this._$Eq??=new Set).add(n))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let n=this.scheduleUpdate();return n!=null&&await n,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,s]of t){let{wrapped:l}=s,d=this[i];l!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,s,d)}}let n=!1,e=this._$AL;try{n=this.shouldUpdate(e),n?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw n=!1,this._$EM(),t}n&&this._$AE(e)}willUpdate(n){}_$AE(n){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(n)),this.updated(n)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(n){return!0}update(n){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(n){}firstUpdated(n){}};Wt.elementStyles=[],Wt.shadowRootOptions={mode:"open"},Wt[rl("elementProperties")]=new Map,Wt[rl("finalized")]=new Map,Sw?.({ReactiveElement:Wt}),(Bd.reactiveElementVersions??=[]).push("2.1.2");var Jm=globalThis,ab=o=>o,Fd=Jm.trustedTypes,nb=Fd?Fd.createPolicy("lit-html",{createHTML:o=>o}):void 0,Zm="$lit$",Yt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qm="?"+Yt,Lw=`<${Qm}>`,br=document,al=()=>br.createComment(""),nl=o=>o===null||typeof o!="object"&&typeof o!="function",eu=Array.isArray,pb=o=>eu(o)||typeof o?.[Symbol.iterator]=="function",Xm=`[
2
2
  \f\r]`,sl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ob=/-->/g,lb=/>/g,gr=RegExp(`>|${Xm}(?:([^\\s"'>=/]+)(${Xm}*=${Xm}*(?:[^
3
3
  \f\r"'\`<>=]|("|')|))|$)`,"g"),cb=/'/g,db=/"/g,mb=/^(?:script|style|textarea|title)$/i,tu=o=>(n,...e)=>({_$litType$:o,strings:n,values:e}),c=tu(1),Xt=tu(2),B0=tu(3),Le=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),hb=new WeakMap,fr=br.createTreeWalker(br,129);function ub(o,n){if(!eu(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return nb!==void 0?nb.createHTML(n):n}var gb=(o,n)=>{let e=o.length-1,t=[],i,s=n===2?"<svg>":n===3?"<math>":"",l=sl;for(let d=0;d<e;d++){let p=o[d],u,b,f=-1,x=0;for(;x<p.length&&(l.lastIndex=x,b=l.exec(p),b!==null);)x=l.lastIndex,l===sl?b[1]==="!--"?l=ob:b[1]!==void 0?l=lb:b[2]!==void 0?(mb.test(b[2])&&(i=RegExp("</"+b[2],"g")),l=gr):b[3]!==void 0&&(l=gr):l===gr?b[0]===">"?(l=i??sl,f=-1):b[1]===void 0?f=-2:(f=l.lastIndex-b[2].length,u=b[1],l=b[3]===void 0?gr:b[3]==='"'?db:cb):l===db||l===cb?l=gr:l===ob||l===lb?l=sl:(l=gr,i=void 0);let y=l===gr&&o[d+1].startsWith("/>")?" ":"";s+=l===sl?p+Lw:f>=0?(t.push(u),p.slice(0,f)+Zm+p.slice(f)+Yt+y):p+Yt+(f===-2?d:y)}return[ub(o,s+(o[e]||"<?>")+(n===2?"</svg>":n===3?"</math>":"")),t]},ol=class o{constructor({strings:n,_$litType$:e},t){let i;this.parts=[];let s=0,l=0,d=n.length-1,p=this.parts,[u,b]=gb(n,e);if(this.el=o.createElement(u,t),fr.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=fr.nextNode())!==null&&p.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(Zm)){let x=b[l++],y=i.getAttribute(f).split(Yt),k=/([.?@])?(.*)/.exec(x);p.push({type:1,index:s,name:k[2],strings:y,ctor:k[1]==="."?jd:k[1]==="?"?Ud:k[1]==="@"?Kd:yr}),i.removeAttribute(f)}else f.startsWith(Yt)&&(p.push({type:6,index:s}),i.removeAttribute(f));if(mb.test(i.tagName)){let f=i.textContent.split(Yt),x=f.length-1;if(x>0){i.textContent=Fd?Fd.emptyScript:"";for(let y=0;y<x;y++)i.append(f[y],al()),fr.nextNode(),p.push({type:2,index:++s});i.append(f[x],al())}}}else if(i.nodeType===8)if(i.data===Qm)p.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(Yt,f+1))!==-1;)p.push({type:7,index:s}),f+=Yt.length-1}s++}}static createElement(n,e){let t=br.createElement("template");return t.innerHTML=n,t}};function vr(o,n,e=o,t){if(n===Le)return n;let i=t!==void 0?e._$Co?.[t]:e._$Cl,s=nl(n)?void 0:n._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(n=vr(o,i._$AS(o,n.values),i,t)),n}var Vd=class{constructor(n,e){this._$AV=[],this._$AN=void 0,this._$AD=n,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(n){let{el:{content:e},parts:t}=this._$AD,i=(n?.creationScope??br).importNode(e,!0);fr.currentNode=i;let s=fr.nextNode(),l=0,d=0,p=t[0];for(;p!==void 0;){if(l===p.index){let u;p.type===2?u=new Bs(s,s.nextSibling,this,n):p.type===1?u=new p.ctor(s,p.name,p.strings,this,n):p.type===6&&(u=new Gd(s,this,n)),this._$AV.push(u),p=t[++d]}l!==p?.index&&(s=fr.nextNode(),l++)}return fr.currentNode=br,i}p(n){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(n,t,e),e+=t.strings.length-2):t._$AI(n[e])),e++}},Bs=class o{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(n,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=n,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let n=this._$AA.parentNode,e=this._$AM;return e!==void 0&&n?.nodeType===11&&(n=e.parentNode),n}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(n,e=this){n=vr(this,n,e),nl(n)?n===h||n==null||n===""?(this._$AH!==h&&this._$AR(),this._$AH=h):n!==this._$AH&&n!==Le&&this._(n):n._$litType$!==void 0?this.$(n):n.nodeType!==void 0?this.T(n):pb(n)?this.k(n):this._(n)}O(n){return this._$AA.parentNode.insertBefore(n,this._$AB)}T(n){this._$AH!==n&&(this._$AR(),this._$AH=this.O(n))}_(n){this._$AH!==h&&nl(this._$AH)?this._$AA.nextSibling.data=n:this.T(br.createTextNode(n)),this._$AH=n}$(n){let{values:e,_$litType$:t}=n,i=typeof t=="number"?this._$AC(n):(t.el===void 0&&(t.el=ol.createElement(ub(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let s=new Vd(i,this),l=s.u(this.options);s.p(e),this.T(l),this._$AH=s}}_$AC(n){let e=hb.get(n.strings);return e===void 0&&hb.set(n.strings,e=new ol(n)),e}k(n){eu(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let s of n)i===e.length?e.push(t=new o(this.O(al()),this.O(al()),this,this.options)):t=e[i],t._$AI(s),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(n=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);n!==this._$AB;){let t=ab(n).nextSibling;ab(n).remove(),n=t}}setConnected(n){this._$AM===void 0&&(this._$Cv=n,this._$AP?.(n))}},yr=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(n,e,t,i,s){this.type=1,this._$AH=h,this._$AN=void 0,this.element=n,this.name=e,this._$AM=i,this.options=s,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(n,e=this,t,i){let s=this.strings,l=!1;if(s===void 0)n=vr(this,n,e,0),l=!nl(n)||n!==this._$AH&&n!==Le,l&&(this._$AH=n);else{let d=n,p,u;for(n=s[0],p=0;p<s.length-1;p++)u=vr(this,d[t+p],e,p),u===Le&&(u=this._$AH[p]),l||=!nl(u)||u!==this._$AH[p],u===h?n=h:n!==h&&(n+=(u??"")+s[p+1]),this._$AH[p]=u}l&&!i&&this.j(n)}j(n){n===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,n??"")}},jd=class extends yr{constructor(){super(...arguments),this.type=3}j(n){this.element[this.name]=n===h?void 0:n}},Ud=class extends yr{constructor(){super(...arguments),this.type=4}j(n){this.element.toggleAttribute(this.name,!!n&&n!==h)}},Kd=class extends yr{constructor(n,e,t,i,s){super(n,e,t,i,s),this.type=5}_$AI(n,e=this){if((n=vr(this,n,e,0)??h)===Le)return;let t=this._$AH,i=n===h&&t!==h||n.capture!==t.capture||n.once!==t.once||n.passive!==t.passive,s=n!==h&&(t===h||i);i&&this.element.removeEventListener(this.name,this,t),s&&this.element.addEventListener(this.name,this,n),this._$AH=n}handleEvent(n){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,n):this._$AH.handleEvent(n)}},Gd=class{constructor(n,e,t){this.element=n,this.type=6,this._$AN=void 0,this._$AM=e,this.options=t}get _$AU(){return this._$AM._$AU}_$AI(n){vr(this,n)}},fb={M:Zm,P:Yt,A:Qm,C:1,L:gb,R:Vd,D:pb,V:vr,I:Bs,H:yr,N:Ud,U:Kd,B:jd,F:Gd},Aw=Jm.litHtmlPolyfillSupport;Aw?.(ol,Bs),(Jm.litHtmlVersions??=[]).push("3.3.3");var bb=(o,n,e)=>{let t=e?.renderBefore??n,i=t._$litPart$;if(i===void 0){let s=e?.renderBefore??null;t._$litPart$=i=new Bs(n.insertBefore(al(),s),s,void 0,e??{})}return i._$AI(o),i};var iu=globalThis,L=class extends Wt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let n=super.createRenderRoot();return this.renderOptions.renderBefore??=n.firstChild,n}update(n){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(n),this._$Do=bb(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Le}};L._$litElement$=!0,L.finalized=!0,iu.litElementHydrateSupport?.({LitElement:L});var Dw=iu.litElementPolyfillSupport;Dw?.({LitElement:L});(iu.litElementVersions??=[]).push("4.2.2");var E=w`
4
4
  :host {
@@ -11,14 +11,14 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
11
11
  `,t$=w`
12
12
  outline: 2px solid var(--cm-border-strong);
13
13
  outline-offset: 2px;
14
- `,Rw=0,N=o=>`${o}-${++Rw}`;function $(o,n){customElements.get(o)||customElements.define(o,n)}function re(o,n){let e=o.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(n).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var Hw={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Wd={common:{...Hw}},ll={},cl={},Yd;function C(o,n){return Wd[o]={...Wd[o],...n},n}function Nw(){return Object.fromEntries(Object.entries(Wd).map(([o,n])=>[o,{...n}]))}function Xd(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function Pw(o,n){Xd(n?cl[n.toLowerCase()]??={}:ll,o),Qd()}function Iw(o={}){"locale"in o&&(Yd=o.locale||void 0),o.strings&&Xd(ll,o.strings);for(let[n,e]of Object.entries(o.translations??{}))Xd(cl[n.toLowerCase()]??={},e);Qd()}function qw(){Yd=void 0;for(let o of Object.keys(ll))delete ll[o];for(let o of Object.keys(cl))delete cl[o];Qd()}function dl(o){if(Yd)return Yd;let n=o;for(;n;){if(n instanceof Element&&n.hasAttribute("lang")&&n.getAttribute("lang"))return n.getAttribute("lang");n=n.parentNode??(n instanceof ShadowRoot?n.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var vb=new Map;function au(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,s=vb.get(i);if(!s){try{s=t(n)}catch{s=t(void 0)}vb.set(i,s)}return s}function nu(o,n={},e){return au("n",e,n,t=>new Intl.NumberFormat(t,n)).format(o)}function he(o,n={},e){return au("d",e,n,t=>new Intl.DateTimeFormat(t,n)).format(o)}function Jd(o,n){return au("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function yb(o,n={},e){if(o==null)return"";if(typeof o=="function")return String(o(n));let t;if(typeof o=="object"){let i=Number(n.count??0);t=o[Jd(i,e)]??o.other??""}else t=String(o);return t.replace(/\{(\w+)\}/g,(i,s)=>{let l=n[s];return l===void 0?i:typeof l=="number"?nu(l,{},e):String(l)})}function Ow(o,n,e,t){if(t&&t[n]!==void 0)return t[n];let i=[];if(e){let s=e.toLowerCase().split("-");for(let l=s.length;l>0;l--)i.push(s.slice(0,l).join("-"))}for(let s of o==="common"?["common"]:[o,"common"]){for(let d of i){let p=cl[d]?.[s]?.[n];if(p!==void 0)return p}let l=ll[s]?.[n]??Wd[s]?.[n];if(l!==void 0)return l}}function Zd(o,n,e,t,i){let s=dl(t);return yb(Ow(o,n,s,i),e,s)}var su=new Set,ru;function Qd(){for(let o of su)o.requestUpdate()}function Bw(){ru||typeof MutationObserver>"u"||typeof document>"u"||(ru=new MutationObserver(Qd),ru.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Fw=o=>o.replace(/^cm-/,"").replace(/-([a-z])/g,(n,e)=>e.toUpperCase()),_=class extends L{static finalize(){let n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!n(this,"finalized")&&n(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||n(this.prototype,e))continue;let s=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[s]??this.t(i)},set(l){this[s]=l},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Fw(this.localName)}t(n,e){return Zd(this.stringsNamespace,n,e,this,this.strings)}get locale(){return dl(this)}formatNumber(n,e){return nu(n,e,this.locale)}connectedCallback(){super.connectedCallback(),su.add(this),Bw()}disconnectedCallback(){super.disconnectedCallback(),su.delete(this)}};_.properties={strings:{type:Object}};var eh={"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",eyedropper:"M14 6l4 4M12.5 7.5l4 4M15.5 3.5a2.1 2.1 0 013 0l2 2a2.1 2.1 0 010 3L18 11l-5-5 2.5-2.5zM14 9.5L5.5 18v2h2L16 11.5",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"},xb=["more","drag"],a$=Object.keys(eh);var wb=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],Fs=class extends L{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=eh[this.name]??eh.more,t=xb.includes(this.name)?3:1.6;return Xt`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
14
+ `,Rw=0,N=o=>`${o}-${++Rw}`;function $(o,n){customElements.get(o)||customElements.define(o,n)}function re(o,n){let e=o.key;return(e==="ArrowLeft"||e==="ArrowRight")&&getComputedStyle(n).direction==="rtl"?e==="ArrowLeft"?"ArrowRight":"ArrowLeft":e}var Hw={close:"Close",dismiss:"Dismiss",loading:"Loading",ascending:"ascending",descending:"descending"},Wd={common:{...Hw}},ll={},cl={},Yd;function C(o,n){return Wd[o]={...Wd[o],...n},n}function Nw(){return Object.fromEntries(Object.entries(Wd).map(([o,n])=>[o,{...n}]))}function Xd(o,n){for(let[e,t]of Object.entries(n??{}))t&&typeof t=="object"&&(o[e]={...o[e],...t})}function Pw(o,n){Xd(n?cl[n.toLowerCase()]??={}:ll,o),Qd()}function Iw(o={}){"locale"in o&&(Yd=o.locale||void 0),o.strings&&Xd(ll,o.strings);for(let[n,e]of Object.entries(o.translations??{}))Xd(cl[n.toLowerCase()]??={},e);Qd()}function qw(){Yd=void 0;for(let o of Object.keys(ll))delete ll[o];for(let o of Object.keys(cl))delete cl[o];Qd()}function dl(o){if(Yd)return Yd;let n=o;for(;n;){if(n instanceof Element&&n.hasAttribute("lang")&&n.getAttribute("lang"))return n.getAttribute("lang");n=n.parentNode??(n instanceof ShadowRoot?n.host:null)}if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang}var vb=new Map;function au(o,n,e,t){let i=`${o}|${n??""}|${JSON.stringify(e)}`,s=vb.get(i);if(!s){try{s=t(n)}catch{s=t(void 0)}vb.set(i,s)}return s}function nu(o,n={},e){return au("n",e,n,t=>new Intl.NumberFormat(t,n)).format(o)}function he(o,n={},e){return au("d",e,n,t=>new Intl.DateTimeFormat(t,n)).format(o)}function Jd(o,n){return au("p",n,{},e=>new Intl.PluralRules(e)).select(o)}function yb(o,n={},e){if(o==null)return"";if(typeof o=="function")return String(o(n));let t;if(typeof o=="object"){let i=Number(n.count??0);t=o[Jd(i,e)]??o.other??""}else t=String(o);return t.replace(/\{(\w+)\}/g,(i,s)=>{let l=n[s];return l===void 0?i:typeof l=="number"?nu(l,{},e):String(l)})}function Ow(o,n,e,t){if(t&&t[n]!==void 0)return t[n];let i=[];if(e){let s=e.toLowerCase().split("-");for(let l=s.length;l>0;l--)i.push(s.slice(0,l).join("-"))}for(let s of o==="common"?["common"]:[o,"common"]){for(let d of i){let p=cl[d]?.[s]?.[n];if(p!==void 0)return p}let l=ll[s]?.[n]??Wd[s]?.[n];if(l!==void 0)return l}}function Zd(o,n,e,t,i){let s=dl(t);return yb(Ow(o,n,s,i),e,s)}var su=new Set,ru;function Qd(){for(let o of su)o.requestUpdate()}function Bw(){ru||typeof MutationObserver>"u"||typeof document>"u"||(ru=new MutationObserver(Qd),ru.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}))}var Fw=o=>o.replace(/^cm-/,"").replace(/-([a-z])/g,(n,e)=>e.toUpperCase()),T=class extends L{static finalize(){let n=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);if(!n(this,"finalized")&&n(this,"properties"))for(let[e,t]of Object.entries(this.properties)){let i=t.string;if(!i||n(this.prototype,e))continue;let s=Symbol(e);Object.defineProperty(this.prototype,e,{get(){return this[s]??this.t(i)},set(l){this[s]=l},configurable:!0,enumerable:!0})}super.finalize()}get stringsNamespace(){return Fw(this.localName)}t(n,e){return Zd(this.stringsNamespace,n,e,this,this.strings)}get locale(){return dl(this)}formatNumber(n,e){return nu(n,e,this.locale)}connectedCallback(){super.connectedCallback(),su.add(this),Bw()}disconnectedCallback(){super.disconnectedCallback(),su.delete(this)}};T.properties={strings:{type:Object}};var eh={"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",eyedropper:"M14 6l4 4M12.5 7.5l4 4M15.5 3.5a2.1 2.1 0 013 0l2 2a2.1 2.1 0 010 3L18 11l-5-5 2.5-2.5zM14 9.5L5.5 18v2h2L16 11.5",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"},xb=["more","drag"],a$=Object.keys(eh);var wb=["chevron-left","chevron-right","arrow-left","arrow-up-right","send","log-out"],Fs=class extends L{constructor(){super(...arguments);this.name="more";this.size=18;this.label="";this.mirror="auto"}render(){let e=eh[this.name]??eh.more,t=xb.includes(this.name)?3:1.6;return Xt`<svg width=${this.size} height=${this.size} viewBox="0 0 24 24" fill="none" stroke="currentColor"
15
15
  stroke-width=${t} stroke-linecap="round" stroke-linejoin="round"
16
16
  role=${this.label?"img":h} aria-label=${this.label||h} aria-hidden=${this.label?h:"true"}
17
17
  part="svg" class=${(this.mirror==="auto"?wb.includes(this.name):this.mirror==="always")?"flip":""}><path d=${e}></path></svg>`}};Fs.properties={name:{reflect:!0},size:{type:Number},label:{},mirror:{}},Fs.styles=w`
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
- `;$("cm-icon",Fs);var $b=99,u$=C("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),th,ih,hl,xr=class extends _{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;m(this,th,this.attachInternals());m(this,ih,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,th).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});m(this,hl,!1);this.addEventListener("click",r(this,ih),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,hl)&&(g(this,hl,!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.loading?c`<span class="spinner" aria-hidden="true"></span>`:c`<slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:h}</slot>`,i=this.iconOnly?c`<span class="vh"><slot></slot></span>`:c`<span class="text"><slot></slot></span>`,s=e?c`<span class="count" part="count" aria-hidden="true">${e>$b?this.t("countOverflow",{max:$b}):this.formatNumber(e)}</span>${this.iconOnly?h:c`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:h,l=this.iconOnly&&(this.label||this.textContent?.trim())||"",d=!this.iconOnly||!l?h:e?this.t("labelWithCount",{label:l,count:e}):this.label||h,p=c`${t}${i}${s}`;return this.href&&!this.disabled?c`<a class="btn" part="control" href=${this.href} target=${this.target??h}
21
+ `;$("cm-icon",Fs);var $b=99,u$=C("button",{labelWithCount:"{label}, {count} unread",count:"{count} unread",countOverflow:"{max}+"}),th,ih,hl,xr=class extends T{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;m(this,th,this.attachInternals());m(this,ih,e=>{if(this.disabled||this.loading){e.preventDefault(),e.stopImmediatePropagation();return}let t=r(this,th).form;!t||this.href||(this.type==="submit"?t.requestSubmit():this.type==="reset"&&t.reset())});m(this,hl,!1);this.addEventListener("click",r(this,ih),{capture:!0})}updated(){this.iconOnly&&!this.label&&!this.textContent?.trim()&&!this.querySelector("[label]")&&!r(this,hl)&&(g(this,hl,!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.loading?c`<span class="spinner" aria-hidden="true"></span>`:c`<slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:h}</slot>`,i=this.iconOnly?c`<span class="vh"><slot></slot></span>`:c`<span class="text"><slot></slot></span>`,s=e?c`<span class="count" part="count" aria-hidden="true">${e>$b?this.t("countOverflow",{max:$b}):this.formatNumber(e)}</span>${this.iconOnly?h:c`<span class="vh"> ${this.t("count",{count:e})}</span>`}`:h,l=this.iconOnly&&(this.label||this.textContent?.trim())||"",d=!this.iconOnly||!l?h:e?this.t("labelWithCount",{label:l,count:e}):this.label||h,p=c`${t}${i}${s}`;return this.href&&!this.disabled?c`<a class="btn" part="control" href=${this.href} target=${this.target??h}
22
22
  rel=${this.target==="_blank"?"noopener noreferrer":h} aria-label=${d}>${p}</a>`:c`<button class="btn" part="control" type="button"
23
23
  ?disabled=${this.disabled} aria-disabled=${this.loading?"true":h}
24
24
  aria-busy=${this.loading?"true":h} aria-label=${d}>${p}</button>`}};th=new WeakMap,ih=new WeakMap,hl=new WeakMap,xr.formAssociated=!0,xr.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}},xr.styles=[E,w`
@@ -108,7 +108,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
108
108
  }
109
109
  `];$("cm-button",xr);var Vs=class extends L{constructor(){super(...arguments);this.value="";this.icon="";this.href="";this.disabled=!1;this.critical=!1;this.heading=!1;this.shortcut=""}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,heading:this.heading||void 0,shortcut:this.shortcut||void 0}}};Vs.properties={value:{reflect:!0},icon:{reflect:!0},href:{reflect:!0},disabled:{type:Boolean,reflect:!0},critical:{type:Boolean,reflect:!0},heading:{type:Boolean,reflect:!0},shortcut:{reflect:!0}},Vs.styles=w`:host { display: none; }`;$("cm-menu-item",Vs);function pl(o){let n=[];for(let e of Array.from(o.children))if(e.localName==="cm-menu-item"){let t=(e.textContent??"").trim(),i=s=>e.getAttribute(s)||void 0;n.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,heading:e.hasAttribute("heading")||void 0,shortcut:i("shortcut")})}else e.localName==="hr"&&n.push({divider:!0});return n}function rh(o,n){let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),e}var Ae=w`
110
110
  :where([popover]) { margin: 0; padding: 0; border: 0; color: inherit; background: none; overflow: visible; }
111
- `,ml=8,kt,js,Us,Ks,wr,fe=class{constructor(){m(this,kt,null);m(this,js,null);m(this,Us,{});m(this,Ks,"");m(this,wr,()=>this.place())}get active(){return!!r(this,kt)}open(n,e,t={}){if(!n||!e||typeof n.showPopover!="function")return!1;r(this,kt)&&r(this,kt)!==n&&this.close(),n.hasAttribute("popover")||n.setAttribute("popover","manual");let i=n.matches(":popover-open");if(!i){if(getComputedStyle(n).position==="static")return n.removeAttribute("popover"),!1;try{n.showPopover()}catch{return!1}}return n.matches(":popover-open")?(r(this,kt)||g(this,Ks,n.style.maxHeight),g(this,kt,n),g(this,js,e),g(this,Us,t),Object.assign(n.style,{position:"fixed",inset:"auto",margin:"0"}),this.place(),i||(window.addEventListener("scroll",r(this,wr),!0),window.addEventListener("resize",r(this,wr))),!0):!1}place(){let n=r(this,kt),e=r(this,js);if(!n||!e)return;let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=r(this,Us).gap??4,d=r(this,Us).align??"start";n.style.maxHeight=r(this,Ks),d==="stretch"&&(n.style.minWidth=`${Math.round(t.width)}px`);let p=n.getBoundingClientRect(),u=p.width,b=p.height,f=getComputedStyle(e).direction==="rtl",x=f?t.right-u:t.left,y=f?t.left:t.right-u,k=d==="end"?y:x;k+u>i-ml&&(k=f?x:y);let S=Math.max(0,Math.min(ml,t.left)),H=Math.min(i,Math.max(i-ml,t.right))-u;k=Math.max(S,Math.min(k,H));let O=s-t.bottom-l-ml,V=t.top-l-ml,G;if(b<=O||O>=V)G=t.bottom+l,b>O&&(n.style.maxHeight=`${Math.max(80,Math.floor(O))}px`);else{let Ue=Math.min(b,Math.floor(V));b>V&&(n.style.maxHeight=`${Math.max(80,Ue)}px`),G=t.top-l-Ue}n.style.left=`${k}px`,n.style.top=`${G}px`}close(){let n=r(this,kt);if(window.removeEventListener("scroll",r(this,wr),!0),window.removeEventListener("resize",r(this,wr)),g(this,kt,null),g(this,js,null),!!n){try{n.matches(":popover-open")&&n.hidePopover()}catch{}for(let e of["position","inset","margin","left","top","minWidth"])n.style[e]="";n.style.maxHeight=r(this,Ks)}}};kt=new WeakMap,js=new WeakMap,Us=new WeakMap,Ks=new WeakMap,wr=new WeakMap;var Gs=class extends _{constructor(){super(...arguments);this.size="large";this.custom=!1}onSlotChange(e){let t=e.target.assignedElements().length>0;t!==this.custom&&(this.custom=t,this.requestUpdate())}render(){let e=this.size==="small"?2.5:3;return c`<span class="spinner" part="spinner" role="status">
111
+ `,ml=8,kt,js,Us,Ks,wr,fe=class{constructor(){m(this,kt,null);m(this,js,null);m(this,Us,{});m(this,Ks,"");m(this,wr,()=>this.place())}get active(){return!!r(this,kt)}open(n,e,t={}){if(!n||!e||typeof n.showPopover!="function")return!1;r(this,kt)&&r(this,kt)!==n&&this.close(),n.hasAttribute("popover")||n.setAttribute("popover","manual");let i=n.matches(":popover-open");if(!i){if(getComputedStyle(n).position==="static")return n.removeAttribute("popover"),!1;try{n.showPopover()}catch{return!1}}return n.matches(":popover-open")?(r(this,kt)||g(this,Ks,n.style.maxHeight),g(this,kt,n),g(this,js,e),g(this,Us,t),Object.assign(n.style,{position:"fixed",inset:"auto",margin:"0"}),this.place(),i||(window.addEventListener("scroll",r(this,wr),!0),window.addEventListener("resize",r(this,wr))),!0):!1}place(){let n=r(this,kt),e=r(this,js);if(!n||!e)return;let t=e.getBoundingClientRect(),i=document.documentElement.clientWidth,s=document.documentElement.clientHeight,l=r(this,Us).gap??4,d=r(this,Us).align??"start";n.style.maxHeight=r(this,Ks),d==="stretch"&&(n.style.minWidth=`${Math.round(t.width)}px`);let p=n.getBoundingClientRect(),u=p.width,b=p.height,f=getComputedStyle(e).direction==="rtl",x=f?t.right-u:t.left,y=f?t.left:t.right-u,k=d==="end"?y:x;k+u>i-ml&&(k=f?x:y);let S=Math.max(0,Math.min(ml,t.left)),H=Math.min(i,Math.max(i-ml,t.right))-u;k=Math.max(S,Math.min(k,H));let O=s-t.bottom-l-ml,V=t.top-l-ml,G;if(b<=O||O>=V)G=t.bottom+l,b>O&&(n.style.maxHeight=`${Math.max(80,Math.floor(O))}px`);else{let Ue=Math.min(b,Math.floor(V));b>V&&(n.style.maxHeight=`${Math.max(80,Ue)}px`),G=t.top-l-Ue}n.style.left=`${k}px`,n.style.top=`${G}px`}close(){let n=r(this,kt);if(window.removeEventListener("scroll",r(this,wr),!0),window.removeEventListener("resize",r(this,wr)),g(this,kt,null),g(this,js,null),!!n){try{n.matches(":popover-open")&&n.hidePopover()}catch{}for(let e of["position","inset","margin","left","top","minWidth"])n.style[e]="";n.style.maxHeight=r(this,Ks)}}};kt=new WeakMap,js=new WeakMap,Us=new WeakMap,Ks=new WeakMap,wr=new WeakMap;var Gs=class extends T{constructor(){super(...arguments);this.size="large";this.custom=!1}onSlotChange(e){let t=e.target.assignedElements().length>0;t!==this.custom&&(this.custom=t,this.requestUpdate())}render(){let e=this.size==="small"?2.5:3;return c`<span class="spinner" part="spinner" role="status">
112
112
  ${this.custom?h:c`<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
113
113
  <circle class="track" cx="12" cy="12" r="10" fill="none" stroke-width=${e}></circle>
114
114
  <path class="arc" d="M12 2a10 10 0 0 1 10 10" fill="none" stroke-width=${e} stroke-linecap="round"></path>
@@ -133,7 +133,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
133
133
  svg { animation-duration: 2.4s; }
134
134
  .spinner { --cm-spinner-play-state: paused; }
135
135
  }
136
- `];$("cm-spinner",Gs);var A$=C("actionMenu",{label:"Actions"}),ul,$r,kr,gl,Y,sh,fl,ah,nh,oh,lh,kb,Ys,Xs,Js,Ws,ch,Eb,ou,Mb,Ht=class extends _{constructor(){super(...arguments);m(this,Y);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this.loading=!1;this.disabled=!1;this._slotted=[];this._active=-1;this._custom=!1;m(this,ul);m(this,$r,N("cm-menu"));m(this,kr,"");m(this,gl,0);m(this,fl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,Y,oh).call(this,!1)});m(this,Ys,new fe);m(this,Xs,e=>{this.disabled||(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)))});m(this,Js,()=>{this.disabled||(this.open?this.hide():this.show())});m(this,ch,e=>{let t=a(this,Y,nh).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,Y,Ws).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,Y,Ws).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,Y,Ws).call(this,t[0]);break;case"End":e.preventDefault(),a(this,Y,Ws).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 s=Date.now();g(this,kr,(s-r(this,gl)<600?r(this,kr):"")+e.key.toLowerCase()),g(this,gl,s);let l=this.menuItems,d=r(this,kr).length>1?i:i+1,u=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(b=>(l[b].label??"").toLowerCase().startsWith(r(this,kr)));u!==void 0&&a(this,Y,Ws).call(this,u)}}})}connectedCallback(){super.connectedCallback(),a(this,Y,sh).call(this),g(this,ul,rh(this,()=>a(this,Y,sh).call(this))),document.addEventListener("pointerdown",r(this,fl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,ul)?.disconnect(),document.removeEventListener("pointerdown",r(this,fl),!0),r(this,Ys).close()}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,Y,nh).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,Y,oh).call(this,!0),this.updateComplete.then(()=>a(this,Y,lh).call(this))}hide(e=!1){a(this,Y,oh).call(this,!1),e&&a(this,Y,ah).call(this)?.focus()}updated(e){if(e.has("open")&&this.open&&a(this,Y,kb).call(this),e.has("open")&&!this.open&&r(this,Ys).close(),this._custom){let t=a(this,Y,ah).call(this);if(t){let i=(s,l)=>{t.getAttribute(s)!==l&&t.setAttribute(s,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${r(this,$r)}-m`)}}if((e.has("open")||e.has("loading"))&&this.open&&this._active<0){let t=a(this,Y,nh).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,Y,lh).call(this))}}triggerTemplate(e,t){}headTemplate(){}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${r(this,Js)} @keydown=${r(this,Xs)} @slotchange=${()=>a(this,Y,sh).call(this)}></slot>`:this.triggerTemplate(r(this,Js),r(this,Xs))??c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
136
+ `];$("cm-spinner",Gs);var A$=C("actionMenu",{label:"Actions"}),ul,$r,kr,gl,Y,sh,fl,ah,nh,oh,lh,kb,Ys,Xs,Js,Ws,ch,Eb,ou,Mb,Ht=class extends T{constructor(){super(...arguments);m(this,Y);this.items=[];this.open=!1;this.triggerLabel="";this.iconOnly=!1;this.icon="more";this.align="start";this.heading="";this.subheading="";this.loading=!1;this.disabled=!1;this._slotted=[];this._active=-1;this._custom=!1;m(this,ul);m(this,$r,N("cm-menu"));m(this,kr,"");m(this,gl,0);m(this,fl,e=>{this.open&&!e.composedPath().includes(this)&&a(this,Y,oh).call(this,!1)});m(this,Ys,new fe);m(this,Xs,e=>{this.disabled||(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)))});m(this,Js,()=>{this.disabled||(this.open?this.hide():this.show())});m(this,ch,e=>{let t=a(this,Y,nh).call(this),i=t.indexOf(this._active);switch(e.key){case"ArrowDown":e.preventDefault(),a(this,Y,Ws).call(this,t[(i+1)%t.length]);break;case"ArrowUp":e.preventDefault(),a(this,Y,Ws).call(this,t[(i-1+t.length)%t.length]);break;case"Home":e.preventDefault(),a(this,Y,Ws).call(this,t[0]);break;case"End":e.preventDefault(),a(this,Y,Ws).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 s=Date.now();g(this,kr,(s-r(this,gl)<600?r(this,kr):"")+e.key.toLowerCase()),g(this,gl,s);let l=this.menuItems,d=r(this,kr).length>1?i:i+1,u=[...t.slice(Math.max(d,0)),...t.slice(0,Math.max(d,0))].find(b=>(l[b].label??"").toLowerCase().startsWith(r(this,kr)));u!==void 0&&a(this,Y,Ws).call(this,u)}}})}connectedCallback(){super.connectedCallback(),a(this,Y,sh).call(this),g(this,ul,rh(this,()=>a(this,Y,sh).call(this))),document.addEventListener("pointerdown",r(this,fl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,ul)?.disconnect(),document.removeEventListener("pointerdown",r(this,fl),!0),r(this,Ys).close()}get menuItems(){return this.items.length?this.items:this._slotted}show(e="first"){let t=a(this,Y,nh).call(this);this._active=e==="first"?t[0]??-1:t[t.length-1]??-1,a(this,Y,oh).call(this,!0),this.updateComplete.then(()=>a(this,Y,lh).call(this))}hide(e=!1){a(this,Y,oh).call(this,!1),e&&a(this,Y,ah).call(this)?.focus()}updated(e){if(e.has("open")&&this.open&&a(this,Y,kb).call(this),e.has("open")&&!this.open&&r(this,Ys).close(),this._custom){let t=a(this,Y,ah).call(this);if(t){let i=(s,l)=>{t.getAttribute(s)!==l&&t.setAttribute(s,l)};i("aria-haspopup","menu"),i("aria-expanded",String(this.open)),i("aria-controls",`${r(this,$r)}-m`)}}if((e.has("open")||e.has("loading"))&&this.open&&this._active<0){let t=a(this,Y,nh).call(this);this._active=t[0]??-1,this.updateComplete.then(()=>a(this,Y,lh).call(this))}}triggerTemplate(e,t){}headTemplate(){}render(){let e=this.menuItems,t=this.triggerLabel||this.label,i=this._custom?c`<slot name="trigger" @click=${r(this,Js)} @keydown=${r(this,Xs)} @slotchange=${()=>a(this,Y,sh).call(this)}></slot>`:this.triggerTemplate(r(this,Js),r(this,Xs))??c`<button type="button" class="trigger ${this.iconOnly?"icon":""}" part="trigger" aria-haspopup="menu"
137
137
  aria-expanded=${String(this.open)} aria-controls="${r(this,$r)}-m" aria-label=${this.iconOnly?t:h}
138
138
  ?disabled=${this.disabled} @click=${r(this,Js)} @keydown=${r(this,Xs)}>${this.iconOnly?c`<cm-icon name=${this.icon} size="18"></cm-icon>`:c`<span>${t}</span><cm-icon name="chevron-down" size="14"></cm-icon>`}</button>`;return c`${i}
139
139
  <div class="pop" part="menu" popover="manual" ?hidden=${!this.open}>
@@ -207,12 +207,12 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
207
207
  }
208
208
  .loading { display: flex; align-items: center; gap: var(--cm-space-8); min-height: var(--cm-control-height-md, 36px); padding: var(--cm-space-4) var(--cm-space-12); font-size: var(--cm-font-size-14); color: var(--cm-text-tertiary); }
209
209
  [role='separator'] { height: 0; margin: 4px 0; border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
210
- `];$("cm-action-menu",Ht);var I$=C("buttonGroup",{more:"More"}),Ci="data-cm-overflow",Vw=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],zi,Er,Jt,Nt,Si,Mr,X,Zs,Tb,bl,lu,dh,hh,_b,ph,cu,du,hu,Qs=class extends _{constructor(){super(...arguments);m(this,X);this.overflow="wrap";this.align="start";this.label="";this._items=[];this._size="medium";m(this,zi,[]);m(this,Er);m(this,Jt);m(this,Nt,0);m(this,Si,new Set);m(this,Mr,!1);m(this,ph,e=>{e.stopPropagation();let t=r(this,zi)[Number(e.detail.value)];if(!t)return;g(this,Mr,!0),(t.shadowRoot?.querySelector('[part="control"]')??t).click(),requestAnimationFrame(()=>requestAnimationFrame(()=>a(this,X,cu).call(this)))})}get overflowing(){return[...r(this,zi)]}connectedCallback(){super.connectedCallback(),g(this,Er,new MutationObserver(e=>a(this,X,Tb).call(this,e))),r(this,Er).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Vw}),typeof ResizeObserver<"u"&&(g(this,Jt,new ResizeObserver(()=>a(this,X,Zs).call(this))),r(this,Jt).observe(this),g(this,Si,new Set([this]))),document.fonts?.ready.then(()=>a(this,X,Zs).call(this)),a(this,X,Zs).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Er)?.disconnect(),r(this,Jt)?.disconnect(),r(this,Si).clear(),cancelAnimationFrame(r(this,Nt)),g(this,Nt,0),a(this,X,lu).call(this,a(this,X,bl).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&a(this,X,Zs).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,Nt)),g(this,Nt,0),a(this,X,hh).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
210
+ `];$("cm-action-menu",Ht);var I$=C("buttonGroup",{more:"More"}),Ci="data-cm-overflow",Vw=["disabled","loading","tone","icon","label","variant","size","icon-only","count","href","hidden","data-priority"],zi,Er,Jt,Nt,Si,Mr,X,Zs,_b,bl,lu,dh,hh,Tb,ph,cu,du,hu,Qs=class extends T{constructor(){super(...arguments);m(this,X);this.overflow="wrap";this.align="start";this.label="";this._items=[];this._size="medium";m(this,zi,[]);m(this,Er);m(this,Jt);m(this,Nt,0);m(this,Si,new Set);m(this,Mr,!1);m(this,ph,e=>{e.stopPropagation();let t=r(this,zi)[Number(e.detail.value)];if(!t)return;g(this,Mr,!0),(t.shadowRoot?.querySelector('[part="control"]')??t).click(),requestAnimationFrame(()=>requestAnimationFrame(()=>a(this,X,cu).call(this)))})}get overflowing(){return[...r(this,zi)]}connectedCallback(){super.connectedCallback(),g(this,Er,new MutationObserver(e=>a(this,X,_b).call(this,e))),r(this,Er).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:Vw}),typeof ResizeObserver<"u"&&(g(this,Jt,new ResizeObserver(()=>a(this,X,Zs).call(this))),r(this,Jt).observe(this),g(this,Si,new Set([this]))),document.fonts?.ready.then(()=>a(this,X,Zs).call(this)),a(this,X,Zs).call(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,Er)?.disconnect(),r(this,Jt)?.disconnect(),r(this,Si).clear(),cancelAnimationFrame(r(this,Nt)),g(this,Nt,0),a(this,X,lu).call(this,a(this,X,bl).call(this))}updated(e){(e.has("overflow")||e.has("moreLabel")||e.has("moreIcon")||e.has("size"))&&a(this,X,Zs).call(this)}firstUpdated(){this.updateComplete.then(()=>this.relayout())}relayout(){cancelAnimationFrame(r(this,Nt)),g(this,Nt,0),a(this,X,hh).call(this)}render(){let e=this.moreIcon!=null;return c`<div class="row" part="row" role="group" aria-label=${this.label||h}>
211
211
  <slot></slot>
212
212
  <cm-action-menu class="more ${this._size}${e?" icon":""}" part="more" hidden align="end"
213
213
  .items=${this._items} label=${this.moreLabel} ?icon-only=${e} icon=${this.moreIcon||"more"}
214
214
  @cm-select=${r(this,ph)}></cm-action-menu>
215
- </div>`}};zi=new WeakMap,Er=new WeakMap,Jt=new WeakMap,Nt=new WeakMap,Si=new WeakMap,Mr=new WeakMap,X=new WeakSet,Zs=function(){r(this,Nt)||!this.isConnected||g(this,Nt,requestAnimationFrame(()=>{g(this,Nt,0);let e=a(this,X,bl).call(this).map(t=>t.updateComplete).filter(Boolean);e.length?Promise.all(e).then(()=>a(this,X,hh).call(this)):a(this,X,hh).call(this)}))},Tb=function(e){for(let t of e)for(let i of Array.from(t.removedNodes))i instanceof HTMLElement&&i.hasAttribute(Ci)&&i.parentElement!==this&&(i.removeAttribute(Ci),i.hidden=!1);a(this,X,Zs).call(this)},bl=function(){return Array.from(this.children).filter(e=>e.localName==="cm-button"&&(!e.hidden||e.hasAttribute(Ci)))},lu=function(e){for(let t of e)t.hasAttribute(Ci)&&(t.removeAttribute(Ci),t.hidden=!1)},dh=function(){return this.renderRoot.querySelector(".more")},hh=function(){let e=this.renderRoot.querySelector(".row"),t=a(this,X,dh).call(this);if(!e||!t||!this.isConnected)return;let i=a(this,X,bl).call(this),s=this.shadowRoot.activeElement===t?t:i.find(b=>b.matches(":focus-within"))??null,l=i[0]?.getAttribute("size");this._size=this.size||(l==="slim"||l==="large"?l:"medium");let d=new Set;if(r(this,Jt)){let b=new Set([this,t,...i]);for(let f of r(this,Si))b.has(f)||r(this,Jt).unobserve(f);for(let f of b)r(this,Si).has(f)||r(this,Jt).observe(f);g(this,Si,b)}if(this.overflow==="menu"){a(this,X,lu).call(this,i),t.hidden=!1;let b=e.clientWidth,f=parseFloat(getComputedStyle(e).columnGap)||0,x=Array.from(this.children).filter(S=>!S.hidden),y=new Map(x.map(S=>[S,S.getBoundingClientRect().width])),k=x.reduce((S,H)=>S+y.get(H),0)+f*Math.max(x.length-1,0);if(k>b+.5){let S=V=>{let G=V.dataset.priority;return G==="low"?0:G==="high"?2:V.getAttribute("variant")==="primary"?3:1},H=i.map((V,G)=>({b:V,i:G,r:S(V)})).sort((V,G)=>V.r-G.r||G.i-V.i),O=k+f+t.getBoundingClientRect().width;for(let{b:V}of H){if(O<=b+.5)break;d.add(V),O-=y.get(V)+f}}}for(let b of i)d.has(b)?(b.setAttribute(Ci,""),b.hidden=!0):b.hasAttribute(Ci)&&(b.removeAttribute(Ci),b.hidden=!1);t.hidden=d.size===0,s===t&&t.hidden?a(this,X,hu).call(this):s&&s!==t&&d.has(s)&&a(this,X,du).call(this),d.size===0&&t.open&&t.hide(),r(this,Er)?.takeRecords();let p=i.filter(b=>d.has(b));this._items=p.map((b,f)=>a(this,X,_b).call(this,b,f));let u=p.length!==r(this,zi).length||p.some((b,f)=>b!==r(this,zi)[f]);g(this,zi,p),u&&this.dispatchEvent(new CustomEvent("cm-overflow-change",{detail:{hidden:[...p]},bubbles:!0,composed:!0})),r(this,Mr)&&this.updateComplete.then(()=>a(this,X,cu).call(this))},_b=function(e,t){let i=Array.from(e.childNodes).filter(d=>!(d instanceof Element&&d.hasAttribute("slot"))).map(d=>d.textContent??"").join("").replace(/\s+/g," ").trim(),s=e.hasAttribute("icon-only")?e.getAttribute("label")||i:i||e.getAttribute("label")||"",l=e.getAttribute("icon")||e.querySelector(':scope > [slot="icon"]')?.getAttribute("name")||void 0;return{label:s,value:String(t),icon:l,disabled:e.hasAttribute("disabled")||e.hasAttribute("loading")||void 0,critical:e.getAttribute("tone")==="critical"||void 0}},ph=new WeakMap,cu=function(){if(!r(this,Mr))return;g(this,Mr,!1);let e=document.activeElement,t=a(this,X,dh).call(this);(!e||e===document.body||e===document.documentElement||e===this&&(!t||t.hidden||this.shadowRoot.activeElement!==t))&&(t&&!t.hidden?a(this,X,du).call(this):a(this,X,hu).call(this))},du=function(){a(this,X,dh).call(this)?.shadowRoot?.querySelector('[part="trigger"]')?.focus()},hu=function(){let e=a(this,X,bl).call(this).filter(i=>!i.hidden&&!i.hasAttribute("disabled")),t=e[e.length-1];(t?.shadowRoot?.querySelector('[part="control"]')??t)?.focus()},Qs.properties={overflow:{reflect:!0},moreLabel:{attribute:"more-label",string:"more"},moreIcon:{attribute:"more-icon"},size:{reflect:!0},align:{reflect:!0},label:{},_items:{state:!0},_size:{state:!0}},Qs.styles=[E,w`
215
+ </div>`}};zi=new WeakMap,Er=new WeakMap,Jt=new WeakMap,Nt=new WeakMap,Si=new WeakMap,Mr=new WeakMap,X=new WeakSet,Zs=function(){r(this,Nt)||!this.isConnected||g(this,Nt,requestAnimationFrame(()=>{g(this,Nt,0);let e=a(this,X,bl).call(this).map(t=>t.updateComplete).filter(Boolean);e.length?Promise.all(e).then(()=>a(this,X,hh).call(this)):a(this,X,hh).call(this)}))},_b=function(e){for(let t of e)for(let i of Array.from(t.removedNodes))i instanceof HTMLElement&&i.hasAttribute(Ci)&&i.parentElement!==this&&(i.removeAttribute(Ci),i.hidden=!1);a(this,X,Zs).call(this)},bl=function(){return Array.from(this.children).filter(e=>e.localName==="cm-button"&&(!e.hidden||e.hasAttribute(Ci)))},lu=function(e){for(let t of e)t.hasAttribute(Ci)&&(t.removeAttribute(Ci),t.hidden=!1)},dh=function(){return this.renderRoot.querySelector(".more")},hh=function(){let e=this.renderRoot.querySelector(".row"),t=a(this,X,dh).call(this);if(!e||!t||!this.isConnected)return;let i=a(this,X,bl).call(this),s=this.shadowRoot.activeElement===t?t:i.find(b=>b.matches(":focus-within"))??null,l=i[0]?.getAttribute("size");this._size=this.size||(l==="slim"||l==="large"?l:"medium");let d=new Set;if(r(this,Jt)){let b=new Set([this,t,...i]);for(let f of r(this,Si))b.has(f)||r(this,Jt).unobserve(f);for(let f of b)r(this,Si).has(f)||r(this,Jt).observe(f);g(this,Si,b)}if(this.overflow==="menu"){a(this,X,lu).call(this,i),t.hidden=!1;let b=e.clientWidth,f=parseFloat(getComputedStyle(e).columnGap)||0,x=Array.from(this.children).filter(S=>!S.hidden),y=new Map(x.map(S=>[S,S.getBoundingClientRect().width])),k=x.reduce((S,H)=>S+y.get(H),0)+f*Math.max(x.length-1,0);if(k>b+.5){let S=V=>{let G=V.dataset.priority;return G==="low"?0:G==="high"?2:V.getAttribute("variant")==="primary"?3:1},H=i.map((V,G)=>({b:V,i:G,r:S(V)})).sort((V,G)=>V.r-G.r||G.i-V.i),O=k+f+t.getBoundingClientRect().width;for(let{b:V}of H){if(O<=b+.5)break;d.add(V),O-=y.get(V)+f}}}for(let b of i)d.has(b)?(b.setAttribute(Ci,""),b.hidden=!0):b.hasAttribute(Ci)&&(b.removeAttribute(Ci),b.hidden=!1);t.hidden=d.size===0,s===t&&t.hidden?a(this,X,hu).call(this):s&&s!==t&&d.has(s)&&a(this,X,du).call(this),d.size===0&&t.open&&t.hide(),r(this,Er)?.takeRecords();let p=i.filter(b=>d.has(b));this._items=p.map((b,f)=>a(this,X,Tb).call(this,b,f));let u=p.length!==r(this,zi).length||p.some((b,f)=>b!==r(this,zi)[f]);g(this,zi,p),u&&this.dispatchEvent(new CustomEvent("cm-overflow-change",{detail:{hidden:[...p]},bubbles:!0,composed:!0})),r(this,Mr)&&this.updateComplete.then(()=>a(this,X,cu).call(this))},Tb=function(e,t){let i=Array.from(e.childNodes).filter(d=>!(d instanceof Element&&d.hasAttribute("slot"))).map(d=>d.textContent??"").join("").replace(/\s+/g," ").trim(),s=e.hasAttribute("icon-only")?e.getAttribute("label")||i:i||e.getAttribute("label")||"",l=e.getAttribute("icon")||e.querySelector(':scope > [slot="icon"]')?.getAttribute("name")||void 0;return{label:s,value:String(t),icon:l,disabled:e.hasAttribute("disabled")||e.hasAttribute("loading")||void 0,critical:e.getAttribute("tone")==="critical"||void 0}},ph=new WeakMap,cu=function(){if(!r(this,Mr))return;g(this,Mr,!1);let e=document.activeElement,t=a(this,X,dh).call(this);(!e||e===document.body||e===document.documentElement||e===this&&(!t||t.hidden||this.shadowRoot.activeElement!==t))&&(t&&!t.hidden?a(this,X,du).call(this):a(this,X,hu).call(this))},du=function(){a(this,X,dh).call(this)?.shadowRoot?.querySelector('[part="trigger"]')?.focus()},hu=function(){let e=a(this,X,bl).call(this).filter(i=>!i.hidden&&!i.hasAttribute("disabled")),t=e[e.length-1];(t?.shadowRoot?.querySelector('[part="control"]')??t)?.focus()},Qs.properties={overflow:{reflect:!0},moreLabel:{attribute:"more-label",string:"more"},moreIcon:{attribute:"more-icon"},size:{reflect:!0},align:{reflect:!0},label:{},_items:{state:!0},_size:{state:!0}},Qs.styles=[E,w`
216
216
  :host { display: block; min-inline-size: 0; }
217
217
  .row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cm-space-8); min-inline-size: 0; }
218
218
  :host([align='end']) .row { justify-content: flex-end; }
@@ -272,7 +272,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
272
272
  [role='option']:not([aria-disabled='true']):not([aria-selected='true']):active { background: color-mix(in srgb, var(--cm-bg-hover), var(--cm-text-default) 8%); }
273
273
  :host([size='small']) [role='option'] { min-height: var(--cm-control-height-sm, 32px); }
274
274
  @media (pointer: coarse) { [role='option'], :host([size='small']) [role='option'] { min-height: var(--cm-control-height-touch, 44px); } }
275
- `;var gh=!1,pu=!1,Ab=!1,Db=()=>{gh||(gh=!0,setTimeout(()=>{gh=!1,pu=!1}))};function Kw(){Ab||typeof document>"u"||(Ab=!0,document.addEventListener("click",Db,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&Db()},!0))}var Ke,Tr,ra,sa,Di,vl,_r,yl,mu,xl,fh,bh,ie=class{constructor(n,e,t){m(this,yl);m(this,Ke);m(this,Tr);m(this,ra);m(this,sa,!1);m(this,Di,!1);m(this,vl,"");m(this,_r,!1);m(this,xl,()=>{g(this,sa,!0)});m(this,fh,n=>{let e=n.relatedTarget;e&&(r(this,Ke).contains(e)||r(this,Ke).shadowRoot?.contains(e))||r(this,Ke).updateComplete.then(()=>{if(!r(this,sa)||r(this,Di))return;let t=r(this,Tr).validity;t.valid||t.valueMissing||(g(this,Di,!0),r(this,Ke).requestUpdate())})});m(this,bh,n=>{if(!(!gh&&!r(this,_r))){if(n.preventDefault(),g(this,Di,!0),r(this,Ke).requestUpdate(),r(this,_r)){r(this,ra).call(this);return}pu||(pu=!0,r(this,ra).call(this))}});g(this,Ke,n),g(this,Tr,e),g(this,ra,t??(()=>n.focus())),Kw(),n.addEventListener("invalid",r(this,bh)),n.addEventListener("input",r(this,xl),!0),n.addEventListener("change",r(this,xl),!0),n.addEventListener("focusout",r(this,fh))}get message(){return a(this,yl,mu).call(this)}sync(){let n=a(this,yl,mu).call(this);r(this,Ke).toggleAttribute("data-cm-invalid",!!n),n!==r(this,vl)&&(g(this,vl,n),queueMicrotask(()=>r(this,Ke).requestUpdate()))}reset(){g(this,sa,g(this,Di,!1)),r(this,Ke).requestUpdate()}report(n){g(this,_r,!0);try{return n()}finally{g(this,_r,!1)}}};Ke=new WeakMap,Tr=new WeakMap,ra=new WeakMap,sa=new WeakMap,Di=new WeakMap,vl=new WeakMap,_r=new WeakMap,yl=new WeakSet,mu=function(){return r(this,Ke).error?r(this,Ke).error:r(this,Di)?r(this,Tr).validity.valid?"":r(this,Tr).validationMessage:""},xl=new WeakMap,fh=new WeakMap,bh=new WeakMap;var o1=C("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.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),pe,Cr,Zt,$l,ne,Rb,wl,vh,Hb,uu,gu,fu,Ri=class extends _{constructor(){super(...arguments);m(this,ne);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.inputMode="";this.size="default";this.patternMessage="";m(this,pe,this.attachInternals());m(this,Cr,new ie(this,r(this,pe)));m(this,Zt,N("cm-tf"));m(this,$l,"")}connectedCallback(){super.connectedCallback(),g(this,$l,this.value)}get form(){return r(this,pe).form}get validity(){return r(this,pe).validity}get validationMessage(){return r(this,pe).validationMessage}checkValidity(){return a(this,ne,wl).call(this),r(this,pe).checkValidity()}reportValidity(){return a(this,ne,wl).call(this),r(this,Cr).report(()=>r(this,pe).reportValidity())}formResetCallback(){this.value=r(this,$l),this.error="",r(this,Cr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,pe).setFormValue(this.value),a(this,ne,wl).call(this)}render(){let e=r(this,Cr).message,t=[e&&`${r(this,Zt)}-err`,this.helpText&&`${r(this,Zt)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,Zt),invalid:e?"true":h},s=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
275
+ `;var gh=!1,pu=!1,Ab=!1,Db=()=>{gh||(gh=!0,setTimeout(()=>{gh=!1,pu=!1}))};function Kw(){Ab||typeof document>"u"||(Ab=!0,document.addEventListener("click",Db,!0),document.addEventListener("keydown",o=>{(o.key==="Enter"||o.ctrlKey||o.metaKey)&&Db()},!0))}var Ke,_r,ra,sa,Di,vl,Tr,yl,mu,xl,fh,bh,ie=class{constructor(n,e,t){m(this,yl);m(this,Ke);m(this,_r);m(this,ra);m(this,sa,!1);m(this,Di,!1);m(this,vl,"");m(this,Tr,!1);m(this,xl,()=>{g(this,sa,!0)});m(this,fh,n=>{let e=n.relatedTarget;e&&(r(this,Ke).contains(e)||r(this,Ke).shadowRoot?.contains(e))||r(this,Ke).updateComplete.then(()=>{if(!r(this,sa)||r(this,Di))return;let t=r(this,_r).validity;t.valid||t.valueMissing||(g(this,Di,!0),r(this,Ke).requestUpdate())})});m(this,bh,n=>{if(!(!gh&&!r(this,Tr))){if(n.preventDefault(),g(this,Di,!0),r(this,Ke).requestUpdate(),r(this,Tr)){r(this,ra).call(this);return}pu||(pu=!0,r(this,ra).call(this))}});g(this,Ke,n),g(this,_r,e),g(this,ra,t??(()=>n.focus())),Kw(),n.addEventListener("invalid",r(this,bh)),n.addEventListener("input",r(this,xl),!0),n.addEventListener("change",r(this,xl),!0),n.addEventListener("focusout",r(this,fh))}get message(){return a(this,yl,mu).call(this)}sync(){let n=a(this,yl,mu).call(this);r(this,Ke).toggleAttribute("data-cm-invalid",!!n),n!==r(this,vl)&&(g(this,vl,n),queueMicrotask(()=>r(this,Ke).requestUpdate()))}reset(){g(this,sa,g(this,Di,!1)),r(this,Ke).requestUpdate()}report(n){g(this,Tr,!0);try{return n()}finally{g(this,Tr,!1)}}};Ke=new WeakMap,_r=new WeakMap,ra=new WeakMap,sa=new WeakMap,Di=new WeakMap,vl=new WeakMap,Tr=new WeakMap,yl=new WeakSet,mu=function(){return r(this,Ke).error?r(this,Ke).error:r(this,Di)?r(this,_r).validity.valid?"":r(this,_r).validationMessage:""},xl=new WeakMap,fh=new WeakMap,bh=new WeakMap;var o1=C("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.",badEmail:"Enter an email address like name@example.com.",badUrl:"Enter a web address like https://example.com.",badNumber:"Enter a number.",pattern:"Enter a value in the requested format.",tooShort:"Enter at least {min} characters.",tooLong:"Enter {max} characters or fewer."}),pe,Cr,Zt,$l,ne,Rb,wl,vh,Hb,uu,gu,fu,Ri=class extends T{constructor(){super(...arguments);m(this,ne);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.inputMode="";this.size="default";this.patternMessage="";m(this,pe,this.attachInternals());m(this,Cr,new ie(this,r(this,pe)));m(this,Zt,N("cm-tf"));m(this,$l,"")}connectedCallback(){super.connectedCallback(),g(this,$l,this.value)}get form(){return r(this,pe).form}get validity(){return r(this,pe).validity}get validationMessage(){return r(this,pe).validationMessage}checkValidity(){return a(this,ne,wl).call(this),r(this,pe).checkValidity()}reportValidity(){return a(this,ne,wl).call(this),r(this,Cr).report(()=>r(this,pe).reportValidity())}formResetCallback(){this.value=r(this,$l),this.error="",r(this,Cr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,pe).setFormValue(this.value),a(this,ne,wl).call(this)}render(){let e=r(this,Cr).message,t=[e&&`${r(this,Zt)}-err`,this.helpText&&`${r(this,Zt)}-help`].filter(Boolean).join(" ")||h,i={id:r(this,Zt),invalid:e?"true":h},s=this.minLength!=null&&this.minLength>0?this.minLength:h,l=this.maxLength!=null&&this.maxLength>=0?this.maxLength:h,d=this.multiline?c`<textarea class="input" part="input" id=${i.id} rows=${this.rows}
276
276
  .value=${Q(this.value)} placeholder=${this.placeholder||h}
277
277
  inputmode=${this.inputMode||h}
278
278
  minlength=${s} maxlength=${l}
@@ -306,7 +306,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
306
306
  .input:read-only, .input:disabled { background: var(--cm-bg-input-filled); }
307
307
  .input:disabled { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); cursor: not-allowed; }
308
308
  :host([error]:not([error=''])) .input, :host([data-cm-invalid]) .input { border-color: var(--cm-border-critical); }
309
- `];$("cm-text-field",Ri);var u1=C("checkbox",{required:"Please tick this box."}),pt,zr,Qt,kl,yh,Nb,Hi=class extends _{constructor(){super(...arguments);m(this,yh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;m(this,pt,this.attachInternals());m(this,zr,new ie(this,r(this,pt)));m(this,Qt,N("cm-cb"));m(this,kl,!1)}connectedCallback(){super.connectedCallback(),g(this,kl,this.checked)}get form(){return r(this,pt).form}get validity(){return r(this,pt).validity}get validationMessage(){return r(this,pt).validationMessage}checkValidity(){return r(this,pt).checkValidity()}reportValidity(){return r(this,zr).report(()=>r(this,pt).reportValidity())}formResetCallback(){this.checked=r(this,kl),r(this,zr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,pt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,pt).setValidity({valueMissing:!0},this.t("required")):r(this,pt).setValidity({}),r(this,zr).sync()}render(){let e=this.indeterminate?c`<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>`:c`<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>`,t=r(this,zr).message,i=[this.description&&`${r(this,Qt)}-d`,t&&`${r(this,Qt)}-err`].filter(Boolean).join(" ");return c`<label for=${r(this,Qt)}>
309
+ `];$("cm-text-field",Ri);var u1=C("checkbox",{required:"Please tick this box."}),pt,zr,Qt,kl,yh,Nb,Hi=class extends T{constructor(){super(...arguments);m(this,yh);this.label="";this.description="";this.name="";this.value="on";this.checked=!1;this.indeterminate=!1;this.disabled=!1;this.required=!1;m(this,pt,this.attachInternals());m(this,zr,new ie(this,r(this,pt)));m(this,Qt,N("cm-cb"));m(this,kl,!1)}connectedCallback(){super.connectedCallback(),g(this,kl,this.checked)}get form(){return r(this,pt).form}get validity(){return r(this,pt).validity}get validationMessage(){return r(this,pt).validationMessage}checkValidity(){return r(this,pt).checkValidity()}reportValidity(){return r(this,zr).report(()=>r(this,pt).reportValidity())}formResetCallback(){this.checked=r(this,kl),r(this,zr).reset()}formDisabledCallback(e){this.disabled=e}updated(){r(this,pt).setFormValue(this.checked?this.value:null),this.required&&!this.checked?r(this,pt).setValidity({valueMissing:!0},this.t("required")):r(this,pt).setValidity({}),r(this,zr).sync()}render(){let e=this.indeterminate?c`<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>`:c`<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>`,t=r(this,zr).message,i=[this.description&&`${r(this,Qt)}-d`,t&&`${r(this,Qt)}-err`].filter(Boolean).join(" ");return c`<label for=${r(this,Qt)}>
310
310
  <input type="checkbox" id=${r(this,Qt)} .checked=${this.checked} .indeterminate=${this.indeterminate}
311
311
  ?disabled=${this.disabled} ?required=${this.required} aria-invalid=${t?"true":h}
312
312
  aria-describedby=${i||h} @change=${a(this,yh,Nb)} />
@@ -365,7 +365,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
365
365
  :host([disabled]) .dot, :host([group-disabled]) .dot { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
366
366
  :host([disabled][checked]) .dot, :host([group-disabled][checked]) .dot { background: var(--cm-border-subtle); }
367
367
  :host([disabled]) .label, :host([group-disabled]) .label { color: var(--cm-text-secondary); }
368
- `];$("cm-radio",Lr);var w1=C("radioGroup",{required:"Please select one of these options."}),et,Dr,ei,Ml,Tl,_l,aa,me,bu,wh,Sr,vu,na,yu,$h,kh,xh,Ar=class extends _{constructor(){super();m(this,me);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;m(this,et,this.attachInternals());m(this,Dr,new ie(this,r(this,et)));m(this,ei,N("cm-rg"));m(this,Ml,"");m(this,Tl,!0);m(this,_l,!1);m(this,aa,!1);m(this,wh,()=>{a(this,me,bu).call(this),r(this,na).call(this)});m(this,na,()=>{let e=a(this,me,Sr).call(this),t=!1;for(let s of e)s.checked=!!this.value&&s.value===this.value&&!t,s.checked&&(t=!0),s.groupDisabled=this.disabled;let i=e.find(s=>s.checked&&!s.disabled)??a(this,me,vu).call(this)[0];for(let s of e)s._tabbable=s===i&&!this.disabled});m(this,$h,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,me,yu).call(this,t,!0)});m(this,kh,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,me,vu).call(this),s=i.indexOf(t),l=re(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(s+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(s-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&a(this,me,yu).call(this,d,!0)});this.addEventListener("keydown",r(this,kh)),this.addEventListener("click",r(this,$h))}connectedCallback(){super.connectedCallback(),a(this,me,bu).call(this)}get form(){return r(this,et).form}get validity(){return r(this,et).validity}get validationMessage(){return r(this,et).validationMessage}checkValidity(){return r(this,et).checkValidity()}reportValidity(){return r(this,Dr).report(()=>r(this,et).reportValidity())}formResetCallback(){this.value=r(this,Ml),r(this,Dr).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(a(this,me,Sr).call(this).find(t=>t._tabbable)??a(this,me,Sr).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,_l)&&!r(this,aa)&&g(this,Tl,!1),g(this,_l,!0),r(this,na).call(this),r(this,et).setFormValue(this.value||null,this.value);let t=a(this,me,Sr).call(this)[0];this.error?r(this,et).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,et).setValidity({valueMissing:!0},this.t("required"),t):r(this,et).setValidity({}),r(this,Dr).sync()}render(){let e=r(this,Dr).message,t=[e&&`${r(this,ei)}-err`,this.helpText&&`${r(this,ei)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
368
+ `];$("cm-radio",Lr);var w1=C("radioGroup",{required:"Please select one of these options."}),et,Dr,ei,Ml,_l,Tl,aa,me,bu,wh,Sr,vu,na,yu,$h,kh,xh,Ar=class extends T{constructor(){super();m(this,me);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.orientation="vertical";this.required=!1;this.disabled=!1;m(this,et,this.attachInternals());m(this,Dr,new ie(this,r(this,et)));m(this,ei,N("cm-rg"));m(this,Ml,"");m(this,_l,!0);m(this,Tl,!1);m(this,aa,!1);m(this,wh,()=>{a(this,me,bu).call(this),r(this,na).call(this)});m(this,na,()=>{let e=a(this,me,Sr).call(this),t=!1;for(let s of e)s.checked=!!this.value&&s.value===this.value&&!t,s.checked&&(t=!0),s.groupDisabled=this.disabled;let i=e.find(s=>s.checked&&!s.disabled)??a(this,me,vu).call(this)[0];for(let s of e)s._tabbable=s===i&&!this.disabled});m(this,$h,e=>{let t=e.target.closest?.("cm-radio");!t||t.disabled||this.disabled||!this.contains(t)||a(this,me,yu).call(this,t,!0)});m(this,kh,e=>{let t=e.target.closest?.("cm-radio");if(!t||this.disabled)return;let i=a(this,me,vu).call(this),s=i.indexOf(t),l=re(e,this),d;if(e.key==="ArrowDown"||l==="ArrowRight")d=i[(s+1)%i.length];else if(e.key==="ArrowUp"||l==="ArrowLeft")d=i[(s-1+i.length)%i.length];else if(e.key===" ")d=t.disabled?void 0:t;else return;e.preventDefault(),d&&a(this,me,yu).call(this,d,!0)});this.addEventListener("keydown",r(this,kh)),this.addEventListener("click",r(this,$h))}connectedCallback(){super.connectedCallback(),a(this,me,bu).call(this)}get form(){return r(this,et).form}get validity(){return r(this,et).validity}get validationMessage(){return r(this,et).validationMessage}checkValidity(){return r(this,et).checkValidity()}reportValidity(){return r(this,Dr).report(()=>r(this,et).reportValidity())}formResetCallback(){this.value=r(this,Ml),r(this,Dr).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){(a(this,me,Sr).call(this).find(t=>t._tabbable)??a(this,me,Sr).call(this)[0])?.focus(e)}updated(e){e.has("value")&&r(this,Tl)&&!r(this,aa)&&g(this,_l,!1),g(this,Tl,!0),r(this,na).call(this),r(this,et).setFormValue(this.value||null,this.value);let t=a(this,me,Sr).call(this)[0];this.error?r(this,et).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,et).setValidity({valueMissing:!0},this.t("required"),t):r(this,et).setValidity({}),r(this,Dr).sync()}render(){let e=r(this,Dr).message,t=[e&&`${r(this,ei)}-err`,this.helpText&&`${r(this,ei)}-help`].filter(Boolean).join(" ");return c`<div class="group" role="radiogroup" part="group"
369
369
  aria-labelledby=${a(this,me,xh).call(this)?`${r(this,ei)}-l`:h} aria-label=${a(this,me,xh).call(this)?h:this.getAttribute("aria-label")??h}
370
370
  aria-describedby=${t||h}
371
371
  aria-required=${this.required?"true":h} aria-invalid=${e?"true":h}
@@ -374,7 +374,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
374
374
  ${this.helpText?c`<p class="help" id="${r(this,ei)}-help">${this.helpText}</p>`:h}
375
375
  ${e?c`<p class="error" id="${r(this,ei)}-err" role="alert">${e}</p>`:h}
376
376
  <div class="options" part="options"><slot @slotchange=${r(this,wh)}></slot></div>
377
- </div>`}};et=new WeakMap,Dr=new WeakMap,ei=new WeakMap,Ml=new WeakMap,Tl=new WeakMap,_l=new WeakMap,aa=new WeakMap,me=new WeakSet,bu=function(){r(this,Tl)&&(this.value||(g(this,aa,!0),this.value=a(this,me,Sr).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,aa,!1))),g(this,Ml,this.value))},wh=new WeakMap,Sr=function(){return[...this.querySelectorAll("cm-radio")]},vu=function(){return a(this,me,Sr).call(this).filter(e=>!e.disabled&&!this.disabled)},na=new WeakMap,yu=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,na).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},$h=new WeakMap,kh=new WeakMap,xh=function(){return!!this.label||!!this.querySelector("[slot=label]")},Ar.formAssociated=!0,Ar.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}},Ar.styles=[E,w`
377
+ </div>`}};et=new WeakMap,Dr=new WeakMap,ei=new WeakMap,Ml=new WeakMap,_l=new WeakMap,Tl=new WeakMap,aa=new WeakMap,me=new WeakSet,bu=function(){r(this,_l)&&(this.value||(g(this,aa,!0),this.value=a(this,me,Sr).call(this).find(e=>e.hasAttribute("checked"))?.getAttribute("value")??"",this.updateComplete.then(()=>g(this,aa,!1))),g(this,Ml,this.value))},wh=new WeakMap,Sr=function(){return[...this.querySelectorAll("cm-radio")]},vu=function(){return a(this,me,Sr).call(this).filter(e=>!e.disabled&&!this.disabled)},na=new WeakMap,yu=function(e,t){t&&e.focus(),e.value!==this.value&&(this.value=e.value,r(this,na).call(this),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},$h=new WeakMap,kh=new WeakMap,xh=function(){return!!this.label||!!this.querySelector("[slot=label]")},Ar.formAssociated=!0,Ar.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}},Ar.styles=[E,w`
378
378
  :host { display: block; }
379
379
  .group { display: flex; flex-direction: column; gap: var(--cm-space-8); }
380
380
  .label { font-size: var(--cm-type-label-size); line-height: var(--cm-type-label-line-height); font-weight: var(--cm-type-label-weight); color: var(--cm-text-default); }
@@ -438,7 +438,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
438
438
  }
439
439
  .gh .count { font-weight: 400; color: var(--cm-text-tertiary); }
440
440
  .gopts { list-style: none; margin: 0; padding: 0; }
441
- `;function ca(o){if(!o.some(t=>t.group))return o;let n=[],e=new Map;for(let t of o)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let s=[t];e.set(t.group,s),n.push({key:t.group,items:s})}}else{let i=n[n.length-1];i&&!i.key?i.items.push(t):n.push({key:"",items:[t]})}return n.flatMap(t=>t.items)}function Th(o){let n=[];return o.forEach((e,t)=>{let i=e.group||"",s=n[n.length-1];s&&s.group===i?s.rows.push({row:e,index:t}):n.push({group:i,rows:[{row:e,index:t}]})}),n}var _h=w`
441
+ `;function ca(o){if(!o.some(t=>t.group))return o;let n=[],e=new Map;for(let t of o)if(t.group){let i=e.get(t.group);if(i)i.push(t);else{let s=[t];e.set(t.group,s),n.push({key:t.group,items:s})}}else{let i=n[n.length-1];i&&!i.key?i.items.push(t):n.push({key:"",items:[t]})}return n.flatMap(t=>t.items)}function _h(o){let n=[];return o.forEach((e,t)=>{let i=e.group||"",s=n[n.length-1];s&&s.group===i?s.rows.push({row:e,index:t}):n.push({group:i,rows:[{row:e,index:t}]})}),n}var Th=w`
442
442
  [role='listbox'] { padding-block: var(--cm-space-4); }
443
443
  [role='listbox'][hidden] { display: none; }
444
444
  [role='option'] {
@@ -459,7 +459,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
459
459
  }
460
460
  `;function Ch(o,n,e,t){return c`<div role="presentation" class="gh" id=${o}><span>${n}</span>${e!==void 0?c`<span class="count" aria-hidden="true">${e}</span><span class="vh">, ${t}</span>`:h}</div>`}function zh(o,n=h){return c`${o.icon?c`<cm-icon name=${o.icon} size="16"></cm-icon>`:h}<span class="text"><span class="title">${o.title}</span>${o.description?c`<span class="vh">, </span><span class="desc">${o.description}</span>`:h}</span>${n}`}function Sh(o,n){let e=`${o.cls??""}${o.active?" active":""}`;return o.href?c`<a role="option" id=${o.id} class=${e} href=${o.href} tabindex="-1" aria-selected=${o.active?"true":"false"}
461
461
  aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</a>`:c`<div role="option" id=${o.id} class=${e} tabindex="-1" aria-selected=${o.active?"true":"false"}
462
- aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</div>`}function Lh(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var P1=C("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),tt,Nr,ke,ha,Mt,pa,Sl,U,xu,Pr,wu,zl,da,Hr,Ii,Ah,Dh,Ll,Rh,Ib,Hh,qi=class extends _{constructor(){super(...arguments);m(this,U);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.size="default";this.loading=!1;this._active=-1;this._slotted=[];m(this,tt,this.attachInternals());m(this,Nr,new ie(this,r(this,tt)));m(this,ke,N("cm-sel"));m(this,ha,"");m(this,Mt,"");m(this,pa,0);m(this,Sl,new MutationObserver(()=>a(this,U,xu).call(this)));m(this,Pr,new fe);m(this,Dh,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,U,zl).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,U,zl).call(this),a(this,U,Ii).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,U,Ah).call(this,t);a(this,U,zl).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?a(this,U,Hr).call(this,this._active):a(this,U,Ii).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?a(this,U,Hr).call(this,this._active):a(this,U,Ii).call(this,-1);break;case"Home":e.preventDefault(),a(this,U,Ii).call(this,"first");break;case"End":e.preventDefault(),a(this,U,Ii).call(this,"last");break;case"PageDown":e.preventDefault(),a(this,U,Ii).call(this,10);break;case"PageUp":e.preventDefault(),a(this,U,Ii).call(this,-10);break;case"Enter":e.preventDefault(),a(this,U,Hr).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),a(this,U,da).call(this);break;case"Tab":a(this,U,Hr).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,Mt)&&Date.now()-r(this,pa)<500){let i=a(this,U,Ah).call(this," ");i>=0&&(this._active=i)}else a(this,U,Hr).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,U,Ah).call(this,t);i>=0&&(this._active=i)}}});m(this,Ll,e=>{this.open&&!e.composedPath().includes(this)&&a(this,U,da).call(this)});m(this,Rh,()=>{this.disabled||(this.open?a(this,U,da).call(this):a(this,U,zl).call(this))});m(this,Hh,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,U,xu).call(this),r(this,Sl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,Ll),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Pr).close(),r(this,Sl).disconnect(),document.removeEventListener("pointerdown",r(this,Ll),!0)}get form(){return r(this,tt).form}get validity(){return r(this,tt).validity}get validationMessage(){return r(this,tt).validationMessage}checkValidity(){return r(this,tt).checkValidity()}reportValidity(){return r(this,Nr).report(()=>r(this,tt).reportValidity())}formResetCallback(){this.value=r(this,ha),this.open=!1,r(this,Nr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?ca(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):ca(this._slotted)}firstUpdated(){r(this,ha)||g(this,ha,this.value)}updated(e){r(this,tt).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,tt).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,tt).setValidity({valueMissing:!0},this.t("required"),t):r(this,tt).setValidity({}),r(this,Nr).sync(),e.has("open")?this.open?r(this,Pr).open(this.renderRoot.querySelector("[role=listbox]"),this.renderRoot.querySelector(".box"),{align:"stretch"}):r(this,Pr).close():this.open&&e.has("items")&&r(this,Pr).place(),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,ke)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(p=>p.value===this.value),i=r(this,Nr).message,s=[i&&`${r(this,ke)}-err`,this.helpText&&`${r(this,ke)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=(p,u)=>c`<li role="option" id="${r(this,ke)}-o${u}" class=${u===this._active?"active":""}
462
+ aria-keyshortcuts=${o.keyshortcuts||h} @pointerenter=${o.onHover} @click=${o.onChoose}>${n}</div>`}function Lh(o,n,e){return e?o<0?n>0?0:e-1:(o+n+e)%e:-1}var P1=C("select",{required:"Please select an item in the list.",grouped:"{group}: {label}"}),tt,Nr,ke,ha,Mt,pa,Sl,U,xu,Pr,wu,zl,da,Hr,Ii,Ah,Dh,Ll,Rh,Ib,Hh,qi=class extends T{constructor(){super(...arguments);m(this,U);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.size="default";this.loading=!1;this._active=-1;this._slotted=[];m(this,tt,this.attachInternals());m(this,Nr,new ie(this,r(this,tt)));m(this,ke,N("cm-sel"));m(this,ha,"");m(this,Mt,"");m(this,pa,0);m(this,Sl,new MutationObserver(()=>a(this,U,xu).call(this)));m(this,Pr,new fe);m(this,Dh,e=>{if(this.disabled)return;let t=e.key;if(!this.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t)){e.preventDefault(),a(this,U,zl).call(this);return}if(t==="Home"||t==="End"){e.preventDefault(),a(this,U,zl).call(this),a(this,U,Ii).call(this,t==="Home"?"first":"last");return}if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,U,Ah).call(this,t);a(this,U,zl).call(this,i>=0?i:void 0)}return}switch(t){case"ArrowDown":e.preventDefault(),e.altKey?a(this,U,Hr).call(this,this._active):a(this,U,Ii).call(this,1);break;case"ArrowUp":e.preventDefault(),e.altKey?a(this,U,Hr).call(this,this._active):a(this,U,Ii).call(this,-1);break;case"Home":e.preventDefault(),a(this,U,Ii).call(this,"first");break;case"End":e.preventDefault(),a(this,U,Ii).call(this,"last");break;case"PageDown":e.preventDefault(),a(this,U,Ii).call(this,10);break;case"PageUp":e.preventDefault(),a(this,U,Ii).call(this,-10);break;case"Enter":e.preventDefault(),a(this,U,Hr).call(this,this._active);break;case"Escape":e.preventDefault(),e.stopPropagation(),a(this,U,da).call(this);break;case"Tab":a(this,U,Hr).call(this,this._active);break;case" ":if(e.preventDefault(),r(this,Mt)&&Date.now()-r(this,pa)<500){let i=a(this,U,Ah).call(this," ");i>=0&&(this._active=i)}else a(this,U,Hr).call(this,this._active);break;default:if(t.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey){let i=a(this,U,Ah).call(this,t);i>=0&&(this._active=i)}}});m(this,Ll,e=>{this.open&&!e.composedPath().includes(this)&&a(this,U,da).call(this)});m(this,Rh,()=>{this.disabled||(this.open?a(this,U,da).call(this):a(this,U,zl).call(this))});m(this,Hh,()=>this.renderRoot.querySelector(".box")?.focus())}connectedCallback(){super.connectedCallback(),a(this,U,xu).call(this),r(this,Sl).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),document.addEventListener("pointerdown",r(this,Ll),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,Pr).close(),r(this,Sl).disconnect(),document.removeEventListener("pointerdown",r(this,Ll),!0)}get form(){return r(this,tt).form}get validity(){return r(this,tt).validity}get validationMessage(){return r(this,tt).validationMessage}checkValidity(){return r(this,tt).checkValidity()}reportValidity(){return r(this,Nr).report(()=>r(this,tt).reportValidity())}formResetCallback(){this.value=r(this,ha),this.open=!1,r(this,Nr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e}get items(){return this.options.length?ca(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):ca(this._slotted)}firstUpdated(){r(this,ha)||g(this,ha,this.value)}updated(e){r(this,tt).setFormValue(this.value||null,this.value);let t=this.renderRoot.querySelector(".box")??void 0;this.error?r(this,tt).setValidity({customError:!0},this.error,t):this.required&&!this.value?r(this,tt).setValidity({valueMissing:!0},this.t("required"),t):r(this,tt).setValidity({}),r(this,Nr).sync(),e.has("open")?this.open?r(this,Pr).open(this.renderRoot.querySelector("[role=listbox]"),this.renderRoot.querySelector(".box"),{align:"stretch"}):r(this,Pr).close():this.open&&e.has("items")&&r(this,Pr).place(),(e.has("_active")||e.has("open"))&&this.open&&this.renderRoot.querySelector(`#${r(this,ke)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=this.items,t=e.find(p=>p.value===this.value),i=r(this,Nr).message,s=[i&&`${r(this,ke)}-err`,this.helpText&&`${r(this,ke)}-help`].filter(Boolean).join(" "),l=this.getAttribute("aria-label"),d=(p,u)=>c`<li role="option" id="${r(this,ke)}-o${u}" class=${u===this._active?"active":""}
463
463
  aria-selected=${p.value===this.value?"true":"false"} aria-disabled=${p.disabled?"true":h}
464
464
  @pointerenter=${()=>!p.disabled&&(this._active=u)} @click=${()=>a(this,U,Hr).call(this,u)}>${p.label}</li>`;return c`<div class="field">
465
465
  ${this.label?c`<span class="label" id="${r(this,ke)}-l" part="label" @click=${r(this,Hh)}>${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
@@ -478,7 +478,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
478
478
  <ul role="listbox" id="${r(this,ke)}-list" part="listbox" tabindex="-1" aria-labelledby=${this.label?`${r(this,ke)}-l`:h}
479
479
  aria-label=${!this.label&&l?l:h} ?hidden=${!this.open}
480
480
  @pointerdown=${p=>p.preventDefault()}>
481
- ${Th(e).map((p,u)=>p.group?c`<li role="group" aria-labelledby="${r(this,ke)}-g${u}"><div role="presentation" class="gh" id="${r(this,ke)}-g${u}">${p.group}</div>
481
+ ${_h(e).map((p,u)=>p.group?c`<li role="group" aria-labelledby="${r(this,ke)}-g${u}"><div role="presentation" class="gh" id="${r(this,ke)}-g${u}">${p.group}</div>
482
482
  <ul role="none" class="gopts">${p.rows.map(({row:b,index:f})=>d(b,f))}</ul></li>`:p.rows.map(({row:b,index:f})=>d(b,f)))}
483
483
  </ul>
484
484
  </div>
@@ -518,7 +518,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
518
518
  [role='group'] { display: block; }
519
519
  slot { display: none; }
520
520
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
521
- `];$("cm-select",qi);var U1=C("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),ua,Nh,Al,Pe,ma,qb,Ob,$u,Oi=class extends _{constructor(){super(...arguments);m(this,Pe);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;m(this,ua,this.attachInternals());m(this,Nh,N("cm-search"));m(this,Al,"")}connectedCallback(){super.connectedCallback(),g(this,Al,this.value)}get form(){return r(this,ua).form}checkValidity(){return r(this,ua).checkValidity()}formResetCallback(){this.value=r(this,Al)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,ua).setFormValue(this.value)}render(){return c`<div class="box" part="box">
521
+ `];$("cm-select",qi);var U1=C("search",{label:"Search",placeholder:"Search",filter:"Filter",filterApplied:"{label} ({count} applied)",clear:"Clear search"}),ua,Nh,Al,Pe,ma,qb,Ob,$u,Oi=class extends T{constructor(){super(...arguments);m(this,Pe);this.name="";this.value="";this.filter=!1;this.filterCount=0;this.size="default";this.disabled=!1;m(this,ua,this.attachInternals());m(this,Nh,N("cm-search"));m(this,Al,"")}connectedCallback(){super.connectedCallback(),g(this,Al,this.value)}get form(){return r(this,ua).form}checkValidity(){return r(this,ua).checkValidity()}formResetCallback(){this.value=r(this,Al)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}updated(){r(this,ua).setFormValue(this.value)}render(){return c`<div class="box" part="box">
522
522
  <cm-icon class="icon" name="search" size="16"></cm-icon>
523
523
  <input id=${r(this,Nh)} part="input" type="search" enterkeyhint="search" autocomplete="off"
524
524
  aria-label=${this.label} .value=${Q(this.value)} placeholder=${this.placeholder||h} ?disabled=${this.disabled}
@@ -561,7 +561,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
561
561
  :host([disabled]) .box { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
562
562
  :host([disabled]) input { color: var(--cm-text-secondary); cursor: not-allowed; }
563
563
  :host([disabled]) button { cursor: not-allowed; }
564
- `];$("cm-search",Oi);var J1=C("tag",{remove:"Remove {label}"}),Ph,Bb,Ir=class extends _{constructor(){super(...arguments);m(this,Ph);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${a(this,Ph,Bb)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};Ph=new WeakSet,Bb=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Ir.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ir.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Ir.styles=[E,w`
564
+ `];$("cm-search",Oi);var J1=C("tag",{remove:"Remove {label}"}),Ph,Bb,Ir=class extends T{constructor(){super(...arguments);m(this,Ph);this.removable=!1;this.removeLabel="";this.disabled=!1}render(){let e=this.removeLabel||this.t("remove",{label:this.textContent?.trim()??""}).trim();return c`<span class="tag" part="tag"><span class="text"><slot @slotchange=${()=>this.requestUpdate()}></slot></span>${this.removable?c`<button type="button" part="remove" aria-label=${e} ?disabled=${this.disabled} @click=${a(this,Ph,Bb)}><cm-icon name="x-circle" size="14"></cm-icon></button>`:h}</span>`}};Ph=new WeakSet,Bb=function(){this.disabled||this.dispatchEvent(new CustomEvent("cm-remove",{bubbles:!0,composed:!0}))},Ir.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ir.properties={removable:{type:Boolean,reflect:!0},removeLabel:{attribute:"remove-label"},disabled:{type:Boolean,reflect:!0}},Ir.styles=[E,w`
565
565
  :host { display: inline-flex; vertical-align: middle; max-width: 100%; }
566
566
  .tag {
567
567
  display: inline-flex; align-items: center; gap: var(--cm-space-4); min-width: 0; height: 24px; padding: 0 var(--cm-space-8);
@@ -579,7 +579,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
579
579
  button:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 0; }
580
580
  :host([disabled]) .tag { color: var(--cm-text-secondary); border-color: var(--cm-border-subtle); }
581
581
  :host([disabled]) button { cursor: not-allowed; color: var(--cm-text-secondary); background: none; }
582
- `];$("cm-tag",Ir);var lk=C("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}",more:"+{count} more"}),Ie,Br,Ee,Nl,ba,Pl,Il,ql,R,ku,Fb,Dl,Ih,Rl,ii,ga,fa,ti,Vb,Hl,Eu,Mu,qr,qh,Oh,Or,jb,Bh,Fh,Vh,Ub,Kb,Bi=class extends _{constructor(){super(...arguments);m(this,R);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.size="default";this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.maxTags=3;this._query="";this._focusIn=!1;this._active=-1;this._slotted=[];this._typing=!1;m(this,Ie,this.attachInternals());m(this,Br,new ie(this,r(this,Ie)));m(this,Ee,N("cm-cb"));m(this,Nl,null);m(this,ba,new Map);m(this,Pl,new Map);m(this,Il,new MutationObserver(()=>a(this,R,ku).call(this)));m(this,ql);m(this,ii,new fe);m(this,qh,()=>{this._focusIn=!0});m(this,Oh,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});m(this,Bh,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,R,fa).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});m(this,Fh,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,R,Hl).call(this,1):(a(this,R,fa).call(this),e.altKey||a(this,R,Hl).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,R,Hl).call(this,-1):(a(this,R,fa).call(this),a(this,R,Hl).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,R,Eu).call(this,this._active)):r(this,R,Ih)&&(e.preventDefault(),a(this,R,Mu).call(this,r(this,R,Ih)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),a(this,R,ti).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",a(this,R,ga).call(this)));break;case"ArrowLeft":case"ArrowRight":{let i=e.target;this.multiple&&this.values.length&&re(e,this)==="ArrowLeft"&&i.selectionStart===0&&i.selectionEnd===0&&(e.preventDefault(),a(this,R,ti).call(this),a(this,R,Or).call(this,this.values.length-1));break}case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":a(this,R,ti).call(this);break;default:}});m(this,Vh,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(a(this,R,ti).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?a(this,R,Dl).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,R,ku).call(this),r(this,Il).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,ql,Mh(this,()=>this.open,()=>a(this,R,ti).call(this))),this.addEventListener("focusin",r(this,qh)),this.addEventListener("focusout",r(this,Oh))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ii).close(),r(this,Il).disconnect(),(e=r(this,ql))==null||e.call(this)}get form(){return r(this,Ie).form}get validity(){return r(this,Ie).validity}get validationMessage(){return r(this,Ie).validationMessage}checkValidity(){return r(this,Ie).checkValidity()}reportValidity(){return r(this,Br).report(()=>r(this,Ie).reportValidity())}formResetCallback(){let e=r(this,Nl)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1,r(this,Br).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
582
+ `];$("cm-tag",Ir);var lk=C("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}",more:"+{count} more"}),Ie,Br,Ee,Nl,ba,Pl,Il,ql,R,ku,Fb,Dl,Ih,Rl,ii,ga,fa,ti,Vb,Hl,Eu,Mu,qr,qh,Oh,Or,jb,Bh,Fh,Vh,Ub,Kb,Bi=class extends T{constructor(){super(...arguments);m(this,R);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.values=[];this.placeholder="";this.options=[];this.multiple=!1;this.size="default";this.allowCustom=!1;this.filter="contains";this.loading=!1;this.required=!1;this.disabled=!1;this.open=!1;this.showGroup=!1;this.maxTags=3;this._query="";this._focusIn=!1;this._active=-1;this._slotted=[];this._typing=!1;m(this,Ie,this.attachInternals());m(this,Br,new ie(this,r(this,Ie)));m(this,Ee,N("cm-cb"));m(this,Nl,null);m(this,ba,new Map);m(this,Pl,new Map);m(this,Il,new MutationObserver(()=>a(this,R,ku).call(this)));m(this,ql);m(this,ii,new fe);m(this,qh,()=>{this._focusIn=!0});m(this,Oh,()=>{setTimeout(()=>{this._focusIn=this.matches(":focus-within")})});m(this,Bh,e=>{e.stopPropagation(),this._query=e.target.value,this._typing=!0,this._active=-1,a(this,R,fa).call(this),this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this._query},bubbles:!0,composed:!0}))});m(this,Fh,e=>{if(this.disabled)return;switch(e.key){case"ArrowDown":e.preventDefault(),this.open?a(this,R,Hl).call(this,1):(a(this,R,fa).call(this),e.altKey||a(this,R,Hl).call(this,"first"));break;case"ArrowUp":e.preventDefault(),this.open?a(this,R,Hl).call(this,-1):(a(this,R,fa).call(this),a(this,R,Hl).call(this,"last"));break;case"Enter":this.open&&this._active>=0?(e.preventDefault(),a(this,R,Eu).call(this,this._active)):r(this,R,Ih)&&(e.preventDefault(),a(this,R,Mu).call(this,r(this,R,Ih)));break;case"Escape":this.open?(e.preventDefault(),e.stopPropagation(),a(this,R,ti).call(this)):this._query&&(e.preventDefault(),this._query="",this._typing=!0,!this.multiple&&this.value&&(this.value="",a(this,R,ga).call(this)));break;case"ArrowLeft":case"ArrowRight":{let i=e.target;this.multiple&&this.values.length&&re(e,this)==="ArrowLeft"&&i.selectionStart===0&&i.selectionEnd===0&&(e.preventDefault(),a(this,R,ti).call(this),a(this,R,Or).call(this,this.values.length-1));break}case"Backspace":this.multiple&&!this._query&&this.values.length&&(e.preventDefault(),this.removeValue(this.values[this.values.length-1]));break;case"Tab":a(this,R,ti).call(this);break;default:}});m(this,Vh,()=>{queueMicrotask(()=>{this.shadowRoot?.activeElement!==this.renderRoot.querySelector("input")&&(a(this,R,ti).call(this),this._typing&&(this._typing=!1,this._query=this.multiple?"":this.value?a(this,R,Dl).call(this,this.value):""))})})}connectedCallback(){super.connectedCallback(),a(this,R,ku).call(this),r(this,Il).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),g(this,ql,Mh(this,()=>this.open,()=>a(this,R,ti).call(this))),this.addEventListener("focusin",r(this,qh)),this.addEventListener("focusout",r(this,Oh))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ii).close(),r(this,Il).disconnect(),(e=r(this,ql))==null||e.call(this)}get form(){return r(this,Ie).form}get validity(){return r(this,Ie).validity}get validationMessage(){return r(this,Ie).validationMessage}checkValidity(){return r(this,Ie).checkValidity()}reportValidity(){return r(this,Br).report(()=>r(this,Ie).reportValidity())}formResetCallback(){let e=r(this,Nl)??{value:"",values:[]};this.value=e.value,this.values=[...e.values],this._query="",this._typing=!1,this.open=!1,r(this,Br).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){typeof e=="string"&&(this.multiple?this.values=e?e.split(`
583
583
  `):[]:this.value=e)}get items(){return this.options?.length?ca(this.options.map(e=>typeof e=="string"?{value:e,label:e}:e)):ca(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(){g(this,Nl,{value:this.value,values:[...this.values]})}willUpdate(e){for(let t of this.items)r(this,ba).set(t.value,t.label),t.group&&r(this,Pl).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?a(this,R,Dl).call(this,this.value):""),e.has("_query")||e.has("options")||e.has("_slotted")||e.has("loading")){let t=a(this,R,Rl).call(this);this._active>=t.length&&(this._active=-1)}}updated(e){let t=this.open;t&&!r(this,ii).active?r(this,ii).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,ii).active?r(this,ii).close():t&&r(this,ii).place();let i=this.renderRoot.querySelector("input")??void 0;if(this.multiple)if(this.name&&this.values.length){let l=new FormData;for(let d of this.values)l.append(this.name,d);r(this,Ie).setFormValue(l,this.values.join(`
584
584
  `))}else r(this,Ie).setFormValue(null);else r(this,Ie).setFormValue(this.value||null,this.value);let s=this.multiple?!this.values.length:!this.value;this.error?r(this,Ie).setValidity({customError:!0},this.error,i):this.required&&s?r(this,Ie).setValidity({valueMissing:!0},this.t(this.multiple?"requiredMultiple":"required"),i):r(this,Ie).setValidity({}),r(this,Br).sync(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,Ee)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}removeValue(e){this.values.includes(e)&&(this.values=this.values.filter(t=>t!==e),a(this,R,ga).call(this))}focus(e){this.renderRoot.querySelector("input")?.focus(e)}render(){let e=a(this,R,Rl).call(this),t=r(this,Br).message,i=[t&&`${r(this,Ee)}-err`,this.helpText&&`${r(this,Ee)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=u=>this.multiple?this.values.includes(u):u===this.value,d=(u,b)=>c`<li role="option" id="${r(this,Ee)}-o${b}" class=${b===this._active?"active":""}
585
585
  aria-selected=${u.create?"false":l(u.value)?"true":"false"} aria-disabled=${u.disabled?"true":h}
@@ -606,7 +606,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
606
606
  <ul role="listbox" id="${r(this,Ee)}-list" part="listbox" ?hidden=${!e.length}
607
607
  aria-labelledby=${this.label?`${r(this,Ee)}-l`:h} aria-label=${!this.label&&s?s:h}
608
608
  aria-multiselectable=${this.multiple?"true":h}>
609
- ${Th(e).map((u,b)=>u.group?c`<li role="group" aria-labelledby="${r(this,Ee)}-g${b}"><div role="presentation" class="gh" id="${r(this,Ee)}-g${b}">${u.group}</div>
609
+ ${_h(e).map((u,b)=>u.group?c`<li role="group" aria-labelledby="${r(this,Ee)}-g${b}"><div role="presentation" class="gh" id="${r(this,Ee)}-g${b}">${u.group}</div>
610
610
  <ul role="none" class="gopts">${u.rows.map(({row:f,index:x})=>d(f,x))}</ul></li>`:u.rows.map(({row:f,index:x})=>d(f,x)))}
611
611
  </ul>
612
612
  ${this.loading?c`<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?h:c`<p class="message">${this.emptyText||this.t("noResults")}</p>`}
@@ -660,7 +660,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
660
660
  .create { font-style: normal; }
661
661
  slot { display: none; }
662
662
  @media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
663
- `];$("cm-combobox",Bi);function Ol(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var Gw={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function jh(o,n){let e=o.trim().toLowerCase().split("+").map(s=>s.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:Gw[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let s of e)if(s==="mod")n?i.meta=!0:i.ctrl=!0;else if(s==="ctrl"||s==="control")i.ctrl=!0;else if(s==="meta"||s==="cmd"||s==="command")i.meta=!0;else if(s==="alt"||s==="option"||s==="opt")i.alt=!0;else if(s==="shift")i.shift=!0;else return null;return i}function Tu(o,n=Ol()){let e=jh(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function _u(o,n,e=Ol()){let t=jh(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function Uh(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var Ww={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},Yw={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},Xw={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},Jw=o=>Xw[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function Kh(o,n=Ol()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=jh(t,n);if(!i)return[o.trim()];let s=n?Ww:Yw,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(s[d]);e.push(Jw(i.key))}return e}function Gb(o,n=Ol()){if(/\s/.test(o.trim()))return"";let e=jh(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,s,l)=>s?`${s[0].toUpperCase()}${s.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var yk=C("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),mt,Fl,te,Gh,Bl,ri,va,Cu,Wh,Wb,Yh,Vl,zu,Yb,Fr=class extends _{constructor(){super(...arguments);m(this,te);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;m(this,mt,N("cm-gs"));m(this,Fl);m(this,ri,new fe);m(this,Wh,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,te,Cu).call(this)});m(this,Yh,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,te,Wb).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,te,Bl)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,mt)}-o${this._active}`)?.click());break;case"Escape":r(this,te,Bl)?(e.preventDefault(),e.stopPropagation(),a(this,te,va).call(this)):this.value&&(e.preventDefault(),a(this,te,zu).call(this,!1));break;case"Tab":a(this,te,va).call(this);break;default:}});m(this,Vl,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||Uh(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,Fl,Mh(this,()=>this.open,()=>a(this,te,va).call(this))),document.addEventListener("keydown",r(this,Vl))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ri).close(),(e=r(this,Fl))==null||e.call(this),document.removeEventListener("keydown",r(this,Vl))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,te,Gh).call(this).length&&(this._active=-1)}updated(e){let t=r(this,te,Bl);t&&!r(this,ri).active?r(this,ri).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,ri).active?r(this,ri).close():t&&r(this,ri).place(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,mt)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=a(this,te,Gh).call(this),t=r(this,te,Bl),i=e.filter(u=>u.item).length,s=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(u=>u?.items?.length),p=(u,b,f="")=>{let x=++l;return Sh({id:`${r(this,mt)}-o${x}`,active:x===this._active,href:u.href,cls:f,onHover:()=>this._active=x,onChoose:y=>a(this,te,Yb).call(this,y,u)},b)};return c`<div class="wrap">
663
+ `];$("cm-combobox",Bi);function Ol(){let o=typeof navigator>"u"?void 0:navigator;return/mac|iphone|ipad|ipod/i.test(o?.userAgentData?.platform||o?.platform||"")}var Gw={esc:"escape",return:"enter",space:" ",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",plus:"+"};function jh(o,n){let e=o.trim().toLowerCase().split("+").map(s=>s.trim());e.length>1&&e[e.length-1]===""&&e[e.length-2]===""&&e.splice(-2,2,"+");let t=e.pop();if(!t)return null;let i={key:Gw[t]??t,ctrl:!1,meta:!1,alt:!1,shift:!1};for(let s of e)if(s==="mod")n?i.meta=!0:i.ctrl=!0;else if(s==="ctrl"||s==="control")i.ctrl=!0;else if(s==="meta"||s==="cmd"||s==="command")i.meta=!0;else if(s==="alt"||s==="option"||s==="opt")i.alt=!0;else if(s==="shift")i.shift=!0;else return null;return i}function _u(o,n=Ol()){let e=jh(o,n);return!!e&&(e.ctrl||e.meta||e.alt)}function Tu(o,n,e=Ol()){let t=jh(n,e);if(!t||!o.key||o.ctrlKey!==t.ctrl||o.metaKey!==t.meta||o.altKey!==t.alt)return!1;let i=/^[a-z0-9]$/.test(t.key);return(i||t.key.length>1)&&o.shiftKey!==t.shift?!1:o.key.toLowerCase()===t.key?!0:i?o.code===(/\d/.test(t.key)?`Digit${t.key}`:`Key${t.key.toUpperCase()}`):!1}function Uh(o){let n=o.composedPath()[0];return!!n&&(n.isContentEditable||/^(input|textarea|select)$/i.test(n.localName??""))}var Ww={meta:"\u2318",ctrl:"\u2303",alt:"\u2325",shift:"\u21E7"},Yw={meta:"Win",ctrl:"Ctrl",alt:"Alt",shift:"Shift"},Xw={escape:"Esc",enter:"\u21B5"," ":"Space",arrowup:"\u2191",arrowdown:"\u2193",arrowleft:"\u2190",arrowright:"\u2192",backspace:"\u232B",delete:"Del",tab:"Tab",pageup:"PgUp",pagedown:"PgDn",home:"Home",end:"End"},Jw=o=>Xw[o]??(o.length===1?o.toUpperCase():o[0].toUpperCase()+o.slice(1));function Kh(o,n=Ol()){let e=[];for(let t of o.trim().split(/\s+/).filter(Boolean)){let i=jh(t,n);if(!i)return[o.trim()];let s=n?Ww:Yw,l=n?["ctrl","alt","shift","meta"]:["ctrl","meta","alt","shift"];for(let d of l)i[d]&&e.push(s[d]);e.push(Jw(i.key))}return e}function Gb(o,n=Ol()){if(/\s/.test(o.trim()))return"";let e=jh(o,n);if(!e)return"";let t=e.key===" "?"Space":e.key.length===1?e.key.toUpperCase():e.key.replace(/^(arrow|page)?(\w)/,(i,s,l)=>s?`${s[0].toUpperCase()}${s.slice(1)}${l.toUpperCase()}`:l.toUpperCase());return[e.ctrl&&"Control",e.meta&&"Meta",e.alt&&"Alt",e.shift&&"Shift",t].filter(Boolean).join("+")}var yk=C("globalSearch",{label:"Search",placeholder:"Search",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all",clear:"Clear search"}),mt,Fl,te,Gh,Bl,ri,va,Cu,Wh,Wb,Yh,Vl,zu,Yb,Fr=class extends T{constructor(){super(...arguments);m(this,te);this.value="";this.results=[];this.loading=!1;this.open=!1;this.shortcut="";this._active=-1;m(this,mt,N("cm-gs"));m(this,Fl);m(this,ri,new fe);m(this,Wh,e=>{this.value=e.target.value,this._active=-1,this.open=!!this.value.trim(),a(this,te,Cu).call(this)});m(this,Yh,e=>{switch(e.key){case"ArrowDown":case"ArrowUp":if(e.preventDefault(),!this.value.trim())break;this.open||(this.open=!0),a(this,te,Wb).call(this,e.key==="ArrowDown"?1:-1);break;case"Enter":r(this,te,Bl)&&this._active>=0&&(e.preventDefault(),this.renderRoot.querySelector(`#${r(this,mt)}-o${this._active}`)?.click());break;case"Escape":r(this,te,Bl)?(e.preventDefault(),e.stopPropagation(),a(this,te,va).call(this)):this.value&&(e.preventDefault(),a(this,te,zu).call(this,!1));break;case"Tab":a(this,te,va).call(this);break;default:}});m(this,Vl,e=>{!this.shortcut||e.key!==this.shortcut||e.ctrlKey||e.metaKey||e.altKey||e.defaultPrevented||Uh(e)||this.getClientRects().length&&(e.preventDefault(),this.focus())})}connectedCallback(){super.connectedCallback(),g(this,Fl,Mh(this,()=>this.open,()=>a(this,te,va).call(this))),document.addEventListener("keydown",r(this,Vl))}disconnectedCallback(){var e;super.disconnectedCallback(),r(this,ri).close(),(e=r(this,Fl))==null||e.call(this),document.removeEventListener("keydown",r(this,Vl))}willUpdate(e){(e.has("results")||e.has("loading")||e.has("value"))&&this._active>=a(this,te,Gh).call(this).length&&(this._active=-1)}updated(e){let t=r(this,te,Bl);t&&!r(this,ri).active?r(this,ri).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch"}):!t&&r(this,ri).active?r(this,ri).close():t&&r(this,ri).place(),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${r(this,mt)}-o${this._active}`)?.scrollIntoView({block:"nearest"})}render(){let e=a(this,te,Gh).call(this),t=r(this,te,Bl),i=e.filter(u=>u.item).length,s=this.loading&&t?this.loadingText:t?e.length?this.t("results",{count:i}):this.emptyText:"",l=-1,d=(this.results??[]).filter(u=>u?.items?.length),p=(u,b,f="")=>{let x=++l;return Sh({id:`${r(this,mt)}-o${x}`,active:x===this._active,href:u.href,cls:f,onHover:()=>this._active=x,onChoose:y=>a(this,te,Yb).call(this,y,u)},b)};return c`<div class="wrap">
664
664
  <div class="box" part="box" @click=${u=>{u.target===u.currentTarget&&this.focus()}}>
665
665
  <cm-icon class="icon" name="search" size="16"></cm-icon>
666
666
 
@@ -684,7 +684,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
684
684
  ${this.loading?c`<p class="message"><cm-spinner size="small" aria-hidden="true"></cm-spinner><span aria-hidden="true">${this.loadingText}</span></p>`:e.length?h:c`<p class="message" aria-hidden="true">${this.emptyText}</p>`}
685
685
  </div>
686
686
  <span class="vh" role="status" aria-live="polite">${s}</span>
687
- </div>`}};mt=new WeakMap,Fl=new WeakMap,te=new WeakSet,Gh=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}]:[]])},Bl=function(){return this.open&&!!this.value.trim()},ri=new WeakMap,va=function(){this.open=!1,this._active=-1},Cu=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Wh=new WeakMap,Wb=function(e){this._active=Lh(this._active,e,a(this,te,Gh).call(this).length)},Yh=new WeakMap,Vl=new WeakMap,zu=function(e=!0){this.value="",a(this,te,va).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,te,Cu).call(this)},Yb=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(),a(this,te,va).call(this)},Fr.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Fr.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}},Fr.styles=[E,Ae,la,Pi,_h,w`
687
+ </div>`}};mt=new WeakMap,Fl=new WeakMap,te=new WeakSet,Gh=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}]:[]])},Bl=function(){return this.open&&!!this.value.trim()},ri=new WeakMap,va=function(){this.open=!1,this._active=-1},Cu=function(){this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))},Wh=new WeakMap,Wb=function(e){this._active=Lh(this._active,e,a(this,te,Gh).call(this).length)},Yh=new WeakMap,Vl=new WeakMap,zu=function(e=!0){this.value="",a(this,te,va).call(this),e&&this.renderRoot.querySelector("input")?.focus(),a(this,te,Cu).call(this)},Yb=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(),a(this,te,va).call(this)},Fr.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Fr.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}},Fr.styles=[E,Ae,la,Pi,Th,w`
688
688
  :host { display: block; position: relative; }
689
689
  .wrap { position: relative; }
690
690
  .box {
@@ -714,7 +714,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
714
714
  overflow-y: auto; max-height: var(--cm-global-search-results-max-height, min(480px, calc(100dvh - 140px)));
715
715
  }
716
716
  @media (pointer: coarse) { .box { min-height: var(--cm-control-height-touch); } input { font-size: var(--cm-font-size-16); } }
717
- `];$("cm-global-search",Fr);var Su=0,Xb="";function Lu(){Su++===0&&(Xb=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function jl(){Su>0&&--Su===0&&(document.documentElement.style.overflow=Xb)}function Au(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var ya,si,xa,wa,Xh,Jh,Zh,Qh,ep,tp,oe=class extends _{constructor(){super(...arguments);m(this,wa);this.open=!1;this.label="";this.uid=N("cm-ovl");m(this,ya,null);m(this,si,!1);m(this,xa,!1);m(this,Jh,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});m(this,Zh,e=>{e.preventDefault(),this.requestClose("escape")});m(this,Qh,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,wa,Xh).call(this))});m(this,ep,e=>{g(this,xa,e.target===e.currentTarget)});m(this,tp,e=>{if(e.target===e.currentTarget&&r(this,xa)){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")}g(this,xa,!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}closeNow(){this.open=!1;let e=this.dialog;e?.open&&(e.close(),a(this,wa,Xh).call(this))}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(g(this,ya,Au()),!this.isConnected)return;t.showModal(),r(this,si)||(Lu(),g(this,si,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),a(this,wa,Xh).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),r(this,si)&&(jl(),g(this,si,!1))}renderHeader(e=h){return c`<header class="head" part="header">
717
+ `];$("cm-global-search",Fr);var Su=0,Xb="";function Lu(){Su++===0&&(Xb=document.documentElement.style.overflow,document.documentElement.style.overflow="hidden")}function jl(){Su>0&&--Su===0&&(document.documentElement.style.overflow=Xb)}function Au(){let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o}var ya,si,xa,wa,Xh,Jh,Zh,Qh,ep,tp,oe=class extends T{constructor(){super(...arguments);m(this,wa);this.open=!1;this.label="";this.uid=N("cm-ovl");m(this,ya,null);m(this,si,!1);m(this,xa,!1);m(this,Jh,e=>{e.key==="Escape"&&!e.defaultPrevented&&(e.preventDefault(),e.stopPropagation(),this.requestClose("escape"))});m(this,Zh,e=>{e.preventDefault(),this.requestClose("escape")});m(this,Qh,()=>{this.open&&!this.dialog?.open&&(this.open=!1,a(this,wa,Xh).call(this))});m(this,ep,e=>{g(this,xa,e.target===e.currentTarget)});m(this,tp,e=>{if(e.target===e.currentTarget&&r(this,xa)){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")}g(this,xa,!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}closeNow(){this.open=!1;let e=this.dialog;e?.open&&(e.close(),a(this,wa,Xh).call(this))}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(g(this,ya,Au()),!this.isConnected)return;t.showModal(),r(this,si)||(Lu(),g(this,si,!0)),this.focusFirst(),this.dispatchEvent(new CustomEvent("cm-open",{bubbles:!0,composed:!0}))}else!this.open&&t.open&&(t.close(),a(this,wa,Xh).call(this))}focusFirst(){let e=this.querySelector("[autofocus]");if(e){e.focus();return}this.renderRoot.querySelector(".panel")?.focus()}disconnectedCallback(){super.disconnectedCallback(),r(this,si)&&(jl(),g(this,si,!1))}renderHeader(e=h){return c`<header class="head" part="header">
718
718
  <h2 id="${this.uid}-h">${this.heading}</h2>${e}
719
719
  <button type="button" class="x" part="close" aria-label=${this.closeLabel||this.t("close")} @click=${()=>this.requestClose("close-button")}>
720
720
  <cm-icon name="close" size="18"></cm-icon></button>
@@ -754,7 +754,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
754
754
 
755
755
  }
756
756
  @keyframes cm-ovl-in { from { opacity: 0; } to { opacity: 1; } }
757
- `];var Rk=C("commandPalette",{label:"Command palette",placeholder:"Search or run a command",recent:"Recent",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all"}),Jb=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function Zb(o,n){let e=Jb(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=Jb([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var Kl,_e,Du,Ru,Ul,ip,rp,Qb,ev,$a=class extends oe{constructor(){super();m(this,_e);this.value="";this.results=[];this.actions=[];this.recent=[];this.loading=!1;this.shortcut="";this._active=-1;m(this,Kl,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!_u(e,this.shortcut)||!this.open&&!Tu(this.shortcut)&&Uh(e)||this.open&&!Tu(this.shortcut)||(e.preventDefault(),this.toggle())});m(this,ip,e=>{this.value=e.target.value,this._active=a(this,_e,Ul).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});m(this,rp,e=>{let t=a(this,_e,Ul).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Lh(this._active,e.key==="ArrowDown"?1:-1,t);break;case"Home":case"End":if(e.shiftKey||!t)break;e.preventDefault(),this._active=e.key==="Home"?0:t-1;break;case"Enter":if(e.isComposing||this._active<0)break;e.preventDefault(),this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.click();break;default:}});this.label=void 0}toggle(){this.open?this.requestClose("method"):this.show()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",r(this,Kl))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,Kl))}willUpdate(e){if(super.willUpdate?.(e),e.has("open")&&!this.open&&e.get("open")&&(this.value="",this._active=-1),["results","actions","recent","loading","value","open"].some(t=>e.has(t))){let t=a(this,_e,Ul).call(this).length;(this._active>=t||this._active<0)&&(this._active=t?0:-1)}}updated(e){super.updated(e),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.scrollIntoView({block:"nearest"})}focusFirst(){let e=this.renderRoot.querySelector("input");e?.focus(),e?.select()}render(){let e=this.open?a(this,_e,Ru).call(this):[],t=a(this,_e,Ul).call(this,e),i=r(this,_e,Du),s=t.filter(u=>u.item).length,l=!this.open||!i?"":this.loading?this.loadingText:t.length?this.t("results",{count:s}):this.emptyText,d=this.uid,p=-1;return this.renderDialog(c`<div class="panel" part="panel">
757
+ `];var Rk=C("commandPalette",{label:"Command palette",placeholder:"Search or run a command",recent:"Recent",noResults:"No results",results:{one:"{count} result",other:"{count} results"},seeAll:"See all"}),Jb=o=>o.normalize("NFD").replace(/\p{M}/gu,"").toLocaleLowerCase();function Zb(o,n){let e=Jb(n).split(/\s+/).filter(Boolean);if(!e.length)return!0;let t=Jb([o.title,...o.keywords??[]].join(" "));return e.every(i=>t.includes(i))}var Kl,Te,Du,Ru,Ul,ip,rp,Qb,ev,$a=class extends oe{constructor(){super();m(this,Te);this.value="";this.results=[];this.actions=[];this.recent=[];this.loading=!1;this.shortcut="";this._active=-1;m(this,Kl,e=>{!this.shortcut||e.defaultPrevented||e.repeat||!Tu(e,this.shortcut)||!this.open&&!_u(this.shortcut)&&Uh(e)||this.open&&!_u(this.shortcut)||(e.preventDefault(),this.toggle())});m(this,ip,e=>{this.value=e.target.value,this._active=a(this,Te,Ul).call(this).length?0:-1,this.dispatchEvent(new CustomEvent("cm-search",{detail:{query:this.value},bubbles:!0,composed:!0}))});m(this,rp,e=>{let t=a(this,Te,Ul).call(this).length;switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this._active=Lh(this._active,e.key==="ArrowDown"?1:-1,t);break;case"Home":case"End":if(e.shiftKey||!t)break;e.preventDefault(),this._active=e.key==="Home"?0:t-1;break;case"Enter":if(e.isComposing||this._active<0)break;e.preventDefault(),this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.click();break;default:}});this.label=void 0}toggle(){this.open?this.requestClose("method"):this.show()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",r(this,Kl))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",r(this,Kl))}willUpdate(e){if(super.willUpdate?.(e),e.has("open")&&!this.open&&e.get("open")&&(this.value="",this._active=-1),["results","actions","recent","loading","value","open"].some(t=>e.has(t))){let t=a(this,Te,Ul).call(this).length;(this._active>=t||this._active<0)&&(this._active=t?0:-1)}}updated(e){super.updated(e),(e.has("_active")||e.has("open"))&&this.open&&this._active>=0&&this.renderRoot.querySelector(`#${this.uid}-o${this._active}`)?.scrollIntoView({block:"nearest"})}focusFirst(){let e=this.renderRoot.querySelector("input");e?.focus(),e?.select()}render(){let e=this.open?a(this,Te,Ru).call(this):[],t=a(this,Te,Ul).call(this,e),i=r(this,Te,Du),s=t.filter(u=>u.item).length,l=!this.open||!i?"":this.loading?this.loadingText:t.length?this.t("results",{count:s}):this.emptyText,d=this.uid,p=-1;return this.renderDialog(c`<div class="panel" part="panel">
758
758
  <div class="top">
759
759
  <div class="box" part="box">
760
760
  <cm-icon name="search" size="16"></cm-icon>
@@ -773,13 +773,13 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
773
773
  <div role="listbox" id="${d}-list" part="listbox" aria-label=${this.label} ?hidden=${!t.length}>
774
774
  ${e.map((u,b)=>c`<div role="group" aria-labelledby="${d}-g${b}">
775
775
  ${Ch(`${d}-g${b}`,u.group.label,u.group.total!==void 0?this.formatNumber(u.group.total):void 0,this.t("results",{count:u.group.total??0}))}
776
- ${u.rows.map(f=>{let x=++p,y=f.item;return Sh({id:`${d}-o${x}`,active:x===this._active,href:f.href,cls:y?"":"all",keyshortcuts:y?.shortcut?Gb(y.shortcut):void 0,onHover:()=>this._active=x,onChoose:k=>a(this,_e,Qb).call(this,k,f)},y?zh(y,a(this,_e,ev).call(this,y.shortcut)):c`<span class="text">${f.group.seeAllLabel||this.seeAllLabel}</span>`)})}
776
+ ${u.rows.map(f=>{let x=++p,y=f.item;return Sh({id:`${d}-o${x}`,active:x===this._active,href:f.href,cls:y?"":"all",keyshortcuts:y?.shortcut?Gb(y.shortcut):void 0,onHover:()=>this._active=x,onChoose:k=>a(this,Te,Qb).call(this,k,f)},y?zh(y,a(this,Te,ev).call(this,y.shortcut)):c`<span class="text">${f.group.seeAllLabel||this.seeAllLabel}</span>`)})}
777
777
  </div>`)}
778
778
  </div>
779
779
  ${i&&!this.loading&&!t.length?c`<p class="message" aria-hidden="true">${this.emptyText}</p>`:h}
780
780
  </div>
781
781
  <span class="vh" role="status" aria-live="polite">${l}</span>
782
- </div>`)}};Kl=new WeakMap,_e=new WeakSet,Du=function(){return this.value.trim()},Ru=function(){let e=r(this,_e,Du),t=[],i=(s,l,d=!1)=>{let p=l.map(u=>({group:s,item:u,href:u.href}));d&&s.href&&p.push({group:s,href:s.href}),l.length&&t.push({group:s,rows:p})};if(!e)this.recent?.length&&i({label:this.recentLabel,items:this.recent},this.recent);else if(!this.loading)for(let s of this.results??[])s?.items?.length&&i(s,s.items,!0);for(let s of this.actions??[])s?.items?.length&&i(s,e?s.items.filter(l=>Zb(l,e)):s.items);return t},Ul=function(e=a(this,_e,Ru).call(this)){return e.flatMap(t=>t.rows)},ip=new WeakMap,rp=new WeakMap,Qb=function(e,t){if(this.closeNow(),!this.dispatchEvent(new CustomEvent("cm-select",{detail:{item:t.item,group:t.group,href:t.href},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}t.item?.run?.(t.item)},ev=function(e){return e?c`<span class="keys" aria-hidden="true">${Kh(e).map(t=>c`<kbd>${t}</kbd>`)}</span>`:h},$a.properties={...oe.properties,label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},actions:{type:Array},recent:{type:Array},loading:{type:Boolean,reflect:!0},shortcut:{},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},recentLabel:{attribute:"recent-label",string:"recent"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},_active:{state:!0}},$a.styles=[...oe.overlayStyles,la,Pi,_h,w`
782
+ </div>`)}};Kl=new WeakMap,Te=new WeakSet,Du=function(){return this.value.trim()},Ru=function(){let e=r(this,Te,Du),t=[],i=(s,l,d=!1)=>{let p=l.map(u=>({group:s,item:u,href:u.href}));d&&s.href&&p.push({group:s,href:s.href}),l.length&&t.push({group:s,rows:p})};if(!e)this.recent?.length&&i({label:this.recentLabel,items:this.recent},this.recent);else if(!this.loading)for(let s of this.results??[])s?.items?.length&&i(s,s.items,!0);for(let s of this.actions??[])s?.items?.length&&i(s,e?s.items.filter(l=>Zb(l,e)):s.items);return t},Ul=function(e=a(this,Te,Ru).call(this)){return e.flatMap(t=>t.rows)},ip=new WeakMap,rp=new WeakMap,Qb=function(e,t){if(this.closeNow(),!this.dispatchEvent(new CustomEvent("cm-select",{detail:{item:t.item,group:t.group,href:t.href},bubbles:!0,composed:!0,cancelable:!0}))){e.preventDefault();return}t.item?.run?.(t.item)},ev=function(e){return e?c`<span class="keys" aria-hidden="true">${Kh(e).map(t=>c`<kbd>${t}</kbd>`)}</span>`:h},$a.properties={...oe.properties,label:{string:"label"},placeholder:{string:"placeholder"},value:{},results:{type:Array},actions:{type:Array},recent:{type:Array},loading:{type:Boolean,reflect:!0},shortcut:{},emptyText:{attribute:"empty-text",string:"noResults"},loadingText:{attribute:"loading-text",string:"loading"},recentLabel:{attribute:"recent-label",string:"recent"},seeAllLabel:{attribute:"see-all-label",string:"seeAll"},_active:{state:!0}},$a.styles=[...oe.overlayStyles,la,Pi,Th,w`
783
783
  dialog {
784
784
  position: fixed; inset: 0; margin: max(var(--cm-space-16), 12dvh) auto auto; height: fit-content;
785
785
  width: min(var(--cm-command-palette-width, 640px), calc(100vw - 32px));
@@ -820,7 +820,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
820
820
  .x { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
821
821
  [role='option'] { min-height: var(--cm-control-height-touch); }
822
822
  }
823
- `];$("cm-command-palette",$a);var Zw=/^(\d{4})-(\d{2})-(\d{2})$/;function P(o){let n=Zw.exec(o??"");if(!n)return null;let e=new Date(+n[1],+n[2]-1,+n[3]);return e.getFullYear()===+n[1]&&e.getMonth()===+n[2]-1&&e.getDate()===+n[3]?e:null}var Pt=(o,n=2)=>String(o).padStart(n,"0"),B=o=>`${Pt(o.getFullYear(),4)}-${Pt(o.getMonth()+1)}-${Pt(o.getDate())}`,Hu=()=>B(new Date),Z=(o,n)=>new Date(o.getFullYear(),o.getMonth(),o.getDate()+n);function Me(o,n){let e=new Date(o.getFullYear(),o.getMonth()+n,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(o.getDate(),t))}var Tt=o=>new Date(o.getFullYear(),o.getMonth(),1),ka=o=>new Date(o.getFullYear(),o.getMonth()+1,0);var Qw=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function ye(o){let n=Qw.exec(o??"");return n?+n[1]*60+ +n[2]:null}var ai=o=>{let n=(Math.round(o)%1440+1440)%1440;return`${Pt(Math.floor(n/60))}:${Pt(n%60)}`};function ut(o){let[n="",e=""]=(o??"").split("T"),t=ye(e);return{date:P(n)?n:"",time:t===null?"":ai(t)}}function It(o,n=!1){let{date:e,time:t}=ut(o),i=P(e);if(!i)return null;let s=t?ye(t):n?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(s/60),s%60)}var rv=()=>{let o=new Date;return`${B(o)}T${Pt(o.getHours())}:${Pt(o.getMinutes())}`},tv=new Map;function Ea(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=tv.get(t);if(i)return i;let s={hour:e==="h23"?"2-digit":"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},l=new Intl.DateTimeFormat(o,s),d=l.resolvedOptions().hourCycle,p=k=>new Date(2e3,0,1,k,30),u=k=>(new Intl.DateTimeFormat(o,{hour:"numeric",hourCycle:"h12"}).formatToParts(p(k)).find(S=>S.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),b=(k,S)=>[...new Set([k,...S].filter(Boolean))],f=k=>k.replace(/[\u202f\u00a0]/g," "),x=f(l.formatToParts(p(9)).map(k=>k.type==="hour"?"{h}":k.type==="minute"?"{m}":k.value).join("")),y={format:k=>f(l.format(new Date(2e3,0,1,Math.floor(k/60),k%60))),dateTime:k=>he(k,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},o),pattern:x,hour12:d==="h12"||d==="h11",am:b(u(9),["am","a"]),pm:b(u(15),["pm","p"])};return tv.set(t,y),y}var sp=(o,n)=>o.pattern.replace(/\{([hm])\}/g,(e,t)=>n[t]);function Vr(o,n){let e=o.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&n.pm.includes(t),s=!!t&&n.am.includes(t);if(t&&!i&&!s)return null;let l=e.match(/\d+/g)??[],d,p;if(l.length===1){let u=l[0];if(u.length<=2)d=+u,p=0;else if(u.length<=4)d=+u.slice(0,-2),p=+u.slice(-2);else return null}else if(l.length===2||l.length===3){if(l[0].length>2||l[1].length!==2)return null;d=+l[0],p=+l[1]}else return null;if(p>59)return null;if(s||i){if(d<1||d>12)return null;d=d%12+(i?12:0)}else if(d>23)return null;return ai(d*60+p)}var Ma={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},Ta=o=>Array.isArray(o)?o:typeof o=="string"?Ma.fromAttribute(o):[];function Fi(o,n){let e=[n,dl(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function _a(o){try{let n=new Intl.Locale(o),e=n.getWeekInfo?.()??n.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var iv=new Map;function Ca(o){let n=iv.get(o);if(n)return n;let e=y=>new Intl.DateTimeFormat(o,y),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),s=e({weekday:"long"}),l=new Date(2024,0,7),d=t.formatToParts(new Date(2026,10,15)),p=d.filter(y=>y.type==="day"||y.type==="month"||y.type==="year").map(y=>y.type),u=d.map(y=>y.type==="day"?"{d}":y.type==="month"?"{m}":y.type==="year"?"{y}":y.value).join(""),b=(y,k)=>Array.from({length:12},(S,H)=>new Intl.DateTimeFormat(y,{month:k}).format(new Date(2024,H,1)).toLowerCase().replace(/\./g,"")),f=Array.from({length:12},(y,k)=>[...new Set([b(o,"long")[k],b(o,"short")[k],b("en","long")[k],b("en","short")[k]])]),x={short:y=>t.format(y),long:y=>he(y,{weekday:"long",day:"numeric",month:"long",year:"numeric"},o),medium:y=>he(y,{day:"numeric",month:"short",year:"numeric"},o),monthYear:y=>he(y,{month:"long",year:"numeric"},o),day:y=>he(y,{day:"numeric"},o),weekdaysShort:Array.from({length:7},(y,k)=>i.format(Z(l,k))),weekdaysLong:Array.from({length:7},(y,k)=>s.format(Z(l,k))),pattern:p.length===3?u:"{y}-{m}-{d}",order:p.length===3?p:["year","month","day"],months:f};return iv.set(o,x),x}var ap=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function np(o,n){let e=o.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,s,l,d=t.findIndex(u=>/\p{L}/u.test(u));if(d>=0){let u=t[d];s=n.months.findIndex(y=>y.some(k=>k===u||u.length>=3&&k.startsWith(u)))+1;let b=t.filter((y,k)=>k!==d);if(!s||b.some(y=>!/^\d+$/.test(y)))return null;let f=b.findIndex(y=>y.length===4),x=f>=0?f:1;i=+b[x],l=+b[1-x],b[x].length<=2&&(i+=2e3)}else{if(t.some(f=>!/^\d+$/.test(f)))return null;let u=t[0].length===4?["year","month","day"]:n.order,b=f=>t[u.indexOf(f)];if(i=+b("year"),s=+b("month"),l=+b("day"),b("year").length<=2)i+=2e3;else if(b("year").length!==4)return null}let p=`${Pt(i,4)}-${Pt(s)}-${Pt(l)}`;return P(p)?p:null}function op(o,n,e,t){let i=(e.getDay()-t+7)%7;switch(o){case"ArrowRight":return Z(e,1);case"ArrowLeft":return Z(e,-1);case"ArrowDown":return Z(e,7);case"ArrowUp":return Z(e,-7);case"Home":return Z(e,-i);case"End":return Z(e,6-i);case"PageDown":return Me(e,n.shiftKey?12:1);case"PageUp":return Me(e,n.shiftKey?-12:-1);default:return null}}var qt=(o,n,e)=>n&&o<n?n:e&&o>e?e:o;function lp(o){let{fmt:n,firstDay:e,month:t,focus:i,min:s,max:l}=o,d=Tt(t),p=(d.getDay()-e+7)%7,u=ka(t).getDate(),b=[],f=Array(p).fill(null);for(let H=1;H<=u;H++)f.push(new Date(t.getFullYear(),t.getMonth(),H)),f.length===7&&(b.push(f),f=[]);f.length&&b.push([...f,...Array(7-f.length).fill(null)]);let x=Array.from({length:7},(H,O)=>(O+e)%7),y=Hu(),k=!!s&&ka(Me(d,-1))<s,S=!!l&&Me(d,1)>l;return c`<div class="cal-head">
823
+ `];$("cm-command-palette",$a);var Zw=/^(\d{4})-(\d{2})-(\d{2})$/;function P(o){let n=Zw.exec(o??"");if(!n)return null;let e=new Date(+n[1],+n[2]-1,+n[3]);return e.getFullYear()===+n[1]&&e.getMonth()===+n[2]-1&&e.getDate()===+n[3]?e:null}var Pt=(o,n=2)=>String(o).padStart(n,"0"),B=o=>`${Pt(o.getFullYear(),4)}-${Pt(o.getMonth()+1)}-${Pt(o.getDate())}`,Hu=()=>B(new Date),Z=(o,n)=>new Date(o.getFullYear(),o.getMonth(),o.getDate()+n);function Me(o,n){let e=new Date(o.getFullYear(),o.getMonth()+n,1),t=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return new Date(e.getFullYear(),e.getMonth(),Math.min(o.getDate(),t))}var _t=o=>new Date(o.getFullYear(),o.getMonth(),1),ka=o=>new Date(o.getFullYear(),o.getMonth()+1,0);var Qw=/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d(?:\.\d{1,3})?)?$/;function ye(o){let n=Qw.exec(o??"");return n?+n[1]*60+ +n[2]:null}var ai=o=>{let n=(Math.round(o)%1440+1440)%1440;return`${Pt(Math.floor(n/60))}:${Pt(n%60)}`};function ut(o){let[n="",e=""]=(o??"").split("T"),t=ye(e);return{date:P(n)?n:"",time:t===null?"":ai(t)}}function It(o,n=!1){let{date:e,time:t}=ut(o),i=P(e);if(!i)return null;let s=t?ye(t):n?1439:0;return new Date(i.getFullYear(),i.getMonth(),i.getDate(),Math.floor(s/60),s%60)}var rv=()=>{let o=new Date;return`${B(o)}T${Pt(o.getHours())}:${Pt(o.getMinutes())}`},tv=new Map;function Ea(o,n){let e=n==="h12"||n==="h23"?n:void 0,t=`${o}|${e??""}`,i=tv.get(t);if(i)return i;let s={hour:e==="h23"?"2-digit":"numeric",minute:"2-digit",numberingSystem:"latn",...e?{hourCycle:e}:{}},l=new Intl.DateTimeFormat(o,s),d=l.resolvedOptions().hourCycle,p=k=>new Date(2e3,0,1,k,30),u=k=>(new Intl.DateTimeFormat(o,{hour:"numeric",hourCycle:"h12"}).formatToParts(p(k)).find(S=>S.type==="dayPeriod")?.value??"").toLowerCase().replace(/[^\p{L}]/gu,""),b=(k,S)=>[...new Set([k,...S].filter(Boolean))],f=k=>k.replace(/[\u202f\u00a0]/g," "),x=f(l.formatToParts(p(9)).map(k=>k.type==="hour"?"{h}":k.type==="minute"?"{m}":k.value).join("")),y={format:k=>f(l.format(new Date(2e3,0,1,Math.floor(k/60),k%60))),dateTime:k=>he(k,{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",...e?{hourCycle:e}:{}},o),pattern:x,hour12:d==="h12"||d==="h11",am:b(u(9),["am","a"]),pm:b(u(15),["pm","p"])};return tv.set(t,y),y}var sp=(o,n)=>o.pattern.replace(/\{([hm])\}/g,(e,t)=>n[t]);function Vr(o,n){let e=o.trim().toLowerCase().normalize("NFKC");if(!e)return null;let t=e.replace(/[^\p{L}]/gu,""),i=!!t&&n.pm.includes(t),s=!!t&&n.am.includes(t);if(t&&!i&&!s)return null;let l=e.match(/\d+/g)??[],d,p;if(l.length===1){let u=l[0];if(u.length<=2)d=+u,p=0;else if(u.length<=4)d=+u.slice(0,-2),p=+u.slice(-2);else return null}else if(l.length===2||l.length===3){if(l[0].length>2||l[1].length!==2)return null;d=+l[0],p=+l[1]}else return null;if(p>59)return null;if(s||i){if(d<1||d>12)return null;d=d%12+(i?12:0)}else if(d>23)return null;return ai(d*60+p)}var Ma={fromAttribute:o=>o?o.split(/[\s,]+/).filter(Boolean):[],toAttribute:o=>Array.isArray(o)?o.join(" "):o},_a=o=>Array.isArray(o)?o:typeof o=="string"?Ma.fromAttribute(o):[];function Fi(o,n){let e=[n,dl(o)??"",navigator.language,"en"];for(let t of e)if(t)try{if(Intl.DateTimeFormat.supportedLocalesOf([t]).length)return t}catch{}return"en"}function Ta(o){try{let n=new Intl.Locale(o),e=n.getWeekInfo?.()??n.weekInfo;if(e?.firstDay)return e.firstDay%7}catch{}return 0}var iv=new Map;function Ca(o){let n=iv.get(o);if(n)return n;let e=y=>new Intl.DateTimeFormat(o,y),t=e({day:"2-digit",month:"2-digit",year:"numeric",numberingSystem:"latn"}),i=e({weekday:"short"}),s=e({weekday:"long"}),l=new Date(2024,0,7),d=t.formatToParts(new Date(2026,10,15)),p=d.filter(y=>y.type==="day"||y.type==="month"||y.type==="year").map(y=>y.type),u=d.map(y=>y.type==="day"?"{d}":y.type==="month"?"{m}":y.type==="year"?"{y}":y.value).join(""),b=(y,k)=>Array.from({length:12},(S,H)=>new Intl.DateTimeFormat(y,{month:k}).format(new Date(2024,H,1)).toLowerCase().replace(/\./g,"")),f=Array.from({length:12},(y,k)=>[...new Set([b(o,"long")[k],b(o,"short")[k],b("en","long")[k],b("en","short")[k]])]),x={short:y=>t.format(y),long:y=>he(y,{weekday:"long",day:"numeric",month:"long",year:"numeric"},o),medium:y=>he(y,{day:"numeric",month:"short",year:"numeric"},o),monthYear:y=>he(y,{month:"long",year:"numeric"},o),day:y=>he(y,{day:"numeric"},o),weekdaysShort:Array.from({length:7},(y,k)=>i.format(Z(l,k))),weekdaysLong:Array.from({length:7},(y,k)=>s.format(Z(l,k))),pattern:p.length===3?u:"{y}-{m}-{d}",order:p.length===3?p:["year","month","day"],months:f};return iv.set(o,x),x}var ap=(o,n)=>o.pattern.replace(/\{([dmy])\}/g,(e,t)=>n[t]);function np(o,n){let e=o.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,s,l,d=t.findIndex(u=>/\p{L}/u.test(u));if(d>=0){let u=t[d];s=n.months.findIndex(y=>y.some(k=>k===u||u.length>=3&&k.startsWith(u)))+1;let b=t.filter((y,k)=>k!==d);if(!s||b.some(y=>!/^\d+$/.test(y)))return null;let f=b.findIndex(y=>y.length===4),x=f>=0?f:1;i=+b[x],l=+b[1-x],b[x].length<=2&&(i+=2e3)}else{if(t.some(f=>!/^\d+$/.test(f)))return null;let u=t[0].length===4?["year","month","day"]:n.order,b=f=>t[u.indexOf(f)];if(i=+b("year"),s=+b("month"),l=+b("day"),b("year").length<=2)i+=2e3;else if(b("year").length!==4)return null}let p=`${Pt(i,4)}-${Pt(s)}-${Pt(l)}`;return P(p)?p:null}function op(o,n,e,t){let i=(e.getDay()-t+7)%7;switch(o){case"ArrowRight":return Z(e,1);case"ArrowLeft":return Z(e,-1);case"ArrowDown":return Z(e,7);case"ArrowUp":return Z(e,-7);case"Home":return Z(e,-i);case"End":return Z(e,6-i);case"PageDown":return Me(e,n.shiftKey?12:1);case"PageUp":return Me(e,n.shiftKey?-12:-1);default:return null}}var qt=(o,n,e)=>n&&o<n?n:e&&o>e?e:o;function lp(o){let{fmt:n,firstDay:e,month:t,focus:i,min:s,max:l}=o,d=_t(t),p=(d.getDay()-e+7)%7,u=ka(t).getDate(),b=[],f=Array(p).fill(null);for(let H=1;H<=u;H++)f.push(new Date(t.getFullYear(),t.getMonth(),H)),f.length===7&&(b.push(f),f=[]);f.length&&b.push([...f,...Array(7-f.length).fill(null)]);let x=Array.from({length:7},(H,O)=>(O+e)%7),y=Hu(),k=!!s&&ka(Me(d,-1))<s,S=!!l&&Me(d,1)>l;return c`<div class="cal-head">
824
824
  ${o.hideNav==="previous"?c`<span class="cal-nav-gap"></span>`:c`<button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.previousLabel} ?disabled=${k} @click=${()=>o.onMonth(-1)}><cm-icon name="chevron-left" size="18"></cm-icon></button>`}
825
825
  <h2 id="${o.id}-month" class="cal-title" aria-live="polite">${n.monthYear(t)}</h2>
826
826
  ${o.hideNav==="next"?c`<span class="cal-nav-gap"></span>`:c`<button type="button" class="cal-nav" part="calendar-nav" aria-label=${o.nextLabel} ?disabled=${S} @click=${()=>o.onMonth(1)}><cm-icon name="chevron-right" size="18"></cm-icon></button>`}
@@ -898,7 +898,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
898
898
  .wrap.timed { display: flex; flex-wrap: wrap; gap: var(--cm-space-8); }
899
899
  .wrap.timed .box { width: auto; min-inline-size: 0; flex: 2 1 10.5rem; }
900
900
  .wrap.timed .box.time { flex: 1 1 7.5rem; padding-inline: var(--_cm-field-pad); }
901
- `;var Wk=C("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."}}),Da,be,Kr,gt,Ra,ci,Ki,Ge,it,Ha,Na,M,Gl,Vi,Pa,hp,jr,Sa,ni,ji,oi,li,pp,Nu,mp,La,Ur,up,Pu,sv,gp,av,nv,di,Ia,Iu,Aa,Wl,Yl,qu,ov,fp,Ou,Bu,bp,vp,yp,xp,wp,Xl,Ui=class extends _{constructor(){super(...arguments);m(this,M);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";m(this,Da,"");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._dateError="";this._timeError="";this._focus=new Date;m(this,be,this.attachInternals());m(this,Kr,new ie(this,r(this,be)));m(this,gt,N("cm-dp"));m(this,Ra,null);m(this,ci,!1);m(this,Ki,!1);m(this,Ge,"");m(this,it,"");m(this,Ha,!1);m(this,Na,"");m(this,Pa,!1);m(this,di,new fe);m(this,Ia,!1);m(this,fp,e=>{e.key==="Enter"?a(this,M,qu).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,M,ov).call(this,e.key==="ArrowUp"?1:-1))});m(this,bp,()=>{this.disabled||(this.open?this.open=!1:(a(this,M,Yl).call(this),this.show()))});m(this,vp,e=>{e.key==="Enter"?a(this,M,Yl).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,M,Yl).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});m(this,yp,e=>{let t=op(re(e,this),e,this._focus,r(this,M,Nu));if(t){e.preventDefault(),this._focus=qt(t,r(this,M,oi),r(this,M,li)),g(this,Ki,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,M,Ou).call(this,this._focus))});m(this,xp,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,M,Bu).call(this);return}dp(e,e.currentTarget)});m(this,wp,e=>{this._focus=qt(Me(this._focus,e),r(this,M,oi),r(this,M,li))});m(this,Xl,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Da)}set locale(e){let t=r(this,Da);g(this,Da,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Ra)===null&&g(this,Ra,this.value),document.addEventListener("pointerdown",r(this,Xl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,di).close(),document.removeEventListener("pointerdown",r(this,Xl),!0)}get form(){return r(this,be).form}get validity(){return r(this,be).validity}get validationMessage(){return r(this,be).validationMessage}get valueAsDate(){return this.time?this.value?It(this.value):null:P(this.value)}checkValidity(){return a(this,M,gp).call(this),r(this,be).checkValidity()}reportValidity(){return a(this,M,gp).call(this),r(this,Kr).report(()=>r(this,be).reportValidity())}formResetCallback(){r(this,Kr).reset(),this._dateError=this._timeError="",this.value=r(this,Ra)??"",this.time&&(a(this,M,Pu).call(this,this.value),g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi)),this._text=a(this,M,La).call(this,r(this,M,ni)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(a(this,M,sv).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=P(e);if(!t)return!0;let i=r(this,M,oi),s=r(this,M,li);return i&&t<i||s&&t>s?!0:Ta(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Pa)?(a(this,M,Pu).call(this,this.value),r(this,Ha)||g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi)):this.time&&(e.has("locale")||e.has("hourCycle"))&&r(this,it)&&g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi),(e.has("value")||e.has("time"))&&!r(this,ci)?this._text=a(this,M,La).call(this,r(this,M,ni)):e.has("locale")&&P(r(this,M,ni))&&(this._text=a(this,M,La).call(this,r(this,M,ni))),e.has("value")&&!r(this,Ia)&&(this._dateError=this._timeError=""),g(this,Ia,!1),g(this,ci,!1),g(this,Ha,!1),g(this,Pa,!1)}updated(e){this.open&&!r(this,di).active?r(this,di).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,di).active?r(this,di).close():this.open&&r(this,di).place(),r(this,be).setFormValue(this.value||null,this.time?this.value:this._text),a(this,M,gp).call(this),this.open&&r(this,Ki)&&(g(this,Ki,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,Ki,!1)}render(){let e=r(this,M,jr),t=P(r(this,M,ni)),i=[this._dateError,this._timeError].filter(Boolean).join(" "),s=r(this,Kr).message,l=this.error||i||s,d=!this.error&&!i&&!!s,p=[l&&`${r(this,gt)}-err`,this.helpText&&`${r(this,gt)}-help`].filter(Boolean).join(" "),u=this.getAttribute("aria-label"),b=this.label||u||"",f=Tt(this._focus);return c`<div class="field">
901
+ `;var Wk=C("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."}}),Da,be,Kr,gt,Ra,ci,Ki,Ge,it,Ha,Na,M,Gl,Vi,Pa,hp,jr,Sa,ni,ji,oi,li,pp,Nu,mp,La,Ur,up,Pu,sv,gp,av,nv,di,Ia,Iu,Aa,Wl,Yl,qu,ov,fp,Ou,Bu,bp,vp,yp,xp,wp,Xl,Ui=class extends T{constructor(){super(...arguments);m(this,M);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.min="";this.max="";this.placeholder="";m(this,Da,"");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._dateError="";this._timeError="";this._focus=new Date;m(this,be,this.attachInternals());m(this,Kr,new ie(this,r(this,be)));m(this,gt,N("cm-dp"));m(this,Ra,null);m(this,ci,!1);m(this,Ki,!1);m(this,Ge,"");m(this,it,"");m(this,Ha,!1);m(this,Na,"");m(this,Pa,!1);m(this,di,new fe);m(this,Ia,!1);m(this,fp,e=>{e.key==="Enter"?a(this,M,qu).call(this):(e.key==="ArrowUp"||e.key==="ArrowDown")&&!e.altKey&&(e.preventDefault(),a(this,M,ov).call(this,e.key==="ArrowUp"?1:-1))});m(this,bp,()=>{this.disabled||(this.open?this.open=!1:(a(this,M,Yl).call(this),this.show()))});m(this,vp,e=>{e.key==="Enter"?a(this,M,Yl).call(this):e.key==="ArrowDown"&&e.altKey?(e.preventDefault(),a(this,M,Yl).call(this),this.show()):e.key==="Escape"&&this.open&&(e.preventDefault(),this.open=!1)});m(this,yp,e=>{let t=op(re(e,this),e,this._focus,r(this,M,Nu));if(t){e.preventDefault(),this._focus=qt(t,r(this,M,oi),r(this,M,li)),g(this,Ki,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,M,Ou).call(this,this._focus))});m(this,xp,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,M,Bu).call(this);return}dp(e,e.currentTarget)});m(this,wp,e=>{this._focus=qt(Me(this._focus,e),r(this,M,oi),r(this,M,li))});m(this,Xl,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Da)}set locale(e){let t=r(this,Da);g(this,Da,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,Ra)===null&&g(this,Ra,this.value),document.addEventListener("pointerdown",r(this,Xl),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,di).close(),document.removeEventListener("pointerdown",r(this,Xl),!0)}get form(){return r(this,be).form}get validity(){return r(this,be).validity}get validationMessage(){return r(this,be).validationMessage}get valueAsDate(){return this.time?this.value?It(this.value):null:P(this.value)}checkValidity(){return a(this,M,gp).call(this),r(this,be).checkValidity()}reportValidity(){return a(this,M,gp).call(this),r(this,Kr).report(()=>r(this,be).reportValidity())}formResetCallback(){r(this,Kr).reset(),this._dateError=this._timeError="",this.value=r(this,Ra)??"",this.time&&(a(this,M,Pu).call(this,this.value),g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi)),this._text=a(this,M,La).call(this,r(this,M,ni)),this.open=!1}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(a(this,M,sv).call(this),this.open=!0)}close(){this.open=!1}isUnavailable(e){let t=P(e);if(!t)return!0;let i=r(this,M,oi),s=r(this,M,li);return i&&t<i||s&&t>s?!0:_a(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){this.time&&(e.has("value")||e.has("time"))&&!r(this,Pa)?(a(this,M,Pu).call(this,this.value),r(this,Ha)||g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi)):this.time&&(e.has("locale")||e.has("hourCycle"))&&r(this,it)&&g(this,M,a(this,M,Ur).call(this,r(this,it)),Vi),(e.has("value")||e.has("time"))&&!r(this,ci)?this._text=a(this,M,La).call(this,r(this,M,ni)):e.has("locale")&&P(r(this,M,ni))&&(this._text=a(this,M,La).call(this,r(this,M,ni))),e.has("value")&&!r(this,Ia)&&(this._dateError=this._timeError=""),g(this,Ia,!1),g(this,ci,!1),g(this,Ha,!1),g(this,Pa,!1)}updated(e){this.open&&!r(this,di).active?r(this,di).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,di).active?r(this,di).close():this.open&&r(this,di).place(),r(this,be).setFormValue(this.value||null,this.time?this.value:this._text),a(this,M,gp).call(this),this.open&&r(this,Ki)&&(g(this,Ki,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus()),e.has("open")&&e.get("open")===!0&&!this.open&&g(this,Ki,!1)}render(){let e=r(this,M,jr),t=P(r(this,M,ni)),i=[this._dateError,this._timeError].filter(Boolean).join(" "),s=r(this,Kr).message,l=this.error||i||s,d=!this.error&&!i&&!!s,p=[l&&`${r(this,gt)}-err`,this.helpText&&`${r(this,gt)}-help`].filter(Boolean).join(" "),u=this.getAttribute("aria-label"),b=this.label||u||"",f=_t(this._focus);return c`<div class="field">
902
902
  ${this.label?c`<label class="label" for="${r(this,gt)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
903
903
  <div class="wrap ${this.time?"timed":""}">
904
904
  <div class="box ${this._dateError&&!this.error||d?"invalid":""}" part="box">
@@ -930,12 +930,12 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
930
930
  </div>
931
931
  ${l?c`<p class="error" id="${r(this,gt)}-err" role="alert">${l}</p>`:h}
932
932
  ${this.helpText?c`<p class="help" id="${r(this,gt)}-help">${this.helpText}</p>`:h}
933
- </div>`}};Da=new WeakMap,be=new WeakMap,Kr=new WeakMap,gt=new WeakMap,Ra=new WeakMap,ci=new WeakMap,Ki=new WeakMap,Ge=new WeakMap,it=new WeakMap,Ha=new WeakMap,Na=new WeakMap,M=new WeakSet,Gl=function(){return r(this,Na)},Vi=function(e){e!==r(this,Na)&&(g(this,Na,e),this.requestUpdate())},Pa=new WeakMap,hp=function(){return Fi(this,this.locale)},jr=function(){return Ca(r(this,M,hp))},Sa=function(){return Ea(r(this,M,hp),this.hourCycle)},ni=function(){return this.time?r(this,Ge):this.value},ji=function(e){return this.time&&e.trim().toLowerCase()==="now"?rv():e},oi=function(){return P(ut(a(this,M,ji).call(this,this.min)).date||this.min)},li=function(){return P(ut(a(this,M,ji).call(this,this.max)).date||this.max)},pp=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Nu=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?_a(r(this,M,hp)):(Math.trunc(e)%7+7)%7},mp=function(){return ap(r(this,M,jr),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},La=function(e){let t=P(e);return t?r(this,M,jr).short(t):e},Ur=function(e){let t=ye(e);return t===null?"":r(this,M,Sa).format(t)},up=function(){return sp(r(this,M,Sa),{h:this.t("patternHour"),m:this.t("patternMinute")})},Pu=function(e){let{date:t,time:i}=ut(e);g(this,Ge,t),g(this,it,t?i:"")},sv=function(){let e=new Date,t=P(r(this,M,ni))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=qt(t,r(this,M,oi),r(this,M,li)),g(this,Ki,!0)},gp=function(){a(this,M,av).call(this),r(this,Kr).sync()},av=function(){let e=this.renderRoot.querySelector("input")??void 0,t=P(r(this,M,ni)),i=r(this,M,jr);this.error?r(this,be).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,be).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,M,mp)}),e):this.time?a(this,M,nv).call(this,t,e):this.required&&!t?r(this,be).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,M,oi)&&t<r(this,M,oi)?r(this,be).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,M,oi))}),e):t&&r(this,M,li)&&t>r(this,M,li)?r(this,be).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,M,li))}),e):t&&this.isUnavailable(this.value)?r(this,be).setValidity({customError:!0},this.t("unavailable"),e):r(this,be).setValidity({})},nv=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,s=(f,x,y,k=t)=>r(this,be).setValidity(f,this.t(x,y),k),l=ye(r(this,it));if(r(this,M,Gl).trim()&&l===null)return s({badInput:!0},"badTime",{pattern:r(this,M,up)},i);if(!e&&l===null)return this.required?s({valueMissing:!0},"required"):r(this,be).setValidity({});if(!e)return s({badInput:!0},"required");if(l===null)return s({badInput:!0},"timeMissing",void 0,i);let d=It(`${r(this,Ge)}T${r(this,it)}`),p=It(a(this,M,ji).call(this,this.min)),u=It(a(this,M,ji).call(this,this.max),!0),b=(f,x)=>ut(f).time?r(this,M,Sa).dateTime(x):r(this,M,jr).medium(x);if(p&&d<p)return s({rangeUnderflow:!0},"rangeUnderflow",{date:b(a(this,M,ji).call(this,this.min),p)},i);if(u&&d>u)return s({rangeOverflow:!0},"rangeOverflow",{date:b(a(this,M,ji).call(this,this.max),u)},i);if(l%r(this,M,pp))return s({stepMismatch:!0},"stepMismatch",{count:r(this,M,pp)},i);if(this.isUnavailable(r(this,Ge)))return s({customError:!0},"unavailable");r(this,be).setValidity({})},di=new WeakMap,Ia=new WeakMap,Iu=function(e){e!==this.value&&(g(this,Ia,!0),this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Aa=function(e,t){g(this,Ge,e),g(this,it,t);let i=e&&t?`${e}T${t}`:"";g(this,Pa,!0),this.requestUpdate(),a(this,M,Iu).call(this,i)},Wl=function(e){this.time?a(this,M,Aa).call(this,e,r(this,it)):a(this,M,Iu).call(this,e)},Yl=function(){let e=this._text.trim();if(this._dateError="",!e){a(this,M,Wl).call(this,"");return}let t=np(e,r(this,M,jr));t?(a(this,M,Wl).call(this,t),this._text=a(this,M,La).call(this,t)):(g(this,ci,!0),a(this,M,Wl).call(this,""),this._dateError=this.t("badInput",{pattern:r(this,M,mp)}))},qu=function(){let e=r(this,M,Gl).trim(),t=e?Vr(e,r(this,M,Sa)):"";if(g(this,ci,!0),t===null){g(this,Ha,!0),a(this,M,Aa).call(this,r(this,Ge),""),this._timeError=this.t("badTime",{pattern:r(this,M,up)});return}this._timeError="",a(this,M,Aa).call(this,r(this,Ge),t),g(this,M,a(this,M,Ur).call(this,t),Vi)},ov=function(e){let t=r(this,M,pp),i=Vr(r(this,M,Gl),r(this,M,Sa));if(!i){let p=ut(a(this,M,ji).call(this,this.min)),u=new Date;if(i=p.time&&(!r(this,Ge)||r(this,Ge)===p.date)?p.time:ai(u.getHours()*60+u.getMinutes()),ye(i)%t===0){g(this,ci,!0),a(this,M,Aa).call(this,r(this,Ge),i),g(this,M,a(this,M,Ur).call(this,i),Vi);return}e=1}let s=ye(i),l=e>0?(Math.floor(s/t)+1)*t:(Math.ceil(s/t)-1)*t,d=ai(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,ci,!0),a(this,M,Aa).call(this,r(this,Ge),d),g(this,M,a(this,M,Ur).call(this,d),Vi)},fp=new WeakMap,Ou=function(e){let t=B(e);this.isUnavailable(t)||(this.open=!1,a(this,M,Wl).call(this,t),this._text=a(this,M,La).call(this,t),this._dateError="",this.time&&!r(this,it)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,M,Bu).call(this))},Bu=function(){this.renderRoot.querySelector(".trigger")?.focus()},bp=new WeakMap,vp=new WeakMap,yp=new WeakMap,xp=new WeakMap,wp=new WeakMap,Xl=new WeakMap,Ui.formAssociated=!0,Ui.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ui.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:Ma},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},_dateError:{state:!0},_timeError:{state:!0},_focus:{state:!0}},Ui.styles=[E,Ae,za,cp,w`.pop { min-width: 0; }`];$("cm-date-picker",Ui);var sE=C("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",thisWeek:"This week",lastWeek:"Last week",last28Days:"Last 28 days",last12Months:"Last 12 months",thisYear:"This year",lastYear:"Last year",custom:"Custom",apply:"Apply",cancel:"Cancel",noRange:"No dates chosen"}),Fu=(o,n)=>Z(o,-((o.getDay()-n+7)%7)),lv={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[Z(o,-1),Z(o,-1)]],"this-week":["This week",(o,n)=>[Fu(o,n),o]],"last-week":["Last week",(o,n)=>[Z(Fu(o,n),-7),Z(Fu(o,n),-1)]],"last-7-days":["Last 7 days",o=>[Z(o,-6),o]],"last-28-days":["Last 28 days",o=>[Z(o,-27),o]],"last-30-days":["Last 30 days",o=>[Z(o,-29),o]],"last-90-days":["Last 90 days",o=>[Z(o,-89),o]],"last-12-months":["Last 12 months",o=>[Z(Me(o,-12),1),o]],"this-month":["This month",o=>[Tt(o),o]],"last-month":["Last month",o=>[Tt(Me(o,-1)),ka(Me(o,-1))]],"this-year":["This year",o=>[new Date(o.getFullYear(),0,1),o]],"last-year":["Last year",o=>[new Date(o.getFullYear()-1,0,1),new Date(o.getFullYear()-1,11,31)]]},e0=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function Vu(o,n=new Date,e,t=0){if(typeof o=="object"&&o)return o;let i=lv[o];if(!i||!Object.prototype.hasOwnProperty.call(lv,o))return null;let s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[l,d]=i[1](s,t);return{label:e?.(e0(o))||i[0],start:B(l),end:B(d)}}var Va,xe,Gr,We,ja,Ua,_t,Ka,Ot,D,ju,qa,Jl,Zl,Oa,Uu,Ku,ft,$p,hi,pi,cv,Ql,Ba,Gu,dv,hv,pv,mv,Fa,kp,Ep,Mp,Tp,ec,Wu,Gi=class extends _{constructor(){super(...arguments);m(this,D);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";m(this,Va,"");this.disabledDates=[];this.presets=[];this.preset="";this.months=1;this.confirm=!1;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;this._view=Tt(new Date);this._draftPreset="";m(this,xe,this.attachInternals());m(this,Gr,new ie(this,r(this,xe)));m(this,We,N("cm-drp"));m(this,ja,null);m(this,Ua,!1);m(this,_t,!1);m(this,Ka,!1);m(this,Ot,!1);m(this,ft,"start");m(this,pi,new fe);m(this,kp,()=>{this.disabled||(this.open?this.open=!1:(a(this,D,Ba).call(this,"start"),a(this,D,Ba).call(this,"end"),this.show()))});m(this,Ep,e=>t=>{t.key==="Enter"?a(this,D,Ba).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,D,Ba).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});m(this,Mp,e=>{let t=op(re(e,this),e,this._focus,r(this,D,Jl));if(t){e.preventDefault(),this._focus=qt(t,P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus),g(this,Ot,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,D,Gu).call(this,this._focus))});m(this,Tp,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,D,Fa).call(this);return}dp(e,e.currentTarget)});m(this,ec,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Va)}set locale(e){let t=r(this,Va);g(this,Va,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,ja)||g(this,ja,[this.start,this.end,this.preset]),document.addEventListener("pointerdown",r(this,ec),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,pi).close(),document.removeEventListener("pointerdown",r(this,ec),!0)}get form(){return r(this,xe).form}get validity(){return r(this,xe).validity}get validationMessage(){return r(this,xe).validationMessage}checkValidity(){return r(this,xe).checkValidity()}reportValidity(){return r(this,Gr).report(()=>r(this,xe).reportValidity())}formResetCallback(){[this.start,this.end,this.preset]=r(this,ja)??["","",""],this._startText=a(this,D,hi).call(this,this.start),this._endText=a(this,D,hi).call(this,this.end),this.open=!1,r(this,Gr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=P(this.start)?this.start:"",this._draftEnd=P(this.end)?this.end:"",this._draftPreset=this.preset,this._hover=null,g(this,_t,!1);let e=new Date,t=r(this,D,Zl)===2?P(this.end)??P(this.start):P(this.start);this._view=Tt(Me(qt(t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),P(this.min),P(this.max)),1-r(this,D,Zl))),this._focus=qt(P(this.start)??t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus),g(this,ft,"start"),g(this,Ot,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=P(e);if(!t)return!0;let i=P(this.min),s=P(this.max);return i&&t<i||s&&t>s?!0:Ta(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){if(e.has("preset")&&!r(this,Ua)&&this.preset){let t=Vu(this.preset,new Date,void 0,r(this,D,Jl));t&&(this.start=t.start,this.end=t.end)}g(this,Ua,!1),r(this,Ka)||(e.has("start")&&(this._startText=a(this,D,hi).call(this,this.start)),e.has("end")&&(this._endText=a(this,D,hi).call(this,this.end))),g(this,Ka,!1),e.has("locale")&&(P(this.start)&&(this._startText=a(this,D,hi).call(this,this.start)),P(this.end)&&(this._endText=a(this,D,hi).call(this,this.end)))}updated(){this.open&&!r(this,pi).active?r(this,pi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,pi).active?r(this,pi).close():this.open&&r(this,pi).place();let e=P(this.start),t=P(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),r(this,xe).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let s=this.renderRoot.querySelectorAll("input"),[l,d]=[s[0]??void 0,s[1]??void 0],p=r(this,D,qa),u=P(this.min),b=P(this.max);this.error?r(this,xe).setValidity({customError:!0},this.error,l):this._startText.trim()&&!e?r(this,xe).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,D,$p)}),l):this._endText.trim()&&!t?r(this,xe).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,D,$p)}),d):this.required&&(!e||!t)?r(this,xe).setValidity({valueMissing:!0},this.t("required"),e?d:l):e&&t&&t<e?r(this,xe).setValidity({badInput:!0},this.t("endBeforeStart"),d):e&&u&&e<u||t&&u&&t<u?r(this,xe).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:p.medium(u)}),l):e&&b&&e>b||t&&b&&t>b?r(this,xe).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:p.medium(b)}),d):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,xe).setValidity({customError:!0},this.t("unavailable"),l):r(this,xe).setValidity({}),r(this,Gr).sync(),this.open&&r(this,Ot)&&(g(this,Ot,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,D,qa),t=P(this.start),i=P(this.end),s=r(this,Gr).message,l=[s&&`${r(this,We)}-err`,this.helpText&&`${r(this,We)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=this.open?r(this,D,Uu):[],[b,f,x]=this.confirm?[this._draftStart,this._draftEnd,this._draftPreset]:[this.start,this.end,this.preset],y=!r(this,_t)&&!!x&&u.some(J=>J.key===x),k=J=>!r(this,_t)&&(y?J.key===x:J.start===b&&J.end===f),S=r(this,_t)||!u.some(k)&&!!(b||f),H=r(this,D,Zl),O=J=>lp({id:H===1?r(this,We):`${r(this,We)}-m${J}`,fmt:e,firstDay:r(this,D,Jl),month:Me(this._view,J),focus:this._focus,min:P(this.min),max:P(this.max),isDisabled:ee=>this.isUnavailable(B(ee)),mark:ee=>a(this,D,Wu).call(this,ee),note:ee=>{let _i=a(this,D,Wu).call(this,ee);return _i==="start"?this.t("startNote"):_i==="end"?this.t("endNote"):""},onPick:ee=>a(this,D,Gu).call(this,ee),onKey:r(this,Mp),onMonth:ee=>{this._view=Me(this._view,ee),this._focus=qt(Me(this._focus,ee),P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus)},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:ee=>{r(this,ft)==="end"&&(this._hover=ee)},hideNav:H===1?void 0:J===0?"next":"previous"}),V=P(this._draftStart),G=P(this._draftEnd),Ue=r(this,ft)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(P(this._draftStart))}):this.t("chooseStart"),W=J=>{let ee=J==="start"?this._startText:this._endText;return c`<input id="${r(this,We)}-${J}" type="text" autocomplete="off" spellcheck="false"
933
+ </div>`}};Da=new WeakMap,be=new WeakMap,Kr=new WeakMap,gt=new WeakMap,Ra=new WeakMap,ci=new WeakMap,Ki=new WeakMap,Ge=new WeakMap,it=new WeakMap,Ha=new WeakMap,Na=new WeakMap,M=new WeakSet,Gl=function(){return r(this,Na)},Vi=function(e){e!==r(this,Na)&&(g(this,Na,e),this.requestUpdate())},Pa=new WeakMap,hp=function(){return Fi(this,this.locale)},jr=function(){return Ca(r(this,M,hp))},Sa=function(){return Ea(r(this,M,hp),this.hourCycle)},ni=function(){return this.time?r(this,Ge):this.value},ji=function(e){return this.time&&e.trim().toLowerCase()==="now"?rv():e},oi=function(){return P(ut(a(this,M,ji).call(this,this.min)).date||this.min)},li=function(){return P(ut(a(this,M,ji).call(this,this.max)).date||this.max)},pp=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=1440?e:1},Nu=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ta(r(this,M,hp)):(Math.trunc(e)%7+7)%7},mp=function(){return ap(r(this,M,jr),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},La=function(e){let t=P(e);return t?r(this,M,jr).short(t):e},Ur=function(e){let t=ye(e);return t===null?"":r(this,M,Sa).format(t)},up=function(){return sp(r(this,M,Sa),{h:this.t("patternHour"),m:this.t("patternMinute")})},Pu=function(e){let{date:t,time:i}=ut(e);g(this,Ge,t),g(this,it,t?i:"")},sv=function(){let e=new Date,t=P(r(this,M,ni))??new Date(e.getFullYear(),e.getMonth(),e.getDate());this._focus=qt(t,r(this,M,oi),r(this,M,li)),g(this,Ki,!0)},gp=function(){a(this,M,av).call(this),r(this,Kr).sync()},av=function(){let e=this.renderRoot.querySelector("input")??void 0,t=P(r(this,M,ni)),i=r(this,M,jr);this.error?r(this,be).setValidity({customError:!0},this.error,e):this._text.trim()&&!t?r(this,be).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,M,mp)}),e):this.time?a(this,M,nv).call(this,t,e):this.required&&!t?r(this,be).setValidity({valueMissing:!0},this.t("required"),e):t&&r(this,M,oi)&&t<r(this,M,oi)?r(this,be).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:i.medium(r(this,M,oi))}),e):t&&r(this,M,li)&&t>r(this,M,li)?r(this,be).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:i.medium(r(this,M,li))}),e):t&&this.isUnavailable(this.value)?r(this,be).setValidity({customError:!0},this.t("unavailable"),e):r(this,be).setValidity({})},nv=function(e,t){let i=this.renderRoot.querySelector("input.time-in")??t,s=(f,x,y,k=t)=>r(this,be).setValidity(f,this.t(x,y),k),l=ye(r(this,it));if(r(this,M,Gl).trim()&&l===null)return s({badInput:!0},"badTime",{pattern:r(this,M,up)},i);if(!e&&l===null)return this.required?s({valueMissing:!0},"required"):r(this,be).setValidity({});if(!e)return s({badInput:!0},"required");if(l===null)return s({badInput:!0},"timeMissing",void 0,i);let d=It(`${r(this,Ge)}T${r(this,it)}`),p=It(a(this,M,ji).call(this,this.min)),u=It(a(this,M,ji).call(this,this.max),!0),b=(f,x)=>ut(f).time?r(this,M,Sa).dateTime(x):r(this,M,jr).medium(x);if(p&&d<p)return s({rangeUnderflow:!0},"rangeUnderflow",{date:b(a(this,M,ji).call(this,this.min),p)},i);if(u&&d>u)return s({rangeOverflow:!0},"rangeOverflow",{date:b(a(this,M,ji).call(this,this.max),u)},i);if(l%r(this,M,pp))return s({stepMismatch:!0},"stepMismatch",{count:r(this,M,pp)},i);if(this.isUnavailable(r(this,Ge)))return s({customError:!0},"unavailable");r(this,be).setValidity({})},di=new WeakMap,Ia=new WeakMap,Iu=function(e){e!==this.value&&(g(this,Ia,!0),this.value=e,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Aa=function(e,t){g(this,Ge,e),g(this,it,t);let i=e&&t?`${e}T${t}`:"";g(this,Pa,!0),this.requestUpdate(),a(this,M,Iu).call(this,i)},Wl=function(e){this.time?a(this,M,Aa).call(this,e,r(this,it)):a(this,M,Iu).call(this,e)},Yl=function(){let e=this._text.trim();if(this._dateError="",!e){a(this,M,Wl).call(this,"");return}let t=np(e,r(this,M,jr));t?(a(this,M,Wl).call(this,t),this._text=a(this,M,La).call(this,t)):(g(this,ci,!0),a(this,M,Wl).call(this,""),this._dateError=this.t("badInput",{pattern:r(this,M,mp)}))},qu=function(){let e=r(this,M,Gl).trim(),t=e?Vr(e,r(this,M,Sa)):"";if(g(this,ci,!0),t===null){g(this,Ha,!0),a(this,M,Aa).call(this,r(this,Ge),""),this._timeError=this.t("badTime",{pattern:r(this,M,up)});return}this._timeError="",a(this,M,Aa).call(this,r(this,Ge),t),g(this,M,a(this,M,Ur).call(this,t),Vi)},ov=function(e){let t=r(this,M,pp),i=Vr(r(this,M,Gl),r(this,M,Sa));if(!i){let p=ut(a(this,M,ji).call(this,this.min)),u=new Date;if(i=p.time&&(!r(this,Ge)||r(this,Ge)===p.date)?p.time:ai(u.getHours()*60+u.getMinutes()),ye(i)%t===0){g(this,ci,!0),a(this,M,Aa).call(this,r(this,Ge),i),g(this,M,a(this,M,Ur).call(this,i),Vi);return}e=1}let s=ye(i),l=e>0?(Math.floor(s/t)+1)*t:(Math.ceil(s/t)-1)*t,d=ai(l>=1440?0:l<0?Math.floor(1439/t)*t:l);g(this,ci,!0),a(this,M,Aa).call(this,r(this,Ge),d),g(this,M,a(this,M,Ur).call(this,d),Vi)},fp=new WeakMap,Ou=function(e){let t=B(e);this.isUnavailable(t)||(this.open=!1,a(this,M,Wl).call(this,t),this._text=a(this,M,La).call(this,t),this._dateError="",this.time&&!r(this,it)?this.updateComplete.then(()=>this.renderRoot.querySelector("input.time-in")?.focus()):a(this,M,Bu).call(this))},Bu=function(){this.renderRoot.querySelector(".trigger")?.focus()},bp=new WeakMap,vp=new WeakMap,yp=new WeakMap,xp=new WeakMap,wp=new WeakMap,Xl=new WeakMap,Ui.formAssociated=!0,Ui.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Ui.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:Ma},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},_dateError:{state:!0},_timeError:{state:!0},_focus:{state:!0}},Ui.styles=[E,Ae,za,cp,w`.pop { min-width: 0; }`];$("cm-date-picker",Ui);var sE=C("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",thisWeek:"This week",lastWeek:"Last week",last28Days:"Last 28 days",last12Months:"Last 12 months",thisYear:"This year",lastYear:"Last year",custom:"Custom",apply:"Apply",cancel:"Cancel",noRange:"No dates chosen"}),Fu=(o,n)=>Z(o,-((o.getDay()-n+7)%7)),lv={today:["Today",o=>[o,o]],yesterday:["Yesterday",o=>[Z(o,-1),Z(o,-1)]],"this-week":["This week",(o,n)=>[Fu(o,n),o]],"last-week":["Last week",(o,n)=>[Z(Fu(o,n),-7),Z(Fu(o,n),-1)]],"last-7-days":["Last 7 days",o=>[Z(o,-6),o]],"last-28-days":["Last 28 days",o=>[Z(o,-27),o]],"last-30-days":["Last 30 days",o=>[Z(o,-29),o]],"last-90-days":["Last 90 days",o=>[Z(o,-89),o]],"last-12-months":["Last 12 months",o=>[Z(Me(o,-12),1),o]],"this-month":["This month",o=>[_t(o),o]],"last-month":["Last month",o=>[_t(Me(o,-1)),ka(Me(o,-1))]],"this-year":["This year",o=>[new Date(o.getFullYear(),0,1),o]],"last-year":["Last year",o=>[new Date(o.getFullYear()-1,0,1),new Date(o.getFullYear()-1,11,31)]]},e0=o=>o.replace(/-([a-z0-9])/g,(n,e)=>e.toUpperCase());function Vu(o,n=new Date,e,t=0){if(typeof o=="object"&&o)return o;let i=lv[o];if(!i||!Object.prototype.hasOwnProperty.call(lv,o))return null;let s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),[l,d]=i[1](s,t);return{label:e?.(e0(o))||i[0],start:B(l),end:B(d)}}var Va,xe,Gr,We,ja,Ua,Tt,Ka,Ot,D,ju,qa,Jl,Zl,Oa,Uu,Ku,ft,$p,hi,pi,cv,Ql,Ba,Gu,dv,hv,pv,mv,Fa,kp,Ep,Mp,_p,ec,Wu,Gi=class extends T{constructor(){super(...arguments);m(this,D);this.label="";this.helpText="";this.error="";this.name="";this.startName="";this.endName="";this.start="";this.end="";this.min="";this.max="";m(this,Va,"");this.disabledDates=[];this.presets=[];this.preset="";this.months=1;this.confirm=!1;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;this._view=_t(new Date);this._draftPreset="";m(this,xe,this.attachInternals());m(this,Gr,new ie(this,r(this,xe)));m(this,We,N("cm-drp"));m(this,ja,null);m(this,Ua,!1);m(this,Tt,!1);m(this,Ka,!1);m(this,Ot,!1);m(this,ft,"start");m(this,pi,new fe);m(this,kp,()=>{this.disabled||(this.open?this.open=!1:(a(this,D,Ba).call(this,"start"),a(this,D,Ba).call(this,"end"),this.show()))});m(this,Ep,e=>t=>{t.key==="Enter"?a(this,D,Ba).call(this,e):t.key==="ArrowDown"&&t.altKey?(t.preventDefault(),a(this,D,Ba).call(this,e),this.show()):t.key==="Escape"&&this.open&&(t.preventDefault(),this.open=!1)});m(this,Mp,e=>{let t=op(re(e,this),e,this._focus,r(this,D,Jl));if(t){e.preventDefault(),this._focus=qt(t,P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus),g(this,Ot,!0);return}(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),a(this,D,Gu).call(this,this._focus))});m(this,_p,e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.open=!1,a(this,D,Fa).call(this);return}dp(e,e.currentTarget)});m(this,ec,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Va)}set locale(e){let t=r(this,Va);g(this,Va,e??""),this.requestUpdate("locale",t)}connectedCallback(){super.connectedCallback(),r(this,ja)||g(this,ja,[this.start,this.end,this.preset]),document.addEventListener("pointerdown",r(this,ec),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,pi).close(),document.removeEventListener("pointerdown",r(this,ec),!0)}get form(){return r(this,xe).form}get validity(){return r(this,xe).validity}get validationMessage(){return r(this,xe).validationMessage}checkValidity(){return r(this,xe).checkValidity()}reportValidity(){return r(this,Gr).report(()=>r(this,xe).reportValidity())}formResetCallback(){[this.start,this.end,this.preset]=r(this,ja)??["","",""],this._startText=a(this,D,hi).call(this,this.start),this._endText=a(this,D,hi).call(this,this.end),this.open=!1,r(this,Gr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){[this.start="",this.end=""]=(e??"").split("/")}show(){if(this.disabled)return;this._draftStart=P(this.start)?this.start:"",this._draftEnd=P(this.end)?this.end:"",this._draftPreset=this.preset,this._hover=null,g(this,Tt,!1);let e=new Date,t=r(this,D,Zl)===2?P(this.end)??P(this.start):P(this.start);this._view=_t(Me(qt(t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),P(this.min),P(this.max)),1-r(this,D,Zl))),this._focus=qt(P(this.start)??t??new Date(e.getFullYear(),e.getMonth(),e.getDate()),P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus),g(this,ft,"start"),g(this,Ot,!0),this.open=!0}close(){this.open=!1}isUnavailable(e){let t=P(e);if(!t)return!0;let i=P(this.min),s=P(this.max);return i&&t<i||s&&t>s?!0:_a(this.disabledDates).includes(e)||!!this.isDateDisabled?.(e)}willUpdate(e){if(e.has("preset")&&!r(this,Ua)&&this.preset){let t=Vu(this.preset,new Date,void 0,r(this,D,Jl));t&&(this.start=t.start,this.end=t.end)}g(this,Ua,!1),r(this,Ka)||(e.has("start")&&(this._startText=a(this,D,hi).call(this,this.start)),e.has("end")&&(this._endText=a(this,D,hi).call(this,this.end))),g(this,Ka,!1),e.has("locale")&&(P(this.start)&&(this._startText=a(this,D,hi).call(this,this.start)),P(this.end)&&(this._endText=a(this,D,hi).call(this,this.end)))}updated(){this.open&&!r(this,pi).active?r(this,pi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".wrap"),{align:"start",gap:8}):!this.open&&r(this,pi).active?r(this,pi).close():this.open&&r(this,pi).place();let e=P(this.start),t=P(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),r(this,xe).setFormValue(e||t?i:null,`${this.start}/${this.end}`);let s=this.renderRoot.querySelectorAll("input"),[l,d]=[s[0]??void 0,s[1]??void 0],p=r(this,D,qa),u=P(this.min),b=P(this.max);this.error?r(this,xe).setValidity({customError:!0},this.error,l):this._startText.trim()&&!e?r(this,xe).setValidity({badInput:!0},this.t("badStart",{pattern:r(this,D,$p)}),l):this._endText.trim()&&!t?r(this,xe).setValidity({badInput:!0},this.t("badEnd",{pattern:r(this,D,$p)}),d):this.required&&(!e||!t)?r(this,xe).setValidity({valueMissing:!0},this.t("required"),e?d:l):e&&t&&t<e?r(this,xe).setValidity({badInput:!0},this.t("endBeforeStart"),d):e&&u&&e<u||t&&u&&t<u?r(this,xe).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{date:p.medium(u)}),l):e&&b&&e>b||t&&b&&t>b?r(this,xe).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{date:p.medium(b)}),d):e&&this.isUnavailable(this.start)||t&&this.isUnavailable(this.end)?r(this,xe).setValidity({customError:!0},this.t("unavailable"),l):r(this,xe).setValidity({}),r(this,Gr).sync(),this.open&&r(this,Ot)&&(g(this,Ot,!1),this.renderRoot.querySelector('td[tabindex="0"]')?.focus())}render(){let e=r(this,D,qa),t=P(this.start),i=P(this.end),s=r(this,Gr).message,l=[s&&`${r(this,We)}-err`,this.helpText&&`${r(this,We)}-help`].filter(Boolean).join(" "),d=this.getAttribute("aria-label"),p=this.label||d||"",u=this.open?r(this,D,Uu):[],[b,f,x]=this.confirm?[this._draftStart,this._draftEnd,this._draftPreset]:[this.start,this.end,this.preset],y=!r(this,Tt)&&!!x&&u.some(J=>J.key===x),k=J=>!r(this,Tt)&&(y?J.key===x:J.start===b&&J.end===f),S=r(this,Tt)||!u.some(k)&&!!(b||f),H=r(this,D,Zl),O=J=>lp({id:H===1?r(this,We):`${r(this,We)}-m${J}`,fmt:e,firstDay:r(this,D,Jl),month:Me(this._view,J),focus:this._focus,min:P(this.min),max:P(this.max),isDisabled:ee=>this.isUnavailable(B(ee)),mark:ee=>a(this,D,Wu).call(this,ee),note:ee=>{let Ti=a(this,D,Wu).call(this,ee);return Ti==="start"?this.t("startNote"):Ti==="end"?this.t("endNote"):""},onPick:ee=>a(this,D,Gu).call(this,ee),onKey:r(this,Mp),onMonth:ee=>{this._view=Me(this._view,ee),this._focus=qt(Me(this._focus,ee),P(this.min),P(this.max)),a(this,D,Oa).call(this,this._focus)},previousLabel:this.t("previousMonth"),nextLabel:this.t("nextMonth"),onHover:ee=>{r(this,ft)==="end"&&(this._hover=ee)},hideNav:H===1?void 0:J===0?"next":"previous"}),V=P(this._draftStart),G=P(this._draftEnd),Ue=r(this,ft)==="end"&&this._draftStart?this.t("chooseEnd",{date:e.medium(P(this._draftStart))}):this.t("chooseStart"),W=J=>{let ee=J==="start"?this._startText:this._endText;return c`<input id="${r(this,We)}-${J}" type="text" autocomplete="off" spellcheck="false"
934
934
  .value=${Q(ee)} placeholder=${r(this,D,$p)}
935
935
  aria-label=${J==="start"?this.startLabel||this.t("start"):this.endLabel||this.t("end")}
936
936
  ?required=${this.required} ?disabled=${this.disabled}
937
937
  aria-invalid=${s?"true":h} aria-describedby=${l||h}
938
- @input=${_i=>{_i.stopPropagation();let tl=_i.target.value;J==="start"?this._startText=tl:this._endText=tl}}
938
+ @input=${Ti=>{Ti.stopPropagation();let tl=Ti.target.value;J==="start"?this._startText=tl:this._endText=tl}}
939
939
  @change=${()=>a(this,D,Ba).call(this,J)} @keydown=${r(this,Ep).call(this,J)} />`};return c`<div class="field" role="group" aria-labelledby=${this.label?`${r(this,We)}-l`:h} aria-label=${!this.label&&d?d:h}>
940
940
  ${this.label?c`<span class="label" id="${r(this,We)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
941
941
  <div class="wrap">
@@ -947,7 +947,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
947
947
  @click=${r(this,kp)}><cm-icon name="calendar" size="16"></cm-icon></button>
948
948
  </div>
949
949
  <div class="pop" id="${r(this,We)}-pop" part="popover" role="dialog" aria-modal="true" aria-label=${this.t("dialog")}
950
- ?hidden=${!this.open} @keydown=${r(this,Tp)}>
950
+ ?hidden=${!this.open} @keydown=${r(this,_p)}>
951
951
  ${this.open?c`<div class="body">
952
952
  ${u.length||r(this,D,Ku)?c`<ul class="presets" part="presets" aria-label=${this.t("presets")}>${u.map(J=>c`<li>
953
953
  <button type="button" class="preset" data-preset=${J.key||h} aria-pressed=${k(J)?"true":"false"}
@@ -968,7 +968,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
968
968
  </div>
969
969
  ${s?c`<p class="error" id="${r(this,We)}-err" role="alert">${s}</p>`:h}
970
970
  ${this.helpText?c`<p class="help" id="${r(this,We)}-help">${this.helpText}</p>`:h}
971
- </div>`}};Va=new WeakMap,xe=new WeakMap,Gr=new WeakMap,We=new WeakMap,ja=new WeakMap,Ua=new WeakMap,_t=new WeakMap,Ka=new WeakMap,Ot=new WeakMap,D=new WeakSet,ju=function(){return Fi(this,this.locale)},qa=function(){return Ca(r(this,D,ju))},Jl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?_a(r(this,D,ju)):(Math.trunc(e)%7+7)%7},Zl=function(){return Number(this.months)!==2||typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches?1:2},Oa=function(e){let t=r(this,D,Zl),i=Tt(e);i<this._view?this._view=i:i>=Me(this._view,t)&&(this._view=Me(i,1-t))},Uu=function(){return Ta(this.presets).flatMap(e=>{let t=Vu(e,new Date,i=>this.t(i),r(this,D,Jl));return t?[{...t,key:typeof e=="string"?e:""}]:[]})},Ku=function(){return Ta(this.presets).includes("custom")},ft=new WeakMap,$p=function(){return ap(r(this,D,qa),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},hi=function(e){let t=P(e);return t?r(this,D,qa).short(t):e},pi=new WeakMap,cv=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ql=function(e,t,i){let s=i??r(this,D,Uu).find(l=>l.key&&l.start===e&&l.end===t)?.key??"";s!==this.preset&&(g(this,Ua,!0),this.preset=s),!(e===this.start&&t===this.end)&&(this.start=e,this.end=t,a(this,D,cv).call(this))},Ba=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?np(t,r(this,D,qa)):"";t&&!i&&g(this,Ka,!0);let s=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,D,Ql).call(this,...s),i&&(e==="start"?this._startText=a(this,D,hi).call(this,i):this._endText=a(this,D,hi).call(this,i))},Gu=function(e){let t=B(e);if(!this.isUnavailable(t)){if(this._draftPreset="",g(this,_t,!0),r(this,ft)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",g(this,ft,"end"),this._focus=e,g(this,Ot,!0);return}if(this._draftEnd=t,g(this,ft,"start"),this.confirm){this._focus=e,g(this,Ot,!0);return}this.open=!1,a(this,D,Ql).call(this,this._draftStart,t,""),a(this,D,Fa).call(this)}},dv=function(e){if(this.confirm){this._draftStart=e.start,this._draftEnd=e.end,this._draftPreset=e.key,g(this,_t,!1),g(this,ft,"start");let t=P(e.end);this._focus=qt(t,P(this.min),P(this.max)),a(this,D,Oa).call(this,P(e.start)),a(this,D,Oa).call(this,t);return}this.open=!1,a(this,D,Ql).call(this,e.start,e.end,e.key),a(this,D,Fa).call(this)},hv=function(){g(this,_t,!0),this._draftPreset="",g(this,ft,"start"),g(this,Ot,!0),this.requestUpdate()},pv=function(){!this._draftStart||!this._draftEnd||(this.open=!1,a(this,D,Ql).call(this,this._draftStart,this._draftEnd,r(this,_t)?"":this._draftPreset||void 0),a(this,D,Fa).call(this))},mv=function(){this.open=!1,a(this,D,Fa).call(this)},Fa=function(){this.renderRoot.querySelector(".trigger")?.focus()},kp=new WeakMap,Ep=new WeakMap,Mp=new WeakMap,Tp=new WeakMap,ec=new WeakMap,Wu=function(e){let t=B(e),i=this._draftStart,s=this._draftEnd||(r(this,ft)==="end"&&i?B(this._hover??this._focus):"");return t===i?"start":t===s&&s>i?"end":i&&s&&t>i&&t<s?"in-range":""},Gi.formAssociated=!0,Gi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Gi.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:Ma},isDateDisabled:{attribute:!1},presets:{converter:Ma},preset:{reflect:!0},months:{type:Number,reflect:!0},confirm:{type:Boolean,reflect:!0},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},_view:{state:!0},_draftPreset:{state:!0}},Gi.styles=[E,Ae,za,cp,w`
971
+ </div>`}};Va=new WeakMap,xe=new WeakMap,Gr=new WeakMap,We=new WeakMap,ja=new WeakMap,Ua=new WeakMap,Tt=new WeakMap,Ka=new WeakMap,Ot=new WeakMap,D=new WeakSet,ju=function(){return Fi(this,this.locale)},qa=function(){return Ca(r(this,D,ju))},Jl=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ta(r(this,D,ju)):(Math.trunc(e)%7+7)%7},Zl=function(){return Number(this.months)!==2||typeof matchMedia=="function"&&matchMedia("(max-width: 640px)").matches?1:2},Oa=function(e){let t=r(this,D,Zl),i=_t(e);i<this._view?this._view=i:i>=Me(this._view,t)&&(this._view=Me(i,1-t))},Uu=function(){return _a(this.presets).flatMap(e=>{let t=Vu(e,new Date,i=>this.t(i),r(this,D,Jl));return t?[{...t,key:typeof e=="string"?e:""}]:[]})},Ku=function(){return _a(this.presets).includes("custom")},ft=new WeakMap,$p=function(){return ap(r(this,D,qa),{d:this.t("patternDay"),m:this.t("patternMonth"),y:this.t("patternYear")})},hi=function(e){let t=P(e);return t?r(this,D,qa).short(t):e},pi=new WeakMap,cv=function(){this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Ql=function(e,t,i){let s=i??r(this,D,Uu).find(l=>l.key&&l.start===e&&l.end===t)?.key??"";s!==this.preset&&(g(this,Ua,!0),this.preset=s),!(e===this.start&&t===this.end)&&(this.start=e,this.end=t,a(this,D,cv).call(this))},Ba=function(e){let t=(e==="start"?this._startText:this._endText).trim(),i=t?np(t,r(this,D,qa)):"";t&&!i&&g(this,Ka,!0);let s=e==="start"?[i??"",this.end]:[this.start,i??""];a(this,D,Ql).call(this,...s),i&&(e==="start"?this._startText=a(this,D,hi).call(this,i):this._endText=a(this,D,hi).call(this,i))},Gu=function(e){let t=B(e);if(!this.isUnavailable(t)){if(this._draftPreset="",g(this,Tt,!0),r(this,ft)==="start"||!this._draftStart||t<this._draftStart){this._draftStart=t,this._draftEnd="",g(this,ft,"end"),this._focus=e,g(this,Ot,!0);return}if(this._draftEnd=t,g(this,ft,"start"),this.confirm){this._focus=e,g(this,Ot,!0);return}this.open=!1,a(this,D,Ql).call(this,this._draftStart,t,""),a(this,D,Fa).call(this)}},dv=function(e){if(this.confirm){this._draftStart=e.start,this._draftEnd=e.end,this._draftPreset=e.key,g(this,Tt,!1),g(this,ft,"start");let t=P(e.end);this._focus=qt(t,P(this.min),P(this.max)),a(this,D,Oa).call(this,P(e.start)),a(this,D,Oa).call(this,t);return}this.open=!1,a(this,D,Ql).call(this,e.start,e.end,e.key),a(this,D,Fa).call(this)},hv=function(){g(this,Tt,!0),this._draftPreset="",g(this,ft,"start"),g(this,Ot,!0),this.requestUpdate()},pv=function(){!this._draftStart||!this._draftEnd||(this.open=!1,a(this,D,Ql).call(this,this._draftStart,this._draftEnd,r(this,Tt)?"":this._draftPreset||void 0),a(this,D,Fa).call(this))},mv=function(){this.open=!1,a(this,D,Fa).call(this)},Fa=function(){this.renderRoot.querySelector(".trigger")?.focus()},kp=new WeakMap,Ep=new WeakMap,Mp=new WeakMap,_p=new WeakMap,ec=new WeakMap,Wu=function(e){let t=B(e),i=this._draftStart,s=this._draftEnd||(r(this,ft)==="end"&&i?B(this._hover??this._focus):"");return t===i?"start":t===s&&s>i?"end":i&&s&&t>i&&t<s?"in-range":""},Gi.formAssociated=!0,Gi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Gi.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:Ma},isDateDisabled:{attribute:!1},presets:{converter:Ma},preset:{reflect:!0},months:{type:Number,reflect:!0},confirm:{type:Boolean,reflect:!0},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},_view:{state:!0},_draftPreset:{state:!0}},Gi.styles=[E,Ae,za,cp,w`
972
972
  :host([data-cm-invalid]) .box { border-color: var(--cm-border-critical); }
973
973
  .sep { flex: none; color: var(--cm-text-tertiary); }
974
974
  input { flex: 0 1 6.6em; }
@@ -1007,7 +1007,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1007
1007
  .preset { width: auto; border: var(--cm-border-1) solid var(--cm-border-subtle); border-radius: var(--cm-radius-full); min-height: 32px; }
1008
1008
  .draft { flex-basis: 100%; }
1009
1009
  }
1010
- `];$("cm-date-range-picker",Gi);var gE=C("timePicker",{showTimes:"Show times",times:"Times",timesFor:"Times for {label}",patternHour:"hh",patternMinute:"mm",badInput:"Enter a time like {pattern}.",required:"Enter or choose a time.",rangeUnderflow:"Choose {time} or later.",rangeOverflow:"Choose {time} or earlier.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Ya,Ce,Wr,bt,Xa,Ja,mi,q,uv,Wi,Ga,gv,Yu,Wa,_p,fv,Xu,bv,Cp,zp,Ju,Sp,Lp,Ap,tc,Yi=class extends _{constructor(){super(...arguments);m(this,q);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.min="";this.max="";this.step=1;this.hourCycle="";m(this,Ya,"");this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._active=-1;m(this,Ce,this.attachInternals());m(this,Wr,new ie(this,r(this,Ce)));m(this,bt,N("cm-tp"));m(this,Xa,null);m(this,Ja,!1);m(this,mi,new fe);m(this,Sp,e=>{let t=r(this,q,_p);switch(e.key){case"ArrowDown":case"ArrowUp":{if(e.preventDefault(),!this.open){this.show();return}if(!t.length)return;let i=e.key==="ArrowDown"?1:-1;this._active=this._active<0?0:Math.min(t.length-1,Math.max(0,this._active+i));return}case"PageDown":case"PageUp":if(!this.open||!t.length)return;e.preventDefault(),this._active=Math.min(t.length-1,Math.max(0,this._active+(e.key==="PageDown"?6:-6)));return;case"Enter":this.open&&this._active>=0&&t[this._active]!==void 0?(e.preventDefault(),a(this,q,Ju).call(this,t[this._active])):(this.open=!1,a(this,q,zp).call(this));return;case"Escape":this.open&&(e.preventDefault(),e.stopPropagation(),this.open=!1);return;case"Tab":this.open=!1;return;default:}});m(this,Lp,e=>{if(e.stopPropagation(),this._text=e.target.value,this.open){let t=Vr(this._text,r(this,q,Wi));t&&(this._active=a(this,q,Xu).call(this,t))}});m(this,Ap,()=>{this.disabled||(this.open?this.open=!1:(a(this,q,zp).call(this),this.show()),this.renderRoot.querySelector("input")?.focus())});m(this,tc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Ya)}set locale(e){let t=r(this,Ya);g(this,Ya,e??""),this.requestUpdate("locale",t)}get valueAsNumber(){return ye(this.value)}connectedCallback(){super.connectedCallback(),r(this,Xa)===null&&g(this,Xa,this.value),document.addEventListener("pointerdown",r(this,tc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,mi).close(),document.removeEventListener("pointerdown",r(this,tc),!0)}get form(){return r(this,Ce).form}get validity(){return r(this,Ce).validity}get validationMessage(){return r(this,Ce).validationMessage}checkValidity(){return r(this,Ce).checkValidity()}reportValidity(){return r(this,Wr).report(()=>r(this,Ce).reportValidity())}formResetCallback(){this.value=r(this,Xa)??"",this._text=a(this,q,Wa).call(this,this.value),this.open=!1,r(this,Wr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(this._active=a(this,q,Xu).call(this,ye(this.value)!==null?this.value:Vr(this._text,r(this,q,Wi))??a(this,q,fv).call(this)),this.open=!0)}close(){this.open=!1}willUpdate(e){e.has("value")&&!r(this,Ja)?this._text=a(this,q,Wa).call(this,this.value):(e.has("locale")||e.has("hourCycle"))&&ye(this.value)!==null&&(this._text=a(this,q,Wa).call(this,this.value)),g(this,Ja,!1)}updated(e){this.open&&!r(this,mi).active?r(this,mi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch",gap:4}):!this.open&&r(this,mi).active?r(this,mi).close():this.open&&r(this,mi).place(),this.open&&a(this,q,bv).call(this,e.has("open"));let t=ye(this.value);r(this,Ce).setFormValue(t===null?null:this.value,this.value);let i=this.renderRoot.querySelector("input")??void 0,s=ye(this.min),l=ye(this.max),d=r(this,q,Wi);this.error?r(this,Ce).setValidity({customError:!0},this.error,i):this._text.trim()&&t===null?r(this,Ce).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,q,Yu)}),i):this.required&&t===null?r(this,Ce).setValidity({valueMissing:!0},this.t("required"),i):t!==null&&s!==null&&t<s?r(this,Ce).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{time:d.format(s)}),i):t!==null&&l!==null&&t>l?r(this,Ce).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{time:d.format(l)}),i):t!==null&&t%r(this,q,Ga)?r(this,Ce).setValidity({stepMismatch:!0},this.t("stepMismatch",{count:r(this,q,Ga)}),i):r(this,Ce).setValidity({}),r(this,Wr).sync()}render(){let e=r(this,q,Wi),t=r(this,Wr).message,i=[t&&`${r(this,bt)}-err`,this.helpText&&`${r(this,bt)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=this.label||s||"",d=this.open?r(this,q,_p):[],p=ye(this.value),u=`${r(this,bt)}-list`;return c`<div class="field">
1010
+ `];$("cm-date-range-picker",Gi);var gE=C("timePicker",{showTimes:"Show times",times:"Times",timesFor:"Times for {label}",patternHour:"hh",patternMinute:"mm",badInput:"Enter a time like {pattern}.",required:"Enter or choose a time.",rangeUnderflow:"Choose {time} or later.",rangeOverflow:"Choose {time} or earlier.",stepMismatch:{one:"Choose a time on the minute.",other:"Choose a time in steps of {count} minutes."}}),Ya,Ce,Wr,bt,Xa,Ja,mi,q,uv,Wi,Ga,gv,Yu,Wa,Tp,fv,Xu,bv,Cp,zp,Ju,Sp,Lp,Ap,tc,Yi=class extends T{constructor(){super(...arguments);m(this,q);this.label="";this.helpText="";this.error="";this.name="";this.value="";this.placeholder="";this.min="";this.max="";this.step=1;this.hourCycle="";m(this,Ya,"");this.required=!1;this.disabled=!1;this.open=!1;this.size="default";this._text="";this._active=-1;m(this,Ce,this.attachInternals());m(this,Wr,new ie(this,r(this,Ce)));m(this,bt,N("cm-tp"));m(this,Xa,null);m(this,Ja,!1);m(this,mi,new fe);m(this,Sp,e=>{let t=r(this,q,Tp);switch(e.key){case"ArrowDown":case"ArrowUp":{if(e.preventDefault(),!this.open){this.show();return}if(!t.length)return;let i=e.key==="ArrowDown"?1:-1;this._active=this._active<0?0:Math.min(t.length-1,Math.max(0,this._active+i));return}case"PageDown":case"PageUp":if(!this.open||!t.length)return;e.preventDefault(),this._active=Math.min(t.length-1,Math.max(0,this._active+(e.key==="PageDown"?6:-6)));return;case"Enter":this.open&&this._active>=0&&t[this._active]!==void 0?(e.preventDefault(),a(this,q,Ju).call(this,t[this._active])):(this.open=!1,a(this,q,zp).call(this));return;case"Escape":this.open&&(e.preventDefault(),e.stopPropagation(),this.open=!1);return;case"Tab":this.open=!1;return;default:}});m(this,Lp,e=>{if(e.stopPropagation(),this._text=e.target.value,this.open){let t=Vr(this._text,r(this,q,Wi));t&&(this._active=a(this,q,Xu).call(this,t))}});m(this,Ap,()=>{this.disabled||(this.open?this.open=!1:(a(this,q,zp).call(this),this.show()),this.renderRoot.querySelector("input")?.focus())});m(this,tc,e=>{this.open&&!e.composedPath().includes(this)&&(this.open=!1)})}get locale(){return r(this,Ya)}set locale(e){let t=r(this,Ya);g(this,Ya,e??""),this.requestUpdate("locale",t)}get valueAsNumber(){return ye(this.value)}connectedCallback(){super.connectedCallback(),r(this,Xa)===null&&g(this,Xa,this.value),document.addEventListener("pointerdown",r(this,tc),!0)}disconnectedCallback(){super.disconnectedCallback(),r(this,mi).close(),document.removeEventListener("pointerdown",r(this,tc),!0)}get form(){return r(this,Ce).form}get validity(){return r(this,Ce).validity}get validationMessage(){return r(this,Ce).validationMessage}checkValidity(){return r(this,Ce).checkValidity()}reportValidity(){return r(this,Wr).report(()=>r(this,Ce).reportValidity())}formResetCallback(){this.value=r(this,Xa)??"",this._text=a(this,q,Wa).call(this,this.value),this.open=!1,r(this,Wr).reset()}formDisabledCallback(e){this.disabled=e,e&&(this.open=!1)}formStateRestoreCallback(e){this.value=e??""}show(){this.disabled||(this._active=a(this,q,Xu).call(this,ye(this.value)!==null?this.value:Vr(this._text,r(this,q,Wi))??a(this,q,fv).call(this)),this.open=!0)}close(){this.open=!1}willUpdate(e){e.has("value")&&!r(this,Ja)?this._text=a(this,q,Wa).call(this,this.value):(e.has("locale")||e.has("hourCycle"))&&ye(this.value)!==null&&(this._text=a(this,q,Wa).call(this,this.value)),g(this,Ja,!1)}updated(e){this.open&&!r(this,mi).active?r(this,mi).open(this.renderRoot.querySelector(".pop"),this.renderRoot.querySelector(".box"),{align:"stretch",gap:4}):!this.open&&r(this,mi).active?r(this,mi).close():this.open&&r(this,mi).place(),this.open&&a(this,q,bv).call(this,e.has("open"));let t=ye(this.value);r(this,Ce).setFormValue(t===null?null:this.value,this.value);let i=this.renderRoot.querySelector("input")??void 0,s=ye(this.min),l=ye(this.max),d=r(this,q,Wi);this.error?r(this,Ce).setValidity({customError:!0},this.error,i):this._text.trim()&&t===null?r(this,Ce).setValidity({badInput:!0},this.t("badInput",{pattern:r(this,q,Yu)}),i):this.required&&t===null?r(this,Ce).setValidity({valueMissing:!0},this.t("required"),i):t!==null&&s!==null&&t<s?r(this,Ce).setValidity({rangeUnderflow:!0},this.t("rangeUnderflow",{time:d.format(s)}),i):t!==null&&l!==null&&t>l?r(this,Ce).setValidity({rangeOverflow:!0},this.t("rangeOverflow",{time:d.format(l)}),i):t!==null&&t%r(this,q,Ga)?r(this,Ce).setValidity({stepMismatch:!0},this.t("stepMismatch",{count:r(this,q,Ga)}),i):r(this,Ce).setValidity({}),r(this,Wr).sync()}render(){let e=r(this,q,Wi),t=r(this,Wr).message,i=[t&&`${r(this,bt)}-err`,this.helpText&&`${r(this,bt)}-help`].filter(Boolean).join(" "),s=this.getAttribute("aria-label"),l=this.label||s||"",d=this.open?r(this,q,Tp):[],p=ye(this.value),u=`${r(this,bt)}-list`;return c`<div class="field">
1011
1011
  ${this.label?c`<label class="label" for="${r(this,bt)}-in" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</label>`:h}
1012
1012
  <div class="wrap">
1013
1013
  <div class="box" part="box">
@@ -1033,7 +1033,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1033
1033
  </div>
1034
1034
  ${t?c`<p class="error" id="${r(this,bt)}-err" role="alert">${t}</p>`:h}
1035
1035
  ${this.helpText?c`<p class="help" id="${r(this,bt)}-help">${this.helpText}</p>`:h}
1036
- </div>`}};Ya=new WeakMap,Ce=new WeakMap,Wr=new WeakMap,bt=new WeakMap,Xa=new WeakMap,Ja=new WeakMap,mi=new WeakMap,q=new WeakSet,uv=function(){return Fi(this,this.locale)},Wi=function(){return Ea(r(this,q,uv),this.hourCycle)},Ga=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=720?e:1},gv=function(){let e=Math.trunc(Number(this.interval));return e>=1&&e<=720?e:r(this,q,Ga)>=5?r(this,q,Ga):30},Yu=function(){return sp(r(this,q,Wi),{h:this.t("patternHour"),m:this.t("patternMinute")})},Wa=function(e){let t=ye(e);return t===null?"":r(this,q,Wi).format(t)},_p=function(){let e=ye(this.min)??0,t=ye(this.max)??1439,i=r(this,q,gv),s=r(this,q,Ga),l=[];for(let d=Math.ceil(e/i)*i;d<=t&&l.length<1440;d+=i)d%s===0&&l.push(d);return l},fv=function(){let e=new Date;return ai(e.getHours()*60+e.getMinutes())},Xu=function(e){let t=r(this,q,_p);if(!t.length)return-1;let i=ye(e);if(i===null)return 0;let s=t.findIndex(l=>l>=i);return s===-1?t.length-1:s},bv=function(e){let t=this.renderRoot.querySelector("[role=listbox]"),i=this.renderRoot.querySelector("[role=option].active");if(!t||!i)return;let s=i.offsetTop-t.offsetTop,l=s+i.offsetHeight;e?t.scrollTop=s-(t.clientHeight-i.offsetHeight)/2:s<t.scrollTop?t.scrollTop=s:l>t.scrollTop+t.clientHeight&&(t.scrollTop=l-t.clientHeight)},Cp=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})))},zp=function(){let e=this._text.trim(),t=e?Vr(e,r(this,q,Wi)):"";if(t===null){g(this,Ja,!0),a(this,q,Cp).call(this,""),this.requestUpdate();return}a(this,q,Cp).call(this,t),this._text=a(this,q,Wa).call(this,t)},Ju=function(e){let t=ai(e);this.open=!1,a(this,q,Cp).call(this,t),this._text=a(this,q,Wa).call(this,t),this.renderRoot.querySelector("input")?.focus()},Sp=new WeakMap,Lp=new WeakMap,Ap=new WeakMap,tc=new WeakMap,Yi.formAssociated=!0,Yi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Yi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},min:{},max:{},step:{type:Number},interval:{type:Number},hourCycle:{attribute:"hour-cycle"},locale:{noAccessor:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_active:{state:!0}},Yi.styles=[E,Ae,za,ia,w`
1036
+ </div>`}};Ya=new WeakMap,Ce=new WeakMap,Wr=new WeakMap,bt=new WeakMap,Xa=new WeakMap,Ja=new WeakMap,mi=new WeakMap,q=new WeakSet,uv=function(){return Fi(this,this.locale)},Wi=function(){return Ea(r(this,q,uv),this.hourCycle)},Ga=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=720?e:1},gv=function(){let e=Math.trunc(Number(this.interval));return e>=1&&e<=720?e:r(this,q,Ga)>=5?r(this,q,Ga):30},Yu=function(){return sp(r(this,q,Wi),{h:this.t("patternHour"),m:this.t("patternMinute")})},Wa=function(e){let t=ye(e);return t===null?"":r(this,q,Wi).format(t)},Tp=function(){let e=ye(this.min)??0,t=ye(this.max)??1439,i=r(this,q,gv),s=r(this,q,Ga),l=[];for(let d=Math.ceil(e/i)*i;d<=t&&l.length<1440;d+=i)d%s===0&&l.push(d);return l},fv=function(){let e=new Date;return ai(e.getHours()*60+e.getMinutes())},Xu=function(e){let t=r(this,q,Tp);if(!t.length)return-1;let i=ye(e);if(i===null)return 0;let s=t.findIndex(l=>l>=i);return s===-1?t.length-1:s},bv=function(e){let t=this.renderRoot.querySelector("[role=listbox]"),i=this.renderRoot.querySelector("[role=option].active");if(!t||!i)return;let s=i.offsetTop-t.offsetTop,l=s+i.offsetHeight;e?t.scrollTop=s-(t.clientHeight-i.offsetHeight)/2:s<t.scrollTop?t.scrollTop=s:l>t.scrollTop+t.clientHeight&&(t.scrollTop=l-t.clientHeight)},Cp=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})))},zp=function(){let e=this._text.trim(),t=e?Vr(e,r(this,q,Wi)):"";if(t===null){g(this,Ja,!0),a(this,q,Cp).call(this,""),this.requestUpdate();return}a(this,q,Cp).call(this,t),this._text=a(this,q,Wa).call(this,t)},Ju=function(e){let t=ai(e);this.open=!1,a(this,q,Cp).call(this,t),this._text=a(this,q,Wa).call(this,t),this.renderRoot.querySelector("input")?.focus()},Sp=new WeakMap,Lp=new WeakMap,Ap=new WeakMap,tc=new WeakMap,Yi.formAssociated=!0,Yi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Yi.properties={label:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},placeholder:{},min:{},max:{},step:{type:Number},interval:{type:Number},hourCycle:{attribute:"hour-cycle"},locale:{noAccessor:!0},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},open:{type:Boolean,reflect:!0},size:{reflect:!0},_text:{state:!0},_active:{state:!0}},Yi.styles=[E,Ae,za,ia,w`
1037
1037
  :host([data-cm-invalid]) .box { border-color: var(--cm-border-critical); }
1038
1038
  :host { max-width: 100%; }
1039
1039
  .pop {
@@ -1047,7 +1047,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1047
1047
  [role='option'][aria-selected='true'] { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
1048
1048
  [role='option'][aria-selected='true'].active { background: var(--cm-action-primary-hover); }
1049
1049
  input { font-variant-numeric: tabular-nums; }
1050
- `];$("cm-time-picker",Yi);var $E=C("fileUpload",{prompt:"Drag files here or {browse}",browse:"Browse",drop:"Drop files to upload",uploading:"Uploading {name}",cancel:"Cancel uploading {name}",cancelShort:"Cancel",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 t0(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.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 rt,ui,ce,gi,j,ic,Zu,Dp,Rp,Qu,eg,tg,ig,Yr,vv,yv,rg,xv,wv,Xi=class extends _{constructor(){super(...arguments);m(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="";this._progress=new Map;this._fileErrors=new Map;this._over=!1;m(this,rt,this.attachInternals());m(this,ui,new ie(this,r(this,rt)));m(this,ce,N("cm-fu"));m(this,gi,new Map)}get form(){return r(this,rt).form}get validity(){return r(this,rt).validity}get validationMessage(){return r(this,rt).validationMessage}checkValidity(){return r(this,rt).checkValidity()}reportValidity(){return r(this,ui).report(()=>r(this,rt).reportValidity())}formResetCallback(){r(this,ui).reset(),this.files=[],this._rejected="",this._progress=new Map,this._fileErrors=new Map}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,gi).values())URL.revokeObjectURL(e);r(this,gi).clear()}updated(e){if(e.has("files"))for(let[l,d]of r(this,gi))this.files.includes(l)||(URL.revokeObjectURL(d),r(this,gi).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);r(this,rt).setFormValue(this.files.length?t:null);let i=(r(this,j,ic)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,s=this.error||this._rejected;s?r(this,rt).setValidity({customError:!0},s,i):this.required&&!this.files.length?r(this,rt).setValidity({valueMissing:!0},this.t("required"),i):r(this,rt).setValidity({}),r(this,ui).sync()}addFiles(e){let t=[...e],i=[],s=[],l=[];for(let p of t)t0(p,r(this,j,Zu))?this.maxSize&&p.size>this.maxSize?(s.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,j,Rp).call(this,this.maxSize)}))):i.push(p):(s.push(p),l.push(this.t("wrongType",{name:p.name})));let d=r(this,j,Dp)?[...this.files,...i]:i.slice(-1);!r(this,j,Dp)&&!i.length&&(d=this.files),r(this,j,Dp)&&this.maxFiles&&d.length>this.maxFiles&&(s.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),s.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:s}})),d!==this.files&&(d.length!==this.files.length||d.some((p,u)=>p!==this.files[u]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}setProgress(e,t){let i=new Map(this._progress);t==null?i.delete(e):i.set(e,Math.min(100,Math.max(0,Number(t)||0))),this._progress=i}setFileError(e,t){let i=new Map(this._fileErrors);t?i.set(e,t):i.delete(e),this._fileErrors=i}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this._progress.has(e)&&this.setProgress(e,null),this._fileErrors.has(e)&&this.setFileError(e,""),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(r(this,j,ic))return a(this,j,wv).call(this);let e=this.error||this._rejected||r(this,ui).message,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
1050
+ `];$("cm-time-picker",Yi);var $E=C("fileUpload",{prompt:"Drag files here or {browse}",browse:"Browse",drop:"Drop files to upload",uploading:"Uploading {name}",cancel:"Cancel uploading {name}",cancelShort:"Cancel",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 t0(o,n){if(!n.trim())return!0;let e=o.name.toLowerCase(),t=o.type.toLowerCase();return n.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 rt,ui,ce,gi,j,ic,Zu,Dp,Rp,Qu,eg,tg,ig,Yr,vv,yv,rg,xv,wv,Xi=class extends T{constructor(){super(...arguments);m(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="";this._progress=new Map;this._fileErrors=new Map;this._over=!1;m(this,rt,this.attachInternals());m(this,ui,new ie(this,r(this,rt)));m(this,ce,N("cm-fu"));m(this,gi,new Map)}get form(){return r(this,rt).form}get validity(){return r(this,rt).validity}get validationMessage(){return r(this,rt).validationMessage}checkValidity(){return r(this,rt).checkValidity()}reportValidity(){return r(this,ui).report(()=>r(this,rt).reportValidity())}formResetCallback(){r(this,ui).reset(),this.files=[],this._rejected="",this._progress=new Map,this._fileErrors=new Map}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback();for(let e of r(this,gi).values())URL.revokeObjectURL(e);r(this,gi).clear()}updated(e){if(e.has("files"))for(let[l,d]of r(this,gi))this.files.includes(l)||(URL.revokeObjectURL(d),r(this,gi).delete(l));let t=new FormData;for(let l of this.files)t.append(this.name||"file",l);r(this,rt).setFormValue(this.files.length?t:null);let i=(r(this,j,ic)&&this.files.length?this.renderRoot.querySelector(".retake"):this.renderRoot.querySelector("input"))??void 0,s=this.error||this._rejected;s?r(this,rt).setValidity({customError:!0},s,i):this.required&&!this.files.length?r(this,rt).setValidity({valueMissing:!0},this.t("required"),i):r(this,rt).setValidity({}),r(this,ui).sync()}addFiles(e){let t=[...e],i=[],s=[],l=[];for(let p of t)t0(p,r(this,j,Zu))?this.maxSize&&p.size>this.maxSize?(s.push(p),l.push(this.t("tooLarge",{name:p.name,size:a(this,j,Rp).call(this,this.maxSize)}))):i.push(p):(s.push(p),l.push(this.t("wrongType",{name:p.name})));let d=r(this,j,Dp)?[...this.files,...i]:i.slice(-1);!r(this,j,Dp)&&!i.length&&(d=this.files),r(this,j,Dp)&&this.maxFiles&&d.length>this.maxFiles&&(s.push(...d.slice(this.maxFiles)),l.push(this.t("tooMany",{max:this.maxFiles})),d=d.slice(0,this.maxFiles)),this._rejected=l.join(". "),s.length&&this.dispatchEvent(new CustomEvent("cm-reject",{bubbles:!0,composed:!0,detail:{files:s}})),d!==this.files&&(d.length!==this.files.length||d.some((p,u)=>p!==this.files[u]))&&(this.files=d,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}setProgress(e,t){let i=new Map(this._progress);t==null?i.delete(e):i.set(e,Math.min(100,Math.max(0,Number(t)||0))),this._progress=i}setFileError(e,t){let i=new Map(this._fileErrors);t?i.set(e,t):i.delete(e),this._fileErrors=i}removeFile(e){this.files.includes(e)&&(this.files=this.files.filter(t=>t!==e),this._rejected="",this._progress.has(e)&&this.setProgress(e,null),this._fileErrors.has(e)&&this.setFileError(e,""),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.renderRoot.querySelector("input")?.focus()))}render(){if(r(this,j,ic))return a(this,j,wv).call(this);let e=this.error||this._rejected||r(this,ui).message,t=!this.files.length||this.multiple,i=this.files.length>0;return c`
1051
1051
  ${this.label||this.hint&&i?c`<div class="head">
1052
1052
  ${this.label?c`<span class="label" id="${r(this,ce)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
1053
1053
  ${this.hint&&i?c`<span class="hint" id="${r(this,ce)}-hint">${this.hint}</span>`:h}
@@ -1180,70 +1180,70 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1180
1180
  @media (max-width: 640px) {
1181
1181
  .label { font-size: var(--cm-type-heading-sm-resp-size); }
1182
1182
  }
1183
- `];$("cm-file-upload",Xi);var fi=(o,n,e)=>Math.min(e,Math.max(n,o)),Xr=(o,n=0)=>{let e=10**n;return Math.round(o*e)/e};function Zr(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}function Hp(o,n){let e=/^(-?\d*\.?\d+(?:e-?\d+)?)(%)?$/i.exec(o.trim());if(!e)return null;let t=parseFloat(e[1]);return e[2]?t/100*n:t}function kv(o){let n=/^(-?\d*\.?\d+)(deg|turn|rad|grad)?$/i.exec(o.trim());if(!n)return null;let e=parseFloat(n[1]),t=(n[2]??"deg").toLowerCase();return((t==="turn"?e*360:t==="rad"?e*180/Math.PI:t==="grad"?e*.9:e)%360+360)%360}function i0(o){let n=o.trim(),e;if(n.includes(","))e=n.split(",").map(t=>t.trim());else{let[t,i]=n.split("/").map(s=>s.trim());e=t.split(/\s+/),i!==void 0&&e.push(i)}return e.length===3||e.length===4?e:null}function De(o){let n=(o??"").trim().toLowerCase();if(!n)return null;if(n==="transparent")return{r:0,g:0,b:0,a:0};let e=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(n);if(e){let u=e[1];u.length<=4&&(u=[...u].map(f=>f+f).join(""));let b=f=>parseInt(u.slice(f,f+2),16);return{r:b(0),g:b(2),b:b(4),a:u.length===8?Xr(b(6)/255,3):1}}let t=/^(rgba?|hsla?)\((.*)\)$/.exec(n);if(!t)return null;let i=i0(t[2]);if(!i)return null;let s=i[3]===void 0?1:Hp(i[3],1);if(s===null)return null;if(t[1].startsWith("rgb")){let[u,b,f]=i.slice(0,3).map(x=>Hp(x,255));return u===null||b===null||f===null?null:{r:fi(Math.round(u),0,255),g:fi(Math.round(b),0,255),b:fi(Math.round(f),0,255),a:fi(Xr(s,3),0,1)}}let l=kv(i[0]),d=Hp(i[1].endsWith("%")?i[1]:`${i[1]}%`,100),p=Hp(i[2].endsWith("%")?i[2]:`${i[2]}%`,100);return l===null||d===null||p===null?null:{...ac({h:l,s:fi(d,0,100),l:fi(p,0,100),a:1}),a:fi(Xr(s,3),0,1)}}function Pp({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=0;return u&&(b=d===i?(s-l)/u%6:d===s?(l-i)/u+2:(i-s)/u+4),{h:(b*60+360)%360,s:d?u/d*100:0,v:d*100,a:t}}function Ip({h:o,s:n,v:e,a:t}){let i=n/100,s=e/100,l=d=>{let p=(d+o/60)%6;return s-s*i*Math.max(0,Math.min(p,4-p,1))};return{r:Math.round(l(5)*255),g:Math.round(l(3)*255),b:Math.round(l(1)*255),a:t}}function sc({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=(d+p)/2,f=u?u/(1-Math.abs(2*b-1)):0;return{h:Pp({r:o,g:n,b:e,a:t}).h,s:f*100,l:b*100,a:t}}function ac({h:o,s:n,l:e,a:t}){let i=n/100,s=e/100,l=u=>(u+o/30)%12,d=i*Math.min(s,1-s),p=u=>s-d*Math.max(-1,Math.min(l(u)-3,9-l(u),1));return{r:Math.round(p(0)*255),g:Math.round(p(8)*255),b:Math.round(p(4)*255),a:t}}var Np=o=>Math.round(o).toString(16).padStart(2,"0"),rc=({r:o,g:n,b:e})=>`#${Np(o)}${Np(n)}${Np(e)}`;function Qr(o,n="hex"){let e=Xr(fi(o.a,0,1),2),t=e<1;if(n==="rgb")return t?`rgba(${o.r}, ${o.g}, ${o.b}, ${e})`:`rgb(${o.r}, ${o.g}, ${o.b})`;if(n==="hsl"){let{h:i,s,l}=sc(o),d=`${Math.round(i)}, ${Math.round(s)}%, ${Math.round(l)}%`;return t?`hsla(${d}, ${e})`:`hsl(${d})`}return t?`${rc(o)}${Np(e*255)}`:rc(o)}function r0(o){let n=[],e=0,t=0;for(let i=0;i<o.length;i++)o[i]==="("?e++:o[i]===")"?e--:o[i]===","&&e===0&&(n.push(o.slice(t,i).trim()),t=i+1);return n.push(o.slice(t).trim()),n}var $v={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};function Ct(o){let n=/^(linear|radial)-gradient\((.*)\)$/i.exec((o??"").trim());if(!n)return null;let e=n[1].toLowerCase(),t=r0(n[2]),i=180,s=t[0]?.toLowerCase().replace(/\s+/g," ")??"";if(e==="linear"){let p=kv(s);p!==null&&/[a-z]/.test(s)?(i=p,t.shift()):s in $v&&(i=$v[s],t.shift())}else/^(circle|ellipse|closest|farthest|at )/.test(s)&&!De(s.split(" ")[0])&&t.shift();let l=t.map(p=>{let u=/^(.*?)(?:\s+(-?\d*\.?\d+)%)?$/.exec(p);return{color:De(u[1]),position:u[2]===void 0?void 0:fi(parseFloat(u[2]),0,100)}});if(l.length<2||l.some(p=>!p.color))return null;let d=l.map((p,u)=>({color:p.color,position:p.position??Xr(u/(l.length-1)*100,1)}));return{type:e,angle:Math.round(i),stops:d}}function Jr(o,n="hex"){let e=[...o.stops].sort((t,i)=>t.position-i.position).map(t=>`${Qr(t.color,n)} ${Xr(t.position,1)}%`).join(", ");return o.type==="radial"?`radial-gradient(circle, ${e})`:`linear-gradient(${Math.round(o.angle)}deg, ${e})`}function Ev(o,n){let e=[...o.stops].sort((t,i)=>t.position-i.position);if(n<=e[0].position)return{...e[0].color};for(let t=1;t<e.length;t++)if(n<=e[t].position){let i=e[t-1],s=e[t],l=(n-i.position)/(s.position-i.position||1),d=(p,u)=>p+(u-p)*l;return{r:Math.round(d(i.color.r,s.color.r)),g:Math.round(d(i.color.g,s.color.g)),b:Math.round(d(i.color.b,s.color.b)),a:Xr(d(i.color.a,s.color.a),2)}}return{...e[e.length-1].color}}function nc(o,n){let e=De(o),t=De(n);if(e&&t)return e.r===t.r&&e.g===t.g&&e.b===t.b&&Math.abs(e.a-t.a)<.005;let i=Ct(o),s=Ct(n);return!!i&&!!s&&Jr(i)===Jr(s)}var sg=o=>!!De(o)||!!Ct(o);var Za=16;function qp(o,n,e=16){let t=n.trim().toLowerCase();return[n.trim(),...o.filter(i=>i.trim().toLowerCase()!==t)].slice(0,e)}function ag(o="default",n=16){let e=`cm-recent-colors:${o}`,t=()=>{try{let i=JSON.parse(localStorage.getItem(e)??"[]");return Array.isArray(i)?i.filter(s=>typeof s=="string").slice(0,n):[]}catch{return[]}};return{recentColors:async()=>t(),async addRecentColor(i){let s=qp(t(),i,n);try{localStorage.setItem(e,JSON.stringify(s))}catch{}return s}}}function s0(o){let n=o.baseUrl.replace(/\/+$/,""),e=async(t,i={})=>{let s=typeof o.headers=="function"?await o.headers():o.headers??{},l=await(o.fetch??fetch)(`${n}${t}`,{credentials:o.credentials??"same-origin",...i,headers:{Accept:"application/json",...i.body?{"Content-Type":"application/json"}:{},...s}});if(!l.ok)throw new Error(`Colour API ${t}: HTTP ${l.status}`);let d=await l.json();return Array.isArray(d?.colors)?d.colors:[]};return{brandColors:()=>e("/brand-colors"),recentColors:async()=>(await e("/recent-colors")).filter(t=>typeof t=="string"),addRecentColor:async t=>(await e("/recent-colors",{method:"POST",body:JSON.stringify({color:t})})).filter(i=>typeof i=="string")}}var DE=C("colorPicker",{label:"Colour picker",solid:"Solid",gradient:"Gradient",area:"Saturation and brightness",areaValue:"Saturation {s}%, brightness {v}%",hue:"Hue",opacity:"Opacity",format:"Colour format",hex:"Hex",rgb:"RGB",hsl:"HSL",red:"Red",green:"Green",blue:"Blue",saturation:"Saturation",lightness:"Lightness",eyedropper:"Pick a colour from the screen",gradientType:"Gradient type",linear:"Linear",radial:"Radial",angle:"Angle",stops:"Gradient stops",stop:"Stop {n}, {color} at {position}%",addStop:"Add stop",removeStop:"Remove stop",brand:"Brand colours",recent:"Recent",palette:"Palette",swatch:"{name}, {value}"}),Mv=["#000000","#707070","#c9c9c9","#de0000","#ad5500","#f1a953","#ffc107","#81bb47","#3c7c00","#5394d9","#2e6faf","#446beb"].map(o=>({value:o})),a0=["hex","rgb","hsl"],ng=o=>(o??[]).flatMap(n=>{let e=typeof n=="string"?{value:n}:n;return e&&typeof e.value=="string"&&(De(e.value)||Ct(e.value))?[{value:e.value.trim(),name:e.name}]:[]}),Vp,dc,tn,hc,bi,T,og,lg,Tv,Ji,es,st,cg,dg,hg,_v,Cv,oc,zv,pg,mg,Sv,Op,ug,Lv,lc,Bp,cc,gg,Av,Dv,Rv,Qa,fg,Hv,Nv,Fp,Pv,en=class extends _{constructor(){super(...arguments);m(this,T);this.value="";this.format="hex";this.formats="hex rgb hsl";this.alpha=!1;this.gradient=!1;this.recentKey="";this.maxRecent=16;this.eyedropper=!0;this.disabled=!1;this._hsva={h:0,s:0,v:0,a:1};this._grad=null;this._stop=0;this._brand=[];this._recent=[];this._drafts={};m(this,Vp,N("cm-cp"));m(this,dc);m(this,tn);m(this,hc);m(this,bi,null)}connectedCallback(){super.connectedCallback(),a(this,T,lg).call(this)}get allowedFormats(){let e=String(this.formats??"").split(/[\s,]+/).filter(t=>a0.includes(t));return e.length?e:["hex"]}get palette(){return this.swatches?ng(this.swatches):Mv}get brand(){return this.brandColors?ng(this.brandColors):this._brand}get recent(){return(this.recentColors??this._recent).filter(t=>De(t)||this.gradient&&Ct(t)).filter(t=>this.alpha||(De(t)?.a??1)===1).slice(0,this.maxRecent||16)}willUpdate(e){e.has("recentKey")&&g(this,hc,void 0),(e.has("source")||e.has("recentKey"))&&a(this,T,lg).call(this),e.has("format")&&!this.allowedFormats.includes(this.format)&&(this.format=this.allowedFormats[0]),e.has("value")&&this.value!==r(this,dc)&&a(this,T,Tv).call(this)}render(){let{h:e,s:t,v:i,a:s}=this._hsva,l=r(this,T,es),d=rc(l),p=this.allowedFormats,u=this._grad,b=this.matches(":dir(rtl)"),f=this.eyedropper&&typeof window<"u"&&"EyeDropper"in window,x=u?Jr({...u,type:"linear",angle:b?270:90}):"";return c`<div class="panel" role="group" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1183
+ `];$("cm-file-upload",Xi);var fi=(o,n,e)=>Math.min(e,Math.max(n,o)),Xr=(o,n=0)=>{let e=10**n;return Math.round(o*e)/e};function Zr(o){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(o.trim());return n?`#${(n[1].length===3?[...n[1]].map(t=>t+t).join(""):n[1]).toLowerCase()}`:null}function Hp(o,n){let e=/^(-?\d*\.?\d+(?:e-?\d+)?)(%)?$/i.exec(o.trim());if(!e)return null;let t=parseFloat(e[1]);return e[2]?t/100*n:t}function kv(o){let n=/^(-?\d*\.?\d+)(deg|turn|rad|grad)?$/i.exec(o.trim());if(!n)return null;let e=parseFloat(n[1]),t=(n[2]??"deg").toLowerCase();return((t==="turn"?e*360:t==="rad"?e*180/Math.PI:t==="grad"?e*.9:e)%360+360)%360}function i0(o){let n=o.trim(),e;if(n.includes(","))e=n.split(",").map(t=>t.trim());else{let[t,i]=n.split("/").map(s=>s.trim());e=t.split(/\s+/),i!==void 0&&e.push(i)}return e.length===3||e.length===4?e:null}function De(o){let n=(o??"").trim().toLowerCase();if(!n)return null;if(n==="transparent")return{r:0,g:0,b:0,a:0};let e=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(n);if(e){let u=e[1];u.length<=4&&(u=[...u].map(f=>f+f).join(""));let b=f=>parseInt(u.slice(f,f+2),16);return{r:b(0),g:b(2),b:b(4),a:u.length===8?Xr(b(6)/255,3):1}}let t=/^(rgba?|hsla?)\((.*)\)$/.exec(n);if(!t)return null;let i=i0(t[2]);if(!i)return null;let s=i[3]===void 0?1:Hp(i[3],1);if(s===null)return null;if(t[1].startsWith("rgb")){let[u,b,f]=i.slice(0,3).map(x=>Hp(x,255));return u===null||b===null||f===null?null:{r:fi(Math.round(u),0,255),g:fi(Math.round(b),0,255),b:fi(Math.round(f),0,255),a:fi(Xr(s,3),0,1)}}let l=kv(i[0]),d=Hp(i[1].endsWith("%")?i[1]:`${i[1]}%`,100),p=Hp(i[2].endsWith("%")?i[2]:`${i[2]}%`,100);return l===null||d===null||p===null?null:{...ac({h:l,s:fi(d,0,100),l:fi(p,0,100),a:1}),a:fi(Xr(s,3),0,1)}}function Pp({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=0;return u&&(b=d===i?(s-l)/u%6:d===s?(l-i)/u+2:(i-s)/u+4),{h:(b*60+360)%360,s:d?u/d*100:0,v:d*100,a:t}}function Ip({h:o,s:n,v:e,a:t}){let i=n/100,s=e/100,l=d=>{let p=(d+o/60)%6;return s-s*i*Math.max(0,Math.min(p,4-p,1))};return{r:Math.round(l(5)*255),g:Math.round(l(3)*255),b:Math.round(l(1)*255),a:t}}function sc({r:o,g:n,b:e,a:t}){let i=o/255,s=n/255,l=e/255,d=Math.max(i,s,l),p=Math.min(i,s,l),u=d-p,b=(d+p)/2,f=u?u/(1-Math.abs(2*b-1)):0;return{h:Pp({r:o,g:n,b:e,a:t}).h,s:f*100,l:b*100,a:t}}function ac({h:o,s:n,l:e,a:t}){let i=n/100,s=e/100,l=u=>(u+o/30)%12,d=i*Math.min(s,1-s),p=u=>s-d*Math.max(-1,Math.min(l(u)-3,9-l(u),1));return{r:Math.round(p(0)*255),g:Math.round(p(8)*255),b:Math.round(p(4)*255),a:t}}var Np=o=>Math.round(o).toString(16).padStart(2,"0"),rc=({r:o,g:n,b:e})=>`#${Np(o)}${Np(n)}${Np(e)}`;function Qr(o,n="hex"){let e=Xr(fi(o.a,0,1),2),t=e<1;if(n==="rgb")return t?`rgba(${o.r}, ${o.g}, ${o.b}, ${e})`:`rgb(${o.r}, ${o.g}, ${o.b})`;if(n==="hsl"){let{h:i,s,l}=sc(o),d=`${Math.round(i)}, ${Math.round(s)}%, ${Math.round(l)}%`;return t?`hsla(${d}, ${e})`:`hsl(${d})`}return t?`${rc(o)}${Np(e*255)}`:rc(o)}function r0(o){let n=[],e=0,t=0;for(let i=0;i<o.length;i++)o[i]==="("?e++:o[i]===")"?e--:o[i]===","&&e===0&&(n.push(o.slice(t,i).trim()),t=i+1);return n.push(o.slice(t).trim()),n}var $v={"to top":0,"to top right":45,"to right top":45,"to right":90,"to bottom right":135,"to right bottom":135,"to bottom":180,"to bottom left":225,"to left bottom":225,"to left":270,"to top left":315,"to left top":315};function Ct(o){let n=/^(linear|radial)-gradient\((.*)\)$/i.exec((o??"").trim());if(!n)return null;let e=n[1].toLowerCase(),t=r0(n[2]),i=180,s=t[0]?.toLowerCase().replace(/\s+/g," ")??"";if(e==="linear"){let p=kv(s);p!==null&&/[a-z]/.test(s)?(i=p,t.shift()):s in $v&&(i=$v[s],t.shift())}else/^(circle|ellipse|closest|farthest|at )/.test(s)&&!De(s.split(" ")[0])&&t.shift();let l=t.map(p=>{let u=/^(.*?)(?:\s+(-?\d*\.?\d+)%)?$/.exec(p);return{color:De(u[1]),position:u[2]===void 0?void 0:fi(parseFloat(u[2]),0,100)}});if(l.length<2||l.some(p=>!p.color))return null;let d=l.map((p,u)=>({color:p.color,position:p.position??Xr(u/(l.length-1)*100,1)}));return{type:e,angle:Math.round(i),stops:d}}function Jr(o,n="hex"){let e=[...o.stops].sort((t,i)=>t.position-i.position).map(t=>`${Qr(t.color,n)} ${Xr(t.position,1)}%`).join(", ");return o.type==="radial"?`radial-gradient(circle, ${e})`:`linear-gradient(${Math.round(o.angle)}deg, ${e})`}function Ev(o,n){let e=[...o.stops].sort((t,i)=>t.position-i.position);if(n<=e[0].position)return{...e[0].color};for(let t=1;t<e.length;t++)if(n<=e[t].position){let i=e[t-1],s=e[t],l=(n-i.position)/(s.position-i.position||1),d=(p,u)=>p+(u-p)*l;return{r:Math.round(d(i.color.r,s.color.r)),g:Math.round(d(i.color.g,s.color.g)),b:Math.round(d(i.color.b,s.color.b)),a:Xr(d(i.color.a,s.color.a),2)}}return{...e[e.length-1].color}}function nc(o,n){let e=De(o),t=De(n);if(e&&t)return e.r===t.r&&e.g===t.g&&e.b===t.b&&Math.abs(e.a-t.a)<.005;let i=Ct(o),s=Ct(n);return!!i&&!!s&&Jr(i)===Jr(s)}var sg=o=>!!De(o)||!!Ct(o);var Za=16;function qp(o,n,e=16){let t=n.trim().toLowerCase();return[n.trim(),...o.filter(i=>i.trim().toLowerCase()!==t)].slice(0,e)}function ag(o="default",n=16){let e=`cm-recent-colors:${o}`,t=()=>{try{let i=JSON.parse(localStorage.getItem(e)??"[]");return Array.isArray(i)?i.filter(s=>typeof s=="string").slice(0,n):[]}catch{return[]}};return{recentColors:async()=>t(),async addRecentColor(i){let s=qp(t(),i,n);try{localStorage.setItem(e,JSON.stringify(s))}catch{}return s}}}function s0(o){let n=o.baseUrl.replace(/\/+$/,""),e=async(t,i={})=>{let s=typeof o.headers=="function"?await o.headers():o.headers??{},l=await(o.fetch??fetch)(`${n}${t}`,{credentials:o.credentials??"same-origin",...i,headers:{Accept:"application/json",...i.body?{"Content-Type":"application/json"}:{},...s}});if(!l.ok)throw new Error(`Colour API ${t}: HTTP ${l.status}`);let d=await l.json();return Array.isArray(d?.colors)?d.colors:[]};return{brandColors:()=>e("/brand-colors"),recentColors:async()=>(await e("/recent-colors")).filter(t=>typeof t=="string"),addRecentColor:async t=>(await e("/recent-colors",{method:"POST",body:JSON.stringify({color:t})})).filter(i=>typeof i=="string")}}var DE=C("colorPicker",{label:"Colour picker",solid:"Solid",gradient:"Gradient",area:"Saturation and brightness",areaValue:"Saturation {s}%, brightness {v}%",hue:"Hue",opacity:"Opacity",format:"Colour format",hex:"Hex",rgb:"RGB",hsl:"HSL",red:"Red",green:"Green",blue:"Blue",saturation:"Saturation",lightness:"Lightness",eyedropper:"Pick a colour from the screen",gradientType:"Gradient type",linear:"Linear",radial:"Radial",angle:"Angle",stops:"Gradient stops",stop:"Stop {n}, {color} at {position}%",addStop:"Add stop",removeStop:"Remove stop",brand:"Brand colours",recent:"Recent",palette:"Palette",swatch:"{name}, {value}"}),Mv=["#000000","#707070","#c9c9c9","#de0000","#ad5500","#f1a953","#ffc107","#81bb47","#3c7c00","#5394d9","#2e6faf","#446beb"].map(o=>({value:o})),a0=["hex","rgb","hsl"],ng=o=>(o??[]).flatMap(n=>{let e=typeof n=="string"?{value:n}:n;return e&&typeof e.value=="string"&&(De(e.value)||Ct(e.value))?[{value:e.value.trim(),name:e.name}]:[]}),Vp,dc,tn,hc,bi,_,og,lg,_v,Ji,es,st,cg,dg,hg,Tv,Cv,oc,zv,pg,mg,Sv,Op,ug,Lv,lc,Bp,cc,gg,Av,Dv,Rv,Qa,fg,Hv,Nv,Fp,Pv,en=class extends T{constructor(){super(...arguments);m(this,_);this.value="";this.format="hex";this.formats="hex rgb hsl";this.alpha=!1;this.gradient=!1;this.recentKey="";this.maxRecent=16;this.eyedropper=!0;this.disabled=!1;this._hsva={h:0,s:0,v:0,a:1};this._grad=null;this._stop=0;this._brand=[];this._recent=[];this._drafts={};m(this,Vp,N("cm-cp"));m(this,dc);m(this,tn);m(this,hc);m(this,bi,null)}connectedCallback(){super.connectedCallback(),a(this,_,lg).call(this)}get allowedFormats(){let e=String(this.formats??"").split(/[\s,]+/).filter(t=>a0.includes(t));return e.length?e:["hex"]}get palette(){return this.swatches?ng(this.swatches):Mv}get brand(){return this.brandColors?ng(this.brandColors):this._brand}get recent(){return(this.recentColors??this._recent).filter(t=>De(t)||this.gradient&&Ct(t)).filter(t=>this.alpha||(De(t)?.a??1)===1).slice(0,this.maxRecent||16)}willUpdate(e){e.has("recentKey")&&g(this,hc,void 0),(e.has("source")||e.has("recentKey"))&&a(this,_,lg).call(this),e.has("format")&&!this.allowedFormats.includes(this.format)&&(this.format=this.allowedFormats[0]),e.has("value")&&this.value!==r(this,dc)&&a(this,_,_v).call(this)}render(){let{h:e,s:t,v:i,a:s}=this._hsva,l=r(this,_,es),d=rc(l),p=this.allowedFormats,u=this._grad,b=this.matches(":dir(rtl)"),f=this.eyedropper&&typeof window<"u"&&"EyeDropper"in window,x=u?Jr({...u,type:"linear",angle:b?270:90}):"";return c`<div class="panel" role="group" aria-label=${this.getAttribute("aria-label")||this.t("label")}>
1184
1184
  ${this.gradient?c`<div class="tabs" role="radiogroup" aria-label=${this.t("label")}>
1185
- <button type="button" role="radio" aria-checked=${u?"false":"true"} tabindex=${u?"-1":"0"} @click=${()=>a(this,T,lc).call(this,!1)}
1186
- @keydown=${y=>{y.key.startsWith("Arrow")&&(y.preventDefault(),a(this,T,lc).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[1]?.focus()))}}>${this.t("solid")}</button>
1187
- <button type="button" role="radio" aria-checked=${u?"true":"false"} tabindex=${u?"0":"-1"} @click=${()=>a(this,T,lc).call(this,!0)}
1188
- @keydown=${y=>{y.key.startsWith("Arrow")&&(y.preventDefault(),a(this,T,lc).call(this,!1),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[0]?.focus()))}}>${this.t("gradient")}</button>
1185
+ <button type="button" role="radio" aria-checked=${u?"false":"true"} tabindex=${u?"-1":"0"} @click=${()=>a(this,_,lc).call(this,!1)}
1186
+ @keydown=${y=>{y.key.startsWith("Arrow")&&(y.preventDefault(),a(this,_,lc).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[1]?.focus()))}}>${this.t("solid")}</button>
1187
+ <button type="button" role="radio" aria-checked=${u?"true":"false"} tabindex=${u?"0":"-1"} @click=${()=>a(this,_,lc).call(this,!0)}
1188
+ @keydown=${y=>{y.key.startsWith("Arrow")&&(y.preventDefault(),a(this,_,lc).call(this,!1),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".tabs button")[0]?.focus()))}}>${this.t("gradient")}</button>
1189
1189
  </div>`:h}
1190
1190
  ${u?c`<div class="row">
1191
- <select aria-label=${this.t("gradientType")} @change=${y=>{y.stopPropagation(),a(this,T,Bp).call(this,{type:y.target.value})}}>
1191
+ <select aria-label=${this.t("gradientType")} @change=${y=>{y.stopPropagation(),a(this,_,Bp).call(this,{type:y.target.value})}}>
1192
1192
  <option value="linear" .selected=${Q(u.type==="linear")}>${this.t("linear")}</option><option value="radial" .selected=${Q(u.type==="radial")}>${this.t("radial")}</option>
1193
1193
  </select>
1194
1194
  ${u.type==="linear"?c`<input class="box num" type="text" inputmode="numeric" aria-label=${this.t("angle")} .value=${Q(this._drafts.angle??`${u.angle}\xB0`)}
1195
1195
  @input=${y=>{y.stopPropagation(),this._drafts={...this._drafts,angle:y.target.value}}}
1196
- @change=${y=>{y.stopPropagation();let k=parseFloat(y.target.value);this._drafts={},Number.isFinite(k)&&a(this,T,Bp).call(this,{angle:(Math.round(k)%360+360)%360})}} />`:h}
1196
+ @change=${y=>{y.stopPropagation();let k=parseFloat(y.target.value);this._drafts={},Number.isFinite(k)&&a(this,_,Bp).call(this,{angle:(Math.round(k)%360+360)%360})}} />`:h}
1197
1197
  <button type="button" class="icon-btn" aria-label=${this.t("removeStop")} title=${this.t("removeStop")} ?disabled=${u.stops.length<=2}
1198
- @click=${()=>a(this,T,fg).call(this,this._stop)}><cm-icon name="trash" size="16"></cm-icon></button>
1198
+ @click=${()=>a(this,_,fg).call(this,this._stop)}><cm-icon name="trash" size="16"></cm-icon></button>
1199
1199
  </div>
1200
- <div class="bar checker" role="group" aria-label=${this.t("stops")} @pointerdown=${a(this,T,Av)}>
1200
+ <div class="bar checker" role="group" aria-label=${this.t("stops")} @pointerdown=${a(this,_,Av)}>
1201
1201
  <span class="fill" style="background:${x}"></span>
1202
1202
  ${u.stops.map((y,k)=>c`<button type="button" class="handle" role="slider" aria-orientation="horizontal"
1203
1203
  aria-valuemin="0" aria-valuemax="100" aria-valuenow=${Math.round(y.position)}
1204
1204
  aria-label=${this.t("stop",{n:k+1,color:Qr(y.color,this.format),position:Math.round(y.position)})}
1205
1205
  aria-current=${k===this._stop?"true":"false"} style="inset-inline-start:${y.position}%;background:${Qr(y.color)}"
1206
- @pointerdown=${S=>a(this,T,Dv).call(this,S,k)} @pointermove=${S=>a(this,T,Rv).call(this,S,k)}
1207
- @pointerup=${a(this,T,oc)} @pointercancel=${a(this,T,oc)} @focus=${()=>{this._stop!==k&&a(this,T,cc).call(this,k)}}
1208
- @keydown=${S=>a(this,T,Hv).call(this,S,k)}></button>`)}
1206
+ @pointerdown=${S=>a(this,_,Dv).call(this,S,k)} @pointermove=${S=>a(this,_,Rv).call(this,S,k)}
1207
+ @pointerup=${a(this,_,oc)} @pointercancel=${a(this,_,oc)} @focus=${()=>{this._stop!==k&&a(this,_,cc).call(this,k)}}
1208
+ @keydown=${S=>a(this,_,Hv).call(this,S,k)}></button>`)}
1209
1209
  </div>`:h}
1210
1210
  <div class="area" part="area" tabindex="0" role="slider" aria-label=${this.t("area")}
1211
1211
  aria-valuetext=${this.t("areaValue",{s:Math.round(t),v:Math.round(i)})} aria-valuenow=${Math.round(t)} aria-valuemin="0" aria-valuemax="100"
1212
1212
  style="background-color:hsl(${e} 100% 50%)"
1213
- @pointerdown=${a(this,T,_v)} @pointermove=${a(this,T,Cv)} @pointerup=${a(this,T,oc)} @pointercancel=${a(this,T,oc)} @keydown=${a(this,T,zv)}>
1213
+ @pointerdown=${a(this,_,Tv)} @pointermove=${a(this,_,Cv)} @pointerup=${a(this,_,oc)} @pointercancel=${a(this,_,oc)} @keydown=${a(this,_,zv)}>
1214
1214
  <span class="thumb" style="left:${b?100-t:t}%;top:${100-i}%;background:${d}"></span>
1215
1215
  </div>
1216
1216
  <div class="sliders">
1217
1217
  <span class="preview checker" aria-hidden="true"><span style="background:${u?Jr(u):Qr(l)}"></span></span>
1218
1218
  <div class="stack">
1219
1219
  <input type="range" class="hue" min="0" max="360" step="1" .value=${Q(String(Math.round(e)))} aria-label=${this.t("hue")}
1220
- @input=${y=>a(this,T,pg).call(this,y,!1)} @change=${y=>a(this,T,pg).call(this,y,!0)} />
1220
+ @input=${y=>a(this,_,pg).call(this,y,!1)} @change=${y=>a(this,_,pg).call(this,y,!0)} />
1221
1221
  ${this.alpha?c`<div class="alpha-wrap checker"><input type="range" min="0" max="100" step="1" .value=${Q(String(Math.round(s*100)))}
1222
1222
  aria-label=${this.t("opacity")} aria-valuetext="${Math.round(s*100)}%"
1223
1223
  style="--track:linear-gradient(to ${b?"left":"right"}, transparent, ${d})"
1224
- @input=${y=>a(this,T,mg).call(this,y,!1)} @change=${y=>a(this,T,mg).call(this,y,!0)} /></div>`:h}
1224
+ @input=${y=>a(this,_,mg).call(this,y,!1)} @change=${y=>a(this,_,mg).call(this,y,!0)} /></div>`:h}
1225
1225
  </div>
1226
1226
  </div>
1227
1227
  <div class="row">
1228
- ${p.length>1?c`<select aria-label=${this.t("format")} @change=${a(this,T,Sv)}>
1228
+ ${p.length>1?c`<select aria-label=${this.t("format")} @change=${a(this,_,Sv)}>
1229
1229
  ${p.map(y=>c`<option value=${y} ?selected=${y===this.format} .selected=${Q(y===this.format)}>${this.t(y)}</option>`)}
1230
1230
  </select>`:h}
1231
- ${a(this,T,Pv).call(this)}
1232
- ${f?c`<button type="button" class="icon-btn" aria-label=${this.t("eyedropper")} title=${this.t("eyedropper")} @click=${a(this,T,Lv)}>
1231
+ ${a(this,_,Pv).call(this)}
1232
+ ${f?c`<button type="button" class="icon-btn" aria-label=${this.t("eyedropper")} title=${this.t("eyedropper")} @click=${a(this,_,Lv)}>
1233
1233
  <cm-icon name="eyedropper" size="16"></cm-icon></button>`:h}
1234
1234
  </div>
1235
- ${a(this,T,Fp).call(this,"brand",this.brand)}
1236
- ${a(this,T,Fp).call(this,"recent",this.recent.map(y=>({value:y})))}
1237
- ${a(this,T,Fp).call(this,"palette",this.palette)}
1238
- </div>`}};Vp=new WeakMap,dc=new WeakMap,tn=new WeakMap,hc=new WeakMap,bi=new WeakMap,T=new WeakSet,og=function(){if(this.source)return this.source;if(this.recentKey)return r(this,hc)??g(this,hc,ag(this.recentKey))},lg=async function(){let e=a(this,T,og).call(this);if(!e||e===r(this,tn))return;g(this,tn,e);let[t,i]=await Promise.allSettled([e.brandColors?.()??Promise.resolve([]),e.recentColors?.()??Promise.resolve([])]);r(this,tn)===e&&(t.status==="fulfilled"&&Array.isArray(t.value)&&(this._brand=ng(t.value)),i.status==="fulfilled"&&Array.isArray(i.value)&&(this._recent=i.value.filter(s=>typeof s=="string")))},Tv=function(){let e=(this.value??"").trim(),t=this.gradient?Ct(e):null;if(t)this._grad=t,this._stop=Math.min(this._stop,t.stops.length-1),a(this,T,Ji).call(this,t.stops[this._stop].color);else{this._grad=null;let i=De(e);i&&a(this,T,Ji).call(this,i)}/^rgba?\(/i.test(e)&&this.allowedFormats.includes("rgb")?this.format="rgb":/^hsla?\(/i.test(e)&&this.allowedFormats.includes("hsl")&&(this.format="hsl"),this._drafts={}},Ji=function(e){let t=Pp(e);(t.s===0||t.v===0)&&(t.h=this._hsva.h),t.v===0&&(t.s=this._hsva.s),this._hsva={...t,a:this.alpha?e.a:1}},es=function(){return Ip(this._hsva)},st=function(e=!1){let t;if(this._grad){let s=this._grad.stops.map((l,d)=>d===this._stop?{...l,color:r(this,T,es)}:l);this._grad={...this._grad,stops:s},t=Jr(this._grad,this.format)}else t=Qr(r(this,T,es),this.format);let i=t!==this.value;g(this,dc,t),this.value=t,i&&a(this,T,cg).call(this,"input"),e&&a(this,T,dg).call(this)},cg=function(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))},dg=function(){a(this,T,cg).call(this,"change");let e=this.value;if(!e||[...this.brand,...this.palette].some(l=>nc(l.value,e)))return;let t=this.recentColors??this._recent;if(t[0]&&nc(t[0],e))return;let i=qp(t,e,Math.max(this.maxRecent||16,16));this._recent=i,this.dispatchEvent(new CustomEvent("cm-recent-change",{detail:{colors:i},bubbles:!0,composed:!0})),a(this,T,og).call(this)?.addRecentColor?.(e)?.then(l=>{Array.isArray(l)&&(this._recent=l)}).catch(()=>{})},hg=function(e){let t=e.currentTarget.getBoundingClientRect(),i=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),l=getComputedStyle(this).direction==="rtl";this._hsva={...this._hsva,s:(l?1-i:i)*100,v:(1-s)*100},a(this,T,st).call(this)},_v=function(e){if(e.button!==0)return;let t=e.currentTarget;t.setPointerCapture?.(e.pointerId),t.focus(),g(this,bi,"area"),a(this,T,hg).call(this,e)},Cv=function(e){r(this,bi)==="area"&&a(this,T,hg).call(this,e)},oc=function(){r(this,bi)!==null&&(g(this,bi,null),a(this,T,dg).call(this))},zv=function(e){let t=e.shiftKey?10:1,i=getComputedStyle(this).direction==="rtl",{s,v:l}=this._hsva;if(e.key==="ArrowRight")s+=i?-t:t;else if(e.key==="ArrowLeft")s+=i?t:-t;else if(e.key==="ArrowUp")l+=t;else if(e.key==="ArrowDown")l-=t;else if(e.key==="Home")s=0;else if(e.key==="End")s=100;else if(e.key==="PageUp")l=100;else if(e.key==="PageDown")l=0;else return;e.preventDefault(),this._hsva={...this._hsva,s:Math.min(100,Math.max(0,s)),v:Math.min(100,Math.max(0,l))},a(this,T,st).call(this,!0)},pg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,h:Number(e.target.value)},a(this,T,st).call(this,t)},mg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,a:Number(e.target.value)/100},a(this,T,st).call(this,t)},Sv=function(e){e.stopPropagation(),this.format=e.target.value,this._drafts={},this.value&&a(this,T,st).call(this,!0)},Op=function(e,t,i){e.stopPropagation();let s=e.target.value,l=a(this,T,ug).call(this,t,s);if(!l){this._drafts={...this._drafts,[t]:s};return}this._drafts=i?{}:{...this._drafts,[t]:s},a(this,T,Ji).call(this,l),a(this,T,st).call(this,i)},ug=function(e,t){let i=r(this,T,es);if(e==="hex"){let d=t.trim();if(!/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(d))return null;let p=De(d);return p&&(this.alpha&&/^#?[0-9a-f]{8}$/i.test(d)?p:{...p,a:this._hsva.a})}let s=Number(t);if(t.trim()===""||!Number.isFinite(s))return null;if(e==="a")return s>=0&&s<=100?{...i,a:s/100}:null;if(e==="r"||e==="g"||e==="b")return s>=0&&s<=255?{...i,[e]:Math.round(s)}:null;let l=sc(i);return e==="h"?s>=0&&s<=360?ac({...l,h:s%360,a:i.a}):null:(e==="s"||e==="l")&&s>=0&&s<=100?ac({...l,[e]:s,a:i.a}):null},Lv=async function(){let e=window.EyeDropper;if(e)try{let{sRGBHex:t}=await new e().open(),i=De(t);if(!i)return;a(this,T,Ji).call(this,{...i,a:this._hsva.a}),a(this,T,st).call(this,!0)}catch{}},lc=function(e){if(e!==!!this._grad){if(e){let t=r(this,T,es),i=Ip({...this._hsva,h:(this._hsva.h+60)%360,s:Math.max(this._hsva.s,40),v:Math.max(this._hsva.v,60)});this._grad={type:"linear",angle:90,stops:[{color:t,position:0},{color:i,position:100}]},this._stop=0}else this._grad=null;a(this,T,st).call(this,!0)}},Bp=function(e,t=!0){this._grad&&(this._grad={...this._grad,...e},a(this,T,st).call(this,t))},cc=function(e){this._grad&&(this._stop=e,a(this,T,Ji).call(this,this._grad.stops[e].color),this._drafts={})},gg=function(e,t){let i=t.getBoundingClientRect(),s=Math.min(1,Math.max(0,(e.clientX-i.left)/i.width));return Math.round((getComputedStyle(this).direction==="rtl"?1-s:s)*100)},Av=function(e){if(!this._grad||e.button!==0||e.target.closest(".handle"))return;let t=a(this,T,gg).call(this,e,e.currentTarget),i=Ev(this._grad,t),s=[...this._grad.stops,{color:i,position:t}];this._grad={...this._grad,stops:s},a(this,T,cc).call(this,s.length-1),a(this,T,st).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[s.length-1]?.focus())},Dv=function(e,t){e.button===0&&(e.stopPropagation(),e.currentTarget.setPointerCapture?.(e.pointerId),a(this,T,cc).call(this,t),g(this,bi,t))},Rv=function(e,t){if(r(this,bi)!==t||!this._grad)return;let i=this.renderRoot.querySelector(".bar");a(this,T,Qa).call(this,t,a(this,T,gg).call(this,e,i),!1)},Qa=function(e,t,i){if(!this._grad)return;let s=this._grad.stops.map((l,d)=>d===e?{...l,position:Math.min(100,Math.max(0,t))}:l);a(this,T,Bp).call(this,{stops:s},i)},fg=function(e){if(!this._grad||this._grad.stops.length<=2)return;let t=this._grad.stops.filter((i,s)=>s!==e);this._grad={...this._grad,stops:t},a(this,T,cc).call(this,Math.min(e,t.length-1)),a(this,T,st).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[this._stop]?.focus())},Hv=function(e,t){if(!this._grad)return;let i=e.shiftKey?10:1,s=getComputedStyle(this).direction==="rtl",l=this._grad.stops[t].position;if(e.key==="ArrowRight"||e.key==="ArrowUp")a(this,T,Qa).call(this,t,l+(s&&e.key==="ArrowRight"?-i:i),!0);else if(e.key==="ArrowLeft"||e.key==="ArrowDown")a(this,T,Qa).call(this,t,l-(s&&e.key==="ArrowLeft"?-i:i),!0);else if(e.key==="Home")a(this,T,Qa).call(this,t,0,!0);else if(e.key==="End")a(this,T,Qa).call(this,t,100,!0);else if(e.key==="Delete"||e.key==="Backspace")a(this,T,fg).call(this,t);else return;e.preventDefault()},Nv=function(e){let t=Ct(e);if(t&&this.gradient)this._grad=t,this._stop=0,a(this,T,Ji).call(this,t.stops[0].color);else{let i=De(e);if(!i)return;this._grad=null,a(this,T,Ji).call(this,i)}this._drafts={},a(this,T,st).call(this,!0)},Fp=function(e,t){if(!t.length)return h;let i=`${r(this,Vp)}-${e}`;return c`<div class="group" role="group" aria-labelledby=${i}>
1235
+ ${a(this,_,Fp).call(this,"brand",this.brand)}
1236
+ ${a(this,_,Fp).call(this,"recent",this.recent.map(y=>({value:y})))}
1237
+ ${a(this,_,Fp).call(this,"palette",this.palette)}
1238
+ </div>`}};Vp=new WeakMap,dc=new WeakMap,tn=new WeakMap,hc=new WeakMap,bi=new WeakMap,_=new WeakSet,og=function(){if(this.source)return this.source;if(this.recentKey)return r(this,hc)??g(this,hc,ag(this.recentKey))},lg=async function(){let e=a(this,_,og).call(this);if(!e||e===r(this,tn))return;g(this,tn,e);let[t,i]=await Promise.allSettled([e.brandColors?.()??Promise.resolve([]),e.recentColors?.()??Promise.resolve([])]);r(this,tn)===e&&(t.status==="fulfilled"&&Array.isArray(t.value)&&(this._brand=ng(t.value)),i.status==="fulfilled"&&Array.isArray(i.value)&&(this._recent=i.value.filter(s=>typeof s=="string")))},_v=function(){let e=(this.value??"").trim(),t=this.gradient?Ct(e):null;if(t)this._grad=t,this._stop=Math.min(this._stop,t.stops.length-1),a(this,_,Ji).call(this,t.stops[this._stop].color);else{this._grad=null;let i=De(e);i&&a(this,_,Ji).call(this,i)}/^rgba?\(/i.test(e)&&this.allowedFormats.includes("rgb")?this.format="rgb":/^hsla?\(/i.test(e)&&this.allowedFormats.includes("hsl")&&(this.format="hsl"),this._drafts={}},Ji=function(e){let t=Pp(e);(t.s===0||t.v===0)&&(t.h=this._hsva.h),t.v===0&&(t.s=this._hsva.s),this._hsva={...t,a:this.alpha?e.a:1}},es=function(){return Ip(this._hsva)},st=function(e=!1){let t;if(this._grad){let s=this._grad.stops.map((l,d)=>d===this._stop?{...l,color:r(this,_,es)}:l);this._grad={...this._grad,stops:s},t=Jr(this._grad,this.format)}else t=Qr(r(this,_,es),this.format);let i=t!==this.value;g(this,dc,t),this.value=t,i&&a(this,_,cg).call(this,"input"),e&&a(this,_,dg).call(this)},cg=function(e){this.dispatchEvent(new Event(e,{bubbles:!0,composed:!0}))},dg=function(){a(this,_,cg).call(this,"change");let e=this.value;if(!e||[...this.brand,...this.palette].some(l=>nc(l.value,e)))return;let t=this.recentColors??this._recent;if(t[0]&&nc(t[0],e))return;let i=qp(t,e,Math.max(this.maxRecent||16,16));this._recent=i,this.dispatchEvent(new CustomEvent("cm-recent-change",{detail:{colors:i},bubbles:!0,composed:!0})),a(this,_,og).call(this)?.addRecentColor?.(e)?.then(l=>{Array.isArray(l)&&(this._recent=l)}).catch(()=>{})},hg=function(e){let t=e.currentTarget.getBoundingClientRect(),i=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width)),s=Math.min(1,Math.max(0,(e.clientY-t.top)/t.height)),l=getComputedStyle(this).direction==="rtl";this._hsva={...this._hsva,s:(l?1-i:i)*100,v:(1-s)*100},a(this,_,st).call(this)},Tv=function(e){if(e.button!==0)return;let t=e.currentTarget;try{t.setPointerCapture(e.pointerId)}catch{}t.focus(),g(this,bi,"area"),a(this,_,hg).call(this,e)},Cv=function(e){r(this,bi)==="area"&&a(this,_,hg).call(this,e)},oc=function(){r(this,bi)!==null&&(g(this,bi,null),a(this,_,dg).call(this))},zv=function(e){let t=e.shiftKey?10:1,i=getComputedStyle(this).direction==="rtl",{s,v:l}=this._hsva;if(e.key==="ArrowRight")s+=i?-t:t;else if(e.key==="ArrowLeft")s+=i?t:-t;else if(e.key==="ArrowUp")l+=t;else if(e.key==="ArrowDown")l-=t;else if(e.key==="Home")s=0;else if(e.key==="End")s=100;else if(e.key==="PageUp")l=100;else if(e.key==="PageDown")l=0;else return;e.preventDefault(),this._hsva={...this._hsva,s:Math.min(100,Math.max(0,s)),v:Math.min(100,Math.max(0,l))},a(this,_,st).call(this,!0)},pg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,h:Number(e.target.value)},a(this,_,st).call(this,t)},mg=function(e,t){e.stopPropagation(),this._hsva={...this._hsva,a:Number(e.target.value)/100},a(this,_,st).call(this,t)},Sv=function(e){e.stopPropagation(),this.format=e.target.value,this._drafts={},this.value&&a(this,_,st).call(this,!0)},Op=function(e,t,i){e.stopPropagation();let s=e.target.value,l=a(this,_,ug).call(this,t,s);if(!l){this._drafts={...this._drafts,[t]:s};return}this._drafts=i?{}:{...this._drafts,[t]:s},a(this,_,Ji).call(this,l),a(this,_,st).call(this,i)},ug=function(e,t){let i=r(this,_,es);if(e==="hex"){let d=t.trim();if(!/^#?([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(d))return null;let p=De(d);return p&&(this.alpha&&/^#?[0-9a-f]{8}$/i.test(d)?p:{...p,a:this._hsva.a})}let s=Number(t);if(t.trim()===""||!Number.isFinite(s))return null;if(e==="a")return s>=0&&s<=100?{...i,a:s/100}:null;if(e==="r"||e==="g"||e==="b")return s>=0&&s<=255?{...i,[e]:Math.round(s)}:null;let l=sc(i);return e==="h"?s>=0&&s<=360?ac({...l,h:s%360,a:i.a}):null:(e==="s"||e==="l")&&s>=0&&s<=100?ac({...l,[e]:s,a:i.a}):null},Lv=async function(){let e=window.EyeDropper;if(e)try{let{sRGBHex:t}=await new e().open(),i=De(t);if(!i)return;a(this,_,Ji).call(this,{...i,a:this._hsva.a}),a(this,_,st).call(this,!0)}catch{}},lc=function(e){if(e!==!!this._grad){if(e){let t=r(this,_,es),i=Ip({...this._hsva,h:(this._hsva.h+60)%360,s:Math.max(this._hsva.s,40),v:Math.max(this._hsva.v,60)});this._grad={type:"linear",angle:90,stops:[{color:t,position:0},{color:i,position:100}]},this._stop=0}else this._grad=null;a(this,_,st).call(this,!0)}},Bp=function(e,t=!0){this._grad&&(this._grad={...this._grad,...e},a(this,_,st).call(this,t))},cc=function(e){this._grad&&(this._stop=e,a(this,_,Ji).call(this,this._grad.stops[e].color),this._drafts={})},gg=function(e,t){let i=t.getBoundingClientRect(),s=Math.min(1,Math.max(0,(e.clientX-i.left)/i.width));return Math.round((getComputedStyle(this).direction==="rtl"?1-s:s)*100)},Av=function(e){if(!this._grad||e.button!==0||e.target.closest(".handle"))return;let t=a(this,_,gg).call(this,e,e.currentTarget),i=Ev(this._grad,t),s=[...this._grad.stops,{color:i,position:t}];this._grad={...this._grad,stops:s},a(this,_,cc).call(this,s.length-1),a(this,_,st).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[s.length-1]?.focus())},Dv=function(e,t){if(e.button===0){e.stopPropagation();try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}a(this,_,cc).call(this,t),g(this,bi,t)}},Rv=function(e,t){if(r(this,bi)!==t||!this._grad)return;let i=this.renderRoot.querySelector(".bar");a(this,_,Qa).call(this,t,a(this,_,gg).call(this,e,i),!1)},Qa=function(e,t,i){if(!this._grad)return;let s=this._grad.stops.map((l,d)=>d===e?{...l,position:Math.min(100,Math.max(0,t))}:l);a(this,_,Bp).call(this,{stops:s},i)},fg=function(e){if(!this._grad||this._grad.stops.length<=2)return;let t=this._grad.stops.filter((i,s)=>s!==e);this._grad={...this._grad,stops:t},a(this,_,cc).call(this,Math.min(e,t.length-1)),a(this,_,st).call(this,!0),this.updateComplete.then(()=>this.renderRoot.querySelectorAll(".handle")[this._stop]?.focus())},Hv=function(e,t){if(!this._grad)return;let i=e.shiftKey?10:1,s=getComputedStyle(this).direction==="rtl",l=this._grad.stops[t].position;if(e.key==="ArrowRight"||e.key==="ArrowUp")a(this,_,Qa).call(this,t,l+(s&&e.key==="ArrowRight"?-i:i),!0);else if(e.key==="ArrowLeft"||e.key==="ArrowDown")a(this,_,Qa).call(this,t,l-(s&&e.key==="ArrowLeft"?-i:i),!0);else if(e.key==="Home")a(this,_,Qa).call(this,t,0,!0);else if(e.key==="End")a(this,_,Qa).call(this,t,100,!0);else if(e.key==="Delete"||e.key==="Backspace")a(this,_,fg).call(this,t);else return;e.preventDefault()},Nv=function(e){let t=Ct(e);if(t&&this.gradient)this._grad=t,this._stop=0,a(this,_,Ji).call(this,t.stops[0].color);else{let i=De(e);if(!i)return;this._grad=null,a(this,_,Ji).call(this,i)}this._drafts={},a(this,_,st).call(this,!0)},Fp=function(e,t){if(!t.length)return h;let i=`${r(this,Vp)}-${e}`;return c`<div class="group" role="group" aria-labelledby=${i}>
1239
1239
  <h3 id=${i}>${this.t(e)}</h3>
1240
1240
  <div class="sws">${t.map(s=>{let l=s.name?this.t("swatch",{name:s.name,value:s.value}):s.value,d=!!this.value&&nc(s.value,this.value);return c`<button type="button" class="sw checker" part="swatch" aria-pressed=${d?"true":"false"} aria-label=${l} title=${s.name||s.value}
1241
- @click=${()=>a(this,T,Nv).call(this,s.value)}><span style="background:${s.value}"></span></button>`})}</div>
1242
- </div>`},Pv=function(){let e=r(this,T,es),t=this._drafts,i=this.format,s=(d,p,u,b=!0)=>c`<input class="box ${b?"num":""}"
1241
+ @click=${()=>a(this,_,Nv).call(this,s.value)}><span style="background:${s.value}"></span></button>`})}</div>
1242
+ </div>`},Pv=function(){let e=r(this,_,es),t=this._drafts,i=this.format,s=(d,p,u,b=!0)=>c`<input class="box ${b?"num":""}"
1243
1243
  type="text" inputmode=${b?"numeric":"text"} autocomplete="off" spellcheck="false" aria-label=${p}
1244
- .value=${Q(t[d]??String(u))} aria-invalid=${t[d]!==void 0&&!a(this,T,ug).call(this,d,t[d])?"true":h}
1245
- @input=${f=>a(this,T,Op).call(this,f,d,!1)} @change=${f=>a(this,T,Op).call(this,f,d,!0)}
1246
- @keydown=${f=>{f.key==="Enter"&&a(this,T,Op).call(this,f,d,!0)}} />`,l=sc(e);return c`<div class="boxes">
1244
+ .value=${Q(t[d]??String(u))} aria-invalid=${t[d]!==void 0&&!a(this,_,ug).call(this,d,t[d])?"true":h}
1245
+ @input=${f=>a(this,_,Op).call(this,f,d,!1)} @change=${f=>a(this,_,Op).call(this,f,d,!0)}
1246
+ @keydown=${f=>{f.key==="Enter"&&a(this,_,Op).call(this,f,d,!0)}} />`,l=sc(e);return c`<div class="boxes">
1247
1247
  ${i==="hex"?s("hex",this.t("hex"),rc(e),!1):h}
1248
1248
  ${i==="rgb"?[s("r",this.t("red"),e.r),s("g",this.t("green"),e.g),s("b",this.t("blue"),e.b)]:h}
1249
1249
  ${i==="hsl"?[s("h",this.t("hue"),Math.round(l.h)),s("s",this.t("saturation"),Math.round(l.s)),s("l",this.t("lightness"),Math.round(l.l))]:h}
@@ -1328,7 +1328,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1328
1328
  .sw[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--cm-bg-surface), 0 0 0 4px var(--cm-border-strong); }
1329
1329
  .sw:focus-visible { outline-offset: 4px; }
1330
1330
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1331
- `];$("cm-color-picker",en);var jE=C("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.",invalidAny:"Enter a colour such as #2e6faf or rgb(46, 111, 175).",value:"Colour value",valueNamed:"{label}, colour value",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"}),n0=[{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"}],o0={fromAttribute:o=>o===null?!1:o==="native"?"native":!0,toAttribute:o=>o==="native"?"native":o?"":null},l0=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&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 c0(o){let n=l0(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var Ye,is,rs,vt,pc,ss,F,rn,ts,mc,vi,bg,Iv,qv,vg,Ov,Bv,Fv,Vv,jv,Uv,Kv,Gv,Zi=class extends _{constructor(){super(...arguments);m(this,F);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.alpha=!1;this.gradient=!1;this.formats="hex";this.recentKey="";this._open=!1;this.required=!1;this.disabled=!1;this._invalid=!1;m(this,Ye,this.attachInternals());m(this,is,new fe);m(this,rs,new ie(this,r(this,Ye)));m(this,vt,N("cm-cf"));m(this,pc,"");m(this,ss);m(this,mc,e=>{this._open&&!e.composedPath().includes(this)&&(this._open=!1)})}connectedCallback(){super.connectedCallback(),g(this,pc,a(this,F,ts).call(this,this.value)??this.value),document.addEventListener("pointerdown",r(this,mc),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,mc),!0),r(this,is).close()}show(){!this.disabled&&this.picker&&this.picker!=="native"&&(this._open=!0)}close(){this._open=!1}get form(){return r(this,Ye).form}get validity(){return r(this,Ye).validity}get validationMessage(){return r(this,Ye).validationMessage}checkValidity(){return r(this,Ye).checkValidity()}reportValidity(){return r(this,rs).report(()=>r(this,Ye).reportValidity())}formResetCallback(){r(this,rs).reset(),this.value=r(this,pc),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=Zr(t?.value??"")??(r(this,F,rn)&&t?.value&&sg(t.value)?t.value.trim():null);return i?[{value:i,name:t.name}]:[]}):n0.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=a(this,F,ts).call(this,this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==r(this,ss)&&(this._draft=void 0,this._invalid=!1),g(this,ss,void 0)}}updated(e){if(e.has("_open")){let s=this.renderRoot.querySelector(".pop");this._open?(r(this,is).open(s,this.renderRoot.querySelector(".anchor"),{align:"start",gap:8})||s?.setAttribute("data-open",""),this.renderRoot.querySelector("cm-color-picker")?.updateComplete.then(()=>{this.renderRoot.querySelector("cm-color-picker")?.shadowRoot?.querySelector(".area")?.focus()})):e.get("_open")&&(r(this,is).close(),s?.removeAttribute("data-open"))}else this._open&&r(this,is).place();let t=!this.value||a(this,F,ts).call(this,this.value)!==null;r(this,Ye).setFormValue(this.value&&t?this.value:null,this.value);let i=this.renderRoot.querySelector(".input")??void 0;this.error?r(this,Ye).setValidity({customError:!0},this.error,i):this._invalid||!t?r(this,Ye).setValidity({patternMismatch:!0},this.t(r(this,F,rn)?"invalidAny":"invalid"),i):this.required&&!this.value?r(this,Ye).setValidity({valueMissing:!0},this.t("required"),i):r(this,Ye).setValidity({}),r(this,rs).sync()}render(){let e=this.items,t=a(this,F,ts).call(this,this.value??""),i=e.findIndex(x=>x.value===t),s=r(this,F,rn),l=this.error||(this._invalid||this.value&&!t?this.t(s?"invalidAny":"invalid"):"")||r(this,rs).message,d=t?Zr(t):null,p=t?`background:${t}`:h,u=[l&&`${r(this,vt)}-err`,this.helpText&&`${r(this,vt)}-help`].filter(Boolean).join(" ")||h,b=this.getAttribute("aria-label"),f=this.label||b||"";return c`<div class="field">
1331
+ `];$("cm-color-picker",en);var jE=C("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.",invalidAny:"Enter a colour such as #2e6faf or rgb(46, 111, 175).",value:"Colour value",valueNamed:"{label}, colour value",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"}),n0=[{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"}],o0={fromAttribute:o=>o===null?!1:o==="native"?"native":!0,toAttribute:o=>o==="native"?"native":o?"":null},l0=o=>{let n=parseInt(o.slice(1),16);return[n>>16&255,n>>8&255,n&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 c0(o){let n=l0(o);return(n+.05)/.05>=1.05/(n+.05)?"#000000":"#ffffff"}var Ye,is,rs,vt,pc,ss,F,rn,ts,mc,vi,bg,Iv,qv,vg,Ov,Bv,Fv,Vv,jv,Uv,Kv,Gv,Zi=class extends T{constructor(){super(...arguments);m(this,F);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.picker=!1;this.alpha=!1;this.gradient=!1;this.formats="hex";this.recentKey="";this._open=!1;this.required=!1;this.disabled=!1;this._invalid=!1;m(this,Ye,this.attachInternals());m(this,is,new fe);m(this,rs,new ie(this,r(this,Ye)));m(this,vt,N("cm-cf"));m(this,pc,"");m(this,ss);m(this,mc,e=>{this._open&&!e.composedPath().includes(this)&&(this._open=!1)})}connectedCallback(){super.connectedCallback(),g(this,pc,a(this,F,ts).call(this,this.value)??this.value),document.addEventListener("pointerdown",r(this,mc),!0)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("pointerdown",r(this,mc),!0),r(this,is).close()}show(){!this.disabled&&this.picker&&this.picker!=="native"&&(this._open=!0)}close(){this._open=!1}get form(){return r(this,Ye).form}get validity(){return r(this,Ye).validity}get validationMessage(){return r(this,Ye).validationMessage}checkValidity(){return r(this,Ye).checkValidity()}reportValidity(){return r(this,rs).report(()=>r(this,Ye).reportValidity())}formResetCallback(){r(this,rs).reset(),this.value=r(this,pc),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=Zr(t?.value??"")??(r(this,F,rn)&&t?.value&&sg(t.value)?t.value.trim():null);return i?[{value:i,name:t.name}]:[]}):n0.map(e=>({value:e.value,name:this.t(e.key)}))}willUpdate(e){if(e.has("value")){let t=a(this,F,ts).call(this,this.value??"");t&&t!==this.value&&(this.value=t),this.hasUpdated&&this.value!==r(this,ss)&&(this._draft=void 0,this._invalid=!1),g(this,ss,void 0)}}updated(e){if(e.has("_open")){let s=this.renderRoot.querySelector(".pop");this._open?(r(this,is).open(s,this.renderRoot.querySelector(".anchor"),{align:"start",gap:8})||s?.setAttribute("data-open",""),this.renderRoot.querySelector("cm-color-picker")?.updateComplete.then(()=>{this.renderRoot.querySelector("cm-color-picker")?.shadowRoot?.querySelector(".area")?.focus()})):e.get("_open")&&(r(this,is).close(),s?.removeAttribute("data-open"))}else this._open&&r(this,is).place();let t=!this.value||a(this,F,ts).call(this,this.value)!==null;r(this,Ye).setFormValue(this.value&&t?this.value:null,this.value);let i=this.renderRoot.querySelector(".input")??void 0;this.error?r(this,Ye).setValidity({customError:!0},this.error,i):this._invalid||!t?r(this,Ye).setValidity({patternMismatch:!0},this.t(r(this,F,rn)?"invalidAny":"invalid"),i):this.required&&!this.value?r(this,Ye).setValidity({valueMissing:!0},this.t("required"),i):r(this,Ye).setValidity({}),r(this,rs).sync()}render(){let e=this.items,t=a(this,F,ts).call(this,this.value??""),i=e.findIndex(x=>x.value===t),s=r(this,F,rn),l=this.error||(this._invalid||this.value&&!t?this.t(s?"invalidAny":"invalid"):"")||r(this,rs).message,d=t?Zr(t):null,p=t?`background:${t}`:h,u=[l&&`${r(this,vt)}-err`,this.helpText&&`${r(this,vt)}-help`].filter(Boolean).join(" ")||h,b=this.getAttribute("aria-label"),f=this.label||b||"";return c`<div class="field">
1332
1332
  ${this.label?c`<span class="label" id="${r(this,vt)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}${this.hint?c`<span class="hint">[${this.hint}]</span>`:h}</span>`:h}
1333
1333
  ${e.length?c`<div class="swatches" part="swatches" role="radiogroup"
1334
1334
  aria-labelledby=${this.label?`${r(this,vt)}-l`:h} aria-label=${!this.label&&b?b:h}
@@ -1420,7 +1420,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1420
1420
  .pop:not(:popover-open):not([data-open]) { display: none; }
1421
1421
  .anchor { position: relative; }
1422
1422
  :host([disabled]) .preview { opacity: 0.4; }
1423
- `];$("cm-color-field",Zi);var ZE=C("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),yg=3,jp=.7,d0=.0055,Up="#000000",Wv=8,uc=2,h0=400,p0=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),at,ns,gc,sn,fc,yt,xt,wt,er,tr,qe,bc,ir,an,A,xg,Kp,wg,yi,Gp,$g,kg,Yv,Eg,Wp,Mg,Yp,Xv,Tg,Jv,as,Xp,_g,Cg,Zv,zg,Qv,Sg,ey,ty,Qi=class extends _{constructor(){super(...arguments);m(this,A);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";m(this,at,this.attachInternals());m(this,ns,new ie(this,r(this,at)));m(this,gc,N("cm-sig"));m(this,sn,"");m(this,fc,"");m(this,yt,[]);m(this,xt);m(this,wt);m(this,er,"");m(this,tr,0);m(this,qe);m(this,bc,"");m(this,ir);m(this,an,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,A,xg).call(this):(g(this,sn,this.value),g(this,fc,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),r(this,ir)?.disconnect(),g(this,ir,void 0),cancelAnimationFrame(r(this,tr)),g(this,tr,0),r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0))}get form(){return r(this,at).form}get validity(){return r(this,at).validity}get validationMessage(){return r(this,at).validationMessage}checkValidity(){return r(this,at).checkValidity()}reportValidity(){return r(this,ns).report(()=>r(this,at).reportValidity())}formResetCallback(){r(this,ns).reset(),g(this,yt,[]),g(this,xt,void 0),g(this,wt,void 0),r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0)),this.typedName=r(this,fc),r(this,sn)?(g(this,er,""),this.value=r(this,sn)):this.updateComplete.then(()=>a(this,A,as).call(this,!1)),a(this,A,yi).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!r(this,yt).length&&!r(this,wt)}toDataURL(){return a(this,A,_g).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,A,_g).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,yt,[]),g(this,xt,void 0),g(this,wt,void 0),a(this,A,yi).call(this)),a(this,A,as).call(this,!0)}undo(){this.mode==="draw"&&(r(this,yt).length?r(this,yt).pop():g(this,wt,void 0),g(this,xt,void 0),a(this,A,yi).call(this),a(this,A,as).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==r(this,er)){let t=this.value??"";if(g(this,er,t),g(this,yt,[]),g(this,xt,void 0),!t)g(this,wt,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.addEventListener("load",()=>{r(this,wt)===i&&a(this,A,yi).call(this)}),i.src=t,g(this,wt,i),this.mode="draw"}a(this,A,yi).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,er,t),this.value=t}}firstUpdated(){a(this,A,xg).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,A,as).call(this,!1)),a(this,A,Yp).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,A,Yp).call(this),r(this,at).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?r(this,at).setValidity({customError:!0},this.error,t):this.required&&this.empty?r(this,at).setValidity({valueMissing:!0},this.t("required"),t):r(this,at).setValidity({}),r(this,ns).sync()}render(){let e=r(this,gc),t=this.getAttribute("aria-label"),i=r(this,ns).message,s=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!r(this,yt).length&&!r(this,wt),p=u=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${u}"
1423
+ `];$("cm-color-field",Zi);var ZE=C("signatureField",{modes:"How to sign",draw:"Draw",type:"Type",pad:"Signature drawing area",padSigned:"Signature drawing area, signed",instructions:"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.",signHere:"Sign here",typeLabel:"Type your full name",typePlaceholder:"Type your full name",undo:"Undo",undoLabel:"Undo last stroke",clear:"Clear",clearLabel:"Clear signature",cleared:"Signature cleared",undone:"Last stroke removed",required:"Please sign here."}),yg=3,jp=.7,d0=.0055,Up="#000000",Wv=8,uc=2,h0=400,p0=(o,n)=>({x:(o.x+n.x)/2,y:(o.y+n.y)/2,p:(o.p+n.p)/2}),at,ns,gc,sn,fc,yt,xt,wt,er,tr,qe,bc,ir,an,A,xg,Kp,wg,yi,Gp,$g,kg,Yv,Eg,Wp,Mg,Yp,Xv,_g,Jv,as,Xp,Tg,Cg,Zv,zg,Qv,Sg,ey,ty,Qi=class extends T{constructor(){super(...arguments);m(this,A);this.label="";this.hint="";this.helpText="";this.error="";this.name="";this.value="";this.mode="draw";this.typedName="";this.required=!1;this.disabled=!1;this._announce="";m(this,at,this.attachInternals());m(this,ns,new ie(this,r(this,at)));m(this,gc,N("cm-sig"));m(this,sn,"");m(this,fc,"");m(this,yt,[]);m(this,xt);m(this,wt);m(this,er,"");m(this,tr,0);m(this,qe);m(this,bc,"");m(this,ir);m(this,an,0)}connectedCallback(){super.connectedCallback(),this.hasUpdated?a(this,A,xg).call(this):(g(this,sn,this.value),g(this,fc,this.typedName))}disconnectedCallback(){super.disconnectedCallback(),r(this,ir)?.disconnect(),g(this,ir,void 0),cancelAnimationFrame(r(this,tr)),g(this,tr,0),r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0))}get form(){return r(this,at).form}get validity(){return r(this,at).validity}get validationMessage(){return r(this,at).validationMessage}checkValidity(){return r(this,at).checkValidity()}reportValidity(){return r(this,ns).report(()=>r(this,at).reportValidity())}formResetCallback(){r(this,ns).reset(),g(this,yt,[]),g(this,xt,void 0),g(this,wt,void 0),r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0)),this.typedName=r(this,fc),r(this,sn)?(g(this,er,""),this.value=r(this,sn)):this.updateComplete.then(()=>a(this,A,as).call(this,!1)),a(this,A,yi).call(this)}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}get empty(){return this.mode==="type"?!this.typedName.trim():!r(this,yt).length&&!r(this,wt)}toDataURL(){return a(this,A,Tg).call(this)?.toDataURL("image/png")??""}toBlob(){let e=a(this,A,Tg).call(this);return e?new Promise(t=>e.toBlob(t,"image/png")):Promise.resolve(null)}clear(){this.mode==="type"?this.typedName="":(g(this,yt,[]),g(this,xt,void 0),g(this,wt,void 0),a(this,A,yi).call(this)),a(this,A,as).call(this,!0)}undo(){this.mode==="draw"&&(r(this,yt).length?r(this,yt).pop():g(this,wt,void 0),g(this,xt,void 0),a(this,A,yi).call(this),a(this,A,as).call(this,!0))}willUpdate(e){if(e.has("value")&&(this.value??"")!==r(this,er)){let t=this.value??"";if(g(this,er,t),g(this,yt,[]),g(this,xt,void 0),!t)g(this,wt,void 0),this.hasUpdated&&(this.typedName="");else{let i=new Image;i.addEventListener("load",()=>{r(this,wt)===i&&a(this,A,yi).call(this)}),i.src=t,g(this,wt,i),this.mode="draw"}a(this,A,yi).call(this)}else if(this.hasUpdated&&(e.has("mode")||e.has("typedName")&&this.mode==="type")){let t=this.empty?"":this.toDataURL();g(this,er,t),this.value=t}}firstUpdated(){a(this,A,xg).call(this),this.typedName&&!this.value&&this.updateComplete.then(()=>a(this,A,as).call(this,!1)),a(this,A,Yp).call(this)}updated(e){e.has("mode")&&this.mode==="type"&&a(this,A,Yp).call(this),r(this,at).setFormValue(this.value||null,this.value);let t=(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))??void 0;this.error?r(this,at).setValidity({customError:!0},this.error,t):this.required&&this.empty?r(this,at).setValidity({valueMissing:!0},this.t("required"),t):r(this,at).setValidity({}),r(this,ns).sync()}render(){let e=r(this,gc),t=this.getAttribute("aria-label"),i=r(this,ns).message,s=[i&&`${e}-err`,this.helpText&&`${e}-help`].filter(Boolean).join(" "),l=this.empty,d=!r(this,yt).length&&!r(this,wt),p=u=>c`<button type="button" role="tab" class="tab" id="${e}-tab-${u}"
1424
1424
  aria-selected=${this.mode===u?"true":"false"} aria-controls="${e}-panel-${u}"
1425
1425
  tabindex=${this.mode===u?"0":"-1"} ?disabled=${this.disabled}
1426
1426
  @click=${()=>a(this,A,Cg).call(this,u,!0)} @keydown=${a(this,A,Zv)}>${this.t(u)}</button>`;return c`<div class="field">
@@ -1460,7 +1460,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1460
1460
  ${i?c`<p class="error" id="${e}-err" role="alert">${i}</p>`:h}
1461
1461
  ${this.helpText?c`<p class="help" id="${e}-help">${this.helpText}</p>`:h}
1462
1462
  <div class="vh" role="status" aria-live="polite">${this._announce}</div>
1463
- </div>`}};at=new WeakMap,ns=new WeakMap,gc=new WeakMap,sn=new WeakMap,fc=new WeakMap,yt=new WeakMap,xt=new WeakMap,wt=new WeakMap,er=new WeakMap,tr=new WeakMap,qe=new WeakMap,bc=new WeakMap,ir=new WeakMap,an=new WeakMap,A=new WeakSet,xg=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||r(this,ir)||(g(this,ir,new ResizeObserver(()=>a(this,A,wg).call(this))),r(this,ir).observe(e))},Kp=function(){return this.renderRoot.querySelector("canvas")},wg=function(){let e=r(this,A,Kp);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,an,t);let s=window.devicePixelRatio||1,l=Math.round(t*s),d=Math.round(i*s);(e.width!==l||e.height!==d)&&(e.width=l,e.height=d),a(this,A,Gp).call(this)},yi=function(){r(this,tr)||g(this,tr,requestAnimationFrame(()=>{g(this,tr,0),a(this,A,Gp).call(this)}))},Gp=function(){let e=r(this,A,Kp);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||r(this,an);if(!i)return;let s=e.width/i;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),t.setTransform(s,0,0,s,0,0);let l=getComputedStyle(e).color||Up;a(this,A,$g).call(this,t,i,l,!0)},$g=function(e,t,i,s){let l=t/yg,d=r(this,wt);if(d?.complete&&d.naturalWidth){let p=Math.min(t*.9/d.naturalWidth,l*.9/d.naturalHeight),u=d.naturalWidth*p,b=d.naturalHeight*p,f=(t-u)/2,x=(l-b)/2;if(s&&!g0(i,Up)){let y=document.createElement("canvas");y.width=Math.max(1,Math.round(u*2)),y.height=Math.max(1,Math.round(b*2));let k=y.getContext("2d");k.drawImage(d,0,0,y.width,y.height),k.globalCompositeOperation="source-in",k.fillStyle=i,k.fillRect(0,0,y.width,y.height),e.drawImage(y,f,x,u,b)}else e.drawImage(d,f,x,u,b)}e.strokeStyle=i,e.fillStyle=i,e.lineCap="round",e.lineJoin="round";for(let p of r(this,yt))m0(e,p,t)},kg=function(e,t){let i=e.pointerType==="pen"&&e.pressure>0?e.pressure:.5;return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.width,p:i}},Yv=function(e){if(this.disabled||r(this,xt)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.currentTarget;e.preventDefault();try{t.setPointerCapture(e.pointerId)}catch{}let i=[a(this,A,kg).call(this,e,t.getBoundingClientRect())];g(this,xt,{id:e.pointerId,stroke:i}),r(this,yt).push(i),a(this,A,yi).call(this)},Eg=function(e){let t=r(this,xt);if(!t||e.pointerId!==t.id)return;e.preventDefault();let i=e.currentTarget.getBoundingClientRect(),s=typeof e.getCoalescedEvents=="function"?e.getCoalescedEvents():[];for(let l of s.length?s:[e]){let d=a(this,A,kg).call(this,l,i),p=t.stroke[t.stroke.length-1];Math.hypot(d.x-p.x,d.y-p.y)*i.width<1.5||t.stroke.push(d)}a(this,A,yi).call(this)},Wp=function(e){let t=r(this,xt);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,A,Eg).call(this,e),g(this,xt,void 0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}a(this,A,yi).call(this),a(this,A,as).call(this,!0)}},Mg=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},Yp=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${r(this,A,Mg)}`,i=!0;try{i=e.check(t,this.typedName||"Signature")}catch{}i||e.load(t,this.typedName||"Signature").then(()=>{this.mode==="type"&&this.typedName.trim()&&a(this,A,as).call(this,!1)},()=>{})},Xv=function(e){e.stopPropagation(),r(this,qe)?clearTimeout(r(this,qe)):g(this,bc,this.value),this.typedName=e.target.value,g(this,qe,setTimeout(()=>a(this,A,Tg).call(this),h0)),a(this,A,Yp).call(this)},Tg=function(){r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0),this.value!==r(this,bc)&&a(this,A,Xp).call(this))},Jv=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,A,Tg).call(this))},as=function(e){let t=this.empty?"":this.toDataURL(),i=t!==this.value;i&&(g(this,er,t),this.value=t),this.requestUpdate(),e&&i&&a(this,A,Xp).call(this)},Xp=function(){let e={value:this.value,empty:this.empty,mode:this.mode};this.dispatchEvent(new CustomEvent("cm-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},_g=function(){if(this.empty)return;let e=Math.max(r(this,A,Kp)?.clientWidth||r(this,an)||600,300),t=e/yg,i=document.createElement("canvas");i.width=Math.round(e*uc),i.height=Math.round(t*uc);let s=i.getContext("2d",{willReadFrequently:!0});if(s.scale(uc,uc),this.mode==="type"){let l=Math.min(t*.45,64),d=r(this,A,Mg);s.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),u=e-2*Wv,b=s.measureText(p).width;b>u&&(l*=u/b,s.font=`400 ${l}px ${d}`),s.direction=getComputedStyle(this).direction==="rtl"?"rtl":"ltr",s.textAlign="center",s.textBaseline="alphabetic",s.fillStyle=Up,s.fillText(p,e/2,t*jp)}else a(this,A,$g).call(this,s,e,Up,!1);return u0(i,Wv*uc)},Cg=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${r(this,gc)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,A,wg).call(this),this.value!==i&&a(this,A,Xp).call(this)})},Zv=function(e){let t=re(e,this),i;if(t==="ArrowRight"||t==="ArrowLeft")i=this.mode==="draw"?"type":"draw";else if(e.key==="Home")i="draw";else if(e.key==="End")i="type";else return;e.preventDefault(),a(this,A,Cg).call(this,i,!0)},zg=function(e){a(this,A,Qv).call(this,this.t(e))},Qv=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Sg=function(e){this.updateComplete.then(()=>{let t=this.shadowRoot?.activeElement;if(!e||t&&!t.disabled)return;(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))?.focus()})},ey=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,A,zg).call(this,"undone"),a(this,A,Sg).call(this,e)},ty=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,A,zg).call(this,"cleared"),a(this,A,Sg).call(this,e)},Qi.formAssociated=!0,Qi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Qi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},mode:{reflect:!0},typedName:{attribute:"typed-name"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_announce:{state:!0}},Qi.styles=[E,w`
1463
+ </div>`}};at=new WeakMap,ns=new WeakMap,gc=new WeakMap,sn=new WeakMap,fc=new WeakMap,yt=new WeakMap,xt=new WeakMap,wt=new WeakMap,er=new WeakMap,tr=new WeakMap,qe=new WeakMap,bc=new WeakMap,ir=new WeakMap,an=new WeakMap,A=new WeakSet,xg=function(){let e=this.renderRoot.querySelector(".panel-draw .pad");!e||r(this,ir)||(g(this,ir,new ResizeObserver(()=>a(this,A,wg).call(this))),r(this,ir).observe(e))},Kp=function(){return this.renderRoot.querySelector("canvas")},wg=function(){let e=r(this,A,Kp);if(!e)return;let t=e.clientWidth,i=e.clientHeight;if(!t||!i)return;g(this,an,t);let s=window.devicePixelRatio||1,l=Math.round(t*s),d=Math.round(i*s);(e.width!==l||e.height!==d)&&(e.width=l,e.height=d),a(this,A,Gp).call(this)},yi=function(){r(this,tr)||g(this,tr,requestAnimationFrame(()=>{g(this,tr,0),a(this,A,Gp).call(this)}))},Gp=function(){let e=r(this,A,Kp);if(!e||!e.width)return;let t=e.getContext("2d"),i=e.clientWidth||r(this,an);if(!i)return;let s=e.width/i;t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),t.setTransform(s,0,0,s,0,0);let l=getComputedStyle(e).color||Up;a(this,A,$g).call(this,t,i,l,!0)},$g=function(e,t,i,s){let l=t/yg,d=r(this,wt);if(d?.complete&&d.naturalWidth){let p=Math.min(t*.9/d.naturalWidth,l*.9/d.naturalHeight),u=d.naturalWidth*p,b=d.naturalHeight*p,f=(t-u)/2,x=(l-b)/2;if(s&&!g0(i,Up)){let y=document.createElement("canvas");y.width=Math.max(1,Math.round(u*2)),y.height=Math.max(1,Math.round(b*2));let k=y.getContext("2d");k.drawImage(d,0,0,y.width,y.height),k.globalCompositeOperation="source-in",k.fillStyle=i,k.fillRect(0,0,y.width,y.height),e.drawImage(y,f,x,u,b)}else e.drawImage(d,f,x,u,b)}e.strokeStyle=i,e.fillStyle=i,e.lineCap="round",e.lineJoin="round";for(let p of r(this,yt))m0(e,p,t)},kg=function(e,t){let i=e.pointerType==="pen"&&e.pressure>0?e.pressure:.5;return{x:(e.clientX-t.left)/t.width,y:(e.clientY-t.top)/t.width,p:i}},Yv=function(e){if(this.disabled||r(this,xt)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.currentTarget;e.preventDefault();try{t.setPointerCapture(e.pointerId)}catch{}let i=[a(this,A,kg).call(this,e,t.getBoundingClientRect())];g(this,xt,{id:e.pointerId,stroke:i}),r(this,yt).push(i),a(this,A,yi).call(this)},Eg=function(e){let t=r(this,xt);if(!t||e.pointerId!==t.id)return;e.preventDefault();let i=e.currentTarget.getBoundingClientRect(),s=typeof e.getCoalescedEvents=="function"?e.getCoalescedEvents():[];for(let l of s.length?s:[e]){let d=a(this,A,kg).call(this,l,i),p=t.stroke[t.stroke.length-1];Math.hypot(d.x-p.x,d.y-p.y)*i.width<1.5||t.stroke.push(d)}a(this,A,yi).call(this)},Wp=function(e){let t=r(this,xt);if(!(!t||e.pointerId!==t.id)){e.type==="pointerup"&&a(this,A,Eg).call(this,e),g(this,xt,void 0);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}a(this,A,yi).call(this),a(this,A,as).call(this,!0)}},Mg=function(){let e=this.renderRoot.querySelector(".typed");return e&&getComputedStyle(e).fontFamily||"cursive"},Yp=function(){let e=document.fonts;if(!e||!this.isConnected)return;let t=`400 40px ${r(this,A,Mg)}`,i=!0;try{i=e.check(t,this.typedName||"Signature")}catch{}i||e.load(t,this.typedName||"Signature").then(()=>{this.mode==="type"&&this.typedName.trim()&&a(this,A,as).call(this,!1)},()=>{})},Xv=function(e){e.stopPropagation(),r(this,qe)?clearTimeout(r(this,qe)):g(this,bc,this.value),this.typedName=e.target.value,g(this,qe,setTimeout(()=>a(this,A,_g).call(this),h0)),a(this,A,Yp).call(this)},_g=function(){r(this,qe)&&(clearTimeout(r(this,qe)),g(this,qe,void 0),this.value!==r(this,bc)&&a(this,A,Xp).call(this))},Jv=function(e){e.stopPropagation(),this.updateComplete.then(()=>a(this,A,_g).call(this))},as=function(e){let t=this.empty?"":this.toDataURL(),i=t!==this.value;i&&(g(this,er,t),this.value=t),this.requestUpdate(),e&&i&&a(this,A,Xp).call(this)},Xp=function(){let e={value:this.value,empty:this.empty,mode:this.mode};this.dispatchEvent(new CustomEvent("cm-change",{detail:e,bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))},Tg=function(){if(this.empty)return;let e=Math.max(r(this,A,Kp)?.clientWidth||r(this,an)||600,300),t=e/yg,i=document.createElement("canvas");i.width=Math.round(e*uc),i.height=Math.round(t*uc);let s=i.getContext("2d",{willReadFrequently:!0});if(s.scale(uc,uc),this.mode==="type"){let l=Math.min(t*.45,64),d=r(this,A,Mg);s.font=`400 ${l}px ${d}`;let p=this.typedName.trim(),u=e-2*Wv,b=s.measureText(p).width;b>u&&(l*=u/b,s.font=`400 ${l}px ${d}`),s.direction=getComputedStyle(this).direction==="rtl"?"rtl":"ltr",s.textAlign="center",s.textBaseline="alphabetic",s.fillStyle=Up,s.fillText(p,e/2,t*jp)}else a(this,A,$g).call(this,s,e,Up,!1);return u0(i,Wv*uc)},Cg=function(e,t){if(this.disabled||(t&&this.updateComplete.then(()=>this.renderRoot.querySelector(`#${r(this,gc)}-tab-${e}`)?.focus()),e===this.mode))return;let i=this.value;this.mode=e,this.updateComplete.then(()=>{e==="draw"&&a(this,A,wg).call(this),this.value!==i&&a(this,A,Xp).call(this)})},Zv=function(e){let t=re(e,this),i;if(t==="ArrowRight"||t==="ArrowLeft")i=this.mode==="draw"?"type":"draw";else if(e.key==="Home")i="draw";else if(e.key==="End")i="type";else return;e.preventDefault(),a(this,A,Cg).call(this,i,!0)},zg=function(e){a(this,A,Qv).call(this,this.t(e))},Qv=function(e){this._announce="",this.updateComplete.then(()=>{this._announce=e})},Sg=function(e){this.updateComplete.then(()=>{let t=this.shadowRoot?.activeElement;if(!e||t&&!t.disabled)return;(this.mode==="type"?this.renderRoot.querySelector(".typed"):this.renderRoot.querySelector('.tab[aria-selected="true"]'))?.focus()})},ey=function(){if(this.disabled||this.mode!=="draw"||this.empty)return;let e=this.matches(":focus-within");this.undo(),a(this,A,zg).call(this,"undone"),a(this,A,Sg).call(this,e)},ty=function(){if(this.disabled||this.empty)return;let e=this.matches(":focus-within");this.clear(),a(this,A,zg).call(this,"cleared"),a(this,A,Sg).call(this,e)},Qi.formAssociated=!0,Qi.shadowRootOptions={...L.shadowRootOptions,delegatesFocus:!0},Qi.properties={label:{},hint:{},helpText:{attribute:"help-text"},error:{reflect:!0},name:{reflect:!0},value:{},mode:{reflect:!0},typedName:{attribute:"typed-name"},required:{type:Boolean,reflect:!0},disabled:{type:Boolean,reflect:!0},_announce:{state:!0}},Qi.styles=[E,w`
1464
1464
  :host { display: block; }
1465
1465
  .field { display: flex; flex-direction: column; gap: var(--cm-space-8); }
1466
1466
  .label { font-size: var(--cm-type-label-size); color: var(--cm-text-default); }
@@ -1526,7 +1526,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1526
1526
  @media (pointer: coarse) { .act, .tab { min-height: var(--cm-control-height-touch); } }
1527
1527
 
1528
1528
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
1529
- `];function m0(o,n,e){let t=d=>e*d0*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],s=n[0];for(let d=1;d<n.length-1;d++){let p=p0(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(s)),o.quadraticCurveTo(...i(n[d]),...i(p)),o.lineWidth=t(n[d].p),o.stroke(),s=p}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(s)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function u0(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,s=t,l=e,d=-1,p=-1;for(let b=0;b<t;b++){let f=b*e*4;for(let x=0;x<e;x++)i[f+x*4+3]>8&&(x<l&&(l=x),x>d&&(d=x),b<s&&(s=b),p=b)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=p-s+1+2*n,u.getContext("2d").drawImage(o,l,s,d-l+1,p-s+1,n,n,d-l+1,p-s+1),u}function g0(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let s=parseInt(i[1],16);return`${s>>16&255},${s>>8&255},${s&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",Qi);var aM=C("optionGroup",{required:"Please select one of these options."}),$t,os,ls,nn,vc,Ft,Lg,Ag,iy,Bt=class extends _{constructor(){super(...arguments);m(this,Ft);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];m(this,$t,this.attachInternals());m(this,os,new ie(this,r(this,$t),()=>this.renderRoot.querySelector('button[tabindex="0"]')?.focus()));m(this,ls,N("cm-og"));m(this,nn,"");m(this,vc,new MutationObserver(()=>a(this,Ft,Lg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,Ft,Lg).call(this),r(this,vc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,vc).disconnect()}get form(){return r(this,$t).form}get validity(){return r(this,$t).validity}get validationMessage(){return r(this,$t).validationMessage}checkValidity(){return r(this,$t).checkValidity()}reportValidity(){return r(this,os).report(()=>r(this,$t).reportValidity())}formResetCallback(){this.value=r(this,nn),r(this,os).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,nn)||g(this,nn,this.value)}updated(){r(this,$t).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,$t).setValidity({valueMissing:!0},this.t("required"),e):r(this,$t).setValidity({}),r(this,os).sync()}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),s=this.getAttribute("aria-label"),l=r(this,os).message;return c`
1529
+ `];function m0(o,n,e){let t=d=>e*d0*(.35+d*1.3);if(n.length===1){o.beginPath(),o.arc(n[0].x*e,n[0].y*e,t(n[0].p)/2,0,Math.PI*2),o.fill();return}let i=d=>[d.x*e,d.y*e],s=n[0];for(let d=1;d<n.length-1;d++){let p=p0(n[d],n[d+1]);o.beginPath(),o.moveTo(...i(s)),o.quadraticCurveTo(...i(n[d]),...i(p)),o.lineWidth=t(n[d].p),o.stroke(),s=p}let l=n[n.length-1];o.beginPath(),o.moveTo(...i(s)),o.lineTo(...i(l)),o.lineWidth=t(l.p),o.stroke()}function u0(o,n){let{width:e,height:t}=o,i=o.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,e,t).data,s=t,l=e,d=-1,p=-1;for(let b=0;b<t;b++){let f=b*e*4;for(let x=0;x<e;x++)i[f+x*4+3]>8&&(x<l&&(l=x),x>d&&(d=x),b<s&&(s=b),p=b)}if(d<0)return;let u=document.createElement("canvas");return u.width=d-l+1+2*n,u.height=p-s+1+2*n,u.getContext("2d").drawImage(o,l,s,d-l+1,p-s+1,n,n,d-l+1,p-s+1),u}function g0(o,n){let e=t=>{let i=/^#([0-9a-f]{6})$/i.exec(t.trim());if(i){let s=parseInt(i[1],16);return`${s>>16&255},${s>>8&255},${s&255}`}return(/\d+\s*,\s*\d+\s*,\s*\d+/.exec(t)?.[0]??t).replace(/\s/g,"")};return e(o)===e(n)}$("cm-signature-field",Qi);var aM=C("optionGroup",{required:"Please select one of these options."}),$t,os,ls,nn,vc,Ft,Lg,Ag,iy,Bt=class extends T{constructor(){super(...arguments);m(this,Ft);this.label="";this.name="";this.value="";this.options=[];this.required=!1;this.disabled=!1;this._slotted=[];m(this,$t,this.attachInternals());m(this,os,new ie(this,r(this,$t),()=>this.renderRoot.querySelector('button[tabindex="0"]')?.focus()));m(this,ls,N("cm-og"));m(this,nn,"");m(this,vc,new MutationObserver(()=>a(this,Ft,Lg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,Ft,Lg).call(this),r(this,vc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","disabled","selected","tone"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,vc).disconnect()}get form(){return r(this,$t).form}get validity(){return r(this,$t).validity}get validationMessage(){return r(this,$t).validationMessage}checkValidity(){return r(this,$t).checkValidity()}reportValidity(){return r(this,os).report(()=>r(this,$t).reportValidity())}formResetCallback(){this.value=r(this,nn),r(this,os).reset()}formDisabledCallback(e){this.disabled=e}formStateRestoreCallback(e){this.value=e}focus(e){this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}get items(){return this.options.length?this.options.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}firstUpdated(){r(this,nn)||g(this,nn,this.value)}updated(){r(this,$t).setFormValue(this.value||null,this.value);let e=this.renderRoot.querySelector("button")??void 0;this.required&&!this.value?r(this,$t).setValidity({valueMissing:!0},this.t("required"),e):r(this,$t).setValidity({}),r(this,os).sync()}render(){let e=this.items,t=e.findIndex(d=>d.value===this.value&&!d.disabled),i=t>=0?t:e.findIndex(d=>!d.disabled),s=this.getAttribute("aria-label"),l=r(this,os).message;return c`
1530
1530
  ${this.label?c`<span class="label" id="${r(this,ls)}-l" part="label">${this.label}${this.required?c`<span class="req" aria-hidden="true">*</span>`:h}</span>`:h}
1531
1531
  <div class="options" part="options" role="radiogroup"
1532
1532
  aria-labelledby=${this.label?`${r(this,ls)}-l`:h} aria-label=${!this.label&&s?s:h}
@@ -1602,7 +1602,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1602
1602
  button[aria-checked='true']:disabled { background: var(--cm-bg-input-filled); border-color: var(--cm-border-subtle); }
1603
1603
  :host([disabled]) .options { background: var(--cm-bg-input-filled); }
1604
1604
  slot { display: none; }
1605
- `];$("cm-segmented-control",on);var bM=C("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),yc,Dg,ln=class extends _{constructor(){super(...arguments);m(this,yc);this.heading="";this.description="";this.breadcrumbs=[];this.backHref="";this.backLabel="";this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=this.backHref?{href:this.backHref,label:this.backLabel}:[...e].reverse().find(i=>i.href);return c`<header part="header">
1605
+ `];$("cm-segmented-control",on);var bM=C("pageHeader",{back:"Back to {label}",backOnly:"Back",breadcrumbs:"Breadcrumb",records:"Records",previous:"Previous",next:"Next"}),yc,Dg,ln=class extends T{constructor(){super(...arguments);m(this,yc);this.heading="";this.description="";this.breadcrumbs=[];this.backHref="";this.backLabel="";this.pagination=!1;this.hasPrevious=!1;this.hasNext=!1}render(){let e=Array.isArray(this.breadcrumbs)?this.breadcrumbs:[],t=this.backHref?{href:this.backHref,label:this.backLabel}:[...e].reverse().find(i=>i.href);return c`<header part="header">
1606
1606
  <div class=${this.description?"lead described":"lead"}>
1607
1607
  ${t?c`<a class=${this.backHref?"back always":"back"} part="back" href=${t.href} aria-label=${t.label?this.t("back",{label:t.label}):this.t("backOnly")}><cm-icon name="chevron-left" size="20"></cm-icon></a>`:h}
1608
1608
  <div class="titles">
@@ -1679,7 +1679,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1679
1679
  h1 { font-size: var(--cm-type-heading-lg-resp-size); line-height: var(--cm-type-heading-lg-resp-line-height); }
1680
1680
  .actions { gap: var(--cm-space-8); }
1681
1681
  }
1682
- `];$("cm-page-header",ln);var kM=C("actionBar",{label:"Actions"}),cn=class extends _{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
1682
+ `];$("cm-page-header",ln);var kM=C("actionBar",{label:"Actions"}),cn=class extends T{constructor(){super(...arguments);this.eyebrow="";this.heading="";this.tone="default";this.sticky=!1;this.label=""}render(){let e=this.tone==="critical";return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.heading||this.eyebrow||this.t("label")}>
1683
1683
  <div class="lead">
1684
1684
  ${e?c`<span class="icon" aria-hidden="true"><cm-icon name="alert" size="20"></cm-icon></span>`:h}
1685
1685
  <div class="text">
@@ -1720,7 +1720,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1720
1720
 
1721
1721
  .actions { gap: var(--cm-space-8); }
1722
1722
  }
1723
- `];$("cm-action-bar",cn);var CM=C("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Vt,cs,xc,Oe,Rg,Hg,Ng,ry,sy,dn=class extends _{constructor(){super(...arguments);m(this,Oe);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";m(this,Vt,null);m(this,cs,()=>{this.open=!0});m(this,xc,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,Oe,Rg).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,Oe,Hg).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,Oe,Rg).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1723
+ `];$("cm-action-bar",cn);var CM=C("saveBar",{message:"Unsaved changes",save:"Save",discard:"Discard"}),Vt,cs,xc,Oe,Rg,Hg,Ng,ry,sy,dn=class extends T{constructor(){super(...arguments);m(this,Oe);this.open=!1;this.loading=!1;this.saveDisabled=!1;this.form="";m(this,Vt,null);m(this,cs,()=>{this.open=!0});m(this,xc,()=>{this.open=!1})}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>a(this,Oe,Rg).call(this))}disconnectedCallback(){super.disconnectedCallback(),a(this,Oe,Hg).call(this)}updated(e){e.has("form")&&this.isConnected&&a(this,Oe,Rg).call(this)}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.message}>
1724
1724
  <p class="message" part="message" role="status">${this.open?this.message:""}</p>
1725
1725
  <div class="actions">
1726
1726
  <cm-button size="large" ?disabled=${this.loading} @click=${a(this,Oe,sy)}>${this.discardLabel}</cm-button>
@@ -1774,7 +1774,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1774
1774
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: baseline;
1775
1775
  column-gap: var(--cm-space-12); grid-column: 1 / -1; --_cm-info-value-gap: 0px;
1776
1776
  }
1777
- `];$("cm-info-panel",hn);var pn=class extends _{constructor(){super(...arguments);this.label="";this.half=!1;this.editable=!1;this.editLabel=""}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){let e=c`<div class="value" part="value"><slot></slot></div>`;return this.editable?c`<div class="label" part="label">${this.label}</div><div class="row">${e}<button class="edit" part="edit" type="button"
1777
+ `];$("cm-info-panel",hn);var pn=class extends T{constructor(){super(...arguments);this.label="";this.half=!1;this.editable=!1;this.editLabel=""}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","listitem")}render(){let e=c`<div class="value" part="value"><slot></slot></div>`;return this.editable?c`<div class="label" part="label">${this.label}</div><div class="row">${e}<button class="edit" part="edit" type="button"
1778
1778
  aria-label=${this.editLabel||this.t("edit",{label:this.label})}
1779
1779
  @click=${()=>this.dispatchEvent(new CustomEvent("cm-edit",{bubbles:!0,composed:!0}))}><cm-icon name="edit" size="16"></cm-icon></button></div>`:c`<div class="label" part="label">${this.label}</div>${e}`}};pn.properties={label:{},half:{type:Boolean,reflect:!0},editable:{type:Boolean,reflect:!0},editLabel:{attribute:"edit-label"}},pn.styles=[E,w`
1780
1780
  :host { display: block; grid-column: 1 / -1; min-width: 0; }
@@ -1908,7 +1908,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1908
1908
  .bone { animation: none; background: var(--cm-thumb-bg); }
1909
1909
  }
1910
1910
  @media (forced-colors: active) { .bone { border: 1px solid CanvasText; } }
1911
- `];$("cm-skeleton",gn);var f0=[472,90,90,251],b0=[94,266,134,191,138],fn=class extends _{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>c`<span class="bone" style="height:${i}px"></span>`);return c`<div class="wrap" part="skeleton-display" aria-busy="true">
1911
+ `];$("cm-skeleton",gn);var f0=[472,90,90,251],b0=[94,266,134,191,138],fn=class extends T{constructor(){super(...arguments);this.layout="two-column";this.navigation=!1}render(){let e=t=>t.map(i=>c`<span class="bone" style="height:${i}px"></span>`);return c`<div class="wrap" part="skeleton-display" aria-busy="true">
1912
1912
  <span class="sr" role="status">${this.label}</span>
1913
1913
  <div class="page" aria-hidden="true">
1914
1914
  ${this.navigation?c`<span class="bone nav"></span>`:h}
@@ -1942,7 +1942,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1942
1942
  .body { grid-template-columns: minmax(0, 1fr); }
1943
1943
  .head { height: 60px; }
1944
1944
  }
1945
- `];$("cm-skeleton-display",fn);var e2=C("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Jp,oy,bn=class extends _{constructor(){super(...arguments);m(this,Jp);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=a(this,Jp,oy).call(this);return c`<article part="comment">
1945
+ `];$("cm-skeleton-display",fn);var e2=C("commentBox",{heading:"Comments",label:"Add a comment",action:"Post comment"}),Jp,oy,bn=class extends T{constructor(){super(...arguments);m(this,Jp);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=a(this,Jp,oy).call(this);return c`<article part="comment">
1946
1946
  ${e?c`<time class="meta" part="time" datetime=${this.datetime||h}>${e}</time>`:h}
1947
1947
  <div class="body" part="body"><slot></slot></div>
1948
1948
  ${this.author?c`<div class="meta" part="author">– ${this.author}</div>`:h}
@@ -1954,7 +1954,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1954
1954
  }
1955
1955
  .meta { font-size: var(--cm-font-size-12); line-height: var(--cm-line-height-12); color: var(--cm-text-tertiary); }
1956
1956
  .body { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); overflow-wrap: anywhere; }
1957
- `];$("cm-comment",bn);var wc,Zp,ly,vn=class extends _{constructor(){super(...arguments);m(this,Zp);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;m(this,wc,N("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 c`<section part="comment-box" aria-labelledby="${r(this,wc)}-h">
1957
+ `];$("cm-comment",bn);var wc,Zp,ly,vn=class extends T{constructor(){super(...arguments);m(this,Zp);this.placeholder="";this.value="";this.disabled=!1;this.headingLevel=2;m(this,wc,N("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 c`<section part="comment-box" aria-labelledby="${r(this,wc)}-h">
1958
1958
  <div class="title" id="${r(this,wc)}-h" role="heading" aria-level=${e} part="heading">${this.heading}</div>
1959
1959
  <textarea part="input" aria-label=${this.label} placeholder=${this.placeholder||h} .value=${this.value}
1960
1960
  ?disabled=${this.disabled} @input=${t=>{this.value=t.target.value}}
@@ -1983,8 +1983,8 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
1983
1983
 
1984
1984
  .actions { justify-content: flex-end; }
1985
1985
  }
1986
- `];$("cm-comment-box",vn);var Qp='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',Te,xn,rr,sr,xi,wn,$n,nt,Ig,em,tm,im,rm,kn,cy,ps,qg,Og,wi,yn=class extends L{constructor(){super(...arguments);m(this,nt);this.content="";this.placement="top";this.delay=400;this.open=!1;this.visualOnly=!1;this._side="top";m(this,Te);m(this,xn);m(this,rr,[]);m(this,sr);m(this,xi);m(this,wn,!1);m(this,$n,!1);m(this,em,()=>{g(this,wn,!0),clearTimeout(r(this,xi)),this.open||g(this,xi,setTimeout(()=>this.show(),this.delay))});m(this,tm,()=>{g(this,wn,!1),clearTimeout(r(this,xi)),r(this,$n)||this.hide()});m(this,im,()=>{g(this,$n,!0),this.show()});m(this,rm,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,$n,!1),r(this,wn)||this.hide())});m(this,kn,e=>{e.key==="Escape"&&this.open&&this.hide()});m(this,ps,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(a(this,nt,Og).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(Qp)&&i.then(()=>{t.shadowRoot?.querySelector(Qp)&&r(this,ps).call(this)}),r(this,Te)||(g(this,Te,document.createElement("span")),r(this,Te).id=N("cm-tooltip"),r(this,Te).hidden=!0,r(this,Te).slot="description"),r(this,Te).textContent=this.content,r(this,Te).isConnected||this.append(r(this,Te));let s=a(this,nt,cy).call(this,t);if(g(this,xn,s),s.getRootNode()===r(this,Te).getRootNode()){let l=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);l.includes(r(this,Te).id)||s.setAttribute("aria-describedby",[...l,r(this,Te).id].join(" "))}else"ariaDescribedByElements"in s?(a(this,nt,qg).call(this,s),g(this,sr,new MutationObserver(()=>{s.getAttribute("aria-describedby")!==""&&a(this,nt,qg).call(this,s)})),r(this,sr).observe(s,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,Te).id)});m(this,wi,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let s=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),l=e.getBoundingClientRect(),d=8,p=8,u=innerWidth,b=innerHeight,f=getComputedStyle(this).direction==="rtl",x=G=>G==="start"?f?"right":"left":G==="end"?f?"left":"right":G,y={top:s.top-d-l.height>=p,bottom:s.bottom+d+l.height<=b-p,left:s.left-d-l.width>=p,right:s.right+d+l.width<=u-p},k={top:"bottom",bottom:"top",left:"right",right:"left"},S=x(this.placement);!y[S]&&y[k[S]]&&(S=k[S]);let H,O;S==="top"||S==="bottom"?(H=s.left+s.width/2-l.width/2,O=S==="top"?s.top-d-l.height:s.bottom+d):(O=s.top+s.height/2-l.height/2,H=S==="left"?s.left-d-l.width:s.right+d),H=Math.min(Math.max(p,H),u-p-l.width),O=Math.min(Math.max(p,O),b-p-l.height),e.style.transform=`translate(${Math.round(H)}px, ${Math.round(O)}px)`;let V={top:"top",bottom:"bottom",left:f?"end":"start",right:f?"start":"end"};this._side=V[S]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,em)),this.addEventListener("pointerleave",r(this,tm)),this.addEventListener("focusin",r(this,im)),this.addEventListener("focusout",r(this,rm)),this.addEventListener("keydown",r(this,kn)),this.hasUpdated&&r(this,ps).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,nt,Og).call(this),a(this,nt,Ig).call(this),clearTimeout(r(this,xi))}show(){clearTimeout(r(this,xi)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,kn),!0),addEventListener("scroll",r(this,wi),!0),addEventListener("resize",r(this,wi)),this.updateComplete.then(r(this,wi)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,xi)),this.open&&(this.open=!1,a(this,nt,Ig).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,ps).call(this),this.content?this.open&&r(this,wi).call(this):this.hide())}render(){return c`<slot @slotchange=${r(this,ps)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1987
- data-side=${this._side}>${this.content}</div>`}};Te=new WeakMap,xn=new WeakMap,rr=new WeakMap,sr=new WeakMap,xi=new WeakMap,wn=new WeakMap,$n=new WeakMap,nt=new WeakSet,Ig=function(){document.removeEventListener("keydown",r(this,kn),!0),removeEventListener("scroll",r(this,wi),!0),removeEventListener("resize",r(this,wi))},em=new WeakMap,tm=new WeakMap,im=new WeakMap,rm=new WeakMap,kn=new WeakMap,cy=function(e){return e.matches(Qp)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Qp)??e},ps=new WeakMap,qg=function(e){g(this,rr,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=r(this,rr).map(s=>t.getElementById(s)).filter(s=>!!s);e.ariaDescribedByElements=[...i,r(this,Te)]},Og=function(){let e=r(this,xn);if(!(!e||!r(this,Te))){if(r(this,sr))r(this,sr).disconnect(),g(this,sr,void 0),r(this,rr).length?e.setAttribute("aria-describedby",r(this,rr).join(" ")):e.removeAttribute("aria-describedby"),g(this,rr,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==r(this,Te).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}g(this,xn,void 0)}},wi=new WeakMap,yn.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},yn.styles=[E,w`
1986
+ `];$("cm-comment-box",vn);var Qp='button, a[href], input, select, textarea, [tabindex]:not([tabindex="-1"]), [part="control"]',_e,xn,rr,sr,xi,wn,$n,nt,Ig,em,tm,im,rm,kn,cy,ps,qg,Og,wi,yn=class extends L{constructor(){super(...arguments);m(this,nt);this.content="";this.placement="top";this.delay=400;this.open=!1;this.visualOnly=!1;this._side="top";m(this,_e);m(this,xn);m(this,rr,[]);m(this,sr);m(this,xi);m(this,wn,!1);m(this,$n,!1);m(this,em,()=>{g(this,wn,!0),clearTimeout(r(this,xi)),this.open||g(this,xi,setTimeout(()=>this.show(),this.delay))});m(this,tm,()=>{g(this,wn,!1),clearTimeout(r(this,xi)),r(this,$n)||this.hide()});m(this,im,()=>{g(this,$n,!0),this.show()});m(this,rm,e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(g(this,$n,!1),r(this,wn)||this.hide())});m(this,kn,e=>{e.key==="Escape"&&this.open&&this.hide()});m(this,ps,()=>{let t=this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0];if(a(this,nt,Og).call(this),!t||!this.content||this.visualOnly)return;let i=t.updateComplete;t.localName.includes("-")&&i&&!t.shadowRoot?.querySelector(Qp)&&i.then(()=>{t.shadowRoot?.querySelector(Qp)&&r(this,ps).call(this)}),r(this,_e)||(g(this,_e,document.createElement("span")),r(this,_e).id=N("cm-tooltip"),r(this,_e).hidden=!0,r(this,_e).slot="description"),r(this,_e).textContent=this.content,r(this,_e).isConnected||this.append(r(this,_e));let s=a(this,nt,cy).call(this,t);if(g(this,xn,s),s.getRootNode()===r(this,_e).getRootNode()){let l=(s.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean);l.includes(r(this,_e).id)||s.setAttribute("aria-describedby",[...l,r(this,_e).id].join(" "))}else"ariaDescribedByElements"in s?(a(this,nt,qg).call(this,s),g(this,sr,new MutationObserver(()=>{s.getAttribute("aria-describedby")!==""&&a(this,nt,qg).call(this,s)})),r(this,sr).observe(s,{attributes:!0,attributeFilter:["aria-describedby"]})):t.setAttribute("aria-describedby",r(this,_e).id)});m(this,wi,()=>{let e=this.renderRoot.querySelector(".tip");if(!e||!this.open)return;let s=(this.renderRoot.querySelector("slot")?.assignedElements({flatten:!0})[0]??this).getBoundingClientRect(),l=e.getBoundingClientRect(),d=8,p=8,u=innerWidth,b=innerHeight,f=getComputedStyle(this).direction==="rtl",x=G=>G==="start"?f?"right":"left":G==="end"?f?"left":"right":G,y={top:s.top-d-l.height>=p,bottom:s.bottom+d+l.height<=b-p,left:s.left-d-l.width>=p,right:s.right+d+l.width<=u-p},k={top:"bottom",bottom:"top",left:"right",right:"left"},S=x(this.placement);!y[S]&&y[k[S]]&&(S=k[S]);let H,O;S==="top"||S==="bottom"?(H=s.left+s.width/2-l.width/2,O=S==="top"?s.top-d-l.height:s.bottom+d):(O=s.top+s.height/2-l.height/2,H=S==="left"?s.left-d-l.width:s.right+d),H=Math.min(Math.max(p,H),u-p-l.width),O=Math.min(Math.max(p,O),b-p-l.height),e.style.transform=`translate(${Math.round(H)}px, ${Math.round(O)}px)`;let V={top:"top",bottom:"bottom",left:f?"end":"start",right:f?"start":"end"};this._side=V[S]})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerenter",r(this,em)),this.addEventListener("pointerleave",r(this,tm)),this.addEventListener("focusin",r(this,im)),this.addEventListener("focusout",r(this,rm)),this.addEventListener("keydown",r(this,kn)),this.hasUpdated&&r(this,ps).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.hide(),a(this,nt,Og).call(this),a(this,nt,Ig).call(this),clearTimeout(r(this,xi))}show(){clearTimeout(r(this,xi)),!(this.open||!this.content)&&(this.open=!0,document.addEventListener("keydown",r(this,kn),!0),addEventListener("scroll",r(this,wi),!0),addEventListener("resize",r(this,wi)),this.updateComplete.then(r(this,wi)),this.dispatchEvent(new CustomEvent("cm-show",{bubbles:!0,composed:!0})))}hide(){clearTimeout(r(this,xi)),this.open&&(this.open=!1,a(this,nt,Ig).call(this),this.dispatchEvent(new CustomEvent("cm-hide",{bubbles:!0,composed:!0})))}updated(e){(e.has("content")||e.has("visualOnly"))&&(r(this,ps).call(this),this.content?this.open&&r(this,wi).call(this):this.hide())}render(){return c`<slot @slotchange=${r(this,ps)}></slot><div class="tip" part="tooltip" role="tooltip" aria-hidden="true"
1987
+ data-side=${this._side}>${this.content}</div>`}};_e=new WeakMap,xn=new WeakMap,rr=new WeakMap,sr=new WeakMap,xi=new WeakMap,wn=new WeakMap,$n=new WeakMap,nt=new WeakSet,Ig=function(){document.removeEventListener("keydown",r(this,kn),!0),removeEventListener("scroll",r(this,wi),!0),removeEventListener("resize",r(this,wi))},em=new WeakMap,tm=new WeakMap,im=new WeakMap,rm=new WeakMap,kn=new WeakMap,cy=function(e){return e.matches(Qp)&&!e.shadowRoot?e:e.shadowRoot?.querySelector(Qp)??e},ps=new WeakMap,qg=function(e){g(this,rr,(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(Boolean));let t=e.getRootNode(),i=r(this,rr).map(s=>t.getElementById(s)).filter(s=>!!s);e.ariaDescribedByElements=[...i,r(this,_e)]},Og=function(){let e=r(this,xn);if(!(!e||!r(this,_e))){if(r(this,sr))r(this,sr).disconnect(),g(this,sr,void 0),r(this,rr).length?e.setAttribute("aria-describedby",r(this,rr).join(" ")):e.removeAttribute("aria-describedby"),g(this,rr,[]);else{let t=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(i=>i&&i!==r(this,_e).id);t.length?e.setAttribute("aria-describedby",t.join(" ")):e.removeAttribute("aria-describedby")}g(this,xn,void 0)}},wi=new WeakMap,yn.properties={content:{},placement:{reflect:!0},delay:{type:Number},open:{type:Boolean,reflect:!0},visualOnly:{type:Boolean,attribute:"visual-only"},_side:{state:!0}},yn.styles=[E,w`
1988
1988
  :host { display: inline-block; position: relative; }
1989
1989
  .tip {
1990
1990
  position: fixed; top: 0; left: 0; z-index: 1100; box-sizing: border-box;
@@ -2001,7 +2001,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2001
2001
  :host([open]) .tip { opacity: 1; visibility: visible; transition: opacity var(--cm-duration-fast) var(--cm-easing-standard); }
2002
2002
  @media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
2003
2003
  @media (forced-colors: active) { .tip { border: 1px solid CanvasText; } }
2004
- `];$("cm-tooltip",yn);var d2=C("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"}),h2=C("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),v0=7,$c=new Set,kc;function dy(o,n){n?$c.add(o):$c.delete(o),$c.size&&!kc&&(kc=setInterval(()=>$c.forEach(e=>e.requestUpdate()),6e4)),!$c.size&&kc&&(clearInterval(kc),kc=void 0)}var Ec,us,zt,Bg,sm,hy,En=class extends _{constructor(){super(...arguments);m(this,zt);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;m(this,Ec,N("cm-tl"));m(this,us)}connectedCallback(){super.connectedCallback(),dy(this,!0)}disconnectedCallback(){super.disconnectedCallback(),dy(this,!1),r(this,us)?.disconnect(),g(this,us,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,us,new ResizeObserver(()=>a(this,zt,Bg).call(this))),r(this,us).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,zt,Bg).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,s=Math.floor(Math.abs(t)/6e4);if(s<1)return this.t("justNow");if(s<60)return this.t(i?"inMinutes":"minutesAgo",{count:s});let l=Math.floor(s/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<v0?this.t(i?"inDays":"daysAgo",{count:d}):he(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?he(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",s=this.lines>0&&!this.expanded,l=e?t?c`<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>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
2004
+ `];$("cm-tooltip",yn);var d2=C("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"}),h2=C("timeline",{label:"Activity",showMore:"Show more",loading:"Loading activity"}),v0=7,$c=new Set,kc;function dy(o,n){n?$c.add(o):$c.delete(o),$c.size&&!kc&&(kc=setInterval(()=>$c.forEach(e=>e.requestUpdate()),6e4)),!$c.size&&kc&&(clearInterval(kc),kc=void 0)}var Ec,us,zt,Bg,sm,hy,En=class extends T{constructor(){super(...arguments);m(this,zt);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;m(this,Ec,N("cm-tl"));m(this,us)}connectedCallback(){super.connectedCallback(),dy(this,!0)}disconnectedCallback(){super.disconnectedCallback(),dy(this,!1),r(this,us)?.disconnect(),g(this,us,void 0)}firstUpdated(){let e=this.renderRoot.querySelector(".body");e&&typeof ResizeObserver<"u"&&(g(this,us,new ResizeObserver(()=>a(this,zt,Bg).call(this))),r(this,us).observe(e))}updated(e){(e.has("lines")||e.has("_body")||e.has("expanded"))&&a(this,zt,Bg).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,s=Math.floor(Math.abs(t)/6e4);if(s<1)return this.t("justNow");if(s<60)return this.t(i?"inMinutes":"minutesAgo",{count:s});let l=Math.floor(s/60);if(l<24)return this.t(i?"inHours":"hoursAgo",{count:l});let d=Math.floor(l/24);return d<v0?this.t(i?"inDays":"daysAgo",{count:d}):he(e,{dateStyle:"medium"},this.locale)}get fullTime(){let e=this.date;return e?he(e,{dateStyle:"full",timeStyle:"short"},this.locale):""}render(){let e=this.relativeTime,t=this.fullTime,i=this.tone&&this.tone!=="neutral"?this.tone:"",s=this.lines>0&&!this.expanded,l=e?t?c`<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>`:c`<time class="when" part="time" datetime=${this.datetime||h}>${e}</time>`:h;return c`<div class="item">
2005
2005
  <span class="icon ${i}" part="icon" aria-hidden="true">${this.icon?c`<cm-icon name=${this.icon} size="16"></cm-icon>`:c`<span class="dot"></span>`}</span>
2006
2006
  <div class="main">
2007
2007
  <div class="head">
@@ -2061,7 +2061,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2061
2061
  [hidden] { display: none !important; }
2062
2062
  .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; }
2063
2063
  ::slotted([slot='badge']) { flex: none; }
2064
- `];$("cm-timeline-item",En);var Mc,Mn,gs,Fg,py,ms=class extends _{constructor(){super(...arguments);m(this,gs);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];m(this,Mc,new MutationObserver(()=>a(this,gs,Fg).call(this)));m(this,Mn,!1)}connectedCallback(){super.connectedCallback(),a(this,gs,Fg).call(this),r(this,Mc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Mc).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,Mn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,s)=>{this._items[s]&&i.assign(this._items[s])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),r(this,Mn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Mn,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?c`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>c`<div class="sk">
2064
+ `];$("cm-timeline-item",En);var Mc,Mn,gs,Fg,py,ms=class extends T{constructor(){super(...arguments);m(this,gs);this.hasMore=!1;this.loading=!1;this._items=[];this._empty=[];m(this,Mc,new MutationObserver(()=>a(this,gs,Fg).call(this)));m(this,Mn,!1)}connectedCallback(){super.connectedCallback(),a(this,gs,Fg).call(this),r(this,Mc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Mc).disconnect()}get items(){return[...this.children].filter(e=>e.localName==="cm-timeline-item"&&!e.hasAttribute("slot"))}willUpdate(){g(this,Mn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach((i,s)=>{this._items[s]&&i.assign(this._items[s])});let t=this.renderRoot.querySelector("slot.empty");t&&t.assign(...this._empty),r(this,Mn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Mn,!1),this.renderRoot.querySelector("ol")?.focus())}render(){let e=this._items,t=this.loading,i=t&&!e.length?c`<div class="loading" aria-hidden="true">${[0,1,2].map(()=>c`<div class="sk">
2065
2065
  <cm-skeleton class="ic" variant="block"></cm-skeleton><cm-skeleton class="tx" lines="2"></cm-skeleton></div>`)}</div>`:h;return c`
2066
2066
  ${e.length?c`<ol part="list" aria-label=${this.label} aria-busy=${t?"true":"false"} tabindex="-1">
2067
2067
  ${e.map(()=>c`<li><slot></slot></li>`)}
@@ -2093,14 +2093,14 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2093
2093
  @media (max-width: 640px) {
2094
2094
  .more { padding-inline-start: 0; }
2095
2095
  }
2096
- `];$("cm-timeline",ms);var b2=C("smartTip",{newTab:"(opens in a new tab)"}),v2=C("smartTips",{heading:"Smart tips",tourAction:"Start"}),Tn=class extends _{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 c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
2096
+ `];$("cm-timeline",ms);var b2=C("smartTip",{newTab:"(opens in a new tab)"}),v2=C("smartTips",{heading:"Smart tips",tourAction:"Start"}),_n=class extends T{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 c`<a part="tip" href=${this.href||h} target=${this.target||h} rel=${e?"noopener noreferrer":h}>
2097
2097
  <span class="text">
2098
2098
  <span class="title" part="heading">${this.heading}</span>
2099
2099
  <span class="desc" part="description"><slot></slot></span>
2100
2100
  ${e?c`<span style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)">${this.t("newTab")}</span>`:h}
2101
2101
  </span>
2102
2102
  <span class="go" aria-hidden="true"><cm-icon name="arrow-up-right" size="16"></cm-icon></span>
2103
- </a>`}};Tn.properties={heading:{},href:{},target:{}},Tn.styles=[E,w`
2103
+ </a>`}};_n.properties={heading:{},href:{},target:{}},_n.styles=[E,w`
2104
2104
  :host { display: block; }
2105
2105
  a {
2106
2106
  display: flex; align-items: flex-start; gap: var(--cm-space-8); padding: var(--cm-space-16);
@@ -2117,7 +2117,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2117
2117
  }
2118
2118
  a:hover .go, a:focus-visible .go { background: var(--cm-action-primary); color: var(--cm-action-primary-text); }
2119
2119
  a:hover .title { text-decoration: underline; }
2120
- `];$("cm-smart-tip",Tn);var _n=class extends _{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<div class="card" part="smart-tips">
2120
+ `];$("cm-smart-tip",_n);var Tn=class extends T{constructor(){super(...arguments);this.tourHeading="";this.headingLevel=2}render(){let e=Math.min(6,Math.max(2,this.headingLevel||2));return c`<div class="card" part="smart-tips">
2121
2121
  ${this.tourHeading?c`<div class="tour" part="tour">
2122
2122
  <span class="tour-icon" aria-hidden="true"><cm-icon name="rocket" size="16"></cm-icon>
2123
2123
  </span>
@@ -2128,7 +2128,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2128
2128
  <div class="title" role="heading" aria-level=${e} part="heading">${this.heading}</div>
2129
2129
  <div class="list" role="list"><slot></slot></div>
2130
2130
  </section>
2131
- </div>`}};_n.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},_n.styles=[E,w`
2131
+ </div>`}};Tn.properties={heading:{string:"heading"},tourHeading:{attribute:"tour-heading"},tourAction:{attribute:"tour-action",string:"tourAction"},headingLevel:{type:Number,attribute:"heading-level"}},Tn.styles=[E,w`
2132
2132
  :host { display: block; }
2133
2133
  .card { display: flex; flex-direction: column; gap: var(--cm-space-8); }
2134
2134
  .tour {
@@ -2145,7 +2145,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2145
2145
  margin: var(--cm-space-8) 0 var(--cm-space-16); text-align: center; font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); font-weight: 600;
2146
2146
  }
2147
2147
  .list { display: flex; flex-direction: column; gap: var(--cm-space-8); }
2148
- `];$("cm-smart-tips",_n);var k2=C("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"}),$i,zn,my,uy,Cn=class extends _{constructor(){super(...arguments);m(this,zn);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;m(this,$i,N("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,s=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
2148
+ `];$("cm-smart-tips",Tn);var k2=C("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"}),$i,zn,my,uy,Cn=class extends T{constructor(){super(...arguments);m(this,zn);this.page=1;this.total=0;this.pageSize=20;this.pageSizes=[10,20,50,100];this.resourceName="";this._draft=null;m(this,$i,N("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,s=Math.min(this.total,t*this.pageSize),l=this.pageSizes??[];return c`
2149
2149
  <nav part="bar" aria-label=${this.label}>
2150
2150
  ${l.length?c`<div class="rows" part="rows">
2151
2151
  <label for="${r(this,$i)}-s">${this.t("rows")}</label>
@@ -2215,7 +2215,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2215
2215
  select, input { height: var(--cm-control-height-touch); }
2216
2216
  button { width: var(--cm-control-height-touch); height: var(--cm-control-height-touch); }
2217
2217
  }
2218
- `];$("cm-pagination",Cn);var z2=C("statusTabs",{label:"Status",option:"{label} ({count})"}),Ln,_c,we,Tc,gy,Vg,fy,jg,by,Sn=class extends _{constructor(){super(...arguments);m(this,we);this.value="";this.tabs=[];this.controls="";this.size="large";this.mobile="scroll";this._more="";m(this,Ln,new ResizeObserver(()=>a(this,we,Tc).call(this)));this._slotted=[];m(this,_c,new MutationObserver(()=>a(this,we,Vg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,we,Vg).call(this),r(this,_c).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,_c).disconnect(),r(this,Ln).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,Ln).observe(e),e.addEventListener("scroll",()=>a(this,we,Tc).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,we,Tc).call(this))}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){let t=this.renderRoot.querySelector(".pick select");t&&t.offsetParent!==null?t.focus(e):this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(e){a(this,we,Tc).call(this);for(let s of this.renderRoot.querySelectorAll(".tabs > *"))r(this,Ln).observe(s);if(!("ariaControlsElements"in Element.prototype))return;let t=this.getRootNode(),i=this.controls?t.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button, select"))s.ariaControlsElements=i?[i]:null}render(){let e=this.items,t=a(this,we,fy).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
2218
+ `];$("cm-pagination",Cn);var z2=C("statusTabs",{label:"Status",option:"{label} ({count})"}),Ln,Tc,we,_c,gy,Vg,fy,jg,by,Sn=class extends T{constructor(){super(...arguments);m(this,we);this.value="";this.tabs=[];this.controls="";this.size="large";this.mobile="scroll";this._more="";m(this,Ln,new ResizeObserver(()=>a(this,we,_c).call(this)));this._slotted=[];m(this,Tc,new MutationObserver(()=>a(this,we,Vg).call(this)))}connectedCallback(){super.connectedCallback(),a(this,we,Vg).call(this),r(this,Tc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","label","count","disabled","selected"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Tc).disconnect(),r(this,Ln).disconnect()}firstUpdated(){let e=this.renderRoot.querySelector(".tabs");r(this,Ln).observe(e),e.addEventListener("scroll",()=>a(this,we,_c).call(this),{passive:!0}),document.fonts?.ready.then(()=>a(this,we,_c).call(this))}get items(){return this.tabs.length?this.tabs.map(e=>typeof e=="string"?{value:e,label:e}:e):this._slotted}focus(e){let t=this.renderRoot.querySelector(".pick select");t&&t.offsetParent!==null?t.focus(e):this.renderRoot.querySelector('button[tabindex="0"]')?.focus(e)}updated(e){a(this,we,_c).call(this);for(let s of this.renderRoot.querySelectorAll(".tabs > *"))r(this,Ln).observe(s);if(!("ariaControlsElements"in Element.prototype))return;let t=this.getRootNode(),i=this.controls?t.getElementById?.(this.controls):null;for(let s of this.renderRoot.querySelectorAll("button, select"))s.ariaControlsElements=i?[i]:null}render(){let e=this.items,t=a(this,we,fy).call(this,e),i=this.getAttribute("aria-label")||this.t("label");return c`
2219
2219
  <div class=${`tabs${this._more?` more-${this._more}`:""}`} part="tabs" role="tablist" aria-label=${i}>
2220
2220
  ${e.map((s,l)=>c`<button type="button" role="tab" part="tab" aria-selected=${l===t?"true":"false"}
2221
2221
  tabindex=${l===t?"0":"-1"} ?disabled=${!!s.disabled}
@@ -2225,7 +2225,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2225
2225
  ${e.map((s,l)=>c`<option value=${s.value} ?disabled=${!!s.disabled} ?selected=${l===t} .selected=${l===t}>${s.count!==void 0&&!Number.isNaN(s.count)?this.t("option",{label:s.label,count:s.count}):s.label}</option>`)}
2226
2226
  </select><cm-icon name="chevron-down" size="16"></cm-icon></div>`:h}
2227
2227
  <slot></slot>
2228
- `}};Ln=new WeakMap,_c=new WeakMap,we=new WeakSet,Tc=function(){let e=this.renderRoot.querySelector(".tabs");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},gy=function(e){let t=e.target.value;t!==this.value&&(this.value=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Vg=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??"")},fy=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},jg=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}))))},by=function(e,t){let i=re(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight")d=s[(l+1)%s.length];else if(i==="ArrowLeft")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,we,jg).call(this,d)},Sn.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},mobile:{reflect:!0},_slotted:{state:!0},_more:{state:!0}},Sn.styles=[E,w`
2228
+ `}};Ln=new WeakMap,Tc=new WeakMap,we=new WeakSet,_c=function(){let e=this.renderRoot.querySelector(".tabs");if(!e)return;let t=e.scrollWidth-e.clientWidth,i=Math.abs(e.scrollLeft),s=t>1&&i>1,l=t>1&&i<t-1,d=s&&l?"both":s?"start":l?"end":"";d!==this._more&&(this._more=d)},gy=function(e){let t=e.target.value;t!==this.value&&(this.value=t,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))},Vg=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??"")},fy=function(e){let t=e.findIndex(i=>i.value===this.value&&!i.disabled);return t>=0?t:e.findIndex(i=>!i.disabled)},jg=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}))))},by=function(e,t){let i=re(e,this),s=this.items.flatMap((p,u)=>p.disabled?[]:[u]),l=s.indexOf(t),d;if(i==="ArrowRight")d=s[(l+1)%s.length];else if(i==="ArrowLeft")d=s[(l-1+s.length)%s.length];else if(e.key==="Home")d=s[0];else if(e.key==="End")d=s[s.length-1];else return;e.preventDefault(),d!==void 0&&a(this,we,jg).call(this,d)},Sn.properties={value:{reflect:!0},tabs:{type:Array},controls:{},size:{reflect:!0},mobile:{reflect:!0},_slotted:{state:!0},_more:{state:!0}},Sn.styles=[E,w`
2229
2229
  :host { display: block; }
2230
2230
  /* A 40px row: 14px labels (medium; semibold when chosen) over a 2px underline on a hairline. */
2231
2231
  .tabs {
@@ -2284,7 +2284,7 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2284
2284
  :host([mobile='select']) .tabs { display: none; }
2285
2285
  :host([mobile='select']) .pick { display: block; }
2286
2286
  }
2287
- `];$("cm-status-tabs",Sn);var H2=C("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),am,Cc,ki,Ug,vy,yy,An=class extends _{constructor(){super(...arguments);m(this,ki);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;m(this,am,N("cm-th"));m(this,Cc,new MutationObserver(()=>a(this,ki,Ug).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,ki,Ug).call(this),r(this,Cc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Cc).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 c`
2287
+ `];$("cm-status-tabs",Sn);var H2=C("tableHeader",{selectAll:"Select all",sorted:", sorted {direction}",sortable:", sortable"}),am,Cc,ki,Ug,vy,yy,An=class extends T{constructor(){super(...arguments);m(this,ki);this.columns=[];this.sort="";this.direction="ascending";this.selectable=!1;this.checked=!1;this.indeterminate=!1;this._slotted=[];this._inTable=!1;m(this,am,N("cm-th"));m(this,Cc,new MutationObserver(()=>a(this,ki,Ug).call(this)))}connectedCallback(){super.connectedCallback(),this._inTable=!!this.parentElement?.closest('table, [role="table"], [role="grid"], [role="treegrid"]'),a(this,ki,Ug).call(this),r(this,Cc).observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Cc).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 c`
2288
2288
  <div class="bar ${this.selectable?"sel":""}" part="bar" role=${e?"row":h}
2289
2289
  style="--_cols: repeat(${Math.max(1,t.length)}, minmax(0, 1fr))">
2290
2290
  ${this.selectable?c`<span class="cell" role=${e?"columnheader":h}><span class="check">
@@ -2329,11 +2329,11 @@ var Qf=o=>{throw TypeError(o)};var Km=(o,n,e)=>n.has(o)||Qf("Cannot "+e);var r=(
2329
2329
  input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2330
2330
  slot { display: none; }
2331
2331
  /* In a cm-resource-list (resource-rows): the bar's content box matches a row's content box, so the same
2332
- --cm-table-columns grid (with column-gap space-20) lands on the same x positions. The list pads its rows
2333
- --_rl from its edges; rows pad --_rp inline, start with a 16px checkbox and a space-12 gap when selectable,
2334
- and end with the gap before their (possibly empty) actions. On phones: no row padding, a 20px checkbox, space-8 gaps.
2332
+ --cm-table-columns grid (with column-gap space-20) lands on the same x positions. Rows run to the list's edges
2333
+ and pad --_rl + --_rp inline (--_rl on phones), start with a 16px checkbox and a space-12 gap when selectable,
2334
+ and end with the gap before their (possibly empty) actions. On phones: a 20px checkbox, space-8 gaps.
2335
2335
  The bar runs to the list's edges with hairlines above and below, and lies under the list's select-all box.
2336
- --_rl and --_rp are cm-resource-list's list padding (--_pad) and row padding: change both together. */
2336
+ --_rl and --_rp are cm-resource-list's --_pad and the row's own space-8: change both together. */
2337
2337
  :host([resource-rows]) { --_rl: var(--cm-space-12); --_rp: var(--cm-space-8); }
2338
2338
  :host([resource-rows]) .bar {
2339
2339
  margin-inline: calc(-1 * var(--_rl));
@@ -2404,7 +2404,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2404
2404
  cm-data-table[mobile='cards'] > table td[data-type='actions'] { justify-content: flex-start; flex-wrap: wrap; padding-block-start: var(--cm-space-8); }
2405
2405
  cm-data-table[mobile='cards'] > table td[data-type='actions'] > * { opacity: 1; }
2406
2406
  }
2407
- `;function w0(){if(ky||typeof document>"u")return;ky=!0;let o=new CSSStyleSheet;o.replaceSync(x0),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var zc=o=>o.type==="numeric"||o.type==="money",$0=o=>(o.align??(zc(o)||o.type==="actions"?"end":"start"))==="end",k0=o=>!o.type||o.type==="text";function Ey(o){if(typeof o=="number")return o;let n=String(o??"").trim(),e=/^\(.*\)$/.test(n)||/^-|^[^\d]*-\s*\d/.test(n),t=n.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var My=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),Ty=new Map;function E0(o){let n=Ty.get(o??"");if(!n){try{n=new Intl.Collator(o,{numeric:!0,sensitivity:"base"})}catch{n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}Ty.set(o??"",n)}return n}function _y(o,n,e,t){let i=s=>s==null||s==="";return i(o)||i(n)?i(o)===i(n)?0:i(o)?1:-1:e==="numeric"||e==="money"?(Ey(o)||0)-(Ey(n)||0):e==="date"?(My(o)||0)-(My(n)||0):E0(t).compare(String(o),String(n))}var Cy=o=>o.parentElement??o.getRootNode().host??null,In,qn,Sc,On,fs,Bn,bs,pm,z,Kg,Gg,Wg,zy,Yg,Sy,Ly,Ay,vs,Dn,Rn,lm,Hn,Nn,cm,Xg,Jg,Zg,Dy,Ry,Qg,ef,dm,Hy,Ny,Py,ar,hm,Fn,Iy,qy,Oy,By,Fy,Vy,jy,Pn=class extends _{constructor(){super(...arguments);m(this,z);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.mobile="scroll";this.rowActions="hover";this.resizable=!1;this.columnPicker=!1;this._light=!1;this._announce="";this._widths={};this._expanded=new Set;this._picker=!1;this._overflows=!1;m(this,In,!1);m(this,qn,N("cm-dt"));m(this,Sc,new MutationObserver(()=>a(this,z,Kg).call(this)));m(this,On,typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a(this,z,Dn).call(this)));m(this,fs,[]);m(this,Bn,0);m(this,bs,-1);m(this,pm,e=>{e.target?.closest?.("[data-lines]")&&a(this,z,cm).call(this,e)});m(this,vs,()=>{r(this,Bn)||!this.stickyHeader||g(this,Bn,requestAnimationFrame(()=>{g(this,Bn,0),a(this,z,Dn).call(this)}))});m(this,ar,new fe);m(this,Fn,e=>{let t=this.renderRoot.querySelector(".tools");t&&!e.composedPath().includes(t)&&a(this,z,hm).call(this,!1)})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerover",r(this,pm)),om(this),a(this,z,Kg).call(this),r(this,Sc).observe(this,{childList:!0,subtree:!0}),document.addEventListener("scroll",r(this,vs),{capture:!0,passive:!0}),window.addEventListener("resize",r(this,vs),{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,ar).close(),r(this,Sc).disconnect(),r(this,On)?.disconnect(),g(this,fs,[]),document.removeEventListener("scroll",r(this,vs),{capture:!0}),window.removeEventListener("resize",r(this,vs)),document.removeEventListener("pointerdown",r(this,Fn),{capture:!0})}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(s=>s.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((s,l)=>[s,l]).sort(([s,l],[d,p])=>{let u=s[t.key],b=d[t.key],f=u==null||u==="",x=b==null||b==="";return f||x?f===x?l-p:f?1:-1:i*_y(u,b,t.type,this.locale)||l-p}).map(([s])=>s)}get visibleColumns(){return(this.columns??[]).filter(e=>e.visible!==!1)}updated(e){if(this._picker&&!r(this,ar).active?r(this,ar).open(this.renderRoot.querySelector(".panel"),this.renderRoot.querySelector(".pick"),{align:"end"}):!this._picker&&r(this,ar).active&&r(this,ar).close(),r(this,In)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,In,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,z,Wg).call(this,t.label,this.direction)}if(e.has("columns")){let t=e.get("columns")??[],i={...this._widths},s=!1;for(let l of this.columns??[]){let d=t.find(p=>p.key===l.key);l.width!==void 0&&d?.width!==l.width&&i[l.key]!==void 0&&(delete i[l.key],s=!0)}s&&(this._widths=i)}a(this,z,Ay).call(this),a(this,z,Dn).call(this)}render(){let e=c`<span class="sr" role="status">${this._announce}</span>`,t=c`<p class="hint" part="scroll-hint" aria-hidden="true">${this.t("scrollHint")}<cm-icon name="chevron-right" size="16"></cm-icon></p>`,i=c`<span class="fade s" aria-hidden="true"></span><span class="fade e" aria-hidden="true"></span>`,s=this.stickyHeader||this.stickyFirstColumn||this._overflows;if(this._light)return c`<div class="frame" part="frame"><div class="wrap"><div class="scroll" part="scroll" tabindex=${this._overflows?"0":h}
2407
+ `;function w0(){if(ky||typeof document>"u")return;ky=!0;let o=new CSSStyleSheet;o.replaceSync(x0),document.adoptedStyleSheets=[...document.adoptedStyleSheets,o]}var zc=o=>o.type==="numeric"||o.type==="money",$0=o=>(o.align??(zc(o)||o.type==="actions"?"end":"start"))==="end",k0=o=>!o.type||o.type==="text";function Ey(o){if(typeof o=="number")return o;let n=String(o??"").trim(),e=/^\(.*\)$/.test(n)||/^-|^[^\d]*-\s*\d/.test(n),t=n.match(/\d[\d,]*(?:\.\d+)?/);if(!t)return NaN;let i=Number(t[0].replace(/,/g,""));return e?-i:i}var My=o=>o instanceof Date?o.getTime():typeof o=="number"?o:Date.parse(String(o??"")),_y=new Map;function E0(o){let n=_y.get(o??"");if(!n){try{n=new Intl.Collator(o,{numeric:!0,sensitivity:"base"})}catch{n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"})}_y.set(o??"",n)}return n}function Ty(o,n,e,t){let i=s=>s==null||s==="";return i(o)||i(n)?i(o)===i(n)?0:i(o)?1:-1:e==="numeric"||e==="money"?(Ey(o)||0)-(Ey(n)||0):e==="date"?(My(o)||0)-(My(n)||0):E0(t).compare(String(o),String(n))}var Cy=o=>o.parentElement??o.getRootNode().host??null,In,qn,Sc,On,fs,Bn,bs,pm,z,Kg,Gg,Wg,zy,Yg,Sy,Ly,Ay,vs,Dn,Rn,lm,Hn,Nn,cm,Xg,Jg,Zg,Dy,Ry,Qg,ef,dm,Hy,Ny,Py,ar,hm,Fn,Iy,qy,Oy,By,Fy,Vy,jy,Pn=class extends T{constructor(){super(...arguments);m(this,z);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.mobile="scroll";this.rowActions="hover";this.resizable=!1;this.columnPicker=!1;this._light=!1;this._announce="";this._widths={};this._expanded=new Set;this._picker=!1;this._overflows=!1;m(this,In,!1);m(this,qn,N("cm-dt"));m(this,Sc,new MutationObserver(()=>a(this,z,Kg).call(this)));m(this,On,typeof ResizeObserver>"u"?null:new ResizeObserver(()=>a(this,z,Dn).call(this)));m(this,fs,[]);m(this,Bn,0);m(this,bs,-1);m(this,pm,e=>{e.target?.closest?.("[data-lines]")&&a(this,z,cm).call(this,e)});m(this,vs,()=>{r(this,Bn)||!this.stickyHeader||g(this,Bn,requestAnimationFrame(()=>{g(this,Bn,0),a(this,z,Dn).call(this)}))});m(this,ar,new fe);m(this,Fn,e=>{let t=this.renderRoot.querySelector(".tools");t&&!e.composedPath().includes(t)&&a(this,z,hm).call(this,!1)})}connectedCallback(){super.connectedCallback(),this.addEventListener("pointerover",r(this,pm)),om(this),a(this,z,Kg).call(this),r(this,Sc).observe(this,{childList:!0,subtree:!0}),document.addEventListener("scroll",r(this,vs),{capture:!0,passive:!0}),window.addEventListener("resize",r(this,vs),{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,ar).close(),r(this,Sc).disconnect(),r(this,On)?.disconnect(),g(this,fs,[]),document.removeEventListener("scroll",r(this,vs),{capture:!0}),window.removeEventListener("resize",r(this,vs)),document.removeEventListener("pointerdown",r(this,Fn),{capture:!0})}get sortedRows(){let e=[...this.rows??[]],t=this.columns.find(s=>s.key===this.sort);if(!t||this.sortMode==="manual")return e;let i=this.direction==="descending"?-1:1;return e.map((s,l)=>[s,l]).sort(([s,l],[d,p])=>{let u=s[t.key],b=d[t.key],f=u==null||u==="",x=b==null||b==="";return f||x?f===x?l-p:f?1:-1:i*Ty(u,b,t.type,this.locale)||l-p}).map(([s])=>s)}get visibleColumns(){return(this.columns??[]).filter(e=>e.visible!==!1)}updated(e){if(this._picker&&!r(this,ar).active?r(this,ar).open(this.renderRoot.querySelector(".panel"),this.renderRoot.querySelector(".pick"),{align:"end"}):!this._picker&&r(this,ar).active&&r(this,ar).close(),r(this,In)&&(e.has("sort")||e.has("direction"))&&this.sort){g(this,In,!1);let t=this.columns.find(i=>i.key===this.sort);t&&a(this,z,Wg).call(this,t.label,this.direction)}if(e.has("columns")){let t=e.get("columns")??[],i={...this._widths},s=!1;for(let l of this.columns??[]){let d=t.find(p=>p.key===l.key);l.width!==void 0&&d?.width!==l.width&&i[l.key]!==void 0&&(delete i[l.key],s=!0)}s&&(this._widths=i)}a(this,z,Ay).call(this),a(this,z,Dn).call(this)}render(){let e=c`<span class="sr" role="status">${this._announce}</span>`,t=c`<p class="hint" part="scroll-hint" aria-hidden="true">${this.t("scrollHint")}<cm-icon name="chevron-right" size="16"></cm-icon></p>`,i=c`<span class="fade s" aria-hidden="true"></span><span class="fade e" aria-hidden="true"></span>`,s=this.stickyHeader||this.stickyFirstColumn||this._overflows;if(this._light)return c`<div class="frame" part="frame"><div class="wrap"><div class="scroll" part="scroll" tabindex=${this._overflows?"0":h}
2408
2408
  role=${this._overflows?"region":h} aria-label=${this._overflows?this.querySelector("caption")?.textContent?.trim()||h:h}
2409
2409
  @scroll=${()=>a(this,z,Dn).call(this)}><slot></slot></div>${i}</div>${t}</div>${e}`;let l=this.visibleColumns,d=a(this,z,Jg).call(this,l),p=this.mobile==="priority"?l.filter(y=>y.priority==="low"&&y!==d):[],u=this.sortedRows,b=Math.max(1,l.length),f=!this.loading&&u.length===0,x=this.mobile==="cards"&&!this.loading&&u.length>0;return c`
2410
2410
  <div class="frame" part="frame" ?data-cards=${x}>
@@ -2429,7 +2429,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2429
2429
  ${t}
2430
2430
  ${x?a(this,z,jy).call(this,u,l,d):h}
2431
2431
  </div>${e}
2432
- `}};In=new WeakMap,qn=new WeakMap,Sc=new WeakMap,On=new WeakMap,fs=new WeakMap,Bn=new WeakMap,bs=new WeakMap,pm=new WeakMap,z=new WeakSet,Kg=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(w0(),a(this,z,zy).call(this))},Gg=function(e){this._announce=this._announce===e?`${e}\xA0`:e},Wg=function(e,t){a(this,z,Gg).call(this,this.t("sorted",{column:e,direction:this.t(t)}))},zy=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;if(!t)return;let i=[...t];i.forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),a(this,z,Yg).call(this,s),d.addEventListener("click",()=>a(this,z,Sy).call(this,e,s,l))});for(let s of[...e.tBodies,...e.tFoot?[e.tFoot]:[]])for(let l of s.rows)[...l.cells].forEach((d,p)=>{let u=i[p];u&&(d.dataset.label||(d.dataset.label=(u.textContent??"").trim()),u.dataset.priority&&!d.dataset.priority&&(d.dataset.priority=u.dataset.priority),u.dataset.type==="actions"&&!d.dataset.type&&(d.dataset.type="actions"))})},Yg=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Sy=function(e,t,i){let s=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),l=t.dataset.key||s,d=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",p=new CustomEvent("cm-sort",{detail:{key:l,direction:d},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(p)||this.sortMode==="manual")return;let u=t.dataset.sort,b=d==="descending"?-1:1;for(let f of e.tBodies){let x=k=>{let S=k.cells[i];return S?(S.dataset.value??S.textContent??"").trim():""},y=[...f.rows].map((k,S)=>[k,x(k),S]).sort(([,k,S],[,H,O])=>k===""||H===""?k===H?S-O:k===""?1:-1:b*_y(k,H,u,this.locale)||S-O);f.append(...y.map(([k])=>k))}for(let f of e.tHead.rows[0].cells)f.dataset.sort&&(f.setAttribute("aria-sort",f===t?d:"none"),a(this,z,Yg).call(this,f));a(this,z,Wg).call(this,s,d)},Ly=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}),s=this.dispatchEvent(i);g(this,In,s),s&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},Ay=function(){let e=[this.renderRoot.querySelector(".scroll"),this.renderRoot.querySelector("table")??this.querySelector(":scope > table")].filter(Boolean);e.length===r(this,fs).length&&e.every((t,i)=>t===r(this,fs)[i])||(r(this,On)?.disconnect(),e.forEach(t=>r(this,On)?.observe(t)),g(this,fs,e))},vs=new WeakMap,Dn=function(){let e=this.renderRoot?.querySelector(".scroll"),t=this.renderRoot?.querySelector(".frame");if(!e||!t)return;let i=getComputedStyle(e).maxBlockSize!=="none",s=e.scrollWidth>e.clientWidth+1;s!==this._overflows&&(this._overflows=s),e.toggleAttribute("data-open",this.stickyHeader&&!i&&!s);let l=Math.abs(e.scrollLeft);t.toggleAttribute("data-more-start",s&&l>1),t.toggleAttribute("data-more-end",s&&l+e.clientWidth<e.scrollWidth-1);let d=this.renderRoot.querySelector("caption")??this.querySelector(":scope > table > caption"),p=d&&getComputedStyle(d).position!=="absolute"?`${d.offsetHeight}px`:"";e.parentElement.style.getPropertyValue("--_cap")!==p&&e.parentElement.style.setProperty("--_cap",p);let u=0,b=this.renderRoot.querySelector("table")??this.querySelector(":scope > table"),f=b?.tHead;if(this.stickyHeader&&!i&&s&&b&&f){let x=r(this,bs)>0?r(this,bs):0,y=f.getBoundingClientRect().top-x,k=b.getBoundingClientRect().bottom-x,S=0;for(let H=Cy(this);H&&H!==document.documentElement&&H!==document.body;H=Cy(H)){let O=getComputedStyle(H);/(auto|scroll|overlay|hidden|clip)/.test(O.overflowY)&&(S=Math.max(S,H.getBoundingClientRect().top+H.clientTop+(parseFloat(O.paddingTop)||0)))}S+=parseFloat(getComputedStyle(this).getPropertyValue("--cm-data-table-sticky-top"))||0,u=Math.max(0,Math.min(S-y,k-y-f.getBoundingClientRect().height))}for(let x of this.renderRoot.querySelectorAll(".rz")){let y=String(Math.round(x.closest("th").getBoundingClientRect().width));x.getAttribute("aria-valuenow")!==y&&x.setAttribute("aria-valuenow",y)}u!==r(this,bs)&&(g(this,bs,u),u?e.style.setProperty("--_shift",`${u}px`):e.style.removeProperty("--_shift"))},Rn=function(e){return e==null?"":e instanceof Date?he(e,{},this.locale):String(e)},lm=function(e){return this._widths[e.key]??e.width},Hn=function(e,t){return[$0(e)&&"end",zc(e)&&"num",(zc(e)||e.type==="date")&&"nw",e.type==="actions"&&"act",e.priority==="low"&&e!==t&&"low",a(this,z,lm).call(this,e)!==void 0&&"w"].filter(Boolean).join(" ")},Nn=function(e){let t=a(this,z,lm).call(this,e);return t===void 0?h:`--_w: ${t}px`},cm=function(e){let t=e.composedPath()[0]?.closest?.("[data-lines]");if(t&&this.contains(t)){t.scrollWidth>t.clientWidth+1||t.scrollHeight>t.clientHeight+1?t.title=t.textContent?.trim()??"":t.removeAttribute("title");return}let i=e.composedPath()[0]?.closest?.(".t");i&&(i.scrollWidth>i.clientWidth+1||i.scrollHeight>i.clientHeight+1?i.title=i.textContent??"":i.removeAttribute("title"))},Xg=function(e){e.type==="focusin"&&a(this,z,cm).call(this,e);let t=e.composedPath().find(s=>s instanceof HTMLTableRowElement);if(!t)return;let i=e.type==="focusin"||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget);t.toggleAttribute("data-focus",i)},Jg=function(e){return e.find(t=>t.primary)??e.find(t=>t.type!=="actions")??e[0]},Zg=function(e,t){return t?a(this,z,Rn).call(this,e[t.key]):""},Dy=function(e,t){let i=t[e.key];return Array.isArray(i)?i:e.actions??[]},Ry=function(e,t){let i=(this.rows??[]).indexOf(t);this.dispatchEvent(new CustomEvent("cm-row-action",{detail:{action:e.value??e.label,row:t,index:i},bubbles:!0,composed:!0}))},Qg=function(e,t,i){return c`<span class="acts">${a(this,z,Dy).call(this,e,t).map(s=>c`<cm-button size="slim" icon=${s.icon??h}
2432
+ `}};In=new WeakMap,qn=new WeakMap,Sc=new WeakMap,On=new WeakMap,fs=new WeakMap,Bn=new WeakMap,bs=new WeakMap,pm=new WeakMap,z=new WeakSet,Kg=function(){this._light=!!this.querySelector(":scope > table"),this._light&&(w0(),a(this,z,zy).call(this))},Gg=function(e){this._announce=this._announce===e?`${e}\xA0`:e},Wg=function(e,t){a(this,z,Gg).call(this,this.t("sorted",{column:e,direction:this.t(t)}))},zy=function(){let e=this.querySelector(":scope > table"),t=e?.tHead?.rows[0]?.cells;if(!t)return;let i=[...t];i.forEach((s,l)=>{if(!s.dataset.sort||s.querySelector(":scope > button.cm-sort"))return;s.dataset.type=s.dataset.sort;let d=document.createElement("button");d.type="button",d.className="cm-sort",d.append(...s.childNodes);let p=document.createElement("cm-icon");p.setAttribute("size","12"),d.append(p),s.append(d),s.hasAttribute("aria-sort")||s.setAttribute("aria-sort","none"),a(this,z,Yg).call(this,s),d.addEventListener("click",()=>a(this,z,Sy).call(this,e,s,l))});for(let s of[...e.tBodies,...e.tFoot?[e.tFoot]:[]])for(let l of s.rows)[...l.cells].forEach((d,p)=>{let u=i[p];u&&(d.dataset.label||(d.dataset.label=(u.textContent??"").trim()),u.dataset.priority&&!d.dataset.priority&&(d.dataset.priority=u.dataset.priority),u.dataset.type==="actions"&&!d.dataset.type&&(d.dataset.type="actions"))})},Yg=function(e){e.querySelector(":scope > button.cm-sort > cm-icon")?.setAttribute("name",e.getAttribute("aria-sort")==="descending"?"chevron-down":"chevron-up")},Sy=function(e,t,i){let s=(t.querySelector(":scope > button.cm-sort")?.textContent??"").trim(),l=t.dataset.key||s,d=t.getAttribute("aria-sort")==="ascending"?"descending":"ascending",p=new CustomEvent("cm-sort",{detail:{key:l,direction:d},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(p)||this.sortMode==="manual")return;let u=t.dataset.sort,b=d==="descending"?-1:1;for(let f of e.tBodies){let x=k=>{let S=k.cells[i];return S?(S.dataset.value??S.textContent??"").trim():""},y=[...f.rows].map((k,S)=>[k,x(k),S]).sort(([,k,S],[,H,O])=>k===""||H===""?k===H?S-O:k===""?1:-1:b*Ty(k,H,u,this.locale)||S-O);f.append(...y.map(([k])=>k))}for(let f of e.tHead.rows[0].cells)f.dataset.sort&&(f.setAttribute("aria-sort",f===t?d:"none"),a(this,z,Yg).call(this,f));a(this,z,Wg).call(this,s,d)},Ly=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}),s=this.dispatchEvent(i);g(this,In,s),s&&this.sortMode!=="manual"&&(this.sort=e.key,this.direction=t)},Ay=function(){let e=[this.renderRoot.querySelector(".scroll"),this.renderRoot.querySelector("table")??this.querySelector(":scope > table")].filter(Boolean);e.length===r(this,fs).length&&e.every((t,i)=>t===r(this,fs)[i])||(r(this,On)?.disconnect(),e.forEach(t=>r(this,On)?.observe(t)),g(this,fs,e))},vs=new WeakMap,Dn=function(){let e=this.renderRoot?.querySelector(".scroll"),t=this.renderRoot?.querySelector(".frame");if(!e||!t)return;let i=getComputedStyle(e).maxBlockSize!=="none",s=e.scrollWidth>e.clientWidth+1;s!==this._overflows&&(this._overflows=s),e.toggleAttribute("data-open",this.stickyHeader&&!i&&!s);let l=Math.abs(e.scrollLeft);t.toggleAttribute("data-more-start",s&&l>1),t.toggleAttribute("data-more-end",s&&l+e.clientWidth<e.scrollWidth-1);let d=this.renderRoot.querySelector("caption")??this.querySelector(":scope > table > caption"),p=d&&getComputedStyle(d).position!=="absolute"?`${d.offsetHeight}px`:"";e.parentElement.style.getPropertyValue("--_cap")!==p&&e.parentElement.style.setProperty("--_cap",p);let u=0,b=this.renderRoot.querySelector("table")??this.querySelector(":scope > table"),f=b?.tHead;if(this.stickyHeader&&!i&&s&&b&&f){let x=r(this,bs)>0?r(this,bs):0,y=f.getBoundingClientRect().top-x,k=b.getBoundingClientRect().bottom-x,S=0;for(let H=Cy(this);H&&H!==document.documentElement&&H!==document.body;H=Cy(H)){let O=getComputedStyle(H);/(auto|scroll|overlay|hidden|clip)/.test(O.overflowY)&&(S=Math.max(S,H.getBoundingClientRect().top+H.clientTop+(parseFloat(O.paddingTop)||0)))}S+=parseFloat(getComputedStyle(this).getPropertyValue("--cm-data-table-sticky-top"))||0,u=Math.max(0,Math.min(S-y,k-y-f.getBoundingClientRect().height))}for(let x of this.renderRoot.querySelectorAll(".rz")){let y=String(Math.round(x.closest("th").getBoundingClientRect().width));x.getAttribute("aria-valuenow")!==y&&x.setAttribute("aria-valuenow",y)}u!==r(this,bs)&&(g(this,bs,u),u?e.style.setProperty("--_shift",`${u}px`):e.style.removeProperty("--_shift"))},Rn=function(e){return e==null?"":e instanceof Date?he(e,{},this.locale):String(e)},lm=function(e){return this._widths[e.key]??e.width},Hn=function(e,t){return[$0(e)&&"end",zc(e)&&"num",(zc(e)||e.type==="date")&&"nw",e.type==="actions"&&"act",e.priority==="low"&&e!==t&&"low",a(this,z,lm).call(this,e)!==void 0&&"w"].filter(Boolean).join(" ")},Nn=function(e){let t=a(this,z,lm).call(this,e);return t===void 0?h:`--_w: ${t}px`},cm=function(e){let t=e.composedPath()[0]?.closest?.("[data-lines]");if(t&&this.contains(t)){t.scrollWidth>t.clientWidth+1||t.scrollHeight>t.clientHeight+1?t.title=t.textContent?.trim()??"":t.removeAttribute("title");return}let i=e.composedPath()[0]?.closest?.(".t");i&&(i.scrollWidth>i.clientWidth+1||i.scrollHeight>i.clientHeight+1?i.title=i.textContent??"":i.removeAttribute("title"))},Xg=function(e){e.type==="focusin"&&a(this,z,cm).call(this,e);let t=e.composedPath().find(s=>s instanceof HTMLTableRowElement);if(!t)return;let i=e.type==="focusin"||e.relatedTarget instanceof Node&&t.contains(e.relatedTarget);t.toggleAttribute("data-focus",i)},Jg=function(e){return e.find(t=>t.primary)??e.find(t=>t.type!=="actions")??e[0]},Zg=function(e,t){return t?a(this,z,Rn).call(this,e[t.key]):""},Dy=function(e,t){let i=t[e.key];return Array.isArray(i)?i:e.actions??[]},Ry=function(e,t){let i=(this.rows??[]).indexOf(t);this.dispatchEvent(new CustomEvent("cm-row-action",{detail:{action:e.value??e.label,row:t,index:i},bubbles:!0,composed:!0}))},Qg=function(e,t,i){return c`<span class="acts">${a(this,z,Dy).call(this,e,t).map(s=>c`<cm-button size="slim" icon=${s.icon??h}
2433
2433
  ?icon-only=${!!s.iconOnly} label=${s.iconOnly?this.t("rowAction",{action:s.label,name:i}):h} tone=${s.tone??h}
2434
2434
  @click=${()=>a(this,z,Ry).call(this,s,t)}>${s.label}${s.iconOnly||!i?h:c`<span class="sr">, ${i}</span>`}</cm-button>`)}</span>`},ef=function(e,t,i){if(e.type==="actions")return a(this,z,Qg).call(this,e,t,i);let s=a(this,z,Rn).call(this,t[e.key]);if(!k0(e))return s;let l=Math.trunc(Number(e.lines))||0;return l>1?c`<span class="t lines" style="--_lines: ${l}">${s}</span>`:c`<span class="t">${s}</span>`},dm=function(e,t,i){let s=Math.max(wy,Math.round(t));this._widths={...this._widths,[e.key]:s},i&&(a(this,z,Gg).call(this,this.t("resized",{column:e.label,width:s})),this.dispatchEvent(new CustomEvent("cm-column-resize",{detail:{key:e.key,width:s},bubbles:!0,composed:!0})))},Hy=function(e,t){return a(this,z,lm).call(this,e)??Math.round(t.closest("th").getBoundingClientRect().width)},Ny=function(e,t){let i=re(e,this);i!=="ArrowLeft"&&i!=="ArrowRight"||(e.preventDefault(),a(this,z,dm).call(this,t,a(this,z,Hy).call(this,t,e.currentTarget)+(i==="ArrowRight"?$y:-$y),!0))},Py=function(e,t){if(e.button!==0)return;e.preventDefault();let i=e.currentTarget,s=i.closest("th").getBoundingClientRect().width,l=e.clientX,d=getComputedStyle(this).direction==="rtl";try{i.setPointerCapture(e.pointerId)}catch{}i.setAttribute("data-dragging","");let p=s,u=f=>{p=s+(f.clientX-l)*(d?-1:1),a(this,z,dm).call(this,t,p,!1)},b=()=>{i.removeEventListener("pointermove",u),i.removeEventListener("pointerup",b),i.removeEventListener("pointercancel",b),i.removeAttribute("data-dragging"),a(this,z,dm).call(this,t,p,!0)};i.addEventListener("pointermove",u),i.addEventListener("pointerup",b),i.addEventListener("pointercancel",b)},ar=new WeakMap,hm=function(e=!this._picker){this._picker=e,e?document.addEventListener("pointerdown",r(this,Fn),{capture:!0}):document.removeEventListener("pointerdown",r(this,Fn),{capture:!0})},Fn=new WeakMap,Iy=function(e){e.key!=="Escape"||!this._picker||(e.stopPropagation(),a(this,z,hm).call(this,!1),this.renderRoot.querySelector(".pick")?.focus())},qy=function(e,t){let i=this.columns.map(s=>s.key===e?{...s,visible:t}:s);this.columns=i,this.dispatchEvent(new CustomEvent("cm-columns-change",{detail:{key:e,visible:t,columns:i},bubbles:!0,composed:!0}))},Oy=function(){let e=this.columns??[],t=a(this,z,Jg).call(this,this.visibleColumns);return c`<div class="tools" part="tools" @keydown=${a(this,z,Iy)}>
2435
2435
  <button type="button" class="pick" part="column-picker" aria-expanded=${this._picker?"true":"false"} aria-controls="${r(this,qn)}-cols"
@@ -2621,7 +2621,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2621
2621
  .dash { width: 50%; height: 2px; background: currentColor; }
2622
2622
  .check input:focus-visible + .box { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
2623
2623
  .check input:disabled + .box { border-color: var(--cm-border-subtle); background: var(--cm-bg-input-filled); }
2624
- `,um,Kn,Ky,Gy,jn=class extends _{constructor(){super();m(this,Kn);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;this.actions="auto";this._hasActions=!1;m(this,um,this.attachInternals());r(this,um).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 c`
2624
+ `,um,Kn,Ky,Gy,jn=class extends T{constructor(){super();m(this,Kn);this.value="";this.selected=!1;this.disabled=!1;this.href="";this.label="";this.selectable=!1;this.columns=!1;this.actions="auto";this._hasActions=!1;m(this,um,this.attachInternals());r(this,um).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 c`
2625
2625
  ${this.href&&!this.disabled?c`<a href=${this.href} part="link"><span class="sr">${this.name}</span></a>`:h}
2626
2626
  <div class=${this._hasActions?"row has-actions":"row"} part="row" @click=${a(this,Kn,Gy)}>
2627
2627
  ${this.selectable?c`<span class="check" part="checkbox"><input type="checkbox" aria-label=${this.t("select",{name:this.name})} .checked=${this.selected}
@@ -2640,7 +2640,8 @@ cm-data-table:has(> table) { container-type: inline-size; }
2640
2640
  (resource-rows in table-header.ts): change both together. */
2641
2641
  .row {
2642
2642
  display: flex; align-items: center; gap: var(--cm-space-12); box-sizing: border-box;
2643
- min-height: var(--cm-resource-row-height, 56px); padding: var(--cm-resource-row-padding, 8px) var(--cm-space-8);
2643
+ min-height: var(--cm-resource-row-height, 56px);
2644
+ padding: var(--cm-resource-row-padding, 8px) calc(var(--_cm-row-inset, 0px) + var(--cm-space-8));
2644
2645
  font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14);
2645
2646
  }
2646
2647
  @media (pointer: coarse) { .row { min-height: max(var(--cm-resource-row-height, 56px), var(--cm-control-height-touch, 44px)); } }
@@ -2672,7 +2673,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2672
2673
  @media (max-width: 640px) {
2673
2674
  :host(:not([actions='inline']):not([columns])) .row.has-actions { flex-wrap: wrap; }
2674
2675
  :host(:not([actions='inline']):not([columns])) .has-actions .content { flex: 1 1 12rem; }
2675
- .row { gap: var(--cm-space-8); padding-inline: 0; }
2676
+ .row { gap: var(--cm-space-8); padding-inline: var(--_cm-row-inset, 0px); }
2676
2677
  .check { width: 20px; height: 20px; }
2677
2678
  ::slotted([slot='media']) { width: 32px; height: 32px; }
2678
2679
  ::slotted(cm-thumbnail[slot='media']) { --cm-thumbnail-size: 32px; }
@@ -2681,7 +2682,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2681
2682
  :host([columns][mobile='stack']) ::slotted(*) { overflow-wrap: break-word; }
2682
2683
  :host([columns][mobile='stack']) ::slotted(:first-child) { flex: 1 1 100%; }
2683
2684
  }
2684
- `];$("cm-resource-item",jn);var Lc,Ac,ze,Wy,tf,gm,fm,Vn,mm,bm,Un=class extends _{constructor(){super();m(this,ze);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this.mobile="columns";this._count=0;this._rows=0;this._hasHeader=!1;this._hasTable=!1;this._hasActions=!1;m(this,Lc,N("cm-rl"));m(this,Ac,new Set);m(this,gm,e=>{let t=e.target;this._hasHeader=t.assignedElements().length>0,a(this,ze,tf).call(this,t)});m(this,fm,e=>{this._hasActions=e.target.assignedElements().length>0});m(this,bm,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,a(this,ze,Vn).call(this),a(this,ze,mm).call(this))})}connectedCallback(){super.connectedCallback(),om(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),a(this,ze,Vn).call(this),a(this,ze,mm).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,ze,Vn).call(this),a(this,ze,mm).call(this)}clearSelection(){this.selectPage(!1)}updated(e){(e.has("selectable")||e.has("mobile"))&&(a(this,ze,Vn).call(this),a(this,ze,tf).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(k=>!k.disabled).length,s=i>0&&e>=i,l=a(this,ze,Wy).call(this),d=k=>Jd(k,this.locale)==="one"?this.resourceName:l,p=this.total>t,u=h;this.allSelected?u=c`${this.t("allSelected",{count:Math.max(this.total,e),resource:l})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(u=c`${this.t("selected",{count:e,resource:d(e)})}${s&&p?c` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:l})}</button>`:h}`);let b=e>0||this.allSelected,f=this._hasTable,x=!this.hideSelectMenu&&(!f||b),y=c`<slot name="actions" @slotchange=${r(this,fm)}></slot>`;return c`
2685
+ `];$("cm-resource-item",jn);var Lc,Ac,ze,Wy,tf,gm,fm,Vn,mm,bm,Un=class extends T{constructor(){super();m(this,ze);this.selectable=!1;this.total=0;this.resourceNamePlural="";this.loading=!1;this.allSelected=!1;this.hideSelectMenu=!1;this.label="";this.mobile="columns";this._count=0;this._rows=0;this._hasHeader=!1;this._hasTable=!1;this._hasActions=!1;m(this,Lc,N("cm-rl"));m(this,Ac,new Set);m(this,gm,e=>{let t=e.target;this._hasHeader=t.assignedElements().length>0,a(this,ze,tf).call(this,t)});m(this,fm,e=>{this._hasActions=e.target.assignedElements().length>0});m(this,bm,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,a(this,ze,Vn).call(this),a(this,ze,mm).call(this))})}connectedCallback(){super.connectedCallback(),om(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),a(this,ze,Vn).call(this),a(this,ze,mm).call(this)}selectAll(){this.items.forEach(e=>{e.disabled||(e.selected=!0)}),this.allSelected=!0,a(this,ze,Vn).call(this),a(this,ze,mm).call(this)}clearSelection(){this.selectPage(!1)}updated(e){(e.has("selectable")||e.has("mobile"))&&(a(this,ze,Vn).call(this),a(this,ze,tf).call(this))}render(){let e=this._count,t=this._rows,i=this.items.filter(k=>!k.disabled).length,s=i>0&&e>=i,l=a(this,ze,Wy).call(this),d=k=>Jd(k,this.locale)==="one"?this.resourceName:l,p=this.total>t,u=h;this.allSelected?u=c`${this.t("allSelected",{count:Math.max(this.total,e),resource:l})} <button type="button" @click=${()=>this.clearSelection()}>${this.t("clearSelection")}</button>`:e&&(u=c`${this.t("selected",{count:e,resource:d(e)})}${s&&p?c` <button type="button" @click=${()=>this.selectAll()}>${this.t("selectAll",{count:this.total,resource:l})}</button>`:h}`);let b=e>0||this.allSelected,f=this._hasTable,x=!this.hideSelectMenu&&(!f||b),y=c`<slot name="actions" @slotchange=${r(this,fm)}></slot>`;return c`
2685
2686
  ${this.selectable&&f?c`<div class="top ${this._hasActions?"has":""}" part="top-actions">${y}</div>`:h}
2686
2687
  <div class="head ${this.selectable||this._hasHeader?"on":""} ${f?"over":""}">
2687
2688
  <div class="header ${this._hasHeader?"has":""}"><slot name="header" @slotchange=${r(this,gm)}></slot></div>
@@ -2707,11 +2708,11 @@ cm-data-table:has(> table) { container-type: inline-size; }
2707
2708
  </div>
2708
2709
  <div class="empty ${t||this.loading?"":"show"}"><slot name="empty"></slot></div>
2709
2710
  `}};Lc=new WeakMap,Ac=new WeakMap,ze=new WeakSet,Wy=function(){if(this.resourceNamePlural)return this.resourceNamePlural;let e=this.resourceName;return e!==this.t("resourceName")?`${e}s`:this.t("resourceNamePlural")},tf=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(s=>t.add(s));for(let i of r(this,Ac))t.has(i)||(i.removeAttribute("resource-rows"),i.removeAttribute("mobile"));for(let i of t)i.setAttribute("resource-rows",this.selectable?"selectable":"plain"),this.mobile==="stack"?i.setAttribute("mobile","stack"):i.removeAttribute("mobile");g(this,Ac,t),this._hasTable=t.size>0},gm=new WeakMap,fm=new WeakMap,Vn=function(){let e=this.items;e.forEach(t=>{t.selectable=this.selectable,t.mobile=this.mobile==="stack"?"stack":void 0}),this._rows=e.length,this._count=e.filter(t=>t.selected).length},mm=function(){this.dispatchEvent(new CustomEvent("cm-selection-change",{detail:{selected:this.selected,all:this.allSelected},bubbles:!0,composed:!0}))},bm=new WeakMap,Un.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:{},density:{reflect:!0},mobile:{reflect:!0},_count:{state:!0},_rows:{state:!0},_hasHeader:{state:!0},_hasTable:{state:!0},_hasActions:{state:!0}},Un.styles=[E,Uy,w`
2710
- :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); --_pad: var(--cm-space-12); }
2711
+ :host { display: block; position: relative; background: var(--cm-bg-surface); border-radius: var(--cm-radius-md); --_pad: var(--cm-space-12); --_cm-row-inset: var(--_pad); }
2711
2712
  /* Density (since 1.6): the rows are this element's children, so they inherit these. See density.ts. */
2712
2713
  :host([density='compact']) { --cm-resource-row-height: 40px; --cm-resource-row-padding: 4px; --cm-resource-media-size: 32px; }
2713
2714
  :host([density='comfortable']) { --cm-resource-row-height: 56px; --cm-resource-row-padding: 8px; --cm-resource-media-size: 40px; }
2714
- /* The header row. Rows sit --_pad in from the list's edges and pad space-8 inside (0 on phones), so their 16px
2715
+ /* The header row. Rows pad --_pad + space-8 inside (--_pad on phones), so their 16px
2715
2716
  checkbox starts space-20 from the edge (space-12 on phones, 20px box). The header row runs edge to edge and puts
2716
2717
  its box at the same place. The slotted header and the toolbar share one grid cell: the toolbar lies over the
2717
2718
  header's checkbox column, and while rows are selected it covers the column names. */
@@ -2747,7 +2748,9 @@ cm-data-table:has(> table) { container-type: inline-size; }
2747
2748
  .top { display: flex; justify-content: flex-end; gap: var(--cm-space-8); padding: var(--cm-space-8) var(--_pad); }
2748
2749
  .top:not(.has) { display: none; }
2749
2750
  .body { position: relative; }
2750
- .list { padding: 0 var(--_pad) var(--cm-space-8); }
2751
+ /* Rows run edge to edge (1.17.1, owner rule: a hover or selected row is highlighted across the full width). The
2752
+ list's --_pad inset lives in each row's padding instead (--_cm-row-inset), so content stays where it was. */
2753
+ .list { padding: 0 0 var(--cm-space-8); }
2751
2754
  :host([loading]) .list ::slotted(*) { opacity: 0.4; }
2752
2755
  .spinner {
2753
2756
  position: absolute; inset-inline-start: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%;
@@ -2762,7 +2765,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2762
2765
  .toolbar .check { width: 20px; height: 20px; }
2763
2766
  .spinner { width: 32px; height: 32px; margin: -16px; border-width: 3px; }
2764
2767
  }
2765
- `];$("cm-resource-list",Un);var sT=C("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}."}),aT=C("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),ym,de,rf,sf,Yy,Xy,nr,Jy,Zy,Qy,af,ex,St=class St extends _{constructor(){super();m(this,de);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;m(this,ym,this.attachInternals());m(this,nr,!1);r(this,ym).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 s=e.items,l=Math.max(0,Math.min(s.length,t??s.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,s[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:s.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 s=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
2768
+ `];$("cm-resource-list",Un);var s_=C("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}."}),a_=C("nestedList",{show:"Show {heading}",hide:"Hide {heading}"}),ym,de,rf,sf,Yy,Xy,nr,Jy,Zy,Qy,af,ex,St=class St extends T{constructor(){super();m(this,de);this.label="";this.value="";this.sortable=!1;this._hasChildren=!1;m(this,ym,this.attachInternals());m(this,nr,!1);r(this,ym).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 s=e.items,l=Math.max(0,Math.min(s.length,t??s.length)),d={item:this,from:i.items.indexOf(this),to:l,fromList:i,toList:e};return this.dispatchEvent(new CustomEvent("cm-move",{detail:d,bubbles:!0,composed:!0,cancelable:!0}))?(e.insertBefore(this,s[l]??null),e.announce(this.t("movedTo",{label:this.label,list:e.heading,position:l+1,total:s.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 s=new CustomEvent("cm-reorder",{detail:{item:this,from:i,to:e},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s))return!1;let l=t[e];return l.parentElement.insertBefore(this,e>i?l.nextSibling:l),this.closest("cm-nested-list")?.announce(this.t("moved",{label:this.label,position:e+1,total:t.length})),!0}render(){return c`
2766
2769
  <div class="row" part="row" @dragover=${a(this,de,Qy)} @dragleave=${a(this,de,af)} @drop=${a(this,de,ex)}>
2767
2770
  ${this.sortable?c`<button class="handle" type="button" part="handle" draggable="true" aria-label=${this.t("reorder",{label:this.label})}
2768
2771
  aria-describedby="hint"
@@ -2802,7 +2805,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2802
2805
  .actions { gap: var(--cm-space-8); }
2803
2806
  .children { margin-inline-start: var(--cm-space-20); }
2804
2807
  }
2805
- `],St.dragged=null;var Wn=St;$("cm-nested-item",Wn);function vm(o,n,e){return o.filter(t=>{if(t===n)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function Dc(o,n){if((o.list??o).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")),!n)return;let t=(n.list?n.list.items:o.siblings).filter(i=>i!==o);t.length?n.index<t.length?t[n.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):n.list?.classList.add("drop-target")}var ys,Je,tx,nf,of,ix,rx,Gn=class extends _{constructor(){super(...arguments);m(this,Je);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;m(this,ys,N("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"))&&a(this,Je,nf).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
2808
+ `],St.dragged=null;var Wn=St;$("cm-nested-item",Wn);function vm(o,n,e){return o.filter(t=>{if(t===n)return!1;let i=t.getBoundingClientRect();return i.top+i.height/2<e}).length}function Dc(o,n){if((o.list??o).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")),!n)return;let t=(n.list?n.list.items:o.siblings).filter(i=>i!==o);t.length?n.index<t.length?t[n.index].classList.add("drop-before"):t[t.length-1].classList.add("drop-after"):n.list?.classList.add("drop-target")}var ys,Je,tx,nf,of,ix,rx,Gn=class extends T{constructor(){super(...arguments);m(this,Je);this.heading="";this.headingLevel=2;this.sortable=!1;this.collapsible=!1;this.open=!0;this.group="";this._msg="";this._empty=!1;m(this,ys,N("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"))&&a(this,Je,nf).call(this)}render(){let e=Math.min(6,Math.max(1,this.headingLevel||2)),t=!this.collapsible||this.open;return c`
2806
2809
  <div class="bar" part="bar">
2807
2810
  <div class="title" part="heading" role="heading" aria-level=${e} id="${r(this,ys)}-h">${this.heading}</div>
2808
2811
  <span class="actions"><slot name="actions"></slot></span>
@@ -2839,7 +2842,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2839
2842
  .title { font-size: var(--cm-type-heading-sm-size); line-height: var(--cm-type-heading-sm-line-height); }
2840
2843
  .rows { margin-inline-start: var(--cm-space-8); }
2841
2844
  }
2842
- `];$("cm-nested-list",Gn);var sx=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},ax=ea(class extends Li{constructor(o){if(super(o),o.type!==Et.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],s=[],l=0;for(let d of o)i[l]=t?t(d,l):l,s[l]=e(d,l),l++;return{values:s,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=Lb(o),{values:s,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,s;let d=this.ut??=[],p=[],u,b,f=0,x=i.length-1,y=0,k=s.length-1;for(;f<=x&&y<=k;)if(i[f]===null)f++;else if(i[x]===null)x--;else if(d[f]===l[y])p[y]=Ai(i[f],s[y]),f++,y++;else if(d[x]===l[k])p[k]=Ai(i[x],s[k]),x--,k--;else if(d[f]===l[k])p[k]=Ai(i[f],s[k]),ta(o,p[k+1],i[f]),f++,k--;else if(d[x]===l[y])p[y]=Ai(i[x],s[y]),ta(o,i[f],i[x]),x--,y++;else if(u===void 0&&(u=sx(l,y,k),b=sx(d,f,x)),u.has(d[f]))if(u.has(d[x])){let S=b.get(l[y]),H=S!==void 0?i[S]:null;if(H===null){let O=ta(o,i[f]);Ai(O,s[y]),p[y]=O}else p[y]=Ai(H,s[y]),ta(o,i[f],H),i[S]=null;y++}else uh(i[x]),x--;else uh(i[f]),f++;for(;y<=k;){let S=ta(o,p[k+1]);Ai(S,s[y]),p[y++]=S}for(;f<=x;){let S=i[f++];S!==null&&uh(S)}return this.ut=l,mh(o,p),Le}});function nx(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),s=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return s(1);case"ArrowLeft":return s(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var ue,ot,lt,ws=class{constructor(n){m(this,ue);m(this,ot,null);m(this,lt,null);g(this,ue,n)}get active(){return r(this,ot)!==null}get from(){return r(this,ot)&&{...r(this,ot)}}get target(){return r(this,lt)&&{...r(this,lt)}}groupCount(){return r(this,ue).groupCount()}slotCount(n){return n>=0&&n<r(this,ue).groupCount()?r(this,ue).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,ot,{...n}),g(this,lt,{...n}),r(this,ue).onTarget?.(this.target),r(this,ue).announce(r(this,ue).messages.pickedUp(this.target))}moveTo(n){if(!r(this,lt))return;let e=Math.max(0,Math.min(n.group,r(this,ue).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,lt,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,ue).onTarget?.(this.target),r(this,ue).announce(r(this,ue).messages.over(this.target)))}drop(){if(!r(this,ot)||!r(this,lt))return;let n=r(this,ot),e=r(this,lt);g(this,ot,g(this,lt,null)),r(this,ue).onTarget?.(null),r(this,ue).onDrop(n,e)}cancel(n=!1){if(!r(this,ot))return;let e=r(this,ot),t=n?"":r(this,ue).messages.cancelled(e);g(this,ot,g(this,lt,null)),r(this,ue).onTarget?.(null),r(this,ue).onCancel?.(e),t&&r(this,ue).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.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=(r(this,ue).navigate??nx)(e,r(this,lt),this);return t?(this.moveTo(t),!0):!1}};ue=new WeakMap,ot=new WeakMap,lt=new WeakMap;var Rc,xs,$s=class{constructor(n=document,e="assertive"){m(this,Rc);m(this,xs);let t=n.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 r(this,xs)??this.element.textContent??""}announce(n){clearTimeout(r(this,Rc)),this.element.textContent===n?(this.element.textContent="",g(this,xs,n),g(this,Rc,setTimeout(()=>{this.element.textContent=n,g(this,xs,void 0)},50))):(g(this,xs,void 0),this.element.textContent=n)}};Rc=new WeakMap,xs=new WeakMap;var $T=C("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"}),kT=C("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),ET=C("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}."}),M0="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",Hc,km,ox,ks=class extends _{constructor(){super(...arguments);m(this,km);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";m(this,Hc,N("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 c`<div class="card" part="card">
2845
+ `];$("cm-nested-list",Gn);var sx=(o,n,e)=>{let t=new Map;for(let i=n;i<=e;i++)t.set(o[i],i);return t},ax=ea(class extends Li{constructor(o){if(super(o),o.type!==Et.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,n,e){let t;e===void 0?e=n:n!==void 0&&(t=n);let i=[],s=[],l=0;for(let d of o)i[l]=t?t(d,l):l,s[l]=e(d,l),l++;return{values:s,keys:i}}render(o,n,e){return this.dt(o,n,e).values}update(o,[n,e,t]){let i=Lb(o),{values:s,keys:l}=this.dt(n,e,t);if(!Array.isArray(i))return this.ut=l,s;let d=this.ut??=[],p=[],u,b,f=0,x=i.length-1,y=0,k=s.length-1;for(;f<=x&&y<=k;)if(i[f]===null)f++;else if(i[x]===null)x--;else if(d[f]===l[y])p[y]=Ai(i[f],s[y]),f++,y++;else if(d[x]===l[k])p[k]=Ai(i[x],s[k]),x--,k--;else if(d[f]===l[k])p[k]=Ai(i[f],s[k]),ta(o,p[k+1],i[f]),f++,k--;else if(d[x]===l[y])p[y]=Ai(i[x],s[y]),ta(o,i[f],i[x]),x--,y++;else if(u===void 0&&(u=sx(l,y,k),b=sx(d,f,x)),u.has(d[f]))if(u.has(d[x])){let S=b.get(l[y]),H=S!==void 0?i[S]:null;if(H===null){let O=ta(o,i[f]);Ai(O,s[y]),p[y]=O}else p[y]=Ai(H,s[y]),ta(o,i[f],H),i[S]=null;y++}else uh(i[x]),x--;else uh(i[f]),f++;for(;y<=k;){let S=ta(o,p[k+1]);Ai(S,s[y]),p[y++]=S}for(;f<=x;){let S=i[f++];S!==null&&uh(S)}return this.ut=l,mh(o,p),Le}});function nx(o,n,e){let t=l=>e.slotCount(l),i=l=>Math.max(0,t(l)-1),s=l=>{for(let d=n.group+l;d>=0&&d<e.groupCount();d+=l)if(t(d)>0)return{group:d,index:Math.min(n.index,i(d))};return{...n}};switch(o){case"ArrowRight":return s(1);case"ArrowLeft":return s(-1);case"ArrowDown":return{group:n.group,index:Math.min(n.index+1,i(n.group))};case"ArrowUp":return{group:n.group,index:Math.max(n.index-1,0)};case"Home":return{group:n.group,index:0};case"End":return{group:n.group,index:i(n.group)};default:return null}}var ue,ot,lt,ws=class{constructor(n){m(this,ue);m(this,ot,null);m(this,lt,null);g(this,ue,n)}get active(){return r(this,ot)!==null}get from(){return r(this,ot)&&{...r(this,ot)}}get target(){return r(this,lt)&&{...r(this,lt)}}groupCount(){return r(this,ue).groupCount()}slotCount(n){return n>=0&&n<r(this,ue).groupCount()?r(this,ue).slotCount(n):0}pickUp(n){this.active&&this.cancel(),g(this,ot,{...n}),g(this,lt,{...n}),r(this,ue).onTarget?.(this.target),r(this,ue).announce(r(this,ue).messages.pickedUp(this.target))}moveTo(n){if(!r(this,lt))return;let e=Math.max(0,Math.min(n.group,r(this,ue).groupCount()-1)),t=this.slotCount(e);t<=0||(g(this,lt,{group:e,index:Math.max(0,Math.min(n.index,t-1))}),r(this,ue).onTarget?.(this.target),r(this,ue).announce(r(this,ue).messages.over(this.target)))}drop(){if(!r(this,ot)||!r(this,lt))return;let n=r(this,ot),e=r(this,lt);g(this,ot,g(this,lt,null)),r(this,ue).onTarget?.(null),r(this,ue).onDrop(n,e)}cancel(n=!1){if(!r(this,ot))return;let e=r(this,ot),t=n?"":r(this,ue).messages.cancelled(e);g(this,ot,g(this,lt,null)),r(this,ue).onTarget?.(null),r(this,ue).onCancel?.(e),t&&r(this,ue).announce(t)}handleKey(n,e=n.key){if(!this.active||n.altKey||n.ctrlKey||n.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=(r(this,ue).navigate??nx)(e,r(this,lt),this);return t?(this.moveTo(t),!0):!1}};ue=new WeakMap,ot=new WeakMap,lt=new WeakMap;var Rc,xs,$s=class{constructor(n=document,e="assertive"){m(this,Rc);m(this,xs);let t=n.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 r(this,xs)??this.element.textContent??""}announce(n){clearTimeout(r(this,Rc)),this.element.textContent===n?(this.element.textContent="",g(this,xs,n),g(this,Rc,setTimeout(()=>{this.element.textContent=n,g(this,xs,void 0)},50))):(g(this,xs,void 0),this.element.textContent=n)}};Rc=new WeakMap,xs=new WeakMap;var $_=C("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"}),k_=C("boardColumn",{count:{one:"{count} card",other:"{count} cards"},loadMore:"Load more",loading:"Loading {column}",empty:"No cards"}),E_=C("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}."}),M0="input, select, textarea, [contenteditable], cm-action-menu, cm-select, cm-text-field, [data-no-drag]",Hc,km,ox,ks=class extends T{constructor(){super(...arguments);m(this,km);this.value="";this.label="";this.heading="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1;this._badges=!1;this._slottedTitle="";m(this,Hc,N("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 c`<div class="card" part="card">
2843
2846
  ${this.locked?h:c`<div class="handle" part="handle" tabindex="0" role="button" aria-roledescription=${this.t("roleDescription")}
2844
2847
  aria-label=${t?`${this.name}, ${this.t("saving")}`:this.name} aria-describedby="${r(this,Hc)}-help"></div>`}
2845
2848
  <div class="content">
@@ -2878,7 +2881,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2878
2881
  :host([moving]) .content { opacity: 0.5; }
2879
2882
  :host([ghost]) .card { cursor: grabbing; box-shadow: var(--cm-shadow-lg); border-color: var(--cm-border-subtle); }
2880
2883
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
2881
- `];$("cm-board-card",ks);var Jn,Nc,Zn,Qn,lr,xm,lx,Es=class extends _{constructor(){super(...arguments);m(this,lr);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;m(this,Jn,!1);this._cards=[];this._drop=null;m(this,Nc,new MutationObserver(()=>a(this,lr,xm).call(this)));m(this,Zn,N("cm-col"));m(this,Qn,!1)}get collapsed(){return r(this,Jn)}connectedCallback(){super.connectedCallback(),a(this,lr,xm).call(this),r(this,Nc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Nc).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 a(this,lr,xm).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,Jn,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",r(this,Jn)),g(this,Qn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let s=this._cards[Number(i.dataset.i)];s?i.assign(s):i.assign()});let t=i=>[...this.children].filter(s=>s.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),r(this,Qn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Qn,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,s=t?e.filter(y=>y!==t.card):e,l=t?e.indexOf(t.card):-1,d=!!t&&!this.collapsed&&!(l>=0&&t.index===l),p=[];e.forEach((y,k)=>{d&&y!==t.card&&s.indexOf(y)===t.index&&p.push({key:"drop"}),p.push({key:y,card:y,i:k})}),d&&t.index>=s.length&&p.push({key:"drop"});let u=this.hasMore||i>e.length,b=this.loading,f=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),x=this.t("count",{count:i});return c`<section aria-labelledby="${r(this,Zn)}-h" class=${t&&this.collapsed?"over":""}>
2884
+ `];$("cm-board-card",ks);var Jn,Nc,Zn,Qn,lr,xm,lx,Es=class extends T{constructor(){super(...arguments);m(this,lr);this.value="";this.heading="";this.hasMore=!1;this.loading=!1;this.headingLevel=3;m(this,Jn,!1);this._cards=[];this._drop=null;m(this,Nc,new MutationObserver(()=>a(this,lr,xm).call(this)));m(this,Zn,N("cm-col"));m(this,Qn,!1)}get collapsed(){return r(this,Jn)}connectedCallback(){super.connectedCallback(),a(this,lr,xm).call(this),r(this,Nc).observe(this,{childList:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),r(this,Nc).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 a(this,lr,xm).call(this),this.updateComplete}willUpdate(){let e=this.closest("cm-board");g(this,Jn,!!e?.hideEmpty&&!this._cards.length&&!this.loading&&!(this.count>0)),this.toggleAttribute("collapsed",r(this,Jn)),g(this,Qn,this.renderRoot?.activeElement?.localName==="cm-button")}updated(){this.renderRoot.querySelectorAll("li > slot").forEach(i=>{let s=this._cards[Number(i.dataset.i)];s?i.assign(s):i.assign()});let t=i=>[...this.children].filter(s=>s.getAttribute("slot")===i);this.renderRoot.querySelector("slot.actions")?.assign(...t("actions")),this.renderRoot.querySelector("slot.empty")?.assign(...t("empty")),r(this,Qn)&&!this.renderRoot.querySelector(".more cm-button")&&(g(this,Qn,!1),this.renderRoot.querySelector("ul")?.focus())}render(){let e=this._cards,t=this._drop,i=this.count,s=t?e.filter(y=>y!==t.card):e,l=t?e.indexOf(t.card):-1,d=!!t&&!this.collapsed&&!(l>=0&&t.index===l),p=[];e.forEach((y,k)=>{d&&y!==t.card&&s.indexOf(y)===t.index&&p.push({key:"drop"}),p.push({key:y,card:y,i:k})}),d&&t.index>=s.length&&p.push({key:"drop"});let u=this.hasMore||i>e.length,b=this.loading,f=Math.min(6,Math.max(2,Math.round(this.headingLevel)||3)),x=this.t("count",{count:i});return c`<section aria-labelledby="${r(this,Zn)}-h" class=${t&&this.collapsed?"over":""}>
2882
2885
  <header part="header">
2883
2886
  <div class="title" id="${r(this,Zn)}-h" role="heading" aria-level=${f}>${this.heading}<span class="sr">, ${x}</span></div>
2884
2887
  <span class="count" part="count" aria-hidden="true">${this.formatNumber(i)}</span>
@@ -2930,7 +2933,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
2930
2933
  :host([collapsed]) .scroll { padding: 0; overflow: hidden; }
2931
2934
  :host([collapsed]) .actions { display: none; }
2932
2935
  :host([collapsed]) section.over { outline: 2px dashed var(--cm-border-strong); outline-offset: -2px; }
2933
- `];$("cm-board-column",Es);var Be,Re,ve,Ms,le,I,lf,Yn,cx,cf,dx,hx,px,mx,Pc,ux,Ic,df,hf,pf,wm,gx,qc,Oc,Bc,Fc,Vc,jc,Uc,mf,uf,$m,fx,or,Xn=class extends _{constructor(){super();m(this,I);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;m(this,Be,new $s);m(this,Re);m(this,ve,null);m(this,Ms,new WeakMap);m(this,le,null);m(this,Pc,e=>{if(r(this,le)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(r(this,Re).active){r(this,Re).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=a(this,I,mx).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 s=a(this,I,ux).call(this,i,t);s&&(e.preventDefault(),s.focusHandle())}}});m(this,Ic,e=>{if(!r(this,Re).active||!r(this,ve))return;let t=e.relatedTarget;t&&(t===r(this,ve).card||r(this,ve).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{r(this,Re).active&&r(this,ve)&&!r(this,ve).card.matches(":focus-within")&&r(this,Re).cancel()})});m(this,qc,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});m(this,Oc,e=>{if(r(this,le)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(d=>d.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(d=>d instanceof Element&&d!==i&&d.matches?.(M0)))return;let s=a(this,I,Yn).call(this,i);if(!s)return;r(this,Re).active&&r(this,Re).cancel();let l=i.getBoundingClientRect();g(this,le,{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-l.left,dy:e.clientY-l.top,width:l.width,height:l.height,from:s.column,fromIndex:s.index}),e.pointerType!=="mouse"&&(r(this,le).timer=setTimeout(()=>{r(this,le)&&!r(this,le).started&&a(this,I,mf).call(this)},300)),window.addEventListener("pointermove",r(this,Vc),!0),window.addEventListener("pointerup",r(this,jc),!0),window.addEventListener("pointercancel",r(this,Uc),!0),window.addEventListener("touchmove",r(this,Bc),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,Fc),!0)});m(this,Bc,e=>{r(this,le)?.started&&e.cancelable&&e.preventDefault()});m(this,Fc,e=>{r(this,le)&&e.preventDefault()});m(this,Vc,e=>{let t=r(this,le);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"?a(this,I,mf).call(this):a(this,I,or).call(this,!1));return}e.preventDefault(),a(this,I,uf).call(this),a(this,I,$m).call(this)}});m(this,jc,e=>{let t=r(this,le);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,I,or).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,I,or).call(this,!0)});m(this,Uc,e=>{r(this,le)&&e.pointerId===r(this,le).pointerId&&a(this,I,or).call(this,!1)});g(this,Re,new ws({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!r(this,ve)?0:t.cards.filter(i=>i!==r(this,ve).card).length+1},onTarget:e=>a(this,I,dx).call(this,e),onDrop:(e,t)=>a(this,I,px).call(this,e,t),onCancel:()=>a(this,I,cf).call(this),messages:{pickedUp:e=>a(this,I,lf).call(this,"pickedUp",e),over:e=>a(this,I,lf).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:r(this,ve)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>r(this,Be).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(s=>s.key===e);if(i)return i}}get heldCard(){return r(this,ve)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,Pc)),this.addEventListener("focusout",r(this,Ic)),this.addEventListener("pointerdown",r(this,Oc)),this.addEventListener("dragstart",r(this,qc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,Pc)),this.removeEventListener("focusout",r(this,Ic)),this.removeEventListener("pointerdown",r(this,Oc)),this.removeEventListener("dragstart",r(this,qc)),r(this,Re).cancel(!0),a(this,I,or).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(r(this,Be).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return r(this,Be).text}announce(e){r(this,Be).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=a(this,I,Yn).call(this,t);return i?(a(this,I,or).call(this,!1),r(this,Re).cancel(!0),g(this,ve,{card:t,column:i.column,index:i.index}),t.moving=!0,a(this,I,cx).call(this,t),r(this,Re).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=r(this,le);e?.started&&(a(this,I,or).call(this,!1),r(this,Be).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),r(this,Re).cancel()}moveCard(e,t,i){let s=typeof e=="string"?this.card(e):e,l=typeof t=="string"?this.column(t):t;if(!s||!l)return!1;let d=a(this,I,Yn).call(this,s);if(!d)return!1;let p=l.cards.filter(b=>b!==s).length,u=Math.max(0,Math.min(i??p,p));return a(this,I,wm).call(this,s,d.column,d.index,l,u,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Ms).get(t);if(this.controlled||!i||(r(this,Ms).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let s=t.matches(":focus-within");return a(this,I,hf).call(this,t,i.from,i.fromIndex),i.totals&&a(this,I,pf).call(this,i.to,i.from),a(this,I,df).call(this,i.to,i.from,s?t:null),r(this,Be).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return c`<div class="board" role="group" aria-label=${this.label}>
2936
+ `];$("cm-board-column",Es);var Be,Re,ve,Ms,le,I,lf,Yn,cx,cf,dx,hx,px,mx,Pc,ux,Ic,df,hf,pf,wm,gx,qc,Oc,Bc,Fc,Vc,jc,Uc,mf,uf,$m,fx,or,Xn=class extends T{constructor(){super();m(this,I);this.hideEmpty=!1;this.controlled=!1;this.dragging=!1;m(this,Be,new $s);m(this,Re);m(this,ve,null);m(this,Ms,new WeakMap);m(this,le,null);m(this,Pc,e=>{if(r(this,le)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(r(this,Re).active){r(this,Re).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}let i=a(this,I,mx).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 s=a(this,I,ux).call(this,i,t);s&&(e.preventDefault(),s.focusHandle())}}});m(this,Ic,e=>{if(!r(this,Re).active||!r(this,ve))return;let t=e.relatedTarget;t&&(t===r(this,ve).card||r(this,ve).card.contains(t))||!t&&document.hasFocus()===!1||queueMicrotask(()=>{r(this,Re).active&&r(this,ve)&&!r(this,ve).card.matches(":focus-within")&&r(this,Re).cancel()})});m(this,qc,e=>{e.composedPath().some(t=>t.localName==="cm-board-card")&&e.preventDefault()});m(this,Oc,e=>{if(r(this,le)||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath(),i=t.find(d=>d.localName==="cm-board-card");if(!i||i.locked||i.pending||t.some(d=>d instanceof Element&&d!==i&&d.matches?.(M0)))return;let s=a(this,I,Yn).call(this,i);if(!s)return;r(this,Re).active&&r(this,Re).cancel();let l=i.getBoundingClientRect();g(this,le,{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-l.left,dy:e.clientY-l.top,width:l.width,height:l.height,from:s.column,fromIndex:s.index}),e.pointerType!=="mouse"&&(r(this,le).timer=setTimeout(()=>{r(this,le)&&!r(this,le).started&&a(this,I,mf).call(this)},300)),window.addEventListener("pointermove",r(this,Vc),!0),window.addEventListener("pointerup",r(this,jc),!0),window.addEventListener("pointercancel",r(this,Uc),!0),window.addEventListener("touchmove",r(this,Bc),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,Fc),!0)});m(this,Bc,e=>{r(this,le)?.started&&e.cancelable&&e.preventDefault()});m(this,Fc,e=>{r(this,le)&&e.preventDefault()});m(this,Vc,e=>{let t=r(this,le);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"?a(this,I,mf).call(this):a(this,I,or).call(this,!1));return}e.preventDefault(),a(this,I,uf).call(this),a(this,I,$m).call(this)}});m(this,jc,e=>{let t=r(this,le);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,I,or).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,I,or).call(this,!0)});m(this,Uc,e=>{r(this,le)&&e.pointerId===r(this,le).pointerId&&a(this,I,or).call(this,!1)});g(this,Re,new ws({groupCount:()=>this.columns.length,slotCount:e=>{let t=this.columns[e];return!t||!r(this,ve)?0:t.cards.filter(i=>i!==r(this,ve).card).length+1},onTarget:e=>a(this,I,dx).call(this,e),onDrop:(e,t)=>a(this,I,px).call(this,e,t),onCancel:()=>a(this,I,cf).call(this),messages:{pickedUp:e=>a(this,I,lf).call(this,"pickedUp",e),over:e=>a(this,I,lf).call(this,"over",e),cancelled:e=>this.t("cancelled",{card:r(this,ve)?.card.name??"",column:this.columns[e.group]?.heading??""})},announce:e=>r(this,Be).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(s=>s.key===e);if(i)return i}}get heldCard(){return r(this,ve)?.card??null}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,Pc)),this.addEventListener("focusout",r(this,Ic)),this.addEventListener("pointerdown",r(this,Oc)),this.addEventListener("dragstart",r(this,qc))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,Pc)),this.removeEventListener("focusout",r(this,Ic)),this.removeEventListener("pointerdown",r(this,Oc)),this.removeEventListener("dragstart",r(this,qc)),r(this,Re).cancel(!0),a(this,I,or).call(this,!1)}firstUpdated(){this.renderRoot.appendChild(r(this,Be).element)}updated(e){e.has("hideEmpty")&&this.columns.forEach(t=>t.requestUpdate())}get announcement(){return r(this,Be).text}announce(e){r(this,Be).announce(e)}pickUp(e){let t=typeof e=="string"?this.card(e):e;if(!t||t.locked||t.pending)return!1;let i=a(this,I,Yn).call(this,t);return i?(a(this,I,or).call(this,!1),r(this,Re).cancel(!0),g(this,ve,{card:t,column:i.column,index:i.index}),t.moving=!0,a(this,I,cx).call(this,t),r(this,Re).pickUp({group:i.group,index:i.index}),!0):!1}cancelMove(){let e=r(this,le);e?.started&&(a(this,I,or).call(this,!1),r(this,Be).announce(this.t("cancelled",{card:e.card.name,column:e.from.heading}))),r(this,Re).cancel()}moveCard(e,t,i){let s=typeof e=="string"?this.card(e):e,l=typeof t=="string"?this.column(t):t;if(!s||!l)return!1;let d=a(this,I,Yn).call(this,s);if(!d)return!1;let p=l.cards.filter(b=>b!==s).length,u=Math.max(0,Math.min(i??p,p));return a(this,I,wm).call(this,s,d.column,d.index,l,u,"api")}revert(e){let t=typeof e=="string"?this.card(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Ms).get(t);if(this.controlled||!i||(r(this,Ms).delete(t),!i.from.isConnected||!this.contains(i.from)))return!1;let s=t.matches(":focus-within");return a(this,I,hf).call(this,t,i.from,i.fromIndex),i.totals&&a(this,I,pf).call(this,i.to,i.from),a(this,I,df).call(this,i.to,i.from,s?t:null),r(this,Be).announce(this.t("reverted",{card:t.name,column:i.from.heading})),!0}render(){return c`<div class="board" role="group" aria-label=${this.label}>
2934
2937
  <div class="columns" part="columns"><slot @slotchange=${()=>this.requestUpdate()}></slot></div>
2935
2938
  </div>`}};Be=new WeakMap,Re=new WeakMap,ve=new WeakMap,Ms=new WeakMap,le=new WeakMap,I=new WeakSet,lf=function(e,t){let i=this.columns[t.group];return this.t(e,{card:r(this,ve)?.card.name??"",column:i?.heading??"",position:t.index+1,count:r(this,Re).slotCount(t.group)})},Yn=function(e){let t=this.columns,i=t.findIndex(s=>s.contains(e)&&e.parentElement===s);return i<0?null:{column:t[i],group:i,index:t[i].cards.indexOf(e)}},cx=function(e){let t=()=>!!e.shadowRoot?.activeElement?.classList.contains("handle");e.focusHandle({preventScroll:!0}),requestAnimationFrame(()=>{r(this,ve)?.card===e&&!t()&&e.focusHandle({preventScroll:!0})})},cf=function(){r(this,ve)&&(r(this,ve).card.moving=!1),g(this,ve,null)},dx=function(e){let t=r(this,ve);if(this.columns.forEach((i,s)=>{i._drop=t&&e&&s===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 s=i.renderRoot.querySelector("li.drop")??(t&&t.column===i?t.card:i);a(this,I,hx).call(this,i,s)})}},hx=function(e,t){let i=this.renderRoot.querySelector(".columns");if(i){let l=i.getBoundingClientRect(),d=e.getBoundingClientRect();d.left<l.left?i.scrollLeft-=l.left-d.left+8:d.right>l.right&&(i.scrollLeft+=d.right-l.right+8)}let s=e.scrollElement;if(s){let l=s.getBoundingClientRect(),d=t.getBoundingClientRect();d.top<l.top?s.scrollTop-=l.top-d.top+8:d.bottom>l.bottom&&(s.scrollTop+=d.bottom-l.bottom+8)}},px=function(e,t){let i=r(this,ve);if(a(this,I,cf).call(this),!i)return;let s=this.columns[t.group];a(this,I,wm).call(this,i.card,i.column,e.index,s,t.index,"keyboard")},mx=function(e){let t=e[0];if(!(t instanceof HTMLElement)||!t.classList?.contains("handle"))return null;let i=e.find(s=>s.localName==="cm-board-card");return i&&a(this,I,Yn).call(this,i)?i:null},Pc=new WeakMap,ux=function(e,t){let i=a(this,I,Yn).call(this,e);if(!i)return null;let s=i.column.cards;if(t==="ArrowDown")return s[i.index+1]??null;if(t==="ArrowUp")return s[i.index-1]??null;let l=t==="ArrowRight"?1:-1,d=this.columns;for(let p=i.group+l;p>=0&&p<d.length;p+=l){let u=d[p].cards;if(u.length)return u[Math.min(i.index,u.length-1)]}return null},Ic=new WeakMap,df=function(e,t,i){e._sync(),t._sync().then(()=>{i?.isConnected&&i.focusHandle({preventScroll:!0})})},hf=function(e,t,i){let s=t.cards.filter(d=>d!==e),l=s[i];l?l.before(e):s.length?s[s.length-1].after(e):t.append(e)},pf=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))},wm=function(e,t,i,s,l,d){let p=e.name;if(t===s&&i===l)return d!=="api"&&r(this,Be).announce(this.t("sameSpot",{card:p})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let u=[],b={value:e.key,card:e,from:t.key,to:s.key,fromColumn:t,toColumn:s,fromIndex:i,toIndex:l,source:d,waitUntil:y=>{u.push(Promise.resolve(y))}};if(!this.dispatchEvent(new CustomEvent("cm-move",{detail:b,bubbles:!0,composed:!0,cancelable:!0})))return r(this,Be).announce(this.t("refused",{card:p,column:s.heading})),d==="keyboard"&&e.focusHandle({preventScroll:!0}),!1;let x=s.cards.filter(y=>y!==e).length+1;if(this.controlled)d==="keyboard"&&a(this,I,gx).call(this,e.key,s);else{let y=d==="keyboard"||e.matches(":focus-within");a(this,I,hf).call(this,e,s,l);let k=t!==s;k&&a(this,I,pf).call(this,t,s),r(this,Ms).set(e,{card:e,from:t,fromIndex:i,to:s,toIndex:l,totals:k}),a(this,I,df).call(this,t,s,y?e:null)}return r(this,Be).announce(this.t("moved",{card:p,column:s.heading,position:l+1,count:x})),u.length&&(e.pending=!0,Promise.all(u).then(()=>{e.pending=!1,this.controlled||r(this,Ms).delete(e)},()=>{e.pending=!1,this.controlled?r(this,Be).announce(this.t("reverted",{card:p,column:t.heading})):this.revert(e)})),!0},gx=function(e,t){let i=()=>t.isConnected?t.cards.find(d=>d.key===e):void 0,s=()=>{let d=i(),p=!document.activeElement||document.activeElement===document.body||!document.activeElement.isConnected;return!d||!(p||this.contains(document.activeElement))?!1:(t._sync().then(()=>d.updateComplete).then(()=>{d.isConnected&&d.focusHandle({preventScroll:!0})}),!0)},l=new MutationObserver(()=>{s()&&l.disconnect()});l.observe(this,{childList:!0,subtree:!0}),setTimeout(()=>l.disconnect(),1e3)},qc=new WeakMap,Oc=new WeakMap,Bc=new WeakMap,Fc=new WeakMap,Vc=new WeakMap,jc=new WeakMap,Uc=new WeakMap,mf=function(){let e=r(this,le);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,r(this,Be).announce(this.t("pickedUp",{card:e.card.name,column:e.from.heading,position:e.fromIndex+1,count:e.from.cards.length})),a(this,I,uf).call(this),a(this,I,$m).call(this);let i=()=>{r(this,le)?.started&&(a(this,I,fx).call(this),r(this,le).raf=requestAnimationFrame(i))};e.raf=requestAnimationFrame(i)},uf=function(){let e=r(this,le);e?.ghost&&(e.ghost.style.transform=`translate(${e.x-e.dx}px, ${e.y-e.dy}px)`)},$m=function(){let e=r(this,le);if(!e)return;let t=this.columns;if(!t.length)return;let i=t[0],s=1/0;for(let u of t){let b=u.getBoundingClientRect(),f=e.x<b.left?b.left-e.x:e.x>b.right?e.x-b.right:0;f<s&&(i=u,s=f)}let l=i.cards.filter(u=>u!==e.card),d=l.length;if(i.collapsed)d=0;else for(let u=0;u<l.length;u++){let b=l[u].getBoundingClientRect();if(e.y<b.top+b.height/2){d=u;break}}if(i===e.to&&d===e.toIndex)return;let p=i!==e.to;e.to=i,e.toIndex=d,t.forEach(u=>{u._drop=u===i?{card:e.card,index:d,height:e.height}:null}),p&&r(this,Be).announce(this.t("over",{column:i.heading,position:d+1,count:l.length+1}))},fx=function(){let e=r(this,le);if(!e)return;let t=48,i=16,s=x=>x<t?Math.ceil((t-Math.max(x,0))/t*i):0,l=!1,d=this.renderRoot.querySelector(".columns");if(d){let x=d.getBoundingClientRect(),y=s(e.x-x.left),k=s(x.right-e.x),S=d.scrollLeft;y?d.scrollLeft-=y:k&&(d.scrollLeft+=k),l||=d.scrollLeft!==S}let p=e.to?.scrollElement;if(p&&p.scrollHeight>p.clientHeight){let x=p.getBoundingClientRect();if(e.x>=x.left&&e.x<=x.right){let y=s(e.y-x.top),k=s(x.bottom-e.y),S=p.scrollTop;y?p.scrollTop-=y:k&&(p.scrollTop+=k),l||=p.scrollTop!==S}}let u=window.innerHeight,b=s(e.y),f=s(u-e.y);if(b||f){let x=window.scrollY;window.scrollBy(0,b?-b:f),l||=window.scrollY!==x}l&&a(this,I,$m).call(this)},or=function(e){let t=r(this,le);t&&(g(this,le,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,Vc),!0),window.removeEventListener("pointerup",r(this,jc),!0),window.removeEventListener("pointercancel",r(this,Uc),!0),window.removeEventListener("touchmove",r(this,Bc),!0),window.removeEventListener("contextmenu",r(this,Fc),!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&&a(this,I,wm).call(this,t.card,t.from,t.fromIndex,t.to,t.toIndex,"pointer")))},Xn.properties={label:{string:"label"},hideEmpty:{type:Boolean,attribute:"hide-empty",reflect:!0},controlled:{type:Boolean,reflect:!0},dragging:{type:Boolean,reflect:!0}},Xn.styles=[E,w`
2936
2939
  :host { position: relative; display: block; container-type: inline-size; container-name: cm-board; min-width: 0; }
@@ -2946,18 +2949,18 @@ cm-data-table:has(> table) { container-type: inline-size; }
2946
2949
  ::slotted(cm-board-column) { inline-size: calc(100% - 40px); scroll-snap-align: start; }
2947
2950
  ::slotted(cm-board-column[collapsed]) { inline-size: 48px; }
2948
2951
  }
2949
- `];$("cm-board",Xn);var AT=C("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),io=class extends L{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};io.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},io.styles=w`:host { display: none !important; }`;$("cm-calendar-event",io);var Sm=o=>String(o).padStart(2,"0"),bx=o=>`${B(o)}T${Sm(o.getHours())}:${Sm(o.getMinutes())}`,Em=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),vx=["month","week","day"],T0=600,yx=new Map,xx=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=yx.get(e);return t||(t=new Intl.DateTimeFormat(o,n),yx.set(e,t)),t},gf=o=>o.replace(/[  ]/g," ").trim(),so,Fe,Ve,Se,se,ae,_s,Ut,dt,ed,hr,ao,no,oo,lo,td,v,He,cr,Kc,Mm,jt,ff,Gc,Lt,bf,wx,At,eo,$x,kx,ct,Wc,Yc,Tm,Ex,Mx,Tx,Ts,vf,Xc,_x,Jc,Cx,zx,Sx,Lx,id,rd,Ax,Dx,sd,Zc,Rx,yf,xf,wf,Hx,Nx,$f,kf,Ef,ad,Mf,Px,nd,od,ld,cd,dd,hd,Tf,_m,Ix,dr,Qc,qx,_f,Ox,Cm,Cf,to,zm,Bx,Fx,Vx,jx,Ux,ro=class extends _{constructor(){super();m(this,v);this.view="month";this.date="";this.today="";this.step=15;m(this,so,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;m(this,Fe,N("cm-cal"));m(this,Ve,new $s);m(this,Se);m(this,se,null);m(this,ae,null);m(this,_s,new WeakMap);m(this,Ut,"");m(this,dt,null);m(this,ed,"");m(this,hr,!0);m(this,ao,0);m(this,no,!1);m(this,oo);m(this,lo,0);m(this,td,new MutationObserver(()=>this.requestUpdate()));m(this,id,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Ut,t.dataset.k);for(let i of a(this,v,Jc).call(this))i.tabIndex=i===t?0:-1}});m(this,rd,e=>{let t=e.relatedTarget;if(this._more&&!r(this,se)){let i=this.renderRoot.querySelector(".pop"),s=e.composedPath()[0];i&&i.contains(s)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,Se).active||!r(this,se)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,Se).active||!r(this,se))return;this.renderRoot.activeElement?.dataset.ev!==r(this,se).ev.key&&r(this,Se).cancel()}))});m(this,sd,e=>{if(r(this,ae)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(r(this,Se).active){r(this,Se).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let s=i.closest(".pop");if(s&&e.key==="Escape"){e.preventDefault(),a(this,v,Cm).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,ao,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(s&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...s.querySelectorAll(".chip")],p=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];p&&(e.preventDefault(),p.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),a(this,v,Dx).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,v,Ax).call(this,i,t);l?(e.preventDefault(),a(this,v,Lx).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});m(this,ad,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});m(this,nd,e=>{if(r(this,ae)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(p=>p.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),s=i&&a(this,v,eo).call(this,i);if(!s||i.locked||i.pending)return;let l=a(this,v,xf).call(this,s,t.dataset.day??s.days[0]);if(!l)return;r(this,Se).active&&r(this,Se).cancel();let d=0;if(l.mode==="time"){let p=a(this,v,Mf).call(this,e.clientX,e.clientY);p&&t.classList.contains("time")&&(d=Math.max(0,Math.min(s.dur,p.min-s.min)))}g(this,ae,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,ae).timer=setTimeout(()=>{r(this,ae)&&!r(this,ae).started&&a(this,v,Tf).call(this)},300)),window.addEventListener("pointermove",r(this,cd),!0),window.addEventListener("pointerup",r(this,dd),!0),window.addEventListener("pointercancel",r(this,hd),!0),window.addEventListener("touchmove",r(this,od),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,ld),!0)});m(this,od,e=>{r(this,ae)?.started&&e.cancelable&&e.preventDefault()});m(this,ld,e=>{r(this,ae)&&e.preventDefault()});m(this,cd,e=>{let t=r(this,ae);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"?a(this,v,Tf).call(this):a(this,v,dr).call(this,!1));return}e.preventDefault(),a(this,v,_m).call(this)}});m(this,dd,e=>{let t=r(this,ae);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,v,dr).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,v,dr).call(this,!0)});m(this,hd,e=>{r(this,ae)&&e.pointerId===r(this,ae).pointerId&&a(this,v,dr).call(this,!1)});g(this,Se,new ws({groupCount:()=>a(this,v,At).call(this).length,slotCount:()=>r(this,se)?r(this,se).mode==="day"?1:a(this,v,Zc).call(this,r(this,se).ev.dur):0,navigate:(e,t)=>a(this,v,Rx).call(this,e,t),onTarget:e=>a(this,v,Hx).call(this,e),onDrop:(e,t)=>a(this,v,Nx).call(this,e,t),onCancel:()=>a(this,v,wf).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,se)?.ev.name??"",place:a(this,v,Ts).call(this,r(this,se),e)}),over:e=>this.t("over",{place:a(this,v,Ts).call(this,r(this,se),e)}),cancelled:e=>this.t("cancelled",{event:r(this,se)?.ev.name??"",place:a(this,v,Ts).call(this,r(this,se),e)})},announce:e=>r(this,Ve).announce(e)}))}get locale(){return r(this,so)}set locale(e){let t=r(this,so);g(this,so,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=a(this,v,At).call(this);return{view:r(this,v,He),start:B(e[0]),end:B(e[e.length-1])}}get heldEvent(){return r(this,se)?.ev.el??null}get announcement(){return r(this,Ve).text}announce(e){r(this,Ve).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,sd)),this.addEventListener("focusin",r(this,id)),this.addEventListener("focusout",r(this,rd)),this.addEventListener("pointerdown",r(this,nd)),this.addEventListener("dragstart",r(this,ad)),r(this,td).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,oo,new ResizeObserver(()=>{cancelAnimationFrame(r(this,lo)),g(this,lo,requestAnimationFrame(()=>a(this,v,vf).call(this)))})),r(this,oo).observe(this)),a(this,v,vf).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,sd)),this.removeEventListener("focusin",r(this,id)),this.removeEventListener("focusout",r(this,rd)),this.removeEventListener("pointerdown",r(this,nd)),this.removeEventListener("dragstart",r(this,ad)),r(this,td).disconnect(),r(this,oo)?.disconnect(),cancelAnimationFrame(r(this,lo)),r(this,Se).cancel(!0),a(this,v,dr).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,hr,!0),e.get("view")!==void 0&&(this._more="",r(this,Se).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Ve).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,hr,!0),a(this,v,Sx).call(this),r(this,dt)){let l=a(this,v,Cx).call(this,r(this,dt).key);l?(g(this,dt,null),l.focus({preventScroll:!1})):Date.now()>r(this,dt).until&&g(this,dt,null)}r(this,no)&&(g(this,no,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,hr)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,hr,!1)}t||g(this,hr,!0),r(this,se)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,s=`${i.view}|${i.start}|${i.end}`;s!==r(this,ed)&&(g(this,ed,s),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),-1))}next(){this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),1))}goToToday(){this.date=r(this,v,Gc)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let s=a(this,v,eo).call(this,i);if(!s)return!1;let l=a(this,v,At).call(this).map(B),d=t&&s.days.includes(t)&&l.includes(t)?t:s.days.find(b=>l.includes(b));if(!d)return!1;let p=a(this,v,xf).call(this,s,d);if(!p)return!1;a(this,v,dr).call(this,!1),r(this,Se).cancel(!0),this._more="",g(this,se,p),i.moving=!0;let u=`ev:${s.key}:${d}`;return g(this,Ut,u),g(this,dt,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,Se).pickUp(p.from),!0}cancelMove(){let e=r(this,ae);e?.started&&(a(this,v,dr).call(this,!1),r(this,Ve).announce(this.t("cancelled",{event:e.ev.name,place:a(this,v,Ts).call(this,e,e.from)}))),r(this,Se).cancel()}moveEvent(e,t,i){let s=typeof e=="string"?this.event(e):e,l=s&&a(this,v,eo).call(this,s);if(!l)return!1;let d=l.allDay?P(ut(t).date||t):It(t);if(!d)return!1;let p=i?l.allDay?P(ut(i).date||i):It(i):null;return(!p||p<d)&&(p=l.allDay?Z(d,Em(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,v,Ef).call(this,l,d,p,"api",!1,B(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,_s).get(t);if(this.controlled||!i)return!1;r(this,_s).delete(t);let s=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=a(this,v,eo).call(this,t);return l&&s&&g(this,dt,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Ve).announce(this.t("reverted",{event:t.name,place:l?a(this,v,Tm).call(this,l):i.start})),!0}render(){let e=a(this,v,At).call(this),t=a(this,v,kx).call(this,a(this,v,$x).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
2952
+ `];$("cm-board",Xn);var A_=C("calendar",{label:"Calendar",previousMonth:"Previous month",nextMonth:"Next month",previousWeek:"Previous week",nextWeek:"Next week",previousDays:"Previous {count} days",nextDays:"Next {count} days",previousDay:"Previous day",nextDay:"Next day",today:"Today",views:"View",month:"Month",week:"Week",day:"Day",allDay:"All day",time:"Time",add:"Add",addOn:"Add on {date}",addAllDay:"Add an all-day event on {date}",addAt:"Add at {time}, {date}",more:"+{count} more",moreLabel:"{count} more on {date}",dayEvents:{one:"{date}, {count} event",other:"{date}, {count} events"},noEvents:"No events",loading:"Loading events",timeRange:"{start} to {end}",timed:"{date}, {time}",allDayOn:"{date}, all day",allDayRange:"{start} to {end}, all day",eventName:"{title}, {when}",eventNameKind:"{title}, {when}, {kind}",roleDescription:"movable event",openHint:"Press Enter to open.",instructions:"Press Space to pick up, then the arrow keys to choose a day or time, Space or Enter to drop and Escape to cancel.",gridHelp:"Use the arrow keys to move between days, times and events, and Page Up and Page Down for the previous or next period.",saving:"Saving",pickedUp:"Picked up {event}. {place}.",over:"{place}.",moved:"Moved {event} to {place}.",sameSpot:"{event} dropped where it started.",cancelled:"Move cancelled. {event} is back on {place}.",refused:"{event} can't be moved to {place}.",reverted:"Couldn't move {event}. It is back on {place}."}),io=class extends L{constructor(){super(...arguments);this.value="";this.heading="";this.label="";this.start="";this.end="";this.allDay=!1;this.kind="";this.tone="neutral";this.icon="";this.href="";this.locked=!1;this.pending=!1;this.moving=!1}get name(){return this.label||this.heading||(this.textContent??"").replace(/\s+/g," ").trim()}get key(){return this.value||this.name}updated(){let e=this.parentElement;e?.localName==="cm-calendar"&&e.requestUpdate()}render(){return h}};io.properties={value:{reflect:!0},heading:{},label:{},start:{},end:{},allDay:{type:Boolean,attribute:"all-day",reflect:!0},kind:{},tone:{reflect:!0},icon:{},href:{},locked:{type:Boolean,reflect:!0},pending:{type:Boolean,reflect:!0},moving:{type:Boolean,reflect:!0}},io.styles=w`:host { display: none !important; }`;$("cm-calendar-event",io);var Sm=o=>String(o).padStart(2,"0"),bx=o=>`${B(o)}T${Sm(o.getHours())}:${Sm(o.getMinutes())}`,Em=(o,n)=>Math.round((Date.UTC(n.getFullYear(),n.getMonth(),n.getDate())-Date.UTC(o.getFullYear(),o.getMonth(),o.getDate()))/864e5),vx=["month","week","day"],_0=600,yx=new Map,xx=(o,n)=>{let e=`${o}|${JSON.stringify(n)}`,t=yx.get(e);return t||(t=new Intl.DateTimeFormat(o,n),yx.set(e,t)),t},gf=o=>o.replace(/[  ]/g," ").trim(),so,Fe,Ve,Se,se,ae,Ts,Ut,dt,ed,hr,ao,no,oo,lo,td,v,He,cr,Kc,Mm,jt,ff,Gc,Lt,bf,wx,At,eo,$x,kx,ct,Wc,Yc,_m,Ex,Mx,_x,_s,vf,Xc,Tx,Jc,Cx,zx,Sx,Lx,id,rd,Ax,Dx,sd,Zc,Rx,yf,xf,wf,Hx,Nx,$f,kf,Ef,ad,Mf,Px,nd,od,ld,cd,dd,hd,_f,Tm,Ix,dr,Qc,qx,Tf,Ox,Cm,Cf,to,zm,Bx,Fx,Vx,jx,Ux,ro=class extends T{constructor(){super();m(this,v);this.view="month";this.date="";this.today="";this.step=15;m(this,so,"");this.hourCycle="";this.dayStart=8;this.maxEvents=3;this.headingLevel=2;this.loading=!1;this.readonly=!1;this.controlled=!1;this.dragging=!1;this._narrow=!1;this._more="";this._target=null;m(this,Fe,N("cm-cal"));m(this,Ve,new $s);m(this,Se);m(this,se,null);m(this,ae,null);m(this,Ts,new WeakMap);m(this,Ut,"");m(this,dt,null);m(this,ed,"");m(this,hr,!0);m(this,ao,0);m(this,no,!1);m(this,oo);m(this,lo,0);m(this,td,new MutationObserver(()=>this.requestUpdate()));m(this,id,e=>{let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.classList.contains("item")&&t.dataset.k){g(this,Ut,t.dataset.k);for(let i of a(this,v,Jc).call(this))i.tabIndex=i===t?0:-1}});m(this,rd,e=>{let t=e.relatedTarget;if(this._more&&!r(this,se)){let i=this.renderRoot.querySelector(".pop"),s=e.composedPath()[0];i&&i.contains(s)&&!(t&&i.contains(t))&&queueMicrotask(()=>{i.contains(this.renderRoot.activeElement)||(this._more="")})}!r(this,Se).active||!r(this,se)||!t&&document.hasFocus()===!1||this.updateComplete.then(()=>setTimeout(()=>{if(!r(this,Se).active||!r(this,se))return;this.renderRoot.activeElement?.dataset.ev!==r(this,se).ev.key&&r(this,Se).cancel()}))});m(this,sd,e=>{if(r(this,ae)?.started&&e.key==="Escape"){e.preventDefault(),this.cancelMove();return}let t=re(e,this);if(r(this,Se).active){r(this,Se).handleKey(e,t)&&(e.preventDefault(),e.stopPropagation());return}if(e.altKey||e.ctrlKey||e.metaKey)return;let i=e.composedPath()[0];if(!(i instanceof HTMLElement)||i.getRootNode()!==this.renderRoot)return;let s=i.closest(".pop");if(s&&e.key==="Escape"){e.preventDefault(),a(this,v,Cm).call(this,!0);return}if(i.dataset.ev&&e.key===" "){e.preventDefault(),g(this,ao,performance.now()+400),this.pickUp(i.dataset.ev,i.dataset.day);return}if(s&&(t==="ArrowDown"||t==="ArrowUp")){let d=[...s.querySelectorAll(".chip")],p=d[d.indexOf(i)+(t==="ArrowDown"?1:-1)];p&&(e.preventDefault(),p.focus());return}if(!i.classList.contains("item"))return;if(e.key==="PageUp"||e.key==="PageDown"){e.preventDefault(),a(this,v,Dx).call(this,i,e.key==="PageUp"?-1:1);return}let l=a(this,v,Ax).call(this,i,t);l?(e.preventDefault(),a(this,v,Lx).call(this,l)):(t.startsWith("Arrow")||t==="Home"||t==="End")&&e.preventDefault()});m(this,ad,e=>{e.composedPath().some(t=>t.dataset?.ev)&&e.preventDefault()});m(this,nd,e=>{if(r(this,ae)||this.readonly||!e.isPrimary||e.pointerType==="mouse"&&e.button!==0)return;let t=e.composedPath().find(p=>p.dataset?.ev);if(!t)return;let i=this.event(t.dataset.ev),s=i&&a(this,v,eo).call(this,i);if(!s||i.locked||i.pending)return;let l=a(this,v,xf).call(this,s,t.dataset.day??s.days[0]);if(!l)return;r(this,Se).active&&r(this,Se).cancel();let d=0;if(l.mode==="time"){let p=a(this,v,Mf).call(this,e.clientX,e.clientY);p&&t.classList.contains("time")&&(d=Math.max(0,Math.min(s.dur,p.min-s.min)))}g(this,ae,{...l,pointerId:e.pointerId,type:e.pointerType,x0:e.clientX,y0:e.clientY,x:e.clientX,y:e.clientY,started:!1,grab:d,to:{...l.from}}),e.pointerType!=="mouse"&&(r(this,ae).timer=setTimeout(()=>{r(this,ae)&&!r(this,ae).started&&a(this,v,_f).call(this)},300)),window.addEventListener("pointermove",r(this,cd),!0),window.addEventListener("pointerup",r(this,dd),!0),window.addEventListener("pointercancel",r(this,hd),!0),window.addEventListener("touchmove",r(this,od),{capture:!0,passive:!1}),window.addEventListener("contextmenu",r(this,ld),!0)});m(this,od,e=>{r(this,ae)?.started&&e.cancelable&&e.preventDefault()});m(this,ld,e=>{r(this,ae)&&e.preventDefault()});m(this,cd,e=>{let t=r(this,ae);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"?a(this,v,_f).call(this):a(this,v,dr).call(this,!1));return}e.preventDefault(),a(this,v,Tm).call(this)}});m(this,dd,e=>{let t=r(this,ae);if(!t||e.pointerId!==t.pointerId)return;if(!t.started){a(this,v,dr).call(this,!1);return}let i=s=>{s.stopPropagation(),s.preventDefault()};window.addEventListener("click",i,{capture:!0,once:!0}),setTimeout(()=>window.removeEventListener("click",i,!0),0),a(this,v,dr).call(this,!0)});m(this,hd,e=>{r(this,ae)&&e.pointerId===r(this,ae).pointerId&&a(this,v,dr).call(this,!1)});g(this,Se,new ws({groupCount:()=>a(this,v,At).call(this).length,slotCount:()=>r(this,se)?r(this,se).mode==="day"?1:a(this,v,Zc).call(this,r(this,se).ev.dur):0,navigate:(e,t)=>a(this,v,Rx).call(this,e,t),onTarget:e=>a(this,v,Hx).call(this,e),onDrop:(e,t)=>a(this,v,Nx).call(this,e,t),onCancel:()=>a(this,v,wf).call(this),messages:{pickedUp:e=>this.t("pickedUp",{event:r(this,se)?.ev.name??"",place:a(this,v,_s).call(this,r(this,se),e)}),over:e=>this.t("over",{place:a(this,v,_s).call(this,r(this,se),e)}),cancelled:e=>this.t("cancelled",{event:r(this,se)?.ev.name??"",place:a(this,v,_s).call(this,r(this,se),e)})},announce:e=>r(this,Ve).announce(e)}))}get locale(){return r(this,so)}set locale(e){let t=r(this,so);g(this,so,e??""),this.requestUpdate("locale",t)}get events(){return[...this.children].filter(e=>e.localName==="cm-calendar-event")}event(e){return this.events.find(t=>t.key===e)}get range(){let e=a(this,v,At).call(this);return{view:r(this,v,He),start:B(e[0]),end:B(e[e.length-1])}}get heldEvent(){return r(this,se)?.ev.el??null}get announcement(){return r(this,Ve).text}announce(e){r(this,Ve).announce(e)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",r(this,sd)),this.addEventListener("focusin",r(this,id)),this.addEventListener("focusout",r(this,rd)),this.addEventListener("pointerdown",r(this,nd)),this.addEventListener("dragstart",r(this,ad)),r(this,td).observe(this,{childList:!0}),typeof ResizeObserver<"u"&&(g(this,oo,new ResizeObserver(()=>{cancelAnimationFrame(r(this,lo)),g(this,lo,requestAnimationFrame(()=>a(this,v,vf).call(this)))})),r(this,oo).observe(this)),a(this,v,vf).call(this)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",r(this,sd)),this.removeEventListener("focusin",r(this,id)),this.removeEventListener("focusout",r(this,rd)),this.removeEventListener("pointerdown",r(this,nd)),this.removeEventListener("dragstart",r(this,ad)),r(this,td).disconnect(),r(this,oo)?.disconnect(),cancelAnimationFrame(r(this,lo)),r(this,Se).cancel(!0),a(this,v,dr).call(this,!1)}willUpdate(e){e.has("view")&&(g(this,hr,!0),e.get("view")!==void 0&&(this._more="",r(this,Se).cancel(!0))),(e.has("date")||e.has("_narrow"))&&(this._more=this._more&&this.range.start<=this._more&&this._more<=this.range.end?this._more:"")}firstUpdated(){this.renderRoot.appendChild(r(this,Ve).element)}scrollToHour(e){let t=this.renderRoot.querySelector(".tg"),i=t?.querySelector(".tcell");!t||!i||(t.scrollTop=i.offsetHeight*Math.max(0,Math.min(23,Math.trunc(Number(e))||0)))}updated(e){if(e.has("dayStart")&&e.get("dayStart")!==void 0&&g(this,hr,!0),a(this,v,Sx).call(this),r(this,dt)){let l=a(this,v,Cx).call(this,r(this,dt).key);l?(g(this,dt,null),l.focus({preventScroll:!1})):Date.now()>r(this,dt).until&&g(this,dt,null)}r(this,no)&&(g(this,no,!1),(this.renderRoot.querySelector(".pop .chip")??this.renderRoot.querySelector(".pop button"))?.focus());let t=this.renderRoot.querySelector(".tg");if(t&&r(this,hr)){let l=t.querySelector(".tcell"),d=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));l&&(t.scrollTop=l.offsetHeight*d),g(this,hr,!1)}t||g(this,hr,!0),r(this,se)&&this._target&&this.renderRoot.querySelector(".ph")?.scrollIntoView?.({block:"nearest",inline:"nearest"});let i=this.range,s=`${i.view}|${i.start}|${i.end}`;s!==r(this,ed)&&(g(this,ed,s),this.dispatchEvent(new CustomEvent("cm-range-change",{detail:i,bubbles:!0,composed:!0})))}previous(){this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),-1))}next(){this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),1))}goToToday(){this.date=r(this,v,Gc)}pickUp(e,t){let i=typeof e=="string"?this.event(e):e;if(!i||i.locked||i.pending||this.readonly)return!1;let s=a(this,v,eo).call(this,i);if(!s)return!1;let l=a(this,v,At).call(this).map(B),d=t&&s.days.includes(t)&&l.includes(t)?t:s.days.find(b=>l.includes(b));if(!d)return!1;let p=a(this,v,xf).call(this,s,d);if(!p)return!1;a(this,v,dr).call(this,!1),r(this,Se).cancel(!0),this._more="",g(this,se,p),i.moving=!0;let u=`ev:${s.key}:${d}`;return g(this,Ut,u),g(this,dt,{key:u,until:Date.now()+1e3}),this.requestUpdate(),r(this,Se).pickUp(p.from),!0}cancelMove(){let e=r(this,ae);e?.started&&(a(this,v,dr).call(this,!1),r(this,Ve).announce(this.t("cancelled",{event:e.ev.name,place:a(this,v,_s).call(this,e,e.from)}))),r(this,Se).cancel()}moveEvent(e,t,i){let s=typeof e=="string"?this.event(e):e,l=s&&a(this,v,eo).call(this,s);if(!l)return!1;let d=l.allDay?P(ut(t).date||t):It(t);if(!d)return!1;let p=i?l.allDay?P(ut(i).date||i):It(i):null;return(!p||p<d)&&(p=l.allDay?Z(d,Em(l.start,l.end)):new Date(d.getTime()+l.dur*6e4)),a(this,v,Ef).call(this,l,d,p,"api",!1,B(d))}revert(e){let t=typeof e=="string"?this.event(e):e;if(!t)return!1;t.pending=!1;let i=r(this,Ts).get(t);if(this.controlled||!i)return!1;r(this,Ts).delete(t);let s=this.renderRoot.activeElement?.dataset.ev===t.key;t.start=i.start,t.end=i.end;let l=a(this,v,eo).call(this,t);return l&&s&&g(this,dt,{key:`ev:${l.key}:${l.days[0]}`,until:Date.now()+1e3}),r(this,Ve).announce(this.t("reverted",{event:t.name,place:l?a(this,v,_m).call(this,l):i.start})),!0}render(){let e=a(this,v,At).call(this),t=a(this,v,kx).call(this,a(this,v,$x).call(this));return c`<div class="cal ${this._narrow?"narrow":""}" role="group" aria-label=${this.label}>
2950
2953
  ${a(this,v,Bx).call(this,e)}
2951
2954
  ${r(this,v,He)==="month"?a(this,v,Vx).call(this,e,t):a(this,v,Ux).call(this,e,t)}
2952
2955
  <span class="vh" role="status">${this.loading?this.t("loading"):""}</span>
2953
2956
  <span id="${r(this,Fe)}-gh" hidden>${this.t("gridHelp")}</span>
2954
2957
  <span id="${r(this,Fe)}-mv" hidden>${this.t("openHint")} ${this.t("instructions")}</span>
2955
2958
  <span id="${r(this,Fe)}-op" hidden>${this.t("openHint")}</span>
2956
- </div>`}};so=new WeakMap,Fe=new WeakMap,Ve=new WeakMap,Se=new WeakMap,se=new WeakMap,ae=new WeakMap,_s=new WeakMap,Ut=new WeakMap,dt=new WeakMap,ed=new WeakMap,hr=new WeakMap,ao=new WeakMap,no=new WeakMap,oo=new WeakMap,lo=new WeakMap,td=new WeakMap,v=new WeakSet,He=function(){return vx.includes(this.view)?this.view:"month"},cr=function(){return Fi(this,this.locale)},Kc=function(){return Ca(r(this,v,cr))},Mm=function(){return Ea(r(this,v,cr),this.hourCycle)},jt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},ff=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?_a(r(this,v,cr)):(Math.trunc(e)%7+7)%7},Gc=function(){return P(this.today)?this.today:Hu()},Lt=function(){return P(this.date)??P(r(this,v,Gc))},bf=function(){return r(this,v,He)==="month"&&this._narrow},wx=function(){return r(this,v,He)!=="month"},At=function(){let e=r(this,v,Lt),t=r(this,v,ff);if(r(this,v,He)==="day")return[e];if(r(this,v,He)==="week"){if(this._narrow)return[e,Z(e,1),Z(e,2)];let d=Z(e,-((e.getDay()-t+7)%7));return Array.from({length:7},(p,u)=>Z(d,u))}let i=Tt(e),s=Z(i,-((i.getDay()-t+7)%7)),l=Math.ceil((Em(s,ka(e))+1)/7)*7;return Array.from({length:l},(d,p)=>Z(s,p))},eo=function(e){let t=e.name,i=!!P(e.start),s=e.allDay||i;if(s){let u=P(ut(e.start).date||e.start);if(!u)return null;let b=P(ut(e.end).date||e.end)??u;b<u&&(b=u);let f=Math.min(Em(u,b),366);return{el:e,key:e.key,name:t,allDay:s,start:u,end:b,min:0,dur:1440,days:Array.from({length:f+1},(x,y)=>B(Z(u,y)))}}let l=It(e.start);if(!l)return null;let d=It(e.end);(!d||d<=l)&&(d=new Date(l.getTime()+30*6e4));let p=Math.max(1,Math.round((d.getTime()-l.getTime())/6e4));return{el:e,key:e.key,name:t,allDay:s,start:l,end:d,min:l.getHours()*60+l.getMinutes(),dur:p,days:[B(l)]}},$x=function(){return this.events.map(e=>a(this,v,eo).call(this,e)).filter(e=>!!e)},kx=function(e){let t=new Map;for(let i of e)for(let s of i.days)(t.get(s)??t.set(s,[]).get(s)).push(i);for(let i of t.values())i.sort((s,l)=>(s.allDay===l.allDay?0:s.allDay?-1:1)||s.start.getTime()-l.start.getTime()||s.name.localeCompare(l.name));return t},ct=function(e){return he(e,{weekday:"long",day:"numeric",month:"long"},r(this,v,cr))},Wc=function(e){return r(this,v,Mm).format((e%1440+1440)%1440)},Yc=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},s=xx(r(this,v,cr),{hour:"numeric",minute:"2-digit",...i});try{if(B(e)===B(t)&&s.formatRangeToParts){let p=s.formatRangeToParts(e,t),u=p.findIndex(f=>f.source==="endRange"),b=-1;if(p.forEach((f,x)=>{f.source==="startRange"&&(b=x)}),b>=0&&u>b){let f=x=>gf(x.map(y=>y.value).join(""));return this.t("timeRange",{start:f(p.slice(0,b+1)),end:f(p.slice(u))})}}}catch{}let l=B(e)===B(t),d=p=>l?a(this,v,Wc).call(this,p.getHours()*60+p.getMinutes()):r(this,v,Mm).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},Tm=function(e){return e.allDay?B(e.start)===B(e.end)?this.t("allDayOn",{date:a(this,v,ct).call(this,e.start)}):this.t("allDayRange",{start:a(this,v,ct).call(this,e.start),end:a(this,v,ct).call(this,e.end)}):B(e.start)!==B(e.end)&&!(e.end.getHours()===0&&e.end.getMinutes()===0&&Em(e.start,e.end)===1)?a(this,v,Yc).call(this,e.start,e.end):this.t("timed",{date:a(this,v,ct).call(this,e.start),time:a(this,v,Yc).call(this,e.start,e.end)})},Ex=function(e){let t={title:e.name,when:a(this,v,Tm).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},Mx=function(e){let t=r(this,v,cr);if(r(this,v,He)==="month")return r(this,v,Kc).monthYear(r(this,v,Lt));if(e.length===1)return he(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=xx(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return gf(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},Tx=function(e){return r(this,v,Mm).hour12?gf(he(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},r(this,v,cr))):a(this,v,Wc).call(this,e*60)},Ts=function(e,t){let{start:i,end:s}=a(this,v,yf).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,v,ct).call(this,i),time:a(this,v,Yc).call(this,i,s)}):a(this,v,ct).call(this,Z(P(e.origin),t.group-e.from.group))},vf=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<T0;t!==this._narrow&&(this._narrow=t)},Xc=function(e,t){return r(this,v,He)==="month"?Me(e,t):r(this,v,He)==="week"?Z(e,t*(this._narrow?3:7)):Z(e,t)},_x=function(e){this.view!==e&&(this.view=e)},Jc=function(){return[...this.renderRoot.querySelectorAll(".item")]},Cx=function(e){let t=[...this.renderRoot.querySelectorAll("[data-k]")],i=t.find(s=>s.dataset.k===e&&s.classList.contains("item"))??t.find(s=>s.dataset.k===e);if(i)return i;if(e.startsWith("ev:")&&!this.controlled){let s=e.slice(e.lastIndexOf(":")+1);return t.find(l=>l.dataset.k===`more:${s}`)??null}return null},zx=function(){let e=B(r(this,v,Lt));if(r(this,v,bf))return`day:${e}`;if(r(this,v,He)==="month")return this.readonly?`cell:${e}`:`add:${e}`;let t=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));return`slot:${e}:${t}`},Sx=function(){let e=a(this,v,Jc).call(this);if(!e.length)return;let t=e.find(i=>i.dataset.k===r(this,Ut))??e.find(i=>i.dataset.k===a(this,v,zx).call(this))??e.find(i=>i.dataset.day===B(r(this,v,Lt)))??e[0];for(let i of e)i.tabIndex=i===t?0:-1},Lx=function(e){g(this,Ut,e.dataset.k??"");for(let t of a(this,v,Jc).call(this))t.tabIndex=t===e?0:-1;e.focus()},id=new WeakMap,rd=new WeakMap,Ax=function(e,t){let i=new Map;for(let y of a(this,v,Jc).call(this)){let k=Number(y.dataset.i);(i.get(k)??i.set(k,[]).get(k)).push(y)}let s=Number(e.dataset.i),l=i.get(s)??[e],d=Math.max(0,l.indexOf(e)),p=a(this,v,At).call(this).length,u=r(this,v,He)==="month",b=e.dataset.row,f=(y,k)=>{let S=y>=0&&y<p?i.get(y):void 0;return(S?.length?k(S):void 0)??null},x=y=>u?y[Math.min(d,y.length-1)]:y.find(k=>k.dataset.row===b)??y[0];switch(t){case"ArrowRight":return f(s+1,x);case"ArrowLeft":return f(s-1,x);case"ArrowDown":return l[d+1]??(u?f(s+7,y=>y[0]):null);case"ArrowUp":return d>0?l[d-1]:u?f(s-7,y=>y[y.length-1]):null;case"Home":return u?f(s-s%7,y=>y[0]):f(0,x);case"End":return u?f(Math.min(p-1,s-s%7+6),y=>y[0]):f(p-1,x);default:return null}},Dx=function(e,t){let i=e.dataset.day??B(r(this,v,Lt)),s=a(this,v,Xc).call(this,P(i)??r(this,v,Lt),t),l=B(s),d=(e.dataset.k??"").split(":")[0],p;r(this,v,bf)?p=`day:${l}`:r(this,v,He)==="month"?p=this.readonly?`cell:${l}`:`add:${l}`:d==="adadd"||e.dataset.row==="a"?p=`adadd:${l}`:p=`slot:${l}:${e.dataset.row??this.dayStart}`,this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),t)),g(this,Ut,p),g(this,dt,{key:p,until:Date.now()+1e3})},sd=new WeakMap,Zc=function(e){return Math.floor((1440-Math.min(e,1440))/r(this,v,jt))+1},Rx=function(e,t){let i=r(this,se);if(!i)return null;let s=a(this,v,At).call(this).length,l=b=>Math.max(0,Math.min(s-1,b));if(i.mode==="day"){let b=r(this,v,He)==="month";switch(e){case"ArrowRight":return{group:l(t.group+1),index:0};case"ArrowLeft":return{group:l(t.group-1),index:0};case"ArrowDown":return b?{group:t.group+7<s?t.group+7:t.group,index:0}:{...t};case"ArrowUp":return b?{group:t.group-7>=0?t.group-7:t.group,index:0}:{...t};case"Home":return{group:b?t.group-t.group%7:0,index:0};case"End":return{group:b?l(t.group-t.group%7+6):s-1,index:0};default:return null}}let d=a(this,v,Zc).call(this,i.ev.dur)-1,p=Math.max(1,Math.round(60/r(this,v,jt))),u=b=>Math.max(0,Math.min(d,b));switch(e){case"ArrowRight":return{group:l(t.group+1),index:t.index};case"ArrowLeft":return{group:l(t.group-1),index:t.index};case"ArrowDown":return{group:t.group,index:u(t.index+1)};case"ArrowUp":return{group:t.group,index:u(t.index-1)};case"PageDown":return{group:t.group,index:u(t.index+p)};case"PageUp":return{group:t.group,index:u(t.index-p)};case"Home":return{group:t.group,index:0};case"End":return{group:t.group,index:d};default:return null}},yf=function(e,t){let{ev:i}=e;if(e.mode==="time"){let d=a(this,v,At).call(this)[t.group]??P(e.origin),p=new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,t.index*r(this,v,jt));return{start:p,end:new Date(p.getTime()+i.dur*6e4)}}let s=t.group-e.from.group,l=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()+s,d.getHours(),d.getMinutes());return{start:l(i.start),end:l(i.end)}},xf=function(e,t){let s=a(this,v,At).call(this).map(B).indexOf(t);if(s<0)return null;let l=r(this,v,wx)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/r(this,v,jt)),a(this,v,Zc).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:s,index:d}}},wf=function(){r(this,se)&&(r(this,se).ev.el.moving=!1),g(this,se,null),this._target=null},Hx=function(e){let t=r(this,se);if(!t||!e){this._target=null;return}let i=B(a(this,v,At).call(this)[e.group]??P(t.origin)),s=e.group===t.from.group&&e.index===t.from.index;this._target=s?null:{iso:i,min:t.mode==="time"?e.index*r(this,v,jt):void 0}},Nx=function(e,t){let i=r(this,se);a(this,v,wf).call(this),i&&(g(this,ao,performance.now()+400),a(this,v,$f).call(this,i,e,t,"keyboard"))},$f=function(e,t,i,s){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,v,yf).call(this,e,i),u=B(Z(P(e.origin),i.group-t.group));a(this,v,Ef).call(this,e.ev,d,p,s,l,e.mode==="time"?B(d):u)},kf=function(e,t,i){return e?{start:B(t),end:B(i)}:{start:bx(t),end:bx(i)}},Ef=function(e,t,i,s,l,d){let p=e.el,u=e.name,b=a(this,v,kf).call(this,e.allDay,e.start,e.end),f=a(this,v,kf).call(this,e.allDay,t,i),x=V=>{s==="keyboard"&&g(this,dt,{key:V,until:Date.now()+1e3})};if(l||b.start===f.start&&b.end===f.end)return s!=="api"&&r(this,Ve).announce(this.t("sameSpot",{event:u})),this.requestUpdate(),!1;let y={...e,start:t,end:i},k=e.allDay?a(this,v,ct).call(this,t):this.t("timed",{date:a(this,v,ct).call(this,t),time:a(this,v,Yc).call(this,t,i)}),S=[],H={value:e.key,event:p,from:b,to:f,allDay:e.allDay,source:s,waitUntil:V=>{S.push(Promise.resolve(V))}};return this.dispatchEvent(new CustomEvent("cm-move",{detail:H,bubbles:!0,composed:!0,cancelable:!0}))?(this.controlled||(r(this,_s).set(p,b),p.start=f.start,p.end=f.end),x(`ev:${e.key}:${d}`),this.requestUpdate(),r(this,Ve).announce(this.t("moved",{event:u,place:y.allDay?a(this,v,ct).call(this,t):k})),S.length&&(p.pending=!0,Promise.all(S).then(()=>{p.pending=!1,this.controlled||r(this,_s).delete(p)},()=>{p.pending=!1,this.controlled?r(this,Ve).announce(this.t("reverted",{event:u,place:a(this,v,Tm).call(this,e)})):this.revert(p)})),!0):(r(this,Ve).announce(this.t("refused",{event:u,place:k})),this.requestUpdate(),!1)},ad=new WeakMap,Mf=function(e,t){let i=[...this.renderRoot.querySelectorAll('.tcell[data-row="0"]')];if(!i.length)return null;let s=0,l=1/0;i.forEach((p,u)=>{let b=p.getBoundingClientRect(),f=e<b.left?b.left-e:e>b.right?e-b.right:0;f<l&&(l=f,s=Number(p.dataset.i??u))});let d=i[0].getBoundingClientRect();return{group:s,min:(t-d.top)/d.height*60}},Px=function(e,t){let i=[...this.renderRoot.querySelectorAll("[data-drop]")];if(!i.length)return null;let s=null,l=1/0;for(let d of i){let p=d.getBoundingClientRect(),u=e<p.left?p.left-e:e>p.right?e-p.right:0,b=t<p.top?p.top-t:t>p.bottom?t-p.bottom:0,f=Math.hypot(u,b);f<l&&(l=f,s=d)}return s?Number(s.dataset.i):null},nd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakMap,dd=new WeakMap,hd=new WeakMap,Tf=function(){let e=r(this,ae);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges(),this._more="",e.ev.el.moving=!0,this.dragging=!0,r(this,Ve).announce(this.t("pickedUp",{event:e.ev.name,place:a(this,v,Ts).call(this,e,e.from)})),a(this,v,_m).call(this);let t=()=>{r(this,ae)?.started&&(a(this,v,Ix).call(this),r(this,ae).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},_m=function(){let e=r(this,ae);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,v,Mf).call(this,e.x,e.y);if(l){let d=a(this,v,Zc).call(this,e.ev.dur)-1;t={group:l.group,index:Math.max(0,Math.min(d,Math.round((l.min-e.grab)/r(this,v,jt))))}}}else{let l=a(this,v,Px).call(this,e.x,e.y);l!==null&&(t={group:l,index:0})}if(!t||t.group===e.to.group&&t.index===e.to.index&&this._target)return;let i=t.group!==e.to.group;e.to=t;let s=t.group===e.from.group&&t.index===e.from.index;this._target=s?null:{iso:B(a(this,v,At).call(this)[t.group]),min:e.mode==="time"?t.index*r(this,v,jt):void 0},i&&r(this,Ve).announce(this.t("over",{place:a(this,v,Ts).call(this,e,t)}))},Ix=function(){let e=r(this,ae),t=this.renderRoot.querySelector(".tg");if(!e||!t||e.mode!=="time")return;let i=40,s=14,l=x=>x<i?Math.ceil((i-Math.max(x,0))/i*s):0,d=t.getBoundingClientRect();if(e.x<d.left||e.x>d.right)return;let p=t.querySelector(".tg-top")?.getBoundingClientRect().bottom??d.top,u=l(e.y-p),b=l(d.bottom-e.y),f=t.scrollTop;u?t.scrollTop-=u:b&&(t.scrollTop+=b),t.scrollTop!==f&&a(this,v,_m).call(this)},dr=function(e){let t=r(this,ae);t&&(g(this,ae,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,cd),!0),window.removeEventListener("pointerup",r(this,dd),!0),window.removeEventListener("pointercancel",r(this,hd),!0),window.removeEventListener("touchmove",r(this,od),!0),window.removeEventListener("contextmenu",r(this,ld),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,v,$f).call(this,t,t.from,t.to,"pointer")))},Qc=function(e,t){this.readonly||this.dispatchEvent(new CustomEvent("cm-add",{detail:{start:e,allDay:t,view:r(this,v,He)},bubbles:!0,composed:!0}))},qx=function(e,t,i){let s=i*60;if(e.detail>0){let p=e.currentTarget.getBoundingClientRect(),u=Math.floor((e.clientY-p.top)/p.height*60/r(this,v,jt))*r(this,v,jt);s+=Math.max(0,Math.min(59,u))}let l=Math.floor(s/60),d=s%60;a(this,v,Qc).call(this,`${t}T${Sm(l)}:${Sm(d)}`,!1)},_f=function(e,t){if(performance.now()<r(this,ao)||r(this,Se).active){e.preventDefault();return}this.dispatchEvent(new CustomEvent("cm-open",{detail:{value:t.key,event:t.el},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},Ox=function(e){this._more=e,g(this,no,!0)},Cm=function(e){let t=this._more;this._more="",e&&t&&(g(this,Ut,`more:${t}`),g(this,dt,{key:`more:${t}`,until:Date.now()+1e3}))},Cf=function(){return r(this,se)?.ev??(r(this,ae)?.started?r(this,ae).ev:null)},to=function(e,t,i,s,l,d={}){let p=e.el,u=p.pending,b=a(this,v,Ex).call(this,e),f=!this.readonly&&!p.locked&&!u,x=["attention","information","success","critical"].includes(p.tone)?p.tone:"neutral",y=`chip ${s} tone-${x}${l?" item":""}${p.moving?" moving":""}${u?" pending":""}${p.locked?" locked":""}`,k=p.icon?c`<cm-icon name=${p.icon} size="14"></cm-icon>`:h,S=e.allDay?h:c`<span class="tm">${a(this,v,Wc).call(this,e.min)}</span>`,H=p.kind&&(s!=="month"||!p.icon)?c`<span class="k">${p.kind}</span>`:h,O=u?c`<span class="spin" aria-hidden="true"></span>`:h,V=s==="time"?c`<span class="lead">${k}${S}${O}</span><span class="h">${e.name}</span>${H}`:c`${k}${S}<span class="h">${e.name}</span>${H}${O}`,G=u?`${b}, ${this.t("saving")}`:b,Ue=f?`${r(this,Fe)}-mv`:`${r(this,Fe)}-op`,W=`ev:${e.key}:${t}`,J=f?this.t("roleDescription"):h;return p.href?c`<a class=${y} href=${p.href} style=${d.style??h} data-k=${W} data-ev=${e.key} data-day=${t} data-i=${i}
2959
+ </div>`}};so=new WeakMap,Fe=new WeakMap,Ve=new WeakMap,Se=new WeakMap,se=new WeakMap,ae=new WeakMap,Ts=new WeakMap,Ut=new WeakMap,dt=new WeakMap,ed=new WeakMap,hr=new WeakMap,ao=new WeakMap,no=new WeakMap,oo=new WeakMap,lo=new WeakMap,td=new WeakMap,v=new WeakSet,He=function(){return vx.includes(this.view)?this.view:"month"},cr=function(){return Fi(this,this.locale)},Kc=function(){return Ca(r(this,v,cr))},Mm=function(){return Ea(r(this,v,cr),this.hourCycle)},jt=function(){let e=Math.trunc(Number(this.step));return e>=1&&e<=240?e:15},ff=function(){let e=Number(this.firstDayOfWeek);return this.firstDayOfWeek==null||Number.isNaN(e)?Ta(r(this,v,cr)):(Math.trunc(e)%7+7)%7},Gc=function(){return P(this.today)?this.today:Hu()},Lt=function(){return P(this.date)??P(r(this,v,Gc))},bf=function(){return r(this,v,He)==="month"&&this._narrow},wx=function(){return r(this,v,He)!=="month"},At=function(){let e=r(this,v,Lt),t=r(this,v,ff);if(r(this,v,He)==="day")return[e];if(r(this,v,He)==="week"){if(this._narrow)return[e,Z(e,1),Z(e,2)];let d=Z(e,-((e.getDay()-t+7)%7));return Array.from({length:7},(p,u)=>Z(d,u))}let i=_t(e),s=Z(i,-((i.getDay()-t+7)%7)),l=Math.ceil((Em(s,ka(e))+1)/7)*7;return Array.from({length:l},(d,p)=>Z(s,p))},eo=function(e){let t=e.name,i=!!P(e.start),s=e.allDay||i;if(s){let u=P(ut(e.start).date||e.start);if(!u)return null;let b=P(ut(e.end).date||e.end)??u;b<u&&(b=u);let f=Math.min(Em(u,b),366);return{el:e,key:e.key,name:t,allDay:s,start:u,end:b,min:0,dur:1440,days:Array.from({length:f+1},(x,y)=>B(Z(u,y)))}}let l=It(e.start);if(!l)return null;let d=It(e.end);(!d||d<=l)&&(d=new Date(l.getTime()+30*6e4));let p=Math.max(1,Math.round((d.getTime()-l.getTime())/6e4));return{el:e,key:e.key,name:t,allDay:s,start:l,end:d,min:l.getHours()*60+l.getMinutes(),dur:p,days:[B(l)]}},$x=function(){return this.events.map(e=>a(this,v,eo).call(this,e)).filter(e=>!!e)},kx=function(e){let t=new Map;for(let i of e)for(let s of i.days)(t.get(s)??t.set(s,[]).get(s)).push(i);for(let i of t.values())i.sort((s,l)=>(s.allDay===l.allDay?0:s.allDay?-1:1)||s.start.getTime()-l.start.getTime()||s.name.localeCompare(l.name));return t},ct=function(e){return he(e,{weekday:"long",day:"numeric",month:"long"},r(this,v,cr))},Wc=function(e){return r(this,v,Mm).format((e%1440+1440)%1440)},Yc=function(e,t){let i=this.hourCycle==="h12"||this.hourCycle==="h23"?{hourCycle:this.hourCycle}:{},s=xx(r(this,v,cr),{hour:"numeric",minute:"2-digit",...i});try{if(B(e)===B(t)&&s.formatRangeToParts){let p=s.formatRangeToParts(e,t),u=p.findIndex(f=>f.source==="endRange"),b=-1;if(p.forEach((f,x)=>{f.source==="startRange"&&(b=x)}),b>=0&&u>b){let f=x=>gf(x.map(y=>y.value).join(""));return this.t("timeRange",{start:f(p.slice(0,b+1)),end:f(p.slice(u))})}}}catch{}let l=B(e)===B(t),d=p=>l?a(this,v,Wc).call(this,p.getHours()*60+p.getMinutes()):r(this,v,Mm).dateTime(p);return this.t("timeRange",{start:d(e),end:d(t)})},_m=function(e){return e.allDay?B(e.start)===B(e.end)?this.t("allDayOn",{date:a(this,v,ct).call(this,e.start)}):this.t("allDayRange",{start:a(this,v,ct).call(this,e.start),end:a(this,v,ct).call(this,e.end)}):B(e.start)!==B(e.end)&&!(e.end.getHours()===0&&e.end.getMinutes()===0&&Em(e.start,e.end)===1)?a(this,v,Yc).call(this,e.start,e.end):this.t("timed",{date:a(this,v,ct).call(this,e.start),time:a(this,v,Yc).call(this,e.start,e.end)})},Ex=function(e){let t={title:e.name,when:a(this,v,_m).call(this,e),kind:e.el.kind};return this.t(e.el.kind?"eventNameKind":"eventName",t)},Mx=function(e){let t=r(this,v,cr);if(r(this,v,He)==="month")return r(this,v,Kc).monthYear(r(this,v,Lt));if(e.length===1)return he(e[0],{weekday:"long",day:"numeric",month:"long",year:"numeric"},t);let i=xx(t,{day:"numeric",month:"short",year:"numeric"});try{if(i.formatRange)return gf(i.formatRange(e[0],e[e.length-1]))}catch{}return`${i.format(e[0])} \u2013 ${i.format(e[e.length-1])}`},_x=function(e){return r(this,v,Mm).hour12?gf(he(new Date(2e3,0,1,e),{hour:"numeric",hourCycle:"h12"},r(this,v,cr))):a(this,v,Wc).call(this,e*60)},_s=function(e,t){let{start:i,end:s}=a(this,v,yf).call(this,e,t);return e.mode==="time"?this.t("timed",{date:a(this,v,ct).call(this,i),time:a(this,v,Yc).call(this,i,s)}):a(this,v,ct).call(this,Z(P(e.origin),t.group-e.from.group))},vf=function(){let e=this.getBoundingClientRect().width;if(!e)return;let t=e<_0;t!==this._narrow&&(this._narrow=t)},Xc=function(e,t){return r(this,v,He)==="month"?Me(e,t):r(this,v,He)==="week"?Z(e,t*(this._narrow?3:7)):Z(e,t)},Tx=function(e){this.view!==e&&(this.view=e)},Jc=function(){return[...this.renderRoot.querySelectorAll(".item")]},Cx=function(e){let t=[...this.renderRoot.querySelectorAll("[data-k]")],i=t.find(s=>s.dataset.k===e&&s.classList.contains("item"))??t.find(s=>s.dataset.k===e);if(i)return i;if(e.startsWith("ev:")&&!this.controlled){let s=e.slice(e.lastIndexOf(":")+1);return t.find(l=>l.dataset.k===`more:${s}`)??null}return null},zx=function(){let e=B(r(this,v,Lt));if(r(this,v,bf))return`day:${e}`;if(r(this,v,He)==="month")return this.readonly?`cell:${e}`:`add:${e}`;let t=Math.max(0,Math.min(23,Math.trunc(Number(this.dayStart))||0));return`slot:${e}:${t}`},Sx=function(){let e=a(this,v,Jc).call(this);if(!e.length)return;let t=e.find(i=>i.dataset.k===r(this,Ut))??e.find(i=>i.dataset.k===a(this,v,zx).call(this))??e.find(i=>i.dataset.day===B(r(this,v,Lt)))??e[0];for(let i of e)i.tabIndex=i===t?0:-1},Lx=function(e){g(this,Ut,e.dataset.k??"");for(let t of a(this,v,Jc).call(this))t.tabIndex=t===e?0:-1;e.focus()},id=new WeakMap,rd=new WeakMap,Ax=function(e,t){let i=new Map;for(let y of a(this,v,Jc).call(this)){let k=Number(y.dataset.i);(i.get(k)??i.set(k,[]).get(k)).push(y)}let s=Number(e.dataset.i),l=i.get(s)??[e],d=Math.max(0,l.indexOf(e)),p=a(this,v,At).call(this).length,u=r(this,v,He)==="month",b=e.dataset.row,f=(y,k)=>{let S=y>=0&&y<p?i.get(y):void 0;return(S?.length?k(S):void 0)??null},x=y=>u?y[Math.min(d,y.length-1)]:y.find(k=>k.dataset.row===b)??y[0];switch(t){case"ArrowRight":return f(s+1,x);case"ArrowLeft":return f(s-1,x);case"ArrowDown":return l[d+1]??(u?f(s+7,y=>y[0]):null);case"ArrowUp":return d>0?l[d-1]:u?f(s-7,y=>y[y.length-1]):null;case"Home":return u?f(s-s%7,y=>y[0]):f(0,x);case"End":return u?f(Math.min(p-1,s-s%7+6),y=>y[0]):f(p-1,x);default:return null}},Dx=function(e,t){let i=e.dataset.day??B(r(this,v,Lt)),s=a(this,v,Xc).call(this,P(i)??r(this,v,Lt),t),l=B(s),d=(e.dataset.k??"").split(":")[0],p;r(this,v,bf)?p=`day:${l}`:r(this,v,He)==="month"?p=this.readonly?`cell:${l}`:`add:${l}`:d==="adadd"||e.dataset.row==="a"?p=`adadd:${l}`:p=`slot:${l}:${e.dataset.row??this.dayStart}`,this.date=B(a(this,v,Xc).call(this,r(this,v,Lt),t)),g(this,Ut,p),g(this,dt,{key:p,until:Date.now()+1e3})},sd=new WeakMap,Zc=function(e){return Math.floor((1440-Math.min(e,1440))/r(this,v,jt))+1},Rx=function(e,t){let i=r(this,se);if(!i)return null;let s=a(this,v,At).call(this).length,l=b=>Math.max(0,Math.min(s-1,b));if(i.mode==="day"){let b=r(this,v,He)==="month";switch(e){case"ArrowRight":return{group:l(t.group+1),index:0};case"ArrowLeft":return{group:l(t.group-1),index:0};case"ArrowDown":return b?{group:t.group+7<s?t.group+7:t.group,index:0}:{...t};case"ArrowUp":return b?{group:t.group-7>=0?t.group-7:t.group,index:0}:{...t};case"Home":return{group:b?t.group-t.group%7:0,index:0};case"End":return{group:b?l(t.group-t.group%7+6):s-1,index:0};default:return null}}let d=a(this,v,Zc).call(this,i.ev.dur)-1,p=Math.max(1,Math.round(60/r(this,v,jt))),u=b=>Math.max(0,Math.min(d,b));switch(e){case"ArrowRight":return{group:l(t.group+1),index:t.index};case"ArrowLeft":return{group:l(t.group-1),index:t.index};case"ArrowDown":return{group:t.group,index:u(t.index+1)};case"ArrowUp":return{group:t.group,index:u(t.index-1)};case"PageDown":return{group:t.group,index:u(t.index+p)};case"PageUp":return{group:t.group,index:u(t.index-p)};case"Home":return{group:t.group,index:0};case"End":return{group:t.group,index:d};default:return null}},yf=function(e,t){let{ev:i}=e;if(e.mode==="time"){let d=a(this,v,At).call(this)[t.group]??P(e.origin),p=new Date(d.getFullYear(),d.getMonth(),d.getDate(),0,t.index*r(this,v,jt));return{start:p,end:new Date(p.getTime()+i.dur*6e4)}}let s=t.group-e.from.group,l=d=>new Date(d.getFullYear(),d.getMonth(),d.getDate()+s,d.getHours(),d.getMinutes());return{start:l(i.start),end:l(i.end)}},xf=function(e,t){let s=a(this,v,At).call(this).map(B).indexOf(t);if(s<0)return null;let l=r(this,v,wx)&&!e.allDay?"time":"day",d=l==="time"?Math.min(Math.floor(e.min/r(this,v,jt)),a(this,v,Zc).call(this,e.dur)-1):0;return{ev:e,origin:t,mode:l,from:{group:s,index:d}}},wf=function(){r(this,se)&&(r(this,se).ev.el.moving=!1),g(this,se,null),this._target=null},Hx=function(e){let t=r(this,se);if(!t||!e){this._target=null;return}let i=B(a(this,v,At).call(this)[e.group]??P(t.origin)),s=e.group===t.from.group&&e.index===t.from.index;this._target=s?null:{iso:i,min:t.mode==="time"?e.index*r(this,v,jt):void 0}},Nx=function(e,t){let i=r(this,se);a(this,v,wf).call(this),i&&(g(this,ao,performance.now()+400),a(this,v,$f).call(this,i,e,t,"keyboard"))},$f=function(e,t,i,s){let l=t.group===i.group&&t.index===i.index,{start:d,end:p}=a(this,v,yf).call(this,e,i),u=B(Z(P(e.origin),i.group-t.group));a(this,v,Ef).call(this,e.ev,d,p,s,l,e.mode==="time"?B(d):u)},kf=function(e,t,i){return e?{start:B(t),end:B(i)}:{start:bx(t),end:bx(i)}},Ef=function(e,t,i,s,l,d){let p=e.el,u=e.name,b=a(this,v,kf).call(this,e.allDay,e.start,e.end),f=a(this,v,kf).call(this,e.allDay,t,i),x=V=>{s==="keyboard"&&g(this,dt,{key:V,until:Date.now()+1e3})};if(l||b.start===f.start&&b.end===f.end)return s!=="api"&&r(this,Ve).announce(this.t("sameSpot",{event:u})),this.requestUpdate(),!1;let y={...e,start:t,end:i},k=e.allDay?a(this,v,ct).call(this,t):this.t("timed",{date:a(this,v,ct).call(this,t),time:a(this,v,Yc).call(this,t,i)}),S=[],H={value:e.key,event:p,from:b,to:f,allDay:e.allDay,source:s,waitUntil:V=>{S.push(Promise.resolve(V))}};return this.dispatchEvent(new CustomEvent("cm-move",{detail:H,bubbles:!0,composed:!0,cancelable:!0}))?(this.controlled||(r(this,Ts).set(p,b),p.start=f.start,p.end=f.end),x(`ev:${e.key}:${d}`),this.requestUpdate(),r(this,Ve).announce(this.t("moved",{event:u,place:y.allDay?a(this,v,ct).call(this,t):k})),S.length&&(p.pending=!0,Promise.all(S).then(()=>{p.pending=!1,this.controlled||r(this,Ts).delete(p)},()=>{p.pending=!1,this.controlled?r(this,Ve).announce(this.t("reverted",{event:u,place:a(this,v,_m).call(this,e)})):this.revert(p)})),!0):(r(this,Ve).announce(this.t("refused",{event:u,place:k})),this.requestUpdate(),!1)},ad=new WeakMap,Mf=function(e,t){let i=[...this.renderRoot.querySelectorAll('.tcell[data-row="0"]')];if(!i.length)return null;let s=0,l=1/0;i.forEach((p,u)=>{let b=p.getBoundingClientRect(),f=e<b.left?b.left-e:e>b.right?e-b.right:0;f<l&&(l=f,s=Number(p.dataset.i??u))});let d=i[0].getBoundingClientRect();return{group:s,min:(t-d.top)/d.height*60}},Px=function(e,t){let i=[...this.renderRoot.querySelectorAll("[data-drop]")];if(!i.length)return null;let s=null,l=1/0;for(let d of i){let p=d.getBoundingClientRect(),u=e<p.left?p.left-e:e>p.right?e-p.right:0,b=t<p.top?p.top-t:t>p.bottom?t-p.bottom:0,f=Math.hypot(u,b);f<l&&(l=f,s=d)}return s?Number(s.dataset.i):null},nd=new WeakMap,od=new WeakMap,ld=new WeakMap,cd=new WeakMap,dd=new WeakMap,hd=new WeakMap,_f=function(){let e=r(this,ae);e.started=!0,clearTimeout(e.timer),getSelection()?.removeAllRanges(),this._more="",e.ev.el.moving=!0,this.dragging=!0,r(this,Ve).announce(this.t("pickedUp",{event:e.ev.name,place:a(this,v,_s).call(this,e,e.from)})),a(this,v,Tm).call(this);let t=()=>{r(this,ae)?.started&&(a(this,v,Ix).call(this),r(this,ae).raf=requestAnimationFrame(t))};e.raf=requestAnimationFrame(t)},Tm=function(){let e=r(this,ae);if(!e)return;let t=null;if(e.mode==="time"){let l=a(this,v,Mf).call(this,e.x,e.y);if(l){let d=a(this,v,Zc).call(this,e.ev.dur)-1;t={group:l.group,index:Math.max(0,Math.min(d,Math.round((l.min-e.grab)/r(this,v,jt))))}}}else{let l=a(this,v,Px).call(this,e.x,e.y);l!==null&&(t={group:l,index:0})}if(!t||t.group===e.to.group&&t.index===e.to.index&&this._target)return;let i=t.group!==e.to.group;e.to=t;let s=t.group===e.from.group&&t.index===e.from.index;this._target=s?null:{iso:B(a(this,v,At).call(this)[t.group]),min:e.mode==="time"?t.index*r(this,v,jt):void 0},i&&r(this,Ve).announce(this.t("over",{place:a(this,v,_s).call(this,e,t)}))},Ix=function(){let e=r(this,ae),t=this.renderRoot.querySelector(".tg");if(!e||!t||e.mode!=="time")return;let i=40,s=14,l=x=>x<i?Math.ceil((i-Math.max(x,0))/i*s):0,d=t.getBoundingClientRect();if(e.x<d.left||e.x>d.right)return;let p=t.querySelector(".tg-top")?.getBoundingClientRect().bottom??d.top,u=l(e.y-p),b=l(d.bottom-e.y),f=t.scrollTop;u?t.scrollTop-=u:b&&(t.scrollTop+=b),t.scrollTop!==f&&a(this,v,Tm).call(this)},dr=function(e){let t=r(this,ae);t&&(g(this,ae,null),clearTimeout(t.timer),t.raf&&cancelAnimationFrame(t.raf),window.removeEventListener("pointermove",r(this,cd),!0),window.removeEventListener("pointerup",r(this,dd),!0),window.removeEventListener("pointercancel",r(this,hd),!0),window.removeEventListener("touchmove",r(this,od),!0),window.removeEventListener("contextmenu",r(this,ld),!0),t.started&&(t.ev.el.moving=!1,this.dragging=!1,this._target=null,e&&a(this,v,$f).call(this,t,t.from,t.to,"pointer")))},Qc=function(e,t){this.readonly||this.dispatchEvent(new CustomEvent("cm-add",{detail:{start:e,allDay:t,view:r(this,v,He)},bubbles:!0,composed:!0}))},qx=function(e,t,i){let s=i*60;if(e.detail>0){let p=e.currentTarget.getBoundingClientRect(),u=Math.floor((e.clientY-p.top)/p.height*60/r(this,v,jt))*r(this,v,jt);s+=Math.max(0,Math.min(59,u))}let l=Math.floor(s/60),d=s%60;a(this,v,Qc).call(this,`${t}T${Sm(l)}:${Sm(d)}`,!1)},Tf=function(e,t){if(performance.now()<r(this,ao)||r(this,Se).active){e.preventDefault();return}this.dispatchEvent(new CustomEvent("cm-open",{detail:{value:t.key,event:t.el},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},Ox=function(e){this._more=e,g(this,no,!0)},Cm=function(e){let t=this._more;this._more="",e&&t&&(g(this,Ut,`more:${t}`),g(this,dt,{key:`more:${t}`,until:Date.now()+1e3}))},Cf=function(){return r(this,se)?.ev??(r(this,ae)?.started?r(this,ae).ev:null)},to=function(e,t,i,s,l,d={}){let p=e.el,u=p.pending,b=a(this,v,Ex).call(this,e),f=!this.readonly&&!p.locked&&!u,x=["attention","information","success","critical"].includes(p.tone)?p.tone:"neutral",y=`chip ${s} tone-${x}${l?" item":""}${p.moving?" moving":""}${u?" pending":""}${p.locked?" locked":""}`,k=p.icon?c`<cm-icon name=${p.icon} size="14"></cm-icon>`:h,S=e.allDay?h:c`<span class="tm">${a(this,v,Wc).call(this,e.min)}</span>`,H=p.kind&&(s!=="month"||!p.icon)?c`<span class="k">${p.kind}</span>`:h,O=u?c`<span class="spin" aria-hidden="true"></span>`:h,V=s==="time"?c`<span class="lead">${k}${S}${O}</span><span class="h">${e.name}</span>${H}`:c`${k}${S}<span class="h">${e.name}</span>${H}${O}`,G=u?`${b}, ${this.t("saving")}`:b,Ue=f?`${r(this,Fe)}-mv`:`${r(this,Fe)}-op`,W=`ev:${e.key}:${t}`,J=f?this.t("roleDescription"):h;return p.href?c`<a class=${y} href=${p.href} style=${d.style??h} data-k=${W} data-ev=${e.key} data-day=${t} data-i=${i}
2957
2960
  data-row=${d.row??h} aria-label=${G} aria-describedby=${Ue} aria-roledescription=${J}
2958
- @click=${ee=>a(this,v,_f).call(this,ee,e)}>${V}</a>`:c`<button type="button" class=${y} style=${d.style??h} data-k=${W} data-ev=${e.key} data-day=${t} data-i=${i}
2961
+ @click=${ee=>a(this,v,Tf).call(this,ee,e)}>${V}</a>`:c`<button type="button" class=${y} style=${d.style??h} data-k=${W} data-ev=${e.key} data-day=${t} data-i=${i}
2959
2962
  data-row=${d.row??h} aria-label=${G} aria-describedby=${Ue} aria-roledescription=${J}
2960
- @click=${ee=>a(this,v,_f).call(this,ee,e)}>${V}</button>`},zm=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.name}</div>`},Bx=function(e){let t=r(this,v,He),i=t==="week"&&this._narrow,s=t==="month"?this.t("previousMonth"):i?this.t("previousDays",{count:3}):t==="week"?this.t("previousWeek"):this.t("previousDay"),l=t==="month"?this.t("nextMonth"):i?this.t("nextDays",{count:3}):t==="week"?this.t("nextWeek"):this.t("nextDay"),d=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2));return c`<div class="head" part="header">
2963
+ @click=${ee=>a(this,v,Tf).call(this,ee,e)}>${V}</button>`},zm=function(e,t="",i){return c`<div class="ph ${t}" style=${i??h} aria-hidden="true">${e.name}</div>`},Bx=function(e){let t=r(this,v,He),i=t==="week"&&this._narrow,s=t==="month"?this.t("previousMonth"):i?this.t("previousDays",{count:3}):t==="week"?this.t("previousWeek"):this.t("previousDay"),l=t==="month"?this.t("nextMonth"):i?this.t("nextDays",{count:3}):t==="week"?this.t("nextWeek"):this.t("nextDay"),d=Math.min(6,Math.max(1,Math.round(Number(this.headingLevel))||2));return c`<div class="head" part="header">
2961
2964
  <div class="nav">
2962
2965
  <button type="button" class="hb icon prev" aria-label=${s} @click=${()=>this.previous()}><cm-icon name="chevron-left" size="18"></cm-icon></button>
2963
2966
  <button type="button" class="hb today" @click=${()=>this.goToToday()}>${this.t("today")}</button>
@@ -2965,12 +2968,12 @@ cm-data-table:has(> table) { container-type: inline-size; }
2965
2968
  </div>
2966
2969
  <div class="title" part="title" id="${r(this,Fe)}-t" role="heading" aria-level=${d} aria-live="polite">${a(this,v,Mx).call(this,e)}${this.loading?c`<cm-spinner size="small" aria-hidden="true"></cm-spinner>`:h}</div>
2967
2970
  <div class="views" role="group" aria-label=${this.t("views")}>
2968
- ${vx.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,v,_x).call(this,p)}>${this.t(p)}</button>`)}
2971
+ ${vx.map(p=>c`<button type="button" class="hb" data-view=${p} aria-pressed=${p===t?"true":"false"} @click=${()=>a(this,v,Tx).call(this,p)}>${this.t(p)}</button>`)}
2969
2972
  </div>
2970
- </div>`},Fx=function(e){let t=r(this,v,Kc),i=Array.from({length:7},(s,l)=>(l+r(this,v,ff))%7);return c`<thead><tr>${i.map(s=>c`<th scope="col" abbr=${t.weekdaysLong[s]}><span aria-hidden="true">${e?t.weekdaysShort[s].slice(0,2):t.weekdaysShort[s]}</span><span class="vh">${t.weekdaysLong[s]}</span></th>`)}</tr></thead>`},Vx=function(e,t){let i=r(this,v,Lt),s=r(this,v,Gc),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,v,Cf).call(this),p=this._target,u=Array.from({length:e.length/7},(V,G)=>e.slice(G*7,G*7+7)),b=this._narrow,f=(V,G,Ue)=>{let W=B(V),J=t.get(W)??[],ee=a(this,v,ct).call(this,V),_i=`${V.getMonth()!==i.getMonth()?"other":""} ${W===s?"today":""} ${p?.iso===W?"over":""}`,tl=c`<span class="num" aria-hidden="true">${r(this,v,Kc).day(V)}</span>`;if(b){let Gt=J.slice(0,3).map(Os=>["attention","information","success","critical"].includes(Os.el.tone)?Os.el.tone:"neutral");return c`<td class=${_i} data-drop data-i=${G} aria-selected=${W===B(i)?"true":"false"} aria-current=${W===s?"date":h}>
2973
+ </div>`},Fx=function(e){let t=r(this,v,Kc),i=Array.from({length:7},(s,l)=>(l+r(this,v,ff))%7);return c`<thead><tr>${i.map(s=>c`<th scope="col" abbr=${t.weekdaysLong[s]}><span aria-hidden="true">${e?t.weekdaysShort[s].slice(0,2):t.weekdaysShort[s]}</span><span class="vh">${t.weekdaysLong[s]}</span></th>`)}</tr></thead>`},Vx=function(e,t){let i=r(this,v,Lt),s=r(this,v,Gc),l=Math.max(1,Math.trunc(Number(this.maxEvents))||3),d=a(this,v,Cf).call(this),p=this._target,u=Array.from({length:e.length/7},(V,G)=>e.slice(G*7,G*7+7)),b=this._narrow,f=(V,G,Ue)=>{let W=B(V),J=t.get(W)??[],ee=a(this,v,ct).call(this,V),Ti=`${V.getMonth()!==i.getMonth()?"other":""} ${W===s?"today":""} ${p?.iso===W?"over":""}`,tl=c`<span class="num" aria-hidden="true">${r(this,v,Kc).day(V)}</span>`;if(b){let Gt=J.slice(0,3).map(Os=>["attention","information","success","critical"].includes(Os.el.tone)?Os.el.tone:"neutral");return c`<td class=${Ti} data-drop data-i=${G} aria-selected=${W===B(i)?"true":"false"} aria-current=${W===s?"date":h}>
2971
2974
  <button type="button" class="dayb item" data-k="day:${W}" data-i=${G} data-day=${W} aria-label=${this.t("dayEvents",{date:ee,count:J.length})}
2972
2975
  @click=${()=>{this.date=W,g(this,Ut,`day:${W}`)}}>${tl}<span class="dots">${Gt.map(Os=>c`<span class="dot tone-${Os}"></span>`)}</span></button>
2973
- </td>`}let qs=J,Nd=0;if(J.length>l){qs=J.slice(0,l-1);let Gt=d&&J.find(Os=>Os.key===d.key);Gt&&!qs.includes(Gt)&&(qs=[...J.slice(0,l-2),Gt]),Nd=J.length-qs.length}let Pd=this.readonly;return c`<td class="${_i}${Pd?" item":""}" data-drop data-i=${G} data-day=${W} data-k=${Pd?`cell:${W}`:h}
2976
+ </td>`}let qs=J,Nd=0;if(J.length>l){qs=J.slice(0,l-1);let Gt=d&&J.find(Os=>Os.key===d.key);Gt&&!qs.includes(Gt)&&(qs=[...J.slice(0,l-2),Gt]),Nd=J.length-qs.length}let Pd=this.readonly;return c`<td class="${Ti}${Pd?" item":""}" data-drop data-i=${G} data-day=${W} data-k=${Pd?`cell:${W}`:h}
2974
2977
  aria-label=${Pd?this.t("dayEvents",{date:ee,count:J.length}):h} aria-current=${W===s?"date":h}>
2975
2978
  <div class="dh">${tl}<span class="vh">${ee}</span>
2976
2979
  ${Pd?h:c`<button type="button" class="add item" data-k="add:${W}" data-i=${G} data-day=${W} aria-label=${this.t("addOn",{date:ee})}
@@ -3020,7 +3023,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3020
3023
  </div>
3021
3024
  <div class="tg-body" role="rowgroup">
3022
3025
  ${b.map(f=>c`<div class="row hr" role="row">
3023
- <div class="axis" role="rowheader"><span>${a(this,v,Tx).call(this,f)}</span></div>
3026
+ <div class="axis" role="rowheader"><span>${a(this,v,_x).call(this,f)}</span></div>
3024
3027
  ${u.map((x,y)=>{let k=x.timed.filter(H=>Math.floor(H.min/60)===f),S=l&&!l.allDay&&d?.iso===x.iso&&d.min!==void 0&&Math.floor(d.min/60)===f;return c`<div class="tcell" role="gridcell" data-i=${y} data-row=${f} data-day=${x.iso}>
3025
3028
  ${p?h:c`<button type="button" class="slot item" data-k="slot:${x.iso}:${f}" data-i=${y} data-row=${f} data-day=${x.iso}
3026
3029
  aria-label=${this.t("addAt",{time:a(this,v,Wc).call(this,f*60),date:x.text})} @click=${H=>a(this,v,qx).call(this,H,x.iso,f)}></button>`}
@@ -3190,7 +3193,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3190
3193
  .chip.time > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3191
3194
  .chip.time .lead { display: flex; align-items: center; gap: 4px; min-width: 0; }
3192
3195
  .ph.time { position: absolute; z-index: 3; inset-inline: 0 2px; inset-block-start: calc(var(--top) * var(--h)); height: calc(var(--len) * var(--h)); align-items: flex-start; }
3193
- `];$("cm-calendar",ro);var IT=C("reportTile",{pinned:", pinned"}),Cs=class extends _{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
3196
+ `];$("cm-calendar",ro);var I_=C("reportTile",{pinned:", pinned"}),Cs=class extends T{constructor(){super(...arguments);this.label="";this.icon="chart";this.href="";this.pinned=!1}render(){let e=c`
3194
3197
  <span class="icon" aria-hidden="true"><slot name="icon"><cm-icon name=${this.icon} size="40"></cm-icon></slot></span>
3195
3198
  <span class="label">${this.label}</span>
3196
3199
  ${this.pinned?c`<span class="pin" part="pin"><cm-icon name="pin" size="16"></cm-icon>
@@ -3227,7 +3230,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3227
3230
  .title { margin-bottom: var(--cm-space-8); }
3228
3231
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--cm-space-8); }
3229
3232
  }
3230
- `];$("cm-report-tiles",co);var VT=C("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Kx=/^\s*-?\d+(\.\d+)?\s*$/,ho=class extends _{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:Kx.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 h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),s=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
3233
+ `];$("cm-report-tiles",co);var V_=C("metric",{up:"Up {change}",down:"Down {change}",flat:"No change {change}",good:"{trend}, good",bad:"{trend}, bad",loadingValue:"Loading {label}"}),Kx=/^\s*-?\d+(\.\d+)?\s*$/,ho=class extends T{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:Kx.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 h;if(!e)return c`<span class="change neutral" part="change">${this.change}</span>`;let t=this.sentiment(),i=this.t(e,{change:this.change}).trim(),s=t==="positive"?this.t("good",{trend:i}):t==="negative"?this.t("bad",{trend:i}):i;return c`<span class="change ${e} ${t}" part="change">
3231
3234
  <cm-icon name=${e==="flat"?"arrow-left":"arrow-up-right"} size="16"></cm-icon><span aria-hidden="true">${this.change}</span><span class="sr">${s}</span>
3232
3235
  </span>`}render(){let e=this._hasHint||!!this.hint,t=this.loading?c`<cm-skeleton variant="block"></cm-skeleton>`:this.figure(),i=this.renderChange(),s=i!==h||e,l=c`
3233
3236
  <span class="label" id="label" part="label">${this.label}</span>
@@ -3272,7 +3275,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3272
3275
  .value { font-size: var(--cm-type-heading-lg-resp-size); }
3273
3276
  }
3274
3277
  @media (forced-colors: active) { .change { color: CanvasText; } }
3275
- `];$("cm-metric",ho);var po=class extends L{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 Gx(this)}};po.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}},po.styles=w`:host { display: none !important; }`;$("cm-nav-item",po);function Gx(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Ei(o);return t.length&&(e.items=t),e}var Ei=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(Gx),zf=o=>o.value||o.href||o.label,Lm=o=>!!o.current||!!o.items?.some(Lm),pr=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},mr=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:zf(n),href:n.href??""}}));var ZT=C("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),pd,md,Rm,K,Sf,Am,Lf,Wx,Yx,Af,Df,Xx,Rf,Hf,Dm,Nf,Jx,mo=class extends _{constructor(){super(...arguments);m(this,K);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;m(this,pd,new Set);m(this,md);m(this,Rm,N("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,K,Sf).call(this),g(this,md,pr(this,()=>a(this,K,Sf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,md)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,K,Am).call(this,e,t);r(this,pd).has(i)||!e.items?.length||(r(this,pd).add(i),(e.expanded||Lm(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let s=a(this,K,Am).call(this,i,e),l=t??!this._open.has(s);if(l===this._open.has(s))return;let d=new Set(this._open);l?d.add(s):d.delete(s),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
3278
+ `];$("cm-metric",ho);var po=class extends L{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 Gx(this)}};po.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}},po.styles=w`:host { display: none !important; }`;$("cm-nav-item",po);function Gx(o){let n=i=>o.getAttribute(i),e={label:n("label")||""};n("icon")&&(e.icon=n("icon")),n("href")&&(e.href=n("href")),n("value")&&(e.value=n("value")),o.hasAttribute("current")&&(e.current=!0),n("badge")&&(e.badge=n("badge")),o.hasAttribute("expanded")&&(e.expanded=!0),o.hasAttribute("primary")&&(e.primary=!0);let t=Ei(o);return t.length&&(e.items=t),e}var Ei=o=>[...o.children].filter(n=>n.localName==="cm-nav-item").map(Gx),zf=o=>o.value||o.href||o.label,Lm=o=>!!o.current||!!o.items?.some(Lm),pr=(o,n)=>{let e=new MutationObserver(n);return e.observe(o,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["label","icon","href","value","current","badge","expanded","primary"]}),e},mr=(o,n)=>o.dispatchEvent(new CustomEvent("cm-navigate",{bubbles:!0,composed:!0,cancelable:!0,detail:{item:n,value:zf(n),href:n.href??""}}));var Z_=C("sideNavigation",{label:"Main",collapse:"Collapse menu",expand:"Expand menu"}),pd,md,Rm,K,Sf,Am,Lf,Wx,Yx,Af,Df,Xx,Rf,Hf,Dm,Nf,Jx,mo=class extends T{constructor(){super(...arguments);m(this,K);this.items=[];this.collapsed=!1;this.collapsible=!1;this._slotted=[];this._open=new Set;m(this,pd,new Set);m(this,md);m(this,Rm,N("cm-sidenav"))}connectedCallback(){super.connectedCallback(),a(this,K,Sf).call(this),g(this,md,pr(this,()=>a(this,K,Sf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,md)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}willUpdate(){this.navItems.forEach((e,t)=>{let i=a(this,K,Am).call(this,e,t);r(this,pd).has(i)||!e.items?.length||(r(this,pd).add(i),(e.expanded||Lm(e))&&this._open.add(i))})}toggle(e,t){let i=this.navItems[e];if(!i?.items?.length)return;let s=a(this,K,Am).call(this,i,e),l=t??!this._open.has(s);if(l===this._open.has(s))return;let d=new Set(this._open);l?d.add(s):d.delete(s),this._open=d,this.dispatchEvent(new CustomEvent("cm-expand",{bubbles:!0,composed:!0,detail:{item:i,expanded:l}}))}render(){let e=this.collapsed;return c`
3276
3279
  <nav part="nav" aria-label=${this.label||this.t("label")} @keydown=${a(this,K,Yx)}>
3277
3280
  <slot name="header"></slot>
3278
3281
  <ul part="list">
@@ -3352,7 +3355,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3352
3355
  .icon { background: var(--cm-bg-input-filled); color: var(--cm-icon-selected); }
3353
3356
  img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
3354
3357
  @media (forced-colors: active) { .avatar { border: 1px solid CanvasText; } }
3355
- `];$("cm-avatar",uo);var l_=C("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),bo,Mi,vo,Ne,ud,Pf,go,fo=class extends _{constructor(){super();m(this,Ne);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;m(this,bo);m(this,Mi,!1);m(this,vo,null);this.addEventListener("cm-select",e=>{let t=a(this,Ne,ud).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,Ne,ud).call(this)?.focus();return}this._searchOpen||(g(this,vo,Au()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,bo,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,bo).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,bo)?.disconnect(),r(this,Mi)&&(jl(),g(this,Mi,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,Mi)||(Lu(),g(this,Mi,!0)),a(this,Ne,ud).call(this)?.focus(),a(this,Ne,go).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,Mi)&&(jl(),g(this,Mi,!1));let i=r(this,vo)??this.renderRoot.querySelector(".search-btn");g(this,vo,null),i?.isConnected&&i.focus(),a(this,Ne,go).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
3358
+ `];$("cm-avatar",uo);var lT=C("headerBar",{label:"Admin",store:"Store: {store}. Switch store",balance:"Wallet balance {balance}",account:"Account: {name}",search:"Search"}),bo,Mi,vo,Ne,ud,Pf,go,fo=class extends T{constructor(){super();m(this,Ne);this.store="";this.balance="";this.userName="";this.avatarSrc="";this._narrow=!1;this._hasSearch=!1;this._searchOpen=!1;m(this,bo);m(this,Mi,!1);m(this,vo,null);this.addEventListener("cm-select",e=>{let t=a(this,Ne,ud).call(this);this._searchOpen&&t&&e.composedPath().includes(t)&&this.closeSearch()})}get searchOpen(){return this._searchOpen}openSearch(){if(!this._narrow){a(this,Ne,ud).call(this)?.focus();return}this._searchOpen||(g(this,vo,Au()),this._searchOpen=!0)}closeSearch(){this._searchOpen&&(this._searchOpen=!1)}connectedCallback(){super.connectedCallback(),g(this,bo,new ResizeObserver(([e])=>{let t=e.contentRect.width<=900;t!==this._narrow&&(this._narrow=t,t||this.closeSearch())})),r(this,bo).observe(this)}disconnectedCallback(){super.disconnectedCallback(),r(this,bo)?.disconnect(),r(this,Mi)&&(jl(),g(this,Mi,!1))}updated(e){if(!e.has("_searchOpen"))return;let t=this.renderRoot.querySelector("dialog.layer");if(this._searchOpen&&t&&!t.open)t.showModal(),r(this,Mi)||(Lu(),g(this,Mi,!0)),a(this,Ne,ud).call(this)?.focus(),a(this,Ne,go).call(this,"cm-search-toggle",{open:!0});else if(!this._searchOpen&&e.get("_searchOpen")){t?.open&&t.close(),r(this,Mi)&&(jl(),g(this,Mi,!1));let i=r(this,vo)??this.renderRoot.querySelector(".search-btn");g(this,vo,null),i?.isConnected&&i.focus(),a(this,Ne,go).call(this,"cm-search-toggle",{open:!1})}}render(){return c`
3356
3359
  <header part="bar" role="banner" aria-label=${this.label||h}>
3357
3360
  <div class="logo"><slot name="logo"></slot></div>
3358
3361
  ${this.store?c`<button type="button" class="store" part="store" aria-haspopup="true" aria-label=${this.t("store",{store:this.store})}
@@ -3457,7 +3460,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3457
3460
  @media (pointer: coarse) {
3458
3461
  @container (max-width: 640px) { .user { min-width: var(--_touch); } }
3459
3462
  }
3460
- `];$("cm-header-bar",fo);var g_=C("bottomNavigation",{label:"Main"}),gd,zs,If,Qx,yo=class extends _{constructor(){super(...arguments);m(this,zs);this.items=[];this.fixed=!1;this._slotted=[];m(this,gd)}connectedCallback(){super.connectedCallback(),a(this,zs,If).call(this),g(this,gd,pr(this,()=>a(this,zs,If).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,gd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3463
+ `];$("cm-header-bar",fo);var gT=C("bottomNavigation",{label:"Main"}),gd,zs,If,Qx,yo=class extends T{constructor(){super(...arguments);m(this,zs);this.items=[];this.fixed=!1;this._slotted=[];m(this,gd)}connectedCallback(){super.connectedCallback(),a(this,zs,If).call(this),g(this,gd,pr(this,()=>a(this,zs,If).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,gd)?.disconnect()}get navItems(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3461
3464
  <ul>${this.navItems.slice(0,5).map(e=>c`<li>${a(this,zs,Qx).call(this,e)}</li>`)}</ul>
3462
3465
  <slot hidden></slot>
3463
3466
  </nav>`}};gd=new WeakMap,zs=new WeakSet,If=function(){this._slotted=Ei(this)},Qx=function(e){let t=`item ${e.primary?"primary":""}`,i=c`<span class="icon">${e.icon?c`<cm-icon name=${e.icon} size=${e.primary?16:20}></cm-icon>`:h}</span><span class="label">${e.label}</span>`,s=l=>{mr(this,e)||l.preventDefault()};return e.href?c`<a class=${t} part="item" href=${e.href} aria-current=${e.current?"page":h} @click=${s}>${i}</a>`:c`<button type="button" class=${t} part="item" aria-current=${e.current?"page":h} @click=${s}>${i}</button>`},yo.properties={items:{type:Array},label:{string:"label"},fixed:{type:Boolean,reflect:!0},_slotted:{state:!0}},yo.styles=[E,w`
@@ -3482,7 +3485,7 @@ cm-data-table:has(> table) { container-type: inline-size; }
3482
3485
  .icon { display: grid; place-items: center; width: var(--cm-icon-size-lg); height: var(--cm-icon-size-lg); }
3483
3486
  .primary .icon { color: var(--cm-action-primary-text); background: var(--cm-action-primary); border-radius: var(--cm-radius-xs); }
3484
3487
  .label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
3485
- `];$("cm-bottom-navigation",yo);var $_=C("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),fd,Ss,je,qf,ew,Of,Bf,tw,xo=class extends _{constructor(){super(...arguments);m(this,je);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;m(this,fd);m(this,Ss,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,je,qf).call(this),g(this,fd,pr(this,()=>a(this,je,qf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,fd)?.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?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Ss)}-sub"
3488
+ `];$("cm-bottom-navigation",yo);var $T=C("mobileMenu",{label:"Menu",profile:"Profile",store:"Logged in to store"}),fd,Ss,je,qf,ew,Of,Bf,tw,xo=class extends T{constructor(){super(...arguments);m(this,je);this.items=[];this.store="";this.userName="";this.userEmail="";this.avatarSrc="";this._slotted=[];this._page=null;m(this,fd);m(this,Ss,N("cm-mmenu"))}connectedCallback(){super.connectedCallback(),a(this,je,qf).call(this),g(this,fd,pr(this,()=>a(this,je,qf).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,fd)?.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?c`<nav part="nav" class="sub" aria-label=${this.label||this.t("label")} id="${r(this,Ss)}-sub"
3486
3489
  @keydown=${i=>{i.key==="Escape"&&(i.preventDefault(),this.back())}}>
3487
3490
  <button type="button" class="back" part="back" @click=${()=>this.back()}><cm-icon name="arrow-left" size="16"></cm-icon>
3488
3491
  ${t.label}</button>
@@ -3548,7 +3551,7 @@ ${t.label}</button>
3548
3551
  }
3549
3552
  .back:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
3550
3553
  .sub .row { font-size: var(--cm-font-size-14); line-height: var(--cm-line-height-14); }
3551
- `];$("cm-mobile-menu",xo);var C_=C("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Hm,iw,wo=class extends _{constructor(){super(...arguments);m(this,Hm);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
3554
+ `];$("cm-mobile-menu",xo);var CT=C("flashOfferBar",{label:"Offer",dismiss:"Dismiss offer"}),Hm,iw,wo=class extends T{constructor(){super(...arguments);m(this,Hm);this.icon="send";this.dismissible=!1}render(){return c`<div class="bar" part="bar" role="region" aria-label=${this.label||this.t("label")}>
3552
3555
  <span class="icon" aria-hidden="true"><slot name="icon">${this.icon?c`<cm-icon name=${this.icon} size="20"></cm-icon>`:h}</slot></span>
3553
3556
  <span class="text"><slot></slot></span>
3554
3557
  ${this.dismissible?c`<button type="button" class="close" part="close" aria-label=${this.t("dismiss")} @click=${a(this,Hm,iw)}><cm-icon name="close" size="16"></cm-icon>
@@ -3575,7 +3578,7 @@ ${t.label}</button>
3575
3578
  @media (max-width: 640px) {
3576
3579
  .bar { min-height: 44px; justify-content: flex-start; text-align: start; }
3577
3580
  }
3578
- `];$("cm-flash-offer-bar",wo);var H_=C("linkTabs",{label:"Sections"}),bd,vd,Ff,$o=class extends _{constructor(){super(...arguments);m(this,vd);this.items=[];this._slotted=[];m(this,bd)}connectedCallback(){super.connectedCallback(),a(this,vd,Ff).call(this),g(this,bd,pr(this,()=>a(this,vd,Ff).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,bd)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3581
+ `];$("cm-flash-offer-bar",wo);var HT=C("linkTabs",{label:"Sections"}),bd,vd,Ff,$o=class extends T{constructor(){super(...arguments);m(this,vd);this.items=[];this._slotted=[];m(this,bd)}connectedCallback(){super.connectedCallback(),a(this,vd,Ff).call(this),g(this,bd,pr(this,()=>a(this,vd,Ff).call(this)))}disconnectedCallback(){super.disconnectedCallback(),r(this,bd)?.disconnect()}get tabs(){return this.items.length?this.items:this._slotted}render(){return c`<nav part="nav" aria-label=${this.label||this.t("label")}>
3579
3582
  <ul part="tabs">${this.tabs.map(e=>c`<li><a part="tab" href=${e.href||"#"} aria-current=${e.current?"page":h}
3580
3583
  @click=${t=>{mr(this,e)||t.preventDefault()}}>${e.label}${e.badge?c`<span class="badge">(${e.badge})</span>`:h}</a></li>`)}</ul>
3581
3584
  <slot hidden></slot>
@@ -3598,7 +3601,7 @@ ${t.label}</button>
3598
3601
  .badge { font-size: var(--cm-font-size-12); color: var(--cm-text-tertiary); font-variant-numeric: tabular-nums; }
3599
3602
  @media (max-width: 640px) { ul { gap: var(--cm-space-16); } }
3600
3603
 
3601
- `];$("cm-link-tabs",$o);var B_=C("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}"}),ko=class extends _{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}):"",s=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
3604
+ `];$("cm-link-tabs",$o);var BT=C("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}"}),ko=class extends T{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}):"",s=t?this.formatNumber(this.rating,{minimumFractionDigits:1,maximumFractionDigits:1}):"";return c`<article part="card" aria-labelledby="name">
3602
3605
  <div class="logo" part="logo"><slot name="logo"></slot></div>
3603
3606
  <div class="status"><slot name="status"></slot></div>
3604
3607
  <div class="name" id="name" role="heading" aria-level=${e}>${this.name}</div>
@@ -3679,23 +3682,23 @@ ${t.label}</button>
3679
3682
  .panel { border-radius: var(--cm-radius-lg); }
3680
3683
 
3681
3684
  }
3682
- `];$("cm-side-panel",Kt);var rC=C("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),To,Im,Mo=class extends Kt{constructor(){super(...arguments);this.search=!1;this.query="";m(this,To,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});m(this,Im,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(s,l)=>{if(l==="")return;let d=e[s];e[s]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[s,l]of new FormData(i))typeof l=="string"&&t(s,l);return e}return this.querySelectorAll("[name]").forEach(s=>{let l=s.getAttribute("name");"checked"in s&&(s.type==="checkbox"||s.type==="radio"||s.localName.match(/^cm-(checkbox|radio|toggle)$/))?s.checked&&t(l,s.value||"on"):typeof s.value=="string"&&t(l,s.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
3685
+ `];$("cm-side-panel",Kt);var rC=C("filterPanel",{heading:"Search and Filter",searchLabel:"Search",searchPlaceholder:"Search anything",apply:"Search",reset:"Reset"}),_o,Im,Mo=class extends Kt{constructor(){super(...arguments);this.search=!1;this.query="";m(this,_o,()=>{this.dispatchEvent(new CustomEvent("cm-filter-apply",{detail:{values:this.values,query:this.query},bubbles:!0,composed:!0,cancelable:!0}))&&this.requestClose("action")});m(this,Im,()=>{this.reset(),this.dispatchEvent(new CustomEvent("cm-filter-reset",{bubbles:!0,composed:!0}))})}get form(){return this.querySelector("form")}get values(){let e={},t=(s,l)=>{if(l==="")return;let d=e[s];e[s]=d===void 0?l:Array.isArray(d)?[...d,l]:[d,l]},i=this.form;if(i){for(let[s,l]of new FormData(i))typeof l=="string"&&t(s,l);return e}return this.querySelectorAll("[name]").forEach(s=>{let l=s.getAttribute("name");"checked"in s&&(s.type==="checkbox"||s.type==="radio"||s.localName.match(/^cm-(checkbox|radio|toggle)$/))?s.checked&&t(l,s.value||"on"):typeof s.value=="string"&&t(l,s.value)}),e}reset(){let e=this.form;e?e.reset():this.querySelectorAll("[name]").forEach(t=>t.formResetCallback?.()),this.query=""}renderBody(){return c`${this.search?c`<cm-search class="search" part="search" .value=${this.query} label=${this.searchLabel}
3683
3686
  placeholder=${this.searchPlaceholder}
3684
3687
  @input=${e=>{this.query=e.target.value}}
3685
- @cm-search=${e=>{e.stopPropagation(),r(this,To).call(this)}}></cm-search>`:h}
3686
- <slot @submit=${e=>{e.preventDefault(),r(this,To).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${r(this,Im)}>${this.resetLabel}</cm-button>
3687
- <cm-button part="apply" variant="primary" @click=${r(this,To)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};To=new WeakMap,Im=new WeakMap,Mo.properties={...Kt.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"}},Mo.styles=[...Kt.styles,w`
3688
+ @cm-search=${e=>{e.stopPropagation(),r(this,_o).call(this)}}></cm-search>`:h}
3689
+ <slot @submit=${e=>{e.preventDefault(),r(this,_o).call(this)}}></slot>`}renderFooter(){return c`<cm-button part="reset" @click=${r(this,Im)}>${this.resetLabel}</cm-button>
3690
+ <cm-button part="apply" variant="primary" @click=${r(this,_o)}>${this.applyLabel}</cm-button>`}get showFooter(){return!0}};_o=new WeakMap,Im=new WeakMap,Mo.properties={...Kt.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"}},Mo.styles=[...Kt.styles,w`
3688
3691
  .search { display: block; margin-bottom: var(--cm-space-20); }
3689
3692
  .foot { justify-content: center; }
3690
3693
  ::slotted(form) { display: grid; gap: var(--cm-space-12); }
3691
- `];$("cm-filter-panel",Mo);var dC=C("accountMenu",{trigger:"Account: {name}"}),_o=class extends Ht{constructor(){super();this.name="";this.avatarSrc="";this.meta="";this.profileHref="";this.orgName="";this.orgMeta="";this.orgHref="";this.plan="";this.align="end"}triggerTemplate(e,t){return c`<button type="button" class="trigger account" part="trigger" aria-haspopup="menu" aria-expanded=${String(this.open)}
3694
+ `];$("cm-filter-panel",Mo);var dC=C("accountMenu",{trigger:"Account: {name}"}),To=class extends Ht{constructor(){super();this.name="";this.avatarSrc="";this.meta="";this.profileHref="";this.orgName="";this.orgMeta="";this.orgHref="";this.plan="";this.align="end"}triggerTemplate(e,t){return c`<button type="button" class="trigger account" part="trigger" aria-haspopup="menu" aria-expanded=${String(this.open)}
3692
3695
  aria-label=${this.t("trigger",{name:this.name})} ?disabled=${this.disabled} @click=${e} @keydown=${t}>
3693
3696
  <cm-avatar name=${this.name} src=${this.avatarSrc||h} decorative></cm-avatar></button>`}headTemplate(){let e=(t,i,s,l,d)=>{let p=c`${s}<span class="who"><strong>${l}</strong>${d?c`<span>${d}</span>`:h}</span>${t?c`<cm-icon class="chev" name="chevron-right" size="16"></cm-icon>`:h}`;return t?c`<a class="row" part=${i} href=${t}>${p}</a>`:c`<div class="row" part=${i}>${p}</div>`};return c`<div class="acct">
3694
3697
  ${e(this.profileHref,"profile",c`<span class="ring"><cm-avatar name=${this.name} src=${this.avatarSrc||h} decorative></cm-avatar></span>`,this.name,this.meta)}
3695
3698
  ${this.orgName?c`<div class="split"></div>
3696
3699
  ${e(this.orgHref,"org",c`<span class="logo"><slot name="org-logo"><cm-icon name="store" size="20"></cm-icon></slot></span>`,this.orgName,this.orgMeta)}
3697
3700
  ${this.plan?c`<div class="plan"><cm-icon name="check-circle" size="16"></cm-icon>${this.plan}</div>`:h}`:h}
3698
- </div>`}};_o.properties={...Ht.properties,name:{},avatarSrc:{attribute:"avatar-src"},meta:{},profileHref:{attribute:"profile-href"},orgName:{attribute:"org-name"},orgMeta:{attribute:"org-meta"},orgHref:{attribute:"org-href"},plan:{}},_o.styles=[...Ht.styles,w`
3701
+ </div>`}};To.properties={...Ht.properties,name:{},avatarSrc:{attribute:"avatar-src"},meta:{},profileHref:{attribute:"profile-href"},orgName:{attribute:"org-name"},orgMeta:{attribute:"org-meta"},orgHref:{attribute:"org-href"},plan:{}},To.styles=[...Ht.styles,w`
3699
3702
  /* The avatar button: 36px round with a ring (40 and a 44px hit area on touch screens). */
3700
3703
  .trigger.account {
3701
3704
  position: relative; width: var(--cm-control-height-md, 36px); height: var(--cm-control-height-md, 36px); min-height: 0; padding: 2px;
@@ -3728,8 +3731,8 @@ ${t.label}</button>
3728
3731
  .plan cm-icon { color: var(--cm-text-success); }
3729
3732
  .split { height: 0; margin: var(--cm-space-4) var(--cm-space-12); border-top: var(--cm-border-1) solid var(--cm-border-subtle); }
3730
3733
  :host(:dir(rtl)) .chev { transform: scaleX(-1); }
3731
- `];$("cm-account-menu",_o);var gC=C("sparkline",{summary:"{label}: {total} in all, peak {peak}, latest {latest}",summaryAt:"{label}: {total} in all, peak {peak} on {when}, latest {latest}",empty:"{label}: no data"}),_0=o=>{if(!o)return[];let n=o.trim(),e=[];if(n.startsWith("["))try{e=JSON.parse(n)}catch{e=[]}else e=n.split(",");return e.map(t=>{let i=Number(t);return Number.isFinite(i)?i:0})},C0=o=>{if(!o)return[];let n=o.trim();if(n.startsWith("["))try{return JSON.parse(n).map(String)}catch{return[]}return n.split(",").map(e=>e.trim())},Co=class extends _{constructor(){super(...arguments);this.values=[];this.labels=[];this.label="";this.type="bars";this.tone="neutral"}get summary(){let e=this.values??[],t=this.label||"";if(!e.length)return this.t("empty",{label:t});let i=e.reduce((u,b)=>u+b,0),s=Math.max(...e),l=e.indexOf(s),d={label:t,total:this.formatNumber(i),peak:this.formatNumber(s),latest:this.formatNumber(e[e.length-1])},p=this.labels?.[l];return p?this.t("summaryAt",{...d,when:p}):this.t("summary",d)}render(){let e=this.values??[],t=e.length,i=100,s=32,l=2,d=Math.max(1,...e.map(f=>Math.max(0,f))),p=f=>s-Math.max(0,f)/d*(s-l),u=f=>this.labels?.[f]?`${this.labels[f]}: ${this.formatNumber(e[f])}`:"",b=h;if(t&&this.type==="line"){let f=t>1?i/(t-1):0,x=e.map((k,S)=>`${(t>1?S*f:i/2).toFixed(2)},${p(k).toFixed(2)}`).join(" "),y=x.split(" ").pop().split(",");b=Xt`<polyline class="line" points=${x}></polyline><line class="dot" x1=${y[0]} y1=${y[1]} x2=${y[0]} y2=${y[1]}></line>`}else if(t){let f=i/t,x=t>1?Math.min(f*.25,2):0,y=f-x;b=e.map((k,S)=>{let H=Math.max(k>0?1.5:0,s-p(k)),O=u(S);return Xt`<rect class=${S===t-1?"bar last":"bar"} x=${(S*f+x/2).toFixed(2)} y=${(s-H).toFixed(2)} width=${y.toFixed(2)} height=${H.toFixed(2)} rx="0.6">${O?Xt`<title>${O}</title>`:h}</rect>`})}return c`<svg part="chart" role="img" aria-label=${this.summary} viewBox="0 0 ${i} ${s}" preserveAspectRatio="none">
3732
- <line class="base" x1="0" y1=${s} x2=${i} y2=${s}></line>${b}</svg>`}};Co.properties={values:{converter:{fromAttribute:_0}},labels:{converter:{fromAttribute:C0}},label:{},type:{reflect:!0},tone:{reflect:!0}},Co.styles=[E,w`
3734
+ `];$("cm-account-menu",To);var gC=C("sparkline",{summary:"{label}: {total} in all, peak {peak}, latest {latest}",summaryAt:"{label}: {total} in all, peak {peak} on {when}, latest {latest}",empty:"{label}: no data"}),T0=o=>{if(!o)return[];let n=o.trim(),e=[];if(n.startsWith("["))try{e=JSON.parse(n)}catch{e=[]}else e=n.split(",");return e.map(t=>{let i=Number(t);return Number.isFinite(i)?i:0})},C0=o=>{if(!o)return[];let n=o.trim();if(n.startsWith("["))try{return JSON.parse(n).map(String)}catch{return[]}return n.split(",").map(e=>e.trim())},Co=class extends T{constructor(){super(...arguments);this.values=[];this.labels=[];this.label="";this.type="bars";this.tone="neutral"}get summary(){let e=this.values??[],t=this.label||"";if(!e.length)return this.t("empty",{label:t});let i=e.reduce((u,b)=>u+b,0),s=Math.max(...e),l=e.indexOf(s),d={label:t,total:this.formatNumber(i),peak:this.formatNumber(s),latest:this.formatNumber(e[e.length-1])},p=this.labels?.[l];return p?this.t("summaryAt",{...d,when:p}):this.t("summary",d)}render(){let e=this.values??[],t=e.length,i=100,s=32,l=2,d=Math.max(1,...e.map(f=>Math.max(0,f))),p=f=>s-Math.max(0,f)/d*(s-l),u=f=>this.labels?.[f]?`${this.labels[f]}: ${this.formatNumber(e[f])}`:"",b=h;if(t&&this.type==="line"){let f=t>1?i/(t-1):0,x=e.map((k,S)=>`${(t>1?S*f:i/2).toFixed(2)},${p(k).toFixed(2)}`).join(" "),y=x.split(" ").pop().split(",");b=Xt`<polyline class="line" points=${x}></polyline><line class="dot" x1=${y[0]} y1=${y[1]} x2=${y[0]} y2=${y[1]}></line>`}else if(t){let f=i/t,x=t>1?Math.min(f*.25,2):0,y=f-x;b=e.map((k,S)=>{let H=Math.max(k>0?1.5:0,s-p(k)),O=u(S);return Xt`<rect class=${S===t-1?"bar last":"bar"} x=${(S*f+x/2).toFixed(2)} y=${(s-H).toFixed(2)} width=${y.toFixed(2)} height=${H.toFixed(2)} rx="0.6">${O?Xt`<title>${O}</title>`:h}</rect>`})}return c`<svg part="chart" role="img" aria-label=${this.summary} viewBox="0 0 ${i} ${s}" preserveAspectRatio="none">
3735
+ <line class="base" x1="0" y1=${s} x2=${i} y2=${s}></line>${b}</svg>`}};Co.properties={values:{converter:{fromAttribute:T0}},labels:{converter:{fromAttribute:C0}},label:{},type:{reflect:!0},tone:{reflect:!0}},Co.styles=[E,w`
3733
3736
  :host { display: block; width: 100%; max-width: var(--cm-sparkline-width, none); height: var(--cm-sparkline-height, 32px); color: var(--cm-icon-default); }
3734
3737
  :host([tone='information']) { color: var(--cm-text-information); }
3735
3738
  :host([tone='success']) { color: var(--cm-text-success); }
@@ -3786,7 +3789,7 @@ ${t.label}</button>
3786
3789
  }
3787
3790
  @keyframes cm-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
3788
3791
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
3789
- `];$("cm-bottom-sheet",zo);var _C=C("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),z0={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},So=class extends L{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};So.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},So.styles=w`:host { display: none; }`;$("cm-notification-item",So);var Ao,Ze,jf,Uf,nw,ow,lw,Lo=class extends oe{constructor(){super(...arguments);m(this,Ze);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;m(this,Ao)}connectedCallback(){super.connectedCallback(),a(this,Ze,jf).call(this),g(this,Ao,new MutationObserver(()=>a(this,Ze,jf).call(this))),r(this,Ao).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Ao)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(s=>s.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${a(this,Ze,ow)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
3792
+ `];$("cm-bottom-sheet",zo);var TC=C("notificationPanel",{heading:"Notifications",more:"See more notifications",empty:"No notifications yet.",unread:"Unread: ",markAllRead:"Mark all read"}),z0={information:"bag",attention:"alert",success:"check-circle",critical:"x-circle"},So=class extends L{constructor(){super(...arguments);this.time="";this.tone="information";this.href="";this.unread=!1;this.value="";this.description="";this.icon=""}render(){return null}};So.properties={time:{reflect:!0},tone:{reflect:!0},href:{reflect:!0},unread:{type:Boolean,reflect:!0},value:{reflect:!0},description:{reflect:!0},icon:{reflect:!0}},So.styles=w`:host { display: none; }`;$("cm-notification-item",So);var Ao,Ze,jf,Uf,nw,ow,lw,Lo=class extends oe{constructor(){super(...arguments);m(this,Ze);this.items=[];this.moreHref="";this.markAllRead=!1;this.loading=!1;this._slotted=[];this._footer=!1;m(this,Ao)}connectedCallback(){super.connectedCallback(),a(this,Ze,jf).call(this),g(this,Ao,new MutationObserver(()=>a(this,Ze,jf).call(this))),r(this,Ao).observe(this,{childList:!0,subtree:!0,attributes:!0,characterData:!0})}disconnectedCallback(){super.disconnectedCallback(),r(this,Ao)?.disconnect()}get notifications(){return this.items.length?this.items:this._slotted}render(){let e=this.notifications,t=this.markAllRead&&!this.loading&&e.some(s=>s.unread)?c`<button type="button" class="mark" part="mark-all-read" @click=${a(this,Ze,ow)}>${this.markAllLabel}</button>`:h,i=this.loading?c`<ul class="loading" part="list" aria-hidden="true">${[0,1,2].map(()=>c`<li>
3790
3793
  <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?c`<ul class="list" part="list">${e.map(s=>c`<li>${a(this,Ze,nw).call(this,s)}</li>`)}</ul>`:c`<p class="empty">${this.emptyText}</p>`;return this.renderDialog(c`<div class="panel" part="panel" tabindex="-1">
3791
3794
  ${this.renderHeader(t)}
3792
3795
  ${i}
@@ -3846,7 +3849,7 @@ ${t.label}</button>
3846
3849
  @media (max-width: 599px) {
3847
3850
  dialog { inset: var(--cm-notification-panel-top, 56px) 8px auto 8px; width: auto; }
3848
3851
  }
3849
- `];$("cm-notification-panel",Lo);var DC=C("toastRegion",{label:"Notifications"}),RC=C("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),cw=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},Kf=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},S0=2e3,dw=1e4,hw=150,xd,Dt,Ti,wd,No,Po,As,ur,Ds,$e,qm,pw,Do,Gf,$d,kd,Ed,Md,mw,Ro=class extends _{constructor(){super(...arguments);m(this,$e);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;m(this,xd);m(this,Dt);m(this,Ti,0);m(this,wd,0);m(this,No,!1);m(this,Po,!1);m(this,As);m(this,ur);m(this,Ds);m(this,$d,()=>{g(this,No,!0),a(this,$e,Gf).call(this)});m(this,kd,()=>{g(this,No,!1),a(this,$e,Do).call(this)});m(this,Ed,()=>{g(this,Po,!0),a(this,$e,Gf).call(this)});m(this,Md,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Po,!1),a(this,$e,Do).call(this))})}get closed(){if(!r(this,As)){if(!this.open&&r(this,Ds))return Promise.resolve(r(this,Ds));g(this,As,new Promise(e=>{g(this,ur,e)}))}return r(this,As)}get effectiveDuration(){let e=this.duration??(this.actionLabel?dw:5e3);return Math.min(dw,Math.max(S0,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,xd,setTimeout(()=>{this._primed=!0},hw)),this.addEventListener("pointerenter",r(this,$d)),this.addEventListener("pointerleave",r(this,kd)),this.addEventListener("focusin",r(this,Ed)),this.addEventListener("focusout",r(this,Md))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,ur)&&queueMicrotask(()=>{!this.isConnected&&this.open&&a(this,$e,qm).call(this,"removed")}),clearTimeout(r(this,Dt)),clearTimeout(r(this,xd)),this.removeEventListener("pointerenter",r(this,$d)),this.removeEventListener("pointerleave",r(this,kd)),this.removeEventListener("focusin",r(this,Ed)),this.removeEventListener("focusout",r(this,Md))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Ds,void 0):r(this,ur)&&a(this,$e,qm).call(this,"close")),(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,Dt)),this.open&&(this._inRegion||this._primed)&&(g(this,Ti,this.effectiveDuration),a(this,$e,Do).call(this)))}show(){this.open?(g(this,Ti,this.effectiveDuration),a(this,$e,Do).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(r(this,Dt)),this.open=!1,a(this,$e,qm).call(this,e),!0):(e==="timeout"&&(g(this,Ti,this.effectiveDuration),a(this,$e,Do).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
3852
+ `];$("cm-notification-panel",Lo);var DC=C("toastRegion",{label:"Notifications"}),RC=C("toast",{undo:"Undo",shortcut:"Press F6 to reach it."}),cw=()=>{let o=document.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o&&o!==document.body?o:null},Kf=(o,n)=>{for(let e=n;e;e=e.parentNode??e.host??null)if(e===o)return!0;return!1},S0=2e3,dw=1e4,hw=150,xd,Dt,_i,wd,No,Po,As,ur,Ds,$e,qm,pw,Do,Gf,$d,kd,Ed,Md,mw,Ro=class extends T{constructor(){super(...arguments);m(this,$e);this.message="";this.tone="default";this.actionLabel="";this.open=!0;this._inRegion=!1;this._primed=!1;m(this,xd);m(this,Dt);m(this,_i,0);m(this,wd,0);m(this,No,!1);m(this,Po,!1);m(this,As);m(this,ur);m(this,Ds);m(this,$d,()=>{g(this,No,!0),a(this,$e,Gf).call(this)});m(this,kd,()=>{g(this,No,!1),a(this,$e,Do).call(this)});m(this,Ed,()=>{g(this,Po,!0),a(this,$e,Gf).call(this)});m(this,Md,e=>{e.relatedTarget instanceof Node&&this.contains(e.relatedTarget)||e.relatedTarget instanceof Node&&this.shadowRoot?.contains(e.relatedTarget)||(g(this,Po,!1),a(this,$e,Do).call(this))})}get closed(){if(!r(this,As)){if(!this.open&&r(this,Ds))return Promise.resolve(r(this,Ds));g(this,As,new Promise(e=>{g(this,ur,e)}))}return r(this,As)}get effectiveDuration(){let e=this.duration??(this.actionLabel?dw:5e3);return Math.min(dw,Math.max(S0,Number(e)||5e3))}connectedCallback(){super.connectedCallback(),this._inRegion=!!this.parentElement?.closest("cm-toast-region"),!this._inRegion&&!this._primed&&g(this,xd,setTimeout(()=>{this._primed=!0},hw)),this.addEventListener("pointerenter",r(this,$d)),this.addEventListener("pointerleave",r(this,kd)),this.addEventListener("focusin",r(this,Ed)),this.addEventListener("focusout",r(this,Md))}disconnectedCallback(){super.disconnectedCallback(),this.open&&r(this,ur)&&queueMicrotask(()=>{!this.isConnected&&this.open&&a(this,$e,qm).call(this,"removed")}),clearTimeout(r(this,Dt)),clearTimeout(r(this,xd)),this.removeEventListener("pointerenter",r(this,$d)),this.removeEventListener("pointerleave",r(this,kd)),this.removeEventListener("focusin",r(this,Ed)),this.removeEventListener("focusout",r(this,Md))}updated(e){e.has("open")&&e.get("open")!==void 0&&(this.open?g(this,Ds,void 0):r(this,ur)&&a(this,$e,qm).call(this,"close")),(e.has("open")||e.has("duration")||e.has("actionLabel")||e.has("_primed")||e.has("_inRegion"))&&(clearTimeout(r(this,Dt)),this.open&&(this._inRegion||this._primed)&&(g(this,_i,this.effectiveDuration),a(this,$e,Do).call(this)))}show(){this.open?(g(this,_i,this.effectiveDuration),a(this,$e,Do).call(this)):this.open=!0}dismiss(e="close"){let t=new CustomEvent("cm-dismiss",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e}});return this.dispatchEvent(t)?(clearTimeout(r(this,Dt)),this.open=!1,a(this,$e,qm).call(this,e),!0):(e==="timeout"&&(g(this,_i,this.effectiveDuration),a(this,$e,Do).call(this)),!1)}render(){let e=c`<div class="toast" part="toast">
3850
3853
  ${this.tone==="critical"?c`<cm-icon class="icon" name="alert" size="20"></cm-icon>`:h}
3851
3854
  <div class="message" part="message">${this.message}<slot></slot></div>
3852
3855
  ${this.actionLabel?c`<button class="action" part="action" aria-keyshortcuts=${this._inRegion?"F6":h} @click=${a(this,$e,mw)}>${this.actionLabel}</button>`:h}
@@ -3854,7 +3857,7 @@ ${t.label}</button>
3854
3857
  <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>
3855
3858
  </button>
3856
3859
  ${this.actionLabel&&this._inRegion&&this.t("shortcut")?c`<span class="hint">${this.t("shortcut")}</span>`:h}
3857
- </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};xd=new WeakMap,Dt=new WeakMap,Ti=new WeakMap,wd=new WeakMap,No=new WeakMap,Po=new WeakMap,As=new WeakMap,ur=new WeakMap,Ds=new WeakMap,$e=new WeakSet,qm=function(e){g(this,Ds,e);let t=r(this,ur);g(this,As,g(this,ur,void 0)),t?.(e)},pw=function(){return r(this,No)||r(this,Po)},Do=function(){clearTimeout(r(this,Dt)),!(!this.open||r(this,$e,pw))&&(g(this,wd,Date.now()),g(this,Dt,setTimeout(()=>this.dismiss("timeout"),r(this,Ti))))},Gf=function(){r(this,Dt)!==void 0&&(clearTimeout(r(this,Dt)),g(this,Dt,void 0),g(this,Ti,Math.max(1e3,r(this,Ti)-(Date.now()-r(this,wd)))))},$d=new WeakMap,kd=new WeakMap,Ed=new WeakMap,Md=new WeakMap,mw=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Ro.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Ro.styles=[E,w`
3860
+ </div>`;return this._inRegion?e:c`<div role="status" aria-live="polite" aria-atomic="false">${this.open&&this._primed?e:h}</div>`}};xd=new WeakMap,Dt=new WeakMap,_i=new WeakMap,wd=new WeakMap,No=new WeakMap,Po=new WeakMap,As=new WeakMap,ur=new WeakMap,Ds=new WeakMap,$e=new WeakSet,qm=function(e){g(this,Ds,e);let t=r(this,ur);g(this,As,g(this,ur,void 0)),t?.(e)},pw=function(){return r(this,No)||r(this,Po)},Do=function(){clearTimeout(r(this,Dt)),!(!this.open||r(this,$e,pw))&&(g(this,wd,Date.now()),g(this,Dt,setTimeout(()=>this.dismiss("timeout"),r(this,_i))))},Gf=function(){r(this,Dt)!==void 0&&(clearTimeout(r(this,Dt)),g(this,Dt,void 0),g(this,_i,Math.max(1e3,r(this,_i)-(Date.now()-r(this,wd)))))},$d=new WeakMap,kd=new WeakMap,Ed=new WeakMap,Md=new WeakMap,mw=function(){let e=new CustomEvent("cm-action",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e)&&this.dismiss("action")},Ro.properties={message:{},tone:{reflect:!0},duration:{type:Number},actionLabel:{attribute:"action-label"},open:{type:Boolean,reflect:!0},_inRegion:{state:!0},_primed:{state:!0}},Ro.styles=[E,w`
3858
3861
  :host { display: block; pointer-events: auto; }
3859
3862
  :host(:not([open])) { display: none; }
3860
3863
  .toast {
@@ -3886,13 +3889,13 @@ ${t.label}</button>
3886
3889
  :host([tone='critical']) button:hover { background: var(--cm-bg-hover); }
3887
3890
  button:focus-visible { outline: 2px solid var(--cm-text-on-dark); outline-offset: 1px; }
3888
3891
  :host([tone='critical']) button:focus-visible { outline-color: var(--cm-border-strong); }
3889
- `];$("cm-toast",Ro);var Rs,Td,_d,Cd,zd,Sd,Io,Om,Ho=class extends _{constructor(){super(...arguments);m(this,Io);this.max=3;m(this,Rs,null);m(this,Td,!1);m(this,_d,e=>{let t=e.target;queueMicrotask(()=>{if(t.localName!=="cm-toast"||t.open)return;let i=t.matches(":focus-within");t.remove(),i&&a(this,Io,Om).call(this)})});m(this,Cd,e=>{let t=e.relatedTarget;t&&!Kf(this,t)&&g(this,Rs,t)});m(this,zd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;let t=e.composedPath().find(i=>i.localName==="cm-toast");t&&t.parentElement===this&&(e.preventDefault(),t.dismiss("close"))});m(this,Sd,e=>{if(e.key!=="F6"||e.altKey||e.ctrlKey||e.metaKey||e.defaultPrevented)return;(this.matches(":focus-within")?a(this,Io,Om).call(this):this.focusToast())&&e.preventDefault()})}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")),g(this,Td,!0)),this.addEventListener("cm-dismiss",r(this,_d)),this.addEventListener("focusin",r(this,Cd)),this.addEventListener("keydown",r(this,zd)),document.addEventListener("keydown",r(this,Sd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,_d)),this.removeEventListener("focusin",r(this,Cd)),this.removeEventListener("keydown",r(this,zd)),document.removeEventListener("keydown",r(this,Sd))}updated(){r(this,Td)&&this.setAttribute("aria-label",this.t("label"))}focusToast(){let e=[...this.querySelectorAll(":scope > cm-toast[open]")].reverse(),t=e.find(l=>l.actionLabel)??e[0],i=t?.shadowRoot?.querySelector(".action")??t?.shadowRoot?.querySelector(".close");if(!i)return!1;let s=cw();return s&&!Kf(this,s)&&g(this,Rs,s),i.focus(),!0}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")],i=t.slice(0,Math.max(0,t.length-Math.max(1,this.max))),s=i.some(l=>l.matches(":focus-within"));return i.forEach(l=>l.remove()),s&&a(this,Io,Om).call(this),e}render(){return c`<slot></slot>`}};Rs=new WeakMap,Td=new WeakMap,_d=new WeakMap,Cd=new WeakMap,zd=new WeakMap,Sd=new WeakMap,Io=new WeakSet,Om=function(){let e=r(this,Rs);return g(this,Rs,null),e?.isConnected?(e.focus(),Kf(e,cw())||e.shadowRoot?.querySelector("button, a[href], input, select, textarea, [tabindex]")?.focus(),!0):!1},Ho.properties={max:{type:Number}},Ho.styles=[E,w`
3892
+ `];$("cm-toast",Ro);var Rs,_d,Td,Cd,zd,Sd,Io,Om,Ho=class extends T{constructor(){super(...arguments);m(this,Io);this.max=3;m(this,Rs,null);m(this,_d,!1);m(this,Td,e=>{let t=e.target;queueMicrotask(()=>{if(t.localName!=="cm-toast"||t.open)return;let i=t.matches(":focus-within");t.remove(),i&&a(this,Io,Om).call(this)})});m(this,Cd,e=>{let t=e.relatedTarget;t&&!Kf(this,t)&&g(this,Rs,t)});m(this,zd,e=>{if(e.key!=="Escape"||e.defaultPrevented)return;let t=e.composedPath().find(i=>i.localName==="cm-toast");t&&t.parentElement===this&&(e.preventDefault(),t.dismiss("close"))});m(this,Sd,e=>{if(e.key!=="F6"||e.altKey||e.ctrlKey||e.metaKey||e.defaultPrevented)return;(this.matches(":focus-within")?a(this,Io,Om).call(this):this.focusToast())&&e.preventDefault()})}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")),g(this,_d,!0)),this.addEventListener("cm-dismiss",r(this,Td)),this.addEventListener("focusin",r(this,Cd)),this.addEventListener("keydown",r(this,zd)),document.addEventListener("keydown",r(this,Sd))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("cm-dismiss",r(this,Td)),this.removeEventListener("focusin",r(this,Cd)),this.removeEventListener("keydown",r(this,zd)),document.removeEventListener("keydown",r(this,Sd))}updated(){r(this,_d)&&this.setAttribute("aria-label",this.t("label"))}focusToast(){let e=[...this.querySelectorAll(":scope > cm-toast[open]")].reverse(),t=e.find(l=>l.actionLabel)??e[0],i=t?.shadowRoot?.querySelector(".action")??t?.shadowRoot?.querySelector(".close");if(!i)return!1;let s=cw();return s&&!Kf(this,s)&&g(this,Rs,s),i.focus(),!0}add(e){this.append(e);let t=[...this.querySelectorAll(":scope > cm-toast")],i=t.slice(0,Math.max(0,t.length-Math.max(1,this.max))),s=i.some(l=>l.matches(":focus-within"));return i.forEach(l=>l.remove()),s&&a(this,Io,Om).call(this),e}render(){return c`<slot></slot>`}};Rs=new WeakMap,_d=new WeakMap,Td=new WeakMap,Cd=new WeakMap,zd=new WeakMap,Sd=new WeakMap,Io=new WeakSet,Om=function(){let e=r(this,Rs);return g(this,Rs,null),e?.isConnected?(e.focus(),Kf(e,cw())||e.shadowRoot?.querySelector("button, a[href], input, select, textarea, [tabindex]")?.focus(),!0):!1},Ho.properties={max:{type:Number}},Ho.styles=[E,w`
3890
3893
  :host {
3891
3894
  position: fixed; inset-block-end: var(--cm-space-20); inset-inline: 0; z-index: 1000;
3892
3895
  display: flex; flex-direction: column; align-items: center; gap: var(--cm-space-8);
3893
3896
  padding-inline: var(--cm-space-12); pointer-events: none;
3894
3897
  }
3895
- `];$("cm-toast-region",Ho);function uw(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let s=document.createElement("cm-toast");if(s.message=String(o),n.tone&&(s.tone=n.tone),n.duration!==void 0&&(s.duration=n.duration),n.action){s.actionLabel=n.action.label;let l=n.action.onAction;s.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(s),hw),s}return t.add(s)}async function L0(o,n,e){await o();let{message:t,undoLabel:i,...s}=e,l=i??Zd("toast","undo",void 0,s.root??document.body),d=await uw(t,{...s,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var OC=C("progressBar",{inProgress:"In progress"}),Bm,qo=class extends _{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";m(this,Bm,N("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${r(this,Bm)}-label`;return c`
3898
+ `];$("cm-toast-region",Ho);function uw(o,n={}){let e=n.root??document.body,t=e.querySelector(":scope > cm-toast-region"),i=!t;t||(t=document.createElement("cm-toast-region"),e.append(t));let s=document.createElement("cm-toast");if(s.message=String(o),n.tone&&(s.tone=n.tone),n.duration!==void 0&&(s.duration=n.duration),n.action){s.actionLabel=n.action.label;let l=n.action.onAction;s.addEventListener("cm-action",()=>l())}if(i){let l=t;return setTimeout(()=>l.add(s),hw),s}return t.add(s)}async function L0(o,n,e){await o();let{message:t,undoLabel:i,...s}=e,l=i??Zd("toast","undo",void 0,s.root??document.body),d=await uw(t,{...s,action:{label:l,onAction:()=>{}}}).closed;return d==="action"&&await n(),d}var OC=C("progressBar",{inProgress:"In progress"}),Bm,qo=class extends T{constructor(){super(...arguments);this.value=null;this.label="";this.labelHidden=!1;this.showValue=!1;this.size="medium";m(this,Bm,N("cm-progress"))}get clampedValue(){let e=this.value;return e==null||Number.isNaN(Number(e))?null:Math.min(100,Math.max(0,Number(e)))}render(){let e=this.clampedValue,t=`${r(this,Bm)}-label`;return c`
3896
3899
  <div class="head ${this.labelHidden?"vh":""}">
3897
3900
  <span id=${t} part="label">${this.label}</span>
3898
3901
  ${this.showValue&&e!==null?c`<span class="value" aria-hidden="true">${this.formatNumber(Math.round(e)/100,{style:"percent"})}</span>`:h}
@@ -4112,7 +4115,7 @@ ${t.label}</button>
4112
4115
  :host([width='detail']) .content { max-inline-size: 1040px; }
4113
4116
  :host([width='wide']) .content { max-inline-size: 1600px; }
4114
4117
  @container cm-page (max-width: 640px) { .content { padding: var(--cm-space-16); } }
4115
- `];$("cm-page",Jo);var Qo,ww,$w,Zo=class extends _{constructor(){super(...arguments);m(this,Qo);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?Xt`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:Xt`<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 c`<div class="banner" part="banner" role=${e}>
4118
+ `];$("cm-page",Jo);var Qo,ww,$w,Zo=class extends T{constructor(){super(...arguments);m(this,Qo);this.tone="attention";this.heading="";this.dismissible=!1;this.hasActions=!1}render(){let e=this.tone==="critical"?"alert":"status",t=this.tone==="success"?Xt`<path d="m5 10.5 3 3 7-7" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>`:Xt`<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 c`<div class="banner" part="banner" role=${e}>
4116
4119
  <svg class="icon" width="20" height="20" viewBox="0 0 20 20" aria-hidden="true">${t}</svg>
4117
4120
  <div class="body">
4118
4121
  ${this.heading?c`<p class="title">${this.heading}</p>`:h}
@@ -4145,7 +4148,7 @@ ${t.label}</button>
4145
4148
  border-radius: var(--cm-radius-sm); color: inherit; cursor: pointer;
4146
4149
  }
4147
4150
  .close:focus-visible { outline: 2px solid var(--cm-border-strong); outline-offset: 2px; }
4148
- `];$("cm-banner",Zo);var Dz=C("thumbnail",{noImage:"{alt} (no image)"}),el=class extends _{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 c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
4151
+ `];$("cm-banner",Zo);var Dz=C("thumbnail",{noImage:"{alt} (no image)"}),el=class extends T{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 c`<span class="box" part="thumbnail"><img src=${this.src} alt=${this.alt} loading=${this.loading}
4149
4152
  @error=${()=>{this._failed=!0}}></span>`;let e=this.size==="small"?18:this.size==="large"?32:24;return c`<span class="box" part="thumbnail" role=${this.alt?"img":h}
4150
4153
  aria-label=${this.alt?this.t("noImage",{alt:this.alt}):h} aria-hidden=${this.alt?h:"true"}>
4151
4154
  <cm-icon name="box" size=${e}></cm-icon></span>`}};el.properties={src:{},alt:{},size:{reflect:!0},loading:{},_failed:{state:!0}},el.styles=[E,w`
@@ -4158,7 +4161,7 @@ ${t.label}</button>
4158
4161
  background: var(--cm-thumb-bg); color: var(--cm-icon-selected);
4159
4162
  }
4160
4163
  img { inline-size: 100%; block-size: 100%; object-fit: contain; display: block; }
4161
- `];$("cm-thumbnail",el);export{$s as Announcer,mn as CmAccordion,_o as CmAccountMenu,cn as CmActionBar,Ht as CmActionMenu,ko as CmAppCard,Yo as CmAppFrame,uo as CmAvatar,Oo as CmBadge,Zo as CmBanner,Xn as CmBoard,ks as CmBoardCard,Es as CmBoardColumn,yo as CmBottomNavigation,zo as CmBottomSheet,xr as CmButton,Qs as CmButtonGroup,ro as CmCalendar,io as CmCalendarEvent,Bo as CmCard,Hi as CmCheckbox,Zi as CmColorField,en as CmColorPicker,Bi as CmCombobox,$a as CmCommandPalette,bn as CmComment,vn as CmCommentBox,Pn as CmDataTable,Ui as CmDatePicker,Gi as CmDateRangePicker,un as CmEmptyState,Xi as CmFileUpload,Mo as CmFilterPanel,wo as CmFlashOfferBar,Fr as CmGlobalSearch,Ko as CmGrid,fo as CmHeaderBar,Fs as CmIcon,pn as CmInfoItem,hn as CmInfoPanel,Go as CmLayout,Wo as CmLayoutSection,$o as CmLinkTabs,_ as CmLocalizedElement,Vs as CmMenuItem,ho as CmMetric,xo as CmMobileMenu,Eo as CmModal,po as CmNavItem,Wn as CmNestedItem,Gn as CmNestedList,So as CmNotificationItem,Lo as CmNotificationPanel,Bt as CmOptionGroup,Jo as CmPage,ln as CmPageHeader,Cn as CmPagination,qo as CmProgressBar,Lr as CmRadio,Ar as CmRadioGroup,Cs as CmReportTile,co as CmReportTiles,jn as CmResourceItem,Un as CmResourceList,dn as CmSaveBar,Oi as CmSearch,on as CmSegmentedControl,qi as CmSelect,mo as CmSideNavigation,Kt as CmSidePanel,Qi as CmSignatureField,gn as CmSkeleton,fn as CmSkeletonDisplay,Tn as CmSmartTip,_n as CmSmartTips,Co as CmSparkline,Gs as CmSpinner,Uo as CmStack,Sn as CmStatusTabs,An as CmTableHeader,Ir as CmTag,Ri as CmTextField,el as CmThumbnail,Yi as CmTimePicker,ms as CmTimeline,En as CmTimelineItem,Ro as CmToast,Ho as CmToastRegion,Ni as CmToggle,yn as CmTooltip,Mv as DEFAULT_PALETTE,Za as MAX_RECENT,ws as MoveModel,Zb as commandMatches,Iw as configure,C as defineStrings,wb as directionalIcons,Qr as formatColor,he as formatDate,Jr as formatGradient,yb as formatMessage,nu as formatNumber,Nw as getDefaultStrings,ac as hslToRgb,Ip as hsvToRgb,s0 as httpColorSource,Zx as initials,Ol as isApplePlatform,sg as isColorValue,nx as listNavigation,ag as localColorSource,dl as localeFor,_u as matchesShortcut,Zr as normalizeHex,De as parseColor,Ct as parseGradient,Jd as pluralCategory,qp as pushRecent,qw as resetStrings,Vu as resolvePreset,sc as rgbToHsl,Pp as rgbToHsv,nc as sameColor,Pw as setStrings,Kh as shortcutKeys,uw as showToast,Zd as translate,L0 as undoable};
4164
+ `];$("cm-thumbnail",el);export{$s as Announcer,mn as CmAccordion,To as CmAccountMenu,cn as CmActionBar,Ht as CmActionMenu,ko as CmAppCard,Yo as CmAppFrame,uo as CmAvatar,Oo as CmBadge,Zo as CmBanner,Xn as CmBoard,ks as CmBoardCard,Es as CmBoardColumn,yo as CmBottomNavigation,zo as CmBottomSheet,xr as CmButton,Qs as CmButtonGroup,ro as CmCalendar,io as CmCalendarEvent,Bo as CmCard,Hi as CmCheckbox,Zi as CmColorField,en as CmColorPicker,Bi as CmCombobox,$a as CmCommandPalette,bn as CmComment,vn as CmCommentBox,Pn as CmDataTable,Ui as CmDatePicker,Gi as CmDateRangePicker,un as CmEmptyState,Xi as CmFileUpload,Mo as CmFilterPanel,wo as CmFlashOfferBar,Fr as CmGlobalSearch,Ko as CmGrid,fo as CmHeaderBar,Fs as CmIcon,pn as CmInfoItem,hn as CmInfoPanel,Go as CmLayout,Wo as CmLayoutSection,$o as CmLinkTabs,T as CmLocalizedElement,Vs as CmMenuItem,ho as CmMetric,xo as CmMobileMenu,Eo as CmModal,po as CmNavItem,Wn as CmNestedItem,Gn as CmNestedList,So as CmNotificationItem,Lo as CmNotificationPanel,Bt as CmOptionGroup,Jo as CmPage,ln as CmPageHeader,Cn as CmPagination,qo as CmProgressBar,Lr as CmRadio,Ar as CmRadioGroup,Cs as CmReportTile,co as CmReportTiles,jn as CmResourceItem,Un as CmResourceList,dn as CmSaveBar,Oi as CmSearch,on as CmSegmentedControl,qi as CmSelect,mo as CmSideNavigation,Kt as CmSidePanel,Qi as CmSignatureField,gn as CmSkeleton,fn as CmSkeletonDisplay,_n as CmSmartTip,Tn as CmSmartTips,Co as CmSparkline,Gs as CmSpinner,Uo as CmStack,Sn as CmStatusTabs,An as CmTableHeader,Ir as CmTag,Ri as CmTextField,el as CmThumbnail,Yi as CmTimePicker,ms as CmTimeline,En as CmTimelineItem,Ro as CmToast,Ho as CmToastRegion,Ni as CmToggle,yn as CmTooltip,Mv as DEFAULT_PALETTE,Za as MAX_RECENT,ws as MoveModel,Zb as commandMatches,Iw as configure,C as defineStrings,wb as directionalIcons,Qr as formatColor,he as formatDate,Jr as formatGradient,yb as formatMessage,nu as formatNumber,Nw as getDefaultStrings,ac as hslToRgb,Ip as hsvToRgb,s0 as httpColorSource,Zx as initials,Ol as isApplePlatform,sg as isColorValue,nx as listNavigation,ag as localColorSource,dl as localeFor,Tu as matchesShortcut,Zr as normalizeHex,De as parseColor,Ct as parseGradient,Jd as pluralCategory,qp as pushRecent,qw as resetStrings,Vu as resolvePreset,sc as rgbToHsl,Pp as rgbToHsv,nc as sameColor,Pw as setStrings,Kh as shortcutKeys,uw as showToast,Zd as translate,L0 as undoable};
4162
4165
  /*! Bundled license information:
4163
4166
 
4164
4167
  @lit/reactive-element/css-tag.js: