@govbr-ds/webcomponents 2.0.0-next.2 → 2.0.0-next.20

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 (386) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +193 -97
  3. package/dist/cjs/app-globals-77a217c6.js +11 -0
  4. package/dist/cjs/app-globals-77a217c6.js.map +1 -0
  5. package/dist/cjs/br-avatar.cjs.entry.js +77 -0
  6. package/dist/cjs/br-avatar.cjs.entry.js.map +1 -0
  7. package/dist/cjs/br-button_2.cjs.entry.js +2491 -0
  8. package/dist/cjs/br-button_2.cjs.entry.js.map +1 -0
  9. package/dist/cjs/br-checkbox.cjs.entry.js +76 -0
  10. package/dist/cjs/br-checkbox.cjs.entry.js.map +1 -0
  11. package/dist/cjs/br-dropdown.cjs.entry.js +100 -0
  12. package/dist/cjs/br-dropdown.cjs.entry.js.map +1 -0
  13. package/dist/cjs/br-input.cjs.entry.js +150 -0
  14. package/dist/cjs/br-input.cjs.entry.js.map +1 -0
  15. package/dist/cjs/br-item.cjs.entry.js +146 -0
  16. package/dist/cjs/br-item.cjs.entry.js.map +1 -0
  17. package/dist/cjs/br-list.cjs.entry.js +82 -0
  18. package/dist/cjs/br-list.cjs.entry.js.map +1 -0
  19. package/dist/cjs/br-loading.cjs.entry.js +43 -0
  20. package/dist/cjs/br-loading.cjs.entry.js.map +1 -0
  21. package/dist/cjs/br-message.cjs.entry.js +68 -0
  22. package/dist/cjs/br-message.cjs.entry.js.map +1 -0
  23. package/dist/cjs/br-radio.cjs.entry.js +79 -0
  24. package/dist/cjs/br-radio.cjs.entry.js.map +1 -0
  25. package/dist/cjs/br-switch.cjs.entry.js +81 -0
  26. package/dist/cjs/br-switch.cjs.entry.js.map +1 -0
  27. package/dist/cjs/br-tag.cjs.entry.js +88 -0
  28. package/dist/cjs/br-tag.cjs.entry.js.map +1 -0
  29. package/dist/cjs/br-textarea.cjs.entry.js +102 -0
  30. package/dist/cjs/br-textarea.cjs.entry.js.map +1 -0
  31. package/dist/cjs/br-upload.cjs.entry.js +168 -0
  32. package/dist/cjs/br-upload.cjs.entry.js.map +1 -0
  33. package/dist/cjs/index-81c11ce2.js +1864 -0
  34. package/dist/cjs/index-81c11ce2.js.map +1 -0
  35. package/dist/cjs/index.cjs.js +8 -0
  36. package/dist/cjs/index.cjs.js.map +1 -0
  37. package/dist/cjs/inherited-attributes-16f7d388.js +107 -0
  38. package/dist/cjs/inherited-attributes-16f7d388.js.map +1 -0
  39. package/dist/cjs/loader.cjs.js +21 -0
  40. package/dist/cjs/loader.cjs.js.map +1 -0
  41. package/dist/cjs/v4-2a0fe526.js +74 -0
  42. package/dist/cjs/v4-2a0fe526.js.map +1 -0
  43. package/dist/cjs/webcomponents.cjs.js +52 -0
  44. package/dist/cjs/webcomponents.cjs.js.map +1 -0
  45. package/dist/collection/collection-manifest.json +26 -0
  46. package/dist/collection/components/avatar/avatar.css +538 -0
  47. package/dist/collection/components/avatar/avatar.js +222 -0
  48. package/dist/collection/components/avatar/avatar.js.map +1 -0
  49. package/dist/collection/components/button/button.css +800 -0
  50. package/dist/collection/components/button/button.js +236 -0
  51. package/dist/collection/components/button/button.js.map +1 -0
  52. package/dist/collection/components/checkbox/checkbox.css +595 -0
  53. package/dist/collection/components/checkbox/checkbox.js +279 -0
  54. package/dist/collection/components/checkbox/checkbox.js.map +1 -0
  55. package/dist/collection/components/dropdown/dropdown.css +465 -0
  56. package/dist/collection/components/dropdown/dropdown.js +185 -0
  57. package/dist/collection/components/dropdown/dropdown.js.map +1 -0
  58. package/dist/collection/components/icon/icon.css +450 -0
  59. package/dist/collection/components/icon/icon.js +176 -0
  60. package/dist/collection/components/icon/icon.js.map +1 -0
  61. package/dist/collection/components/input/input.css +671 -0
  62. package/dist/collection/components/input/input.js +580 -0
  63. package/dist/collection/components/input/input.js.map +1 -0
  64. package/dist/collection/components/item/item.css +660 -0
  65. package/dist/collection/components/item/item.js +376 -0
  66. package/dist/collection/components/item/item.js.map +1 -0
  67. package/dist/collection/components/list/list.css +562 -0
  68. package/dist/collection/components/list/list.js +138 -0
  69. package/dist/collection/components/list/list.js.map +1 -0
  70. package/dist/collection/components/loading/loading.css +651 -0
  71. package/dist/collection/components/loading/loading.js +119 -0
  72. package/dist/collection/components/loading/loading.js.map +1 -0
  73. package/dist/collection/components/message/message.css +598 -0
  74. package/dist/collection/components/message/message.js +211 -0
  75. package/dist/collection/components/message/message.js.map +1 -0
  76. package/dist/collection/components/radio/radio.css +550 -0
  77. package/dist/collection/components/radio/radio.js +247 -0
  78. package/dist/collection/components/radio/radio.js.map +1 -0
  79. package/dist/collection/components/switch/switch.css +621 -0
  80. package/dist/collection/components/switch/switch.js +320 -0
  81. package/dist/collection/components/switch/switch.js.map +1 -0
  82. package/dist/collection/components/tag/tag.css +643 -0
  83. package/dist/collection/components/tag/tag.js +256 -0
  84. package/dist/collection/components/tag/tag.js.map +1 -0
  85. package/dist/collection/components/textarea/textarea.css +516 -0
  86. package/dist/collection/components/textarea/textarea.js +298 -0
  87. package/dist/collection/components/textarea/textarea.js.map +1 -0
  88. package/dist/collection/components/upload/upload.css +560 -0
  89. package/dist/collection/components/upload/upload.js +469 -0
  90. package/dist/collection/components/upload/upload.js.map +1 -0
  91. package/dist/collection/index.js +2 -0
  92. package/dist/collection/index.js.map +1 -0
  93. package/dist/collection/pages/components/button/index.js +18 -0
  94. package/dist/collection/pages/components/checkbox/index.js +18 -0
  95. package/dist/collection/pages/components/dropdown/index.js +18 -0
  96. package/dist/collection/pages/components/icon/index.js +18 -0
  97. package/dist/collection/pages/components/input/index.js +27 -0
  98. package/dist/collection/pages/components/item/index.js +18 -0
  99. package/dist/collection/pages/components/list/index.js +19 -0
  100. package/dist/collection/pages/components/message/index.js +18 -0
  101. package/dist/collection/pages/components/radio/index.js +18 -0
  102. package/dist/collection/pages/components/switch/index.js +18 -0
  103. package/dist/collection/pages/components/tag/index.js +18 -0
  104. package/dist/collection/pages/components/textarea/index.js +19 -0
  105. package/dist/collection/pages/components/upload/index.js +19 -0
  106. package/dist/collection/pages/scripts/menu.js +221 -0
  107. package/dist/collection/pages/scripts/pageLoader.js +180 -0
  108. package/dist/collection/scripts/menu.js +146 -0
  109. package/dist/collection/utils/inherited-attributes.js +102 -0
  110. package/dist/collection/utils/inherited-attributes.js.map +1 -0
  111. package/dist/collection/utils/interfaces.js +2 -0
  112. package/dist/collection/utils/interfaces.js.map +1 -0
  113. package/dist/collection/utils/unique-id-generator.js +13 -0
  114. package/dist/collection/utils/unique-id-generator.js.map +1 -0
  115. package/dist/components/br-avatar.d.ts +11 -0
  116. package/dist/components/br-avatar.js +6 -0
  117. package/dist/components/br-avatar.js.map +1 -0
  118. package/dist/components/br-button.d.ts +11 -0
  119. package/dist/components/br-button.js +6 -0
  120. package/dist/components/br-button.js.map +1 -0
  121. package/dist/components/br-checkbox.d.ts +11 -0
  122. package/dist/components/br-checkbox.js +6 -0
  123. package/dist/components/br-checkbox.js.map +1 -0
  124. package/dist/components/br-dropdown.d.ts +11 -0
  125. package/dist/components/br-dropdown.js +6 -0
  126. package/dist/components/br-dropdown.js.map +1 -0
  127. package/dist/components/br-icon.d.ts +11 -0
  128. package/dist/components/br-icon.js +6 -0
  129. package/dist/components/br-icon.js.map +1 -0
  130. package/dist/components/br-input.d.ts +11 -0
  131. package/dist/components/br-input.js +6 -0
  132. package/dist/components/br-input.js.map +1 -0
  133. package/dist/components/br-item.d.ts +11 -0
  134. package/dist/components/br-item.js +6 -0
  135. package/dist/components/br-item.js.map +1 -0
  136. package/dist/components/br-list.d.ts +11 -0
  137. package/dist/components/br-list.js +6 -0
  138. package/dist/components/br-list.js.map +1 -0
  139. package/dist/components/br-loading.d.ts +11 -0
  140. package/dist/components/br-loading.js +6 -0
  141. package/dist/components/br-loading.js.map +1 -0
  142. package/dist/components/br-message.d.ts +11 -0
  143. package/dist/components/br-message.js +6 -0
  144. package/dist/components/br-message.js.map +1 -0
  145. package/dist/components/br-radio.d.ts +11 -0
  146. package/dist/components/br-radio.js +6 -0
  147. package/dist/components/br-radio.js.map +1 -0
  148. package/dist/components/br-switch.d.ts +11 -0
  149. package/dist/components/br-switch.js +6 -0
  150. package/dist/components/br-switch.js.map +1 -0
  151. package/dist/components/br-tag.d.ts +11 -0
  152. package/dist/components/br-tag.js +6 -0
  153. package/dist/components/br-tag.js.map +1 -0
  154. package/dist/components/br-textarea.d.ts +11 -0
  155. package/dist/components/br-textarea.js +6 -0
  156. package/dist/components/br-textarea.js.map +1 -0
  157. package/dist/components/br-upload.d.ts +11 -0
  158. package/dist/components/br-upload.js +6 -0
  159. package/dist/components/br-upload.js.map +1 -0
  160. package/dist/components/index.d.ts +33 -0
  161. package/dist/components/index.js +6 -0
  162. package/dist/components/index.js.map +1 -0
  163. package/dist/components/p-2d8e59f6.js +7 -0
  164. package/dist/components/p-2d8e59f6.js.map +1 -0
  165. package/dist/components/p-64831033.js +17 -0
  166. package/dist/components/p-64831033.js.map +1 -0
  167. package/dist/components/p-74a4eb38.js +6 -0
  168. package/dist/components/p-74a4eb38.js.map +1 -0
  169. package/dist/components/p-d5a8d30c.js +6 -0
  170. package/dist/components/p-d5a8d30c.js.map +1 -0
  171. package/dist/components/p-e4af8eac.js +6 -0
  172. package/dist/components/p-e4af8eac.js.map +1 -0
  173. package/dist/esm/app-globals-72548b13.js +9 -0
  174. package/dist/esm/app-globals-72548b13.js.map +1 -0
  175. package/dist/esm/br-avatar.entry.js +73 -0
  176. package/dist/esm/br-avatar.entry.js.map +1 -0
  177. package/dist/esm/br-button_2.entry.js +2486 -0
  178. package/dist/esm/br-button_2.entry.js.map +1 -0
  179. package/dist/esm/br-checkbox.entry.js +72 -0
  180. package/dist/esm/br-checkbox.entry.js.map +1 -0
  181. package/dist/esm/br-dropdown.entry.js +96 -0
  182. package/dist/esm/br-dropdown.entry.js.map +1 -0
  183. package/dist/esm/br-input.entry.js +146 -0
  184. package/dist/esm/br-input.entry.js.map +1 -0
  185. package/dist/esm/br-item.entry.js +142 -0
  186. package/dist/esm/br-item.entry.js.map +1 -0
  187. package/dist/esm/br-list.entry.js +78 -0
  188. package/dist/esm/br-list.entry.js.map +1 -0
  189. package/dist/esm/br-loading.entry.js +39 -0
  190. package/dist/esm/br-loading.entry.js.map +1 -0
  191. package/dist/esm/br-message.entry.js +64 -0
  192. package/dist/esm/br-message.entry.js.map +1 -0
  193. package/dist/esm/br-radio.entry.js +75 -0
  194. package/dist/esm/br-radio.entry.js.map +1 -0
  195. package/dist/esm/br-switch.entry.js +77 -0
  196. package/dist/esm/br-switch.entry.js.map +1 -0
  197. package/dist/esm/br-tag.entry.js +84 -0
  198. package/dist/esm/br-tag.entry.js.map +1 -0
  199. package/dist/esm/br-textarea.entry.js +98 -0
  200. package/dist/esm/br-textarea.entry.js.map +1 -0
  201. package/dist/esm/br-upload.entry.js +164 -0
  202. package/dist/esm/br-upload.entry.js.map +1 -0
  203. package/dist/esm/index-aab4a630.js +1834 -0
  204. package/dist/esm/index-aab4a630.js.map +1 -0
  205. package/dist/esm/index.js +6 -0
  206. package/dist/esm/index.js.map +1 -0
  207. package/dist/esm/inherited-attributes-553a7c36.js +105 -0
  208. package/dist/esm/inherited-attributes-553a7c36.js.map +1 -0
  209. package/dist/esm/loader.js +17 -0
  210. package/dist/esm/loader.js.map +1 -0
  211. package/dist/esm/polyfills/core-js.js +11 -0
  212. package/dist/esm/polyfills/dom.js +79 -0
  213. package/dist/esm/polyfills/es5-html-element.js +1 -0
  214. package/dist/esm/polyfills/index.js +34 -0
  215. package/dist/esm/polyfills/system.js +6 -0
  216. package/dist/esm/v4-c99c1585.js +72 -0
  217. package/dist/esm/v4-c99c1585.js.map +1 -0
  218. package/dist/esm/webcomponents.js +47 -0
  219. package/dist/esm/webcomponents.js.map +1 -0
  220. package/dist/esm-es5/app-globals-72548b13.js +6 -0
  221. package/dist/esm-es5/app-globals-72548b13.js.map +1 -0
  222. package/dist/esm-es5/br-avatar.entry.js +6 -0
  223. package/dist/esm-es5/br-avatar.entry.js.map +1 -0
  224. package/dist/esm-es5/br-button_2.entry.js +17 -0
  225. package/dist/esm-es5/br-button_2.entry.js.map +1 -0
  226. package/dist/esm-es5/br-checkbox.entry.js +6 -0
  227. package/dist/esm-es5/br-checkbox.entry.js.map +1 -0
  228. package/dist/esm-es5/br-dropdown.entry.js +6 -0
  229. package/dist/esm-es5/br-dropdown.entry.js.map +1 -0
  230. package/dist/esm-es5/br-input.entry.js +6 -0
  231. package/dist/esm-es5/br-input.entry.js.map +1 -0
  232. package/dist/esm-es5/br-item.entry.js +6 -0
  233. package/dist/esm-es5/br-item.entry.js.map +1 -0
  234. package/dist/esm-es5/br-list.entry.js +6 -0
  235. package/dist/esm-es5/br-list.entry.js.map +1 -0
  236. package/dist/esm-es5/br-loading.entry.js +6 -0
  237. package/dist/esm-es5/br-loading.entry.js.map +1 -0
  238. package/dist/esm-es5/br-message.entry.js +6 -0
  239. package/dist/esm-es5/br-message.entry.js.map +1 -0
  240. package/dist/esm-es5/br-radio.entry.js +6 -0
  241. package/dist/esm-es5/br-radio.entry.js.map +1 -0
  242. package/dist/esm-es5/br-switch.entry.js +6 -0
  243. package/dist/esm-es5/br-switch.entry.js.map +1 -0
  244. package/dist/esm-es5/br-tag.entry.js +6 -0
  245. package/dist/esm-es5/br-tag.entry.js.map +1 -0
  246. package/dist/esm-es5/br-textarea.entry.js +6 -0
  247. package/dist/esm-es5/br-textarea.entry.js.map +1 -0
  248. package/dist/esm-es5/br-upload.entry.js +6 -0
  249. package/dist/esm-es5/br-upload.entry.js.map +1 -0
  250. package/dist/esm-es5/index-aab4a630.js +6 -0
  251. package/dist/esm-es5/index-aab4a630.js.map +1 -0
  252. package/dist/esm-es5/index.js +5 -0
  253. package/dist/esm-es5/index.js.map +1 -0
  254. package/dist/esm-es5/inherited-attributes-553a7c36.js +6 -0
  255. package/dist/esm-es5/inherited-attributes-553a7c36.js.map +1 -0
  256. package/dist/esm-es5/loader.js +6 -0
  257. package/dist/esm-es5/loader.js.map +1 -0
  258. package/dist/esm-es5/v4-c99c1585.js +6 -0
  259. package/dist/esm-es5/v4-c99c1585.js.map +1 -0
  260. package/dist/esm-es5/webcomponents.js +6 -0
  261. package/dist/esm-es5/webcomponents.js.map +1 -0
  262. package/dist/index.cjs.js +1 -0
  263. package/dist/index.js +1 -0
  264. package/dist/playwright.config.js +39 -0
  265. package/dist/playwright.config.js.map +1 -0
  266. package/dist/types/builds/govbr-ds/bibliotecas/wbc/govbr-ds-wbc/packages/webcomponents/.stencil/playwright.config.d.ts +5 -0
  267. package/dist/types/components/avatar/avatar.d.ts +60 -0
  268. package/dist/types/components/button/button.d.ts +64 -0
  269. package/dist/types/components/checkbox/checkbox.d.ts +78 -0
  270. package/dist/types/components/dropdown/dropdown.d.ts +64 -0
  271. package/dist/types/components/icon/icon.d.ts +58 -0
  272. package/dist/types/components/input/input.d.ts +151 -0
  273. package/dist/types/components/item/item.d.ts +96 -0
  274. package/dist/types/components/list/list.d.ts +34 -0
  275. package/dist/types/components/loading/loading.d.ts +34 -0
  276. package/dist/types/components/message/message.d.ts +62 -0
  277. package/dist/types/components/radio/radio.d.ts +75 -0
  278. package/dist/types/components/switch/switch.d.ts +78 -0
  279. package/dist/types/components/tag/tag.d.ts +73 -0
  280. package/dist/types/components/textarea/textarea.d.ts +66 -0
  281. package/dist/types/components/upload/upload.d.ts +160 -0
  282. package/dist/types/components.d.ts +1682 -0
  283. package/dist/types/index.d.ts +10 -0
  284. package/dist/types/stencil-public-runtime.d.ts +1680 -0
  285. package/dist/types/utils/inherited-attributes.d.ts +20 -0
  286. package/dist/types/utils/interfaces.d.ts +3 -0
  287. package/dist/types/utils/unique-id-generator.d.ts +1 -0
  288. package/dist/webcomponents/index.esm.js +6 -0
  289. package/dist/webcomponents/index.esm.js.map +1 -0
  290. package/dist/webcomponents/p-05343155.system.entry.js +6 -0
  291. package/dist/webcomponents/p-05343155.system.entry.js.map +1 -0
  292. package/dist/webcomponents/p-183614c8.system.entry.js +6 -0
  293. package/dist/webcomponents/p-183614c8.system.entry.js.map +1 -0
  294. package/dist/webcomponents/p-2083ff7b.entry.js +6 -0
  295. package/dist/webcomponents/p-2083ff7b.entry.js.map +1 -0
  296. package/dist/webcomponents/p-24da392a.entry.js +6 -0
  297. package/dist/webcomponents/p-24da392a.entry.js.map +1 -0
  298. package/dist/webcomponents/p-254a2b7c.js +6 -0
  299. package/dist/webcomponents/p-254a2b7c.js.map +1 -0
  300. package/dist/webcomponents/p-28476b17.system.entry.js +6 -0
  301. package/dist/webcomponents/p-28476b17.system.entry.js.map +1 -0
  302. package/dist/webcomponents/p-2c2c8629.js +7 -0
  303. package/dist/webcomponents/p-2c2c8629.js.map +1 -0
  304. package/dist/webcomponents/p-3f00a196.entry.js +6 -0
  305. package/dist/webcomponents/p-3f00a196.entry.js.map +1 -0
  306. package/dist/webcomponents/p-430afeb5.system.js +7 -0
  307. package/dist/webcomponents/p-430afeb5.system.js.map +1 -0
  308. package/dist/webcomponents/p-447c8036.entry.js +6 -0
  309. package/dist/webcomponents/p-447c8036.entry.js.map +1 -0
  310. package/dist/webcomponents/p-5539ffa8.entry.js +6 -0
  311. package/dist/webcomponents/p-5539ffa8.entry.js.map +1 -0
  312. package/dist/webcomponents/p-55604b7f.system.entry.js +6 -0
  313. package/dist/webcomponents/p-55604b7f.system.entry.js.map +1 -0
  314. package/dist/webcomponents/p-61523bc9.entry.js +6 -0
  315. package/dist/webcomponents/p-61523bc9.entry.js.map +1 -0
  316. package/dist/webcomponents/p-626fe2cb.entry.js +6 -0
  317. package/dist/webcomponents/p-626fe2cb.entry.js.map +1 -0
  318. package/dist/webcomponents/p-6a8226b3.system.entry.js +6 -0
  319. package/dist/webcomponents/p-6a8226b3.system.entry.js.map +1 -0
  320. package/dist/webcomponents/p-6e286eba.system.js +6 -0
  321. package/dist/webcomponents/p-6e286eba.system.js.map +1 -0
  322. package/dist/webcomponents/p-71be2e3f.system.entry.js +6 -0
  323. package/dist/webcomponents/p-71be2e3f.system.entry.js.map +1 -0
  324. package/dist/webcomponents/p-74a4eb38.js +6 -0
  325. package/dist/webcomponents/p-74a4eb38.js.map +1 -0
  326. package/dist/webcomponents/p-7a4e1265.system.entry.js +6 -0
  327. package/dist/webcomponents/p-7a4e1265.system.entry.js.map +1 -0
  328. package/dist/webcomponents/p-8039a644.system.entry.js +6 -0
  329. package/dist/webcomponents/p-8039a644.system.entry.js.map +1 -0
  330. package/dist/webcomponents/p-842b2513.entry.js +6 -0
  331. package/dist/webcomponents/p-842b2513.entry.js.map +1 -0
  332. package/dist/webcomponents/p-8f156fc4.system.entry.js +6 -0
  333. package/dist/webcomponents/p-8f156fc4.system.entry.js.map +1 -0
  334. package/dist/webcomponents/p-90e2e623.system.js +6 -0
  335. package/dist/webcomponents/p-90e2e623.system.js.map +1 -0
  336. package/dist/webcomponents/p-9f0d01d1.entry.js +6 -0
  337. package/dist/webcomponents/p-9f0d01d1.entry.js.map +1 -0
  338. package/dist/webcomponents/p-a71689a5.system.js +6 -0
  339. package/dist/webcomponents/p-a71689a5.system.js.map +1 -0
  340. package/dist/webcomponents/p-ae629243.system.entry.js +6 -0
  341. package/dist/webcomponents/p-ae629243.system.entry.js.map +1 -0
  342. package/dist/webcomponents/p-b88a5d9a.system.js +6 -0
  343. package/dist/webcomponents/p-b88a5d9a.system.js.map +1 -0
  344. package/dist/webcomponents/p-b9fd2bc0.system.entry.js +6 -0
  345. package/dist/webcomponents/p-b9fd2bc0.system.entry.js.map +1 -0
  346. package/dist/webcomponents/p-baad00f8.system.entry.js +6 -0
  347. package/dist/webcomponents/p-baad00f8.system.entry.js.map +1 -0
  348. package/dist/webcomponents/p-d174c8cd.entry.js +6 -0
  349. package/dist/webcomponents/p-d174c8cd.entry.js.map +1 -0
  350. package/dist/webcomponents/p-d5a8d30c.js +6 -0
  351. package/dist/webcomponents/p-d5a8d30c.js.map +1 -0
  352. package/dist/webcomponents/p-d83e2172.system.entry.js +17 -0
  353. package/dist/webcomponents/p-d83e2172.system.entry.js.map +1 -0
  354. package/dist/webcomponents/p-dcf41d91.entry.js +6 -0
  355. package/dist/webcomponents/p-dcf41d91.entry.js.map +1 -0
  356. package/dist/webcomponents/p-e027fca2.entry.js +6 -0
  357. package/dist/webcomponents/p-e027fca2.entry.js.map +1 -0
  358. package/dist/webcomponents/p-e6d921ef.entry.js +17 -0
  359. package/dist/webcomponents/p-e6d921ef.entry.js.map +1 -0
  360. package/dist/webcomponents/p-e751c991.system.js +6 -0
  361. package/dist/webcomponents/p-e751c991.system.js.map +1 -0
  362. package/dist/webcomponents/p-e8b5b14f.entry.js +6 -0
  363. package/dist/webcomponents/p-e8b5b14f.entry.js.map +1 -0
  364. package/dist/webcomponents/p-f5e674ba.system.entry.js +6 -0
  365. package/dist/webcomponents/p-f5e674ba.system.entry.js.map +1 -0
  366. package/dist/webcomponents/webcomponents.esm.js +6 -0
  367. package/dist/webcomponents/webcomponents.esm.js.map +1 -0
  368. package/dist/webcomponents/webcomponents.js +127 -0
  369. package/hydrate/index.d.ts +242 -0
  370. package/hydrate/index.js +22120 -0
  371. package/hydrate/index.mjs +22112 -0
  372. package/hydrate/package.json +12 -0
  373. package/loader/cdn.js +6 -0
  374. package/loader/index.cjs.js +6 -0
  375. package/loader/index.d.ts +24 -0
  376. package/loader/index.es2017.js +6 -0
  377. package/loader/index.js +7 -0
  378. package/loader/package.json +11 -0
  379. package/package.json +54 -89
  380. package/vscode-data.json +915 -0
  381. package/dist/webcomponents.common.js +0 -23958
  382. package/dist/webcomponents.common.js.map +0 -1
  383. package/dist/webcomponents.umd.js +0 -23969
  384. package/dist/webcomponents.umd.js.map +0 -1
  385. package/dist/webcomponents.umd.min.js +0 -8
  386. package/dist/webcomponents.umd.min.js.map +0 -1
@@ -0,0 +1,2491 @@
1
+ /*!
2
+ * Construído com @govbr-ds/webcomponents
3
+ * Padrão Digital de Governo.
4
+ */
5
+ 'use strict';
6
+
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
9
+ const index = require('./index-81c11ce2.js');
10
+ const inheritedAttributes = require('./inherited-attributes-16f7d388.js');
11
+
12
+ const buttonCss = "*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;-moz-appearance:button;appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}[hidden]{display:none}.d-flex{display:-ms-flexbox !important;display:flex !important}.align-items-center{-ms-flex-align:center !important;align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter) * 0.5);padding-right:calc(var(--grid-gutter) * 0.5);width:100%}.col{-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.container{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter) * -0.5);margin-right:calc(var(--grid-gutter) * -0.5)}@media (min-width: 576px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width: 992px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width: 1600px){.container{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mr-2{margin-right:var(--spacing-scale-base) !important}.mr-n2{margin-right:calc(var(--spacing-scale-base) * -1) !important}.mb-3{margin-bottom:var(--spacing-scale-2x) !important}.mr-auto{margin-right:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.py-3{padding-bottom:var(--spacing-scale-2x) !important;padding-top:var(--spacing-scale-2x) !important}.py-4{padding-bottom:var(--spacing-scale-3x) !important;padding-top:var(--spacing-scale-3x) !important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}:-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.text-pure-0{color:var(--pure-0) !important}.text-primary-default{color:var(--color-primary-default) !important}.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-support-01) !important}.text-nowrap{white-space:nowrap !important}.text-base{font-size:var(--font-size-scale-base) !important}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear, left top, left bottom, from(var(--status-highlight-overlay)), to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.br-button{--button-radius:100em;--button-xsmall:24px;--button-small:32px;--button-medium:40px;--button-large:48px;--button-size:var(--button-medium);-ms-flex-align:center;align-items:center;background-color:transparent;border:0;border-radius:var(--button-radius);color:var(--interactive);cursor:pointer;display:-ms-inline-flexbox;display:inline-flex;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);height:var(--button-size);-ms-flex-pack:center;justify-content:center;overflow:hidden;padding:0 var(--spacing-scale-3x);position:relative;text-align:center;vertical-align:middle;white-space:nowrap;width:auto}.br-button.block{width:100%}.br-button.circle,.br-button[circle]{border-radius:50%;padding:0;width:var(--button-size)}.br-button.small,.br-button[small]{--button-size:var(--button-small)}.br-button.medium,.br-button[medium],.br-button.is-medium{--button-size:var(--button-medium)}.br-button.large,.br-button[large]{--button-size:var(--button-large)}.br-button.primary,.br-button[primary]{--interactive-rgb:var(--color-dark-rgb);background-color:var(--interactive-light);color:var(--color-dark)}.br-button.secondary,.br-button[secondary]{background-color:var(--background-light);border:1px solid var(--interactive)}.br-button.danger,.br-button[danger]{background-color:var(--danger);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button.success,.br-button[success]{background-color:var(--success);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button.warning,.br-button[warning]{background-color:var(--warning);--interactive-rgb:var(--color-light-rgb);color:var(--color-light)}.br-button.info,.br-button[info]{background-color:var(--info);--interactive-rgb:var(--color-dark-rgb);color:var(--color-dark)}.br-button:disabled{cursor:not-allowed}.br-button:not(:disabled){--focus-offset:var(--spacing-scale-half)}.br-button:not(:disabled):focus{outline:none}.br-button:not(:disabled):focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}.br-button:not(:disabled):not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-button:not(:disabled):not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}.br-button.active,.br-button.is-active,.br-button[active]{--hover:var(--hover-dark);background-color:var(--active);color:var(--color-dark)}.br-button.loading{color:transparent !important;cursor:progress}.br-button.loading:not(:disabled):hover{background-image:none}.br-button.loading::before{border-color:var(--interactive) var(--interactive) transparent;border-style:solid}.br-button.loading.primary::before,.br-button.loading.danger::before,.br-button.loading.success::before,.br-button.loading.info::before{border-color:var(--background) var(--background) transparent}.br-button.dark-mode{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);color:var(--interactive-dark)}.br-button.dark-mode.primary,.br-button.dark-mode[primary]{--interactive-rgb:var(--background-dark-rgb);background-color:var(--interactive-dark);color:var(--background-dark)}.br-button.dark-mode.secondary,.br-button.dark-mode[secondary]{background-color:var(--background-dark)}.br-button.dark-mode.active{--hover:var(--hover-light);--interactive-rgb:var(--active-rgb);background-color:var(--background-light);color:var(--active)}a.br-button{font-weight:var(--font-weight-semi-bold);text-decoration:none !important}.loading,.br-loading{--loading-size:var(--loading-indetermined-diameter-sm);--loading-diameter:84px;--loading-stroke:5px;--loading-indetermined-color:var(--interactive);--loading-indetermined-diameter-md:44px;--loading-indetermined-diameter-sm:24px;position:relative;z-index:var(--z-index-layer-4)}.loading[data-progress]:not(:empty),.br-loading[data-progress]:not(:empty){background-color:var(--border-color);border-radius:50%}.loading[data-progress]:not(:empty)::before,.br-loading[data-progress]:not(:empty)::before{content:none}.loading[data-progress]::after,.br-loading[data-progress]::after{--loading-size:calc(var(--loading-diameter) - var(--loading-stroke) * 2);background:var(--background);border-radius:50%;color:var(--interactive);content:attr(data-progress) \"%\";font-size:var(--font-size-scale-up-02);font-weight:var(--font-weight-semi-bold);height:var(--loading-size);line-height:var(--loading-size);margin:var(--loading-stroke);position:absolute;text-align:center;width:var(--loading-size)}.loading[data-progress] .br-loading-mask,.loading[data-progress] .br-loading-fill,.br-loading[data-progress] .br-loading-mask,.br-loading[data-progress] .br-loading-fill{-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;clip:rect(0, var(--loading-diameter), var(--loading-diameter), calc(var(--loading-diameter) * 0.5));height:var(--loading-diameter);overflow:hidden;position:absolute;width:var(--loading-diameter)}.loading[data-progress] .br-loading-fill,.br-loading[data-progress] .br-loading-fill{background:var(--interactive);clip:rect(0, calc(var(--loading-diameter) * 0.5), var(--loading-diameter), 0)}.loading::before,.br-loading::before{-webkit-animation:spinAround 1.3s infinite linear;animation:spinAround 1.3s infinite linear;border:2px solid var(--loading-indetermined-color);border-radius:50%;border-right-color:transparent;content:\"\";display:block;height:var(--loading-size);left:calc(50% - var(--loading-size) * 0.5);position:absolute;top:calc(50% - var(--loading-size) * 0.5);width:var(--loading-size)}.loading:not(.br-button),.br-loading:not(.br-button){height:var(--loading-size);width:var(--loading-size)}.loading:not(.br-button).medium,.br-loading:not(.br-button).medium{--loading-size:var(--loading-indetermined-diameter-md)}.loading:not(.br-button).medium::before,.br-loading:not(.br-button).medium::before{border-width:4px}.loading:not(.br-button)[data-progress],.br-loading:not(.br-button)[data-progress]{--loading-size:var(--loading-diameter)}.loading:not(.br-button)[data-progress]::before,.br-loading:not(.br-button)[data-progress]::before{border-width:var(--loading-stroke)}.loading[data-progress=\"1\"] .br-loading-mask.full,.loading[data-progress=\"1\"] .br-loading-fill,.br-loading[data-progress=\"1\"] .br-loading-mask.full,.br-loading[data-progress=\"1\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(1.8deg);transform:rotate(1.8deg)}.loading[data-progress=\"2\"] .br-loading-mask.full,.loading[data-progress=\"2\"] .br-loading-fill,.br-loading[data-progress=\"2\"] .br-loading-mask.full,.br-loading[data-progress=\"2\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(3.6deg);transform:rotate(3.6deg)}.loading[data-progress=\"3\"] .br-loading-mask.full,.loading[data-progress=\"3\"] .br-loading-fill,.br-loading[data-progress=\"3\"] .br-loading-mask.full,.br-loading[data-progress=\"3\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(5.4deg);transform:rotate(5.4deg)}.loading[data-progress=\"5\"] .br-loading-mask.full,.loading[data-progress=\"5\"] .br-loading-fill,.br-loading[data-progress=\"5\"] .br-loading-mask.full,.br-loading[data-progress=\"5\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(9deg);transform:rotate(9deg)}.loading[data-progress=\"10\"] .br-loading-mask.full,.loading[data-progress=\"10\"] .br-loading-fill,.br-loading[data-progress=\"10\"] .br-loading-mask.full,.br-loading[data-progress=\"10\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(18deg);transform:rotate(18deg)}.loading[data-progress=\"16\"] .br-loading-mask.full,.loading[data-progress=\"16\"] .br-loading-fill,.br-loading[data-progress=\"16\"] .br-loading-mask.full,.br-loading[data-progress=\"16\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(28.8deg);transform:rotate(28.8deg)}.loading[data-progress=\"20\"] .br-loading-mask.full,.loading[data-progress=\"20\"] .br-loading-fill,.br-loading[data-progress=\"20\"] .br-loading-mask.full,.br-loading[data-progress=\"20\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(36deg);transform:rotate(36deg)}.loading[data-progress=\"24\"] .br-loading-mask.full,.loading[data-progress=\"24\"] .br-loading-fill,.br-loading[data-progress=\"24\"] .br-loading-mask.full,.br-loading[data-progress=\"24\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(43.2deg);transform:rotate(43.2deg)}.loading[data-progress=\"48\"] .br-loading-mask.full,.loading[data-progress=\"48\"] .br-loading-fill,.br-loading[data-progress=\"48\"] .br-loading-mask.full,.br-loading[data-progress=\"48\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(86.4deg);transform:rotate(86.4deg)}.loading[data-progress=\"50\"] .br-loading-mask.full,.loading[data-progress=\"50\"] .br-loading-fill,.br-loading[data-progress=\"50\"] .br-loading-mask.full,.br-loading[data-progress=\"50\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.loading[data-progress=\"70\"] .br-loading-mask.full,.loading[data-progress=\"70\"] .br-loading-fill,.br-loading[data-progress=\"70\"] .br-loading-mask.full,.br-loading[data-progress=\"70\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(126deg);transform:rotate(126deg)}.loading[data-progress=\"72\"] .br-loading-mask.full,.loading[data-progress=\"72\"] .br-loading-fill,.br-loading[data-progress=\"72\"] .br-loading-mask.full,.br-loading[data-progress=\"72\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(129.6deg);transform:rotate(129.6deg)}.loading[data-progress=\"100\"] .br-loading-mask.full,.loading[data-progress=\"100\"] .br-loading-fill,.br-loading[data-progress=\"100\"] .br-loading-mask.full,.br-loading[data-progress=\"100\"] .br-loading-fill{-webkit-animation:fill ease-in-out 2s;animation:fill ease-in-out 2s;-webkit-transform:rotate(180deg);transform:rotate(180deg)}@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes fill{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fill{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}:host{display:block}button{display:-ms-flexbox;display:flex}button.icon-right{-ms-flex-direction:row-reverse;flex-direction:row-reverse}button.icon-left{-ms-flex-direction:row;flex-direction:row}";
13
+ const BrButtonStyle0 = buttonCss;
14
+
15
+ const Button = class {
16
+ constructor(hostRef) {
17
+ index.registerInstance(this, hostRef);
18
+ if (hostRef.$hostElement$["s-ei"]) {
19
+ this.elementInternals = hostRef.$hostElement$["s-ei"];
20
+ }
21
+ else {
22
+ this.elementInternals = hostRef.$hostElement$.attachInternals();
23
+ hostRef.$hostElement$["s-ei"] = this.elementInternals;
24
+ }
25
+ this.handleClick = () => {
26
+ if (this.type === 'submit') {
27
+ const submitEvent = new SubmitEvent('submit', {
28
+ submitter: this.elementInternals.form,
29
+ composed: true,
30
+ cancelable: true,
31
+ bubbles: true,
32
+ });
33
+ this.elementInternals.form.dispatchEvent(submitEvent);
34
+ }
35
+ if (this.type === 'reset') {
36
+ this.elementInternals.form.reset();
37
+ }
38
+ };
39
+ this.inheritedAttributes = {};
40
+ this.colorMode = undefined;
41
+ this.density = 'medium';
42
+ this.disabled = false;
43
+ this.emphasis = undefined;
44
+ this.isActive = false;
45
+ this.isLoading = false;
46
+ this.shape = undefined;
47
+ this.type = undefined;
48
+ this.value = undefined;
49
+ }
50
+ componentWillLoad() {
51
+ this.inheritedAttributes = inheritedAttributes.inheritAriaAttributes(this.el);
52
+ }
53
+ getCssClassMap() {
54
+ return {
55
+ 'br-button': true,
56
+ primary: this.emphasis === 'primary',
57
+ secondary: this.emphasis === 'secondary',
58
+ large: this.density === 'large',
59
+ small: this.density === 'small',
60
+ block: this.shape === 'block',
61
+ circle: this.shape === 'circle',
62
+ active: this.isActive,
63
+ loading: this.isLoading,
64
+ 'dark-mode': this.colorMode === 'dark',
65
+ };
66
+ }
67
+ render() {
68
+ return (index.h(index.Host, { key: '163d419411ac143f3743228d16fe833aa1b71c30', "aria-disabled": this.disabled ? 'true' : null }, index.h("button", Object.assign({ key: 'b461c13bea0b05b7c20dcc62ecbb74c96b9d5097', class: this.getCssClassMap(), type: this.type, disabled: this.disabled, value: this.value, onClick: this.handleClick }, this.inheritedAttributes), index.h("slot", { key: '50e37710881cb6c421184e5fede1888985c19e64' }))));
69
+ }
70
+ static get formAssociated() { return true; }
71
+ get el() { return index.getElement(this); }
72
+ };
73
+ Button.style = BrButtonStyle0;
74
+
75
+ /**
76
+ * (c) Iconify
77
+ *
78
+ * For the full copyright and license information, please view the license.txt
79
+ * files at https://github.com/iconify/iconify
80
+ *
81
+ * Licensed under MIT.
82
+ *
83
+ * @license MIT
84
+ * @version 2.1.0
85
+ */
86
+ const defaultIconDimensions = Object.freeze(
87
+ {
88
+ left: 0,
89
+ top: 0,
90
+ width: 16,
91
+ height: 16
92
+ }
93
+ );
94
+ const defaultIconTransformations = Object.freeze({
95
+ rotate: 0,
96
+ vFlip: false,
97
+ hFlip: false
98
+ });
99
+ const defaultIconProps = Object.freeze({
100
+ ...defaultIconDimensions,
101
+ ...defaultIconTransformations
102
+ });
103
+ const defaultExtendedIconProps = Object.freeze({
104
+ ...defaultIconProps,
105
+ body: "",
106
+ hidden: false
107
+ });
108
+
109
+ const defaultIconSizeCustomisations = Object.freeze({
110
+ width: null,
111
+ height: null
112
+ });
113
+ const defaultIconCustomisations = Object.freeze({
114
+ // Dimensions
115
+ ...defaultIconSizeCustomisations,
116
+ // Transformations
117
+ ...defaultIconTransformations
118
+ });
119
+
120
+ function rotateFromString(value, defaultValue = 0) {
121
+ const units = value.replace(/^-?[0-9.]*/, "");
122
+ function cleanup(value2) {
123
+ while (value2 < 0) {
124
+ value2 += 4;
125
+ }
126
+ return value2 % 4;
127
+ }
128
+ if (units === "") {
129
+ const num = parseInt(value);
130
+ return isNaN(num) ? 0 : cleanup(num);
131
+ } else if (units !== value) {
132
+ let split = 0;
133
+ switch (units) {
134
+ case "%":
135
+ split = 25;
136
+ break;
137
+ case "deg":
138
+ split = 90;
139
+ }
140
+ if (split) {
141
+ let num = parseFloat(value.slice(0, value.length - units.length));
142
+ if (isNaN(num)) {
143
+ return 0;
144
+ }
145
+ num = num / split;
146
+ return num % 1 === 0 ? cleanup(num) : 0;
147
+ }
148
+ }
149
+ return defaultValue;
150
+ }
151
+
152
+ const separator = /[\s,]+/;
153
+ function flipFromString(custom, flip) {
154
+ flip.split(separator).forEach((str) => {
155
+ const value = str.trim();
156
+ switch (value) {
157
+ case "horizontal":
158
+ custom.hFlip = true;
159
+ break;
160
+ case "vertical":
161
+ custom.vFlip = true;
162
+ break;
163
+ }
164
+ });
165
+ }
166
+
167
+ const defaultCustomisations = {
168
+ ...defaultIconCustomisations,
169
+ preserveAspectRatio: '',
170
+ };
171
+ /**
172
+ * Get customisations
173
+ */
174
+ function getCustomisations(node) {
175
+ const customisations = {
176
+ ...defaultCustomisations,
177
+ };
178
+ const attr = (key, def) => node.getAttribute(key) || def;
179
+ // Dimensions
180
+ customisations.width = attr('width', null);
181
+ customisations.height = attr('height', null);
182
+ // Rotation
183
+ customisations.rotate = rotateFromString(attr('rotate', ''));
184
+ // Flip
185
+ flipFromString(customisations, attr('flip', ''));
186
+ // SVG attributes
187
+ customisations.preserveAspectRatio = attr('preserveAspectRatio', attr('preserveaspectratio', ''));
188
+ return customisations;
189
+ }
190
+ /**
191
+ * Check if customisations have been updated
192
+ */
193
+ function haveCustomisationsChanged(value1, value2) {
194
+ for (const key in defaultCustomisations) {
195
+ if (value1[key] !== value2[key]) {
196
+ return true;
197
+ }
198
+ }
199
+ return false;
200
+ }
201
+
202
+ const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
203
+ const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
204
+ const colonSeparated = value.split(":");
205
+ if (value.slice(0, 1) === "@") {
206
+ if (colonSeparated.length < 2 || colonSeparated.length > 3) {
207
+ return null;
208
+ }
209
+ provider = colonSeparated.shift().slice(1);
210
+ }
211
+ if (colonSeparated.length > 3 || !colonSeparated.length) {
212
+ return null;
213
+ }
214
+ if (colonSeparated.length > 1) {
215
+ const name2 = colonSeparated.pop();
216
+ const prefix = colonSeparated.pop();
217
+ const result = {
218
+ // Allow provider without '@': "provider:prefix:name"
219
+ provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
220
+ prefix,
221
+ name: name2
222
+ };
223
+ return validate && !validateIconName(result) ? null : result;
224
+ }
225
+ const name = colonSeparated[0];
226
+ const dashSeparated = name.split("-");
227
+ if (dashSeparated.length > 1) {
228
+ const result = {
229
+ provider,
230
+ prefix: dashSeparated.shift(),
231
+ name: dashSeparated.join("-")
232
+ };
233
+ return validate && !validateIconName(result) ? null : result;
234
+ }
235
+ if (allowSimpleName && provider === "") {
236
+ const result = {
237
+ provider,
238
+ prefix: "",
239
+ name
240
+ };
241
+ return validate && !validateIconName(result, allowSimpleName) ? null : result;
242
+ }
243
+ return null;
244
+ };
245
+ const validateIconName = (icon, allowSimpleName) => {
246
+ if (!icon) {
247
+ return false;
248
+ }
249
+ return !!((icon.provider === "" || icon.provider.match(matchIconName)) && (allowSimpleName && icon.prefix === "" || icon.prefix.match(matchIconName)) && icon.name.match(matchIconName));
250
+ };
251
+
252
+ function mergeIconTransformations(obj1, obj2) {
253
+ const result = {};
254
+ if (!obj1.hFlip !== !obj2.hFlip) {
255
+ result.hFlip = true;
256
+ }
257
+ if (!obj1.vFlip !== !obj2.vFlip) {
258
+ result.vFlip = true;
259
+ }
260
+ const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
261
+ if (rotate) {
262
+ result.rotate = rotate;
263
+ }
264
+ return result;
265
+ }
266
+
267
+ function mergeIconData(parent, child) {
268
+ const result = mergeIconTransformations(parent, child);
269
+ for (const key in defaultExtendedIconProps) {
270
+ if (key in defaultIconTransformations) {
271
+ if (key in parent && !(key in result)) {
272
+ result[key] = defaultIconTransformations[key];
273
+ }
274
+ } else if (key in child) {
275
+ result[key] = child[key];
276
+ } else if (key in parent) {
277
+ result[key] = parent[key];
278
+ }
279
+ }
280
+ return result;
281
+ }
282
+
283
+ function getIconsTree(data, names) {
284
+ const icons = data.icons;
285
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
286
+ const resolved = /* @__PURE__ */ Object.create(null);
287
+ function resolve(name) {
288
+ if (icons[name]) {
289
+ return resolved[name] = [];
290
+ }
291
+ if (!(name in resolved)) {
292
+ resolved[name] = null;
293
+ const parent = aliases[name] && aliases[name].parent;
294
+ const value = parent && resolve(parent);
295
+ if (value) {
296
+ resolved[name] = [parent].concat(value);
297
+ }
298
+ }
299
+ return resolved[name];
300
+ }
301
+ (names || Object.keys(icons).concat(Object.keys(aliases))).forEach(resolve);
302
+ return resolved;
303
+ }
304
+
305
+ function internalGetIconData(data, name, tree) {
306
+ const icons = data.icons;
307
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
308
+ let currentProps = {};
309
+ function parse(name2) {
310
+ currentProps = mergeIconData(
311
+ icons[name2] || aliases[name2],
312
+ currentProps
313
+ );
314
+ }
315
+ parse(name);
316
+ tree.forEach(parse);
317
+ return mergeIconData(data, currentProps);
318
+ }
319
+
320
+ function parseIconSet(data, callback) {
321
+ const names = [];
322
+ if (typeof data !== "object" || typeof data.icons !== "object") {
323
+ return names;
324
+ }
325
+ if (data.not_found instanceof Array) {
326
+ data.not_found.forEach((name) => {
327
+ callback(name, null);
328
+ names.push(name);
329
+ });
330
+ }
331
+ const tree = getIconsTree(data);
332
+ for (const name in tree) {
333
+ const item = tree[name];
334
+ if (item) {
335
+ callback(name, internalGetIconData(data, name, item));
336
+ names.push(name);
337
+ }
338
+ }
339
+ return names;
340
+ }
341
+
342
+ const optionalPropertyDefaults = {
343
+ provider: "",
344
+ aliases: {},
345
+ not_found: {},
346
+ ...defaultIconDimensions
347
+ };
348
+ function checkOptionalProps(item, defaults) {
349
+ for (const prop in defaults) {
350
+ if (prop in item && typeof item[prop] !== typeof defaults[prop]) {
351
+ return false;
352
+ }
353
+ }
354
+ return true;
355
+ }
356
+ function quicklyValidateIconSet(obj) {
357
+ if (typeof obj !== "object" || obj === null) {
358
+ return null;
359
+ }
360
+ const data = obj;
361
+ if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
362
+ return null;
363
+ }
364
+ if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
365
+ return null;
366
+ }
367
+ const icons = data.icons;
368
+ for (const name in icons) {
369
+ const icon = icons[name];
370
+ if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(
371
+ icon,
372
+ defaultExtendedIconProps
373
+ )) {
374
+ return null;
375
+ }
376
+ }
377
+ const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
378
+ for (const name in aliases) {
379
+ const icon = aliases[name];
380
+ const parent = icon.parent;
381
+ if (!name.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(
382
+ icon,
383
+ defaultExtendedIconProps
384
+ )) {
385
+ return null;
386
+ }
387
+ }
388
+ return data;
389
+ }
390
+
391
+ const dataStorage = /* @__PURE__ */ Object.create(null);
392
+ function newStorage(provider, prefix) {
393
+ return {
394
+ provider,
395
+ prefix,
396
+ icons: /* @__PURE__ */ Object.create(null),
397
+ missing: /* @__PURE__ */ new Set()
398
+ };
399
+ }
400
+ function getStorage(provider, prefix) {
401
+ const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
402
+ return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
403
+ }
404
+ function addIconSet(storage, data) {
405
+ if (!quicklyValidateIconSet(data)) {
406
+ return [];
407
+ }
408
+ return parseIconSet(data, (name, icon) => {
409
+ if (icon) {
410
+ storage.icons[name] = icon;
411
+ } else {
412
+ storage.missing.add(name);
413
+ }
414
+ });
415
+ }
416
+ function addIconToStorage(storage, name, icon) {
417
+ try {
418
+ if (typeof icon.body === "string") {
419
+ storage.icons[name] = { ...icon };
420
+ return true;
421
+ }
422
+ } catch (err) {
423
+ }
424
+ return false;
425
+ }
426
+ function listIcons$1(provider, prefix) {
427
+ let allIcons = [];
428
+ const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
429
+ providers.forEach((provider2) => {
430
+ const prefixes = typeof provider2 === "string" && typeof prefix === "string" ? [prefix] : Object.keys(dataStorage[provider2] || {});
431
+ prefixes.forEach((prefix2) => {
432
+ const storage = getStorage(provider2, prefix2);
433
+ allIcons = allIcons.concat(
434
+ Object.keys(storage.icons).map(
435
+ (name) => (provider2 !== "" ? "@" + provider2 + ":" : "") + prefix2 + ":" + name
436
+ )
437
+ );
438
+ });
439
+ });
440
+ return allIcons;
441
+ }
442
+
443
+ let simpleNames = false;
444
+ function allowSimpleNames(allow) {
445
+ if (typeof allow === "boolean") {
446
+ simpleNames = allow;
447
+ }
448
+ return simpleNames;
449
+ }
450
+ function getIconData(name) {
451
+ const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
452
+ if (icon) {
453
+ const storage = getStorage(icon.provider, icon.prefix);
454
+ const iconName = icon.name;
455
+ return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
456
+ }
457
+ }
458
+ function addIcon$1(name, data) {
459
+ const icon = stringToIcon(name, true, simpleNames);
460
+ if (!icon) {
461
+ return false;
462
+ }
463
+ const storage = getStorage(icon.provider, icon.prefix);
464
+ return addIconToStorage(storage, icon.name, data);
465
+ }
466
+ function addCollection$1(data, provider) {
467
+ if (typeof data !== "object") {
468
+ return false;
469
+ }
470
+ if (typeof provider !== "string") {
471
+ provider = data.provider || "";
472
+ }
473
+ if (simpleNames && !provider && !data.prefix) {
474
+ let added = false;
475
+ if (quicklyValidateIconSet(data)) {
476
+ data.prefix = "";
477
+ parseIconSet(data, (name, icon) => {
478
+ if (icon && addIcon$1(name, icon)) {
479
+ added = true;
480
+ }
481
+ });
482
+ }
483
+ return added;
484
+ }
485
+ const prefix = data.prefix;
486
+ if (!validateIconName({
487
+ provider,
488
+ prefix,
489
+ name: "a"
490
+ })) {
491
+ return false;
492
+ }
493
+ const storage = getStorage(provider, prefix);
494
+ return !!addIconSet(storage, data);
495
+ }
496
+ function iconLoaded$1(name) {
497
+ return !!getIconData(name);
498
+ }
499
+ function getIcon$1(name) {
500
+ const result = getIconData(name);
501
+ return result ? {
502
+ ...defaultIconProps,
503
+ ...result
504
+ } : null;
505
+ }
506
+
507
+ function sortIcons(icons) {
508
+ const result = {
509
+ loaded: [],
510
+ missing: [],
511
+ pending: []
512
+ };
513
+ const storage = /* @__PURE__ */ Object.create(null);
514
+ icons.sort((a, b) => {
515
+ if (a.provider !== b.provider) {
516
+ return a.provider.localeCompare(b.provider);
517
+ }
518
+ if (a.prefix !== b.prefix) {
519
+ return a.prefix.localeCompare(b.prefix);
520
+ }
521
+ return a.name.localeCompare(b.name);
522
+ });
523
+ let lastIcon = {
524
+ provider: "",
525
+ prefix: "",
526
+ name: ""
527
+ };
528
+ icons.forEach((icon) => {
529
+ if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
530
+ return;
531
+ }
532
+ lastIcon = icon;
533
+ const provider = icon.provider;
534
+ const prefix = icon.prefix;
535
+ const name = icon.name;
536
+ const providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
537
+ const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
538
+ let list;
539
+ if (name in localStorage.icons) {
540
+ list = result.loaded;
541
+ } else if (prefix === "" || localStorage.missing.has(name)) {
542
+ list = result.missing;
543
+ } else {
544
+ list = result.pending;
545
+ }
546
+ const item = {
547
+ provider,
548
+ prefix,
549
+ name
550
+ };
551
+ list.push(item);
552
+ });
553
+ return result;
554
+ }
555
+
556
+ function removeCallback(storages, id) {
557
+ storages.forEach((storage) => {
558
+ const items = storage.loaderCallbacks;
559
+ if (items) {
560
+ storage.loaderCallbacks = items.filter((row) => row.id !== id);
561
+ }
562
+ });
563
+ }
564
+ function updateCallbacks(storage) {
565
+ if (!storage.pendingCallbacksFlag) {
566
+ storage.pendingCallbacksFlag = true;
567
+ setTimeout(() => {
568
+ storage.pendingCallbacksFlag = false;
569
+ const items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
570
+ if (!items.length) {
571
+ return;
572
+ }
573
+ let hasPending = false;
574
+ const provider = storage.provider;
575
+ const prefix = storage.prefix;
576
+ items.forEach((item) => {
577
+ const icons = item.icons;
578
+ const oldLength = icons.pending.length;
579
+ icons.pending = icons.pending.filter((icon) => {
580
+ if (icon.prefix !== prefix) {
581
+ return true;
582
+ }
583
+ const name = icon.name;
584
+ if (storage.icons[name]) {
585
+ icons.loaded.push({
586
+ provider,
587
+ prefix,
588
+ name
589
+ });
590
+ } else if (storage.missing.has(name)) {
591
+ icons.missing.push({
592
+ provider,
593
+ prefix,
594
+ name
595
+ });
596
+ } else {
597
+ hasPending = true;
598
+ return true;
599
+ }
600
+ return false;
601
+ });
602
+ if (icons.pending.length !== oldLength) {
603
+ if (!hasPending) {
604
+ removeCallback([storage], item.id);
605
+ }
606
+ item.callback(
607
+ icons.loaded.slice(0),
608
+ icons.missing.slice(0),
609
+ icons.pending.slice(0),
610
+ item.abort
611
+ );
612
+ }
613
+ });
614
+ });
615
+ }
616
+ }
617
+ let idCounter = 0;
618
+ function storeCallback(callback, icons, pendingSources) {
619
+ const id = idCounter++;
620
+ const abort = removeCallback.bind(null, pendingSources, id);
621
+ if (!icons.pending.length) {
622
+ return abort;
623
+ }
624
+ const item = {
625
+ id,
626
+ icons,
627
+ callback,
628
+ abort
629
+ };
630
+ pendingSources.forEach((storage) => {
631
+ (storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
632
+ });
633
+ return abort;
634
+ }
635
+
636
+ const storage = /* @__PURE__ */ Object.create(null);
637
+ function setAPIModule(provider, item) {
638
+ storage[provider] = item;
639
+ }
640
+ function getAPIModule(provider) {
641
+ return storage[provider] || storage[""];
642
+ }
643
+
644
+ function listToIcons(list, validate = true, simpleNames = false) {
645
+ const result = [];
646
+ list.forEach((item) => {
647
+ const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
648
+ if (icon) {
649
+ result.push(icon);
650
+ }
651
+ });
652
+ return result;
653
+ }
654
+
655
+ // src/config.ts
656
+ var defaultConfig = {
657
+ resources: [],
658
+ index: 0,
659
+ timeout: 2e3,
660
+ rotate: 750,
661
+ random: false,
662
+ dataAfterTimeout: false
663
+ };
664
+
665
+ // src/query.ts
666
+ function sendQuery(config, payload, query, done) {
667
+ const resourcesCount = config.resources.length;
668
+ const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
669
+ let resources;
670
+ if (config.random) {
671
+ let list = config.resources.slice(0);
672
+ resources = [];
673
+ while (list.length > 1) {
674
+ const nextIndex = Math.floor(Math.random() * list.length);
675
+ resources.push(list[nextIndex]);
676
+ list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
677
+ }
678
+ resources = resources.concat(list);
679
+ } else {
680
+ resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
681
+ }
682
+ const startTime = Date.now();
683
+ let status = "pending";
684
+ let queriesSent = 0;
685
+ let lastError;
686
+ let timer = null;
687
+ let queue = [];
688
+ let doneCallbacks = [];
689
+ if (typeof done === "function") {
690
+ doneCallbacks.push(done);
691
+ }
692
+ function resetTimer() {
693
+ if (timer) {
694
+ clearTimeout(timer);
695
+ timer = null;
696
+ }
697
+ }
698
+ function abort() {
699
+ if (status === "pending") {
700
+ status = "aborted";
701
+ }
702
+ resetTimer();
703
+ queue.forEach((item) => {
704
+ if (item.status === "pending") {
705
+ item.status = "aborted";
706
+ }
707
+ });
708
+ queue = [];
709
+ }
710
+ function subscribe(callback, overwrite) {
711
+ if (overwrite) {
712
+ doneCallbacks = [];
713
+ }
714
+ if (typeof callback === "function") {
715
+ doneCallbacks.push(callback);
716
+ }
717
+ }
718
+ function getQueryStatus() {
719
+ return {
720
+ startTime,
721
+ payload,
722
+ status,
723
+ queriesSent,
724
+ queriesPending: queue.length,
725
+ subscribe,
726
+ abort
727
+ };
728
+ }
729
+ function failQuery() {
730
+ status = "failed";
731
+ doneCallbacks.forEach((callback) => {
732
+ callback(void 0, lastError);
733
+ });
734
+ }
735
+ function clearQueue() {
736
+ queue.forEach((item) => {
737
+ if (item.status === "pending") {
738
+ item.status = "aborted";
739
+ }
740
+ });
741
+ queue = [];
742
+ }
743
+ function moduleResponse(item, response, data) {
744
+ const isError = response !== "success";
745
+ queue = queue.filter((queued) => queued !== item);
746
+ switch (status) {
747
+ case "pending":
748
+ break;
749
+ case "failed":
750
+ if (isError || !config.dataAfterTimeout) {
751
+ return;
752
+ }
753
+ break;
754
+ default:
755
+ return;
756
+ }
757
+ if (response === "abort") {
758
+ lastError = data;
759
+ failQuery();
760
+ return;
761
+ }
762
+ if (isError) {
763
+ lastError = data;
764
+ if (!queue.length) {
765
+ if (!resources.length) {
766
+ failQuery();
767
+ } else {
768
+ execNext();
769
+ }
770
+ }
771
+ return;
772
+ }
773
+ resetTimer();
774
+ clearQueue();
775
+ if (!config.random) {
776
+ const index = config.resources.indexOf(item.resource);
777
+ if (index !== -1 && index !== config.index) {
778
+ config.index = index;
779
+ }
780
+ }
781
+ status = "completed";
782
+ doneCallbacks.forEach((callback) => {
783
+ callback(data);
784
+ });
785
+ }
786
+ function execNext() {
787
+ if (status !== "pending") {
788
+ return;
789
+ }
790
+ resetTimer();
791
+ const resource = resources.shift();
792
+ if (resource === void 0) {
793
+ if (queue.length) {
794
+ timer = setTimeout(() => {
795
+ resetTimer();
796
+ if (status === "pending") {
797
+ clearQueue();
798
+ failQuery();
799
+ }
800
+ }, config.timeout);
801
+ return;
802
+ }
803
+ failQuery();
804
+ return;
805
+ }
806
+ const item = {
807
+ status: "pending",
808
+ resource,
809
+ callback: (status2, data) => {
810
+ moduleResponse(item, status2, data);
811
+ }
812
+ };
813
+ queue.push(item);
814
+ queriesSent++;
815
+ timer = setTimeout(execNext, config.rotate);
816
+ query(resource, payload, item.callback);
817
+ }
818
+ setTimeout(execNext);
819
+ return getQueryStatus;
820
+ }
821
+
822
+ // src/index.ts
823
+ function initRedundancy(cfg) {
824
+ const config = {
825
+ ...defaultConfig,
826
+ ...cfg
827
+ };
828
+ let queries = [];
829
+ function cleanup() {
830
+ queries = queries.filter((item) => item().status === "pending");
831
+ }
832
+ function query(payload, queryCallback, doneCallback) {
833
+ const query2 = sendQuery(
834
+ config,
835
+ payload,
836
+ queryCallback,
837
+ (data, error) => {
838
+ cleanup();
839
+ if (doneCallback) {
840
+ doneCallback(data, error);
841
+ }
842
+ }
843
+ );
844
+ queries.push(query2);
845
+ return query2;
846
+ }
847
+ function find(callback) {
848
+ return queries.find((value) => {
849
+ return callback(value);
850
+ }) || null;
851
+ }
852
+ const instance = {
853
+ query,
854
+ find,
855
+ setIndex: (index) => {
856
+ config.index = index;
857
+ },
858
+ getIndex: () => config.index,
859
+ cleanup
860
+ };
861
+ return instance;
862
+ }
863
+
864
+ function createAPIConfig(source) {
865
+ let resources;
866
+ if (typeof source.resources === "string") {
867
+ resources = [source.resources];
868
+ } else {
869
+ resources = source.resources;
870
+ if (!(resources instanceof Array) || !resources.length) {
871
+ return null;
872
+ }
873
+ }
874
+ const result = {
875
+ // API hosts
876
+ resources,
877
+ // Root path
878
+ path: source.path || "/",
879
+ // URL length limit
880
+ maxURL: source.maxURL || 500,
881
+ // Timeout before next host is used.
882
+ rotate: source.rotate || 750,
883
+ // Timeout before failing query.
884
+ timeout: source.timeout || 5e3,
885
+ // Randomise default API end point.
886
+ random: source.random === true,
887
+ // Start index
888
+ index: source.index || 0,
889
+ // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
890
+ dataAfterTimeout: source.dataAfterTimeout !== false
891
+ };
892
+ return result;
893
+ }
894
+ const configStorage = /* @__PURE__ */ Object.create(null);
895
+ const fallBackAPISources = [
896
+ "https://api.simplesvg.com",
897
+ "https://api.unisvg.com"
898
+ ];
899
+ const fallBackAPI = [];
900
+ while (fallBackAPISources.length > 0) {
901
+ if (fallBackAPISources.length === 1) {
902
+ fallBackAPI.push(fallBackAPISources.shift());
903
+ } else {
904
+ if (Math.random() > 0.5) {
905
+ fallBackAPI.push(fallBackAPISources.shift());
906
+ } else {
907
+ fallBackAPI.push(fallBackAPISources.pop());
908
+ }
909
+ }
910
+ }
911
+ configStorage[""] = createAPIConfig({
912
+ resources: ["https://api.iconify.design"].concat(fallBackAPI)
913
+ });
914
+ function addAPIProvider$1(provider, customConfig) {
915
+ const config = createAPIConfig(customConfig);
916
+ if (config === null) {
917
+ return false;
918
+ }
919
+ configStorage[provider] = config;
920
+ return true;
921
+ }
922
+ function getAPIConfig(provider) {
923
+ return configStorage[provider];
924
+ }
925
+ function listAPIProviders() {
926
+ return Object.keys(configStorage);
927
+ }
928
+
929
+ function emptyCallback$1() {
930
+ }
931
+ const redundancyCache = /* @__PURE__ */ Object.create(null);
932
+ function getRedundancyCache(provider) {
933
+ if (!redundancyCache[provider]) {
934
+ const config = getAPIConfig(provider);
935
+ if (!config) {
936
+ return;
937
+ }
938
+ const redundancy = initRedundancy(config);
939
+ const cachedReundancy = {
940
+ config,
941
+ redundancy
942
+ };
943
+ redundancyCache[provider] = cachedReundancy;
944
+ }
945
+ return redundancyCache[provider];
946
+ }
947
+ function sendAPIQuery(target, query, callback) {
948
+ let redundancy;
949
+ let send;
950
+ if (typeof target === "string") {
951
+ const api = getAPIModule(target);
952
+ if (!api) {
953
+ callback(void 0, 424);
954
+ return emptyCallback$1;
955
+ }
956
+ send = api.send;
957
+ const cached = getRedundancyCache(target);
958
+ if (cached) {
959
+ redundancy = cached.redundancy;
960
+ }
961
+ } else {
962
+ const config = createAPIConfig(target);
963
+ if (config) {
964
+ redundancy = initRedundancy(config);
965
+ const moduleKey = target.resources ? target.resources[0] : "";
966
+ const api = getAPIModule(moduleKey);
967
+ if (api) {
968
+ send = api.send;
969
+ }
970
+ }
971
+ }
972
+ if (!redundancy || !send) {
973
+ callback(void 0, 424);
974
+ return emptyCallback$1;
975
+ }
976
+ return redundancy.query(query, send, callback)().abort;
977
+ }
978
+
979
+ const browserCacheVersion = "iconify2";
980
+ const browserCachePrefix = "iconify";
981
+ const browserCacheCountKey = browserCachePrefix + "-count";
982
+ const browserCacheVersionKey = browserCachePrefix + "-version";
983
+ const browserStorageHour = 36e5;
984
+ const browserStorageCacheExpiration = 168;
985
+ const browserStorageLimit = 50;
986
+
987
+ function getStoredItem(func, key) {
988
+ try {
989
+ return func.getItem(key);
990
+ } catch (err) {
991
+ }
992
+ }
993
+ function setStoredItem(func, key, value) {
994
+ try {
995
+ func.setItem(key, value);
996
+ return true;
997
+ } catch (err) {
998
+ }
999
+ }
1000
+ function removeStoredItem(func, key) {
1001
+ try {
1002
+ func.removeItem(key);
1003
+ } catch (err) {
1004
+ }
1005
+ }
1006
+
1007
+ function setBrowserStorageItemsCount(storage, value) {
1008
+ return setStoredItem(storage, browserCacheCountKey, value.toString());
1009
+ }
1010
+ function getBrowserStorageItemsCount(storage) {
1011
+ return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
1012
+ }
1013
+
1014
+ const browserStorageConfig = {
1015
+ local: true,
1016
+ session: true
1017
+ };
1018
+ const browserStorageEmptyItems = {
1019
+ local: /* @__PURE__ */ new Set(),
1020
+ session: /* @__PURE__ */ new Set()
1021
+ };
1022
+ let browserStorageStatus = false;
1023
+ function setBrowserStorageStatus(status) {
1024
+ browserStorageStatus = status;
1025
+ }
1026
+
1027
+ let _window = typeof window === "undefined" ? {} : window;
1028
+ function getBrowserStorage(key) {
1029
+ const attr = key + "Storage";
1030
+ try {
1031
+ if (_window && _window[attr] && typeof _window[attr].length === "number") {
1032
+ return _window[attr];
1033
+ }
1034
+ } catch (err) {
1035
+ }
1036
+ browserStorageConfig[key] = false;
1037
+ }
1038
+
1039
+ function iterateBrowserStorage(key, callback) {
1040
+ const func = getBrowserStorage(key);
1041
+ if (!func) {
1042
+ return;
1043
+ }
1044
+ const version = getStoredItem(func, browserCacheVersionKey);
1045
+ if (version !== browserCacheVersion) {
1046
+ if (version) {
1047
+ const total2 = getBrowserStorageItemsCount(func);
1048
+ for (let i = 0; i < total2; i++) {
1049
+ removeStoredItem(func, browserCachePrefix + i.toString());
1050
+ }
1051
+ }
1052
+ setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
1053
+ setBrowserStorageItemsCount(func, 0);
1054
+ return;
1055
+ }
1056
+ const minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
1057
+ const parseItem = (index) => {
1058
+ const name = browserCachePrefix + index.toString();
1059
+ const item = getStoredItem(func, name);
1060
+ if (typeof item !== "string") {
1061
+ return;
1062
+ }
1063
+ try {
1064
+ const data = JSON.parse(item);
1065
+ if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
1066
+ callback(data, index)) {
1067
+ return true;
1068
+ }
1069
+ } catch (err) {
1070
+ }
1071
+ removeStoredItem(func, name);
1072
+ };
1073
+ let total = getBrowserStorageItemsCount(func);
1074
+ for (let i = total - 1; i >= 0; i--) {
1075
+ if (!parseItem(i)) {
1076
+ if (i === total - 1) {
1077
+ total--;
1078
+ setBrowserStorageItemsCount(func, total);
1079
+ } else {
1080
+ browserStorageEmptyItems[key].add(i);
1081
+ }
1082
+ }
1083
+ }
1084
+ }
1085
+
1086
+ function initBrowserStorage() {
1087
+ if (browserStorageStatus) {
1088
+ return;
1089
+ }
1090
+ setBrowserStorageStatus(true);
1091
+ for (const key in browserStorageConfig) {
1092
+ iterateBrowserStorage(key, (item) => {
1093
+ const iconSet = item.data;
1094
+ const provider = item.provider;
1095
+ const prefix = iconSet.prefix;
1096
+ const storage = getStorage(
1097
+ provider,
1098
+ prefix
1099
+ );
1100
+ if (!addIconSet(storage, iconSet).length) {
1101
+ return false;
1102
+ }
1103
+ const lastModified = iconSet.lastModified || -1;
1104
+ storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
1105
+ return true;
1106
+ });
1107
+ }
1108
+ }
1109
+
1110
+ function updateLastModified(storage, lastModified) {
1111
+ const lastValue = storage.lastModifiedCached;
1112
+ if (
1113
+ // Matches or newer
1114
+ lastValue && lastValue >= lastModified
1115
+ ) {
1116
+ return lastValue === lastModified;
1117
+ }
1118
+ storage.lastModifiedCached = lastModified;
1119
+ if (lastValue) {
1120
+ for (const key in browserStorageConfig) {
1121
+ iterateBrowserStorage(key, (item) => {
1122
+ const iconSet = item.data;
1123
+ return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
1124
+ });
1125
+ }
1126
+ }
1127
+ return true;
1128
+ }
1129
+ function storeInBrowserStorage(storage, data) {
1130
+ if (!browserStorageStatus) {
1131
+ initBrowserStorage();
1132
+ }
1133
+ function store(key) {
1134
+ let func;
1135
+ if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
1136
+ return;
1137
+ }
1138
+ const set = browserStorageEmptyItems[key];
1139
+ let index;
1140
+ if (set.size) {
1141
+ set.delete(index = Array.from(set).shift());
1142
+ } else {
1143
+ index = getBrowserStorageItemsCount(func);
1144
+ if (index >= browserStorageLimit || !setBrowserStorageItemsCount(func, index + 1)) {
1145
+ return;
1146
+ }
1147
+ }
1148
+ const item = {
1149
+ cached: Math.floor(Date.now() / browserStorageHour),
1150
+ provider: storage.provider,
1151
+ data
1152
+ };
1153
+ return setStoredItem(
1154
+ func,
1155
+ browserCachePrefix + index.toString(),
1156
+ JSON.stringify(item)
1157
+ );
1158
+ }
1159
+ if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
1160
+ return;
1161
+ }
1162
+ if (!Object.keys(data.icons).length) {
1163
+ return;
1164
+ }
1165
+ if (data.not_found) {
1166
+ data = Object.assign({}, data);
1167
+ delete data.not_found;
1168
+ }
1169
+ if (!store("local")) {
1170
+ store("session");
1171
+ }
1172
+ }
1173
+
1174
+ function emptyCallback() {
1175
+ }
1176
+ function loadedNewIcons(storage) {
1177
+ if (!storage.iconsLoaderFlag) {
1178
+ storage.iconsLoaderFlag = true;
1179
+ setTimeout(() => {
1180
+ storage.iconsLoaderFlag = false;
1181
+ updateCallbacks(storage);
1182
+ });
1183
+ }
1184
+ }
1185
+ function loadNewIcons(storage, icons) {
1186
+ if (!storage.iconsToLoad) {
1187
+ storage.iconsToLoad = icons;
1188
+ } else {
1189
+ storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
1190
+ }
1191
+ if (!storage.iconsQueueFlag) {
1192
+ storage.iconsQueueFlag = true;
1193
+ setTimeout(() => {
1194
+ storage.iconsQueueFlag = false;
1195
+ const { provider, prefix } = storage;
1196
+ const icons2 = storage.iconsToLoad;
1197
+ delete storage.iconsToLoad;
1198
+ let api;
1199
+ if (!icons2 || !(api = getAPIModule(provider))) {
1200
+ return;
1201
+ }
1202
+ const params = api.prepare(provider, prefix, icons2);
1203
+ params.forEach((item) => {
1204
+ sendAPIQuery(provider, item, (data) => {
1205
+ if (typeof data !== "object") {
1206
+ item.icons.forEach((name) => {
1207
+ storage.missing.add(name);
1208
+ });
1209
+ } else {
1210
+ try {
1211
+ const parsed = addIconSet(
1212
+ storage,
1213
+ data
1214
+ );
1215
+ if (!parsed.length) {
1216
+ return;
1217
+ }
1218
+ const pending = storage.pendingIcons;
1219
+ if (pending) {
1220
+ parsed.forEach((name) => {
1221
+ pending.delete(name);
1222
+ });
1223
+ }
1224
+ storeInBrowserStorage(storage, data);
1225
+ } catch (err) {
1226
+ console.error(err);
1227
+ }
1228
+ }
1229
+ loadedNewIcons(storage);
1230
+ });
1231
+ });
1232
+ });
1233
+ }
1234
+ }
1235
+ const loadIcons$1 = (icons, callback) => {
1236
+ const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1237
+ const sortedIcons = sortIcons(cleanedIcons);
1238
+ if (!sortedIcons.pending.length) {
1239
+ let callCallback = true;
1240
+ if (callback) {
1241
+ setTimeout(() => {
1242
+ if (callCallback) {
1243
+ callback(
1244
+ sortedIcons.loaded,
1245
+ sortedIcons.missing,
1246
+ sortedIcons.pending,
1247
+ emptyCallback
1248
+ );
1249
+ }
1250
+ });
1251
+ }
1252
+ return () => {
1253
+ callCallback = false;
1254
+ };
1255
+ }
1256
+ const newIcons = /* @__PURE__ */ Object.create(null);
1257
+ const sources = [];
1258
+ let lastProvider, lastPrefix;
1259
+ sortedIcons.pending.forEach((icon) => {
1260
+ const { provider, prefix } = icon;
1261
+ if (prefix === lastPrefix && provider === lastProvider) {
1262
+ return;
1263
+ }
1264
+ lastProvider = provider;
1265
+ lastPrefix = prefix;
1266
+ sources.push(getStorage(provider, prefix));
1267
+ const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1268
+ if (!providerNewIcons[prefix]) {
1269
+ providerNewIcons[prefix] = [];
1270
+ }
1271
+ });
1272
+ sortedIcons.pending.forEach((icon) => {
1273
+ const { provider, prefix, name } = icon;
1274
+ const storage = getStorage(provider, prefix);
1275
+ const pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
1276
+ if (!pendingQueue.has(name)) {
1277
+ pendingQueue.add(name);
1278
+ newIcons[provider][prefix].push(name);
1279
+ }
1280
+ });
1281
+ sources.forEach((storage) => {
1282
+ const { provider, prefix } = storage;
1283
+ if (newIcons[provider][prefix].length) {
1284
+ loadNewIcons(storage, newIcons[provider][prefix]);
1285
+ }
1286
+ });
1287
+ return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1288
+ };
1289
+ const loadIcon$1 = (icon) => {
1290
+ return new Promise((fulfill, reject) => {
1291
+ const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
1292
+ if (!iconObj) {
1293
+ reject(icon);
1294
+ return;
1295
+ }
1296
+ loadIcons$1([iconObj || icon], (loaded) => {
1297
+ if (loaded.length && iconObj) {
1298
+ const data = getIconData(iconObj);
1299
+ if (data) {
1300
+ fulfill({
1301
+ ...defaultIconProps,
1302
+ ...data
1303
+ });
1304
+ return;
1305
+ }
1306
+ }
1307
+ reject(icon);
1308
+ });
1309
+ });
1310
+ };
1311
+
1312
+ /**
1313
+ * Test icon string
1314
+ */
1315
+ function testIconObject(value) {
1316
+ try {
1317
+ const obj = typeof value === 'string' ? JSON.parse(value) : value;
1318
+ if (typeof obj.body === 'string') {
1319
+ return {
1320
+ ...obj,
1321
+ };
1322
+ }
1323
+ }
1324
+ catch (err) {
1325
+ //
1326
+ }
1327
+ }
1328
+
1329
+ /**
1330
+ * Parse icon value, load if needed
1331
+ */
1332
+ function parseIconValue(value, onload) {
1333
+ // Check if icon name is valid
1334
+ const name = typeof value === 'string' ? stringToIcon(value, true, true) : null;
1335
+ if (!name) {
1336
+ // Test for serialised object
1337
+ const data = testIconObject(value);
1338
+ return {
1339
+ value,
1340
+ data,
1341
+ };
1342
+ }
1343
+ // Valid icon name: check if data is available
1344
+ const data = getIconData(name);
1345
+ // Icon data exists or icon has no prefix. Do not load icon from API if icon has no prefix
1346
+ if (data !== void 0 || !name.prefix) {
1347
+ return {
1348
+ value,
1349
+ name,
1350
+ data, // could be 'null' -> icon is missing
1351
+ };
1352
+ }
1353
+ // Load icon
1354
+ const loading = loadIcons$1([name], () => onload(value, name, getIconData(name)));
1355
+ return {
1356
+ value,
1357
+ name,
1358
+ loading,
1359
+ };
1360
+ }
1361
+
1362
+ // Check for Safari
1363
+ let isBuggedSafari = false;
1364
+ try {
1365
+ isBuggedSafari = navigator.vendor.indexOf('Apple') === 0;
1366
+ }
1367
+ catch (err) {
1368
+ //
1369
+ }
1370
+ /**
1371
+ * Get render mode
1372
+ */
1373
+ function getRenderMode(body, mode) {
1374
+ switch (mode) {
1375
+ // Force mode
1376
+ case 'svg':
1377
+ case 'bg':
1378
+ case 'mask':
1379
+ return mode;
1380
+ }
1381
+ // Check for animation, use 'style' for animated icons, unless browser is Safari
1382
+ // (only <a>, which should be ignored or animations start with '<a')
1383
+ if (mode !== 'style' &&
1384
+ (isBuggedSafari || body.indexOf('<a') === -1)) {
1385
+ // Render <svg>
1386
+ return 'svg';
1387
+ }
1388
+ // Use background or mask
1389
+ return body.indexOf('currentColor') === -1 ? 'bg' : 'mask';
1390
+ }
1391
+
1392
+ const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
1393
+ const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
1394
+ function calculateSize$1(size, ratio, precision) {
1395
+ if (ratio === 1) {
1396
+ return size;
1397
+ }
1398
+ precision = precision || 100;
1399
+ if (typeof size === "number") {
1400
+ return Math.ceil(size * ratio * precision) / precision;
1401
+ }
1402
+ if (typeof size !== "string") {
1403
+ return size;
1404
+ }
1405
+ const oldParts = size.split(unitsSplit);
1406
+ if (oldParts === null || !oldParts.length) {
1407
+ return size;
1408
+ }
1409
+ const newParts = [];
1410
+ let code = oldParts.shift();
1411
+ let isNumber = unitsTest.test(code);
1412
+ while (true) {
1413
+ if (isNumber) {
1414
+ const num = parseFloat(code);
1415
+ if (isNaN(num)) {
1416
+ newParts.push(code);
1417
+ } else {
1418
+ newParts.push(Math.ceil(num * ratio * precision) / precision);
1419
+ }
1420
+ } else {
1421
+ newParts.push(code);
1422
+ }
1423
+ code = oldParts.shift();
1424
+ if (code === void 0) {
1425
+ return newParts.join("");
1426
+ }
1427
+ isNumber = !isNumber;
1428
+ }
1429
+ }
1430
+
1431
+ function splitSVGDefs(content, tag = "defs") {
1432
+ let defs = "";
1433
+ const index = content.indexOf("<" + tag);
1434
+ while (index >= 0) {
1435
+ const start = content.indexOf(">", index);
1436
+ const end = content.indexOf("</" + tag);
1437
+ if (start === -1 || end === -1) {
1438
+ break;
1439
+ }
1440
+ const endEnd = content.indexOf(">", end);
1441
+ if (endEnd === -1) {
1442
+ break;
1443
+ }
1444
+ defs += content.slice(start + 1, end).trim();
1445
+ content = content.slice(0, index).trim() + content.slice(endEnd + 1);
1446
+ }
1447
+ return {
1448
+ defs,
1449
+ content
1450
+ };
1451
+ }
1452
+ function mergeDefsAndContent(defs, content) {
1453
+ return defs ? "<defs>" + defs + "</defs>" + content : content;
1454
+ }
1455
+ function wrapSVGContent(body, start, end) {
1456
+ const split = splitSVGDefs(body);
1457
+ return mergeDefsAndContent(split.defs, start + split.content + end);
1458
+ }
1459
+
1460
+ const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
1461
+ function iconToSVG(icon, customisations) {
1462
+ const fullIcon = {
1463
+ ...defaultIconProps,
1464
+ ...icon
1465
+ };
1466
+ const fullCustomisations = {
1467
+ ...defaultIconCustomisations,
1468
+ ...customisations
1469
+ };
1470
+ const box = {
1471
+ left: fullIcon.left,
1472
+ top: fullIcon.top,
1473
+ width: fullIcon.width,
1474
+ height: fullIcon.height
1475
+ };
1476
+ let body = fullIcon.body;
1477
+ [fullIcon, fullCustomisations].forEach((props) => {
1478
+ const transformations = [];
1479
+ const hFlip = props.hFlip;
1480
+ const vFlip = props.vFlip;
1481
+ let rotation = props.rotate;
1482
+ if (hFlip) {
1483
+ if (vFlip) {
1484
+ rotation += 2;
1485
+ } else {
1486
+ transformations.push(
1487
+ "translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")"
1488
+ );
1489
+ transformations.push("scale(-1 1)");
1490
+ box.top = box.left = 0;
1491
+ }
1492
+ } else if (vFlip) {
1493
+ transformations.push(
1494
+ "translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")"
1495
+ );
1496
+ transformations.push("scale(1 -1)");
1497
+ box.top = box.left = 0;
1498
+ }
1499
+ let tempValue;
1500
+ if (rotation < 0) {
1501
+ rotation -= Math.floor(rotation / 4) * 4;
1502
+ }
1503
+ rotation = rotation % 4;
1504
+ switch (rotation) {
1505
+ case 1:
1506
+ tempValue = box.height / 2 + box.top;
1507
+ transformations.unshift(
1508
+ "rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")"
1509
+ );
1510
+ break;
1511
+ case 2:
1512
+ transformations.unshift(
1513
+ "rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")"
1514
+ );
1515
+ break;
1516
+ case 3:
1517
+ tempValue = box.width / 2 + box.left;
1518
+ transformations.unshift(
1519
+ "rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")"
1520
+ );
1521
+ break;
1522
+ }
1523
+ if (rotation % 2 === 1) {
1524
+ if (box.left !== box.top) {
1525
+ tempValue = box.left;
1526
+ box.left = box.top;
1527
+ box.top = tempValue;
1528
+ }
1529
+ if (box.width !== box.height) {
1530
+ tempValue = box.width;
1531
+ box.width = box.height;
1532
+ box.height = tempValue;
1533
+ }
1534
+ }
1535
+ if (transformations.length) {
1536
+ body = wrapSVGContent(
1537
+ body,
1538
+ '<g transform="' + transformations.join(" ") + '">',
1539
+ "</g>"
1540
+ );
1541
+ }
1542
+ });
1543
+ const customisationsWidth = fullCustomisations.width;
1544
+ const customisationsHeight = fullCustomisations.height;
1545
+ const boxWidth = box.width;
1546
+ const boxHeight = box.height;
1547
+ let width;
1548
+ let height;
1549
+ if (customisationsWidth === null) {
1550
+ height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
1551
+ width = calculateSize$1(height, boxWidth / boxHeight);
1552
+ } else {
1553
+ width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
1554
+ height = customisationsHeight === null ? calculateSize$1(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
1555
+ }
1556
+ const attributes = {};
1557
+ const setAttr = (prop, value) => {
1558
+ if (!isUnsetKeyword(value)) {
1559
+ attributes[prop] = value.toString();
1560
+ }
1561
+ };
1562
+ setAttr("width", width);
1563
+ setAttr("height", height);
1564
+ const viewBox = [box.left, box.top, boxWidth, boxHeight];
1565
+ attributes.viewBox = viewBox.join(" ");
1566
+ return {
1567
+ attributes,
1568
+ viewBox,
1569
+ body
1570
+ };
1571
+ }
1572
+
1573
+ function iconToHTML$1(body, attributes) {
1574
+ let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1575
+ for (const attr in attributes) {
1576
+ renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
1577
+ }
1578
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1579
+ }
1580
+
1581
+ function encodeSVGforURL(svg) {
1582
+ return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1583
+ }
1584
+ function svgToData(svg) {
1585
+ return "data:image/svg+xml," + encodeSVGforURL(svg);
1586
+ }
1587
+ function svgToURL$1(svg) {
1588
+ return 'url("' + svgToData(svg) + '")';
1589
+ }
1590
+
1591
+ const detectFetch = () => {
1592
+ let callback;
1593
+ try {
1594
+ callback = fetch;
1595
+ if (typeof callback === "function") {
1596
+ return callback;
1597
+ }
1598
+ } catch (err) {
1599
+ }
1600
+ };
1601
+ let fetchModule = detectFetch();
1602
+ function setFetch(fetch2) {
1603
+ fetchModule = fetch2;
1604
+ }
1605
+ function getFetch() {
1606
+ return fetchModule;
1607
+ }
1608
+ function calculateMaxLength(provider, prefix) {
1609
+ const config = getAPIConfig(provider);
1610
+ if (!config) {
1611
+ return 0;
1612
+ }
1613
+ let result;
1614
+ if (!config.maxURL) {
1615
+ result = 0;
1616
+ } else {
1617
+ let maxHostLength = 0;
1618
+ config.resources.forEach((item) => {
1619
+ const host = item;
1620
+ maxHostLength = Math.max(maxHostLength, host.length);
1621
+ });
1622
+ const url = prefix + ".json?icons=";
1623
+ result = config.maxURL - maxHostLength - config.path.length - url.length;
1624
+ }
1625
+ return result;
1626
+ }
1627
+ function shouldAbort(status) {
1628
+ return status === 404;
1629
+ }
1630
+ const prepare = (provider, prefix, icons) => {
1631
+ const results = [];
1632
+ const maxLength = calculateMaxLength(provider, prefix);
1633
+ const type = "icons";
1634
+ let item = {
1635
+ type,
1636
+ provider,
1637
+ prefix,
1638
+ icons: []
1639
+ };
1640
+ let length = 0;
1641
+ icons.forEach((name, index) => {
1642
+ length += name.length + 1;
1643
+ if (length >= maxLength && index > 0) {
1644
+ results.push(item);
1645
+ item = {
1646
+ type,
1647
+ provider,
1648
+ prefix,
1649
+ icons: []
1650
+ };
1651
+ length = name.length;
1652
+ }
1653
+ item.icons.push(name);
1654
+ });
1655
+ results.push(item);
1656
+ return results;
1657
+ };
1658
+ function getPath(provider) {
1659
+ if (typeof provider === "string") {
1660
+ const config = getAPIConfig(provider);
1661
+ if (config) {
1662
+ return config.path;
1663
+ }
1664
+ }
1665
+ return "/";
1666
+ }
1667
+ const send = (host, params, callback) => {
1668
+ if (!fetchModule) {
1669
+ callback("abort", 424);
1670
+ return;
1671
+ }
1672
+ let path = getPath(params.provider);
1673
+ switch (params.type) {
1674
+ case "icons": {
1675
+ const prefix = params.prefix;
1676
+ const icons = params.icons;
1677
+ const iconsList = icons.join(",");
1678
+ const urlParams = new URLSearchParams({
1679
+ icons: iconsList
1680
+ });
1681
+ path += prefix + ".json?" + urlParams.toString();
1682
+ break;
1683
+ }
1684
+ case "custom": {
1685
+ const uri = params.uri;
1686
+ path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
1687
+ break;
1688
+ }
1689
+ default:
1690
+ callback("abort", 400);
1691
+ return;
1692
+ }
1693
+ let defaultError = 503;
1694
+ fetchModule(host + path).then((response) => {
1695
+ const status = response.status;
1696
+ if (status !== 200) {
1697
+ setTimeout(() => {
1698
+ callback(shouldAbort(status) ? "abort" : "next", status);
1699
+ });
1700
+ return;
1701
+ }
1702
+ defaultError = 501;
1703
+ return response.json();
1704
+ }).then((data) => {
1705
+ if (typeof data !== "object" || data === null) {
1706
+ setTimeout(() => {
1707
+ if (data === 404) {
1708
+ callback("abort", data);
1709
+ } else {
1710
+ callback("next", defaultError);
1711
+ }
1712
+ });
1713
+ return;
1714
+ }
1715
+ setTimeout(() => {
1716
+ callback("success", data);
1717
+ });
1718
+ }).catch(() => {
1719
+ callback("next", defaultError);
1720
+ });
1721
+ };
1722
+ const fetchAPIModule = {
1723
+ prepare,
1724
+ send
1725
+ };
1726
+
1727
+ function toggleBrowserCache(storage, value) {
1728
+ switch (storage) {
1729
+ case "local":
1730
+ case "session":
1731
+ browserStorageConfig[storage] = value;
1732
+ break;
1733
+ case "all":
1734
+ for (const key in browserStorageConfig) {
1735
+ browserStorageConfig[key] = value;
1736
+ }
1737
+ break;
1738
+ }
1739
+ }
1740
+
1741
+ /**
1742
+ * Attribute to add
1743
+ */
1744
+ const nodeAttr = 'data-style';
1745
+ /**
1746
+ * Custom style to add to each node
1747
+ */
1748
+ let customStyle = '';
1749
+ /**
1750
+ * Set custom style to add to all components
1751
+ *
1752
+ * Affects only components rendered after function call
1753
+ */
1754
+ function appendCustomStyle(style) {
1755
+ customStyle = style;
1756
+ }
1757
+ /**
1758
+ * Add/update style node
1759
+ */
1760
+ function updateStyle(parent, inline) {
1761
+ // Get node, create if needed
1762
+ let styleNode = Array.from(parent.childNodes).find((node) => node.hasAttribute &&
1763
+ node.hasAttribute(nodeAttr));
1764
+ if (!styleNode) {
1765
+ styleNode = document.createElement('style');
1766
+ styleNode.setAttribute(nodeAttr, nodeAttr);
1767
+ parent.appendChild(styleNode);
1768
+ }
1769
+ // Update content
1770
+ styleNode.textContent =
1771
+ ':host{display:inline-block;vertical-align:' +
1772
+ (inline ? '-0.125em' : '0') +
1773
+ '}span,svg{display:block}' +
1774
+ customStyle;
1775
+ }
1776
+
1777
+ // Core
1778
+ /**
1779
+ * Get functions and initialise stuff
1780
+ */
1781
+ function exportFunctions() {
1782
+ /**
1783
+ * Initialise stuff
1784
+ */
1785
+ // Set API module
1786
+ setAPIModule('', fetchAPIModule);
1787
+ // Allow simple icon names
1788
+ allowSimpleNames(true);
1789
+ let _window;
1790
+ try {
1791
+ _window = window;
1792
+ }
1793
+ catch (err) {
1794
+ //
1795
+ }
1796
+ if (_window) {
1797
+ // Set cache and load existing cache
1798
+ initBrowserStorage();
1799
+ // Load icons from global "IconifyPreload"
1800
+ if (_window.IconifyPreload !== void 0) {
1801
+ const preload = _window.IconifyPreload;
1802
+ const err = 'Invalid IconifyPreload syntax.';
1803
+ if (typeof preload === 'object' && preload !== null) {
1804
+ (preload instanceof Array ? preload : [preload]).forEach((item) => {
1805
+ try {
1806
+ if (
1807
+ // Check if item is an object and not null/array
1808
+ typeof item !== 'object' ||
1809
+ item === null ||
1810
+ item instanceof Array ||
1811
+ // Check for 'icons' and 'prefix'
1812
+ typeof item.icons !== 'object' ||
1813
+ typeof item.prefix !== 'string' ||
1814
+ // Add icon set
1815
+ !addCollection$1(item)) {
1816
+ console.error(err);
1817
+ }
1818
+ }
1819
+ catch (e) {
1820
+ console.error(err);
1821
+ }
1822
+ });
1823
+ }
1824
+ }
1825
+ // Set API from global "IconifyProviders"
1826
+ if (_window.IconifyProviders !== void 0) {
1827
+ const providers = _window.IconifyProviders;
1828
+ if (typeof providers === 'object' && providers !== null) {
1829
+ for (const key in providers) {
1830
+ const err = 'IconifyProviders[' + key + '] is invalid.';
1831
+ try {
1832
+ const value = providers[key];
1833
+ if (typeof value !== 'object' ||
1834
+ !value ||
1835
+ value.resources === void 0) {
1836
+ continue;
1837
+ }
1838
+ if (!addAPIProvider$1(key, value)) {
1839
+ console.error(err);
1840
+ }
1841
+ }
1842
+ catch (e) {
1843
+ console.error(err);
1844
+ }
1845
+ }
1846
+ }
1847
+ }
1848
+ }
1849
+ const _api = {
1850
+ getAPIConfig,
1851
+ setAPIModule,
1852
+ sendAPIQuery,
1853
+ setFetch,
1854
+ getFetch,
1855
+ listAPIProviders,
1856
+ };
1857
+ return {
1858
+ enableCache: (storage) => toggleBrowserCache(storage, true),
1859
+ disableCache: (storage) => toggleBrowserCache(storage, false),
1860
+ iconLoaded: iconLoaded$1,
1861
+ iconExists: iconLoaded$1, // deprecated, kept to avoid breaking changes
1862
+ getIcon: getIcon$1,
1863
+ listIcons: listIcons$1,
1864
+ addIcon: addIcon$1,
1865
+ addCollection: addCollection$1,
1866
+ calculateSize: calculateSize$1,
1867
+ buildIcon: iconToSVG,
1868
+ iconToHTML: iconToHTML$1,
1869
+ svgToURL: svgToURL$1,
1870
+ loadIcons: loadIcons$1,
1871
+ loadIcon: loadIcon$1,
1872
+ addAPIProvider: addAPIProvider$1,
1873
+ appendCustomStyle,
1874
+ _api,
1875
+ };
1876
+ }
1877
+
1878
+ // List of properties to apply
1879
+ const monotoneProps = {
1880
+ 'background-color': 'currentColor',
1881
+ };
1882
+ const coloredProps = {
1883
+ 'background-color': 'transparent',
1884
+ };
1885
+ // Dynamically add common props to variables above
1886
+ const propsToAdd = {
1887
+ image: 'var(--svg)',
1888
+ repeat: 'no-repeat',
1889
+ size: '100% 100%',
1890
+ };
1891
+ const propsToAddTo = {
1892
+ '-webkit-mask': monotoneProps,
1893
+ 'mask': monotoneProps,
1894
+ 'background': coloredProps,
1895
+ };
1896
+ for (const prefix in propsToAddTo) {
1897
+ const list = propsToAddTo[prefix];
1898
+ for (const prop in propsToAdd) {
1899
+ list[prefix + '-' + prop] = propsToAdd[prop];
1900
+ }
1901
+ }
1902
+ /**
1903
+ * Fix size: add 'px' to numbers
1904
+ */
1905
+ function fixSize(value) {
1906
+ return value ? value + (value.match(/^[-0-9.]+$/) ? 'px' : '') : 'inherit';
1907
+ }
1908
+ /**
1909
+ * Render node as <span>
1910
+ */
1911
+ function renderSPAN(data, icon, useMask) {
1912
+ const node = document.createElement('span');
1913
+ // Body
1914
+ let body = data.body;
1915
+ if (body.indexOf('<a') !== -1) {
1916
+ // Animated SVG: add something to fix timing bug
1917
+ body += '<!-- ' + Date.now() + ' -->';
1918
+ }
1919
+ // Generate SVG as URL
1920
+ const renderAttribs = data.attributes;
1921
+ const html = iconToHTML$1(body, {
1922
+ ...renderAttribs,
1923
+ width: icon.width + '',
1924
+ height: icon.height + '',
1925
+ });
1926
+ const url = svgToURL$1(html);
1927
+ // Generate style
1928
+ const svgStyle = node.style;
1929
+ const styles = {
1930
+ '--svg': url,
1931
+ 'width': fixSize(renderAttribs.width),
1932
+ 'height': fixSize(renderAttribs.height),
1933
+ ...(useMask ? monotoneProps : coloredProps),
1934
+ };
1935
+ // Apply style
1936
+ for (const prop in styles) {
1937
+ svgStyle.setProperty(prop, styles[prop]);
1938
+ }
1939
+ return node;
1940
+ }
1941
+
1942
+ let policy;
1943
+ function createPolicy() {
1944
+ try {
1945
+ policy = window.trustedTypes.createPolicy("iconify", {
1946
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-return
1947
+ createHTML: (s) => s
1948
+ });
1949
+ } catch (err) {
1950
+ policy = null;
1951
+ }
1952
+ }
1953
+ function cleanUpInnerHTML(html) {
1954
+ if (policy === void 0) {
1955
+ createPolicy();
1956
+ }
1957
+ return policy ? policy.createHTML(html) : html;
1958
+ }
1959
+
1960
+ /**
1961
+ * Render node as <svg>
1962
+ */
1963
+ function renderSVG(data) {
1964
+ const node = document.createElement('span');
1965
+ // Add style if needed
1966
+ const attr = data.attributes;
1967
+ let style = '';
1968
+ if (!attr.width) {
1969
+ style = 'width: inherit;';
1970
+ }
1971
+ if (!attr.height) {
1972
+ style += 'height: inherit;';
1973
+ }
1974
+ if (style) {
1975
+ attr.style = style;
1976
+ }
1977
+ // Generate SVG
1978
+ const html = iconToHTML$1(data.body, attr);
1979
+ node.innerHTML = cleanUpInnerHTML(html);
1980
+ return node.firstChild;
1981
+ }
1982
+
1983
+ /**
1984
+ * Find icon node
1985
+ */
1986
+ function findIconElement(parent) {
1987
+ return Array.from(parent.childNodes).find((node) => {
1988
+ const tag = node.tagName &&
1989
+ node.tagName.toUpperCase();
1990
+ return tag === 'SPAN' || tag === 'SVG';
1991
+ });
1992
+ }
1993
+ /**
1994
+ * Render icon
1995
+ */
1996
+ function renderIcon(parent, state) {
1997
+ const iconData = state.icon.data;
1998
+ const customisations = state.customisations;
1999
+ // Render icon
2000
+ const renderData = iconToSVG(iconData, customisations);
2001
+ if (customisations.preserveAspectRatio) {
2002
+ renderData.attributes['preserveAspectRatio'] =
2003
+ customisations.preserveAspectRatio;
2004
+ }
2005
+ const mode = state.renderedMode;
2006
+ let node;
2007
+ switch (mode) {
2008
+ case 'svg':
2009
+ node = renderSVG(renderData);
2010
+ break;
2011
+ default:
2012
+ node = renderSPAN(renderData, {
2013
+ ...defaultIconProps,
2014
+ ...iconData,
2015
+ }, mode === 'mask');
2016
+ }
2017
+ // Set element
2018
+ const oldNode = findIconElement(parent);
2019
+ if (oldNode) {
2020
+ // Replace old element
2021
+ if (node.tagName === 'SPAN' && oldNode.tagName === node.tagName) {
2022
+ // Swap style instead of whole node
2023
+ oldNode.setAttribute('style', node.getAttribute('style'));
2024
+ }
2025
+ else {
2026
+ parent.replaceChild(node, oldNode);
2027
+ }
2028
+ }
2029
+ else {
2030
+ // Add new element
2031
+ parent.appendChild(node);
2032
+ }
2033
+ }
2034
+
2035
+ /**
2036
+ * Set state to PendingState
2037
+ */
2038
+ function setPendingState(icon, inline, lastState) {
2039
+ const lastRender = lastState &&
2040
+ (lastState.rendered
2041
+ ? lastState
2042
+ : lastState.lastRender);
2043
+ return {
2044
+ rendered: false,
2045
+ inline,
2046
+ icon,
2047
+ lastRender,
2048
+ };
2049
+ }
2050
+
2051
+ /**
2052
+ * Register 'iconify-icon' component, if it does not exist
2053
+ */
2054
+ function defineIconifyIcon(name = 'iconify-icon') {
2055
+ // Check for custom elements registry and HTMLElement
2056
+ let customElements;
2057
+ let ParentClass;
2058
+ try {
2059
+ customElements = window.customElements;
2060
+ ParentClass = window.HTMLElement;
2061
+ }
2062
+ catch (err) {
2063
+ return;
2064
+ }
2065
+ // Make sure registry and HTMLElement exist
2066
+ if (!customElements || !ParentClass) {
2067
+ return;
2068
+ }
2069
+ // Check for duplicate
2070
+ const ConflictingClass = customElements.get(name);
2071
+ if (ConflictingClass) {
2072
+ return ConflictingClass;
2073
+ }
2074
+ // All attributes
2075
+ const attributes = [
2076
+ // Icon
2077
+ 'icon',
2078
+ // Mode
2079
+ 'mode',
2080
+ 'inline',
2081
+ 'noobserver',
2082
+ // Customisations
2083
+ 'width',
2084
+ 'height',
2085
+ 'rotate',
2086
+ 'flip',
2087
+ ];
2088
+ /**
2089
+ * Component class
2090
+ */
2091
+ const IconifyIcon = class extends ParentClass {
2092
+ // Root
2093
+ _shadowRoot;
2094
+ // Initialised
2095
+ _initialised = false;
2096
+ // Icon state
2097
+ _state;
2098
+ // Attributes check queued
2099
+ _checkQueued = false;
2100
+ // Connected
2101
+ _connected = false;
2102
+ // Observer
2103
+ _observer = null;
2104
+ _visible = true;
2105
+ /**
2106
+ * Constructor
2107
+ */
2108
+ constructor() {
2109
+ super();
2110
+ // Attach shadow DOM
2111
+ const root = (this._shadowRoot = this.attachShadow({
2112
+ mode: 'open',
2113
+ }));
2114
+ // Add style
2115
+ const inline = this.hasAttribute('inline');
2116
+ updateStyle(root, inline);
2117
+ // Create empty state
2118
+ this._state = setPendingState({
2119
+ value: '',
2120
+ }, inline);
2121
+ // Queue icon render
2122
+ this._queueCheck();
2123
+ }
2124
+ /**
2125
+ * Connected to DOM
2126
+ */
2127
+ connectedCallback() {
2128
+ this._connected = true;
2129
+ this.startObserver();
2130
+ }
2131
+ /**
2132
+ * Disconnected from DOM
2133
+ */
2134
+ disconnectedCallback() {
2135
+ this._connected = false;
2136
+ this.stopObserver();
2137
+ }
2138
+ /**
2139
+ * Observed attributes
2140
+ */
2141
+ static get observedAttributes() {
2142
+ return attributes.slice(0);
2143
+ }
2144
+ /**
2145
+ * Observed properties that are different from attributes
2146
+ *
2147
+ * Experimental! Need to test with various frameworks that support it
2148
+ */
2149
+ /*
2150
+ static get properties() {
2151
+ return {
2152
+ inline: {
2153
+ type: Boolean,
2154
+ reflect: true,
2155
+ },
2156
+ // Not listing other attributes because they are strings or combination
2157
+ // of string and another type. Cannot have multiple types
2158
+ };
2159
+ }
2160
+ */
2161
+ /**
2162
+ * Attribute has changed
2163
+ */
2164
+ attributeChangedCallback(name) {
2165
+ switch (name) {
2166
+ case 'inline': {
2167
+ // Update immediately: not affected by other attributes
2168
+ const newInline = this.hasAttribute('inline');
2169
+ const state = this._state;
2170
+ if (newInline !== state.inline) {
2171
+ // Update style if inline mode changed
2172
+ state.inline = newInline;
2173
+ updateStyle(this._shadowRoot, newInline);
2174
+ }
2175
+ break;
2176
+ }
2177
+ case 'noobserver': {
2178
+ const value = this.hasAttribute('noobserver');
2179
+ if (value) {
2180
+ this.startObserver();
2181
+ }
2182
+ else {
2183
+ this.stopObserver();
2184
+ }
2185
+ break;
2186
+ }
2187
+ default:
2188
+ // Queue check for other attributes
2189
+ this._queueCheck();
2190
+ }
2191
+ }
2192
+ /**
2193
+ * Get/set icon
2194
+ */
2195
+ get icon() {
2196
+ const value = this.getAttribute('icon');
2197
+ if (value && value.slice(0, 1) === '{') {
2198
+ try {
2199
+ return JSON.parse(value);
2200
+ }
2201
+ catch (err) {
2202
+ //
2203
+ }
2204
+ }
2205
+ return value;
2206
+ }
2207
+ set icon(value) {
2208
+ if (typeof value === 'object') {
2209
+ value = JSON.stringify(value);
2210
+ }
2211
+ this.setAttribute('icon', value);
2212
+ }
2213
+ /**
2214
+ * Get/set inline
2215
+ */
2216
+ get inline() {
2217
+ return this.hasAttribute('inline');
2218
+ }
2219
+ set inline(value) {
2220
+ if (value) {
2221
+ this.setAttribute('inline', 'true');
2222
+ }
2223
+ else {
2224
+ this.removeAttribute('inline');
2225
+ }
2226
+ }
2227
+ /**
2228
+ * Get/set observer
2229
+ */
2230
+ get observer() {
2231
+ return this.hasAttribute('observer');
2232
+ }
2233
+ set observer(value) {
2234
+ if (value) {
2235
+ this.setAttribute('observer', 'true');
2236
+ }
2237
+ else {
2238
+ this.removeAttribute('observer');
2239
+ }
2240
+ }
2241
+ /**
2242
+ * Restart animation
2243
+ */
2244
+ restartAnimation() {
2245
+ const state = this._state;
2246
+ if (state.rendered) {
2247
+ const root = this._shadowRoot;
2248
+ if (state.renderedMode === 'svg') {
2249
+ // Update root node
2250
+ try {
2251
+ root.lastChild.setCurrentTime(0);
2252
+ return;
2253
+ }
2254
+ catch (err) {
2255
+ // Failed: setCurrentTime() is not supported
2256
+ }
2257
+ }
2258
+ renderIcon(root, state);
2259
+ }
2260
+ }
2261
+ /**
2262
+ * Get status
2263
+ */
2264
+ get status() {
2265
+ const state = this._state;
2266
+ return state.rendered
2267
+ ? 'rendered'
2268
+ : state.icon.data === null
2269
+ ? 'failed'
2270
+ : 'loading';
2271
+ }
2272
+ /**
2273
+ * Queue attributes re-check
2274
+ */
2275
+ _queueCheck() {
2276
+ if (!this._checkQueued) {
2277
+ this._checkQueued = true;
2278
+ setTimeout(() => {
2279
+ this._check();
2280
+ });
2281
+ }
2282
+ }
2283
+ /**
2284
+ * Check for changes
2285
+ */
2286
+ _check() {
2287
+ if (!this._checkQueued) {
2288
+ return;
2289
+ }
2290
+ this._checkQueued = false;
2291
+ const state = this._state;
2292
+ // Get icon
2293
+ const newIcon = this.getAttribute('icon');
2294
+ if (newIcon !== state.icon.value) {
2295
+ this._iconChanged(newIcon);
2296
+ return;
2297
+ }
2298
+ // Ignore other attributes if icon is not rendered
2299
+ if (!state.rendered || !this._visible) {
2300
+ return;
2301
+ }
2302
+ // Check for mode and attribute changes
2303
+ const mode = this.getAttribute('mode');
2304
+ const customisations = getCustomisations(this);
2305
+ if (state.attrMode !== mode ||
2306
+ haveCustomisationsChanged(state.customisations, customisations) ||
2307
+ !findIconElement(this._shadowRoot)) {
2308
+ this._renderIcon(state.icon, customisations, mode);
2309
+ }
2310
+ }
2311
+ /**
2312
+ * Icon value has changed
2313
+ */
2314
+ _iconChanged(newValue) {
2315
+ const icon = parseIconValue(newValue, (value, name, data) => {
2316
+ // Asynchronous callback: re-check values to make sure stuff wasn't changed
2317
+ const state = this._state;
2318
+ if (state.rendered || this.getAttribute('icon') !== value) {
2319
+ // Icon data is already available or icon attribute was changed
2320
+ return;
2321
+ }
2322
+ // Change icon
2323
+ const icon = {
2324
+ value,
2325
+ name,
2326
+ data,
2327
+ };
2328
+ if (icon.data) {
2329
+ // Render icon
2330
+ this._gotIconData(icon);
2331
+ }
2332
+ else {
2333
+ // Nothing to render: update icon in state
2334
+ state.icon = icon;
2335
+ }
2336
+ });
2337
+ if (icon.data) {
2338
+ // Icon is ready to render
2339
+ this._gotIconData(icon);
2340
+ }
2341
+ else {
2342
+ // Pending icon
2343
+ this._state = setPendingState(icon, this._state.inline, this._state);
2344
+ }
2345
+ }
2346
+ /**
2347
+ * Force render icon on state change
2348
+ */
2349
+ _forceRender() {
2350
+ if (!this._visible) {
2351
+ // Remove icon
2352
+ const node = findIconElement(this._shadowRoot);
2353
+ if (node) {
2354
+ this._shadowRoot.removeChild(node);
2355
+ }
2356
+ return;
2357
+ }
2358
+ // Re-render icon
2359
+ this._queueCheck();
2360
+ }
2361
+ /**
2362
+ * Got new icon data, icon is ready to (re)render
2363
+ */
2364
+ _gotIconData(icon) {
2365
+ this._checkQueued = false;
2366
+ this._renderIcon(icon, getCustomisations(this), this.getAttribute('mode'));
2367
+ }
2368
+ /**
2369
+ * Re-render based on icon data
2370
+ */
2371
+ _renderIcon(icon, customisations, attrMode) {
2372
+ // Get mode
2373
+ const renderedMode = getRenderMode(icon.data.body, attrMode);
2374
+ // Inline was not changed
2375
+ const inline = this._state.inline;
2376
+ // Set state and render
2377
+ renderIcon(this._shadowRoot, (this._state = {
2378
+ rendered: true,
2379
+ icon,
2380
+ inline,
2381
+ customisations,
2382
+ attrMode,
2383
+ renderedMode,
2384
+ }));
2385
+ }
2386
+ /**
2387
+ * Start observer
2388
+ */
2389
+ startObserver() {
2390
+ if (!this._observer && !this.hasAttribute('noobserver')) {
2391
+ try {
2392
+ this._observer = new IntersectionObserver((entries) => {
2393
+ const intersecting = entries.some((entry) => entry.isIntersecting);
2394
+ if (intersecting !== this._visible) {
2395
+ this._visible = intersecting;
2396
+ this._forceRender();
2397
+ }
2398
+ });
2399
+ this._observer.observe(this);
2400
+ }
2401
+ catch (err) {
2402
+ // Something went wrong, possibly observer is not supported
2403
+ if (this._observer) {
2404
+ try {
2405
+ this._observer.disconnect();
2406
+ }
2407
+ catch (err) {
2408
+ //
2409
+ }
2410
+ this._observer = null;
2411
+ }
2412
+ }
2413
+ }
2414
+ }
2415
+ /**
2416
+ * Stop observer
2417
+ */
2418
+ stopObserver() {
2419
+ if (this._observer) {
2420
+ this._observer.disconnect();
2421
+ this._observer = null;
2422
+ this._visible = true;
2423
+ if (this._connected) {
2424
+ // Render icon
2425
+ this._forceRender();
2426
+ }
2427
+ }
2428
+ }
2429
+ };
2430
+ // Add getters and setters
2431
+ attributes.forEach((attr) => {
2432
+ if (!(attr in IconifyIcon.prototype)) {
2433
+ Object.defineProperty(IconifyIcon.prototype, attr, {
2434
+ get: function () {
2435
+ return this.getAttribute(attr);
2436
+ },
2437
+ set: function (value) {
2438
+ if (value !== null) {
2439
+ this.setAttribute(attr, value);
2440
+ }
2441
+ else {
2442
+ this.removeAttribute(attr);
2443
+ }
2444
+ },
2445
+ });
2446
+ }
2447
+ });
2448
+ // Add exported functions: both as static and instance methods
2449
+ const functions = exportFunctions();
2450
+ for (const key in functions) {
2451
+ IconifyIcon[key] = IconifyIcon.prototype[key] = functions[key];
2452
+ }
2453
+ // Define new component
2454
+ customElements.define(name, IconifyIcon);
2455
+ return IconifyIcon;
2456
+ }
2457
+
2458
+ /**
2459
+ * Create exported data: either component instance or functions
2460
+ */
2461
+ defineIconifyIcon() || exportFunctions();
2462
+
2463
+ const iconCss = "*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;-moz-appearance:button;appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}[hidden]{display:none}.d-flex{display:-ms-flexbox !important;display:flex !important}.align-items-center{-ms-flex-align:center !important;align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter) * 0.5);padding-right:calc(var(--grid-gutter) * 0.5);width:100%}.col{-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.container{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter) * -0.5);margin-right:calc(var(--grid-gutter) * -0.5)}@media (min-width: 576px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width: 992px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width: 1600px){.container{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mr-2{margin-right:var(--spacing-scale-base) !important}.mr-n2{margin-right:calc(var(--spacing-scale-base) * -1) !important}.mb-3{margin-bottom:var(--spacing-scale-2x) !important}.mr-auto{margin-right:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.py-3{padding-bottom:var(--spacing-scale-2x) !important;padding-top:var(--spacing-scale-2x) !important}.py-4{padding-bottom:var(--spacing-scale-3x) !important;padding-top:var(--spacing-scale-3x) !important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}:-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.text-pure-0{color:var(--pure-0) !important}.text-primary-default{color:var(--color-primary-default) !important}.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-support-01) !important}.text-nowrap{white-space:nowrap !important}.text-base{font-size:var(--font-size-scale-base) !important}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear, left top, left bottom, from(var(--status-highlight-overlay)), to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}:host{margin:var(--spacing-scale-base)}";
2464
+ const BrIconStyle0 = iconCss;
2465
+
2466
+ const Icon = class {
2467
+ constructor(hostRef) {
2468
+ index.registerInstance(this, hostRef);
2469
+ this.inheritedAttributes = {};
2470
+ this.iconName = undefined;
2471
+ this.height = '16';
2472
+ this.width = '24';
2473
+ this.cssClasses = undefined;
2474
+ this.isInline = false;
2475
+ this.rotate = undefined;
2476
+ this.flip = undefined;
2477
+ }
2478
+ componentWillLoad() {
2479
+ this.inheritedAttributes = inheritedAttributes.inheritAriaAttributes(this.el);
2480
+ }
2481
+ render() {
2482
+ return (index.h(index.Host, { key: '4e061bbb7aabb1fa8820a44cfa570e3372ec6d1b' }, index.h("iconify-icon", Object.assign({ key: '14ea56661308b88bbc72c280facae0963b18cd30', flip: this.flip, width: this.width, class: this.cssClasses, icon: this.iconName, inline: this.isInline, height: this.height, rotate: this.rotate }, this.inheritedAttributes))));
2483
+ }
2484
+ get el() { return index.getElement(this); }
2485
+ };
2486
+ Icon.style = BrIconStyle0;
2487
+
2488
+ exports.br_button = Button;
2489
+ exports.br_icon = Icon;
2490
+
2491
+ //# sourceMappingURL=br-button_2.cjs.entry.js.map