@dso-toolkit/core 47.0.1 → 48.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/cjs/dso-accordion-section.cjs.entry.js +1447 -58
  2. package/dist/cjs/dso-autosuggest.cjs.entry.js +57 -47
  3. package/dist/cjs/dso-date-picker.cjs.entry.js +3 -2
  4. package/dist/cjs/dso-dropdown-menu.cjs.entry.js +2 -2
  5. package/dist/cjs/dso-helpcenter-panel.cjs.entry.js +1 -1
  6. package/dist/cjs/dso-image-overlay.cjs.entry.js +1 -1
  7. package/dist/cjs/dso-info_2.cjs.entry.js +2 -2
  8. package/dist/cjs/dso-label.cjs.entry.js +2 -2
  9. package/dist/cjs/dso-modal.cjs.entry.js +4 -7
  10. package/dist/cjs/dso-ozon-content.cjs.entry.js +3 -3
  11. package/dist/cjs/dso-table.cjs.entry.js +3 -5
  12. package/dist/cjs/dso-toggletip.cjs.entry.js +1 -1
  13. package/dist/cjs/dso-toolkit.cjs.js +2 -2
  14. package/dist/cjs/dso-tooltip.cjs.entry.js +13 -21
  15. package/dist/cjs/dso-viewer-grid.cjs.entry.js +8 -3
  16. package/dist/cjs/{focus-trap.esm-d83fd673.js → focus-trap.esm-c501d382.js} +82 -155
  17. package/dist/cjs/loader.cjs.js +2 -2
  18. package/dist/collection/collection-manifest.json +8 -8
  19. package/dist/collection/components/accordion/components/accordion-section.css +27 -4
  20. package/dist/collection/components/accordion/components/accordion-section.interfaces.js +6 -0
  21. package/dist/collection/components/accordion/components/accordion-section.js +91 -59
  22. package/dist/collection/components/accordion/components/handles/element.handle.js +7 -0
  23. package/dist/collection/components/accordion/components/handles/heading.handle.js +14 -0
  24. package/dist/collection/components/accordion/components/handles/icon.handle.js +13 -0
  25. package/dist/collection/components/accordion/components/handles/index.js +4 -0
  26. package/dist/collection/components/accordion/components/handles/state-icon.handle.js +15 -0
  27. package/dist/collection/components/autosuggest/autosuggest.interfaces.js +1 -0
  28. package/dist/collection/components/autosuggest/autosuggest.js +61 -49
  29. package/dist/collection/components/banner/banner.js +1 -1
  30. package/dist/collection/components/card-container/card-container.js +1 -1
  31. package/dist/collection/components/date-picker/date-picker.interfaces.js +1 -0
  32. package/dist/collection/components/date-picker/date-picker.js +19 -11
  33. package/dist/collection/components/dropdown-menu/dropdown-menu.js +2 -2
  34. package/dist/collection/components/header/header.js +2 -6
  35. package/dist/collection/components/info-button/info-button.interfaces.js +1 -0
  36. package/dist/collection/components/info-button/info-button.js +2 -1
  37. package/dist/collection/components/label/label.js +2 -2
  38. package/dist/collection/components/modal/modal.css +103 -75
  39. package/dist/collection/components/modal/modal.interfaces.js +1 -0
  40. package/dist/collection/components/modal/modal.js +5 -7
  41. package/dist/collection/components/ozon-content/nodes/noot.node.js +1 -1
  42. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +1 -1
  43. package/dist/collection/components/progress-indicator/progress-indicator.js +1 -1
  44. package/dist/collection/components/selectable/selectable.css +18 -1
  45. package/dist/collection/components/selectable/selectable.interfaces.js +1 -0
  46. package/dist/collection/components/selectable/selectable.js +3 -2
  47. package/dist/collection/components/table/table.css +49 -16
  48. package/dist/collection/components/table/table.js +2 -4
  49. package/dist/collection/components/toggletip/toggletip.js +1 -1
  50. package/dist/collection/components/tooltip/tooltip.js +13 -42
  51. package/dist/collection/components/tree-view/tree-view.js +8 -2
  52. package/dist/collection/components/viewer-grid/viewer-grid.interfaces.js +1 -0
  53. package/dist/collection/components/viewer-grid/viewer-grid.js +19 -11
  54. package/dist/collection/index.js +13 -0
  55. package/dist/components/clsx.m.js +3 -0
  56. package/dist/components/create-identifier.js +15 -0
  57. package/dist/components/dropdown-menu.js +151 -0
  58. package/dist/components/dso-accordion-section.d.ts +11 -0
  59. package/dist/components/dso-accordion-section.js +1535 -0
  60. package/dist/components/dso-accordion.d.ts +11 -0
  61. package/dist/components/dso-accordion.js +316 -0
  62. package/dist/components/dso-alert.d.ts +11 -0
  63. package/dist/components/dso-alert.js +55 -0
  64. package/dist/components/dso-attachments-counter.d.ts +11 -0
  65. package/dist/components/dso-attachments-counter.js +42 -0
  66. package/dist/components/dso-autosuggest.d.ts +11 -0
  67. package/dist/components/dso-autosuggest.js +309 -0
  68. package/dist/components/dso-badge.d.ts +11 -0
  69. package/dist/components/dso-badge.js +37 -0
  70. package/dist/components/dso-banner.d.ts +11 -0
  71. package/dist/components/dso-banner.js +37 -0
  72. package/dist/components/dso-card-container.d.ts +11 -0
  73. package/dist/components/dso-card-container.js +36 -0
  74. package/dist/components/dso-card.d.ts +11 -0
  75. package/dist/components/dso-card.js +66 -0
  76. package/dist/components/dso-date-picker.d.ts +11 -0
  77. package/dist/components/dso-date-picker.js +682 -0
  78. package/dist/components/dso-dropdown-menu.d.ts +11 -0
  79. package/dist/components/dso-dropdown-menu.js +6 -0
  80. package/dist/components/dso-header.d.ts +11 -0
  81. package/dist/components/dso-header.js +159 -0
  82. package/dist/components/dso-helpcenter-panel.d.ts +11 -0
  83. package/dist/components/dso-helpcenter-panel.js +127 -0
  84. package/dist/components/dso-highlight-box.d.ts +11 -0
  85. package/dist/components/dso-highlight-box.js +55 -0
  86. package/dist/components/dso-icon.d.ts +11 -0
  87. package/dist/components/dso-icon.js +6 -0
  88. package/dist/components/dso-image-overlay.d.ts +11 -0
  89. package/dist/components/dso-image-overlay.js +129 -0
  90. package/dist/components/dso-info-button.d.ts +11 -0
  91. package/dist/components/dso-info-button.js +6 -0
  92. package/dist/components/dso-info.d.ts +11 -0
  93. package/dist/components/dso-info.js +6 -0
  94. package/dist/components/dso-label.d.ts +11 -0
  95. package/dist/components/dso-label.js +156 -0
  96. package/dist/components/dso-map-base-layers.d.ts +11 -0
  97. package/dist/components/dso-map-base-layers.js +80 -0
  98. package/dist/components/dso-map-controls.d.ts +11 -0
  99. package/dist/components/dso-map-controls.js +86 -0
  100. package/dist/components/dso-map-overlays.d.ts +11 -0
  101. package/dist/components/dso-map-overlays.js +81 -0
  102. package/dist/components/dso-modal.d.ts +11 -0
  103. package/dist/components/dso-modal.js +85 -0
  104. package/dist/components/dso-ozon-content.d.ts +11 -0
  105. package/dist/components/dso-ozon-content.js +507 -0
  106. package/dist/components/dso-pagination.d.ts +11 -0
  107. package/dist/components/dso-pagination.js +159 -0
  108. package/dist/components/dso-progress-bar.d.ts +11 -0
  109. package/dist/components/dso-progress-bar.js +42 -0
  110. package/dist/components/dso-progress-indicator.d.ts +11 -0
  111. package/dist/components/dso-progress-indicator.js +6 -0
  112. package/dist/components/dso-responsive-element.d.ts +11 -0
  113. package/dist/components/dso-responsive-element.js +6 -0
  114. package/dist/components/dso-selectable.d.ts +11 -0
  115. package/dist/components/dso-selectable.js +6 -0
  116. package/dist/components/dso-table.d.ts +11 -0
  117. package/dist/components/dso-table.js +111 -0
  118. package/dist/components/dso-toggletip.d.ts +11 -0
  119. package/dist/components/dso-toggletip.js +90 -0
  120. package/dist/components/dso-tooltip.d.ts +11 -0
  121. package/dist/components/dso-tooltip.js +6 -0
  122. package/dist/components/dso-tree-view.d.ts +11 -0
  123. package/dist/components/dso-tree-view.js +227 -0
  124. package/dist/components/dso-viewer-grid.d.ts +11 -0
  125. package/dist/components/dso-viewer-grid.js +171 -0
  126. package/dist/components/focus-trap.esm.js +688 -0
  127. package/dist/components/icon.js +663 -0
  128. package/dist/components/index.d.ts +55 -0
  129. package/dist/components/index.esm.js +458 -0
  130. package/dist/components/index.js +35 -0
  131. package/dist/components/index2.js +70 -0
  132. package/dist/components/info-button.js +56 -0
  133. package/dist/components/info.js +42 -0
  134. package/dist/components/is-modified-event.js +4 -0
  135. package/dist/components/progress-indicator.js +44 -0
  136. package/dist/components/responsive-element.js +67 -0
  137. package/dist/components/selectable.js +108 -0
  138. package/dist/components/tooltip.js +2047 -0
  139. package/dist/components/v4.js +66 -0
  140. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  141. package/dist/dso-toolkit/p-04ffcc93.entry.js +1 -0
  142. package/dist/dso-toolkit/{p-e0a37d82.entry.js → p-06b4f78d.entry.js} +1 -1
  143. package/dist/dso-toolkit/{p-2b83a825.entry.js → p-35687d62.entry.js} +1 -1
  144. package/dist/dso-toolkit/p-52bc72d0.entry.js +1 -0
  145. package/dist/dso-toolkit/p-57ceabab.js +5 -0
  146. package/dist/dso-toolkit/p-655eff47.entry.js +1 -0
  147. package/dist/dso-toolkit/p-672c8323.entry.js +1 -0
  148. package/dist/dso-toolkit/p-7f8be9bc.entry.js +1 -0
  149. package/dist/dso-toolkit/p-80575700.entry.js +1 -0
  150. package/dist/dso-toolkit/p-8e9f6355.entry.js +1 -0
  151. package/dist/dso-toolkit/p-a8cb2eae.entry.js +1 -0
  152. package/dist/dso-toolkit/p-d31805a9.entry.js +1 -0
  153. package/dist/dso-toolkit/{p-dcc74039.entry.js → p-d7b2adc3.entry.js} +1 -1
  154. package/dist/dso-toolkit/{p-800e1267.entry.js → p-daee3252.entry.js} +1 -1
  155. package/dist/dso-toolkit/p-ec5412aa.entry.js +1 -0
  156. package/dist/esm/dso-accordion-section.entry.js +1448 -59
  157. package/dist/esm/dso-autosuggest.entry.js +57 -47
  158. package/dist/esm/dso-date-picker.entry.js +3 -2
  159. package/dist/esm/dso-dropdown-menu.entry.js +2 -2
  160. package/dist/esm/dso-helpcenter-panel.entry.js +1 -1
  161. package/dist/esm/dso-image-overlay.entry.js +1 -1
  162. package/dist/esm/dso-info_2.entry.js +2 -2
  163. package/dist/esm/dso-label.entry.js +2 -2
  164. package/dist/esm/dso-modal.entry.js +5 -8
  165. package/dist/esm/dso-ozon-content.entry.js +3 -3
  166. package/dist/esm/dso-table.entry.js +3 -5
  167. package/dist/esm/dso-toggletip.entry.js +1 -1
  168. package/dist/esm/dso-toolkit.js +2 -2
  169. package/dist/esm/dso-tooltip.entry.js +13 -21
  170. package/dist/esm/dso-viewer-grid.entry.js +8 -3
  171. package/dist/esm/{focus-trap.esm-33203b60.js → focus-trap.esm-94794d92.js} +82 -155
  172. package/dist/esm/loader.js +2 -2
  173. package/dist/types/components/accordion/accordion.interfaces.d.ts +0 -2
  174. package/dist/types/components/accordion/components/accordion-section.d.ts +10 -1
  175. package/dist/types/components/accordion/components/accordion-section.interfaces.d.ts +3 -0
  176. package/dist/types/components/accordion/components/handles/element.handle.d.ts +6 -0
  177. package/dist/types/components/accordion/components/handles/heading.handle.d.ts +5 -0
  178. package/dist/types/components/accordion/components/handles/icon.handle.d.ts +7 -0
  179. package/dist/types/components/accordion/components/handles/index.d.ts +4 -0
  180. package/dist/types/components/accordion/components/handles/state-icon.handle.d.ts +5 -0
  181. package/dist/types/components/autosuggest/autosuggest.d.ts +2 -15
  182. package/dist/types/components/autosuggest/autosuggest.interfaces.d.ts +14 -0
  183. package/dist/types/components/date-picker/date-picker.d.ts +2 -15
  184. package/dist/types/components/date-picker/date-picker.interfaces.d.ts +14 -0
  185. package/dist/types/components/dropdown-menu/dropdown-menu.d.ts +1 -1
  186. package/dist/types/components/header/header.d.ts +2 -2
  187. package/dist/types/components/header/header.interfaces.d.ts +1 -0
  188. package/dist/types/components/info-button/info-button.d.ts +1 -4
  189. package/dist/types/components/info-button/info-button.interfaces.d.ts +4 -0
  190. package/dist/types/components/map-overlays/map-overlays.d.ts +1 -1
  191. package/dist/types/components/modal/modal.d.ts +2 -4
  192. package/dist/types/components/modal/modal.interfaces.d.ts +3 -0
  193. package/dist/types/components/selectable/selectable.d.ts +1 -2
  194. package/dist/types/components/selectable/selectable.interfaces.d.ts +2 -0
  195. package/dist/types/components/table/table.d.ts +1 -1
  196. package/dist/types/components/tooltip/tooltip.d.ts +0 -8
  197. package/dist/types/components/tree-view/tree-view.d.ts +2 -2
  198. package/dist/types/components/viewer-grid/viewer-grid.d.ts +5 -16
  199. package/dist/types/components/viewer-grid/viewer-grid.interfaces.d.ts +15 -0
  200. package/dist/types/components.d.ts +20 -26
  201. package/dist/types/index.d.ts +13 -0
  202. package/package.json +8 -8
  203. package/dist/custom-elements/index.d.ts +0 -243
  204. package/dist/custom-elements/index.js +0 -7555
  205. package/dist/dso-toolkit/p-0917f18a.entry.js +0 -1
  206. package/dist/dso-toolkit/p-0c8cd0d8.entry.js +0 -1
  207. package/dist/dso-toolkit/p-203fc66c.entry.js +0 -1
  208. package/dist/dso-toolkit/p-3ab4441a.entry.js +0 -1
  209. package/dist/dso-toolkit/p-44c0bb3e.entry.js +0 -1
  210. package/dist/dso-toolkit/p-89d262b7.js +0 -5
  211. package/dist/dso-toolkit/p-9aa3fa9d.entry.js +0 -1
  212. package/dist/dso-toolkit/p-ba253bcd.entry.js +0 -1
  213. package/dist/dso-toolkit/p-e43e39cf.entry.js +0 -1
  214. package/dist/dso-toolkit/p-e8b22546.entry.js +0 -1
  215. package/dist/dso-toolkit/p-f93b7c7a.entry.js +0 -1
@@ -3,8 +3,1372 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-ecec64a0.js');
6
+ const index$1 = require('./index-794ad37a.js');
6
7
 
7
- const accordionSectionCss = "*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}:host{display:block}:host .dso-section-handle{font-size:1em;font-weight:600;line-height:1.375em;margin:0;position:relative}:host .dso-section-handle>a:active{text-decoration:none}:host .dso-section-handle a{text-decoration:none}:host .dso-section-handle a:hover,:host .dso-section-handle a:focus{text-decoration:none}:host .dso-section-handle a:active{text-decoration:underline}:host .dso-section-handle .dso-status{font-weight:400;text-decoration:underline}:host .dso-section-handle>button,:host .dso-section-handle>a{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;font-family:Asap, sans-serif;font-size:1em;font-weight:600;line-height:1.375em;margin:0;padding:12px 16px 12px;text-align:start;width:100%;word-break:break-word}:host .dso-section-handle>button dso-icon,:host .dso-section-handle>a dso-icon{flex-shrink:0}:host .dso-section-handle>button>.dso-section-handle-addons:first-child,:host .dso-section-handle>button>dso-icon:first-child,:host .dso-section-handle>a>.dso-section-handle-addons:first-child,:host .dso-section-handle>a>dso-icon:first-child{margin-right:8px}:host .dso-section-handle>button>dso-icon:last-child,:host .dso-section-handle>a>dso-icon:last-child{margin-left:auto}:host .dso-section-handle>button>.dso-section-handle-addons:last-child,:host .dso-section-handle>a>.dso-section-handle-addons:last-child{margin-left:auto}:host .dso-section-handle>button>.dso-section-handle-addons:last-child dso-icon,:host .dso-section-handle>a>.dso-section-handle-addons:last-child dso-icon{margin-left:16px}:host(:not([open])) .dso-section-body{display:none}.dso-section-body{background-color:#fff;border-top:0;margin-top:-4px;padding:20px 16px 16px}:host(.dso-accordion-default) .dso-section-handle{background-color:#fff;border:1px solid #8b4a6a;border-radius:4px}:host(.dso-accordion-default) .dso-section-handle a,:host(.dso-accordion-default) .dso-section-handle button{color:#8b4a6a}:host(.dso-accordion-default) .dso-section-handle a:hover,:host(.dso-accordion-default) .dso-section-handle a:active,:host(.dso-accordion-default) .dso-section-handle a.active,:host(.dso-accordion-default) .dso-section-handle button:hover,:host(.dso-accordion-default) .dso-section-handle button:active,:host(.dso-accordion-default) .dso-section-handle button.active{color:#8b4a6a}:host(.dso-accordion-default) .dso-section-body{border:1px solid #8b4a6a;border-radius:0 0 4px 4px}:host(.dso-accordion-default[open])>.dso-section-handle{background-color:#8b4a6a;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}:host(.dso-accordion-default[open])>.dso-section-handle a,:host(.dso-accordion-default[open])>.dso-section-handle button{color:#fff}:host(.dso-accordion-default[open])>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-default[open])>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#fff;--dso-icon:var(--di-paperclip-wit)}:host(.dso-accordion-default.dso-nested-accordion[open]) .dso-section-body{background-color:#e5e5e5}:host(.dso-accordion-compact) .dso-section-handle{border-bottom:1px solid transparent;border-top:1px solid #ccc}:host(.dso-accordion-compact) .dso-section-handle a,:host(.dso-accordion-compact) .dso-section-handle button{color:#39870c;padding-bottom:11px;padding-left:0;padding-top:11px}:host(.dso-accordion-compact) .dso-section-handle a:hover,:host(.dso-accordion-compact) .dso-section-handle a:active,:host(.dso-accordion-compact) .dso-section-handle a.active,:host(.dso-accordion-compact) .dso-section-handle button:hover,:host(.dso-accordion-compact) .dso-section-handle button:active,:host(.dso-accordion-compact) .dso-section-handle button.active{color:#39870c}:host(.dso-accordion-compact) .dso-section-body{padding-left:32px;padding-top:0;padding-right:0}:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-handle a,:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-handle button{padding-left:16px}:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-body{padding-left:16px;padding-right:0}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle{background-color:transparent}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button{color:#39870c}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a:hover,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a:active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a.active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button:hover,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button:active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button.active{color:#39870c}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#666;--dso-icon:var(--di-paperclip-grijs)}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-body{border-top:0}:host(.dso-accordion-compact.dso-nested-accordion[open])>.dso-section-body{padding-bottom:0}:host(.dso-accordion-compact.dso-nested-accordion[open])>.dso-section-body dso-accordion-section:last-child{border-bottom:0}:host(.dso-accordion-conclusion) .dso-section-handle{background-color:#f2f2f2;border:1px solid #f2f2f2}:host(.dso-accordion-conclusion) .dso-section-handle a,:host(.dso-accordion-conclusion) .dso-section-handle button{color:#191919}:host(.dso-accordion-conclusion) .dso-section-handle a:hover,:host(.dso-accordion-conclusion) .dso-section-handle a:active,:host(.dso-accordion-conclusion) .dso-section-handle a.active,:host(.dso-accordion-conclusion) .dso-section-handle button:hover,:host(.dso-accordion-conclusion) .dso-section-handle button:active,:host(.dso-accordion-conclusion) .dso-section-handle button.active{background-color:#e5e5e5;color:#191919}:host(.dso-accordion-conclusion) .dso-section-body{border:2px solid #f2f2f2}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle{background-color:#f2f2f2}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle a,:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle button{color:#191919}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#666;--dso-icon:var(--di-paperclip-grijs)}:host(.dso-accordion-conclusion.dso-nested-accordion[open]){background-color:#fff}";
8
+ /*
9
+ * anime.js v3.2.1
10
+ * (c) 2020 Julian Garnier
11
+ * Released under the MIT license
12
+ * animejs.com
13
+ */
14
+
15
+ // Defaults
16
+
17
+ var defaultInstanceSettings = {
18
+ update: null,
19
+ begin: null,
20
+ loopBegin: null,
21
+ changeBegin: null,
22
+ change: null,
23
+ changeComplete: null,
24
+ loopComplete: null,
25
+ complete: null,
26
+ loop: 1,
27
+ direction: 'normal',
28
+ autoplay: true,
29
+ timelineOffset: 0
30
+ };
31
+
32
+ var defaultTweenSettings = {
33
+ duration: 1000,
34
+ delay: 0,
35
+ endDelay: 0,
36
+ easing: 'easeOutElastic(1, .5)',
37
+ round: 0
38
+ };
39
+
40
+ var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d'];
41
+
42
+ // Caching
43
+
44
+ var cache = {
45
+ CSS: {},
46
+ springs: {}
47
+ };
48
+
49
+ // Utils
50
+
51
+ function minMax(val, min, max) {
52
+ return Math.min(Math.max(val, min), max);
53
+ }
54
+
55
+ function stringContains(str, text) {
56
+ return str.indexOf(text) > -1;
57
+ }
58
+
59
+ function applyArguments(func, args) {
60
+ return func.apply(null, args);
61
+ }
62
+
63
+ var is = {
64
+ arr: function (a) { return Array.isArray(a); },
65
+ obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },
66
+ pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },
67
+ svg: function (a) { return a instanceof SVGElement; },
68
+ inp: function (a) { return a instanceof HTMLInputElement; },
69
+ dom: function (a) { return a.nodeType || is.svg(a); },
70
+ str: function (a) { return typeof a === 'string'; },
71
+ fnc: function (a) { return typeof a === 'function'; },
72
+ und: function (a) { return typeof a === 'undefined'; },
73
+ nil: function (a) { return is.und(a) || a === null; },
74
+ hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); },
75
+ rgb: function (a) { return /^rgb/.test(a); },
76
+ hsl: function (a) { return /^hsl/.test(a); },
77
+ col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },
78
+ key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; },
79
+ };
80
+
81
+ // Easings
82
+
83
+ function parseEasingParameters(string) {
84
+ var match = /\(([^)]+)\)/.exec(string);
85
+ return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];
86
+ }
87
+
88
+ // Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js
89
+
90
+ function spring(string, duration) {
91
+
92
+ var params = parseEasingParameters(string);
93
+ var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);
94
+ var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);
95
+ var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);
96
+ var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);
97
+ var w0 = Math.sqrt(stiffness / mass);
98
+ var zeta = damping / (2 * Math.sqrt(stiffness * mass));
99
+ var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
100
+ var a = 1;
101
+ var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
102
+
103
+ function solver(t) {
104
+ var progress = duration ? (duration * t) / 1000 : t;
105
+ if (zeta < 1) {
106
+ progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));
107
+ } else {
108
+ progress = (a + b * progress) * Math.exp(-progress * w0);
109
+ }
110
+ if (t === 0 || t === 1) { return t; }
111
+ return 1 - progress;
112
+ }
113
+
114
+ function getDuration() {
115
+ var cached = cache.springs[string];
116
+ if (cached) { return cached; }
117
+ var frame = 1/6;
118
+ var elapsed = 0;
119
+ var rest = 0;
120
+ while(true) {
121
+ elapsed += frame;
122
+ if (solver(elapsed) === 1) {
123
+ rest++;
124
+ if (rest >= 16) { break; }
125
+ } else {
126
+ rest = 0;
127
+ }
128
+ }
129
+ var duration = elapsed * frame * 1000;
130
+ cache.springs[string] = duration;
131
+ return duration;
132
+ }
133
+
134
+ return duration ? solver : getDuration;
135
+
136
+ }
137
+
138
+ // Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
139
+
140
+ function steps(steps) {
141
+ if ( steps === void 0 ) steps = 10;
142
+
143
+ return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); };
144
+ }
145
+
146
+ // BezierEasing https://github.com/gre/bezier-easing
147
+
148
+ var bezier = (function () {
149
+
150
+ var kSplineTableSize = 11;
151
+ var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
152
+
153
+ function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }
154
+ function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }
155
+ function C(aA1) { return 3.0 * aA1 }
156
+
157
+ function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }
158
+ function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }
159
+
160
+ function binarySubdivide(aX, aA, aB, mX1, mX2) {
161
+ var currentX, currentT, i = 0;
162
+ do {
163
+ currentT = aA + (aB - aA) / 2.0;
164
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
165
+ if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }
166
+ } while (Math.abs(currentX) > 0.0000001 && ++i < 10);
167
+ return currentT;
168
+ }
169
+
170
+ function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
171
+ for (var i = 0; i < 4; ++i) {
172
+ var currentSlope = getSlope(aGuessT, mX1, mX2);
173
+ if (currentSlope === 0.0) { return aGuessT; }
174
+ var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
175
+ aGuessT -= currentX / currentSlope;
176
+ }
177
+ return aGuessT;
178
+ }
179
+
180
+ function bezier(mX1, mY1, mX2, mY2) {
181
+
182
+ if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }
183
+ var sampleValues = new Float32Array(kSplineTableSize);
184
+
185
+ if (mX1 !== mY1 || mX2 !== mY2) {
186
+ for (var i = 0; i < kSplineTableSize; ++i) {
187
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
188
+ }
189
+ }
190
+
191
+ function getTForX(aX) {
192
+
193
+ var intervalStart = 0;
194
+ var currentSample = 1;
195
+ var lastSample = kSplineTableSize - 1;
196
+
197
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
198
+ intervalStart += kSampleStepSize;
199
+ }
200
+
201
+ --currentSample;
202
+
203
+ var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
204
+ var guessForT = intervalStart + dist * kSampleStepSize;
205
+ var initialSlope = getSlope(guessForT, mX1, mX2);
206
+
207
+ if (initialSlope >= 0.001) {
208
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
209
+ } else if (initialSlope === 0.0) {
210
+ return guessForT;
211
+ } else {
212
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
213
+ }
214
+
215
+ }
216
+
217
+ return function (x) {
218
+ if (mX1 === mY1 && mX2 === mY2) { return x; }
219
+ if (x === 0 || x === 1) { return x; }
220
+ return calcBezier(getTForX(x), mY1, mY2);
221
+ }
222
+
223
+ }
224
+
225
+ return bezier;
226
+
227
+ })();
228
+
229
+ var penner = (function () {
230
+
231
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
232
+
233
+ var eases = { linear: function () { return function (t) { return t; }; } };
234
+
235
+ var functionEasings = {
236
+ Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
237
+ Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
238
+ Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
239
+ Bounce: function () { return function (t) {
240
+ var pow2, b = 4;
241
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
242
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
243
+ }; },
244
+ Elastic: function (amplitude, period) {
245
+ if ( amplitude === void 0 ) amplitude = 1;
246
+ if ( period === void 0 ) period = .5;
247
+
248
+ var a = minMax(amplitude, 1, 10);
249
+ var p = minMax(period, .1, 2);
250
+ return function (t) {
251
+ return (t === 0 || t === 1) ? t :
252
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
253
+ }
254
+ }
255
+ };
256
+
257
+ var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
258
+
259
+ baseEasings.forEach(function (name, i) {
260
+ functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
261
+ });
262
+
263
+ Object.keys(functionEasings).forEach(function (name) {
264
+ var easeIn = functionEasings[name];
265
+ eases['easeIn' + name] = easeIn;
266
+ eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
267
+ eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
268
+ 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
269
+ eases['easeOutIn' + name] = function (a, b) { return function (t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 :
270
+ (easeIn(a, b)(t * 2 - 1) + 1) / 2; }; };
271
+ });
272
+
273
+ return eases;
274
+
275
+ })();
276
+
277
+ function parseEasings(easing, duration) {
278
+ if (is.fnc(easing)) { return easing; }
279
+ var name = easing.split('(')[0];
280
+ var ease = penner[name];
281
+ var args = parseEasingParameters(easing);
282
+ switch (name) {
283
+ case 'spring' : return spring(easing, duration);
284
+ case 'cubicBezier' : return applyArguments(bezier, args);
285
+ case 'steps' : return applyArguments(steps, args);
286
+ default : return applyArguments(ease, args);
287
+ }
288
+ }
289
+
290
+ // Strings
291
+
292
+ function selectString(str) {
293
+ try {
294
+ var nodes = document.querySelectorAll(str);
295
+ return nodes;
296
+ } catch(e) {
297
+ return;
298
+ }
299
+ }
300
+
301
+ // Arrays
302
+
303
+ function filterArray(arr, callback) {
304
+ var len = arr.length;
305
+ var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
306
+ var result = [];
307
+ for (var i = 0; i < len; i++) {
308
+ if (i in arr) {
309
+ var val = arr[i];
310
+ if (callback.call(thisArg, val, i, arr)) {
311
+ result.push(val);
312
+ }
313
+ }
314
+ }
315
+ return result;
316
+ }
317
+
318
+ function flattenArray(arr) {
319
+ return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []);
320
+ }
321
+
322
+ function toArray(o) {
323
+ if (is.arr(o)) { return o; }
324
+ if (is.str(o)) { o = selectString(o) || o; }
325
+ if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }
326
+ return [o];
327
+ }
328
+
329
+ function arrayContains(arr, val) {
330
+ return arr.some(function (a) { return a === val; });
331
+ }
332
+
333
+ // Objects
334
+
335
+ function cloneObject(o) {
336
+ var clone = {};
337
+ for (var p in o) { clone[p] = o[p]; }
338
+ return clone;
339
+ }
340
+
341
+ function replaceObjectProps(o1, o2) {
342
+ var o = cloneObject(o1);
343
+ for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }
344
+ return o;
345
+ }
346
+
347
+ function mergeObjects(o1, o2) {
348
+ var o = cloneObject(o1);
349
+ for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }
350
+ return o;
351
+ }
352
+
353
+ // Colors
354
+
355
+ function rgbToRgba(rgbValue) {
356
+ var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue);
357
+ return rgb ? ("rgba(" + (rgb[1]) + ",1)") : rgbValue;
358
+ }
359
+
360
+ function hexToRgba(hexValue) {
361
+ var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
362
+ var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } );
363
+ var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
364
+ var r = parseInt(rgb[1], 16);
365
+ var g = parseInt(rgb[2], 16);
366
+ var b = parseInt(rgb[3], 16);
367
+ return ("rgba(" + r + "," + g + "," + b + ",1)");
368
+ }
369
+
370
+ function hslToRgba(hslValue) {
371
+ var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue);
372
+ var h = parseInt(hsl[1], 10) / 360;
373
+ var s = parseInt(hsl[2], 10) / 100;
374
+ var l = parseInt(hsl[3], 10) / 100;
375
+ var a = hsl[4] || 1;
376
+ function hue2rgb(p, q, t) {
377
+ if (t < 0) { t += 1; }
378
+ if (t > 1) { t -= 1; }
379
+ if (t < 1/6) { return p + (q - p) * 6 * t; }
380
+ if (t < 1/2) { return q; }
381
+ if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }
382
+ return p;
383
+ }
384
+ var r, g, b;
385
+ if (s == 0) {
386
+ r = g = b = l;
387
+ } else {
388
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
389
+ var p = 2 * l - q;
390
+ r = hue2rgb(p, q, h + 1/3);
391
+ g = hue2rgb(p, q, h);
392
+ b = hue2rgb(p, q, h - 1/3);
393
+ }
394
+ return ("rgba(" + (r * 255) + "," + (g * 255) + "," + (b * 255) + "," + a + ")");
395
+ }
396
+
397
+ function colorToRgb(val) {
398
+ if (is.rgb(val)) { return rgbToRgba(val); }
399
+ if (is.hex(val)) { return hexToRgba(val); }
400
+ if (is.hsl(val)) { return hslToRgba(val); }
401
+ }
402
+
403
+ // Units
404
+
405
+ function getUnit(val) {
406
+ var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);
407
+ if (split) { return split[1]; }
408
+ }
409
+
410
+ function getTransformUnit(propName) {
411
+ if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }
412
+ if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }
413
+ }
414
+
415
+ // Values
416
+
417
+ function getFunctionValue(val, animatable) {
418
+ if (!is.fnc(val)) { return val; }
419
+ return val(animatable.target, animatable.id, animatable.total);
420
+ }
421
+
422
+ function getAttribute(el, prop) {
423
+ return el.getAttribute(prop);
424
+ }
425
+
426
+ function convertPxToUnit(el, value, unit) {
427
+ var valueUnit = getUnit(value);
428
+ if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }
429
+ var cached = cache.CSS[value + unit];
430
+ if (!is.und(cached)) { return cached; }
431
+ var baseline = 100;
432
+ var tempEl = document.createElement(el.tagName);
433
+ var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;
434
+ parentEl.appendChild(tempEl);
435
+ tempEl.style.position = 'absolute';
436
+ tempEl.style.width = baseline + unit;
437
+ var factor = baseline / tempEl.offsetWidth;
438
+ parentEl.removeChild(tempEl);
439
+ var convertedUnit = factor * parseFloat(value);
440
+ cache.CSS[value + unit] = convertedUnit;
441
+ return convertedUnit;
442
+ }
443
+
444
+ function getCSSValue(el, prop, unit) {
445
+ if (prop in el.style) {
446
+ var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
447
+ var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';
448
+ return unit ? convertPxToUnit(el, value, unit) : value;
449
+ }
450
+ }
451
+
452
+ function getAnimationType(el, prop) {
453
+ if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || (is.svg(el) && el[prop]))) { return 'attribute'; }
454
+ if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }
455
+ if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }
456
+ if (el[prop] != null) { return 'object'; }
457
+ }
458
+
459
+ function getElementTransforms(el) {
460
+ if (!is.dom(el)) { return; }
461
+ var str = el.style.transform || '';
462
+ var reg = /(\w+)\(([^)]*)\)/g;
463
+ var transforms = new Map();
464
+ var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); }
465
+ return transforms;
466
+ }
467
+
468
+ function getTransformValue(el, propName, animatable, unit) {
469
+ var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);
470
+ var value = getElementTransforms(el).get(propName) || defaultVal;
471
+ if (animatable) {
472
+ animatable.transforms.list.set(propName, value);
473
+ animatable.transforms['last'] = propName;
474
+ }
475
+ return unit ? convertPxToUnit(el, value, unit) : value;
476
+ }
477
+
478
+ function getOriginalTargetValue(target, propName, unit, animatable) {
479
+ switch (getAnimationType(target, propName)) {
480
+ case 'transform': return getTransformValue(target, propName, animatable, unit);
481
+ case 'css': return getCSSValue(target, propName, unit);
482
+ case 'attribute': return getAttribute(target, propName);
483
+ default: return target[propName] || 0;
484
+ }
485
+ }
486
+
487
+ function getRelativeValue(to, from) {
488
+ var operator = /^(\*=|\+=|-=)/.exec(to);
489
+ if (!operator) { return to; }
490
+ var u = getUnit(to) || 0;
491
+ var x = parseFloat(from);
492
+ var y = parseFloat(to.replace(operator[0], ''));
493
+ switch (operator[0][0]) {
494
+ case '+': return x + y + u;
495
+ case '-': return x - y + u;
496
+ case '*': return x * y + u;
497
+ }
498
+ }
499
+
500
+ function validateValue(val, unit) {
501
+ if (is.col(val)) { return colorToRgb(val); }
502
+ if (/\s/g.test(val)) { return val; }
503
+ var originalUnit = getUnit(val);
504
+ var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;
505
+ if (unit) { return unitLess + unit; }
506
+ return unitLess;
507
+ }
508
+
509
+ // getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes
510
+ // adapted from https://gist.github.com/SebLambla/3e0550c496c236709744
511
+
512
+ function getDistance(p1, p2) {
513
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
514
+ }
515
+
516
+ function getCircleLength(el) {
517
+ return Math.PI * 2 * getAttribute(el, 'r');
518
+ }
519
+
520
+ function getRectLength(el) {
521
+ return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);
522
+ }
523
+
524
+ function getLineLength(el) {
525
+ return getDistance(
526
+ {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
527
+ {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
528
+ );
529
+ }
530
+
531
+ function getPolylineLength(el) {
532
+ var points = el.points;
533
+ var totalLength = 0;
534
+ var previousPos;
535
+ for (var i = 0 ; i < points.numberOfItems; i++) {
536
+ var currentPos = points.getItem(i);
537
+ if (i > 0) { totalLength += getDistance(previousPos, currentPos); }
538
+ previousPos = currentPos;
539
+ }
540
+ return totalLength;
541
+ }
542
+
543
+ function getPolygonLength(el) {
544
+ var points = el.points;
545
+ return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));
546
+ }
547
+
548
+ // Path animation
549
+
550
+ function getTotalLength(el) {
551
+ if (el.getTotalLength) { return el.getTotalLength(); }
552
+ switch(el.tagName.toLowerCase()) {
553
+ case 'circle': return getCircleLength(el);
554
+ case 'rect': return getRectLength(el);
555
+ case 'line': return getLineLength(el);
556
+ case 'polyline': return getPolylineLength(el);
557
+ case 'polygon': return getPolygonLength(el);
558
+ }
559
+ }
560
+
561
+ function setDashoffset(el) {
562
+ var pathLength = getTotalLength(el);
563
+ el.setAttribute('stroke-dasharray', pathLength);
564
+ return pathLength;
565
+ }
566
+
567
+ // Motion path
568
+
569
+ function getParentSvgEl(el) {
570
+ var parentEl = el.parentNode;
571
+ while (is.svg(parentEl)) {
572
+ if (!is.svg(parentEl.parentNode)) { break; }
573
+ parentEl = parentEl.parentNode;
574
+ }
575
+ return parentEl;
576
+ }
577
+
578
+ function getParentSvg(pathEl, svgData) {
579
+ var svg = svgData || {};
580
+ var parentSvgEl = svg.el || getParentSvgEl(pathEl);
581
+ var rect = parentSvgEl.getBoundingClientRect();
582
+ var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');
583
+ var width = rect.width;
584
+ var height = rect.height;
585
+ var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);
586
+ return {
587
+ el: parentSvgEl,
588
+ viewBox: viewBox,
589
+ x: viewBox[0] / 1,
590
+ y: viewBox[1] / 1,
591
+ w: width,
592
+ h: height,
593
+ vW: viewBox[2],
594
+ vH: viewBox[3]
595
+ }
596
+ }
597
+
598
+ function getPath(path, percent) {
599
+ var pathEl = is.str(path) ? selectString(path)[0] : path;
600
+ var p = percent || 100;
601
+ return function(property) {
602
+ return {
603
+ property: property,
604
+ el: pathEl,
605
+ svg: getParentSvg(pathEl),
606
+ totalLength: getTotalLength(pathEl) * (p / 100)
607
+ }
608
+ }
609
+ }
610
+
611
+ function getPathProgress(path, progress, isPathTargetInsideSVG) {
612
+ function point(offset) {
613
+ if ( offset === void 0 ) offset = 0;
614
+
615
+ var l = progress + offset >= 1 ? progress + offset : 0;
616
+ return path.el.getPointAtLength(l);
617
+ }
618
+ var svg = getParentSvg(path.el, path.svg);
619
+ var p = point();
620
+ var p0 = point(-1);
621
+ var p1 = point(+1);
622
+ var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW;
623
+ var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH;
624
+ switch (path.property) {
625
+ case 'x': return (p.x - svg.x) * scaleX;
626
+ case 'y': return (p.y - svg.y) * scaleY;
627
+ case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
628
+ }
629
+ }
630
+
631
+ // Decompose value
632
+
633
+ function decomposeValue(val, unit) {
634
+ // const rgx = /-?\d*\.?\d+/g; // handles basic numbers
635
+ // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
636
+ var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
637
+ var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';
638
+ return {
639
+ original: value,
640
+ numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],
641
+ strings: (is.str(val) || unit) ? value.split(rgx) : []
642
+ }
643
+ }
644
+
645
+ // Animatables
646
+
647
+ function parseTargets(targets) {
648
+ var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];
649
+ return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });
650
+ }
651
+
652
+ function getAnimatables(targets) {
653
+ var parsed = parseTargets(targets);
654
+ return parsed.map(function (t, i) {
655
+ return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };
656
+ });
657
+ }
658
+
659
+ // Properties
660
+
661
+ function normalizePropertyTweens(prop, tweenSettings) {
662
+ var settings = cloneObject(tweenSettings);
663
+ // Override duration if easing is a spring
664
+ if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); }
665
+ if (is.arr(prop)) {
666
+ var l = prop.length;
667
+ var isFromTo = (l === 2 && !is.obj(prop[0]));
668
+ if (!isFromTo) {
669
+ // Duration divided by the number of tweens
670
+ if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }
671
+ } else {
672
+ // Transform [from, to] values shorthand to a valid tween value
673
+ prop = {value: prop};
674
+ }
675
+ }
676
+ var propArray = is.arr(prop) ? prop : [prop];
677
+ return propArray.map(function (v, i) {
678
+ var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};
679
+ // Default delay value should only be applied to the first tween
680
+ if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }
681
+ // Default endDelay value should only be applied to the last tween
682
+ if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }
683
+ return obj;
684
+ }).map(function (k) { return mergeObjects(k, settings); });
685
+ }
686
+
687
+
688
+ function flattenKeyframes(keyframes) {
689
+ var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })
690
+ .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);
691
+ var properties = {};
692
+ var loop = function ( i ) {
693
+ var propName = propertyNames[i];
694
+ properties[propName] = keyframes.map(function (key) {
695
+ var newKey = {};
696
+ for (var p in key) {
697
+ if (is.key(p)) {
698
+ if (p == propName) { newKey.value = key[p]; }
699
+ } else {
700
+ newKey[p] = key[p];
701
+ }
702
+ }
703
+ return newKey;
704
+ });
705
+ };
706
+
707
+ for (var i = 0; i < propertyNames.length; i++) loop( i );
708
+ return properties;
709
+ }
710
+
711
+ function getProperties(tweenSettings, params) {
712
+ var properties = [];
713
+ var keyframes = params.keyframes;
714
+ if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }
715
+ for (var p in params) {
716
+ if (is.key(p)) {
717
+ properties.push({
718
+ name: p,
719
+ tweens: normalizePropertyTweens(params[p], tweenSettings)
720
+ });
721
+ }
722
+ }
723
+ return properties;
724
+ }
725
+
726
+ // Tweens
727
+
728
+ function normalizeTweenValues(tween, animatable) {
729
+ var t = {};
730
+ for (var p in tween) {
731
+ var value = getFunctionValue(tween[p], animatable);
732
+ if (is.arr(value)) {
733
+ value = value.map(function (v) { return getFunctionValue(v, animatable); });
734
+ if (value.length === 1) { value = value[0]; }
735
+ }
736
+ t[p] = value;
737
+ }
738
+ t.duration = parseFloat(t.duration);
739
+ t.delay = parseFloat(t.delay);
740
+ return t;
741
+ }
742
+
743
+ function normalizeTweens(prop, animatable) {
744
+ var previousTween;
745
+ return prop.tweens.map(function (t) {
746
+ var tween = normalizeTweenValues(t, animatable);
747
+ var tweenValue = tween.value;
748
+ var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;
749
+ var toUnit = getUnit(to);
750
+ var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);
751
+ var previousValue = previousTween ? previousTween.to.original : originalValue;
752
+ var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;
753
+ var fromUnit = getUnit(from) || getUnit(originalValue);
754
+ var unit = toUnit || fromUnit;
755
+ if (is.und(to)) { to = previousValue; }
756
+ tween.from = decomposeValue(from, unit);
757
+ tween.to = decomposeValue(getRelativeValue(to, from), unit);
758
+ tween.start = previousTween ? previousTween.end : 0;
759
+ tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;
760
+ tween.easing = parseEasings(tween.easing, tween.duration);
761
+ tween.isPath = is.pth(tweenValue);
762
+ tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target);
763
+ tween.isColor = is.col(tween.from.original);
764
+ if (tween.isColor) { tween.round = 1; }
765
+ previousTween = tween;
766
+ return tween;
767
+ });
768
+ }
769
+
770
+ // Tween progress
771
+
772
+ var setProgressValue = {
773
+ css: function (t, p, v) { return t.style[p] = v; },
774
+ attribute: function (t, p, v) { return t.setAttribute(p, v); },
775
+ object: function (t, p, v) { return t[p] = v; },
776
+ transform: function (t, p, v, transforms, manual) {
777
+ transforms.list.set(p, v);
778
+ if (p === transforms.last || manual) {
779
+ var str = '';
780
+ transforms.list.forEach(function (value, prop) { str += prop + "(" + value + ") "; });
781
+ t.style.transform = str;
782
+ }
783
+ }
784
+ };
785
+
786
+ // Set Value helper
787
+
788
+ function setTargetsValue(targets, properties) {
789
+ var animatables = getAnimatables(targets);
790
+ animatables.forEach(function (animatable) {
791
+ for (var property in properties) {
792
+ var value = getFunctionValue(properties[property], animatable);
793
+ var target = animatable.target;
794
+ var valueUnit = getUnit(value);
795
+ var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);
796
+ var unit = valueUnit || getUnit(originalValue);
797
+ var to = getRelativeValue(validateValue(value, unit), originalValue);
798
+ var animType = getAnimationType(target, property);
799
+ setProgressValue[animType](target, property, to, animatable.transforms, true);
800
+ }
801
+ });
802
+ }
803
+
804
+ // Animations
805
+
806
+ function createAnimation(animatable, prop) {
807
+ var animType = getAnimationType(animatable.target, prop.name);
808
+ if (animType) {
809
+ var tweens = normalizeTweens(prop, animatable);
810
+ var lastTween = tweens[tweens.length - 1];
811
+ return {
812
+ type: animType,
813
+ property: prop.name,
814
+ animatable: animatable,
815
+ tweens: tweens,
816
+ duration: lastTween.end,
817
+ delay: tweens[0].delay,
818
+ endDelay: lastTween.endDelay
819
+ }
820
+ }
821
+ }
822
+
823
+ function getAnimations(animatables, properties) {
824
+ return filterArray(flattenArray(animatables.map(function (animatable) {
825
+ return properties.map(function (prop) {
826
+ return createAnimation(animatable, prop);
827
+ });
828
+ })), function (a) { return !is.und(a); });
829
+ }
830
+
831
+ // Create Instance
832
+
833
+ function getInstanceTimings(animations, tweenSettings) {
834
+ var animLength = animations.length;
835
+ var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };
836
+ var timings = {};
837
+ timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;
838
+ timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;
839
+ timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;
840
+ return timings;
841
+ }
842
+
843
+ var instanceID = 0;
844
+
845
+ function createNewInstance(params) {
846
+ var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);
847
+ var tweenSettings = replaceObjectProps(defaultTweenSettings, params);
848
+ var properties = getProperties(tweenSettings, params);
849
+ var animatables = getAnimatables(params.targets);
850
+ var animations = getAnimations(animatables, properties);
851
+ var timings = getInstanceTimings(animations, tweenSettings);
852
+ var id = instanceID;
853
+ instanceID++;
854
+ return mergeObjects(instanceSettings, {
855
+ id: id,
856
+ children: [],
857
+ animatables: animatables,
858
+ animations: animations,
859
+ duration: timings.duration,
860
+ delay: timings.delay,
861
+ endDelay: timings.endDelay
862
+ });
863
+ }
864
+
865
+ // Core
866
+
867
+ var activeInstances = [];
868
+
869
+ var engine = (function () {
870
+ var raf;
871
+
872
+ function play() {
873
+ if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) {
874
+ raf = requestAnimationFrame(step);
875
+ }
876
+ }
877
+ function step(t) {
878
+ // memo on algorithm issue:
879
+ // dangerous iteration over mutable `activeInstances`
880
+ // (that collection may be updated from within callbacks of `tick`-ed animation instances)
881
+ var activeInstancesLength = activeInstances.length;
882
+ var i = 0;
883
+ while (i < activeInstancesLength) {
884
+ var activeInstance = activeInstances[i];
885
+ if (!activeInstance.paused) {
886
+ activeInstance.tick(t);
887
+ i++;
888
+ } else {
889
+ activeInstances.splice(i, 1);
890
+ activeInstancesLength--;
891
+ }
892
+ }
893
+ raf = i > 0 ? requestAnimationFrame(step) : undefined;
894
+ }
895
+
896
+ function handleVisibilityChange() {
897
+ if (!anime.suspendWhenDocumentHidden) { return; }
898
+
899
+ if (isDocumentHidden()) {
900
+ // suspend ticks
901
+ raf = cancelAnimationFrame(raf);
902
+ } else { // is back to active tab
903
+ // first adjust animations to consider the time that ticks were suspended
904
+ activeInstances.forEach(
905
+ function (instance) { return instance ._onDocumentVisibility(); }
906
+ );
907
+ engine();
908
+ }
909
+ }
910
+ if (typeof document !== 'undefined') {
911
+ document.addEventListener('visibilitychange', handleVisibilityChange);
912
+ }
913
+
914
+ return play;
915
+ })();
916
+
917
+ function isDocumentHidden() {
918
+ return !!document && document.hidden;
919
+ }
920
+
921
+ // Public Instance
922
+
923
+ function anime(params) {
924
+ if ( params === void 0 ) params = {};
925
+
926
+
927
+ var startTime = 0, lastTime = 0, now = 0;
928
+ var children, childrenLength = 0;
929
+ var resolve = null;
930
+
931
+ function makePromise(instance) {
932
+ var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });
933
+ instance.finished = promise;
934
+ return promise;
935
+ }
936
+
937
+ var instance = createNewInstance(params);
938
+ makePromise(instance);
939
+
940
+ function toggleInstanceDirection() {
941
+ var direction = instance.direction;
942
+ if (direction !== 'alternate') {
943
+ instance.direction = direction !== 'normal' ? 'normal' : 'reverse';
944
+ }
945
+ instance.reversed = !instance.reversed;
946
+ children.forEach(function (child) { return child.reversed = instance.reversed; });
947
+ }
948
+
949
+ function adjustTime(time) {
950
+ return instance.reversed ? instance.duration - time : time;
951
+ }
952
+
953
+ function resetTime() {
954
+ startTime = 0;
955
+ lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
956
+ }
957
+
958
+ function seekChild(time, child) {
959
+ if (child) { child.seek(time - child.timelineOffset); }
960
+ }
961
+
962
+ function syncInstanceChildren(time) {
963
+ if (!instance.reversePlayback) {
964
+ for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
965
+ } else {
966
+ for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
967
+ }
968
+ }
969
+
970
+ function setAnimationsProgress(insTime) {
971
+ var i = 0;
972
+ var animations = instance.animations;
973
+ var animationsLength = animations.length;
974
+ while (i < animationsLength) {
975
+ var anim = animations[i];
976
+ var animatable = anim.animatable;
977
+ var tweens = anim.tweens;
978
+ var tweenLength = tweens.length - 1;
979
+ var tween = tweens[tweenLength];
980
+ // Only check for keyframes if there is more than one tween
981
+ if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }
982
+ var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;
983
+ var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);
984
+ var strings = tween.to.strings;
985
+ var round = tween.round;
986
+ var numbers = [];
987
+ var toNumbersLength = tween.to.numbers.length;
988
+ var progress = (void 0);
989
+ for (var n = 0; n < toNumbersLength; n++) {
990
+ var value = (void 0);
991
+ var toNumber = tween.to.numbers[n];
992
+ var fromNumber = tween.from.numbers[n] || 0;
993
+ if (!tween.isPath) {
994
+ value = fromNumber + (eased * (toNumber - fromNumber));
995
+ } else {
996
+ value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG);
997
+ }
998
+ if (round) {
999
+ if (!(tween.isColor && n > 2)) {
1000
+ value = Math.round(value * round) / round;
1001
+ }
1002
+ }
1003
+ numbers.push(value);
1004
+ }
1005
+ // Manual Array.reduce for better performances
1006
+ var stringsLength = strings.length;
1007
+ if (!stringsLength) {
1008
+ progress = numbers[0];
1009
+ } else {
1010
+ progress = strings[0];
1011
+ for (var s = 0; s < stringsLength; s++) {
1012
+ var b = strings[s + 1];
1013
+ var n$1 = numbers[s];
1014
+ if (!isNaN(n$1)) {
1015
+ if (!b) {
1016
+ progress += n$1 + ' ';
1017
+ } else {
1018
+ progress += n$1 + b;
1019
+ }
1020
+ }
1021
+ }
1022
+ }
1023
+ setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);
1024
+ anim.currentValue = progress;
1025
+ i++;
1026
+ }
1027
+ }
1028
+
1029
+ function setCallback(cb) {
1030
+ if (instance[cb] && !instance.passThrough) { instance[cb](instance); }
1031
+ }
1032
+
1033
+ function countIteration() {
1034
+ if (instance.remaining && instance.remaining !== true) {
1035
+ instance.remaining--;
1036
+ }
1037
+ }
1038
+
1039
+ function setInstanceProgress(engineTime) {
1040
+ var insDuration = instance.duration;
1041
+ var insDelay = instance.delay;
1042
+ var insEndDelay = insDuration - instance.endDelay;
1043
+ var insTime = adjustTime(engineTime);
1044
+ instance.progress = minMax((insTime / insDuration) * 100, 0, 100);
1045
+ instance.reversePlayback = insTime < instance.currentTime;
1046
+ if (children) { syncInstanceChildren(insTime); }
1047
+ if (!instance.began && instance.currentTime > 0) {
1048
+ instance.began = true;
1049
+ setCallback('begin');
1050
+ }
1051
+ if (!instance.loopBegan && instance.currentTime > 0) {
1052
+ instance.loopBegan = true;
1053
+ setCallback('loopBegin');
1054
+ }
1055
+ if (insTime <= insDelay && instance.currentTime !== 0) {
1056
+ setAnimationsProgress(0);
1057
+ }
1058
+ if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {
1059
+ setAnimationsProgress(insDuration);
1060
+ }
1061
+ if (insTime > insDelay && insTime < insEndDelay) {
1062
+ if (!instance.changeBegan) {
1063
+ instance.changeBegan = true;
1064
+ instance.changeCompleted = false;
1065
+ setCallback('changeBegin');
1066
+ }
1067
+ setCallback('change');
1068
+ setAnimationsProgress(insTime);
1069
+ } else {
1070
+ if (instance.changeBegan) {
1071
+ instance.changeCompleted = true;
1072
+ instance.changeBegan = false;
1073
+ setCallback('changeComplete');
1074
+ }
1075
+ }
1076
+ instance.currentTime = minMax(insTime, 0, insDuration);
1077
+ if (instance.began) { setCallback('update'); }
1078
+ if (engineTime >= insDuration) {
1079
+ lastTime = 0;
1080
+ countIteration();
1081
+ if (!instance.remaining) {
1082
+ instance.paused = true;
1083
+ if (!instance.completed) {
1084
+ instance.completed = true;
1085
+ setCallback('loopComplete');
1086
+ setCallback('complete');
1087
+ if (!instance.passThrough && 'Promise' in window) {
1088
+ resolve();
1089
+ makePromise(instance);
1090
+ }
1091
+ }
1092
+ } else {
1093
+ startTime = now;
1094
+ setCallback('loopComplete');
1095
+ instance.loopBegan = false;
1096
+ if (instance.direction === 'alternate') {
1097
+ toggleInstanceDirection();
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+
1103
+ instance.reset = function() {
1104
+ var direction = instance.direction;
1105
+ instance.passThrough = false;
1106
+ instance.currentTime = 0;
1107
+ instance.progress = 0;
1108
+ instance.paused = true;
1109
+ instance.began = false;
1110
+ instance.loopBegan = false;
1111
+ instance.changeBegan = false;
1112
+ instance.completed = false;
1113
+ instance.changeCompleted = false;
1114
+ instance.reversePlayback = false;
1115
+ instance.reversed = direction === 'reverse';
1116
+ instance.remaining = instance.loop;
1117
+ children = instance.children;
1118
+ childrenLength = children.length;
1119
+ for (var i = childrenLength; i--;) { instance.children[i].reset(); }
1120
+ if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }
1121
+ setAnimationsProgress(instance.reversed ? instance.duration : 0);
1122
+ };
1123
+
1124
+ // internal method (for engine) to adjust animation timings before restoring engine ticks (rAF)
1125
+ instance._onDocumentVisibility = resetTime;
1126
+
1127
+ // Set Value helper
1128
+
1129
+ instance.set = function(targets, properties) {
1130
+ setTargetsValue(targets, properties);
1131
+ return instance;
1132
+ };
1133
+
1134
+ instance.tick = function(t) {
1135
+ now = t;
1136
+ if (!startTime) { startTime = now; }
1137
+ setInstanceProgress((now + (lastTime - startTime)) * anime.speed);
1138
+ };
1139
+
1140
+ instance.seek = function(time) {
1141
+ setInstanceProgress(adjustTime(time));
1142
+ };
1143
+
1144
+ instance.pause = function() {
1145
+ instance.paused = true;
1146
+ resetTime();
1147
+ };
1148
+
1149
+ instance.play = function() {
1150
+ if (!instance.paused) { return; }
1151
+ if (instance.completed) { instance.reset(); }
1152
+ instance.paused = false;
1153
+ activeInstances.push(instance);
1154
+ resetTime();
1155
+ engine();
1156
+ };
1157
+
1158
+ instance.reverse = function() {
1159
+ toggleInstanceDirection();
1160
+ instance.completed = instance.reversed ? false : true;
1161
+ resetTime();
1162
+ };
1163
+
1164
+ instance.restart = function() {
1165
+ instance.reset();
1166
+ instance.play();
1167
+ };
1168
+
1169
+ instance.remove = function(targets) {
1170
+ var targetsArray = parseTargets(targets);
1171
+ removeTargetsFromInstance(targetsArray, instance);
1172
+ };
1173
+
1174
+ instance.reset();
1175
+
1176
+ if (instance.autoplay) { instance.play(); }
1177
+
1178
+ return instance;
1179
+
1180
+ }
1181
+
1182
+ // Remove targets from animation
1183
+
1184
+ function removeTargetsFromAnimations(targetsArray, animations) {
1185
+ for (var a = animations.length; a--;) {
1186
+ if (arrayContains(targetsArray, animations[a].animatable.target)) {
1187
+ animations.splice(a, 1);
1188
+ }
1189
+ }
1190
+ }
1191
+
1192
+ function removeTargetsFromInstance(targetsArray, instance) {
1193
+ var animations = instance.animations;
1194
+ var children = instance.children;
1195
+ removeTargetsFromAnimations(targetsArray, animations);
1196
+ for (var c = children.length; c--;) {
1197
+ var child = children[c];
1198
+ var childAnimations = child.animations;
1199
+ removeTargetsFromAnimations(targetsArray, childAnimations);
1200
+ if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }
1201
+ }
1202
+ if (!animations.length && !children.length) { instance.pause(); }
1203
+ }
1204
+
1205
+ function removeTargetsFromActiveInstances(targets) {
1206
+ var targetsArray = parseTargets(targets);
1207
+ for (var i = activeInstances.length; i--;) {
1208
+ var instance = activeInstances[i];
1209
+ removeTargetsFromInstance(targetsArray, instance);
1210
+ }
1211
+ }
1212
+
1213
+ // Stagger helpers
1214
+
1215
+ function stagger(val, params) {
1216
+ if ( params === void 0 ) params = {};
1217
+
1218
+ var direction = params.direction || 'normal';
1219
+ var easing = params.easing ? parseEasings(params.easing) : null;
1220
+ var grid = params.grid;
1221
+ var axis = params.axis;
1222
+ var fromIndex = params.from || 0;
1223
+ var fromFirst = fromIndex === 'first';
1224
+ var fromCenter = fromIndex === 'center';
1225
+ var fromLast = fromIndex === 'last';
1226
+ var isRange = is.arr(val);
1227
+ var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);
1228
+ var val2 = isRange ? parseFloat(val[1]) : 0;
1229
+ var unit = getUnit(isRange ? val[1] : val) || 0;
1230
+ var start = params.start || 0 + (isRange ? val1 : 0);
1231
+ var values = [];
1232
+ var maxValue = 0;
1233
+ return function (el, i, t) {
1234
+ if (fromFirst) { fromIndex = 0; }
1235
+ if (fromCenter) { fromIndex = (t - 1) / 2; }
1236
+ if (fromLast) { fromIndex = t - 1; }
1237
+ if (!values.length) {
1238
+ for (var index = 0; index < t; index++) {
1239
+ if (!grid) {
1240
+ values.push(Math.abs(fromIndex - index));
1241
+ } else {
1242
+ var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;
1243
+ var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;
1244
+ var toX = index%grid[0];
1245
+ var toY = Math.floor(index/grid[0]);
1246
+ var distanceX = fromX - toX;
1247
+ var distanceY = fromY - toY;
1248
+ var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
1249
+ if (axis === 'x') { value = -distanceX; }
1250
+ if (axis === 'y') { value = -distanceY; }
1251
+ values.push(value);
1252
+ }
1253
+ maxValue = Math.max.apply(Math, values);
1254
+ }
1255
+ if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }
1256
+ if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }
1257
+ }
1258
+ var spacing = isRange ? (val2 - val1) / maxValue : val1;
1259
+ return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;
1260
+ }
1261
+ }
1262
+
1263
+ // Timeline
1264
+
1265
+ function timeline(params) {
1266
+ if ( params === void 0 ) params = {};
1267
+
1268
+ var tl = anime(params);
1269
+ tl.duration = 0;
1270
+ tl.add = function(instanceParams, timelineOffset) {
1271
+ var tlIndex = activeInstances.indexOf(tl);
1272
+ var children = tl.children;
1273
+ if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }
1274
+ function passThrough(ins) { ins.passThrough = true; }
1275
+ for (var i = 0; i < children.length; i++) { passThrough(children[i]); }
1276
+ var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));
1277
+ insParams.targets = insParams.targets || params.targets;
1278
+ var tlDuration = tl.duration;
1279
+ insParams.autoplay = false;
1280
+ insParams.direction = tl.direction;
1281
+ insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);
1282
+ passThrough(tl);
1283
+ tl.seek(insParams.timelineOffset);
1284
+ var ins = anime(insParams);
1285
+ passThrough(ins);
1286
+ children.push(ins);
1287
+ var timings = getInstanceTimings(children, params);
1288
+ tl.delay = timings.delay;
1289
+ tl.endDelay = timings.endDelay;
1290
+ tl.duration = timings.duration;
1291
+ tl.seek(0);
1292
+ tl.reset();
1293
+ if (tl.autoplay) { tl.play(); }
1294
+ return tl;
1295
+ };
1296
+ return tl;
1297
+ }
1298
+
1299
+ anime.version = '3.2.1';
1300
+ anime.speed = 1;
1301
+ // TODO:#review: naming, documentation
1302
+ anime.suspendWhenDocumentHidden = true;
1303
+ anime.running = activeInstances;
1304
+ anime.remove = removeTargetsFromActiveInstances;
1305
+ anime.get = getOriginalTargetValue;
1306
+ anime.set = setTargetsValue;
1307
+ anime.convertPx = convertPxToUnit;
1308
+ anime.path = getPath;
1309
+ anime.setDashoffset = setDashoffset;
1310
+ anime.stagger = stagger;
1311
+ anime.timeline = timeline;
1312
+ anime.easing = parseEasings;
1313
+ anime.penner = penner;
1314
+ anime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };
1315
+
1316
+ const stateMap = {
1317
+ success: "succes:",
1318
+ info: "info:",
1319
+ warning: "waarschuwing:",
1320
+ danger: "fout:",
1321
+ };
1322
+
1323
+ const HandleElement = ({ handleUrl, onClick, open }, children) => {
1324
+ if (handleUrl) {
1325
+ return (index.h("a", { href: handleUrl, onClick: onClick, "aria-expanded": open ? "true" : "false" }, children));
1326
+ }
1327
+ return (index.h("button", { type: "button", onClick: onClick, "aria-expanded": open ? "true" : "false" }, children));
1328
+ };
1329
+
1330
+ const Handle = ({ heading }, children) => {
1331
+ switch (heading) {
1332
+ default:
1333
+ case "h2":
1334
+ return index.h("h2", { class: "dso-section-handle" }, children);
1335
+ case "h3":
1336
+ return index.h("h3", { class: "dso-section-handle" }, children);
1337
+ case "h4":
1338
+ return index.h("h4", { class: "dso-section-handle" }, children);
1339
+ case "h5":
1340
+ return index.h("h5", { class: "dso-section-handle" }, children);
1341
+ }
1342
+ };
1343
+
1344
+ const HandleStateIcon = ({ state }) => {
1345
+ if (state === "danger") {
1346
+ return index.h("dso-icon", { icon: "status-danger" });
1347
+ }
1348
+ if (state === "success") {
1349
+ return index.h("dso-icon", { icon: "status-success" });
1350
+ }
1351
+ if (state === "info") {
1352
+ return index.h("dso-icon", { icon: "status-info" });
1353
+ }
1354
+ if (state === "warning") {
1355
+ return index.h("dso-icon", { icon: "status-warning" });
1356
+ }
1357
+ };
1358
+
1359
+ const HandleIcon = ({ state, icon, attachmentCount }) => {
1360
+ if (state) {
1361
+ return index.h(HandleStateIcon, { state: state });
1362
+ }
1363
+ if (attachmentCount) {
1364
+ return index.h("dso-attachments-counter", { count: attachmentCount });
1365
+ }
1366
+ if (icon) {
1367
+ return index.h("dso-icon", { icon: icon });
1368
+ }
1369
+ };
1370
+
1371
+ const accordionSectionCss = "*,*::after,*::before{box-sizing:border-box}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}:host{display:block}:host .dso-section-handle{font-size:1em;font-weight:600;line-height:1.375em;margin:0;position:relative}:host .dso-section-handle>a:active{text-decoration:none}:host .dso-section-handle a{text-decoration:none}:host .dso-section-handle a:hover,:host .dso-section-handle a:focus{text-decoration:none}:host .dso-section-handle a:active{text-decoration:underline}:host .dso-section-handle .dso-status{font-weight:400;text-decoration:underline}:host .dso-section-handle>button,:host .dso-section-handle>a{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;font-family:Asap, sans-serif;font-size:1em;font-weight:600;line-height:1.375em;margin:0;padding:12px 16px 12px;text-align:start;width:100%;word-break:break-word}:host .dso-section-handle>button dso-icon,:host .dso-section-handle>a dso-icon{flex-shrink:0}:host .dso-section-handle>button dso-icon.dso-section-handle-chevron,:host .dso-section-handle>a dso-icon.dso-section-handle-chevron{transform:rotate(0);transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1)}:host .dso-section-handle>button>.dso-section-handle-addons:first-child,:host .dso-section-handle>button>dso-icon:first-child,:host .dso-section-handle>a>.dso-section-handle-addons:first-child,:host .dso-section-handle>a>dso-icon:first-child{margin-right:8px}:host .dso-section-handle>button>dso-icon:last-child,:host .dso-section-handle>a>dso-icon:last-child{margin-left:auto}:host .dso-section-handle>button>.dso-section-handle-addons:last-child,:host .dso-section-handle>a>.dso-section-handle-addons:last-child{margin-left:auto}:host .dso-section-handle>button>.dso-section-handle-addons:last-child dso-attachments-counter,:host .dso-section-handle>button>.dso-section-handle-addons:last-child dso-icon,:host .dso-section-handle>a>.dso-section-handle-addons:last-child dso-attachments-counter,:host .dso-section-handle>a>.dso-section-handle-addons:last-child dso-icon{margin-left:16px}:host([open]) .dso-section-body{position:inherit;visibility:inherit}:host([open]) .dso-section-handle>button .dso-section-handle-chevron:first-child,:host([open]) .dso-section-handle>a .dso-section-handle-chevron:first-child{transform:rotate(90deg)}:host([open]) .dso-section-handle>button .dso-section-handle-chevron:last-child,:host([open]) .dso-section-handle>a .dso-section-handle-chevron:last-child{transform:rotate(-180deg)}.dso-section-body{background-color:#fff;border-top:0;margin-top:-4px;overflow-y:hidden}.dso-section-body:not(.dso-animate-ready){position:absolute;visibility:hidden}.dso-section-body .dso-section-body-content{padding:20px 16px 16px}:host(.dso-accordion-default) .dso-section-handle{background-color:#fff;border:1px solid #8b4a6a;border-radius:4px}:host(.dso-accordion-default) .dso-section-handle a,:host(.dso-accordion-default) .dso-section-handle button{color:#8b4a6a}:host(.dso-accordion-default) .dso-section-handle a:hover,:host(.dso-accordion-default) .dso-section-handle a:active,:host(.dso-accordion-default) .dso-section-handle a.active,:host(.dso-accordion-default) .dso-section-handle button:hover,:host(.dso-accordion-default) .dso-section-handle button:active,:host(.dso-accordion-default) .dso-section-handle button.active{color:#8b4a6a}:host(.dso-accordion-default) .dso-section-body{border:1px solid #8b4a6a;border-radius:0 0 4px 4px}:host(.dso-accordion-default[open])>.dso-section-handle{background-color:#8b4a6a;border-radius:0;border-top-left-radius:4px;border-top-right-radius:4px}:host(.dso-accordion-default[open])>.dso-section-handle a,:host(.dso-accordion-default[open])>.dso-section-handle button{color:#fff}:host(.dso-accordion-default[open])>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-default[open])>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#fff;--dso-icon:var(--di-paperclip-wit)}:host(.dso-accordion-default.dso-nested-accordion[open]) .dso-section-body{background-color:#e5e5e5}:host(.dso-accordion-compact) .dso-section-handle{border-bottom:1px solid transparent;border-top:1px solid #ccc}:host(.dso-accordion-compact) .dso-section-handle a,:host(.dso-accordion-compact) .dso-section-handle button{color:#39870c;padding-bottom:11px;padding-left:0;padding-top:11px}:host(.dso-accordion-compact) .dso-section-handle a:hover,:host(.dso-accordion-compact) .dso-section-handle a:active,:host(.dso-accordion-compact) .dso-section-handle a.active,:host(.dso-accordion-compact) .dso-section-handle button:hover,:host(.dso-accordion-compact) .dso-section-handle button:active,:host(.dso-accordion-compact) .dso-section-handle button.active{color:#39870c}:host(.dso-accordion-compact) .dso-section-body .dso-section-body-content{padding-left:32px;padding-top:0;padding-right:0}:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-handle a,:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-handle button{padding-left:16px}:host(.dso-accordion-compact.dso-accordion-reverse-align) .dso-section-body .dso-section-body-content{padding-left:16px;padding-right:0}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle{background-color:transparent}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button{color:#39870c}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a:hover,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a:active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a.active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button:hover,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button:active,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button.active{color:#39870c}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#666;--dso-icon:var(--di-paperclip-grijs)}:host(.dso-accordion-compact[open]:not(.dso-nested-accordion))>.dso-section-body{border-top:0}:host(.dso-accordion-compact.dso-nested-accordion[open])>.dso-section-body{padding-bottom:0}:host(.dso-accordion-compact.dso-nested-accordion[open])>.dso-section-body dso-accordion-section:last-child{border-bottom:0}:host(.dso-accordion-conclusion) .dso-section-handle{background-color:#f2f2f2;border:1px solid #f2f2f2}:host(.dso-accordion-conclusion) .dso-section-handle a,:host(.dso-accordion-conclusion) .dso-section-handle button{color:#191919}:host(.dso-accordion-conclusion) .dso-section-handle a:hover,:host(.dso-accordion-conclusion) .dso-section-handle a:active,:host(.dso-accordion-conclusion) .dso-section-handle a.active,:host(.dso-accordion-conclusion) .dso-section-handle button:hover,:host(.dso-accordion-conclusion) .dso-section-handle button:active,:host(.dso-accordion-conclusion) .dso-section-handle button.active{background-color:#e5e5e5;color:#191919}:host(.dso-accordion-conclusion) .dso-section-body{border:2px solid #f2f2f2}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle{background-color:#f2f2f2}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle a,:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle button{color:#191919}:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle a dso-attachments-counter,:host(.dso-accordion-conclusion[open]:not(.dso-nested-accordion))>.dso-section-handle button dso-attachments-counter{--dso-attachments-counter-color:#666;--dso-icon:var(--di-paperclip-grijs)}:host(.dso-accordion-conclusion.dso-nested-accordion[open]){background-color:#fff}";
8
1372
 
9
1373
  const AccordionSection = class {
10
1374
  constructor(hostRef) {
@@ -19,8 +1383,12 @@ const AccordionSection = class {
19
1383
  this.open = false;
20
1384
  this.hasNestedSection = false;
21
1385
  }
1386
+ toggleOpen() {
1387
+ this.activateAnimation();
1388
+ }
22
1389
  componentWillLoad() {
23
1390
  const accordion = this.host.parentElement;
1391
+ this.hasNestedSection = this.host.querySelector("dso-accordion") !== null;
24
1392
  if (isAccordion(accordion)) {
25
1393
  this.accordion = accordion;
26
1394
  accordion.getState().then((state) => {
@@ -28,9 +1396,18 @@ const AccordionSection = class {
28
1396
  index.forceUpdate(this.host);
29
1397
  });
30
1398
  }
1399
+ this.startAnimationResizeObserver();
31
1400
  }
32
1401
  componentDidLoad() {
33
- this.hasNestedSection = this.host.querySelector("dso-accordion") !== null;
1402
+ var _a, _b;
1403
+ const bodyContentElement = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(".dso-section-body-content");
1404
+ if (bodyContentElement) {
1405
+ (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.observe(bodyContentElement);
1406
+ }
1407
+ }
1408
+ disconnectedCallback() {
1409
+ var _a;
1410
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
34
1411
  }
35
1412
  /** Toggle this section */
36
1413
  async toggleSection() {
@@ -43,73 +1420,85 @@ const AccordionSection = class {
43
1420
  return (_a = this.accordion) === null || _a === void 0 ? void 0 : _a.toggleSection(this.host, e);
44
1421
  }
45
1422
  render() {
46
- if (!this.accordionState) {
47
- return;
48
- }
49
- const { variant, reverseAlign } = this.accordionState;
1423
+ var _a;
1424
+ const { variant, reverseAlign } = (_a = this.accordionState) !== null && _a !== void 0 ? _a : {};
50
1425
  const hasAddons = !!this.status || !!this.state || !!this.icon || !!this.attachmentCount;
51
1426
  return (index.h(index.Host, { class: {
52
1427
  "dso-accordion-section": true,
53
1428
  ["dso-accordion-" + variant]: true,
54
1429
  "dso-nested-accordion": this.hasNestedSection,
55
- "dso-accordion-reverse-align": this.accordionState.reverseAlign,
56
- } }, index.h(Handle, { heading: this.heading }, index.h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (index.h(index.Fragment, null, hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, index.h(HandleIcon, { icon: this.icon }))), index.h("span", null, this.handleTitle), index.h("dso-icon", { icon: this.open ? "chevron-up" : "chevron-down" }))) : (index.h(index.Fragment, null, index.h("dso-icon", { icon: this.open ? "chevron-down" : "chevron-right" }), this.state && index.h("span", { class: "sr-only" }, stateMap[this.state]), index.h("span", null, this.handleTitle), hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, this.status && index.h("span", { class: "dso-status" }, this.status), index.h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), index.h("div", { class: "dso-section-body", style: this.open ? {} : { display: "none" } }, index.h("slot", null))));
1430
+ "dso-accordion-reverse-align": reverseAlign !== null && reverseAlign !== void 0 ? reverseAlign : false,
1431
+ }, hidden: !variant }, index.h(Handle, { heading: this.heading }, index.h(HandleElement, { handleUrl: this.handleUrl, onClick: async (event) => await this.toggle(event), open: this.open }, reverseAlign ? (index.h(index.Fragment, null, hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, index.h(HandleIcon, { icon: this.icon }))), index.h("span", null, this.handleTitle), index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-down" }))) : (index.h(index.Fragment, null, index.h("dso-icon", { class: "dso-section-handle-chevron", icon: "chevron-right" }), this.state && index.h("span", { class: "sr-only" }, stateMap[this.state]), index.h("span", null, this.handleTitle), hasAddons && (index.h("div", { class: "dso-section-handle-addons" }, this.status && index.h("span", { class: "dso-status" }, this.status), index.h(HandleIcon, { state: this.state, icon: this.icon, attachmentCount: this.attachmentCount }))))))), index.h("div", { class: { "dso-section-body": true, "dso-animate-ready": !!this.animeInstance }, ref: (element) => (this.sectionBody = element), "aria-hidden": this.open ? "false" : "true" }, index.h("div", { class: "dso-section-body-content" }, index.h("slot", null)))));
1432
+ }
1433
+ startAnimationResizeObserver() {
1434
+ this.resizeObserver = new ResizeObserver(index$1.debounce_1(([entry]) => {
1435
+ if (this.bodyHeight !== entry.contentRect.height) {
1436
+ this.bodyHeight = entry.contentRect.height;
1437
+ this.instantiateAnimation();
1438
+ }
1439
+ }, 150));
1440
+ }
1441
+ instantiateAnimation() {
1442
+ this.animeInstance = anime({
1443
+ targets: this.sectionBody,
1444
+ height: 4,
1445
+ easing: "cubicBezier(0.4, 0, 0.2, 1)",
1446
+ duration: 260,
1447
+ autoplay: false,
1448
+ direction: "normal",
1449
+ begin: () => {
1450
+ if (this.sectionBody) {
1451
+ if (this.open) {
1452
+ this.sectionBody.style.visibility = "";
1453
+ this.sectionBody.style.position = "";
1454
+ this.sectionBody.style.bottom = "";
1455
+ }
1456
+ }
1457
+ },
1458
+ complete: () => {
1459
+ if (this.sectionBody) {
1460
+ this.sectionBody.style.height = "";
1461
+ if (!this.open) {
1462
+ this.sectionBody.style.visibility = "hidden";
1463
+ this.sectionBody.style.position = "absolute";
1464
+ this.sectionBody.style.bottom = "100%";
1465
+ }
1466
+ }
1467
+ },
1468
+ });
1469
+ if (!this.open) {
1470
+ this.animeInstance.reverse();
1471
+ this.animeInstance.play();
1472
+ }
1473
+ if (this.sectionBody) {
1474
+ this.sectionBody.style.height = "";
1475
+ }
1476
+ }
1477
+ activateAnimation() {
1478
+ if (this.animeInstance) {
1479
+ if (this.animeInstance.progress > 0 && this.animeInstance.progress < 100) {
1480
+ this.animeInstance.reverse();
1481
+ }
1482
+ else {
1483
+ if (this.open) {
1484
+ this.animeInstance.direction = "reverse";
1485
+ this.animeInstance.play();
1486
+ }
1487
+ else {
1488
+ this.animeInstance.direction = "normal";
1489
+ this.animeInstance.play();
1490
+ }
1491
+ }
1492
+ }
57
1493
  }
58
1494
  get host() { return index.getElement(this); }
1495
+ static get watchers() { return {
1496
+ "open": ["toggleOpen"]
1497
+ }; }
59
1498
  };
60
1499
  function isAccordion(element) {
61
1500
  return element instanceof HTMLElement && "getState" in element;
62
1501
  }
63
- const Handle = ({ heading }, children) => {
64
- switch (heading) {
65
- default:
66
- case "h2":
67
- return index.h("h2", { class: "dso-section-handle" }, children);
68
- case "h3":
69
- return index.h("h3", { class: "dso-section-handle" }, children);
70
- case "h4":
71
- return index.h("h4", { class: "dso-section-handle" }, children);
72
- case "h5":
73
- return index.h("h5", { class: "dso-section-handle" }, children);
74
- }
75
- };
76
- const HandleElement = ({ handleUrl, onClick, open }, children) => {
77
- if (handleUrl) {
78
- return (index.h("a", { href: handleUrl, onClick: onClick, "aria-expanded": open ? "true" : "false" }, children));
79
- }
80
- return (index.h("button", { type: "button", onClick: onClick, "aria-expanded": open ? "true" : "false" }, children));
81
- };
82
- const HandleIcon = ({ state, icon, attachmentCount, }) => {
83
- if (state) {
84
- return index.h(HandleStateIcon, { state: state });
85
- }
86
- if (attachmentCount) {
87
- return index.h("dso-attachments-counter", { count: attachmentCount });
88
- }
89
- if (icon) {
90
- return index.h("dso-icon", { icon: icon });
91
- }
92
- };
93
- const stateMap = {
94
- success: "succes:",
95
- info: "info:",
96
- warning: "waarschuwing:",
97
- danger: "fout:",
98
- };
99
- const HandleStateIcon = ({ state }) => {
100
- if (state === "danger") {
101
- return index.h("dso-icon", { icon: "status-danger" });
102
- }
103
- if (state === "success") {
104
- return index.h("dso-icon", { icon: "status-success" });
105
- }
106
- if (state === "info") {
107
- return index.h("dso-icon", { icon: "status-info" });
108
- }
109
- if (state === "warning") {
110
- return index.h("dso-icon", { icon: "status-warning" });
111
- }
112
- };
113
1502
  AccordionSection.style = accordionSectionCss;
114
1503
 
115
1504
  exports.dso_accordion_section = AccordionSection;