@vc-shell/framework 1.1.44 → 1.1.46

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 (453) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/core/plugins/modularity/loader.ts +150 -74
  3. package/core/services/app-bar-mobile-buttons-service.ts +1 -1
  4. package/dist/core/plugins/modularity/loader.d.ts.map +1 -1
  5. package/dist/core/services/app-bar-mobile-buttons-service.d.ts +1 -1
  6. package/dist/core/services/app-bar-mobile-buttons-service.d.ts.map +1 -1
  7. package/dist/framework.js +33355 -295
  8. package/dist/index.css +1 -9
  9. package/dist/index.d.ts +0 -4
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/locales/de.json +0 -84
  12. package/dist/locales/en.json +0 -84
  13. package/dist/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue.d.ts.map +1 -1
  14. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts +1 -1
  15. package/dist/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.d.ts.map +1 -1
  16. package/dist/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.d.ts.map +1 -1
  17. package/dist/shared/components/change-password-button/change-password-button.vue.d.ts.map +1 -1
  18. package/dist/shared/components/logout-button/logout-button.vue.d.ts.map +1 -1
  19. package/dist/shared/components/settings-menu-item/settings-menu-item.vue.d.ts.map +1 -1
  20. package/dist/shared/modules/dynamic/pages/dynamic-blade-form.vue.d.ts +2 -2
  21. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts +6 -6
  22. package/dist/shared/modules/dynamic/pages/dynamic-blade-list.vue.d.ts.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/dist/ui/components/atoms/vc-hint/vc-hint.vue.d.ts.map +1 -1
  25. package/dist/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue.d.ts.map +1 -1
  26. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts +0 -26
  27. package/dist/ui/components/atoms/vc-icon/icons/index.d.ts.map +1 -1
  28. package/dist/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue.d.ts.map +1 -1
  29. package/dist/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue.d.ts.map +1 -1
  30. package/dist/ui/components/atoms/vc-icon/vc-icon.vue.d.ts.map +1 -1
  31. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts +0 -5
  32. package/dist/ui/components/atoms/vc-icon/vc-lucide-icon.vue.d.ts.map +1 -1
  33. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts +0 -20
  34. package/dist/ui/components/atoms/vc-icon/vc-material-icon.vue.d.ts.map +1 -1
  35. package/dist/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue.d.ts.map +1 -1
  36. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts +36 -0
  37. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue.d.ts.map +1 -0
  38. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts +17 -0
  39. package/dist/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue.d.ts.map +1 -0
  40. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts +16 -2381
  41. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  42. package/dist/ui/components/molecules/vc-form/vc-form.vue.d.ts.map +1 -1
  43. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts +1 -1
  44. package/dist/ui/components/molecules/vc-input-currency/vc-input-currency.vue.d.ts.map +1 -1
  45. package/dist/ui/components/molecules/vc-multivalue/vc-multivalue.vue.d.ts +1 -1
  46. package/dist/ui/components/molecules/vc-pagination/vc-pagination.vue.d.ts.map +1 -1
  47. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue.d.ts.map +1 -1
  48. package/dist/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue.d.ts.map +1 -1
  49. package/dist/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue.d.ts.map +1 -1
  50. package/dist/ui/components/organisms/vc-app/vc-app.vue.d.ts.map +1 -1
  51. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue.d.ts.map +1 -1
  52. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue.d.ts.map +1 -1
  53. package/dist/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue.d.ts.map +1 -1
  54. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  55. package/dist/ui/components/organisms/vc-gallery/_internal/vc-gallery-item/vc-gallery-item.vue.d.ts +2 -2
  56. package/dist/ui/components/organisms/vc-gallery/vc-gallery.vue.d.ts +2 -2
  57. package/dist/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue.d.ts.map +1 -1
  58. package/dist/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue.d.ts.map +1 -1
  59. package/dist/vendor-boolbase-Cp9L0GAZ.js +25 -0
  60. package/dist/vendor-cheerio-HN9zIPZn.js +3135 -0
  61. package/dist/vendor-cheerio-select-5Ry0HvBq.js +306 -0
  62. package/dist/vendor-core-js-l0sNRNKZ.js +1 -0
  63. package/dist/vendor-css-select-DRIZ9kfZ.js +966 -0
  64. package/dist/vendor-css-what-DuPJ1HEF.js +448 -0
  65. package/dist/vendor-cypress-signalr-mock-BKdBJpdt.js +778 -0
  66. package/dist/vendor-date-fns-515YWkk-.js +6724 -0
  67. package/dist/vendor-dom-serializer-nQMsqjYW.js +286 -0
  68. package/dist/vendor-dom7-CJLPMwy5.js +941 -0
  69. package/dist/vendor-domelementtype-CjSzQey5.js +53 -0
  70. package/dist/vendor-domhandler-9z8cS16a.js +484 -0
  71. package/dist/vendor-dompurify-CRFzu7ib.js +1336 -0
  72. package/dist/vendor-domutils-Bc-Opz-v.js +981 -0
  73. package/dist/vendor-entities-Bfsx4xOQ.js +636 -0
  74. package/dist/vendor-floating-ui-core-wV8u8QP4.js +511 -0
  75. package/dist/vendor-floating-ui-dom-DDnRPs17.js +706 -0
  76. package/dist/vendor-floating-ui-utils-OMIFy1QU.js +296 -0
  77. package/dist/vendor-floating-ui-vue-D-tCDAMm.js +167 -0
  78. package/dist/vendor-fontsource-plus-jakarta-sans.css +1 -0
  79. package/dist/vendor-headlessui-vue-CY9FRgTb.js +83 -0
  80. package/dist/vendor-htmlparser2-B1dhFPOs.js +1426 -0
  81. package/dist/vendor-iconify-vue-DfRGgyNu.js +1840 -0
  82. package/dist/vendor-intlify-core-base-BuknsFQe.js +1876 -0
  83. package/dist/vendor-intlify-message-compiler-CuOQDWx1.js +1508 -0
  84. package/dist/vendor-intlify-shared-Cz4YRMuC.js +241 -0
  85. package/dist/vendor-iso-639-1-BJCk9DvE.js +819 -0
  86. package/dist/vendor-linkify-it-CKUf4vsc.js +830 -0
  87. package/dist/vendor-linkifyjs-BfyGgbCh.js +1756 -0
  88. package/dist/vendor-lodash-es-BySUOlwf.js +18333 -0
  89. package/dist/vendor-markdown-it-D-apazHa.js +6000 -0
  90. package/dist/vendor-markdown-it-task-lists-rxMVH6Ku.js +131 -0
  91. package/dist/vendor-mdurl-BNh2CCgT.js +537 -0
  92. package/dist/vendor-microsoft-applicationinsights-analytics-js-kG3lLg8X.js +1275 -0
  93. package/dist/vendor-microsoft-applicationinsights-cfgsync-js-C0uQkiQq.js +591 -0
  94. package/dist/vendor-microsoft-applicationinsights-channel-js-Dyd_PXA3.js +2153 -0
  95. package/dist/vendor-microsoft-applicationinsights-common-CfmP1_Qr.js +2470 -0
  96. package/dist/vendor-microsoft-applicationinsights-core-js-Cq4YSEvZ.js +6589 -0
  97. package/dist/vendor-microsoft-applicationinsights-dependencies-js-C56OBFr4.js +1510 -0
  98. package/dist/vendor-microsoft-applicationinsights-properties-js-CBJTBawx.js +761 -0
  99. package/dist/vendor-microsoft-applicationinsights-shims-CX8sJgar.js +70 -0
  100. package/dist/vendor-microsoft-applicationinsights-web-pim2ri-g.js +667 -0
  101. package/dist/vendor-microsoft-dynamicproto-js-CFBBUu9p.js +520 -0
  102. package/dist/vendor-microsoft-signalr-dUnlRsGm.js +3339 -0
  103. package/dist/vendor-moment-Mki5YqAR.js +5679 -0
  104. package/dist/vendor-nevware21-ts-async-CLMApQ9E.js +395 -0
  105. package/dist/vendor-nevware21-ts-utils-e8v8Jty3.js +1160 -0
  106. package/dist/vendor-normalize-css.css +1 -0
  107. package/dist/vendor-nth-check-Bx8TxtJt.js +157 -0
  108. package/dist/vendor-orderedmap-dGG6uMFJ.js +137 -0
  109. package/dist/vendor-parse5-Bt2NhSzR.js +8432 -0
  110. package/dist/vendor-parse5-htmlparser2-tree-adapter-BUUtKzf8.js +216 -0
  111. package/dist/vendor-popperjs-core-Cr2byIky.js +1790 -0
  112. package/dist/vendor-prettier-B4PaeWRQ.js +98 -0
  113. package/dist/vendor-prosemirror-commands-BH9lWGpW.js +561 -0
  114. package/dist/vendor-prosemirror-dropcursor-CeyPcxrA.js +146 -0
  115. package/dist/vendor-prosemirror-gapcursor-U8UoUJII.js +236 -0
  116. package/dist/vendor-prosemirror-history-BDaJkvNx.js +414 -0
  117. package/dist/vendor-prosemirror-keymap-BbWvIWmH.js +128 -0
  118. package/dist/vendor-prosemirror-markdown-gB0PXBbz.js +866 -0
  119. package/dist/vendor-prosemirror-model-BZu3WVcD.js +3463 -0
  120. package/dist/vendor-prosemirror-schema-list-Bl9NpKA7.js +158 -0
  121. package/dist/vendor-prosemirror-state-BvL9Pxph.js +1003 -0
  122. package/dist/vendor-prosemirror-tables-17qAnviK.js +2159 -0
  123. package/dist/vendor-prosemirror-transform-CE9VV3qg.js +2156 -0
  124. package/dist/vendor-prosemirror-view-CU2WTHT7.js +5811 -0
  125. package/dist/vendor-punycode-js-iAs5RxMf.js +441 -0
  126. package/dist/vendor-rope-sequence-BdXDKoGt.js +207 -0
  127. package/dist/vendor-semver-CVLMK-S4.js +2702 -0
  128. package/dist/vendor-ssr-window-s6OpKa3O.js +150 -0
  129. package/dist/vendor-swiper-CdiyNHVt.js +5679 -0
  130. package/dist/vendor-swiper.css +1 -0
  131. package/dist/vendor-tanstack-virtual-core-l0sNRNKZ.js +1 -0
  132. package/dist/vendor-tanstack-vue-virtual-l0sNRNKZ.js +1 -0
  133. package/dist/vendor-tippy-js-DWFe2TfK.js +1647 -0
  134. package/dist/vendor-tiptap-core-NfwGfaQk.js +4910 -0
  135. package/dist/vendor-tiptap-extension-blockquote-jmWBTtsI.js +57 -0
  136. package/dist/vendor-tiptap-extension-bold-p5frh4ak.js +97 -0
  137. package/dist/vendor-tiptap-extension-bubble-menu-KUhZSfrs.js +218 -0
  138. package/dist/vendor-tiptap-extension-bullet-list-COmZRoSB.js +73 -0
  139. package/dist/vendor-tiptap-extension-code-block-DyTARZss.js +221 -0
  140. package/dist/vendor-tiptap-extension-code-jVv6CXpX.js +75 -0
  141. package/dist/vendor-tiptap-extension-document-DssuotYs.js +13 -0
  142. package/dist/vendor-tiptap-extension-dropcursor-BoO0Qv91.js +26 -0
  143. package/dist/vendor-tiptap-extension-floating-menu-CrO8CN5w.js +165 -0
  144. package/dist/vendor-tiptap-extension-gapcursor-KpsWEoMD.js +30 -0
  145. package/dist/vendor-tiptap-extension-hard-break-ldOzhSvf.js +68 -0
  146. package/dist/vendor-tiptap-extension-heading-CKz2llX0.js +77 -0
  147. package/dist/vendor-tiptap-extension-history-DeKZ2VQ9.js +48 -0
  148. package/dist/vendor-tiptap-extension-horizontal-rule-CAjWRyDS.js +92 -0
  149. package/dist/vendor-tiptap-extension-image-ZagcEYuk.js +76 -0
  150. package/dist/vendor-tiptap-extension-italic-CM4xdznY.js +96 -0
  151. package/dist/vendor-tiptap-extension-link-Z-AMC4Ri.js +414 -0
  152. package/dist/vendor-tiptap-extension-list-item-BJi5QpXc.js +37 -0
  153. package/dist/vendor-tiptap-extension-ordered-list-C_TMrfBE.js +97 -0
  154. package/dist/vendor-tiptap-extension-paragraph-CQw0E0Au.js +39 -0
  155. package/dist/vendor-tiptap-extension-placeholder-BBNVKfa_.js +66 -0
  156. package/dist/vendor-tiptap-extension-strike-DUyMYX1Z.js +79 -0
  157. package/dist/vendor-tiptap-extension-table-cell-CoDIMPA5.js +47 -0
  158. package/dist/vendor-tiptap-extension-table-header-DvbGHnmw.js +47 -0
  159. package/dist/vendor-tiptap-extension-table-row-D1uqN5Aj.js +26 -0
  160. package/dist/vendor-tiptap-extension-table-tKS4MOM4.js +354 -0
  161. package/dist/vendor-tiptap-extension-text-DtRBhKB2.js +12 -0
  162. package/dist/vendor-tiptap-extension-underline-DqaSFp_P.js +50 -0
  163. package/dist/vendor-tiptap-markdown-7-PCADTU.js +1017 -0
  164. package/dist/vendor-tiptap-pm-l0sNRNKZ.js +1 -0
  165. package/dist/vendor-tiptap-starter-kit-CDSV_Zuu.js +88 -0
  166. package/dist/vendor-tiptap-vue-3-DZg2fjq_.js +268 -0
  167. package/dist/vendor-truncate-html-3qQY0Djo.js +196 -0
  168. package/dist/vendor-uc-micro-jjt6LQ65.js +23 -0
  169. package/dist/vendor-vee-validate-i18n-v_gHjRmD.js +154 -0
  170. package/dist/vendor-vee-validate-rules-DzV3VY3N.js +536 -0
  171. package/dist/vendor-vue-currency-input-DGAkEFBO.js +545 -0
  172. package/dist/vendor-vue-demi-l0sNRNKZ.js +1 -0
  173. package/dist/vendor-vue-devtools-api-DXYR8qBG.js +169 -0
  174. package/dist/vendor-vue-i18n-Co752uk3.js +1897 -0
  175. package/dist/vendor-vue3-application-insights-CYWFCr_J.js +119 -0
  176. package/dist/vendor-vue3-touch-events-BJEAiSa3.js +416 -0
  177. package/dist/vendor-vuepic-vue-datepicker-BSWXRSiu.js +5019 -0
  178. package/dist/vendor-vuepic-vue-datepicker.css +1 -0
  179. package/dist/vendor-vueuse-components-l1bL12mE.js +339 -0
  180. package/dist/vendor-vueuse-core-DGcJOmwG.js +7743 -0
  181. package/dist/vendor-vueuse-shared-_mOXsFuM.js +1568 -0
  182. package/dist/vendor-w3c-keyname-BOm2dtJm.js +121 -0
  183. package/package.json +22 -11
  184. package/shared/components/blade-navigation/components/vc-blade-navigation/_internal/vc-mobile-back-button.vue +3 -3
  185. package/shared/components/blade-navigation/components/vc-blade-view/vc-blade-view.ts +2 -1
  186. package/shared/components/blade-navigation/composables/useBladeNavigation/internal/bladeRouteResolver.ts +1 -0
  187. package/shared/components/change-password-button/change-password-button.vue +1 -2
  188. package/shared/components/logout-button/logout-button.vue +1 -2
  189. package/shared/components/notifications/components/notification-container/index.ts +1 -1
  190. package/shared/components/notifications/core/notification.ts +1 -1
  191. package/shared/components/settings-menu-item/settings-menu-item.vue +1 -0
  192. package/shared/components/sidebar/sidebar.vue +2 -2
  193. package/shared/modules/dynamic/pages/dynamic-blade-list.vue +2 -1
  194. package/ui/components/atoms/vc-hint/vc-hint.vue +2 -0
  195. package/ui/components/atoms/vc-icon/composables/use-icon.ts +1 -1
  196. package/ui/components/atoms/vc-icon/icons/MenuBurgerIcon.vue +18 -14
  197. package/ui/components/atoms/vc-icon/icons/index.ts +1 -27
  198. package/ui/components/atoms/vc-icon/vc-bootstrap-icon.vue +7 -11
  199. package/ui/components/atoms/vc-icon/vc-fontawesome-icon.vue +37 -31
  200. package/ui/components/atoms/vc-icon/vc-icon-examples.vue +1 -1
  201. package/ui/components/atoms/vc-icon/vc-icon.stories.ts +4 -5
  202. package/ui/components/atoms/vc-icon/vc-icon.vue +43 -186
  203. package/ui/components/atoms/vc-icon/vc-lucide-icon.vue +22 -70
  204. package/ui/components/atoms/vc-icon/vc-material-icon.vue +28 -59
  205. package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +2 -3
  206. package/ui/components/molecules/vc-editor/_internal/vc-editor-button.vue +103 -0
  207. package/ui/components/molecules/vc-editor/_internal/vc-editor-toolbar.vue +252 -0
  208. package/ui/components/molecules/vc-editor/vc-editor.stories.ts +1 -4
  209. package/ui/components/molecules/vc-editor/vc-editor.vue +666 -360
  210. package/ui/components/molecules/vc-form/vc-form.vue +7 -5
  211. package/ui/components/molecules/vc-input/vc-input.vue +1 -1
  212. package/ui/components/molecules/vc-pagination/vc-pagination.vue +4 -17
  213. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/AppBarMobileActions.vue +1 -1
  214. package/ui/components/organisms/vc-app/_internal/vc-app-bar/_internal/MenuSidebar.vue +1 -3
  215. package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -4
  216. package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +1 -3
  217. package/ui/components/organisms/vc-app/vc-app.backupsb.ts +214 -214
  218. package/ui/components/organisms/vc-app/vc-app.vue +3 -5
  219. package/ui/components/organisms/vc-blade/_internal/vc-blade-header/vc-blade-header.vue +3 -10
  220. package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-buttons/mobile/vc-blade-toolbar-mobile.vue +1 -1
  221. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-desktop.vue +2 -2
  222. package/ui/components/organisms/vc-blade/_internal/vc-blade-widget-container/_internal/vc-widget-container-mobile.vue +2 -2
  223. package/ui/components/organisms/vc-blade/vc-blade.vue +4 -5
  224. package/ui/components/organisms/vc-table/_internal/vc-table-filter/vc-table-filter.vue +1 -3
  225. package/ui/components/organisms/vc-table/_internal/vc-table-header/vc-table-header.vue +1 -2
  226. package/ui/components/organisms/vc-table/composables/useTableState.ts +5 -5
  227. package/dist/apl-B2DGVGxc.js +0 -76
  228. package/dist/asciiarmor-2LVJmxlE.js +0 -34
  229. package/dist/asn1-jKiBa2Ya.js +0 -95
  230. package/dist/asterisk-DS281yxp.js +0 -271
  231. package/dist/brainfuck-C_p9pTT8.js +0 -34
  232. package/dist/clike-DGTaUp48.js +0 -620
  233. package/dist/clojure-CCKyeQKf.js +0 -800
  234. package/dist/cmake-CuaCgAKt.js +0 -28
  235. package/dist/cobol-BlTKFDRj.js +0 -72
  236. package/dist/coffeescript-BVCvwO8I.js +0 -179
  237. package/dist/commonlisp-D_kxz07b.js +0 -75
  238. package/dist/crystal-D309uH6_.js +0 -217
  239. package/dist/css-BkF-NPzE.js +0 -1553
  240. package/dist/cypher-BMq4Fwjl.js +0 -68
  241. package/dist/d-BZcgY6La.js +0 -127
  242. package/dist/diff-Cg9d_RX2.js +0 -18
  243. package/dist/dockerfile-DIy8NleC.js +0 -194
  244. package/dist/dtd-CtLokQ-U.js +0 -84
  245. package/dist/dylan-QYeExnWK.js +0 -234
  246. package/dist/ebnf-DUPDuY4r.js +0 -78
  247. package/dist/ecl-CiXN-g_D.js +0 -121
  248. package/dist/eiffel-yQhjl4T1.js +0 -110
  249. package/dist/elm-CNT9vbN0.js +0 -108
  250. package/dist/erlang-CFOYdy9e.js +0 -487
  251. package/dist/factor-DDOC7X6P.js +0 -65
  252. package/dist/fcl-CPC2WYrI.js +0 -103
  253. package/dist/forth-BmxRyE9S.js +0 -60
  254. package/dist/fortran-9bvPyrOW.js +0 -442
  255. package/dist/gas-cpmYfFX2.js +0 -183
  256. package/dist/gherkin-CJuwpceU.js +0 -34
  257. package/dist/groovy-DZeT_VM-.js +0 -146
  258. package/dist/haskell-Bvt3Qq1t.js +0 -375
  259. package/dist/haxe-70NVW1pR.js +0 -359
  260. package/dist/http-D9LttvKF.js +0 -44
  261. package/dist/idl-B6TRFYjl.js +0 -947
  262. package/dist/index-4DWvmoYg.js +0 -71
  263. package/dist/index-52o7mJaX.js +0 -156
  264. package/dist/index-B0KatioT.js +0 -98
  265. package/dist/index-BP3W8zuk.js +0 -268
  266. package/dist/index-BykT5L1A.js +0 -148134
  267. package/dist/index-CfXo9hsG.js +0 -75
  268. package/dist/index-Ch37pBUt.js +0 -308
  269. package/dist/index-D2KGkAYT.js +0 -93
  270. package/dist/index-D83zQom_.js +0 -58
  271. package/dist/index-DuQrVLbu.js +0 -134
  272. package/dist/index-_fdMid5h.js +0 -288
  273. package/dist/index-a1wO-owY.js +0 -545
  274. package/dist/index-crMpNSFe.js +0 -611
  275. package/dist/index-dmBRpHHY.js +0 -137
  276. package/dist/index-kBdB14Fz.js +0 -341
  277. package/dist/index-uBhy41le.js +0 -249
  278. package/dist/index-zZrijNsr.js +0 -299
  279. package/dist/javascript-C2yteZeJ.js +0 -691
  280. package/dist/jinja2-DnB6dQmV.js +0 -154
  281. package/dist/julia-DpvXAuO6.js +0 -241
  282. package/dist/livescript-CanGTf8u.js +0 -272
  283. package/dist/lua-XplVlWi_.js +0 -217
  284. package/dist/mathematica-jaRHnSxC.js +0 -35
  285. package/dist/mbox-BctzC1hL.js +0 -76
  286. package/dist/mirc-CFBPAOaF.js +0 -72
  287. package/dist/mllike-BSnXJBGA.js +0 -272
  288. package/dist/modelica-vUgVs--1.js +0 -93
  289. package/dist/mscgen-Cpl0NYLN.js +0 -104
  290. package/dist/mumps-CQoS1kWX.js +0 -25
  291. package/dist/nginx-zDPm3Z74.js +0 -89
  292. package/dist/nsis-fePjrhq7.js +0 -62
  293. package/dist/ntriples-CsNjv2QF.js +0 -79
  294. package/dist/octave-C8PmmSRH.js +0 -143
  295. package/dist/oz-Ce8aN8oE.js +0 -151
  296. package/dist/pascal-De0D6mP7.js +0 -77
  297. package/dist/perl-B4bSCe1C.js +0 -915
  298. package/dist/pig-D24Z8EXi.js +0 -54
  299. package/dist/powershell-DkYVfTzP.js +0 -249
  300. package/dist/properties-Dn9wna3M.js +0 -26
  301. package/dist/protobuf-BPIjwpzm.js +0 -49
  302. package/dist/pug-CwAQJzGR.js +0 -248
  303. package/dist/puppet-nyd4dhjf.js +0 -45
  304. package/dist/python-BkR3uSy8.js +0 -313
  305. package/dist/q-DXjKs-tC.js +0 -83
  306. package/dist/r-LKEuhEGI.js +0 -104
  307. package/dist/rpm-IznJm2Xc.js +0 -57
  308. package/dist/ruby-CcYfvIk6.js +0 -228
  309. package/dist/sas-7E8yHoCW.js +0 -105
  310. package/dist/scheme-DjibxsNh.js +0 -124
  311. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts +0 -113
  312. package/dist/shared/modules/dynamic/components/fields/storybook/common/args.d.ts.map +0 -1
  313. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts +0 -3
  314. package/dist/shared/modules/dynamic/components/fields/storybook/common/templates.d.ts.map +0 -1
  315. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts +0 -102
  316. package/dist/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.d.ts.map +0 -1
  317. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts +0 -4
  318. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.d.ts.map +0 -1
  319. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts +0 -3
  320. package/dist/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.d.ts.map +0 -1
  321. package/dist/shell-C0C2sNA_.js +0 -182
  322. package/dist/sieve-Bwz7vjP5.js +0 -72
  323. package/dist/simple-mode-B0dvCdAA.js +0 -89
  324. package/dist/smalltalk-Bhddl2pB.js +0 -48
  325. package/dist/solr-BNlsLglM.js +0 -41
  326. package/dist/sparql-FarWu_Gb.js +0 -197
  327. package/dist/spreadsheet-C-cy4P5N.js +0 -49
  328. package/dist/sql-CfG5lQ3l.js +0 -282
  329. package/dist/stex-Du4h4KAU.js +0 -129
  330. package/dist/stylus-CAdqWld3.js +0 -250
  331. package/dist/swift-DSxqR9R6.js +0 -230
  332. package/dist/tcl-xfoLljhY.js +0 -81
  333. package/dist/textile-D1AWE-pc.js +0 -295
  334. package/dist/tiddlywiki-5wqsXtSk.js +0 -155
  335. package/dist/tiki-__Kn3CeS.js +0 -181
  336. package/dist/toml-BHiuTcfn.js +0 -49
  337. package/dist/troff-D2UO-fKf.js +0 -35
  338. package/dist/ttcn-Bsa4sfRm.js +0 -123
  339. package/dist/ttcn-cfg-Bac_acMi.js +0 -88
  340. package/dist/turtle-xwJUxoPV.js +0 -80
  341. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts +0 -7
  342. package/dist/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue.d.ts.map +0 -1
  343. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts +0 -7
  344. package/dist/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue.d.ts.map +0 -1
  345. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts +0 -7
  346. package/dist/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue.d.ts.map +0 -1
  347. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts +0 -7
  348. package/dist/ui/components/atoms/vc-icon/icons/BellIcon.vue.d.ts.map +0 -1
  349. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts +0 -7
  350. package/dist/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue.d.ts.map +0 -1
  351. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts +0 -7
  352. package/dist/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue.d.ts.map +0 -1
  353. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts +0 -7
  354. package/dist/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue.d.ts.map +0 -1
  355. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts +0 -7
  356. package/dist/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue.d.ts.map +0 -1
  357. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts +0 -7
  358. package/dist/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue.d.ts.map +0 -1
  359. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts +0 -7
  360. package/dist/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue.d.ts.map +0 -1
  361. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts +0 -7
  362. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue.d.ts.map +0 -1
  363. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts +0 -7
  364. package/dist/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue.d.ts.map +0 -1
  365. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts +0 -7
  366. package/dist/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue.d.ts.map +0 -1
  367. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts +0 -7
  368. package/dist/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue.d.ts.map +0 -1
  369. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts +0 -7
  370. package/dist/ui/components/atoms/vc-icon/icons/LogoutIcon.vue.d.ts.map +0 -1
  371. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts +0 -7
  372. package/dist/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue.d.ts.map +0 -1
  373. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts +0 -7
  374. package/dist/ui/components/atoms/vc-icon/icons/OffersIcon.vue.d.ts.map +0 -1
  375. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts +0 -7
  376. package/dist/ui/components/atoms/vc-icon/icons/OrdersIcon.vue.d.ts.map +0 -1
  377. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts +0 -7
  378. package/dist/ui/components/atoms/vc-icon/icons/PeopleIcon.vue.d.ts.map +0 -1
  379. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts +0 -7
  380. package/dist/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue.d.ts.map +0 -1
  381. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts +0 -7
  382. package/dist/ui/components/atoms/vc-icon/icons/ProductsIcon.vue.d.ts.map +0 -1
  383. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts +0 -7
  384. package/dist/ui/components/atoms/vc-icon/icons/ProfileIcon.vue.d.ts.map +0 -1
  385. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts +0 -7
  386. package/dist/ui/components/atoms/vc-icon/icons/SearchIcon.vue.d.ts.map +0 -1
  387. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts +0 -7
  388. package/dist/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue.d.ts.map +0 -1
  389. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts +0 -7
  390. package/dist/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue.d.ts.map +0 -1
  391. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts +0 -7
  392. package/dist/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue.d.ts.map +0 -1
  393. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts +0 -7
  394. package/dist/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue.d.ts.map +0 -1
  395. package/dist/vb-c2kQGd6-.js +0 -74
  396. package/dist/vbscript-1f_Dhg5H.js +0 -324
  397. package/dist/velocity-DJd0pTTC.js +0 -96
  398. package/dist/verilog-CiS1jyi5.js +0 -262
  399. package/dist/vhdl-T9HkrbI2.js +0 -106
  400. package/dist/webidl-CjfDENEo.js +0 -155
  401. package/dist/xquery-BUQdORAS.js +0 -422
  402. package/dist/yacas-C0absKBh.js +0 -73
  403. package/dist/z80-Pki2zAjW.js +0 -61
  404. package/shared/modules/dynamic/components/fields/storybook/Button.stories.ts +0 -186
  405. package/shared/modules/dynamic/components/fields/storybook/Card.stories.ts +0 -175
  406. package/shared/modules/dynamic/components/fields/storybook/Checkbox.stories.ts +0 -185
  407. package/shared/modules/dynamic/components/fields/storybook/ContentField.stories.ts +0 -245
  408. package/shared/modules/dynamic/components/fields/storybook/EditorField.stories.ts +0 -192
  409. package/shared/modules/dynamic/components/fields/storybook/Fieldset.stories.ts +0 -347
  410. package/shared/modules/dynamic/components/fields/storybook/GalleryField.stories.ts +0 -239
  411. package/shared/modules/dynamic/components/fields/storybook/ImageField.stories.ts +0 -186
  412. package/shared/modules/dynamic/components/fields/storybook/InputCurrency.stories.ts +0 -281
  413. package/shared/modules/dynamic/components/fields/storybook/InputField.stories.ts +0 -312
  414. package/shared/modules/dynamic/components/fields/storybook/MultivalueField.stories.ts +0 -361
  415. package/shared/modules/dynamic/components/fields/storybook/RadioButtonGroup.stories.ts +0 -224
  416. package/shared/modules/dynamic/components/fields/storybook/RatingField.stories.ts +0 -131
  417. package/shared/modules/dynamic/components/fields/storybook/SelectField.stories.ts +0 -666
  418. package/shared/modules/dynamic/components/fields/storybook/StatusField.stories.ts +0 -202
  419. package/shared/modules/dynamic/components/fields/storybook/SwitchField.stories.ts +0 -178
  420. package/shared/modules/dynamic/components/fields/storybook/TextareaField.stories.ts +0 -203
  421. package/shared/modules/dynamic/components/fields/storybook/VideoField.stories.ts +0 -92
  422. package/shared/modules/dynamic/components/fields/storybook/common/args.ts +0 -130
  423. package/shared/modules/dynamic/components/fields/storybook/common/templates.ts +0 -8
  424. package/shared/modules/dynamic/components/fields/storybook/pages/DynamicRender.ts +0 -54
  425. package/shared/modules/dynamic/components/fields/storybook/utils/sourceHighlighter.ts +0 -16
  426. package/shared/modules/dynamic/components/fields/storybook/utils/sourceTransform.ts +0 -41
  427. package/ui/components/atoms/vc-icon/icons/AppWindowIcon.vue +0 -15
  428. package/ui/components/atoms/vc-icon/icons/ArrowLeftIcon.vue +0 -20
  429. package/ui/components/atoms/vc-icon/icons/ArrowRightIcon.vue +0 -13
  430. package/ui/components/atoms/vc-icon/icons/BellIcon.vue +0 -14
  431. package/ui/components/atoms/vc-icon/icons/ChevronDownIcon.vue +0 -13
  432. package/ui/components/atoms/vc-icon/icons/ChevronLeftIcon.vue +0 -13
  433. package/ui/components/atoms/vc-icon/icons/ChevronRightIcon.vue +0 -13
  434. package/ui/components/atoms/vc-icon/icons/ChevronUpIcon.vue +0 -13
  435. package/ui/components/atoms/vc-icon/icons/CircleDotsIcon.vue +0 -16
  436. package/ui/components/atoms/vc-icon/icons/CrossSignIcon.vue +0 -20
  437. package/ui/components/atoms/vc-icon/icons/DoubleArrowLeftIcon.vue +0 -14
  438. package/ui/components/atoms/vc-icon/icons/DoubleArrowRightIcon.vue +0 -14
  439. package/ui/components/atoms/vc-icon/icons/FulfillmentCentersIcon.vue +0 -27
  440. package/ui/components/atoms/vc-icon/icons/GridDotsIcon.vue +0 -22
  441. package/ui/components/atoms/vc-icon/icons/LogoutIcon.vue +0 -13
  442. package/ui/components/atoms/vc-icon/icons/MinusSignIcon.vue +0 -14
  443. package/ui/components/atoms/vc-icon/icons/OffersIcon.vue +0 -23
  444. package/ui/components/atoms/vc-icon/icons/OrdersIcon.vue +0 -19
  445. package/ui/components/atoms/vc-icon/icons/PeopleIcon.vue +0 -21
  446. package/ui/components/atoms/vc-icon/icons/PlusSignIcon.vue +0 -20
  447. package/ui/components/atoms/vc-icon/icons/ProductsIcon.vue +0 -23
  448. package/ui/components/atoms/vc-icon/icons/ProfileIcon.vue +0 -18
  449. package/ui/components/atoms/vc-icon/icons/SearchIcon.vue +0 -14
  450. package/ui/components/atoms/vc-icon/icons/SettingsBoltIcon.vue +0 -21
  451. package/ui/components/atoms/vc-icon/icons/ShoppingCardIcon.vue +0 -16
  452. package/ui/components/atoms/vc-icon/icons/VendorSwitchIcon.vue +0 -26
  453. package/ui/components/atoms/vc-icon/icons/VertDotsIcon.vue +0 -19
@@ -0,0 +1,1840 @@
1
+ import { defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, h, nextTick } from 'vue';
2
+
3
+ const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
4
+ const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
5
+ const colonSeparated = value.split(":");
6
+ if (value.slice(0, 1) === "@") {
7
+ if (colonSeparated.length < 2 || colonSeparated.length > 3) {
8
+ return null;
9
+ }
10
+ provider = colonSeparated.shift().slice(1);
11
+ }
12
+ if (colonSeparated.length > 3 || !colonSeparated.length) {
13
+ return null;
14
+ }
15
+ if (colonSeparated.length > 1) {
16
+ const name2 = colonSeparated.pop();
17
+ const prefix = colonSeparated.pop();
18
+ const result = {
19
+ // Allow provider without '@': "provider:prefix:name"
20
+ provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
21
+ prefix,
22
+ name: name2
23
+ };
24
+ return validate && !validateIconName(result) ? null : result;
25
+ }
26
+ const name = colonSeparated[0];
27
+ const dashSeparated = name.split("-");
28
+ if (dashSeparated.length > 1) {
29
+ const result = {
30
+ provider,
31
+ prefix: dashSeparated.shift(),
32
+ name: dashSeparated.join("-")
33
+ };
34
+ return validate && !validateIconName(result) ? null : result;
35
+ }
36
+ if (allowSimpleName && provider === "") {
37
+ const result = {
38
+ provider,
39
+ prefix: "",
40
+ name
41
+ };
42
+ return validate && !validateIconName(result, allowSimpleName) ? null : result;
43
+ }
44
+ return null;
45
+ };
46
+ const validateIconName = (icon, allowSimpleName) => {
47
+ if (!icon) {
48
+ return false;
49
+ }
50
+ return !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
51
+ // Check name: cannot be empty
52
+ ((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
53
+ };
54
+
55
+ const defaultIconDimensions = Object.freeze(
56
+ {
57
+ left: 0,
58
+ top: 0,
59
+ width: 16,
60
+ height: 16
61
+ }
62
+ );
63
+ const defaultIconTransformations = Object.freeze({
64
+ rotate: 0,
65
+ vFlip: false,
66
+ hFlip: false
67
+ });
68
+ const defaultIconProps = Object.freeze({
69
+ ...defaultIconDimensions,
70
+ ...defaultIconTransformations
71
+ });
72
+ const defaultExtendedIconProps = Object.freeze({
73
+ ...defaultIconProps,
74
+ body: "",
75
+ hidden: false
76
+ });
77
+
78
+ function mergeIconTransformations(obj1, obj2) {
79
+ const result = {};
80
+ if (!obj1.hFlip !== !obj2.hFlip) {
81
+ result.hFlip = true;
82
+ }
83
+ if (!obj1.vFlip !== !obj2.vFlip) {
84
+ result.vFlip = true;
85
+ }
86
+ const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
87
+ if (rotate) {
88
+ result.rotate = rotate;
89
+ }
90
+ return result;
91
+ }
92
+
93
+ function mergeIconData(parent, child) {
94
+ const result = mergeIconTransformations(parent, child);
95
+ for (const key in defaultExtendedIconProps) {
96
+ if (key in defaultIconTransformations) {
97
+ if (key in parent && !(key in result)) {
98
+ result[key] = defaultIconTransformations[key];
99
+ }
100
+ } else if (key in child) {
101
+ result[key] = child[key];
102
+ } else if (key in parent) {
103
+ result[key] = parent[key];
104
+ }
105
+ }
106
+ return result;
107
+ }
108
+
109
+ function getIconsTree(data, names) {
110
+ const icons = data.icons;
111
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
112
+ const resolved = /* @__PURE__ */ Object.create(null);
113
+ function resolve(name) {
114
+ if (icons[name]) {
115
+ return resolved[name] = [];
116
+ }
117
+ if (!(name in resolved)) {
118
+ resolved[name] = null;
119
+ const parent = aliases[name] && aliases[name].parent;
120
+ const value = parent && resolve(parent);
121
+ if (value) {
122
+ resolved[name] = [parent].concat(value);
123
+ }
124
+ }
125
+ return resolved[name];
126
+ }
127
+ (Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
128
+ return resolved;
129
+ }
130
+
131
+ function internalGetIconData(data, name, tree) {
132
+ const icons = data.icons;
133
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
134
+ let currentProps = {};
135
+ function parse(name2) {
136
+ currentProps = mergeIconData(
137
+ icons[name2] || aliases[name2],
138
+ currentProps
139
+ );
140
+ }
141
+ parse(name);
142
+ tree.forEach(parse);
143
+ return mergeIconData(data, currentProps);
144
+ }
145
+
146
+ function parseIconSet(data, callback) {
147
+ const names = [];
148
+ if (typeof data !== "object" || typeof data.icons !== "object") {
149
+ return names;
150
+ }
151
+ if (data.not_found instanceof Array) {
152
+ data.not_found.forEach((name) => {
153
+ callback(name, null);
154
+ names.push(name);
155
+ });
156
+ }
157
+ const tree = getIconsTree(data);
158
+ for (const name in tree) {
159
+ const item = tree[name];
160
+ if (item) {
161
+ callback(name, internalGetIconData(data, name, item));
162
+ names.push(name);
163
+ }
164
+ }
165
+ return names;
166
+ }
167
+
168
+ const optionalPropertyDefaults = {
169
+ provider: "",
170
+ aliases: {},
171
+ not_found: {},
172
+ ...defaultIconDimensions
173
+ };
174
+ function checkOptionalProps(item, defaults) {
175
+ for (const prop in defaults) {
176
+ if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
177
+ return false;
178
+ }
179
+ }
180
+ return true;
181
+ }
182
+ function quicklyValidateIconSet(obj) {
183
+ if (typeof obj !== "object" || obj === null) {
184
+ return null;
185
+ }
186
+ const data = obj;
187
+ if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
188
+ return null;
189
+ }
190
+ if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
191
+ return null;
192
+ }
193
+ const icons = data.icons;
194
+ for (const name in icons) {
195
+ const icon = icons[name];
196
+ if (
197
+ // Name cannot be empty
198
+ !name || // Must have body
199
+ typeof icon.body !== "string" || // Check other props
200
+ !checkOptionalProps(
201
+ icon,
202
+ defaultExtendedIconProps
203
+ )
204
+ ) {
205
+ return null;
206
+ }
207
+ }
208
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
209
+ for (const name in aliases) {
210
+ const icon = aliases[name];
211
+ const parent = icon.parent;
212
+ if (
213
+ // Name cannot be empty
214
+ !name || // Parent must be set and point to existing icon
215
+ typeof parent !== "string" || !icons[parent] && !aliases[parent] || // Check other props
216
+ !checkOptionalProps(
217
+ icon,
218
+ defaultExtendedIconProps
219
+ )
220
+ ) {
221
+ return null;
222
+ }
223
+ }
224
+ return data;
225
+ }
226
+
227
+ const dataStorage = /* @__PURE__ */ Object.create(null);
228
+ function newStorage(provider, prefix) {
229
+ return {
230
+ provider,
231
+ prefix,
232
+ icons: /* @__PURE__ */ Object.create(null),
233
+ missing: /* @__PURE__ */ new Set()
234
+ };
235
+ }
236
+ function getStorage(provider, prefix) {
237
+ const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
238
+ return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
239
+ }
240
+ function addIconSet(storage, data) {
241
+ if (!quicklyValidateIconSet(data)) {
242
+ return [];
243
+ }
244
+ return parseIconSet(data, (name, icon) => {
245
+ if (icon) {
246
+ storage.icons[name] = icon;
247
+ } else {
248
+ storage.missing.add(name);
249
+ }
250
+ });
251
+ }
252
+ function addIconToStorage(storage, name, icon) {
253
+ try {
254
+ if (typeof icon.body === "string") {
255
+ storage.icons[name] = { ...icon };
256
+ return true;
257
+ }
258
+ } catch (err) {
259
+ }
260
+ return false;
261
+ }
262
+
263
+ let simpleNames = false;
264
+ function allowSimpleNames(allow) {
265
+ if (typeof allow === "boolean") {
266
+ simpleNames = allow;
267
+ }
268
+ return simpleNames;
269
+ }
270
+ function getIconData(name) {
271
+ const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
272
+ if (icon) {
273
+ const storage = getStorage(icon.provider, icon.prefix);
274
+ const iconName = icon.name;
275
+ return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
276
+ }
277
+ }
278
+ function addIcon(name, data) {
279
+ const icon = stringToIcon(name, true, simpleNames);
280
+ if (!icon) {
281
+ return false;
282
+ }
283
+ const storage = getStorage(icon.provider, icon.prefix);
284
+ if (data) {
285
+ return addIconToStorage(storage, icon.name, data);
286
+ } else {
287
+ storage.missing.add(icon.name);
288
+ return true;
289
+ }
290
+ }
291
+ function addCollection(data, provider) {
292
+ if (typeof data !== "object") {
293
+ return false;
294
+ }
295
+ if (typeof provider !== "string") {
296
+ provider = data.provider || "";
297
+ }
298
+ if (simpleNames && !provider && !data.prefix) {
299
+ let added = false;
300
+ if (quicklyValidateIconSet(data)) {
301
+ data.prefix = "";
302
+ parseIconSet(data, (name, icon) => {
303
+ if (addIcon(name, icon)) {
304
+ added = true;
305
+ }
306
+ });
307
+ }
308
+ return added;
309
+ }
310
+ const prefix = data.prefix;
311
+ if (!validateIconName({
312
+ prefix,
313
+ name: "a"
314
+ })) {
315
+ return false;
316
+ }
317
+ const storage = getStorage(provider, prefix);
318
+ return !!addIconSet(storage, data);
319
+ }
320
+
321
+ const defaultIconSizeCustomisations = Object.freeze({
322
+ width: null,
323
+ height: null
324
+ });
325
+ const defaultIconCustomisations = Object.freeze({
326
+ // Dimensions
327
+ ...defaultIconSizeCustomisations,
328
+ // Transformations
329
+ ...defaultIconTransformations
330
+ });
331
+
332
+ const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
333
+ const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
334
+ function calculateSize(size, ratio, precision) {
335
+ if (ratio === 1) {
336
+ return size;
337
+ }
338
+ precision = precision || 100;
339
+ if (typeof size === "number") {
340
+ return Math.ceil(size * ratio * precision) / precision;
341
+ }
342
+ if (typeof size !== "string") {
343
+ return size;
344
+ }
345
+ const oldParts = size.split(unitsSplit);
346
+ if (oldParts === null || !oldParts.length) {
347
+ return size;
348
+ }
349
+ const newParts = [];
350
+ let code = oldParts.shift();
351
+ let isNumber = unitsTest.test(code);
352
+ while (true) {
353
+ if (isNumber) {
354
+ const num = parseFloat(code);
355
+ if (isNaN(num)) {
356
+ newParts.push(code);
357
+ } else {
358
+ newParts.push(Math.ceil(num * ratio * precision) / precision);
359
+ }
360
+ } else {
361
+ newParts.push(code);
362
+ }
363
+ code = oldParts.shift();
364
+ if (code === void 0) {
365
+ return newParts.join("");
366
+ }
367
+ isNumber = !isNumber;
368
+ }
369
+ }
370
+
371
+ function splitSVGDefs(content, tag = "defs") {
372
+ let defs = "";
373
+ const index = content.indexOf("<" + tag);
374
+ while (index >= 0) {
375
+ const start = content.indexOf(">", index);
376
+ const end = content.indexOf("</" + tag);
377
+ if (start === -1 || end === -1) {
378
+ break;
379
+ }
380
+ const endEnd = content.indexOf(">", end);
381
+ if (endEnd === -1) {
382
+ break;
383
+ }
384
+ defs += content.slice(start + 1, end).trim();
385
+ content = content.slice(0, index).trim() + content.slice(endEnd + 1);
386
+ }
387
+ return {
388
+ defs,
389
+ content
390
+ };
391
+ }
392
+ function mergeDefsAndContent(defs, content) {
393
+ return defs ? "<defs>" + defs + "</defs>" + content : content;
394
+ }
395
+ function wrapSVGContent(body, start, end) {
396
+ const split = splitSVGDefs(body);
397
+ return mergeDefsAndContent(split.defs, start + split.content + end);
398
+ }
399
+
400
+ const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
401
+ function iconToSVG(icon, customisations) {
402
+ const fullIcon = {
403
+ ...defaultIconProps,
404
+ ...icon
405
+ };
406
+ const fullCustomisations = {
407
+ ...defaultIconCustomisations,
408
+ ...customisations
409
+ };
410
+ const box = {
411
+ left: fullIcon.left,
412
+ top: fullIcon.top,
413
+ width: fullIcon.width,
414
+ height: fullIcon.height
415
+ };
416
+ let body = fullIcon.body;
417
+ [fullIcon, fullCustomisations].forEach((props) => {
418
+ const transformations = [];
419
+ const hFlip = props.hFlip;
420
+ const vFlip = props.vFlip;
421
+ let rotation = props.rotate;
422
+ if (hFlip) {
423
+ if (vFlip) {
424
+ rotation += 2;
425
+ } else {
426
+ transformations.push(
427
+ "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
428
+ );
429
+ transformations.push("scale(-1 1)");
430
+ box.top = box.left = 0;
431
+ }
432
+ } else if (vFlip) {
433
+ transformations.push(
434
+ "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
435
+ );
436
+ transformations.push("scale(1 -1)");
437
+ box.top = box.left = 0;
438
+ }
439
+ let tempValue;
440
+ if (rotation < 0) {
441
+ rotation -= Math.floor(rotation / 4) * 4;
442
+ }
443
+ rotation = rotation % 4;
444
+ switch (rotation) {
445
+ case 1:
446
+ tempValue = box.height / 2 + box.top;
447
+ transformations.unshift(
448
+ "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
449
+ );
450
+ break;
451
+ case 2:
452
+ transformations.unshift(
453
+ "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
454
+ );
455
+ break;
456
+ case 3:
457
+ tempValue = box.width / 2 + box.left;
458
+ transformations.unshift(
459
+ "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
460
+ );
461
+ break;
462
+ }
463
+ if (rotation % 2 === 1) {
464
+ if (box.left !== box.top) {
465
+ tempValue = box.left;
466
+ box.left = box.top;
467
+ box.top = tempValue;
468
+ }
469
+ if (box.width !== box.height) {
470
+ tempValue = box.width;
471
+ box.width = box.height;
472
+ box.height = tempValue;
473
+ }
474
+ }
475
+ if (transformations.length) {
476
+ body = wrapSVGContent(
477
+ body,
478
+ '<g transform="' + transformations.join(" ") + '">',
479
+ "</g>"
480
+ );
481
+ }
482
+ });
483
+ const customisationsWidth = fullCustomisations.width;
484
+ const customisationsHeight = fullCustomisations.height;
485
+ const boxWidth = box.width;
486
+ const boxHeight = box.height;
487
+ let width;
488
+ let height;
489
+ if (customisationsWidth === null) {
490
+ height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
491
+ width = calculateSize(height, boxWidth / boxHeight);
492
+ } else {
493
+ width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
494
+ height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
495
+ }
496
+ const attributes = {};
497
+ const setAttr = (prop, value) => {
498
+ if (!isUnsetKeyword(value)) {
499
+ attributes[prop] = value.toString();
500
+ }
501
+ };
502
+ setAttr("width", width);
503
+ setAttr("height", height);
504
+ const viewBox = [box.left, box.top, boxWidth, boxHeight];
505
+ attributes.viewBox = viewBox.join(" ");
506
+ return {
507
+ attributes,
508
+ viewBox,
509
+ body
510
+ };
511
+ }
512
+
513
+ const regex = /\sid="(\S+)"/g;
514
+ const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
515
+ let counter = 0;
516
+ function replaceIDs(body, prefix = randomPrefix) {
517
+ const ids = [];
518
+ let match;
519
+ while (match = regex.exec(body)) {
520
+ ids.push(match[1]);
521
+ }
522
+ if (!ids.length) {
523
+ return body;
524
+ }
525
+ const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
526
+ ids.forEach((id) => {
527
+ const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
528
+ const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
529
+ body = body.replace(
530
+ // Allowed characters before id: [#;"]
531
+ // Allowed characters after id: [)"], .[a-z]
532
+ new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"),
533
+ "$1" + newID + suffix + "$3"
534
+ );
535
+ });
536
+ body = body.replace(new RegExp(suffix, "g"), "");
537
+ return body;
538
+ }
539
+
540
+ const storage = /* @__PURE__ */ Object.create(null);
541
+ function setAPIModule(provider, item) {
542
+ storage[provider] = item;
543
+ }
544
+ function getAPIModule(provider) {
545
+ return storage[provider] || storage[""];
546
+ }
547
+
548
+ function createAPIConfig(source) {
549
+ let resources;
550
+ if (typeof source.resources === "string") {
551
+ resources = [source.resources];
552
+ } else {
553
+ resources = source.resources;
554
+ if (!(resources instanceof Array) || !resources.length) {
555
+ return null;
556
+ }
557
+ }
558
+ const result = {
559
+ // API hosts
560
+ resources,
561
+ // Root path
562
+ path: source.path || "/",
563
+ // URL length limit
564
+ maxURL: source.maxURL || 500,
565
+ // Timeout before next host is used.
566
+ rotate: source.rotate || 750,
567
+ // Timeout before failing query.
568
+ timeout: source.timeout || 5e3,
569
+ // Randomise default API end point.
570
+ random: source.random === true,
571
+ // Start index
572
+ index: source.index || 0,
573
+ // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
574
+ dataAfterTimeout: source.dataAfterTimeout !== false
575
+ };
576
+ return result;
577
+ }
578
+ const configStorage = /* @__PURE__ */ Object.create(null);
579
+ const fallBackAPISources = [
580
+ "https://api.simplesvg.com",
581
+ "https://api.unisvg.com"
582
+ ];
583
+ const fallBackAPI = [];
584
+ while (fallBackAPISources.length > 0) {
585
+ if (fallBackAPISources.length === 1) {
586
+ fallBackAPI.push(fallBackAPISources.shift());
587
+ } else {
588
+ if (Math.random() > 0.5) {
589
+ fallBackAPI.push(fallBackAPISources.shift());
590
+ } else {
591
+ fallBackAPI.push(fallBackAPISources.pop());
592
+ }
593
+ }
594
+ }
595
+ configStorage[""] = createAPIConfig({
596
+ resources: ["https://api.iconify.design"].concat(fallBackAPI)
597
+ });
598
+ function addAPIProvider(provider, customConfig) {
599
+ const config = createAPIConfig(customConfig);
600
+ if (config === null) {
601
+ return false;
602
+ }
603
+ configStorage[provider] = config;
604
+ return true;
605
+ }
606
+ function getAPIConfig(provider) {
607
+ return configStorage[provider];
608
+ }
609
+
610
+ const detectFetch = () => {
611
+ let callback;
612
+ try {
613
+ callback = fetch;
614
+ if (typeof callback === "function") {
615
+ return callback;
616
+ }
617
+ } catch (err) {
618
+ }
619
+ };
620
+ let fetchModule = detectFetch();
621
+ function calculateMaxLength(provider, prefix) {
622
+ const config = getAPIConfig(provider);
623
+ if (!config) {
624
+ return 0;
625
+ }
626
+ let result;
627
+ if (!config.maxURL) {
628
+ result = 0;
629
+ } else {
630
+ let maxHostLength = 0;
631
+ config.resources.forEach((item) => {
632
+ const host = item;
633
+ maxHostLength = Math.max(maxHostLength, host.length);
634
+ });
635
+ const url = prefix + ".json?icons=";
636
+ result = config.maxURL - maxHostLength - config.path.length - url.length;
637
+ }
638
+ return result;
639
+ }
640
+ function shouldAbort(status) {
641
+ return status === 404;
642
+ }
643
+ const prepare = (provider, prefix, icons) => {
644
+ const results = [];
645
+ const maxLength = calculateMaxLength(provider, prefix);
646
+ const type = "icons";
647
+ let item = {
648
+ type,
649
+ provider,
650
+ prefix,
651
+ icons: []
652
+ };
653
+ let length = 0;
654
+ icons.forEach((name, index) => {
655
+ length += name.length + 1;
656
+ if (length >= maxLength && index > 0) {
657
+ results.push(item);
658
+ item = {
659
+ type,
660
+ provider,
661
+ prefix,
662
+ icons: []
663
+ };
664
+ length = name.length;
665
+ }
666
+ item.icons.push(name);
667
+ });
668
+ results.push(item);
669
+ return results;
670
+ };
671
+ function getPath(provider) {
672
+ if (typeof provider === "string") {
673
+ const config = getAPIConfig(provider);
674
+ if (config) {
675
+ return config.path;
676
+ }
677
+ }
678
+ return "/";
679
+ }
680
+ const send = (host, params, callback) => {
681
+ if (!fetchModule) {
682
+ callback("abort", 424);
683
+ return;
684
+ }
685
+ let path = getPath(params.provider);
686
+ switch (params.type) {
687
+ case "icons": {
688
+ const prefix = params.prefix;
689
+ const icons = params.icons;
690
+ const iconsList = icons.join(",");
691
+ const urlParams = new URLSearchParams({
692
+ icons: iconsList
693
+ });
694
+ path += prefix + ".json?" + urlParams.toString();
695
+ break;
696
+ }
697
+ case "custom": {
698
+ const uri = params.uri;
699
+ path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
700
+ break;
701
+ }
702
+ default:
703
+ callback("abort", 400);
704
+ return;
705
+ }
706
+ let defaultError = 503;
707
+ fetchModule(host + path).then((response) => {
708
+ const status = response.status;
709
+ if (status !== 200) {
710
+ setTimeout(() => {
711
+ callback(shouldAbort(status) ? "abort" : "next", status);
712
+ });
713
+ return;
714
+ }
715
+ defaultError = 501;
716
+ return response.json();
717
+ }).then((data) => {
718
+ if (typeof data !== "object" || data === null) {
719
+ setTimeout(() => {
720
+ if (data === 404) {
721
+ callback("abort", data);
722
+ } else {
723
+ callback("next", defaultError);
724
+ }
725
+ });
726
+ return;
727
+ }
728
+ setTimeout(() => {
729
+ callback("success", data);
730
+ });
731
+ }).catch(() => {
732
+ callback("next", defaultError);
733
+ });
734
+ };
735
+ const fetchAPIModule = {
736
+ prepare,
737
+ send
738
+ };
739
+
740
+ function sortIcons(icons) {
741
+ const result = {
742
+ loaded: [],
743
+ missing: [],
744
+ pending: []
745
+ };
746
+ const storage = /* @__PURE__ */ Object.create(null);
747
+ icons.sort((a, b) => {
748
+ if (a.provider !== b.provider) {
749
+ return a.provider.localeCompare(b.provider);
750
+ }
751
+ if (a.prefix !== b.prefix) {
752
+ return a.prefix.localeCompare(b.prefix);
753
+ }
754
+ return a.name.localeCompare(b.name);
755
+ });
756
+ let lastIcon = {
757
+ provider: "",
758
+ prefix: "",
759
+ name: ""
760
+ };
761
+ icons.forEach((icon) => {
762
+ if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
763
+ return;
764
+ }
765
+ lastIcon = icon;
766
+ const provider = icon.provider;
767
+ const prefix = icon.prefix;
768
+ const name = icon.name;
769
+ const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
770
+ const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
771
+ let list;
772
+ if (name in localStorage.icons) {
773
+ list = result.loaded;
774
+ } else if (prefix === "" || localStorage.missing.has(name)) {
775
+ list = result.missing;
776
+ } else {
777
+ list = result.pending;
778
+ }
779
+ const item = {
780
+ provider,
781
+ prefix,
782
+ name
783
+ };
784
+ list.push(item);
785
+ });
786
+ return result;
787
+ }
788
+
789
+ function removeCallback(storages, id) {
790
+ storages.forEach((storage) => {
791
+ const items = storage.loaderCallbacks;
792
+ if (items) {
793
+ storage.loaderCallbacks = items.filter((row) => row.id !== id);
794
+ }
795
+ });
796
+ }
797
+ function updateCallbacks(storage) {
798
+ if (!storage.pendingCallbacksFlag) {
799
+ storage.pendingCallbacksFlag = true;
800
+ setTimeout(() => {
801
+ storage.pendingCallbacksFlag = false;
802
+ const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
803
+ if (!items.length) {
804
+ return;
805
+ }
806
+ let hasPending = false;
807
+ const provider = storage.provider;
808
+ const prefix = storage.prefix;
809
+ items.forEach((item) => {
810
+ const icons = item.icons;
811
+ const oldLength = icons.pending.length;
812
+ icons.pending = icons.pending.filter((icon) => {
813
+ if (icon.prefix !== prefix) {
814
+ return true;
815
+ }
816
+ const name = icon.name;
817
+ if (storage.icons[name]) {
818
+ icons.loaded.push({
819
+ provider,
820
+ prefix,
821
+ name
822
+ });
823
+ } else if (storage.missing.has(name)) {
824
+ icons.missing.push({
825
+ provider,
826
+ prefix,
827
+ name
828
+ });
829
+ } else {
830
+ hasPending = true;
831
+ return true;
832
+ }
833
+ return false;
834
+ });
835
+ if (icons.pending.length !== oldLength) {
836
+ if (!hasPending) {
837
+ removeCallback([storage], item.id);
838
+ }
839
+ item.callback(
840
+ icons.loaded.slice(0),
841
+ icons.missing.slice(0),
842
+ icons.pending.slice(0),
843
+ item.abort
844
+ );
845
+ }
846
+ });
847
+ });
848
+ }
849
+ }
850
+ let idCounter = 0;
851
+ function storeCallback(callback, icons, pendingSources) {
852
+ const id = idCounter++;
853
+ const abort = removeCallback.bind(null, pendingSources, id);
854
+ if (!icons.pending.length) {
855
+ return abort;
856
+ }
857
+ const item = {
858
+ id,
859
+ icons,
860
+ callback,
861
+ abort
862
+ };
863
+ pendingSources.forEach((storage) => {
864
+ (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
865
+ });
866
+ return abort;
867
+ }
868
+
869
+ function listToIcons(list, validate = true, simpleNames = false) {
870
+ const result = [];
871
+ list.forEach((item) => {
872
+ const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
873
+ if (icon) {
874
+ result.push(icon);
875
+ }
876
+ });
877
+ return result;
878
+ }
879
+
880
+ // src/config.ts
881
+ var defaultConfig = {
882
+ resources: [],
883
+ index: 0,
884
+ timeout: 2e3,
885
+ rotate: 750,
886
+ random: false,
887
+ dataAfterTimeout: false
888
+ };
889
+
890
+ // src/query.ts
891
+ function sendQuery(config, payload, query, done) {
892
+ const resourcesCount = config.resources.length;
893
+ const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
894
+ let resources;
895
+ if (config.random) {
896
+ let list = config.resources.slice(0);
897
+ resources = [];
898
+ while (list.length > 1) {
899
+ const nextIndex = Math.floor(Math.random() * list.length);
900
+ resources.push(list[nextIndex]);
901
+ list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
902
+ }
903
+ resources = resources.concat(list);
904
+ } else {
905
+ resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
906
+ }
907
+ const startTime = Date.now();
908
+ let status = "pending";
909
+ let queriesSent = 0;
910
+ let lastError;
911
+ let timer = null;
912
+ let queue = [];
913
+ let doneCallbacks = [];
914
+ if (typeof done === "function") {
915
+ doneCallbacks.push(done);
916
+ }
917
+ function resetTimer() {
918
+ if (timer) {
919
+ clearTimeout(timer);
920
+ timer = null;
921
+ }
922
+ }
923
+ function abort() {
924
+ if (status === "pending") {
925
+ status = "aborted";
926
+ }
927
+ resetTimer();
928
+ queue.forEach((item) => {
929
+ if (item.status === "pending") {
930
+ item.status = "aborted";
931
+ }
932
+ });
933
+ queue = [];
934
+ }
935
+ function subscribe(callback, overwrite) {
936
+ if (overwrite) {
937
+ doneCallbacks = [];
938
+ }
939
+ if (typeof callback === "function") {
940
+ doneCallbacks.push(callback);
941
+ }
942
+ }
943
+ function getQueryStatus() {
944
+ return {
945
+ startTime,
946
+ payload,
947
+ status,
948
+ queriesSent,
949
+ queriesPending: queue.length,
950
+ subscribe,
951
+ abort
952
+ };
953
+ }
954
+ function failQuery() {
955
+ status = "failed";
956
+ doneCallbacks.forEach((callback) => {
957
+ callback(void 0, lastError);
958
+ });
959
+ }
960
+ function clearQueue() {
961
+ queue.forEach((item) => {
962
+ if (item.status === "pending") {
963
+ item.status = "aborted";
964
+ }
965
+ });
966
+ queue = [];
967
+ }
968
+ function moduleResponse(item, response, data) {
969
+ const isError = response !== "success";
970
+ queue = queue.filter((queued) => queued !== item);
971
+ switch (status) {
972
+ case "pending":
973
+ break;
974
+ case "failed":
975
+ if (isError || !config.dataAfterTimeout) {
976
+ return;
977
+ }
978
+ break;
979
+ default:
980
+ return;
981
+ }
982
+ if (response === "abort") {
983
+ lastError = data;
984
+ failQuery();
985
+ return;
986
+ }
987
+ if (isError) {
988
+ lastError = data;
989
+ if (!queue.length) {
990
+ if (!resources.length) {
991
+ failQuery();
992
+ } else {
993
+ execNext();
994
+ }
995
+ }
996
+ return;
997
+ }
998
+ resetTimer();
999
+ clearQueue();
1000
+ if (!config.random) {
1001
+ const index = config.resources.indexOf(item.resource);
1002
+ if (index !== -1 && index !== config.index) {
1003
+ config.index = index;
1004
+ }
1005
+ }
1006
+ status = "completed";
1007
+ doneCallbacks.forEach((callback) => {
1008
+ callback(data);
1009
+ });
1010
+ }
1011
+ function execNext() {
1012
+ if (status !== "pending") {
1013
+ return;
1014
+ }
1015
+ resetTimer();
1016
+ const resource = resources.shift();
1017
+ if (resource === void 0) {
1018
+ if (queue.length) {
1019
+ timer = setTimeout(() => {
1020
+ resetTimer();
1021
+ if (status === "pending") {
1022
+ clearQueue();
1023
+ failQuery();
1024
+ }
1025
+ }, config.timeout);
1026
+ return;
1027
+ }
1028
+ failQuery();
1029
+ return;
1030
+ }
1031
+ const item = {
1032
+ status: "pending",
1033
+ resource,
1034
+ callback: (status2, data) => {
1035
+ moduleResponse(item, status2, data);
1036
+ }
1037
+ };
1038
+ queue.push(item);
1039
+ queriesSent++;
1040
+ timer = setTimeout(execNext, config.rotate);
1041
+ query(resource, payload, item.callback);
1042
+ }
1043
+ setTimeout(execNext);
1044
+ return getQueryStatus;
1045
+ }
1046
+
1047
+ // src/index.ts
1048
+ function initRedundancy(cfg) {
1049
+ const config = {
1050
+ ...defaultConfig,
1051
+ ...cfg
1052
+ };
1053
+ let queries = [];
1054
+ function cleanup() {
1055
+ queries = queries.filter((item) => item().status === "pending");
1056
+ }
1057
+ function query(payload, queryCallback, doneCallback) {
1058
+ const query2 = sendQuery(
1059
+ config,
1060
+ payload,
1061
+ queryCallback,
1062
+ (data, error) => {
1063
+ cleanup();
1064
+ if (doneCallback) {
1065
+ doneCallback(data, error);
1066
+ }
1067
+ }
1068
+ );
1069
+ queries.push(query2);
1070
+ return query2;
1071
+ }
1072
+ function find(callback) {
1073
+ return queries.find((value) => {
1074
+ return callback(value);
1075
+ }) || null;
1076
+ }
1077
+ const instance = {
1078
+ query,
1079
+ find,
1080
+ setIndex: (index) => {
1081
+ config.index = index;
1082
+ },
1083
+ getIndex: () => config.index,
1084
+ cleanup
1085
+ };
1086
+ return instance;
1087
+ }
1088
+
1089
+ function emptyCallback$1() {
1090
+ }
1091
+ const redundancyCache = /* @__PURE__ */ Object.create(null);
1092
+ function getRedundancyCache(provider) {
1093
+ if (!redundancyCache[provider]) {
1094
+ const config = getAPIConfig(provider);
1095
+ if (!config) {
1096
+ return;
1097
+ }
1098
+ const redundancy = initRedundancy(config);
1099
+ const cachedReundancy = {
1100
+ config,
1101
+ redundancy
1102
+ };
1103
+ redundancyCache[provider] = cachedReundancy;
1104
+ }
1105
+ return redundancyCache[provider];
1106
+ }
1107
+ function sendAPIQuery(target, query, callback) {
1108
+ let redundancy;
1109
+ let send;
1110
+ if (typeof target === "string") {
1111
+ const api = getAPIModule(target);
1112
+ if (!api) {
1113
+ callback(void 0, 424);
1114
+ return emptyCallback$1;
1115
+ }
1116
+ send = api.send;
1117
+ const cached = getRedundancyCache(target);
1118
+ if (cached) {
1119
+ redundancy = cached.redundancy;
1120
+ }
1121
+ } else {
1122
+ const config = createAPIConfig(target);
1123
+ if (config) {
1124
+ redundancy = initRedundancy(config);
1125
+ const moduleKey = target.resources ? target.resources[0] : "";
1126
+ const api = getAPIModule(moduleKey);
1127
+ if (api) {
1128
+ send = api.send;
1129
+ }
1130
+ }
1131
+ }
1132
+ if (!redundancy || !send) {
1133
+ callback(void 0, 424);
1134
+ return emptyCallback$1;
1135
+ }
1136
+ return redundancy.query(query, send, callback)().abort;
1137
+ }
1138
+
1139
+ function emptyCallback() {
1140
+ }
1141
+ function loadedNewIcons(storage) {
1142
+ if (!storage.iconsLoaderFlag) {
1143
+ storage.iconsLoaderFlag = true;
1144
+ setTimeout(() => {
1145
+ storage.iconsLoaderFlag = false;
1146
+ updateCallbacks(storage);
1147
+ });
1148
+ }
1149
+ }
1150
+ function checkIconNamesForAPI(icons) {
1151
+ const valid = [];
1152
+ const invalid = [];
1153
+ icons.forEach((name) => {
1154
+ (name.match(matchIconName) ? valid : invalid).push(name);
1155
+ });
1156
+ return {
1157
+ valid,
1158
+ invalid
1159
+ };
1160
+ }
1161
+ function parseLoaderResponse(storage, icons, data) {
1162
+ function checkMissing() {
1163
+ const pending = storage.pendingIcons;
1164
+ icons.forEach((name) => {
1165
+ if (pending) {
1166
+ pending.delete(name);
1167
+ }
1168
+ if (!storage.icons[name]) {
1169
+ storage.missing.add(name);
1170
+ }
1171
+ });
1172
+ }
1173
+ if (data && typeof data === "object") {
1174
+ try {
1175
+ const parsed = addIconSet(storage, data);
1176
+ if (!parsed.length) {
1177
+ checkMissing();
1178
+ return;
1179
+ }
1180
+ } catch (err) {
1181
+ console.error(err);
1182
+ }
1183
+ }
1184
+ checkMissing();
1185
+ loadedNewIcons(storage);
1186
+ }
1187
+ function parsePossiblyAsyncResponse(response, callback) {
1188
+ if (response instanceof Promise) {
1189
+ response.then((data) => {
1190
+ callback(data);
1191
+ }).catch(() => {
1192
+ callback(null);
1193
+ });
1194
+ } else {
1195
+ callback(response);
1196
+ }
1197
+ }
1198
+ function loadNewIcons(storage, icons) {
1199
+ if (!storage.iconsToLoad) {
1200
+ storage.iconsToLoad = icons;
1201
+ } else {
1202
+ storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
1203
+ }
1204
+ if (!storage.iconsQueueFlag) {
1205
+ storage.iconsQueueFlag = true;
1206
+ setTimeout(() => {
1207
+ storage.iconsQueueFlag = false;
1208
+ const { provider, prefix } = storage;
1209
+ const icons2 = storage.iconsToLoad;
1210
+ delete storage.iconsToLoad;
1211
+ if (!icons2 || !icons2.length) {
1212
+ return;
1213
+ }
1214
+ const customIconLoader = storage.loadIcon;
1215
+ if (storage.loadIcons && (icons2.length > 1 || !customIconLoader)) {
1216
+ parsePossiblyAsyncResponse(
1217
+ storage.loadIcons(icons2, prefix, provider),
1218
+ (data) => {
1219
+ parseLoaderResponse(storage, icons2, data);
1220
+ }
1221
+ );
1222
+ return;
1223
+ }
1224
+ if (customIconLoader) {
1225
+ icons2.forEach((name) => {
1226
+ const response = customIconLoader(name, prefix, provider);
1227
+ parsePossiblyAsyncResponse(response, (data) => {
1228
+ const iconSet = data ? {
1229
+ prefix,
1230
+ icons: {
1231
+ [name]: data
1232
+ }
1233
+ } : null;
1234
+ parseLoaderResponse(storage, [name], iconSet);
1235
+ });
1236
+ });
1237
+ return;
1238
+ }
1239
+ const { valid, invalid } = checkIconNamesForAPI(icons2);
1240
+ if (invalid.length) {
1241
+ parseLoaderResponse(storage, invalid, null);
1242
+ }
1243
+ if (!valid.length) {
1244
+ return;
1245
+ }
1246
+ const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
1247
+ if (!api) {
1248
+ parseLoaderResponse(storage, valid, null);
1249
+ return;
1250
+ }
1251
+ const params = api.prepare(provider, prefix, valid);
1252
+ params.forEach((item) => {
1253
+ sendAPIQuery(provider, item, (data) => {
1254
+ parseLoaderResponse(storage, item.icons, data);
1255
+ });
1256
+ });
1257
+ });
1258
+ }
1259
+ }
1260
+ const loadIcons = (icons, callback) => {
1261
+ const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1262
+ const sortedIcons = sortIcons(cleanedIcons);
1263
+ if (!sortedIcons.pending.length) {
1264
+ let callCallback = true;
1265
+ if (callback) {
1266
+ setTimeout(() => {
1267
+ if (callCallback) {
1268
+ callback(
1269
+ sortedIcons.loaded,
1270
+ sortedIcons.missing,
1271
+ sortedIcons.pending,
1272
+ emptyCallback
1273
+ );
1274
+ }
1275
+ });
1276
+ }
1277
+ return () => {
1278
+ callCallback = false;
1279
+ };
1280
+ }
1281
+ const newIcons = /* @__PURE__ */ Object.create(null);
1282
+ const sources = [];
1283
+ let lastProvider, lastPrefix;
1284
+ sortedIcons.pending.forEach((icon) => {
1285
+ const { provider, prefix } = icon;
1286
+ if (prefix === lastPrefix && provider === lastProvider) {
1287
+ return;
1288
+ }
1289
+ lastProvider = provider;
1290
+ lastPrefix = prefix;
1291
+ sources.push(getStorage(provider, prefix));
1292
+ const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1293
+ if (!providerNewIcons[prefix]) {
1294
+ providerNewIcons[prefix] = [];
1295
+ }
1296
+ });
1297
+ sortedIcons.pending.forEach((icon) => {
1298
+ const { provider, prefix, name } = icon;
1299
+ const storage = getStorage(provider, prefix);
1300
+ const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
1301
+ if (!pendingQueue.has(name)) {
1302
+ pendingQueue.add(name);
1303
+ newIcons[provider][prefix].push(name);
1304
+ }
1305
+ });
1306
+ sources.forEach((storage) => {
1307
+ const list = newIcons[storage.provider][storage.prefix];
1308
+ if (list.length) {
1309
+ loadNewIcons(storage, list);
1310
+ }
1311
+ });
1312
+ return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1313
+ };
1314
+ const loadIcon = (icon) => {
1315
+ return new Promise((fulfill, reject) => {
1316
+ const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1317
+ if (!iconObj) {
1318
+ reject(icon);
1319
+ return;
1320
+ }
1321
+ loadIcons([iconObj || icon], (loaded) => {
1322
+ if (loaded.length && iconObj) {
1323
+ const data = getIconData(iconObj);
1324
+ if (data) {
1325
+ fulfill({
1326
+ ...defaultIconProps,
1327
+ ...data
1328
+ });
1329
+ return;
1330
+ }
1331
+ }
1332
+ reject(icon);
1333
+ });
1334
+ });
1335
+ };
1336
+
1337
+ function mergeCustomisations(defaults, item) {
1338
+ const result = {
1339
+ ...defaults
1340
+ };
1341
+ for (const key in item) {
1342
+ const value = item[key];
1343
+ const valueType = typeof value;
1344
+ if (key in defaultIconSizeCustomisations) {
1345
+ if (value === null || value && (valueType === "string" || valueType === "number")) {
1346
+ result[key] = value;
1347
+ }
1348
+ } else if (valueType === typeof result[key]) {
1349
+ result[key] = key === "rotate" ? value % 4 : value;
1350
+ }
1351
+ }
1352
+ return result;
1353
+ }
1354
+
1355
+ const separator = /[\s,]+/;
1356
+ function flipFromString(custom, flip) {
1357
+ flip.split(separator).forEach((str) => {
1358
+ const value = str.trim();
1359
+ switch (value) {
1360
+ case "horizontal":
1361
+ custom.hFlip = true;
1362
+ break;
1363
+ case "vertical":
1364
+ custom.vFlip = true;
1365
+ break;
1366
+ }
1367
+ });
1368
+ }
1369
+
1370
+ function rotateFromString(value, defaultValue = 0) {
1371
+ const units = value.replace(/^-?[0-9.]*/, "");
1372
+ function cleanup(value2) {
1373
+ while (value2 < 0) {
1374
+ value2 += 4;
1375
+ }
1376
+ return value2 % 4;
1377
+ }
1378
+ if (units === "") {
1379
+ const num = parseInt(value);
1380
+ return isNaN(num) ? 0 : cleanup(num);
1381
+ } else if (units !== value) {
1382
+ let split = 0;
1383
+ switch (units) {
1384
+ case "%":
1385
+ split = 25;
1386
+ break;
1387
+ case "deg":
1388
+ split = 90;
1389
+ }
1390
+ if (split) {
1391
+ let num = parseFloat(value.slice(0, value.length - units.length));
1392
+ if (isNaN(num)) {
1393
+ return 0;
1394
+ }
1395
+ num = num / split;
1396
+ return num % 1 === 0 ? cleanup(num) : 0;
1397
+ }
1398
+ }
1399
+ return defaultValue;
1400
+ }
1401
+
1402
+ function iconToHTML(body, attributes) {
1403
+ let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1404
+ for (const attr in attributes) {
1405
+ renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
1406
+ }
1407
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1408
+ }
1409
+
1410
+ function encodeSVGforURL(svg) {
1411
+ return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1412
+ }
1413
+ function svgToData(svg) {
1414
+ return "data:image/svg+xml," + encodeSVGforURL(svg);
1415
+ }
1416
+ function svgToURL(svg) {
1417
+ return 'url("' + svgToData(svg) + '")';
1418
+ }
1419
+
1420
+ const defaultExtendedIconCustomisations = {
1421
+ ...defaultIconCustomisations,
1422
+ inline: false,
1423
+ };
1424
+
1425
+ /**
1426
+ * Default SVG attributes
1427
+ */
1428
+ const svgDefaults = {
1429
+ 'xmlns': 'http://www.w3.org/2000/svg',
1430
+ 'xmlns:xlink': 'http://www.w3.org/1999/xlink',
1431
+ 'aria-hidden': true,
1432
+ 'role': 'img',
1433
+ };
1434
+ /**
1435
+ * Style modes
1436
+ */
1437
+ const commonProps = {
1438
+ display: 'inline-block',
1439
+ };
1440
+ const monotoneProps = {
1441
+ backgroundColor: 'currentColor',
1442
+ };
1443
+ const coloredProps = {
1444
+ backgroundColor: 'transparent',
1445
+ };
1446
+ // Dynamically add common props to variables above
1447
+ const propsToAdd = {
1448
+ Image: 'var(--svg)',
1449
+ Repeat: 'no-repeat',
1450
+ Size: '100% 100%',
1451
+ };
1452
+ const propsToAddTo = {
1453
+ webkitMask: monotoneProps,
1454
+ mask: monotoneProps,
1455
+ background: coloredProps,
1456
+ };
1457
+ for (const prefix in propsToAddTo) {
1458
+ const list = propsToAddTo[prefix];
1459
+ for (const prop in propsToAdd) {
1460
+ list[prefix + prop] = propsToAdd[prop];
1461
+ }
1462
+ }
1463
+ /**
1464
+ * Aliases for customisations.
1465
+ * In Vue 'v-' properties are reserved, so v-flip must be renamed
1466
+ */
1467
+ const customisationAliases = {};
1468
+ ['horizontal', 'vertical'].forEach((prefix) => {
1469
+ const attr = prefix.slice(0, 1) + 'Flip';
1470
+ // vertical-flip
1471
+ customisationAliases[prefix + '-flip'] = attr;
1472
+ // v-flip
1473
+ customisationAliases[prefix.slice(0, 1) + '-flip'] = attr;
1474
+ // verticalFlip
1475
+ customisationAliases[prefix + 'Flip'] = attr;
1476
+ });
1477
+ /**
1478
+ * Fix size: add 'px' to numbers
1479
+ */
1480
+ function fixSize(value) {
1481
+ return value + (value.match(/^[-0-9.]+$/) ? 'px' : '');
1482
+ }
1483
+ /**
1484
+ * Render icon
1485
+ */
1486
+ const render = (
1487
+ // Icon must be validated before calling this function
1488
+ icon,
1489
+ // Partial properties
1490
+ props) => {
1491
+ // Split properties
1492
+ const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
1493
+ const componentProps = { ...svgDefaults };
1494
+ // Check mode
1495
+ const mode = props.mode || 'svg';
1496
+ // Copy style
1497
+ const style = {};
1498
+ const propsStyle = props.style;
1499
+ const customStyle = typeof propsStyle === 'object' && !(propsStyle instanceof Array)
1500
+ ? propsStyle
1501
+ : {};
1502
+ // Get element properties
1503
+ for (let key in props) {
1504
+ const value = props[key];
1505
+ if (value === void 0) {
1506
+ continue;
1507
+ }
1508
+ switch (key) {
1509
+ // Properties to ignore
1510
+ case 'icon':
1511
+ case 'style':
1512
+ case 'onLoad':
1513
+ case 'mode':
1514
+ case 'ssr':
1515
+ break;
1516
+ // Boolean attributes
1517
+ case 'inline':
1518
+ case 'hFlip':
1519
+ case 'vFlip':
1520
+ customisations[key] =
1521
+ value === true || value === 'true' || value === 1;
1522
+ break;
1523
+ // Flip as string: 'horizontal,vertical'
1524
+ case 'flip':
1525
+ if (typeof value === 'string') {
1526
+ flipFromString(customisations, value);
1527
+ }
1528
+ break;
1529
+ // Color: override style
1530
+ case 'color':
1531
+ style.color = value;
1532
+ break;
1533
+ // Rotation as string
1534
+ case 'rotate':
1535
+ if (typeof value === 'string') {
1536
+ customisations[key] = rotateFromString(value);
1537
+ }
1538
+ else if (typeof value === 'number') {
1539
+ customisations[key] = value;
1540
+ }
1541
+ break;
1542
+ // Remove aria-hidden
1543
+ case 'ariaHidden':
1544
+ case 'aria-hidden':
1545
+ // Vue transforms 'aria-hidden' property to 'ariaHidden'
1546
+ if (value !== true && value !== 'true') {
1547
+ delete componentProps['aria-hidden'];
1548
+ }
1549
+ break;
1550
+ default: {
1551
+ const alias = customisationAliases[key];
1552
+ if (alias) {
1553
+ // Aliases for boolean customisations
1554
+ if (value === true || value === 'true' || value === 1) {
1555
+ customisations[alias] = true;
1556
+ }
1557
+ }
1558
+ else if (defaultExtendedIconCustomisations[key] === void 0) {
1559
+ // Copy missing property if it does not exist in customisations
1560
+ componentProps[key] = value;
1561
+ }
1562
+ }
1563
+ }
1564
+ }
1565
+ // Generate icon
1566
+ const item = iconToSVG(icon, customisations);
1567
+ const renderAttribs = item.attributes;
1568
+ // Inline display
1569
+ if (customisations.inline) {
1570
+ style.verticalAlign = '-0.125em';
1571
+ }
1572
+ if (mode === 'svg') {
1573
+ // Add style
1574
+ componentProps.style = {
1575
+ ...style,
1576
+ ...customStyle,
1577
+ };
1578
+ // Add icon stuff
1579
+ Object.assign(componentProps, renderAttribs);
1580
+ // Counter for ids based on "id" property to render icons consistently on server and client
1581
+ let localCounter = 0;
1582
+ let id = props.id;
1583
+ if (typeof id === 'string') {
1584
+ // Convert '-' to '_' to avoid errors in animations
1585
+ id = id.replace(/-/g, '_');
1586
+ }
1587
+ // Add innerHTML and style to props
1588
+ componentProps['innerHTML'] = replaceIDs(item.body, id ? () => id + 'ID' + localCounter++ : 'iconifyVue');
1589
+ // Render icon
1590
+ return h('svg', componentProps);
1591
+ }
1592
+ // Render <span> with style
1593
+ const { body, width, height } = icon;
1594
+ const useMask = mode === 'mask' ||
1595
+ (mode === 'bg' ? false : body.indexOf('currentColor') !== -1);
1596
+ // Generate SVG
1597
+ const html = iconToHTML(body, {
1598
+ ...renderAttribs,
1599
+ width: width + '',
1600
+ height: height + '',
1601
+ });
1602
+ // Generate style
1603
+ componentProps.style = {
1604
+ ...style,
1605
+ '--svg': svgToURL(html),
1606
+ 'width': fixSize(renderAttribs.width),
1607
+ 'height': fixSize(renderAttribs.height),
1608
+ ...commonProps,
1609
+ ...(useMask ? monotoneProps : coloredProps),
1610
+ ...customStyle,
1611
+ };
1612
+ return h('span', componentProps);
1613
+ };
1614
+
1615
+ /**
1616
+ * Initialise stuff
1617
+ */
1618
+ // Enable short names
1619
+ allowSimpleNames(true);
1620
+ // Set API module
1621
+ setAPIModule('', fetchAPIModule);
1622
+ /**
1623
+ * Browser stuff
1624
+ */
1625
+ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
1626
+ const _window = window;
1627
+ // Load icons from global "IconifyPreload"
1628
+ if (_window.IconifyPreload !== void 0) {
1629
+ const preload = _window.IconifyPreload;
1630
+ const err = 'Invalid IconifyPreload syntax.';
1631
+ if (typeof preload === 'object' && preload !== null) {
1632
+ (preload instanceof Array ? preload : [preload]).forEach((item) => {
1633
+ try {
1634
+ if (
1635
+ // Check if item is an object and not null/array
1636
+ typeof item !== 'object' ||
1637
+ item === null ||
1638
+ item instanceof Array ||
1639
+ // Check for 'icons' and 'prefix'
1640
+ typeof item.icons !== 'object' ||
1641
+ typeof item.prefix !== 'string' ||
1642
+ // Add icon set
1643
+ !addCollection(item)) {
1644
+ console.error(err);
1645
+ }
1646
+ }
1647
+ catch (e) {
1648
+ console.error(err);
1649
+ }
1650
+ });
1651
+ }
1652
+ }
1653
+ // Set API from global "IconifyProviders"
1654
+ if (_window.IconifyProviders !== void 0) {
1655
+ const providers = _window.IconifyProviders;
1656
+ if (typeof providers === 'object' && providers !== null) {
1657
+ for (let key in providers) {
1658
+ const err = 'IconifyProviders[' + key + '] is invalid.';
1659
+ try {
1660
+ const value = providers[key];
1661
+ if (typeof value !== 'object' ||
1662
+ !value ||
1663
+ value.resources === void 0) {
1664
+ continue;
1665
+ }
1666
+ if (!addAPIProvider(key, value)) {
1667
+ console.error(err);
1668
+ }
1669
+ }
1670
+ catch (e) {
1671
+ console.error(err);
1672
+ }
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1677
+ /**
1678
+ * Empty icon data, rendered when icon is not available
1679
+ */
1680
+ const emptyIcon = {
1681
+ ...defaultIconProps,
1682
+ body: '',
1683
+ };
1684
+ /**
1685
+ * Component
1686
+ */
1687
+ const Icon = defineComponent((props, { emit }) => {
1688
+ const loader = ref(null);
1689
+ function abortLoading() {
1690
+ if (loader.value) {
1691
+ loader.value.abort?.();
1692
+ loader.value = null;
1693
+ }
1694
+ }
1695
+ // Render state
1696
+ const rendering = ref(!!props.ssr);
1697
+ const lastRenderedIconName = ref('');
1698
+ const iconData = shallowRef(null);
1699
+ // Update icon data
1700
+ function getIcon() {
1701
+ const icon = props.icon;
1702
+ // Icon is an object
1703
+ if (typeof icon === 'object' &&
1704
+ icon !== null &&
1705
+ typeof icon.body === 'string') {
1706
+ lastRenderedIconName.value = '';
1707
+ return {
1708
+ data: icon,
1709
+ };
1710
+ }
1711
+ // Check for valid icon name
1712
+ let iconName;
1713
+ if (typeof icon !== 'string' ||
1714
+ (iconName = stringToIcon(icon, false, true)) === null) {
1715
+ return null;
1716
+ }
1717
+ // Load icon
1718
+ let data = getIconData(iconName);
1719
+ if (!data) {
1720
+ // Icon data is not available
1721
+ const oldState = loader.value;
1722
+ if (!oldState || oldState.name !== icon) {
1723
+ // Icon name does not match old loader state
1724
+ if (data === null) {
1725
+ // Failed to load
1726
+ loader.value = {
1727
+ name: icon,
1728
+ };
1729
+ }
1730
+ else {
1731
+ loader.value = {
1732
+ name: icon,
1733
+ abort: loadIcons([iconName], updateIconData),
1734
+ };
1735
+ }
1736
+ }
1737
+ return null;
1738
+ }
1739
+ // Icon data is available
1740
+ abortLoading();
1741
+ if (lastRenderedIconName.value !== icon) {
1742
+ lastRenderedIconName.value = icon;
1743
+ // Emit on next tick because render will be called on next tick
1744
+ nextTick(() => {
1745
+ emit('load', icon);
1746
+ });
1747
+ }
1748
+ // Customise icon
1749
+ const customise = props.customise;
1750
+ if (customise) {
1751
+ // Clone data and customise it
1752
+ data = Object.assign({}, data);
1753
+ const customised = customise(data.body, iconName.name, iconName.prefix, iconName.provider);
1754
+ if (typeof customised === 'string') {
1755
+ data.body = customised;
1756
+ }
1757
+ }
1758
+ // Add classes
1759
+ const classes = ['iconify'];
1760
+ if (iconName.prefix !== '') {
1761
+ classes.push('iconify--' + iconName.prefix);
1762
+ }
1763
+ if (iconName.provider !== '') {
1764
+ classes.push('iconify--' + iconName.provider);
1765
+ }
1766
+ return { data, classes };
1767
+ }
1768
+ function updateIconData() {
1769
+ const icon = getIcon();
1770
+ if (!icon) {
1771
+ iconData.value = null;
1772
+ }
1773
+ else if (icon.data !== iconData.value?.data) {
1774
+ iconData.value = icon;
1775
+ }
1776
+ }
1777
+ // Set icon data
1778
+ if (rendering.value) {
1779
+ updateIconData();
1780
+ }
1781
+ else {
1782
+ onMounted(() => {
1783
+ rendering.value = true;
1784
+ updateIconData();
1785
+ });
1786
+ }
1787
+ watch(() => props.icon, updateIconData);
1788
+ // Abort loading on unmount
1789
+ onUnmounted(abortLoading);
1790
+ // Render function
1791
+ return () => {
1792
+ // Get icon data
1793
+ const icon = iconData.value;
1794
+ if (!icon) {
1795
+ // Icon is not available
1796
+ return render(emptyIcon, props);
1797
+ }
1798
+ // Add classes
1799
+ let newProps = props;
1800
+ if (icon.classes) {
1801
+ newProps = {
1802
+ ...props,
1803
+ class: icon.classes.join(' '),
1804
+ };
1805
+ }
1806
+ // Render icon
1807
+ return render({
1808
+ ...defaultIconProps,
1809
+ ...icon.data,
1810
+ }, newProps);
1811
+ };
1812
+ }, {
1813
+ props: [
1814
+ // Icon and render mode
1815
+ 'icon',
1816
+ 'mode',
1817
+ 'ssr',
1818
+ // Layout and style
1819
+ 'width',
1820
+ 'height',
1821
+ 'style',
1822
+ 'color',
1823
+ 'inline',
1824
+ // Transformations
1825
+ 'rotate',
1826
+ 'hFlip',
1827
+ 'horizontalFlip',
1828
+ 'vFlip',
1829
+ 'verticalFlip',
1830
+ 'flip',
1831
+ // Misc
1832
+ 'id',
1833
+ 'ariaHidden',
1834
+ 'customise',
1835
+ 'title',
1836
+ ],
1837
+ emits: ['load'],
1838
+ });
1839
+
1840
+ export { Icon as I, loadIcon as l };