@elmethis/qwik 0.0.17 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "@builder.io/qwik/jsx-runtime";
2
- import { component$, Slot, useSignal, useTask$, $, useComputed$, useVisibleTask$, useContextProvider, createContextId, useContext } from "@builder.io/qwik";
2
+ import { component$, Slot, useSignal, useTask$, $, useComputed$, useOnDocument, useVisibleTask$, useContextProvider, createContextId, useContext } from "@builder.io/qwik";
3
3
  import { mdiCodeTags, mdiClipboardCheckMultipleOutline, mdiClipboardMultipleOutline, mdiChevronRight, mdiPlus, mdiMessageImageOutline, mdiFile, mdiDownload, mdiLinkVariant, mdiHome, mdiApplicationOutline, mdiFolderOpen, mdiFormatQuoteOpen, mdiFormatQuoteClose, mdiAlertOctagram, mdiAlert, mdiShieldAlert, mdiLightbulbOn, mdiInformation } from "@mdi/js";
4
4
  import { codeToHtml } from "shiki";
5
5
  import { renderToString } from "katex";
@@ -7,7 +7,7 @@ import { kebabCase } from "lodash-es";
7
7
  const caption$1 = "_caption_1j0ec_27";
8
8
  const divider = "_divider_1j0ec_50";
9
9
  const code$2 = "_code_1j0ec_1";
10
- const styles$r = {
10
+ const styles$s = {
11
11
  "code-block": "_code-block_1j0ec_1",
12
12
  "language-icon": "_language-icon_1j0ec_22",
13
13
  caption: caption$1,
@@ -67,7 +67,7 @@ const Typescript = component$(({ size = 24, ...props }) => {
67
67
  });
68
68
  });
69
69
  const path = "_path_1ccs2_1";
70
- const styles$q = {
70
+ const styles$r = {
71
71
  path
72
72
  };
73
73
  const Bash = component$(({ size = 24, ...props }) => {
@@ -83,7 +83,7 @@ const Bash = component$(({ size = 24, ...props }) => {
83
83
  d: "M4.24 4.24h119.53v119.53H4.24z"
84
84
  }),
85
85
  /* @__PURE__ */ jsx("path", {
86
- class: styles$q.path,
86
+ class: styles$r.path,
87
87
  d: "M109.01 28.64L71.28 6.24c-2.25-1.33-4.77-2-7.28-2s-5.03.67-7.28 2.01l-37.74 22.4c-4.5 2.67-7.28 7.61-7.28 12.96v44.8c0 5.35 2.77 10.29 7.28 12.96l37.73 22.4c2.25 1.34 4.76 2 7.28 2c2.51 0 5.03-.67 7.28-2l37.74-22.4c4.5-2.67 7.28-7.62 7.28-12.96V41.6c0-5.34-2.77-10.29-7.28-12.96M79.79 98.59l.06 3.22c0 .39-.25.83-.55.99l-1.91 1.1c-.3.15-.56-.03-.56-.42l-.03-3.17c-1.63.68-3.29.84-4.34.42c-.2-.08-.29-.37-.21-.71l.69-2.91c.06-.23.18-.46.34-.6c.06-.06.12-.1.18-.13c.11-.06.22-.07.31-.03c1.14.38 2.59.2 3.99-.5c1.78-.9 2.97-2.72 2.95-4.52c-.02-1.64-.9-2.31-3.05-2.33c-2.74.01-5.3-.53-5.34-4.57c-.03-3.32 1.69-6.78 4.43-8.96l-.03-3.25c0-.4.24-.84.55-1l1.85-1.18c.3-.15.56.04.56.43l.03 3.25c1.36-.54 2.54-.69 3.61-.44c.23.06.34.38.24.75l-.72 2.88c-.06.22-.18.44-.33.58a.8.8 0 0 1-.19.14c-.1.05-.19.06-.28.05c-.49-.11-1.65-.36-3.48.56c-1.92.97-2.59 2.64-2.58 3.88c.02 1.48.77 1.93 3.39 1.97c3.49.06 4.99 1.58 5.03 5.09c.05 3.44-1.79 7.15-4.61 9.41m26.34-60.5l-35.7 22.05c-4.45 2.6-7.73 5.52-7.74 10.89v43.99c0 3.21 1.3 5.29 3.29 5.9c-.65.11-1.32.19-1.98.19c-2.09 0-4.15-.57-5.96-1.64l-37.73-22.4c-3.69-2.19-5.98-6.28-5.98-10.67V41.6c0-4.39 2.29-8.48 5.98-10.67l37.74-22.4c1.81-1.07 3.87-1.64 5.96-1.64s4.15.57 5.96 1.64l37.74 22.4c3.11 1.85 5.21 5.04 5.8 8.63c-1.27-2.67-4.09-3.39-7.38-1.47"
88
88
  }),
89
89
  /* @__PURE__ */ jsx("path", {
@@ -523,13 +523,13 @@ const C = component$(({ size = 24, ...props }) => {
523
523
  ]
524
524
  });
525
525
  });
526
- const icon$2 = "_icon_1gvln_1";
527
- const styles$p = {
528
- icon: icon$2
526
+ const icon$3 = "_icon_1gvln_1";
527
+ const styles$q = {
528
+ icon: icon$3
529
529
  };
530
530
  const ElmMdiIcon = component$(({ d, size = "1em", color, lightColor, darkColor }) => {
531
531
  return /* @__PURE__ */ jsx("svg", {
532
- class: styles$p.icon,
532
+ class: styles$q.icon,
533
533
  style: {
534
534
  "--color": lightColor ?? color,
535
535
  "--dark-color": darkColor ?? color
@@ -638,7 +638,7 @@ const text$3 = "_text_1gswr_1";
638
638
  const code$1 = "_code_1gswr_12";
639
639
  const kbd = "_kbd_1gswr_21";
640
640
  const link$1 = "_link_1gswr_47";
641
- const styles$o = {
641
+ const styles$p = {
642
642
  text: text$3,
643
643
  code: code$1,
644
644
  kbd,
@@ -648,17 +648,17 @@ const text$2 = "_text_zryur_1";
648
648
  const textStyles = {
649
649
  text: text$2
650
650
  };
651
- const icon$1 = "_icon_19g82_1";
652
- const styles$n = {
653
- icon: icon$1
651
+ const icon$2 = "_icon_19g82_1";
652
+ const styles$o = {
653
+ icon: icon$2
654
654
  };
655
655
  const ElmInlineIcon = component$(({ src, alt }) => {
656
656
  return /* @__PURE__ */ jsx("span", {
657
- class: styles$n.icon,
657
+ class: styles$o.icon,
658
658
  children: /* @__PURE__ */ jsx("img", {
659
659
  src,
660
660
  alt,
661
- class: styles$n.icon
661
+ class: styles$o.icon
662
662
  })
663
663
  });
664
664
  });
@@ -669,7 +669,7 @@ const ElmInlineText = component$((props) => {
669
669
  }) : /* @__PURE__ */ jsx(Slot, {});
670
670
  if (props.kbd) {
671
671
  vnode = /* @__PURE__ */ jsx("kbd", {
672
- class: styles$o.kbd,
672
+ class: styles$p.kbd,
673
673
  children: vnode
674
674
  });
675
675
  }
@@ -695,13 +695,13 @@ const ElmInlineText = component$((props) => {
695
695
  }
696
696
  if (code2) {
697
697
  vnode = /* @__PURE__ */ jsx("code", {
698
- class: styles$o.code,
698
+ class: styles$p.code,
699
699
  children: vnode
700
700
  });
701
701
  }
702
702
  if (props.ruby) {
703
703
  vnode = /* @__PURE__ */ jsxs("ruby", {
704
- class: styles$o.text,
704
+ class: styles$p.text,
705
705
  children: [
706
706
  /* @__PURE__ */ jsx("span", {
707
707
  children: vnode
@@ -714,7 +714,7 @@ const ElmInlineText = component$((props) => {
714
714
  }
715
715
  const wrappedVnode = /* @__PURE__ */ jsx("span", {
716
716
  class: [
717
- styles$o.text,
717
+ styles$p.text,
718
718
  textStyles.text
719
719
  ],
720
720
  style: {
@@ -726,7 +726,7 @@ const ElmInlineText = component$((props) => {
726
726
  });
727
727
  if (props.href) {
728
728
  return /* @__PURE__ */ jsxs("a", {
729
- class: styles$o.link,
729
+ class: styles$p.link,
730
730
  href: props.href,
731
731
  style: {
732
732
  "--font-size": size
@@ -744,7 +744,7 @@ const ElmInlineText = component$((props) => {
744
744
  return wrappedVnode;
745
745
  });
746
746
  const code = "_code_1sw1e_1";
747
- const styles$m = {
747
+ const styles$n = {
748
748
  code
749
749
  };
750
750
  const ElmShikiHighlighter = component$(({ code: code2, language = "txt" }) => {
@@ -769,7 +769,7 @@ const ElmShikiHighlighter = component$(({ code: code2, language = "txt" }) => {
769
769
  }
770
770
  });
771
771
  return /* @__PURE__ */ jsx("pre", {
772
- class: styles$m.code,
772
+ class: styles$n.code,
773
773
  dangerouslySetInnerHTML: rawHtml.value
774
774
  });
775
775
  });
@@ -788,19 +788,19 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
788
788
  }
789
789
  });
790
790
  return /* @__PURE__ */ jsxs("figure", {
791
- class: styles$r["code-block"],
791
+ class: styles$s["code-block"],
792
792
  style: {
793
793
  margin
794
794
  },
795
795
  children: [
796
796
  /* @__PURE__ */ jsx("span", {
797
- class: styles$r["language-icon"],
797
+ class: styles$s["language-icon"],
798
798
  children: /* @__PURE__ */ jsx(ElmLanguageIcon, {
799
799
  language
800
800
  })
801
801
  }),
802
802
  /* @__PURE__ */ jsx("span", {
803
- class: styles$r.caption,
803
+ class: styles$s.caption,
804
804
  children: /* @__PURE__ */ jsxs(ElmInlineText, {
805
805
  children: [
806
806
  caption2 || language,
@@ -809,7 +809,7 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
809
809
  })
810
810
  }),
811
811
  /* @__PURE__ */ jsx("div", {
812
- class: styles$r["copy-icon"],
812
+ class: styles$s["copy-icon"],
813
813
  onClick$: copyToClipboard,
814
814
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
815
815
  size: "1.25rem",
@@ -818,10 +818,10 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
818
818
  })
819
819
  }),
820
820
  /* @__PURE__ */ jsx("hr", {
821
- class: styles$r.divider
821
+ class: styles$s.divider
822
822
  }),
823
823
  /* @__PURE__ */ jsx("div", {
824
- class: styles$r.code,
824
+ class: styles$s.code,
825
825
  children: /* @__PURE__ */ jsx(ElmShikiHighlighter, {
826
826
  code: code2,
827
827
  language
@@ -841,7 +841,7 @@ const ElmKatex = component$(({ expression, block = false }) => {
841
841
  });
842
842
  });
843
843
  const parallax = "_parallax_1kb0k_1";
844
- const styles$l = {
844
+ const styles$m = {
845
845
  "parallax-watcher": "_parallax-watcher_1kb0k_1",
846
846
  parallax
847
847
  };
@@ -850,13 +850,13 @@ const ElmParallax = component$(({ images }) => {
850
850
  return /* @__PURE__ */ jsxs(Fragment, {
851
851
  children: [
852
852
  /* @__PURE__ */ jsx("div", {
853
- class: styles$l["parallax-watcher"],
853
+ class: styles$m["parallax-watcher"],
854
854
  "window:onScroll$": () => {
855
855
  y.value = window.scrollY;
856
856
  }
857
857
  }),
858
858
  images.map((image2, index) => /* @__PURE__ */ jsx("div", {
859
- class: styles$l.parallax,
859
+ class: styles$m.parallax,
860
860
  style: {
861
861
  backgroundImage: `url(${image2})`,
862
862
  transform: `scale(1.2) translateY(${y.value / (1e3 * (index + 1))}%)`,
@@ -870,7 +870,7 @@ const toggle = "_toggle_1nxqa_1";
870
870
  const summary = "_summary_1nxqa_14";
871
871
  const content$2 = "_content_1nxqa_60";
872
872
  const footer = "_footer_1nxqa_80";
873
- const styles$k = {
873
+ const styles$l = {
874
874
  toggle,
875
875
  "toggle-closed": "_toggle-closed_1nxqa_7",
876
876
  "toggle-open": "_toggle-open_1nxqa_10",
@@ -898,29 +898,29 @@ const ElmToggle = component$(({ summary: summary2 }) => {
898
898
  });
899
899
  return /* @__PURE__ */ jsxs("div", {
900
900
  class: [
901
- styles$k.toggle,
901
+ styles$l.toggle,
902
902
  {
903
- [styles$k["toggle-open"]]: isOpen.value,
904
- [styles$k["toggle-closed"]]: !isOpen.value
903
+ [styles$l["toggle-open"]]: isOpen.value,
904
+ [styles$l["toggle-closed"]]: !isOpen.value
905
905
  }
906
906
  ],
907
907
  children: [
908
908
  /* @__PURE__ */ jsxs("div", {
909
909
  class: [
910
- styles$k.summary,
910
+ styles$l.summary,
911
911
  {
912
- [styles$k["summary-open"]]: isOpen.value,
913
- [styles$k["summary-closed"]]: !isOpen.value
912
+ [styles$l["summary-open"]]: isOpen.value,
913
+ [styles$l["summary-closed"]]: !isOpen.value
914
914
  }
915
915
  ],
916
916
  onClick$: toggle2,
917
917
  children: [
918
918
  /* @__PURE__ */ jsx("span", {
919
919
  class: [
920
- styles$k["chevron-icon"],
920
+ styles$l["chevron-icon"],
921
921
  {
922
- [styles$k["chevron-icon-open"]]: isOpen.value,
923
- [styles$k["chevron-icon-closed"]]: !isOpen.value
922
+ [styles$l["chevron-icon-open"]]: isOpen.value,
923
+ [styles$l["chevron-icon-closed"]]: !isOpen.value
924
924
  }
925
925
  ],
926
926
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
@@ -928,17 +928,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
928
928
  })
929
929
  }),
930
930
  /* @__PURE__ */ jsx("span", {
931
- class: styles$k["summary-text"],
931
+ class: styles$l["summary-text"],
932
932
  children: summary2 ? summary2 : /* @__PURE__ */ jsx(Slot, {
933
933
  name: "summary"
934
934
  })
935
935
  }),
936
936
  /* @__PURE__ */ jsx("span", {
937
937
  class: [
938
- styles$k["plus-icon"],
938
+ styles$l["plus-icon"],
939
939
  {
940
- [styles$k["plus-icon-open"]]: isOpen.value,
941
- [styles$k["plus-icon-closed"]]: !isOpen.value
940
+ [styles$l["plus-icon-open"]]: isOpen.value,
941
+ [styles$l["plus-icon-closed"]]: !isOpen.value
942
942
  }
943
943
  ],
944
944
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
@@ -951,30 +951,30 @@ const ElmToggle = component$(({ summary: summary2 }) => {
951
951
  }),
952
952
  /* @__PURE__ */ jsx("div", {
953
953
  class: [
954
- styles$k.content,
954
+ styles$l.content,
955
955
  {
956
- [styles$k["content-open"]]: isOpen.value,
957
- [styles$k["content-closed"]]: !isOpen.value
956
+ [styles$l["content-open"]]: isOpen.value,
957
+ [styles$l["content-closed"]]: !isOpen.value
958
958
  }
959
959
  ],
960
960
  children: /* @__PURE__ */ jsx(Slot, {})
961
961
  }),
962
962
  /* @__PURE__ */ jsxs("div", {
963
- class: styles$k.footer,
963
+ class: styles$l.footer,
964
964
  onClick$: toggle2,
965
965
  children: [
966
966
  /* @__PURE__ */ jsx("span", {
967
- class: styles$k["footer-chevron-icon"],
967
+ class: styles$l["footer-chevron-icon"],
968
968
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
969
969
  d: mdiChevronRight,
970
970
  color: "gray"
971
971
  })
972
972
  }),
973
973
  /* @__PURE__ */ jsx("hr", {
974
- class: styles$k["footer-line"]
974
+ class: styles$l["footer-line"]
975
975
  }),
976
976
  /* @__PURE__ */ jsx("span", {
977
- class: styles$k["footer-cross-icon"],
977
+ class: styles$l["footer-cross-icon"],
978
978
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
979
979
  d: mdiPlus,
980
980
  color: "#c56565"
@@ -984,17 +984,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
984
984
  children: "CLOSE"
985
985
  }),
986
986
  /* @__PURE__ */ jsx("span", {
987
- class: styles$k["footer-cross-icon"],
987
+ class: styles$l["footer-cross-icon"],
988
988
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
989
989
  d: mdiPlus,
990
990
  color: "#c56565"
991
991
  })
992
992
  }),
993
993
  /* @__PURE__ */ jsx("hr", {
994
- class: styles$k["footer-line"]
994
+ class: styles$l["footer-line"]
995
995
  }),
996
996
  /* @__PURE__ */ jsx("span", {
997
- class: styles$k["footer-chevron-icon"],
997
+ class: styles$l["footer-chevron-icon"],
998
998
  children: /* @__PURE__ */ jsx(ElmMdiIcon, {
999
999
  d: mdiChevronRight,
1000
1000
  color: "gray"
@@ -1005,50 +1005,50 @@ const ElmToggle = component$(({ summary: summary2 }) => {
1005
1005
  ]
1006
1006
  });
1007
1007
  });
1008
- const styles$j = {
1008
+ const styles$k = {
1009
1009
  "block-fallback": "_block-fallback_rt986_1"
1010
1010
  };
1011
1011
  const wrapper$1 = "_wrapper_1yktj_12";
1012
1012
  const dot = "_dot_1yktj_22";
1013
- const styles$i = {
1013
+ const styles$j = {
1014
1014
  wrapper: wrapper$1,
1015
1015
  dot
1016
1016
  };
1017
1017
  const ElmDotLoadingIcon = component$(({ size = "4em", color = "#606875" }) => {
1018
1018
  return /* @__PURE__ */ jsxs("div", {
1019
- class: styles$i.wrapper,
1019
+ class: styles$j.wrapper,
1020
1020
  style: {
1021
1021
  "--size": size,
1022
1022
  "--color": color
1023
1023
  },
1024
1024
  children: [
1025
1025
  /* @__PURE__ */ jsx("div", {
1026
- class: styles$i.dot,
1026
+ class: styles$j.dot,
1027
1027
  "aria-hidden": "true"
1028
1028
  }),
1029
1029
  /* @__PURE__ */ jsx("div", {
1030
- class: styles$i.dot,
1030
+ class: styles$j.dot,
1031
1031
  "aria-hidden": "true"
1032
1032
  }),
1033
1033
  /* @__PURE__ */ jsx("div", {
1034
- class: styles$i.dot,
1034
+ class: styles$j.dot,
1035
1035
  "aria-hidden": "true"
1036
1036
  })
1037
1037
  ]
1038
1038
  });
1039
1039
  });
1040
- const styles$h = {
1040
+ const styles$i = {
1041
1041
  "rectangle-wave": "_rectangle-wave_hej9g_17"
1042
1042
  };
1043
1043
  const ElmRectangleWave = component$(() => {
1044
1044
  return /* @__PURE__ */ jsx("div", {
1045
1045
  "aria-hidden": "true",
1046
- class: styles$h["rectangle-wave"]
1046
+ class: styles$i["rectangle-wave"]
1047
1047
  });
1048
1048
  });
1049
1049
  const ElmBlockFallback = component$(({ height = "16rem" }) => {
1050
1050
  return /* @__PURE__ */ jsxs("div", {
1051
- class: styles$j["block-fallback"],
1051
+ class: styles$k["block-fallback"],
1052
1052
  style: {
1053
1053
  "--height": height
1054
1054
  },
@@ -1058,15 +1058,522 @@ const ElmBlockFallback = component$(({ height = "16rem" }) => {
1058
1058
  ]
1059
1059
  });
1060
1060
  });
1061
- const image$1 = "_image_zq5gl_11";
1062
- const fallback = "_fallback_zq5gl_31";
1061
+ const LOCAL_STORAGE_KEY = "elmethis-theme";
1062
+ function useElmethisTheme() {
1063
+ const isDarkTheme = useSignal(false);
1064
+ const toggleTheme = $(() => {
1065
+ isDarkTheme.value = !isDarkTheme.value;
1066
+ if (typeof document !== "undefined") {
1067
+ const theme = isDarkTheme.value ? "dark" : "light";
1068
+ document.documentElement.setAttribute("data-theme", theme);
1069
+ const body2 = document.querySelector("body");
1070
+ if (body2 != null) {
1071
+ body2.style.colorScheme = theme;
1072
+ }
1073
+ if (typeof localStorage !== "undefined") {
1074
+ localStorage.setItem(LOCAL_STORAGE_KEY, theme);
1075
+ }
1076
+ }
1077
+ });
1078
+ useOnDocument("storage", $(() => {
1079
+ const localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
1080
+ if (localStorageTheme != null) {
1081
+ isDarkTheme.value = localStorageTheme === "dark";
1082
+ }
1083
+ }));
1084
+ useVisibleTask$(() => {
1085
+ const currentTheme = document.documentElement.getAttribute("data-theme");
1086
+ if (currentTheme != null) {
1087
+ isDarkTheme.value = currentTheme === "dark";
1088
+ } else {
1089
+ const localStorageTheme = localStorage.getItem(LOCAL_STORAGE_KEY);
1090
+ if (localStorageTheme != null) {
1091
+ isDarkTheme.value = localStorageTheme === "dark";
1092
+ }
1093
+ }
1094
+ }, {
1095
+ strategy: "document-ready"
1096
+ });
1097
+ return {
1098
+ isDarkTheme,
1099
+ toggleTheme
1100
+ };
1101
+ }
1102
+ const icon$1 = "_icon_1husg_1";
1103
+ const styles$h = {
1104
+ icon: icon$1
1105
+ };
1106
+ const ElmToggleTheme = component$(({ size = "2rem" }) => {
1107
+ const { isDarkTheme, toggleTheme } = useElmethisTheme();
1108
+ return /* @__PURE__ */ jsx(Fragment, {
1109
+ children: !isDarkTheme.value ? /* @__PURE__ */ jsxs("svg", {
1110
+ xmlns: "http://www.w3.org/2000/svg",
1111
+ width: size,
1112
+ height: size,
1113
+ viewBox: "0 0 24 24",
1114
+ class: styles$h.icon,
1115
+ onClick$: toggleTheme,
1116
+ children: [
1117
+ /* @__PURE__ */ jsxs("g", {
1118
+ fill: "none",
1119
+ stroke: "currentColor",
1120
+ "stroke-linecap": "round",
1121
+ "stroke-linejoin": "round",
1122
+ "stroke-width": "2",
1123
+ children: [
1124
+ /* @__PURE__ */ jsxs("path", {
1125
+ "stroke-dasharray": "2",
1126
+ "stroke-dashoffset": "2",
1127
+ d: "M12 19v1M19 12h1M12 5v-1M5 12h-1",
1128
+ children: [
1129
+ /* @__PURE__ */ jsx("animate", {
1130
+ fill: "freeze",
1131
+ attributeName: "d",
1132
+ begin: "1.2s",
1133
+ dur: "0.2s",
1134
+ values: "M12 19v1M19 12h1M12 5v-1M5 12h-1;M12 21v1M21 12h1M12 3v-1M3 12h-1"
1135
+ }),
1136
+ /* @__PURE__ */ jsx("animate", {
1137
+ fill: "freeze",
1138
+ attributeName: "stroke-dashoffset",
1139
+ begin: "1.2s",
1140
+ dur: "0.2s",
1141
+ values: "2;0"
1142
+ })
1143
+ ]
1144
+ }),
1145
+ /* @__PURE__ */ jsxs("path", {
1146
+ "stroke-dasharray": "2",
1147
+ "stroke-dashoffset": "2",
1148
+ d: "M17 17l0.5 0.5M17 7l0.5 -0.5M7 7l-0.5 -0.5M7 17l-0.5 0.5",
1149
+ children: [
1150
+ /* @__PURE__ */ jsx("animate", {
1151
+ fill: "freeze",
1152
+ attributeName: "d",
1153
+ begin: "1.4s",
1154
+ dur: "0.2s",
1155
+ values: "M17 17l0.5 0.5M17 7l0.5 -0.5M7 7l-0.5 -0.5M7 17l-0.5 0.5;M18.5 18.5l0.5 0.5M18.5 5.5l0.5 -0.5M5.5 5.5l-0.5 -0.5M5.5 18.5l-0.5 0.5"
1156
+ }),
1157
+ /* @__PURE__ */ jsx("animate", {
1158
+ fill: "freeze",
1159
+ attributeName: "stroke-dashoffset",
1160
+ begin: "1.4s",
1161
+ dur: "0.2s",
1162
+ values: "2;0"
1163
+ })
1164
+ ]
1165
+ }),
1166
+ /* @__PURE__ */ jsx("animateTransform", {
1167
+ attributeName: "transform",
1168
+ dur: "30s",
1169
+ repeatCount: "indefinite",
1170
+ type: "rotate",
1171
+ values: "0 12 12;360 12 12"
1172
+ })
1173
+ ]
1174
+ }),
1175
+ /* @__PURE__ */ jsxs("g", {
1176
+ fill: "currentColor",
1177
+ children: [
1178
+ /* @__PURE__ */ jsx("path", {
1179
+ d: "M15.22 6.03L17.75 4.09L14.56 4L13.5 1L12.44 4L9.25 4.09L11.78 6.03L10.87 9.09L13.5 7.28L16.13 9.09L15.22 6.03Z",
1180
+ children: /* @__PURE__ */ jsx("animate", {
1181
+ fill: "freeze",
1182
+ attributeName: "fill-opacity",
1183
+ dur: "0.4s",
1184
+ values: "1;0"
1185
+ })
1186
+ }),
1187
+ /* @__PURE__ */ jsx("path", {
1188
+ d: "M19.61 12.25L21.25 11L19.19 10.95L18.5 9L17.81 10.95L15.75 11L17.39 12.25L16.8 14.23L18.5 13.06L20.2 14.23L19.61 12.25Z",
1189
+ children: /* @__PURE__ */ jsx("animate", {
1190
+ fill: "freeze",
1191
+ attributeName: "fill-opacity",
1192
+ begin: "0.2s",
1193
+ dur: "0.4s",
1194
+ values: "1;0"
1195
+ })
1196
+ })
1197
+ ]
1198
+ }),
1199
+ /* @__PURE__ */ jsx("path", {
1200
+ fill: "none",
1201
+ stroke: "currentColor",
1202
+ "stroke-linecap": "round",
1203
+ "stroke-linejoin": "round",
1204
+ "stroke-width": "2",
1205
+ d: "M7 6 C7 12.08 11.92 17 18 17 C18.53 17 19.05 16.96 19.56 16.89 C17.95 19.36 15.17 21 12 21 C7.03 21 3 16.97 3 12 C3 8.83 4.64 6.05 7.11 4.44 C7.04 4.95 7 5.47 7 6 Z",
1206
+ children: /* @__PURE__ */ jsx("set", {
1207
+ fill: "freeze",
1208
+ attributeName: "opacity",
1209
+ begin: "0.6s",
1210
+ to: "0"
1211
+ })
1212
+ }),
1213
+ /* @__PURE__ */ jsxs("mask", {
1214
+ id: "lineMdMoonToSunnyOutlineLoopTransition0",
1215
+ children: [
1216
+ /* @__PURE__ */ jsx("circle", {
1217
+ cx: "12",
1218
+ cy: "12",
1219
+ r: "12",
1220
+ fill: "#fff"
1221
+ }),
1222
+ /* @__PURE__ */ jsx("circle", {
1223
+ cx: "12",
1224
+ cy: "12",
1225
+ r: "8",
1226
+ children: /* @__PURE__ */ jsx("animate", {
1227
+ fill: "freeze",
1228
+ attributeName: "r",
1229
+ begin: "0.6s",
1230
+ dur: "0.4s",
1231
+ values: "8;4"
1232
+ })
1233
+ }),
1234
+ /* @__PURE__ */ jsxs("circle", {
1235
+ cx: "18",
1236
+ cy: "6",
1237
+ r: "12",
1238
+ fill: "#fff",
1239
+ children: [
1240
+ /* @__PURE__ */ jsx("animate", {
1241
+ fill: "freeze",
1242
+ attributeName: "cx",
1243
+ begin: "0.6s",
1244
+ dur: "0.4s",
1245
+ values: "18;22"
1246
+ }),
1247
+ /* @__PURE__ */ jsx("animate", {
1248
+ fill: "freeze",
1249
+ attributeName: "cy",
1250
+ begin: "0.6s",
1251
+ dur: "0.4s",
1252
+ values: "6;2"
1253
+ }),
1254
+ /* @__PURE__ */ jsx("animate", {
1255
+ fill: "freeze",
1256
+ attributeName: "r",
1257
+ begin: "0.6s",
1258
+ dur: "0.4s",
1259
+ values: "12;3"
1260
+ })
1261
+ ]
1262
+ }),
1263
+ /* @__PURE__ */ jsxs("circle", {
1264
+ cx: "18",
1265
+ cy: "6",
1266
+ r: "10",
1267
+ children: [
1268
+ /* @__PURE__ */ jsx("animate", {
1269
+ fill: "freeze",
1270
+ attributeName: "cx",
1271
+ begin: "0.6s",
1272
+ dur: "0.4s",
1273
+ values: "18;22"
1274
+ }),
1275
+ /* @__PURE__ */ jsx("animate", {
1276
+ fill: "freeze",
1277
+ attributeName: "cy",
1278
+ begin: "0.6s",
1279
+ dur: "0.4s",
1280
+ values: "6;2"
1281
+ }),
1282
+ /* @__PURE__ */ jsx("animate", {
1283
+ fill: "freeze",
1284
+ attributeName: "r",
1285
+ begin: "0.6s",
1286
+ dur: "0.4s",
1287
+ values: "10;1"
1288
+ })
1289
+ ]
1290
+ })
1291
+ ]
1292
+ }),
1293
+ /* @__PURE__ */ jsxs("circle", {
1294
+ cx: "12",
1295
+ cy: "12",
1296
+ r: "10",
1297
+ mask: "url(#lineMdMoonToSunnyOutlineLoopTransition0)",
1298
+ opacity: "0",
1299
+ fill: "currentColor",
1300
+ children: [
1301
+ /* @__PURE__ */ jsx("animate", {
1302
+ fill: "freeze",
1303
+ attributeName: "r",
1304
+ begin: "0.6s",
1305
+ dur: "0.4s",
1306
+ values: "10;6"
1307
+ }),
1308
+ /* @__PURE__ */ jsx("set", {
1309
+ fill: "freeze",
1310
+ attributeName: "opacity",
1311
+ begin: "0.6s",
1312
+ to: "1"
1313
+ })
1314
+ ]
1315
+ })
1316
+ ]
1317
+ }) : /* @__PURE__ */ jsxs("svg", {
1318
+ xmlns: "http://www.w3.org/2000/svg",
1319
+ width: size,
1320
+ height: size,
1321
+ viewBox: "0 0 24 24",
1322
+ class: styles$h.icon,
1323
+ onClick$: toggleTheme,
1324
+ children: [
1325
+ /* @__PURE__ */ jsxs("path", {
1326
+ "fill-opacity": "0",
1327
+ d: "M15.22 6.03l2.53-1.94L14.56 4L13.5 1l-1.06 3l-3.19.09l2.53 1.94l-.91 3.06l2.63-1.81l2.63 1.81z",
1328
+ fill: "currentColor",
1329
+ children: [
1330
+ /* @__PURE__ */ jsx("animate", {
1331
+ id: "lineMdSunnyOutlineToMoonLoopTransition0",
1332
+ fill: "freeze",
1333
+ attributeName: "fill-opacity",
1334
+ begin: "0.6s;lineMdSunnyOutlineToMoonLoopTransition0.begin+6s",
1335
+ dur: "0.4s",
1336
+ values: "0;1"
1337
+ }),
1338
+ /* @__PURE__ */ jsx("animate", {
1339
+ fill: "freeze",
1340
+ attributeName: "fill-opacity",
1341
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+2.2s",
1342
+ dur: "0.4s",
1343
+ values: "1;0"
1344
+ })
1345
+ ]
1346
+ }),
1347
+ /* @__PURE__ */ jsxs("path", {
1348
+ "fill-opacity": "0",
1349
+ d: "M13.61 5.25L15.25 4l-2.06-.05L12.5 2l-.69 1.95L9.75 4l1.64 1.25l-.59 1.98l1.7-1.17l1.7 1.17z",
1350
+ fill: "currentColor",
1351
+ children: [
1352
+ /* @__PURE__ */ jsx("animate", {
1353
+ fill: "freeze",
1354
+ attributeName: "fill-opacity",
1355
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+3s",
1356
+ dur: "0.4s",
1357
+ values: "0;1"
1358
+ }),
1359
+ /* @__PURE__ */ jsx("animate", {
1360
+ fill: "freeze",
1361
+ attributeName: "fill-opacity",
1362
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+5.2s",
1363
+ dur: "0.4s",
1364
+ values: "1;0"
1365
+ })
1366
+ ]
1367
+ }),
1368
+ /* @__PURE__ */ jsxs("path", {
1369
+ "fill-opacity": "0",
1370
+ d: "M19.61 12.25L21.25 11l-2.06-.05L18.5 9l-.69 1.95l-2.06.05l1.64 1.25l-.59 1.98l1.7-1.17l1.7 1.17z",
1371
+ fill: "currentColor",
1372
+ children: [
1373
+ /* @__PURE__ */ jsx("animate", {
1374
+ fill: "freeze",
1375
+ attributeName: "fill-opacity",
1376
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+0.4s",
1377
+ dur: "0.4s",
1378
+ values: "0;1"
1379
+ }),
1380
+ /* @__PURE__ */ jsx("animate", {
1381
+ fill: "freeze",
1382
+ attributeName: "fill-opacity",
1383
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+2.8s",
1384
+ dur: "0.4s",
1385
+ values: "1;0"
1386
+ })
1387
+ ]
1388
+ }),
1389
+ /* @__PURE__ */ jsxs("path", {
1390
+ "fill-opacity": "0",
1391
+ d: "M20.828 9.731l1.876-1.439l-2.366-.067L19.552 6l-.786 2.225l-2.366.067l1.876 1.439L17.601 12l1.951-1.342L21.503 12z",
1392
+ fill: "currentColor",
1393
+ children: [
1394
+ /* @__PURE__ */ jsx("animate", {
1395
+ fill: "freeze",
1396
+ attributeName: "fill-opacity",
1397
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+3.4s",
1398
+ dur: "0.4s",
1399
+ values: "0;1"
1400
+ }),
1401
+ /* @__PURE__ */ jsx("animate", {
1402
+ fill: "freeze",
1403
+ attributeName: "fill-opacity",
1404
+ begin: "lineMdSunnyOutlineToMoonLoopTransition0.begin+5.6s",
1405
+ dur: "0.4s",
1406
+ values: "1;0"
1407
+ })
1408
+ ]
1409
+ }),
1410
+ /* @__PURE__ */ jsxs("g", {
1411
+ fill: "none",
1412
+ stroke: "currentColor",
1413
+ "stroke-linecap": "round",
1414
+ "stroke-linejoin": "round",
1415
+ "stroke-width": "2",
1416
+ children: [
1417
+ /* @__PURE__ */ jsxs("g", {
1418
+ children: [
1419
+ /* @__PURE__ */ jsx("path", {
1420
+ "stroke-dasharray": "2",
1421
+ "stroke-dashoffset": "4",
1422
+ d: "M12 21v1M21 12h1M12 3v-1M3 12h-1",
1423
+ children: /* @__PURE__ */ jsx("animate", {
1424
+ fill: "freeze",
1425
+ attributeName: "stroke-dashoffset",
1426
+ dur: "0.2s",
1427
+ values: "4;2"
1428
+ })
1429
+ }),
1430
+ /* @__PURE__ */ jsx("path", {
1431
+ "stroke-dasharray": "2",
1432
+ "stroke-dashoffset": "4",
1433
+ d: "M18.5 18.5l0.5 0.5M18.5 5.5l0.5 -0.5M5.5 5.5l-0.5 -0.5M5.5 18.5l-0.5 0.5",
1434
+ children: /* @__PURE__ */ jsx("animate", {
1435
+ fill: "freeze",
1436
+ attributeName: "stroke-dashoffset",
1437
+ begin: "0.2s",
1438
+ dur: "0.2s",
1439
+ values: "4;2"
1440
+ })
1441
+ }),
1442
+ /* @__PURE__ */ jsx("set", {
1443
+ fill: "freeze",
1444
+ attributeName: "opacity",
1445
+ begin: "0.5s",
1446
+ to: "0"
1447
+ })
1448
+ ]
1449
+ }),
1450
+ /* @__PURE__ */ jsx("path", {
1451
+ d: "M7 6 C7 12.08 11.92 17 18 17 C18.53 17 19.05 16.96 19.56 16.89 C17.95 19.36 15.17 21 12 21 C7.03 21 3 16.97 3 12 C3 8.83 4.64 6.05 7.11 4.44 C7.04 4.95 7 5.47 7 6 Z",
1452
+ opacity: "0",
1453
+ children: /* @__PURE__ */ jsx("set", {
1454
+ fill: "freeze",
1455
+ attributeName: "opacity",
1456
+ begin: "0.5s",
1457
+ to: "1"
1458
+ })
1459
+ })
1460
+ ]
1461
+ }),
1462
+ /* @__PURE__ */ jsxs("mask", {
1463
+ id: "lineMdSunnyOutlineToMoonLoopTransition1",
1464
+ children: [
1465
+ /* @__PURE__ */ jsx("circle", {
1466
+ cx: "12",
1467
+ cy: "12",
1468
+ r: "12",
1469
+ fill: "#fff"
1470
+ }),
1471
+ /* @__PURE__ */ jsx("circle", {
1472
+ cx: "12",
1473
+ cy: "12",
1474
+ r: "4",
1475
+ children: /* @__PURE__ */ jsx("animate", {
1476
+ fill: "freeze",
1477
+ attributeName: "r",
1478
+ begin: "0.1s",
1479
+ dur: "0.4s",
1480
+ values: "4;8"
1481
+ })
1482
+ }),
1483
+ /* @__PURE__ */ jsxs("circle", {
1484
+ cx: "22",
1485
+ cy: "2",
1486
+ r: "3",
1487
+ fill: "#fff",
1488
+ children: [
1489
+ /* @__PURE__ */ jsx("animate", {
1490
+ fill: "freeze",
1491
+ attributeName: "cx",
1492
+ begin: "0.1s",
1493
+ dur: "0.4s",
1494
+ values: "22;18"
1495
+ }),
1496
+ /* @__PURE__ */ jsx("animate", {
1497
+ fill: "freeze",
1498
+ attributeName: "cy",
1499
+ begin: "0.1s",
1500
+ dur: "0.4s",
1501
+ values: "2;6"
1502
+ }),
1503
+ /* @__PURE__ */ jsx("animate", {
1504
+ fill: "freeze",
1505
+ attributeName: "r",
1506
+ begin: "0.1s",
1507
+ dur: "0.4s",
1508
+ values: "3;12"
1509
+ })
1510
+ ]
1511
+ }),
1512
+ /* @__PURE__ */ jsxs("circle", {
1513
+ cx: "22",
1514
+ cy: "2",
1515
+ r: "1",
1516
+ children: [
1517
+ /* @__PURE__ */ jsx("animate", {
1518
+ fill: "freeze",
1519
+ attributeName: "cx",
1520
+ begin: "0.1s",
1521
+ dur: "0.4s",
1522
+ values: "22;18"
1523
+ }),
1524
+ /* @__PURE__ */ jsx("animate", {
1525
+ fill: "freeze",
1526
+ attributeName: "cy",
1527
+ begin: "0.1s",
1528
+ dur: "0.4s",
1529
+ values: "2;6"
1530
+ }),
1531
+ /* @__PURE__ */ jsx("animate", {
1532
+ fill: "freeze",
1533
+ attributeName: "r",
1534
+ begin: "0.1s",
1535
+ dur: "0.4s",
1536
+ values: "1;10"
1537
+ })
1538
+ ]
1539
+ })
1540
+ ]
1541
+ }),
1542
+ /* @__PURE__ */ jsxs("circle", {
1543
+ cx: "12",
1544
+ cy: "12",
1545
+ r: "6",
1546
+ mask: "url(#lineMdSunnyOutlineToMoonLoopTransition1)",
1547
+ fill: "currentColor",
1548
+ children: [
1549
+ /* @__PURE__ */ jsx("animate", {
1550
+ fill: "freeze",
1551
+ attributeName: "r",
1552
+ begin: "0.1s",
1553
+ dur: "0.4s",
1554
+ values: "6;10"
1555
+ }),
1556
+ /* @__PURE__ */ jsx("set", {
1557
+ fill: "freeze",
1558
+ attributeName: "opacity",
1559
+ begin: "0.5s",
1560
+ to: "0"
1561
+ })
1562
+ ]
1563
+ })
1564
+ ]
1565
+ })
1566
+ });
1567
+ });
1568
+ const image$1 = "_image_5s2ag_11";
1569
+ const fallback = "_fallback_5s2ag_33";
1063
1570
  const styles$g = {
1064
- "block-image": "_block-image_zq5gl_1",
1065
- "image-container": "_image-container_zq5gl_11",
1571
+ "block-image": "_block-image_5s2ag_1",
1572
+ "image-container": "_image-container_5s2ag_11",
1066
1573
  image: image$1,
1067
1574
  fallback,
1068
- "caption-box": "_caption-box_zq5gl_41",
1069
- "modal-container": "_modal-container_zq5gl_53"
1575
+ "caption-box": "_caption-box_5s2ag_43",
1576
+ "modal-container": "_modal-container_5s2ag_55"
1070
1577
  };
1071
1578
  const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height, enableModal = true }) => {
1072
1579
  const isLoading = useSignal(true);
@@ -1075,7 +1582,7 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
1075
1582
  isLoading.value = false;
1076
1583
  });
1077
1584
  const handleToggleModal = $(() => {
1078
- if (enableModal) {
1585
+ if (enableModal && !isLoading.value) {
1079
1586
  isShowModal.value = !isShowModal.value;
1080
1587
  }
1081
1588
  });
@@ -1088,7 +1595,8 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
1088
1595
  onLoad$: handleImageLoad,
1089
1596
  style: {
1090
1597
  "--opacity": isLoading.value ? 0 : 1,
1091
- "--cursor": enableModal ? isShowModal.value ? "zoom-out" : "zoom-in" : "default"
1598
+ "--cursor": enableModal ? isShowModal.value ? "zoom-out" : "zoom-in" : "default",
1599
+ "--aspect-ratio": width && height ? `${width} / ${height}` : "auto"
1092
1600
  }
1093
1601
  });
1094
1602
  const Modal = /* @__PURE__ */ jsx("div", {
@@ -1958,5 +2466,6 @@ export {
1958
2466
  ElmTableCell,
1959
2467
  ElmTableHeader,
1960
2468
  ElmTableRow,
1961
- ElmToggle
2469
+ ElmToggle,
2470
+ ElmToggleTheme
1962
2471
  };