primer_view_components 0.0.116 → 0.0.117

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +2 -2
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list.css +1 -1
  8. data/app/components/primer/alpha/action_list.css.json +1 -1
  9. data/app/components/primer/alpha/action_list.css.map +1 -1
  10. data/app/components/primer/alpha/auto_complete/item.rb +4 -4
  11. data/app/components/primer/alpha/auto_complete.rb +6 -6
  12. data/app/components/primer/alpha/dialog.rb +0 -2
  13. data/app/components/primer/alpha/dropdown.rb +53 -53
  14. data/app/components/primer/alpha/hellip_button.rb +41 -0
  15. data/app/components/primer/alpha/hidden_text_expander.rb +1 -1
  16. data/app/components/primer/alpha/layout.rb +48 -48
  17. data/app/components/primer/alpha/menu.css +1 -1
  18. data/app/components/primer/alpha/menu.css.json +1 -1
  19. data/app/components/primer/alpha/menu.css.map +1 -1
  20. data/app/components/primer/alpha/menu.rb +5 -5
  21. data/app/components/primer/alpha/segmented_control.rb +20 -20
  22. data/app/components/primer/{tab_container_component.d.ts → alpha/tab_container.d.ts} +0 -0
  23. data/app/components/primer/{tab_container_component.js → alpha/tab_container.js} +0 -0
  24. data/app/components/primer/alpha/tab_container.rb +43 -0
  25. data/app/components/primer/{tab_container_component.ts → alpha/tab_container.ts} +0 -0
  26. data/app/components/primer/alpha/tab_nav.css +1 -1
  27. data/app/components/primer/alpha/tab_nav.css.json +1 -1
  28. data/app/components/primer/alpha/tab_nav.css.map +1 -1
  29. data/app/components/primer/alpha/tab_nav.rb +32 -32
  30. data/app/components/primer/alpha/tool_tip.js +3 -7
  31. data/app/components/primer/alpha/tool_tip.ts +3 -7
  32. data/app/components/primer/alpha/tooltip.rb +18 -18
  33. data/app/components/primer/alpha/underline_nav.css +1 -1
  34. data/app/components/primer/alpha/underline_nav.css.json +1 -1
  35. data/app/components/primer/alpha/underline_nav.css.map +1 -1
  36. data/app/components/primer/alpha/underline_nav.rb +18 -18
  37. data/app/components/primer/beta/auto_complete/item.rb +2 -3
  38. data/app/components/primer/beta/auto_complete.rb +14 -16
  39. data/app/components/primer/beta/avatar_stack.rb +12 -14
  40. data/app/components/primer/beta/blankslate.rb +0 -1
  41. data/app/components/primer/beta/border_box/header.rb +0 -2
  42. data/app/components/primer/beta/border_box.rb +0 -2
  43. data/app/components/primer/beta/breadcrumbs.css +1 -1
  44. data/app/components/primer/beta/breadcrumbs.css.json +1 -1
  45. data/app/components/primer/beta/breadcrumbs.css.map +1 -1
  46. data/app/components/primer/beta/breadcrumbs.rb +0 -1
  47. data/app/components/primer/beta/button.rb +9 -10
  48. data/app/components/primer/beta/button_group.rb +0 -1
  49. data/app/components/primer/beta/details.rb +0 -1
  50. data/app/components/primer/beta/flash.rb +0 -1
  51. data/app/components/primer/beta/link.rb +2 -3
  52. data/app/components/primer/beta/octicon.rb +0 -1
  53. data/app/components/primer/beta/popover.rb +0 -1
  54. data/app/components/primer/{state_component.css → beta/state.css} +0 -0
  55. data/app/components/primer/beta/state.css.json +1 -0
  56. data/app/components/primer/beta/state.css.map +1 -0
  57. data/app/components/primer/{state_component.pcss → beta/state.pcss} +0 -0
  58. data/app/components/primer/beta/state.rb +76 -0
  59. data/app/components/primer/{subhead_component.css → beta/subhead.css} +0 -0
  60. data/app/components/primer/beta/subhead.css.json +1 -0
  61. data/app/components/primer/beta/subhead.css.map +1 -0
  62. data/app/components/primer/{subhead_component.html.erb → beta/subhead.html.erb} +0 -0
  63. data/app/components/primer/{subhead_component.pcss → beta/subhead.pcss} +0 -0
  64. data/app/components/primer/beta/subhead.rb +135 -0
  65. data/app/components/primer/{timeline_item_component.css → beta/timeline_item.css} +0 -0
  66. data/app/components/primer/beta/timeline_item.css.json +1 -0
  67. data/app/components/primer/beta/timeline_item.css.map +1 -0
  68. data/app/components/primer/{timeline_item_component.html.erb → beta/timeline_item.html.erb} +0 -0
  69. data/app/components/primer/{timeline_item_component.pcss → beta/timeline_item.pcss} +0 -0
  70. data/app/components/primer/beta/timeline_item.rb +90 -0
  71. data/app/components/primer/beta/truncate.css +1 -1
  72. data/app/components/primer/beta/truncate.css.json +1 -1
  73. data/app/components/primer/beta/truncate.css.map +1 -1
  74. data/app/components/primer/beta/truncate.rb +0 -1
  75. data/app/components/primer/button_component.rb +9 -9
  76. data/app/components/primer/component.rb +0 -1
  77. data/app/components/primer/hellip_button.rb +2 -34
  78. data/app/components/primer/navigation/tab_component.rb +16 -16
  79. data/app/components/primer/primer.d.ts +1 -1
  80. data/app/components/primer/primer.js +1 -1
  81. data/app/components/primer/primer.pcss +3 -3
  82. data/app/components/primer/primer.ts +1 -1
  83. data/app/components/primer/state_component.rb +2 -69
  84. data/app/components/primer/subhead_component.rb +2 -128
  85. data/app/components/primer/tab_container_component.rb +2 -36
  86. data/app/components/primer/timeline_item_component.rb +5 -78
  87. data/app/forms/example_toggle_switch_form/example_field_caption.html.erb +1 -0
  88. data/app/forms/example_toggle_switch_form.rb +8 -0
  89. data/app/forms/submit_button_form.rb +4 -4
  90. data/app/lib/primer/tabbed_component_helper.rb +1 -1
  91. data/lib/primer/deprecations.rb +7 -13
  92. data/lib/primer/deprecations.yml +24 -0
  93. data/lib/primer/forms/button.html.erb +2 -2
  94. data/lib/primer/forms/dsl/toggle_switch_input.rb +35 -0
  95. data/lib/primer/forms/toggle_switch.html.erb +17 -0
  96. data/lib/primer/forms/toggle_switch.rb +19 -0
  97. data/lib/primer/forms/toggle_switch_form.rb +74 -0
  98. data/lib/primer/view_components/linters/subhead_component_migration_counter.rb +1 -1
  99. data/lib/primer/view_components/version.rb +1 -1
  100. data/lib/rubocop/cop/primer/component_name_migration.rb +2 -1
  101. data/lib/tasks/docs.rake +6 -6
  102. data/previews/primer/alpha/action_list_preview.rb +44 -44
  103. data/previews/primer/alpha/dropdown_preview.rb +97 -97
  104. data/previews/primer/alpha/hellip_button_preview.rb +24 -0
  105. data/previews/primer/alpha/layout_preview.rb +63 -63
  106. data/previews/primer/alpha/menu_preview/default.html.erb +5 -5
  107. data/previews/primer/alpha/menu_preview/playground.html.erb +5 -5
  108. data/previews/primer/alpha/segmented_control_preview.rb +60 -60
  109. data/previews/primer/alpha/tab_nav_preview.rb +22 -22
  110. data/previews/primer/alpha/tab_panels_preview.rb +2 -2
  111. data/previews/primer/alpha/tooltip_preview/with_multiple_on_a_page.html.erb +6 -6
  112. data/previews/primer/alpha/tooltip_preview.rb +12 -12
  113. data/previews/primer/alpha/underline_nav_preview.rb +4 -4
  114. data/previews/primer/alpha/underline_panels_preview.rb +8 -8
  115. data/previews/primer/beta/auto_complete_item_preview/default.html.erb +2 -2
  116. data/previews/primer/beta/auto_complete_item_preview/playground.html.erb +2 -2
  117. data/previews/primer/beta/auto_complete_item_preview/with_description.html.erb +3 -3
  118. data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +2 -2
  119. data/previews/primer/beta/auto_complete_preview.rb +18 -18
  120. data/previews/primer/beta/avatar_stack_preview.rb +32 -32
  121. data/previews/primer/beta/blankslate_preview.rb +40 -40
  122. data/previews/primer/beta/border_box_preview.rb +38 -38
  123. data/previews/primer/beta/breadcrumbs_preview.rb +2 -2
  124. data/previews/primer/beta/button_group_preview.rb +10 -10
  125. data/previews/primer/beta/button_preview/all_schemes.html.erb +4 -4
  126. data/previews/primer/beta/button_preview/invisible_all_visuals.html.erb +16 -16
  127. data/previews/primer/beta/button_preview/leading_visual.html.erb +2 -2
  128. data/previews/primer/beta/button_preview/trailing_action.html.erb +2 -2
  129. data/previews/primer/beta/button_preview/trailing_visual.html.erb +2 -2
  130. data/previews/primer/beta/button_preview/with_tooltip.html.erb +2 -2
  131. data/previews/primer/beta/details_preview.rb +6 -6
  132. data/previews/primer/beta/state_preview.rb +66 -0
  133. data/previews/primer/beta/subhead_preview/actions.html.erb +14 -0
  134. data/previews/primer/beta/subhead_preview.rb +99 -0
  135. data/previews/primer/beta/timeline_item_preview.rb +30 -0
  136. data/previews/primer/forms/forms_preview/example_toggle_switch_form.html.erb +1 -0
  137. data/previews/primer/forms/forms_preview.rb +2 -0
  138. data/static/arguments.json +118 -118
  139. data/static/audited_at.json +6 -0
  140. data/static/constants.json +67 -54
  141. data/static/statuses.json +12 -6
  142. metadata +36 -23
  143. data/app/components/primer/state_component.css.json +0 -1
  144. data/app/components/primer/state_component.css.map +0 -1
  145. data/app/components/primer/subhead_component.css.json +0 -1
  146. data/app/components/primer/subhead_component.css.map +0 -1
  147. data/app/components/primer/timeline_item_component.css.json +0 -1
  148. data/app/components/primer/timeline_item_component.css.map +0 -1
  149. data/previews/primer/hellip_button_preview.rb +0 -22
  150. data/previews/primer/state_component_preview.rb +0 -26
  151. data/previews/primer/subhead_component_preview.rb +0 -40
  152. data/previews/primer/timeline_item_component_preview.rb +0 -28
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0a1f0dad71fe0fe4e36e068a7b26b86fc23386a3b04edeb419d3c0eb19aab58
4
- data.tar.gz: d5f37b8d972cbab208181c43281caf0fcc90e3254757b39badf5b117a5941888
3
+ metadata.gz: bf5be29594c15ccf66965f12ebe6d493a5ee15727fa559bc68296013335d63e6
4
+ data.tar.gz: c83bbd7582816fdb5fa2efa905ce861d34bca5ea34dfae9173a62dc0bf4cf9af
5
5
  SHA512:
6
- metadata.gz: 999413b8d2d7349bb77db985e609f3e6bde08f43983e78c2f221f98bf624a5db831a67fa7074e4a993d3c68c48a063284b4d7f99a0db6caddf76c99d4ae026ce
7
- data.tar.gz: f1efde401c1cb74d6595e8c41e51e2d6407684b9ab96a80b447c0b8e8d45ee2da267df79916be17dd853158ddc2957dec4a1f6facbd2514003c04e95b361a03d
6
+ metadata.gz: e7f939ea34fd98ee8d4317d25e90f8e0ff41ffea92af4c2359dac8f9314bf8b2f5ab48f16da3f6049863759ff620f62b0815cb039825441583ce8cab6323fc1b
7
+ data.tar.gz: cfdfa0f15f7c48307b7a3a31c8dce6d9e176f223dad3dec82a8c6c5221465699fba327eb52a6c9dd3c7a120624b1d058497352eaf9dcb5eeccc91d43c00d0da7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.117
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1719](https://github.com/primer/view_components/pull/1719) [`8e4b37bc`](https://github.com/primer/view_components/commit/8e4b37bc269a1a285ce1bce695691f82827c9bc2) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Fix previews that used old slots API
8
+
9
+ * [#1721](https://github.com/primer/view_components/pull/1721) [`3cea518c`](https://github.com/primer/view_components/commit/3cea518c521631ac5e40e857c0eb87d863409a0d) Thanks [@joelhawksley](https://github.com/joelhawksley)! - fix more previews to use new Slots API
10
+
11
+ - [#1722](https://github.com/primer/view_components/pull/1722) [`0186096b`](https://github.com/primer/view_components/commit/0186096be9ae6990ed90b1ff04a26d73dabc78a4) Thanks [@simurai](https://github.com/simurai)! - Disable `is()` selector
12
+
13
+ * [#1724](https://github.com/primer/view_components/pull/1724) [`3533d8fb`](https://github.com/primer/view_components/commit/3533d8fbc77189656c9c2c85e343c548bc2596cf) Thanks [@simurai](https://github.com/simurai)! - Remove PCSS imports for Docs
14
+
15
+ - [#1718](https://github.com/primer/view_components/pull/1718) [`f96b7edd`](https://github.com/primer/view_components/commit/f96b7edd1af06170c4dea3a418630a8bd12bc092) Thanks [@joelhawksley](https://github.com/joelhawksley)! - fix missed Slots API changes
16
+
17
+ * [#1716](https://github.com/primer/view_components/pull/1716) [`9a4ad693`](https://github.com/primer/view_components/commit/9a4ad6935ea9d6852ee08c3ff4d7d45e0f07cc78) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::StateComponent` to `Primer::Beta::State` and deprecate the original
18
+
19
+ - [#1720](https://github.com/primer/view_components/pull/1720) [`365048a3`](https://github.com/primer/view_components/commit/365048a39af18484ac0eb9ca6985858fb2285b88) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::SubheadComponent` to `Primer::Beta::Subhead` and deprecate the original
20
+
21
+ * [#1729](https://github.com/primer/view_components/pull/1729) [`897b3524`](https://github.com/primer/view_components/commit/897b35246c7d8c9a813984eaa101fa0e9368ad63) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Correctly deprecate `Primer::TimelineItemComponent::BadgeComponent` in favor of `Primer::Beta::TimelineItem::Badge`
22
+
23
+ - [#1715](https://github.com/primer/view_components/pull/1715) [`34dfc3ab`](https://github.com/primer/view_components/commit/34dfc3abdc66ad15db3449ec1acae4b41be63e28) Thanks [@neall](https://github.com/neall)! - Add Primer::Forms::ToggleSwitchForm
24
+
25
+ * [#1713](https://github.com/primer/view_components/pull/1713) [`9b535d89`](https://github.com/primer/view_components/commit/9b535d89962a2cac4fc50d3a43119db3ccad8041) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Use new Slots API in previews.
26
+
27
+ - [#1725](https://github.com/primer/view_components/pull/1725) [`f84c7dda`](https://github.com/primer/view_components/commit/f84c7dda2239f4e01b1785db83fe70007df47f89) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::TabContainerComponent` to `Primer::Alpha::TabContainer`
28
+
29
+ * [#1717](https://github.com/primer/view_components/pull/1717) [`da56d348`](https://github.com/primer/view_components/commit/da56d34842afc7cbe3abe54de7545faa993abcae) Thanks [@KyFaSt](https://github.com/KyFaSt)! - Make tool_tip Trusted Types compatible
30
+
31
+ - [#1699](https://github.com/primer/view_components/pull/1699) [`14498234`](https://github.com/primer/view_components/commit/14498234a2953427a7fffd54c2aff82df594c9a1) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Update component deprecation in CI to report as info instead of errors. Update the deprecation messages to always provide a replacement when possible.
32
+
33
+ * [#1726](https://github.com/primer/view_components/pull/1726) [`0b21fb75`](https://github.com/primer/view_components/commit/0b21fb757cabb2f9ddc40cad57b58db6216a2002) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::HellipButton` to `Primer::Alpha::HellipButton`
34
+
35
+ - [#1727](https://github.com/primer/view_components/pull/1727) [`97a781a9`](https://github.com/primer/view_components/commit/97a781a9da38aa6c0f5cd8a98a889130d488693a) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move Primer::TimelineItemComponent to Primer::Beta::TimelineItem
36
+
3
37
  ## 0.0.116
4
38
 
5
39
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- !function(){"use strict";class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const s=this.parentElement;if(!s)return;const c=s.querySelector("summary");c&&(c.setAttribute("aria-haspopup","menu"),c.hasAttribute("role")||c.setAttribute("role","button"));const f=[n(s,"compositionstart",(t=>h(this,t))),n(s,"compositionend",(t=>h(this,t))),n(s,"click",(t=>l(s,t))),n(s,"change",(t=>l(s,t))),n(s,"keydown",(e=>function(e,n,i){if(!(i instanceof KeyboardEvent))return;if(e.querySelector("details[open]"))return;const o=t.get(n);if(!o||o.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":e.hasAttribute("open")&&(d(e),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case"n":if(a&&i.ctrlKey){const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"p":if(a&&i.ctrlKey){const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case" ":case"Enter":{const t=document.activeElement;t instanceof HTMLElement&&u(t)&&t.closest("details")===e&&(i.preventDefault(),i.stopPropagation(),t.click())}}}(s,this,e))),n(s,"toggle",(()=>i(s,this)),{once:!0}),n(s,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(s))),this.preload?n(s,"mouseover",(()=>i(s,this)),{once:!0}):e,...o(s)];t.set(this,{subscriptions:f,loaded:!1,isComposing:!1})}disconnectedCallback(){const e=t.get(this);if(e){t.delete(this);for(const t of e.subscriptions)t.unsubscribe()}}}const t=new WeakMap,e={unsubscribe(){}};function n(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function i(e,n){const i=n.getAttribute("src");if(!i)return;const o=t.get(n);if(!o)return;if(o.loaded)return;o.loaded=!0;const r=n.querySelector("include-fragment");r&&!r.hasAttribute("src")&&(r.addEventListener("loadend",(()=>s(e))),r.setAttribute("src",i))}function o(t){let e=!1;return[n(t,"mousedown",(()=>e=!0)),n(t,"keydown",(()=>e=!1)),n(t,"toggle",(()=>{t.hasAttribute("open")&&(s(t)||e||function(t){const e=document.activeElement;if(e&&u(e)&&t.contains(e))return;const n=r(t,!0);n&&n.focus()}(t))}))]}function s(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function r(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const a=navigator.userAgent.match(/Macintosh/);function l(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||c(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&c(e,t)}}function c(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&d(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function u(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function d(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function h(e,n){const i=t.get(e);i&&(i.isComposing="compositionstart"===n.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const f=new WeakMap,m=new WeakMap,p=new WeakMap;function b(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=p.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(m.has(e)&&t instanceof MouseEvent){const n=m.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(m.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=m.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,T(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)m.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];m.set(e,{dragStartX:n,dragStartY:i})}}function g(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return y(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,f.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=f.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=f.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&E(n,s,r,!(t instanceof KeyboardEvent))}function w(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function v(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",g),n.addEventListener("touchmove",g,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),f.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),g(t)}else n.addEventListener("mousemove",b),n.addEventListener("touchmove",b,{passive:!0})}function E(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=f.get(t);if(!s)return;const{box:r,image:a}=p.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const l=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,c=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${l}px`,r.style.top=`${c}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,T(t,{x:l,y:c,width:o,height:o})}function y(t){const{image:e}=p.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);f.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),E(t,n,n)}function A(t){const e=t.currentTarget;e instanceof ImageCropElement&&(m.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",g),e.removeEventListener("mousemove",b),e.removeEventListener("touchmove",g),e.removeEventListener("touchmove",b))}function T(t,e){const{image:n}=p.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(p.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(p.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,y(this)})),this.addEventListener("mouseleave",A),this.addEventListener("touchend",A),this.addEventListener("mouseup",A),e.addEventListener("mousedown",v),e.addEventListener("touchstart",v,{passive:!0}),this.addEventListener("keydown",b),this.addEventListener("keydown",g),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=p.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}function M(t,e,n,i){var o,s=arguments.length,r=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function k(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function x(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const L={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},C={start:["end","center"],end:["start","center"],center:["end","start"]};function S(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=F(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=L[o];let f=0;if(r){let t=o;for(;f<r.length&&P(t,u,c,n);){const o=r[f++];t=o,u=F(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=C[s];let p=0;if(m){let t=s;for(;p<m.length&&$(t,u,c,n);){const o=m[p++];t=o,u=F(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:I,a=null!==(n=t.align)&&void 0!==n?n:D;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:H,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?R:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:O}}(n))}const I="outside-bottom",D="start",H=4,R=4,O=!1;function F(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-o-t.height:"outside-bottom"===n?l=a+o:"outside-left"===n?c=e.left-o-t.width:"outside-right"===n&&(c=r+o),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?l=e.top+o:"inside-bottom"===n?l=a-o-t.height:"inside-left"===n?c=e.left+o:"inside-right"===n?c=r-o-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:l,left:c}}function P(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function $(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}function q(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?W:N,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function N(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function W(t,e=!1){return N(t,e)&&"-1"!==t.getAttribute("tabindex")}let B=!1;function Y(){}try{const t=Object.create({},{signal:{get(){B=!0}}});window.addEventListener("test",Y,t),window.removeEventListener("test",Y,t)}catch(t){}B||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,i){return"object"==typeof i&&"signal"in i&&i.signal instanceof AbortSignal&&t.call(i.signal,"abort",(()=>{this.removeEventListener(e,n,i)})),t.call(this,e,n,i)}}(),B=!0);const j=[];let X;function K(t,e,n){const i=new AbortController,o=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=q(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function l(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&W(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=q(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=q(t);null==e||e.focus()},t.prepend(s),t.append(r);const c=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(o);if(X){const t=X;X.container.setAttribute("data-focus-trap","suspended"),X.controller.abort(),j.push(t)}c.signal.addEventListener("abort",(()=>{X=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=j.findIndex((e=>e.container===t));n>=0&&j.splice(n,1),function(){const t=j.pop();t&&K(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),X={container:t,controller:c,initialFocus:e,originalSignal:o};const u=j.findIndex((e=>e.container===t));if(u>=0&&j.splice(u,1),!n)return i}var V,z,U,Z;function _(t){document.activeElement!==t&&(null==t||t.focus())}const G=[];function J(t){const e=t.target,n=null==e?void 0:e.closest("button");let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=G[G.length-1];if(!o)return;const s=!e.closest(`#${o.getAttribute("id")}`);n?(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(G.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(G.pop(),o.close(!0))):s&&(G.pop(),o.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),V.add(this),z.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=k(this,V,"a",U))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",k(this,z,"f").signal.aborted&&x(this,z,new AbortController,"f"),K(this,void 0,k(this,z,"f").signal),G.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=k(this,V,"a",U))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",k(this,z,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));_(t?q(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",J),this.addEventListener("keydown",(t=>k(this,V,"m",Z).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}z=new WeakMap,V=new WeakSet,U=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},Z=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const Q=new WeakSet;function tt(t){it(t),nt(t)}const et=new WeakMap;function nt(t=document){if(et.has(t))return et.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)rt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&it(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,et.delete(t),n.disconnect()}};return et.set(t,i),i}function it(t){for(const e of t.querySelectorAll("[data-action]"))rt(e);t instanceof Element&&t.hasAttribute("data-action")&&rt(t)}function ot(t){const e=t.currentTarget;for(const n of st(e))if(t.type===n.type){const i=e.closest(n.tag);Q.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Q.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*st(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function rt(t){for(const e of st(t))t.addEventListener(e.type,ot)}const at=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),lt=(t,e="property")=>{const n=at(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const ct="attr",ut=new WeakSet;function dt(t,e){if(ut.has(t))return;ut.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=mt(n,ct));for(const n of e){const e=t[n],o=lt(`${i}${n}`);let s={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(o)&&s.set.call(t,e)}}const ht=Symbol.for("catalyst");class ft{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const i=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,i)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,o)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>lt(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...mt(t.prototype,ct)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=at(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),dt(t),function(t){Q.add(t),t.shadowRoot&&tt(t.shadowRoot),it(t),nt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&tt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){dt(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function mt(t,e){if(!Object.prototype.hasOwnProperty.call(t,ht)){const e=t[ht],n=t[ht]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[ht];return n.has(e)||n.set(e,new Set),n.get(e)}function pt(t,e){mt(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase();if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!i.closest(n))return i;for(const i of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(i.closest(n)===t)return i}(this,e)}})}function bt(t,e){mt(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),i=[];if(t.shadowRoot)for(const o of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)||i.push(o);for(const o of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)===t&&i.push(o);return i}(this,e)}})}function gt(t){new ft(t)}new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)}));let wt=class NavListElement extends HTMLElement{connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=this.parseHTML(document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(o,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}parseHTML(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}};var vt,Et;M([pt],wt.prototype,"list",void 0),M([pt],wt.prototype,"showMoreItem",void 0),M([bt],wt.prototype,"focusMarkers",void 0),wt=M([gt],wt);let yt=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),vt.add(this)}connectedCallback(){k(this,vt,"m",Et).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};function At(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){let s,r=0,a=!1;function l(...c){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,c),o&&l.cancel()}),i?e-u:e))}return l.cancel=()=>{clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}vt=new WeakSet,Et=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},M([bt],yt.prototype,"items",void 0),yt=M([gt],yt),window.customElements.get("segmented-control")||(window.SegmentedControlElement=yt,window.customElements.define("segmented-control",yt));let Tt=class ToggleSwitchElement extends HTMLElement{get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}toggle(){this.isDisabled()||(this.isRemote()?(this.setLoadingState(),this.submitForm()):this.performToggle())}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}setSuccessState(){this.setFinishedState(!1)}setErrorState(){this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden"),this.enable()}async submitForm(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"0":"1");try{if(!this.src)throw new Error("invalid src");(await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})).ok?(this.setSuccessState(),this.performToggle()):this.setErrorState()}catch(t){this.setErrorState()}}};var Mt,kt,xt,Lt,Ct,St,It,Dt,Ht;M([pt],Tt.prototype,"switch",void 0),M([pt],Tt.prototype,"loadingSpinner",void 0),M([pt],Tt.prototype,"errorIcon",void 0),M([function(t=0,e={}){return(n,i,o)=>{if(!o||"function"!=typeof o.value)throw new Error("debounce can only decorate functions");const s=o.value;o.value=At(s,t,e),Object.defineProperty(n,i,o)}}(300)],Tt.prototype,"submitForm",null),Tt=M([gt],Tt),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Tt,window.customElements.define("toggle-switch",Tt));const Rt="tooltip-open",Ot="sr-only",Ft=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),kt.set(this,void 0),xt.set(this,"center"),Lt.set(this,"outside-bottom"),Ct.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){this.classList.toggle(Ot,t),this.isConnected&&k(this,Mt,"m",St).call(this)}get hiddenFromView(){return this.classList.contains(Ot)}connectedCallback(){var t;if(k(this,Mt,"m",It).call(this),k(this,Mt,"m",Dt).call(this),!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hiddenFromView=!0,x(this,Ct,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=k(this,kt,"f"))||void 0===t||t.abort(),x(this,kt,new AbortController,"f");const{signal:e}=k(this,kt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),k(this,Mt,"m",St).call(this)}disconnectedCallback(){var t;null===(t=k(this,kt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?k(this,Mt,"m",It).call(this):"data-direction"===t&&k(this,Mt,"m",Dt).call(this))}}kt=new WeakMap,xt=new WeakMap,Lt=new WeakMap,Ct=new WeakMap,Mt=new WeakSet,St=function(){if(this.hiddenFromView)this.classList.remove(Rt,...Ft);else{this.classList.add(Rt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);k(this,Mt,"m",Ht).call(this)}},It=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Dt=function(){this.classList.remove(...Ft);const t=this.direction;"n"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-top","f")):"ne"===t?(x(this,xt,"start","f"),x(this,Lt,"outside-top","f")):"e"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-right","f")):"se"===t?(x(this,xt,"start","f"),x(this,Lt,"outside-bottom","f")):"s"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-bottom","f")):"sw"===t?(x(this,xt,"end","f"),x(this,Lt,"outside-bottom","f")):"w"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-left","f")):"nw"===t&&(x(this,xt,"end","f"),x(this,Lt,"outside-top","f"))},Ht=function(){if(!this.control)return;if(!k(this,Ct,"f")||this.hiddenFromView)return;this.style.left="0px";const t=S(this,this.control,{side:k(this,Lt,"f"),align:k(this,xt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let Pt=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};M([pt],Pt.prototype,"titleText",void 0),Pt=M([gt],Pt),window.customElements.get("x-banner")||(window.XBannerElement=Pt,window.customElements.define("x-banner",Pt));const $t=!!navigator.userAgent.match(/Macintosh/);class qt{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!$t&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":$t&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":$t&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Nt)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Nt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Wt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Wt),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let o=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(o=e)}const s=n[o];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Bt(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function Nt(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function Wt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Bt(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const Yt=window.testScreenReaderDelay||100;class jt{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new qt(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(o=this.clearButton)||void 0===o||o.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),Yt)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class Xt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Kt=new WeakMap;function Vt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Kt.get(t);n&&n.abort();Kt.set(t,e);const i=()=>Kt.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const zt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Vt}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");zt.set(this,new jt(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=zt.get(this);t&&(t.destroy(),zt.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=zt.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new Xt("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function Ut(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function Zt(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),Ut(n),e.removeChild(n),Promise.resolve()}function _t(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Zt(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?Zt(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Zt(o.href):Ut(o)).then(i)}var o}function Gt(t){const e=t.currentTarget;e instanceof HTMLElement&&_t(e)}function Jt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),_t(e))}}function Qt(t){t.currentTarget.addEventListener("keydown",Jt)}function te(t){t.currentTarget.removeEventListener("keydown",Jt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Gt),this.addEventListener("focus",Qt),this.addEventListener("blur",te)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function ee(t){t.style.display="inline-block"}function ne(t){t.style.display="none"}const ie=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ie.get(t);e?(clearTimeout(e),ie.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ne(e),ee(n))}(t),ie.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ee(e),ne(n))}(t),ie.delete(t)}),2e3))}));const oe=["second","minute","hour","day","month","year"];const se=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;class re{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,this.seconds=r}abs(){return new re(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds))}static from(t){var e;if("string"==typeof t){const n=String(t).trim(),i=n.startsWith("-")?-1:1,o=null===(e=n.match(se))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new re(...o):new re}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a}=t;return new re(e,n,i,o,s,r,a)}throw new RangeError("invalid duration")}}function ae(t,e,n){const i=function(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+7*e.weeks+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setSeconds(n.getSeconds()+e.seconds),n}(t,re.from(n).abs());return!i||Math.abs(Number(i)-Number(t))>Math.abs(Number(t)-Number(e))}var le,ce,ue,de,he,fe,me,pe=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},be=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const ge=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null;class we extends Event{constructor(t,e,n,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=n,this.newTitle=i}}function ve(t){if(!t.date)return 1/0;if("elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const Ee=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=ve(t),n=Date.now()+e;n<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=n)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,ve(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends ge{constructor(){super(...arguments),le.add(this),ce.set(this,!1),ue.set(this,!1),he.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","datetime","lang","title"]}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if("long"===t||"short"===t||"narrow"===t)return t}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){var t;const e=null!==(t=this.getAttribute("month"))&&void 0!==t?t:"short";if("numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e)return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("day",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,se.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return oe.includes(t)?t:"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){Ee.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&be(this,ce,null!==n&&pe(this,le,"m",fe).call(this)!==n,"f"),pe(this,ue,"f")||"title"===t&&pe(this,ce,"f")||be(this,ue,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=pe(this,he,"f").textContent||"",e=this.getAttribute("title")||"";let n=e,i=t;const o=new Date;pe(this,ce,"f")||(n=pe(this,le,"m",fe).call(this)||"",n&&this.setAttribute("title",n)),i=pe(this,le,"m",me).call(this,o)||"",i?pe(this,he,"f").textContent=i:this.shadowRoot===pe(this,he,"f")&&this.textContent&&(pe(this,he,"f").textContent=this.textContent),i===t&&n===e||this.dispatchEvent(new we(t,i,e,n));const s=this.date,r=this.format,a=("auto"===r||"micro"===r)&&s&&ae(o,s,this.threshold);"elapsed"===r||a?Ee.observe(this):Ee.unobserve(this),be(this,ue,!1,"f")}}ce=new WeakMap,ue=new WeakMap,he=new WeakMap,le=new WeakSet,de=function(){var t,e;return null!==(e=null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))&&void 0!==e?e:"default"},fe=function(){const t=this.date;if(t&&"undefined"!=typeof Intl&&Intl.DateTimeFormat)return new Intl.DateTimeFormat(pe(this,le,"a",de),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},me=function(t=new Date){const e=this.date;if(!e)return;const n=this.format;if("elapsed"===n){const t=oe.indexOf(this.precision)||0;return function(t){const e=Math.abs(t.getTime()-(new Date).getTime()),n=Math.floor(e/1e3),i=Math.floor(n/60),o=Math.floor(i/60),s=Math.floor(o/24),r=Math.floor(s/30),a=Math.floor(r/12),l=[];return a&&l.push([a,"year"]),r-12*a&&l.push([r-12*a,"month"]),s-30*r&&l.push([s-30*r,"day"]),o-24*s&&l.push([o-24*s,"hour"]),i-60*o&&l.push([i-60*o,"minute"]),n-60*i&&l.push([n-60*i,"second"]),l}(e).filter((e=>oe.indexOf(e[1])>=t)).map((([t,e])=>`${t}${e[0]}`)).join(" ")||`0${this.precision[0]}`}const i=this.tense,o="micro"===n,s=t.getTime()<e.getTime(),r=ae(t,e,this.threshold),a=pe(this,le,"a",de);if("undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const t=new Intl.RelativeTimeFormat(a,{numeric:"auto"});if("past"===i||"auto"===i&&!s&&r){const[n,i]=o?function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return i<1?[1,"minute"]:i<60?[i,"minute"]:o<24?[o,"hour"]:s<365?[s,"day"]:[a,"year"]}(e):function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return e<0||n<10?[0,"second"]:n<45?[-n,"second"]:n<90||i<45?[-i,"minute"]:i<90||o<24?[-o,"hour"]:o<36||s<30?[-s,"day"]:r<18?[-r,"month"]:[-a,"year"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}if("future"===i||"auto"===i&&s&&r){const[n,i]=o?function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return s>=365?[a,"year"]:o>=24?[s,"day"]:i>=60?[o,"hour"]:i>1?[i,"minute"]:[1,"minute"]}(e):function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return r>=18||r>=12?[a,"year"]:s>=45||s>=30?[r,"month"]:o>=36||o>=24?[s,"day"]:i>=90||i>=45?[o,"hour"]:n>=90||n>=45?[i,"minute"]:n>=10?[n,"second"]:[0,"second"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}}if("undefined"==typeof Intl||!Intl.DateTimeFormat)return;const l=new Intl.DateTimeFormat(a,{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${l.format(e)}`.trim()};const ye="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),ye.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(ye.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Ae(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Ae(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Ae(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}))}connectedCallback(){for(const t of Ae(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=Ae(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const i=e[t],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let Te=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function Me(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){var s,r=0,a=!1,l=function l(...c){if(!a){var u=Date.now()-r;r=Date.now(),n?(n=!1,t(...c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((function(){r=Date.now(),t(...c),o&&l.cancel()}),i?e-u:e))}};return l.cancel=function(){clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}M([bt],Te.prototype,"fields",void 0),Te=M([gt],Te),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Te}),window.customElements.define("primer-multi-input",Te));const ke=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=Me(Le.bind(null,this),300),n={check:e,controller:null};ke.set(this,n),t.addEventListener("input",xe),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=ke.get(this);e&&(ke.delete(this),t.removeEventListener("input",xe),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}}function xe(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,o=n.csrf,s=ke.get(n);if(!i||!o||!s)return;let r="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>r=t}})),n.required&&e.setCustomValidity(r)}async function Le(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=ke.get(t);if(!i||!o||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append(n,o),r.append("value",e.value),e.dispatchEvent(new CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const n=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});n.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(n,e,t.required):function(t,e,n){let i="Validation failed";const o=t=>i=t;e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:o}})),n&&e.setCustomValidity(i)}(n,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}var Ce;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let Se=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Ce.set(this,void 0)}connectedCallback(){var t;null===(t=k(this,Ce,"f"))||void 0===t||t.abort();const{signal:e}=x(this,Ce,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(t=>{t.detail.response.text().then((t=>{this.setError(t)}))}),{signal:e})}disconnectedCallback(){var t;null===(t=k(this,Ce,"f"))||void 0===t||t.abort()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.innerText=""}setError(t){this.validationMessageElement.innerText=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};Ce=new WeakMap,M([pt],Se.prototype,"inputElement",void 0),M([pt],Se.prototype,"validationElement",void 0),M([pt],Se.prototype,"validationMessageElement",void 0),Se=M([gt],Se)}();
1
+ !function(){"use strict";class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const s=this.parentElement;if(!s)return;const c=s.querySelector("summary");c&&(c.setAttribute("aria-haspopup","menu"),c.hasAttribute("role")||c.setAttribute("role","button"));const f=[n(s,"compositionstart",(t=>h(this,t))),n(s,"compositionend",(t=>h(this,t))),n(s,"click",(t=>l(s,t))),n(s,"change",(t=>l(s,t))),n(s,"keydown",(e=>function(e,n,i){if(!(i instanceof KeyboardEvent))return;if(e.querySelector("details[open]"))return;const o=t.get(n);if(!o||o.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":e.hasAttribute("open")&&(d(e),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case"n":if(a&&i.ctrlKey){const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"p":if(a&&i.ctrlKey){const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case" ":case"Enter":{const t=document.activeElement;t instanceof HTMLElement&&u(t)&&t.closest("details")===e&&(i.preventDefault(),i.stopPropagation(),t.click())}}}(s,this,e))),n(s,"toggle",(()=>i(s,this)),{once:!0}),n(s,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(s))),this.preload?n(s,"mouseover",(()=>i(s,this)),{once:!0}):e,...o(s)];t.set(this,{subscriptions:f,loaded:!1,isComposing:!1})}disconnectedCallback(){const e=t.get(this);if(e){t.delete(this);for(const t of e.subscriptions)t.unsubscribe()}}}const t=new WeakMap,e={unsubscribe(){}};function n(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function i(e,n){const i=n.getAttribute("src");if(!i)return;const o=t.get(n);if(!o)return;if(o.loaded)return;o.loaded=!0;const r=n.querySelector("include-fragment");r&&!r.hasAttribute("src")&&(r.addEventListener("loadend",(()=>s(e))),r.setAttribute("src",i))}function o(t){let e=!1;return[n(t,"mousedown",(()=>e=!0)),n(t,"keydown",(()=>e=!1)),n(t,"toggle",(()=>{t.hasAttribute("open")&&(s(t)||e||function(t){const e=document.activeElement;if(e&&u(e)&&t.contains(e))return;const n=r(t,!0);n&&n.focus()}(t))}))]}function s(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function r(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const a=navigator.userAgent.match(/Macintosh/);function l(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||c(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&c(e,t)}}function c(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&d(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function u(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function d(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function h(e,n){const i=t.get(e);i&&(i.isComposing="compositionstart"===n.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const f=new WeakMap,m=new WeakMap,p=new WeakMap;function b(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=p.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(m.has(e)&&t instanceof MouseEvent){const n=m.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(m.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=m.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,T(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)m.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];m.set(e,{dragStartX:n,dragStartY:i})}}function g(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return y(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,f.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=f.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=f.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&E(n,s,r,!(t instanceof KeyboardEvent))}function w(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function v(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",g),n.addEventListener("touchmove",g,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),f.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),g(t)}else n.addEventListener("mousemove",b),n.addEventListener("touchmove",b,{passive:!0})}function E(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=f.get(t);if(!s)return;const{box:r,image:a}=p.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const l=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,c=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${l}px`,r.style.top=`${c}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,T(t,{x:l,y:c,width:o,height:o})}function y(t){const{image:e}=p.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);f.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),E(t,n,n)}function A(t){const e=t.currentTarget;e instanceof ImageCropElement&&(m.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",g),e.removeEventListener("mousemove",b),e.removeEventListener("touchmove",g),e.removeEventListener("touchmove",b))}function T(t,e){const{image:n}=p.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(p.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(p.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,y(this)})),this.addEventListener("mouseleave",A),this.addEventListener("touchend",A),this.addEventListener("mouseup",A),e.addEventListener("mousedown",v),e.addEventListener("touchstart",v,{passive:!0}),this.addEventListener("keydown",b),this.addEventListener("keydown",g),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=p.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}function M(t,e,n,i){var o,s=arguments.length,r=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function k(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function x(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const C={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},L={start:["end","center"],end:["start","center"],center:["end","start"]};function S(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=F(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=C[o];let f=0;if(r){let t=o;for(;f<r.length&&P(t,u,c,n);){const o=r[f++];t=o,u=F(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=L[s];let p=0;if(m){let t=s;for(;p<m.length&&q(t,u,c,n);){const o=m[p++];t=o,u=F(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:I,a=null!==(n=t.align)&&void 0!==n?n:D;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:H,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?R:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:O}}(n))}const I="outside-bottom",D="start",H=4,R=4,O=!1;function F(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-o-t.height:"outside-bottom"===n?l=a+o:"outside-left"===n?c=e.left-o-t.width:"outside-right"===n&&(c=r+o),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?l=e.top+o:"inside-bottom"===n?l=a-o-t.height:"inside-left"===n?c=e.left+o:"inside-right"===n?c=r-o-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:l,left:c}}function P(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function q(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}function $(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?W:N,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function N(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function W(t,e=!1){return N(t,e)&&"-1"!==t.getAttribute("tabindex")}let B=!1;function Y(){}try{const t=Object.create({},{signal:{get(){B=!0}}});window.addEventListener("test",Y,t),window.removeEventListener("test",Y,t)}catch(t){}B||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,i){return"object"==typeof i&&"signal"in i&&i.signal instanceof AbortSignal&&t.call(i.signal,"abort",(()=>{this.removeEventListener(e,n,i)})),t.call(this,e,n,i)}}(),B=!0);const j=[];let X;function K(t,e,n){const i=new AbortController,o=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=$(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function l(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&W(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=$(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=$(t);null==e||e.focus()},t.prepend(s),t.append(r);const c=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(o);if(X){const t=X;X.container.setAttribute("data-focus-trap","suspended"),X.controller.abort(),j.push(t)}c.signal.addEventListener("abort",(()=>{X=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=j.findIndex((e=>e.container===t));n>=0&&j.splice(n,1),function(){const t=j.pop();t&&K(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),X={container:t,controller:c,initialFocus:e,originalSignal:o};const u=j.findIndex((e=>e.container===t));if(u>=0&&j.splice(u,1),!n)return i}var V,z,U,Z;function _(t){document.activeElement!==t&&(null==t||t.focus())}const G=[];function J(t){const e=t.target,n=null==e?void 0:e.closest("button");let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=G[G.length-1];if(!o)return;const s=!e.closest(`#${o.getAttribute("id")}`);n?(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(G.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(G.pop(),o.close(!0))):s&&(G.pop(),o.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),V.add(this),z.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=k(this,V,"a",U))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",k(this,z,"f").signal.aborted&&x(this,z,new AbortController,"f"),K(this,void 0,k(this,z,"f").signal),G.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=k(this,V,"a",U))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",k(this,z,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));_(t?$(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",J),this.addEventListener("keydown",(t=>k(this,V,"m",Z).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}z=new WeakMap,V=new WeakSet,U=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},Z=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const Q=new WeakSet;function tt(t){it(t),nt(t)}const et=new WeakMap;function nt(t=document){if(et.has(t))return et.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)rt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&it(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,et.delete(t),n.disconnect()}};return et.set(t,i),i}function it(t){for(const e of t.querySelectorAll("[data-action]"))rt(e);t instanceof Element&&t.hasAttribute("data-action")&&rt(t)}function ot(t){const e=t.currentTarget;for(const n of st(e))if(t.type===n.type){const i=e.closest(n.tag);Q.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Q.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*st(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function rt(t){for(const e of st(t))t.addEventListener(e.type,ot)}const at=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),lt=(t,e="property")=>{const n=at(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const ct="attr",ut=new WeakSet;function dt(t,e){if(ut.has(t))return;ut.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=mt(n,ct));for(const n of e){const e=t[n],o=lt(`${i}${n}`);let s={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(o)&&s.set.call(t,e)}}const ht=Symbol.for("catalyst");class ft{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const i=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,i)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,o)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>lt(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...mt(t.prototype,ct)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=at(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),dt(t),function(t){Q.add(t),t.shadowRoot&&tt(t.shadowRoot),it(t),nt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&tt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){dt(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function mt(t,e){if(!Object.prototype.hasOwnProperty.call(t,ht)){const e=t[ht],n=t[ht]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[ht];return n.has(e)||n.set(e,new Set),n.get(e)}function pt(t,e){mt(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase();if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!i.closest(n))return i;for(const i of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(i.closest(n)===t)return i}(this,e)}})}function bt(t,e){mt(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),i=[];if(t.shadowRoot)for(const o of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)||i.push(o);for(const o of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)===t&&i.push(o);return i}(this,e)}})}function gt(t){new ft(t)}new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)}));let wt=class NavListElement extends HTMLElement{connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=this.parseHTML(document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(o,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}parseHTML(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}};var vt,Et;M([pt],wt.prototype,"list",void 0),M([pt],wt.prototype,"showMoreItem",void 0),M([bt],wt.prototype,"focusMarkers",void 0),wt=M([gt],wt);let yt=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),vt.add(this)}connectedCallback(){k(this,vt,"m",Et).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};function At(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){let s,r=0,a=!1;function l(...c){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,c),o&&l.cancel()}),i?e-u:e))}return l.cancel=()=>{clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}vt=new WeakSet,Et=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},M([bt],yt.prototype,"items",void 0),yt=M([gt],yt),window.customElements.get("segmented-control")||(window.SegmentedControlElement=yt,window.customElements.define("segmented-control",yt));let Tt=class ToggleSwitchElement extends HTMLElement{get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}toggle(){this.isDisabled()||(this.isRemote()?(this.setLoadingState(),this.submitForm()):this.performToggle())}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}setSuccessState(){this.setFinishedState(!1)}setErrorState(){this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden"),this.enable()}async submitForm(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"0":"1");try{if(!this.src)throw new Error("invalid src");(await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})).ok?(this.setSuccessState(),this.performToggle()):this.setErrorState()}catch(t){this.setErrorState()}}};var Mt,kt,xt,Ct,Lt,St,It,Dt,Ht;M([pt],Tt.prototype,"switch",void 0),M([pt],Tt.prototype,"loadingSpinner",void 0),M([pt],Tt.prototype,"errorIcon",void 0),M([function(t=0,e={}){return(n,i,o)=>{if(!o||"function"!=typeof o.value)throw new Error("debounce can only decorate functions");const s=o.value;o.value=At(s,t,e),Object.defineProperty(n,i,o)}}(300)],Tt.prototype,"submitForm",null),Tt=M([gt],Tt),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Tt,window.customElements.define("toggle-switch",Tt));const Rt="tooltip-open",Ot="sr-only",Ft=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),kt.set(this,void 0),xt.set(this,"center"),Ct.set(this,"outside-bottom"),Lt.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){this.classList.toggle(Ot,t),this.isConnected&&k(this,Mt,"m",St).call(this)}get hiddenFromView(){return this.classList.contains(Ot)}connectedCallback(){var t;if(k(this,Mt,"m",It).call(this),k(this,Mt,"m",Dt).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,x(this,Lt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=k(this,kt,"f"))||void 0===t||t.abort(),x(this,kt,new AbortController,"f");const{signal:e}=k(this,kt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),k(this,Mt,"m",St).call(this)}disconnectedCallback(){var t;null===(t=k(this,kt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?k(this,Mt,"m",It).call(this):"data-direction"===t&&k(this,Mt,"m",Dt).call(this))}}kt=new WeakMap,xt=new WeakMap,Ct=new WeakMap,Lt=new WeakMap,Mt=new WeakSet,St=function(){if(this.hiddenFromView)this.classList.remove(Rt,...Ft);else{this.classList.add(Rt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);k(this,Mt,"m",Ht).call(this)}},It=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Dt=function(){this.classList.remove(...Ft);const t=this.direction;"n"===t?(x(this,xt,"center","f"),x(this,Ct,"outside-top","f")):"ne"===t?(x(this,xt,"start","f"),x(this,Ct,"outside-top","f")):"e"===t?(x(this,xt,"center","f"),x(this,Ct,"outside-right","f")):"se"===t?(x(this,xt,"start","f"),x(this,Ct,"outside-bottom","f")):"s"===t?(x(this,xt,"center","f"),x(this,Ct,"outside-bottom","f")):"sw"===t?(x(this,xt,"end","f"),x(this,Ct,"outside-bottom","f")):"w"===t?(x(this,xt,"center","f"),x(this,Ct,"outside-left","f")):"nw"===t&&(x(this,xt,"end","f"),x(this,Ct,"outside-top","f"))},Ht=function(){if(!this.control)return;if(!k(this,Lt,"f")||this.hiddenFromView)return;this.style.left="0px";const t=S(this,this.control,{side:k(this,Ct,"f"),align:k(this,xt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let Pt=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};M([pt],Pt.prototype,"titleText",void 0),Pt=M([gt],Pt),window.customElements.get("x-banner")||(window.XBannerElement=Pt,window.customElements.define("x-banner",Pt));const qt=!!navigator.userAgent.match(/Macintosh/);class $t{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!qt&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":qt&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":qt&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Nt)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Nt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Wt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Wt),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let o=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(o=e)}const s=n[o];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Bt(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function Nt(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function Wt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Bt(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const Yt=window.testScreenReaderDelay||100;class jt{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new $t(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(o=this.clearButton)||void 0===o||o.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),Yt)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class Xt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Kt=new WeakMap;function Vt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Kt.get(t);n&&n.abort();Kt.set(t,e);const i=()=>Kt.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const zt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Vt}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");zt.set(this,new jt(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=zt.get(this);t&&(t.destroy(),zt.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=zt.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new Xt("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function Ut(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function Zt(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),Ut(n),e.removeChild(n),Promise.resolve()}function _t(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Zt(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?Zt(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Zt(o.href):Ut(o)).then(i)}var o}function Gt(t){const e=t.currentTarget;e instanceof HTMLElement&&_t(e)}function Jt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),_t(e))}}function Qt(t){t.currentTarget.addEventListener("keydown",Jt)}function te(t){t.currentTarget.removeEventListener("keydown",Jt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Gt),this.addEventListener("focus",Qt),this.addEventListener("blur",te)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function ee(t){t.style.display="inline-block"}function ne(t){t.style.display="none"}const ie=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ie.get(t);e?(clearTimeout(e),ie.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ne(e),ee(n))}(t),ie.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ee(e),ne(n))}(t),ie.delete(t)}),2e3))}));const oe=["second","minute","hour","day","month","year"];const se=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;class re{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,this.seconds=r}abs(){return new re(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds))}static from(t){var e;if("string"==typeof t){const n=String(t).trim(),i=n.startsWith("-")?-1:1,o=null===(e=n.match(se))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new re(...o):new re}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a}=t;return new re(e,n,i,o,s,r,a)}throw new RangeError("invalid duration")}}function ae(t,e,n){const i=function(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+7*e.weeks+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setSeconds(n.getSeconds()+e.seconds),n}(t,re.from(n).abs());return!i||Math.abs(Number(i)-Number(t))>Math.abs(Number(t)-Number(e))}var le,ce,ue,de,he,fe,me,pe=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},be=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const ge=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null;class we extends Event{constructor(t,e,n,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=n,this.newTitle=i}}function ve(t){if(!t.date)return 1/0;if("elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const Ee=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=ve(t),n=Date.now()+e;n<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=n)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,ve(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends ge{constructor(){super(...arguments),le.add(this),ce.set(this,!1),ue.set(this,!1),he.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","datetime","lang","title"]}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if("long"===t||"short"===t||"narrow"===t)return t}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){var t;const e=null!==(t=this.getAttribute("month"))&&void 0!==t?t:"short";if("numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e)return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("day",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,se.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return oe.includes(t)?t:"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){Ee.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&be(this,ce,null!==n&&pe(this,le,"m",fe).call(this)!==n,"f"),pe(this,ue,"f")||"title"===t&&pe(this,ce,"f")||be(this,ue,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=pe(this,he,"f").textContent||"",e=this.getAttribute("title")||"";let n=e,i=t;const o=new Date;pe(this,ce,"f")||(n=pe(this,le,"m",fe).call(this)||"",n&&this.setAttribute("title",n)),i=pe(this,le,"m",me).call(this,o)||"",i?pe(this,he,"f").textContent=i:this.shadowRoot===pe(this,he,"f")&&this.textContent&&(pe(this,he,"f").textContent=this.textContent),i===t&&n===e||this.dispatchEvent(new we(t,i,e,n));const s=this.date,r=this.format,a=("auto"===r||"micro"===r)&&s&&ae(o,s,this.threshold);"elapsed"===r||a?Ee.observe(this):Ee.unobserve(this),be(this,ue,!1,"f")}}ce=new WeakMap,ue=new WeakMap,he=new WeakMap,le=new WeakSet,de=function(){var t,e;return null!==(e=null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))&&void 0!==e?e:"default"},fe=function(){const t=this.date;if(t&&"undefined"!=typeof Intl&&Intl.DateTimeFormat)return new Intl.DateTimeFormat(pe(this,le,"a",de),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},me=function(t=new Date){const e=this.date;if(!e)return;const n=this.format;if("elapsed"===n){const t=oe.indexOf(this.precision)||0;return function(t){const e=Math.abs(t.getTime()-(new Date).getTime()),n=Math.floor(e/1e3),i=Math.floor(n/60),o=Math.floor(i/60),s=Math.floor(o/24),r=Math.floor(s/30),a=Math.floor(r/12),l=[];return a&&l.push([a,"year"]),r-12*a&&l.push([r-12*a,"month"]),s-30*r&&l.push([s-30*r,"day"]),o-24*s&&l.push([o-24*s,"hour"]),i-60*o&&l.push([i-60*o,"minute"]),n-60*i&&l.push([n-60*i,"second"]),l}(e).filter((e=>oe.indexOf(e[1])>=t)).map((([t,e])=>`${t}${e[0]}`)).join(" ")||`0${this.precision[0]}`}const i=this.tense,o="micro"===n,s=t.getTime()<e.getTime(),r=ae(t,e,this.threshold),a=pe(this,le,"a",de);if("undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const t=new Intl.RelativeTimeFormat(a,{numeric:"auto"});if("past"===i||"auto"===i&&!s&&r){const[n,i]=o?function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return i<1?[1,"minute"]:i<60?[i,"minute"]:o<24?[o,"hour"]:s<365?[s,"day"]:[a,"year"]}(e):function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return e<0||n<10?[0,"second"]:n<45?[-n,"second"]:n<90||i<45?[-i,"minute"]:i<90||o<24?[-o,"hour"]:o<36||s<30?[-s,"day"]:r<18?[-r,"month"]:[-a,"year"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}if("future"===i||"auto"===i&&s&&r){const[n,i]=o?function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return s>=365?[a,"year"]:o>=24?[s,"day"]:i>=60?[o,"hour"]:i>1?[i,"minute"]:[1,"minute"]}(e):function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return r>=18||r>=12?[a,"year"]:s>=45||s>=30?[r,"month"]:o>=36||o>=24?[s,"day"]:i>=90||i>=45?[o,"hour"]:n>=90||n>=45?[i,"minute"]:n>=10?[n,"second"]:[0,"second"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}}if("undefined"==typeof Intl||!Intl.DateTimeFormat)return;const l=new Intl.DateTimeFormat(a,{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${l.format(e)}`.trim()};const ye="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),ye.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(ye.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Ae(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Ae(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Ae(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}))}connectedCallback(){for(const t of Ae(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=Ae(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const i=e[t],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let Te=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function Me(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){var s,r=0,a=!1,l=function l(...c){if(!a){var u=Date.now()-r;r=Date.now(),n?(n=!1,t(...c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((function(){r=Date.now(),t(...c),o&&l.cancel()}),i?e-u:e))}};return l.cancel=function(){clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}M([bt],Te.prototype,"fields",void 0),Te=M([gt],Te),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Te}),window.customElements.define("primer-multi-input",Te));const ke=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=Me(Ce.bind(null,this),300),n={check:e,controller:null};ke.set(this,n),t.addEventListener("input",xe),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=ke.get(this);e&&(ke.delete(this),t.removeEventListener("input",xe),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}}function xe(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,o=n.csrf,s=ke.get(n);if(!i||!o||!s)return;let r="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>r=t}})),n.required&&e.setCustomValidity(r)}async function Ce(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=ke.get(t);if(!i||!o||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append(n,o),r.append("value",e.value),e.dispatchEvent(new CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const n=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});n.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(n,e,t.required):function(t,e,n){let i="Validation failed";const o=t=>i=t;e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:o}})),n&&e.setCustomValidity(i)}(n,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}var Le;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let Se=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Le.set(this,void 0)}connectedCallback(){var t;null===(t=k(this,Le,"f"))||void 0===t||t.abort();const{signal:e}=x(this,Le,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(t=>{t.detail.response.text().then((t=>{this.setError(t)}))}),{signal:e})}disconnectedCallback(){var t;null===(t=k(this,Le,"f"))||void 0===t||t.abort()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.innerText=""}setError(t){this.validationMessageElement.innerText=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};Le=new WeakMap,M([pt],Se.prototype,"inputElement",void 0),M([pt],Se.prototype,"validationElement",void 0),M([pt],Se.prototype,"validationMessageElement",void 0),Se=M([gt],Se)}();
2
2
  //# sourceMappingURL=primer_view_components.js.map