@udixio/theme 1.0.0-beta.27 → 1.0.0-beta.28

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,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("awilix"),e=require("@material/material-color-utilities"),r=require("path"),n=require("node:fs"),o=require("tailwindcss/plugin"),i=function(){function t(t){var e=t.colorManagerService;this.colorManagerService=void 0,this.colorManagerService=e}var e=t.prototype;return e.getColors=function(){return this.colorManagerService.getAll()},e.addColor=function(t,e){return this.colorManagerService.createOrUpdate(t,e)},e.addColors=function(t){var e=this;Array.isArray(t)||(t=[t]),t.forEach((function(t){"function"==typeof t&&(t=t(e)),t.fromPalettes&&(Array.isArray(t.fromPalettes)||(t.fromPalettes=[t.fromPalettes]),t.fromPalettes.map((function(t){e.colorManagerService.addFromPalette(t)}))),t.colors&&Object.keys(t.colors).map((function(r){return e.addColor(r,t.colors[r])}))}))},e.getColor=function(t){return this.colorManagerService.get(t)},e.removeColor=function(t){return this.colorManagerService.remove(t)},e.updateColor=function(t,e){return this.colorManagerService.createOrUpdate(t,e)},t}();function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function u(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){return l=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},l.apply(null,arguments)}function f(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function g(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}var p,d=function(){function t(t,e,r,n){this.low=void 0,this.normal=void 0,this.medium=void 0,this.high=void 0,this.low=t,this.normal=e,this.medium=r,this.high=n}return t.prototype.get=function(t){return t<=-1?this.low:t<0?e.lerp(this.low,this.normal,(t- -1)/1):t<.5?e.lerp(this.normal,this.medium,(t-0)/.5):t<1?e.lerp(this.medium,this.high,(t-.5)/.5):this.high},t}(),v=function(){function t(t,e,r,n,o,i,a,s){if(this.name=void 0,this.palette=void 0,this.tone=void 0,this.isBackground=void 0,this.background=void 0,this.secondBackground=void 0,this.contrastCurve=void 0,this.toneDeltaPair=void 0,this.hctCache=new Map,this.name=t,this.palette=e,this.tone=r,this.isBackground=n,this.background=o,this.secondBackground=i,this.contrastCurve=a,this.toneDeltaPair=s,!o&&i)throw new Error("Color "+t+" has secondBackgrounddefined, but background is not defined.");if(!o&&a)throw new Error("Color "+t+" has contrastCurvedefined, but background is not defined.");if(o&&!a)throw new Error("Color "+t+" has backgrounddefined, but contrastCurve is not defined.")}t.fromPalette=function(e){var r,n;return new t(null!=(r=e.name)?r:"",e.palette,e.tone,null!=(n=e.isBackground)&&n,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)},t.foregroundTone=function(r,n){var o=e.Contrast.lighterUnsafe(r,n),i=e.Contrast.darkerUnsafe(r,n),a=e.Contrast.ratioOfTones(o,r),s=e.Contrast.ratioOfTones(i,r);if(t.tonePrefersLightForeground(r)){var u=Math.abs(a-s)<.1&&a<n&&s<n;return a>=n||a>=s||u?o:i}return s>=n||s>=a?i:o},t.tonePrefersLightForeground=function(t){return Math.round(t)<60},t.toneAllowsLightForeground=function(t){return Math.round(t)<=49},t.enableLightForeground=function(e){return t.tonePrefersLightForeground(e)&&!t.toneAllowsLightForeground(e)?49:e};var r=t.prototype;return r.getArgb=function(t){return this.getHct(t).toInt()},r.getHct=function(t){var e=this.hctCache.get(t);if(null!=e)return e;var r=this.getTone(t),n=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,n),n},r.getTone=function(r){var n=r.contrastLevel<0;if(this.toneDeltaPair){var o=this.toneDeltaPair(r),i=o.roleA,a=o.roleB,s=o.delta,u=o.polarity,c=o.stayTogether,l=this.background(r).getTone(r),f="nearer"===u||"lighter"===u&&!r.isDark||"darker"===u&&r.isDark,h=f?i:a,g=f?a:i,p=this.name===h.name,d=r.isDark?1:-1,v=h.contrastCurve.get(r.contrastLevel),m=g.contrastCurve.get(r.contrastLevel),y=h.tone(r),C=e.Contrast.ratioOfTones(l,y)>=v?y:t.foregroundTone(l,v),k=g.tone(r),S=e.Contrast.ratioOfTones(l,k)>=m?k:t.foregroundTone(l,m);return n&&(C=t.foregroundTone(l,v),S=t.foregroundTone(l,m)),(S-C)*d>=s||((S=e.clampDouble(0,100,C+s*d))-C)*d>=s||(C=e.clampDouble(0,100,S-s*d)),50<=C&&C<60?d>0?(C=60,S=Math.max(S,C+s*d)):(C=49,S=Math.min(S,C+s*d)):50<=S&&S<60&&(c?d>0?(C=60,S=Math.max(S,C+s*d)):(C=49,S=Math.min(S,C+s*d)):S=d>0?60:49),p?C:S}var b=this.tone(r);if(null==this.background)return b;var P=this.background(r).getTone(r),x=this.contrastCurve.get(r.contrastLevel);if(e.Contrast.ratioOfTones(P,b)>=x||(b=t.foregroundTone(P,x)),n&&(b=t.foregroundTone(P,x)),this.isBackground&&50<=b&&b<60&&(b=e.Contrast.ratioOfTones(49,P)>=x?49:60),this.secondBackground){var w=[this.background,this.secondBackground],D=w[1],F=[(0,w[0])(r).getTone(r),D(r).getTone(r)],H=F[0],T=F[1],E=[Math.max(H,T),Math.min(H,T)],O=E[0],M=E[1];if(e.Contrast.ratioOfTones(O,b)>=x&&e.Contrast.ratioOfTones(M,b)>=x)return b;var A=e.Contrast.lighter(O,x),B=e.Contrast.darker(M,x),j=[];return-1!==A&&j.push(A),-1!==B&&j.push(B),t.tonePrefersLightForeground(H)||t.tonePrefersLightForeground(T)?A<0?100:A:1===j.length?j[0]:B<0?0:B}return b},t}(),m=function(t,e,r,n,o){this.roleA=void 0,this.roleB=void 0,this.delta=void 0,this.polarity=void 0,this.stayTogether=void 0,this.roleA=t,this.roleB=e,this.delta=r,this.polarity=n,this.stayTogether=o},y=function(){function t(t,e,r){this.option=void 0,this.schemeService=void 0,this.colorService=void 0,this.dynamicColor=null,this.option=t,this.schemeService=e,this.colorService=r}var r=t.prototype;return r.update=function(t){this.dynamicColor=null,this.option=l({},this.option,t)},r.getHex=function(){return e.hexFromArgb(this.getArgb())},r.getArgb=function(){return this.getDynamicColor().getArgb(this.schemeService.get())},r.getRgb=function(){return{r:(t=this.getArgb())>>16&255,g:t>>8&255,b:255&t};var t},r.getName=function(){return this.option.name.replace(/([A-Z])/g,"_$1").toLowerCase()},r.getDynamicColor=function(){return this.dynamicColor||(this.dynamicColor=v.fromPalette(l({},this.option,{name:this.getName()}))),this.dynamicColor},t}(),C=function(t,e){return e instanceof i?t.isDark?e.getColor("surfaceBright").getDynamicColor():e.getColor("surfaceDim").getDynamicColor():t.isDark?e.get("surfaceBright").getDynamicColor():e.get("surfaceDim").getDynamicColor()},k=function(){function t(t){var e=t.schemeService;this.colorMap=new Map,this.schemeService=void 0,this.schemeService=e}var e=t.prototype;return e.createOrUpdate=function(t,e){var r=this.colorMap.get(t);if(r)r.update(l({},e,{name:t})),this.colorMap.set(t,r);else{var n=e.palette,o=e.tone;if(!n||!o)throw new Error("Palette "+t+" does not exist");r=new y(l({},e,{palette:n,tone:o,name:t}),this.schemeService,this),this.colorMap.set(t,r)}return r},e.remove=function(t){return this.colorMap.delete(t)},e.get=function(t){var e=this.colorMap.get(t);if(e)return e;throw new Error("Color "+t+" does not exist")},e.getAll=function(){return this.colorMap},e.addFromPalette=function(t){var e,r=this,n=t,o=(e=t).charAt(0).toUpperCase()+e.slice(1),i="on"+o,a=n+"Container",s="on"+o+"Container",u="inverse"+o,c=n+"Fixed",l=n+"FixedDim",f="on"+o+"Fixed",h="on"+o+"FixedVariant";this.createOrUpdate(n,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?80:40},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(3,4.5,7,11),toneDeltaPair:function(t){return new m(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(i,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?20:100},background:function(t){return r.get(n).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(a,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?30:90},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new m(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(s,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?90:10},background:function(t){return r.get(a).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(u,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?40:80},background:function(t){return r.get("inverseSurface").getDynamicColor()},contrastCurve:new d(3,4.5,7,11)}),this.createOrUpdate(c,{palette:function(e){return e.getPalette(t)},tone:function(t){return 90},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new m(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(l,{palette:function(e){return e.getPalette(t)},tone:function(t){return 80},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new m(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(f,{palette:function(e){return e.getPalette(t)},tone:function(t){return 10},background:function(t){return r.get(l).getDynamicColor()},secondBackground:function(t){return r.get(c).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(h,{palette:function(e){return e.getPalette(t)},tone:function(t){return 30},background:function(t){return r.get(l).getDynamicColor()},secondBackground:function(t){return r.get(c).getDynamicColor()},contrastCurve:new d(3,4.5,7,11)})},t}(),S={colorManagerService:t.asClass(k).singleton(),colorService:t.asClass(i).singleton()},b=function(){function t(t){this.options=void 0,this.options=t}return t.prototype.getPalette=function(t){if(!this.options)throw new Error("Scheme options is not set");var e=this.options.palettes.get(t);if(!e)throw new Error("Palette "+t+" not found");return e},u(t,[{key:"contrastLevel",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.contrastLevel}},{key:"isDark",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.isDark}},{key:"sourceColorHct",get:function(){if(!this.options)throw new Error("Scheme options is not set");return e.Hct.fromInt(this.options.sourceColorArgb)}}])}(),P=function(){function t(){this.schemeEntity=void 0,this.options=void 0}var r=t.prototype;return r.createOrUpdate=function(t){var r,n;this.options=l({},this.options,t,{sourcesColorHex:l({},null==(r=this.options)?void 0:r.sourcesColorHex,t.sourcesColorHex),palettes:l({},null==(n=this.options)?void 0:n.palettes,t.palettes)});var o=new Map;if(!this.options.sourcesColorHex.primary)throw new Error("Primary source color is not set");var i=e.argbFromHex(this.options.sourcesColorHex.primary),a=e.Hct.fromInt(i);if(this.options.palettes){for(var s=0,u=Object.entries(this.options.palettes);s<u.length;s++){var c=u[s],f=c[0],h=c[1],g=h.sourceColorkey,p=h.tonalPalette,d=void 0;if(g){var v=e.argbFromHex(this.options.sourcesColorHex[g]);d=p(e.Hct.fromInt(v))}else d=p(a);o.set(f,d)}this.schemeEntity=new b(l({},this.options,{palettes:o,sourceColorArgb:i}))}},r.get=function(){if(!this.schemeEntity)throw new Error("Scheme is not created");return this.schemeEntity},t}(),x=function(){function t(t){var e=t.schemeService,r=t.variantService;this.schemeService=void 0,this.variantService=void 0,this.schemeService=e,this.variantService=r}var e=t.prototype;return e.create=function(t){this.schemeService.createOrUpdate(l({},t,{sourcesColorHex:{primary:t.sourceColorHex}})),this.variantService.set(t.variant)},e.update=function(t){var e=l({},t);t.sourceColorHex&&(e.sourcesColorHex={primary:t.sourceColorHex}),this.schemeService.createOrUpdate(e),t.variant&&this.variantService.set(t.variant)},e.addCustomPalette=function(t,e){this.variantService.addCustomPalette(t,e)},t}(),w=function(){function t(t){var e=t.schemeService;this.customPalettes={},this.variantEntity=void 0,this.schemeService=void 0,this.schemeService=e}var r=t.prototype;return r.addCustomPalette=function(t,e){this.customPalettes[t]=e,this.update()},r.set=function(t){this.variantEntity=t,t.palettes.error||(t.palettes.error=function(){return e.TonalPalette.fromHueAndChroma(25,84)}),this.update()},r.update=function(){var t=this;if(this.variantEntity){var e={};Object.keys(this.variantEntity.palettes).forEach((function(r){e[r]={tonalPalette:t.variantEntity.palettes[r]}})),this.variantEntity.customPalettes&&Object.keys(this.customPalettes).forEach((function(r){e[r]={sourceColorkey:r,tonalPalette:t.variantEntity.customPalettes}})),this.schemeService.createOrUpdate({sourcesColorHex:this.customPalettes,palettes:e})}},t}(),D={schemeService:t.asClass(P).singleton(),variantService:t.asClass(w).singleton(),themeService:t.asClass(x).singleton()},F=function(t){var e=t.colorService,r=t.themeService,n=t.pluginService;this.colorService=void 0,this.themeService=void 0,this.pluginService=void 0,this.pluginService=n,this.colorService=e,this.themeService=r},H={appService:t.asClass(F).singleton()},T=function(t){return{fromPalettes:["primary","secondary","tertiary"],colors:{background:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:98},isBackground:!0},onBackground:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:10},background:function(e){return t.getColor("background").getDynamicColor()},contrastCurve:new d(3,3,4.5,7)},surface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:98},isBackground:!0},surfaceDim:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:87},isBackground:!0},surfaceBright:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?24:98},isBackground:!0},surfaceContainerLowest:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?4:100},isBackground:!0},surfaceContainerLow:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?10:96},isBackground:!0},surfaceContainer:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?12:94},isBackground:!0},surfaceContainerHigh:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?17:92},isBackground:!0},surfaceContainerHighest:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?22:90},isBackground:!0},onSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:10},background:function(e){return C(e,t)},contrastCurve:new d(4.5,7,11,21)},surfaceVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?30:90},isBackground:!0},onSurfaceVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?80:30},background:function(e){return C(e,t)},contrastCurve:new d(3,4.5,7,11)},inverseSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:20}},inverseOnSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?20:95},background:function(e){return t.getColor("inverseSurface").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},outline:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?60:50},background:function(e){return C(e,t)},contrastCurve:new d(1.5,3,4.5,7)},outlineVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?30:80},background:function(e){return C(e,t)},contrastCurve:new d(1,1,3,7)},shadow:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return 0}},scrim:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return 0}},surfaceTint:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?80:40},isBackground:!0},secondaryContainer:{tone:function(t){var r=t.isDark?30:90;return function(t,r,n,o){var i=n,a=e.Hct.from(t,r,n);if(a.chroma<r)for(var s=a.chroma;a.chroma<r;){var u=e.Hct.from(t,r,i+=o?-1:1);if(s>u.chroma)break;if(Math.abs(u.chroma-r)<.4)break;Math.abs(u.chroma-r)<Math.abs(a.chroma-r)&&(a=u),s=Math.max(s,u.chroma)}return i}(t.getPalette("secondary").hue,t.getPalette("secondary").chroma,r,!t.isDark)}},onSecondaryContainer:{tone:function(e){return v.foregroundTone(t.getColor("secondaryContainer").getDynamicColor().tone(e),4.5)}},tertiaryContainer:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){var r=t.getPalette("tertiary").getHct(t.sourceColorHct.tone);return e.DislikeAnalyzer.fixIfDisliked(r).tone}},onTertiaryContainer:{palette:function(t){return t.getPalette("tertiary")},tone:function(e){return v.foregroundTone(t.getColor("tertiaryContainer").getDynamicColor().tone(e),4.5)}},error:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?80:40},isBackground:!0,background:function(e){return C(e,t)},contrastCurve:new d(3,4.5,7,11),toneDeltaPair:function(e){return new m(t.getColor("errorContainer").getDynamicColor(),t.getColor("error").getDynamicColor(),15,"nearer",!1)}},onError:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?20:100},background:function(e){return t.getColor("error").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},errorContainer:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?30:90},isBackground:!0,background:function(e){return C(e,t)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(e){return new m(t.getColor("errorContainer").getDynamicColor(),t.getColor("error").getDynamicColor(),15,"nearer",!1)}},onErrorContainer:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?90:10},background:function(e){return t.getColor("errorContainer").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},onTertiaryFixed:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){return 10},background:function(e){return t.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(e){return t.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},onTertiaryFixedVariant:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){return 30},background:function(e){return t.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(e){return t.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new d(3,4.5,7,11)}}}},E=function(t,r,n){var o=t.hue;if(r.length!==n.length)throw new Error("mismatch between hue length "+r.length+" & rotations "+n.length);if(1===n.length)return e.sanitizeDegreesDouble(t.hue+n[0]);for(var i=r.length,a=0;a<=i-2;a++)if(r[a]<o&&o<r[a+1])return e.sanitizeDegreesDouble(o+n[a]);return o},O=function(){};p=O,O.tonalSpot={palettes:{primary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,36)},secondary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,16)},tertiary:function(t){return e.TonalPalette.fromHueAndChroma(e.sanitizeDegreesDouble(t.hue+60),24)},neutral:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,6)},neutralVariant:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,8)}},customPalettes:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,16)}},O.vibrant={palettes:{primary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,200)},secondary:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.secondaryRotations),24)},tertiary:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.tertiaryRotations),32)},neutral:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,6)},neutralVariant:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,8)}},customPalettes:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.secondaryRotations),24)}},O.hues=[0,41,61,101,131,181,251,301,360],O.secondaryRotations=[18,15,10,12,15,18,15,12,12],O.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var M=function(){function t(t){var e=t.appService;this.configPath="./theme.config",this.appService=void 0,this.appService=e}var e=t.prototype;return e.loadConfig=function(t){var e=this.appService,r=e.themeService,n=e.colorService,o=e.pluginService,i=null!=t?t:this.getConfig(),a=i.contrastLevel,s=i.isDark,u=i.variant,c=i.palettes,l=i.colors,f=i.useDefaultColors,h=void 0===f||f,g=i.plugins;r.create({contrastLevel:void 0===a?0:a,isDark:void 0!==s&&s,sourceColorHex:i.sourceColor,variant:void 0===u?O.tonalSpot:u}),c&&Object.entries(c).forEach((function(t){return r.addCustomPalette(t[0],t[1])})),h&&n.addColors(T),l&&n.addColors(l),g&&(g.forEach((function(t){o.addPlugin(t)})),o.loadPlugins(this.appService))},e.getConfig=function(){for(var t=r.resolve(this.configPath),e=null,o=0,i=[".js",".ts",".jms",".jcs"];o<i.length;o++){var a=t+i[o];if(n.existsSync(a)){e=require(a);break}}if(!e)throw new Error("Configuration file not found");return"default"in e?e.default:e},t}(),A={configService:t.asClass(M).singleton()},B=function(){function t(){this.plugins=new Map}var e=t.prototype;return e.addPlugin=function(t){this.plugins.set(t.name,t)},e.loadPlugins=function(t){var e=this,r=new Map(this.plugins),n=0;do{n=r.size,r.forEach((function(n,o){0===n.dependencies.filter((function(t){return!e.plugins.has((new t).name)})).length&&(e.plugins.set(n.name,n.init(t)),r.delete(o))}))}while(0!=r.size&&r.size<n);if(r.size>0)throw new Error("Some plugins couldn't be loaded due to missing dependencies: "+Array.from(r.keys()))},e.getPlugin=function(t){var e=this.plugins.get((new t).name);if(!e)throw new Error("Plugin "+t.name+" not found");return e},t}(),j={pluginService:t.asClass(B).singleton()};function z(t,e){return e.forEach((function(e){Object.entries(e).forEach((function(e){t.register(e[0],e[1])}))})),t}var I=t.createContainer({injectionMode:t.InjectionMode.PROXY});function L(t){var e=I.resolve("configService");return null!=t&&t.path&&(e.configPath=t.path),e.loadConfig(null==t?void 0:t.config),I.resolve("appService")}z(I,[A,H,j,S,D]);var U,W=function(){function t(t){this.options=void 0,this.pluginInstance=void 0,this.options=t}var e=t.prototype;return e.init=function(t){return this.pluginInstance=new this.pluginClass(t,this.options),this.pluginInstance.onInit(),this},e.getInstance=function(){if(!this.pluginInstance)throw new Error("Plugin "+this.name+" is not initialized");return this.pluginInstance},t}(),_=function(t,e){this.appService=void 0,this.options=void 0,this.appService=t,this.options=e,this.onInit()};exports.FontFamily=void 0,(U=exports.FontFamily||(exports.FontFamily={})).Expressive="expressive",U.Neutral="neutral";var V=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).dependencies=[],e.name="font",e.pluginClass=N,e}return f(e,t),e}(W),N=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this)._fontFamily=void 0,e._fontStyles=void 0,e}f(e,t);var r=e.prototype;return r.getFonts=function(){return{fontStyles:this.fontStyles,fontFamily:this.fontFamily}},r.onInit=function(){var t,e,r,n,o=this;this.fontFamily={expressive:null!=(t=null==(e=this.options)||null==(e=e.fontFamily)?void 0:e.expressive)?t:["Roboto","sans-serif"],neutral:null!=(r=null==(n=this.options)||null==(n=n.fontFamily)?void 0:n.neutral)?r:["Roboto","sans-serif"]},this.fontStyles={display:{large:{fontWeight:400,fontSize:3.5625,lineHeight:4,letterSpacing:-.015625,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:2.8125,lineHeight:3.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:2.25,lineHeight:2.75,fontFamily:exports.FontFamily.Expressive}},headline:{large:{fontWeight:400,fontSize:2,lineHeight:2.5,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:1.75,lineHeight:2.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:1.5,lineHeight:2,fontFamily:exports.FontFamily.Expressive}},title:{large:{fontWeight:400,fontSize:1.375,lineHeight:1.75,fontFamily:exports.FontFamily.Neutral},medium:{fontWeight:500,fontSize:1,lineHeight:1.5,fontFamily:exports.FontFamily.Neutral,letterSpacing:.009375},small:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625}},label:{large:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625},medium:{fontWeight:500,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},small:{fontWeight:500,fontSize:.6875,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125}},body:{large:{fontWeight:400,fontSize:1,lineHeight:1.5625,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},medium:{fontWeight:400,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.015625},small:{fontWeight:400,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.025}}},this.options&&this.options.fontStyles&&Object.entries(this.options.fontStyles).forEach((function(t){var e=t[0];Object.entries(t[1]).forEach((function(t){var r=t[0],n=t[1];n&&(o.fontStyles[e][r]=l({},o.fontStyles[e][r],n))}))}))},u(e,[{key:"fontFamily",get:function(){if(!this._fontFamily)throw new Error("Font family not initialized");return this._fontFamily},set:function(t){this._fontFamily=t}},{key:"fontStyles",get:function(){if(!this._fontStyles)throw new Error("Font styles not initialized");return this._fontStyles},set:function(t){this._fontStyles=t}}])}(_),R=function(t){return o((function(e){q(e,{statePrefix:"state",disabledStyles:{textOpacity:.38,backgroundOpacity:.12},transition:{duration:150}},t)}),{})},q=function(t,e,r){for(var n=t.addComponents,o=e.statePrefix,i=e.disabledStyles,a=e.transition,s={},u=0,l=[!1,!0];u<l.length;u++)for(var f,h=l[u]?"group-":"",g=c(r);!(f=g()).done;){var p,d=f.value,v="."+h+o+"-"+d;s[v]=((p={})["@apply "+h+"hover:bg-"+d+"/[0.08]"]={},p["@apply "+h+"active:bg-"+d+"/[0.12]"]={},p["@apply "+h+"focus-visible:bg-"+d+"/[0.12]"]={},p),a&&(s[v]["@apply transition-colors"]={},s[v]["@apply duration-"+a.duration]={}),i&&(s[v]["@apply "+h+"disabled:text-on-surface/["+i.textOpacity+"]"]={},s[v]["@apply "+h+"disabled:bg-on-surface/["+i.backgroundOpacity+"]"]={})}for(var m,y=c(r);!(m=y()).done;)for(var C=m.value,k=0,S=["hover","active","focus","disabled"];k<S.length;k++){var b,P=S[k],x="."+P+"-"+o+"-"+C;if("active"===P||"focus"===P)s[x]=((b={})["@apply bg-"+C+"/[0.12]"]={},b);else if("hover"===P){var w;s[x]=((w={})["@apply bg-"+C+"/[0.08]"]={},w)}else if("disabled"===P){var D,F;s[x]=((D={})["@apply text-on-surface/["+i.textOpacity+"]"]={},D),s[x]=((F={})["@apply bg-on-surface/["+i.backgroundOpacity+"]"]={},F)}}n(s)};function $(t){var e=t.name,r=t.darkMode,n=t.isDarkTheme;return{name:n?e+"Dark":e,selectors:n&&"class"===r?[".dark-mode .theme-"+e,".dark-mode.theme-"+e,'[data-theme="dark"] .theme-'+e,'[data-theme="dark"].theme-'+e]:[".theme-"+e],mediaQuery:n&&"media"===r?"@media (prefers-color-scheme: dark)":void 0,extend:{colors:t.colors}}}var Z=function(t){var e=t.appService,r=e.themeService,n=e.colorService,o={defaultTheme:{extend:{colors:{}}},themes:[{name:"darkTheme",extend:{colors:{}}}]};return Object.entries(t.colors).forEach((function(t){var e=t[0],r=t[1];o.defaultTheme.extend.colors[e]=r.light,o.themes[0].extend.colors[e]=r.dark})),o.themes[0].selectors="class"===t.darkMode?[".dark-mode",'[data-theme="dark"]']:void 0,o.themes[0].mediaQuery="media"===t.darkMode?"@media (prefers-color-scheme: dark)":void 0,t.subThemes&&Object.entries(t.subThemes).forEach((function(e){var i=e[0];r.update({sourceColorHex:e[1]});for(var a=0,s=[!0,!1];a<s.length;a++){var u=s[a],l={};r.update({isDark:u});for(var f,h=c(n.getColors().entries());!(f=h()).done;){var g=f.value,p=g[1];l[g[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()]=p.getHex()}o.themes.push($({name:i,isDarkTheme:u,darkMode:t.darkMode,colors:l}))}})),require("tailwindcss-themer")(o)},Q=function(t,e){return o((function(r){(0,r.addUtilities)(function(r){for(var n=r.theme,o="rem",i={},a=function(t){return{fontSize:t.fontSize+o,fontWeight:t.fontWeight,lineHeight:t.lineHeight+o,letterSpacing:t.letterSpacing?t.letterSpacing+o:null,fontFamily:n("fontFamily."+t.fontFamily)}},s=function(t,e,r){var i;return(i={})["@media (min-width: "+n("screens."+e,{})+")"]={fontSize:t.fontSize*r+o,lineHeight:t.lineHeight*r+o},i},u=0,c=Object.entries(t);u<c.length;u++)for(var f=c[u],h=f[0],g=function(){var t=d[p],r=t[1];i[".text-"+h+"-"+t[0]]=l({},a(r),Object.entries(e).reduce((function(t,e){return l({},t,s(r,e[0],e[1]))}),{}))},p=0,d=Object.entries(f[1]);p<d.length;p++)g();return i}({theme:r.theme}))}))},X=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).dependencies=[V],e.name="tailwind",e.pluginClass=Y,e}return f(e,t),e}(W),Y=function(t){function e(){return t.apply(this,arguments)||this}f(e,t);var r=e.prototype;return r.onInit=function(){var t,e;null!=(t=this.options).darkMode||(t.darkMode="class"),null!=(e=this.options).responsiveBreakPoints||(e.responsiveBreakPoints={lg:1.125})},r.getTheme=function(){for(var t={},e=0,r=[!1,!0];e<r.length;e++){var n=r[e];this.appService.themeService.update({isDark:n});for(var o,i=c(this.appService.colorService.getColors().entries());!(o=i()).done;){var a=o.value,s=a[1],u=a[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();null!=t[u]||(t[u]={light:"",dark:""}),t[u][n?"dark":"light"]=s.getHex()}}var l=this.appService.pluginService.getPlugin(V).getInstance().getFonts(),f=l.fontStyles;return{colors:{},fontFamily:l.fontFamily,plugins:[R(Object.keys(t)),Q(f,this.options.responsiveBreakPoints),Z({colors:t,darkMode:this.options.darkMode,subThemes:this.options.subThemes,appService:this.appService})]}},e}(_);exports.AppContainer=I,exports.AppModule=H,exports.AppService=F,exports.ColorEntity=y,exports.ColorManagerService=k,exports.ColorModule=S,exports.ColorService=i,exports.ConfigModule=A,exports.ConfigService=M,exports.ContrastCurve=d,exports.DynamicColor=v,exports.FontPlugin=V,exports.PluginAbstract=W,exports.PluginImplAbstract=_,exports.PluginModule=j,exports.PluginService=B,exports.SchemeEntity=b,exports.SchemeService=P,exports.TailwindPlugin=X,exports.ThemeModule=D,exports.ThemeService=x,exports.ToneDeltaPair=m,exports.VariantEntity=function(t,e){void 0===t&&(t={}),this.palettes=void 0,this.customPalettes=void 0,this.palettes=t,this.customPalettes=e},exports.VariantModel=O,exports.VariantService=w,exports.bootstrap=function(){return I.resolve("appService")},exports.bootstrapFromConfig=L,exports.createTheme=function(){var t=L();return l({},t.pluginService.getPlugin(X).getInstance().getTheme(),{appService:t})},exports.defaultColors=T,exports.defineConfig=function(t){if(!t||"object"!=typeof t)throw new Error("The configuration is missing or not an object");if(!("sourceColor"in t))throw new Error("Invalid configuration");return t},exports.getRotatedHue=E,exports.highestSurface=C,exports.importContainer=z,exports.state=R,exports.themer=Z;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("awilix"),e=require("@material/material-color-utilities"),r=require("path"),n=require("node:fs"),o=require("tailwindcss/plugin"),i=function(){function t(t){var e=t.colorManagerService;this.colorManagerService=void 0,this.colorManagerService=e}var e=t.prototype;return e.getColors=function(){return this.colorManagerService.getAll()},e.addColor=function(t,e){return this.colorManagerService.createOrUpdate(t,e)},e.addColors=function(t){var e=this;Array.isArray(t)||(t=[t]),t.forEach((function(t){"function"==typeof t&&(t=t(e)),t.fromPalettes&&(Array.isArray(t.fromPalettes)||(t.fromPalettes=[t.fromPalettes]),t.fromPalettes.map((function(t){e.colorManagerService.addFromPalette(t)}))),t.colors&&Object.keys(t.colors).map((function(r){return e.addColor(r,t.colors[r])}))}))},e.getColor=function(t){return this.colorManagerService.get(t)},e.removeColor=function(t){return this.colorManagerService.remove(t)},e.updateColor=function(t,e){return this.colorManagerService.createOrUpdate(t,e)},t}();function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,g(n.key),n)}}function u(t,e,r){return e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function c(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(){return l=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},l.apply(null,arguments)}function f(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,h(t,e)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}function g(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}var p,d=function(){function t(t,e,r,n){this.low=void 0,this.normal=void 0,this.medium=void 0,this.high=void 0,this.low=t,this.normal=e,this.medium=r,this.high=n}return t.prototype.get=function(t){return t<=-1?this.low:t<0?e.lerp(this.low,this.normal,(t- -1)/1):t<.5?e.lerp(this.normal,this.medium,(t-0)/.5):t<1?e.lerp(this.medium,this.high,(t-.5)/.5):this.high},t}(),m=function(){function t(t,e,r,n,o,i,a,s){if(this.name=void 0,this.palette=void 0,this.tone=void 0,this.isBackground=void 0,this.background=void 0,this.secondBackground=void 0,this.contrastCurve=void 0,this.toneDeltaPair=void 0,this.hctCache=new Map,this.name=t,this.palette=e,this.tone=r,this.isBackground=n,this.background=o,this.secondBackground=i,this.contrastCurve=a,this.toneDeltaPair=s,!o&&i)throw new Error("Color "+t+" has secondBackgrounddefined, but background is not defined.");if(!o&&a)throw new Error("Color "+t+" has contrastCurvedefined, but background is not defined.");if(o&&!a)throw new Error("Color "+t+" has backgrounddefined, but contrastCurve is not defined.")}t.fromPalette=function(e){var r,n;return new t(null!=(r=e.name)?r:"",e.palette,e.tone,null!=(n=e.isBackground)&&n,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)},t.foregroundTone=function(r,n){var o=e.Contrast.lighterUnsafe(r,n),i=e.Contrast.darkerUnsafe(r,n),a=e.Contrast.ratioOfTones(o,r),s=e.Contrast.ratioOfTones(i,r);if(t.tonePrefersLightForeground(r)){var u=Math.abs(a-s)<.1&&a<n&&s<n;return a>=n||a>=s||u?o:i}return s>=n||s>=a?i:o},t.tonePrefersLightForeground=function(t){return Math.round(t)<60},t.toneAllowsLightForeground=function(t){return Math.round(t)<=49},t.enableLightForeground=function(e){return t.tonePrefersLightForeground(e)&&!t.toneAllowsLightForeground(e)?49:e};var r=t.prototype;return r.getArgb=function(t){return this.getHct(t).toInt()},r.getHct=function(t){var e=this.hctCache.get(t);if(null!=e)return e;var r=this.getTone(t),n=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,n),n},r.getTone=function(r){var n=r.contrastLevel<0;if(this.toneDeltaPair){var o=this.toneDeltaPair(r),i=o.roleA,a=o.roleB,s=o.delta,u=o.polarity,c=o.stayTogether,l=this.background(r).getTone(r),f="nearer"===u||"lighter"===u&&!r.isDark||"darker"===u&&r.isDark,h=f?i:a,g=f?a:i,p=this.name===h.name,d=r.isDark?1:-1,m=h.contrastCurve.get(r.contrastLevel),v=g.contrastCurve.get(r.contrastLevel),y=h.tone(r),C=e.Contrast.ratioOfTones(l,y)>=m?y:t.foregroundTone(l,m),k=g.tone(r),S=e.Contrast.ratioOfTones(l,k)>=v?k:t.foregroundTone(l,v);return n&&(C=t.foregroundTone(l,m),S=t.foregroundTone(l,v)),(S-C)*d>=s||((S=e.clampDouble(0,100,C+s*d))-C)*d>=s||(C=e.clampDouble(0,100,S-s*d)),50<=C&&C<60?d>0?(C=60,S=Math.max(S,C+s*d)):(C=49,S=Math.min(S,C+s*d)):50<=S&&S<60&&(c?d>0?(C=60,S=Math.max(S,C+s*d)):(C=49,S=Math.min(S,C+s*d)):S=d>0?60:49),p?C:S}var b=this.tone(r);if(null==this.background)return b;var P=this.background(r).getTone(r),x=this.contrastCurve.get(r.contrastLevel);if(e.Contrast.ratioOfTones(P,b)>=x||(b=t.foregroundTone(P,x)),n&&(b=t.foregroundTone(P,x)),this.isBackground&&50<=b&&b<60&&(b=e.Contrast.ratioOfTones(49,P)>=x?49:60),this.secondBackground){var w=[this.background,this.secondBackground],D=w[1],F=[(0,w[0])(r).getTone(r),D(r).getTone(r)],H=F[0],T=F[1],E=[Math.max(H,T),Math.min(H,T)],O=E[0],M=E[1];if(e.Contrast.ratioOfTones(O,b)>=x&&e.Contrast.ratioOfTones(M,b)>=x)return b;var A=e.Contrast.lighter(O,x),B=e.Contrast.darker(M,x),j=[];return-1!==A&&j.push(A),-1!==B&&j.push(B),t.tonePrefersLightForeground(H)||t.tonePrefersLightForeground(T)?A<0?100:A:1===j.length?j[0]:B<0?0:B}return b},t}(),v=function(t,e,r,n,o){this.roleA=void 0,this.roleB=void 0,this.delta=void 0,this.polarity=void 0,this.stayTogether=void 0,this.roleA=t,this.roleB=e,this.delta=r,this.polarity=n,this.stayTogether=o},y=function(){function t(t,e,r){this.option=void 0,this.schemeService=void 0,this.colorService=void 0,this.dynamicColor=null,this.option=t,this.schemeService=e,this.colorService=r}var r=t.prototype;return r.update=function(t){this.dynamicColor=null,this.option=l({},this.option,t)},r.getHex=function(){return e.hexFromArgb(this.getArgb())},r.getArgb=function(){return this.getDynamicColor().getArgb(this.schemeService.get())},r.getRgb=function(){return{r:(t=this.getArgb())>>16&255,g:t>>8&255,b:255&t};var t},r.getName=function(){return this.option.name.replace(/([A-Z])/g,"_$1").toLowerCase()},r.getDynamicColor=function(){return this.dynamicColor||(this.dynamicColor=m.fromPalette(l({},this.option,{name:this.getName()}))),this.dynamicColor},t}(),C=function(t,e){return e instanceof i?t.isDark?e.getColor("surfaceBright").getDynamicColor():e.getColor("surfaceDim").getDynamicColor():t.isDark?e.get("surfaceBright").getDynamicColor():e.get("surfaceDim").getDynamicColor()},k=function(){function t(t){var e=t.schemeService;this.colorMap=new Map,this.schemeService=void 0,this.schemeService=e}var e=t.prototype;return e.createOrUpdate=function(t,e){var r=this.colorMap.get(t);if(r)r.update(l({},e,{name:t})),this.colorMap.set(t,r);else{var n=e.palette,o=e.tone;if(!n||!o)throw new Error("Palette "+t+" does not exist");r=new y(l({},e,{palette:n,tone:o,name:t}),this.schemeService,this),this.colorMap.set(t,r)}return r},e.remove=function(t){return this.colorMap.delete(t)},e.get=function(t){var e=this.colorMap.get(t);if(e)return e;throw new Error("Color "+t+" does not exist")},e.getAll=function(){return this.colorMap},e.addFromPalette=function(t){var e,r=this,n=t,o=(e=t).charAt(0).toUpperCase()+e.slice(1),i="on"+o,a=n+"Container",s="on"+o+"Container",u="inverse"+o,c=n+"Fixed",l=n+"FixedDim",f="on"+o+"Fixed",h="on"+o+"FixedVariant";this.createOrUpdate(n,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?80:40},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(3,4.5,7,11),toneDeltaPair:function(t){return new v(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(i,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?20:100},background:function(t){return r.get(n).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(a,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?30:90},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new v(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(s,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?90:10},background:function(t){return r.get(a).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(u,{palette:function(e){return e.getPalette(t)},tone:function(t){return t.isDark?40:80},background:function(t){return r.get("inverseSurface").getDynamicColor()},contrastCurve:new d(3,4.5,7,11)}),this.createOrUpdate(c,{palette:function(e){return e.getPalette(t)},tone:function(t){return 90},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new v(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(l,{palette:function(e){return e.getPalette(t)},tone:function(t){return 80},isBackground:!0,background:function(t){return C(t,r)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(t){return new v(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(f,{palette:function(e){return e.getPalette(t)},tone:function(t){return 10},background:function(t){return r.get(l).getDynamicColor()},secondBackground:function(t){return r.get(c).getDynamicColor()},contrastCurve:new d(4.5,7,11,21)}),this.createOrUpdate(h,{palette:function(e){return e.getPalette(t)},tone:function(t){return 30},background:function(t){return r.get(l).getDynamicColor()},secondBackground:function(t){return r.get(c).getDynamicColor()},contrastCurve:new d(3,4.5,7,11)})},t}(),S={colorManagerService:t.asClass(k).singleton(),colorService:t.asClass(i).singleton()},b=function(){function t(t){this.options=void 0,this.options=t}return t.prototype.getPalette=function(t){if(!this.options)throw new Error("Scheme options is not set");var e=this.options.palettes.get(t);if(!e)throw new Error("Palette "+t+" not found");return e},u(t,[{key:"contrastLevel",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.contrastLevel}},{key:"isDark",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.isDark}},{key:"sourceColorHct",get:function(){if(!this.options)throw new Error("Scheme options is not set");return e.Hct.fromInt(this.options.sourceColorArgb)}}])}(),P=function(){function t(){this.schemeEntity=void 0,this.options=void 0}var r=t.prototype;return r.createOrUpdate=function(t){var r,n;this.options=l({},this.options,t,{sourcesColorHex:l({},null==(r=this.options)?void 0:r.sourcesColorHex,t.sourcesColorHex),palettes:l({},null==(n=this.options)?void 0:n.palettes,t.palettes)});var o=new Map;if(!this.options.sourcesColorHex.primary)throw new Error("Primary source color is not set");var i=e.argbFromHex(this.options.sourcesColorHex.primary),a=e.Hct.fromInt(i);if(this.options.palettes){for(var s=0,u=Object.entries(this.options.palettes);s<u.length;s++){var c=u[s],f=c[0],h=c[1],g=h.sourceColorkey,p=h.tonalPalette,d=void 0;if(g){var m=e.argbFromHex(this.options.sourcesColorHex[g]);d=p(e.Hct.fromInt(m))}else d=p(a);o.set(f,d)}this.schemeEntity=new b(l({},this.options,{palettes:o,sourceColorArgb:i}))}},r.get=function(){if(!this.schemeEntity)throw new Error("Scheme is not created");return this.schemeEntity},t}(),x=function(){function t(t){var e=t.schemeService,r=t.variantService;this.schemeService=void 0,this.variantService=void 0,this.schemeService=e,this.variantService=r}var e=t.prototype;return e.create=function(t){this.schemeService.createOrUpdate(l({},t,{sourcesColorHex:{primary:t.sourceColorHex}})),this.variantService.set(t.variant)},e.update=function(t){var e=l({},t);t.sourceColorHex&&(e.sourcesColorHex={primary:t.sourceColorHex}),this.schemeService.createOrUpdate(e),t.variant&&this.variantService.set(t.variant)},e.addCustomPalette=function(t,e){this.variantService.addCustomPalette(t,e)},t}(),w=function(){function t(t){var e=t.schemeService;this.customPalettes={},this.variantEntity=void 0,this.schemeService=void 0,this.schemeService=e}var r=t.prototype;return r.addCustomPalette=function(t,e){this.customPalettes[t]=e,this.update()},r.set=function(t){this.variantEntity=t,t.palettes.error||(t.palettes.error=function(){return e.TonalPalette.fromHueAndChroma(25,84)}),this.update()},r.update=function(){var t=this;if(this.variantEntity){var e={};Object.keys(this.variantEntity.palettes).forEach((function(r){e[r]={tonalPalette:t.variantEntity.palettes[r]}})),this.variantEntity.customPalettes&&Object.keys(this.customPalettes).forEach((function(r){e[r]={sourceColorkey:r,tonalPalette:t.variantEntity.customPalettes}})),this.schemeService.createOrUpdate({sourcesColorHex:this.customPalettes,palettes:e})}},t}(),D={schemeService:t.asClass(P).singleton(),variantService:t.asClass(w).singleton(),themeService:t.asClass(x).singleton()},F=function(t){var e=t.colorService,r=t.themeService,n=t.pluginService;this.colorService=void 0,this.themeService=void 0,this.pluginService=void 0,this.pluginService=n,this.colorService=e,this.themeService=r},H={appService:t.asClass(F).singleton()},T=function(t){return{fromPalettes:["primary","secondary","tertiary"],colors:{background:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:98},isBackground:!0},onBackground:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:10},background:function(e){return t.getColor("background").getDynamicColor()},contrastCurve:new d(3,3,4.5,7)},surface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:98},isBackground:!0},surfaceDim:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?6:87},isBackground:!0},surfaceBright:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?24:98},isBackground:!0},surfaceContainerLowest:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?4:100},isBackground:!0},surfaceContainerLow:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?10:96},isBackground:!0},surfaceContainer:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?12:94},isBackground:!0},surfaceContainerHigh:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?17:92},isBackground:!0},surfaceContainerHighest:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?22:90},isBackground:!0},onSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:10},background:function(e){return C(e,t)},contrastCurve:new d(4.5,7,11,21)},surfaceVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?30:90},isBackground:!0},onSurfaceVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?80:30},background:function(e){return C(e,t)},contrastCurve:new d(3,4.5,7,11)},inverseSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?90:20}},inverseOnSurface:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?20:95},background:function(e){return t.getColor("inverseSurface").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},outline:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?60:50},background:function(e){return C(e,t)},contrastCurve:new d(1.5,3,4.5,7)},outlineVariant:{palette:function(t){return t.getPalette("neutralVariant")},tone:function(t){return t.isDark?30:80},background:function(e){return C(e,t)},contrastCurve:new d(1,1,3,7)},shadow:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return 0}},scrim:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return 0}},surfaceTint:{palette:function(t){return t.getPalette("neutral")},tone:function(t){return t.isDark?80:40},isBackground:!0},secondaryContainer:{tone:function(t){var r=t.isDark?30:90;return function(t,r,n,o){var i=n,a=e.Hct.from(t,r,n);if(a.chroma<r)for(var s=a.chroma;a.chroma<r;){var u=e.Hct.from(t,r,i+=o?-1:1);if(s>u.chroma)break;if(Math.abs(u.chroma-r)<.4)break;Math.abs(u.chroma-r)<Math.abs(a.chroma-r)&&(a=u),s=Math.max(s,u.chroma)}return i}(t.getPalette("secondary").hue,t.getPalette("secondary").chroma,r,!t.isDark)}},onSecondaryContainer:{tone:function(e){return m.foregroundTone(t.getColor("secondaryContainer").getDynamicColor().tone(e),4.5)}},tertiaryContainer:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){var r=t.getPalette("tertiary").getHct(t.sourceColorHct.tone);return e.DislikeAnalyzer.fixIfDisliked(r).tone}},onTertiaryContainer:{palette:function(t){return t.getPalette("tertiary")},tone:function(e){return m.foregroundTone(t.getColor("tertiaryContainer").getDynamicColor().tone(e),4.5)}},error:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?80:40},isBackground:!0,background:function(e){return C(e,t)},contrastCurve:new d(3,4.5,7,11),toneDeltaPair:function(e){return new v(t.getColor("errorContainer").getDynamicColor(),t.getColor("error").getDynamicColor(),15,"nearer",!1)}},onError:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?20:100},background:function(e){return t.getColor("error").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},errorContainer:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?30:90},isBackground:!0,background:function(e){return C(e,t)},contrastCurve:new d(1,1,3,7),toneDeltaPair:function(e){return new v(t.getColor("errorContainer").getDynamicColor(),t.getColor("error").getDynamicColor(),15,"nearer",!1)}},onErrorContainer:{palette:function(t){return t.getPalette("error")},tone:function(t){return t.isDark?90:10},background:function(e){return t.getColor("errorContainer").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},onTertiaryFixed:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){return 10},background:function(e){return t.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(e){return t.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new d(4.5,7,11,21)},onTertiaryFixedVariant:{palette:function(t){return t.getPalette("tertiary")},tone:function(t){return 30},background:function(e){return t.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(e){return t.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new d(3,4.5,7,11)}}}},E=function(t,r,n){var o=t.hue;if(r.length!==n.length)throw new Error("mismatch between hue length "+r.length+" & rotations "+n.length);if(1===n.length)return e.sanitizeDegreesDouble(t.hue+n[0]);for(var i=r.length,a=0;a<=i-2;a++)if(r[a]<o&&o<r[a+1])return e.sanitizeDegreesDouble(o+n[a]);return o},O=function(){};p=O,O.tonalSpot={palettes:{primary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,36)},secondary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,16)},tertiary:function(t){return e.TonalPalette.fromHueAndChroma(e.sanitizeDegreesDouble(t.hue+60),24)},neutral:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,6)},neutralVariant:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,8)}},customPalettes:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,16)}},O.vibrant={palettes:{primary:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,200)},secondary:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.secondaryRotations),24)},tertiary:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.tertiaryRotations),32)},neutral:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,6)},neutralVariant:function(t){return e.TonalPalette.fromHueAndChroma(t.hue,8)}},customPalettes:function(t){return e.TonalPalette.fromHueAndChroma(E(t,p.hues,p.secondaryRotations),24)}},O.hues=[0,41,61,101,131,181,251,301,360],O.secondaryRotations=[18,15,10,12,15,18,15,12,12],O.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var M=function(){function t(t){var e=t.appService;this.configPath="./theme.config",this.appService=void 0,this.appService=e}var e=t.prototype;return e.loadConfig=function(t){var e=this.appService,r=e.themeService,n=e.colorService,o=e.pluginService,i=null!=t?t:this.getConfig(),a=i.contrastLevel,s=i.isDark,u=i.variant,c=i.palettes,l=i.colors,f=i.useDefaultColors,h=void 0===f||f,g=i.plugins;r.create({contrastLevel:void 0===a?0:a,isDark:void 0!==s&&s,sourceColorHex:i.sourceColor,variant:void 0===u?O.tonalSpot:u}),c&&Object.entries(c).forEach((function(t){return r.addCustomPalette(t[0],t[1])})),h&&n.addColors(T),l&&n.addColors(l),g&&(g.forEach((function(t){o.addPlugin(t)})),o.loadPlugins(this.appService))},e.getConfig=function(){for(var t=r.resolve(this.configPath),e=null,o=0,i=[".js",".ts",".jms",".jcs"];o<i.length;o++){var a=t+i[o];if(n.existsSync(a)){e=require(a);break}}if(!e)throw new Error("Configuration file not found");return"default"in e?e.default:e},t}(),A={configService:t.asClass(M).singleton()},B=function(){function t(){this.plugins=new Map}var e=t.prototype;return e.addPlugin=function(t){this.plugins.set(t.name,t)},e.loadPlugins=function(t){var e=this,r=new Map(this.plugins),n=0;do{n=r.size,r.forEach((function(n,o){0===n.dependencies.filter((function(t){return!e.plugins.has((new t).name)})).length&&(e.plugins.set(n.name,n.init(t)),r.delete(o))}))}while(0!=r.size&&r.size<n);if(r.size>0)throw new Error("Some plugins couldn't be loaded due to missing dependencies: "+Array.from(r.keys()))},e.getPlugin=function(t){var e=this.plugins.get((new t).name);if(!e)throw new Error("Plugin "+t.name+" not found");return e},t}(),j={pluginService:t.asClass(B).singleton()};function z(t,e){return e.forEach((function(e){Object.entries(e).forEach((function(e){t.register(e[0],e[1])}))})),t}var I=t.createContainer({injectionMode:t.InjectionMode.PROXY});function L(t){var e=I.resolve("configService");return null!=t&&t.path&&(e.configPath=t.path),e.loadConfig(null==t?void 0:t.config),I.resolve("appService")}z(I,[A,H,j,S,D]);var U,W=function(){function t(t){this.options=void 0,this.pluginInstance=void 0,this.options=t}var e=t.prototype;return e.init=function(t){return this.pluginInstance=new this.pluginClass(t,this.options),this.pluginInstance.onInit(),this},e.getInstance=function(){if(!this.pluginInstance)throw new Error("Plugin "+this.name+" is not initialized");return this.pluginInstance},t}(),_=function(t,e){this.appService=void 0,this.options=void 0,this.appService=t,this.options=e,this.onInit()};exports.FontFamily=void 0,(U=exports.FontFamily||(exports.FontFamily={})).Expressive="expressive",U.Neutral="neutral";var V=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).dependencies=[],e.name="font",e.pluginClass=N,e}return f(e,t),e}(W),N=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this)._fontFamily=void 0,e._fontStyles=void 0,e}f(e,t);var r=e.prototype;return r.getFonts=function(){return{fontStyles:this.fontStyles,fontFamily:this.fontFamily}},r.onInit=function(){var t,e,r,n,o=this;this.fontFamily={expressive:null!=(t=null==(e=this.options)||null==(e=e.fontFamily)?void 0:e.expressive)?t:["Roboto","sans-serif"],neutral:null!=(r=null==(n=this.options)||null==(n=n.fontFamily)?void 0:n.neutral)?r:["Roboto","sans-serif"]},this.fontStyles={display:{large:{fontWeight:400,fontSize:3.5625,lineHeight:4,letterSpacing:-.015625,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:2.8125,lineHeight:3.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:2.25,lineHeight:2.75,fontFamily:exports.FontFamily.Expressive}},headline:{large:{fontWeight:400,fontSize:2,lineHeight:2.5,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:1.75,lineHeight:2.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:1.5,lineHeight:2,fontFamily:exports.FontFamily.Expressive}},title:{large:{fontWeight:400,fontSize:1.375,lineHeight:1.75,fontFamily:exports.FontFamily.Neutral},medium:{fontWeight:500,fontSize:1,lineHeight:1.5,fontFamily:exports.FontFamily.Neutral,letterSpacing:.009375},small:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625}},label:{large:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625},medium:{fontWeight:500,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},small:{fontWeight:500,fontSize:.6875,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125}},body:{large:{fontWeight:400,fontSize:1,lineHeight:1.5625,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},medium:{fontWeight:400,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.015625},small:{fontWeight:400,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.025}}},this.options&&this.options.fontStyles&&Object.entries(this.options.fontStyles).forEach((function(t){var e=t[0];Object.entries(t[1]).forEach((function(t){var r=t[0],n=t[1];n&&(o.fontStyles[e][r]=l({},o.fontStyles[e][r],n))}))}))},u(e,[{key:"fontFamily",get:function(){if(!this._fontFamily)throw new Error("Font family not initialized");return this._fontFamily},set:function(t){this._fontFamily=t}},{key:"fontStyles",get:function(){if(!this._fontStyles)throw new Error("Font styles not initialized");return this._fontStyles},set:function(t){this._fontStyles=t}}])}(_),R=function(t){return o((function(e){q(e,{statePrefix:"state",disabledStyles:{textOpacity:.38,backgroundOpacity:.12},transition:{duration:150}},t)}),{})},q=function(t,e,r){for(var n=t.addComponents,o=e.statePrefix,i=e.disabledStyles,a=e.transition,s={},u=0,l=[!1,!0];u<l.length;u++)for(var f,h=l[u]?"group-":"",g=c(r);!(f=g()).done;){var p,d=f.value,m="."+h+o+"-"+d;s[m]=((p={})["@apply "+h+"hover:bg-"+d+"/[0.08]"]={},p["@apply "+h+"active:bg-"+d+"/[0.12]"]={},p["@apply "+h+"focus-visible:bg-"+d+"/[0.12]"]={},p),a&&(s[m]["@apply transition-colors"]={},s[m]["@apply duration-"+a.duration]={}),i&&(s[m]["@apply "+h+"disabled:text-on-surface/["+i.textOpacity+"]"]={},s[m]["@apply "+h+"disabled:bg-on-surface/["+i.backgroundOpacity+"]"]={})}for(var v,y=c(r);!(v=y()).done;)for(var C=v.value,k=0,S=["hover","active","focus","disabled"];k<S.length;k++){var b,P=S[k],x="."+P+"-"+o+"-"+C;if("active"===P||"focus"===P)s[x]=((b={})["@apply bg-"+C+"/[0.12]"]={},b);else if("hover"===P){var w;s[x]=((w={})["@apply bg-"+C+"/[0.08]"]={},w)}else if("disabled"===P){var D,F;s[x]=((D={})["@apply text-on-surface/["+i.textOpacity+"]"]={},D),s[x]=((F={})["@apply bg-on-surface/["+i.backgroundOpacity+"]"]={},F)}}n(s)};function $(t){var e=t.name,r=t.darkMode,n=t.isDarkTheme;return{name:n?e+"Dark":e,selectors:n&&"class"===r?[".dark-mode .theme-"+e,".dark-mode.theme-"+e,'[data-theme="dark"] .theme-'+e,'[data-theme="dark"].theme-'+e]:[".theme-"+e,".theme-"+e+" .light-mode",".theme-"+e+' [data-theme="light"]',".light-mode .theme-"+e,".light-mode.theme-"+e,'[data-theme="light"] .theme-'+e,'[data-theme="light"].theme-'+e],mediaQuery:n&&"media"===r?"@media (prefers-color-scheme: dark)":void 0,extend:{colors:t.colors}}}var Z=function(t){var e=t.appService,r=e.themeService,n=e.colorService,o={defaultTheme:{extend:{colors:{}}},themes:[{name:"darkTheme",extend:{colors:{}}}]};return Object.entries(t.colors).forEach((function(t){var e=t[0],r=t[1];o.defaultTheme.extend.colors[e]=r.light,o.themes[0].extend.colors[e]=r.dark})),o.themes[0].selectors="class"===t.darkMode?[".dark-mode",'[data-theme="dark"]']:void 0,o.themes[0].mediaQuery="media"===t.darkMode?"@media (prefers-color-scheme: dark)":void 0,t.subThemes&&Object.entries(t.subThemes).forEach((function(e){var i=e[0];r.update({sourceColorHex:e[1]});for(var a=0,s=[!0,!1];a<s.length;a++){var u=s[a],l={};r.update({isDark:u});for(var f,h=c(n.getColors().entries());!(f=h()).done;){var g=f.value,p=g[1];l[g[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()]=p.getHex()}o.themes.push($({name:i,isDarkTheme:u,darkMode:t.darkMode,colors:l}))}})),require("tailwindcss-themer")(o)},Q=function(t,e){return o((function(r){(0,r.addUtilities)(function(r){for(var n=r.theme,o="rem",i={},a=function(t){return{fontSize:t.fontSize+o,fontWeight:t.fontWeight,lineHeight:t.lineHeight+o,letterSpacing:t.letterSpacing?t.letterSpacing+o:null,fontFamily:n("fontFamily."+t.fontFamily)}},s=function(t,e,r){var i;return(i={})["@media (min-width: "+n("screens."+e,{})+")"]={fontSize:t.fontSize*r+o,lineHeight:t.lineHeight*r+o},i},u=0,c=Object.entries(t);u<c.length;u++)for(var f=c[u],h=f[0],g=function(){var t=d[p],r=t[1];i[".text-"+h+"-"+t[0]]=l({},a(r),Object.entries(e).reduce((function(t,e){return l({},t,s(r,e[0],e[1]))}),{}))},p=0,d=Object.entries(f[1]);p<d.length;p++)g();return i}({theme:r.theme}))}))},X=function(t){function e(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return(e=t.call.apply(t,[this].concat(n))||this).dependencies=[V],e.name="tailwind",e.pluginClass=Y,e}return f(e,t),e}(W),Y=function(t){function e(){return t.apply(this,arguments)||this}f(e,t);var r=e.prototype;return r.onInit=function(){var t,e;null!=(t=this.options).darkMode||(t.darkMode="class"),null!=(e=this.options).responsiveBreakPoints||(e.responsiveBreakPoints={lg:1.125})},r.getTheme=function(){for(var t={},e=0,r=[!1,!0];e<r.length;e++){var n=r[e];this.appService.themeService.update({isDark:n});for(var o,i=c(this.appService.colorService.getColors().entries());!(o=i()).done;){var a=o.value,s=a[1],u=a[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();null!=t[u]||(t[u]={light:"",dark:""}),t[u][n?"dark":"light"]=s.getHex()}}var l=this.appService.pluginService.getPlugin(V).getInstance().getFonts(),f=l.fontStyles;return{colors:{},fontFamily:l.fontFamily,plugins:[R(Object.keys(t)),Q(f,this.options.responsiveBreakPoints),Z({colors:t,darkMode:this.options.darkMode,subThemes:this.options.subThemes,appService:this.appService})]}},e}(_);exports.AppContainer=I,exports.AppModule=H,exports.AppService=F,exports.ColorEntity=y,exports.ColorManagerService=k,exports.ColorModule=S,exports.ColorService=i,exports.ConfigModule=A,exports.ConfigService=M,exports.ContrastCurve=d,exports.DynamicColor=m,exports.FontPlugin=V,exports.PluginAbstract=W,exports.PluginImplAbstract=_,exports.PluginModule=j,exports.PluginService=B,exports.SchemeEntity=b,exports.SchemeService=P,exports.TailwindPlugin=X,exports.ThemeModule=D,exports.ThemeService=x,exports.ToneDeltaPair=v,exports.VariantEntity=function(t,e){void 0===t&&(t={}),this.palettes=void 0,this.customPalettes=void 0,this.palettes=t,this.customPalettes=e},exports.VariantModel=O,exports.VariantService=w,exports.bootstrap=function(){return I.resolve("appService")},exports.bootstrapFromConfig=L,exports.createTheme=function(){var t=L();return l({},t.pluginService.getPlugin(X).getInstance().getTheme(),{appService:t})},exports.defaultColors=T,exports.defineConfig=function(t){if(!t||"object"!=typeof t)throw new Error("The configuration is missing or not an object");if(!("sourceColor"in t))throw new Error("Invalid configuration");return t},exports.getRotatedHue=E,exports.highestSurface=C,exports.importContainer=z,exports.state=R,exports.themer=Z;
2
2
  //# sourceMappingURL=theme.cjs.production.min.js.map