@mhmo91/schmancy 0.1.3 → 0.2.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.
Files changed (225) hide show
  1. package/dist/{animated-text-CXWL8BLX.js → animated-text-B9SdI5HG.js} +3 -3
  2. package/dist/{animated-text-CXWL8BLX.js.map → animated-text-B9SdI5HG.js.map} +1 -1
  3. package/dist/{animated-text-Be1GRrxM.cjs → animated-text-nDP_F5VC.cjs} +2 -2
  4. package/dist/{animated-text-Be1GRrxM.cjs.map → animated-text-nDP_F5VC.cjs.map} +1 -1
  5. package/dist/animated-text.cjs +1 -1
  6. package/dist/animated-text.js +1 -1
  7. package/dist/area.cjs +1 -1
  8. package/dist/{area.component-lv5p1JAi.js → area.component-AMUgdMqi.js} +3 -3
  9. package/dist/{area.component-lv5p1JAi.js.map → area.component-AMUgdMqi.js.map} +1 -1
  10. package/dist/{area.component-BdOz0QVI.cjs → area.component-DpO04rGR.cjs} +2 -2
  11. package/dist/{area.component-BdOz0QVI.cjs.map → area.component-DpO04rGR.cjs.map} +1 -1
  12. package/dist/area.js +1 -1
  13. package/dist/{autocomplete-DUasFfQd.cjs → autocomplete-DRBBs-YO.cjs} +2 -2
  14. package/dist/{autocomplete-DUasFfQd.cjs.map → autocomplete-DRBBs-YO.cjs.map} +1 -1
  15. package/dist/{autocomplete-IIohssup.js → autocomplete-S7nz-gls.js} +3 -3
  16. package/dist/{autocomplete-IIohssup.js.map → autocomplete-S7nz-gls.js.map} +1 -1
  17. package/dist/autocomplete.cjs +1 -1
  18. package/dist/autocomplete.js +1 -1
  19. package/dist/busy.cjs +1 -1
  20. package/dist/busy.js +1 -1
  21. package/dist/button.cjs +1 -1
  22. package/dist/button.js +1 -1
  23. package/dist/card.cjs +1 -1
  24. package/dist/card.js +1 -1
  25. package/dist/{checkbox-rX1ai5aE.js → checkbox-DNbOp9CO.js} +2 -2
  26. package/dist/{checkbox-rX1ai5aE.js.map → checkbox-DNbOp9CO.js.map} +1 -1
  27. package/dist/{checkbox-UGSiC4-7.cjs → checkbox-DV_o7EFp.cjs} +2 -2
  28. package/dist/{checkbox-UGSiC4-7.cjs.map → checkbox-DV_o7EFp.cjs.map} +1 -1
  29. package/dist/checkbox.cjs +1 -1
  30. package/dist/checkbox.js +1 -1
  31. package/dist/{chips-DKyOFX0b.js → chips-B1DqsDUN.js} +3 -3
  32. package/dist/{chips-DKyOFX0b.js.map → chips-B1DqsDUN.js.map} +1 -1
  33. package/dist/{chips-42rqq7eR.cjs → chips-Cv0qcGHx.cjs} +2 -2
  34. package/dist/{chips-42rqq7eR.cjs.map → chips-Cv0qcGHx.cjs.map} +1 -1
  35. package/dist/chips.cjs +1 -1
  36. package/dist/chips.js +1 -1
  37. package/dist/components.cjs +1 -1
  38. package/dist/components.js +1 -1
  39. package/dist/content-drawer.cjs +1 -1
  40. package/dist/content-drawer.js +1 -1
  41. package/dist/{date-range-Cv7J4zqk.js → date-range-BRkCPAff.js} +3 -3
  42. package/dist/{date-range-Cv7J4zqk.js.map → date-range-BRkCPAff.js.map} +1 -1
  43. package/dist/{date-range-Dx0X9XkD.cjs → date-range-CY-DT-VU.cjs} +2 -2
  44. package/dist/{date-range-Dx0X9XkD.cjs.map → date-range-CY-DT-VU.cjs.map} +1 -1
  45. package/dist/date-range.cjs +1 -1
  46. package/dist/date-range.js +1 -1
  47. package/dist/{delay-DDTFbzUT.js → delay-B7VUwnDz.js} +2 -2
  48. package/dist/{delay-DDTFbzUT.js.map → delay-B7VUwnDz.js.map} +1 -1
  49. package/dist/{delay-BknG_sX0.cjs → delay-BPyG3Kp9.cjs} +2 -2
  50. package/dist/{delay-BknG_sX0.cjs.map → delay-BPyG3Kp9.cjs.map} +1 -1
  51. package/dist/delay.cjs +1 -1
  52. package/dist/delay.js +1 -1
  53. package/dist/{divider-CA2cFFcc.cjs → divider-B_ON7uf5.cjs} +2 -2
  54. package/dist/{divider-CA2cFFcc.cjs.map → divider-B_ON7uf5.cjs.map} +1 -1
  55. package/dist/{divider-LocxHBJv.js → divider-DpHFBFrA.js} +3 -3
  56. package/dist/{divider-LocxHBJv.js.map → divider-DpHFBFrA.js.map} +1 -1
  57. package/dist/divider.cjs +1 -1
  58. package/dist/divider.js +1 -1
  59. package/dist/{form-BV79BLFu.js → form-DD-SYyrx.js} +2 -2
  60. package/dist/{form-BV79BLFu.js.map → form-DD-SYyrx.js.map} +1 -1
  61. package/dist/{form-RAgk2SSz.cjs → form-jopPseAf.cjs} +2 -2
  62. package/dist/{form-RAgk2SSz.cjs.map → form-jopPseAf.cjs.map} +1 -1
  63. package/dist/form.cjs +1 -1
  64. package/dist/form.js +1 -1
  65. package/dist/{icon-DBIGGdxd.cjs → icon-C_FPBlRN.cjs} +2 -2
  66. package/dist/{icon-DBIGGdxd.cjs.map → icon-C_FPBlRN.cjs.map} +1 -1
  67. package/dist/{icon-DMom-EmW.js → icon-Dl79Z-46.js} +3 -3
  68. package/dist/{icon-DMom-EmW.js.map → icon-Dl79Z-46.js.map} +1 -1
  69. package/dist/{icon-button-B1siCgt2.js → icon-button-BkcXisF4.js} +3 -3
  70. package/dist/{icon-button-B1siCgt2.js.map → icon-button-BkcXisF4.js.map} +1 -1
  71. package/dist/{icon-button-cP-S-rgo.cjs → icon-button-C5VXKLyn.cjs} +2 -2
  72. package/dist/{icon-button-cP-S-rgo.cjs.map → icon-button-C5VXKLyn.cjs.map} +1 -1
  73. package/dist/icons.cjs +1 -1
  74. package/dist/icons.js +1 -1
  75. package/dist/index.cjs +1 -1
  76. package/dist/index.js +92 -92
  77. package/dist/index.js.map +1 -1
  78. package/dist/{input-JeE5xI6K.js → input-Dv_d3Ube.js} +2 -2
  79. package/dist/{input-JeE5xI6K.js.map → input-Dv_d3Ube.js.map} +1 -1
  80. package/dist/{input-BE2Nmifh.cjs → input-DzOE-efI.cjs} +2 -2
  81. package/dist/{input-BE2Nmifh.cjs.map → input-DzOE-efI.cjs.map} +1 -1
  82. package/dist/input.cjs +1 -1
  83. package/dist/input.js +1 -1
  84. package/dist/layout.cjs +1 -1
  85. package/dist/layout.js +1 -1
  86. package/dist/list.cjs +1 -1
  87. package/dist/list.js +1 -1
  88. package/dist/{litElement.mixin-BQQ8SViR.js → litElement.mixin-BcBF7FRS.js} +2 -2
  89. package/dist/{litElement.mixin-BQQ8SViR.js.map → litElement.mixin-BcBF7FRS.js.map} +1 -1
  90. package/dist/{litElement.mixin-T2hfvva-.cjs → litElement.mixin-IGVWivq2.cjs} +2 -2
  91. package/dist/{litElement.mixin-T2hfvva-.cjs.map → litElement.mixin-IGVWivq2.cjs.map} +1 -1
  92. package/dist/{menu-CcoCzR8e.cjs → menu-BMJZsO7u.cjs} +2 -2
  93. package/dist/{menu-CcoCzR8e.cjs.map → menu-BMJZsO7u.cjs.map} +1 -1
  94. package/dist/{menu-HLuts8V3.js → menu-CDsJkpu5.js} +3 -3
  95. package/dist/{menu-HLuts8V3.js.map → menu-CDsJkpu5.js.map} +1 -1
  96. package/dist/menu.cjs +1 -1
  97. package/dist/menu.js +1 -1
  98. package/dist/mixins/tailwind.css +392 -1
  99. package/dist/nav-drawer.cjs +1 -1
  100. package/dist/nav-drawer.js +1 -1
  101. package/dist/notification.cjs +1 -1
  102. package/dist/notification.js +1 -1
  103. package/dist/{option-Bzi4aanD.cjs → option-1bQVbrEt.cjs} +2 -2
  104. package/dist/{option-Bzi4aanD.cjs.map → option-1bQVbrEt.cjs.map} +1 -1
  105. package/dist/{option-C5egpChO.js → option-DIpHfpFS.js} +2 -2
  106. package/dist/{option-C5egpChO.js.map → option-DIpHfpFS.js.map} +1 -1
  107. package/dist/option.cjs +1 -1
  108. package/dist/option.js +1 -1
  109. package/dist/{outlet-CQ6YXEen.cjs → outlet-BvAT4m3r.cjs} +2 -2
  110. package/dist/{outlet-CQ6YXEen.cjs.map → outlet-BvAT4m3r.cjs.map} +1 -1
  111. package/dist/{outlet-CXxpQ37y.js → outlet-Ci9xMSJ0.js} +2 -2
  112. package/dist/{outlet-CXxpQ37y.js.map → outlet-Ci9xMSJ0.js.map} +1 -1
  113. package/dist/{payment-card-form-DNI4IjK7.cjs → payment-card-form-Cd66MCeM.cjs} +2 -2
  114. package/dist/{payment-card-form-DNI4IjK7.cjs.map → payment-card-form-Cd66MCeM.cjs.map} +1 -1
  115. package/dist/{payment-card-form-BNCVkn4A.js → payment-card-form-DrWyUhkX.js} +3 -3
  116. package/dist/{payment-card-form-BNCVkn4A.js.map → payment-card-form-DrWyUhkX.js.map} +1 -1
  117. package/dist/{radio-group-CPmdicYZ.js → radio-group-DwAtByja.js} +2 -2
  118. package/dist/{radio-group-CPmdicYZ.js.map → radio-group-DwAtByja.js.map} +1 -1
  119. package/dist/{radio-group-DiecmCUy.cjs → radio-group-SlWpazT2.cjs} +2 -2
  120. package/dist/{radio-group-DiecmCUy.cjs.map → radio-group-SlWpazT2.cjs.map} +1 -1
  121. package/dist/radio-group.cjs +1 -1
  122. package/dist/radio-group.js +1 -1
  123. package/dist/{scroll-C2AdiqOm.js → scroll-BFAm-L6v.js} +2 -2
  124. package/dist/{scroll-C2AdiqOm.js.map → scroll-BFAm-L6v.js.map} +1 -1
  125. package/dist/{scroll-CmQioZO_.cjs → scroll-CFfZT7gH.cjs} +2 -2
  126. package/dist/{scroll-CmQioZO_.cjs.map → scroll-CFfZT7gH.cjs.map} +1 -1
  127. package/dist/{select-BPPcWB35.cjs → select-Bq3rx22N.cjs} +2 -2
  128. package/dist/{select-BPPcWB35.cjs.map → select-Bq3rx22N.cjs.map} +1 -1
  129. package/dist/{select-CHqzliGG.js → select-D1iuS17j.js} +3 -3
  130. package/dist/{select-CHqzliGG.js.map → select-D1iuS17j.js.map} +1 -1
  131. package/dist/select.cjs +1 -1
  132. package/dist/select.js +1 -1
  133. package/dist/{sheet-KV0oZtrR.cjs → sheet-CiWmylhJ.cjs} +2 -2
  134. package/dist/{sheet-KV0oZtrR.cjs.map → sheet-CiWmylhJ.cjs.map} +1 -1
  135. package/dist/{sheet-CGmu7xn7.js → sheet-DRevGqjY.js} +3 -3
  136. package/dist/{sheet-CGmu7xn7.js.map → sheet-DRevGqjY.js.map} +1 -1
  137. package/dist/sheet.cjs +1 -1
  138. package/dist/sheet.js +1 -1
  139. package/dist/{slider-D8zKzxgN.cjs → slider-CR1AnZQy.cjs} +2 -2
  140. package/dist/{slider-D8zKzxgN.cjs.map → slider-CR1AnZQy.cjs.map} +1 -1
  141. package/dist/{slider-D-M3pFtn.js → slider-Dqe5E2F9.js} +3 -3
  142. package/dist/{slider-D-M3pFtn.js.map → slider-Dqe5E2F9.js.map} +1 -1
  143. package/dist/slider.cjs +1 -1
  144. package/dist/slider.js +1 -1
  145. package/dist/{spinner-C-2I7yH9.cjs → spinner-gZpHGbro.cjs} +2 -2
  146. package/dist/{spinner-C-2I7yH9.cjs.map → spinner-gZpHGbro.cjs.map} +1 -1
  147. package/dist/{spinner-Bxpq8jN0.js → spinner-tOzccpuH.js} +3 -3
  148. package/dist/{spinner-Bxpq8jN0.js.map → spinner-tOzccpuH.js.map} +1 -1
  149. package/dist/{surface-B0Wpttcp.js → surface-PcBZIgVN.js} +2 -2
  150. package/dist/{surface-B0Wpttcp.js.map → surface-PcBZIgVN.js.map} +1 -1
  151. package/dist/{surface-K6V6QGZ7.cjs → surface-teeIR4jt.cjs} +2 -2
  152. package/dist/{surface-K6V6QGZ7.cjs.map → surface-teeIR4jt.cjs.map} +1 -1
  153. package/dist/surface.cjs +1 -1
  154. package/dist/surface.js +1 -1
  155. package/dist/{table-CNa5CVCb.cjs → table-D0scRpUa.cjs} +2 -2
  156. package/dist/{table-CNa5CVCb.cjs.map → table-D0scRpUa.cjs.map} +1 -1
  157. package/dist/{table-DXYjwhsS.js → table-Dfip6wRe.js} +2 -2
  158. package/dist/{table-DXYjwhsS.js.map → table-Dfip6wRe.js.map} +1 -1
  159. package/dist/table.cjs +1 -1
  160. package/dist/table.js +1 -1
  161. package/dist/{tabs-group-jVXSw4vO.js → tabs-group-BUtko5gD.js} +2 -2
  162. package/dist/{tabs-group-jVXSw4vO.js.map → tabs-group-BUtko5gD.js.map} +1 -1
  163. package/dist/{tabs-group-B6L2cvkm.cjs → tabs-group-D469QufO.cjs} +2 -2
  164. package/dist/{tabs-group-B6L2cvkm.cjs.map → tabs-group-D469QufO.cjs.map} +1 -1
  165. package/dist/tabs.cjs +1 -1
  166. package/dist/tabs.js +1 -1
  167. package/dist/tailwind.mixin-Cwk3HTxV.js +43 -0
  168. package/dist/{tailwind.mixin-DZctuRzi.js.map → tailwind.mixin-Cwk3HTxV.js.map} +1 -1
  169. package/dist/tailwind.mixin-TcrSCY6e.cjs +2 -0
  170. package/dist/{tailwind.mixin-BXsGUMQ1.cjs.map → tailwind.mixin-TcrSCY6e.cjs.map} +1 -1
  171. package/dist/teleport.cjs +1 -1
  172. package/dist/teleport.component-CJ1tlZZL.cjs +173 -0
  173. package/dist/teleport.component-CJ1tlZZL.cjs.map +1 -0
  174. package/dist/{theme-button-BQZkb1t4.js → teleport.component-CgNOwz49.js} +177 -188
  175. package/dist/teleport.component-CgNOwz49.js.map +1 -0
  176. package/dist/teleport.js +1 -1
  177. package/dist/{textarea-Buxkp6z0.js → textarea-BRE-ZxNE.js} +2 -2
  178. package/dist/{textarea-Buxkp6z0.js.map → textarea-BRE-ZxNE.js.map} +1 -1
  179. package/dist/{textarea-B6Pl8Y2D.cjs → textarea-Dd0cdn5f.cjs} +2 -2
  180. package/dist/{textarea-B6Pl8Y2D.cjs.map → textarea-Dd0cdn5f.cjs.map} +1 -1
  181. package/dist/textarea.cjs +1 -1
  182. package/dist/textarea.js +1 -1
  183. package/dist/theme-button-B3n5iZsE.js +26 -0
  184. package/dist/theme-button-B3n5iZsE.js.map +1 -0
  185. package/dist/theme-button-BYxPN54_.cjs +9 -0
  186. package/dist/theme-button-BYxPN54_.cjs.map +1 -0
  187. package/dist/theme-button.cjs +1 -1
  188. package/dist/theme-button.js +1 -1
  189. package/dist/theme.cjs +1 -1
  190. package/dist/theme.component-CqFcwW_5.cjs +3 -0
  191. package/dist/theme.component-CqFcwW_5.cjs.map +1 -0
  192. package/dist/theme.component-DELqRYyh.js +725 -0
  193. package/dist/theme.component-DELqRYyh.js.map +1 -0
  194. package/dist/theme.js +4 -5
  195. package/dist/{tree-7PVEhRCU.js → tree-C-rEmlo4.js} +2 -2
  196. package/dist/{tree-7PVEhRCU.js.map → tree-C-rEmlo4.js.map} +1 -1
  197. package/dist/{tree-nmdWfp9I.cjs → tree-C38O9nQ9.cjs} +2 -2
  198. package/dist/{tree-nmdWfp9I.cjs.map → tree-C38O9nQ9.cjs.map} +1 -1
  199. package/dist/tree.cjs +1 -1
  200. package/dist/tree.js +1 -1
  201. package/dist/{typewriter-ZnPAe8JA.js → typewriter-BJW4ypAk.js} +4 -4
  202. package/dist/{typewriter-ZnPAe8JA.js.map → typewriter-BJW4ypAk.js.map} +1 -1
  203. package/dist/{typewriter-DnGkvyDG.cjs → typewriter-BdsCux99.cjs} +2 -2
  204. package/dist/{typewriter-DnGkvyDG.cjs.map → typewriter-BdsCux99.cjs.map} +1 -1
  205. package/dist/typewriter.cjs +1 -1
  206. package/dist/typewriter.js +1 -1
  207. package/dist/{typography-oGjgh4qJ.cjs → typography-BAI6fEiW.cjs} +2 -2
  208. package/dist/{typography-oGjgh4qJ.cjs.map → typography-BAI6fEiW.cjs.map} +1 -1
  209. package/dist/{typography-L0ZKDX-X.js → typography-BFPivXLr.js} +2 -2
  210. package/dist/{typography-L0ZKDX-X.js.map → typography-BFPivXLr.js.map} +1 -1
  211. package/dist/typography.cjs +1 -1
  212. package/dist/typography.js +1 -1
  213. package/package.json +1 -1
  214. package/types/src/nav-drawer/navbar.d.ts +3 -1
  215. package/types/src/theme/index.d.ts +1 -2
  216. package/types/src/theme/theme.component.d.ts +18 -0
  217. package/dist/dynamicTheme-BYlTubq6.cjs +0 -3
  218. package/dist/dynamicTheme-BYlTubq6.cjs.map +0 -1
  219. package/dist/dynamicTheme-DYtQDYE_.js +0 -721
  220. package/dist/dynamicTheme-DYtQDYE_.js.map +0 -1
  221. package/dist/tailwind.mixin-BXsGUMQ1.cjs +0 -2
  222. package/dist/tailwind.mixin-DZctuRzi.js +0 -43
  223. package/dist/theme-button-BQZkb1t4.js.map +0 -1
  224. package/dist/theme-button-CWM-0CJh.cjs +0 -180
  225. package/dist/theme-button-CWM-0CJh.cjs.map +0 -1
@@ -1,3 +0,0 @@
1
- "use strict";const N=require("rxjs");function Me(e="schmancy",r,t){return typeof t=="object"?Object.keys(t).map(a=>Me(e,r+(r?"-":"")+a,t[a])).join(`
2
- `):void document.documentElement.style.setProperty(`--${e}-${r}`,t)}const ye=new N.Subject,ce=new N.Subject;function H(e){return e<0?-1:e===0?0:1}function Z(e,r,t){return(1-t)*e+t*r}function ie(e,r,t){return t<e?e:t>r?r:t}function ue(e){return(e%=360)<0&&(e+=360),e}function he(e,r){return[e[0]*r[0][0]+e[1]*r[0][1]+e[2]*r[0][2],e[0]*r[1][0]+e[1]*r[1][1]+e[2]*r[1][2],e[0]*r[2][0]+e[1]*r[2][1]+e[2]*r[2][2]]}ce.pipe().subscribe(e=>{Me("schmancy","",e)});const Te=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],Se=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],Fe=[95.047,100,108.883];function pe(e,r,t){return(255<<24|(255&e)<<16|(255&r)<<8|255&t)>>>0}function xe(e){return pe($(e[0]),$(e[1]),$(e[2]))}function le(e){const r=function(t){const a=W(function(s){return s>>16&255}(t)),n=W(function(s){return s>>8&255}(t)),i=W(function(s){return 255&s}(t));return he([a,n,i],Te)}(e)[1];return 116*be(r/100)-16}function J(e){return 100*function(r){const t=903.2962962962963,a=r*r*r;return a>216/24389?a:(116*r-16)/t}((e+16)/116)}function me(e){return 116*be(e/100)-16}function W(e){const r=e/255;return r<=.040449936?r/12.92*100:100*Math.pow((r+.055)/1.055,2.4)}function $(e){const r=e/100;let t=0;return t=r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055,a=0,n=255,(i=Math.round(255*t))<a?a:i>n?n:i;var a,n,i}function be(e){return e>216/24389?Math.pow(e,1/3):(903.2962962962963*e+16)/116}class _{static make(r=function(){return Fe}(),t=200/Math.PI*J(50)/100,a=50,n=2,i=!1){const s=r,c=.401288*s[0]+.650173*s[1]+-.051461*s[2],u=-.250268*s[0]+1.204414*s[1]+.045854*s[2],h=-.002079*s[0]+.048952*s[1]+.953127*s[2],m=.8+n/10,g=m>=.9?Z(.59,.69,10*(m-.9)):Z(.525,.59,10*(m-.8));let C=i?1:m*(1-1/3.6*Math.exp((-t-42)/92));C=C>1?1:C<0?0:C;const w=m,f=[C*(100/c)+1-C,C*(100/u)+1-C,C*(100/h)+1-C],M=1/(5*t+1),b=M*M*M*M,v=1-b,y=b*t+.1*v*v*Math.cbrt(5*t),O=J(a)/r[1],x=1.48+Math.sqrt(O),P=.725/Math.pow(O,.2),S=P,k=[Math.pow(y*f[0]*c/100,.42),Math.pow(y*f[1]*u/100,.42),Math.pow(y*f[2]*h/100,.42)],T=[400*k[0]/(k[0]+27.13),400*k[1]/(k[1]+27.13),400*k[2]/(k[2]+27.13)];return new _(O,(2*T[0]+T[1]+.05*T[2])*P,P,S,g,w,f,y,Math.pow(y,.25),x)}constructor(r,t,a,n,i,s,c,u,h,m){this.n=r,this.aw=t,this.nbb=a,this.ncb=n,this.c=i,this.nc=s,this.rgbD=c,this.fl=u,this.fLRoot=h,this.z=m}}_.DEFAULT=_.make();class B{constructor(r,t,a,n,i,s,c,u,h){this.hue=r,this.chroma=t,this.j=a,this.q=n,this.m=i,this.s=s,this.jstar=c,this.astar=u,this.bstar=h}distance(r){const t=this.jstar-r.jstar,a=this.astar-r.astar,n=this.bstar-r.bstar,i=Math.sqrt(t*t+a*a+n*n);return 1.41*Math.pow(i,.63)}static fromInt(r){return B.fromIntInViewingConditions(r,_.DEFAULT)}static fromIntInViewingConditions(r,t){const a=(65280&r)>>8,n=255&r,i=W((16711680&r)>>16),s=W(a),c=W(n),u=.41233895*i+.35762064*s+.18051042*c,h=.2126*i+.7152*s+.0722*c,m=.01932141*i+.11916382*s+.95034478*c,g=.401288*u+.650173*h-.051461*m,C=-.250268*u+1.204414*h+.045854*m,w=-.002079*u+.048952*h+.953127*m,f=t.rgbD[0]*g,M=t.rgbD[1]*C,b=t.rgbD[2]*w,v=Math.pow(t.fl*Math.abs(f)/100,.42),y=Math.pow(t.fl*Math.abs(M)/100,.42),O=Math.pow(t.fl*Math.abs(b)/100,.42),x=400*H(f)*v/(v+27.13),P=400*H(M)*y/(y+27.13),S=400*H(b)*O/(O+27.13),k=(11*x+-12*P+S)/11,T=(x+P-2*S)/9,I=(20*x+20*P+21*S)/20,re=(40*x+20*P+S)/20,U=180*Math.atan2(T,k)/Math.PI,q=U<0?U+360:U>=360?U-360:U,j=q*Math.PI/180,R=re*t.nbb,z=100*Math.pow(R/t.aw,t.c*t.z),X=4/t.c*Math.sqrt(z/100)*(t.aw+4)*t.fLRoot,Q=q<20.14?q+360:q,te=5e4/13*(.25*(Math.cos(Q*Math.PI/180+2)+3.8))*t.nc*t.ncb*Math.sqrt(k*k+T*T)/(I+.305),ae=Math.pow(te,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),ne=ae*Math.sqrt(z/100),ge=ne*t.fLRoot,ke=50*Math.sqrt(ae*t.c/(t.aw+4)),De=(1+100*.007)*z/(1+.007*z),Ce=1/.0228*Math.log(1+.0228*ge),ve=Ce*Math.cos(j),Ie=Ce*Math.sin(j);return new B(q,ne,z,X,ge,ke,De,ve,Ie)}static fromJch(r,t,a){return B.fromJchInViewingConditions(r,t,a,_.DEFAULT)}static fromJchInViewingConditions(r,t,a,n){const i=4/n.c*Math.sqrt(r/100)*(n.aw+4)*n.fLRoot,s=t*n.fLRoot,c=t/Math.sqrt(r/100),u=50*Math.sqrt(c*n.c/(n.aw+4)),h=a*Math.PI/180,m=(1+100*.007)*r/(1+.007*r),g=1/.0228*Math.log(1+.0228*s),C=g*Math.cos(h),w=g*Math.sin(h);return new B(a,t,r,i,s,u,m,C,w)}static fromUcs(r,t,a){return B.fromUcsInViewingConditions(r,t,a,_.DEFAULT)}static fromUcsInViewingConditions(r,t,a,n){const i=t,s=a,c=Math.sqrt(i*i+s*s),u=(Math.exp(.0228*c)-1)/.0228/n.fLRoot;let h=Math.atan2(s,i)*(180/Math.PI);h<0&&(h+=360);const m=r/(1-.007*(r-100));return B.fromJchInViewingConditions(m,u,h,n)}toInt(){return this.viewed(_.DEFAULT)}viewed(r){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(t/Math.pow(1.64-Math.pow(.29,r.n),.73),1/.9),n=this.hue*Math.PI/180,i=.25*(Math.cos(n+2)+3.8),s=r.aw*Math.pow(this.j/100,1/r.c/r.z),c=i*(5e4/13)*r.nc*r.ncb,u=s/r.nbb,h=Math.sin(n),m=Math.cos(n),g=23*(u+.305)*a/(23*c+11*a*m+108*a*h),C=g*m,w=g*h,f=(460*u+451*C+288*w)/1403,M=(460*u-891*C-261*w)/1403,b=(460*u-220*C-6300*w)/1403,v=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),y=H(f)*(100/r.fl)*Math.pow(v,1/.42),O=Math.max(0,27.13*Math.abs(M)/(400-Math.abs(M))),x=H(M)*(100/r.fl)*Math.pow(O,1/.42),P=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),S=H(b)*(100/r.fl)*Math.pow(P,1/.42),k=y/r.rgbD[0],T=x/r.rgbD[1],I=S/r.rgbD[2];return function(U,q,j){const R=Se,z=R[0][0]*U+R[0][1]*q+R[0][2]*j,X=R[1][0]*U+R[1][1]*q+R[1][2]*j,Q=R[2][0]*U+R[2][1]*q+R[2][2]*j;return pe($(z),$(X),$(Q))}(1.86206786*k-1.01125463*T+.14918677*I,.38752654*k+.62144744*T-.00897398*I,-.0158415*k-.03412294*T+1.04996444*I)}static fromXyzInViewingConditions(r,t,a,n){const i=.401288*r+.650173*t-.051461*a,s=-.250268*r+1.204414*t+.045854*a,c=-.002079*r+.048952*t+.953127*a,u=n.rgbD[0]*i,h=n.rgbD[1]*s,m=n.rgbD[2]*c,g=Math.pow(n.fl*Math.abs(u)/100,.42),C=Math.pow(n.fl*Math.abs(h)/100,.42),w=Math.pow(n.fl*Math.abs(m)/100,.42),f=400*H(u)*g/(g+27.13),M=400*H(h)*C/(C+27.13),b=400*H(m)*w/(w+27.13),v=(11*f+-12*M+b)/11,y=(f+M-2*b)/9,O=(20*f+20*M+21*b)/20,x=(40*f+20*M+b)/20,P=180*Math.atan2(y,v)/Math.PI,S=P<0?P+360:P>=360?P-360:P,k=S*Math.PI/180,T=x*n.nbb,I=100*Math.pow(T/n.aw,n.c*n.z),re=4/n.c*Math.sqrt(I/100)*(n.aw+4)*n.fLRoot,U=S<20.14?S+360:S,q=5e4/13*(1/4*(Math.cos(U*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(v*v+y*y)/(O+.305),j=Math.pow(q,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),R=j*Math.sqrt(I/100),z=R*n.fLRoot,X=50*Math.sqrt(j*n.c/(n.aw+4)),Q=(1+100*.007)*I/(1+.007*I),te=Math.log(1+.0228*z)/.0228,ae=te*Math.cos(k),ne=te*Math.sin(k);return new B(S,R,I,re,z,X,Q,ae,ne)}xyzInViewingConditions(r){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),a=Math.pow(t/Math.pow(1.64-Math.pow(.29,r.n),.73),1/.9),n=this.hue*Math.PI/180,i=.25*(Math.cos(n+2)+3.8),s=r.aw*Math.pow(this.j/100,1/r.c/r.z),c=i*(5e4/13)*r.nc*r.ncb,u=s/r.nbb,h=Math.sin(n),m=Math.cos(n),g=23*(u+.305)*a/(23*c+11*a*m+108*a*h),C=g*m,w=g*h,f=(460*u+451*C+288*w)/1403,M=(460*u-891*C-261*w)/1403,b=(460*u-220*C-6300*w)/1403,v=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),y=H(f)*(100/r.fl)*Math.pow(v,1/.42),O=Math.max(0,27.13*Math.abs(M)/(400-Math.abs(M))),x=H(M)*(100/r.fl)*Math.pow(O,1/.42),P=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),S=H(b)*(100/r.fl)*Math.pow(P,1/.42),k=y/r.rgbD[0],T=x/r.rgbD[1],I=S/r.rgbD[2];return[1.86206786*k-1.01125463*T+.14918677*I,.38752654*k+.62144744*T-.00897398*I,-.0158415*k-.03412294*T+1.04996444*I]}}class p{static sanitizeRadians(r){return(r+8*Math.PI)%(2*Math.PI)}static trueDelinearized(r){const t=r/100;let a=0;return a=t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,255*a}static chromaticAdaptation(r){const t=Math.pow(Math.abs(r),.42);return 400*H(r)*t/(t+27.13)}static hueOf(r){const t=he(r,p.SCALED_DISCOUNT_FROM_LINRGB),a=p.chromaticAdaptation(t[0]),n=p.chromaticAdaptation(t[1]),i=p.chromaticAdaptation(t[2]),s=(11*a+-12*n+i)/11,c=(a+n-2*i)/9;return Math.atan2(c,s)}static areInCyclicOrder(r,t,a){return p.sanitizeRadians(t-r)<p.sanitizeRadians(a-r)}static intercept(r,t,a){return(t-r)/(a-r)}static lerpPoint(r,t,a){return[r[0]+(a[0]-r[0])*t,r[1]+(a[1]-r[1])*t,r[2]+(a[2]-r[2])*t]}static setCoordinate(r,t,a,n){const i=p.intercept(r[n],t,a[n]);return p.lerpPoint(r,i,a)}static isBounded(r){return 0<=r&&r<=100}static nthVertex(r,t){const a=p.Y_FROM_LINRGB[0],n=p.Y_FROM_LINRGB[1],i=p.Y_FROM_LINRGB[2],s=t%4<=1?0:100,c=t%2==0?0:100;if(t<4){const u=s,h=c,m=(r-u*n-h*i)/a;return p.isBounded(m)?[m,u,h]:[-1,-1,-1]}if(t<8){const u=s,h=c,m=(r-h*a-u*i)/n;return p.isBounded(m)?[h,m,u]:[-1,-1,-1]}{const u=s,h=c,m=(r-u*a-h*n)/i;return p.isBounded(m)?[u,h,m]:[-1,-1,-1]}}static bisectToSegment(r,t){let a=[-1,-1,-1],n=a,i=0,s=0,c=!1,u=!0;for(let h=0;h<12;h++){const m=p.nthVertex(r,h);if(m[0]<0)continue;const g=p.hueOf(m);c?(u||p.areInCyclicOrder(i,g,s))&&(u=!1,p.areInCyclicOrder(i,t,g)?(n=m,s=g):(a=m,i=g)):(a=m,n=m,i=g,s=g,c=!0)}return[a,n]}static midpoint(r,t){return[(r[0]+t[0])/2,(r[1]+t[1])/2,(r[2]+t[2])/2]}static criticalPlaneBelow(r){return Math.floor(r-.5)}static criticalPlaneAbove(r){return Math.ceil(r-.5)}static bisectToLimit(r,t){const a=p.bisectToSegment(r,t);let n=a[0],i=p.hueOf(n),s=a[1];for(let c=0;c<3;c++)if(n[c]!==s[c]){let u=-1,h=255;n[c]<s[c]?(u=p.criticalPlaneBelow(p.trueDelinearized(n[c])),h=p.criticalPlaneAbove(p.trueDelinearized(s[c]))):(u=p.criticalPlaneAbove(p.trueDelinearized(n[c])),h=p.criticalPlaneBelow(p.trueDelinearized(s[c])));for(let m=0;m<8&&!(Math.abs(h-u)<=1);m++){const g=Math.floor((u+h)/2),C=p.CRITICAL_PLANES[g],w=p.setCoordinate(n,C,s,c),f=p.hueOf(w);p.areInCyclicOrder(i,t,f)?(s=w,h=g):(n=w,i=f,u=g)}}return p.midpoint(n,s)}static inverseChromaticAdaptation(r){const t=Math.abs(r),a=Math.max(0,27.13*t/(400-t));return H(r)*Math.pow(a,1/.42)}static findResultByJ(r,t,a){let n=11*Math.sqrt(a);const i=_.DEFAULT,s=1/Math.pow(1.64-Math.pow(.29,i.n),.73),c=.25*(Math.cos(r+2)+3.8)*(5e4/13)*i.nc*i.ncb,u=Math.sin(r),h=Math.cos(r);for(let m=0;m<5;m++){const g=n/100,C=t===0||n===0?0:t/Math.sqrt(g),w=Math.pow(C*s,1/.9),f=i.aw*Math.pow(g,1/i.c/i.z)/i.nbb,M=23*(f+.305)*w/(23*c+11*w*h+108*w*u),b=M*h,v=M*u,y=(460*f+451*b+288*v)/1403,O=(460*f-891*b-261*v)/1403,x=(460*f-220*b-6300*v)/1403,P=he([p.inverseChromaticAdaptation(y),p.inverseChromaticAdaptation(O),p.inverseChromaticAdaptation(x)],p.LINRGB_FROM_SCALED_DISCOUNT);if(P[0]<0||P[1]<0||P[2]<0)return 0;const S=p.Y_FROM_LINRGB[0],k=p.Y_FROM_LINRGB[1],T=p.Y_FROM_LINRGB[2],I=S*P[0]+k*P[1]+T*P[2];if(I<=0)return 0;if(m===4||Math.abs(I-a)<.002)return P[0]>100.01||P[1]>100.01||P[2]>100.01?0:xe(P);n-=(I-a)*n/(2*I)}return 0}static solveToInt(r,t,a){if(t<1e-4||a<1e-4||a>99.9999)return function(c){const u=$(J(c));return pe(u,u,u)}(a);const n=(r=ue(r))/180*Math.PI,i=J(a),s=p.findResultByJ(n,t,i);return s!==0?s:xe(p.bisectToLimit(i,n))}static solveToCam(r,t,a){return B.fromInt(p.solveToInt(r,t,a))}}p.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],p.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],p.Y_FROM_LINRGB=[.2126,.7152,.0722],p.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776];class L{static from(r,t,a){return new L(p.solveToInt(r,t,a))}static fromInt(r){return new L(r)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(r){this.setInternalState(p.solveToInt(r,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(r){this.setInternalState(p.solveToInt(this.internalHue,r,this.internalTone))}get tone(){return this.internalTone}set tone(r){this.setInternalState(p.solveToInt(this.internalHue,this.internalChroma,r))}constructor(r){this.argb=r;const t=B.fromInt(r);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=le(r),this.argb=r}setInternalState(r){const t=B.fromInt(r);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=le(r),this.argb=r}inViewingConditions(r){const t=B.fromInt(this.toInt()).xyzInViewingConditions(r),a=B.fromXyzInViewingConditions(t[0],t[1],t[2],_.make());return L.from(a.hue,a.chroma,me(t[1]))}}class de{static harmonize(r,t){const a=L.fromInt(r),n=L.fromInt(t),i=(s=a.hue,c=n.hue,180-Math.abs(Math.abs(s-c)-180));var s,c;const u=Math.min(.5*i,15),h=ue(a.hue+u*(m=a.hue,ue(n.hue-m)<=180?1:-1));var m;return L.from(h,a.chroma,a.tone).toInt()}static hctHue(r,t,a){const n=de.cam16Ucs(r,t,a),i=B.fromInt(n),s=B.fromInt(r);return L.from(i.hue,s.chroma,le(r)).toInt()}static cam16Ucs(r,t,a){const n=B.fromInt(r),i=B.fromInt(t),s=n.jstar,c=n.astar,u=n.bstar,h=s+(i.jstar-s)*a,m=c+(i.astar-c)*a,g=u+(i.bstar-u)*a;return B.fromUcs(h,m,g).toInt()}}class F{static ratioOfTones(r,t){return r=ie(0,100,r),t=ie(0,100,t),F.ratioOfYs(J(r),J(t))}static ratioOfYs(r,t){const a=r>t?r:t;return(a+5)/((a===t?r:t)+5)}static lighter(r,t){if(r<0||r>100)return-1;const a=J(r),n=t*(a+5)-5,i=F.ratioOfYs(n,a),s=Math.abs(i-t);if(i<t&&s>.04)return-1;const c=me(n)+.4;return c<0||c>100?-1:c}static darker(r,t){if(r<0||r>100)return-1;const a=J(r),n=(a+5)/t-5,i=F.ratioOfYs(a,n),s=Math.abs(i-t);if(i<t&&s>.04)return-1;const c=me(n)-.4;return c<0||c>100?-1:c}static lighterUnsafe(r,t){const a=F.lighter(r,t);return a<0?100:a}static darkerUnsafe(r,t){const a=F.darker(r,t);return a<0?0:a}}class fe{static isDisliked(r){const t=Math.round(r.hue)>=90&&Math.round(r.hue)<=111,a=Math.round(r.chroma)>16,n=Math.round(r.tone)<65;return t&&a&&n}static fixIfDisliked(r){return fe.isDisliked(r)?L.from(r.hue,r.chroma,70):r}}class l{static fromPalette(r){return new l(r.name??"",r.palette,r.tone,r.isBackground??!1,r.background,r.secondBackground,r.contrastCurve,r.toneDeltaPair)}constructor(r,t,a,n,i,s,c,u){if(this.name=r,this.palette=t,this.tone=a,this.isBackground=n,this.background=i,this.secondBackground=s,this.contrastCurve=c,this.toneDeltaPair=u,this.hctCache=new Map,!i&&s)throw new Error(`Color ${r} has secondBackgrounddefined, but background is not defined.`);if(!i&&c)throw new Error(`Color ${r} has contrastCurvedefined, but background is not defined.`);if(i&&!c)throw new Error(`Color ${r} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(r){return this.getHct(r).toInt()}getHct(r){const t=this.hctCache.get(r);if(t!=null)return t;const a=this.getTone(r),n=this.palette(r).getHct(a);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(r,n),n}getTone(r){const t=r.contrastLevel<0;if(this.toneDeltaPair){const a=this.toneDeltaPair(r),n=a.roleA,i=a.roleB,s=a.delta,c=a.polarity,u=a.stayTogether,h=this.background(r).getTone(r),m=c==="nearer"||c==="lighter"&&!r.isDark||c==="darker"&&r.isDark,g=m?n:i,C=m?i:n,w=this.name===g.name,f=r.isDark?1:-1,M=g.contrastCurve.get(r.contrastLevel),b=C.contrastCurve.get(r.contrastLevel),v=g.tone(r);let y=F.ratioOfTones(h,v)>=M?v:l.foregroundTone(h,M);const O=C.tone(r);let x=F.ratioOfTones(h,O)>=b?O:l.foregroundTone(h,b);return t&&(y=l.foregroundTone(h,M),x=l.foregroundTone(h,b)),(x-y)*f>=s||(x=ie(0,100,y+s*f),(x-y)*f>=s||(y=ie(0,100,x-s*f))),50<=y&&y<60?f>0?(y=60,x=Math.max(x,y+s*f)):(y=49,x=Math.min(x,y+s*f)):50<=x&&x<60&&(u?f>0?(y=60,x=Math.max(x,y+s*f)):(y=49,x=Math.min(x,y+s*f)):x=f>0?60:49),w?y:x}{let a=this.tone(r);if(this.background==null)return a;const n=this.background(r).getTone(r),i=this.contrastCurve.get(r.contrastLevel);if(F.ratioOfTones(n,a)>=i||(a=l.foregroundTone(n,i)),t&&(a=l.foregroundTone(n,i)),this.isBackground&&50<=a&&a<60&&(a=F.ratioOfTones(49,n)>=i?49:60),this.secondBackground){const[s,c]=[this.background,this.secondBackground],[u,h]=[s(r).getTone(r),c(r).getTone(r)],[m,g]=[Math.max(u,h),Math.min(u,h)];if(F.ratioOfTones(m,a)>=i&&F.ratioOfTones(g,a)>=i)return a;const C=F.lighter(m,i),w=F.darker(g,i),f=[];return C!==-1&&f.push(C),w!==-1&&f.push(w),l.tonePrefersLightForeground(u)||l.tonePrefersLightForeground(h)?C<0?100:C:f.length===1?f[0]:w<0?0:w}return a}}static foregroundTone(r,t){const a=F.lighterUnsafe(r,t),n=F.darkerUnsafe(r,t),i=F.ratioOfTones(a,r),s=F.ratioOfTones(n,r);if(l.tonePrefersLightForeground(r)){const c=Math.abs(i-s)<.1&&i<t&&s<t;return i>=t||i>=s||c?a:n}return s>=t||s>=i?n:a}static tonePrefersLightForeground(r){return Math.round(r)<60}static toneAllowsLightForeground(r){return Math.round(r)<=49}static enableLightForeground(r){return l.tonePrefersLightForeground(r)&&!l.toneAllowsLightForeground(r)?49:r}}class V{static fromInt(r){const t=L.fromInt(r);return V.fromHct(t)}static fromHct(r){return new V(r.hue,r.chroma,r)}static fromHueAndChroma(r,t){const a=new Be(r,t).create();return new V(r,t,a)}constructor(r,t,a){this.hue=r,this.chroma=t,this.keyColor=a,this.cache=new Map}tone(r){let t=this.cache.get(r);return t===void 0&&(t=L.from(this.hue,this.chroma,r).toInt(),this.cache.set(r,t)),t}getHct(r){return L.fromInt(this.tone(r))}}class Be{constructor(r,t){this.hue=r,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let r=0,t=100;for(;r<t;){const a=Math.floor((r+t)/2),n=this.maxChroma(a)<this.maxChroma(a+1);if(this.maxChroma(a)>=this.requestedChroma-.01)if(Math.abs(r-50)<Math.abs(t-50))t=a;else{if(r===a)return L.from(this.hue,this.requestedChroma,r);r=a}else n?r=a+1:t=a}return L.from(this.hue,this.requestedChroma,r)}maxChroma(r){if(this.chromaCache.has(r))return this.chromaCache.get(r);const t=L.from(this.hue,this.maxChromaValue,r).chroma;return this.chromaCache.set(r,t),t}}class d{constructor(r,t,a,n){this.low=r,this.normal=t,this.medium=a,this.high=n}get(r){return r<=-1?this.low:r<0?Z(this.low,this.normal,(r- -1)/1):r<.5?Z(this.normal,this.medium,(r-0)/.5):r<1?Z(this.medium,this.high,(r-.5)/.5):this.high}}class A{constructor(r,t,a,n,i){this.roleA=r,this.roleB=t,this.delta=a,this.polarity=n,this.stayTogether=i}}var ee;function K(e){return e.variant===ee.FIDELITY||e.variant===ee.CONTENT}function D(e){return e.variant===ee.MONOCHROME}(function(e){e[e.MONOCHROME=0]="MONOCHROME",e[e.NEUTRAL=1]="NEUTRAL",e[e.TONAL_SPOT=2]="TONAL_SPOT",e[e.VIBRANT=3]="VIBRANT",e[e.EXPRESSIVE=4]="EXPRESSIVE",e[e.FIDELITY=5]="FIDELITY",e[e.CONTENT=6]="CONTENT",e[e.RAINBOW=7]="RAINBOW",e[e.FRUIT_SALAD=8]="FRUIT_SALAD"})(ee||(ee={}));class o{static highestSurface(r){return r.isDark?o.surfaceBright:o.surfaceDim}}o.contentAccentToneDelta=15,o.primaryPaletteKeyColor=l.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone}),o.secondaryPaletteKeyColor=l.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone}),o.tertiaryPaletteKeyColor=l.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone}),o.neutralPaletteKeyColor=l.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone}),o.neutralVariantPaletteKeyColor=l.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone}),o.background=l.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),o.onBackground=l.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>o.background,contrastCurve:new d(3,3,4.5,7)}),o.surface=l.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0}),o.surfaceDim=l.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new d(87,87,80,75).get(e.contrastLevel),isBackground:!0}),o.surfaceBright=l.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(24,24,29,34).get(e.contrastLevel):98,isBackground:!0}),o.surfaceContainerLowest=l.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(4,4,2,0).get(e.contrastLevel):100,isBackground:!0}),o.surfaceContainerLow=l.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(10,10,11,12).get(e.contrastLevel):new d(96,96,96,95).get(e.contrastLevel),isBackground:!0}),o.surfaceContainer=l.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(12,12,16,20).get(e.contrastLevel):new d(94,94,92,90).get(e.contrastLevel),isBackground:!0}),o.surfaceContainerHigh=l.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(17,17,21,25).get(e.contrastLevel):new d(92,92,88,85).get(e.contrastLevel),isBackground:!0}),o.surfaceContainerHighest=l.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new d(22,22,26,30).get(e.contrastLevel):new d(90,90,84,80).get(e.contrastLevel),isBackground:!0}),o.onSurface=l.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>o.highestSurface(e),contrastCurve:new d(4.5,7,11,21)}),o.surfaceVariant=l.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0}),o.onSurfaceVariant=l.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>o.highestSurface(e),contrastCurve:new d(3,4.5,7,11)}),o.inverseSurface=l.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20}),o.inverseOnSurface=l.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>o.inverseSurface,contrastCurve:new d(4.5,7,11,21)}),o.outline=l.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>o.highestSurface(e),contrastCurve:new d(1.5,3,4.5,7)}),o.outlineVariant=l.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5)}),o.shadow=l.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0}),o.scrim=l.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0}),o.surfaceTint=l.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0}),o.primary=l.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>D(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(3,4.5,7,7),toneDeltaPair:e=>new A(o.primaryContainer,o.primary,10,"nearer",!1)}),o.onPrimary=l.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>D(e)?e.isDark?10:90:e.isDark?20:100,background:e=>o.primary,contrastCurve:new d(4.5,7,11,21)}),o.primaryContainer=l.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>K(e)?e.sourceColorHct.tone:D(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.primaryContainer,o.primary,10,"nearer",!1)}),o.onPrimaryContainer=l.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>K(e)?l.foregroundTone(o.primaryContainer.tone(e),4.5):D(e)?e.isDark?0:100:e.isDark?90:30,background:e=>o.primaryContainer,contrastCurve:new d(3,4.5,7,11)}),o.inversePrimary=l.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>o.inverseSurface,contrastCurve:new d(3,4.5,7,7)}),o.secondary=l.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(3,4.5,7,7),toneDeltaPair:e=>new A(o.secondaryContainer,o.secondary,10,"nearer",!1)}),o.onSecondary=l.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>D(e)?e.isDark?10:100:e.isDark?20:100,background:e=>o.secondary,contrastCurve:new d(4.5,7,11,21)}),o.secondaryContainer=l.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const r=e.isDark?30:90;return D(e)?e.isDark?30:85:K(e)?function(t,a,n,i){let s=n,c=L.from(t,a,n);if(c.chroma<a){let u=c.chroma;for(;c.chroma<a;){s+=i?-1:1;const h=L.from(t,a,s);if(u>h.chroma||Math.abs(h.chroma-a)<.4)break;Math.abs(h.chroma-a)<Math.abs(c.chroma-a)&&(c=h),u=Math.max(u,h.chroma)}}return s}(e.secondaryPalette.hue,e.secondaryPalette.chroma,r,!e.isDark):r},isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.secondaryContainer,o.secondary,10,"nearer",!1)}),o.onSecondaryContainer=l.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>D(e)?e.isDark?90:10:K(e)?l.foregroundTone(o.secondaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>o.secondaryContainer,contrastCurve:new d(3,4.5,7,11)}),o.tertiary=l.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>D(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(3,4.5,7,7),toneDeltaPair:e=>new A(o.tertiaryContainer,o.tertiary,10,"nearer",!1)}),o.onTertiary=l.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>D(e)?e.isDark?10:90:e.isDark?20:100,background:e=>o.tertiary,contrastCurve:new d(4.5,7,11,21)}),o.tertiaryContainer=l.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(D(e))return e.isDark?60:49;if(!K(e))return e.isDark?30:90;const r=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return fe.fixIfDisliked(r).tone},isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.tertiaryContainer,o.tertiary,10,"nearer",!1)}),o.onTertiaryContainer=l.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>D(e)?e.isDark?0:100:K(e)?l.foregroundTone(o.tertiaryContainer.tone(e),4.5):e.isDark?90:30,background:e=>o.tertiaryContainer,contrastCurve:new d(3,4.5,7,11)}),o.error=l.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(3,4.5,7,7),toneDeltaPair:e=>new A(o.errorContainer,o.error,10,"nearer",!1)}),o.onError=l.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>o.error,contrastCurve:new d(4.5,7,11,21)}),o.errorContainer=l.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.errorContainer,o.error,10,"nearer",!1)}),o.onErrorContainer=l.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>D(e)?e.isDark?90:10:e.isDark?90:30,background:e=>o.errorContainer,contrastCurve:new d(3,4.5,7,11)}),o.primaryFixed=l.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>D(e)?40:90,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.primaryFixed,o.primaryFixedDim,10,"lighter",!0)}),o.primaryFixedDim=l.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>D(e)?30:80,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.primaryFixed,o.primaryFixedDim,10,"lighter",!0)}),o.onPrimaryFixed=l.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>D(e)?100:10,background:e=>o.primaryFixedDim,secondBackground:e=>o.primaryFixed,contrastCurve:new d(4.5,7,11,21)}),o.onPrimaryFixedVariant=l.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>D(e)?90:30,background:e=>o.primaryFixedDim,secondBackground:e=>o.primaryFixed,contrastCurve:new d(3,4.5,7,11)}),o.secondaryFixed=l.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>D(e)?80:90,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.secondaryFixed,o.secondaryFixedDim,10,"lighter",!0)}),o.secondaryFixedDim=l.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>D(e)?70:80,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.secondaryFixed,o.secondaryFixedDim,10,"lighter",!0)}),o.onSecondaryFixed=l.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>o.secondaryFixedDim,secondBackground:e=>o.secondaryFixed,contrastCurve:new d(4.5,7,11,21)}),o.onSecondaryFixedVariant=l.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>D(e)?25:30,background:e=>o.secondaryFixedDim,secondBackground:e=>o.secondaryFixed,contrastCurve:new d(3,4.5,7,11)}),o.tertiaryFixed=l.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>D(e)?40:90,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.tertiaryFixed,o.tertiaryFixedDim,10,"lighter",!0)}),o.tertiaryFixedDim=l.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>D(e)?30:80,isBackground:!0,background:e=>o.highestSurface(e),contrastCurve:new d(1,1,3,4.5),toneDeltaPair:e=>new A(o.tertiaryFixed,o.tertiaryFixedDim,10,"lighter",!0)}),o.onTertiaryFixed=l.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>D(e)?100:10,background:e=>o.tertiaryFixedDim,secondBackground:e=>o.tertiaryFixed,contrastCurve:new d(4.5,7,11,21)}),o.onTertiaryFixedVariant=l.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>D(e)?90:30,background:e=>o.tertiaryFixedDim,secondBackground:e=>o.tertiaryFixed,contrastCurve:new d(3,4.5,7,11)});class E{static of(r){return new E(r,!1)}static contentOf(r){return new E(r,!0)}static fromColors(r){return E.createPaletteFromColors(!1,r)}static contentFromColors(r){return E.createPaletteFromColors(!0,r)}static createPaletteFromColors(r,t){const a=new E(t.primary,r);if(t.secondary){const n=new E(t.secondary,r);a.a2=n.a1}if(t.tertiary){const n=new E(t.tertiary,r);a.a3=n.a1}if(t.error){const n=new E(t.error,r);a.error=n.a1}if(t.neutral){const n=new E(t.neutral,r);a.n1=n.n1}if(t.neutralVariant){const n=new E(t.neutralVariant,r);a.n2=n.n2}return a}constructor(r,t){const a=L.fromInt(r),n=a.hue,i=a.chroma;t?(this.a1=V.fromHueAndChroma(n,i),this.a2=V.fromHueAndChroma(n,i/3),this.a3=V.fromHueAndChroma(n+60,i/2),this.n1=V.fromHueAndChroma(n,Math.min(i/12,4)),this.n2=V.fromHueAndChroma(n,Math.min(i/6,8))):(this.a1=V.fromHueAndChroma(n,Math.max(48,i)),this.a2=V.fromHueAndChroma(n,16),this.a3=V.fromHueAndChroma(n+60,24),this.n1=V.fromHueAndChroma(n,4),this.n2=V.fromHueAndChroma(n,8)),this.error=V.fromHueAndChroma(25,84)}}class G{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(r){return G.lightFromCorePalette(E.of(r))}static dark(r){return G.darkFromCorePalette(E.of(r))}static lightContent(r){return G.lightFromCorePalette(E.contentOf(r))}static darkContent(r){return G.darkFromCorePalette(E.contentOf(r))}static lightFromCorePalette(r){return new G({primary:r.a1.tone(40),onPrimary:r.a1.tone(100),primaryContainer:r.a1.tone(90),onPrimaryContainer:r.a1.tone(10),secondary:r.a2.tone(40),onSecondary:r.a2.tone(100),secondaryContainer:r.a2.tone(90),onSecondaryContainer:r.a2.tone(10),tertiary:r.a3.tone(40),onTertiary:r.a3.tone(100),tertiaryContainer:r.a3.tone(90),onTertiaryContainer:r.a3.tone(10),error:r.error.tone(40),onError:r.error.tone(100),errorContainer:r.error.tone(90),onErrorContainer:r.error.tone(10),background:r.n1.tone(99),onBackground:r.n1.tone(10),surface:r.n1.tone(99),onSurface:r.n1.tone(10),surfaceVariant:r.n2.tone(90),onSurfaceVariant:r.n2.tone(30),outline:r.n2.tone(50),outlineVariant:r.n2.tone(80),shadow:r.n1.tone(0),scrim:r.n1.tone(0),inverseSurface:r.n1.tone(20),inverseOnSurface:r.n1.tone(95),inversePrimary:r.a1.tone(80)})}static darkFromCorePalette(r){return new G({primary:r.a1.tone(80),onPrimary:r.a1.tone(20),primaryContainer:r.a1.tone(30),onPrimaryContainer:r.a1.tone(90),secondary:r.a2.tone(80),onSecondary:r.a2.tone(20),secondaryContainer:r.a2.tone(30),onSecondaryContainer:r.a2.tone(90),tertiary:r.a3.tone(80),onTertiary:r.a3.tone(20),tertiaryContainer:r.a3.tone(30),onTertiaryContainer:r.a3.tone(90),error:r.error.tone(80),onError:r.error.tone(20),errorContainer:r.error.tone(30),onErrorContainer:r.error.tone(80),background:r.n1.tone(10),onBackground:r.n1.tone(90),surface:r.n1.tone(10),onSurface:r.n1.tone(90),surfaceVariant:r.n2.tone(30),onSurfaceVariant:r.n2.tone(80),outline:r.n2.tone(60),outlineVariant:r.n2.tone(30),shadow:r.n1.tone(0),scrim:r.n1.tone(0),inverseSurface:r.n1.tone(90),inverseOnSurface:r.n1.tone(20),inversePrimary:r.a1.tone(40)})}constructor(r){this.props=r}toJSON(){return{...this.props}}}function we(e){const r=(e=e.replace("#","")).length===3,t=e.length===6,a=e.length===8;if(!r&&!t&&!a)throw new Error("unexpected hex "+e);let n=0,i=0,s=0;return r?(n=Y(e.slice(0,1).repeat(2)),i=Y(e.slice(1,2).repeat(2)),s=Y(e.slice(2,3).repeat(2))):t?(n=Y(e.slice(0,2)),i=Y(e.slice(2,4)),s=Y(e.slice(4,6))):a&&(n=Y(e.slice(2,4)),i=Y(e.slice(4,6)),s=Y(e.slice(6,8))),(255<<24|(255&n)<<16|(255&i)<<8|255&s)>>>0}function Y(e){return parseInt(e,16)}function Le(e,r=[]){const t=E.of(e);return{source:e,schemes:{light:G.light(e),dark:G.dark(e)},palettes:{primary:t.a1,secondary:t.a2,tertiary:t.a3,neutral:t.n1,neutralVariant:t.n2,error:t.error},customColors:r.map(a=>function(n,i){let s=i.value;const c=s,u=n;i.blend&&(s=de.harmonize(c,u));const h=E.of(s),m=h.a1;return{color:i,value:s,light:{color:m.tone(40),onColor:m.tone(100),colorContainer:m.tone(90),onColorContainer:m.tone(10)},dark:{color:m.tone(80),onColor:m.tone(20),colorContainer:m.tone(30),onColorContainer:m.tone(90)}}}(e,a))}}function Pe(e,r=!1){function t(a){return"#"+a.toString(16).slice(2)}if(r){const a=e.schemes.dark,n=function(i,s){const c=V.fromHueAndChroma(i,s);return{cLowest:c.tone(4),cLow:c.tone(10),c:c.tone(12),cHigh:c.tone(17),cHighest:c.tone(22),sDim:c.tone(6),s:c.tone(6),sBright:c.tone(24)}}(e.palettes.neutral.hue,e.palettes.neutral.chroma);return{sys:{color:{scrim:t(a.scrim),outlineVariant:t(a.outlineVariant),outline:t(a.outline),surface:{default:t(a.surface),dim:t(n.sDim),bright:t(n.sBright),on:t(a.onSurface),onVariant:t(a.onSurfaceVariant),highest:t(n.cHighest),high:t(n.cHigh),container:t(n.c),low:t(n.cLow),lowest:t(n.cLowest)},primary:{default:t(a.primary),on:t(a.onPrimary),container:t(a.primaryContainer),onContainer:t(a.onPrimaryContainer)},secondary:{default:t(a.secondary),on:t(a.onSecondary),container:t(n.sBright),onContainer:t(a.onSecondaryContainer)},tertiary:{default:t(a.tertiary),on:t(a.onTertiary),container:t(a.tertiaryContainer),onContainer:t(a.onTertiaryContainer)},error:{default:t(a.error),on:t(a.onError),container:t(a.errorContainer),onContainer:t(a.onErrorContainer)},success:{default:"#00FF00",on:"#000000",container:"#00FF00",onContainer:"#000000"}},elevation:{0:"0 0 0 0 rgba(0, 0, 0, 0)",1:"rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px",2:"rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px",3:"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px",4:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",5:"rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px"},outline:{1:"1px"}}}}{const a=e.schemes.light,n=function(i,s){const c=V.fromHueAndChroma(i,s);return{cLowest:c.tone(100),cLow:c.tone(96),c:c.tone(94),cHigh:c.tone(92),cHighest:c.tone(90),sDim:c.tone(87),s:c.tone(98),sBright:c.tone(98)}}(e.palettes.neutral.hue,e.palettes.neutral.chroma);return{sys:{color:{scrim:t(a.scrim),outlineVariant:t(a.outlineVariant),outline:t(a.outline),surface:{default:t(a.surface),dim:t(n.sDim),bright:t(n.sBright),on:t(a.onSurface),onVariant:t(a.onSurfaceVariant),highest:t(n.cHighest),high:t(n.cHigh),container:t(n.c),low:t(n.cLow),lowest:t(n.cLowest)},primary:{default:t(a.primary),on:t(a.onPrimary),container:t(a.primaryContainer),onContainer:t(a.onPrimaryContainer)},secondary:{default:t(a.secondary),on:t(a.onSecondary),container:t(a.secondaryContainer),onContainer:t(a.onSecondaryContainer)},tertiary:{default:t(a.tertiary),on:t(a.onTertiary),container:t(a.tertiaryContainer),onContainer:t(a.onTertiaryContainer)},error:{default:t(a.error),on:t(a.onError),container:t(a.errorContainer),onContainer:t(a.onErrorContainer)},success:{default:"#00FF00",on:"#000000",container:"#00FF00",onContainer:"#000000"}},elevation:{0:"0 0 0 0 rgba(0, 0, 0, 0)",1:"rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px",2:"rgba(0, 0, 0, 0.2) 0px 3px 3px -2px, rgba(0, 0, 0, 0.14) 0px 3px 4px 0px, rgba(0, 0, 0, 0.12) 0px 1px 8px 0px",3:"rgba(0, 0, 0, 0.2) 0px 3px 5px -1px, rgba(0, 0, 0, 0.14) 0px 6px 10px 0px, rgba(0, 0, 0, 0.12) 0px 1px 18px 0px",4:"rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px, rgba(0, 0, 0, 0.12) 0px 3px 14px 2px",5:"rgba(0, 0, 0, 0.2) 0px 7px 8px -4px, rgba(0, 0, 0, 0.14) 0px 12px 17px 2px, rgba(0, 0, 0, 0.12) 0px 5px 22px 4px"},outline:{1:"1px"}}}}}const se=window.matchMedia("(prefers-color-scheme: dark)"),Oe=new N.Observable(e=>{const r=a=>{const n=a.matches?"dark":"light";e.next(n)};se.addEventListener("change",r);const t=se.matches?"dark":"light";return e.next(t),()=>se.removeEventListener("change",r)});function oe(){return"#"+Math.floor(16777215*Math.random()).toString(16).padStart(6,"0")}ye.pipe(N.startWith(function(e){try{return JSON.parse(e)}catch{return}}(localStorage.getItem("schmancy-theme"))),N.map(e=>{try{return we(e.color),e||{color:oe(),scheme:"auto"}}catch{return{color:oe(),scheme:"auto"}}}),N.catchError(()=>N.of({color:oe(),scheme:"auto"})),N.tap(e=>localStorage.setItem("schmancy-theme",JSON.stringify(e)))).pipe(N.combineLatestWith(Oe.pipe(N.map(e=>e==="dark")))).pipe(N.map(([e,r])=>({theme:Le(we(e.color)),isDark:e.scheme==="dark"||e.scheme!=="light"&&r})),N.map(e=>Pe(e.theme,e.isDark))).subscribe(e=>{ce.next(e)}),exports.$newSchmancyTheme=ye,exports.$schmancyTheme=ce,exports.formateTheme=Pe,exports.generateRandomColor=oe;
3
- //# sourceMappingURL=dynamicTheme-BYlTubq6.cjs.map