wagtail 7.1.2__py3-none-any.whl → 7.2rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (332) hide show
  1. wagtail/__init__.py +1 -1
  2. wagtail/actions/copy_page.py +1 -1
  3. wagtail/actions/create_alias.py +1 -1
  4. wagtail/actions/delete_page.py +1 -1
  5. wagtail/actions/publish_page_revision.py +1 -1
  6. wagtail/actions/publish_revision.py +1 -1
  7. wagtail/actions/revert_to_page_revision.py +1 -1
  8. wagtail/actions/unpublish.py +1 -1
  9. wagtail/actions/unpublish_page.py +1 -1
  10. wagtail/admin/auth.py +3 -1
  11. wagtail/admin/checks.py +2 -2
  12. wagtail/admin/filters.py +28 -1
  13. wagtail/admin/forms/collections.py +1 -1
  14. wagtail/admin/forms/comments.py +1 -1
  15. wagtail/admin/forms/models.py +1 -1
  16. wagtail/admin/forms/pages.py +1 -1
  17. wagtail/admin/forms/tags.py +1 -1
  18. wagtail/admin/locale/cs/LC_MESSAGES/django.mo +0 -0
  19. wagtail/admin/locale/cs/LC_MESSAGES/django.po +25 -1
  20. wagtail/admin/locale/en/LC_MESSAGES/django.po +278 -192
  21. wagtail/admin/locale/en/LC_MESSAGES/djangojs.po +29 -15
  22. wagtail/admin/locale/it/LC_MESSAGES/django.mo +0 -0
  23. wagtail/admin/locale/it/LC_MESSAGES/django.po +3 -2
  24. wagtail/admin/locale/nl/LC_MESSAGES/django.mo +0 -0
  25. wagtail/admin/locale/nl/LC_MESSAGES/django.po +57 -3
  26. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.mo +0 -0
  27. wagtail/admin/locale/nl/LC_MESSAGES/djangojs.po +8 -2
  28. wagtail/admin/locale/ru/LC_MESSAGES/django.mo +0 -0
  29. wagtail/admin/locale/ru/LC_MESSAGES/django.po +58 -1
  30. wagtail/admin/locale/tr/LC_MESSAGES/django.mo +0 -0
  31. wagtail/admin/locale/tr/LC_MESSAGES/django.po +3 -2
  32. wagtail/admin/static/wagtailadmin/css/core.css +1 -1
  33. wagtail/admin/static/wagtailadmin/js/bulk-actions.js +1 -1
  34. wagtail/admin/static/wagtailadmin/js/chooser-modal.js +1 -1
  35. wagtail/admin/static/wagtailadmin/js/chooser-widget-telepath.js +1 -1
  36. wagtail/admin/static/wagtailadmin/js/chooser-widget.js +1 -1
  37. wagtail/admin/static/wagtailadmin/js/comments.js +1 -1
  38. wagtail/admin/static/wagtailadmin/js/core.js +1 -1
  39. wagtail/admin/static/wagtailadmin/js/core.js.LICENSE.txt +2 -2
  40. wagtail/admin/static/wagtailadmin/js/date-time-chooser.js +1 -1
  41. wagtail/admin/static/wagtailadmin/js/draftail.js +1 -1
  42. wagtail/admin/static/wagtailadmin/js/filtered-select.js +1 -1
  43. wagtail/admin/static/wagtailadmin/js/icons.js +1 -1
  44. wagtail/admin/static/wagtailadmin/js/modal-workflow.js +1 -1
  45. wagtail/admin/static/wagtailadmin/js/page-chooser-modal.js +1 -1
  46. wagtail/admin/static/wagtailadmin/js/page-chooser-telepath.js +1 -1
  47. wagtail/admin/static/wagtailadmin/js/page-chooser.js +1 -1
  48. wagtail/admin/static/wagtailadmin/js/privacy-switch.js +1 -1
  49. wagtail/admin/static/wagtailadmin/js/sidebar.js +1 -1
  50. wagtail/admin/static/wagtailadmin/js/task-chooser-modal.js +1 -1
  51. wagtail/admin/static/wagtailadmin/js/task-chooser.js +1 -1
  52. wagtail/admin/static/wagtailadmin/js/telepath/blocks.js +1 -1
  53. wagtail/admin/static/wagtailadmin/js/telepath/telepath.js +1 -1
  54. wagtail/admin/static/wagtailadmin/js/telepath/widgets.js +1 -1
  55. wagtail/admin/static/wagtailadmin/js/userbar.js +1 -1
  56. wagtail/admin/static/wagtailadmin/js/userbar.js.LICENSE.txt +2 -2
  57. wagtail/admin/static/wagtailadmin/js/vendor/bootstrap-modal.js +1 -1
  58. wagtail/admin/static/wagtailadmin/js/vendor/bootstrap-transition.js +1 -1
  59. wagtail/admin/static/wagtailadmin/js/vendor/jquery-3.6.0.min.js +1 -1
  60. wagtail/admin/static/wagtailadmin/js/vendor/jquery-ui-1.13.2.min.js +1 -1
  61. wagtail/admin/static/wagtailadmin/js/vendor/jquery.datetimepicker.js +1 -1
  62. wagtail/admin/static/wagtailadmin/js/vendor/jquery.fileupload-process.js +1 -1
  63. wagtail/admin/static/wagtailadmin/js/vendor/jquery.fileupload.js +1 -1
  64. wagtail/admin/static/wagtailadmin/js/vendor/jquery.iframe-transport.js +1 -1
  65. wagtail/admin/static/wagtailadmin/js/vendor/tag-it.js +1 -1
  66. wagtail/admin/static/wagtailadmin/js/vendor.js +1 -1
  67. wagtail/admin/static/wagtailadmin/js/vendor.js.LICENSE.txt +1 -1
  68. wagtail/admin/static/wagtailadmin/js/wagtailadmin.js +1 -1
  69. wagtail/admin/static/wagtailadmin/js/workflow-action.js +1 -1
  70. wagtail/admin/templates/wagtailadmin/account/account.html +2 -0
  71. wagtail/admin/templates/wagtailadmin/base.html +14 -0
  72. wagtail/admin/templates/wagtailadmin/generic/chooser/chooser.html +2 -1
  73. wagtail/admin/templates/wagtailadmin/generic/chooser/creation_form.html +2 -1
  74. wagtail/admin/templates/wagtailadmin/panels/multi_field_panel_child.html +1 -1
  75. wagtail/admin/templates/wagtailadmin/panels/object_list.html +1 -1
  76. wagtail/admin/templates/wagtailadmin/panels/tabbed_interface.html +3 -2
  77. wagtail/admin/templates/wagtailadmin/shared/formatted_field.html +1 -1
  78. wagtail/admin/templates/wagtailadmin/shared/forms/single_checkbox.html +1 -1
  79. wagtail/admin/templates/wagtailadmin/shared/keyboard_shortcuts_dialog.html +19 -0
  80. wagtail/admin/templates/wagtailadmin/shared/panel.html +1 -1
  81. wagtail/admin/templates/wagtailadmin/shared/set_privacy.html +15 -0
  82. wagtail/admin/templates/wagtailadmin/shared/side_panels/checks.html +28 -1
  83. wagtail/admin/templates/wagtailadmin/shared/workflow_history/detail.html +2 -2
  84. wagtail/admin/templates/wagtailadmin/{pages/listing/_ordering_header.html → tables/ordering_header.html} +2 -2
  85. wagtail/admin/templates/wagtailadmin/tables/title_cell.html +1 -1
  86. wagtail/admin/templates/wagtailadmin/widgets/{daterange_input.html → range_input.html} +1 -1
  87. wagtail/admin/templates/wagtailadmin/workflows/task_chooser/chooser.html +4 -2
  88. wagtail/admin/templatetags/wagtailadmin_tags.py +41 -22
  89. wagtail/admin/tests/api/test_pages.py +7 -7
  90. wagtail/admin/tests/api/test_renderer_classes.py +16 -0
  91. wagtail/admin/tests/pages/test_create_page.py +34 -2
  92. wagtail/admin/tests/pages/test_edit_page.py +128 -14
  93. wagtail/admin/tests/pages/test_explorer_view.py +34 -7
  94. wagtail/admin/tests/pages/test_reorder_page.py +11 -0
  95. wagtail/admin/tests/test_collections_views.py +12 -0
  96. wagtail/admin/tests/test_edit_handlers.py +3 -3
  97. wagtail/admin/tests/test_filters.py +2 -2
  98. wagtail/admin/tests/test_keyboard_shortcuts.py +52 -2
  99. wagtail/admin/tests/test_menu.py +0 -2
  100. wagtail/admin/tests/test_privacy.py +16 -16
  101. wagtail/admin/tests/test_templatetags.py +137 -0
  102. wagtail/admin/tests/test_workflows.py +34 -0
  103. wagtail/admin/tests/viewsets/test_model_viewset.py +322 -0
  104. wagtail/admin/ui/tables/orderable.py +73 -0
  105. wagtail/admin/ui/tables/pages.py +3 -13
  106. wagtail/admin/views/collection_privacy.py +6 -2
  107. wagtail/admin/views/generic/__init__.py +1 -0
  108. wagtail/admin/views/generic/mixins.py +20 -2
  109. wagtail/admin/views/generic/models.py +67 -1
  110. wagtail/admin/views/generic/ordering.py +79 -0
  111. wagtail/admin/views/home.py +3 -3
  112. wagtail/admin/views/page_privacy.py +5 -2
  113. wagtail/admin/views/pages/create.py +1 -1
  114. wagtail/admin/views/pages/edit.py +2 -2
  115. wagtail/admin/views/pages/listing.py +7 -42
  116. wagtail/admin/views/pages/move.py +1 -1
  117. wagtail/admin/views/pages/ordering.py +1 -1
  118. wagtail/admin/viewsets/base.py +1 -1
  119. wagtail/admin/viewsets/model.py +49 -1
  120. wagtail/admin/wagtail_hooks.py +2 -1
  121. wagtail/admin/widgets/slug.py +10 -10
  122. wagtail/api/v2/serializers.py +1 -1
  123. wagtail/api/v2/tests/test_renderer_classes.py +32 -0
  124. wagtail/apps.py +2 -0
  125. wagtail/bin/wagtail.py +1 -1
  126. wagtail/contrib/forms/locale/en/LC_MESSAGES/django.po +14 -14
  127. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.mo +0 -0
  128. wagtail/contrib/forms/locale/nl/LC_MESSAGES/django.po +19 -2
  129. wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.mo +0 -0
  130. wagtail/contrib/forms/locale/ru/LC_MESSAGES/django.po +18 -1
  131. wagtail/contrib/frontend_cache/tests.py +4 -2
  132. wagtail/contrib/redirects/locale/en/LC_MESSAGES/django.po +4 -4
  133. wagtail/contrib/redirects/tests/test_tmp_storages.py +20 -0
  134. wagtail/contrib/redirects/tmp_storages.py +1 -1
  135. wagtail/contrib/redirects/views.py +3 -3
  136. wagtail/contrib/search_promotions/locale/en/LC_MESSAGES/django.po +3 -3
  137. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.mo +0 -0
  138. wagtail/contrib/search_promotions/locale/tr/LC_MESSAGES/django.po +43 -3
  139. wagtail/contrib/search_promotions/static/wagtailsearchpromotions/js/query-chooser-modal.js +1 -1
  140. wagtail/contrib/search_promotions/views/settings.py +2 -2
  141. wagtail/contrib/settings/locale/cs/LC_MESSAGES/django.mo +0 -0
  142. wagtail/contrib/settings/locale/cs/LC_MESSAGES/django.po +6 -1
  143. wagtail/contrib/settings/locale/en/LC_MESSAGES/django.po +1 -1
  144. wagtail/contrib/settings/locale/nl/LC_MESSAGES/django.mo +0 -0
  145. wagtail/contrib/settings/locale/nl/LC_MESSAGES/django.po +6 -2
  146. wagtail/contrib/settings/locale/ru/LC_MESSAGES/django.mo +0 -0
  147. wagtail/contrib/settings/locale/ru/LC_MESSAGES/django.po +6 -1
  148. wagtail/contrib/settings/tests/site_specific/test_admin.py +40 -6
  149. wagtail/contrib/simple_translation/locale/en/LC_MESSAGES/django.po +1 -1
  150. wagtail/contrib/styleguide/locale/en/LC_MESSAGES/django.po +1 -1
  151. wagtail/contrib/styleguide/templates/wagtailstyleguide/base.html +5 -5
  152. wagtail/contrib/table_block/blocks.py +1 -0
  153. wagtail/contrib/table_block/locale/en/LC_MESSAGES/django.po +5 -1
  154. wagtail/contrib/table_block/static/table_block/js/table.js +1 -1
  155. wagtail/contrib/typed_table_block/locale/en/LC_MESSAGES/django.po +1 -1
  156. wagtail/contrib/typed_table_block/static/typed_table_block/js/typed_table_block.js +1 -1
  157. wagtail/coreutils.py +5 -5
  158. wagtail/documents/forms.py +18 -1
  159. wagtail/documents/locale/en/LC_MESSAGES/django.po +10 -10
  160. wagtail/documents/locale/nl/LC_MESSAGES/django.mo +0 -0
  161. wagtail/documents/locale/nl/LC_MESSAGES/django.po +9 -0
  162. wagtail/documents/locale/ru/LC_MESSAGES/django.mo +0 -0
  163. wagtail/documents/locale/ru/LC_MESSAGES/django.po +9 -0
  164. wagtail/documents/models.py +1 -1
  165. wagtail/documents/static/wagtaildocs/js/add-multiple.js +1 -1
  166. wagtail/documents/static/wagtaildocs/js/document-chooser-modal.js +1 -1
  167. wagtail/documents/static/wagtaildocs/js/document-chooser-telepath.js +1 -1
  168. wagtail/documents/static/wagtaildocs/js/document-chooser.js +1 -1
  169. wagtail/documents/templates/wagtaildocs/documents/add.html +0 -34
  170. wagtail/documents/tests/test_admin_views.py +132 -26
  171. wagtail/documents/tests/test_collection_privacy.py +18 -4
  172. wagtail/documents/tests/test_form_overrides.py +1 -1
  173. wagtail/documents/tests/test_search.py +21 -8
  174. wagtail/documents/views/documents.py +1 -1
  175. wagtail/embeds/locale/en/LC_MESSAGES/django.po +1 -1
  176. wagtail/embeds/static/wagtailembeds/js/embed-chooser-modal.js +1 -1
  177. wagtail/images/forms.py +16 -1
  178. wagtail/images/locale/cs/LC_MESSAGES/django.mo +0 -0
  179. wagtail/images/locale/cs/LC_MESSAGES/django.po +12 -1
  180. wagtail/images/locale/en/LC_MESSAGES/django.po +57 -46
  181. wagtail/images/locale/nl/LC_MESSAGES/django.mo +0 -0
  182. wagtail/images/locale/nl/LC_MESSAGES/django.po +37 -14
  183. wagtail/images/locale/ru/LC_MESSAGES/django.mo +0 -0
  184. wagtail/images/locale/ru/LC_MESSAGES/django.po +20 -1
  185. wagtail/images/models.py +1 -1
  186. wagtail/images/static/wagtailimages/js/add-multiple.js +1 -1
  187. wagtail/images/static/wagtailimages/js/focal-point-chooser.js +1 -1
  188. wagtail/images/static/wagtailimages/js/image-block.js +1 -1
  189. wagtail/images/static/wagtailimages/js/image-chooser-modal.js +1 -1
  190. wagtail/images/static/wagtailimages/js/image-chooser-telepath.js +1 -1
  191. wagtail/images/static/wagtailimages/js/image-chooser.js +1 -1
  192. wagtail/images/static/wagtailimages/js/image-url-generator.js +1 -1
  193. wagtail/images/static/wagtailimages/js/vendor/jquery.Jcrop.min.js +1 -1
  194. wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-image.js +1 -1
  195. wagtail/images/static/wagtailimages/js/vendor/jquery.fileupload-validate.js +1 -1
  196. wagtail/images/static/wagtailimages/js/vendor/load-image.min.js +1 -1
  197. wagtail/images/templates/wagtailimages/chooser/chooser.html +22 -13
  198. wagtail/images/templates/wagtailimages/chooser/image_preview_column_cell.html +10 -0
  199. wagtail/images/templates/wagtailimages/chooser/results.html +24 -20
  200. wagtail/images/templates/wagtailimages/chooser/title_column_cell.html +15 -0
  201. wagtail/images/templates/wagtailimages/images/add.html +0 -34
  202. wagtail/images/templates/wagtailimages/images/index.html +3 -3
  203. wagtail/images/templates/wagtailimages/images/index_results.html +1 -1
  204. wagtail/images/templates/wagtailimages/images/layout_toggle_button.html +8 -7
  205. wagtail/images/templatetags/wagtailimages_tags.py +2 -2
  206. wagtail/images/tests/test_admin_views.py +87 -0
  207. wagtail/images/tests/test_form_overrides.py +1 -1
  208. wagtail/images/tests/test_models.py +48 -9
  209. wagtail/images/views/chooser.py +66 -2
  210. wagtail/locale/en/LC_MESSAGES/django.po +55 -55
  211. wagtail/locale/is_IS/LC_MESSAGES/django.mo +0 -0
  212. wagtail/locale/is_IS/LC_MESSAGES/django.po +3 -3
  213. wagtail/locale/nl/LC_MESSAGES/django.mo +0 -0
  214. wagtail/locale/nl/LC_MESSAGES/django.po +11 -2
  215. wagtail/locale/ru/LC_MESSAGES/django.mo +0 -0
  216. wagtail/locale/ru/LC_MESSAGES/django.po +11 -1
  217. wagtail/locales/locale/en/LC_MESSAGES/django.po +1 -1
  218. wagtail/locales/locale/nl/LC_MESSAGES/django.mo +0 -0
  219. wagtail/locales/locale/nl/LC_MESSAGES/django.po +12 -1
  220. wagtail/locales/locale/ru/LC_MESSAGES/django.mo +0 -0
  221. wagtail/locales/locale/ru/LC_MESSAGES/django.po +10 -1
  222. wagtail/locales/views.py +2 -2
  223. wagtail/models/orderable.py +10 -0
  224. wagtail/models/pages.py +9 -11
  225. wagtail/models/sites.py +1 -1
  226. wagtail/models/workflows.py +8 -5
  227. wagtail/project_template/home/tests.py +6 -7
  228. wagtail/project_template/project_name/settings/base.py +9 -9
  229. wagtail/project_template/requirements.txt +1 -1
  230. wagtail/query.py +7 -2
  231. wagtail/rich_text/rewriters.py +1 -1
  232. wagtail/search/apps.py +4 -49
  233. wagtail/search/backends/__init__.py +1 -113
  234. wagtail/search/backends/base.py +1 -547
  235. wagtail/search/backends/database/__init__.py +1 -50
  236. wagtail/search/backends/database/fallback.py +1 -253
  237. wagtail/search/backends/database/mysql/mysql.py +1 -700
  238. wagtail/search/backends/database/mysql/query.py +1 -258
  239. wagtail/search/backends/database/postgres/postgres.py +1 -749
  240. wagtail/search/backends/database/postgres/query.py +1 -83
  241. wagtail/search/backends/database/postgres/weights.py +1 -63
  242. wagtail/search/backends/database/sqlite/query.py +1 -294
  243. wagtail/search/backends/database/sqlite/sqlite.py +1 -719
  244. wagtail/search/backends/database/sqlite/utils.py +1 -35
  245. wagtail/search/backends/deprecation.py +45 -0
  246. wagtail/search/backends/elasticsearch7.py +18 -1260
  247. wagtail/search/backends/elasticsearch8.py +21 -96
  248. wagtail/search/backends/elasticsearch9.py +35 -0
  249. wagtail/search/backends/opensearch2.py +35 -0
  250. wagtail/search/backends/opensearch3.py +35 -0
  251. wagtail/search/index.py +1 -358
  252. wagtail/search/locale/en/LC_MESSAGES/django.po +2 -10
  253. wagtail/search/management/commands/update_index.py +1 -205
  254. wagtail/search/management/commands/wagtail_update_index.py +1 -4
  255. wagtail/search/models.py +32 -158
  256. wagtail/search/query.py +1 -114
  257. wagtail/search/queryset.py +1 -43
  258. wagtail/search/signal_handlers.py +1 -24
  259. wagtail/search/tasks.py +1 -10
  260. wagtail/search/tests/test_elasticsearch.py +22 -0
  261. wagtail/search/utils.py +1 -206
  262. wagtail/sites/locale/en/LC_MESSAGES/django.po +1 -1
  263. wagtail/snippets/locale/en/LC_MESSAGES/django.po +3 -3
  264. wagtail/snippets/locale/ru/LC_MESSAGES/django.mo +0 -0
  265. wagtail/snippets/locale/ru/LC_MESSAGES/django.po +8 -1
  266. wagtail/snippets/locale/tr/LC_MESSAGES/django.mo +0 -0
  267. wagtail/snippets/locale/tr/LC_MESSAGES/django.po +8 -1
  268. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser-telepath.js +1 -1
  269. wagtail/snippets/static/wagtailsnippets/js/snippet-chooser.js +1 -1
  270. wagtail/snippets/tests/test_reordering.py +319 -0
  271. wagtail/snippets/tests/test_snippets.py +65 -12
  272. wagtail/snippets/views/snippets.py +16 -0
  273. wagtail/test/numberformat.py +30 -0
  274. wagtail/test/settings.py +35 -12
  275. wagtail/test/testapp/fields.py +12 -0
  276. wagtail/test/testapp/migrations/0056_commentablejsonpage.py +50 -0
  277. wagtail/test/testapp/migrations/0057_featurecompletetoy_sort_order.py +23 -0
  278. wagtail/test/testapp/migrations/0058_customlocktask.py +31 -0
  279. wagtail/test/testapp/models.py +27 -0
  280. wagtail/test/testapp/views.py +3 -1
  281. wagtail/test/utils/page_tests.py +17 -17
  282. wagtail/test/utils/template_tests.py +4 -6
  283. wagtail/test/utils/wagtail_tests.py +1 -2
  284. wagtail/tests/test_page_model.py +15 -0
  285. wagtail/{search/tests → tests}/test_page_search.py +29 -2
  286. wagtail/tests/test_search_fields.py +69 -0
  287. wagtail/tests/test_tests.py +62 -6
  288. wagtail/tests/test_workflow.py +25 -1
  289. wagtail/users/locale/cs/LC_MESSAGES/django.mo +0 -0
  290. wagtail/users/locale/cs/LC_MESSAGES/django.po +3 -0
  291. wagtail/users/locale/en/LC_MESSAGES/django.po +2 -2
  292. wagtail/users/locale/nl/LC_MESSAGES/django.mo +0 -0
  293. wagtail/users/locale/nl/LC_MESSAGES/django.po +6 -3
  294. wagtail/users/locale/ru/LC_MESSAGES/django.mo +0 -0
  295. wagtail/users/locale/ru/LC_MESSAGES/django.po +5 -1
  296. wagtail/users/locale/tr/LC_MESSAGES/django.mo +0 -0
  297. wagtail/users/locale/tr/LC_MESSAGES/django.po +78 -4
  298. wagtail/users/templates/wagtailusers/users/create.html +2 -0
  299. wagtail/users/templates/wagtailusers/users/edit.html +2 -0
  300. wagtail/users/tests/test_admin_views.py +4 -0
  301. wagtail/users/views/users.py +1 -1
  302. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/METADATA +7 -6
  303. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/RECORD +309 -315
  304. wagtail/admin/templates/wagtailadmin/collection_privacy/set_privacy.html +0 -13
  305. wagtail/admin/templates/wagtailadmin/page_privacy/set_privacy.html +0 -13
  306. wagtail/search/tests/__init__.py +0 -0
  307. wagtail/search/tests/elasticsearch_common_tests.py +0 -251
  308. wagtail/search/tests/test_backends.py +0 -1215
  309. wagtail/search/tests/test_db_backend.py +0 -62
  310. wagtail/search/tests/test_elasticsearch7_backend.py +0 -1452
  311. wagtail/search/tests/test_elasticsearch8_backend.py +0 -15
  312. wagtail/search/tests/test_index_functions.py +0 -256
  313. wagtail/search/tests/test_indexed_class.py +0 -157
  314. wagtail/search/tests/test_mysql_backend.py +0 -192
  315. wagtail/search/tests/test_postgres_backend.py +0 -210
  316. wagtail/search/tests/test_queries.py +0 -332
  317. wagtail/search/tests/test_related_fields.py +0 -102
  318. wagtail/search/tests/test_sqlite_backend.py +0 -52
  319. wagtail/test/search/__init__.py +0 -0
  320. wagtail/test/search/apps.py +0 -9
  321. wagtail/test/search/fixtures/search.json +0 -545
  322. wagtail/test/search/migrations/0001_initial.py +0 -146
  323. wagtail/test/search/migrations/0002_bookunindexed.py +0 -43
  324. wagtail/test/search/migrations/0003_book_summary.py +0 -18
  325. wagtail/test/search/migrations/__init__.py +0 -0
  326. wagtail/test/search/models.py +0 -137
  327. /wagtail/admin/templates/wagtailadmin/{pages/listing/_ordering_cell.html → tables/ordering_cell.html} +0 -0
  328. /wagtail/{search/checks.py → checks.py} +0 -0
  329. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/WHEEL +0 -0
  330. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/entry_points.txt +0 -0
  331. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/licenses/LICENSE +0 -0
  332. {wagtail-7.1.2.dist-info → wagtail-7.2rc1.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t={4625:(e,t,c)=>{var n=c(9675);const o="[data-bulk-action-checkbox]",r="[data-bulk-action-select-all-checkbox]",d="[data-bulk-action-footer]",a="[data-bulk-action-num-objects]",l="[data-bulk-action-num-objects-in-listing]",i=document.querySelector(d).getAttribute("data-bulk-action-footer");let s={};function u(e){return wagtailConfig.STRINGS.BULK_ACTIONS[i]?wagtailConfig.STRINGS.BULK_ACTIONS[i][e]:wagtailConfig.STRINGS.BULK_ACTIONS.ITEM[e]}function h(e){document.querySelectorAll(r).forEach((t=>{t.checked=e.target.checked}));const t=new Event("change");document.querySelectorAll(o).forEach((c=>{c.checked!==e.target.checked&&(c.checked=e.target.checked,e.target.checked?c.dispatchEvent(t):c.classList.remove("show"))})),e.target.checked||(s.checkedObjects.clear(),document.querySelector(d).classList.add("hidden"))}function b(e){if(e.shiftKey&&s.prevCheckedObject){const t=[...document.querySelectorAll(o)],c=t.findIndex((e=>e.dataset.objectId===s.prevCheckedObject)),r=t.findIndex((t=>t.dataset.objectId===e.target.dataset.objectId)),d=(c>r?r:c)+1,a=c<=r?r:c;(0,n.y)(d,a).forEach((e=>{const n=new Event("change");t[e].checked=t[c].checked,t[e].dispatchEvent(n)})),s.prevCheckedObject=e.target.dataset.objectId}}function f(e){s.selectAllInListing&&(s.selectAllInListing=!1);const t=s.checkedObjects.size;e.target.checked?s.checkedObjects.add(e.target.dataset.objectId):(document.querySelectorAll(r).forEach((e=>{e.checked=!1})),s.checkedObjects.delete(e.target.dataset.objectId));const c=s.checkedObjects.size;if(0===c?(document.querySelector(d).classList.add("hidden"),document.querySelectorAll(o).forEach((e=>e.classList.remove("show")))):1===c&&0===t&&(document.querySelectorAll(o).forEach((e=>{e.classList.add("show")})),document.querySelector(d).classList.remove("hidden")),c===s.numObjects?(document.querySelectorAll(r).forEach((e=>{e.checked=!0})),s.shouldShowAllInListingText&&document.querySelector(l).classList.remove("w-hidden")):s.shouldShowAllInListingText&&document.querySelector(l).classList.add("w-hidden"),c>0){let e="";e=1===c?u("SINGULAR"):c===s.numObjects?u("ALL").replace("%(objects)s",c):u("PLURAL").replace("%(objects)s",c),document.querySelector(a).textContent=e}s.prevCheckedObject=e.target.dataset.objectId}function g(e){e.preventDefault(),s.selectAllInListing=!0,document.querySelector(a).textContent=`${u("ALL_IN_LISTING")}.`,document.querySelector(l).classList.add("w-hidden")}function v(e){e.preventDefault();const t=e.target.getAttribute("href"),c=new URLSearchParams(window.location.search);if(s.selectAllInListing){c.append("id","all");const e=document.querySelector("[data-bulk-action-parent-id]");if(e){const t=e.dataset.bulkActionParentId;c.append("childOf",t)}}else s.checkedObjects.forEach((e=>{c.append("id",e)}));window.location.href=`${t}&${c.toString()}`}document.addEventListener("DOMContentLoaded",(function(){s={checkedObjects:new Set,numObjects:0,selectAllInListing:!1,shouldShowAllInListingText:!0,prevCheckedObject:null};const e=new Event("change");document.querySelectorAll(o).forEach((e=>{s.numObjects+=1,e.addEventListener("change",f),e.addEventListener("click",b)})),document.querySelectorAll(r).forEach((e=>{e.addEventListener("change",h)})),document.querySelectorAll(`${d} [data-bulk-action-button]`).forEach((e=>e.addEventListener("click",v))),document.addEventListener("w-dropdown:shown",(()=>{document.querySelectorAll(`${d} [data-bulk-action-button]`).forEach((e=>{e.removeEventListener("click",v),e.addEventListener("click",v)}))}));const t=document.querySelector(l);t?t.addEventListener("click",g):s.shouldShowAllInListingText=!1,document.querySelectorAll(o).forEach((t=>{t.checked&&t.dispatchEvent(e)}))})),document.addEventListener("w-swap:success",(function(){document.querySelectorAll(r).forEach((e=>{e.checked=!1})),document.querySelector(d).classList.add("hidden"),document.querySelectorAll(r).forEach((e=>{e.removeEventListener("change",h),e.addEventListener("change",h)})),s.checkedObjects.clear(),s.numObjects=0,document.querySelectorAll(o).forEach((e=>{s.numObjects+=1,e.addEventListener("change",f)}))}))}},c={};function n(e){var o=c[e];if(void 0!==o)return o.exports;var r=c[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,c,o,r)=>{if(!c){var d=1/0;for(s=0;s<e.length;s++){for(var[c,o,r]=e[s],a=!0,l=0;l<c.length;l++)(!1&r||d>=r)&&Object.keys(n.O).every((e=>n.O[e](c[l])))?c.splice(l--,1):(a=!1,r<d&&(d=r));if(a){e.splice(s--,1);var i=o();void 0!==i&&(t=i)}}return t}r=r||0;for(var s=e.length;s>0&&e[s-1][2]>r;s--)e[s]=e[s-1];e[s]=[c,o,r]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var c in t)n.o(t,c)&&!n.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:t[c]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=217,(()=>{var e={217:0};n.O.j=t=>0===e[t];var t=(t,c)=>{var o,r,[d,a,l]=c,i=0;if(d.some((t=>0!==e[t]))){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(l)var s=l(n)}for(t&&t(c);i<d.length;i++)r=d[i],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(s)},c=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];c.forEach(t.bind(null,0)),c.push=t.bind(null,c.push.bind(c))})();var o=n.O(void 0,[321],(()=>n(4625)));o=n.O(o)})();
1
+ (()=>{"use strict";var e,t={4625:(e,t,c)=>{var n=c(9675);const o="[data-bulk-action-checkbox]",r="[data-bulk-action-select-all-checkbox]",d="[data-bulk-action-footer]",a="[data-bulk-action-num-objects]",l="[data-bulk-action-num-objects-in-listing]",i=document.querySelector(d).getAttribute("data-bulk-action-footer");let s={};function u(e){return wagtailConfig.STRINGS.BULK_ACTIONS[i]?wagtailConfig.STRINGS.BULK_ACTIONS[i][e]:wagtailConfig.STRINGS.BULK_ACTIONS.ITEM[e]}function h(e){document.querySelectorAll(r).forEach(t=>{t.checked=e.target.checked});const t=new Event("change");document.querySelectorAll(o).forEach(c=>{c.checked!==e.target.checked&&(c.checked=e.target.checked,e.target.checked?c.dispatchEvent(t):c.classList.remove("show"))}),e.target.checked||(s.checkedObjects.clear(),document.querySelector(d).classList.add("hidden"))}function b(e){if(e.shiftKey&&s.prevCheckedObject){const t=[...document.querySelectorAll(o)],c=t.findIndex(e=>e.dataset.objectId===s.prevCheckedObject),r=t.findIndex(t=>t.dataset.objectId===e.target.dataset.objectId),d=(c>r?r:c)+1,a=c<=r?r:c;(0,n.y)(d,a).forEach(e=>{const n=new Event("change");t[e].checked=t[c].checked,t[e].dispatchEvent(n)}),s.prevCheckedObject=e.target.dataset.objectId}}function f(e){s.selectAllInListing&&(s.selectAllInListing=!1);const t=s.checkedObjects.size;e.target.checked?s.checkedObjects.add(e.target.dataset.objectId):(document.querySelectorAll(r).forEach(e=>{e.checked=!1}),s.checkedObjects.delete(e.target.dataset.objectId));const c=s.checkedObjects.size;if(0===c?(document.querySelector(d).classList.add("hidden"),document.querySelectorAll(o).forEach(e=>e.classList.remove("show"))):1===c&&0===t&&(document.querySelectorAll(o).forEach(e=>{e.classList.add("show")}),document.querySelector(d).classList.remove("hidden")),c===s.numObjects?(document.querySelectorAll(r).forEach(e=>{e.checked=!0}),s.shouldShowAllInListingText&&document.querySelector(l).classList.remove("w-hidden")):s.shouldShowAllInListingText&&document.querySelector(l).classList.add("w-hidden"),c>0){let e="";e=1===c?u("SINGULAR"):c===s.numObjects?u("ALL").replace("%(objects)s",c):u("PLURAL").replace("%(objects)s",c),document.querySelector(a).textContent=e}s.prevCheckedObject=e.target.dataset.objectId}function g(e){e.preventDefault(),s.selectAllInListing=!0,document.querySelector(a).textContent=`${u("ALL_IN_LISTING")}.`,document.querySelector(l).classList.add("w-hidden")}function v(e){e.preventDefault();const t=e.target.getAttribute("href"),c=new URLSearchParams(window.location.search);if(s.selectAllInListing){c.append("id","all");const e=document.querySelector("[data-bulk-action-parent-id]");if(e){const t=e.dataset.bulkActionParentId;c.append("childOf",t)}}else s.checkedObjects.forEach(e=>{c.append("id",e)});window.location.href=`${t}&${c.toString()}`}document.addEventListener("DOMContentLoaded",function(){s={checkedObjects:new Set,numObjects:0,selectAllInListing:!1,shouldShowAllInListingText:!0,prevCheckedObject:null};const e=new Event("change");document.querySelectorAll(o).forEach(e=>{s.numObjects+=1,e.addEventListener("change",f),e.addEventListener("click",b)}),document.querySelectorAll(r).forEach(e=>{e.addEventListener("change",h)}),document.querySelectorAll(`${d} [data-bulk-action-button]`).forEach(e=>e.addEventListener("click",v)),document.addEventListener("w-dropdown:shown",()=>{document.querySelectorAll(`${d} [data-bulk-action-button]`).forEach(e=>{e.removeEventListener("click",v),e.addEventListener("click",v)})});const t=document.querySelector(l);t?t.addEventListener("click",g):s.shouldShowAllInListingText=!1,document.querySelectorAll(o).forEach(t=>{t.checked&&t.dispatchEvent(e)})}),document.addEventListener("w-swap:success",function(){document.querySelectorAll(r).forEach(e=>{e.checked=!1}),document.querySelector(d).classList.add("hidden"),document.querySelectorAll(r).forEach(e=>{e.removeEventListener("change",h),e.addEventListener("change",h)}),s.checkedObjects.clear(),s.numObjects=0,document.querySelectorAll(o).forEach(e=>{s.numObjects+=1,e.addEventListener("change",f)})})}},c={};function n(e){var o=c[e];if(void 0!==o)return o.exports;var r=c[e]={exports:{}};return t[e](r,r.exports,n),r.exports}n.m=t,e=[],n.O=(t,c,o,r)=>{if(!c){var d=1/0;for(s=0;s<e.length;s++){for(var[c,o,r]=e[s],a=!0,l=0;l<c.length;l++)(!1&r||d>=r)&&Object.keys(n.O).every(e=>n.O[e](c[l]))?c.splice(l--,1):(a=!1,r<d&&(d=r));if(a){e.splice(s--,1);var i=o();void 0!==i&&(t=i)}}return t}r=r||0;for(var s=e.length;s>0&&e[s-1][2]>r;s--)e[s]=e[s-1];e[s]=[c,o,r]},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var c in t)n.o(t,c)&&!n.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:t[c]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.j=217,(()=>{var e={217:0};n.O.j=t=>0===e[t];var t=(t,c)=>{var o,r,[d,a,l]=c,i=0;if(d.some(t=>0!==e[t])){for(o in a)n.o(a,o)&&(n.m[o]=a[o]);if(l)var s=l(n)}for(t&&t(c);i<d.length;i++)r=d[i],n.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return n.O(s)},c=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];c.forEach(t.bind(null,0)),c.push=t.bind(null,c.push.bind(c))})();var o=n.O(void 0,[321],()=>n(4625));o=n.O(o)})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e,r={7599:(e,r,o)=>{var t=o(2614);window.ChooserModalOnloadHandlerFactory=t.C4,window.CHOOSER_MODAL_ONLOAD_HANDLERS=t.FF},1669:e=>{e.exports=jQuery}},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,t),a.exports}t.m=r,e=[],t.O=(r,o,n,a)=>{if(!o){var i=1/0;for(f=0;f<e.length;f++){for(var[o,n,a]=e[f],l=!0,u=0;u<o.length;u++)(!1&a||i>=a)&&Object.keys(t.O).every((e=>t.O[e](o[u])))?o.splice(u--,1):(l=!1,a<i&&(i=a));if(l){e.splice(f--,1);var d=n();void 0!==d&&(r=d)}}return r}a=a||0;for(var f=e.length;f>0&&e[f-1][2]>a;f--)e[f]=e[f-1];e[f]=[o,n,a]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.j=238,(()=>{var e={238:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[i,l,u]=o,d=0;if(i.some((r=>0!==e[r]))){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(u)var f=u(t)}for(r&&r(o);d<i.length;d++)a=i[d],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(f)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})();var n=t.O(void 0,[321],(()=>t(7599)));n=t.O(n)})();
1
+ (()=>{"use strict";var e,r={1669:e=>{e.exports=jQuery},7599:(e,r,o)=>{var t=o(2614);window.ChooserModalOnloadHandlerFactory=t.C4,window.CHOOSER_MODAL_ONLOAD_HANDLERS=t.FF}},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={exports:{}};return r[e](a,a.exports,t),a.exports}t.m=r,e=[],t.O=(r,o,n,a)=>{if(!o){var i=1/0;for(f=0;f<e.length;f++){for(var[o,n,a]=e[f],l=!0,u=0;u<o.length;u++)(!1&a||i>=a)&&Object.keys(t.O).every(e=>t.O[e](o[u]))?o.splice(u--,1):(l=!1,a<i&&(i=a));if(l){e.splice(f--,1);var d=n();void 0!==d&&(r=d)}}return r}a=a||0;for(var f=e.length;f>0&&e[f-1][2]>a;f--)e[f]=e[f-1];e[f]=[o,n,a]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.j=238,(()=>{var e={238:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,a,[i,l,u]=o,d=0;if(i.some(r=>0!==e[r])){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(u)var f=u(t)}for(r&&r(o);d<i.length;d++)a=i[d],t.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return t.O(f)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})();var n=t.O(void 0,[321],()=>t(7599));n=t.O(n)})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e,r={8878:(e,r,t)=>{var o=t(9465);window.telepath.register("wagtail.admin.widgets.Chooser",o._)},1669:e=>{e.exports=jQuery}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,n,i)=>{if(!t){var a=1/0;for(f=0;f<e.length;f++){for(var[t,n,i]=e[f],l=!0,u=0;u<t.length;u++)(!1&i||a>=i)&&Object.keys(o.O).every((e=>o.O[e](t[u])))?t.splice(u--,1):(l=!1,i<a&&(a=i));if(l){e.splice(f--,1);var s=n();void 0!==s&&(r=s)}}return r}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[t,n,i]},o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=577,(()=>{var e={577:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[a,l,u]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);if(u)var f=u(o)}for(r&&r(t);s<a.length;s++)i=a[s],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(f)},t=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n=o.O(void 0,[321],(()=>o(8878)));n=o.O(n)})();
1
+ (()=>{"use strict";var e,r={1669:e=>{e.exports=jQuery},8878:(e,r,t)=>{var o=t(9465);window.telepath.register("wagtail.admin.widgets.Chooser",o._)}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,n,i)=>{if(!t){var a=1/0;for(f=0;f<e.length;f++){for(var[t,n,i]=e[f],l=!0,u=0;u<t.length;u++)(!1&i||a>=i)&&Object.keys(o.O).every(e=>o.O[e](t[u]))?t.splice(u--,1):(l=!1,i<a&&(a=i));if(l){e.splice(f--,1);var s=n();void 0!==s&&(r=s)}}return r}i=i||0;for(var f=e.length;f>0&&e[f-1][2]>i;f--)e[f]=e[f-1];e[f]=[t,n,i]},o.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return o.d(r,{a:r}),r},o.d=(e,r)=>{for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=577,(()=>{var e={577:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var n,i,[a,l,u]=t,s=0;if(a.some(r=>0!==e[r])){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);if(u)var f=u(o)}for(r&&r(t);s<a.length;s++)i=a[s],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(f)},t=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var n=o.O(void 0,[321],()=>o(8878));n=o.O(n)})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e,r={2732:(e,r,o)=>{var t=o(9465);window.Chooser=t.y},1669:e=>{e.exports=jQuery}},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,t),i.exports}t.m=r,e=[],t.O=(r,o,n,i)=>{if(!o){var a=1/0;for(s=0;s<e.length;s++){for(var[o,n,i]=e[s],l=!0,u=0;u<o.length;u++)(!1&i||a>=i)&&Object.keys(t.O).every((e=>t.O[e](o[u])))?o.splice(u--,1):(l=!1,i<a&&(a=i));if(l){e.splice(s--,1);var f=n();void 0!==f&&(r=f)}}return r}i=i||0;for(var s=e.length;s>0&&e[s-1][2]>i;s--)e[s]=e[s-1];e[s]=[o,n,i]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.j=307,(()=>{var e={307:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,i,[a,l,u]=o,f=0;if(a.some((r=>0!==e[r]))){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(u)var s=u(t)}for(r&&r(o);f<a.length;f++)i=a[f],t.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return t.O(s)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})();var n=t.O(void 0,[321],(()=>t(2732)));n=t.O(n)})();
1
+ (()=>{"use strict";var e,r={1669:e=>{e.exports=jQuery},2732:(e,r,o)=>{var t=o(9465);window.Chooser=t.y}},o={};function t(e){var n=o[e];if(void 0!==n)return n.exports;var i=o[e]={exports:{}};return r[e](i,i.exports,t),i.exports}t.m=r,e=[],t.O=(r,o,n,i)=>{if(!o){var a=1/0;for(s=0;s<e.length;s++){for(var[o,n,i]=e[s],l=!0,u=0;u<o.length;u++)(!1&i||a>=i)&&Object.keys(t.O).every(e=>t.O[e](o[u]))?o.splice(u--,1):(l=!1,i<a&&(a=i));if(l){e.splice(s--,1);var f=n();void 0!==f&&(r=f)}}return r}i=i||0;for(var s=e.length;s>0&&e[s-1][2]>i;s--)e[s]=e[s-1];e[s]=[o,n,i]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.j=307,(()=>{var e={307:0};t.O.j=r=>0===e[r];var r=(r,o)=>{var n,i,[a,l,u]=o,f=0;if(a.some(r=>0!==e[r])){for(n in l)t.o(l,n)&&(t.m[n]=l[n]);if(u)var s=u(t)}for(r&&r(o);f<a.length;f++)i=a[f],t.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return t.O(s)},o=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})();var n=t.O(void 0,[321],()=>t(2732));n=t.O(n)})();
@@ -1 +1 @@
1
- (()=>{"use strict";var e,t={9786:(e,t,n)=>{var o=n(2833),r=n(2427),s=n.n(r),c=n(6931),a=n.n(c);function i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),m=()=>Math.random().toString(36).substring(7).split("").join("."),u={INIT:`@@redux/INIT${m()}`,REPLACE:`@@redux/REPLACE${m()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${m()}`};function d(e,t,n){if("function"!=typeof e)throw new Error(i(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(i(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(i(1));return n(d)(e,t)}let o=e,r=t,s=new Map,c=s,a=0,m=!1;function p(){c===s&&(c=new Map,s.forEach(((e,t)=>{c.set(t,e)})))}function f(){if(m)throw new Error(i(3));return r}function h(e){if("function"!=typeof e)throw new Error(i(4));if(m)throw new Error(i(5));let t=!0;p();const n=a++;return c.set(n,e),function(){if(t){if(m)throw new Error(i(6));t=!1,p(),c.delete(n),s=null}}}function y(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(i(7));if(void 0===e.type)throw new Error(i(8));if("string"!=typeof e.type)throw new Error(i(17));if(m)throw new Error(i(9));try{m=!0,r=o(r,e)}finally{m=!1}return(s=c).forEach((e=>{e()})),e}return y({type:u.INIT}),{dispatch:y,subscribe:h,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error(i(10));o=e,y({type:u.REPLACE})},[l]:function(){const e=h;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(i(11));function n(){const e=t;e.next&&e.next(f())}return n(),{unsubscribe:e(n)}},[l](){return this}}}}}function p(e,t,n){const o=e.get(t);return void 0===o?n:o}class f{commentElements=new Map;commentAnnotations=new Map;commentTabs=new Map;commentDesiredPositions=new Map;commentHeights=new Map;pinnedComment=null;commentCalculatedPositions=new Map;isDirty=!1;setCommentElement(e,t){null!==t?this.commentElements.set(e,t):this.commentElements.delete(e),this.isDirty=!0}setCommentAnnotation(e,t){this.commentAnnotations.set(e,t),this.commentTabs.set(e,t.getTab()||null),this.updateDesiredPosition(e),this.isDirty=!0}setCommentHeight(e,t){this.commentHeights.get(e)!==t&&(this.commentHeights.set(e,t),this.isDirty=!0)}setPinnedComment(e){this.pinnedComment=e,this.isDirty=!0}updateDesiredPosition(e){const t=this.commentAnnotations.get(e);if(!t)return;const n=t.getAnchorNode(e===this.pinnedComment);let o=n.getBoundingClientRect().top,r=n.parentElement;for(;r;)o+=r.scrollTop,r=r.parentElement;this.commentDesiredPositions.set(e,0!==o?o+-50:0)}refreshDesiredPositions(e=null){const t=new Map(this.commentDesiredPositions);this.commentAnnotations.forEach(((t,n)=>{this.getCommentTabVisible(e,n)&&this.updateDesiredPosition(n)})),this.commentDesiredPositions!==t&&(this.isDirty=!0)}refreshLayout(){if(!this.isDirty)return!1;const e=Array.from(this.commentElements.keys()).map((e=>({tab:p(this.commentTabs,e,null),position:p(this.commentDesiredPositions,e,0),height:p(this.commentHeights,e,0),comments:[e],containsPinnedComment:null!==this.pinnedComment&&e===this.pinnedComment,pinnedCommentPosition:0}))),t=new Map;e.forEach((e=>{const n=t.get(e.tab)||[];n.push(e),t.set(e.tab,n)}));const n=this.pinnedComment?this.commentDesiredPositions.get(this.pinnedComment):void 0,o=this.pinnedComment?this.commentTabs.get(this.pinnedComment):void 0;return Array.from(t.entries()).forEach((([e,t])=>{const r=this.pinnedComment&&o===e;t.sort(((e,t)=>e.position-t.position));let s=t,c=!0;for(;c;){c=!1;const e=[];let t=null;for(const o of s)t&&t.position+t.height+20>o.position?(c=!0,t.comments.push(...o.comments),o.containsPinnedComment&&(t.containsPinnedComment=!0,t.pinnedCommentPosition=o.pinnedCommentPosition+t.height),t.height+=o.height,!r&&t.position<50&&(t.position=100+t.height- -50),n&&t.containsPinnedComment&&(t.position=n-t.pinnedCommentPosition)):(e.push(o),t=o);s=e}s.forEach((e=>{let t=e.position;e.comments.forEach((e=>{this.commentCalculatedPositions.set(e,t);const n=this.commentHeights.get(e);n&&(t+=n+20)}))}))})),this.isDirty=!1,!0}getCommentTabVisible(e,t){return p(this.commentTabs,t,null)===e}getCommentVisible(e,t){return this.getCommentTabVisible(e,t)&&p(this.commentDesiredPositions,t,1)>0}getCommentPosition(e){return this.commentCalculatedPositions.has(e)?this.commentCalculatedPositions.get(e):this.commentDesiredPositions.get(e)}}let h=1,y=1;function _(){return h+=1,h}function b(){return y+=1,y}var g=Symbol.for("immer-nothing"),v=Symbol.for("immer-draftable"),E=Symbol.for("immer-state");function C(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var w=Object.getPrototypeOf;function I(e){return!!e&&!!e[E]}function N(e){return!!e&&(P(e)||Array.isArray(e)||!!e[v]||!!e.constructor?.[v]||D(e)||R(e))}var x=Object.prototype.constructor.toString();function P(e){if(!e||"object"!=typeof e)return!1;const t=w(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===x}function A(e,t){0===S(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,o)=>t(o,n,e)))}function S(e){const t=e[E];return t?t.type_:Array.isArray(e)?1:D(e)?2:R(e)?3:0}function F(e,t){return 2===S(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k(e,t,n){const o=S(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function D(e){return e instanceof Map}function R(e){return e instanceof Set}function T(e){return e.copy_||e.base_}function O(e,t){if(D(e))return new Map(e);if(R(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=P(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[E];let n=Reflect.ownKeys(t);for(let o=0;o<n.length;o++){const r=n[o],s=t[r];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[r]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[r]})}return Object.create(w(e),t)}{const t=w(e);if(null!==t&&n)return{...e};const o=Object.create(t);return Object.assign(o,e)}}function M(e,t=!1){return z(e)||I(e)||!N(e)||(S(e)>1&&(e.set=e.add=e.clear=e.delete=j),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>M(t,!0)))),e}function j(){C(2)}function z(e){return Object.isFrozen(e)}var L,U={};function $(e){const t=U[e];return t||C(0),t}function H(){return L}function q(e,t){t&&($("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K(e){W(e),e.drafts_.forEach(V),e.drafts_=null}function W(e){e===L&&(L=e.parent_)}function B(e){return L={drafts_:[],parent_:L,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function V(e){const t=e[E];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function X(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[E].modified_&&(K(t),C(4)),N(e)&&(e=J(t,e),t.parent_||G(t,e)),t.patches_&&$("Patches").generateReplacementPatches_(n[E].base_,e,t.patches_,t.inversePatches_)):e=J(t,n,[]),K(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==g?e:void 0}function J(e,t,n){if(z(t))return t;const o=t[E];if(!o)return A(t,((r,s)=>Y(e,o,t,r,s,n))),t;if(o.scope_!==e)return t;if(!o.modified_)return G(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,s=!1;3===o.type_&&(r=new Set(t),t.clear(),s=!0),A(r,((r,c)=>Y(e,o,t,r,c,n,s))),G(e,t,!1),n&&e.patches_&&$("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Y(e,t,n,o,r,s,c){if(I(r)){const c=J(e,r,s&&t&&3!==t.type_&&!F(t.assigned_,o)?s.concat(o):void 0);if(k(n,o,c),!I(c))return;e.canAutoFreeze_=!1}else c&&n.add(r);if(N(r)&&!z(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;J(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||G(e,r)}}function G(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&M(t,n)}var Q={get(e,t){if(t===E)return e;const n=T(e);if(!F(n,t))return function(e,t,n){const o=te(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!N(o)?o:o===ee(e.base_,t)?(oe(e),e.copy_[t]=re(o,e)):o},has:(e,t)=>t in T(e),ownKeys:e=>Reflect.ownKeys(T(e)),set(e,t,n){const o=te(T(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=ee(T(e),t),c=o?.[E];if(c&&c.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(s=o)?0!==r||1/r==1/s:r!=r&&s!=s)&&(void 0!==n||F(e.base_,t)))return!0;oe(e),ne(e)}var r,s;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ee(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,oe(e),ne(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=T(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){C(11)},getPrototypeOf:e=>w(e.base_),setPrototypeOf(){C(12)}},Z={};function ee(e,t){const n=e[E];return(n?T(n):e)[t]}function te(e,t){if(!(t in e))return;let n=w(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=w(n)}}function ne(e){e.modified_||(e.modified_=!0,e.parent_&&ne(e.parent_))}function oe(e){e.copy_||(e.copy_=O(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function re(e,t){const n=D(e)?$("MapSet").proxyMap_(e,t):R(e)?$("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,s=Q;n&&(r=[o],s=Z);const{revoke:c,proxy:a}=Proxy.revocable(r,s);return o.draft_=a,o.revoke_=c,a}(e,t);return(t?t.scope_:H()).drafts_.push(n),n}function se(e){if(!N(e)||z(e))return e;const t=e[E];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=O(e,t.scope_.immer_.useStrictShallowCopy_)}else n=O(e,!0);return A(n,((e,t)=>{k(n,e,se(t))})),t&&(t.finalized_=!1),n}A(Q,((e,t)=>{Z[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Z.deleteProperty=function(e,t){return Z.set.call(this,e,t,void 0)},Z.set=function(e,t,n){return Q.set.call(this,e[0],t,n,e[0])};var ce=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,(e=>t.call(this,e,...r)))}}let o;if("function"!=typeof t&&C(6),void 0!==n&&"function"!=typeof n&&C(7),N(e)){const r=B(this),s=re(e,void 0);let c=!0;try{o=t(s),c=!1}finally{c?K(r):W(r)}return q(r,n),X(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===g&&(o=void 0),this.autoFreeze_&&M(o,!0),n){const t=[],r=[];$("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}C(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,o;return[this.produce(e,t,((e,t)=>{n=e,o=t})),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;N(e)||C(8),I(e)&&(I(t=e)||C(10),e=se(t));const n=B(this),o=re(e,void 0);return o[E].isManual_=!0,W(n),o}finishDraft(e,t){const n=e&&e[E];n&&n.isManual_||C(9);const{scope_:o}=n;return q(o,t),X(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=$("Patches").applyPatches_;return I(e)?o(e,t):this.produce(e,(e=>o(e,t)))}},ae=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseStrictShallowCopy.bind(ce),ce.applyPatches.bind(ce),ce.createDraft.bind(ce),ce.finishDraft.bind(ce);const ie="add-comment",le="update-comment",me="delete-comment",ue="resolve-comment",de="set-focused-comment",pe="add-reply",fe="update-reply",he="delete-reply",ye="invalidate-content-path";function _e(e){return{type:ie,comment:e}}function be(e,t){return{type:le,commentId:e,update:t}}function ge(e){return{type:me,commentId:e}}function ve(e){return{type:ue,commentId:e}}function Ee(e,{updatePinnedComment:t,forceFocus:n}={updatePinnedComment:!1,forceFocus:!1}){return{type:de,commentId:e,updatePinnedComment:t,forceFocus:n}}function Ce(e,t){return{type:pe,commentId:e,reply:t}}function we(e,t,n){return{type:fe,commentId:e,replyId:t,update:n}}function Ie(e,t){return{type:he,commentId:e,replyId:t}}function Ne(e){return{type:ye,contentPath:e}}const xe={addComment:_e,updateComment:be,deleteComment:ge,resolveComment:ve,setFocusedComment:Ee,addReply:Ce,updateReply:we,deleteReply:Ie,invalidateContentPath:Ne};function Pe(e,t,n,{remoteId:o=null,mode:r="default",text:s="",deleted:c=!1}){return{localId:e,remoteId:o,mode:r,author:t,date:n,text:s,originalText:s,newText:"",deleted:c}}function Ae(e,t,n,o,r,s,{remoteId:c=null,mode:a="default",text:i="",resolved:l=!1,deleted:m=!1,replies:u=new Map}){return{contentpath:e,position:t,localId:n,annotation:o,remoteId:c,mode:a,author:r,date:s,text:i,originalText:i,replies:u,newReply:"",newText:"",deleted:m,resolved:l,remoteReplyCount:Array.from(u.values()).reduce(((e,t)=>null!==t.remoteId?e+1:e),0)}}!function(){class e extends Map{constructor(e,t){super(),this[E]={type_:2,parent_:t,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return T(this[E]).size}has(e){return T(this[E]).has(e)}set(e,n){const o=this[E];return r(o),T(o).has(e)&&T(o).get(e)===n||(t(o),ne(o),o.assigned_.set(e,!0),o.copy_.set(e,n),o.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;const n=this[E];return r(n),t(n),ne(n),n.base_.has(e)?n.assigned_.set(e,!1):n.assigned_.delete(e),n.copy_.delete(e),!0}clear(){const e=this[E];r(e),T(e).size&&(t(e),ne(e),e.assigned_=new Map,A(e.base_,(t=>{e.assigned_.set(t,!1)})),e.copy_.clear())}forEach(e,t){T(this[E]).forEach(((n,o,r)=>{e.call(t,this.get(o),o,this)}))}get(e){const n=this[E];r(n);const o=T(n).get(e);if(n.finalized_||!N(o))return o;if(o!==n.base_.get(e))return o;const s=re(o,n);return t(n),n.copy_.set(e,s),s}keys(){return T(this[E]).keys()}values(){const e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}}entries(){const e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const t=e.next();if(t.done)return t;const n=this.get(t.value);return{done:!1,value:[t.value,n]}}}}[Symbol.iterator](){return this.entries()}}function t(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}class n extends Set{constructor(e,t){super(),this[E]={type_:3,parent_:t,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return T(this[E]).size}has(e){const t=this[E];return r(t),t.copy_?!!t.copy_.has(e)||!(!t.drafts_.has(e)||!t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){const t=this[E];return r(t),this.has(e)||(o(t),ne(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;const t=this[E];return r(t),o(t),ne(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))}clear(){const e=this[E];r(e),T(e).size&&(o(e),ne(e),e.copy_.clear())}values(){const e=this[E];return r(e),o(e),e.copy_.values()}entries(){const e=this[E];return r(e),o(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){const n=this.values();let o=n.next();for(;!o.done;)e.call(t,o.value,o.value,this),o=n.next()}}function o(e){e.copy_||(e.copy_=new Set,e.base_.forEach((t=>{if(N(t)){const n=re(t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)})))}function r(e){e.revoked_&&C(3,JSON.stringify(T(e)))}var s,c;c={proxyMap_:function(t,n){return new e(t,n)},proxySet_:function(e,t){return new n(e,t)}},U[s="MapSet"]||(U[s]=c)}();const Se={comments:new Map,forceFocus:!1,focusedComment:null,pinnedComment:null,remoteCommentCount:0},Fe=ae(((e,t)=>{const n=t=>{t.remoteId?t.resolved=!0:e.comments.delete(t.localId),e.focusedComment===t.localId&&(e.focusedComment=null),e.pinnedComment===t.localId&&(e.pinnedComment=null)};switch(t.type){case ie:e.comments.set(t.comment.localId,t.comment),t.comment.remoteId&&(e.remoteCommentCount+=1);break;case le:{const n=e.comments.get(t.commentId);if(n){if(t.update.newText&&0===t.update.newText.length)break;Object.assign(n,t.update)}break}case me:{const n=e.comments.get(t.commentId);if(!n)break;(t=>{t.remoteId?t.deleted=!0:e.comments.delete(t.localId),e.focusedComment===t.localId&&(e.focusedComment=null,e.forceFocus=!1),e.pinnedComment===t.localId&&(e.pinnedComment=null)})(n);break}case ue:{const o=e.comments.get(t.commentId);if(!o)break;n(o);break}case de:(null===t.commentId||e.comments.has(t.commentId))&&(e.focusedComment=t.commentId,t.updatePinnedComment&&(e.pinnedComment=t.commentId),e.forceFocus=t.forceFocus);break;case pe:{const n=e.comments.get(t.commentId);if(!n||0===t.reply.text.length)break;t.reply.remoteId&&(n.remoteReplyCount+=1),n.replies.set(t.reply.localId,t.reply);break}case fe:{const n=e.comments.get(t.commentId);if(!n)break;const o=n.replies.get(t.replyId);if(!o)break;if(t.update.newText&&0===t.update.newText.length)break;Object.assign(o,t.update);break}case he:{const n=e.comments.get(t.commentId);if(!n)break;const o=n.replies.get(t.replyId);if(!o)break;o.remoteId?o.deleted=!0:n.replies.delete(o.localId);break}case ye:{const o=e.comments;for(const e of o.values())e.contentpath.startsWith(t.contentPath)&&n(e);break}}}),Se),ke="update-global-settings";function De(e){return{type:ke,update:e}}const Re={user:null,currentTab:null},Te=function(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const r=t[o];"function"==typeof e[r]&&(n[r]=e[r])}const o=Object.keys(n);let r;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:u.INIT}))throw new Error(i(12));if(void 0===n(void 0,{type:u.PROBE_UNKNOWN_ACTION()}))throw new Error(i(13))}))}(n)}catch(e){r=e}return function(e={},t){if(r)throw r;let s=!1;const c={};for(let r=0;r<o.length;r++){const a=o[r],l=n[a],m=e[a],u=l(m,t);if(void 0===u)throw t&&t.type,new Error(i(14));c[a]=u,s=s||u!==m}return s=s||o.length!==Object.keys(e).length,s?c:e}}({comments:Fe,settings:ae(((e,t)=>{t.type===ke&&Object.assign(e,t.update)}),Re)});var Oe=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Me="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},je=0,ze=1;function Le(){return{s:je,v:void 0,o:null,p:null}}function Ue(e,t={}){let n=Le();const{resultEqualityCheck:o}=t;let r,s=0;function c(){let t=n;const{length:c}=arguments;for(let e=0,n=c;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const o=e.get(n);void 0===o?(t=Le(),e.set(n,t)):t=o}else{let e=t.p;null===e&&(t.p=e=new Map);const o=e.get(n);void 0===o?(t=Le(),e.set(n,t)):t=o}}const a=t;let i;if(t.s===ze)i=t.v;else if(i=e.apply(null,arguments),s++,o){const e=r?.deref?.()??r;null!=e&&o(e,i)&&(i=e,0!==s&&s--),r="object"==typeof i&&null!==i||"function"==typeof i?new Me(i):i}return a.s=ze,a.v=i,i}return c.clearCache=()=>{n=Le(),c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}function $e(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,o=(...e)=>{let t,o=0,r=0,s={},c=e.pop();"object"==typeof c&&(s=c,c=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const a={...n,...s},{memoize:i,memoizeOptions:l=[],argsMemoize:m=Ue,argsMemoizeOptions:u=[],devModeChecks:d={}}=a,p=Oe(l),f=Oe(u),h=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=i((function(){return o++,c.apply(null,arguments)}),...p),_=m((function(){r++;const e=function(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}(h,arguments);return t=y.apply(null,e),t}),...f);return Object.assign(_,{resultFunc:c,memoizedResultFunc:y,dependencies:h,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>t,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:i,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var He=$e(Ue),qe=Object.assign(((e,t=He)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,o)=>(e[n[o]]=t,e)),{})))}),{withTypes:()=>qe});const Ke=e=>e.comments.comments,We=e=>e.comments.focusedComment;function Be(e){return He(Ke,(t=>[...t.values()].filter((t=>t.contentpath===e&&!(t.deleted||t.resolved)))))}function Ve(e){return He(Ke,(t=>{const n=t.get(e);if(void 0===n||!n.deleted&&!n.resolved)return n}))}const Xe=He(Ke,(e=>e.comments.remoteCommentCount),((e,t)=>t!==e.size||Array.from(e.values()).some((e=>!(!e.deleted&&!e.resolved&&e.replies.size===e.remoteReplyCount&&e.originalText===e.text)||Array.from(e.replies.values()).some((e=>e.deleted||e.originalText!==e.text)))))),Je=e=>[...e.comments.comments.values()].filter((e=>!e.deleted&&!e.resolved)).length;var Ye=n(1688),Ge=n.n(Ye),Qe=n(1238);const Ze=new Intl.DateTimeFormat([],{dateStyle:"medium",timeStyle:"short"}),et=({commentReply:e,store:t,onResolve:n,onEdit:c,onDelete:a,descriptionId:i,focused:l})=>{const{author:m,date:u}=e,[d,p]=(0,r.useState)(!1);(0,r.useEffect)((()=>{d&&!l&&p(!1)}),[l]);const f=(0,r.useRef)(null),h=(0,r.useRef)(null),y=e=>{e.preventDefault(),e.stopPropagation(),p(!d)};(0,r.useEffect)((()=>{d&&setTimeout((()=>f.current?.focus()),1)}),[d]);const _=e=>{h.current&&e.target instanceof Node&&!h.current.contains(e.target)&&p(!1)};(0,r.useEffect)((()=>(document.addEventListener("click",_,!0),()=>{document.removeEventListener("click",_,!0)})),[]);const b=new Date(u).toISOString();return s().createElement("div",{className:"comment-header"},s().createElement("div",{className:"comment-header__actions"},(c||a||n)&&s().createElement("div",{className:"comment-header__action comment-header__action--more",ref:h},s().createElement("details",{open:d,onClick:y},s().createElement("summary",{"aria-label":(0,o.AP)("More actions"),"aria-haspopup":"menu",role:"button",onClick:y,"aria-expanded":d},s().createElement(Qe.A,{name:"dots-horizontal"})),s().createElement("div",{className:"comment-header__more-actions",role:"menu",ref:f},c&&s().createElement("button",{type:"button",role:"menuitem",onClick:async n=>{n.preventDefault(),c&&c(e,t)}},(0,o.AP)("Edit")),a&&s().createElement("button",{type:"button",role:"menuitem",onClick:async n=>{n.preventDefault(),a&&a(e,t)}},(0,o.AP)("Delete")),n&&s().createElement("button",{type:"button",role:"menuitem",onClick:o=>{o.preventDefault(),n&&n(e,t)}},(0,o.AP)("Resolve")))))),m&&m.avatarUrl&&s().createElement("img",{className:"comment-header__avatar",src:m.avatarUrl,alt:"",decoding:"async",loading:"lazy"}),s().createElement("span",{id:i},s().createElement("p",{className:"comment-header__author"},m?m.name:""),s().createElement("p",{className:"comment-header__date"},s().createElement("time",{dateTime:b},Ze.format(u)))))},tt=s().forwardRef((({value:e,className:t,placeholder:n,onChange:o,focusOnMount:r,focusTarget:c=!1,additionalAttributes:a={}},i)=>{const l=s().useRef(null);return s().useImperativeHandle(i,(()=>l.current)),s().useEffect((()=>{l.current&&(l.current.style.height="",l.current.style.height=l.current.scrollHeight+"px")}),[e,l]),s().useEffect((()=>{r&&l.current&&l.current.focus()}),[l]),s().createElement("textarea",{"data-focus-target":c,rows:1,style:{resize:"none",overflowY:"hidden"},className:t,placeholder:n,ref:l,onChange:e=>{o&&o(e.target.value)},value:e,...a})}));async function nt(e,t,n){n.dispatch(we(e.localId,t.localId,{mode:"saving"}));try{n.dispatch(we(e.localId,t.localId,{mode:"default",text:t.newText,author:t.author}))}catch(o){console.error(o),n.dispatch(we(e.localId,t.localId,{mode:"save_error"}))}}async function ot(e,t,n){n.dispatch(we(e.localId,t.localId,{mode:"deleting"}));try{n.dispatch(Ie(e.localId,t.localId))}catch(o){n.dispatch(we(e.localId,t.localId,{mode:"delete_error"}))}}class rt extends s().Component{renderEditing(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:t,store:n,focused:r}),s().createElement("form",{onSubmit:async o=>{o.preventDefault(),await nt(e,t,n)}},s().createElement(tt,{className:"comment-reply__input",value:t.newText,onChange:o=>{n.dispatch(we(e.localId,t.localId,{newText:o}))}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{type:"submit",disabled:0===t.newText.length,className:"comment__button comment__button--primary"},(0,o.AP)("Save")),s().createElement("button",{type:"button",className:"comment__button",onClick:o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default",newText:t.text}))}},(0,o.AP)("Cancel")))))}renderSaving(){const{reply:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Saving...")))}renderSaveError(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__error"},(0,o.AP)("Save error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),await nt(e,t,n)}},(0,o.AP)("Retry"))))}renderDeleteConfirm(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__confirm-delete"},(0,o.AP)("Are you sure?"),s().createElement("button",{type:"button",className:"comment__button button button-small",onClick:o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button button button-small no",onClick:async o=>{o.preventDefault(),await ot(e,t,n)}},(0,o.AP)("Delete"))))}renderDeleting(){const{reply:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Deleting")))}renderDeleteError(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__error"},(0,o.AP)("Delete error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),await ot(e,t,n)}},(0,o.AP)("Retry"))))}renderDefault(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;let c,a;(null===t.author||this.props.user&&this.props.user.id===t.author.id)&&(c=()=>{n.dispatch(we(e.localId,t.localId,{mode:"editing",newText:t.text}))},a=()=>{n.dispatch(we(e.localId,t.localId,{mode:"delete_confirm"}))});let i="";return t.remoteId&&t.text===t.originalText||(i=(0,o.AP)("Save the page to save this reply")),s().createElement(s().Fragment,null,s().createElement(et,{commentReply:t,store:n,onEdit:c,onDelete:a,focused:r}),s().createElement("p",{className:"comment__text"},t.text),i&&s().createElement("div",{className:"comment__notice-placeholder"},s().createElement("div",{className:"comment__notice",role:"status"},s().createElement(Qe.A,{name:"info-circle"}),i)))}render(){let e;switch(this.props.reply.mode){case"editing":e=this.renderEditing();break;case"saving":e=this.renderSaving();break;case"save_error":e=this.renderSaveError();break;case"delete_confirm":e=this.renderDeleteConfirm();break;case"deleting":e=this.renderDeleting();break;case"delete_error":e=this.renderDeleteError();break;default:e=this.renderDefault()}return s().createElement("li",{key:this.props.reply.localId,className:`comment-reply comment-reply--mode-${this.props.reply.mode}`,"data-reply-id":this.props.reply.localId},e)}}async function st(e,t){t.dispatch(be(e.localId,{mode:"saving"}));try{t.dispatch(be(e.localId,{mode:"default",text:e.newText,remoteId:e.remoteId,author:e.author,date:e.date}))}catch(n){console.error(n),t.dispatch(be(e.localId,{mode:"save_error"}))}}async function ct(e,t){t.dispatch(be(e.localId,{mode:"deleting"}));try{t.dispatch(ge(e.localId))}catch(n){console.error(n),t.dispatch(be(e.localId,{mode:"delete_error"}))}}function at(e,t){t.dispatch(ve(e.localId))}class it extends s().Component{renderReplies({hideNewReply:e=!1}={}){const{comment:t,isFocused:n,store:r,user:c}=this.props;if(!t.remoteId)return null;const a=[];let i,l=!1;for(const e of t.replies.values())"saving"!==e.mode&&"editing"!==e.mode||(l=!0),e.deleted||a.push(s().createElement(rt,{key:e.localId,store:r,user:c,comment:t,reply:e,isFocused:n}));if(e||l||!n&&!t.newReply){if(0===a.length)return null}else i=s().createElement("form",{onSubmit:async e=>{e.preventDefault();const n=Pe(b(),c,Date.now(),{text:t.newReply,mode:"default"});r.dispatch(Ce(t.localId,n)),r.dispatch(be(t.localId,{newReply:""}))}},s().createElement(tt,{className:"comment__reply-input",placeholder:(0,o.AP)("Enter your reply..."),value:t.newReply,onChange:e=>{r.dispatch(be(t.localId,{newReply:e}))}}),s().createElement("div",{className:"comment__reply-actions"},s().createElement("button",{disabled:0===t.newReply.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Reply")),s().createElement("button",{type:"button",onClick:e=>{e.preventDefault(),r.dispatch(be(t.localId,{newReply:""})),r.dispatch(Ee(null)),e.stopPropagation()},className:"comment__button"},(0,o.AP)("Cancel"))));return s().createElement(s().Fragment,null,s().createElement("ul",{className:"comment__replies"},a),i)}renderCreating(){const{comment:e,store:t,isFocused:n}=this.props,r=`comment-description-${e.localId}`;return s().createElement(s().Fragment,null,s().createElement(et,{descriptionId:r,commentReply:e,store:t,focused:n}),s().createElement("form",{onSubmit:async n=>{n.preventDefault(),await st(e,t)}},s().createElement(tt,{focusTarget:n,className:"comment__input",value:e.newText,onChange:n=>{t.dispatch(be(e.localId,{newText:n}))},placeholder:(0,o.AP)("Enter your comments..."),additionalAttributes:{"aria-describedby":r}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{disabled:0===e.newText.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Comment")),s().createElement("button",{type:"button",onClick:n=>{n.preventDefault(),t.dispatch(ge(e.localId))},className:"comment__button"},(0,o.AP)("Cancel")))))}renderEditing(){const{comment:e,store:t,isFocused:n}=this.props,r=`comment-description-${e.localId}`;return s().createElement(s().Fragment,null,s().createElement(et,{descriptionId:r,commentReply:e,store:t,focused:n}),s().createElement("form",{onSubmit:async n=>{n.preventDefault(),await st(e,t)}},s().createElement(tt,{focusTarget:n,className:"comment__input",value:e.newText,additionalAttributes:{"aria-describedby":r},onChange:n=>{t.dispatch(be(e.localId,{newText:n}))}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{disabled:0===e.newText.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Save")),s().createElement("button",{type:"button",onClick:n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default",newText:e.text}))},className:"comment__button"},(0,o.AP)("Cancel")))),this.renderReplies({hideNewReply:!0}))}renderSaving(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Saving...")),this.renderReplies({hideNewReply:!0}))}renderSaveError(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),this.renderReplies({hideNewReply:!0}),s().createElement("div",{className:"comment__error"},(0,o.AP)("Save error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),await st(e,t)}},(0,o.AP)("Retry"))))}renderDeleteConfirm(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__confirm-delete"},(0,o.AP)("Are you sure?"),s().createElement("button",{type:"button",className:"comment__button button button-small",onClick:n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button button button-small no",onClick:async n=>{n.preventDefault(),await ct(e,t)}},(0,o.AP)("Delete"))),this.renderReplies({hideNewReply:!0}))}renderDeleting(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Deleting")),this.renderReplies({hideNewReply:!0}))}renderDeleteError(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),this.renderReplies({hideNewReply:!0}),s().createElement("div",{className:"comment__error"},(0,o.AP)("Delete error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),await ct(e,t)}},(0,o.AP)("Retry"))))}renderDefault(){const{comment:e,store:t,isFocused:n}=this.props;let r,c;(null===e.author||this.props.user&&this.props.user.id===e.author.id)&&(r=()=>{t.dispatch(be(e.localId,{mode:"editing",newText:e.text}))},c=()=>{t.dispatch(be(e.localId,{mode:"delete_confirm"}))});let a="";return e.remoteId?e.text!==e.originalText&&(a=(0,o.AP)("Save the page to save this comment")):a=(0,o.AP)("Save the page to add this comment"),s().createElement(s().Fragment,null,s().createElement(et,{commentReply:e,store:t,onResolve:at,onEdit:r,onDelete:c,focused:n}),s().createElement("p",{className:"comment__text"},e.text),a&&s().createElement("div",{className:"comment__notice-placeholder"},s().createElement("div",{className:"comment__notice",role:"status"},s().createElement(Qe.A,{name:"info-circle"}),a)),this.renderReplies())}render(){let e;switch(this.props.comment.mode){case"creating":e=this.renderCreating();break;case"editing":e=this.renderEditing();break;case"saving":e=this.renderSaving();break;case"save_error":e=this.renderSaveError();break;case"delete_confirm":e=this.renderDeleteConfirm();break;case"deleting":e=this.renderDeleting();break;case"delete_error":e=this.renderDeleteError();break;default:e=this.renderDefault()}const t=this.props.layout.getCommentPosition(this.props.comment.localId);return s().createElement(Ge(),{focusTrapOptions:{preventScroll:!0,clickOutsideDeactivates:!0,onDeactivate:()=>{this.props.store.dispatch(Ee(null,{updatePinnedComment:!0,forceFocus:!1}))},checkCanFocusTrap:e=>e.some((e=>e.matches('[data-form-side="comments"].form-side--comments [data-focus-target="true"]')))?Promise.resolve():new Promise((e=>{setTimeout(e,250)})),initialFocus:'[data-focus-target="true"]',delayInitialFocus:!0},active:this.props.isFocused&&this.props.forceFocus},s().createElement("li",{tabIndex:-1,"data-focus-target":this.props.isFocused&&!["creating","editing"].includes(this.props.comment.mode),key:this.props.comment.localId,className:`comment comment--mode-${this.props.comment.mode} ${this.props.isFocused?"comment--focused":""}`,style:{position:"absolute",top:`${t}px`,display:this.props.isVisible?"block":"none"},"data-comment-id":this.props.comment.localId,onClick:()=>{this.props.store.dispatch(Ee(this.props.comment.localId,{updatePinnedComment:!1,forceFocus:this.props.isFocused&&this.props.forceFocus}))},onDoubleClick:()=>{this.props.store.dispatch(Ee(this.props.comment.localId,{updatePinnedComment:!0,forceFocus:!0}))}},e))}componentDidMount(){const e=a().findDOMNode(this);e instanceof HTMLElement&&(this.props.layout.setCommentElement(this.props.comment.localId,e),this.props.isVisible&&this.props.layout.setCommentHeight(this.props.comment.localId,e.offsetHeight))}componentWillUnmount(){this.props.layout.setCommentElement(this.props.comment.localId,null)}componentDidUpdate(){const e=a().findDOMNode(this);this.props.isVisible&&e instanceof HTMLElement&&this.props.layout.setCommentHeight(this.props.comment.localId,e.offsetHeight)}}function lt({prefix:e,value:t,fieldName:n}){return s().createElement("input",{type:"hidden",name:`${e}-${n}`,value:null===t?"":t,id:`id_${e}-${n}`})}function mt({reply:e,formNumber:t,prefix:n}){const o=`${n}-${t}`;return s().createElement("fieldset",null,s().createElement(lt,{fieldName:"DELETE",value:e.deleted?1:"",prefix:o}),s().createElement(lt,{fieldName:"id",value:e.remoteId,prefix:o}),s().createElement(lt,{fieldName:"text",value:e.text,prefix:o}))}function ut({replies:e,prefix:t,remoteReplyCount:n}){const o=`${t}-replies`,r=e.map(((e,t)=>s().createElement(mt,{key:e.localId,formNumber:t,reply:e,prefix:o})));return s().createElement(s().Fragment,null,s().createElement(lt,{fieldName:"TOTAL_FORMS",value:e.length,prefix:o}),s().createElement(lt,{fieldName:"INITIAL_FORMS",value:n,prefix:o}),s().createElement(lt,{fieldName:"MIN_NUM_FORMS",value:"0",prefix:o}),s().createElement(lt,{fieldName:"MAX_NUM_FORMS",value:"",prefix:o}),r)}function dt({comment:e,formNumber:t,prefix:n}){const o=`${n}-${t}`;return s().createElement("fieldset",null,s().createElement(lt,{fieldName:"DELETE",value:e.deleted?1:"",prefix:o}),s().createElement(lt,{fieldName:"resolved",value:e.resolved?1:"",prefix:o}),s().createElement(lt,{fieldName:"id",value:e.remoteId,prefix:o}),s().createElement(lt,{fieldName:"contentpath",value:e.contentpath,prefix:o}),s().createElement(lt,{fieldName:"text",value:e.text,prefix:o}),s().createElement(lt,{fieldName:"position",value:e.position,prefix:o}),s().createElement(ut,{replies:Array.from(e.replies.values()),prefix:o,remoteReplyCount:e.remoteReplyCount}))}function pt({comments:e,remoteCommentCount:t}){const n="comments",o=e.map(((e,t)=>s().createElement(dt,{key:e.localId,comment:e,formNumber:t,prefix:n})));return s().createElement(s().Fragment,null,s().createElement(lt,{fieldName:"TOTAL_FORMS",value:e.length,prefix:n}),s().createElement(lt,{fieldName:"INITIAL_FORMS",value:t,prefix:n}),s().createElement(lt,{fieldName:"MIN_NUM_FORMS",value:"0",prefix:n}),s().createElement(lt,{fieldName:"MAX_NUM_FORMS",value:"",prefix:n}),o)}const ft=(e,t)=>{const n=p(e,String(t),{name:"",avatar_url:""});return{id:t,name:n.name,avatarUrl:n.avatar_url}};function ht({store:e,layout:t,comments:n}){const o=e.getState(),{user:c,currentTab:a}=o.settings,{focusedComment:i,forceFocus:l}=o.comments,m=s().useRef(null),u=(0,r.useCallback)((e=>{if(!m.current)return;if("scroll"===e.type&&!document.querySelector(".form-side--comments"))return;const t=document.querySelector(".content"),n=t?.getBoundingClientRect().top;m.current.style.top=`${n}px`}),[m]);let d=n;s().useEffect((()=>{const e=document.querySelector("#main"),t=document.querySelector('[data-side-panel="comments"]');return e?.addEventListener("scroll",u),t?.addEventListener("show",u),()=>{e?.removeEventListener("scroll",u),t?.removeEventListener("show",u)}}),[]),c||(d=[]),d=d.filter((({deleted:e,resolved:t})=>!(e||t)));const p=d.map((n=>s().createElement(it,{key:n.localId,store:e,layout:t,user:c,comment:n,isFocused:n.localId===i,forceFocus:l,isVisible:t.getCommentVisible(a,n.localId)})));return s().createElement("ol",{ref:m,className:"comments-list"},p)}class yt{store;layout;utils={selectCommentsForContentPathFactory:Be,selectCommentFactory:Ve};selectors={selectComments:Ke,selectFocused:We,selectIsDirty:Xe,selectCommentCount:Je};actions=xe;activationHandlers=[];constructor(){this.store=function(e,t,n){return d(e,t,void 0)}(Te,{comments:Se,settings:Re}),this.layout=new f}setUser(e,t){this.store.dispatch(De({user:ft(t,e)}))}updateAnnotation(e,t){this.attachAnnotationLayout(e,t),this.store.dispatch(be(t,{annotation:e}))}attachAnnotationLayout(e,t){this.layout.setCommentAnnotation(t,e)}setCurrentTab(e){this.store.dispatch(De({currentTab:e}))}makeComment(e,t,n=""){const o=_();return this.attachAnnotationLayout(e,o),this.store.dispatch(_e(Ae(t,n,o,e,this.store.getState().settings.user,Date.now(),{mode:"creating"}))),this.store.dispatch(Ee(o,{updatePinnedComment:!0,forceFocus:!0})),o}activate(){this.activationHandlers.forEach((e=>e()))}onActivate(e){this.activationHandlers.push(e)}invalidateContentPath(e){this.store.dispatch(Ne(e))}updateContentPath(e,t){this.store.dispatch(be(e,{contentpath:t}))}renderApp(e,t,n,o,r){let c=null;this.setUser(n,r);let i=null;const l=new URLSearchParams(window.location.search).get("comment");l&&(i=parseInt(l,10));const m=()=>{const n=this.store.getState(),o=Array.from(n.comments.comments.values());a().render(s().createElement(pt,{comments:o.filter((e=>"creating"!==e.mode)),remoteCommentCount:n.comments.remoteCommentCount}),t),n.comments.pinnedComment!==c&&(this.layout.setPinnedComment(n.comments.pinnedComment),c=n.comments.pinnedComment),a().render(s().createElement(ht,{store:this.store,layout:this.layout,comments:o}),e,(()=>{this.layout.refreshDesiredPositions(n.settings.currentTab),this.layout.refreshLayout()&&a().render(s().createElement(ht,{store:this.store,layout:this.layout,comments:o}),e)}))};for(const e of o){const t=_();this.store.dispatch(_e(Ae(e.contentpath,e.position,t,null,ft(r,e.user),Date.parse(e.created_at),{remoteId:e.pk,text:e.text,deleted:e.deleted,resolved:e.resolved})));for(const n of e.replies)this.store.dispatch(Ce(t,Pe(b(),ft(r,n.user),Date.parse(n.created_at),{remoteId:n.pk,text:n.text,deleted:n.deleted})));i&&e.pk===i&&this.store.dispatch(Ee(t,{updatePinnedComment:!0,forceFocus:!0}))}m(),this.store.subscribe(m),document.body.addEventListener("mousedown",(e=>{e.target instanceof HTMLElement&&(e.target.closest("#comments, [data-annotation], [data-comment-add]")||setTimeout((()=>{this.store.dispatch(Ee(null,{updatePinnedComment:!0,forceFocus:!1}))}),200))})),document.body.addEventListener("commentAnchorVisibilityChange",(()=>{this.layout.refreshDesiredPositions(this.store.getState().settings.currentTab),this.layout.refreshLayout()&&m()}))}}var _t=n(2898);window.comments=(()=>{const e=new yt;function t(e){return _t.HE.KEYBOARD_SHORTCUTS_ENABLED&&(e.ctrlKey||e.metaKey)&&e.altKey&&77===e.keyCode}function n(e){if(!e||e.closest("[data-contentpath-disabled]"))return"";let t=e.closest("[data-contentpath]");const n=[];for(;null!==t;)n.push(t.dataset.contentpath),t=t.parentElement.closest("[data-contentpath]");return n.reverse(),n.join(".")}class r{constructor(e,t){this.node=t,this.fieldNode=e,this.unsubscribe=null}subscribeToUpdates(t){const{selectFocused:n}=e.selectors,o=e.utils.selectCommentFactory(t),r=e.store,s=r.getState();let c=n(s)===t;c&&this.onFocus(),this.show(),this.unsubscribe=r.subscribe((()=>{const e=r.getState();o(e)||this.onDelete();const s=n(e)===t;s!==c&&(c?this.onUnfocus():this.onFocus(),c=s)})),this.setOnClickHandler(t)}onDelete(){this.node.remove(),this.unsubscribe&&this.unsubscribe()}onFocus(){this.node.classList.add("w-field__comment-button--focused"),this.node.ariaLabel=(0,o.AP)("Unfocus comment")}onUnfocus(){this.node.classList.remove("w-field__comment-button--focused"),this.node.ariaLabel=(0,o.AP)("Focus comment")}show(){this.node.classList.remove("!w-hidden")}hide(){this.node.classList.add("!w-hidden")}setOnClickHandler(t){this.node.addEventListener("click",(()=>{e.activate(),e.store.dispatch(e.actions.setFocusedComment(t,{updatePinnedComment:!0,forceFocus:!0}))}))}getTab(){return this.fieldNode.closest('[role="tabpanel"]')?.getAttribute("id")}getAnchorNode(){return this.fieldNode}}class s extends Error{constructor(e,...t){super(...t),this.name="MissingElementError",this.element=e}}class c{constructor({fieldNode:e,commentAdditionNode:t}){if(this.fieldNode=e,this.contentpath=n(e),!t)throw new s(t);this.commentAdditionNode=t}register(){if(!this.contentpath)return void this.commentAdditionNode.remove();const n=e.store.getState(),o=e.utils.selectCommentsForContentPathFactory(this.contentpath);let r=o(n);const s=e.store.subscribe((()=>{const t=e.store.getState(),n=o(t);r!==n&&(r=n,r.filter((e=>null===e.annotation)).forEach((t=>{const n=this.getAnnotationForComment(t);e.updateAnnotation(n,t.localId),n.subscribeToUpdates(t.localId)})))}));n.comments.comments.forEach((t=>{if(t.contentpath===this.contentpath){const n=this.getAnnotationForComment(t);e.updateAnnotation(n,t.localId),n.subscribeToUpdates(t.localId)}}));const c=()=>{const t=this.getAnnotationForComment(),n=e.makeComment(t,this.contentpath);t.subscribeToUpdates(n)};return this.commentAdditionNode.addEventListener("click",(()=>{e.activate(),c()})),this.fieldNode.addEventListener("keyup",(n=>{t(n)&&(0===r.length?c():e.store.dispatch(e.actions.setFocusedComment(r[0].localId,{updatePinnedComment:!0,forceFocus:!0})))})),s}getAnnotationForComment(){const t=document.querySelector("#comment-icon").cloneNode(!0);return t.id="",t.setAttribute("aria-label",this.commentAdditionNode.getAttribute("aria-label")),t.setAttribute("aria-describedby",this.commentAdditionNode.getAttribute("aria-describedby")),t.classList.remove("!w-hidden"),this.commentAdditionNode.insertAdjacentElement("beforebegin",t),new r(this.fieldNode,t,e)}}function a(e){new c({fieldNode:e.closest("[data-contentpath]"),commentAdditionNode:e}).register()}function i(t){const n=document.getElementById("comments"),o=document.getElementById("comments-output"),r=document.getElementById("comments-data");if(!n||!o||!r)throw new Error("Comments app failed to initialise. Missing HTML element");const s=JSON.parse(r.textContent);e.renderApp(n,o,s.user,s.comments,new Map(Object.entries(s.authors))),t.querySelectorAll('[data-component="add-comment-button"]').forEach(a);const c=t.querySelector('[data-controller~="w-tabs"]');if(c){const t=c.getAttribute("data-w-tabs-active-panel-id-value");e.setCurrentTab(t),c.addEventListener("w-tabs:changed",(({detail:{current:t}})=>setTimeout((()=>e.setCurrentTab(t)))))}const i=document.querySelector("[data-comment-notifications]");i.hidden=!1,i.querySelector("input").setAttribute("form",t.id),t.querySelector(".tab-content").classList.add("tab-content--comments-enabled");const l=document.querySelector('[data-side-panel="comments"]');e.onActivate((()=>{l.dispatchEvent(new Event("open"))}));const m=document.querySelector('[data-side-panel-toggle="comments"] [data-side-panel-toggle-counter]'),u=()=>{const t=e.selectors.selectCommentCount(e.store.getState());m&&(t>0?(m.innerText=t.toString(),m.hidden=!1):m.hidden=!0)};e.store.subscribe(u),u()}return document.addEventListener("w-comments:init",(({target:e})=>{setTimeout((()=>{i(e)}))}),{once:!0}),{commentApp:e,getContentPath:n,isCommentShortcut:t,initAddCommentButton:a,initCommentsInterface:i}})()}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.m=t,e=[],o.O=(t,n,r,s)=>{if(!n){var c=1/0;for(m=0;m<e.length;m++){for(var[n,r,s]=e[m],a=!0,i=0;i<n.length;i++)(!1&s||c>=s)&&Object.keys(o.O).every((e=>o.O[e](n[i])))?n.splice(i--,1):(a=!1,s<c&&(c=s));if(a){e.splice(m--,1);var l=r();void 0!==l&&(t=l)}}return t}s=s||0;for(var m=e.length;m>0&&e[m-1][2]>s;m--)e[m]=e[m-1];e[m]=[n,r,s]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=125,(()=>{var e={125:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var r,s,[c,a,i]=n,l=0;if(c.some((t=>0!==e[t]))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(i)var m=i(o)}for(t&&t(n);l<c.length;l++)s=c[l],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return o.O(m)},n=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var r=o.O(void 0,[321],(()=>o(9786)));r=o.O(r)})();
1
+ (()=>{"use strict";var e,t={9786:(e,t,n)=>{var o=n(2833),r=n(2427),s=n.n(r),c=n(6931),a=n.n(c);function i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),m=()=>Math.random().toString(36).substring(7).split("").join("."),u={INIT:`@@redux/INIT${m()}`,REPLACE:`@@redux/REPLACE${m()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${m()}`};function d(e,t,n){if("function"!=typeof e)throw new Error(i(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(i(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(i(1));return n(d)(e,t)}let o=e,r=t,s=new Map,c=s,a=0,m=!1;function p(){c===s&&(c=new Map,s.forEach((e,t)=>{c.set(t,e)}))}function f(){if(m)throw new Error(i(3));return r}function h(e){if("function"!=typeof e)throw new Error(i(4));if(m)throw new Error(i(5));let t=!0;p();const n=a++;return c.set(n,e),function(){if(t){if(m)throw new Error(i(6));t=!1,p(),c.delete(n),s=null}}}function y(e){if(!function(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}(e))throw new Error(i(7));if(void 0===e.type)throw new Error(i(8));if("string"!=typeof e.type)throw new Error(i(17));if(m)throw new Error(i(9));try{m=!0,r=o(r,e)}finally{m=!1}return(s=c).forEach(e=>{e()}),e}return y({type:u.INIT}),{dispatch:y,subscribe:h,getState:f,replaceReducer:function(e){if("function"!=typeof e)throw new Error(i(10));o=e,y({type:u.REPLACE})},[l]:function(){const e=h;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(i(11));function n(){const e=t;e.next&&e.next(f())}return n(),{unsubscribe:e(n)}},[l](){return this}}}}}function p(e,t,n){const o=e.get(t);return void 0===o?n:o}class f{commentElements=new Map;commentAnnotations=new Map;commentTabs=new Map;commentDesiredPositions=new Map;commentHeights=new Map;pinnedComment=null;commentCalculatedPositions=new Map;isDirty=!1;setCommentElement(e,t){null!==t?this.commentElements.set(e,t):this.commentElements.delete(e),this.isDirty=!0}setCommentAnnotation(e,t){this.commentAnnotations.set(e,t),this.commentTabs.set(e,t.getTab()||null),this.updateDesiredPosition(e),this.isDirty=!0}setCommentHeight(e,t){this.commentHeights.get(e)!==t&&(this.commentHeights.set(e,t),this.isDirty=!0)}setPinnedComment(e){this.pinnedComment=e,this.isDirty=!0}updateDesiredPosition(e){const t=this.commentAnnotations.get(e);if(!t)return;const n=t.getAnchorNode(e===this.pinnedComment);let o=n.getBoundingClientRect().top,r=n.parentElement;for(;r;)o+=r.scrollTop,r=r.parentElement;this.commentDesiredPositions.set(e,0!==o?o+-50:0)}refreshDesiredPositions(e=null){const t=new Map(this.commentDesiredPositions);this.commentAnnotations.forEach((t,n)=>{this.getCommentTabVisible(e,n)&&this.updateDesiredPosition(n)}),this.commentDesiredPositions!==t&&(this.isDirty=!0)}refreshLayout(){if(!this.isDirty)return!1;const e=Array.from(this.commentElements.keys()).map(e=>({tab:p(this.commentTabs,e,null),position:p(this.commentDesiredPositions,e,0),height:p(this.commentHeights,e,0),comments:[e],containsPinnedComment:null!==this.pinnedComment&&e===this.pinnedComment,pinnedCommentPosition:0})),t=new Map;e.forEach(e=>{const n=t.get(e.tab)||[];n.push(e),t.set(e.tab,n)});const n=this.pinnedComment?this.commentDesiredPositions.get(this.pinnedComment):void 0,o=this.pinnedComment?this.commentTabs.get(this.pinnedComment):void 0;return Array.from(t.entries()).forEach(([e,t])=>{const r=this.pinnedComment&&o===e;t.sort((e,t)=>e.position-t.position);let s=t,c=!0;for(;c;){c=!1;const e=[];let t=null;for(const o of s)t&&t.position+t.height+20>o.position?(c=!0,t.comments.push(...o.comments),o.containsPinnedComment&&(t.containsPinnedComment=!0,t.pinnedCommentPosition=o.pinnedCommentPosition+t.height),t.height+=o.height,!r&&t.position<50&&(t.position=100+t.height- -50),n&&t.containsPinnedComment&&(t.position=n-t.pinnedCommentPosition)):(e.push(o),t=o);s=e}s.forEach(e=>{let t=e.position;e.comments.forEach(e=>{this.commentCalculatedPositions.set(e,t);const n=this.commentHeights.get(e);n&&(t+=n+20)})})}),this.isDirty=!1,!0}getCommentTabVisible(e,t){return p(this.commentTabs,t,null)===e}getCommentVisible(e,t){return this.getCommentTabVisible(e,t)&&p(this.commentDesiredPositions,t,1)>0}getCommentPosition(e){return this.commentCalculatedPositions.has(e)?this.commentCalculatedPositions.get(e):this.commentDesiredPositions.get(e)}}let h=1,y=1;function _(){return h+=1,h}function b(){return y+=1,y}var v=Symbol.for("immer-nothing"),g=Symbol.for("immer-draftable"),E=Symbol.for("immer-state");function C(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var w=Object.getPrototypeOf;function I(e){return!!e&&!!e[E]}function N(e){return!!e&&(P(e)||Array.isArray(e)||!!e[g]||!!e.constructor?.[g]||D(e)||R(e))}var x=Object.prototype.constructor.toString();function P(e){if(!e||"object"!=typeof e)return!1;const t=w(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===x}function A(e,t){0===S(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function S(e){const t=e[E];return t?t.type_:Array.isArray(e)?1:D(e)?2:R(e)?3:0}function F(e,t){return 2===S(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k(e,t,n){const o=S(e);2===o?e.set(t,n):3===o?e.add(n):e[t]=n}function D(e){return e instanceof Map}function R(e){return e instanceof Set}function T(e){return e.copy_||e.base_}function O(e,t){if(D(e))return new Map(e);if(R(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=P(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[E];let n=Reflect.ownKeys(t);for(let o=0;o<n.length;o++){const r=n[o],s=t[r];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[r]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[r]})}return Object.create(w(e),t)}{const t=w(e);if(null!==t&&n)return{...e};const o=Object.create(t);return Object.assign(o,e)}}function M(e,t=!1){return z(e)||I(e)||!N(e)||(S(e)>1&&(e.set=e.add=e.clear=e.delete=j),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>M(t,!0))),e}function j(){C(2)}function z(e){return Object.isFrozen(e)}var L,U={};function $(e){const t=U[e];return t||C(0),t}function H(){return L}function q(e,t){t&&($("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function K(e){W(e),e.drafts_.forEach(V),e.drafts_=null}function W(e){e===L&&(L=e.parent_)}function B(e){return L={drafts_:[],parent_:L,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function V(e){const t=e[E];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function X(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[E].modified_&&(K(t),C(4)),N(e)&&(e=J(t,e),t.parent_||G(t,e)),t.patches_&&$("Patches").generateReplacementPatches_(n[E].base_,e,t.patches_,t.inversePatches_)):e=J(t,n,[]),K(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==v?e:void 0}function J(e,t,n){if(z(t))return t;const o=t[E];if(!o)return A(t,(r,s)=>Y(e,o,t,r,s,n)),t;if(o.scope_!==e)return t;if(!o.modified_)return G(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let r=t,s=!1;3===o.type_&&(r=new Set(t),t.clear(),s=!0),A(r,(r,c)=>Y(e,o,t,r,c,n,s)),G(e,t,!1),n&&e.patches_&&$("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Y(e,t,n,o,r,s,c){if(I(r)){const c=J(e,r,s&&t&&3!==t.type_&&!F(t.assigned_,o)?s.concat(o):void 0);if(k(n,o,c),!I(c))return;e.canAutoFreeze_=!1}else c&&n.add(r);if(N(r)&&!z(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;J(e,r),t&&t.scope_.parent_||"symbol"==typeof o||!Object.prototype.propertyIsEnumerable.call(n,o)||G(e,r)}}function G(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&M(t,n)}var Q={get(e,t){if(t===E)return e;const n=T(e);if(!F(n,t))return function(e,t,n){const o=te(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}(e,n,t);const o=n[t];return e.finalized_||!N(o)?o:o===ee(e.base_,t)?(oe(e),e.copy_[t]=re(o,e)):o},has:(e,t)=>t in T(e),ownKeys:e=>Reflect.ownKeys(T(e)),set(e,t,n){const o=te(T(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const o=ee(T(e),t),c=o?.[E];if(c&&c.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((r=n)===(s=o)?0!==r||1/r==1/s:r!=r&&s!=s)&&(void 0!==n||F(e.base_,t)))return!0;oe(e),ne(e)}var r,s;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==ee(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,oe(e),ne(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=T(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:o.enumerable,value:n[t]}:o},defineProperty(){C(11)},getPrototypeOf:e=>w(e.base_),setPrototypeOf(){C(12)}},Z={};function ee(e,t){const n=e[E];return(n?T(n):e)[t]}function te(e,t){if(!(t in e))return;let n=w(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=w(n)}}function ne(e){e.modified_||(e.modified_=!0,e.parent_&&ne(e.parent_))}function oe(e){e.copy_||(e.copy_=O(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function re(e,t){const n=D(e)?$("MapSet").proxyMap_(e,t):R(e)?$("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,s=Q;n&&(r=[o],s=Z);const{revoke:c,proxy:a}=Proxy.revocable(r,s);return o.draft_=a,o.revoke_=c,a}(e,t);return(t?t.scope_:H()).drafts_.push(n),n}function se(e){if(!N(e)||z(e))return e;const t=e[E];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=O(e,t.scope_.immer_.useStrictShallowCopy_)}else n=O(e,!0);return A(n,(e,t)=>{k(n,e,se(t))}),t&&(t.finalized_=!1),n}A(Q,(e,t)=>{Z[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Z.deleteProperty=function(e,t){return Z.set.call(this,e,t,void 0)},Z.set=function(e,t,n){return Q.set.call(this,e[0],t,n,e[0])};var ce=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const o=this;return function(e=n,...r){return o.produce(e,e=>t.call(this,e,...r))}}let o;if("function"!=typeof t&&C(6),void 0!==n&&"function"!=typeof n&&C(7),N(e)){const r=B(this),s=re(e,void 0);let c=!0;try{o=t(s),c=!1}finally{c?K(r):W(r)}return q(r,n),X(o,r)}if(!e||"object"!=typeof e){if(o=t(e),void 0===o&&(o=e),o===v&&(o=void 0),this.autoFreeze_&&M(o,!0),n){const t=[],r=[];$("Patches").generateReplacementPatches_(e,o,t,r),n(t,r)}return o}C(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,o;return[this.produce(e,t,(e,t)=>{n=e,o=t}),n,o]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;N(e)||C(8),I(e)&&(I(t=e)||C(10),e=se(t));const n=B(this),o=re(e,void 0);return o[E].isManual_=!0,W(n),o}finishDraft(e,t){const n=e&&e[E];n&&n.isManual_||C(9);const{scope_:o}=n;return q(o,t),X(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(0===o.path.length&&"replace"===o.op){e=o.value;break}}n>-1&&(t=t.slice(n+1));const o=$("Patches").applyPatches_;return I(e)?o(e,t):this.produce(e,e=>o(e,t))}},ae=ce.produce;ce.produceWithPatches.bind(ce),ce.setAutoFreeze.bind(ce),ce.setUseStrictShallowCopy.bind(ce),ce.applyPatches.bind(ce),ce.createDraft.bind(ce),ce.finishDraft.bind(ce);const ie="add-comment",le="update-comment",me="delete-comment",ue="resolve-comment",de="set-focused-comment",pe="add-reply",fe="update-reply",he="delete-reply",ye="invalidate-content-path";function _e(e){return{type:ie,comment:e}}function be(e,t){return{type:le,commentId:e,update:t}}function ve(e){return{type:me,commentId:e}}function ge(e){return{type:ue,commentId:e}}function Ee(e,{updatePinnedComment:t,forceFocus:n}={updatePinnedComment:!1,forceFocus:!1}){return{type:de,commentId:e,updatePinnedComment:t,forceFocus:n}}function Ce(e,t){return{type:pe,commentId:e,reply:t}}function we(e,t,n){return{type:fe,commentId:e,replyId:t,update:n}}function Ie(e,t){return{type:he,commentId:e,replyId:t}}function Ne(e){return{type:ye,contentPath:e}}const xe={addComment:_e,updateComment:be,deleteComment:ve,resolveComment:ge,setFocusedComment:Ee,addReply:Ce,updateReply:we,deleteReply:Ie,invalidateContentPath:Ne};function Pe(e,t,n,{remoteId:o=null,mode:r="default",text:s="",deleted:c=!1}){return{localId:e,remoteId:o,mode:r,author:t,date:n,text:s,originalText:s,newText:"",deleted:c}}function Ae(e,t,n,o,r,s,{remoteId:c=null,mode:a="default",text:i="",resolved:l=!1,deleted:m=!1,replies:u=new Map}){return{contentpath:e,position:t,localId:n,annotation:o,remoteId:c,mode:a,author:r,date:s,text:i,originalText:i,replies:u,newReply:"",newText:"",deleted:m,resolved:l,remoteReplyCount:Array.from(u.values()).reduce((e,t)=>null!==t.remoteId?e+1:e,0)}}!function(){class e extends Map{constructor(e,t){super(),this[E]={type_:2,parent_:t,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return T(this[E]).size}has(e){return T(this[E]).has(e)}set(e,n){const o=this[E];return r(o),T(o).has(e)&&T(o).get(e)===n||(t(o),ne(o),o.assigned_.set(e,!0),o.copy_.set(e,n),o.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;const n=this[E];return r(n),t(n),ne(n),n.base_.has(e)?n.assigned_.set(e,!1):n.assigned_.delete(e),n.copy_.delete(e),!0}clear(){const e=this[E];r(e),T(e).size&&(t(e),ne(e),e.assigned_=new Map,A(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){T(this[E]).forEach((n,o,r)=>{e.call(t,this.get(o),o,this)})}get(e){const n=this[E];r(n);const o=T(n).get(e);if(n.finalized_||!N(o))return o;if(o!==n.base_.get(e))return o;const s=re(o,n);return t(n),n.copy_.set(e,s),s}keys(){return T(this[E]).keys()}values(){const e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}}entries(){const e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const t=e.next();if(t.done)return t;const n=this.get(t.value);return{done:!1,value:[t.value,n]}}}}[Symbol.iterator](){return this.entries()}}function t(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}class n extends Set{constructor(e,t){super(),this[E]={type_:3,parent_:t,scope_:t?t.scope_:H(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return T(this[E]).size}has(e){const t=this[E];return r(t),t.copy_?!!t.copy_.has(e)||!(!t.drafts_.has(e)||!t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){const t=this[E];return r(t),this.has(e)||(o(t),ne(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;const t=this[E];return r(t),o(t),ne(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))}clear(){const e=this[E];r(e),T(e).size&&(o(e),ne(e),e.copy_.clear())}values(){const e=this[E];return r(e),o(e),e.copy_.values()}entries(){const e=this[E];return r(e),o(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){const n=this.values();let o=n.next();for(;!o.done;)e.call(t,o.value,o.value,this),o=n.next()}}function o(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(N(t)){const n=re(t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)}))}function r(e){e.revoked_&&C(3,JSON.stringify(T(e)))}var s,c;c={proxyMap_:function(t,n){return new e(t,n)},proxySet_:function(e,t){return new n(e,t)}},U[s="MapSet"]||(U[s]=c)}();const Se={comments:new Map,forceFocus:!1,focusedComment:null,pinnedComment:null,remoteCommentCount:0},Fe=ae((e,t)=>{const n=t=>{t.remoteId?t.resolved=!0:e.comments.delete(t.localId),e.focusedComment===t.localId&&(e.focusedComment=null),e.pinnedComment===t.localId&&(e.pinnedComment=null)};switch(t.type){case ie:e.comments.set(t.comment.localId,t.comment),t.comment.remoteId&&(e.remoteCommentCount+=1);break;case le:{const n=e.comments.get(t.commentId);if(n){if(t.update.newText&&0===t.update.newText.length)break;Object.assign(n,t.update)}break}case me:{const n=e.comments.get(t.commentId);if(!n)break;(t=>{t.remoteId?t.deleted=!0:e.comments.delete(t.localId),e.focusedComment===t.localId&&(e.focusedComment=null,e.forceFocus=!1),e.pinnedComment===t.localId&&(e.pinnedComment=null)})(n);break}case ue:{const o=e.comments.get(t.commentId);if(!o)break;n(o);break}case de:(null===t.commentId||e.comments.has(t.commentId))&&(e.focusedComment=t.commentId,t.updatePinnedComment&&(e.pinnedComment=t.commentId),e.forceFocus=t.forceFocus);break;case pe:{const n=e.comments.get(t.commentId);if(!n||0===t.reply.text.length)break;t.reply.remoteId&&(n.remoteReplyCount+=1),n.replies.set(t.reply.localId,t.reply);break}case fe:{const n=e.comments.get(t.commentId);if(!n)break;const o=n.replies.get(t.replyId);if(!o)break;if(t.update.newText&&0===t.update.newText.length)break;Object.assign(o,t.update);break}case he:{const n=e.comments.get(t.commentId);if(!n)break;const o=n.replies.get(t.replyId);if(!o)break;o.remoteId?o.deleted=!0:n.replies.delete(o.localId);break}case ye:{const o=e.comments;for(const e of o.values())e.contentpath.startsWith(t.contentPath)&&n(e);break}}},Se),ke="update-global-settings";function De(e){return{type:ke,update:e}}const Re={user:null,currentTab:null},Te=function(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const r=t[o];"function"==typeof e[r]&&(n[r]=e[r])}const o=Object.keys(n);let r;try{!function(e){Object.keys(e).forEach(t=>{const n=e[t];if(void 0===n(void 0,{type:u.INIT}))throw new Error(i(12));if(void 0===n(void 0,{type:u.PROBE_UNKNOWN_ACTION()}))throw new Error(i(13))})}(n)}catch(e){r=e}return function(e={},t){if(r)throw r;let s=!1;const c={};for(let r=0;r<o.length;r++){const a=o[r],l=n[a],m=e[a],u=l(m,t);if(void 0===u)throw t&&t.type,new Error(i(14));c[a]=u,s=s||u!==m}return s=s||o.length!==Object.keys(e).length,s?c:e}}({comments:Fe,settings:ae((e,t)=>{t.type===ke&&Object.assign(e,t.update)},Re)});var Oe=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Me="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function je(){return{s:0,v:void 0,o:null,p:null}}function ze(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:o}=t;let r,s=0;function c(){let t=n;const{length:c}=arguments;for(let e=0,n=c;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const o=e.get(n);void 0===o?(t=je(),e.set(n,t)):t=o}else{let e=t.p;null===e&&(t.p=e=new Map);const o=e.get(n);void 0===o?(t=je(),e.set(n,t)):t=o}}const a=t;let i;if(1===t.s)i=t.v;else if(i=e.apply(null,arguments),s++,o){const e=r?.deref?.()??r;null!=e&&o(e,i)&&(i=e,0!==s&&s--),r="object"==typeof i&&null!==i||"function"==typeof i?new Me(i):i}return a.s=1,a.v=i,i}return c.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},c.resetResultsCount()},c.resultsCount=()=>s,c.resetResultsCount=()=>{s=0},c}function Le(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,o=(...e)=>{let t,o=0,r=0,s={},c=e.pop();"object"==typeof c&&(s=c,c=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const a={...n,...s},{memoize:i,memoizeOptions:l=[],argsMemoize:m=ze,argsMemoizeOptions:u=[],devModeChecks:d={}}=a,p=Oe(l),f=Oe(u),h=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(e=>"function"==typeof e)){const n=e.map(e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),y=i(function(){return o++,c.apply(null,arguments)},...p),_=m(function(){r++;const e=function(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}(h,arguments);return t=y.apply(null,e),t},...f);return Object.assign(_,{resultFunc:c,memoizedResultFunc:y,dependencies:h,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>t,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:i,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var Ue=Le(ze),$e=Object.assign((e,t=Ue)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,o)=>(e[n[o]]=t,e),{}))},{withTypes:()=>$e});const He=e=>e.comments.comments,qe=e=>e.comments.focusedComment;function Ke(e){return Ue(He,t=>[...t.values()].filter(t=>t.contentpath===e&&!(t.deleted||t.resolved)))}function We(e){return Ue(He,t=>{const n=t.get(e);if(void 0===n||!n.deleted&&!n.resolved)return n})}const Be=Ue(He,e=>e.comments.remoteCommentCount,(e,t)=>t!==e.size||Array.from(e.values()).some(e=>!(!e.deleted&&!e.resolved&&e.replies.size===e.remoteReplyCount&&e.originalText===e.text)||Array.from(e.replies.values()).some(e=>e.deleted||e.originalText!==e.text))),Ve=e=>[...e.comments.comments.values()].filter(e=>!e.deleted&&!e.resolved).length;var Xe=n(1688),Je=n.n(Xe),Ye=n(1238);const Ge=new Intl.DateTimeFormat([],{dateStyle:"medium",timeStyle:"short"}),Qe=({commentReply:e,store:t,onResolve:n,onEdit:c,onDelete:a,descriptionId:i,focused:l})=>{const{author:m,date:u}=e,[d,p]=(0,r.useState)(!1);(0,r.useEffect)(()=>{d&&!l&&p(!1)},[l]);const f=(0,r.useRef)(null),h=(0,r.useRef)(null),y=e=>{e.preventDefault(),e.stopPropagation(),p(!d)};(0,r.useEffect)(()=>{d&&setTimeout(()=>f.current?.focus(),1)},[d]);const _=e=>{h.current&&e.target instanceof Node&&!h.current.contains(e.target)&&p(!1)};(0,r.useEffect)(()=>(document.addEventListener("click",_,!0),()=>{document.removeEventListener("click",_,!0)}),[]);const b=new Date(u).toISOString();return s().createElement("div",{className:"comment-header"},s().createElement("div",{className:"comment-header__actions"},(c||a||n)&&s().createElement("div",{className:"comment-header__action comment-header__action--more",ref:h},s().createElement("details",{open:d,onClick:y},s().createElement("summary",{"aria-label":(0,o.AP)("More actions"),"aria-haspopup":"menu",role:"button",onClick:y,"aria-expanded":d},s().createElement(Ye.A,{name:"dots-horizontal"})),s().createElement("div",{className:"comment-header__more-actions",role:"menu",ref:f},c&&s().createElement("button",{type:"button",role:"menuitem",onClick:async n=>{n.preventDefault(),c&&c(e,t)}},(0,o.AP)("Edit")),a&&s().createElement("button",{type:"button",role:"menuitem",onClick:async n=>{n.preventDefault(),a&&a(e,t)}},(0,o.AP)("Delete")),n&&s().createElement("button",{type:"button",role:"menuitem",onClick:o=>{o.preventDefault(),n&&n(e,t)}},(0,o.AP)("Resolve")))))),m&&m.avatarUrl&&s().createElement("img",{className:"comment-header__avatar",src:m.avatarUrl,alt:"",decoding:"async",loading:"lazy"}),s().createElement("span",{id:i},s().createElement("p",{className:"comment-header__author"},m?m.name:""),s().createElement("p",{className:"comment-header__date"},s().createElement("time",{dateTime:b},Ge.format(u)))))},Ze=s().forwardRef(({value:e,className:t,placeholder:n,onChange:o,focusOnMount:r,focusTarget:c=!1,additionalAttributes:a={}},i)=>{const l=s().useRef(null);return s().useImperativeHandle(i,()=>l.current),s().useEffect(()=>{l.current&&(l.current.style.height="",l.current.style.height=l.current.scrollHeight+"px")},[e,l]),s().useEffect(()=>{r&&l.current&&l.current.focus()},[l]),s().createElement("textarea",{"data-focus-target":c,rows:1,style:{resize:"none",overflowY:"hidden"},className:t,placeholder:n,ref:l,onChange:e=>{o&&o(e.target.value)},value:e,...a})});async function et(e,t,n){n.dispatch(we(e.localId,t.localId,{mode:"saving"}));try{n.dispatch(we(e.localId,t.localId,{mode:"default",text:t.newText,author:t.author}))}catch(o){console.error(o),n.dispatch(we(e.localId,t.localId,{mode:"save_error"}))}}async function tt(e,t,n){n.dispatch(we(e.localId,t.localId,{mode:"deleting"}));try{n.dispatch(Ie(e.localId,t.localId))}catch(o){n.dispatch(we(e.localId,t.localId,{mode:"delete_error"}))}}class nt extends s().Component{renderEditing(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:t,store:n,focused:r}),s().createElement("form",{onSubmit:async o=>{o.preventDefault(),await et(e,t,n)}},s().createElement(Ze,{className:"comment-reply__input",value:t.newText,onChange:o=>{n.dispatch(we(e.localId,t.localId,{newText:o}))}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{type:"submit",disabled:0===t.newText.length,className:"comment__button comment__button--primary"},(0,o.AP)("Save")),s().createElement("button",{type:"button",className:"comment__button",onClick:o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default",newText:t.text}))}},(0,o.AP)("Cancel")))))}renderSaving(){const{reply:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Saving...")))}renderSaveError(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__error"},(0,o.AP)("Save error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),await et(e,t,n)}},(0,o.AP)("Retry"))))}renderDeleteConfirm(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__confirm-delete"},(0,o.AP)("Are you sure?"),s().createElement("button",{type:"button",className:"comment__button button button-small",onClick:o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button button button-small no",onClick:async o=>{o.preventDefault(),await tt(e,t,n)}},(0,o.AP)("Delete"))))}renderDeleting(){const{reply:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Deleting")))}renderDeleteError(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:t,store:n,focused:r}),s().createElement("p",{className:"comment__text"},t.text),s().createElement("div",{className:"comment__error"},(0,o.AP)("Delete error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),n.dispatch(we(e.localId,t.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button",onClick:async o=>{o.preventDefault(),await tt(e,t,n)}},(0,o.AP)("Retry"))))}renderDefault(){const{comment:e,reply:t,store:n,isFocused:r}=this.props;let c,a;(null===t.author||this.props.user&&this.props.user.id===t.author.id)&&(c=()=>{n.dispatch(we(e.localId,t.localId,{mode:"editing",newText:t.text}))},a=()=>{n.dispatch(we(e.localId,t.localId,{mode:"delete_confirm"}))});let i="";return t.remoteId&&t.text===t.originalText||(i=(0,o.AP)("Save the page to save this reply")),s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:t,store:n,onEdit:c,onDelete:a,focused:r}),s().createElement("p",{className:"comment__text"},t.text),i&&s().createElement("div",{className:"comment__notice-placeholder"},s().createElement("div",{className:"comment__notice",role:"status"},s().createElement(Ye.A,{name:"info-circle"}),i)))}render(){let e;switch(this.props.reply.mode){case"editing":e=this.renderEditing();break;case"saving":e=this.renderSaving();break;case"save_error":e=this.renderSaveError();break;case"delete_confirm":e=this.renderDeleteConfirm();break;case"deleting":e=this.renderDeleting();break;case"delete_error":e=this.renderDeleteError();break;default:e=this.renderDefault()}return s().createElement("li",{key:this.props.reply.localId,className:`comment-reply comment-reply--mode-${this.props.reply.mode}`,"data-reply-id":this.props.reply.localId},e)}}async function ot(e,t){t.dispatch(be(e.localId,{mode:"saving"}));try{t.dispatch(be(e.localId,{mode:"default",text:e.newText,remoteId:e.remoteId,author:e.author,date:e.date}))}catch(n){console.error(n),t.dispatch(be(e.localId,{mode:"save_error"}))}}async function rt(e,t){t.dispatch(be(e.localId,{mode:"deleting"}));try{t.dispatch(ve(e.localId))}catch(n){console.error(n),t.dispatch(be(e.localId,{mode:"delete_error"}))}}function st(e,t){t.dispatch(ge(e.localId))}class ct extends s().Component{renderReplies({hideNewReply:e=!1}={}){const{comment:t,isFocused:n,store:r,user:c}=this.props;if(!t.remoteId)return null;const a=[];let i,l=!1;for(const e of t.replies.values())"saving"!==e.mode&&"editing"!==e.mode||(l=!0),e.deleted||a.push(s().createElement(nt,{key:e.localId,store:r,user:c,comment:t,reply:e,isFocused:n}));if(e||l||!n&&!t.newReply){if(0===a.length)return null}else i=s().createElement("form",{onSubmit:async e=>{e.preventDefault();const n=Pe(b(),c,Date.now(),{text:t.newReply,mode:"default"});r.dispatch(Ce(t.localId,n)),r.dispatch(be(t.localId,{newReply:""}))}},s().createElement(Ze,{className:"comment__reply-input",placeholder:(0,o.AP)("Enter your reply..."),value:t.newReply,onChange:e=>{r.dispatch(be(t.localId,{newReply:e}))}}),s().createElement("div",{className:"comment__reply-actions"},s().createElement("button",{disabled:0===t.newReply.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Reply")),s().createElement("button",{type:"button",onClick:e=>{e.preventDefault(),r.dispatch(be(t.localId,{newReply:""})),r.dispatch(Ee(null)),e.stopPropagation()},className:"comment__button"},(0,o.AP)("Cancel"))));return s().createElement(s().Fragment,null,s().createElement("ul",{className:"comment__replies"},a),i)}renderCreating(){const{comment:e,store:t,isFocused:n}=this.props,r=`comment-description-${e.localId}`;return s().createElement(s().Fragment,null,s().createElement(Qe,{descriptionId:r,commentReply:e,store:t,focused:n}),s().createElement("form",{onSubmit:async n=>{n.preventDefault(),await ot(e,t)}},s().createElement(Ze,{focusTarget:n,className:"comment__input",value:e.newText,onChange:n=>{t.dispatch(be(e.localId,{newText:n}))},placeholder:(0,o.AP)("Enter your comments..."),additionalAttributes:{"aria-describedby":r}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{disabled:0===e.newText.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Comment")),s().createElement("button",{type:"button",onClick:n=>{n.preventDefault(),t.dispatch(ve(e.localId))},className:"comment__button"},(0,o.AP)("Cancel")))))}renderEditing(){const{comment:e,store:t,isFocused:n}=this.props,r=`comment-description-${e.localId}`;return s().createElement(s().Fragment,null,s().createElement(Qe,{descriptionId:r,commentReply:e,store:t,focused:n}),s().createElement("form",{onSubmit:async n=>{n.preventDefault(),await ot(e,t)}},s().createElement(Ze,{focusTarget:n,className:"comment__input",value:e.newText,additionalAttributes:{"aria-describedby":r},onChange:n=>{t.dispatch(be(e.localId,{newText:n}))}}),s().createElement("div",{className:"comment__actions"},s().createElement("button",{disabled:0===e.newText.length,type:"submit",className:"comment__button comment__button--primary"},(0,o.AP)("Save")),s().createElement("button",{type:"button",onClick:n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default",newText:e.text}))},className:"comment__button"},(0,o.AP)("Cancel")))),this.renderReplies({hideNewReply:!0}))}renderSaving(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Saving...")),this.renderReplies({hideNewReply:!0}))}renderSaveError(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),this.renderReplies({hideNewReply:!0}),s().createElement("div",{className:"comment__error"},(0,o.AP)("Save error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),await ot(e,t)}},(0,o.AP)("Retry"))))}renderDeleteConfirm(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__confirm-delete"},(0,o.AP)("Are you sure?"),s().createElement("button",{type:"button",className:"comment__button button button-small",onClick:n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button button button-small no",onClick:async n=>{n.preventDefault(),await rt(e,t)}},(0,o.AP)("Delete"))),this.renderReplies({hideNewReply:!0}))}renderDeleting(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),s().createElement("div",{className:"comment__progress"},(0,o.AP)("Deleting")),this.renderReplies({hideNewReply:!0}))}renderDeleteError(){const{comment:e,store:t,isFocused:n}=this.props;return s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,focused:n}),s().createElement("p",{className:"comment__text"},e.text),this.renderReplies({hideNewReply:!0}),s().createElement("div",{className:"comment__error"},(0,o.AP)("Delete error"),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),t.dispatch(be(e.localId,{mode:"default"}))}},(0,o.AP)("Cancel")),s().createElement("button",{type:"button",className:"comment__button",onClick:async n=>{n.preventDefault(),await rt(e,t)}},(0,o.AP)("Retry"))))}renderDefault(){const{comment:e,store:t,isFocused:n}=this.props;let r,c;(null===e.author||this.props.user&&this.props.user.id===e.author.id)&&(r=()=>{t.dispatch(be(e.localId,{mode:"editing",newText:e.text}))},c=()=>{t.dispatch(be(e.localId,{mode:"delete_confirm"}))});let a="";return e.remoteId?e.text!==e.originalText&&(a=(0,o.AP)("Save the page to save this comment")):a=(0,o.AP)("Save the page to add this comment"),s().createElement(s().Fragment,null,s().createElement(Qe,{commentReply:e,store:t,onResolve:st,onEdit:r,onDelete:c,focused:n}),s().createElement("p",{className:"comment__text"},e.text),a&&s().createElement("div",{className:"comment__notice-placeholder"},s().createElement("div",{className:"comment__notice",role:"status"},s().createElement(Ye.A,{name:"info-circle"}),a)),this.renderReplies())}render(){let e;switch(this.props.comment.mode){case"creating":e=this.renderCreating();break;case"editing":e=this.renderEditing();break;case"saving":e=this.renderSaving();break;case"save_error":e=this.renderSaveError();break;case"delete_confirm":e=this.renderDeleteConfirm();break;case"deleting":e=this.renderDeleting();break;case"delete_error":e=this.renderDeleteError();break;default:e=this.renderDefault()}const t=this.props.layout.getCommentPosition(this.props.comment.localId);return s().createElement(Je(),{focusTrapOptions:{preventScroll:!0,clickOutsideDeactivates:!0,onDeactivate:()=>{this.props.store.dispatch(Ee(null,{updatePinnedComment:!0,forceFocus:!1}))},checkCanFocusTrap:e=>e.some(e=>e.matches('[data-form-side="comments"].form-side--comments [data-focus-target="true"]'))?Promise.resolve():new Promise(e=>{setTimeout(e,250)}),initialFocus:'[data-focus-target="true"]',delayInitialFocus:!0},active:this.props.isFocused&&this.props.forceFocus},s().createElement("li",{tabIndex:-1,"data-focus-target":this.props.isFocused&&!["creating","editing"].includes(this.props.comment.mode),key:this.props.comment.localId,className:`comment comment--mode-${this.props.comment.mode} ${this.props.isFocused?"comment--focused":""}`,style:{position:"absolute",top:`${t}px`,display:this.props.isVisible?"block":"none"},"data-comment-id":this.props.comment.localId,onClick:()=>{this.props.store.dispatch(Ee(this.props.comment.localId,{updatePinnedComment:!1,forceFocus:this.props.isFocused&&this.props.forceFocus}))},onDoubleClick:()=>{this.props.store.dispatch(Ee(this.props.comment.localId,{updatePinnedComment:!0,forceFocus:!0}))}},e))}componentDidMount(){const e=a().findDOMNode(this);e instanceof HTMLElement&&(this.props.layout.setCommentElement(this.props.comment.localId,e),this.props.isVisible&&this.props.layout.setCommentHeight(this.props.comment.localId,e.offsetHeight))}componentWillUnmount(){this.props.layout.setCommentElement(this.props.comment.localId,null)}componentDidUpdate(){const e=a().findDOMNode(this);this.props.isVisible&&e instanceof HTMLElement&&this.props.layout.setCommentHeight(this.props.comment.localId,e.offsetHeight)}}function at({prefix:e,value:t,fieldName:n}){return s().createElement("input",{type:"hidden",name:`${e}-${n}`,value:null===t?"":t,id:`id_${e}-${n}`})}function it({reply:e,formNumber:t,prefix:n}){const o=`${n}-${t}`;return s().createElement("fieldset",null,s().createElement(at,{fieldName:"DELETE",value:e.deleted?1:"",prefix:o}),s().createElement(at,{fieldName:"id",value:e.remoteId,prefix:o}),s().createElement(at,{fieldName:"text",value:e.text,prefix:o}))}function lt({replies:e,prefix:t,remoteReplyCount:n}){const o=`${t}-replies`,r=e.map((e,t)=>s().createElement(it,{key:e.localId,formNumber:t,reply:e,prefix:o}));return s().createElement(s().Fragment,null,s().createElement(at,{fieldName:"TOTAL_FORMS",value:e.length,prefix:o}),s().createElement(at,{fieldName:"INITIAL_FORMS",value:n,prefix:o}),s().createElement(at,{fieldName:"MIN_NUM_FORMS",value:"0",prefix:o}),s().createElement(at,{fieldName:"MAX_NUM_FORMS",value:"",prefix:o}),r)}function mt({comment:e,formNumber:t,prefix:n}){const o=`${n}-${t}`;return s().createElement("fieldset",null,s().createElement(at,{fieldName:"DELETE",value:e.deleted?1:"",prefix:o}),s().createElement(at,{fieldName:"resolved",value:e.resolved?1:"",prefix:o}),s().createElement(at,{fieldName:"id",value:e.remoteId,prefix:o}),s().createElement(at,{fieldName:"contentpath",value:e.contentpath,prefix:o}),s().createElement(at,{fieldName:"text",value:e.text,prefix:o}),s().createElement(at,{fieldName:"position",value:e.position,prefix:o}),s().createElement(lt,{replies:Array.from(e.replies.values()),prefix:o,remoteReplyCount:e.remoteReplyCount}))}function ut({comments:e,remoteCommentCount:t}){const n="comments",o=e.map((e,t)=>s().createElement(mt,{key:e.localId,comment:e,formNumber:t,prefix:n}));return s().createElement(s().Fragment,null,s().createElement(at,{fieldName:"TOTAL_FORMS",value:e.length,prefix:n}),s().createElement(at,{fieldName:"INITIAL_FORMS",value:t,prefix:n}),s().createElement(at,{fieldName:"MIN_NUM_FORMS",value:"0",prefix:n}),s().createElement(at,{fieldName:"MAX_NUM_FORMS",value:"",prefix:n}),o)}const dt=(e,t)=>{const n=p(e,String(t),{name:"",avatar_url:""});return{id:t,name:n.name,avatarUrl:n.avatar_url}};function pt({store:e,layout:t,comments:n}){const o=e.getState(),{user:c,currentTab:a}=o.settings,{focusedComment:i,forceFocus:l}=o.comments,m=s().useRef(null),u=(0,r.useCallback)(e=>{if(!m.current)return;if("scroll"===e.type&&!document.querySelector(".form-side--comments"))return;const t=document.querySelector(".content"),n=t?.getBoundingClientRect().top;m.current.style.top=`${n}px`},[m]);let d=n;s().useEffect(()=>{const e=document.querySelector("#main"),t=document.querySelector('[data-side-panel="comments"]');return e?.addEventListener("scroll",u),t?.addEventListener("show",u),()=>{e?.removeEventListener("scroll",u),t?.removeEventListener("show",u)}},[]),c||(d=[]),d=d.filter(({deleted:e,resolved:t})=>!(e||t));const p=d.map(n=>s().createElement(ct,{key:n.localId,store:e,layout:t,user:c,comment:n,isFocused:n.localId===i,forceFocus:l,isVisible:t.getCommentVisible(a,n.localId)}));return s().createElement("ol",{ref:m,className:"comments-list"},p)}class ft{store;layout;utils={selectCommentsForContentPathFactory:Ke,selectCommentFactory:We};selectors={selectComments:He,selectFocused:qe,selectIsDirty:Be,selectCommentCount:Ve};actions=xe;activationHandlers=[];constructor(){this.store=function(e,t){return d(e,t,void 0)}(Te,{comments:Se,settings:Re}),this.layout=new f}setUser(e,t){this.store.dispatch(De({user:dt(t,e)}))}updateAnnotation(e,t){this.attachAnnotationLayout(e,t),this.store.dispatch(be(t,{annotation:e}))}attachAnnotationLayout(e,t){this.layout.setCommentAnnotation(t,e)}setCurrentTab(e){this.store.dispatch(De({currentTab:e}))}makeComment(e,t,n=""){const o=_();return this.attachAnnotationLayout(e,o),this.store.dispatch(_e(Ae(t,n,o,e,this.store.getState().settings.user,Date.now(),{mode:"creating"}))),this.store.dispatch(Ee(o,{updatePinnedComment:!0,forceFocus:!0})),o}activate(){this.activationHandlers.forEach(e=>e())}onActivate(e){this.activationHandlers.push(e)}invalidateContentPath(e){this.store.dispatch(Ne(e))}updateContentPath(e,t){this.store.dispatch(be(e,{contentpath:t}))}renderApp(e,t,n,o,r){let c=null;this.setUser(n,r);let i=null;const l=new URLSearchParams(window.location.search).get("comment");l&&(i=parseInt(l,10));const m=()=>{const n=this.store.getState(),o=Array.from(n.comments.comments.values());a().render(s().createElement(ut,{comments:o.filter(e=>"creating"!==e.mode),remoteCommentCount:n.comments.remoteCommentCount}),t),n.comments.pinnedComment!==c&&(this.layout.setPinnedComment(n.comments.pinnedComment),c=n.comments.pinnedComment),a().render(s().createElement(pt,{store:this.store,layout:this.layout,comments:o}),e,()=>{this.layout.refreshDesiredPositions(n.settings.currentTab),this.layout.refreshLayout()&&a().render(s().createElement(pt,{store:this.store,layout:this.layout,comments:o}),e)})};for(const e of o){const t=_();this.store.dispatch(_e(Ae(e.contentpath,e.position,t,null,dt(r,e.user),Date.parse(e.created_at),{remoteId:e.pk,text:e.text,deleted:e.deleted,resolved:e.resolved})));for(const n of e.replies)this.store.dispatch(Ce(t,Pe(b(),dt(r,n.user),Date.parse(n.created_at),{remoteId:n.pk,text:n.text,deleted:n.deleted})));i&&e.pk===i&&this.store.dispatch(Ee(t,{updatePinnedComment:!0,forceFocus:!0}))}m(),this.store.subscribe(m),document.body.addEventListener("mousedown",e=>{e.target instanceof HTMLElement&&(e.target.closest("#comments, [data-annotation], [data-comment-add]")||setTimeout(()=>{this.store.dispatch(Ee(null,{updatePinnedComment:!0,forceFocus:!1}))},200))}),document.body.addEventListener("commentAnchorVisibilityChange",()=>{this.layout.refreshDesiredPositions(this.store.getState().settings.currentTab),this.layout.refreshLayout()&&m()})}}var ht=n(2898);window.comments=(()=>{const e=new ft;function t(e){return ht.HE.KEYBOARD_SHORTCUTS_ENABLED&&(e.ctrlKey||e.metaKey)&&e.altKey&&77===e.keyCode}function n(e){if(!e||e.closest("[data-contentpath-disabled]"))return"";let t=e.closest("[data-contentpath]");const n=[];for(;null!==t;)n.push(t.dataset.contentpath),t=t.parentElement.closest("[data-contentpath]");return n.reverse(),n.join(".")}class r{constructor(e,t){this.node=t,this.fieldNode=e,this.unsubscribe=null}subscribeToUpdates(t){const{selectFocused:n}=e.selectors,o=e.utils.selectCommentFactory(t),r=e.store,s=r.getState();let c=n(s)===t;c&&this.onFocus(),this.show(),this.unsubscribe=r.subscribe(()=>{const e=r.getState();o(e)||this.onDelete();const s=n(e)===t;s!==c&&(c?this.onUnfocus():this.onFocus(),c=s)}),this.setOnClickHandler(t)}onDelete(){this.node.remove(),this.unsubscribe&&this.unsubscribe()}onFocus(){this.node.classList.add("w-field__comment-button--focused"),this.node.ariaLabel=(0,o.AP)("Unfocus comment")}onUnfocus(){this.node.classList.remove("w-field__comment-button--focused"),this.node.ariaLabel=(0,o.AP)("Focus comment")}show(){this.node.classList.remove("!w-hidden")}hide(){this.node.classList.add("!w-hidden")}setOnClickHandler(t){this.node.addEventListener("click",()=>{e.activate(),e.store.dispatch(e.actions.setFocusedComment(t,{updatePinnedComment:!0,forceFocus:!0}))})}getTab(){return this.fieldNode.closest('[role="tabpanel"]')?.getAttribute("id")}getAnchorNode(){return this.fieldNode}}class s extends Error{constructor(e,...t){super(...t),this.name="MissingElementError",this.element=e}}class c{constructor({fieldNode:e,commentAdditionNode:t}){if(this.fieldNode=e,this.contentpath=n(e),!t)throw new s(t);this.commentAdditionNode=t}register(){if(!this.contentpath)return void this.commentAdditionNode.remove();const n=e.store.getState(),o=e.utils.selectCommentsForContentPathFactory(this.contentpath);let r=o(n);const s=e.store.subscribe(()=>{const t=e.store.getState(),n=o(t);r!==n&&(r=n,r.filter(e=>null===e.annotation).forEach(t=>{const n=this.getAnnotationForComment(t);e.updateAnnotation(n,t.localId),n.subscribeToUpdates(t.localId)}))});n.comments.comments.forEach(t=>{if(t.contentpath===this.contentpath){const n=this.getAnnotationForComment(t);e.updateAnnotation(n,t.localId),n.subscribeToUpdates(t.localId)}});const c=()=>{const t=this.getAnnotationForComment(),n=e.makeComment(t,this.contentpath);t.subscribeToUpdates(n)};return this.commentAdditionNode.addEventListener("click",()=>{e.activate(),c()}),this.fieldNode.addEventListener("keyup",n=>{t(n)&&(0===r.length?c():e.store.dispatch(e.actions.setFocusedComment(r[0].localId,{updatePinnedComment:!0,forceFocus:!0})))}),s}getAnnotationForComment(){const t=document.querySelector("#comment-icon").cloneNode(!0);return t.id="",t.setAttribute("aria-label",this.commentAdditionNode.getAttribute("aria-label")),t.setAttribute("aria-describedby",this.commentAdditionNode.getAttribute("aria-describedby")),t.classList.remove("!w-hidden"),this.commentAdditionNode.insertAdjacentElement("beforebegin",t),new r(this.fieldNode,t,e)}}function a(e){new c({fieldNode:e.closest("[data-contentpath]"),commentAdditionNode:e}).register()}function i(t){const n=document.getElementById("comments"),o=document.getElementById("comments-output"),r=document.getElementById("comments-data");if(!n||!o||!r)throw new Error("Comments app failed to initialise. Missing HTML element");const s=JSON.parse(r.textContent);e.renderApp(n,o,s.user,s.comments,new Map(Object.entries(s.authors))),t.querySelectorAll('[data-component="add-comment-button"]').forEach(a);const c=t.querySelector('[data-controller~="w-tabs"]');if(c){const t=c.getAttribute("data-w-tabs-active-panel-id-value");e.setCurrentTab(t),c.addEventListener("w-tabs:changed",({detail:{current:t}})=>setTimeout(()=>e.setCurrentTab(t)))}const i=document.querySelector("[data-comment-notifications]");i.hidden=!1,i.querySelector("input").setAttribute("form",t.id),t.querySelector(".tab-content").classList.add("tab-content--comments-enabled");const l=document.querySelector('[data-side-panel="comments"]');e.onActivate(()=>{l.dispatchEvent(new Event("open"))});const m=document.querySelector('[data-side-panel-toggle="comments"] [data-side-panel-toggle-counter]'),u=()=>{const t=e.selectors.selectCommentCount(e.store.getState());m&&(t>0?(m.innerText=t.toString(),m.hidden=!1):m.hidden=!0)};e.store.subscribe(u),u()}return document.addEventListener("w-comments:init",({target:e})=>{setTimeout(()=>{i(e)})},{once:!0}),{commentApp:e,getContentPath:n,isCommentShortcut:t,initAddCommentButton:a,initCommentsInterface:i}})()}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var s=n[e]={exports:{}};return t[e](s,s.exports,o),s.exports}o.m=t,e=[],o.O=(t,n,r,s)=>{if(!n){var c=1/0;for(m=0;m<e.length;m++){for(var[n,r,s]=e[m],a=!0,i=0;i<n.length;i++)(!1&s||c>=s)&&Object.keys(o.O).every(e=>o.O[e](n[i]))?n.splice(i--,1):(a=!1,s<c&&(c=s));if(a){e.splice(m--,1);var l=r();void 0!==l&&(t=l)}}return t}s=s||0;for(var m=e.length;m>0&&e[m-1][2]>s;m--)e[m]=e[m-1];e[m]=[n,r,s]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.j=125,(()=>{var e={125:0};o.O.j=t=>0===e[t];var t=(t,n)=>{var r,s,[c,a,i]=n,l=0;if(c.some(t=>0!==e[t])){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(i)var m=i(o)}for(t&&t(n);l<c.length;l++)s=c[l],o.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return o.O(m)},n=globalThis.webpackChunkwagtail=globalThis.webpackChunkwagtail||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var r=o.O(void 0,[321],()=>o(9786));r=o.O(r)})();