avo 1.25.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

Files changed (701) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +10 -1
  3. data/Gemfile.lock +19 -6
  4. data/README.md +33 -28
  5. data/app/assets/stylesheets/avo.css +7 -2
  6. data/app/assets/stylesheets/css/breadcrumbs.css +6 -2
  7. data/app/assets/stylesheets/css/buttons.css +16 -0
  8. data/app/assets/stylesheets/css/fonts.css +42 -16
  9. data/app/assets/stylesheets/css/pagination.css +9 -9
  10. data/app/assets/stylesheets/css/search.css +18 -7
  11. data/app/assets/stylesheets/css/tooltips.css +1 -0
  12. data/app/assets/stylesheets/css/typography.css +4 -2
  13. data/app/assets/svgs/bell.svg +3 -0
  14. data/app/assets/svgs/dashboards-icon.svg +6 -0
  15. data/app/assets/svgs/detach.svg +8 -0
  16. data/app/assets/svgs/edit.svg +5 -1
  17. data/app/assets/svgs/grid-empty-state.svg +37 -0
  18. data/app/assets/svgs/grid-view-type.svg +5 -0
  19. data/app/assets/svgs/heroicons/outline/academic-cap.svg +5 -0
  20. data/app/assets/svgs/heroicons/outline/adjustments.svg +3 -0
  21. data/app/assets/svgs/heroicons/outline/annotation.svg +3 -0
  22. data/app/assets/svgs/heroicons/outline/archive.svg +3 -0
  23. data/app/assets/svgs/heroicons/outline/arrow-circle-down.svg +3 -0
  24. data/app/assets/svgs/heroicons/outline/arrow-circle-left.svg +3 -0
  25. data/app/assets/svgs/heroicons/outline/arrow-circle-right.svg +3 -0
  26. data/app/assets/svgs/heroicons/outline/arrow-circle-up.svg +3 -0
  27. data/app/assets/svgs/heroicons/outline/arrow-down.svg +3 -0
  28. data/app/assets/svgs/heroicons/outline/arrow-left.svg +3 -0
  29. data/app/assets/svgs/heroicons/outline/arrow-narrow-down.svg +3 -0
  30. data/app/assets/svgs/heroicons/outline/arrow-narrow-left.svg +3 -0
  31. data/app/assets/svgs/heroicons/outline/arrow-narrow-right.svg +3 -0
  32. data/app/assets/svgs/heroicons/outline/arrow-narrow-up.svg +3 -0
  33. data/app/assets/svgs/heroicons/outline/arrow-right.svg +3 -0
  34. data/app/assets/svgs/heroicons/outline/arrow-sm-down.svg +3 -0
  35. data/app/assets/svgs/heroicons/outline/arrow-sm-left.svg +3 -0
  36. data/app/assets/svgs/heroicons/outline/arrow-sm-right.svg +3 -0
  37. data/app/assets/svgs/heroicons/outline/arrow-sm-up.svg +3 -0
  38. data/app/assets/svgs/heroicons/outline/arrow-up.svg +3 -0
  39. data/app/assets/svgs/heroicons/outline/arrows-expand.svg +3 -0
  40. data/app/assets/svgs/heroicons/outline/at-symbol.svg +3 -0
  41. data/app/assets/svgs/heroicons/outline/backspace.svg +3 -0
  42. data/app/assets/svgs/heroicons/outline/badge-check.svg +3 -0
  43. data/app/assets/svgs/heroicons/outline/ban.svg +3 -0
  44. data/app/assets/svgs/heroicons/outline/beaker.svg +3 -0
  45. data/app/assets/svgs/heroicons/outline/bell.svg +3 -0
  46. data/app/assets/svgs/heroicons/outline/book-open.svg +3 -0
  47. data/app/assets/svgs/heroicons/outline/bookmark-alt.svg +3 -0
  48. data/app/assets/svgs/heroicons/outline/bookmark.svg +3 -0
  49. data/app/assets/svgs/heroicons/outline/briefcase.svg +3 -0
  50. data/app/assets/svgs/heroicons/outline/cake.svg +3 -0
  51. data/app/assets/svgs/heroicons/outline/calculator.svg +3 -0
  52. data/app/assets/svgs/heroicons/outline/calendar.svg +3 -0
  53. data/app/assets/svgs/heroicons/outline/camera.svg +4 -0
  54. data/app/assets/svgs/heroicons/outline/cash.svg +3 -0
  55. data/app/assets/svgs/heroicons/outline/chart-bar.svg +3 -0
  56. data/app/assets/svgs/heroicons/outline/chart-pie.svg +4 -0
  57. data/app/assets/svgs/heroicons/outline/chart-square-bar.svg +3 -0
  58. data/app/assets/svgs/heroicons/outline/chat-alt-2.svg +3 -0
  59. data/app/assets/svgs/heroicons/outline/chat-alt.svg +3 -0
  60. data/app/assets/svgs/heroicons/outline/chat.svg +3 -0
  61. data/app/assets/svgs/heroicons/outline/check-circle.svg +3 -0
  62. data/app/assets/svgs/heroicons/outline/check.svg +3 -0
  63. data/app/assets/svgs/heroicons/outline/chevron-double-down.svg +3 -0
  64. data/app/assets/svgs/heroicons/outline/chevron-double-left.svg +3 -0
  65. data/app/assets/svgs/heroicons/outline/chevron-double-right.svg +3 -0
  66. data/app/assets/svgs/heroicons/outline/chevron-double-up.svg +3 -0
  67. data/app/assets/svgs/heroicons/outline/chevron-down.svg +3 -0
  68. data/app/assets/svgs/heroicons/outline/chevron-left.svg +3 -0
  69. data/app/assets/svgs/heroicons/outline/chevron-right.svg +3 -0
  70. data/app/assets/svgs/heroicons/outline/chevron-up.svg +3 -0
  71. data/app/assets/svgs/heroicons/outline/chip.svg +3 -0
  72. data/app/assets/svgs/heroicons/outline/clipboard-check.svg +3 -0
  73. data/app/assets/svgs/heroicons/outline/clipboard-copy.svg +3 -0
  74. data/app/assets/svgs/heroicons/outline/clipboard-list.svg +3 -0
  75. data/app/assets/svgs/heroicons/outline/clipboard.svg +3 -0
  76. data/app/assets/svgs/heroicons/outline/clock.svg +3 -0
  77. data/app/assets/svgs/heroicons/outline/cloud-download.svg +3 -0
  78. data/app/assets/svgs/heroicons/outline/cloud-upload.svg +3 -0
  79. data/app/assets/svgs/heroicons/outline/cloud.svg +3 -0
  80. data/app/assets/svgs/heroicons/outline/code.svg +3 -0
  81. data/app/assets/svgs/heroicons/outline/cog.svg +4 -0
  82. data/app/assets/svgs/heroicons/outline/collection.svg +3 -0
  83. data/app/assets/svgs/heroicons/outline/color-swatch.svg +3 -0
  84. data/app/assets/svgs/heroicons/outline/credit-card.svg +3 -0
  85. data/app/assets/svgs/heroicons/outline/cube-transparent.svg +3 -0
  86. data/app/assets/svgs/heroicons/outline/cube.svg +3 -0
  87. data/app/assets/svgs/heroicons/outline/currency-bangladeshi.svg +3 -0
  88. data/app/assets/svgs/heroicons/outline/currency-dollar.svg +3 -0
  89. data/app/assets/svgs/heroicons/outline/currency-euro.svg +3 -0
  90. data/app/assets/svgs/heroicons/outline/currency-pound.svg +3 -0
  91. data/app/assets/svgs/heroicons/outline/currency-rupee.svg +3 -0
  92. data/app/assets/svgs/heroicons/outline/currency-yen.svg +3 -0
  93. data/app/assets/svgs/heroicons/outline/cursor-click.svg +3 -0
  94. data/app/assets/svgs/heroicons/outline/database.svg +3 -0
  95. data/app/assets/svgs/heroicons/outline/desktop-computer.svg +3 -0
  96. data/app/assets/svgs/heroicons/outline/device-mobile.svg +3 -0
  97. data/app/assets/svgs/heroicons/outline/device-tablet.svg +3 -0
  98. data/app/assets/svgs/heroicons/outline/document-add.svg +3 -0
  99. data/app/assets/svgs/heroicons/outline/document-download.svg +3 -0
  100. data/app/assets/svgs/heroicons/outline/document-duplicate.svg +3 -0
  101. data/app/assets/svgs/heroicons/outline/document-remove.svg +3 -0
  102. data/app/assets/svgs/heroicons/outline/document-report.svg +3 -0
  103. data/app/assets/svgs/heroicons/outline/document-search.svg +3 -0
  104. data/app/assets/svgs/heroicons/outline/document-text.svg +3 -0
  105. data/app/assets/svgs/heroicons/outline/document.svg +3 -0
  106. data/app/assets/svgs/heroicons/outline/dots-circle-horizontal.svg +3 -0
  107. data/app/assets/svgs/heroicons/outline/dots-horizontal.svg +3 -0
  108. data/app/assets/svgs/heroicons/outline/dots-vertical.svg +3 -0
  109. data/app/assets/svgs/heroicons/outline/download.svg +3 -0
  110. data/app/assets/svgs/heroicons/outline/duplicate.svg +3 -0
  111. data/app/assets/svgs/heroicons/outline/emoji-happy.svg +3 -0
  112. data/app/assets/svgs/heroicons/outline/emoji-sad.svg +3 -0
  113. data/app/assets/svgs/heroicons/outline/exclamation-circle.svg +3 -0
  114. data/app/assets/svgs/heroicons/outline/exclamation.svg +3 -0
  115. data/app/assets/svgs/heroicons/outline/external-link.svg +3 -0
  116. data/app/assets/svgs/heroicons/outline/eye-off.svg +3 -0
  117. data/app/assets/svgs/heroicons/outline/eye.svg +4 -0
  118. data/app/assets/svgs/heroicons/outline/fast-forward.svg +3 -0
  119. data/app/assets/svgs/heroicons/outline/film.svg +3 -0
  120. data/app/assets/svgs/heroicons/outline/filter.svg +3 -0
  121. data/app/assets/svgs/heroicons/outline/finger-print.svg +3 -0
  122. data/app/assets/svgs/heroicons/outline/fire.svg +4 -0
  123. data/app/assets/svgs/heroicons/outline/flag.svg +3 -0
  124. data/app/assets/svgs/heroicons/outline/folder-add.svg +3 -0
  125. data/app/assets/svgs/heroicons/outline/folder-download.svg +3 -0
  126. data/app/assets/svgs/heroicons/outline/folder-open.svg +3 -0
  127. data/app/assets/svgs/heroicons/outline/folder-remove.svg +3 -0
  128. data/app/assets/svgs/heroicons/outline/folder.svg +3 -0
  129. data/app/assets/svgs/heroicons/outline/gift.svg +3 -0
  130. data/app/assets/svgs/heroicons/outline/globe-alt.svg +3 -0
  131. data/app/assets/svgs/heroicons/outline/globe.svg +3 -0
  132. data/app/assets/svgs/heroicons/outline/hand.svg +3 -0
  133. data/app/assets/svgs/heroicons/outline/hashtag.svg +3 -0
  134. data/app/assets/svgs/heroicons/outline/heart.svg +3 -0
  135. data/app/assets/svgs/heroicons/outline/home.svg +3 -0
  136. data/app/assets/svgs/heroicons/outline/identification.svg +3 -0
  137. data/app/assets/svgs/heroicons/outline/inbox-in.svg +3 -0
  138. data/app/assets/svgs/heroicons/outline/inbox.svg +3 -0
  139. data/app/assets/svgs/heroicons/outline/information-circle.svg +3 -0
  140. data/app/assets/svgs/heroicons/outline/key.svg +3 -0
  141. data/app/assets/svgs/heroicons/outline/library.svg +3 -0
  142. data/app/assets/svgs/heroicons/outline/light-bulb.svg +3 -0
  143. data/app/assets/svgs/heroicons/outline/lightning-bolt.svg +3 -0
  144. data/app/assets/svgs/heroicons/outline/link.svg +3 -0
  145. data/app/assets/svgs/heroicons/outline/location-marker.svg +4 -0
  146. data/app/assets/svgs/heroicons/outline/lock-closed.svg +3 -0
  147. data/app/assets/svgs/heroicons/outline/lock-open.svg +3 -0
  148. data/app/assets/svgs/heroicons/outline/login.svg +3 -0
  149. data/app/assets/svgs/heroicons/outline/logout.svg +3 -0
  150. data/app/assets/svgs/heroicons/outline/mail-open.svg +3 -0
  151. data/app/assets/svgs/heroicons/outline/mail.svg +3 -0
  152. data/app/assets/svgs/heroicons/outline/map.svg +3 -0
  153. data/app/assets/svgs/heroicons/outline/menu-alt-1.svg +3 -0
  154. data/app/assets/svgs/heroicons/outline/menu-alt-2.svg +3 -0
  155. data/app/assets/svgs/heroicons/outline/menu-alt-3.svg +3 -0
  156. data/app/assets/svgs/heroicons/outline/menu-alt-4.svg +3 -0
  157. data/app/assets/svgs/heroicons/outline/menu.svg +3 -0
  158. data/app/assets/svgs/heroicons/outline/microphone.svg +3 -0
  159. data/app/assets/svgs/heroicons/outline/minus-circle.svg +3 -0
  160. data/app/assets/svgs/heroicons/outline/minus-sm.svg +3 -0
  161. data/app/assets/svgs/heroicons/outline/minus.svg +3 -0
  162. data/app/assets/svgs/heroicons/outline/moon.svg +3 -0
  163. data/app/assets/svgs/heroicons/outline/music-note.svg +3 -0
  164. data/app/assets/svgs/heroicons/outline/newspaper.svg +3 -0
  165. data/app/assets/svgs/heroicons/outline/office-building.svg +3 -0
  166. data/app/assets/svgs/heroicons/outline/paper-airplane.svg +3 -0
  167. data/app/assets/svgs/heroicons/outline/paper-clip.svg +3 -0
  168. data/app/assets/svgs/heroicons/outline/pause.svg +3 -0
  169. data/app/assets/svgs/heroicons/outline/pencil-alt.svg +3 -0
  170. data/app/assets/svgs/heroicons/outline/pencil.svg +3 -0
  171. data/app/assets/svgs/heroicons/outline/phone-incoming.svg +3 -0
  172. data/app/assets/svgs/heroicons/outline/phone-missed-call.svg +3 -0
  173. data/app/assets/svgs/heroicons/outline/phone-outgoing.svg +3 -0
  174. data/app/assets/svgs/heroicons/outline/phone.svg +3 -0
  175. data/app/assets/svgs/heroicons/outline/photograph.svg +3 -0
  176. data/app/assets/svgs/heroicons/outline/play.svg +4 -0
  177. data/app/assets/svgs/heroicons/outline/plus-circle.svg +3 -0
  178. data/app/assets/svgs/heroicons/outline/plus-sm.svg +3 -0
  179. data/app/assets/svgs/heroicons/outline/plus.svg +3 -0
  180. data/app/assets/svgs/heroicons/outline/presentation-chart-bar.svg +3 -0
  181. data/app/assets/svgs/heroicons/outline/presentation-chart-line.svg +3 -0
  182. data/app/assets/svgs/heroicons/outline/printer.svg +3 -0
  183. data/app/assets/svgs/heroicons/outline/puzzle.svg +3 -0
  184. data/app/assets/svgs/heroicons/outline/qrcode.svg +3 -0
  185. data/app/assets/svgs/heroicons/outline/question-mark-circle.svg +3 -0
  186. data/app/assets/svgs/heroicons/outline/receipt-refund.svg +3 -0
  187. data/app/assets/svgs/heroicons/outline/receipt-tax.svg +3 -0
  188. data/app/assets/svgs/heroicons/outline/refresh.svg +3 -0
  189. data/app/assets/svgs/heroicons/outline/reply.svg +3 -0
  190. data/app/assets/svgs/heroicons/outline/rewind.svg +3 -0
  191. data/app/assets/svgs/heroicons/outline/rss.svg +3 -0
  192. data/app/assets/svgs/heroicons/outline/save-as.svg +3 -0
  193. data/app/assets/svgs/heroicons/outline/save.svg +3 -0
  194. data/app/assets/svgs/heroicons/outline/scale.svg +3 -0
  195. data/app/assets/svgs/heroicons/outline/scissors.svg +3 -0
  196. data/app/assets/svgs/heroicons/outline/search-circle.svg +3 -0
  197. data/app/assets/svgs/heroicons/outline/search.svg +3 -0
  198. data/app/assets/svgs/heroicons/outline/selector.svg +3 -0
  199. data/app/assets/svgs/heroicons/outline/server.svg +3 -0
  200. data/app/assets/svgs/heroicons/outline/share.svg +3 -0
  201. data/app/assets/svgs/heroicons/outline/shield-check.svg +3 -0
  202. data/app/assets/svgs/heroicons/outline/shield-exclamation.svg +3 -0
  203. data/app/assets/svgs/heroicons/outline/shopping-bag.svg +3 -0
  204. data/app/assets/svgs/heroicons/outline/shopping-cart.svg +3 -0
  205. data/app/assets/svgs/heroicons/outline/sort-ascending.svg +3 -0
  206. data/app/assets/svgs/heroicons/outline/sort-descending.svg +3 -0
  207. data/app/assets/svgs/heroicons/outline/sparkles.svg +3 -0
  208. data/app/assets/svgs/heroicons/outline/speakerphone.svg +3 -0
  209. data/app/assets/svgs/heroicons/outline/star.svg +3 -0
  210. data/app/assets/svgs/heroicons/outline/status-offline.svg +3 -0
  211. data/app/assets/svgs/heroicons/outline/status-online.svg +3 -0
  212. data/app/assets/svgs/heroicons/outline/stop.svg +4 -0
  213. data/app/assets/svgs/heroicons/outline/sun.svg +3 -0
  214. data/app/assets/svgs/heroicons/outline/support.svg +3 -0
  215. data/app/assets/svgs/heroicons/outline/switch-horizontal.svg +3 -0
  216. data/app/assets/svgs/heroicons/outline/switch-vertical.svg +3 -0
  217. data/app/assets/svgs/heroicons/outline/table.svg +3 -0
  218. data/app/assets/svgs/heroicons/outline/tag.svg +3 -0
  219. data/app/assets/svgs/heroicons/outline/template.svg +3 -0
  220. data/app/assets/svgs/heroicons/outline/terminal.svg +3 -0
  221. data/app/assets/svgs/heroicons/outline/thumb-down.svg +3 -0
  222. data/app/assets/svgs/heroicons/outline/thumb-up.svg +3 -0
  223. data/app/assets/svgs/heroicons/outline/ticket.svg +3 -0
  224. data/app/assets/svgs/heroicons/outline/translate.svg +3 -0
  225. data/app/assets/svgs/heroicons/outline/trash.svg +3 -0
  226. data/app/assets/svgs/heroicons/outline/trending-down.svg +3 -0
  227. data/app/assets/svgs/heroicons/outline/trending-up.svg +3 -0
  228. data/app/assets/svgs/heroicons/outline/truck.svg +4 -0
  229. data/app/assets/svgs/heroicons/outline/upload.svg +3 -0
  230. data/app/assets/svgs/heroicons/outline/user-add.svg +3 -0
  231. data/app/assets/svgs/heroicons/outline/user-circle.svg +3 -0
  232. data/app/assets/svgs/heroicons/outline/user-group.svg +3 -0
  233. data/app/assets/svgs/heroicons/outline/user-remove.svg +3 -0
  234. data/app/assets/svgs/heroicons/outline/user.svg +3 -0
  235. data/app/assets/svgs/heroicons/outline/users.svg +3 -0
  236. data/app/assets/svgs/heroicons/outline/variable.svg +3 -0
  237. data/app/assets/svgs/heroicons/outline/video-camera.svg +3 -0
  238. data/app/assets/svgs/heroicons/outline/view-boards.svg +3 -0
  239. data/app/assets/svgs/heroicons/outline/view-grid-add.svg +3 -0
  240. data/app/assets/svgs/heroicons/outline/view-grid.svg +3 -0
  241. data/app/assets/svgs/heroicons/outline/view-list.svg +3 -0
  242. data/app/assets/svgs/heroicons/outline/volume-off.svg +4 -0
  243. data/app/assets/svgs/heroicons/outline/volume-up.svg +3 -0
  244. data/app/assets/svgs/heroicons/outline/wifi.svg +3 -0
  245. data/app/assets/svgs/heroicons/outline/x-circle.svg +3 -0
  246. data/app/assets/svgs/heroicons/outline/x.svg +3 -0
  247. data/app/assets/svgs/heroicons/outline/zoom-in.svg +3 -0
  248. data/app/assets/svgs/heroicons/outline/zoom-out.svg +3 -0
  249. data/app/assets/svgs/heroicons/solid/academic-cap.svg +3 -0
  250. data/app/assets/svgs/heroicons/solid/adjustments.svg +3 -0
  251. data/app/assets/svgs/heroicons/solid/annotation.svg +3 -0
  252. data/app/assets/svgs/heroicons/solid/archive.svg +4 -0
  253. data/app/assets/svgs/heroicons/solid/arrow-circle-down.svg +3 -0
  254. data/app/assets/svgs/heroicons/solid/arrow-circle-left.svg +3 -0
  255. data/app/assets/svgs/heroicons/solid/arrow-circle-right.svg +3 -0
  256. data/app/assets/svgs/heroicons/solid/arrow-circle-up.svg +3 -0
  257. data/app/assets/svgs/heroicons/solid/arrow-down.svg +3 -0
  258. data/app/assets/svgs/heroicons/solid/arrow-left.svg +3 -0
  259. data/app/assets/svgs/heroicons/solid/arrow-narrow-down.svg +3 -0
  260. data/app/assets/svgs/heroicons/solid/arrow-narrow-left.svg +3 -0
  261. data/app/assets/svgs/heroicons/solid/arrow-narrow-right.svg +3 -0
  262. data/app/assets/svgs/heroicons/solid/arrow-narrow-up.svg +3 -0
  263. data/app/assets/svgs/heroicons/solid/arrow-right.svg +3 -0
  264. data/app/assets/svgs/heroicons/solid/arrow-sm-down.svg +3 -0
  265. data/app/assets/svgs/heroicons/solid/arrow-sm-left.svg +3 -0
  266. data/app/assets/svgs/heroicons/solid/arrow-sm-right.svg +3 -0
  267. data/app/assets/svgs/heroicons/solid/arrow-sm-up.svg +3 -0
  268. data/app/assets/svgs/heroicons/solid/arrow-up.svg +3 -0
  269. data/app/assets/svgs/heroicons/solid/arrows-expand.svg +3 -0
  270. data/app/assets/svgs/heroicons/solid/at-symbol.svg +3 -0
  271. data/app/assets/svgs/heroicons/solid/backspace.svg +3 -0
  272. data/app/assets/svgs/heroicons/solid/badge-check.svg +3 -0
  273. data/app/assets/svgs/heroicons/solid/ban.svg +3 -0
  274. data/app/assets/svgs/heroicons/solid/beaker.svg +3 -0
  275. data/app/assets/svgs/heroicons/solid/bell.svg +3 -0
  276. data/app/assets/svgs/heroicons/solid/book-open.svg +3 -0
  277. data/app/assets/svgs/heroicons/solid/bookmark-alt.svg +3 -0
  278. data/app/assets/svgs/heroicons/solid/bookmark.svg +3 -0
  279. data/app/assets/svgs/heroicons/solid/briefcase.svg +4 -0
  280. data/app/assets/svgs/heroicons/solid/cake.svg +3 -0
  281. data/app/assets/svgs/heroicons/solid/calculator.svg +3 -0
  282. data/app/assets/svgs/heroicons/solid/calendar.svg +3 -0
  283. data/app/assets/svgs/heroicons/solid/camera.svg +3 -0
  284. data/app/assets/svgs/heroicons/solid/cash.svg +3 -0
  285. data/app/assets/svgs/heroicons/solid/chart-bar.svg +3 -0
  286. data/app/assets/svgs/heroicons/solid/chart-pie.svg +4 -0
  287. data/app/assets/svgs/heroicons/solid/chart-square-bar.svg +3 -0
  288. data/app/assets/svgs/heroicons/solid/chat-alt-2.svg +4 -0
  289. data/app/assets/svgs/heroicons/solid/chat-alt.svg +3 -0
  290. data/app/assets/svgs/heroicons/solid/chat.svg +3 -0
  291. data/app/assets/svgs/heroicons/solid/check-circle.svg +3 -0
  292. data/app/assets/svgs/heroicons/solid/check.svg +3 -0
  293. data/app/assets/svgs/heroicons/solid/chevron-double-down.svg +3 -0
  294. data/app/assets/svgs/heroicons/solid/chevron-double-left.svg +3 -0
  295. data/app/assets/svgs/heroicons/solid/chevron-double-right.svg +4 -0
  296. data/app/assets/svgs/heroicons/solid/chevron-double-up.svg +3 -0
  297. data/app/assets/svgs/heroicons/solid/chevron-down.svg +3 -0
  298. data/app/assets/svgs/heroicons/solid/chevron-left.svg +3 -0
  299. data/app/assets/svgs/heroicons/solid/chevron-right.svg +3 -0
  300. data/app/assets/svgs/heroicons/solid/chevron-up.svg +3 -0
  301. data/app/assets/svgs/heroicons/solid/chip.svg +4 -0
  302. data/app/assets/svgs/heroicons/solid/clipboard-check.svg +4 -0
  303. data/app/assets/svgs/heroicons/solid/clipboard-copy.svg +4 -0
  304. data/app/assets/svgs/heroicons/solid/clipboard-list.svg +4 -0
  305. data/app/assets/svgs/heroicons/solid/clipboard.svg +4 -0
  306. data/app/assets/svgs/heroicons/solid/clock.svg +3 -0
  307. data/app/assets/svgs/heroicons/solid/cloud-download.svg +3 -0
  308. data/app/assets/svgs/heroicons/solid/cloud-upload.svg +4 -0
  309. data/app/assets/svgs/heroicons/solid/cloud.svg +3 -0
  310. data/app/assets/svgs/heroicons/solid/code.svg +3 -0
  311. data/app/assets/svgs/heroicons/solid/cog.svg +3 -0
  312. data/app/assets/svgs/heroicons/solid/collection.svg +3 -0
  313. data/app/assets/svgs/heroicons/solid/color-swatch.svg +3 -0
  314. data/app/assets/svgs/heroicons/solid/credit-card.svg +4 -0
  315. data/app/assets/svgs/heroicons/solid/cube-transparent.svg +3 -0
  316. data/app/assets/svgs/heroicons/solid/cube.svg +3 -0
  317. data/app/assets/svgs/heroicons/solid/currency-bangladeshi.svg +3 -0
  318. data/app/assets/svgs/heroicons/solid/currency-dollar.svg +4 -0
  319. data/app/assets/svgs/heroicons/solid/currency-euro.svg +3 -0
  320. data/app/assets/svgs/heroicons/solid/currency-pound.svg +3 -0
  321. data/app/assets/svgs/heroicons/solid/currency-rupee.svg +3 -0
  322. data/app/assets/svgs/heroicons/solid/currency-yen.svg +3 -0
  323. data/app/assets/svgs/heroicons/solid/cursor-click.svg +3 -0
  324. data/app/assets/svgs/heroicons/solid/database.svg +5 -0
  325. data/app/assets/svgs/heroicons/solid/desktop-computer.svg +3 -0
  326. data/app/assets/svgs/heroicons/solid/device-mobile.svg +3 -0
  327. data/app/assets/svgs/heroicons/solid/device-tablet.svg +3 -0
  328. data/app/assets/svgs/heroicons/solid/document-add.svg +3 -0
  329. data/app/assets/svgs/heroicons/solid/document-download.svg +3 -0
  330. data/app/assets/svgs/heroicons/solid/document-duplicate.svg +4 -0
  331. data/app/assets/svgs/heroicons/solid/document-remove.svg +3 -0
  332. data/app/assets/svgs/heroicons/solid/document-report.svg +3 -0
  333. data/app/assets/svgs/heroicons/solid/document-search.svg +4 -0
  334. data/app/assets/svgs/heroicons/solid/document-text.svg +3 -0
  335. data/app/assets/svgs/heroicons/solid/document.svg +3 -0
  336. data/app/assets/svgs/heroicons/solid/dots-circle-horizontal.svg +3 -0
  337. data/app/assets/svgs/heroicons/solid/dots-horizontal.svg +3 -0
  338. data/app/assets/svgs/heroicons/solid/dots-vertical.svg +3 -0
  339. data/app/assets/svgs/heroicons/solid/download.svg +3 -0
  340. data/app/assets/svgs/heroicons/solid/duplicate.svg +4 -0
  341. data/app/assets/svgs/heroicons/solid/emoji-happy.svg +3 -0
  342. data/app/assets/svgs/heroicons/solid/emoji-sad.svg +3 -0
  343. data/app/assets/svgs/heroicons/solid/exclamation-circle.svg +3 -0
  344. data/app/assets/svgs/heroicons/solid/exclamation.svg +3 -0
  345. data/app/assets/svgs/heroicons/solid/external-link.svg +4 -0
  346. data/app/assets/svgs/heroicons/solid/eye-off.svg +4 -0
  347. data/app/assets/svgs/heroicons/solid/eye.svg +4 -0
  348. data/app/assets/svgs/heroicons/solid/fast-forward.svg +3 -0
  349. data/app/assets/svgs/heroicons/solid/film.svg +3 -0
  350. data/app/assets/svgs/heroicons/solid/filter.svg +3 -0
  351. data/app/assets/svgs/heroicons/solid/finger-print.svg +5 -0
  352. data/app/assets/svgs/heroicons/solid/fire.svg +3 -0
  353. data/app/assets/svgs/heroicons/solid/flag.svg +3 -0
  354. data/app/assets/svgs/heroicons/solid/folder-add.svg +3 -0
  355. data/app/assets/svgs/heroicons/solid/folder-download.svg +3 -0
  356. data/app/assets/svgs/heroicons/solid/folder-open.svg +4 -0
  357. data/app/assets/svgs/heroicons/solid/folder-remove.svg +3 -0
  358. data/app/assets/svgs/heroicons/solid/folder.svg +3 -0
  359. data/app/assets/svgs/heroicons/solid/gift.svg +4 -0
  360. data/app/assets/svgs/heroicons/solid/globe-alt.svg +3 -0
  361. data/app/assets/svgs/heroicons/solid/globe.svg +3 -0
  362. data/app/assets/svgs/heroicons/solid/hand.svg +3 -0
  363. data/app/assets/svgs/heroicons/solid/hashtag.svg +3 -0
  364. data/app/assets/svgs/heroicons/solid/heart.svg +3 -0
  365. data/app/assets/svgs/heroicons/solid/home.svg +3 -0
  366. data/app/assets/svgs/heroicons/solid/identification.svg +3 -0
  367. data/app/assets/svgs/heroicons/solid/inbox-in.svg +4 -0
  368. data/app/assets/svgs/heroicons/solid/inbox.svg +3 -0
  369. data/app/assets/svgs/heroicons/solid/information-circle.svg +3 -0
  370. data/app/assets/svgs/heroicons/solid/key.svg +3 -0
  371. data/app/assets/svgs/heroicons/solid/library.svg +3 -0
  372. data/app/assets/svgs/heroicons/solid/light-bulb.svg +3 -0
  373. data/app/assets/svgs/heroicons/solid/lightning-bolt.svg +3 -0
  374. data/app/assets/svgs/heroicons/solid/link.svg +3 -0
  375. data/app/assets/svgs/heroicons/solid/location-marker.svg +3 -0
  376. data/app/assets/svgs/heroicons/solid/lock-closed.svg +3 -0
  377. data/app/assets/svgs/heroicons/solid/lock-open.svg +3 -0
  378. data/app/assets/svgs/heroicons/solid/login.svg +3 -0
  379. data/app/assets/svgs/heroicons/solid/logout.svg +3 -0
  380. data/app/assets/svgs/heroicons/solid/mail-open.svg +3 -0
  381. data/app/assets/svgs/heroicons/solid/mail.svg +4 -0
  382. data/app/assets/svgs/heroicons/solid/map.svg +3 -0
  383. data/app/assets/svgs/heroicons/solid/menu-alt-1.svg +3 -0
  384. data/app/assets/svgs/heroicons/solid/menu-alt-2.svg +3 -0
  385. data/app/assets/svgs/heroicons/solid/menu-alt-3.svg +3 -0
  386. data/app/assets/svgs/heroicons/solid/menu-alt-4.svg +3 -0
  387. data/app/assets/svgs/heroicons/solid/menu.svg +3 -0
  388. data/app/assets/svgs/heroicons/solid/microphone.svg +3 -0
  389. data/app/assets/svgs/heroicons/solid/minus-circle.svg +3 -0
  390. data/app/assets/svgs/heroicons/solid/minus-sm.svg +3 -0
  391. data/app/assets/svgs/heroicons/solid/minus.svg +3 -0
  392. data/app/assets/svgs/heroicons/solid/moon.svg +3 -0
  393. data/app/assets/svgs/heroicons/solid/music-note.svg +3 -0
  394. data/app/assets/svgs/heroicons/solid/newspaper.svg +4 -0
  395. data/app/assets/svgs/heroicons/solid/office-building.svg +3 -0
  396. data/app/assets/svgs/heroicons/solid/paper-airplane.svg +3 -0
  397. data/app/assets/svgs/heroicons/solid/paper-clip.svg +3 -0
  398. data/app/assets/svgs/heroicons/solid/pause.svg +3 -0
  399. data/app/assets/svgs/heroicons/solid/pencil-alt.svg +4 -0
  400. data/app/assets/svgs/heroicons/solid/pencil.svg +3 -0
  401. data/app/assets/svgs/heroicons/solid/phone-incoming.svg +4 -0
  402. data/app/assets/svgs/heroicons/solid/phone-missed-call.svg +4 -0
  403. data/app/assets/svgs/heroicons/solid/phone-outgoing.svg +4 -0
  404. data/app/assets/svgs/heroicons/solid/phone.svg +3 -0
  405. data/app/assets/svgs/heroicons/solid/photograph.svg +3 -0
  406. data/app/assets/svgs/heroicons/solid/play.svg +3 -0
  407. data/app/assets/svgs/heroicons/solid/plus-circle.svg +3 -0
  408. data/app/assets/svgs/heroicons/solid/plus-sm.svg +3 -0
  409. data/app/assets/svgs/heroicons/solid/plus.svg +3 -0
  410. data/app/assets/svgs/heroicons/solid/presentation-chart-bar.svg +3 -0
  411. data/app/assets/svgs/heroicons/solid/presentation-chart-line.svg +3 -0
  412. data/app/assets/svgs/heroicons/solid/printer.svg +3 -0
  413. data/app/assets/svgs/heroicons/solid/puzzle.svg +3 -0
  414. data/app/assets/svgs/heroicons/solid/qrcode.svg +4 -0
  415. data/app/assets/svgs/heroicons/solid/question-mark-circle.svg +3 -0
  416. data/app/assets/svgs/heroicons/solid/receipt-refund.svg +3 -0
  417. data/app/assets/svgs/heroicons/solid/receipt-tax.svg +3 -0
  418. data/app/assets/svgs/heroicons/solid/refresh.svg +3 -0
  419. data/app/assets/svgs/heroicons/solid/reply.svg +3 -0
  420. data/app/assets/svgs/heroicons/solid/rewind.svg +3 -0
  421. data/app/assets/svgs/heroicons/solid/rss.svg +4 -0
  422. data/app/assets/svgs/heroicons/solid/save-as.svg +4 -0
  423. data/app/assets/svgs/heroicons/solid/save.svg +3 -0
  424. data/app/assets/svgs/heroicons/solid/scale.svg +3 -0
  425. data/app/assets/svgs/heroicons/solid/scissors.svg +4 -0
  426. data/app/assets/svgs/heroicons/solid/search-circle.svg +4 -0
  427. data/app/assets/svgs/heroicons/solid/search.svg +3 -0
  428. data/app/assets/svgs/heroicons/solid/selector.svg +3 -0
  429. data/app/assets/svgs/heroicons/solid/server.svg +3 -0
  430. data/app/assets/svgs/heroicons/solid/share.svg +3 -0
  431. data/app/assets/svgs/heroicons/solid/shield-check.svg +3 -0
  432. data/app/assets/svgs/heroicons/solid/shield-exclamation.svg +3 -0
  433. data/app/assets/svgs/heroicons/solid/shopping-bag.svg +3 -0
  434. data/app/assets/svgs/heroicons/solid/shopping-cart.svg +3 -0
  435. data/app/assets/svgs/heroicons/solid/sort-ascending.svg +3 -0
  436. data/app/assets/svgs/heroicons/solid/sort-descending.svg +3 -0
  437. data/app/assets/svgs/heroicons/solid/sparkles.svg +3 -0
  438. data/app/assets/svgs/heroicons/solid/speakerphone.svg +3 -0
  439. data/app/assets/svgs/heroicons/solid/star.svg +3 -0
  440. data/app/assets/svgs/heroicons/solid/status-offline.svg +3 -0
  441. data/app/assets/svgs/heroicons/solid/status-online.svg +3 -0
  442. data/app/assets/svgs/heroicons/solid/stop.svg +3 -0
  443. data/app/assets/svgs/heroicons/solid/sun.svg +3 -0
  444. data/app/assets/svgs/heroicons/solid/support.svg +3 -0
  445. data/app/assets/svgs/heroicons/solid/switch-horizontal.svg +3 -0
  446. data/app/assets/svgs/heroicons/solid/switch-vertical.svg +3 -0
  447. data/app/assets/svgs/heroicons/solid/table.svg +3 -0
  448. data/app/assets/svgs/heroicons/solid/tag.svg +3 -0
  449. data/app/assets/svgs/heroicons/solid/template.svg +3 -0
  450. data/app/assets/svgs/heroicons/solid/terminal.svg +3 -0
  451. data/app/assets/svgs/heroicons/solid/thumb-down.svg +3 -0
  452. data/app/assets/svgs/heroicons/solid/thumb-up.svg +3 -0
  453. data/app/assets/svgs/heroicons/solid/ticket.svg +3 -0
  454. data/app/assets/svgs/heroicons/solid/translate.svg +3 -0
  455. data/app/assets/svgs/heroicons/solid/trash.svg +3 -0
  456. data/app/assets/svgs/heroicons/solid/trending-down.svg +3 -0
  457. data/app/assets/svgs/heroicons/solid/trending-up.svg +3 -0
  458. data/app/assets/svgs/heroicons/solid/truck.svg +4 -0
  459. data/app/assets/svgs/heroicons/solid/upload.svg +3 -0
  460. data/app/assets/svgs/heroicons/solid/user-add.svg +3 -0
  461. data/app/assets/svgs/heroicons/solid/user-circle.svg +3 -0
  462. data/app/assets/svgs/heroicons/solid/user-group.svg +3 -0
  463. data/app/assets/svgs/heroicons/solid/user-remove.svg +3 -0
  464. data/app/assets/svgs/heroicons/solid/user.svg +3 -0
  465. data/app/assets/svgs/heroicons/solid/users.svg +3 -0
  466. data/app/assets/svgs/heroicons/solid/variable.svg +3 -0
  467. data/app/assets/svgs/heroicons/solid/video-camera.svg +3 -0
  468. data/app/assets/svgs/heroicons/solid/view-boards.svg +3 -0
  469. data/app/assets/svgs/heroicons/solid/view-grid-add.svg +3 -0
  470. data/app/assets/svgs/heroicons/solid/view-grid.svg +3 -0
  471. data/app/assets/svgs/heroicons/solid/view-list.svg +3 -0
  472. data/app/assets/svgs/heroicons/solid/volume-off.svg +3 -0
  473. data/app/assets/svgs/heroicons/solid/volume-up.svg +3 -0
  474. data/app/assets/svgs/heroicons/solid/wifi.svg +3 -0
  475. data/app/assets/svgs/{x-circle-sm.svg → heroicons/solid/x-circle.svg} +2 -2
  476. data/app/assets/svgs/heroicons/solid/x.svg +3 -0
  477. data/app/assets/svgs/heroicons/solid/zoom-in.svg +4 -0
  478. data/app/assets/svgs/heroicons/solid/zoom-out.svg +4 -0
  479. data/app/assets/svgs/logout.svg +3 -0
  480. data/app/assets/svgs/menu-back.svg +4 -0
  481. data/app/assets/svgs/menu.svg +3 -0
  482. data/app/assets/svgs/resources-icon.svg +13 -0
  483. data/app/assets/svgs/table-empty-state.svg +57 -0
  484. data/app/assets/svgs/table-view-type.svg +6 -0
  485. data/app/assets/svgs/three-dots.svg +5 -0
  486. data/app/assets/svgs/tools-icon.svg +3 -0
  487. data/app/assets/svgs/trash.svg +7 -1
  488. data/app/assets/svgs/user-circle.svg +3 -0
  489. data/app/components/avo/actions_component.html.erb +43 -0
  490. data/app/components/avo/actions_component.rb +14 -0
  491. data/app/components/avo/alert_component.html.erb +25 -1
  492. data/app/components/avo/alert_component.rb +24 -0
  493. data/app/components/avo/button_component.html.erb +1 -0
  494. data/app/components/avo/button_component.rb +143 -0
  495. data/app/components/avo/card_component.html.erb +40 -0
  496. data/app/components/avo/card_component.rb +11 -0
  497. data/app/components/avo/common_field_wrapper_component.html.erb +15 -0
  498. data/app/components/avo/common_field_wrapper_component.rb +20 -0
  499. data/app/components/avo/dashboards/divider_component.html.erb +9 -0
  500. data/app/components/avo/dashboards/divider_component.rb +19 -0
  501. data/app/components/avo/edit/field_wrapper_component.html.erb +10 -19
  502. data/app/components/avo/edit/field_wrapper_component.rb +0 -8
  503. data/app/components/avo/empty_state_component.html.erb +12 -0
  504. data/app/components/avo/empty_state_component.rb +24 -0
  505. data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +2 -1
  506. data/app/components/avo/fields/boolean_field/edit_component.html.erb +1 -1
  507. data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
  508. data/app/components/avo/fields/boolean_group_field/edit_component.html.erb +1 -1
  509. data/app/components/avo/fields/common/boolean_check_component.html.erb +4 -4
  510. data/app/components/avo/fields/common/boolean_group_component.html.erb +2 -2
  511. data/app/components/avo/fields/common/files_list_viewer_component.html.erb +2 -2
  512. data/app/components/avo/fields/common/gravatar_viewer_component.html.erb +1 -1
  513. data/app/components/avo/fields/common/heading_component.html.erb +2 -2
  514. data/app/components/avo/fields/common/key_value_component.html.erb +2 -2
  515. data/app/components/avo/fields/common/single_file_viewer_component.html.erb +42 -23
  516. data/app/components/avo/fields/common/single_file_viewer_component.rb +34 -6
  517. data/app/components/avo/fields/common/status_viewer_component.html.erb +2 -2
  518. data/app/components/avo/fields/external_image_field/index_component.html.erb +1 -1
  519. data/app/components/avo/fields/file_field/edit_component.html.erb +1 -1
  520. data/app/components/avo/fields/file_field/show_component.html.erb +1 -1
  521. data/app/components/avo/fields/has_many_field/show_component.html.erb +1 -1
  522. data/app/components/avo/fields/has_one_field/show_component.html.erb +4 -4
  523. data/app/components/avo/fields/heading_field/edit_component.html.erb +1 -1
  524. data/app/components/avo/fields/heading_field/show_component.html.erb +1 -1
  525. data/app/components/avo/fields/trix_field/edit_component.html.erb +1 -0
  526. data/app/components/avo/filters_component.html.erb +37 -0
  527. data/app/components/avo/filters_component.rb +14 -0
  528. data/app/components/avo/{alerts_component.html.erb → flash_alerts_component.html.erb} +1 -1
  529. data/app/components/avo/flash_alerts_component.rb +9 -0
  530. data/app/components/avo/index/field_wrapper_component.html.erb +8 -2
  531. data/app/components/avo/index/field_wrapper_component.rb +2 -1
  532. data/app/components/avo/index/grid_item_component.html.erb +13 -10
  533. data/app/components/avo/index/ordering/buttons_component.rb +2 -0
  534. data/app/components/avo/index/resource_controls_component.html.erb +6 -5
  535. data/app/components/avo/index/resource_grid_component.html.erb +3 -3
  536. data/app/components/avo/index/resource_table_component.html.erb +10 -14
  537. data/app/components/avo/index/table_row_component.html.erb +1 -1
  538. data/app/components/avo/modal_component.html.erb +9 -7
  539. data/app/{views/avo/partials/_paginator.html.erb → components/avo/paginator_component.html.erb} +16 -16
  540. data/app/components/avo/paginator_component.rb +17 -0
  541. data/app/components/avo/panel_component.html.erb +21 -17
  542. data/app/components/avo/panel_component.rb +8 -2
  543. data/app/components/avo/profile_item_component.html.erb +3 -0
  544. data/app/components/avo/profile_item_component.rb +11 -0
  545. data/app/components/avo/resource_component.rb +1 -1
  546. data/app/components/avo/show/field_wrapper_component.html.erb +8 -15
  547. data/app/components/avo/show/field_wrapper_component.rb +0 -4
  548. data/app/components/avo/sidebar_component.html.erb +51 -0
  549. data/app/components/avo/sidebar_component.rb +19 -0
  550. data/app/components/avo/sidebar_heading_component.html.erb +3 -0
  551. data/app/components/avo/sidebar_heading_component.rb +11 -0
  552. data/app/components/avo/sidebar_item_component.html.erb +3 -0
  553. data/app/components/avo/sidebar_item_component.rb +10 -0
  554. data/app/components/avo/sidebar_profile_component.html.erb +36 -0
  555. data/app/components/avo/sidebar_profile_component.rb +43 -0
  556. data/app/components/avo/turbo_frame_wrapper_component.html.erb +8 -9
  557. data/app/components/avo/views/resource_edit_component.html.erb +16 -19
  558. data/app/components/avo/views/resource_index_component.html.erb +44 -35
  559. data/app/components/avo/views/resource_new_component.html.erb +18 -16
  560. data/app/components/avo/views/resource_show_component.html.erb +36 -34
  561. data/app/components/avo/views/resource_show_component.rb +2 -3
  562. data/app/controllers/avo/application_controller.rb +43 -12
  563. data/app/controllers/avo/{relations_controller.rb → associations_controller.rb} +1 -3
  564. data/app/controllers/avo/attachments_controller.rb +1 -5
  565. data/app/controllers/avo/base_controller.rb +20 -24
  566. data/app/controllers/avo/dashboards_controller.rb +28 -0
  567. data/app/controllers/avo/private_controller.rb +8 -0
  568. data/app/helpers/avo/application_helper.rb +29 -47
  569. data/app/helpers/avo/resources_helper.rb +2 -2
  570. data/app/helpers/avo/url_helpers.rb +5 -9
  571. data/app/javascript/avo.js +22 -2
  572. data/app/javascript/js/application.js +2 -1
  573. data/app/javascript/js/controllers/actions_picker_controller.js +12 -10
  574. data/app/javascript/js/controllers/dashboard_card_controller.js +33 -0
  575. data/app/javascript/js/controllers/item_selector_controller.js +8 -4
  576. data/app/javascript/js/controllers/mobile_controller.js +9 -0
  577. data/app/javascript/js/controllers/select_controller.js +23 -0
  578. data/app/javascript/js/controllers.js +6 -0
  579. data/app/views/avo/actions/show.html.erb +22 -17
  580. data/app/views/avo/{relations → associations}/new.html.erb +16 -6
  581. data/app/views/avo/base/_multiple_select_filter.html.erb +5 -1
  582. data/app/views/avo/base/_text_filter.html.erb +3 -1
  583. data/app/views/avo/base/show.html.erb +1 -1
  584. data/app/views/avo/dashboards/_chartkick_card.html.erb +3 -0
  585. data/app/views/avo/dashboards/_metric_card.html.erb +5 -0
  586. data/app/views/avo/dashboards/card.html.erb +3 -0
  587. data/app/views/avo/dashboards/show.html.erb +35 -0
  588. data/app/views/avo/home/index.html.erb +1 -5
  589. data/app/views/avo/partials/_custom_tools_alert.html.erb +2 -2
  590. data/app/views/avo/partials/_global_search.html.erb +3 -3
  591. data/app/views/avo/partials/_header.html.erb +1 -1
  592. data/app/views/avo/partials/_logo.html.erb +1 -1
  593. data/app/views/avo/partials/_navbar.html.erb +11 -0
  594. data/app/views/avo/partials/_resource_search.html.erb +1 -1
  595. data/app/views/avo/partials/_sortable_component.html.erb +1 -1
  596. data/app/views/avo/partials/_table_header.html.erb +4 -4
  597. data/app/views/avo/partials/_view_toggle_button.html.erb +36 -16
  598. data/app/views/avo/private/_links_and_buttons.html.erb +57 -0
  599. data/app/views/avo/private/design.html.erb +27 -0
  600. data/app/views/layouts/avo/application.html.erb +20 -31
  601. data/avo.gemspec +4 -2
  602. data/config/routes.rb +19 -11
  603. data/lib/avo/app.rb +30 -3
  604. data/lib/avo/base_resource.rb +6 -8
  605. data/lib/avo/dashboards/base_card.rb +151 -0
  606. data/lib/avo/dashboards/base_dashboard.rb +54 -0
  607. data/lib/avo/dashboards/base_divider.rb +23 -0
  608. data/lib/avo/dashboards/chartkick_card.rb +77 -0
  609. data/lib/avo/dashboards/metric_card.rb +9 -0
  610. data/lib/avo/dashboards/partial_card.rb +7 -0
  611. data/lib/avo/dynamic_router.rb +3 -0
  612. data/lib/avo/engine.rb +5 -1
  613. data/lib/avo/fields/date_field.rb +1 -1
  614. data/lib/avo/fields/gravatar_field.rb +2 -2
  615. data/lib/avo/hosts/dashboard_card.rb +21 -0
  616. data/lib/avo/hosts/ordering.rb +1 -1
  617. data/lib/avo/licensing/license.rb +4 -2
  618. data/lib/avo/licensing/pro_license.rb +2 -1
  619. data/lib/avo/version.rb +1 -1
  620. data/lib/avo.rb +24 -1
  621. data/lib/generators/avo/chartkick_card_generator.rb +16 -0
  622. data/lib/generators/avo/dashboard_generator.rb +16 -0
  623. data/lib/generators/avo/metric_card_generator.rb +16 -0
  624. data/lib/generators/avo/partial_card_generator.rb +17 -0
  625. data/lib/generators/avo/templates/cards/chartkick_card.tt +16 -0
  626. data/lib/generators/avo/templates/cards/chartkick_card_sample.tt +26 -0
  627. data/lib/generators/avo/templates/cards/metric_card.tt +8 -0
  628. data/lib/generators/avo/templates/cards/metric_card_sample.tt +38 -0
  629. data/lib/generators/avo/templates/cards/partial_card.tt +8 -0
  630. data/lib/generators/avo/templates/cards/partial_card_partial.tt +8 -0
  631. data/lib/generators/avo/templates/cards/partial_card_sample.tt +8 -0
  632. data/lib/generators/avo/templates/dashboards/dashboard.tt +9 -0
  633. data/lib/generators/avo/templates/locales/avo.en.yml +11 -4
  634. data/lib/generators/avo/templates/locales/avo.nb-NO.yml +5 -2
  635. data/lib/generators/avo/templates/locales/avo.pt-BR.yml +4 -2
  636. data/lib/generators/avo/templates/locales/avo.ro.yml +4 -1
  637. data/lib/generators/avo/templates/tool/sidebar_item.tt +1 -1
  638. data/public/avo-assets/avo.css +1300 -1121
  639. data/public/avo-assets/avo.js +348 -88688
  640. data/public/avo-assets/avo.js.map +3 -3
  641. data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
  642. data/public/avo-assets/fonts/inter-v7-latin-500.svg +351 -0
  643. data/public/avo-assets/fonts/inter-v7-latin-500.ttf +0 -0
  644. data/public/avo-assets/fonts/inter-v7-latin-500.woff +0 -0
  645. data/public/avo-assets/fonts/inter-v7-latin-500.woff2 +0 -0
  646. data/public/avo-assets/fonts/inter-v7-latin-600.eot +0 -0
  647. data/public/avo-assets/fonts/inter-v7-latin-600.svg +351 -0
  648. data/public/avo-assets/fonts/inter-v7-latin-600.ttf +0 -0
  649. data/public/avo-assets/fonts/inter-v7-latin-600.woff +0 -0
  650. data/public/avo-assets/fonts/inter-v7-latin-600.woff2 +0 -0
  651. data/public/avo-assets/fonts/inter-v7-latin-700.eot +0 -0
  652. data/public/avo-assets/fonts/inter-v7-latin-700.svg +352 -0
  653. data/public/avo-assets/fonts/inter-v7-latin-700.ttf +0 -0
  654. data/public/avo-assets/fonts/inter-v7-latin-700.woff +0 -0
  655. data/public/avo-assets/fonts/inter-v7-latin-700.woff2 +0 -0
  656. data/public/avo-assets/fonts/inter-v7-latin-regular.eot +0 -0
  657. data/public/avo-assets/fonts/inter-v7-latin-regular.svg +351 -0
  658. data/public/avo-assets/fonts/inter-v7-latin-regular.ttf +0 -0
  659. data/public/avo-assets/fonts/inter-v7-latin-regular.woff +0 -0
  660. data/public/avo-assets/fonts/inter-v7-latin-regular.woff2 +0 -0
  661. data/public/avo-assets/logo-on-white.png +0 -0
  662. data/public/avo-assets/logo.png +0 -0
  663. metadata +579 -50
  664. data/app/assets/builds/action_cable.js +0 -2
  665. data/app/assets/builds/action_cable.js.map +0 -7
  666. data/app/assets/builds/application.js +0 -2
  667. data/app/assets/builds/application.js.map +0 -7
  668. data/app/assets/builds/avo.css +0 -8610
  669. data/app/assets/builds/avo.js +0 -88762
  670. data/app/assets/builds/avo.js.map +0 -7
  671. data/app/assets/builds/avo_custom.js +0 -6
  672. data/app/assets/builds/avo_custom.js.map +0 -7
  673. data/app/assets/images/avo/logo.png +0 -0
  674. data/app/assets/svgs/check-circle-sm.svg +0 -3
  675. data/app/components/avo/alerts_component.rb +0 -5
  676. data/app/components/avo/fields/common/multiple_file_viewer_component.html.erb +0 -35
  677. data/app/components/avo/fields/common/multiple_file_viewer_component.rb +0 -15
  678. data/app/components/avo/navigation_heading_component.html.erb +0 -3
  679. data/app/components/avo/navigation_heading_component.rb +0 -7
  680. data/app/components/avo/navigation_link_component.html.erb +0 -3
  681. data/app/components/avo/navigation_link_component.rb +0 -11
  682. data/app/javascript/js/toastr.js +0 -10
  683. data/app/views/avo/attachments/show.html.erb +0 -14
  684. data/app/views/avo/base/_actions.html.erb +0 -36
  685. data/app/views/avo/base/_filters.html.erb +0 -34
  686. data/app/views/avo/partials/_a_button.html.erb +0 -7
  687. data/app/views/avo/partials/_a_link.html.erb +0 -7
  688. data/app/views/avo/partials/_empty_state.html.erb +0 -17
  689. data/app/views/avo/partials/_profile_dropdown.html.erb +0 -25
  690. data/app/views/avo/sidebar/_sidebar.html.erb +0 -31
  691. data/lib/avo/services/panel_service.rb +0 -27
  692. data/public/avo-assets/fonts/nunito-v16-latin-700.eot +0 -0
  693. data/public/avo-assets/fonts/nunito-v16-latin-700.svg +0 -388
  694. data/public/avo-assets/fonts/nunito-v16-latin-700.ttf +0 -0
  695. data/public/avo-assets/fonts/nunito-v16-latin-700.woff +0 -0
  696. data/public/avo-assets/fonts/nunito-v16-latin-700.woff2 +0 -0
  697. data/public/avo-assets/fonts/nunito-v16-latin-regular.eot +0 -0
  698. data/public/avo-assets/fonts/nunito-v16-latin-regular.svg +0 -380
  699. data/public/avo-assets/fonts/nunito-v16-latin-regular.ttf +0 -0
  700. data/public/avo-assets/fonts/nunito-v16-latin-regular.woff +0 -0
  701. data/public/avo-assets/fonts/nunito-v16-latin-regular.woff2 +0 -0
@@ -1,6 +0,0 @@
1
- (()=>{var X=Object.defineProperty;var Y=(r,e,t)=>e in r?X(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var g=(r,e,t)=>(Y(r,typeof e!="symbol"?e+"":e,t),t);var f=(r,e,t)=>new Promise((s,n)=>{var i=a=>{try{c(t.next(a))}catch(u){n(u)}},o=a=>{try{c(t.throw(a))}catch(u){n(u)}},c=a=>a.done?s(a.value):Promise.resolve(a.value).then(i,o);c((t=t.apply(r,e)).next())});var k=class{constructor(e,t,s){this.eventTarget=e,this.eventName=t,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){let t=ee(e);for(let s of this.bindings){if(t.immediatePropagationStopped)break;s.handleEvent(t)}}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{let s=e.index,n=t.index;return s<n?-1:s>n?1:0})}};function ee(r){if("immediatePropagationStopped"in r)return r;{let{stopImmediatePropagation:e}=r;return Object.assign(r,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,e.call(this)}})}}var B=class{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e){this.fetchEventListenerForBinding(e).bindingDisconnected(e)}handleError(e,t,s={}){this.application.handleError(e,`Error ${t}`,s)}fetchEventListenerForBinding(e){let{eventTarget:t,eventName:s,eventOptions:n}=e;return this.fetchEventListener(t,s,n)}fetchEventListener(e,t,s){let n=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,s),o=n.get(i);return o||(o=this.createEventListener(e,t,s),n.set(i,o)),o}createEventListener(e,t,s){let n=new k(e,t,s);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){let s=[e];return Object.keys(t).sort().forEach(n=>{s.push(`${t[n]?"":"!"}${n}`)}),s.join(":")}},te=/^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;function se(r){let t=r.trim().match(te)||[];return{eventTarget:re(t[4]),eventName:t[2],eventOptions:t[9]?ne(t[9]):{},identifier:t[5],methodName:t[7]}}function re(r){if(r=="window")return window;if(r=="document")return document}function ne(r){return r.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})}function ie(r){if(r==window)return"window";if(r==document)return"document"}function S(r){return r.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function p(r){return r.charAt(0).toUpperCase()+r.slice(1)}function N(r){return r.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function oe(r){return r.match(/[^\s]+/g)||[]}var F=class{constructor(e,t,s){this.element=e,this.index=t,this.eventTarget=s.eventTarget||e,this.eventName=s.eventName||ae(e)||y("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||y("missing identifier"),this.methodName=s.methodName||y("missing method name")}static forToken(e){return new this(e.element,e.index,se(e.content))}toString(){let e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}->${this.identifier}#${this.methodName}`}get params(){return this.eventTarget instanceof Element?this.getParamsFromEventTargetAttributes(this.eventTarget):{}}getParamsFromEventTargetAttributes(e){let t={},s=new RegExp(`^data-${this.identifier}-(.+)-param$`);return Array.from(e.attributes).forEach(({name:i,value:o})=>{let c=i.match(s),a=c&&c[1];a&&Object.assign(t,{[S(a)]:ce(o)})}),t}get eventTargetName(){return ie(this.eventTarget)}},T={a:r=>"click",button:r=>"click",form:r=>"submit",details:r=>"toggle",input:r=>r.getAttribute("type")=="submit"?"click":"input",select:r=>"change",textarea:r=>"input"};function ae(r){let e=r.tagName.toLowerCase();if(e in T)return T[e](r)}function y(r){throw new Error(r)}function ce(r){try{return JSON.parse(r)}catch{return r}}var x=class{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){this.willBeInvokedByEvent(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){let e=this.controller[this.methodName];if(typeof e=="function")return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}invokeWithEvent(e){let{target:t,currentTarget:s}=e;try{let{params:n}=this.action,i=Object.assign(e,{params:n});this.method.call(this.controller,i),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:s,action:this.methodName})}catch(n){let{identifier:i,controller:o,element:c,index:a}=this,u={identifier:i,controller:o,element:c,index:a,event:e};this.context.handleError(n,`invoking action "${this.action}"`,u)}}willBeInvokedByEvent(e){let t=e.target;return this.element===t?!0:t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},V=class{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let e=new Set(this.matchElementsInTree());for(let t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(let t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){e.type=="attributes"?this.processAttributeChange(e.target,e.attributeName):e.type=="childList"&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){let s=e;this.elements.has(s)?this.delegate.elementAttributeChanged&&this.matchElement(s)?this.delegate.elementAttributeChanged(s,t):this.removeElement(s):this.matchElement(s)&&this.addElement(s)}processRemovedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.processTree(s,this.removeElement)}}processAddedNodes(e){for(let t of Array.from(e)){let s=this.elementFromNode(t);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(let s of this.matchElementsInTree(e))t.call(this,s)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected!=this.element.isConnected?!1:this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}},I=class{constructor(e,t,s){this.attributeName=t,this.delegate=s,this.elementObserver=new V(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){let t=this.matchElement(e)?[e]:[],s=Array.from(e.querySelectorAll(this.selector));return t.concat(s)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}},D=class{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(let t of e)this.processMutation(t)}processMutation(e){let t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){let s=this.delegate.getStringMapKeyForAttribute(e);if(s!=null){this.stringMap.has(e)||this.stringMapKeyAdded(s,e);let n=this.element.getAttribute(e);if(this.stringMap.get(e)!=n&&this.stringMapValueChanged(n,s,t),n==null){let i=this.stringMap.get(e);this.stringMap.delete(e),i&&this.stringMapKeyRemoved(s,e,i)}else this.stringMap.set(e,n)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,s)}stringMapKeyRemoved(e,t,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}};function he(r,e,t){L(r,e).add(t)}function le(r,e,t){L(r,e).delete(t),ue(r,e)}function L(r,e){let t=r.get(e);return t||(t=new Set,r.set(e,t)),t}function ue(r,e){let t=r.get(e);t!=null&&t.size==0&&r.delete(e)}var m=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((t,s)=>t+s.size,0)}add(e,t){he(this.valuesByKey,e,t)}delete(e,t){le(this.valuesByKey,e,t)}has(e,t){let s=this.valuesByKey.get(e);return s!=null&&s.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(s=>s.has(e))}getValuesForKey(e){let t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,s])=>s.has(e)).map(([t,s])=>t)}};var v=class{constructor(e,t,s){this.attributeObserver=new I(e,t,this),this.delegate=s,this.tokensByElement=new m}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){let[t,s]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(s)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(t=>this.tokenMatched(t))}tokensUnmatched(e){e.forEach(t=>this.tokenUnmatched(t))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){let t=this.tokensByElement.getValuesForKey(e),s=this.readTokensForElement(e),n=ge(t,s).findIndex(([i,o])=>!fe(i,o));return n==-1?[[],[]]:[t.slice(n),s.slice(n)]}readTokensForElement(e){let t=this.attributeName,s=e.getAttribute(t)||"";return de(s,e,t)}};function de(r,e,t){return r.trim().split(/\s+/).filter(s=>s.length).map((s,n)=>({element:e,attributeName:t,content:s,index:n}))}function ge(r,e){let t=Math.max(r.length,e.length);return Array.from({length:t},(s,n)=>[r[n],e[n]])}function fe(r,e){return r&&e&&r.index==e.index&&r.content==e.content}var A=class{constructor(e,t,s){this.tokenListObserver=new v(e,t,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).set(e,s),this.delegate.elementMatchedValue(t,s))}tokenUnmatched(e){let{element:t}=e,{value:s}=this.fetchParseResultForToken(e);s&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,s))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(t){return{error:t}}}},$=class{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new A(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){let t=new x(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){let t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e)),this.bindingsByAction.clear()}parseValueForToken(e){let t=F.forToken(e);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}},K=class{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new D(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap,this.invokeChangedCallbacksForDefaultValues()}start(){this.stringMapObserver.start()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){let s=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,s.writer(this.receiver[e]),s.writer(s.defaultValue))}stringMapValueChanged(e,t,s){let n=this.valueDescriptorNameMap[t];e!==null&&(s===null&&(s=n.writer(n.defaultValue)),this.invokeChangedCallback(t,e,s))}stringMapKeyRemoved(e,t,s){let n=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,n.writer(this.receiver[e]),s):this.invokeChangedCallback(e,n.writer(n.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(let{key:e,name:t,defaultValue:s,writer:n}of this.valueDescriptors)s!=null&&!this.controller.data.has(e)&&this.invokeChangedCallback(t,n(s),void 0)}invokeChangedCallback(e,t,s){let n=`${e}Changed`,i=this.receiver[n];if(typeof i=="function"){let o=this.valueDescriptorNameMap[e],c=o.reader(t),a=s;s&&(a=o.reader(s)),i.call(this.receiver,c,a)}}get valueDescriptors(){let{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){let e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{let s=this.valueDescriptorMap[t];e[s.name]=s}),e}hasValue(e){let t=this.valueDescriptorNameMap[e],s=`has${p(t.name)}`;return this.receiver[s]}},j=class{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new m}start(){this.tokenListObserver||(this.tokenListObserver=new v(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var s;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var s;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(let e of this.targetsByName.keys)for(let t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}},P=class{constructor(e,t){this.logDebugActivity=(s,n={})=>{let{identifier:i,controller:o,element:c}=this;n=Object.assign({identifier:i,controller:o,element:c},n),this.application.logDebugActivity(this.identifier,s,n)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new $(this,this.dispatcher),this.valueObserver=new K(this,this.controller),this.targetObserver=new j(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,s={}){let{identifier:n,controller:i,element:o}=this;s=Object.assign({identifier:n,controller:i,element:o},s),this.application.handleError(e,`Error ${t}`,s)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}invokeControllerMethod(e,...t){let s=this.controller;typeof s[e]=="function"&&s[e](...t)}};function w(r,e){let t=R(r);return Array.from(t.reduce((s,n)=>(me(n,e).forEach(i=>s.add(i)),s),new Set))}function pe(r,e){return R(r).reduce((s,n)=>(s.push(...ye(n,e)),s),[])}function R(r){let e=[];for(;r;)e.push(r),r=Object.getPrototypeOf(r);return e.reverse()}function me(r,e){let t=r[e];return Array.isArray(t)?t:[]}function ye(r,e){let t=r[e];return t?Object.keys(t).map(s=>[s,t[s]]):[]}function be(r){return ve(r,Ae(r))}function ve(r,e){let t=Te(r),s=we(r.prototype,e);return Object.defineProperties(t.prototype,s),t}function Ae(r){return w(r,"blessings").reduce((t,s)=>{let n=s(r);for(let i in n){let o=t[i]||{};t[i]=Object.assign(o,n[i])}return t},{})}function we(r,e){return Oe(e).reduce((t,s)=>{let n=Ee(r,e,s);return n&&Object.assign(t,{[s]:n}),t},{})}function Ee(r,e,t){let s=Object.getOwnPropertyDescriptor(r,t);if(!(s&&"value"in s)){let i=Object.getOwnPropertyDescriptor(e,t).value;return s&&(i.get=s.get||i.get,i.set=s.set||i.set),i}}var Oe=(()=>typeof Object.getOwnPropertySymbols=="function"?r=>[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)]:Object.getOwnPropertyNames)(),Te=(()=>{function r(t){function s(){return Reflect.construct(t,arguments,new.target)}return s.prototype=Object.create(t.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,t),s}function e(){let s=r(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return e(),r}catch{return s=>class extends s{}}})();function Me(r){return{identifier:r.identifier,controllerConstructor:be(r.controllerConstructor)}}var U=class{constructor(e,t){this.application=e,this.definition=Me(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){let t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){let t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new P(this,e),this.contextsByScope.set(e,t)),t}},W=class{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){let t=this.data.get(this.getDataKey(e))||"";return oe(t)}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}},z=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){let t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){let s=this.getAttributeNameForKey(e);return this.element.setAttribute(s,t),this.get(e)}has(e){let t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){let t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}else return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${N(e)}`}},_=class{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,s){let n=this.warnedKeysByObject.get(e);n||(n=new Set,this.warnedKeysByObject.set(e,n)),n.has(t)||(n.add(t),this.logger.warn(s,e))}};function b(r,e){return`[${r}~="${e}"]`}var q=class{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return this.find(e)!=null}find(...e){return e.reduce((t,s)=>t||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...e){return e.reduce((t,s)=>[...t,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(e){let t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){let t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){let t=this.schema.targetAttributeForScope(this.identifier);return b(t,e)}findLegacyTarget(e){let t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){let t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(s=>this.deprecate(s,e))}getLegacySelectorForTargetName(e){let t=`${this.identifier}.${e}`;return b(this.schema.targetAttribute,t)}deprecate(e,t){if(e){let{identifier:s}=this,n=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(s);this.guide.warn(e,`target:${t}`,`Please replace ${n}="${s}.${t}" with ${i}="${t}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}},J=class{constructor(e,t,s,n){this.targets=new q(this),this.classes=new W(this),this.data=new z(this),this.containsElement=i=>i.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=s,this.guide=new _(n)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return b(this.schema.controllerAttribute,this.identifier)}},G=class{constructor(e,t,s){this.element=e,this.schema=t,this.delegate=s,this.valueListObserver=new A(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){let{element:t,content:s}=e,n=this.fetchScopesByIdentifierForElement(t),i=n.get(s);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,s),n.set(s,i)),i}elementMatchedValue(e,t){let s=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,s),s==1&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){let s=this.scopeReferenceCounts.get(t);s&&(this.scopeReferenceCounts.set(t,s-1),s==1&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}},Z=class{constructor(e){this.application=e,this.scopeObserver=new G(this.element,this.schema,this),this.scopesByIdentifier=new m,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);let t=new U(this.application,e);this.connectModule(t)}unloadIdentifier(e){let t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){let s=this.modulesByIdentifier.get(t);if(s)return s.contexts.find(n=>n.element==e)}handleError(e,t,s){this.application.handleError(e,t,s)}createScopeForElementAndIdentifier(e,t){return new J(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);let t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.connectContextForScope(s))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(s=>e.disconnectContextForScope(s))}},Ce={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:r=>`data-${r}-target`},d=class{constructor(e=document.documentElement,t=Ce){this.logger=console,this.debug=!1,this.logDebugActivity=(s,n,i={})=>{this.debug&&this.logFormattedMessage(s,n,i)},this.element=e,this.schema=t,this.dispatcher=new B(this),this.router=new Z(this)}static start(e,t){let s=new d(e,t);return s.start(),s}async start(){await ke(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){t.shouldLoad&&this.load({identifier:e,controllerConstructor:t})}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.loadDefinition(n))}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){let s=this.router.getContextForElementAndIdentifier(e,t);return s?s.controller:null}handleError(e,t,s){var n;this.logger.error(`%s
2
-
3
- %o
4
-
5
- %o`,t,e,s),(n=window.onerror)===null||n===void 0||n.call(window,t,"",0,0,e)}logFormattedMessage(e,t,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}};function ke(){return new Promise(r=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>r()):r()})}function Be(r){return w(r,"classes").reduce((t,s)=>Object.assign(t,Se(s)),{})}function Se(r){return{[`${r}Class`]:{get(){let{classes:e}=this;if(e.has(r))return e.get(r);{let t=e.getAttributeName(r);throw new Error(`Missing attribute "${t}"`)}}},[`${r}Classes`]:{get(){return this.classes.getAll(r)}},[`has${p(r)}Class`]:{get(){return this.classes.has(r)}}}}function Ne(r){return w(r,"targets").reduce((t,s)=>Object.assign(t,Fe(s)),{})}function Fe(r){return{[`${r}Target`]:{get(){let e=this.targets.find(r);if(e)return e;throw new Error(`Missing target element "${r}" for "${this.identifier}" controller`)}},[`${r}Targets`]:{get(){return this.targets.findAll(r)}},[`has${p(r)}Target`]:{get(){return this.targets.has(r)}}}}function xe(r){let e=pe(r,"values"),t={valueDescriptorMap:{get(){return e.reduce((s,n)=>{let i=H(n),o=this.data.getAttributeNameForKey(i.key);return Object.assign(s,{[o]:i})},{})}}};return e.reduce((s,n)=>Object.assign(s,Ve(n)),t)}function Ve(r){let e=H(r),{key:t,name:s,reader:n,writer:i}=e;return{[s]:{get(){let o=this.data.get(t);return o!==null?n(o):e.defaultValue},set(o){o===void 0?this.data.delete(t):this.data.set(t,i(o))}},[`has${p(s)}`]:{get(){return this.data.has(t)||e.hasCustomDefaultValue}}}}function H([r,e]){return $e(r,e)}function E(r){switch(r){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function O(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(r))return"array";if(Object.prototype.toString.call(r)==="[object Object]")return"object"}function Ie(r){let e=E(r.type);if(e){let t=O(r.default);if(e!==t)throw new Error(`Type "${e}" must match the type of the default value. Given default value: "${r.default}" as "${t}"`);return e}}function De(r){let e=Ie(r),t=O(r),s=E(r),n=e||t||s;if(n)return n;throw new Error(`Unknown value type "${r}"`)}function Le(r){let e=E(r);if(e)return Ke[e];let t=r.default;return t!==void 0?t:r}function $e(r,e){let t=`${N(r)}-value`,s=De(e);return{type:s,key:t,name:S(t),get defaultValue(){return Le(e)},get hasCustomDefaultValue(){return O(e)!==void 0},reader:je[s],writer:M[s]||M.default}}var Ke={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},je={array(r){let e=JSON.parse(r);if(!Array.isArray(e))throw new TypeError("Expected array");return e},boolean(r){return!(r=="0"||r=="false")},number(r){return Number(r)},object(r){let e=JSON.parse(r);if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("Expected object");return e},string(r){return r}},M={default:Pe,array:C,object:C};function C(r){return JSON.stringify(r)}function Pe(r){return`${r}`}var h=class{constructor(e){this.context=e}static get shouldLoad(){return!0}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:s={},prefix:n=this.identifier,bubbles:i=!0,cancelable:o=!0}={}){let c=n?`${n}:${e}`:e,a=new CustomEvent(c,{detail:s,bubbles:i,cancelable:o});return t.dispatchEvent(a),a}};h.blessings=[Be,Ne,xe];h.targets=[];h.values={};var Re="absolute bg-gray-100 opacity-10 w-full h-full",l=class extends h{get placeholder(){return this.citySelectInputTarget.ariaPlaceholder}set loading(r){if(r){let e=document.createElement("div");e.className=Re,e.dataset.target="city-loader",this.citySelectWrapperTarget.prepend(e),this.citySelectWrapperTarget.classList.add("opacity-50")}else this.citySelectWrapperTarget.querySelector('[data-target="city-loader"]').remove(),this.citySelectWrapperTarget.classList.remove("opacity-50")}connect(){return f(this,null,function*(){["edit","new"].includes(this.viewValue)&&(this.captureTheInitialValue(),yield this.onCountryChange())})}onCountryChange(){return f(this,null,function*(){if(this.hasCountrySelectInputTarget&&this.countrySelectInputTarget){let r=this.countrySelectInputTarget.value,e=yield this.fetchCitiesForCountry(r);Object.keys(this.citySelectInputTarget.options).forEach(()=>{this.citySelectInputTarget.options.remove(0)}),this.citySelectInputTarget.add(new Option(this.placeholder)),e.forEach(s=>{this.citySelectInputTarget.add(new Option(s,s))}),Array.from(this.citySelectInputTarget.options).map(s=>s.value).includes(this.initialValue)?this.citySelectInputTarget.value=this.initialValue:this.citySelectInputTarget.value=this.citySelectInputTarget.options[0].value}})}captureTheInitialValue(){this.initialValue=this.citySelectInputTarget.value}fetchCitiesForCountry(r){return f(this,null,function*(){if(!r)return[];this.loading=!0;let t=yield(yield fetch(`${window.Avo.configuration.root_path}/resources/courses/cities?country=${r}`)).json();return this.loading=!1,t})}};g(l,"targets",["countrySelectInput","citySelectInput","citySelectWrapper"]),g(l,"values",{view:String}),g(l,"initialValue");var Q=d.start();Q.debug=window==null?void 0:window.localStorage.getItem("avo.debug");Q.register("course-resource",l);})();
6
- //# sourceMappingURL=avo_custom.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../node_modules/@hotwired/stimulus/dist/stimulus.js", "../../../spec/dummy/app/javascript/avo_custom/course_resource_controller.js", "../../../spec/dummy/app/javascript/avo_custom.js"],
4
- "sourcesContent": ["/*\nStimulus 3.0.1\nCopyright \u00A9 2021 Basecamp, LLC\n */\nclass EventListener {\n constructor(eventTarget, eventName, eventOptions) {\n this.eventTarget = eventTarget;\n this.eventName = eventName;\n this.eventOptions = eventOptions;\n this.unorderedBindings = new Set();\n }\n connect() {\n this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);\n }\n disconnect() {\n this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);\n }\n bindingConnected(binding) {\n this.unorderedBindings.add(binding);\n }\n bindingDisconnected(binding) {\n this.unorderedBindings.delete(binding);\n }\n handleEvent(event) {\n const extendedEvent = extendEvent(event);\n for (const binding of this.bindings) {\n if (extendedEvent.immediatePropagationStopped) {\n break;\n }\n else {\n binding.handleEvent(extendedEvent);\n }\n }\n }\n get bindings() {\n return Array.from(this.unorderedBindings).sort((left, right) => {\n const leftIndex = left.index, rightIndex = right.index;\n return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;\n });\n }\n}\nfunction extendEvent(event) {\n if (\"immediatePropagationStopped\" in event) {\n return event;\n }\n else {\n const { stopImmediatePropagation } = event;\n return Object.assign(event, {\n immediatePropagationStopped: false,\n stopImmediatePropagation() {\n this.immediatePropagationStopped = true;\n stopImmediatePropagation.call(this);\n }\n });\n }\n}\n\nclass Dispatcher {\n constructor(application) {\n this.application = application;\n this.eventListenerMaps = new Map;\n this.started = false;\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.eventListeners.forEach(eventListener => eventListener.connect());\n }\n }\n stop() {\n if (this.started) {\n this.started = false;\n this.eventListeners.forEach(eventListener => eventListener.disconnect());\n }\n }\n get eventListeners() {\n return Array.from(this.eventListenerMaps.values())\n .reduce((listeners, map) => listeners.concat(Array.from(map.values())), []);\n }\n bindingConnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingConnected(binding);\n }\n bindingDisconnected(binding) {\n this.fetchEventListenerForBinding(binding).bindingDisconnected(binding);\n }\n handleError(error, message, detail = {}) {\n this.application.handleError(error, `Error ${message}`, detail);\n }\n fetchEventListenerForBinding(binding) {\n const { eventTarget, eventName, eventOptions } = binding;\n return this.fetchEventListener(eventTarget, eventName, eventOptions);\n }\n fetchEventListener(eventTarget, eventName, eventOptions) {\n const eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);\n const cacheKey = this.cacheKey(eventName, eventOptions);\n let eventListener = eventListenerMap.get(cacheKey);\n if (!eventListener) {\n eventListener = this.createEventListener(eventTarget, eventName, eventOptions);\n eventListenerMap.set(cacheKey, eventListener);\n }\n return eventListener;\n }\n createEventListener(eventTarget, eventName, eventOptions) {\n const eventListener = new EventListener(eventTarget, eventName, eventOptions);\n if (this.started) {\n eventListener.connect();\n }\n return eventListener;\n }\n fetchEventListenerMapForEventTarget(eventTarget) {\n let eventListenerMap = this.eventListenerMaps.get(eventTarget);\n if (!eventListenerMap) {\n eventListenerMap = new Map;\n this.eventListenerMaps.set(eventTarget, eventListenerMap);\n }\n return eventListenerMap;\n }\n cacheKey(eventName, eventOptions) {\n const parts = [eventName];\n Object.keys(eventOptions).sort().forEach(key => {\n parts.push(`${eventOptions[key] ? \"\" : \"!\"}${key}`);\n });\n return parts.join(\":\");\n }\n}\n\nconst descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;\nfunction parseActionDescriptorString(descriptorString) {\n const source = descriptorString.trim();\n const matches = source.match(descriptorPattern) || [];\n return {\n eventTarget: parseEventTarget(matches[4]),\n eventName: matches[2],\n eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},\n identifier: matches[5],\n methodName: matches[7]\n };\n}\nfunction parseEventTarget(eventTargetName) {\n if (eventTargetName == \"window\") {\n return window;\n }\n else if (eventTargetName == \"document\") {\n return document;\n }\n}\nfunction parseEventOptions(eventOptions) {\n return eventOptions.split(\":\").reduce((options, token) => Object.assign(options, { [token.replace(/^!/, \"\")]: !/^!/.test(token) }), {});\n}\nfunction stringifyEventTarget(eventTarget) {\n if (eventTarget == window) {\n return \"window\";\n }\n else if (eventTarget == document) {\n return \"document\";\n }\n}\n\nfunction camelize(value) {\n return value.replace(/(?:[_-])([a-z0-9])/g, (_, char) => char.toUpperCase());\n}\nfunction capitalize(value) {\n return value.charAt(0).toUpperCase() + value.slice(1);\n}\nfunction dasherize(value) {\n return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`);\n}\nfunction tokenize(value) {\n return value.match(/[^\\s]+/g) || [];\n}\n\nclass Action {\n constructor(element, index, descriptor) {\n this.element = element;\n this.index = index;\n this.eventTarget = descriptor.eventTarget || element;\n this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error(\"missing event name\");\n this.eventOptions = descriptor.eventOptions || {};\n this.identifier = descriptor.identifier || error(\"missing identifier\");\n this.methodName = descriptor.methodName || error(\"missing method name\");\n }\n static forToken(token) {\n return new this(token.element, token.index, parseActionDescriptorString(token.content));\n }\n toString() {\n const eventNameSuffix = this.eventTargetName ? `@${this.eventTargetName}` : \"\";\n return `${this.eventName}${eventNameSuffix}->${this.identifier}#${this.methodName}`;\n }\n get params() {\n if (this.eventTarget instanceof Element) {\n return this.getParamsFromEventTargetAttributes(this.eventTarget);\n }\n else {\n return {};\n }\n }\n getParamsFromEventTargetAttributes(eventTarget) {\n const params = {};\n const pattern = new RegExp(`^data-${this.identifier}-(.+)-param$`);\n const attributes = Array.from(eventTarget.attributes);\n attributes.forEach(({ name, value }) => {\n const match = name.match(pattern);\n const key = match && match[1];\n if (key) {\n Object.assign(params, { [camelize(key)]: typecast(value) });\n }\n });\n return params;\n }\n get eventTargetName() {\n return stringifyEventTarget(this.eventTarget);\n }\n}\nconst defaultEventNames = {\n \"a\": e => \"click\",\n \"button\": e => \"click\",\n \"form\": e => \"submit\",\n \"details\": e => \"toggle\",\n \"input\": e => e.getAttribute(\"type\") == \"submit\" ? \"click\" : \"input\",\n \"select\": e => \"change\",\n \"textarea\": e => \"input\"\n};\nfunction getDefaultEventNameForElement(element) {\n const tagName = element.tagName.toLowerCase();\n if (tagName in defaultEventNames) {\n return defaultEventNames[tagName](element);\n }\n}\nfunction error(message) {\n throw new Error(message);\n}\nfunction typecast(value) {\n try {\n return JSON.parse(value);\n }\n catch (o_O) {\n return value;\n }\n}\n\nclass Binding {\n constructor(context, action) {\n this.context = context;\n this.action = action;\n }\n get index() {\n return this.action.index;\n }\n get eventTarget() {\n return this.action.eventTarget;\n }\n get eventOptions() {\n return this.action.eventOptions;\n }\n get identifier() {\n return this.context.identifier;\n }\n handleEvent(event) {\n if (this.willBeInvokedByEvent(event)) {\n this.invokeWithEvent(event);\n }\n }\n get eventName() {\n return this.action.eventName;\n }\n get method() {\n const method = this.controller[this.methodName];\n if (typeof method == \"function\") {\n return method;\n }\n throw new Error(`Action \"${this.action}\" references undefined method \"${this.methodName}\"`);\n }\n invokeWithEvent(event) {\n const { target, currentTarget } = event;\n try {\n const { params } = this.action;\n const actionEvent = Object.assign(event, { params });\n this.method.call(this.controller, actionEvent);\n this.context.logDebugActivity(this.methodName, { event, target, currentTarget, action: this.methodName });\n }\n catch (error) {\n const { identifier, controller, element, index } = this;\n const detail = { identifier, controller, element, index, event };\n this.context.handleError(error, `invoking action \"${this.action}\"`, detail);\n }\n }\n willBeInvokedByEvent(event) {\n const eventTarget = event.target;\n if (this.element === eventTarget) {\n return true;\n }\n else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {\n return this.scope.containsElement(eventTarget);\n }\n else {\n return this.scope.containsElement(this.action.element);\n }\n }\n get controller() {\n return this.context.controller;\n }\n get methodName() {\n return this.action.methodName;\n }\n get element() {\n return this.scope.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass ElementObserver {\n constructor(element, delegate) {\n this.mutationObserverInit = { attributes: true, childList: true, subtree: true };\n this.element = element;\n this.started = false;\n this.delegate = delegate;\n this.elements = new Set;\n this.mutationObserver = new MutationObserver((mutations) => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.refresh();\n }\n }\n pause(callback) {\n if (this.started) {\n this.mutationObserver.disconnect();\n this.started = false;\n }\n callback();\n if (!this.started) {\n this.mutationObserver.observe(this.element, this.mutationObserverInit);\n this.started = true;\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n const matches = new Set(this.matchElementsInTree());\n for (const element of Array.from(this.elements)) {\n if (!matches.has(element)) {\n this.removeElement(element);\n }\n }\n for (const element of Array.from(matches)) {\n this.addElement(element);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n if (mutation.type == \"attributes\") {\n this.processAttributeChange(mutation.target, mutation.attributeName);\n }\n else if (mutation.type == \"childList\") {\n this.processRemovedNodes(mutation.removedNodes);\n this.processAddedNodes(mutation.addedNodes);\n }\n }\n processAttributeChange(node, attributeName) {\n const element = node;\n if (this.elements.has(element)) {\n if (this.delegate.elementAttributeChanged && this.matchElement(element)) {\n this.delegate.elementAttributeChanged(element, attributeName);\n }\n else {\n this.removeElement(element);\n }\n }\n else if (this.matchElement(element)) {\n this.addElement(element);\n }\n }\n processRemovedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element) {\n this.processTree(element, this.removeElement);\n }\n }\n }\n processAddedNodes(nodes) {\n for (const node of Array.from(nodes)) {\n const element = this.elementFromNode(node);\n if (element && this.elementIsActive(element)) {\n this.processTree(element, this.addElement);\n }\n }\n }\n matchElement(element) {\n return this.delegate.matchElement(element);\n }\n matchElementsInTree(tree = this.element) {\n return this.delegate.matchElementsInTree(tree);\n }\n processTree(tree, processor) {\n for (const element of this.matchElementsInTree(tree)) {\n processor.call(this, element);\n }\n }\n elementFromNode(node) {\n if (node.nodeType == Node.ELEMENT_NODE) {\n return node;\n }\n }\n elementIsActive(element) {\n if (element.isConnected != this.element.isConnected) {\n return false;\n }\n else {\n return this.element.contains(element);\n }\n }\n addElement(element) {\n if (!this.elements.has(element)) {\n if (this.elementIsActive(element)) {\n this.elements.add(element);\n if (this.delegate.elementMatched) {\n this.delegate.elementMatched(element);\n }\n }\n }\n }\n removeElement(element) {\n if (this.elements.has(element)) {\n this.elements.delete(element);\n if (this.delegate.elementUnmatched) {\n this.delegate.elementUnmatched(element);\n }\n }\n }\n}\n\nclass AttributeObserver {\n constructor(element, attributeName, delegate) {\n this.attributeName = attributeName;\n this.delegate = delegate;\n this.elementObserver = new ElementObserver(element, this);\n }\n get element() {\n return this.elementObserver.element;\n }\n get selector() {\n return `[${this.attributeName}]`;\n }\n start() {\n this.elementObserver.start();\n }\n pause(callback) {\n this.elementObserver.pause(callback);\n }\n stop() {\n this.elementObserver.stop();\n }\n refresh() {\n this.elementObserver.refresh();\n }\n get started() {\n return this.elementObserver.started;\n }\n matchElement(element) {\n return element.hasAttribute(this.attributeName);\n }\n matchElementsInTree(tree) {\n const match = this.matchElement(tree) ? [tree] : [];\n const matches = Array.from(tree.querySelectorAll(this.selector));\n return match.concat(matches);\n }\n elementMatched(element) {\n if (this.delegate.elementMatchedAttribute) {\n this.delegate.elementMatchedAttribute(element, this.attributeName);\n }\n }\n elementUnmatched(element) {\n if (this.delegate.elementUnmatchedAttribute) {\n this.delegate.elementUnmatchedAttribute(element, this.attributeName);\n }\n }\n elementAttributeChanged(element, attributeName) {\n if (this.delegate.elementAttributeValueChanged && this.attributeName == attributeName) {\n this.delegate.elementAttributeValueChanged(element, attributeName);\n }\n }\n}\n\nclass StringMapObserver {\n constructor(element, delegate) {\n this.element = element;\n this.delegate = delegate;\n this.started = false;\n this.stringMap = new Map;\n this.mutationObserver = new MutationObserver(mutations => this.processMutations(mutations));\n }\n start() {\n if (!this.started) {\n this.started = true;\n this.mutationObserver.observe(this.element, { attributes: true, attributeOldValue: true });\n this.refresh();\n }\n }\n stop() {\n if (this.started) {\n this.mutationObserver.takeRecords();\n this.mutationObserver.disconnect();\n this.started = false;\n }\n }\n refresh() {\n if (this.started) {\n for (const attributeName of this.knownAttributeNames) {\n this.refreshAttribute(attributeName, null);\n }\n }\n }\n processMutations(mutations) {\n if (this.started) {\n for (const mutation of mutations) {\n this.processMutation(mutation);\n }\n }\n }\n processMutation(mutation) {\n const attributeName = mutation.attributeName;\n if (attributeName) {\n this.refreshAttribute(attributeName, mutation.oldValue);\n }\n }\n refreshAttribute(attributeName, oldValue) {\n const key = this.delegate.getStringMapKeyForAttribute(attributeName);\n if (key != null) {\n if (!this.stringMap.has(attributeName)) {\n this.stringMapKeyAdded(key, attributeName);\n }\n const value = this.element.getAttribute(attributeName);\n if (this.stringMap.get(attributeName) != value) {\n this.stringMapValueChanged(value, key, oldValue);\n }\n if (value == null) {\n const oldValue = this.stringMap.get(attributeName);\n this.stringMap.delete(attributeName);\n if (oldValue)\n this.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n else {\n this.stringMap.set(attributeName, value);\n }\n }\n }\n stringMapKeyAdded(key, attributeName) {\n if (this.delegate.stringMapKeyAdded) {\n this.delegate.stringMapKeyAdded(key, attributeName);\n }\n }\n stringMapValueChanged(value, key, oldValue) {\n if (this.delegate.stringMapValueChanged) {\n this.delegate.stringMapValueChanged(value, key, oldValue);\n }\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n if (this.delegate.stringMapKeyRemoved) {\n this.delegate.stringMapKeyRemoved(key, attributeName, oldValue);\n }\n }\n get knownAttributeNames() {\n return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));\n }\n get currentAttributeNames() {\n return Array.from(this.element.attributes).map(attribute => attribute.name);\n }\n get recordedAttributeNames() {\n return Array.from(this.stringMap.keys());\n }\n}\n\nfunction add(map, key, value) {\n fetch(map, key).add(value);\n}\nfunction del(map, key, value) {\n fetch(map, key).delete(value);\n prune(map, key);\n}\nfunction fetch(map, key) {\n let values = map.get(key);\n if (!values) {\n values = new Set();\n map.set(key, values);\n }\n return values;\n}\nfunction prune(map, key) {\n const values = map.get(key);\n if (values != null && values.size == 0) {\n map.delete(key);\n }\n}\n\nclass Multimap {\n constructor() {\n this.valuesByKey = new Map();\n }\n get keys() {\n return Array.from(this.valuesByKey.keys());\n }\n get values() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((values, set) => values.concat(Array.from(set)), []);\n }\n get size() {\n const sets = Array.from(this.valuesByKey.values());\n return sets.reduce((size, set) => size + set.size, 0);\n }\n add(key, value) {\n add(this.valuesByKey, key, value);\n }\n delete(key, value) {\n del(this.valuesByKey, key, value);\n }\n has(key, value) {\n const values = this.valuesByKey.get(key);\n return values != null && values.has(value);\n }\n hasKey(key) {\n return this.valuesByKey.has(key);\n }\n hasValue(value) {\n const sets = Array.from(this.valuesByKey.values());\n return sets.some(set => set.has(value));\n }\n getValuesForKey(key) {\n const values = this.valuesByKey.get(key);\n return values ? Array.from(values) : [];\n }\n getKeysForValue(value) {\n return Array.from(this.valuesByKey)\n .filter(([key, values]) => values.has(value))\n .map(([key, values]) => key);\n }\n}\n\nclass IndexedMultimap extends Multimap {\n constructor() {\n super();\n this.keysByValue = new Map;\n }\n get values() {\n return Array.from(this.keysByValue.keys());\n }\n add(key, value) {\n super.add(key, value);\n add(this.keysByValue, value, key);\n }\n delete(key, value) {\n super.delete(key, value);\n del(this.keysByValue, value, key);\n }\n hasValue(value) {\n return this.keysByValue.has(value);\n }\n getKeysForValue(value) {\n const set = this.keysByValue.get(value);\n return set ? Array.from(set) : [];\n }\n}\n\nclass TokenListObserver {\n constructor(element, attributeName, delegate) {\n this.attributeObserver = new AttributeObserver(element, attributeName, this);\n this.delegate = delegate;\n this.tokensByElement = new Multimap;\n }\n get started() {\n return this.attributeObserver.started;\n }\n start() {\n this.attributeObserver.start();\n }\n pause(callback) {\n this.attributeObserver.pause(callback);\n }\n stop() {\n this.attributeObserver.stop();\n }\n refresh() {\n this.attributeObserver.refresh();\n }\n get element() {\n return this.attributeObserver.element;\n }\n get attributeName() {\n return this.attributeObserver.attributeName;\n }\n elementMatchedAttribute(element) {\n this.tokensMatched(this.readTokensForElement(element));\n }\n elementAttributeValueChanged(element) {\n const [unmatchedTokens, matchedTokens] = this.refreshTokensForElement(element);\n this.tokensUnmatched(unmatchedTokens);\n this.tokensMatched(matchedTokens);\n }\n elementUnmatchedAttribute(element) {\n this.tokensUnmatched(this.tokensByElement.getValuesForKey(element));\n }\n tokensMatched(tokens) {\n tokens.forEach(token => this.tokenMatched(token));\n }\n tokensUnmatched(tokens) {\n tokens.forEach(token => this.tokenUnmatched(token));\n }\n tokenMatched(token) {\n this.delegate.tokenMatched(token);\n this.tokensByElement.add(token.element, token);\n }\n tokenUnmatched(token) {\n this.delegate.tokenUnmatched(token);\n this.tokensByElement.delete(token.element, token);\n }\n refreshTokensForElement(element) {\n const previousTokens = this.tokensByElement.getValuesForKey(element);\n const currentTokens = this.readTokensForElement(element);\n const firstDifferingIndex = zip(previousTokens, currentTokens)\n .findIndex(([previousToken, currentToken]) => !tokensAreEqual(previousToken, currentToken));\n if (firstDifferingIndex == -1) {\n return [[], []];\n }\n else {\n return [previousTokens.slice(firstDifferingIndex), currentTokens.slice(firstDifferingIndex)];\n }\n }\n readTokensForElement(element) {\n const attributeName = this.attributeName;\n const tokenString = element.getAttribute(attributeName) || \"\";\n return parseTokenString(tokenString, element, attributeName);\n }\n}\nfunction parseTokenString(tokenString, element, attributeName) {\n return tokenString.trim().split(/\\s+/).filter(content => content.length)\n .map((content, index) => ({ element, attributeName, content, index }));\n}\nfunction zip(left, right) {\n const length = Math.max(left.length, right.length);\n return Array.from({ length }, (_, index) => [left[index], right[index]]);\n}\nfunction tokensAreEqual(left, right) {\n return left && right && left.index == right.index && left.content == right.content;\n}\n\nclass ValueListObserver {\n constructor(element, attributeName, delegate) {\n this.tokenListObserver = new TokenListObserver(element, attributeName, this);\n this.delegate = delegate;\n this.parseResultsByToken = new WeakMap;\n this.valuesByTokenByElement = new WeakMap;\n }\n get started() {\n return this.tokenListObserver.started;\n }\n start() {\n this.tokenListObserver.start();\n }\n stop() {\n this.tokenListObserver.stop();\n }\n refresh() {\n this.tokenListObserver.refresh();\n }\n get element() {\n return this.tokenListObserver.element;\n }\n get attributeName() {\n return this.tokenListObserver.attributeName;\n }\n tokenMatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).set(token, value);\n this.delegate.elementMatchedValue(element, value);\n }\n }\n tokenUnmatched(token) {\n const { element } = token;\n const { value } = this.fetchParseResultForToken(token);\n if (value) {\n this.fetchValuesByTokenForElement(element).delete(token);\n this.delegate.elementUnmatchedValue(element, value);\n }\n }\n fetchParseResultForToken(token) {\n let parseResult = this.parseResultsByToken.get(token);\n if (!parseResult) {\n parseResult = this.parseToken(token);\n this.parseResultsByToken.set(token, parseResult);\n }\n return parseResult;\n }\n fetchValuesByTokenForElement(element) {\n let valuesByToken = this.valuesByTokenByElement.get(element);\n if (!valuesByToken) {\n valuesByToken = new Map;\n this.valuesByTokenByElement.set(element, valuesByToken);\n }\n return valuesByToken;\n }\n parseToken(token) {\n try {\n const value = this.delegate.parseValueForToken(token);\n return { value };\n }\n catch (error) {\n return { error };\n }\n }\n}\n\nclass BindingObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.bindingsByAction = new Map;\n }\n start() {\n if (!this.valueListObserver) {\n this.valueListObserver = new ValueListObserver(this.element, this.actionAttribute, this);\n this.valueListObserver.start();\n }\n }\n stop() {\n if (this.valueListObserver) {\n this.valueListObserver.stop();\n delete this.valueListObserver;\n this.disconnectAllActions();\n }\n }\n get element() {\n return this.context.element;\n }\n get identifier() {\n return this.context.identifier;\n }\n get actionAttribute() {\n return this.schema.actionAttribute;\n }\n get schema() {\n return this.context.schema;\n }\n get bindings() {\n return Array.from(this.bindingsByAction.values());\n }\n connectAction(action) {\n const binding = new Binding(this.context, action);\n this.bindingsByAction.set(action, binding);\n this.delegate.bindingConnected(binding);\n }\n disconnectAction(action) {\n const binding = this.bindingsByAction.get(action);\n if (binding) {\n this.bindingsByAction.delete(action);\n this.delegate.bindingDisconnected(binding);\n }\n }\n disconnectAllActions() {\n this.bindings.forEach(binding => this.delegate.bindingDisconnected(binding));\n this.bindingsByAction.clear();\n }\n parseValueForToken(token) {\n const action = Action.forToken(token);\n if (action.identifier == this.identifier) {\n return action;\n }\n }\n elementMatchedValue(element, action) {\n this.connectAction(action);\n }\n elementUnmatchedValue(element, action) {\n this.disconnectAction(action);\n }\n}\n\nclass ValueObserver {\n constructor(context, receiver) {\n this.context = context;\n this.receiver = receiver;\n this.stringMapObserver = new StringMapObserver(this.element, this);\n this.valueDescriptorMap = this.controller.valueDescriptorMap;\n this.invokeChangedCallbacksForDefaultValues();\n }\n start() {\n this.stringMapObserver.start();\n }\n stop() {\n this.stringMapObserver.stop();\n }\n get element() {\n return this.context.element;\n }\n get controller() {\n return this.context.controller;\n }\n getStringMapKeyForAttribute(attributeName) {\n if (attributeName in this.valueDescriptorMap) {\n return this.valueDescriptorMap[attributeName].name;\n }\n }\n stringMapKeyAdded(key, attributeName) {\n const descriptor = this.valueDescriptorMap[attributeName];\n if (!this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), descriptor.writer(descriptor.defaultValue));\n }\n }\n stringMapValueChanged(value, name, oldValue) {\n const descriptor = this.valueDescriptorNameMap[name];\n if (value === null)\n return;\n if (oldValue === null) {\n oldValue = descriptor.writer(descriptor.defaultValue);\n }\n this.invokeChangedCallback(name, value, oldValue);\n }\n stringMapKeyRemoved(key, attributeName, oldValue) {\n const descriptor = this.valueDescriptorNameMap[key];\n if (this.hasValue(key)) {\n this.invokeChangedCallback(key, descriptor.writer(this.receiver[key]), oldValue);\n }\n else {\n this.invokeChangedCallback(key, descriptor.writer(descriptor.defaultValue), oldValue);\n }\n }\n invokeChangedCallbacksForDefaultValues() {\n for (const { key, name, defaultValue, writer } of this.valueDescriptors) {\n if (defaultValue != undefined && !this.controller.data.has(key)) {\n this.invokeChangedCallback(name, writer(defaultValue), undefined);\n }\n }\n }\n invokeChangedCallback(name, rawValue, rawOldValue) {\n const changedMethodName = `${name}Changed`;\n const changedMethod = this.receiver[changedMethodName];\n if (typeof changedMethod == \"function\") {\n const descriptor = this.valueDescriptorNameMap[name];\n const value = descriptor.reader(rawValue);\n let oldValue = rawOldValue;\n if (rawOldValue) {\n oldValue = descriptor.reader(rawOldValue);\n }\n changedMethod.call(this.receiver, value, oldValue);\n }\n }\n get valueDescriptors() {\n const { valueDescriptorMap } = this;\n return Object.keys(valueDescriptorMap).map(key => valueDescriptorMap[key]);\n }\n get valueDescriptorNameMap() {\n const descriptors = {};\n Object.keys(this.valueDescriptorMap).forEach(key => {\n const descriptor = this.valueDescriptorMap[key];\n descriptors[descriptor.name] = descriptor;\n });\n return descriptors;\n }\n hasValue(attributeName) {\n const descriptor = this.valueDescriptorNameMap[attributeName];\n const hasMethodName = `has${capitalize(descriptor.name)}`;\n return this.receiver[hasMethodName];\n }\n}\n\nclass TargetObserver {\n constructor(context, delegate) {\n this.context = context;\n this.delegate = delegate;\n this.targetsByName = new Multimap;\n }\n start() {\n if (!this.tokenListObserver) {\n this.tokenListObserver = new TokenListObserver(this.element, this.attributeName, this);\n this.tokenListObserver.start();\n }\n }\n stop() {\n if (this.tokenListObserver) {\n this.disconnectAllTargets();\n this.tokenListObserver.stop();\n delete this.tokenListObserver;\n }\n }\n tokenMatched({ element, content: name }) {\n if (this.scope.containsElement(element)) {\n this.connectTarget(element, name);\n }\n }\n tokenUnmatched({ element, content: name }) {\n this.disconnectTarget(element, name);\n }\n connectTarget(element, name) {\n var _a;\n if (!this.targetsByName.has(name, element)) {\n this.targetsByName.add(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetConnected(element, name));\n }\n }\n disconnectTarget(element, name) {\n var _a;\n if (this.targetsByName.has(name, element)) {\n this.targetsByName.delete(name, element);\n (_a = this.tokenListObserver) === null || _a === void 0 ? void 0 : _a.pause(() => this.delegate.targetDisconnected(element, name));\n }\n }\n disconnectAllTargets() {\n for (const name of this.targetsByName.keys) {\n for (const element of this.targetsByName.getValuesForKey(name)) {\n this.disconnectTarget(element, name);\n }\n }\n }\n get attributeName() {\n return `data-${this.context.identifier}-target`;\n }\n get element() {\n return this.context.element;\n }\n get scope() {\n return this.context.scope;\n }\n}\n\nclass Context {\n constructor(module, scope) {\n this.logDebugActivity = (functionName, detail = {}) => {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.logDebugActivity(this.identifier, functionName, detail);\n };\n this.module = module;\n this.scope = scope;\n this.controller = new module.controllerConstructor(this);\n this.bindingObserver = new BindingObserver(this, this.dispatcher);\n this.valueObserver = new ValueObserver(this, this.controller);\n this.targetObserver = new TargetObserver(this, this);\n try {\n this.controller.initialize();\n this.logDebugActivity(\"initialize\");\n }\n catch (error) {\n this.handleError(error, \"initializing controller\");\n }\n }\n connect() {\n this.bindingObserver.start();\n this.valueObserver.start();\n this.targetObserver.start();\n try {\n this.controller.connect();\n this.logDebugActivity(\"connect\");\n }\n catch (error) {\n this.handleError(error, \"connecting controller\");\n }\n }\n disconnect() {\n try {\n this.controller.disconnect();\n this.logDebugActivity(\"disconnect\");\n }\n catch (error) {\n this.handleError(error, \"disconnecting controller\");\n }\n this.targetObserver.stop();\n this.valueObserver.stop();\n this.bindingObserver.stop();\n }\n get application() {\n return this.module.application;\n }\n get identifier() {\n return this.module.identifier;\n }\n get schema() {\n return this.application.schema;\n }\n get dispatcher() {\n return this.application.dispatcher;\n }\n get element() {\n return this.scope.element;\n }\n get parentElement() {\n return this.element.parentElement;\n }\n handleError(error, message, detail = {}) {\n const { identifier, controller, element } = this;\n detail = Object.assign({ identifier, controller, element }, detail);\n this.application.handleError(error, `Error ${message}`, detail);\n }\n targetConnected(element, name) {\n this.invokeControllerMethod(`${name}TargetConnected`, element);\n }\n targetDisconnected(element, name) {\n this.invokeControllerMethod(`${name}TargetDisconnected`, element);\n }\n invokeControllerMethod(methodName, ...args) {\n const controller = this.controller;\n if (typeof controller[methodName] == \"function\") {\n controller[methodName](...args);\n }\n }\n}\n\nfunction readInheritableStaticArrayValues(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return Array.from(ancestors.reduce((values, constructor) => {\n getOwnStaticArrayValues(constructor, propertyName).forEach(name => values.add(name));\n return values;\n }, new Set));\n}\nfunction readInheritableStaticObjectPairs(constructor, propertyName) {\n const ancestors = getAncestorsForConstructor(constructor);\n return ancestors.reduce((pairs, constructor) => {\n pairs.push(...getOwnStaticObjectPairs(constructor, propertyName));\n return pairs;\n }, []);\n}\nfunction getAncestorsForConstructor(constructor) {\n const ancestors = [];\n while (constructor) {\n ancestors.push(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n return ancestors.reverse();\n}\nfunction getOwnStaticArrayValues(constructor, propertyName) {\n const definition = constructor[propertyName];\n return Array.isArray(definition) ? definition : [];\n}\nfunction getOwnStaticObjectPairs(constructor, propertyName) {\n const definition = constructor[propertyName];\n return definition ? Object.keys(definition).map(key => [key, definition[key]]) : [];\n}\n\nfunction bless(constructor) {\n return shadow(constructor, getBlessedProperties(constructor));\n}\nfunction shadow(constructor, properties) {\n const shadowConstructor = extend(constructor);\n const shadowProperties = getShadowProperties(constructor.prototype, properties);\n Object.defineProperties(shadowConstructor.prototype, shadowProperties);\n return shadowConstructor;\n}\nfunction getBlessedProperties(constructor) {\n const blessings = readInheritableStaticArrayValues(constructor, \"blessings\");\n return blessings.reduce((blessedProperties, blessing) => {\n const properties = blessing(constructor);\n for (const key in properties) {\n const descriptor = blessedProperties[key] || {};\n blessedProperties[key] = Object.assign(descriptor, properties[key]);\n }\n return blessedProperties;\n }, {});\n}\nfunction getShadowProperties(prototype, properties) {\n return getOwnKeys(properties).reduce((shadowProperties, key) => {\n const descriptor = getShadowedDescriptor(prototype, properties, key);\n if (descriptor) {\n Object.assign(shadowProperties, { [key]: descriptor });\n }\n return shadowProperties;\n }, {});\n}\nfunction getShadowedDescriptor(prototype, properties, key) {\n const shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);\n const shadowedByValue = shadowingDescriptor && \"value\" in shadowingDescriptor;\n if (!shadowedByValue) {\n const descriptor = Object.getOwnPropertyDescriptor(properties, key).value;\n if (shadowingDescriptor) {\n descriptor.get = shadowingDescriptor.get || descriptor.get;\n descriptor.set = shadowingDescriptor.set || descriptor.set;\n }\n return descriptor;\n }\n}\nconst getOwnKeys = (() => {\n if (typeof Object.getOwnPropertySymbols == \"function\") {\n return (object) => [\n ...Object.getOwnPropertyNames(object),\n ...Object.getOwnPropertySymbols(object)\n ];\n }\n else {\n return Object.getOwnPropertyNames;\n }\n})();\nconst extend = (() => {\n function extendWithReflect(constructor) {\n function extended() {\n return Reflect.construct(constructor, arguments, new.target);\n }\n extended.prototype = Object.create(constructor.prototype, {\n constructor: { value: extended }\n });\n Reflect.setPrototypeOf(extended, constructor);\n return extended;\n }\n function testReflectExtension() {\n const a = function () { this.a.call(this); };\n const b = extendWithReflect(a);\n b.prototype.a = function () { };\n return new b;\n }\n try {\n testReflectExtension();\n return extendWithReflect;\n }\n catch (error) {\n return (constructor) => class extended extends constructor {\n };\n }\n})();\n\nfunction blessDefinition(definition) {\n return {\n identifier: definition.identifier,\n controllerConstructor: bless(definition.controllerConstructor)\n };\n}\n\nclass Module {\n constructor(application, definition) {\n this.application = application;\n this.definition = blessDefinition(definition);\n this.contextsByScope = new WeakMap;\n this.connectedContexts = new Set;\n }\n get identifier() {\n return this.definition.identifier;\n }\n get controllerConstructor() {\n return this.definition.controllerConstructor;\n }\n get contexts() {\n return Array.from(this.connectedContexts);\n }\n connectContextForScope(scope) {\n const context = this.fetchContextForScope(scope);\n this.connectedContexts.add(context);\n context.connect();\n }\n disconnectContextForScope(scope) {\n const context = this.contextsByScope.get(scope);\n if (context) {\n this.connectedContexts.delete(context);\n context.disconnect();\n }\n }\n fetchContextForScope(scope) {\n let context = this.contextsByScope.get(scope);\n if (!context) {\n context = new Context(this, scope);\n this.contextsByScope.set(scope, context);\n }\n return context;\n }\n}\n\nclass ClassMap {\n constructor(scope) {\n this.scope = scope;\n }\n has(name) {\n return this.data.has(this.getDataKey(name));\n }\n get(name) {\n return this.getAll(name)[0];\n }\n getAll(name) {\n const tokenString = this.data.get(this.getDataKey(name)) || \"\";\n return tokenize(tokenString);\n }\n getAttributeName(name) {\n return this.data.getAttributeNameForKey(this.getDataKey(name));\n }\n getDataKey(name) {\n return `${name}-class`;\n }\n get data() {\n return this.scope.data;\n }\n}\n\nclass DataMap {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.getAttribute(name);\n }\n set(key, value) {\n const name = this.getAttributeNameForKey(key);\n this.element.setAttribute(name, value);\n return this.get(key);\n }\n has(key) {\n const name = this.getAttributeNameForKey(key);\n return this.element.hasAttribute(name);\n }\n delete(key) {\n if (this.has(key)) {\n const name = this.getAttributeNameForKey(key);\n this.element.removeAttribute(name);\n return true;\n }\n else {\n return false;\n }\n }\n getAttributeNameForKey(key) {\n return `data-${this.identifier}-${dasherize(key)}`;\n }\n}\n\nclass Guide {\n constructor(logger) {\n this.warnedKeysByObject = new WeakMap;\n this.logger = logger;\n }\n warn(object, key, message) {\n let warnedKeys = this.warnedKeysByObject.get(object);\n if (!warnedKeys) {\n warnedKeys = new Set;\n this.warnedKeysByObject.set(object, warnedKeys);\n }\n if (!warnedKeys.has(key)) {\n warnedKeys.add(key);\n this.logger.warn(message, object);\n }\n }\n}\n\nfunction attributeValueContainsToken(attributeName, token) {\n return `[${attributeName}~=\"${token}\"]`;\n}\n\nclass TargetSet {\n constructor(scope) {\n this.scope = scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get schema() {\n return this.scope.schema;\n }\n has(targetName) {\n return this.find(targetName) != null;\n }\n find(...targetNames) {\n return targetNames.reduce((target, targetName) => target\n || this.findTarget(targetName)\n || this.findLegacyTarget(targetName), undefined);\n }\n findAll(...targetNames) {\n return targetNames.reduce((targets, targetName) => [\n ...targets,\n ...this.findAllTargets(targetName),\n ...this.findAllLegacyTargets(targetName)\n ], []);\n }\n findTarget(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findElement(selector);\n }\n findAllTargets(targetName) {\n const selector = this.getSelectorForTargetName(targetName);\n return this.scope.findAllElements(selector);\n }\n getSelectorForTargetName(targetName) {\n const attributeName = this.schema.targetAttributeForScope(this.identifier);\n return attributeValueContainsToken(attributeName, targetName);\n }\n findLegacyTarget(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.deprecate(this.scope.findElement(selector), targetName);\n }\n findAllLegacyTargets(targetName) {\n const selector = this.getLegacySelectorForTargetName(targetName);\n return this.scope.findAllElements(selector).map(element => this.deprecate(element, targetName));\n }\n getLegacySelectorForTargetName(targetName) {\n const targetDescriptor = `${this.identifier}.${targetName}`;\n return attributeValueContainsToken(this.schema.targetAttribute, targetDescriptor);\n }\n deprecate(element, targetName) {\n if (element) {\n const { identifier } = this;\n const attributeName = this.schema.targetAttribute;\n const revisedAttributeName = this.schema.targetAttributeForScope(identifier);\n this.guide.warn(element, `target:${targetName}`, `Please replace ${attributeName}=\"${identifier}.${targetName}\" with ${revisedAttributeName}=\"${targetName}\". ` +\n `The ${attributeName} attribute is deprecated and will be removed in a future version of Stimulus.`);\n }\n return element;\n }\n get guide() {\n return this.scope.guide;\n }\n}\n\nclass Scope {\n constructor(schema, element, identifier, logger) {\n this.targets = new TargetSet(this);\n this.classes = new ClassMap(this);\n this.data = new DataMap(this);\n this.containsElement = (element) => {\n return element.closest(this.controllerSelector) === this.element;\n };\n this.schema = schema;\n this.element = element;\n this.identifier = identifier;\n this.guide = new Guide(logger);\n }\n findElement(selector) {\n return this.element.matches(selector)\n ? this.element\n : this.queryElements(selector).find(this.containsElement);\n }\n findAllElements(selector) {\n return [\n ...this.element.matches(selector) ? [this.element] : [],\n ...this.queryElements(selector).filter(this.containsElement)\n ];\n }\n queryElements(selector) {\n return Array.from(this.element.querySelectorAll(selector));\n }\n get controllerSelector() {\n return attributeValueContainsToken(this.schema.controllerAttribute, this.identifier);\n }\n}\n\nclass ScopeObserver {\n constructor(element, schema, delegate) {\n this.element = element;\n this.schema = schema;\n this.delegate = delegate;\n this.valueListObserver = new ValueListObserver(this.element, this.controllerAttribute, this);\n this.scopesByIdentifierByElement = new WeakMap;\n this.scopeReferenceCounts = new WeakMap;\n }\n start() {\n this.valueListObserver.start();\n }\n stop() {\n this.valueListObserver.stop();\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n parseValueForToken(token) {\n const { element, content: identifier } = token;\n const scopesByIdentifier = this.fetchScopesByIdentifierForElement(element);\n let scope = scopesByIdentifier.get(identifier);\n if (!scope) {\n scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);\n scopesByIdentifier.set(identifier, scope);\n }\n return scope;\n }\n elementMatchedValue(element, value) {\n const referenceCount = (this.scopeReferenceCounts.get(value) || 0) + 1;\n this.scopeReferenceCounts.set(value, referenceCount);\n if (referenceCount == 1) {\n this.delegate.scopeConnected(value);\n }\n }\n elementUnmatchedValue(element, value) {\n const referenceCount = this.scopeReferenceCounts.get(value);\n if (referenceCount) {\n this.scopeReferenceCounts.set(value, referenceCount - 1);\n if (referenceCount == 1) {\n this.delegate.scopeDisconnected(value);\n }\n }\n }\n fetchScopesByIdentifierForElement(element) {\n let scopesByIdentifier = this.scopesByIdentifierByElement.get(element);\n if (!scopesByIdentifier) {\n scopesByIdentifier = new Map;\n this.scopesByIdentifierByElement.set(element, scopesByIdentifier);\n }\n return scopesByIdentifier;\n }\n}\n\nclass Router {\n constructor(application) {\n this.application = application;\n this.scopeObserver = new ScopeObserver(this.element, this.schema, this);\n this.scopesByIdentifier = new Multimap;\n this.modulesByIdentifier = new Map;\n }\n get element() {\n return this.application.element;\n }\n get schema() {\n return this.application.schema;\n }\n get logger() {\n return this.application.logger;\n }\n get controllerAttribute() {\n return this.schema.controllerAttribute;\n }\n get modules() {\n return Array.from(this.modulesByIdentifier.values());\n }\n get contexts() {\n return this.modules.reduce((contexts, module) => contexts.concat(module.contexts), []);\n }\n start() {\n this.scopeObserver.start();\n }\n stop() {\n this.scopeObserver.stop();\n }\n loadDefinition(definition) {\n this.unloadIdentifier(definition.identifier);\n const module = new Module(this.application, definition);\n this.connectModule(module);\n }\n unloadIdentifier(identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n this.disconnectModule(module);\n }\n }\n getContextForElementAndIdentifier(element, identifier) {\n const module = this.modulesByIdentifier.get(identifier);\n if (module) {\n return module.contexts.find(context => context.element == element);\n }\n }\n handleError(error, message, detail) {\n this.application.handleError(error, message, detail);\n }\n createScopeForElementAndIdentifier(element, identifier) {\n return new Scope(this.schema, element, identifier, this.logger);\n }\n scopeConnected(scope) {\n this.scopesByIdentifier.add(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.connectContextForScope(scope);\n }\n }\n scopeDisconnected(scope) {\n this.scopesByIdentifier.delete(scope.identifier, scope);\n const module = this.modulesByIdentifier.get(scope.identifier);\n if (module) {\n module.disconnectContextForScope(scope);\n }\n }\n connectModule(module) {\n this.modulesByIdentifier.set(module.identifier, module);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.connectContextForScope(scope));\n }\n disconnectModule(module) {\n this.modulesByIdentifier.delete(module.identifier);\n const scopes = this.scopesByIdentifier.getValuesForKey(module.identifier);\n scopes.forEach(scope => module.disconnectContextForScope(scope));\n }\n}\n\nconst defaultSchema = {\n controllerAttribute: \"data-controller\",\n actionAttribute: \"data-action\",\n targetAttribute: \"data-target\",\n targetAttributeForScope: identifier => `data-${identifier}-target`\n};\n\nclass Application {\n constructor(element = document.documentElement, schema = defaultSchema) {\n this.logger = console;\n this.debug = false;\n this.logDebugActivity = (identifier, functionName, detail = {}) => {\n if (this.debug) {\n this.logFormattedMessage(identifier, functionName, detail);\n }\n };\n this.element = element;\n this.schema = schema;\n this.dispatcher = new Dispatcher(this);\n this.router = new Router(this);\n }\n static start(element, schema) {\n const application = new Application(element, schema);\n application.start();\n return application;\n }\n async start() {\n await domReady();\n this.logDebugActivity(\"application\", \"starting\");\n this.dispatcher.start();\n this.router.start();\n this.logDebugActivity(\"application\", \"start\");\n }\n stop() {\n this.logDebugActivity(\"application\", \"stopping\");\n this.dispatcher.stop();\n this.router.stop();\n this.logDebugActivity(\"application\", \"stop\");\n }\n register(identifier, controllerConstructor) {\n if (controllerConstructor.shouldLoad) {\n this.load({ identifier, controllerConstructor });\n }\n }\n load(head, ...rest) {\n const definitions = Array.isArray(head) ? head : [head, ...rest];\n definitions.forEach(definition => this.router.loadDefinition(definition));\n }\n unload(head, ...rest) {\n const identifiers = Array.isArray(head) ? head : [head, ...rest];\n identifiers.forEach(identifier => this.router.unloadIdentifier(identifier));\n }\n get controllers() {\n return this.router.contexts.map(context => context.controller);\n }\n getControllerForElementAndIdentifier(element, identifier) {\n const context = this.router.getContextForElementAndIdentifier(element, identifier);\n return context ? context.controller : null;\n }\n handleError(error, message, detail) {\n var _a;\n this.logger.error(`%s\\n\\n%o\\n\\n%o`, message, error, detail);\n (_a = window.onerror) === null || _a === void 0 ? void 0 : _a.call(window, message, \"\", 0, 0, error);\n }\n logFormattedMessage(identifier, functionName, detail = {}) {\n detail = Object.assign({ application: this }, detail);\n this.logger.groupCollapsed(`${identifier} #${functionName}`);\n this.logger.log(\"details:\", Object.assign({}, detail));\n this.logger.groupEnd();\n }\n}\nfunction domReady() {\n return new Promise(resolve => {\n if (document.readyState == \"loading\") {\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n }\n else {\n resolve();\n }\n });\n}\n\nfunction ClassPropertiesBlessing(constructor) {\n const classes = readInheritableStaticArrayValues(constructor, \"classes\");\n return classes.reduce((properties, classDefinition) => {\n return Object.assign(properties, propertiesForClassDefinition(classDefinition));\n }, {});\n}\nfunction propertiesForClassDefinition(key) {\n return {\n [`${key}Class`]: {\n get() {\n const { classes } = this;\n if (classes.has(key)) {\n return classes.get(key);\n }\n else {\n const attribute = classes.getAttributeName(key);\n throw new Error(`Missing attribute \"${attribute}\"`);\n }\n }\n },\n [`${key}Classes`]: {\n get() {\n return this.classes.getAll(key);\n }\n },\n [`has${capitalize(key)}Class`]: {\n get() {\n return this.classes.has(key);\n }\n }\n };\n}\n\nfunction TargetPropertiesBlessing(constructor) {\n const targets = readInheritableStaticArrayValues(constructor, \"targets\");\n return targets.reduce((properties, targetDefinition) => {\n return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));\n }, {});\n}\nfunction propertiesForTargetDefinition(name) {\n return {\n [`${name}Target`]: {\n get() {\n const target = this.targets.find(name);\n if (target) {\n return target;\n }\n else {\n throw new Error(`Missing target element \"${name}\" for \"${this.identifier}\" controller`);\n }\n }\n },\n [`${name}Targets`]: {\n get() {\n return this.targets.findAll(name);\n }\n },\n [`has${capitalize(name)}Target`]: {\n get() {\n return this.targets.has(name);\n }\n }\n };\n}\n\nfunction ValuePropertiesBlessing(constructor) {\n const valueDefinitionPairs = readInheritableStaticObjectPairs(constructor, \"values\");\n const propertyDescriptorMap = {\n valueDescriptorMap: {\n get() {\n return valueDefinitionPairs.reduce((result, valueDefinitionPair) => {\n const valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);\n const attributeName = this.data.getAttributeNameForKey(valueDescriptor.key);\n return Object.assign(result, { [attributeName]: valueDescriptor });\n }, {});\n }\n }\n };\n return valueDefinitionPairs.reduce((properties, valueDefinitionPair) => {\n return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));\n }, propertyDescriptorMap);\n}\nfunction propertiesForValueDefinitionPair(valueDefinitionPair) {\n const definition = parseValueDefinitionPair(valueDefinitionPair);\n const { key, name, reader: read, writer: write } = definition;\n return {\n [name]: {\n get() {\n const value = this.data.get(key);\n if (value !== null) {\n return read(value);\n }\n else {\n return definition.defaultValue;\n }\n },\n set(value) {\n if (value === undefined) {\n this.data.delete(key);\n }\n else {\n this.data.set(key, write(value));\n }\n }\n },\n [`has${capitalize(name)}`]: {\n get() {\n return this.data.has(key) || definition.hasCustomDefaultValue;\n }\n }\n };\n}\nfunction parseValueDefinitionPair([token, typeDefinition]) {\n return valueDescriptorForTokenAndTypeDefinition(token, typeDefinition);\n}\nfunction parseValueTypeConstant(constant) {\n switch (constant) {\n case Array: return \"array\";\n case Boolean: return \"boolean\";\n case Number: return \"number\";\n case Object: return \"object\";\n case String: return \"string\";\n }\n}\nfunction parseValueTypeDefault(defaultValue) {\n switch (typeof defaultValue) {\n case \"boolean\": return \"boolean\";\n case \"number\": return \"number\";\n case \"string\": return \"string\";\n }\n if (Array.isArray(defaultValue))\n return \"array\";\n if (Object.prototype.toString.call(defaultValue) === \"[object Object]\")\n return \"object\";\n}\nfunction parseValueTypeObject(typeObject) {\n const typeFromObject = parseValueTypeConstant(typeObject.type);\n if (typeFromObject) {\n const defaultValueType = parseValueTypeDefault(typeObject.default);\n if (typeFromObject !== defaultValueType) {\n throw new Error(`Type \"${typeFromObject}\" must match the type of the default value. Given default value: \"${typeObject.default}\" as \"${defaultValueType}\"`);\n }\n return typeFromObject;\n }\n}\nfunction parseValueTypeDefinition(typeDefinition) {\n const typeFromObject = parseValueTypeObject(typeDefinition);\n const typeFromDefaultValue = parseValueTypeDefault(typeDefinition);\n const typeFromConstant = parseValueTypeConstant(typeDefinition);\n const type = typeFromObject || typeFromDefaultValue || typeFromConstant;\n if (type)\n return type;\n throw new Error(`Unknown value type \"${typeDefinition}\"`);\n}\nfunction defaultValueForDefinition(typeDefinition) {\n const constant = parseValueTypeConstant(typeDefinition);\n if (constant)\n return defaultValuesByType[constant];\n const defaultValue = typeDefinition.default;\n if (defaultValue !== undefined)\n return defaultValue;\n return typeDefinition;\n}\nfunction valueDescriptorForTokenAndTypeDefinition(token, typeDefinition) {\n const key = `${dasherize(token)}-value`;\n const type = parseValueTypeDefinition(typeDefinition);\n return {\n type,\n key,\n name: camelize(key),\n get defaultValue() { return defaultValueForDefinition(typeDefinition); },\n get hasCustomDefaultValue() { return parseValueTypeDefault(typeDefinition) !== undefined; },\n reader: readers[type],\n writer: writers[type] || writers.default\n };\n}\nconst defaultValuesByType = {\n get array() { return []; },\n boolean: false,\n number: 0,\n get object() { return {}; },\n string: \"\"\n};\nconst readers = {\n array(value) {\n const array = JSON.parse(value);\n if (!Array.isArray(array)) {\n throw new TypeError(\"Expected array\");\n }\n return array;\n },\n boolean(value) {\n return !(value == \"0\" || value == \"false\");\n },\n number(value) {\n return Number(value);\n },\n object(value) {\n const object = JSON.parse(value);\n if (object === null || typeof object != \"object\" || Array.isArray(object)) {\n throw new TypeError(\"Expected object\");\n }\n return object;\n },\n string(value) {\n return value;\n }\n};\nconst writers = {\n default: writeString,\n array: writeJSON,\n object: writeJSON\n};\nfunction writeJSON(value) {\n return JSON.stringify(value);\n}\nfunction writeString(value) {\n return `${value}`;\n}\n\nclass Controller {\n constructor(context) {\n this.context = context;\n }\n static get shouldLoad() {\n return true;\n }\n get application() {\n return this.context.application;\n }\n get scope() {\n return this.context.scope;\n }\n get element() {\n return this.scope.element;\n }\n get identifier() {\n return this.scope.identifier;\n }\n get targets() {\n return this.scope.targets;\n }\n get classes() {\n return this.scope.classes;\n }\n get data() {\n return this.scope.data;\n }\n initialize() {\n }\n connect() {\n }\n disconnect() {\n }\n dispatch(eventName, { target = this.element, detail = {}, prefix = this.identifier, bubbles = true, cancelable = true } = {}) {\n const type = prefix ? `${prefix}:${eventName}` : eventName;\n const event = new CustomEvent(type, { detail, bubbles, cancelable });\n target.dispatchEvent(event);\n return event;\n }\n}\nController.blessings = [ClassPropertiesBlessing, TargetPropertiesBlessing, ValuePropertiesBlessing];\nController.targets = [];\nController.values = {};\n\nexport { Application, AttributeObserver, Context, Controller, ElementObserver, IndexedMultimap, Multimap, StringMapObserver, TokenListObserver, ValueListObserver, add, defaultSchema, del, fetch, prune };\n", "import { Controller } from '@hotwired/stimulus'\n\nconst LOADER_CLASSES = 'absolute bg-gray-100 opacity-10 w-full h-full'\n\nexport default class extends Controller {\n static targets = ['countrySelectInput', 'citySelectInput', 'citySelectWrapper'];\n\n static values = {\n view: String,\n }\n\n // The fields initial value\n static initialValue\n\n get placeholder() {\n return this.citySelectInputTarget.ariaPlaceholder\n }\n\n set loading(isLoading) {\n if (isLoading) {\n // create a loader overlay\n const loadingDiv = document.createElement('div')\n loadingDiv.className = LOADER_CLASSES\n loadingDiv.dataset.target = 'city-loader'\n\n // add the loader overlay\n this.citySelectWrapperTarget.prepend(loadingDiv)\n this.citySelectWrapperTarget.classList.add('opacity-50')\n } else {\n // remove the loader overlay\n this.citySelectWrapperTarget.querySelector('[data-target=\"city-loader\"]').remove()\n this.citySelectWrapperTarget.classList.remove('opacity-50')\n }\n }\n\n async connect() {\n // Add the controller functionality only on forms\n if (['edit', 'new'].includes(this.viewValue)) {\n this.captureTheInitialValue()\n\n // Trigger the change on load\n await this.onCountryChange()\n }\n }\n\n // Read the country select.\n // If there's any value selected show the cities and prefill them.\n async onCountryChange() {\n if (this.hasCountrySelectInputTarget && this.countrySelectInputTarget) {\n // Get the country\n const country = this.countrySelectInputTarget.value\n // Dynamically fetch the cities for this country\n const cities = await this.fetchCitiesForCountry(country)\n\n // Clear the select of options\n Object.keys(this.citySelectInputTarget.options).forEach(() => {\n this.citySelectInputTarget.options.remove(0)\n })\n\n // Add blank option\n this.citySelectInputTarget.add(new Option(this.placeholder))\n\n // Add the new cities\n cities.forEach((city) => {\n this.citySelectInputTarget.add(new Option(city, city))\n })\n\n // Check if the initial value is present in the cities array and select it.\n // If not, select the first item\n const currentOptions = Array.from(this.citySelectInputTarget.options).map((item) => item.value)\n if (currentOptions.includes(this.initialValue)) {\n this.citySelectInputTarget.value = this.initialValue\n } else {\n // Select the first item\n this.citySelectInputTarget.value = this.citySelectInputTarget.options[0].value\n }\n }\n }\n\n // Private\n\n captureTheInitialValue() {\n this.initialValue = this.citySelectInputTarget.value\n }\n\n async fetchCitiesForCountry(country) {\n if (!country) {\n return []\n }\n\n this.loading = true\n\n const response = await fetch(\n `${window.Avo.configuration.root_path}/resources/courses/cities?country=${country}`,\n )\n const data = await response.json()\n\n this.loading = false\n\n return data\n }\n}\n", "import { Application } from '@hotwired/stimulus'\nimport CourseResourceController from './avo_custom/course_resource_controller'\n\nconst application = Application.start()\n\n// Configure Stimulus development experience\napplication.debug = window?.localStorage.getItem('avo.debug')\napplication.register('course-resource', CourseResourceController)\n"],
5
- "mappings": "2XAIA,WAAoB,CAChB,YAAY,EAAa,EAAW,EAAc,CAC9C,KAAK,YAAc,EACnB,KAAK,UAAY,EACjB,KAAK,aAAe,EACpB,KAAK,kBAAoB,GAAI,IACjC,CACA,SAAU,CACN,KAAK,YAAY,iBAAiB,KAAK,UAAW,KAAM,KAAK,YAAY,CAC7E,CACA,YAAa,CACT,KAAK,YAAY,oBAAoB,KAAK,UAAW,KAAM,KAAK,YAAY,CAChF,CACA,iBAAiB,EAAS,CACtB,KAAK,kBAAkB,IAAI,CAAO,CACtC,CACA,oBAAoB,EAAS,CACzB,KAAK,kBAAkB,OAAO,CAAO,CACzC,CACA,YAAY,EAAO,CACf,GAAM,GAAgB,GAAY,CAAK,EACvC,OAAW,KAAW,MAAK,SAAU,CACjC,GAAI,EAAc,4BACd,MAGA,EAAQ,YAAY,CAAa,CAEzC,CACJ,IACI,WAAW,CACX,MAAO,OAAM,KAAK,KAAK,iBAAiB,EAAE,KAAK,CAAC,EAAM,IAAU,CAC5D,GAAM,GAAY,EAAK,MAAO,EAAa,EAAM,MACjD,MAAO,GAAY,EAAa,GAAK,EAAY,EAAa,EAAI,CACtE,CAAC,CACL,CACJ,EACA,YAAqB,EAAO,CACxB,GAAI,+BAA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Q,KAAK,sBAAsB,QAAQ,GAAG,KAE7E,CACF,GAIA,wBAAyB,CACvB,KAAK,aAAe,KAAK,sBAAsB,KACjD,CAEM,sBAAsB,EAAS,gCACnC,GAAI,CAAC,EACH,MAAO,CAAC,EAGV,KAAK,QAAU,GAKf,GAAM,GAAO,KAAM,AAHF,MAAM,OACrB,GAAG,OAAO,IAAI,cAAc,8CAA8C,GAC5E,GAC4B,KAAK,EAEjC,YAAK,QAAU,GAER,CACT,GACF,EAhGS,EADT,EACS,UAAU,CAAC,qBAAsB,kBAAmB,mBAAmB,GAEvE,EAHT,EAGS,SAAS,CACd,KAAM,MACR,GAGO,EART,EAQS,gBCTT,GAAM,GAAc,EAAY,MAAM,EAGtC,EAAY,MAAQ,2BAAQ,aAAa,QAAQ,aACjD,EAAY,SAAS,kBAAmB,CAAwB",
6
- "names": []
7
- }
Binary file
@@ -1,3 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
2
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
3
- </svg>
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Avo::AlertsComponent < ViewComponent::Base
4
-
5
- end
@@ -1,35 +0,0 @@
1
- <div class="relative min-h-full max-w-full flex-1 flex flex-col justify-between space-y-3">
2
- <% if @file.present? %>
3
- <% if @file.representable? && @is_image %>
4
- <%= image_tag helpers.main_app.url_for(@file), class: 'rounded-lg max-h-168 max-w-full' %>
5
- <% elsif @is_audio %>
6
- <%= audio_tag(helpers.main_app.url_for(@file), controls: true, preload: false, class: 'w-full')%>
7
- <% else %>
8
- <div class="relative flex flex-col justify-evenly items-center px-2 rounded-lg border bg-white border-gray-500 py-6 flex-1">
9
- <div class="flex flex-col justify-center items-center w-full">
10
- <%= helpers.svg 'document-text', class: 'h-10 text-gray-800 mb-2' %>
11
- <div class="block w-full truncate text-center text-sm">
12
- <%= @file.filename %>
13
- </div>
14
- </div>
15
- </div>
16
- <% end %>
17
-
18
- <div class="flex justify-between lg:flex-col lg:space-y-2 2xl:flex-row 2xl:space-y-0">
19
- <div>
20
- <% if @resource.authorization.authorize_action(:download_attachments?, raise_exception: false) %>
21
- <%= a_link helpers.main_app.url_for(@file), color: 'indigo', download: true, class: 'text-center', size: :xs do %>
22
- <%= helpers.svg 'download' %> <span class="hidden lg:block lg:flex-1"><%= t('avo.download_file') %></span>
23
- <% end %>
24
- <% end %>
25
- </div>
26
- <div>
27
- <% if @resource.authorization.authorize_action(:delete_attachments?, raise_exception: false) %>
28
- <%= a_link "#{@resource.record_path}/active_storage_attachments/#{@id}/#{@file.id}", color: :red, variant: :outlined, size: :xs, class: 'text-center', 'data-turbo-frame': 'destroy_attachment_form', data: { confirm: t('avo.are_you_sure')} do %>
29
- <%= helpers.svg 'trash' %> <span class="hidden lg:block lg:flex-1"><%= t 'avo.delete_file', item: @file.filename %></span>
30
- <% end %>
31
- <% end %>
32
- </div>
33
- </div>
34
- <% end %>
35
- </div>
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Avo::Fields::Common::MultipleFileViewerComponent < ViewComponent::Base
4
- include Avo::ApplicationHelper
5
-
6
- def initialize(id:, file:, is_image:, is_audio:, direct_upload: false, resource:, button_size: :md)
7
- @id = id
8
- @file = file
9
- @is_image = is_image
10
- @is_audio = is_audio
11
- @direct_upload = direct_upload
12
- @button_size = button_size
13
- @resource = resource
14
- end
15
- end
@@ -1,3 +0,0 @@
1
- <div class="flex items-center my-2 p-3 text-gray-500 font-bold text-sm -mb-1 leading-none">
2
- <div class="w-4"></div> <%= @label %>
3
- </div>
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Avo::NavigationHeadingComponent < ViewComponent::Base
4
- def initialize(label: nil)
5
- @label = label
6
- end
7
- end
@@ -1,3 +0,0 @@
1
- <%= active_link_to @path, class: 'text-gray-800 py-2 px-4 block font-normal hover:bg-gray-100 rounded-md mb-1 mx-3 text-sm leading-none', active: @active, target: @target do %>
2
- <div class="w-4"></div> <%= @label %>
3
- <% end %>
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Avo::NavigationLinkComponent < ViewComponent::Base
4
- def initialize(label: nil, path: nil, active: :inclusive, size: :md, target: nil)
5
- @label = label
6
- @path = path
7
- @active = active
8
- @size = size
9
- @target = target
10
- end
11
- end
@@ -1,10 +0,0 @@
1
- import toastr from 'toastr/build/toastr.min'
2
-
3
- toastr.options.showDuration = 400
4
- toastr.options.hideDuration = 400
5
- toastr.options.closeButton = true
6
- toastr.options.positionClass = 'toast-bottom-right'
7
- // eslint-disable-next-line max-len
8
- toastr.options.closeHtml = '<button class="mt-2 mr-1"><svg class="w-4 h-4 text-gray-700" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg></button>'
9
-
10
- window.toastr = toastr
@@ -1,14 +0,0 @@
1
- <%= turbo_frame_tag 'destroy_attachment_form' do %>
2
- <%= form_with url: "#{avo.root_path}resources/#{params[:resource_name]}/#{params[:id]
3
- }/active_storage_attachments/#{params[:attachment_name]}/#{params[:signed_attachment_id]}",
4
- method: :delete,
5
- html: {
6
- 'data-turbo-frame': 'destroy_attachment_form',
7
- 'data-controller': 'attachments',
8
- 'data-attachments-target': 'form',
9
- class: 'hidden'
10
- } do |form| %>
11
- <%= form.button 'destroy', type: :submit %>
12
- <%= form.hidden_field :referrer, value: request.referer, id: "referrer_destroy_attachment_#{params[:signed_attachment_id]}" %>
13
- <% end %>
14
- <% end %>
@@ -1,36 +0,0 @@
1
- <% if @actions.count > 0 %>
2
- <div class="relative z-40 js-actions-dropdown" data-controller="toggle-panel actions-picker">
3
- <%= a_button class: "focus:outline-none",
4
- color: 'sky',
5
- 'data-action': "click->toggle-panel#togglePanel",
6
- 'data-actions-dropdown-button': @resource.model_key do
7
- %>
8
- <%= svg 'arrow-left', class: 'h-4 mr-1 transform -rotate-90' %> <%= t 'avo.actions' %>
9
- <% end %>
10
- <div
11
- class="absolute block inset-auto right-0 top-full bg-white min-w-300px mt-2 py-4 z-20 shadow-context rounded-xl overflow-hidden hidden"
12
- data-toggle-panel-target="panel"
13
- >
14
- <%
15
- @actions.each_with_index do |action, index|
16
- path = action_name == 'show' ?
17
- "#{@resource.record_path}/actions/#{action.param_id}" :
18
- "#{@resource.records_path}/actions/#{action.param_id}"
19
- if action_name == 'show' || action.standalone
20
- disabled = false
21
- else
22
- disabled = true
23
- end
24
- %>
25
- <%= link_to path,
26
- 'data-turbo-frame': 'actions_show',
27
- 'data-action': 'click->actions-picker#visitAction',
28
- 'data-actions-picker-target': action.standalone ? 'standaloneAction' : 'resourceAction',
29
- class: "flex items-center w-full py-2 px-4 font-bold text-gray-700 hover:text-white hover:bg-blue-500 #{disabled ? 'text-gray-500' : 'text-gray-700'}",
30
- 'data-disabled': disabled do %>
31
- <%= svg 'play', class: 'h-5 mr-1 inline' %> <%= action.action_name %>
32
- <% end %>
33
- <% end %>
34
- </div>
35
- </div>
36
- <% end %>
@@ -1,34 +0,0 @@
1
- <div data-controller="toggle-panel">
2
- <div class="relative w-full flex justify-between z-30">
3
- <%= a_button class: 'focus:outline-none',
4
- color: 'slate',
5
- title: t('avo.click_to_reveal_filters'),
6
- 'data-button': 'resource-filters',
7
- 'data-action': 'click->toggle-panel#togglePanel',
8
- 'data-tippy': 'tooltip' do
9
- %>
10
-
11
- <%= svg 'filter' %> <%= t 'avo.filters' %>
12
- <% if params[:filters].present? %>
13
- <div class="ml-1">(<%=JSON.parse(Base64.decode64(params[:filters])).count%> applied)</div>
14
- <% end %>
15
- <% end %>
16
-
17
- <div
18
- class="absolute block inset-auto right-0 top-full bg-white min-w-300px mt-2 z-20 shadow-context rounded-xl hidden divide-y divide-gray-300"
19
- data-toggle-panel-target="panel"
20
- >
21
- <% @filters.each do |filter| %>
22
- <%= render partial: filter.class.template, locals: {filter: filter} %>
23
- <% end %>
24
-
25
- <div class="p-4 border-gray-300 border-t">
26
- <% if params[:filters].present? %>
27
- <%= a_link t('avo.reset_filters'), resources_path(resource: @resource, filters: nil, keep_query_params: true), color: 'slate', class: 'w-full justify-center' %>
28
- <% else %>
29
- <%= a_button t('avo.reset_filters'), color: 'slate', class: 'w-full justify-center', disabled: true %>
30
- <% end %>
31
- </div>
32
- </div>
33
- </div>
34
- </div>
@@ -1,7 +0,0 @@
1
- <% if (block = yield).empty? %>
2
- <%= button_tag label, **args %>
3
- <% else %>
4
- <%= button_tag **args do %>
5
- <%= yield %>
6
- <% end %>
7
- <% end %>
@@ -1,7 +0,0 @@
1
- <% if (block = yield).empty? %>
2
- <%= link_to label, url, **args %>
3
- <% else %>
4
- <%= link_to url, **args do %>
5
- <%= yield %>
6
- <% end %>
7
- <% end %>
@@ -1,17 +0,0 @@
1
- <%
2
- classes = 'absolute inset-auto left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2'
3
- translation_tag = params[:related_name].present? ? 'avo.no_related_item_found' : 'avo.no_item_found'
4
- label = t translation_tag, item: resource_name
5
- %>
6
- <div class="relative flex-1 py-12">
7
- <div class="relative block text-gray-300 h-64 w-full">
8
- <%= svg 'avocado', class: "#{classes} h-20 text-gray-400" %>
9
- <%= svg 'code', class: "#{classes} h-8 -ml-20 -mt-12" %>
10
- <%= svg 'fire', class: "#{classes} h-8 -ml-10 -mt-24" %>
11
- <%= svg 'color-swatch', class: "#{classes} h-8 ml-8 -mt-24" %>
12
- <%= svg 'globe', class: "#{classes} h-8 ml-20 -mt-12" %>
13
- <%= svg 'library', class: "#{classes} h-8 -ml-20 mt-4" %>
14
- <%= svg 'photograph', class: "#{classes} h-8 ml-20 mt-4" %>
15
- </div>
16
- <div class="relative block text-center text-lg text-gray-400 font-semibold -mt-10"><%= label %></div>
17
- </div>
@@ -1,25 +0,0 @@
1
- <% destroy_user_session_path = "destroy_#{Avo.configuration.current_user_resource_name}_session_path".to_sym %>
2
-
3
- <div <% if main_app.respond_to?(destroy_user_session_path) %> data-controller="toggle-panel" <% end %>>
4
- <a href="javascript:void(0);" class="flex items-center cursor-pointer font-semibold text-gray-700" data-action="click->toggle-panel#togglePanel">
5
- <% if _current_user.respond_to?(:avatar) && _current_user.avatar.present? %>
6
- <%= image_tag _current_user.avatar, class: "h-12 rounded-full border-4 border-white mr-1" %>
7
- <% end %>
8
- <% if _current_user.respond_to?(:name) && _current_user.name.present? %>
9
- <%= _current_user.name %>
10
- <% elsif _current_user.respond_to?(:email) && _current_user.email.present? %>
11
- <%= _current_user.email %>
12
- <% else %>
13
- Avo user
14
- <% end %>
15
- <% if main_app.respond_to?(destroy_user_session_path) %>
16
- <%= svg 'chevron-down', class: "ml-1 h-4" %>
17
- <% end %>
18
- </a>
19
-
20
- <% if main_app.respond_to?(destroy_user_session_path) %>
21
- <div class="hidden absolute inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
22
- <%= button_to t('avo.sign_out'), main_app.send(destroy_user_session_path), method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
23
- </div>
24
- <% end %>
25
- </div>