@govbr-ds/webcomponents 2.0.0-next.22 → 2.0.0-next.24

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