@theme-registry/refract 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/_createTheme-255ff48e.esm.js +2 -0
- package/dist/_createTheme-255ff48e.esm.js.map +1 -0
- package/dist/_createTheme-41c01033.cjs.js +2 -0
- package/dist/_createTheme-41c01033.cjs.js.map +1 -0
- package/dist/_errors-be768b25.cjs.js +2 -0
- package/dist/_errors-be768b25.cjs.js.map +1 -0
- package/dist/_errors-d75a5c74.esm.js +2 -0
- package/dist/_errors-d75a5c74.esm.js.map +1 -0
- package/dist/adapter-kit.cjs.js +2 -0
- package/dist/adapter-kit.cjs.js.map +1 -0
- package/dist/adapter-kit.d.ts +88 -0
- package/dist/adapter-kit.esm.js +2 -0
- package/dist/adapter-kit.esm.js.map +1 -0
- package/dist/build/auditCommand.d.ts +19 -0
- package/dist/build/buildCommand.d.ts +23 -0
- package/dist/build/cli.d.ts +2 -0
- package/dist/build/config.d.ts +58 -0
- package/dist/build/diff.d.ts +56 -0
- package/dist/build/diffCommand.d.ts +29 -0
- package/dist/build/emit.d.ts +20 -0
- package/dist/build/emitTheme.d.ts +39 -0
- package/dist/build/guide.d.ts +34 -0
- package/dist/build/importCommand.d.ts +42 -0
- package/dist/build/index.d.ts +33 -0
- package/dist/build/init.d.ts +32 -0
- package/dist/build/paths.d.ts +42 -0
- package/dist/build/skillsCommand.d.ts +53 -0
- package/dist/build/tokensCommand.d.ts +17 -0
- package/dist/build/vendor.d.ts +39 -0
- package/dist/build.cjs.js +2 -0
- package/dist/build.cjs.js.map +1 -0
- package/dist/build.esm.js +2 -0
- package/dist/build.esm.js.map +1 -0
- package/dist/cli.js +8250 -0
- package/dist/cli.js.map +1 -0
- package/dist/color-math.cjs.js +2 -0
- package/dist/color-math.cjs.js.map +1 -0
- package/dist/color-math.esm.js +2 -0
- package/dist/color-math.esm.js.map +1 -0
- package/dist/core/ThemeAdapter.d.ts +234 -0
- package/dist/core/createTheme.d.ts +96 -0
- package/dist/core/cssProperties.d.ts +8 -0
- package/dist/core/defineAdapter.d.ts +25 -0
- package/dist/core/derive/crossProperty.d.ts +31 -0
- package/dist/core/derive/index.d.ts +11 -0
- package/dist/core/derive/resolveTokens.d.ts +27 -0
- package/dist/core/errors.d.ts +24 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/media/containers.d.ts +20 -0
- package/dist/core/media/defaults.d.ts +3 -0
- package/dist/core/media/descriptors.d.ts +12 -0
- package/dist/core/media/index.d.ts +11 -0
- package/dist/core/media/queries.d.ts +20 -0
- package/dist/core/model/buildModel.d.ts +116 -0
- package/dist/core/model/index.d.ts +14 -0
- package/dist/core/model/interpreted.d.ts +37 -0
- package/dist/core/model/mergeRuleSet.d.ts +68 -0
- package/dist/core/model/model.d.ts +260 -0
- package/dist/core/noopAdapter.d.ts +26 -0
- package/dist/core/normalize/index.d.ts +15 -0
- package/dist/core/normalize/properties.d.ts +20 -0
- package/dist/core/normalize/recipeResolver.d.ts +19 -0
- package/dist/core/normalize/recipes.d.ts +38 -0
- package/dist/core/normalize/responsive.d.ts +40 -0
- package/dist/core/normalize/types.d.ts +261 -0
- package/dist/core/rawTheme.d.ts +53 -0
- package/dist/core/ref.d.ts +13 -0
- package/dist/core/subsystem.d.ts +115 -0
- package/dist/core/types.d.ts +31 -0
- package/dist/core/units.d.ts +93 -0
- package/dist/dtcg/export.d.ts +48 -0
- package/dist/dtcg/import.d.ts +43 -0
- package/dist/dtcg/index.d.ts +21 -0
- package/dist/dtcg/parse.d.ts +6 -0
- package/dist/dtcg/types.d.ts +69 -0
- package/dist/dtcg.cjs.js +2 -0
- package/dist/dtcg.cjs.js.map +1 -0
- package/dist/dtcg.esm.js +2 -0
- package/dist/dtcg.esm.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/subsystems/animation/index.d.ts +13 -0
- package/dist/subsystems/animation/recipes.d.ts +20 -0
- package/dist/subsystems/animation/types.d.ts +52 -0
- package/dist/subsystems/borders/index.d.ts +10 -0
- package/dist/subsystems/borders/recipes.d.ts +29 -0
- package/dist/subsystems/borders/types.d.ts +50 -0
- package/dist/subsystems/colors/audit.d.ts +67 -0
- package/dist/subsystems/colors/colorInput.d.ts +17 -0
- package/dist/subsystems/colors/index.d.ts +12 -0
- package/dist/subsystems/colors/keywords.d.ts +9 -0
- package/dist/subsystems/colors/normalize.d.ts +26 -0
- package/dist/subsystems/colors/recipes.d.ts +21 -0
- package/dist/subsystems/colors/types.d.ts +98 -0
- package/dist/subsystems/colors/utils.d.ts +104 -0
- package/dist/subsystems/components/index.d.ts +13 -0
- package/dist/subsystems/components/recipes.d.ts +22 -0
- package/dist/subsystems/components/types.d.ts +46 -0
- package/dist/subsystems/effects/index.d.ts +9 -0
- package/dist/subsystems/effects/recipes.d.ts +24 -0
- package/dist/subsystems/effects/types.d.ts +63 -0
- package/dist/subsystems/effects/utils.d.ts +57 -0
- package/dist/subsystems/globals/index.d.ts +21 -0
- package/dist/subsystems/globals/presets.d.ts +33 -0
- package/dist/subsystems/globals/types.d.ts +48 -0
- package/dist/subsystems/index.d.ts +21 -0
- package/dist/subsystems/layout/index.d.ts +14 -0
- package/dist/subsystems/layout/normalize.d.ts +35 -0
- package/dist/subsystems/layout/recipes.d.ts +16 -0
- package/dist/subsystems/layout/structural.d.ts +37 -0
- package/dist/subsystems/layout/types.d.ts +154 -0
- package/dist/subsystems/typography/index.d.ts +9 -0
- package/dist/subsystems/typography/normalize.d.ts +17 -0
- package/dist/subsystems/typography/recipes.d.ts +21 -0
- package/dist/subsystems/typography/types.d.ts +49 -0
- package/package.json +83 -0
- package/skills/adapter-scaffold/SKILL.md +85 -0
- package/skills/adapter-usage/SKILL.md +75 -0
- package/skills/build-config/SKILL.md +77 -0
- package/skills/colors/SKILL.md +134 -0
- package/skills/consuming-the-output/SKILL.md +62 -0
- package/skills/dtcg-import/SKILL.md +76 -0
- package/skills/layout/SKILL.md +65 -0
- package/skills/overrides-and-child-themes/SKILL.md +70 -0
- package/skills/recipes-and-composition/SKILL.md +110 -0
- package/skills/theme-authoring/SKILL.md +107 -0
- package/skills/theme-foundations/SKILL.md +127 -0
- package/skills/troubleshooting/SKILL.md +97 -0
- package/skills/typography/SKILL.md +66 -0
- package/skills/visual-effects/SKILL.md +96 -0
- package/src/subsystems/colors/utils.ts +299 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Petyo Stoyanov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{R as e}from"./_errors-d75a5c74.esm.js";import{serializeColor as t,oklchToRgb as r,convertHexToRGB as n,parseColor as o,rotateHue as i,setL as s,lighten as a,darken as l,alpha as c,adjust as d}from"./color-math.esm.js";const f=new Set("display position top right bottom left inset inset-block inset-block-start inset-block-end inset-inline inset-inline-start inset-inline-end float clear z-index visibility overflow overflow-x overflow-y overflow-block overflow-inline overflow-clip-margin overflow-anchor box-sizing width height min-width min-height max-width max-height block-size inline-size min-block-size min-inline-size max-block-size max-inline-size aspect-ratio margin margin-top margin-right margin-bottom margin-left margin-block margin-block-start margin-block-end margin-inline margin-inline-start margin-inline-end margin-trim padding padding-top padding-right padding-bottom padding-left padding-block padding-block-start padding-block-end padding-inline padding-inline-start padding-inline-end flex flex-grow flex-shrink flex-basis flex-direction flex-flow flex-wrap order justify-content justify-items justify-self align-content align-items align-self place-content place-items place-self gap row-gap column-gap grid grid-area grid-template grid-template-areas grid-template-columns grid-template-rows grid-auto-columns grid-auto-rows grid-auto-flow grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end columns column-count column-width column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-fill color opacity accent-color caret-color color-scheme forced-color-adjust print-color-adjust background background-color background-image background-position background-position-x background-position-y background-size background-repeat background-origin background-clip background-attachment background-blend-mode mix-blend-mode isolation border border-width border-style border-color border-top border-top-width border-top-style border-top-color border-right border-right-width border-right-style border-right-color border-bottom border-bottom-width border-bottom-style border-bottom-color border-left border-left-width border-left-style border-left-color border-block border-block-width border-block-style border-block-color border-block-start border-block-start-width border-block-start-style border-block-start-color border-block-end border-block-end-width border-block-end-style border-block-end-color border-inline border-inline-width border-inline-style border-inline-color border-inline-start border-inline-start-width border-inline-start-style border-inline-start-color border-inline-end border-inline-end-width border-inline-end-style border-inline-end-color border-radius border-top-left-radius border-top-right-radius border-bottom-right-radius border-bottom-left-radius border-start-start-radius border-start-end-radius border-end-start-radius border-end-end-radius border-image border-image-source border-image-slice border-image-width border-image-outset border-image-repeat border-collapse border-spacing outline outline-width outline-style outline-color outline-offset box-shadow filter backdrop-filter clip-path mask mask-image mask-mode mask-repeat mask-position mask-clip mask-origin mask-size mask-composite mask-type opacity transform transform-origin transform-box transform-style perspective perspective-origin backface-visibility rotate scale translate transition transition-property transition-duration transition-timing-function transition-delay transition-behavior animation animation-name animation-duration animation-timing-function animation-delay animation-iteration-count animation-direction animation-fill-mode animation-play-state animation-composition animation-timeline will-change font font-family font-size font-size-adjust font-weight font-style font-variant font-variant-caps font-variant-numeric font-variant-ligatures font-variant-east-asian font-variant-alternates font-variant-position font-feature-settings font-variation-settings font-kerning font-stretch font-optical-sizing font-synthesis font-display line-height letter-spacing word-spacing text-align text-align-last text-decoration text-decoration-line text-decoration-color text-decoration-style text-decoration-thickness text-decoration-skip-ink text-underline-offset text-underline-position text-transform text-indent text-overflow text-shadow text-rendering text-wrap text-wrap-mode text-wrap-style text-emphasis text-emphasis-color text-emphasis-style text-emphasis-position text-orientation text-combine-upright text-justify white-space white-space-collapse word-break word-wrap overflow-wrap hyphens hyphenate-character line-break tab-size vertical-align writing-mode direction unicode-bidi quotes content list-style list-style-type list-style-position list-style-image counter-reset counter-increment counter-set cursor pointer-events user-select touch-action resize appearance caret scroll-behavior scroll-margin scroll-margin-top scroll-margin-right scroll-margin-bottom scroll-margin-left scroll-padding scroll-padding-top scroll-padding-right scroll-padding-bottom scroll-padding-left scroll-snap-type scroll-snap-align scroll-snap-stop overscroll-behavior overscroll-behavior-x overscroll-behavior-y scrollbar-width scrollbar-color scrollbar-gutter table-layout caption-side empty-cells vertical-align object-fit object-position image-rendering fill fill-opacity fill-rule stroke stroke-width stroke-opacity stroke-linecap stroke-linejoin stroke-dasharray stroke-dashoffset stroke-miterlimit paint-order shape-rendering stop-color flood-color lighting-color container container-type container-name contain content-visibility break-before break-after break-inside page-break-before page-break-after page-break-inside orphans widows all cx cy r rx ry d".split(" ")),u=/^-(webkit|moz|ms|o)-/,p=e=>{if(e.startsWith("--"))return!0;const t=e.replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return!!u.test(t)||f.has(t)},b=e=>"string"==typeof e||"number"==typeof e,v=e=>Array.isArray(e),m=e=>({value:e}),g=(e,t)=>{if(!t)return m(e);const r={ref:t.ref};return void 0!==t.fn&&(r.fn=t.fn),void 0!==t.arg&&(r.arg=t.arg),void 0!==t.modifiers&&(r.modifiers=t.modifiers),void 0!==e&&(r.value=e),r},h=new Set(["mode","target","base","derive"]),y=(t,r,n)=>{const o={},i=t.derive,s=t.base;if(i){if(void 0===i.ref)throw new e("REFRACT_E_REFERENCE",`Derived appearance mode "${r}.modes.${n}" was not baked — derived modes require a subsystem that resolves them (colors). Use a literal value instead.`);o.base=g(b(s)?s:void 0,i)}else b(s)?o.base=m(s):v(s)&&(o.base={struct:s});for(const[e,r]of Object.entries(t))h.has(e)||b(r)&&(o[e]=m(r));return o},w=(e,t)=>{const r={};for(const[n,o]of Object.entries(e))t.has(n)||b(o)&&(r[n]=m(o));return r},k=new Set(["base","derive"]),$=new Set(["base","responsive","variants","modes","external"]),x=new Set(["breakpoint","query","state","orientation","ref","modifiers","mode","variant","target","derive","ratio","step","steps"]),R=(e,t="property")=>{var r;const n={base:void 0!==e.external?{value:`var(${e.external})`,external:e.external}:(o=e.base,v(o)?{struct:o}:m(o))};var o;const i=w(e,$);if(Object.keys(i).length&&(n.extras=i),e.variants&&Object.keys(e.variants).length){const t={};for(const[r,n]of Object.entries(e.variants)){let e;const o=n.derive;if(b(n.base)?e=g(n.base,o):v(n.base)?e={struct:n.base}:void 0!==(null==o?void 0:o.ref)&&(e=g(void 0,o)),!e)continue;const i=w(n,k);t[r]=Object.keys(i).length?{base:e,extras:i}:{base:e}}Object.keys(t).length&&(n.variants=t)}const s=e.modes;if(s&&s.length){const e=[];for(const r of s){const n=r.mode,o=y(r,t,n);if(!Object.keys(o).length)continue;const i={mode:n,overrides:o};"string"==typeof r.target&&(i.target=r.target),e.push(i)}e.length&&(n.modes=e)}if(null===(r=e.responsive)||void 0===r?void 0:r.length){const t=e.responsive.map(e=>{const t=e,r={breakpoint:t.breakpoint};"string"==typeof t.query&&(r.query=t.query),"string"==typeof t.orientation&&(r.orientation=t.orientation),"string"==typeof t.ref&&(r.ref=t.ref),"string"==typeof t.mode&&(r.mode=t.mode),"string"==typeof t.target&&(r.target=t.target);const n=((e,t)=>{const r={};for(const[n,o]of Object.entries(e))t.has(n)||(b(o)?r[n]=m(o):v(o)&&(r[n]={struct:o}));return r})(t,x),o=t.derive;return o&&n.base&&void 0!==n.base.value&&(n.base=g(n.base.value,o)),Object.keys(n).length&&(r.overrides=n),r});n.responsive=t}return n},E=e=>{const t={};for(const[r,n]of Object.entries(e))t[r]=R(n,r);return t},j=e=>({kind:"recipe",declarations:{...e.base},overrides:e.responsive.map(e=>{const t={};return void 0!==e.state&&(t.state=e.state),void 0!==e.breakpoint&&(t.breakpoint=e.breakpoint),void 0!==e.query&&(t.query=e.query),void 0!==e.orientation&&(t.orientation=e.orientation),void 0!==e.container&&(t.container=e.container),void 0!==e.size&&(t.size=e.size),void 0!==e.variant&&(t.variant=e.variant),void 0!==e.target&&(t.target=e.target),Object.keys(e.declarations).length&&(t.declarations={...e.declarations}),t})}),A=e=>{const t={};for(const[r,n]of Object.entries(e))t[r]=j(n);return t},O=(e,t)=>{const r=e=>void 0!==e.ref&&void 0!==t[e.ref]?{...e,ref:t[e.ref]}:e,n=e=>{const t={};for(const[n,o]of Object.entries(e))t[n]=r(o);return t},o={};for(const[t,r]of Object.entries(e))o[t]={...r,declarations:n(r.declarations),overrides:r.overrides.map(e=>e.declarations?{...e,declarations:n(e.declarations)}:e)};return o},_=(e,t)=>{const r=e=>void 0!==e.ref&&void 0!==t[e.ref]?{...e,ref:t[e.ref]}:e,n=e=>{const t={};for(const[n,o]of Object.entries(e))t[n]=r(o);return t},o=e=>{const t={};for(const[o,i]of Object.entries(e))t[o]=i.extras?{base:r(i.base),extras:n(i.extras)}:{base:r(i.base)};return t},i={};for(const[t,s]of Object.entries(e))i[t]={...s,base:r(s.base),...s.variants?{variants:o(s.variants)}:{},...s.extras?{extras:n(s.extras)}:{}};return i},S=e=>{const t=[];for(const[r,n]of Object.entries(e))T.has(r)&&"string"==typeof n&&n.includes(".")&&t.push(`${r}:${n}`);return t},C=(e,t)=>{const r=j(e);return r.kind="recipe",t.length&&(r.references=t),r},T=new Set(["colors","typography","layout","effects","borders"]),F=e=>!!e&&Object.keys(e).length>0,N=e=>{var t;if(!e)return;const r={};return e.properties&&Object.keys(e.properties).length&&(r.properties=E(e.properties)),e.extraProperties&&Object.keys(e.extraProperties).length&&(r.properties={...null!==(t=r.properties)&&void 0!==t?t:{},...e.extraProperties}),F(e.ruleSetGroups)&&(r.ruleSets=e.ruleSetGroups),F(e.keyframes)&&(r.keyframes=e.keyframes),Object.keys(r).length?r:void 0},z=e=>{var t;const r={},n=N(e.colors);n&&(r.colors=n);const o=N(e.typography);o&&(r.typography=o);const i=N(e.layout);i&&(r.layout=i);const s=N(e.effects);s&&(r.effects=s);const a=N(e.borders);a&&(r.borders=a);const l=N(e.animation);l&&(r.animation=l),F(null===(t=e.components)||void 0===t?void 0:t.ruleSetGroups)&&(r.components={ruleSets:e.components.ruleSetGroups});const c=N(e.globals);c&&(r.globals=c);const d={breakpoints:e.breakpoints,subsystems:r};return e.containers&&Object.keys(e.containers).length&&(d.containers=e.containers),d},P=e=>{var t,r,n,o;const i={};for(const[s,a]of Object.entries(e.subsystems))for(const[e,l]of Object.entries(null!==(t=a.properties)&&void 0!==t?t:{})){const t=`${s}.${e}`;i[t]=l.base;for(const[e,o]of Object.entries(null!==(r=l.variants)&&void 0!==r?r:{})){i[`${t}.${e}`]=o.base;for(const[r,s]of Object.entries(null!==(n=o.extras)&&void 0!==n?n:{}))i[`${t}.${e}.${r}`]=s}for(const[e,r]of Object.entries(null!==(o=l.extras)&&void 0!==o?o:{}))i[`${t}.${e}`]=r}return i},q=.02,I=["min","max","exact","between"],V=e=>Object.keys(e).sort((t,r)=>e[t]-e[r]),B=e=>void 0===e?void 0:e-q,M=(t,r)=>{const n=V(t);(t=>{const r=t.filter(e=>I.includes(e));if(r.length)throw new e("REFRACT_E_BREAKPOINT",`Breakpoint names conflict with reserved keys: ${r.map(e=>`"${e}"`).join(", ")}. Reserved: ${I.map(e=>`"${e}"`).join(", ")}.`)})(n);const o=e=>n[n.indexOf(e)+1],i=n.reduce((e,n)=>{const i=t[n],s=o(n),a=void 0!==s?t[s]:void 0;return e[n]=L({own:i,next:a},r),e},{}),s=t=>{const r=i[t];if(!r)throw new e("REFRACT_E_BREAKPOINT",`Breakpoint "${t}" is not defined.`);return r};return{...i,min:(e,n)=>{const o=s(e);return n?r({min:t[e],...n}):o.min},max:(e,n)=>{const i=s(e);if(!n)return i.max;const a=o(e),l=void 0!==a?t[a]:void 0;return r({max:B(l),...n})},exact:(e,n)=>{const i=s(e);if(!n)return i.exact;const a=o(e),l=void 0!==a?t[a]:void 0;return r({min:t[e],max:B(l),...n})},between:(n,o,i)=>{const s=t[n],a=t[o];if(void 0===s||void 0===a)throw new e("REFRACT_E_BREAKPOINT",`Cannot build media query between "${n}" and "${o}" breakpoints.`);return r({min:s,max:a-q,...i})}}},L=({own:e,next:t},r)=>{const n=B(t);return{min:r({min:e}),max:void 0===n?"":r({max:n}),exact:r({min:e,max:n})}},U="px",Y=16,H=e=>{var t;return{unit:null!==(t=null==e?void 0:e.unit)&&void 0!==t?t:U,baseFontSize:(null==e?void 0:e.baseFontSize)&&e.baseFontSize>0?e.baseFontSize:Y}},J=(e,t)=>{if("px"===t.unit)return`${e}px`;const r=e/t.baseFontSize;return`${Number(r.toFixed(4))}${t.unit}`},W=({min:t,max:r,orientation:n},o)=>{const i=[];if(void 0!==t&&void 0!==r&&t>r)throw new e("REFRACT_E_MEDIA","Invalid media query: `min` cannot be greater than `max`.");return void 0!==t&&i.push(`(min-width: ${J(t,o)})`),void 0!==r&&i.push(`(max-width: ${J(r,o)})`),n&&i.push(`(orientation: ${n})`),i.length?`@media ${i.join(" and ")}`:""},D=(e,t)=>W(e,H(t)),G=(t,{min:r,max:n},o)=>{const i=[];if(void 0!==r&&void 0!==n&&r>n)throw new e("REFRACT_E_MEDIA","Invalid container query: `min` cannot be greater than `max`.");return void 0!==r&&i.push(`(min-width: ${J(r,o)})`),void 0!==n&&i.push(`(max-width: ${J(n,o)})`),i.length?`@container ${t} ${i.join(" and ")}`:""},K={xs:0,sm:576,md:768,lg:992,xl:1280},X=(e,t)=>{const r=H(t),n={};for(const[t,o]of Object.entries(null!=e?e:{}))n[t]=M(o.sizes,e=>G(t,{min:e.min,max:e.max},r));return n},Z=["px","cm","mm","q","in","pc","pt","rem","em","ex","cap","ch","ic","lh","rlh","%","vw","vh","vi","vb","vmin","vmax","svw","svh","lvw","lvh","dvw","dvh","cqw","cqh","cqi","cqb","cqmin","cqmax"],Q=new Set(Z),ee=/^-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?$/i,te=/^(-?(?:\d+\.?\d*|\.\d+)(?:e-?\d+)?)([a-z%]+)$/i,re=t=>{if("number"==typeof t)return{value:t};const r=t.trim();if(ee.test(r))return{value:Number(r)};const n=te.exec(r);if(n){const r=n[2].toLowerCase();if(Q.has(r))return{value:Number(n[1]),unit:r};throw new e("REFRACT_E_UNITS",`Unknown length unit "${n[2]}" in "${t}". Use a CSS unit, or wrap functions/keywords (calc(), clamp(), var(), a keyword) — those pass through as raw strings.`)}return{raw:t}},ne=16,oe={"typography.lineHeight":"none","typography.letterSpacing":"em"},ie=(e,t)=>{var r,n,o,i;const s=e.slice(0,e.indexOf("."));return null!==(i=null!==(o=null!==(n=null!==(r=null==t?void 0:t[e])&&void 0!==r?r:oe[e])&&void 0!==n?n:null==t?void 0:t[s])&&void 0!==o?o:null==t?void 0:t.default)&&void 0!==i?i:"px"},se=(e,t)=>Number((e/t).toFixed(4)),ae=(e,t,r)=>"none"===t?{value:e}:"rem"===t?{value:se(e,r),unit:"rem"}:{value:e,unit:t},le=(e,t,r)=>{if(void 0!==e.unit)return e;if(void 0!==e.ref&&void 0===e.value)return e;const n=e.value;if("number"==typeof n){const{value:o,unit:i}=ae(n,t,r);return void 0===i?e:{...e,value:o,unit:i}}if("string"==typeof n){const o=re(n);if("raw"in o)return e;if(void 0!==o.unit)return{...e,value:o.value,unit:o.unit};const{value:i,unit:s}=ae(o.value,t,r);return void 0===s?{...e,value:i}:{...e,value:i,unit:s}}return e},ce=(e,t,r)=>{if("number"==typeof e){const{value:n,unit:o}=ae(e,t,r);return void 0===o?e:{value:n,unit:o}}return e},de={typography:{fontSize:"length",letterSpacing:"length",lineHeight:"length"},layout:{spacing:"length",gutters:"length",sizes:"length"},borders:{width:"length",offset:"length",radius:"length"},effects:{blur:"length",shadow:"shadow"}},fe=(e,t)=>{let r=!1;const n={};for(const[o,i]of Object.entries(e)){const e=t(i);e!==i&&(r=!0),n[o]=e}return r?n:e},ue=(e,t,r)=>{const n=t(e.base),o=e.variants?((e,t)=>{let r=!1;const n={};for(const[o,i]of Object.entries(e)){const e=t(i.base),s=i.extras?fe(i.extras,t):void 0;e===i.base&&s===i.extras||(r=!0),n[o]=s?{base:e,extras:s}:{base:e}}return r?n:e})(e.variants,t):void 0,i=r&&e.extras?fe(e.extras,t):e.extras,s=e.modes?((e,t)=>{let r=!1;const n=e.map(e=>{if(!e.overrides)return e;const n=fe(e.overrides,t);return n===e.overrides?e:(r=!0,{...e,overrides:n})});return r?n:e})(e.modes,t):void 0,a=((e,t)=>{if(!e.responsive)return;let r=!1;const n=e.responsive.map(e=>{if(!e.overrides)return e;const n=fe(e.overrides,t);return n===e.overrides?e:(r=!0,{...e,overrides:n})});return r?n:e.responsive})(e,t);if(n===e.base&&o===e.variants&&i===e.extras&&s===e.modes&&a===e.responsive)return e;const l={...e,base:n};return void 0!==o&&(l.variants=o),void 0!==i&&(l.extras=i),void 0!==s&&(l.modes=s),void 0!==a&&(l.responsive=a),l},pe=(e,t,r,n)=>ue(e,"shadow"===t?e=>{if(!e.struct)return e;const t=e.struct;let o=!1;const i=t.map(e=>{const t=((e,t,r)=>{const n={...e};let o=!1;for(const i of["offsetX","offsetY","blur","spread"]){const s=e[i];if(void 0===s)continue;const a=ce(s,t,r);a!==s&&(n[i]=a,o=!0)}return o?n:e})(e,r,n);return t!==e&&(o=!0),t});return o?{...e,struct:i}:e}:e=>le(e,r,n),!1),be=(e,t={})=>{var r;const n=null!==(r=t.baseFontSize)&&void 0!==r?r:16;let o=!1;const i={};for(const[r,s]of Object.entries(e.subsystems)){const e=de[r];if(!e||!s.properties){i[r]=s;continue}let a=!1;const l={};for(const[o,i]of Object.entries(s.properties)){const s=e[o];if(!s){l[o]=i;continue}const c=ie(`${r}.${o}`,t.units),d=pe(i,s,c,n);d!==i&&(a=!0),l[o]=d}a?(i[r]={...s,properties:l},o=!0):i[r]=s}return o?{...e,subsystems:i}:e},ve="exact",me=e=>(null==e?void 0:e.propertyPath)?` for "${e.propertyPath}"`:"",ge=(e,t)=>!t||(Array.isArray(t)?t.includes(e):t.has(e));function he(t,r){return(null==t?void 0:t.length)?t.map(t=>{if(!t.breakpoint)throw new e("REFRACT_E_BREAKPOINT",`Responsive entry${me(r)} is missing a "breakpoint" value.`);if((null==r?void 0:r.allowedBreakpoints)&&!ge(t.breakpoint,r.allowedBreakpoints))throw new e("REFRACT_E_BREAKPOINT",`Responsive entry${me(r)} references unknown breakpoint "${t.breakpoint}".`);if(t.ref&&!ge(t.ref,null==r?void 0:r.allowedVariants))throw new e("REFRACT_E_RESPONSIVE",`Responsive entry${me(r)} references unknown variant "${t.ref}" (ref).`);if(t.target&&!ge(t.target,null==r?void 0:r.allowedTargets))throw new e("REFRACT_E_RESPONSIVE",`Responsive entry${me(r)} references unknown target "${t.target}".`);const{query:n,...o}=t;return{...o,query:null!=n?n:ve}}):[]}function ye(t,r){const n=t.variants?Object.keys(t.variants):[];if(!n.length)return;const o=new Set(n),i=(null==r?void 0:r.propertyPath)?` for "${r.propertyPath}"`:"";for(const r of t.responsive){if(r.ref&&!o.has(r.ref))throw new e("REFRACT_E_RESPONSIVE",`Responsive entry${i} references unknown variant "${r.ref}" (ref).`);if(r.target&&!o.has(r.target))throw new e("REFRACT_E_RESPONSIVE",`Responsive entry${i} references unknown target "${r.target}".`)}}const we=e=>"object"==typeof e&&null!==e&&Array.isArray(e.modifiers),ke=(t,r)=>{if(!Array.isArray(t)||0===t.length)throw new e("REFRACT_E_VARIANT",`Derivation "${r}" needs a non-empty "modifiers" array.`);return t.map((t,n)=>{if("object"!=typeof t||null===t||Array.isArray(t))throw new e("REFRACT_E_VARIANT",`Modifier ${n} of "${r}" must be a single-key object like { darken: 10 }.`);const o=Object.keys(t);if(1!==o.length)throw new e("REFRACT_E_VARIANT",`Modifier ${n} of "${r}" must have exactly one fn key; got [${o.join(", ")}].`);return{fn:o[0],arg:t[o[0]]}})},$e=new Set(["breakpoint","query","ref","modifiers","mode","target","orientation"]),xe=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),Re=(t,r,n)=>{var o;const i=null!==(o=null!=t?t:r)&&void 0!==o?o:n.fallbackBase;if(void 0===i)throw new e("REFRACT_E_PROPERTY",`Unable to resolve base value${s=n.propertyPath,s?` for "${s}"`:""}.`);var s;return n.coerceValue?n.coerceValue(i):i},Ee=(e,t)=>{const r=new Set(t),n={},o={};let i=!1;for(const[t,s]of Object.entries(e))r.has(t)?(n[t]=s,i=!0):o[t]=s;return{base:i?n:void 0,extra:o}},je=(e,t,r,n)=>{var o;if(void 0===e&&(null===(o=n.leafFields)||void 0===o?void 0:o.length)){const e=Ee(t,n.leafFields);if(void 0!==e.base){const t=e.base;return{base:n.coerceValue?n.coerceValue(t):t,extra:e.extra}}}return{base:Re(e,r,n),extra:t}},Ae=(e,t,r,n)=>{const o=r.propertyPath?`${r.propertyPath}.variants.${e}`:`variants.${e}`,i=xe(t)?t:{base:t},{base:s,...a}=i,{base:l,extra:c}=je(s,a,n,{...r,propertyPath:o});return{...c,base:l}},Oe=(t,r={})=>{var n;const o=xe(t)?t:{base:t},{base:i,responsive:s,variants:a,modes:l,...c}=o,{base:d,extra:f}=je(i,c,r.fallbackBase,r),u=a?Object.fromEntries(Object.entries(a).map(([e,t])=>[e,Ae(e,t,r,d)])):void 0,p=l?l.map(t=>((t,r)=>{const{mode:n,target:o,...i}=t,s=r.propertyPath?`${r.propertyPath}.modes.${n}`:`modes.${n}`;return{mode:n,...void 0!==o?{target:o}:{},...(()=>{var t;if((null===(t=r.leafFields)||void 0===t?void 0:t.length)&&!("base"in i)&&!we(i)){const{base:e,extra:t}=Ee(i,r.leafFields);if(void 0!==e){const n={...t};return n.base=r.coerceValue?r.coerceValue(e):e,n}}if(we(i)){const{ref:e,modifiers:t,...r}=i,n={...r};return n.derive={...void 0!==e?{ref:e}:{},modifiers:ke(t,s)},n}const{base:n,...o}=i,a={...o};if(void 0!==n&&(a.base=Array.isArray(n)||!r.coerceValue?n:r.coerceValue(n)),void 0===a.base&&!a.derive&&!Object.keys(o).length)throw new e("REFRACT_E_MODE",`Appearance mode "${s}" overrides nothing.`);return a})()}})(t,r)):void 0,b=he(s,{propertyPath:r.propertyPath,allowedBreakpoints:r.allowedBreakpoints}),v=(null===(n=r.leafFields)||void 0===n?void 0:n.length)?b.map(e=>((e,t)=>{const r={},n={};let o;for(const[t,i]of Object.entries(e))$e.has(t)?r[t]=i:"base"===t?o=i:n[t]=i;const i=t.leafFields.some(e=>e in n);if(void 0===o&&!i)return e;const{base:s,extra:a}=je(o,n,void 0,t);return{...r,...a,base:s}})(e,r)):b;return{...f,base:d,responsive:v,variants:u,modes:p}},_e=["orientation","height","aspectRatio"],Se=(e,t)=>!t||(Array.isArray(t)?t.includes(e):t.has(e)),Ce=e=>e?` for "${e}"`:"",Te="responsive",Fe="states",Ne="css",ze="variants",Pe=e=>Array.isArray(e)?e:e&&"object"==typeof e?Object.entries(e).map(([e,t])=>({state:e,...t})):[],qe=e=>{var t;return`${e.state}\0${null!==(t=e.target)&&void 0!==t?t:""}`},Ie=(e,t)=>{const r=Pe(e).map(e=>({...e})),n=new Map(r.map((e,t)=>[qe(e),t]));for(const e of Pe(t)){const t=qe(e),o=n.get(t);void 0!==o?r[o]={...r[o],...e}:(n.set(t,r.length),r.push({...e}))}return r},Ve=(e,t)=>{var r,n;const o={...e};for(const[i,s]of Object.entries(t))null!==s?i===Te?o[Te]=[...null!==(r=e[Te])&&void 0!==r?r:[],...s]:i===Fe?o[Fe]=Ie(e[Fe],s):i===Ne?o[Ne]={...null!==(n=e[Ne])&&void 0!==n?n:{},...s}:o[i]=s:delete o[i];return o},Be=(t,r={})=>{const n=((t,r)=>{if(!Object.values(t).some(e=>null!=e&&"object"==typeof e&&null!=e[ze]))return t;const n={},o=(t,o)=>{if(t in n)throw new e("REFRACT_E_VARIANT",`Recipe variant expansion${Ce(r)} produced a duplicate recipe name "${t}" — a desugared "<recipe>-<variant>" collides with an existing sibling recipe.`);n[t]=o};for(const[e,r]of Object.entries(t)){const{[ze]:t,...n}=r;if(o(e,n),null!=t){const r=null!=n[Fe]?{...n,[Fe]:Pe(n[Fe]).filter(e=>!e.target)}:n;for(const[n,i]of Object.entries(t))o(`${e}-${n}`,Ve(r,i))}}return n})(t,r.propertyPath),o=Object.keys(n),i=o.length?new Set(o):void 0,s={};return o.forEach(e=>{var t;const o=n[e];s[e]=Me(`${null!==(t=r.propertyPath)&&void 0!==t?t:"recipes"}.${e}`,o,{allowedBreakpoints:r.allowedBreakpoints,allowedStates:r.allowedStates,allowedTargets:i,allowedVariants:i,allowedContainers:r.allowedContainers,recipeName:e})}),s},Me=(e,t,r)=>{const{responsive:n,states:o,...i}=t;return{base:i,responsive:[...Le(o,e,r),...Ue(n,e,r)]}},Le=(t,r,n)=>Pe(t).map(t=>{const{state:o,...i}=t;if(n.allowedStates&&!Se(o,n.allowedStates))throw new e("REFRACT_E_STATE",`Recipe state entry${Ce(r)} references unknown state "${o}".`);if(i.target&&n.allowedTargets){const t=n.recipeName?`${n.recipeName}-${i.target}`:i.target;if(!Se(t,n.allowedTargets))throw new e("REFRACT_E_RESPONSIVE",`Recipe state entry${Ce(r)} references unknown target "${i.target}".`)}return{...i,state:o}}),Ue=(t,r,n)=>(null==t?void 0:t.length)?t.map(t=>{var o;if(void 0!==t.variant&&void 0!==t.target)throw new e("REFRACT_E_RESPONSIVE",`Responsive entry${Ce(r)} cannot set both "variant" and "target".`);if(void 0!==t.container)return Ye(t,r,n);if(!t.breakpoint)throw new e("REFRACT_E_BREAKPOINT",`Responsive recipe entry${Ce(r)} is missing a "breakpoint" value.`);if(n.allowedBreakpoints&&!Se(t.breakpoint,n.allowedBreakpoints))throw new e("REFRACT_E_BREAKPOINT",`Responsive recipe entry${Ce(r)} references unknown breakpoint "${t.breakpoint}".`);if(t.state&&n.allowedStates&&!Se(t.state,n.allowedStates))throw new e("REFRACT_E_STATE",`Responsive recipe entry${Ce(r)} references unknown state "${t.state}".`);if(t.variant&&!Se(t.variant,n.allowedVariants))throw new e("REFRACT_E_RESPONSIVE",`Responsive recipe entry${Ce(r)} references unknown variant "${t.variant}".`);if(t.target&&!Se(t.target,n.allowedTargets))throw new e("REFRACT_E_RESPONSIVE",`Responsive recipe entry${Ce(r)} references unknown target "${t.target}".`);return{...t,query:null!==(o=t.query)&&void 0!==o?o:"exact"}}):[],Ye=(t,r,n)=>{var o,i;const s=t.container;for(const n of _e)if(void 0!==t[n])throw new e("REFRACT_E_CONTAINER",`Container recipe entry${Ce(r)} cannot use "${n}" — container queries respond to a container's inline size, not orientation/height/aspect-ratio.`);const a=null===(o=n.allowedContainers)||void 0===o?void 0:o.get(s);if(n.allowedContainers&&!a)throw new e("REFRACT_E_CONTAINER",`Container recipe entry${Ce(r)} references unknown container "${s}".`);if(void 0===t.size)throw new e("REFRACT_E_CONTAINER",`Container recipe entry${Ce(r)} for container "${s}" is missing a "size" value.`);if(a&&!a.has(t.size))throw new e("REFRACT_E_CONTAINER",`Container recipe entry${Ce(r)} references unknown size "${t.size}" on container "${s}".`);return{...t,query:null!==(i=t.query)&&void 0!==i?i:"min"}},He=(t,r,n={})=>{var o;const i=new Map,s=[],a=null!==(o=n.groupPath)&&void 0!==o?o:"recipes",l=n=>{if(i.has(n))return i.get(n);if(s.includes(n)){const t=[...s,n].join(" -> ");throw new e("REFRACT_E_CYCLE",`Cyclic recipe reference in "${a}": ${t}`)}const o=t[n];if(!o)throw new e("REFRACT_E_REFERENCE",`Recipe variant "${n}" is not defined in "${a}".`);s.push(n);try{const e=r(n,o,l);return i.set(n,e),e}finally{s.pop()}};return{resolve:l,resolveAll:()=>{const e={};for(const r of Object.keys(t))e[r]=l(r);return e}}},Je=t=>{const r={};for(const n of t)for(const[t,o]of Object.entries(n)){if(t in r)throw new e("REFRACT_E_TOKEN_PATH",`Duplicate derivation fn "${t}" registered by two subsystems.`);r[t]=o}return r},We=(t,r,n,o=new Map,i=new Set)=>{const s=o.get(n);if(void 0!==s)return s;const a=t[n];if(!a)throw new e("REFRACT_E_TOKEN_PATH",`Unknown token path "${n}".`);if(void 0!==a.external){const e=`var(${a.external})`;return o.set(n,e),e}if(void 0===a.ref){if(void 0===a.value)throw new e("REFRACT_E_TOKEN_PATH",`Token "${n}" has neither "ref" nor "value".`);return o.set(n,a.value),a.value}if(i.has(n))throw new e("REFRACT_E_CYCLE",`Cyclic token reference: ${[...i,n].join(" -> ")}`);i.add(n);const l=We(t,r,a.ref,o,i);let c;if(void 0!==a.modifiers)c=a.modifiers.reduce((t,o)=>{const i=r[o.fn];if(!i)throw new e("REFRACT_E_TOKEN_PATH",`Unknown derivation fn "${o.fn}" for token "${n}".`);return i(t,o.arg)},l);else if(void 0!==a.fn){const t=r[a.fn];if(!t)throw new e("REFRACT_E_TOKEN_PATH",`Unknown derivation fn "${a.fn}" for token "${n}".`);c=t(l,a.arg)}else c=l;return i.delete(n),o.set(n,c),c},De=(e,t)=>{const r=new Map,n={};for(const o of Object.keys(e))n[o]=We(e,t,o,r);return n},Ge=(e,t)=>!!(null==e?void 0:e.ref)&&((void 0!==e.modifiers||void 0!==e.fn)&&(e=>{const[t,r]=e.split(".");return`${t}.${r}`})(e.ref)!==t),Ke=(t,r,n,o,i)=>{let s;try{s=We(r,n,t.ref,o)}catch{throw new e("REFRACT_E_VALIDATION",`${i}: cross-property derivation references unknown token '${t.ref}'.`)}const a=(t,r)=>{const o=n[t];if(!o)throw new e("REFRACT_E_VALIDATION",`${i}: unknown derivation fn '${t}'.`);return o(s,r)};if(void 0!==t.modifiers)for(const e of t.modifiers)s=a(e.fn,e.arg);else void 0!==t.fn&&(s=a(t.fn,t.arg));return{...t,value:s}},Xe=(e,t,r,n,o,i)=>{let s;for(const[a,l]of Object.entries(e))Ge(l,t)&&(s=null!=s?s:{...e},s[a]=Ke(l,r,n,o,`${i}.${a}`));return s},Ze=(e,t,r,n,o)=>{const i=e.variants?((e,t,r,n,o)=>{let i;for(const[s,a]of Object.entries(e)){const l=`${t}.variants.${s}`,c=Ge(a.base,t)?Ke(a.base,r,n,o,l):a.base,d=a.extras?Xe(a.extras,t,r,n,o,`${l} extra`):void 0;(c!==a.base||d)&&(i=null!=i?i:{...e},i[s]=d?{base:c,extras:d}:{...a,base:c})}return i})(e.variants,t,r,n,o):void 0;let s;if(e.modes)for(let i=0;i<e.modes.length;i++){const a=e.modes[i];if(!a.overrides)continue;const l=Xe(a.overrides,t,r,n,o,`${t}.modes.${a.mode}`);l&&(s=null!=s?s:[...e.modes],s[i]={...a,overrides:l})}if(!i&&!s)return;const a={...e};return i&&(a.variants=i),s&&(a.modes=s),a},Qe=(e,t)=>{var r;const n=P(e),o=new Map;let i=!1;const s={};for(const[a,l]of Object.entries(e.subsystems)){let e,c=!1;for(const[i,s]of Object.entries(null!==(r=l.properties)&&void 0!==r?r:{})){const r=Ze(s,`${a}.${i}`,n,t,o);r&&(e=null!=e?e:{...l.properties},e[i]=r,c=!0)}c?(s[a]={...l,properties:e},i=!0):s[a]=l}return i?{...e,subsystems:s}:e},et={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},tt=e=>Math.round(1e3*Math.min(1,Math.max(0,e)))/1e3,rt=(e,t,r)=>{const n=(e%360+360)%360/60,o=(1-Math.abs(2*Math.min(1,Math.max(0,r))-1))*Math.min(1,Math.max(0,t)),i=o*(1-Math.abs(n%2-1)),s=Math.min(1,Math.max(0,r))-o/2,[a,l,c]=n<1?[o,i,0]:n<2?[i,o,0]:n<3?[0,o,i]:n<4?[0,i,o]:n<5?[i,0,o]:[o,0,i];return[255*(a+s),255*(l+s),255*(c+s)]},nt=/^oklch\(\s*([\d.]+)(%?)\s+([\d.]+)\s+([\d.]+)(?:deg)?\s*(?:\/\s*([\d.]+)(%?)\s*)?\)$/i,ot=/^hsla?\(\s*([\d.]+)(?:deg)?\s*[, ]\s*([\d.]+)%\s*[, ]\s*([\d.]+)%\s*(?:[,/]\s*([\d.]+)(%?)\s*)?\)$/i,it=i=>{if("string"==typeof i){const s=(e=>{const t=e.trim(),i=nt.exec(t);if(i){const e="%"===i[2]?Number(i[1]):100*Number(i[1]),t=void 0===i[5]?1:tt("%"===i[6]?Number(i[5])/100:Number(i[5]));return{rgb:r({L:e,C:Number(i[3]),h:Number(i[4])}),a:t}}const s=ot.exec(t);if(s){const e=void 0===s[4]?1:tt("%"===s[5]?Number(s[4])/100:Number(s[4]));return{rgb:rt(Number(s[1]),Number(s[2])/100,Number(s[3])/100),a:e}}const a=et[t.toLowerCase()];if(a)return{rgb:n(a),a:1};try{return o(t)}catch{return null}})(i);if(!s)throw new e("REFRACT_E_COLOR_INPUT",`Invalid colour "${i}". Author a colour as a hex string ("#4dabf7"), an [r, g, b] tuple, or a CSS colour — oklch(), hsl()/hsla(), rgb()/rgba(), or a named keyword (e.g. "rebeccapurple"). A var(--…) can't be tonally derived at build time.`);return t(s.rgb,s.a)}if(!Array.isArray(i)||3!==i.length||i.some(e=>"number"!=typeof e))throw new e("REFRACT_E_COLOR_TUPLE",`Invalid colour tuple ${JSON.stringify(i)}. Use an [r, g, b] tuple with 0–255 channels (alpha comes from an \`alpha\` variant, not the base).`);const[s,a,l]=i;return t([s,a,l])},st={lighten:(e,t)=>a(e,Number(t)),darken:(e,t)=>l(e,Number(t)),alpha:(e,t)=>c(e,Number(t)),setL:(e,t)=>s(e,Number(t)),rotateHue:(e,t)=>i(e,Number(t)),adjust:(e,t)=>d(e,t)},at=["light","lighter"],lt=["dark","darker"],ct=(e,t)=>{if(!e||!e.includes("."))return!1;const[r,n]=e.split(".");return`${r}.${n}`!=`colors.${t}`},dt=(t,r)=>{try{return it(t)}catch(t){throw new e("REFRACT_E_COLOR_INPUT",`colors.${r}.text — ${t.message}`)}},ft=(t,r,n={})=>{var i;const s=((e,t)=>{let r=t;if(void 0!==t.text&&(r={...r,text:dt(t.text,e)}),t.variants){let n=!1;const o={};for(const[r,i]of Object.entries(t.variants))void 0!==i.text?(o[r]={...i,text:dt(i.text,`${e}.variants.${r}`)},n=!0):o[r]=i;n&&(r={...r,variants:o})}if(t.modes){let n=!1;const o=t.modes.map(t=>void 0!==t.text?(n=!0,{...t,text:dt(t.text,`${e}.modes.${t.mode}`)}):t);n&&(r={...r,modes:o})}return r})(t,r),a=(e=>{try{return o(e),!0}catch{return!1}})(s.base),l=!(!s.steps||!s.steps.length),c=Object.keys(n).length>0,d=void 0!==s.harmony;if((l||c||d)&&!a)throw new e("REFRACT_E_STEPS",`colors.${t} declares derived steps/variants but its base "${s.base}" is not a hex or [r,g,b] colour.`);const f=a?bt(s,t):{},u=a?mt(s,t):{},p=null!==(i=s.variants)&&void 0!==i?i:{},b={...f,...u,...p},v=$t(t,s.base,b,n),m={...f,...u,...p,...v},g=pt(s,t,m),h=ut(s,t,m);return Object.keys(m).length||g||h?{...s,...Object.keys(m).length?{variants:m}:{},...g?{modes:g}:{},...h?{responsive:h}:{}}:s},ut=(t,r,n)=>{const o=t.responsive;if(!o||!o.length)return;let i=!1;const s=o.map((t,o)=>{const s=t.ref,a=t.modifiers;if(!s||!Array.isArray(a)||!a.length){let e;for(const r of["base","text"]){const n=t[r];if("string"==typeof n||Array.isArray(n)){const o=it(n);o!==n&&(e=null!=e?e:{...t},e[r]=o)}}return e&&(i=!0),null!=e?e:t}const l=n[s];if(!l)throw new e("REFRACT_E_VARIANT_REF",`colors.${r}.responsive[${o}] references unknown variant "${s}".`);if(void 0===l.base)throw new e("REFRACT_E_VARIANT_REF",`colors.${r}.responsive[${o}] references "${s}", a cross-property derivation — not supported.`);const c=kt({modifiers:a},r,`responsive[${o}]`);let d=l.base;for(const e of c)d=st[e.fn](d,e.arg);i=!0;const{ref:f,modifiers:u,...p}=t;return{...p,base:d,derive:{ref:`colors.${r}.${s}`,modifiers:c}}});return i?s:o},pt=(t,r,n)=>{const o=t.modes;if(!o||!o.length)return;return o.map(o=>{var i;const s=o.mode,a=o.derive;if(!a)return o;const l=null!==(i=a.modifiers)&&void 0!==i?i:a.fn?[{fn:a.fn,arg:a.arg}]:[];if(ct(a.ref,r)){const{base:e,derive:t,...r}=o;return{...r,derive:{ref:a.ref,modifiers:l}}}const c=((o,i)=>{if(!o||o===`colors.${r}`)return{value:t.base,path:`colors.${r}`};const s=o.includes(".")?o.slice(`colors.${r}.`.length):o,a=n[s];if(!a||void 0===a.base)throw new e("REFRACT_E_VARIANT_REF",`colors.${r}.modes.${i} references unknown variant "${o}".`);return{value:a.base,path:`colors.${r}.${s}`}})(a.ref,s);let d=c.value;for(const t of l){const n=st[t.fn];if(!n)throw new e("REFRACT_E_VARIANT_REF",`Unknown derivation fn "${t.fn}" for appearance mode "colors.${r}.modes.${s}".`);d=n(d,t.arg)}return{...o,base:d,derive:{ref:c.path,modifiers:l}}})},bt=(e,t)=>e.steps&&e.steps.length?wt(e,t):ht(e,t),vt={complement:[{name:"complement",deg:180}],analogous:[{name:"analogous1",deg:-30},{name:"analogous2",deg:30}],"split-complement":[{name:"split1",deg:150},{name:"split2",deg:210}],triadic:[{name:"triadic1",deg:120},{name:"triadic2",deg:240}],tetradic:[{name:"tetradic1",deg:90},{name:"complement",deg:180},{name:"tetradic2",deg:270}]},mt=(t,r)=>{const n=t.harmony;if(void 0===n)return{};let o,s;if("string"==typeof n)o=n;else{if("object"!=typeof n||null===n||Array.isArray(n))throw new e("REFRACT_E_HARMONY",`colors.${r}.harmony must be a scheme name or a { scheme: [names] } object.`);{const t=Object.keys(n);if(1!==t.length)throw new e("REFRACT_E_HARMONY",`colors.${r}.harmony object form must name exactly one scheme; got [${t.join(", ")}].`);o=t[0],s=n[o]}}const a=vt[o];if(!a)throw new e("REFRACT_E_HARMONY",`colors.${r}.harmony: unknown scheme "${o}". Use one of ${Object.keys(vt).join(", ")}.`);const l={};return a.forEach((e,n)=>{var o;const a=null!==(o=null==s?void 0:s[n])&&void 0!==o?o:e.name;l[a]={base:i(t.base,e.deg),derive:{ref:`colors.${r}`,fn:"rotateHue",arg:e.deg}}}),l},gt=(e,t,r,n,o,i,s,a)=>{var l;const c=e=>e?`colors.${r}.${e}`:`colors.${r}`;let d,f=t.base;for(const t of o){if(void 0!==(null===(l=n[t])||void 0===l?void 0:l.base)){f=n[t].base,d=t;continue}const r=i(f,a);e[t]={base:r,derive:{ref:c(d),fn:s,arg:a}},f=r,d=t}},ht=(e,t)=>{var r,n,o;const i=null!==(r=e.variants)&&void 0!==r?r:{},s={},c=null!==(n=e.lightenBy)&&void 0!==n?n:10,d=null!==(o=e.darkenBy)&&void 0!==o?o:10;return gt(s,e,t,i,at,a,"lighten",c),gt(s,e,t,i,lt,l,"darken",d),s},yt=e=>e<=0?100:e>=1e3?0:Math.min(98,Math.max(5,(1e3-e)/10)),wt=(t,r)=>{var n,o;const i=null!==(n=t.steps)&&void 0!==n?n:[],a=i.find(e=>"number"!=typeof e||isNaN(e)||e<0||e>1e3);if(void 0!==a)throw new e("REFRACT_E_STEPS",`colors.${r}.steps must be numbers in 0–1000 (e.g. [50, …, 950]); got ${JSON.stringify(a)}.`);const l=null!==(o=t.variants)&&void 0!==o?o:{},c={};for(const e of i){const n=e.toString();if(l[n])continue;const o=yt(e);c[n]={base:s(t.base,o),derive:{ref:`colors.${r}`,fn:"setL",arg:o}}}return c},kt=(t,r,n)=>{const o=`colors.${r}.variants.${n}`,i=t.modifiers;if(!Array.isArray(i)||0===i.length)throw new e("REFRACT_E_VARIANT",`${o} needs a non-empty "modifiers" array (e.g. [{ darken: 10 }]).`);return i.map((t,i)=>{if("object"!=typeof t||null===t||Array.isArray(t))throw new e("REFRACT_E_VARIANT",`${o}.modifiers[${i}] must be a single-key object like { darken: 10 }.`);const s=Object.keys(t);if(1!==s.length)throw new e("REFRACT_E_VARIANT",`${o}.modifiers[${i}] must have exactly one fn key; got [${s.join(", ")}].`);const a=s[0];if(!st[a])throw new e("REFRACT_E_VARIANT",`${o}.modifiers[${i}] unknown fn "${a}"; use ${Object.keys(st).join(" / ")}.`);const l=t[a],c="adjust"===a?((t,r,n)=>{const o=`colors.${r}.variants.${n}.adjust`;if("object"!=typeof t||null===t||Array.isArray(t))throw new e("REFRACT_E_ADJUST",`${o} must be an object with numeric l / c / h dials.`);const{l:i,c:s,h:a}=t,l={};if(void 0!==i){if("number"!=typeof i||isNaN(i)||i<0||i>100)throw new e("REFRACT_E_ADJUST",`${o}.l must be an absolute OKLCH lightness in 0–100; got ${JSON.stringify(i)}.`);l.l=i}if(void 0!==s){if("number"!=typeof s||isNaN(s)||s<0)throw new e("REFRACT_E_ADJUST",`${o}.c must be a non-negative chroma multiplier (1 keeps, 0 greys); got ${JSON.stringify(s)}.`);l.c=s}if(void 0!==a){if("number"!=typeof a||isNaN(a))throw new e("REFRACT_E_ADJUST",`${o}.h must be a numeric hue rotation in degrees; got ${JSON.stringify(a)}.`);l.h=a}return l})(l,r,n):Number(l);return{fn:a,arg:c}})},$t=(t,r,n,o)=>{const i={},s=new Set,a=(r,n)=>{if(void 0===r.base)throw new e("REFRACT_E_VARIANT_REF",`colors.${t} variant chains off "${n}", which is a cross-property derivation — not supported.`);return r.base};function l(c,d){if(i[c])return;if(s.has(c))throw new e("REFRACT_E_CYCLE",`Cyclic colour variant derivation at colors.${t}.${c}.`);s.add(c);const f=kt(d,t,c);if(ct(d.ref,t))return i[c]={derive:{ref:d.ref,modifiers:f}},void s.delete(c);const u=(s=>{if(!s)return{value:r,path:`colors.${t}`};if(i[s])return{value:a(i[s],s),path:`colors.${t}.${s}`};if(n[s])return{value:a(n[s],s),path:`colors.${t}.${s}`};if(o[s])return l(s,o[s]),{value:a(i[s],s),path:`colors.${t}.${s}`};throw new e("REFRACT_E_VARIANT_REF",`colors.${t} variant references unknown source "${s}".`)})(d.ref);let p=u.value;for(const e of f)p=st[e.fn](p,e.arg);i[c]={base:p,derive:{ref:u.path,modifiers:f}},s.delete(c)}for(const[e,t]of Object.entries(o))l(e,t);return i},xt=new Set(["breakpoint","query","state","variant","target","orientation"]),Rt=(t,r,n)=>{const o={};if(!t)return o;for(const[i,s]of Object.entries(t)){if(void 0===s||xt.has(i))continue;if(!p(i))throw new e("REFRACT_E_RECIPE_PROPERTY",`Unknown recipe property "${i}" in ${n} — expected a CSS property or a reserved key (variant, target, state, breakpoint, query, orientation, container, size).`);const t=Et(s,r,n,i);void 0!==t&&(o[jt(i)]=t)}return o},Et=(t,r,n,o)=>{var i;if("number"==typeof t)return{value:t};const s=t.trim();if(!s)return;const a=s.split("."),l=a[0],c=r.properties[l];if(!c)return{value:s};const d=a.length>1?a.slice(1).join("."):void 0;if(!d)return{ref:`colors.${l}`};if("text"===d)return{ref:`colors.${l}.text`};if(!(null===(i=c.variants)||void 0===i?void 0:i[d]))throw new e("REFRACT_E_VARIANT_REF",`Unknown palette variant reference "${l}.${d}" in ${n}.${o}.`);return{ref:`colors.${l}.${d}`}},jt=e=>e.startsWith("--")?e:e.replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),At=new Set(["recipes"]),Ot=e=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!("base"in e)&&Array.isArray(e.modifiers),_t=e=>{if("object"!=typeof e||null===e||Array.isArray(e)||!e.variants)return{value:e,specs:{}};const t=e.variants,r={},n={};for(const[e,o]of Object.entries(t))Ot(o)?r[e]=o:n[e]=o;if(!Object.keys(r).length)return{value:e,specs:r};const o=Object.keys(n).length?n:void 0;return{value:{...e,variants:o},specs:r}},St={key:"colors",derivations:{lighten:(e,t)=>a(String(e),Number(t)),darken:(e,t)=>l(String(e),Number(t)),alpha:(e,t)=>c(String(e),Number(t)),setL:(e,t)=>s(String(e),Number(t)),rotateHue:(e,t)=>i(String(e),Number(t)),adjust:(e,t)=>d(String(e),t)},normalizeProperties(e,t){const r={};if(!e)return r;for(const[n,o]of Object.entries(e)){if(At.has(n))continue;const{value:e,specs:i}=_t(o),s=Oe(e,{propertyPath:`colors.${n}`,allowedBreakpoints:t.allowedBreakpoints,coerceValue:it}),a=ft(n,s,i);ye(a,{propertyPath:`colors.${n}`}),r[n]=a}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>{const n=`${r.groupPath}.${e}`;return{base:Rt(t.base,r,n),responsive:t.responsive.map(e=>{const{breakpoint:t,query:o,state:i,variant:s,target:a,orientation:l,container:c,size:d,...f}=e,u={declarations:{...s?{...r.resolveRecipeVariant(s).base}:{},...Rt(f,r,`${n}.responsive`)}};return t&&(u.breakpoint=t,u.query=null!=o?o:"exact"),c&&(u.container=c,d&&(u.size=d),u.query=null!=o?o:"min"),i&&(u.state=i),l&&(u.orientation=l),a&&(u.target=a),u})}})(e,t,r)},Ct={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618},Tt={xs:-2,sm:-1,md:0,lg:1,xl:2,"2xl":3,"3xl":4,"4xl":5},Ft=(e,t)=>"fontSize"!==e?t:Nt(t),Nt=e=>{var t,r,n,o;const i=e.ratio;if(!i)return e;const s=Ct[i];if(!s)return e;const a=null!==(t=e.baseFontSize)&&void 0!==t?t:e.base,l=null!==(r=e.precision)&&void 0!==r?r:4,c=e.algorithm,d=null!==(n=e.variants)&&void 0!==n?n:{},f={};let u=null;for(const[e,t]of Object.entries(Tt)){if(d[e]){u=null!==(o=d[e].base)&&void 0!==o?o:null;continue}let r;r=c?c(a,e,t,u):a*Math.pow(s,t);const n=Number(r.toFixed(l));u=n,f[e]={base:n}}return{...e,variants:{...f,...d}}},zt=new Set(["breakpoint","query","state","variant","target","orientation"]),Pt={fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",lineHeight:"line-height",letterSpacing:"letter-spacing",fontStyle:"font-style",textTransform:"text-transform",textDecoration:"text-decoration",textAlign:"text-align"},qt=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e)){if(!n||zt.has(r))continue;const e=Pt[r];e&&(t[e]={ref:It(r,n)})}return t},It=(e,t)=>"base"===t?`typography.${e}`:`typography.${e}.${t}`,Vt=new Set(["recipes"]),Bt={key:"typography",normalizeProperties(e,t){const r={};if(!e)return r;for(const[n,o]of Object.entries(e)){if(Vt.has(n))continue;const e=Oe(o,{propertyPath:`typography.${n}`,allowedBreakpoints:t.allowedBreakpoints}),i=Ft(n,e);ye(i,{propertyPath:`typography.${n}`}),r[n]=i}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>({base:qt(t.base),responsive:t.responsive.map(e=>{const{breakpoint:t,query:n,state:o,variant:i,target:s,orientation:a,container:l,size:c,...d}=e,f={declarations:{...i?{...r.resolveRecipeVariant(i).base}:{},...qt(d)}};return t&&(f.breakpoint=t,f.query=null!=n?n:"exact"),l&&(f.container=l,c&&(f.size=c),f.query=null!=n?n:"min"),o&&(f.state=o),s&&(f.target=s),a&&(f.orientation=a),f})}))(0,t,r)},Mt=["spacing","gutters","aspectRatio","sizes"],Lt=new Set(["spacing","gutters","sizes"]),Ut=new Set(["spacing","gutters"]),Yt=["xs","sm","md","lg","xl","2xl","3xl","4xl"],Ht=e=>Number(e.toFixed(4)),Jt=(t,r)=>{var n;if(!Lt.has(t))return r;const o=((t,r)=>{const n=r,o=void 0!==n.ratio,i=void 0!==n.step;if(!o&&!i)return;if(o&&i)throw new e("REFRACT_E_LAYOUT",`layout.${t}: declare only one of "ratio" (geometric) or "step" (linear) scale, not both.`);const s=n.steps;if(o){let r;if(void 0===s)r=Yt;else{if(!Array.isArray(s))throw new e("REFRACT_E_LAYOUT",`layout.${t}: a geometric scale ("ratio") needs "steps" as an ordered name array, e.g. ["sm","md","lg"].`);r=s.map(String)}const o=r.map((e,t)=>({name:e,exp:t}));return{curve:"geometric",ratio:Number(n.ratio),specs:o}}let a;if(void 0===s)a=Yt.map((e,t)=>({name:e,exp:t,mult:t+1}));else{if(Array.isArray(s)||"object"!=typeof s||null===s)throw new e("REFRACT_E_LAYOUT",`layout.${t}: a linear scale ("step") needs "steps" as a name→multiplier map, e.g. { sm:1, md:2, lg:3 }.`);a=Object.entries(s).map(([e,t],r)=>({name:e,exp:r,mult:Number(t)}))}return{curve:"linear",step:Number(n.step),specs:a}})(t,r);if(!o)return Ut.has(t)?Wt(r):r;const i=((e,t,r)=>{const n=`layout.${e}`,o={};for(const e of r.specs)if("geometric"===r.curve){const i=Ht(Number(t)*Math.pow(r.ratio,e.exp));o[e.name]={base:i,derive:{ref:n,fn:"scaleStep",arg:{curve:"geometric",ratio:r.ratio,exp:e.exp}}}}else{const t=Ht(r.step*e.mult);o[e.name]={base:t,derive:{ref:n,fn:"scaleStep",arg:{curve:"linear",step:r.step,mult:e.mult}}}}return o})(t,r.base,o);let s={...i,...null!==(n=r.variants)&&void 0!==n?n:{}};Ut.has(t)&&(s={...s,none:{base:0}});const a=((t,r,n,o)=>{if(!(null==n?void 0:n.length))return n;const i=`layout.${t}`,s=[];let a=!1;for(const l of n){const n=l;if(void 0===n.ratio&&void 0===n.step){s.push(n);continue}if(a=!0,void 0!==n.ratio&&void 0!==n.step)throw new e("REFRACT_E_LAYOUT",`layout.${t}: a responsive ramp entry may set only "ratio" or "step", not both.`);if(!o)throw new e("REFRACT_E_LAYOUT",`layout.${t}: a responsive ramp entry needs a base scale — declare a top-level "ratio"/"step" (+ "steps") first.`);const{breakpoint:c,query:d,orientation:f}=n,u=void 0!==n.ratio;for(const a of o.specs){let o,l;if(u){const e=Number(n.ratio),t=void 0!==n.base,i=Number(t?n.base:r);o=Ht(i*Math.pow(e,a.exp)),l={curve:"geometric",ratio:e,exp:a.exp,...t?{base:i}:{}}}else{if(void 0===a.mult)throw new e("REFRACT_E_LAYOUT",`layout.${t}: a linear responsive ramp ("step") requires a linear base scale (a name→multiplier "steps").`);const r=Number(n.step);o=Ht(r*a.mult),l={curve:"linear",step:r,mult:a.mult}}const p={breakpoint:c,query:d,target:a.name,base:o,derive:{ref:i,fn:"scaleStep",arg:l}};void 0!==f&&(p.orientation=f),s.push(p)}}return a?s:n})(t,r.base,r.responsive,o);return(e=>{const{ratio:t,step:r,steps:n,...o}=e;return o})({...r,variants:s,responsive:a})},Wt=e=>{var t;const r=null!==(t=e.variants)&&void 0!==t?t:{};return{...e,variants:{...r,none:{base:0}}}},Dt=new Set(["breakpoint","query","state","variant","target","orientation"]),Gt={paddingY:["padding-top","padding-bottom"],paddingX:["padding-left","padding-right"],marginY:["margin-top","margin-bottom"],marginX:["margin-left","margin-right"],gap:["gap"],background:["background"],width:["width"],minWidth:["min-width"],maxWidth:["max-width"],height:["height"],minHeight:["min-height"],maxHeight:["max-height"]},Kt={paddingY:"spacing",paddingX:"spacing",marginY:"spacing",marginX:"spacing",gap:"spacing",width:"sizes",minWidth:"sizes",maxWidth:"sizes",height:"sizes",minHeight:"sizes",maxHeight:"sizes",background:"literal"},Xt=(e,t)=>"base"===t?`layout.${e}`:`layout.${e}.${t}`,Zt=(t,r)=>{const n={};if(!t)return n;for(const[o,i]of Object.entries(t)){if(Dt.has(o))continue;if(!i)continue;const t=Gt[o];if(!t)throw new e("REFRACT_E_LAYOUT",`Unknown layout recipe property "${o}" in ${r}. Known verbs: ${Object.keys(Gt).join(", ")}. For arbitrary CSS use a component \`css\` delta.`);const s=Kt[o];for(const e of t)n[e]="literal"===s?{value:i}:{ref:Xt(s,i)}}return n},Qt=e=>({ref:"base"===e?"layout.spacing":`layout.spacing.${e}`}),er=e=>({ref:"base"===e?"layout.gutters":`layout.gutters.${e}`}),tr=e=>({ref:`layout.${e}`}),rr=e=>({value:e}),nr=e=>Object.keys(e).sort((t,r)=>e[t]-e[r]),or=[["templateColumns","grid-template-columns"],["templateRows","grid-template-rows"],["autoRows","grid-auto-rows"],["autoColumns","grid-auto-columns"],["justifyItems","justify-items"],["alignItems","align-items"],["justifyContent","justify-content"],["alignContent","align-content"]],ir=(e,t)=>{const r={};t&&(r.display=rr("grid"));for(const[t,n]of or){const o=e[t];o&&(r[n]=rr(o))}return e.gap&&(r.gap=Qt(e.gap)),r},sr=e=>{var t,r;if(!e||"string"==typeof e)return{mode:null!==(t=e)&&void 0!==t?t:"fixed"};const n=e;return{mode:null!==(r=n.base)&&void 0!==r?r:"fixed",inset:n.inset,gutter:n.gutter,direction:n.direction,align:n.align,justify:n.justify,maxWidth:n.maxWidth}},ar=(e,t,r=new Set,n)=>{var o,i,s,a;const l=H(n),c=e=>J(e,l),d={},f={},u=nr(t),p=e&&"object"==typeof e?e:void 0,b=p?{mode:null!==(o=p.base)&&void 0!==o?o:"fixed",inset:p.inset,gutter:p.gutter,direction:p.direction,align:p.align,justify:p.justify,maxWidth:p.maxWidth}:sr(null!=e?e:"fixed"),v=null!==(i=null==p?void 0:p.variants)&&void 0!==i?i:{},m=null!==(s=null==p?void 0:p.responsive)&&void 0!==s?s:[],g=e=>e?`container-${e}`:"container",h=(e,n)=>{var o,i,s,a,l,p,v,m,h;const y=e?`--${e}`:"",w=`container${y}--inset`,k=`container${y}--gutter`,$=null!==(i=null!==(o=n.inset)&&void 0!==o?o:b.inset)&&void 0!==i?i:"base",x=null!==(s=n.gutter)&&void 0!==s?s:b.gutter,R=null!==(l=null!==(a=n.mode)&&void 0!==a?a:b.mode)&&void 0!==l?l:"fixed",E=null!==(p=n.direction)&&void 0!==p?p:b.direction,j=null!==(v=n.align)&&void 0!==v?v:b.align,A=null!==(m=n.justify)&&void 0!==m?m:b.justify,O=null!==(h=n.maxWidth)&&void 0!==h?h:e?b.maxWidth:void 0;d[w]={base:Qt($)},x&&(d[k]={base:er(x)});const _={"box-sizing":rr("border-box"),width:rr("100%"),"margin-left":rr("auto"),"margin-right":rr("auto"),"padding-left":tr(w),"padding-right":tr(w)};x&&(_.gap=tr(k)),E&&(_.display=rr("flex"),_["flex-direction"]=rr(E)),j&&(_["align-items"]=rr(j)),A&&(_["justify-content"]=rr(A));const S=[];if("fixed"===R){const e="string"==typeof O&&void 0!==t[O]?O:void 0,r=e?u.indexOf(e):-1;for(let n=0;n<u.length;n++){const o=u[n],i=t[r>=0&&n>r?e:o];0!==i?0===n?_["max-width"]=rr(c(i)):S.push({breakpoint:o,query:"min",declarations:{"max-width":rr(c(i))}}):0===n&&(_["max-width"]=rr("none"))}}else"fluid"===R?void 0!==O&&(_["max-width"]=((e,t,r)=>{return"number"==typeof e?rr(`${e}px`):t.has(e)?{ref:"base"===(n=e)?"layout.sizes":`layout.sizes.${n}`}:void 0!==r[e]?rr(`${r[e]}px`):rr(e);var n})(O,r,t)):_["max-width"]=rr("number"==typeof R?`${R}px`:R);f[g(e)]={kind:"recipe",declarations:_,overrides:S}};h(null,b);for(const[e,t]of Object.entries(v))h(e,sr(t));for(const e of m){const t=e.target,r=g(null!=t?t:null),n=f[r];if(!n)continue;const o={};if(e.direction&&(o["flex-direction"]=rr(e.direction)),e.align&&(o["align-items"]=rr(e.align)),e.justify&&(o["justify-content"]=rr(e.justify)),e.inset){const e=t?`container--${t}--inset`:"container--inset";o["padding-left"]=tr(e),o["padding-right"]=tr(e)}if(e.gutter){const e=t?`container--${t}--gutter`:"container--gutter";o.gap=tr(e)}Object.keys(o).length&&n.overrides.push({breakpoint:e.breakpoint,query:null!==(a=e.query)&&void 0!==a?a:"exact",declarations:o})}return{ruleSetGroups:{container:f},configProperties:d}},lr=(e,t,r)=>{const n={},o={},i=e=>{e&&(Object.assign(n,e.ruleSetGroups),Object.assign(o,e.configProperties))};return i(((e,t)=>{var r,n;if(!e)return;const o="number"==typeof e?{size:e}:e,i=o.size,s=null!==(r=o.gutter)&&void 0!==r?r:"base",a=null!==(n=o.inset)&&void 0!==n?n:"none",l={"columns--size":{base:rr(String(i))},"columns--gutter":{base:er(s)},"columns--inset":{base:Qt(a)}},c={},d=Array.from({length:i},(e,t)=>t+1);for(const e of nr(t))for(const r of d){const n=`col-${e}-${r}`,o=`offset-${e}-${r}`,i={"grid-column-end":rr(`span ${r}`)},s={"grid-column-start":rr(String(r+1))};0===t[e]?(c[n]={kind:"utility",declarations:i,overrides:[]},c[o]={kind:"utility",declarations:s,overrides:[]}):(c[n]={kind:"utility",declarations:{},overrides:[{breakpoint:e,query:"min",declarations:i}]},c[o]={kind:"utility",declarations:{},overrides:[{breakpoint:e,query:"min",declarations:s}]})}return{ruleSetGroups:{columns:c},configProperties:l}})(e.columns,t)),i((e=>{var t,r;if(!e||!Object.keys(e).length)return;const n={};for(const[o,i]of Object.entries(e)){const e=ir(i,!0),s=[];for(const e of null!==(t=i.responsive)&&void 0!==t?t:[]){const t=ir(e,!1);Object.keys(t).length&&s.push({breakpoint:e.breakpoint,query:null!==(r=e.query)&&void 0!==r?r:"exact",declarations:t})}n[`grid-${o}`]={kind:"recipe",declarations:e,overrides:s}}return{ruleSetGroups:{grids:n},configProperties:{}}})(e.grids)),i((e=>{var t,r,n;if(!e||!Object.keys(e).length)return;const o={};for(const[i,s]of Object.entries(e)){const e={display:rr(s.inline?"inline-flex":"flex"),"flex-direction":rr(null!==(t=s.direction)&&void 0!==t?t:"column")};s.align&&(e["align-items"]=rr(s.align)),s.justify&&(e["justify-content"]=rr(s.justify)),s.wrap&&(e["flex-wrap"]=rr(s.wrap)),s.gap&&(e.gap=Qt(s.gap));const a=[];for(const e of null!==(r=s.responsive)&&void 0!==r?r:[]){const t={};void 0!==e.inline&&(t.display=rr(e.inline?"inline-flex":"flex")),e.direction&&(t["flex-direction"]=rr(e.direction)),e.align&&(t["align-items"]=rr(e.align)),e.justify&&(t["justify-content"]=rr(e.justify)),e.wrap&&(t["flex-wrap"]=rr(e.wrap)),Object.keys(t).length&&a.push({breakpoint:e.breakpoint,query:null!==(n=e.query)&&void 0!==n?n:"exact",declarations:t})}o[`stack-${i}`]={kind:"recipe",declarations:e,overrides:a}}return{ruleSetGroups:{stacks:o},configProperties:{}}})(e.stacks)),i(ar(e.container,t,(e=>{const t=new Set;if(e&&"object"==typeof e&&!Array.isArray(e)){const r=e;"base"in r&&t.add("base");const n=r.variants;if(n&&"object"==typeof n)for(const e of Object.keys(n))t.add(e)}return t})(e.sizes),r)),{ruleSetGroups:n,configProperties:o}},cr=new Set(Mt),dr={key:"layout",derivations:{scaleStep:(e,t)=>((e,t)=>{const r=null!=t?t:{};if("linear"===r.curve)return Ht(Number(r.step)*Number(r.mult));const n=void 0!==r.base?Number(r.base):Number(e);return Ht(n*Math.pow(Number(r.ratio),Number(r.exp)))})(e,t)},normalizeProperties(e,t){const r={};if(!e)return r;for(const n of Mt){const o=e[n];if(void 0===o||!cr.has(n))continue;const i=Oe(o,{propertyPath:`layout.${n}`,allowedBreakpoints:t.allowedBreakpoints}),s=Jt(n,i);ye(s,{propertyPath:`layout.${n}`}),r[n]=s}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>{var n;const o=`${null!==(n=r.groupPath)&&void 0!==n?n:"layout.recipes"}.${e}`;return{base:Zt(t.base,o),responsive:t.responsive.map(e=>{const{breakpoint:t,query:n,state:i,variant:s,target:a,orientation:l,container:c,size:d,...f}=e,u={declarations:{...s?{...r.resolveRecipeVariant(s).base}:{},...Zt(f,o)}};return t&&(u.breakpoint=t,u.query=null!=n?n:"exact"),c&&(u.container=c,d&&(u.size=d),u.query=null!=n?n:"min"),i&&(u.state=i),a&&(u.target=a),l&&(u.orientation=l),u})}})(e,t,r),buildStructural:(e,t)=>lr(e,t.breakpoints,t.mediaConfig)},fr=new Set(["breakpoint","query","state","variant","target","orientation"]),ur={boxShadow:"box-shadow",opacity:"opacity",blur:"filter",transition:"transition",zIndex:"z-index"},pr={boxShadow:"shadow",opacity:"opacity",blur:"blur",transition:"transitions",zIndex:"zIndex"},br=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e)){if(!n||fr.has(r))continue;const e=ur[r],o=pr[r];if(!e||!o)continue;const i={ref:vr(o,n)};"blur"===r&&(i.wrap="blur"),t[e]=i}return t},vr=(e,t)=>"base"===t?`effects.${e}`:`effects.${e}.${t}`,mr=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),gr=(t,r)=>{if(void 0!==t){if("number"!=typeof t||Number.isNaN(t))throw new e("REFRACT_E_EFFECTS",`${r} must be a number, received ${JSON.stringify(t)}.`);return t}},hr=(t,r)=>{if(void 0!==t){if("number"==typeof t){if(Number.isNaN(t))throw new e("REFRACT_E_EFFECTS",`${r} must be a number or length string, received ${JSON.stringify(t)}.`);return t}if("string"==typeof t){const n=re(t);if("raw"in n)throw new e("REFRACT_E_EFFECTS",`${r} must be a number or a <number><unit> length (received ${JSON.stringify(t)}).`);return void 0===n.unit?n.value:{value:n.value,unit:n.unit}}throw new e("REFRACT_E_EFFECTS",`${r} must be a number or length string, received ${JSON.stringify(t)}.`)}},yr=new Set(["offsetX","offsetY","blur","spread","color","inset"]),wr=(t,r)=>{if(!mr(t))throw new e("REFRACT_E_EFFECTS",`${r} must be a shadow-layer object, received ${JSON.stringify(t)}.`);for(const n of Object.keys(t))if(!yr.has(n))throw new e("REFRACT_E_EFFECTS",`${r} has unknown shadow field "${n}" (allowed: ${[...yr].join(", ")}).`);const n={},o=hr(t.offsetX,`${r}.offsetX`),i=hr(t.offsetY,`${r}.offsetY`),s=hr(t.blur,`${r}.blur`),a=hr(t.spread,`${r}.spread`);if(void 0!==o&&(n.offsetX=o),void 0!==i&&(n.offsetY=i),void 0!==s&&(n.blur=s),void 0!==a&&(n.spread=a),void 0!==t.color){if("string"!=typeof t.color||!t.color)throw new e("REFRACT_E_EFFECTS",`${r}.color must be a "colors.*" token-path string.`);n.color=t.color}if(void 0!==t.inset){if("boolean"!=typeof t.inset)throw new e("REFRACT_E_EFFECTS",`${r}.inset must be a boolean.`);t.inset&&(n.inset=!0)}return n},kr=new Set(["property","duration","timingFunction","delay"]),$r=(t,r)=>{if(!mr(t))throw new e("REFRACT_E_EFFECTS",`${r} must be a transition-part object, received ${JSON.stringify(t)}.`);for(const n of Object.keys(t))if(!kr.has(n))throw new e("REFRACT_E_EFFECTS",`${r} has unknown transition field "${n}" (allowed: ${[...kr].join(", ")}).`);if("string"!=typeof t.property||!t.property)throw new e("REFRACT_E_EFFECTS",`${r}.property is required (the CSS property to transition).`);const n={property:t.property},o=gr(t.duration,`${r}.duration`),i=gr(t.delay,`${r}.delay`);if(void 0!==o&&(n.duration=o),void 0!==t.timingFunction){if("string"!=typeof t.timingFunction||!t.timingFunction)throw new e("REFRACT_E_EFFECTS",`${r}.timingFunction must be a keyword or cubic-bezier(...) string.`);n.timingFunction=t.timingFunction}return void 0!==i&&(n.delay=i),n},xr=new Set(["recipes"]),Rr={shadow:["offsetX","offsetY","blur","spread","color","inset"],transitions:["property","duration","timingFunction","delay"]},Er=t=>"shadow"===t?r=>((t,r="effects.shadow")=>{if("string"==typeof t){if("none"===t)return"none";throw new e("REFRACT_E_EFFECTS",`${r} must be structured shadow layer(s) or "none" — raw CSS strings are not accepted (received ${JSON.stringify(t)}).`)}if(Array.isArray(t)){if(!t.length)throw new e("REFRACT_E_EFFECTS",`${r} is an empty shadow-layer array.`);return t.map((e,t)=>wr(e,`${r}[${t}]`))}return[wr(t,r)]})(r,`effects.${t}`):"transitions"===t?r=>((t,r="effects.transitions")=>{if("string"==typeof t){if("none"===t)return"none";throw new e("REFRACT_E_EFFECTS",`${r} must be structured transition part(s) or "none" — raw CSS strings are not accepted (received ${JSON.stringify(t)}).`)}if(Array.isArray(t)){if(!t.length)throw new e("REFRACT_E_EFFECTS",`${r} is an empty transition-part array.`);return t.map((e,t)=>$r(e,`${r}[${t}]`))}return[$r(t,r)]})(r,`effects.${t}`):void 0,jr={key:"effects",normalizeProperties(e,t){const r={};if(!e)return r;for(const[n,o]of Object.entries(e)){if(xr.has(n))continue;const e=Rr[n],i=Er(n),s=Oe(o,{propertyPath:`effects.${n}`,allowedBreakpoints:t.allowedBreakpoints,...e?{leafFields:e}:{},...i?{coerceValue:i}:{},...e?{fallbackBase:"none"}:{}});ye(s,{propertyPath:`effects.${n}`}),r[n]=s}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>({base:br(t.base),responsive:t.responsive.map(e=>{const{breakpoint:t,query:n,state:o,variant:i,target:s,orientation:a,container:l,size:c,...d}=e,f={declarations:{...i?{...r.resolveRecipeVariant(i).base}:{},...br(d)}};return t&&(f.breakpoint=t,f.query=null!=n?n:"exact"),l&&(f.container=l,c&&(f.size=c),f.query=null!=n?n:"min"),o&&(f.state=o),s&&(f.target=s),a&&(f.orientation=a),f})}))(0,t,r)},Ar=new Set(["breakpoint","query","state","variant","target","orientation","container","size"]),Or=new Set(["as","side"]),_r=new Set(["width","style","offset","radius","color"]),Sr=(e,t,r)=>"radius"===r?"border-radius":"offset"===r?"outline-offset":"outline"===e?`outline-${r}`:t?`border-${t}-${r}`:`border-${r}`,Cr=(e,t)=>"color"===e?{ref:t}:{ref:"base"===t?`borders.${e}`:`borders.${e}.${t}`},Tr=(e,t,r)=>{const n={};if(!e)return n;for(const[o,i]of Object.entries(e))i&&!Ar.has(o)&&!Or.has(o)&&_r.has(o)&&(n[Sr(t,r,o)]=Cr(o,i));return n},Fr=new Set(["recipes"]),Nr={key:"borders",normalizeProperties(e,t){const r={};if(!e)return r;for(const[n,o]of Object.entries(e)){if(Fr.has(n))continue;const e=Oe(o,{propertyPath:`borders.${n}`,allowedBreakpoints:t.allowedBreakpoints});ye(e,{propertyPath:`borders.${n}`}),r[n]=e}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>{var n;const o=null!==(n=t.base.as)&&void 0!==n?n:"border",i=t.base.side,s=Tr(t.base,o,i),a=t.responsive.map(e=>{var t,n;const{breakpoint:s,query:a,state:l,variant:c,target:d,orientation:f,container:u,size:p,as:b,side:v,...m}=e,g=null!==(t=b)&&void 0!==t?t:o,h=null!==(n=v)&&void 0!==n?n:i,y={declarations:{...c?{...r.resolveRecipeVariant(c).base}:{},...Tr(m,g,h)}};return s&&(y.breakpoint=s,y.query=null!=a?a:"exact"),u&&(y.container=u,p&&(y.size=p),y.query=null!=a?a:"min"),l&&(y.state=l),f&&(y.orientation=f),d&&(y.target=d),y});return{base:s,responsive:a}})(0,t,r)},zr=new Set(["breakpoint","query","state","variant","target","orientation"]),Pr={keyframes:"animation-name",duration:"animation-duration",easing:"animation-timing-function",delay:"animation-delay",iterationCount:"animation-iteration-count",direction:"animation-direction",fillMode:"animation-fill-mode",playState:"animation-play-state"},qr={duration:"duration",easing:"easing",delay:"delay"},Ir=(e,t)=>"base"===t?`animation.${e}`:`animation.${e}.${t}`,Vr=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e)){if(void 0===n||""===n||zr.has(r))continue;const e=Pr[r];e&&(t[e]="keyframes"===r?{ref:`animation.keyframes.${n}`}:qr[r]?{ref:Ir(qr[r],String(n))}:{value:n})}return t},Br=new Set(["keyframes","recipes"]),Mr=e=>e&&"object"==typeof e&&"ref"in e?{ref:String(e.ref)}:"string"==typeof e||"number"==typeof e?{value:e}:void 0,Lr=e=>{const t={};for(const[r,n]of Object.entries(e)){const e=Mr(n);e&&(t[r]=e)}return t},Ur=e=>{const t=[];for(const[r,n]of Object.entries(e))t.push({stop:r,declarations:Lr(n)});return{steps:t}},Yr=e=>{if(!e||"object"!=typeof e)return{};const t={};for(const[r,n]of Object.entries(e))n&&"object"==typeof n&&(t[r]=Ur(n));return t},Hr={key:"animation",normalizeProperties(e,t){const r={};if(!e)return r;for(const[n,o]of Object.entries(e)){if(Br.has(n))continue;const e=Oe(o,{propertyPath:`animation.${n}`,allowedBreakpoints:t.allowedBreakpoints});ye(e,{propertyPath:`animation.${n}`}),r[n]=e}return r},interpretRecipe:(e,t,r)=>((e,t,r)=>({base:Vr(t.base),responsive:t.responsive.map(e=>{const{breakpoint:t,query:n,state:o,variant:i,target:s,orientation:a,container:l,size:c,...d}=e,f={declarations:{...i?{...r.resolveRecipeVariant(i).base}:{},...Vr(d)}};return t&&(f.breakpoint=t,f.query=null!=n?n:"exact"),l&&(f.container=l,c&&(f.size=c),f.query=null!=n?n:"min"),o&&(f.state=o),s&&(f.target=s),a&&(f.orientation=a),f})}))(0,t,r),buildStructural:e=>({ruleSetGroups:{},configProperties:{},keyframes:Yr(e.keyframes)})},Jr=e=>{const t={};if(!e)return t;for(const[r,n]of Object.entries(e))t[Dr(r)]=Wr(n);return t},Wr=e=>"object"==typeof e?{ref:e.ref}:{value:e},Dr=e=>e.startsWith("--")?e:e.replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gr={key:"components",normalizeProperties:()=>({}),interpretRecipe:(e,t,r)=>((e,t)=>({base:Jr(t.base.css),responsive:t.responsive.map(e=>{var t,r;const n=e,o={declarations:Jr(n.css)};return n.breakpoint&&(o.breakpoint=n.breakpoint,o.query=null!==(t=n.query)&&void 0!==t?t:"exact"),n.container&&(o.container=n.container,n.size&&(o.size=n.size),o.query=null!==(r=n.query)&&void 0!==r?r:"min"),n.state&&(o.state=n.state),n.orientation&&(o.orientation=n.orientation),n.target&&(o.target=n.target),o})}))(0,t),extractReferences:e=>S(e)},Kr=e=>({value:e}),Xr=e=>({ref:e}),Zr=(e,t)=>({kind:"reset",selector:e,declarations:t,overrides:[]}),Qr=e=>{const t={};for(const[r,n,o]of e){const e={};for(const[t,r]of Object.entries(o))e[t]=Kr(r);t[r]=Zr(n,e)}return t},en=[["h1","4xl"],["h2","3xl"],["h3","2xl"],["h4","xl"],["h5","lg"],["h6","md"]],tn={preflight:{static:[["box","*,::before,::after",{"box-sizing":"border-box","border-width":"0","border-style":"solid"}],["body","body",{margin:"0","line-height":"inherit"}],["headings","h1,h2,h3,h4,h5,h6",{"font-size":"inherit","font-weight":"inherit",margin:"0"}],["blocks","p,figure,blockquote,dl,dd",{margin:"0"}],["lists","ul,ol",{"list-style":"none",margin:"0",padding:"0"}],["media","img,picture,video,canvas,svg",{display:"block","max-width":"100%"}],["forms","button,input,select,textarea",{font:"inherit",color:"inherit"}],["anchors","a",{color:"inherit","text-decoration":"inherit"}]],headings:!0},normalize:{static:[["box","*,::before,::after",{"box-sizing":"border-box"}],["body","body",{margin:"0"}],["media","img,picture,video,canvas,svg",{"max-width":"100%"}]],headings:!1},reset:{static:[["box","*,::before,::after",{"box-sizing":"border-box"}],["all","*",{margin:"0",padding:"0",border:"0",font:"inherit","vertical-align":"baseline"}],["headings","h1,h2,h3,h4,h5,h6",{"font-size":"inherit","font-weight":"inherit"}],["lists","ul,ol",{"list-style":"none"}],["media","img,picture,video,canvas,svg",{display:"block","max-width":"100%"}]],headings:!0}},rn=Object.keys(tn),nn=t=>{if(!1===t)return{};const r=tn[t];if(!r)throw new e("REFRACT_E_PRESET",`globals: unknown preset "${t}" — expected one of ${rn.join(", ")} or false`);const n={static:Qr(r.static)};return r.headings&&(n.defaults=(()=>{const e={};for(const[t,r]of en)e[t]=Zr(t,{"font-size":Xr(`typography.fontSize.${r}`)});return e})()),n},on=new Set(["state","breakpoint","query","orientation","container","size","variant","target"]),sn=e=>null!==e&&"object"==typeof e?{ref:e.ref}:{value:e},an=e=>e.startsWith("--")?e:e.replace(/_/g,"-").replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ln=e=>{const t={};for(const[r,n]of Object.entries(e))null==n||on.has(r)||(t[an(r)]=sn(n));return t},cn=e=>{const t={declarations:ln(e)},r=e;for(const e of on)void 0!==r[e]&&(t[e]=r[e]);return t},dn=(e,t,r)=>(e=>({declarations:ln(e.base),overrides:e.responsive.map(cn)}))(Be({[e]:t},r)[e]),fn=(e,t)=>{const r=null!=e?e:{},n={};if(void 0!==r.preset){const e=nn(r.preset);e.static&&(n.static=e.static),e.defaults&&(n.defaults=e.defaults)}const o=((e,t)=>{if(!e||!Object.keys(e).length)return;const r=Object.keys(t.breakpoints),n={};for(const[o,i]of Object.entries(e)){if(!i||"object"!=typeof i)continue;const e={propertyPath:`globals.elements.${o}`,allowedBreakpoints:r,allowedStates:t.allowedStates,allowedContainers:t.allowedContainers},{variants:s,...a}=i,l=dn(o,a,e),c={kind:"globals",selector:o,declarations:l.declarations,overrides:l.overrides};if(s&&"object"==typeof s&&Object.keys(s).length){const t={};for(const[r,n]of Object.entries(s))n&&"object"==typeof n&&(t[r]=dn(r,n,{...e,propertyPath:`${e.propertyPath}.variants.${r}`}));Object.keys(t).length&&(c.variants=t)}n[o]=c}return Object.keys(n).length?n:void 0})(r.elements,t);return o&&(n.elements=o),n},un={key:"globals",normalizeProperties:()=>({}),buildStructural:(e,t)=>({ruleSetGroups:fn(e,t),configProperties:{}})},pn=[St,Bt,dr,jr,Nr,Hr,Gr,un];const bn=(e,t)=>M(e,e=>W(e,H(t))),vn=e=>{var t;if(!e||"object"!=typeof e)return;const r={};for(const[n,o]of Object.entries(e))o&&"object"==typeof o&&o.sizes&&Object.keys(o.sizes).length&&(r[n]={type:null!==(t=o.type)&&void 0!==t?t:"inline-size",sizes:{...o.sizes}});return Object.keys(r).length?r:void 0},mn=e=>{if(!e)return;const t=new Map;for(const[r,n]of Object.entries(e))t.set(r,new Set(Object.keys(n.sizes)));return t},gn=(e,t)=>{if(e.startsWith("--"))return e;const r=e.split(".").join("-").toLowerCase();return t?`--${t}-${r}`:`--${r}`};function hn(e,t,r){const{clean:n,externals:o}=((e,t)=>{if(!e)return{clean:e,externals:{}};const r={},n={};for(const[o,i]of Object.entries(e))if(null===i||"object"!=typeof i||Array.isArray(i)||"string"!=typeof i.external)r[o]=i;else{const e=gn(i.external,t);n[o]={base:`var(${e})`,external:e,responsive:[]}}return{clean:r,externals:n}})(t,r.extendsPrefix),i=e.normalizeProperties(n,{allowedBreakpoints:r.allowedBreakpoints});Object.assign(i,o);const s=r.inheritedProperties?{...r.inheritedProperties,...i}:i,a=function(e,t,r){var n,o;if(!e.interpretRecipe||!t||!Object.keys(t).length)return{};const i={};for(const[s,a]of Object.entries(t)){const t=`${e.key}.recipes.${s}`,l=Be(a,{propertyPath:t,allowedBreakpoints:r.allowedBreakpoints,allowedStates:r.allowedStates,allowedContainers:r.allowedContainers}),c=He(l,(n,o,i)=>e.interpretRecipe(n,o,{breakpoints:r.breakpoints,media:r.media,properties:r.properties,resolveRecipeVariant:i,groupPath:t}),{groupPath:t}).resolveAll(),d={};for(const[t,r]of Object.entries(c))if(e.extractReferences){const i=e.extractReferences(null!==(o=null===(n=l[t])||void 0===n?void 0:n.base)&&void 0!==o?o:{});d[t]=C(r,i)}else d[t]=j(r);i[s]=d}return i}(e,null==t?void 0:t.recipes,{breakpoints:r.breakpoints,media:r.media,properties:s,allowedBreakpoints:r.allowedBreakpoints,allowedStates:r.allowedStates,allowedContainers:r.allowedContainers});let l,c,d=a;if(e.buildStructural&&t){const n=e.buildStructural(t,{breakpoints:r.breakpoints,media:r.media,mediaConfig:r.mediaConfig,allowedStates:r.allowedStates,allowedContainers:r.allowedContainers});d={...n.ruleSetGroups,...a},Object.keys(n.configProperties).length&&(l=n.configProperties),n.keyframes&&Object.keys(n.keyframes).length&&(c=n.keyframes)}const f={};return Object.keys(i).length&&(f.properties=i),Object.keys(d).length&&(f.ruleSetGroups=d),l&&(f.extraProperties=l),c&&(f.keyframes=c),f}function yn(e){const t={};if(!(null==e?void 0:e.properties))return t;for(const[r,n]of Object.entries(e.properties)){const e={base:n.base.value};if(n.variants&&Object.keys(n.variants).length){const t={};for(const[e,r]of Object.entries(n.variants)){const n={base:r.base.value};if(r.extras)for(const[e,t]of Object.entries(r.extras))n[e]=t.value;t[e]=n}e.variants=t}if(n.extras)for(const[t,r]of Object.entries(n.extras))e[t]=r.value;t[r]=e}return t}function wn(e,t){var r,n,o,i,s;if(!e)return t;const a={...e};if(t.properties&&(a.properties={...null!==(r=e.properties)&&void 0!==r?r:{},...t.properties}),t.ruleSets){const r={...null!==(n=e.ruleSets)&&void 0!==n?n:{}};for(const[n,s]of Object.entries(t.ruleSets))r[n]={...null!==(i=null===(o=e.ruleSets)||void 0===o?void 0:o[n])&&void 0!==i?i:{},...s};a.ruleSets=r}return t.keyframes&&(a.keyframes={...null!==(s=e.keyframes)&&void 0!==s?s:{},...t.keyframes}),a}function kn(t,r){var n,o,i,s;const{adapter:a}=r,l=t,c=null!==(n=l.breakpoints)&&void 0!==n?n:K,d=Object.keys(c),f=null!==(i=null===(o=l.extends)||void 0===o?void 0:o.prefix)&&void 0!==i?i:"dt",u=a.allowedStates,p=new Set(null!==(s=l.modes)&&void 0!==s?s:["dark","light"]),b=r.media,v=bn(c,b),m=vn(l.containers),g=mn(m),h={};for(const e of pn){const t=hn(e,l[e.key],{breakpoints:c,extendsPrefix:f,media:v,mediaConfig:b,allowedBreakpoints:d,allowedStates:u,allowedContainers:g});Object.keys(t).length&&(h[e.key]=t)}const y=z({breakpoints:c,containers:m,...h}),w={units:r.units,baseFontSize:r.baseFontSize},k=function(e,t){var r;const{propertiesOverlay:n,ruleSetsOverlay:o,keyframesOverlay:i,containersOverlay:s}=t;if(!(n||o||i||s))return e;const a={...e.subsystems},l=new Set([...Object.keys(null!=n?n:{}),...Object.keys(null!=o?o:{}),...Object.keys(null!=i?i:{})]);for(const e of l)a[e]=wn(a[e],{properties:null==n?void 0:n[e],ruleSets:null==o?void 0:o[e],keyframes:null==i?void 0:i[e]});const c={...e,subsystems:a};return s&&(c.containers={...null!==(r=e.containers)&&void 0!==r?r:{},...s}),c}(be(y,w),r),$=Je(pn.flatMap(e=>e.derivations?[e.derivations]:[])),x=Qe(k,$),R=[...xn(x),...Rn(x),...En(x),...$n(x,p)];if(R.length>0){const t=R.map(e=>` - ${e}`).join("\n");throw new e("REFRACT_E_VALIDATION",`refract: ${R.length} validation error(s):\n${t}`,R)}return jn(x,{adapter:a,derivationRegistry:$,allowedStates:u,mediaConfig:b,unitConfig:w})}function $n(e,t){var r,n,o;const i=[],s=(e,r,n,o)=>{t.has(n)||i.push(`${e}.${r}${o}: unknown appearance mode '${n}' — declare it in the top-level 'modes' registry (known: ${[...t].join(", ")})`)};for(const[t,i]of Object.entries(e.subsystems))for(const[e,a]of Object.entries(null!==(r=i.properties)&&void 0!==r?r:{})){for(const r of null!==(n=a.modes)&&void 0!==n?n:[])r.mode&&s(t,e,r.mode,"");for(const r of null!==(o=a.responsive)&&void 0!==o?o:[])r.mode&&s(t,e,r.mode," (responsive)")}return i}function xn(e){var t,r,n,o,i;const s=null===(t=e.subsystems.components)||void 0===t?void 0:t.ruleSets;if(!s)return[];const a=[];for(const[t,l]of Object.entries(s))for(const[s,c]of Object.entries(l))for(const l of null!==(r=c.references)&&void 0!==r?r:[]){const[r,c=""]=l.split(":"),d=c.indexOf("."),f=d>=0?c.slice(0,d):c,u=d>=0?c.slice(d+1):"";(null===(i=null===(o=null===(n=e.subsystems[r])||void 0===n?void 0:n.ruleSets)||void 0===o?void 0:o[f])||void 0===i?void 0:i[u])||a.push(`components.${t}.${s}: Recipe variant "${u}" is not defined in "${r}:${f}". Check the subsystem:group.variant reference against what the subsystem declares.`)}return a}function Rn(e){var t,r;const n=null===(t=e.subsystems.components)||void 0===t?void 0:t.ruleSets;if(!n)return[];const o=P(e),i=[],s=(e,t,r,n)=>{for(const[s,a]of Object.entries(null!=e?e:{}))void 0===a.ref||a.ref in o||i.push(`components.${t}.${r}: css '${s}'${n} references unknown token '${a.ref}' — check the token path, or use a bare string / number for a raw CSS value`)};for(const[e,t]of Object.entries(n))for(const[n,o]of Object.entries(t)){s(o.declarations,e,n,"");for(const t of null!==(r=o.overrides)&&void 0!==r?r:[])s(t.declarations,e,n," (override)")}return i}function En(e){var t,r,n,o,i;const s=null===(t=e.subsystems.globals)||void 0===t?void 0:t.ruleSets;if(!s)return[];const a=P(e),l=[],c=(e,t,r)=>{for(const[n,o]of Object.entries(null!=e?e:{}))void 0===o.ref||o.ref in a||l.push(`globals element '${t}'${r}: '${n}' references unknown token '${o.ref}' — check the token path, or use a bare string / number for a raw CSS value`)};for(const e of Object.values(s))for(const t of Object.values(e)){if("globals"!==t.kind)continue;const e=null!==(r=t.selector)&&void 0!==r?r:"";c(t.declarations,e,"");for(const r of null!==(n=t.overrides)&&void 0!==n?n:[])c(r.declarations,e," (override)");for(const[r,n]of Object.entries(null!==(o=t.variants)&&void 0!==o?o:{})){const t=` (variant '${r}')`;c(n.declarations,e,t);for(const r of null!==(i=n.overrides)&&void 0!==i?i:[])c(r.declarations,e,`${t} (override)`)}}return l}function jn(e,t){var r;const n=bn(e.breakpoints,t.mediaConfig),o=X(e.containers,t.mediaConfig),i=new WeakMap,s=()=>{let t=i.get(e);return t||(t=P(e),i.set(e,t)),t},a=e=>We(s(),t.derivationRegistry,e),l={media:n,containers:o,resolve:a},c=t.adapter.bind(e,l),d={model:e,get tokens(){return s()},resolveToken:a,override:r=>function(e,t,r){var n,o,i;const s=t.breakpoints,a=s?{...e.breakpoints,...s}:e.breakpoints,l=Object.keys(a),c=bn(a,r.mediaConfig),d=vn(t.containers),f=d?{...null!==(n=e.containers)&&void 0!==n?n:{},...d}:e.containers,u=mn(f),p={...e.subsystems};for(const n of pn){const s=t[n.key];if(void 0===s)continue;const d=yn(e.subsystems[n.key]),f=hn(n,s,{breakpoints:a,extendsPrefix:null!==(i=null===(o=t.extends)||void 0===o?void 0:o.prefix)&&void 0!==i?i:"dt",media:c,mediaConfig:r.mediaConfig,allowedBreakpoints:l,allowedStates:r.allowedStates,allowedContainers:u,inheritedProperties:d}),b=N(f);b&&(p[n.key]=wn(e.subsystems[n.key],b))}const b={breakpoints:a,subsystems:p};f&&Object.keys(f).length&&(b.containers=f);const v=be(b,r.unitConfig),m=Qe(v,r.derivationRegistry);return jn(m,r)}(e,r,t)},f=null===(r=c.extend)||void 0===r?void 0:r.call(c,d);return f&&Object.defineProperties(d,Object.getOwnPropertyDescriptors(f)),d}export{ve as A,q as B,Z as C,K as D,he as E,ye as F,Be as G,He as H,Je as I,We as J,f as K,de as L,De as M,Qe as N,kn as O,St as P,Bt as Q,dr as R,jr as S,Nr as T,Hr as U,Gr as V,un as W,E as a,R as b,j as c,A as d,_ as e,S as f,C as g,N as h,p as i,z as j,P as k,M as l,J as m,W as n,D as o,O as p,G as q,H as r,V as s,X as t,re as u,ne as v,ie as w,le as x,be as y,Oe as z};
|
|
2
|
+
//# sourceMappingURL=_createTheme-255ff48e.esm.js.map
|