@taprootio/espalier 7.3.0 → 7.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(c,e,t,o);else for(var d=c.length-1;d>=0;d--)(m=c[d])&&(r=(h<3?m(r):h>3?m(e,t,r):m(e,t))||r);return h>3&&r&&Object.defineProperty(e,t,r),r},l;import{surfaceLayerAttributes as x}from"../shared/surface-layer.js";import{css as A,html as L,LitElement as D}from"lit";import{customElement as P,property as n,state as F}from"lit/decorators.js";import{getEspBus as p}from"../shared/bus-events.js";import{GoverningRootObserver as O}from"../shared/governing-root.js";import{getComponentPropertyAnalysis as k}from"../shared/component-property-normalizer.js";import{addComponentPropertyResets as I}from"../shared/component-property-resets.js";import{ScopedStyleDeclarations as z}from"../shared/scoped-style-declarations.js";import{subscribeToRootEvent as W}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as v,DEFAULT_DARK_THEME as y,encodeTheme as T,parseTheme as f,mergeTheme as w}from"../shared/theme-core.js";import{extractFamily as u,isLocalFontFamily as B,removeRuntimeGoogleFontLinks as C,syncRuntimeGoogleFontLink as _}from"../shared/font-helpers.js";import{computeThemeProperties as U}from"./helpers/compute-theme-properties.js";import{registerImageTexture as G,registeredImageTextures as M}from"../shared/image-texture-registry.js";import{registerImageTexture as re,registeredImageTextures as ie,BUILT_IN_IMAGE_TEXTURES as ne}from"../shared/image-texture-registry.js";const E=1e3;let s=l=class extends D{static registerTexture(e,t){G(e,t)}static registeredTextures(){return M()}subscribeScoped(e,t){return W(this,e,t)}get virtualViewportWidth(){return this.virtualViewportWidthBacker}set virtualViewportWidth(e){const t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,o=this.virtualViewportWidthBacker;this.virtualViewportWidthBacker=t,t===void 0?this.hasAttribute("virtual-viewport-width")&&this.removeAttribute("virtual-viewport-width"):this.getAttribute("virtual-viewport-width")!==String(t)&&this.setAttribute("virtual-viewport-width",String(t)),this.requestUpdate("virtualViewportWidth",o)}get lightTheme(){return this.lightThemeAttr?f(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?T(e):""}get darkTheme(){return this.darkThemeAttr?f(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?T(e):""}get themeSettled(){return this.themeReadyState}whenThemeSettled(){return this.themeReadyState?Promise.resolve():new Promise(e=>{this.themeSettleWaiters.push(e)})}get hasAuthorTheme(){return!!(this.scheme==="dark"?this.darkThemeAttr:this.lightThemeAttr)}settleTheme(){if(this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.themeReadyState)return;this.themeReadyState=!0;const e=this.themeSettleWaiters;this.themeSettleWaiters=[];for(const t of e)t()}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,h=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const r=t||this.resolveDefaultScheme();h!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),r!==o&&(this.schemeBacker=r,this.requestUpdate("scheme",o),this.themeEventsReady&&(this.resolveThemes(),p().publish("scheme-changed",{scheme:r,correlationId:this.correlationId})))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,o){const h=`${this.correlationId}-${e}`,r=B(t)?"":t;_({owner:`root:${h}`,family:r,weight:o,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",u(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",u(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",u(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",u(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",u(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){C(`root:${this.correlationId}-`),C(`picker:${this.correlationId}:`,this.ownerDocument)}constructor(){super(),this.outerRootObserver=new O(this,(t,o)=>{t!==o&&(this.outerComponentCandidates=void 0,this.applyComponentProperties(),t&&this.outerRootObserver.whenReady(this.syncOuterComponentCandidates))}),this.componentDeclarations=new z(this),this.componentProperties={},this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightThemeAttr="",this.resolvedDarkThemeAttr="",this.resolvedLightTheme={...v},this.resolvedDarkTheme={...y},this.appliedThemeProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.themePending=!1,this.themeReadyState=!1,this.themeSettleWaiters=[],this.warnedThemeSettleTimeout=!1,this.defaultScheme="light",this.syncOuterComponentCandidates=t=>{const{candidates:o}=k(t.activeTheme);o!==this.outerComponentCandidates&&(this.outerComponentCandidates=o,this.applyComponentProperties())},this.resizeObserver=new ResizeObserver(()=>{p().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=t=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=t.matches?"dark":"light",this.resolvingDefaultScheme=!1)};const e=()=>{const t=this.outerRootObserver.root;t&&this.syncOuterComponentCandidates(t)};this.outerRootObserver.subscribe("scheme-changed",e),this.outerRootObserver.subscribe("theme-changed",e)}applyComponentProperties(){const e={...this.componentProperties};this.outerComponentCandidates&&I(e,this.outerComponentCandidates),this.componentDeclarations.apply(e)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){if(this.lightThemeAttr!==this.resolvedLightThemeAttr){this.resolvedLightThemeAttr=this.lightThemeAttr;const e=f(this.lightThemeAttr);this.resolvedLightTheme=e?w(v,e):{...v}}if(this.darkThemeAttr!==this.resolvedDarkThemeAttr){this.resolvedDarkThemeAttr=this.darkThemeAttr;const e=f(this.darkThemeAttr);this.resolvedDarkTheme=e?w(y,e):{...y}}}connectedCallback(){super.connectedCallback(),this.outerRootObserver.connect(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks(),this.hasAuthorTheme||this.startThemeSettleTimer())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(a=>e.has(a)))&&(this.resolveThemes(),this.themeEventsReady&&p().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=this.activeTheme,{root:r,candidates:m}=k(h),d=U(h,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth},{surface:r}),S={};for(const a of m)Object.prototype.hasOwnProperty.call(d,a)&&(S[a]=d[a],delete d[a]);this.componentProperties=S,this.applyComponentProperties();const b=new Set(Object.keys(d));for(const a of this.appliedThemeProperties)b.has(a)||this.style.removeProperty(a);for(const[a,R]of Object.entries(d))this.style.setProperty(a,R);this.appliedThemeProperties=b;const g=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==g&&p().publish("seed-color-changed",{seedColor:g,correlationId:this.correlationId}),this.lastSeedColor=g,this.themeEventsReady&&e.has("iconSpriteUrl")&&p().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=l.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0,this.startThemeSettleTimer()}startThemeSettleTimer(){if(this.themeReadyState||this.themeSettleTimer!==void 0)return;this.themeSettleDeadline??=performance.now()+E;const e=Math.max(0,this.themeSettleDeadline-performance.now());if(e===0){this.closeThemeWindow();return}this.themeSettleTimer=setTimeout(()=>this.closeThemeWindow(),e)}closeThemeWindow(){this.themeSettleTimer=void 0,this.themePending&&!this.warnedThemeSettleTimeout&&(this.warnedThemeSettleTimeout=!0,console.warn(`Espalier root: theme-pending was declared but no ${this.scheme} theme arrived within ${E}ms, so the default palette is rendering. Assign ${this.scheme==="dark"?"darkTheme":"lightTheme"} (or remove theme-pending).`)),this.settleTheme()}updated(e){this.toggleAttribute("data-theme-ready",this.themeReadyState),(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.outerRootObserver.disconnect(),this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,l.connectedRootCount+=1,l.connectedRootCount===1&&document.addEventListener("click",l.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,l.connectedRootCount=Math.max(0,l.connectedRootCount-1),l.connectedRootCount===0&&document.removeEventListener("click",l.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return L`<slot></slot>`}};s.connectedRootCount=0,s.handleDocumentClick=c=>{const e=c.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");p().publish("close-popovers",{source:c.target??void 0,skipPopovers:e})},s.lightDomStyles=`
2
- ${x("esp-root [surface-layer]").cssText}
1
+ var i=function(c,e,t,o){var h=arguments.length,s=h<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(c,e,t,o);else for(var d=c.length-1;d>=0;d--)(p=c[d])&&(s=(h<3?p(s):h>3?p(e,t,s):p(e,t))||s);return h>3&&s&&Object.defineProperty(e,t,s),s},l;import{footerHeadingFit as A,footerLinkFit as T}from"../shared/footer-ink-styles.js";import{surfaceLayerAttributes as L}from"../shared/surface-layer.js";import{css as D,html as F,LitElement as P}from"lit";import{customElement as O,property as n,state as I}from"lit/decorators.js";import{getEspBus as m}from"../shared/bus-events.js";import{GoverningRootObserver as z}from"../shared/governing-root.js";import{getComponentPropertyAnalysis as S}from"../shared/component-property-normalizer.js";import{addComponentPropertyResets as W}from"../shared/component-property-resets.js";import{ScopedStyleDeclarations as _}from"../shared/scoped-style-declarations.js";import{subscribeToRootEvent as B}from"../shared/root-event-subscription.js";import{DEFAULT_LIGHT_THEME as v,DEFAULT_DARK_THEME as y,encodeTheme as w,parseTheme as f,mergeTheme as C}from"../shared/theme-core.js";import{extractFamily as u,isLocalFontFamily as U,removeRuntimeGoogleFontLinks as x,syncRuntimeGoogleFontLink as G}from"../shared/font-helpers.js";import{computeThemeProperties as M}from"./helpers/compute-theme-properties.js";import{registerImageTexture as H,registeredImageTextures as j}from"../shared/image-texture-registry.js";import{registerImageTexture as he,registeredImageTextures as ae,BUILT_IN_IMAGE_TEXTURES as le}from"../shared/image-texture-registry.js";const E=1e3;let r=l=class extends P{static registerTexture(e,t){H(e,t)}static registeredTextures(){return j()}subscribeScoped(e,t){return B(this,e,t)}get virtualViewportWidth(){return this.virtualViewportWidthBacker}set virtualViewportWidth(e){const t=typeof e=="number"&&Number.isFinite(e)&&e>0?e:void 0,o=this.virtualViewportWidthBacker;this.virtualViewportWidthBacker=t,t===void 0?this.hasAttribute("virtual-viewport-width")&&this.removeAttribute("virtual-viewport-width"):this.getAttribute("virtual-viewport-width")!==String(t)&&this.setAttribute("virtual-viewport-width",String(t)),this.requestUpdate("virtualViewportWidth",o)}get lightTheme(){return this.lightThemeAttr?f(this.lightThemeAttr):null}set lightTheme(e){this.lightThemeAttr=e?w(e):""}get darkTheme(){return this.darkThemeAttr?f(this.darkThemeAttr):null}set darkTheme(e){this.darkThemeAttr=e?w(e):""}get themeSettled(){return this.themeReadyState}whenThemeSettled(){return this.themeReadyState?Promise.resolve():new Promise(e=>{this.themeSettleWaiters.push(e)})}get hasAuthorTheme(){return!!(this.scheme==="dark"?this.darkThemeAttr:this.lightThemeAttr)}settleTheme(){if(this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.themeReadyState)return;this.themeReadyState=!0;const e=this.themeSettleWaiters;this.themeSettleWaiters=[];for(const t of e)t()}get scheme(){return this.schemeBacker}set scheme(e){const t=e==="dark"?"dark":e==="light"?"light":"",o=this.schemeBacker,h=this.schemeExplicitlySet;this.resolvingDefaultScheme||(this.schemeExplicitlySet=t.length>0);const s=t||this.resolveDefaultScheme();h!==this.schemeExplicitlySet&&this.isConnected&&this.syncSystemSchemeListener(),s!==o&&(this.schemeBacker=s,this.requestUpdate("scheme",o),this.themeEventsReady&&(this.resolveThemes(),m().publish("scheme-changed",{scheme:s,correlationId:this.correlationId})))}get seedColor(){return this.activeTheme.seedColor}injectGoogleFontLink(e,t,o){const h=`${this.correlationId}-${e}`,s=U(t)?"":t;G({owner:`root:${h}`,family:s,weight:o,enabled:this.googleFontLoading!=="none"})}syncGoogleFontLinks(){this.googleFontLoading==="none"&&this.removeRuntimeGoogleFontLinks();const e=this.activeTheme;this.injectGoogleFontLink("body",u(e.fontBody),e.fontWeightBody),this.injectGoogleFontLink("headings",u(e.fontHeadings),e.fontWeightHeadings),this.injectGoogleFontLink("brand",u(e.fontBrand),e.fontWeightBrand),this.injectGoogleFontLink("menu",u(e.fontMenu),e.fontWeightMenu),this.injectGoogleFontLink("monospace",u(e.fontMonospace),e.fontWeightMonospace)}removeRuntimeGoogleFontLinks(){x(`root:${this.correlationId}-`),x(`picker:${this.correlationId}:`,this.ownerDocument)}constructor(){super(),this.outerRootObserver=new z(this,(t,o)=>{t!==o&&(this.outerComponentCandidates=void 0,this.applyComponentProperties(),t&&this.outerRootObserver.whenReady(this.syncOuterComponentCandidates))}),this.componentDeclarations=new _(this),this.componentProperties={},this.schemeBacker="",this.schemeExplicitlySet=!1,this.resolvingDefaultScheme=!1,this.themeEventsReady=!1,this.systemSchemeQuery=null,this.lastSeedColor="",this.resolvedLightThemeAttr="",this.resolvedDarkThemeAttr="",this.resolvedLightTheme={...v},this.resolvedDarkTheme={...y},this.appliedThemeProperties=new Set,this.documentClickRegistrationActive=!1,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.lightThemeAttr="",this.darkThemeAttr="",this.fontCSSRoot="/css/fonts/",this.fontDefinitionsUrl="",this.googleFontLoading="auto",this.iconSpriteUrl="/assets/icons.svg",this.themePending=!1,this.themeReadyState=!1,this.themeSettleWaiters=[],this.warnedThemeSettleTimeout=!1,this.defaultScheme="light",this.syncOuterComponentCandidates=t=>{const{candidates:o}=S(t.activeTheme);o!==this.outerComponentCandidates&&(this.outerComponentCandidates=o,this.applyComponentProperties())},this.resizeObserver=new ResizeObserver(()=>{m().publish("window-resized",{emWidth:window.innerWidth/parseFloat(getComputedStyle(document.documentElement).fontSize),emHeight:window.innerHeight/parseFloat(getComputedStyle(document.documentElement).fontSize),pxWidth:window.innerWidth,pxHeight:window.innerHeight})}),this.handleSystemSchemeChange=t=>{this.schemeExplicitlySet||this.defaultScheme!=="system"||(this.resolvingDefaultScheme=!0,this.scheme=t.matches?"dark":"light",this.resolvingDefaultScheme=!1)};const e=()=>{const t=this.outerRootObserver.root;t&&this.syncOuterComponentCandidates(t)};this.outerRootObserver.subscribe("scheme-changed",e),this.outerRootObserver.subscribe("theme-changed",e)}applyComponentProperties(){const e={...this.componentProperties};this.outerComponentCandidates&&W(e,this.outerComponentCandidates),this.componentDeclarations.apply(e)}get activeTheme(){return this.scheme==="dark"?this.resolvedDarkTheme:this.resolvedLightTheme}resolveThemes(){if(this.lightThemeAttr!==this.resolvedLightThemeAttr){this.resolvedLightThemeAttr=this.lightThemeAttr;const e=f(this.lightThemeAttr);this.resolvedLightTheme=e?C(v,e):{...v}}if(this.darkThemeAttr!==this.resolvedDarkThemeAttr){this.resolvedDarkThemeAttr=this.darkThemeAttr;const e=f(this.darkThemeAttr);this.resolvedDarkTheme=e?C(y,e):{...y}}}connectedCallback(){super.connectedCallback(),this.outerRootObserver.connect(),this.registerDocumentClickBridge(),this.resizeObserver.observe(this),this.hasUpdated&&(this.applyDefaultScheme(),this.syncGoogleFontLinks(),this.hasAuthorTheme||this.startThemeSettleTimer())}willUpdate(e){const t=["lightThemeAttr","darkThemeAttr"];(!this.lastSeedColor||t.some(a=>e.has(a)))&&(this.resolveThemes(),this.themeEventsReady&&m().publish("theme-changed",{correlationId:this.correlationId})),this.hasAuthorTheme&&this.settleTheme();const h=this.activeTheme,{root:s,candidates:p}=S(h),d=M(h,this.scheme==="dark"?"dark":"light",void 0,{viewportWidth:this.virtualViewportWidth},{surface:s}),b={};for(const a of p)Object.prototype.hasOwnProperty.call(d,a)&&(b[a]=d[a],delete d[a]);this.componentProperties=b,this.applyComponentProperties();const k=new Set(Object.keys(d));for(const a of this.appliedThemeProperties)k.has(a)||this.style.removeProperty(a);for(const[a,R]of Object.entries(d))this.style.setProperty(a,R);this.appliedThemeProperties=k;const g=this.activeTheme.seedColor;this.themeEventsReady&&this.lastSeedColor&&this.lastSeedColor!==g&&m().publish("seed-color-changed",{seedColor:g,correlationId:this.correlationId}),this.lastSeedColor=g,this.themeEventsReady&&e.has("iconSpriteUrl")&&m().publish("icon-sprite-url-changed",{iconSpriteUrl:this.iconSpriteUrl,correlationId:this.correlationId}),this.syncGoogleFontLinks()}firstUpdated(){const e=this.activeTheme.stylesheets;if(e.length)for(const t of e){const o=document.createElement("link");o.rel="stylesheet",o.href=t,document.head.appendChild(o)}if(!document.getElementById("esp-root-base-styles")){const t=document.createElement("style");t.id="esp-root-base-styles",t.textContent=l.lightDomStyles,document.head.appendChild(t)}this.applyDefaultScheme(),this.lastSeedColor=this.activeTheme.seedColor,this.themeEventsReady=!0,this.startThemeSettleTimer()}startThemeSettleTimer(){if(this.themeReadyState||this.themeSettleTimer!==void 0)return;this.themeSettleDeadline??=performance.now()+E;const e=Math.max(0,this.themeSettleDeadline-performance.now());if(e===0){this.closeThemeWindow();return}this.themeSettleTimer=setTimeout(()=>this.closeThemeWindow(),e)}closeThemeWindow(){this.themeSettleTimer=void 0,this.themePending&&!this.warnedThemeSettleTimeout&&(this.warnedThemeSettleTimeout=!0,console.warn(`Espalier root: theme-pending was declared but no ${this.scheme} theme arrived within ${E}ms, so the default palette is rendering. Assign ${this.scheme==="dark"?"darkTheme":"lightTheme"} (or remove theme-pending).`)),this.settleTheme()}updated(e){this.toggleAttribute("data-theme-ready",this.themeReadyState),(e.has("defaultScheme")||e.has("scheme"))&&!this.schemeExplicitlySet&&this.applyDefaultScheme()}disconnectedCallback(){this.outerRootObserver.disconnect(),this.themeSettleTimer!==void 0&&(clearTimeout(this.themeSettleTimer),this.themeSettleTimer=void 0),this.unregisterDocumentClickBridge(),this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null,this.resizeObserver.disconnect(),this.removeRuntimeGoogleFontLinks(),super.disconnectedCallback()}registerDocumentClickBridge(){this.documentClickRegistrationActive||(this.documentClickRegistrationActive=!0,l.connectedRootCount+=1,l.connectedRootCount===1&&document.addEventListener("click",l.handleDocumentClick))}unregisterDocumentClickBridge(){this.documentClickRegistrationActive&&(this.documentClickRegistrationActive=!1,l.connectedRootCount=Math.max(0,l.connectedRootCount-1),l.connectedRootCount===0&&document.removeEventListener("click",l.handleDocumentClick))}applyDefaultScheme(){this.schemeExplicitlySet||(this.resolvingDefaultScheme=!0,this.scheme=this.resolveDefaultScheme(),this.resolvingDefaultScheme=!1,this.syncSystemSchemeListener())}resolveDefaultScheme(){return this.defaultScheme==="dark"||this.defaultScheme==="system"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}syncSystemSchemeListener(){if(this.schemeExplicitlySet||this.defaultScheme!=="system"||!window.matchMedia){this.systemSchemeQuery?.removeEventListener("change",this.handleSystemSchemeChange),this.systemSchemeQuery=null;return}this.systemSchemeQuery||(this.systemSchemeQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.systemSchemeQuery.addEventListener("change",this.handleSystemSchemeChange))}render(){return F`<slot></slot>`}};r.connectedRootCount=0,r.handleDocumentClick=c=>{const e=c.composedPath().filter(t=>t instanceof HTMLElement&&t.tagName==="ESP-POPOVER");m().publish("close-popovers",{source:c.target??void 0,skipPopovers:e})},r.lightDomStyles=`
2
+ ${L("esp-root [surface-layer]").cssText}
3
3
 
4
4
 
5
5
  esp-root {
@@ -48,6 +48,33 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
48
48
  }
49
49
 
50
50
 
51
+ esp-root a[data-esp-badge-link]:has(> esp-badge[linked]:defined) {
52
+ background-color: transparent;
53
+ text-decoration: none;
54
+ }
55
+
56
+ esp-root a[data-esp-badge-link]:focus-visible:has(> esp-badge[linked]:defined) {
57
+ outline: none;
58
+ }
59
+
60
+ esp-root a:focus-visible > esp-badge[linked]::part(badge) {
61
+ background: var(--esp-badge-link-focus-background, var(--esp-color-link-hover-bg));
62
+ border-color: var(--esp-badge-link-focus-border-color, var(--esp-color-link-hover));
63
+ color: var(--esp-badge-link-focus-color, var(--esp-color-link-hover));
64
+ }
65
+
66
+ esp-root a[data-esp-badge-link]:focus-visible > esp-badge[linked]:defined::part(badge) {
67
+ outline: 2px solid var(--esp-badge-link-focus-ring-color, var(--esp-color-link));
68
+ outline-offset: 3px;
69
+ }
70
+
71
+ @media (forced-colors: active) {
72
+ esp-root a[data-esp-badge-link]:focus-visible > esp-badge[linked]:defined::part(badge) {
73
+ outline-color: Highlight;
74
+ }
75
+ }
76
+
77
+
51
78
  esp-root input,
52
79
  esp-root button,
53
80
  esp-root textarea,
@@ -156,7 +183,8 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
156
183
  }
157
184
 
158
185
  esp-root esp-footer :is(h1, h2, h3, h4, h5, h6) {
159
- color: var(--esp-footer-heading-color, var(--esp-color-headings));
186
+ ${A.cssText}
187
+ color: var(--esp-footer-heading-color, var(--_esp-footer-local-fitted-heading-color, var(--esp-color-headings)));
160
188
  }
161
189
 
162
190
  esp-root esp-footer h2 {
@@ -165,7 +193,8 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
165
193
 
166
194
  esp-root esp-footer a,
167
195
  esp-root esp-footer a:not([class]) {
168
- color: var(--esp-footer-link-color, var(--esp-color-link));
196
+ ${T.cssText}
197
+ color: var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)));
169
198
  }
170
199
 
171
200
  esp-root esp-footer a:not([class]) {
@@ -188,9 +217,10 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
188
217
  }
189
218
 
190
219
  esp-root esp-footer a:focus-visible {
220
+ ${T.cssText}
191
221
  outline: var(
192
222
  --esp-footer-focus-outline,
193
- 2px solid var(--esp-footer-link-color, var(--esp-color-link))
223
+ 2px solid var(--esp-footer-link-color, var(--_esp-footer-local-fitted-link-color, var(--esp-color-link)))
194
224
  );
195
225
  outline-offset: 3px;
196
226
  }
@@ -199,7 +229,7 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
199
229
  esp-root esp-footer a:not([class]):focus-visible {
200
230
  border-radius: var(--esp-size-border-radius);
201
231
  }
202
- `,s.styles=A`
232
+ `,r.styles=D`
203
233
  :host {
204
234
  display: block;
205
235
  }
@@ -208,4 +238,4 @@ var i=function(c,e,t,o){var h=arguments.length,r=h<3?e:o===null?o=Object.getOwnP
208
238
  :host([theme-pending]:not([data-theme-ready])) {
209
239
  visibility: hidden;
210
240
  }
211
- `,i([n({attribute:!1})],s.prototype,"correlationId",void 0),i([n({attribute:"virtual-viewport-width",noAccessor:!0,converter:{fromAttribute:c=>{const e=c?.trim()??"";return/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}}})],s.prototype,"virtualViewportWidth",null),i([n({attribute:"light-theme"})],s.prototype,"lightThemeAttr",void 0),i([n({attribute:"dark-theme"})],s.prototype,"darkThemeAttr",void 0),i([n({attribute:!1})],s.prototype,"lightTheme",null),i([n({attribute:!1})],s.prototype,"darkTheme",null),i([n({attribute:"font-css-root",type:String})],s.prototype,"fontCSSRoot",void 0),i([n({attribute:"font-definitions-url",type:String})],s.prototype,"fontDefinitionsUrl",void 0),i([n({attribute:"google-font-loading",type:String})],s.prototype,"googleFontLoading",void 0),i([n({attribute:"icon-sprite-url",type:String})],s.prototype,"iconSpriteUrl",void 0),i([n({attribute:"theme-pending",reflect:!0,type:Boolean})],s.prototype,"themePending",void 0),i([F()],s.prototype,"themeReadyState",void 0),i([n({attribute:"default-scheme",type:String,reflect:!0})],s.prototype,"defaultScheme",void 0),i([n({attribute:"scheme",type:String,reflect:!0})],s.prototype,"scheme",null),s=l=i([P("esp-root")],s);export{ne as BUILT_IN_IMAGE_TEXTURES,s as EspalierRoot,re as registerImageTexture,ie as registeredImageTextures};
241
+ `,i([n({attribute:!1})],r.prototype,"correlationId",void 0),i([n({attribute:"virtual-viewport-width",noAccessor:!0,converter:{fromAttribute:c=>{const e=c?.trim()??"";return/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}}})],r.prototype,"virtualViewportWidth",null),i([n({attribute:"light-theme"})],r.prototype,"lightThemeAttr",void 0),i([n({attribute:"dark-theme"})],r.prototype,"darkThemeAttr",void 0),i([n({attribute:!1})],r.prototype,"lightTheme",null),i([n({attribute:!1})],r.prototype,"darkTheme",null),i([n({attribute:"font-css-root",type:String})],r.prototype,"fontCSSRoot",void 0),i([n({attribute:"font-definitions-url",type:String})],r.prototype,"fontDefinitionsUrl",void 0),i([n({attribute:"google-font-loading",type:String})],r.prototype,"googleFontLoading",void 0),i([n({attribute:"icon-sprite-url",type:String})],r.prototype,"iconSpriteUrl",void 0),i([n({attribute:"theme-pending",reflect:!0,type:Boolean})],r.prototype,"themePending",void 0),i([I()],r.prototype,"themeReadyState",void 0),i([n({attribute:"default-scheme",type:String,reflect:!0})],r.prototype,"defaultScheme",void 0),i([n({attribute:"scheme",type:String,reflect:!0})],r.prototype,"scheme",null),r=l=i([O("esp-root")],r);export{le as BUILT_IN_IMAGE_TEXTURES,r as EspalierRoot,he as registerImageTexture,ae as registeredImageTextures};
@@ -1 +1 @@
1
- import{deriveSemantic as k,deriveSemanticWithContrast as A,serializeOklch as R}from"../../shared/color-engine.js";import{SEMANTIC_COLOR_NAMES as C,TOKEN_PAIRINGS as L,resolveLightnessReference as M,semanticToCSS as y}from"../../shared/theme-core.js";import{resolveMappingSource as E}from"./compute-variants.js";function I(o,g,r,t,i,m){return[o.l,o.c,o.h,g,r,t,i.l,i.c,i.h,m].join("|")}function K(o,g,r={}){const t={},i={},m=new Map,h=(e,s)=>{const n=r.effectiveSource?.(e,s)??s,c=E(n,g,o.anchors);return c||r.onUnresolvedSource?.(n),{color:c??g.primary,resolved:c!==null,source:n}};for(const e of C){if(L[e])continue;const s=o.semanticMappings[e],n=o.chroma[e],c=h(e,s.source),a=M(o.lightness,o.tones,s.lightness),u=k(c.color,a,n.min,n.max),l=y(e);i[e]=u,t[l]=R(u),r.trace&&r.trace.push({token:e,property:l,resolved:t[l],source:c.source,lightness:s.lightness,sourceResolved:c.resolved,base:c.color})}for(const e of C){const s=L[e];if(!s)continue;const n=o.semanticMappings[e],c=o.chroma[e],a=h(e,n.source),u=M(o.lightness,o.tones,n.lightness),l=i[s.bg],v=I(a.color,u,c.min,c.max,l,s.targetLc);let f=m.get(v);if(!f){let S;const N=A(a.color,u,c.min,c.max,l,s.targetLc,r.trace&&(O=>{S=O}));f={requested:S,semantic:N},m.set(v,f)}const{requested:x,semantic:d}=f,p=y(e);i[e]=d,t[p]=R(d),r.trace&&r.trace.push({token:e,property:p,resolved:t[p],source:a.source,lightness:n.lightness,sourceResolved:a.resolved,base:a.color,requested:x,contrast:{against:s.bg,background:l,targetLc:s.targetLc}})}return t}export{K as computeSemanticProperties};
1
+ import{deriveSemantic as A,deriveSemanticWithContrast as K,parseOklch as P,serializeOklch as N}from"../../shared/color-engine.js";import{SEMANTIC_COLOR_NAMES as _,TOKEN_PAIRINGS as S,resolveLightnessReference as x,semanticToCSS as R}from"../../shared/theme-core.js";import{FOOTER_INK_PROPERTIES as j}from"../../shared/footer-ink.js";import{resolveMappingSource as q}from"./compute-variants.js";function G(n,u,c,t,i,m,p){return[n.l,n.c,n.h,u,c,t,i.l,i.c,i.h,m,p].join("|")}function W(n,u,c={}){const t={},i={},m=new Map,p=c.trace!==void 0||c.footerTrace!==void 0,O=(e,o,r,s,a,g,l=!1)=>{const v=n.semanticMappings[e],d=n.chroma[e],f=T(e,v.source),C=x(n.lightness,n.tones,v.lightness),E=G(f.color,C,d.min,d.max,s,a,l);let h=m.get(E);if(!h){let M;const k=K(f.color,C,d.min,d.max,s,a,p?y=>{M=y}:void 0,l);h={requested:M,semantic:k},m.set(E,h)}const{requested:F,semantic:I}=h;return t[o]=N(I),g?.push({token:e,property:o,resolved:t[o],source:f.source,lightness:v.lightness,sourceResolved:f.resolved,base:f.color,requested:F,contrast:{against:r,background:s,targetLc:a}}),I},T=(e,o)=>{const r=c.effectiveSource?.(e,o)??o,s=q(r,u,n.anchors);return s||c.onUnresolvedSource?.(r),{color:s??u.primary,resolved:s!==null,source:r}};for(const e of _){if(S[e])continue;const o=n.semanticMappings[e],r=n.chroma[e],s=T(e,o.source),a=x(n.lightness,n.tones,o.lightness),g=A(s.color,a,r.min,r.max),l=R(e);i[e]=g,t[l]=N(g),c.trace&&c.trace.push({token:e,property:l,resolved:t[l],source:s.source,lightness:o.lightness,sourceResolved:s.resolved,base:s.color})}for(const e of _){const o=S[e];o&&(i[e]=O(e,R(e),o.bg,i[o.bg],o.targetLc,c.trace))}if(c.includeFooterInk!==!1){const e=P(t[R("layer2")]);for(const[o,r]of Object.entries(j)){const s=o;O(s,r,"layer2",e,S[s].targetLc,c.footerTrace,!0)}}return t}export{W as computeSemanticProperties};
@@ -1 +1 @@
1
- import{parseCssColor as m,serializeOklch as b,gamutMapToSRGB as S}from"../../shared/color-engine.js";import{compileComponentProperties as O}from"../../shared/component-property-compiler.js";import{generateScaleProperties as k}from"../../shared/scale-engine.js";import{DATA_SERIES_KEYS as y,DEFAULT_DATA_PALETTE as B,generateDivergingRamp as R,generateSequentialRamp as w}from"../../shared/data-colors.js";import{DEFAULT_BODY_FONT_FAMILY as E,DEFAULT_MONOSPACE_FONT_FAMILY as I,resolveDataColorSource as P}from"../../shared/theme-core.js";import{dataCompanionProperties as $}from"./data-companion-properties.js";import{lightnessRampProperties as M}from"./lightness-ramp-properties.js";import{surfacePolarityProperty as T}from"./surface-polarity-property.js";import{computeVariants as x}from"./compute-variants.js";import{computeSemanticProperties as A}from"./compute-semantic-properties.js";function C(o){return{rootFontSize:o.rootFontSize,typeRatio:o.typeRatio,spaceRatio:o.spaceRatio,borderRadius:o.borderRadius,viewportMin:o.viewportMin,viewportMax:o.viewportMax}}function _(o,g,l){const d={},s=o.dataPalette??B;for(let r=0;r<y.length;r+=1){const a=y[r],i=m(l(s[a],`dataPalette.${a}`))??g;d[`--esp-color-series-${r+1}`]=b(S(i))}return d}function q(o,g,l,d={},s){const r=m(o.seedColor);if(!r)return{};const a={};a["--esp-scheme"]=g,a["--esp-seed-color"]=o.seedColor;const i=x(r,o);for(const[e,n]of Object.entries(i))a[`--esp-color-${e}`]=b(S(n));const f=new Set,p=(e,n)=>{const t=typeof e=="string"?P(e,o.anchors):null;if(t)return t;const c=typeof e=="string"?e:String(e);return f.has(c)||(f.add(c),console.warn(`Espalier theme: ${n} color source "${c}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared data colors.`)),o.seedColor};Object.assign(a,_(o,r,p));for(const[e,n]of Object.entries(o.dataRamps??{}))try{(n.type==="sequential"?w(p(n.source,`dataRamps.${e}.source`),{steps:n.steps,lightnessStart:n.lightnessStart,lightnessEnd:n.lightnessEnd}):R(p(n.start,`dataRamps.${e}.start`),p(n.end,`dataRamps.${e}.end`),{steps:n.steps,neutral:n.neutral===void 0?void 0:p(n.neutral,`dataRamps.${e}.neutral`)})).forEach((c,v)=>{a[`--esp-color-ramp-${e}-${v+1}`]=c})}catch(t){console.warn(`Espalier theme: dataRamps.${e} cannot be generated \u2014 ${t instanceof Error?t.message:String(t)}`)}Object.assign(a,M(o));const u=new Set;return Object.assign(a,A(o,i,{trace:l,onUnresolvedSource:e=>{u.has(e)||(u.add(e),console.warn(`Espalier theme: color source "${e}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared anchors.`))}})),s&&Object.assign(a,O(s.surface,{theme:o,variants:i,semanticProperties:a},s.trace)),Object.assign(a,T(a)),Object.assign(a,$(a)),Object.assign(a,k(C(o),d.viewportWidth)),a["--esp-font-body"]=o.fontBody||E,o.fontHeadings&&(a["--esp-font-headings"]=o.fontHeadings),o.fontBrand&&(a["--esp-font-brand"]=o.fontBrand),o.fontMenu&&(a["--esp-font-menu"]=o.fontMenu),a["--esp-font-monospace"]=o.fontMonospace||I,a["--esp-font-weight-body"]=o.fontWeightBody,a["--esp-font-weight-headings"]=o.fontWeightHeadings,a["--esp-font-weight-brand"]=o.fontWeightBrand,a["--esp-font-weight-menu"]=o.fontWeightMenu,a["--esp-font-weight-monospace"]=o.fontWeightMonospace,o.pageBackgroundImage&&(a["--esp-page-background-image"]=o.pageBackgroundImage),o.pageBackgroundImageOpacity!==void 0&&(a["--esp-page-background-image-opacity"]=o.pageBackgroundImageOpacity.toString()),o.boxBackgroundImage&&(a["--esp-box-background-image"]=o.boxBackgroundImage),o.boxBackgroundImageOpacity!==void 0&&(a["--esp-box-background-image-opacity"]=o.boxBackgroundImageOpacity.toString()),o.vellumOpacity!==void 0&&(a["--esp-vellum-opacity"]=o.vellumOpacity.toString()),o.vellumBackgroundImage&&(a["--esp-vellum-background-image"]=o.vellumBackgroundImage),o.vellumBackgroundImageOpacity!==void 0&&(a["--esp-vellum-background-image-opacity"]=o.vellumBackgroundImageOpacity.toString()),a}export{q as computeThemeProperties,_ as dataSeriesProperties};
1
+ import{parseCssColor as b,serializeOklch as S,gamutMapToSRGB as y}from"../../shared/color-engine.js";import{compileComponentProperties as k}from"../../shared/component-property-compiler.js";import{generateScaleProperties as B}from"../../shared/scale-engine.js";import{DATA_SERIES_KEYS as v,DEFAULT_DATA_PALETTE as R,generateDivergingRamp as w,generateSequentialRamp as E}from"../../shared/data-colors.js";import{DEFAULT_BODY_FONT_FAMILY as I,DEFAULT_MONOSPACE_FONT_FAMILY as P,resolveDataColorSource as $}from"../../shared/theme-core.js";import{dataCompanionProperties as M}from"./data-companion-properties.js";import{lightnessRampProperties as T}from"./lightness-ramp-properties.js";import{surfacePolarityProperty as x}from"./surface-polarity-property.js";import{computeVariants as A}from"./compute-variants.js";import{computeSemanticProperties as C}from"./compute-semantic-properties.js";function _(o){return{rootFontSize:o.rootFontSize,typeRatio:o.typeRatio,spaceRatio:o.spaceRatio,borderRadius:o.borderRadius,viewportMin:o.viewportMin,viewportMax:o.viewportMax}}function j(o,g,l){const d={},i=o.dataPalette??R;for(let t=0;t<v.length;t+=1){const s=v[t],a=b(l(i[s],`dataPalette.${s}`))??g;d[`--esp-color-series-${t+1}`]=S(y(a))}return d}function G(o,g,l,d={},i,t){const s=b(o.seedColor);if(!s)return{};const a={};a["--esp-scheme"]=g,a["--esp-seed-color"]=o.seedColor;const f=A(s,o);for(const[e,n]of Object.entries(f))a[`--esp-color-${e}`]=S(y(n));const u=new Set,p=(e,n)=>{const r=typeof e=="string"?$(e,o.anchors):null;if(r)return r;const c=typeof e=="string"?e:String(e);return u.has(c)||(u.add(c),console.warn(`Espalier theme: ${n} color source "${c}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared data colors.`)),o.seedColor};Object.assign(a,j(o,s,p));for(const[e,n]of Object.entries(o.dataRamps??{}))try{(n.type==="sequential"?E(p(n.source,`dataRamps.${e}.source`),{steps:n.steps,lightnessStart:n.lightnessStart,lightnessEnd:n.lightnessEnd}):w(p(n.start,`dataRamps.${e}.start`),p(n.end,`dataRamps.${e}.end`),{steps:n.steps,neutral:n.neutral===void 0?void 0:p(n.neutral,`dataRamps.${e}.neutral`)})).forEach((c,O)=>{a[`--esp-color-ramp-${e}-${O+1}`]=c})}catch(r){console.warn(`Espalier theme: dataRamps.${e} cannot be generated \u2014 ${r instanceof Error?r.message:String(r)}`)}Object.assign(a,T(o));const m=new Set;return Object.assign(a,C(o,f,{trace:l,footerTrace:t,onUnresolvedSource:e=>{m.has(e)||(m.add(e),console.warn(`Espalier theme: color source "${e}" cannot be resolved \u2014 falling back to the seed. Run validateTheme for the declared anchors.`))}})),i&&Object.assign(a,k(i.surface,{theme:o,variants:f,semanticProperties:a},i.trace)),Object.assign(a,x(a)),Object.assign(a,M(a)),Object.assign(a,B(_(o),d.viewportWidth)),a["--esp-font-body"]=o.fontBody||I,o.fontHeadings&&(a["--esp-font-headings"]=o.fontHeadings),o.fontBrand&&(a["--esp-font-brand"]=o.fontBrand),o.fontMenu&&(a["--esp-font-menu"]=o.fontMenu),a["--esp-font-monospace"]=o.fontMonospace||P,a["--esp-font-weight-body"]=o.fontWeightBody,a["--esp-font-weight-headings"]=o.fontWeightHeadings,a["--esp-font-weight-brand"]=o.fontWeightBrand,a["--esp-font-weight-menu"]=o.fontWeightMenu,a["--esp-font-weight-monospace"]=o.fontWeightMonospace,o.pageBackgroundImage&&(a["--esp-page-background-image"]=o.pageBackgroundImage),o.pageBackgroundImageOpacity!==void 0&&(a["--esp-page-background-image-opacity"]=o.pageBackgroundImageOpacity.toString()),o.boxBackgroundImage&&(a["--esp-box-background-image"]=o.boxBackgroundImage),o.boxBackgroundImageOpacity!==void 0&&(a["--esp-box-background-image-opacity"]=o.boxBackgroundImageOpacity.toString()),o.vellumOpacity!==void 0&&(a["--esp-vellum-opacity"]=o.vellumOpacity.toString()),o.vellumBackgroundImage&&(a["--esp-vellum-background-image"]=o.vellumBackgroundImage),o.vellumBackgroundImageOpacity!==void 0&&(a["--esp-vellum-background-image-opacity"]=o.vellumBackgroundImageOpacity.toString()),a}export{G as computeThemeProperties,j as dataSeriesProperties};
@@ -1 +1 @@
1
- import{CSS_NAMED_COLORS as w}from"./css-named-colors.js";const mt={l:0,c:0,h:0},Mt={l:1,c:0,h:0},B=Math.PI/180,p=1e-4,K=50,_="[+-]?(?:\\d+|\\d*\\.\\d+)(?:[eE][+-]?\\d+)?",h="[\\t\\n\\f\\r ]",U=new RegExp(h+"*,"+h+"*"),z=new RegExp(h+"+");function d(t){return t.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," ").replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g,"")}const P={"":1,deg:1,grad:.9,rad:180/Math.PI,turn:360},Y=.4,j=new RegExp("^oklch\\("+h+"*("+_+")(%?)"+h+"+("+_+")(%?)"+h+"+("+_+")(deg|grad|rad|turn)?"+h+"*\\)$","i");function k(t){const n=t.h*B;return{L:t.l,a:t.c*Math.cos(n),b:t.c*Math.sin(n)}}function q(t){const n=t.L+.3963377774*t.a+.2158037573*t.b,e=t.L-.1055613458*t.a-.0638541728*t.b,r=t.L-.0894841775*t.a-1.291485548*t.b,o=n*n*n,c=e*e*e,s=r*r*r;return{r:4.0767416621*o-3.3077115913*c+.2309699292*s,g:-1.2684380046*o+2.6097574011*c-.3413193965*s,b:-.0041960863*o-.7034186147*c+1.707614701*s}}function A(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function J(t){return{r:A(t.r),g:A(t.g),b:A(t.b)}}function Q(t){return t.r>=-p&&t.r<=1+p&&t.g>=-p&&t.g<=1+p&&t.b>=-p&&t.b<=1+p}function f(t){return Math.max(0,Math.min(1,t))}function Z(t){const n=d(t).match(j);if(!n)return null;let e=parseFloat(n[1]);n[2]==="%"&&(e/=100);let r=parseFloat(n[3]);n[4]==="%"&&(r=r/100*Y);const o=parseFloat(n[5])*P[(n[6]??"").toLowerCase()];return!isFinite(e)||!isFinite(r)||!isFinite(o)?null:{l:Math.max(0,Math.min(1,e)),c:Math.max(0,r),h:(o%360+360)%360}}function gt(t){const n=M(t.l,6),e=M(t.c,6),r=M((t.h%360+360)%360,4);return`oklch(${n} ${e} ${r})`}function R(t){return J(q(k(t)))}function S(t){return Q(R(t))}function x(t){if(t.c<=p||S(t))return{...t};let n=0,e=t.c,r={...t};for(let o=0;o<K;o++){const c=(n+e)/2;if(r={l:t.l,c,h:t.h},S(r)?n=c:e=c,e-n<p)break}return{l:t.l,c:n,h:t.h}}function tt(t,n,e){const r={l:t.l,c:Math.max(n,Math.min(e,t.c)),h:t.h};return x(r)}const L=.022,I=.012,v=.022,F=.57,N=.56,y=1.14,O=.001,b=.027;function D(t){const n=Math.pow(f(t.r),2.4),e=Math.pow(f(t.g),2.4),r=Math.pow(f(t.b),2.4);return .2126729*n+.7151522*e+.072175*r}function $(t,n){const e=R(x(t)),r=R(x(n));let o=D(e),c=D(r);if(o=o>L?o:o+Math.pow(L-o,1.414),c=c>L?c:c+Math.pow(L-c,1.414),Math.abs(c-o)<O)return 0;let s;if(c>o){const u=Math.pow(c,N),l=Math.pow(o,F);if(s=(u-l)*y,s<O)return 0;s=s<b?s-s*v*b:s-v}else{const u=Math.pow(c,N),l=Math.pow(o,F);if(s=(u-l)*y,s>-O)return 0;s=s>-b?s-s*I*b:s+I}return s*100}function nt(t,n,e=60){let r=x({...t}),o=Math.abs($(r,n));if(o>=e)return r;const c=n.l>.5,s=.01,u=c?0:1;for(let l=0;l<100;l++){if(c?r.l=Math.max(u,r.l-s):r.l=Math.min(u,r.l+s),r=x(r),o=Math.abs($(r,n)),o>=e)return r;if(r.l<=0||r.l>=1)break}return r}function xt(t,n){return((t+n)%360+360)%360}function Ct(t,n){const e=k(t),r=k(n),o=e.L-r.L,c=e.a-r.a,s=e.b-r.b;return Math.sqrt(o*o+c*c+s*s)}function rt(t,n,e,r){return tt({l:n,c:t.c,h:t.h},e,r)}function _t(t,n,e,r,o,c=60,s){const u=rt(t,n,e,r);return s?.(u),nt(u,o,c)}function G(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function et(t){return{r:G(t.r),g:G(t.g),b:G(t.b)}}function ot({r:t,g:n,b:e}){const r=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*e),o=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*e),c=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*e);return{L:.2104542553*r+.793617785*o-.0040720468*c,a:1.9779984951*r-2.428592205*o+.4505937099*c,b:.0259040371*r+.7827717662*o-.808675766*c}}function ct(t){return ot(et(t))}function H(t){const n=Math.sqrt(t.a*t.a+t.b*t.b),e=n<1e-12?0:(Math.atan2(t.b,t.a)/B%360+360)%360;return{l:t.L,c:n,h:e}}function st(t){const n=M(t.c,4);return{l:M(t.l,3),c:n,h:n===0?0:M(t.h,1)}}function m(t){return Math.round(f(t)*255)}function ut(t){const n=H(ct(t)),e=t.r===t.g&&t.g===t.b?{l:n.l,c:0,h:0}:n,r=st(e);if(S(r)){const o=R(r);if(m(o.r)===m(t.r)&&m(o.g)===m(t.g)&&m(o.b)===m(t.b))return r}return e}function V(t,n){const e=t.slice(1),r=e.length;if(!/^[0-9a-f]+$/i.test(e)||r!==3&&r!==6&&!(n&&(r===4||r===8)))return null;const o=r<=4?1:2,c=s=>{const u=e.slice(s*o,(s+1)*o);return parseInt(o===1?u.repeat(2):u,16)/255};return{space:"srgb",color:{r:c(0),g:c(1),b:c(2)},alpha:r===4||r===8?c(3):1}}function C(t,n,e){const r=t.match(new RegExp("^"+n+"\\("+h+"*([^)]*?)"+h+"*\\)$","i"));if(!r)return null;const o=r[1],c=o.includes(","),s=o.split("/");if(s.length>2||s.length===2&&(c||!e))return null;const l=d(s[0]).split(c?U:z),i=c&&l.length===4&&e?l.pop():s[1];if(l.length!==3||l.some(g=>g.length===0))return null;const a=i===void 0?1:W(d(i));return a===null?null:{args:l,legacy:c,alpha:a}}const at=new RegExp("^("+_+")([a-z%]*)$","i");function T(t){const n=t.match(at);if(!n)return null;const e=parseFloat(n[1]);return isFinite(e)?{value:e,unit:n[2].toLowerCase()}:null}function W(t){if(t.toLowerCase()==="none")return 0;const n=T(t);return!n||n.unit!==""&&n.unit!=="%"?null:f(n.unit==="%"?n.value/100:n.value)}function lt(t){if(t.unit!==""&&t.unit!=="%")return null;const n=t.unit==="%"?t.value/100:t.value/255;return Math.max(0,Math.min(1,n))}function it(t){const n=P[t.unit];return n===void 0?null:t.value*n}function X(t){return t.unit!==""&&t.unit!=="%"?null:Math.max(0,Math.min(1,t.value/100))}function ht(t,n,e){const r=(t%360+360)%360,o=c=>{const s=(c+r/30)%12,u=n*Math.min(e,1-e);return e-u*Math.max(-1,Math.min(s-3,9-s,1))};return{r:o(0),g:o(8),b:o(4)}}const dt='"#rrggbb", "#rgb", "rgb(\u2026)", "hsl(\u2026)", "oklch(\u2026)"';function Rt(t){const n=pt(t,!1);return n?n.space==="oklch"?n.color:ut(n.color):null}function pt(t,n){const e=d(t);if(e.startsWith("#"))return V(e,n);if(/^oklch\(/i.test(e)){const r=n?C(e,"oklch",!0):null;if(n&&(!r||r.legacy))return null;const o=Z(r?`oklch(${r.args.map(c=>c.toLowerCase()==="none"?"0":c).join(" ")})`:e);return o?{space:"oklch",color:o,alpha:r?.alpha??1}:null}if(/^rgba?\(/i.test(e)){const r=C(e,"rgba?",n);if(!r)return null;const o=r.args.map(T);if(o.some(a=>a===null))return null;const c=o;if(r.legacy&&new Set(c.map(a=>a.unit)).size>1)return null;const s=c.map(lt);if(s.some(a=>a===null))return null;const[u,l,i]=s;return{space:"srgb",color:{r:u,g:l,b:i},alpha:r.alpha}}if(/^hsla?\(/i.test(e)){const r=C(e,"hsla?",n);if(!r)return null;const o=r.args.map(T);if(o.some(g=>g===null))return null;const[c,s,u]=o;if(r.legacy&&(s.unit!=="%"||u.unit!=="%"))return null;const l=it(c),i=X(s),a=X(u);return l===null||i===null||a===null?null:{space:"srgb",color:ht(l,i,a),alpha:r.alpha}}if(n){if(/^oklab\(/i.test(e)){const c=C(e,"oklab",!0);if(!c||c.legacy)return null;const s=c.args.map(a=>T(a.toLowerCase()==="none"?"0":a));if(s.some(a=>!a||a.unit!==""&&a.unit!=="%"))return null;const[u,l,i]=s.map((a,g)=>{const E=a;return E.unit!=="%"?E.value:E.value/100*(g===0?1:.4)});return{space:"oklch",color:H({L:f(u),a:l,b:i}),alpha:c.alpha}}const r=e.toLowerCase();if(Object.prototype.hasOwnProperty.call(w,r))return V(w[r],n);if(r==="transparent")return{space:"srgb",color:{r:0,g:0,b:0},alpha:0};const o=e.match(new RegExp("^color\\("+h+"*srgb"+h+"+","i"));if(o){const c=C(`color(${e.slice(o[0].length)}`,"color",!0);if(!c||c.legacy)return null;const s=c.args.map(W);if(s.some(a=>a===null))return null;const[u,l,i]=s;return{space:"srgb",color:{r:u,g:l,b:i},alpha:c.alpha}}}return null}function M(t,n){const e=Math.pow(10,n);return Math.round(t*e)/e}export{dt as ACCEPTED_COLOR_FORMS,mt as BLACK_INK,Mt as WHITE_INK,$ as apcaContrast,f as clampChannel,tt as clampChromaAndGamutMap,Ct as deltaEOK,rt as deriveSemantic,_t as deriveSemanticWithContrast,nt as ensureContrast,G as gammaToLinear,x as gamutMapToSRGB,S as isInSRGBGamut,ot as linearRgbToOklab,H as oklabToOklch,k as oklchToOklab,R as oklchToSRGB,Rt as parseCssColor,pt as parseCssColorValue,Z as parseOklch,xt as rotateHue,gt as serializeOklch,et as srgbToLinearRGB,ct as srgbToOklab};
1
+ import{CSS_NAMED_COLORS as P}from"./css-named-colors.js";const U={l:0,c:0,h:0},z={l:1,c:0,h:0},v=Math.PI/180,m=1e-4,q=50,_="[+-]?(?:\\d+|\\d*\\.\\d+)(?:[eE][+-]?\\d+)?",p="[\\t\\n\\f\\r ]",Y=new RegExp(p+"*,"+p+"*"),j=new RegExp(p+"+");function R(t){return t.replace(/\/\*[\s\S]*?(?:\*\/|$)/g," ").replace(/^[\t\n\f\r ]+|[\t\n\f\r ]+$/g,"")}const F={"":1,deg:1,grad:.9,rad:180/Math.PI,turn:360},J=.4,Q=new RegExp("^oklch\\("+p+"*("+_+")(%?)"+p+"+("+_+")(%?)"+p+"+("+_+")(deg|grad|rad|turn)?"+p+"*\\)$","i");function k(t){const n=t.h*v;return{L:t.l,a:t.c*Math.cos(n),b:t.c*Math.sin(n)}}function Z(t){const n=t.L+.3963377774*t.a+.2158037573*t.b,r=t.L-.1055613458*t.a-.0638541728*t.b,e=t.L-.0894841775*t.a-1.291485548*t.b,c=n*n*n,o=r*r*r,s=e*e*e;return{r:4.0767416621*c-3.3077115913*o+.2309699292*s,g:-1.2684380046*c+2.6097574011*o-.3413193965*s,b:-.0041960863*c-.7034186147*o+1.707614701*s}}function A(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function tt(t){return{r:A(t.r),g:A(t.g),b:A(t.b)}}function nt(t){return t.r>=-m&&t.r<=1+m&&t.g>=-m&&t.g<=1+m&&t.b>=-m&&t.b<=1+m}function M(t){return Math.max(0,Math.min(1,t))}function rt(t){const n=R(t).match(Q);if(!n)return null;let r=parseFloat(n[1]);n[2]==="%"&&(r/=100);let e=parseFloat(n[3]);n[4]==="%"&&(e=e/100*J);const c=parseFloat(n[5])*F[(n[6]??"").toLowerCase()];return!isFinite(r)||!isFinite(e)||!isFinite(c)?null:{l:Math.max(0,Math.min(1,r)),c:Math.max(0,e),h:(c%360+360)%360}}function xt(t){const n=x(t.l,6),r=x(t.c,6),e=x((t.h%360+360)%360,4);return`oklch(${n} ${r} ${e})`}function T(t){return tt(Z(k(t)))}function S(t){return nt(T(t))}function C(t){if(t.c<=m||S(t))return{...t};let n=0,r=t.c,e={...t};for(let c=0;c<q;c++){const o=(n+r)/2;if(e={l:t.l,c:o,h:t.h},S(e)?n=o:r=o,r-n<m)break}return{l:t.l,c:n,h:t.h}}function et(t,n,r){const e={l:t.l,c:Math.max(n,Math.min(r,t.c)),h:t.h};return C(e)}const L=.022,I=.012,N=.022,D=.57,y=.56,$=1.14,O=.001,b=.027;function H(t){const n=Math.pow(M(t.r),2.4),r=Math.pow(M(t.g),2.4),e=Math.pow(M(t.b),2.4);return .2126729*n+.7151522*r+.072175*e}function G(t,n){const r=T(C(t)),e=T(C(n));let c=H(r),o=H(e);if(c=c>L?c:c+Math.pow(L-c,1.414),o=o>L?o:o+Math.pow(L-o,1.414),Math.abs(o-c)<O)return 0;let s;if(o>c){const l=Math.pow(o,y),a=Math.pow(c,D);if(s=(l-a)*$,s<O)return 0;s=s<b?s-s*N*b:s-N}else{const l=Math.pow(o,y),a=Math.pow(c,D);if(s=(l-a)*$,s>-O)return 0;s=s>-b?s-s*I*b:s+I}return s*100}function ot(t,n,r=60,e=!1){const c=C({...t}),o=f=>Math.abs(G(f,n))>=r;if(o(c))return c;const s=f=>{let h={...c};for(let B=0;B<100&&(h.l=f?Math.max(0,h.l-.01):Math.min(1,h.l+.01),h=C(h),!(o(h)||h.l<=0||h.l>=1));B++);return h},l=n.l>.5,a=s(l);if(!e||o(a))return a;const i=l?z:U;if(!o(i))return Math.abs(G(i,n))>Math.abs(G(a,n))?{...i}:a;const u=s(!l);return o(u)?u:{...i}}function Ct(t,n){return((t+n)%360+360)%360}function dt(t,n){const r=k(t),e=k(n),c=r.L-e.L,o=r.a-e.a,s=r.b-e.b;return Math.sqrt(c*c+o*o+s*s)}function ct(t,n,r,e){return et({l:n,c:t.c,h:t.h},r,e)}function _t(t,n,r,e,c,o=60,s,l=!1){const a=ct(t,n,r,e);return s?.(a),ot(a,c,o,l)}function w(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function st(t){return{r:w(t.r),g:w(t.g),b:w(t.b)}}function at({r:t,g:n,b:r}){const e=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*r),c=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*r),o=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*r);return{L:.2104542553*e+.793617785*c-.0040720468*o,a:1.9779984951*e-2.428592205*c+.4505937099*o,b:.0259040371*e+.7827717662*c-.808675766*o}}function ut(t){return at(st(t))}function V(t){const n=Math.sqrt(t.a*t.a+t.b*t.b),r=n<1e-12?0:(Math.atan2(t.b,t.a)/v%360+360)%360;return{l:t.L,c:n,h:r}}function lt(t){const n=x(t.c,4);return{l:x(t.l,3),c:n,h:n===0?0:x(t.h,1)}}function g(t){return Math.round(M(t)*255)}function it(t){const n=V(ut(t)),r=t.r===t.g&&t.g===t.b?{l:n.l,c:0,h:0}:n,e=lt(r);if(S(e)){const c=T(e);if(g(c.r)===g(t.r)&&g(c.g)===g(t.g)&&g(c.b)===g(t.b))return e}return r}function W(t,n){const r=t.slice(1),e=r.length;if(!/^[0-9a-f]+$/i.test(r)||e!==3&&e!==6&&!(n&&(e===4||e===8)))return null;const c=e<=4?1:2,o=s=>{const l=r.slice(s*c,(s+1)*c);return parseInt(c===1?l.repeat(2):l,16)/255};return{space:"srgb",color:{r:o(0),g:o(1),b:o(2)},alpha:e===4||e===8?o(3):1}}function d(t,n,r){const e=t.match(new RegExp("^"+n+"\\("+p+"*([^)]*?)"+p+"*\\)$","i"));if(!e)return null;const c=e[1],o=c.includes(","),s=c.split("/");if(s.length>2||s.length===2&&(o||!r))return null;const a=R(s[0]).split(o?Y:j),i=o&&a.length===4&&r?a.pop():s[1];if(a.length!==3||a.some(f=>f.length===0))return null;const u=i===void 0?1:X(R(i));return u===null?null:{args:a,legacy:o,alpha:u}}const ht=new RegExp("^("+_+")([a-z%]*)$","i");function E(t){const n=t.match(ht);if(!n)return null;const r=parseFloat(n[1]);return isFinite(r)?{value:r,unit:n[2].toLowerCase()}:null}function X(t){if(t.toLowerCase()==="none")return 0;const n=E(t);return!n||n.unit!==""&&n.unit!=="%"?null:M(n.unit==="%"?n.value/100:n.value)}function pt(t){if(t.unit!==""&&t.unit!=="%")return null;const n=t.unit==="%"?t.value/100:t.value/255;return Math.max(0,Math.min(1,n))}function ft(t){const n=F[t.unit];return n===void 0?null:t.value*n}function K(t){return t.unit!==""&&t.unit!=="%"?null:Math.max(0,Math.min(1,t.value/100))}function mt(t,n,r){const e=(t%360+360)%360,c=o=>{const s=(o+e/30)%12,l=n*Math.min(r,1-r);return r-l*Math.max(-1,Math.min(s-3,9-s,1))};return{r:c(0),g:c(8),b:c(4)}}const Rt='"#rrggbb", "#rgb", "rgb(\u2026)", "hsl(\u2026)", "oklch(\u2026)"';function Tt(t){const n=Mt(t,!1);return n?n.space==="oklch"?n.color:it(n.color):null}function Mt(t,n){const r=R(t);if(r.startsWith("#"))return W(r,n);if(/^oklch\(/i.test(r)){const e=n?d(r,"oklch",!0):null;if(n&&(!e||e.legacy))return null;const c=rt(e?`oklch(${e.args.map(o=>o.toLowerCase()==="none"?"0":o).join(" ")})`:r);return c?{space:"oklch",color:c,alpha:e?.alpha??1}:null}if(/^rgba?\(/i.test(r)){const e=d(r,"rgba?",n);if(!e)return null;const c=e.args.map(E);if(c.some(u=>u===null))return null;const o=c;if(e.legacy&&new Set(o.map(u=>u.unit)).size>1)return null;const s=o.map(pt);if(s.some(u=>u===null))return null;const[l,a,i]=s;return{space:"srgb",color:{r:l,g:a,b:i},alpha:e.alpha}}if(/^hsla?\(/i.test(r)){const e=d(r,"hsla?",n);if(!e)return null;const c=e.args.map(E);if(c.some(f=>f===null))return null;const[o,s,l]=c;if(e.legacy&&(s.unit!=="%"||l.unit!=="%"))return null;const a=ft(o),i=K(s),u=K(l);return a===null||i===null||u===null?null:{space:"srgb",color:mt(a,i,u),alpha:e.alpha}}if(n){if(/^oklab\(/i.test(r)){const o=d(r,"oklab",!0);if(!o||o.legacy)return null;const s=o.args.map(u=>E(u.toLowerCase()==="none"?"0":u));if(s.some(u=>!u||u.unit!==""&&u.unit!=="%"))return null;const[l,a,i]=s.map((u,f)=>{const h=u;return h.unit!=="%"?h.value:h.value/100*(f===0?1:.4)});return{space:"oklch",color:V({L:M(l),a,b:i}),alpha:o.alpha}}const e=r.toLowerCase();if(Object.prototype.hasOwnProperty.call(P,e))return W(P[e],n);if(e==="transparent")return{space:"srgb",color:{r:0,g:0,b:0},alpha:0};const c=r.match(new RegExp("^color\\("+p+"*srgb"+p+"+","i"));if(c){const o=d(`color(${r.slice(c[0].length)}`,"color",!0);if(!o||o.legacy)return null;const s=o.args.map(X);if(s.some(u=>u===null))return null;const[l,a,i]=s;return{space:"srgb",color:{r:l,g:a,b:i},alpha:o.alpha}}}return null}function x(t,n){const r=Math.pow(10,n);return Math.round(t*r)/r}export{Rt as ACCEPTED_COLOR_FORMS,U as BLACK_INK,z as WHITE_INK,G as apcaContrast,M as clampChannel,et as clampChromaAndGamutMap,dt as deltaEOK,ct as deriveSemantic,_t as deriveSemanticWithContrast,ot as ensureContrast,w as gammaToLinear,C as gamutMapToSRGB,S as isInSRGBGamut,at as linearRgbToOklab,V as oklabToOklch,k as oklchToOklab,T as oklchToSRGB,Tt as parseCssColor,Mt as parseCssColorValue,rt as parseOklch,Ct as rotateHue,xt as serializeOklch,st as srgbToLinearRGB,ut as srgbToOklab};
@@ -1 +1 @@
1
- import{PUBLIC_TOKEN_NAMES as a,PUBLIC_TOKEN_PATTERNS as i}from"./public-token-catalog.generated.js";import{isSettableComponentPropertyName as l,PRIVATE_COMPONENT_PROPERTY_PREFIX as c,SETTABLE_COMPONENT_PROPERTIES as u}from"./settable-component-properties.js";import{PUBLIC_TOKEN_NAMES as h,PUBLIC_TOKEN_PATTERNS as C}from"./public-token-catalog.generated.js";const p=new Set(a),f=i.map(e=>new RegExp(e)),m=Object.keys(u);function T(e){return e.startsWith(c)?"private":l(e)?"settable":p.has(e)||f.some(t=>t.test(e))?"not_settable":"unknown"}function P(e,t){let o=Array.from({length:t.length+1},(n,s)=>s);for(let n=0;n<e.length;n+=1){const s=[n+1];for(let r=0;r<t.length;r+=1)s.push(Math.min(o[r+1]+1,s[r]+1,o[r]+ +(e[n]!==t[r])));o=s}return o[t.length]}function _(e,t=m){let o,n=1/0;for(const s of t){const r=P(e,s);(o===void 0||r<n||r===n&&s<o)&&(o=s,n=r)}return o}function d(e){if(!e)return"a JSON object of settable component property names and values";if(e.syntax==="color")return`${e.allowedValues?.join(", ")??"a semantic color token"} or a { source, lightness } mapping`;const t=e.allowedValues?.join(", ");if(e.syntax==="keyword")return`one of ${t}`;const o=`a length from ${e.min}${e.unit} to ${e.max}${e.unit}, or 0`;return t?`${o}, or one of ${t}`:o}export{h as PUBLIC_TOKEN_NAMES,C as PUBLIC_TOKEN_PATTERNS,T as classifyComponentPropertyName,d as describeAcceptedComponentPropertyValue,_ as nearestSettableComponentProperty};
1
+ import{PUBLIC_TOKEN_NAMES as a,PUBLIC_TOKEN_PATTERNS as i}from"./public-token-catalog.generated.js";import{isSettableComponentPropertyName as l,PRIVATE_COMPONENT_PROPERTY_PREFIX as u,SETTABLE_COMPONENT_PROPERTIES as c}from"./settable-component-properties.js";import{PUBLIC_TOKEN_NAMES as S,PUBLIC_TOKEN_PATTERNS as h}from"./public-token-catalog.generated.js";const m=new Set(a),p=i.map(e=>new RegExp(e)),f=Object.keys(c);function T(e){return e.startsWith(u)?"private":l(e)?"settable":m.has(e)||p.some(t=>t.test(e))?"not_settable":"unknown"}function N(e,t){let o=Array.from({length:t.length+1},(n,s)=>s);for(let n=0;n<e.length;n+=1){const s=[n+1];for(let r=0;r<t.length;r+=1)s.push(Math.min(o[r+1]+1,s[r]+1,o[r]+ +(e[n]!==t[r])));o=s}return o[t.length]}function _(e,t=f){let o,n=1/0;for(const s of t){const r=N(e,s);(o===void 0||r<n||r===n&&s<o)&&(o=s,n=r)}return o}function b(e){if(!e)return"a JSON object of settable component property names and values";if(e.syntax==="color")return`${e.allowedValues?.join(", ")??"a semantic color token"} or a { source, lightness } mapping`;if(e.syntax==="number")return`a unitless number from ${e.min} to ${e.max} in a JSON string`;const t=e.allowedValues?.join(", ");if(e.syntax==="keyword")return`one of ${t}`;const o=`a length from ${e.min}${e.unit} to ${e.max}${e.unit}, or 0`;return t?`${o}, or one of ${t}`:o}export{S as PUBLIC_TOKEN_NAMES,h as PUBLIC_TOKEN_PATTERNS,T as classifyComponentPropertyName,b as describeAcceptedComponentPropertyValue,_ as nearestSettableComponentProperty};
@@ -1 +1 @@
1
- import{parseCssColor as P}from"./color-engine.js";import{SEMANTIC_COLOR_PROPERTIES as y,SETTABLE_COMPONENT_PROPERTIES as p}from"./settable-component-properties.js";import{isColorSource as g,isLightnessKey as b,isObjectRecord as u,isThemeSlug as m,isThemeTone as S,toneReferenceName as T}from"./theme-mapping-grammar.js";import{parseAnchorSource as E}from"./variant-engine.js";const C=/[;{}]|!\s*important|(?:var|calc|url)\s*\(/i,R=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(em|rem)$/,h=new WeakMap;function l(e,n){return u(e)&&Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0}function j(e,n){if(g(e))return!0;if(typeof e!="string")return!1;const t=E(e);if(!t||!m(t.name))return!1;const{name:o,slot:r}=t;if(r!==void 0&&!m(r))return!1;const i=l(n,o),s=typeof i=="string"&&r===void 0?i:l(i,r??"color");return typeof s=="string"&&P(s)!==null}function N(e,n){if(b(e))return!0;const t=T(e);return t!==null&&n.has(t)}function M(e,n,t){if(typeof e=="string")return(n.allowedValues?n.allowedValues.includes(e):y.has(e))?e:void 0;if(!u(e)||Reflect.ownKeys(e).length!==2)return;const o=l(e,"source"),r=l(e,"lightness");if(!(!j(o,t.anchors)||!N(r,t.tones)))return{source:o,lightness:r}}function L(e,n){if(e==="0")return!0;const t=R.exec(e);if(!t||t[0]!==e||t[2]!==n.unit)return!1;const o=Number(t[1]);return Number.isFinite(o)&&o>=n.min&&o<=n.max}function V(e,n,t){if(!(typeof e=="string"&&C.test(e))){if(n.syntax==="color")return M(e,n,t);if(typeof e=="string"&&(n.syntax!=="keyword"&&L(e,n)||n.syntax!=="length"&&n.allowedValues?.includes(e)))return e}}function w(e,n){const t=new Set(n);if(u(e))for(const[o,r]of Object.entries(e))S(o,r)&&t.add(o);return t}function _(e,n,t){const o=new Map,{map:r,context:i}=e;if(r===void 0)return o;if(!u(r))return t.push({context:i,property:null,code:"bad_value"}),o;for(const[s,f]of Object.entries(r)){if(!Object.prototype.hasOwnProperty.call(n,s)){t.push({context:i,property:s,code:"unregistered"}),o.set(s,{valid:!1,authored:f});continue}const c=V(f,n[s],e);c===void 0?(t.push({context:i,property:s,code:"bad_value"}),o.set(s,{valid:!1,authored:f})):o.set(s,{valid:!0,authored:c})}return o}function O(e,n,t,o,r){const i=_(e,n,o),s=new Map(r?.winners),f={...r?.values};for(const[c,a]of i)if(s.set(c,{...a,context:e.context,overridesRoot:a.valid&&(r?.declarations.has(c)??!1)}),a.valid){f[c]=a.authored,t.add(c);const{derives:d}=n[c];d&&typeof a.authored=="string"&&Object.prototype.hasOwnProperty.call(d.values,a.authored)&&t.add(d.property)}else delete f[c];return{context:e.context,supplied:e.map!==void 0||(r?.supplied??!1),declarations:i,winners:s,values:f}}function x(e,n){const t=[],o=new Set,r=e.anchors,i=w(e.tones),s=O({map:e.componentProperties,context:null,anchors:r,tones:i},n,o,t),f=new Map;if(u(e.contexts))for(const[c,a]of Object.entries(e.contexts)){if(!u(a))continue;const d={map:a.componentProperties,context:c,anchors:r,tones:w(a.tones,i)};f.set(c,O(d,n,o,t,s))}for(const[c,{pairsWith:a}]of Object.entries(n))a!==void 0&&Object.prototype.hasOwnProperty.call(n,a)&&o.has(a)&&o.add(c);return{root:s,contexts:f,findings:t,candidates:o}}function K(e,n,t=p){return{...x(e,t),scheme:n}}function W(e){let n=h.get(e);return n||(n=x(e,p),h.set(e,n)),n}export{W as getComponentPropertyAnalysis,K as normalizeComponentProperties};
1
+ import{parseCssColor as b}from"./color-engine.js";import{SEMANTIC_COLOR_PROPERTIES as P,SETTABLE_COMPONENT_PROPERTIES as p}from"./settable-component-properties.js";import{isColorSource as S,isLightnessKey as g,isObjectRecord as u,isThemeSlug as m,isThemeTone as y,toneReferenceName as E}from"./theme-mapping-grammar.js";import{parseAnchorSource as T}from"./variant-engine.js";const C=/[;{}]|!\s*important|(?:var|calc|url)\s*\(/i,N=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(em|rem)$/,R=/^(?:\d+(?:\.\d+)?|\.\d+)$/,h=new WeakMap;function l(n,e){return u(n)&&Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0}function j(n,e){if(S(n))return!0;if(typeof n!="string")return!1;const t=T(n);if(!t||!m(t.name))return!1;const{name:o,slot:r}=t;if(r!==void 0&&!m(r))return!1;const i=l(e,o),s=typeof i=="string"&&r===void 0?i:l(i,r??"color");return typeof s=="string"&&b(s)!==null}function M(n,e){if(g(n))return!0;const t=E(n);return t!==null&&e.has(t)}function _(n,e,t){if(typeof n=="string")return(e.allowedValues?e.allowedValues.includes(n):P.has(n))?n:void 0;if(!u(n)||Reflect.ownKeys(n).length!==2)return;const o=l(n,"source"),r=l(n,"lightness");if(!(!j(o,t.anchors)||!M(r,t.tones)))return{source:o,lightness:r}}function L(n,e){if(n==="0")return!0;const t=N.exec(n);if(!t||t[0]!==n||t[2]!==e.unit)return!1;const o=Number(t[1]);return Number.isFinite(o)&&o>=e.min&&o<=e.max}function V(n,e,t){if(!(typeof n=="string"&&C.test(n))){if(e.syntax==="color")return _(n,e,t);if(typeof n=="string"){if(e.syntax==="number"){const o=Number(n);return R.exec(n)?.[0]===n&&o>=e.min&&o<=e.max?n:void 0}if(e.syntax!=="keyword"&&L(n,e)||e.syntax!=="length"&&e.allowedValues?.includes(n))return n}}}function x(n,e){const t=new Set(e);if(u(n))for(const[o,r]of Object.entries(n))y(o,r)&&t.add(o);return t}function z(n,e,t){const o=new Map,{map:r,context:i}=n;if(r===void 0)return o;if(!u(r))return t.push({context:i,property:null,code:"bad_value"}),o;for(const[s,f]of Object.entries(r)){if(!Object.prototype.hasOwnProperty.call(e,s)){t.push({context:i,property:s,code:"unregistered"}),o.set(s,{valid:!1,authored:f});continue}const c=V(f,e[s],n);c===void 0?(t.push({context:i,property:s,code:"bad_value"}),o.set(s,{valid:!1,authored:f})):o.set(s,{valid:!0,authored:c})}return o}function w(n,e,t,o,r){const i=z(n,e,o),s=new Map(r?.winners),f={...r?.values};for(const[c,a]of i)if(s.set(c,{...a,context:n.context,overridesRoot:a.valid&&(r?.declarations.has(c)??!1)}),a.valid){f[c]=a.authored,t.add(c);const{derives:d}=e[c];d&&typeof a.authored=="string"&&Object.prototype.hasOwnProperty.call(d.values,a.authored)&&t.add(d.property)}else delete f[c];return{context:n.context,supplied:n.map!==void 0||(r?.supplied??!1),declarations:i,winners:s,values:f}}function O(n,e){const t=[],o=new Set,r=n.anchors,i=x(n.tones),s=w({map:n.componentProperties,context:null,anchors:r,tones:i},e,o,t),f=new Map;if(u(n.contexts))for(const[c,a]of Object.entries(n.contexts)){if(!u(a))continue;const d={map:a.componentProperties,context:c,anchors:r,tones:x(a.tones,i)};f.set(c,w(d,e,o,t,s))}for(const[c,{pairsWith:a}]of Object.entries(e))a!==void 0&&Object.prototype.hasOwnProperty.call(e,a)&&o.has(a)&&o.add(c);return{root:s,contexts:f,findings:t,candidates:o}}function K(n,e,t=p){return{...O(n,t),scheme:e}}function W(n){let e=h.get(n);return e||(e=O(n,p),h.set(n,e)),e}export{W as getComponentPropertyAnalysis,K as normalizeComponentProperties};
@@ -1,4 +1,4 @@
1
- var d=function(v,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(v,e,t,r);else for(var s=v.length-1;s>=0;s--)(c=v[s])&&(n=(o<3?c(n):o>3?c(e,t,n):c(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};import{css as R,LitElement as C}from"lit";import{property as u,state as T}from"lit/decorators.js";import{flattenedParent as b,GoverningRootObserver as x}from"./governing-root.js";import{compileComponentProperties as S}from"./component-property-compiler.js";import{getComponentPropertyAnalysis as O}from"./component-property-normalizer.js";import{addComponentPropertyResets as _}from"./component-property-resets.js";import{ScopedStyleDeclarations as P}from"./scoped-style-declarations.js";import{traverseToClosest as E}from"./utilities.js";import{parseCssColor as U,serializeOklch as A,gamutMapToSRGB as z}from"./color-engine.js";import{computeVariants as m}from"../root/helpers/compute-variants.js";import{computeSemanticProperties as g}from"../root/helpers/compute-semantic-properties.js";import{DocumentSpriteController as I}from"./document-sprite.js";import{dataCompanionProperties as N}from"../root/helpers/data-companion-properties.js";import{dataSeriesProperties as j}from"../root/helpers/compute-theme-properties.js";import{lightnessRampProperties as B}from"../root/helpers/lightness-ramp-properties.js";import{surfacePolarityProperty as D}from"../root/helpers/surface-polarity-property.js";import{ELEVATION_PROPERTIES as V,TYPE_ROLE_COLOR_PROPERTIES as L}from"./scale-engine.js";import{resolveContextTheme as y,resolveDataColorSource as M,semanticToCSS as W}from"./theme-core.js";import{alignAttributeTextInheritance as q,focusRing as $}from"./style-fragments.js";import{syncNormalizedAttribute as G}from"./attribute-helpers.js";import{INTENT_VARIANTS as k,normalizeIntentVariant as H}from"./intent-values.js";import{ESP_EVENTS as Z}from"./events.js";import{surfaceLayerAttributes as w,surfaceLayerColor as Y}from"./surface-layer.js";class i extends C{get espRoot(){return this.rootObserver.root}get seedColor(){return this.seedColorBacker}set seedColor(e){this.seedColorBacker=e}focusResolvedElementAfterUpdate(e,t){const r=()=>{const o=e();return o?(o.focus(t),!0):!1};r()||this.updateComplete.then(()=>{r()})}focusShadowElementAfterUpdate(e,t){this.focusResolvedElementAfterUpdate(()=>this.shadowRoot?.querySelector(e),t)}emitValueChanged(e){this.dispatchEvent(new CustomEvent(Z.VALUE_CHANGED,{detail:e,bubbles:!0,composed:!0}))}get intent(){return this.intentBacker}set intent(e){const t=typeof e=="string"?e.trim():"";t!==""&&!k.includes(t)&&!this.warnedUnknownIntents.has(t)&&(this.warnedUnknownIntents.add(t),console.warn(`Espalier intent: "${t}" is not an intent; expected one of ${k.join(", ")}. Treating it as "neutral".`));const r=this.intentBacker,o=H(e);G(this,"intent",o),o!==r&&(this.intentBacker=o,this.requestUpdate("intent",r),this.applyTokensWhenRootReady())}get context(){return this.contextBacker}set context(e){const t=e??"";t!==this.contextBacker&&(this.contextBacker=t,this.applyTokensWhenRootReady(),this.refreshDescendantIntentDerivations())}refreshDescendantIntentDerivations(){const e=new Set,t=o=>{for(const n of Array.from(o.children))r(n)},r=o=>{if(!e.has(o)){if(e.add(o),o instanceof i&&o.applyTokensWhenRootReady(),o.shadowRoot&&t(o.shadowRoot),o instanceof HTMLSlotElement)for(const n of o.assignedElements({flatten:!0}))r(n);t(o)}};t(this),this.shadowRoot&&t(this.shadowRoot)}resolveAncestorZoneTheme(e){let t=b(this);for(;t;){if(t instanceof Element&&t.localName==="esp-root")return null;if(t instanceof i){const r=t.contextBacker.trim();if(r){const o=this.resolveNamedContextTheme(e,r);if(o)return o}}t=b(t)}return null}connectedCallback(){super.connectedCallback(),this.rootObserver.connect()}disconnectedCallback(){super.disconnectedCallback(),this.rootObserver.disconnect()}firstUpdated(e){if(this.isConnected&&!this.rootObserver.refresh())throw new Error("No esp-root ancestor found. Espalier components must be placed inside an <esp-root> element.");this.rootObserver.whenReady(this.applyReadyRoot)}governingRootChanged(e){}syncRootMetadata(e){this.scheme=e.scheme==="dark"?"dark":"light",this.seedColor=e.seedColor}applyTokensWhenRootReady(){this.rootObserver.refresh(),this.rootObserver.whenReady(this.applyReadyRoot)}constructor(){super(),this.seedColorBacker="oklch(0.7 0.125 216)",this.rootObserver=new x(this,(e,t)=>{e!==t&&(this.scopedTokens.clear(),this.governingRootChanged(e),this.isConnected&&this.requestUpdate()),e&&(this.syncRootMetadata(e),this.rootObserver.whenReady(this.applyReadyRoot))}),this.contextBacker="",this.scopedTokens=new P(this),this.warnedUnknownContexts=new Set,this.intentBacker="neutral",this.intentEmitsTokens=!0,this.warnedUnknownIntents=new Set,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.scheme="light",this.applyReadyRoot=e=>{this.syncRootMetadata(e),this.applyScopedColorTokens()},this.rootObserver.subscribe("scheme-changed",()=>{const e=this.espRoot;!e||this.scheme===e.scheme||(this.syncRootMetadata(e),this.rootObserver.whenReady(this.applyReadyRoot))}),this.rootObserver.subscribe("seed-color-changed",({seedColor:e})=>{this.seedColor=e,this.applyScopedColorTokens()}),this.rootObserver.subscribe("theme-changed",()=>{const e=this.espRoot;e&&this.syncRootMetadata(e),this.applyScopedColorTokens()}),this.rootObserver.subscribe("icon-sprite-url-changed",()=>this.requestUpdate()),new I(this,this.rootObserver)}traverseToClosest(e){return E(this,e)}applyScopedColorTokens(){if(!this.espRoot)return;const e=this.intentEmitsTokens?i.intentColorSources[this.intentBacker]:"";if(!e&&!this.context.trim()){this.scopedTokens.clear();return}const t=this.espRoot.activeTheme;if(!t){this.scopedTokens.clear();return}const r=this.resolveContextTheme(t),o=r.theme,n=U(o.seedColor);if(!n)return;const c=m(n,o),s={};if(r.applied){Object.assign(s,g(o,c));const{candidates:l,contexts:h}=O(t),p=h.get(r.name);if(p&&l.size>0){const a=S(p,{theme:o,variants:c,semanticProperties:s});_(a,l),Object.assign(s,a)}s["--_esp-context-shadow"]="var(--esp-color-shadow)",Object.assign(s,D(s)),Object.assign(s,B(o)),Object.assign(s,V),Object.assign(s,L),Object.assign(s,N(s,j(o,n,a=>(typeof a=="string"?M(a,o.anchors):null)??o.seedColor)))}if(e){let l=o;r.applied||(l=this.resolveAncestorZoneTheme(t)??o);const h=l===o?c:m(n,l),p=g(l,h,{effectiveSource:(a,f)=>i.semanticActionTokens.has(a)?e:f});s["--esp-color-primary"]=A(z(h[e]));for(const a of i.semanticActionTokens){const f=W(a);s[f]=p[f]}}this.scopedTokens.apply(s)}resolveContextTheme(e){const t=this.context.trim();if(!t)return{applied:!1,theme:e};const r=this.resolveNamedContextTheme(e,t);return r?{applied:!0,name:t,theme:r}:(this.warnUnknownContextWhenSettled(t),{applied:!1,theme:e})}warnUnknownContextWhenSettled(e){if(this.warnedUnknownContexts.has(e))return;const t=this.espRoot;if(t&&!t.themeSettled){t.whenThemeSettled().then(this.rootObserver.guard(r=>{if(this.context.trim()!==e)return;const o=r.activeTheme;o&&y(o,e)||this.warnUnknownContextWhenSettled(e)}));return}this.warnedUnknownContexts.add(e),console.warn(`Espalier context: "${e}" is not defined by the active theme; inheriting root tokens.`)}resolveNamedContextTheme(e,t){return y(e,t)}}i.intentColorSources={danger:"danger",info:"info",neutral:"",success:"success",warning:"warning"},i.semanticActionTokens=new Set(["actionBackground","actionText"]),i.styles=[w(":host"),w("[surface-layer]"),$(".esp-field:focus-within","--esp-field-focus-shadow"),q,R`
1
+ var d=function(v,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(v,e,t,r);else for(var s=v.length-1;s>=0;s--)(c=v[s])&&(n=(o<3?c(n):o>3?c(e,t,n):c(e,t))||n);return o>3&&n&&Object.defineProperty(e,t,n),n};import{css as R,LitElement as C}from"lit";import{property as u,state as T}from"lit/decorators.js";import{flattenedParent as b,GoverningRootObserver as x}from"./governing-root.js";import{compileComponentProperties as S}from"./component-property-compiler.js";import{getComponentPropertyAnalysis as O}from"./component-property-normalizer.js";import{addComponentPropertyResets as _}from"./component-property-resets.js";import{ScopedStyleDeclarations as P}from"./scoped-style-declarations.js";import{traverseToClosest as E}from"./utilities.js";import{parseCssColor as U,serializeOklch as A,gamutMapToSRGB as z}from"./color-engine.js";import{computeVariants as m}from"../root/helpers/compute-variants.js";import{computeSemanticProperties as g}from"../root/helpers/compute-semantic-properties.js";import{DocumentSpriteController as I}from"./document-sprite.js";import{dataCompanionProperties as N}from"../root/helpers/data-companion-properties.js";import{dataSeriesProperties as j}from"../root/helpers/compute-theme-properties.js";import{lightnessRampProperties as B}from"../root/helpers/lightness-ramp-properties.js";import{surfacePolarityProperty as D}from"../root/helpers/surface-polarity-property.js";import{ELEVATION_PROPERTIES as V,TYPE_ROLE_COLOR_PROPERTIES as L}from"./scale-engine.js";import{resolveContextTheme as y,resolveDataColorSource as M,semanticToCSS as W}from"./theme-core.js";import{alignAttributeTextInheritance as q,focusRing as $}from"./style-fragments.js";import{syncNormalizedAttribute as G}from"./attribute-helpers.js";import{INTENT_VARIANTS as k,normalizeIntentVariant as H}from"./intent-values.js";import{ESP_EVENTS as Z}from"./events.js";import{surfaceLayerAttributes as w,surfaceLayerColor as F}from"./surface-layer.js";class i extends C{get espRoot(){return this.rootObserver.root}get seedColor(){return this.seedColorBacker}set seedColor(e){this.seedColorBacker=e}focusResolvedElementAfterUpdate(e,t){const r=()=>{const o=e();return o?(o.focus(t),!0):!1};r()||this.updateComplete.then(()=>{r()})}focusShadowElementAfterUpdate(e,t){this.focusResolvedElementAfterUpdate(()=>this.shadowRoot?.querySelector(e),t)}emitValueChanged(e){this.dispatchEvent(new CustomEvent(Z.VALUE_CHANGED,{detail:e,bubbles:!0,composed:!0}))}get intent(){return this.intentBacker}set intent(e){const t=typeof e=="string"?e.trim():"";t!==""&&!k.includes(t)&&!this.warnedUnknownIntents.has(t)&&(this.warnedUnknownIntents.add(t),console.warn(`Espalier intent: "${t}" is not an intent; expected one of ${k.join(", ")}. Treating it as "neutral".`));const r=this.intentBacker,o=H(e);G(this,"intent",o),o!==r&&(this.intentBacker=o,this.requestUpdate("intent",r),this.applyTokensWhenRootReady())}get context(){return this.contextBacker}set context(e){const t=e??"";t!==this.contextBacker&&(this.contextBacker=t,this.applyTokensWhenRootReady(),this.refreshDescendantIntentDerivations())}refreshDescendantIntentDerivations(){const e=new Set,t=o=>{for(const n of Array.from(o.children))r(n)},r=o=>{if(!e.has(o)){if(e.add(o),o instanceof i&&o.applyTokensWhenRootReady(),o.shadowRoot&&t(o.shadowRoot),o instanceof HTMLSlotElement)for(const n of o.assignedElements({flatten:!0}))r(n);t(o)}};t(this),this.shadowRoot&&t(this.shadowRoot)}resolveAncestorZoneTheme(e){let t=b(this);for(;t;){if(t instanceof Element&&t.localName==="esp-root")return null;if(t instanceof i){const r=t.contextBacker.trim();if(r){const o=this.resolveNamedContextTheme(e,r);if(o)return o}}t=b(t)}return null}connectedCallback(){super.connectedCallback(),this.rootObserver.connect()}disconnectedCallback(){super.disconnectedCallback(),this.rootObserver.disconnect()}firstUpdated(e){if(this.isConnected&&!this.rootObserver.refresh())throw new Error("No esp-root ancestor found. Espalier components must be placed inside an <esp-root> element.");this.rootObserver.whenReady(this.applyReadyRoot)}governingRootChanged(e){}syncRootMetadata(e){this.scheme=e.scheme==="dark"?"dark":"light",this.seedColor=e.seedColor}applyTokensWhenRootReady(){this.rootObserver.refresh(),this.rootObserver.whenReady(this.applyReadyRoot)}constructor(){super(),this.seedColorBacker="oklch(0.7 0.125 216)",this.rootObserver=new x(this,(e,t)=>{e!==t&&(this.scopedTokens.clear(),this.governingRootChanged(e),this.isConnected&&this.requestUpdate()),e&&(this.syncRootMetadata(e),this.rootObserver.whenReady(this.applyReadyRoot))}),this.contextBacker="",this.scopedTokens=new P(this),this.warnedUnknownContexts=new Set,this.intentBacker="neutral",this.intentEmitsTokens=!0,this.warnedUnknownIntents=new Set,this.correlationId=globalThis.crypto?.randomUUID?.()??Math.random().toString(36),this.scheme="light",this.applyReadyRoot=e=>{this.syncRootMetadata(e),this.applyScopedColorTokens()},this.rootObserver.subscribe("scheme-changed",()=>{const e=this.espRoot;!e||this.scheme===e.scheme||(this.syncRootMetadata(e),this.rootObserver.whenReady(this.applyReadyRoot))}),this.rootObserver.subscribe("seed-color-changed",({seedColor:e})=>{this.seedColor=e,this.applyScopedColorTokens()}),this.rootObserver.subscribe("theme-changed",()=>{const e=this.espRoot;e&&this.syncRootMetadata(e),this.applyScopedColorTokens()}),this.rootObserver.subscribe("icon-sprite-url-changed",()=>this.requestUpdate()),new I(this,this.rootObserver)}traverseToClosest(e){return E(this,e)}applyScopedColorTokens(){if(!this.espRoot)return;const e=this.intentEmitsTokens?i.intentColorSources[this.intentBacker]:"";if(!e&&!this.context.trim()){this.scopedTokens.clear();return}const t=this.espRoot.activeTheme;if(!t){this.scopedTokens.clear();return}const r=this.resolveContextTheme(t),o=r.theme,n=U(o.seedColor);if(!n)return;const c=m(n,o),s={};if(r.applied){Object.assign(s,g(o,c));const{candidates:l,contexts:h}=O(t),p=h.get(r.name);if(p&&l.size>0){const a=S(p,{theme:o,variants:c,semanticProperties:s});_(a,l),Object.assign(s,a)}s["--_esp-context-shadow"]="var(--esp-color-shadow)",Object.assign(s,D(s)),Object.assign(s,B(o)),Object.assign(s,V),Object.assign(s,L),Object.assign(s,N(s,j(o,n,a=>(typeof a=="string"?M(a,o.anchors):null)??o.seedColor)))}if(e){let l=o;r.applied||(l=this.resolveAncestorZoneTheme(t)??o);const h=l===o?c:m(n,l),p=g(l,h,{includeFooterInk:!1,effectiveSource:(a,f)=>i.semanticActionTokens.has(a)?e:f});s["--esp-color-primary"]=A(z(h[e]));for(const a of i.semanticActionTokens){const f=W(a);s[f]=p[f]}}this.scopedTokens.apply(s)}resolveContextTheme(e){const t=this.context.trim();if(!t)return{applied:!1,theme:e};const r=this.resolveNamedContextTheme(e,t);return r?{applied:!0,name:t,theme:r}:(this.warnUnknownContextWhenSettled(t),{applied:!1,theme:e})}warnUnknownContextWhenSettled(e){if(this.warnedUnknownContexts.has(e))return;const t=this.espRoot;if(t&&!t.themeSettled){t.whenThemeSettled().then(this.rootObserver.guard(r=>{if(this.context.trim()!==e)return;const o=r.activeTheme;o&&y(o,e)||this.warnUnknownContextWhenSettled(e)}));return}this.warnedUnknownContexts.add(e),console.warn(`Espalier context: "${e}" is not defined by the active theme; inheriting root tokens.`)}resolveNamedContextTheme(e,t){return y(e,t)}}i.intentColorSources={danger:"danger",info:"info",neutral:"",success:"success",warning:"warning"},i.semanticActionTokens=new Set(["actionBackground","actionText"]),i.styles=[w(":host"),w("[surface-layer]"),$(".esp-field:focus-within","--esp-field-focus-shadow"),q,R`
2
2
  :host {
3
3
 
4
4
  --_esp-font-body-fallback: system-ui, sans-serif;
@@ -42,7 +42,7 @@ var d=function(v,e,t,r){var o=arguments.length,n=o<3?e:r===null?r=Object.getOwnP
42
42
  }
43
43
 
44
44
  .esp-field {
45
- --_esp-field-resolved-background: var(--esp-field-background, ${Y(2)});
45
+ --_esp-field-resolved-background: var(--esp-field-background, ${F(2)});
46
46
 
47
47
 
48
48
  --_esp-field-polarity: var(--_esp-surface-polarity, 1);
@@ -0,0 +1,18 @@
1
+ import{css as o}from"lit";const t=o`
2
+ :host {
3
+ --_esp-footer-fit-prefix: ;
4
+ --_esp-footer-ink-mode: fitted;
5
+ }
6
+ :host([surface-layer="1"]),
7
+ :host([surface-layer="3"]),
8
+ :host([surface-layer="4"]) {
9
+ --_esp-footer-fit-prefix: initial;
10
+ --_esp-footer-ink-mode: semantic;
11
+ }
12
+ `,r=o`
13
+ --_esp-footer-local-fitted-heading-color: var(--_esp-footer-fit-prefix)
14
+ var(--_esp-footer-fitted-heading-color);
15
+ `,f=o`
16
+ --_esp-footer-local-fitted-link-color: var(--_esp-footer-fit-prefix)
17
+ var(--_esp-footer-fitted-link-color);
18
+ `;export{r as footerHeadingFit,t as footerInkLayerStyles,f as footerLinkFit};
@@ -0,0 +1 @@
1
+ const o={headings:"--_esp-footer-fitted-heading-color",link:"--_esp-footer-fitted-link-color"},e="--_esp-footer-ink-mode",t="footer-heading-ink",n="footer-link-ink";export{t as FOOTER_HEADING_INK,e as FOOTER_INK_MODE,o as FOOTER_INK_PROPERTIES,n as FOOTER_LINK_INK};
@@ -1 +1 @@
1
- import{buttonPaintRegistration as y}from"../button/paint-registration.js";import{footerPaintRegistration as w}from"../footer/paint-registration.js";import{headerPaintRegistration as T}from"../header/paint-registration.js";import{menuPaintRegistration as j}from"../menu/paint-registration.js";import{resolveConfiguredBrandColor as v}from"./configured-brand-color.js";import{parsePaintColor as x}from"./paint-color.js";import{COLOR_SOURCES as A,SEMANTIC_COLOR_NAMES as E,isObjectRecord as p,semanticToCSS as R}from"./theme.js";const u=new Map([...E.map(t=>[t,R(t)]),...A.map(t=>[t,`--esp-color-${t}`])]),U=Object.freeze([...u.keys()]),l="brand-color";function f(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function V(t){return u.get(t)}function c(t){return typeof t=="string"&&t.trim()!==""}function N(t){return c(t)&&t===t.trim()}function C(t){return t==="text"||t==="graphic"||t==="ring"}function $(t){return Array.isArray(t)&&Array.from(t).every(c)}const g={depth:t=>t==="top-level"||t==="nested",kind:t=>t==="button"||t==="plain"||t==="group",anchor:t=>typeof t=="boolean",canBeCurrent:t=>typeof t=="boolean",icon:t=>t===void 0||typeof t=="boolean"};function H(t){return p(t)&&Object.entries(g).every(([e,n])=>n(t[e]))}const k={element:!0,foreground:!0,background:!0,state:!0,kind:!0,flags:!0,navigation:!0,indicator:!0,paintOpacity:!0};function S(t){return p(t)&&Object.entries(t).every(([e,n])=>f(g,e)&&g[e](n))}function I(t,e,n){if(!p(t)||!Object.keys(t).every(o=>f(k,o))||!c(t.element)||!c(t.state)||!C(t.kind)||!$(t.flags))throw new TypeError(`${e} is not a paint entry.`);for(const o of["foreground","background"]){const r=t[o];if(!c(r)||!(u.has(r)||f(n,r)||o==="foreground"&&r===l))throw new TypeError(`${e} has an unknown ${o} paint identifier "${String(r)}".`)}if(t.paintOpacity!==void 0&&(typeof t.paintOpacity!="number"||!Number.isFinite(t.paintOpacity)||t.paintOpacity<0||t.paintOpacity>1))throw new TypeError(`${e} has an invalid paint opacity.`);if(t.navigation!==void 0&&!S(t.navigation))throw new TypeError(`${e} has an invalid navigation predicate.`);if(t.indicator!==void 0&&(t.indicator!=="blurred-shadow"||t.kind==="text"))throw new TypeError(`${e} has an invalid indicator.`)}function _(t,e=O){if(!p(t))throw new TypeError("Paint entries must be grouped by role.");for(const[n,o]of Object.entries(t)){if(!N(n)||!Array.isArray(o))throw new TypeError(`Paint entries for role "${n}" must be an array on a nonempty role without outer whitespace.`);for(let r=0;r<o.length;r+=1)I(o[r],`Paint entry for "${n}" at index ${r}`,e)}}function z(t){const e=Object.create(null),n=Object.create(null),o=Object.create(null);for(const r of t)for(const[i,a]of Object.entries(r.derivations??{})){if(!c(i)||i===l||u.has(i)||i in o)throw new TypeError(`Paint derivation "${i}" must have a unique identifier.`);o[i]=a}for(const r of t){_(r.entriesByRole,o);for(const[i,a]of Object.entries(r.entriesByRole))(e[i]??=[]).push(...a);for(const[i,a]of Object.entries(r.targets))(n[i]??=[]).push(...a)}for(const r of Object.values(e))Object.freeze(r);for(const r of Object.values(n))Object.freeze(r);return{entriesByRole:Object.freeze(e),targets:Object.freeze(n),derivations:Object.freeze(o)}}const b=z([T,w,j,y]),B=b.entriesByRole,J=b.targets,O=b.derivations;function Q(t,e,n=B,{brandColor:o}={}){const r=f(n,t)?n[t]:[],i=new Set(e.flags),a=r.filter(s=>{if(!s.flags.every(d=>i.has(d)))return!1;if(s.navigation===void 0)return!0;const m=Object.entries(s.navigation);return e.navigation.some(d=>m.every(([P,h])=>d[P]===h))});return v(o)?a:a.map(s=>s.foreground===l?{...s,foreground:"headings"}:s)}function W(t,e,n=O){if(f(n,t))return n[t](e);const o=e.readColor(t);return o?x(o):null}export{l as BRAND_PAINT_ID,B as PAINT_CATALOG,O as PAINT_DERIVATIONS,J as PAINT_TARGETS,U as PAINT_TOKEN_IDS,z as createPaintCatalog,Q as enabledPaintEntries,$ as isPaintFlags,C as isPaintKind,c as isPaintName,H as isPaintNavigationFact,N as isPaintRole,V as paintTokenProperty,W as resolvePaintColor,_ as validatePaintEntries};
1
+ import{buttonPaintRegistration as y}from"../button/paint-registration.js";import{footerPaintRegistration as w}from"../footer/paint-registration.js";import{headerPaintRegistration as T}from"../header/paint-registration.js";import{menuPaintRegistration as j}from"../menu/paint-registration.js";import{resolveConfiguredBrandColor as v}from"./configured-brand-color.js";import{FOOTER_HEADING_INK as x}from"./footer-ink.js";import{parsePaintColor as E}from"./paint-color.js";import{COLOR_SOURCES as A,SEMANTIC_COLOR_NAMES as N,isObjectRecord as p,semanticToCSS as R}from"./theme.js";const u=new Map([...N.map(t=>[t,R(t)]),...A.map(t=>[t,`--esp-color-${t}`])]),V=Object.freeze([...u.keys()]),l="brand-color";function f(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function J(t){return u.get(t)}function c(t){return typeof t=="string"&&t.trim()!==""}function C(t){return c(t)&&t===t.trim()}function I(t){return t==="text"||t==="graphic"||t==="ring"}function _(t){return Array.isArray(t)&&Array.from(t).every(c)}const g={depth:t=>t==="top-level"||t==="nested",kind:t=>t==="button"||t==="plain"||t==="group",anchor:t=>typeof t=="boolean",canBeCurrent:t=>typeof t=="boolean",icon:t=>t===void 0||typeof t=="boolean"};function Q(t){return p(t)&&Object.entries(g).every(([e,n])=>n(t[e]))}const $={element:!0,foreground:!0,background:!0,state:!0,kind:!0,flags:!0,navigation:!0,indicator:!0,paintOpacity:!0};function k(t){return p(t)&&Object.entries(t).every(([e,n])=>f(g,e)&&g[e](n))}function S(t,e,n){if(!p(t)||!Object.keys(t).every(o=>f($,o))||!c(t.element)||!c(t.state)||!I(t.kind)||!_(t.flags))throw new TypeError(`${e} is not a paint entry.`);for(const o of["foreground","background"]){const r=t[o];if(!c(r)||!(u.has(r)||f(n,r)||o==="foreground"&&r===l))throw new TypeError(`${e} has an unknown ${o} paint identifier "${String(r)}".`)}if(t.paintOpacity!==void 0&&(typeof t.paintOpacity!="number"||!Number.isFinite(t.paintOpacity)||t.paintOpacity<0||t.paintOpacity>1))throw new TypeError(`${e} has an invalid paint opacity.`);if(t.navigation!==void 0&&!k(t.navigation))throw new TypeError(`${e} has an invalid navigation predicate.`);if(t.indicator!==void 0&&(t.indicator!=="blurred-shadow"||t.kind==="text"))throw new TypeError(`${e} has an invalid indicator.`)}function z(t,e=b){if(!p(t))throw new TypeError("Paint entries must be grouped by role.");for(const[n,o]of Object.entries(t)){if(!C(n)||!Array.isArray(o))throw new TypeError(`Paint entries for role "${n}" must be an array on a nonempty role without outer whitespace.`);for(let r=0;r<o.length;r+=1)S(o[r],`Paint entry for "${n}" at index ${r}`,e)}}function B(t){const e=Object.create(null),n=Object.create(null),o=Object.create(null);for(const r of t)for(const[i,a]of Object.entries(r.derivations??{})){if(!c(i)||i===l||u.has(i)||i in o)throw new TypeError(`Paint derivation "${i}" must have a unique identifier.`);o[i]=a}for(const r of t){z(r.entriesByRole,o);for(const[i,a]of Object.entries(r.entriesByRole))(e[i]??=[]).push(...a);for(const[i,a]of Object.entries(r.targets))(n[i]??=[]).push(...a)}for(const r of Object.values(e))Object.freeze(r);for(const r of Object.values(n))Object.freeze(r);return{entriesByRole:Object.freeze(e),targets:Object.freeze(n),derivations:Object.freeze(o)}}const O=B([T,w,j,y]),D=O.entriesByRole,W=O.targets,b=O.derivations;function X(t,e,n=D,{brandColor:o}={}){const r=f(n,t)?n[t]:[],i=new Set(e.flags),a=r.filter(s=>{if(!s.flags.every(d=>i.has(d)))return!1;if(s.navigation===void 0)return!0;const m=Object.entries(s.navigation);return e.navigation.some(d=>m.every(([P,h])=>d[P]===h))});return v(o)?a:a.map(s=>s.foreground===l?{...s,foreground:t==="footer"?x:"headings"}:s)}function Y(t,e,n=b){if(f(n,t))return n[t](e);const o=e.readColor(t);return o?E(o):null}export{l as BRAND_PAINT_ID,D as PAINT_CATALOG,b as PAINT_DERIVATIONS,W as PAINT_TARGETS,V as PAINT_TOKEN_IDS,B as createPaintCatalog,X as enabledPaintEntries,_ as isPaintFlags,I as isPaintKind,c as isPaintName,Q as isPaintNavigationFact,C as isPaintRole,J as paintTokenProperty,Y as resolvePaintColor,z as validatePaintEntries};
@@ -1 +1 @@
1
- import{resolveConfiguredBrandColor as N}from"./configured-brand-color.js";import{BRAND_PAINT_ID as k,PAINT_CATALOG as B,PAINT_DERIVATIONS as q,enabledPaintEntries as O,isPaintFlags as D,isPaintName as j,isPaintNavigationFact as x,isPaintRole as M,paintTokenProperty as L,resolvePaintColor as S,validatePaintEntries as F}from"./paint-catalog.js";import{compositePaint as W,MIN_SHADOW_INDICATOR_BLUR as H,paintRequiredRatio as G,shadowIndicatorAlpha as U}from"./paint-color.js";import{firstPaintByIdentity as V,paintIdentity as z}from"./paint-identity.js";import{SEMANTIC_COLOR_PROPERTIES as J,SETTABLE_COMPONENT_PROPERTIES as K}from"./settable-component-properties.js";import{isObjectRecord as p,semanticToCSS as Q}from"./theme-core.js";import{wcagRatio as X}from"./wcag-contrast.js";const Y=["light","dark"],Z=new Set(Object.entries(K).flatMap(([t,{derives:e}])=>e?[t,e.property]:[t]));function rr(t){return p(t)&&D(t.flags)&&Array.isArray(t.navigation)&&Array.from(t.navigation).every(x)}function tr(t){if(!Array.isArray(t))throw new TypeError("Paint surfaces must be an array.");const e=new Set;for(const a of t){if(!p(a)||!M(a.role))throw new TypeError("Each paint surface requires a nonempty role without outer whitespace.");const{role:o,context:l,brandColors:s,features:i}=a;if(e.has(o))throw new TypeError(`Duplicate paint surface role "${o}".`);if(e.add(o),l!=null&&!j(l))throw new TypeError(`Paint surface "${o}" has an invalid context.`);if(s!==void 0&&(!p(s)||Object.entries(s).some(([r,c])=>!["light","dark","generic"].includes(r)||c!==void 0&&typeof c!="string")))throw new TypeError(`Paint surface "${o}" has invalid brand colors.`);if(!p(i)||!Y.every(r=>rr(i[r])))throw new TypeError(`Paint surface "${o}" requires light and dark feature facts.`)}}function er(t,e,a,o,l,s){const{role:i}=t,r=t.context??null,c=a.get(null),h=a.get(r);if(!c||!h)throw new Error(`Paint surface "${i}" requests undefined ${e} context "${r}".`);const d=N(t.brandColors?.[e],t.brandColors?.generic),P=n=>n==="--_esp-context-shadow"?r===null?void 0:h[Q("shadow")]:J.has(n)||Z.has(n)||n.startsWith("--esp-l-")||n==="--_esp-surface-polarity"?h[n]:c[n],E={scheme:e,context:r,readProperty:P,readColor:n=>{if(n===k)return d?.startsWith("--esp-color-")?P(d):d;const f=L(n);return f&&P(f)}},T=t.features[e],g={brandColor:d},b=[...O(i,T,o.entriesByRole,g),...O(i,T,l,g)],I=[...V(b).values()].map(n=>{const{element:f,foreground:w,background:m,kind:R,state:A}=n,y=S(w,E,o.derivations),u=S(m,E,o.derivations);if(!y||!u||u.alpha!==1)throw new Error(`Paint surface "${i}" (${e}) cannot resolve "${f}" ${A}: ${w} on opaque ${m}.`);const $=y.alpha*(n.paintOpacity??1),v=U({alpha:$,blur:n.indicator==="blurred-shadow"?H:0}),_=W({...y,alpha:v},u),C={element:f,foreground:w,background:m,state:A,kind:R,ratio:X(_,u),required:G(R)};return s?.(e,z({role:i,...n}),C),C});return{role:i,context:r,pairs:I}}function fr(t,e,a={},o={entriesByRole:B,derivations:q},l){tr(e),F(a,o.derivations);const s=new Set([...Object.entries(o.entriesByRole),...Object.entries(a)].filter(([,r])=>r.length>0).map(([r])=>r));for(const{role:r}of e)if(!s.has(r))throw new TypeError(`Paint surface "${r}" has no registered paint entries.`);const i=r=>e.map(c=>er(c,r,t[r],o,a,l));return{light:i("light"),dark:i("dark")}}export{fr as measurePaintSurfaces};
1
+ import{FOOTER_INK_PROPERTIES as N}from"./footer-ink.js";import{resolveConfiguredBrandColor as k}from"./configured-brand-color.js";import{BRAND_PAINT_ID as B,PAINT_CATALOG as j,PAINT_DERIVATIONS as q,enabledPaintEntries as I,isPaintFlags as D,isPaintName as x,isPaintNavigationFact as M,isPaintRole as F,paintTokenProperty as L,resolvePaintColor as S,validatePaintEntries as W}from"./paint-catalog.js";import{compositePaint as H,MIN_SHADOW_INDICATOR_BLUR as G,paintRequiredRatio as K,shadowIndicatorAlpha as U}from"./paint-color.js";import{firstPaintByIdentity as V,paintIdentity as z}from"./paint-identity.js";import{SEMANTIC_COLOR_PROPERTIES as J,SETTABLE_COMPONENT_PROPERTIES as Q}from"./settable-component-properties.js";import{isObjectRecord as p,semanticToCSS as X}from"./theme-core.js";import{wcagRatio as Y}from"./wcag-contrast.js";const Z=["light","dark"],rr=new Set([...Object.values(N),...Object.entries(Q).flatMap(([t,{derives:e}])=>e?[t,e.property]:[t])]);function tr(t){return p(t)&&D(t.flags)&&Array.isArray(t.navigation)&&Array.from(t.navigation).every(M)}function er(t){if(!Array.isArray(t))throw new TypeError("Paint surfaces must be an array.");const e=new Set;for(const a of t){if(!p(a)||!F(a.role))throw new TypeError("Each paint surface requires a nonempty role without outer whitespace.");const{role:o,context:l,brandColors:s,features:i}=a;if(e.has(o))throw new TypeError(`Duplicate paint surface role "${o}".`);if(e.add(o),l!=null&&!x(l))throw new TypeError(`Paint surface "${o}" has an invalid context.`);if(s!==void 0&&(!p(s)||Object.entries(s).some(([r,c])=>!["light","dark","generic"].includes(r)||c!==void 0&&typeof c!="string")))throw new TypeError(`Paint surface "${o}" has invalid brand colors.`);if(!p(i)||!Z.every(r=>tr(i[r])))throw new TypeError(`Paint surface "${o}" requires light and dark feature facts.`)}}function nr(t,e,a,o,l,s){const{role:i}=t,r=t.context??null,c=a.get(null),P=a.get(r);if(!c||!P)throw new Error(`Paint surface "${i}" requests undefined ${e} context "${r}".`);const u=k(t.brandColors?.[e],t.brandColors?.generic),h=n=>n==="--_esp-context-shadow"?r===null?void 0:P[X("shadow")]:J.has(n)||rr.has(n)||n.startsWith("--esp-l-")||n==="--_esp-surface-polarity"?P[n]:c[n],T={scheme:e,context:r,readProperty:h,readColor:n=>{if(n===B)return u?.startsWith("--esp-color-")?h(u):u;const f=L(n);return f&&h(f)}},y=t.features[e],R={brandColor:u},b=[...I(i,y,o.entriesByRole,R),...I(i,y,l,R)],C=[...V(b).values()].map(n=>{const{element:f,foreground:w,background:m,kind:O,state:g}=n,E=S(w,T,o.derivations),d=S(m,T,o.derivations);if(!E||!d||d.alpha!==1)throw new Error(`Paint surface "${i}" (${e}) cannot resolve "${f}" ${g}: ${w} on opaque ${m}.`);const _=E.alpha*(n.paintOpacity??1),v=U({alpha:_,blur:n.indicator==="blurred-shadow"?G:0}),$=H({...E,alpha:v},d),A={element:f,foreground:w,background:m,state:g,kind:O,ratio:Y($,d),required:K(O)};return s?.(e,z({role:i,...n}),A),A});return{role:i,context:r,pairs:C}}function dr(t,e,a={},o={entriesByRole:j,derivations:q},l){er(e),W(a,o.derivations);const s=new Set([...Object.entries(o.entriesByRole),...Object.entries(a)].filter(([,r])=>r.length>0).map(([r])=>r));for(const{role:r}of e)if(!s.has(r))throw new TypeError(`Paint surface "${r}" has no registered paint entries.`);const i=r=>e.map(c=>nr(c,r,t[r],o,a,l));return{light:i("light"),dark:i("dark")}}export{dr as measurePaintSurfaces};
@@ -1 +1 @@
1
- const e=Object.freeze(["--esp-action-menu-background","--esp-action-menu-border","--esp-action-menu-item-focus-shadow","--esp-action-menu-item-gap","--esp-action-menu-item-hover-background","--esp-action-menu-item-icon-background","--esp-action-menu-item-icon-border-color","--esp-action-menu-item-icon-hover-background","--esp-action-menu-item-padding","--esp-action-menu-min-width","--esp-action-menu-shadow","--esp-avatar-border-radius","--esp-avatar-size","--esp-badge-background","--esp-badge-border-color","--esp-badge-border-radius","--esp-badge-color","--esp-blockquote-bar-color","--esp-blockquote-glyph-color","--esp-box-background","--esp-box-background-image","--esp-box-background-image-opacity","--esp-box-background-opacity","--esp-box-shadow","--esp-breadcrumb-color","--esp-breadcrumb-current-color","--esp-breadcrumb-hover-background","--esp-breadcrumb-hover-color","--esp-breadcrumb-separator-color","--esp-breadcrumb-separator-size","--esp-button-group-divider","--esp-button-incognito-padding","--esp-button-padding","--esp-card-min","--esp-checkbox-focus-shadow","--esp-checkbox-icon-color","--esp-checkbox-size","--esp-color-action-background","--esp-color-action-text","--esp-color-analogous-left","--esp-color-analogous-right","--esp-color-background","--esp-color-border","--esp-color-box-background","--esp-color-burger","--esp-color-burger-hover","--esp-color-burger-opened","--esp-color-burger-opened-hover","--esp-color-complementary","--esp-color-danger","--esp-color-danger-text","--esp-color-dialog-bg","--esp-color-headings","--esp-color-headings-hover","--esp-color-info","--esp-color-input-caret","--esp-color-input-selection","--esp-color-input-selection-bg","--esp-color-layer-1","--esp-color-layer-2","--esp-color-layer-3","--esp-color-layer-4","--esp-color-link","--esp-color-link-hover","--esp-color-link-hover-bg","--esp-color-picker-bg","--esp-color-picker-bg-alt","--esp-color-picker-bg-alt-hover","--esp-color-picker-bg-hover","--esp-color-primary","--esp-color-series-1","--esp-color-series-1-ink","--esp-color-series-1-tint","--esp-color-series-1-wash","--esp-color-series-2","--esp-color-series-2-ink","--esp-color-series-2-tint","--esp-color-series-2-wash","--esp-color-series-3","--esp-color-series-3-ink","--esp-color-series-3-tint","--esp-color-series-3-wash","--esp-color-series-4","--esp-color-series-4-ink","--esp-color-series-4-tint","--esp-color-series-4-wash","--esp-color-series-5","--esp-color-series-5-ink","--esp-color-series-5-tint","--esp-color-series-5-wash","--esp-color-series-6","--esp-color-series-6-ink","--esp-color-series-6-tint","--esp-color-series-6-wash","--esp-color-series-7","--esp-color-series-7-ink","--esp-color-series-7-tint","--esp-color-series-7-wash","--esp-color-series-8","--esp-color-series-8-ink","--esp-color-series-8-tint","--esp-color-series-8-wash","--esp-color-shadow","--esp-color-split-complementary-left","--esp-color-split-complementary-right","--esp-color-success","--esp-color-text","--esp-color-triadic-left","--esp-color-triadic-right","--esp-color-type-caption","--esp-color-type-label","--esp-color-type-lead","--esp-color-type-overline","--esp-color-warning","--esp-columns-gap","--esp-details-color-background","--esp-details-color-border","--esp-details-color-indicator","--esp-details-color-summary-background","--esp-details-color-summary-background-active","--esp-details-color-summary-hover-background","--esp-details-group-color-border","--esp-details-size-padding","--esp-dialog-bg-opacity","--esp-dialog-inset-block-end","--esp-dialog-inset-block-start","--esp-dialog-inset-inline-end","--esp-dialog-inset-inline-start","--esp-field-background","--esp-field-border-color","--esp-field-border-width","--esp-field-focus-bg","--esp-field-focus-shadow","--esp-field-hover-bg","--esp-field-text-color","--esp-flyout-background","--esp-flyout-border","--esp-flyout-padding","--esp-flyout-radius","--esp-flyout-shadow","--esp-flyout-z-index","--esp-focus-picker-focus-outline","--esp-focus-picker-gap","--esp-focus-picker-marker-border","--esp-focus-picker-marker-color","--esp-focus-picker-marker-shadow","--esp-focus-picker-marker-size","--esp-focus-picker-stage-background","--esp-font-body","--esp-font-brand","--esp-font-headings","--esp-font-menu","--esp-font-monospace","--esp-font-weight-body","--esp-font-weight-brand","--esp-font-weight-headings","--esp-font-weight-menu","--esp-font-weight-monospace","--esp-footer-background","--esp-footer-background-blend-mode","--esp-footer-background-image","--esp-footer-background-image-opacity","--esp-footer-background-position","--esp-footer-background-repeat","--esp-footer-background-size","--esp-footer-border","--esp-footer-brand-logo-aspect-ratio","--esp-footer-brand-logo-max-width","--esp-footer-brand-logo-max-width-compact","--esp-footer-brand-logo-size","--esp-footer-brand-logo-size-compact","--esp-footer-brand-text-size","--esp-footer-brand-text-size-compact","--esp-footer-color","--esp-footer-column-gap","--esp-footer-content-lead","--esp-footer-content-max-width","--esp-footer-current-block-align","--esp-footer-current-inline-align","--esp-footer-current-prose-align","--esp-footer-current-text-align","--esp-footer-dark-brand-logo-aspect-ratio","--esp-footer-focus-outline","--esp-footer-heading-color","--esp-footer-heading-font-size","--esp-footer-heading-size","--esp-footer-light-brand-logo-aspect-ratio","--esp-footer-link-color","--esp-footer-link-decoration","--esp-footer-link-group-gap","--esp-footer-link-hover-bg","--esp-footer-link-hover-color","--esp-footer-link-underline-offset","--esp-footer-link-underline-thickness","--esp-footer-padding-block","--esp-footer-padding-inline","--esp-footer-row-gap","--esp-footer-section-gap","--esp-form-item-error-background","--esp-form-item-error-color","--esp-form-item-error-field-background","--esp-form-item-error-field-border-color","--esp-form-item-error-field-focus-shadow","--esp-form-item-error-field-text-color","--esp-form-item-font","--esp-form-item-font-size","--esp-form-item-hint-color","--esp-form-item-hint-font-size","--esp-form-item-label-color","--esp-form-item-warning-background","--esp-form-item-warning-color","--esp-form-item-warning-field-background","--esp-form-item-warning-field-border-color","--esp-form-item-warning-field-focus-shadow","--esp-form-item-warning-field-text-color","--esp-grid-background","--esp-grid-border-inner","--esp-grid-border-outer","--esp-grid-cell-border-color","--esp-grid-header-active-background","--esp-grid-header-background","--esp-grid-link-color","--esp-grid-link-hover-color","--esp-grid-row-background-even","--esp-grid-row-background-odd","--esp-grid-row-hover-background","--esp-grid-row-hover-border-color","--esp-grid-text-color","--esp-header-background","--esp-header-border","--esp-header-border-width","--esp-header-brand-color","--esp-header-brand-font-family","--esp-header-brand-font-size","--esp-header-brand-font-weight","--esp-header-brand-gap","--esp-header-brand-hover-background","--esp-header-brand-hover-color","--esp-header-brand-hover-decoration","--esp-header-brand-hover-transform","--esp-header-brand-inline-placement","--esp-header-brand-logo-aspect-ratio","--esp-header-brand-logo-max-width","--esp-header-brand-logo-size","--esp-header-brand-max-width","--esp-header-brand-padding-inline","--esp-header-brand-placement","--esp-header-button-background","--esp-header-button-background-hover","--esp-header-button-border-left","--esp-header-button-box-shadow","--esp-header-button-closed-color","--esp-header-button-closed-hover-color","--esp-header-button-color","--esp-header-button-open-color","--esp-header-button-open-hover-color","--esp-header-button-stroke-width","--esp-header-color","--esp-header-compact-brand-logo-aspect-ratio","--esp-header-compact-height","--esp-header-content-lead","--esp-header-content-max-width","--esp-header-extended-menu-border","--esp-header-extended-menu-height","--esp-header-height","--esp-header-progress-background","--esp-header-progress-height","--esp-header-progress-track-background","--esp-header-scrolled-shadow","--esp-header-shadow","--esp-header-topbar-height","--esp-header-transparent-background","--esp-header-transparent-color","--esp-header-z-index","--esp-heading-1-color","--esp-heading-2-color","--esp-heading-3-color","--esp-heading-4-color","--esp-image-banner-block-size","--esp-image-banner-max-block-size","--esp-image-border","--esp-image-border-radius","--esp-image-compact-width","--esp-image-duotone-highlight-color","--esp-image-duotone-shadow-color","--esp-image-object-position","--esp-image-overlay-color","--esp-image-overlay-gap","--esp-image-overlay-measure","--esp-image-overlay-padding","--esp-image-overlay-text-shadow","--esp-image-picker-option-height","--esp-image-picker-option-width","--esp-image-picker-preview-height","--esp-image-preview-border-color","--esp-image-preview-overlay-text","--esp-image-preview-remove-color","--esp-image-scrim-color","--esp-image-scrim-edge-depth","--esp-image-scrim-edge-image","--esp-image-scrim-edge-size","--esp-image-scrim-opacity","--esp-image-static-compact-ratio","--esp-image-static-ratio","--esp-image-texture-blend-mode","--esp-image-texture-color","--esp-image-texture-image","--esp-image-texture-image-opacity","--esp-image-texture-opacity","--esp-image-texture-position","--esp-image-texture-repeat","--esp-image-texture-scale","--esp-image-texture-size","--esp-image-upload-preview-background","--esp-info-color-background","--esp-info-color-border","--esp-info-color-text","--esp-l-accent","--esp-l-border","--esp-l-ink","--esp-l-muted","--esp-l-raised-1","--esp-l-raised-2","--esp-l-raised-3","--esp-l-raised-4","--esp-l-shadow","--esp-l-surface","--esp-l-text","--esp-lightbox-bg","--esp-lightbox-bg-opacity","--esp-measure","--esp-measure-wide","--esp-menu-background","--esp-menu-border-color","--esp-menu-drawer-brand-color","--esp-menu-drawer-brand-logo-size","--esp-menu-drawer-item-font-size","--esp-menu-drawer-nested-item-max-font-size","--esp-menu-drawer-nested-item-min-font-size","--esp-menu-drawer-shadow","--esp-menu-drawer-transition-duration","--esp-menu-drawer-width","--esp-menu-group-background","--esp-menu-group-border-color","--esp-menu-group-color","--esp-menu-group-hover-background","--esp-menu-group-icon-background","--esp-menu-group-icon-min-width","--esp-menu-group-icon-padding","--esp-menu-group-icon-size","--esp-menu-group-indicator-color","--esp-menu-group-panel-background","--esp-menu-group-panel-shadow","--esp-menu-horizontal-justify-content","--esp-menu-item-active-background","--esp-menu-item-active-color","--esp-menu-item-active-font-weight","--esp-menu-item-active-indicator-color","--esp-menu-item-background","--esp-menu-item-border-color","--esp-menu-item-color","--esp-menu-item-font-family","--esp-menu-item-font-size","--esp-menu-item-font-weight","--esp-menu-item-hover-background","--esp-menu-item-hover-color","--esp-menu-item-hover-decoration","--esp-menu-item-hover-indicator-color","--esp-menu-item-icon-background","--esp-menu-item-icon-min-width","--esp-menu-item-icon-padding","--esp-menu-item-icon-size","--esp-menu-item-padding","--esp-menu-item-transition-duration","--esp-menu-scrim-color","--esp-menu-top-offset","--esp-page-background","--esp-page-background-image","--esp-page-background-image-opacity","--esp-page-canvas-background","--esp-page-canvas-background-attachment","--esp-page-canvas-background-image","--esp-page-canvas-background-image-opacity","--esp-page-fixed-header-offset","--esp-page-flyout-default-width","--esp-page-flyout-max-width","--esp-page-flyout-min-width","--esp-page-header-expanded-size","--esp-page-header-z-index","--esp-page-main-background","--esp-page-main-max-width","--esp-page-main-min-width","--esp-page-preview-background","--esp-page-preview-border","--esp-page-preview-default-width","--esp-page-preview-max-width","--esp-page-preview-min-width","--esp-page-preview-shadow","--esp-page-resize-focus-outline","--esp-page-resize-focus-shadow","--esp-page-resize-handle-hit-size","--esp-page-resize-large-step","--esp-page-resize-step","--esp-page-sticky-header-top","--esp-page-surface-border","--esp-page-surface-shadow","--esp-page-visible-header-offset","--esp-page-well-max-width","--esp-progress-border-color","--esp-progress-border-radius","--esp-progress-circle-size","--esp-progress-fill-color","--esp-progress-font-size","--esp-progress-height","--esp-progress-text-color","--esp-radio-button-focus-shadow","--esp-radio-button-icon-color","--esp-radio-button-size","--esp-repeater-background","--esp-repeater-border","--esp-repeater-border-radius","--esp-repeater-content-padding","--esp-repeater-gap","--esp-repeater-grid-column-gap","--esp-repeater-grid-columns","--esp-repeater-grid-row-gap","--esp-repeater-padding","--esp-row-gap","--esp-scheme","--esp-search-active-background","--esp-search-backdrop","--esp-search-border-color","--esp-search-highlight-background","--esp-search-loading-indicator-color","--esp-search-loading-indicator-track-color","--esp-search-max-height","--esp-search-max-width","--esp-search-muted-color","--esp-search-panel-background","--esp-search-panel-shadow","--esp-search-text-color","--esp-search-title-color","--esp-section-background","--esp-section-decoration-color","--esp-section-decoration-image","--esp-section-decoration-opacity","--esp-section-decoration-position","--esp-section-decoration-size","--esp-section-max-width","--esp-section-padding-block","--esp-section-padding-inline","--esp-seed-color","--esp-shadow-1","--esp-shadow-2","--esp-shadow-3","--esp-size-big","--esp-size-big-to-large","--esp-size-border-radius","--esp-size-box-padding","--esp-size-burger-stroke","--esp-size-color-picker-border-width","--esp-size-font","--esp-size-huge","--esp-size-large","--esp-size-large-to-huge","--esp-size-medium","--esp-size-medium-to-big","--esp-size-normal","--esp-size-normal-to-medium","--esp-size-padding","--esp-size-padding-page","--esp-size-section","--esp-size-small","--esp-size-small-to-normal","--esp-size-tiny","--esp-size-tiny-to-small","--esp-slider-focus-shadow","--esp-slider-thumb-border-color","--esp-slider-thumb-color","--esp-slider-thumb-shadow","--esp-slider-thumb-size","--esp-slider-track-border-radius","--esp-slider-track-color","--esp-slider-track-fill-color","--esp-slider-track-height","--esp-stack-gap","--esp-status-indicator-border-radius","--esp-status-indicator-height","--esp-status-indicator-popover-max-width","--esp-status-indicator-width","--esp-switch-focus-shadow","--esp-switch-height","--esp-switch-text-active-color","--esp-switch-text-font-size","--esp-switch-text-highlight-color","--esp-switch-text-inactive-color","--esp-switch-text-padding","--esp-switch-thumb-color","--esp-switch-thumb-size","--esp-switch-track-color","--esp-switch-track-color-on","--esp-switch-width","--esp-tab-color-background","--esp-tab-color-border","--esp-tab-color-button-active","--esp-tab-color-button-hover","--esp-tab-color-strip-background","--esp-tab-color-text","--esp-tab-size-padding","--esp-toaster-gap","--esp-toaster-padding","--esp-toaster-z-index","--esp-tooltip-background","--esp-tooltip-border","--esp-tooltip-border-radius","--esp-tooltip-color","--esp-tooltip-focus-outline","--esp-tooltip-font-size","--esp-tooltip-max-width","--esp-tooltip-padding","--esp-tooltip-shadow","--esp-tree-action-bg","--esp-tree-action-hover-bg","--esp-tree-action-size","--esp-tree-guide-color","--esp-tree-hover-bg","--esp-tree-icon-color","--esp-tree-indent-step","--esp-tree-node-padding","--esp-tree-row-bg","--esp-tree-row-border-color","--esp-tree-selected-bg","--esp-type-big","--esp-type-caption-color","--esp-type-caption-font-size","--esp-type-caption-font-weight","--esp-type-caption-letter-spacing","--esp-type-display-color","--esp-type-display-font-family","--esp-type-display-font-size","--esp-type-display-font-weight","--esp-type-display-letter-spacing","--esp-type-display-line-height","--esp-type-huge","--esp-type-label-color","--esp-type-label-font-size","--esp-type-label-font-weight","--esp-type-label-letter-spacing","--esp-type-large","--esp-type-lead-color","--esp-type-lead-font-size","--esp-type-lead-font-weight","--esp-type-lead-letter-spacing","--esp-type-medium","--esp-type-normal","--esp-type-overline-color","--esp-type-overline-font-size","--esp-type-overline-font-weight","--esp-type-overline-letter-spacing","--esp-type-overline-text-transform","--esp-type-small","--esp-type-tiny","--esp-vellum-background","--esp-vellum-background-image","--esp-vellum-background-image-opacity","--esp-vellum-opacity","--esp-video-accent","--esp-video-border-radius","--esp-video-focus-outline","--esp-video-message-background","--esp-video-message-color","--esp-video-object-fit","--esp-video-play-background","--esp-video-play-color","--esp-video-play-size","--esp-video-surface"]),o=Object.freeze(["^--esp-color-ramp-[a-z][a-z0-9-]*-(?:[1-9]|1[01])$"]);export{e as PUBLIC_TOKEN_NAMES,o as PUBLIC_TOKEN_PATTERNS};
1
+ const e=Object.freeze(["--esp-action-menu-background","--esp-action-menu-border","--esp-action-menu-item-focus-shadow","--esp-action-menu-item-gap","--esp-action-menu-item-hover-background","--esp-action-menu-item-icon-background","--esp-action-menu-item-icon-border-color","--esp-action-menu-item-icon-hover-background","--esp-action-menu-item-padding","--esp-action-menu-min-width","--esp-action-menu-shadow","--esp-avatar-border-radius","--esp-avatar-size","--esp-badge-background","--esp-badge-border-color","--esp-badge-border-radius","--esp-badge-color","--esp-badge-link-background","--esp-badge-link-border-color","--esp-badge-link-color","--esp-badge-link-focus-background","--esp-badge-link-focus-border-color","--esp-badge-link-focus-color","--esp-badge-link-focus-ring-color","--esp-badge-link-hover-background","--esp-badge-link-hover-border-color","--esp-badge-link-hover-color","--esp-blockquote-bar-color","--esp-blockquote-glyph-color","--esp-box-background","--esp-box-background-image","--esp-box-background-image-opacity","--esp-box-background-opacity","--esp-box-shadow","--esp-breadcrumb-color","--esp-breadcrumb-current-color","--esp-breadcrumb-hover-background","--esp-breadcrumb-hover-color","--esp-breadcrumb-separator-color","--esp-breadcrumb-separator-size","--esp-breadcrumb-separator-stroke-width","--esp-button-group-divider","--esp-button-incognito-padding","--esp-button-padding","--esp-card-min","--esp-checkbox-focus-shadow","--esp-checkbox-icon-color","--esp-checkbox-size","--esp-color-action-background","--esp-color-action-text","--esp-color-analogous-left","--esp-color-analogous-right","--esp-color-background","--esp-color-border","--esp-color-box-background","--esp-color-burger","--esp-color-burger-hover","--esp-color-burger-opened","--esp-color-burger-opened-hover","--esp-color-complementary","--esp-color-danger","--esp-color-danger-text","--esp-color-dialog-bg","--esp-color-headings","--esp-color-headings-hover","--esp-color-info","--esp-color-input-caret","--esp-color-input-selection","--esp-color-input-selection-bg","--esp-color-layer-1","--esp-color-layer-2","--esp-color-layer-3","--esp-color-layer-4","--esp-color-link","--esp-color-link-hover","--esp-color-link-hover-bg","--esp-color-picker-bg","--esp-color-picker-bg-alt","--esp-color-picker-bg-alt-hover","--esp-color-picker-bg-hover","--esp-color-primary","--esp-color-series-1","--esp-color-series-1-ink","--esp-color-series-1-tint","--esp-color-series-1-wash","--esp-color-series-2","--esp-color-series-2-ink","--esp-color-series-2-tint","--esp-color-series-2-wash","--esp-color-series-3","--esp-color-series-3-ink","--esp-color-series-3-tint","--esp-color-series-3-wash","--esp-color-series-4","--esp-color-series-4-ink","--esp-color-series-4-tint","--esp-color-series-4-wash","--esp-color-series-5","--esp-color-series-5-ink","--esp-color-series-5-tint","--esp-color-series-5-wash","--esp-color-series-6","--esp-color-series-6-ink","--esp-color-series-6-tint","--esp-color-series-6-wash","--esp-color-series-7","--esp-color-series-7-ink","--esp-color-series-7-tint","--esp-color-series-7-wash","--esp-color-series-8","--esp-color-series-8-ink","--esp-color-series-8-tint","--esp-color-series-8-wash","--esp-color-shadow","--esp-color-split-complementary-left","--esp-color-split-complementary-right","--esp-color-success","--esp-color-text","--esp-color-triadic-left","--esp-color-triadic-right","--esp-color-type-caption","--esp-color-type-label","--esp-color-type-lead","--esp-color-type-overline","--esp-color-warning","--esp-columns-gap","--esp-details-color-background","--esp-details-color-border","--esp-details-color-indicator","--esp-details-color-summary-background","--esp-details-color-summary-background-active","--esp-details-color-summary-hover-background","--esp-details-group-color-border","--esp-details-size-padding","--esp-dialog-bg-opacity","--esp-dialog-inset-block-end","--esp-dialog-inset-block-start","--esp-dialog-inset-inline-end","--esp-dialog-inset-inline-start","--esp-field-background","--esp-field-border-color","--esp-field-border-width","--esp-field-focus-bg","--esp-field-focus-shadow","--esp-field-hover-bg","--esp-field-text-color","--esp-flyout-background","--esp-flyout-border","--esp-flyout-padding","--esp-flyout-radius","--esp-flyout-shadow","--esp-flyout-z-index","--esp-focus-picker-focus-outline","--esp-focus-picker-gap","--esp-focus-picker-marker-border","--esp-focus-picker-marker-color","--esp-focus-picker-marker-shadow","--esp-focus-picker-marker-size","--esp-focus-picker-stage-background","--esp-font-body","--esp-font-brand","--esp-font-headings","--esp-font-menu","--esp-font-monospace","--esp-font-weight-body","--esp-font-weight-brand","--esp-font-weight-headings","--esp-font-weight-menu","--esp-font-weight-monospace","--esp-footer-background","--esp-footer-background-blend-mode","--esp-footer-background-image","--esp-footer-background-image-opacity","--esp-footer-background-position","--esp-footer-background-repeat","--esp-footer-background-size","--esp-footer-border","--esp-footer-brand-logo-aspect-ratio","--esp-footer-brand-logo-max-width","--esp-footer-brand-logo-max-width-compact","--esp-footer-brand-logo-size","--esp-footer-brand-logo-size-compact","--esp-footer-brand-text-size","--esp-footer-brand-text-size-compact","--esp-footer-color","--esp-footer-column-gap","--esp-footer-content-lead","--esp-footer-content-max-width","--esp-footer-current-block-align","--esp-footer-current-inline-align","--esp-footer-current-prose-align","--esp-footer-current-text-align","--esp-footer-dark-brand-logo-aspect-ratio","--esp-footer-focus-outline","--esp-footer-heading-color","--esp-footer-heading-font-size","--esp-footer-heading-size","--esp-footer-light-brand-logo-aspect-ratio","--esp-footer-link-color","--esp-footer-link-decoration","--esp-footer-link-group-gap","--esp-footer-link-hover-bg","--esp-footer-link-hover-color","--esp-footer-link-underline-offset","--esp-footer-link-underline-thickness","--esp-footer-padding-block","--esp-footer-padding-inline","--esp-footer-row-gap","--esp-footer-section-gap","--esp-form-item-error-background","--esp-form-item-error-color","--esp-form-item-error-field-background","--esp-form-item-error-field-border-color","--esp-form-item-error-field-focus-shadow","--esp-form-item-error-field-text-color","--esp-form-item-font","--esp-form-item-font-size","--esp-form-item-hint-color","--esp-form-item-hint-font-size","--esp-form-item-label-color","--esp-form-item-warning-background","--esp-form-item-warning-color","--esp-form-item-warning-field-background","--esp-form-item-warning-field-border-color","--esp-form-item-warning-field-focus-shadow","--esp-form-item-warning-field-text-color","--esp-grid-background","--esp-grid-border-inner","--esp-grid-border-outer","--esp-grid-cell-border-color","--esp-grid-header-active-background","--esp-grid-header-background","--esp-grid-link-color","--esp-grid-link-hover-color","--esp-grid-row-background-even","--esp-grid-row-background-odd","--esp-grid-row-hover-background","--esp-grid-row-hover-border-color","--esp-grid-text-color","--esp-header-background","--esp-header-border","--esp-header-border-width","--esp-header-brand-color","--esp-header-brand-font-family","--esp-header-brand-font-size","--esp-header-brand-font-weight","--esp-header-brand-gap","--esp-header-brand-hover-background","--esp-header-brand-hover-color","--esp-header-brand-hover-decoration","--esp-header-brand-hover-transform","--esp-header-brand-inline-placement","--esp-header-brand-logo-aspect-ratio","--esp-header-brand-logo-max-width","--esp-header-brand-logo-size","--esp-header-brand-max-width","--esp-header-brand-padding-inline","--esp-header-brand-placement","--esp-header-button-background","--esp-header-button-background-hover","--esp-header-button-border-left","--esp-header-button-box-shadow","--esp-header-button-closed-color","--esp-header-button-closed-hover-color","--esp-header-button-color","--esp-header-button-open-color","--esp-header-button-open-hover-color","--esp-header-button-stroke-width","--esp-header-color","--esp-header-compact-brand-logo-aspect-ratio","--esp-header-compact-height","--esp-header-content-lead","--esp-header-content-max-width","--esp-header-extended-menu-border","--esp-header-extended-menu-height","--esp-header-height","--esp-header-progress-background","--esp-header-progress-height","--esp-header-progress-track-background","--esp-header-scrolled-shadow","--esp-header-shadow","--esp-header-topbar-height","--esp-header-transparent-background","--esp-header-transparent-color","--esp-header-z-index","--esp-heading-1-color","--esp-heading-2-color","--esp-heading-3-color","--esp-heading-4-color","--esp-image-banner-block-size","--esp-image-banner-max-block-size","--esp-image-border","--esp-image-border-radius","--esp-image-compact-width","--esp-image-duotone-highlight-color","--esp-image-duotone-shadow-color","--esp-image-object-position","--esp-image-overlay-color","--esp-image-overlay-gap","--esp-image-overlay-measure","--esp-image-overlay-padding","--esp-image-overlay-text-shadow","--esp-image-picker-option-height","--esp-image-picker-option-width","--esp-image-picker-preview-height","--esp-image-preview-border-color","--esp-image-preview-overlay-text","--esp-image-preview-remove-color","--esp-image-scrim-color","--esp-image-scrim-edge-depth","--esp-image-scrim-edge-image","--esp-image-scrim-edge-size","--esp-image-scrim-opacity","--esp-image-static-compact-ratio","--esp-image-static-ratio","--esp-image-texture-blend-mode","--esp-image-texture-color","--esp-image-texture-image","--esp-image-texture-image-opacity","--esp-image-texture-opacity","--esp-image-texture-position","--esp-image-texture-repeat","--esp-image-texture-scale","--esp-image-texture-size","--esp-image-upload-preview-background","--esp-info-color-background","--esp-info-color-border","--esp-info-color-text","--esp-l-accent","--esp-l-border","--esp-l-ink","--esp-l-muted","--esp-l-raised-1","--esp-l-raised-2","--esp-l-raised-3","--esp-l-raised-4","--esp-l-shadow","--esp-l-surface","--esp-l-text","--esp-lightbox-bg","--esp-lightbox-bg-opacity","--esp-measure","--esp-measure-wide","--esp-menu-background","--esp-menu-border-color","--esp-menu-drawer-brand-color","--esp-menu-drawer-brand-logo-size","--esp-menu-drawer-item-font-size","--esp-menu-drawer-nested-item-max-font-size","--esp-menu-drawer-nested-item-min-font-size","--esp-menu-drawer-shadow","--esp-menu-drawer-transition-duration","--esp-menu-drawer-width","--esp-menu-group-background","--esp-menu-group-border-color","--esp-menu-group-color","--esp-menu-group-hover-background","--esp-menu-group-icon-background","--esp-menu-group-icon-min-width","--esp-menu-group-icon-padding","--esp-menu-group-icon-size","--esp-menu-group-indicator-color","--esp-menu-group-panel-background","--esp-menu-group-panel-shadow","--esp-menu-horizontal-justify-content","--esp-menu-item-active-background","--esp-menu-item-active-color","--esp-menu-item-active-font-weight","--esp-menu-item-active-indicator-color","--esp-menu-item-background","--esp-menu-item-border-color","--esp-menu-item-color","--esp-menu-item-font-family","--esp-menu-item-font-size","--esp-menu-item-font-weight","--esp-menu-item-hover-background","--esp-menu-item-hover-color","--esp-menu-item-hover-decoration","--esp-menu-item-hover-indicator-color","--esp-menu-item-icon-background","--esp-menu-item-icon-min-width","--esp-menu-item-icon-padding","--esp-menu-item-icon-size","--esp-menu-item-padding","--esp-menu-item-transition-duration","--esp-menu-scrim-color","--esp-menu-top-offset","--esp-page-background","--esp-page-background-image","--esp-page-background-image-opacity","--esp-page-canvas-background","--esp-page-canvas-background-attachment","--esp-page-canvas-background-image","--esp-page-canvas-background-image-opacity","--esp-page-fixed-header-offset","--esp-page-flyout-default-width","--esp-page-flyout-max-width","--esp-page-flyout-min-width","--esp-page-header-expanded-size","--esp-page-header-z-index","--esp-page-main-background","--esp-page-main-max-width","--esp-page-main-min-width","--esp-page-preview-background","--esp-page-preview-border","--esp-page-preview-default-width","--esp-page-preview-max-width","--esp-page-preview-min-width","--esp-page-preview-shadow","--esp-page-resize-focus-outline","--esp-page-resize-focus-shadow","--esp-page-resize-handle-hit-size","--esp-page-resize-large-step","--esp-page-resize-step","--esp-page-sticky-header-top","--esp-page-surface-border","--esp-page-surface-shadow","--esp-page-visible-header-offset","--esp-page-well-max-width","--esp-progress-border-color","--esp-progress-border-radius","--esp-progress-circle-size","--esp-progress-fill-color","--esp-progress-font-size","--esp-progress-height","--esp-progress-text-color","--esp-radio-button-focus-shadow","--esp-radio-button-icon-color","--esp-radio-button-size","--esp-repeater-background","--esp-repeater-border","--esp-repeater-border-radius","--esp-repeater-content-padding","--esp-repeater-gap","--esp-repeater-grid-column-gap","--esp-repeater-grid-columns","--esp-repeater-grid-row-gap","--esp-repeater-padding","--esp-row-gap","--esp-scheme","--esp-search-active-background","--esp-search-backdrop","--esp-search-border-color","--esp-search-highlight-background","--esp-search-loading-indicator-color","--esp-search-loading-indicator-track-color","--esp-search-max-height","--esp-search-max-width","--esp-search-muted-color","--esp-search-panel-background","--esp-search-panel-shadow","--esp-search-text-color","--esp-search-title-color","--esp-section-background","--esp-section-decoration-color","--esp-section-decoration-image","--esp-section-decoration-opacity","--esp-section-decoration-position","--esp-section-decoration-size","--esp-section-max-width","--esp-section-padding-block","--esp-section-padding-inline","--esp-seed-color","--esp-shadow-1","--esp-shadow-2","--esp-shadow-3","--esp-size-big","--esp-size-big-to-large","--esp-size-border-radius","--esp-size-box-padding","--esp-size-burger-stroke","--esp-size-color-picker-border-width","--esp-size-font","--esp-size-huge","--esp-size-large","--esp-size-large-to-huge","--esp-size-medium","--esp-size-medium-to-big","--esp-size-normal","--esp-size-normal-to-medium","--esp-size-padding","--esp-size-padding-page","--esp-size-section","--esp-size-small","--esp-size-small-to-normal","--esp-size-tiny","--esp-size-tiny-to-small","--esp-slider-focus-shadow","--esp-slider-thumb-border-color","--esp-slider-thumb-color","--esp-slider-thumb-shadow","--esp-slider-thumb-size","--esp-slider-track-border-radius","--esp-slider-track-color","--esp-slider-track-fill-color","--esp-slider-track-height","--esp-stack-gap","--esp-status-indicator-border-radius","--esp-status-indicator-height","--esp-status-indicator-popover-max-width","--esp-status-indicator-width","--esp-switch-focus-shadow","--esp-switch-height","--esp-switch-text-active-color","--esp-switch-text-font-size","--esp-switch-text-highlight-color","--esp-switch-text-inactive-color","--esp-switch-text-padding","--esp-switch-thumb-color","--esp-switch-thumb-size","--esp-switch-track-color","--esp-switch-track-color-on","--esp-switch-width","--esp-tab-color-background","--esp-tab-color-border","--esp-tab-color-button-active","--esp-tab-color-button-hover","--esp-tab-color-strip-background","--esp-tab-color-text","--esp-tab-size-padding","--esp-toaster-gap","--esp-toaster-padding","--esp-toaster-z-index","--esp-tooltip-background","--esp-tooltip-border","--esp-tooltip-border-radius","--esp-tooltip-color","--esp-tooltip-focus-outline","--esp-tooltip-font-size","--esp-tooltip-max-width","--esp-tooltip-padding","--esp-tooltip-shadow","--esp-tree-action-bg","--esp-tree-action-hover-bg","--esp-tree-action-size","--esp-tree-guide-color","--esp-tree-hover-bg","--esp-tree-icon-color","--esp-tree-indent-step","--esp-tree-node-padding","--esp-tree-row-bg","--esp-tree-row-border-color","--esp-tree-selected-bg","--esp-type-big","--esp-type-caption-color","--esp-type-caption-font-size","--esp-type-caption-font-weight","--esp-type-caption-letter-spacing","--esp-type-display-color","--esp-type-display-font-family","--esp-type-display-font-size","--esp-type-display-font-weight","--esp-type-display-letter-spacing","--esp-type-display-line-height","--esp-type-huge","--esp-type-label-color","--esp-type-label-font-size","--esp-type-label-font-weight","--esp-type-label-letter-spacing","--esp-type-large","--esp-type-lead-color","--esp-type-lead-font-size","--esp-type-lead-font-weight","--esp-type-lead-letter-spacing","--esp-type-medium","--esp-type-normal","--esp-type-overline-color","--esp-type-overline-font-size","--esp-type-overline-font-weight","--esp-type-overline-letter-spacing","--esp-type-overline-text-transform","--esp-type-small","--esp-type-tiny","--esp-vellum-background","--esp-vellum-background-image","--esp-vellum-background-image-opacity","--esp-vellum-opacity","--esp-video-accent","--esp-video-border-radius","--esp-video-focus-outline","--esp-video-message-background","--esp-video-message-color","--esp-video-object-fit","--esp-video-play-background","--esp-video-play-color","--esp-video-play-size","--esp-video-surface"]),o=Object.freeze(["^--esp-color-ramp-[a-z][a-z0-9-]*-(?:[1-9]|1[01])$"]);export{e as PUBLIC_TOKEN_NAMES,o as PUBLIC_TOKEN_PATTERNS};
@@ -1 +1 @@
1
- import{SEMANTIC_COLOR_NAMES as h,semanticToCSS as g}from"./semantic-color-names.js";const s=Object.freeze({component:"esp-root",syntax:"color",default:"var(--esp-color-headings)",pairsWith:"--esp-color-background",targetLc:60,fitFallback:"--esp-color-headings"}),w=Object.freeze({"--esp-badge-background":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-layer-2)",fitFallback:"--esp-color-layer-2"}),"--esp-badge-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-text)",pairsWith:"--esp-badge-background",targetLc:75,fitFallback:"--esp-color-text"}),"--esp-badge-border-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-border)"}),"--esp-blockquote-bar-color":Object.freeze({syntax:"color",default:"var(--esp-color-border)"}),"--esp-blockquote-glyph-color":Object.freeze({syntax:"color",default:"var(--esp-blockquote-bar-color, var(--esp-color-border))"}),"--esp-breadcrumb-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link)",pairsWith:"--esp-color-background",targetLc:75,fitFallback:"--esp-color-link"}),"--esp-breadcrumb-hover-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link-hover)",pairsWith:"--esp-breadcrumb-hover-background",targetLc:75,fitFallback:"--esp-color-link-hover"}),"--esp-breadcrumb-hover-background":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link-hover-bg)",fitFallback:"--esp-color-link-hover-bg"}),"--esp-breadcrumb-current-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-breadcrumb-color, var(--esp-color-headings))",pairsWith:"--esp-color-background",targetLc:60,fitFallback:"--esp-color-headings"}),"--esp-breadcrumb-separator-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"color-mix(in oklch, var(--esp-breadcrumb-color, var(--esp-color-link)) 70%, transparent)"}),"--esp-breadcrumb-separator-size":Object.freeze({component:"esp-breadcrumb",syntax:"length",default:"var(--esp-size-normal-to-medium)",unit:"rem",min:.5,max:2}),"--esp-footer-heading-size":Object.freeze({component:"esp-footer",syntax:"keyword",default:"normal",allowedValues:["small","normal","medium","big","large"],derives:{property:"--esp-footer-heading-font-size",values:{small:"var(--esp-type-small)",normal:"var(--esp-type-normal)",medium:"var(--esp-type-medium)",big:"var(--esp-type-big)",large:"var(--esp-type-large)"}}}),"--esp-footer-link-decoration":Object.freeze({component:"esp-footer",syntax:"keyword",default:"underline",allowedValues:["none","underline"]}),"--esp-footer-link-underline-offset":Object.freeze({component:"esp-footer",syntax:"length",default:"0.18em",unit:"em",min:0,max:.5}),"--esp-footer-link-underline-thickness":Object.freeze({component:"esp-footer",syntax:"length | keyword",default:"auto",unit:"em",min:0,max:.2,allowedValues:["auto"]}),"--esp-header-brand-logo-max-width":Object.freeze({component:"esp-header",syntax:"length",default:"12rem",unit:"rem",min:4,max:32}),"--esp-heading-1-color":s,"--esp-heading-2-color":s,"--esp-heading-3-color":s,"--esp-heading-4-color":s});function x(a){return typeof a=="string"&&Object.prototype.hasOwnProperty.call(w,a)}const O="--_esp-",c=/^--esp-[a-z0-9-]+$/,y=/^--_esp-[a-z0-9-]+$/,k=/^[a-z][a-z0-9-]*$/,l=new Set(h.map(g));function u(a,t){if(t.syntax!=="color"||!l.has(t.fitFallback??"")||t.allowedValues?.some(n=>!l.has(n)))throw new Error(`${a} must use an opaque semantic fit fallback and opaque pair values.`)}function E(a,t){const n=new Map(Object.entries(a)),i=new Set;for(const[r,e]of n){if(!c.test(r))throw new Error(`${r} must be a public --esp- property.`);if(t){const o=t.get(r);if(!o)throw new Error(`${r} is missing @cssprop documentation.`);if(e.component===void 0){if(o.category!=="shared-hook")throw new Error(`${r} has no component owner and must be documented as a shared hook.`)}else if(o.category!=="component"||o.component!==e.component)throw new Error(`${r} is documented for ${o.component??o.category}, not ${e.component}.`)}const m=e.syntax==="length"||e.syntax==="length | keyword",p=e.syntax==="keyword"||e.syntax==="length | keyword";if(m&&(e.unit!=="rem"&&e.unit!=="em"||e.min===void 0||e.max===void 0||!Number.isFinite(e.min)||!Number.isFinite(e.max)||e.min>e.max))throw new Error(`${r} must have a supported unit and finite, ordered length bounds.`);if(p&&(!e.allowedValues?.length||!e.allowedValues.every(o=>k.test(o))))throw new Error(`${r} must declare its allowed keywords.`);if(e.pairsWith!==void 0){if(!(e.targetLc!==void 0&&Number.isFinite(e.targetLc)&&e.targetLc>0))throw new Error(`${r} must have a positive, finite contrast target.`);if(u(r,e),!l.has(e.pairsWith)){const o=n.get(e.pairsWith);if(!o||e.pairsWith===r||e.component===void 0||o.component!==e.component||o.pairsWith!==void 0)throw new Error(`${r} must pair with a semantic color or a same-component unpaired color.`);u(e.pairsWith,o)}}else if(e.targetLc!==void 0)throw new Error(`${r} declares a contrast target without a pair.`);if(e.derives){const{property:o,values:b}=e.derives,d=Object.keys(b);if(!p||!d.length||d.some(f=>!e.allowedValues?.includes(f)))throw new Error(`${r} may derive values only from its allowed keywords.`);if(n.has(o)||i.has(o))throw new Error(`${r} must derive a unique, non-settable output: ${o}.`);if(!c.test(o)&&!y.test(o))throw new Error(`${r} must derive a public --esp- or private --_esp- output.`);if(t&&c.test(o)&&!t.has(o))throw new Error(`${r} derives ${o}, which is missing @cssprop documentation.`);i.add(o)}}}export{O as PRIVATE_COMPONENT_PROPERTY_PREFIX,l as SEMANTIC_COLOR_PROPERTIES,w as SETTABLE_COMPONENT_PROPERTIES,E as assertRegistryInvariants,x as isSettableComponentPropertyName};
1
+ import{SEMANTIC_COLOR_NAMES as g,semanticToCSS as h}from"./semantic-color-names.js";const s=Object.freeze({component:"esp-root",syntax:"color",default:"var(--esp-color-headings)",pairsWith:"--esp-color-background",targetLc:60,fitFallback:"--esp-color-headings"}),k=Object.freeze({"--esp-badge-background":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-layer-2)",fitFallback:"--esp-color-layer-2"}),"--esp-badge-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-text)",pairsWith:"--esp-badge-background",targetLc:75,fitFallback:"--esp-color-text"}),"--esp-badge-border-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-border)"}),"--esp-badge-link-background":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-background)",fitFallback:"--esp-color-background"}),"--esp-badge-link-border-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link)"}),"--esp-badge-link-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link)",pairsWith:"--esp-badge-link-background",targetLc:75,fitFallback:"--esp-color-link"}),"--esp-badge-link-hover-background":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover-bg)",fitFallback:"--esp-color-link-hover-bg"}),"--esp-badge-link-hover-border-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover)"}),"--esp-badge-link-hover-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover)",pairsWith:"--esp-badge-link-hover-background",targetLc:75,fitFallback:"--esp-color-link-hover"}),"--esp-badge-link-focus-background":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover-bg)",fitFallback:"--esp-color-link-hover-bg"}),"--esp-badge-link-focus-border-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover)"}),"--esp-badge-link-focus-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link-hover)",pairsWith:"--esp-badge-link-focus-background",targetLc:75,fitFallback:"--esp-color-link-hover"}),"--esp-badge-link-focus-ring-color":Object.freeze({component:"esp-badge",syntax:"color",default:"var(--esp-color-link)"}),"--esp-blockquote-bar-color":Object.freeze({syntax:"color",default:"var(--esp-color-border)"}),"--esp-blockquote-glyph-color":Object.freeze({syntax:"color",default:"var(--esp-blockquote-bar-color, var(--esp-color-border))"}),"--esp-breadcrumb-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link)",pairsWith:"--esp-color-background",targetLc:75,fitFallback:"--esp-color-link"}),"--esp-breadcrumb-hover-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link-hover)",pairsWith:"--esp-breadcrumb-hover-background",targetLc:75,fitFallback:"--esp-color-link-hover"}),"--esp-breadcrumb-hover-background":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-color-link-hover-bg)",fitFallback:"--esp-color-link-hover-bg"}),"--esp-breadcrumb-current-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"var(--esp-breadcrumb-color, var(--esp-color-headings))",pairsWith:"--esp-color-background",targetLc:60,fitFallback:"--esp-color-headings"}),"--esp-breadcrumb-separator-color":Object.freeze({component:"esp-breadcrumb",syntax:"color",default:"color-mix(in oklch, var(--esp-breadcrumb-color, var(--esp-color-link)) 70%, transparent)"}),"--esp-breadcrumb-separator-size":Object.freeze({component:"esp-breadcrumb",syntax:"length",default:"var(--esp-size-normal-to-medium)",unit:"rem",min:.5,max:2}),"--esp-breadcrumb-separator-stroke-width":Object.freeze({component:"esp-breadcrumb",syntax:"number",default:"2",min:.5,max:6}),"--esp-footer-heading-size":Object.freeze({component:"esp-footer",syntax:"keyword",default:"normal",allowedValues:["small","normal","medium","big","large"],derives:{property:"--esp-footer-heading-font-size",values:{small:"var(--esp-type-small)",normal:"var(--esp-type-normal)",medium:"var(--esp-type-medium)",big:"var(--esp-type-big)",large:"var(--esp-type-large)"}}}),"--esp-footer-link-decoration":Object.freeze({component:"esp-footer",syntax:"keyword",default:"underline",allowedValues:["none","underline"]}),"--esp-footer-link-underline-offset":Object.freeze({component:"esp-footer",syntax:"length",default:"0.18em",unit:"em",min:0,max:.5}),"--esp-footer-link-underline-thickness":Object.freeze({component:"esp-footer",syntax:"length | keyword",default:"auto",unit:"em",min:0,max:.2,allowedValues:["auto"]}),"--esp-header-brand-logo-max-width":Object.freeze({component:"esp-header",syntax:"length",default:"12rem",unit:"rem",min:4,max:32}),"--esp-heading-1-color":s,"--esp-heading-2-color":s,"--esp-heading-3-color":s,"--esp-heading-4-color":s});function x(a){return typeof a=="string"&&Object.prototype.hasOwnProperty.call(k,a)}const O="--_esp-",c=/^--esp-[a-z0-9-]+$/,v=/^--_esp-[a-z0-9-]+$/,y=/^[a-z][a-z0-9-]*$/,l=new Set(g.map(h));function b(a,t){if(t.syntax!=="color"||!l.has(t.fitFallback??"")||t.allowedValues?.some(n=>!l.has(n)))throw new Error(`${a} must use an opaque semantic fit fallback and opaque pair values.`)}function z(a,t){const n=new Map(Object.entries(a)),i=new Set;for(const[r,e]of n){if(!c.test(r))throw new Error(`${r} must be a public --esp- property.`);if(t){const o=t.get(r);if(!o)throw new Error(`${r} is missing @cssprop documentation.`);if(e.component===void 0){if(o.category!=="shared-hook")throw new Error(`${r} has no component owner and must be documented as a shared hook.`)}else if(o.category!=="component"||o.component!==e.component)throw new Error(`${r} is documented for ${o.component??o.category}, not ${e.component}.`)}const u=e.syntax==="length"||e.syntax==="length | keyword",p=e.syntax==="keyword"||e.syntax==="length | keyword";if(u&&(e.unit!=="rem"&&e.unit!=="em"||e.min===void 0||e.max===void 0||!Number.isFinite(e.min)||!Number.isFinite(e.max)||e.min>e.max))throw new Error(`${r} must have a supported unit and finite, ordered length bounds.`);if(e.syntax==="number"&&(e.min===void 0||e.max===void 0||!Number.isFinite(e.min)||!Number.isFinite(e.max)||e.min>e.max))throw new Error(`${r} must have finite, ordered number bounds.`);if(p&&(!e.allowedValues?.length||!e.allowedValues.every(o=>y.test(o))))throw new Error(`${r} must declare its allowed keywords.`);if(e.pairsWith!==void 0){if(!(e.targetLc!==void 0&&Number.isFinite(e.targetLc)&&e.targetLc>0))throw new Error(`${r} must have a positive, finite contrast target.`);if(b(r,e),!l.has(e.pairsWith)){const o=n.get(e.pairsWith);if(!o||e.pairsWith===r||e.component===void 0||o.component!==e.component||o.pairsWith!==void 0)throw new Error(`${r} must pair with a semantic color or a same-component unpaired color.`);b(e.pairsWith,o)}}else if(e.targetLc!==void 0)throw new Error(`${r} declares a contrast target without a pair.`);if(e.derives){const{property:o,values:m}=e.derives,d=Object.keys(m);if(!p||!d.length||d.some(f=>!e.allowedValues?.includes(f)))throw new Error(`${r} may derive values only from its allowed keywords.`);if(n.has(o)||i.has(o))throw new Error(`${r} must derive a unique, non-settable output: ${o}.`);if(!c.test(o)&&!v.test(o))throw new Error(`${r} must derive a public --esp- or private --_esp- output.`);if(t&&c.test(o)&&!t.has(o))throw new Error(`${r} derives ${o}, which is missing @cssprop documentation.`);i.add(o)}}}export{O as PRIVATE_COMPONENT_PROPERTY_PREFIX,l as SEMANTIC_COLOR_PROPERTIES,k as SETTABLE_COMPONENT_PROPERTIES,z as assertRegistryInvariants,x as isSettableComponentPropertyName};