primer_view_components 0.0.114 → 0.0.115
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +2 -2
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/divider.rb +2 -0
- data/app/components/primer/alpha/action_list/heading.rb +2 -0
- data/app/components/primer/alpha/action_list/item.rb +8 -6
- data/app/components/primer/alpha/action_list.rb +1 -0
- data/app/components/primer/alpha/auto_complete/auto_complete.html.erb +1 -1
- data/app/components/primer/alpha/auto_complete/item.rb +1 -0
- data/app/components/primer/alpha/auto_complete.rb +3 -2
- data/app/components/primer/alpha/banner.html.erb +1 -1
- data/app/components/primer/alpha/banner.rb +1 -0
- data/app/components/primer/alpha/button_marketing.rb +2 -0
- data/app/components/primer/alpha/dialog.rb +3 -0
- data/app/components/primer/alpha/image.rb +1 -0
- data/app/components/primer/alpha/image_crop.html.erb +1 -1
- data/app/components/primer/alpha/layout.css +1 -0
- data/app/components/primer/alpha/layout.css.json +1 -0
- data/app/components/primer/alpha/layout.css.map +1 -0
- data/app/components/primer/alpha/layout.pcss +268 -0
- data/app/components/primer/{menu_component.css → alpha/menu.css} +0 -0
- data/app/components/primer/alpha/menu.css.json +1 -0
- data/app/components/primer/alpha/menu.css.map +1 -0
- data/app/components/primer/{menu_component.html.erb → alpha/menu.html.erb} +0 -0
- data/app/components/primer/{menu_component.pcss → alpha/menu.pcss} +0 -0
- data/app/components/primer/alpha/menu.rb +76 -0
- data/app/components/primer/{octicon_symbols_component.html.erb → alpha/octicon_symbols.html.erb} +0 -0
- data/app/components/primer/alpha/octicon_symbols.rb +61 -0
- data/app/components/primer/alpha/text_field.rb +1 -0
- data/app/components/primer/alpha/toggle_switch.html.erb +2 -2
- data/app/components/primer/alpha/toggle_switch.rb +2 -0
- data/app/components/primer/alpha/tool_tip.js +77 -69
- data/app/components/primer/alpha/tool_tip.ts +63 -51
- data/app/components/primer/alpha/tooltip.rb +2 -0
- data/app/components/primer/beta/auto_complete/item.rb +4 -4
- data/app/components/primer/beta/auto_complete.rb +3 -3
- data/app/components/primer/beta/avatar.rb +1 -0
- data/app/components/primer/beta/base_button.rb +1 -0
- data/app/components/primer/beta/blankslate.rb +5 -5
- data/app/components/primer/beta/button.rb +7 -7
- data/app/components/primer/beta/clipboard_copy.html.erb +2 -2
- data/app/components/primer/beta/clipboard_copy.rb +1 -0
- data/app/components/primer/beta/close_button.rb +2 -1
- data/app/components/primer/beta/counter.rb +1 -0
- data/app/components/primer/beta/heading.rb +1 -0
- data/app/components/primer/beta/icon_button.html.erb +1 -1
- data/app/components/primer/beta/icon_button.rb +1 -0
- data/app/components/primer/beta/label.rb +1 -0
- data/app/components/primer/beta/markdown.rb +1 -0
- data/app/components/primer/{octicon_component.html.erb → beta/octicon.html.erb} +0 -0
- data/app/components/primer/beta/octicon.rb +88 -0
- data/app/components/primer/beta/relative_time.rb +2 -1
- data/app/components/primer/{spinner_component.html.erb → beta/spinner.html.erb} +0 -0
- data/app/components/primer/beta/spinner.rb +46 -0
- data/app/components/primer/beta/text.rb +1 -0
- data/app/components/primer/blankslate_component.rb +3 -3
- data/app/components/primer/box.rb +1 -0
- data/app/components/primer/button_component.rb +3 -3
- data/app/components/primer/conditional_wrapper.rb +2 -0
- data/app/components/primer/hellip_button.rb +2 -0
- data/app/components/primer/icon_button.html.erb +2 -2
- data/app/components/primer/icon_button.rb +1 -0
- data/app/components/primer/layout_component.rb +2 -0
- data/app/components/primer/local_time.rb +3 -0
- data/app/components/primer/menu_component.rb +2 -69
- data/app/components/primer/navigation/tab_component.rb +2 -2
- data/app/components/primer/octicon_component.rb +3 -81
- data/app/components/primer/octicon_symbols_component.rb +2 -52
- data/app/components/primer/primer.d.ts +2 -0
- data/app/components/primer/primer.js +2 -0
- data/app/components/primer/primer.pcss +2 -1
- data/app/components/primer/primer.ts +2 -0
- data/app/components/primer/spinner_component.rb +2 -38
- data/app/components/primer/state_component.rb +1 -0
- data/app/components/primer/subhead_component.rb +2 -0
- data/app/components/primer/tab_container_component.rb +2 -0
- data/app/components/primer/time_ago_component.rb +2 -1
- data/app/components/primer/timeline_item_component.rb +3 -2
- data/app/components/primer/tooltip.rb +1 -0
- data/app/components/primer/truncate.rb +2 -0
- data/app/forms/immediate_validation_form.rb +29 -0
- data/app/forms/multi_input_form.rb +4 -2
- data/app/lib/primer/css/layout.css +1 -378
- data/app/lib/primer/css/layout.css.json +1 -1
- data/app/lib/primer/octicon/cache.rb +1 -1
- data/app/lib/primer/view_helper.rb +1 -1
- data/lib/primer/deprecations.yml +26 -0
- data/lib/primer/forms/builder.rb +48 -8
- data/lib/primer/forms/check_box.html.erb +3 -1
- data/lib/primer/forms/dsl/input.rb +23 -1
- data/lib/primer/forms/dsl/multi_input.rb +6 -9
- data/lib/primer/forms/dsl/select_list_input.rb +1 -1
- data/lib/primer/forms/dsl/text_field_input.rb +31 -1
- data/lib/primer/forms/form_control.html.erb +17 -13
- data/lib/primer/forms/form_control.rb +2 -0
- data/lib/primer/forms/multi.html.erb +6 -2
- data/lib/primer/forms/primer_multi_input.d.ts +10 -0
- data/lib/primer/forms/primer_multi_input.js +45 -0
- data/lib/primer/forms/primer_multi_input.ts +46 -0
- data/lib/primer/forms/primer_text_field.d.ts +1 -0
- data/lib/primer/forms/primer_text_field.js +62 -0
- data/lib/primer/forms/primer_text_field.ts +48 -0
- data/lib/primer/forms/radio_button.html.erb +3 -1
- data/lib/primer/forms/text_field.html.erb +8 -8
- data/lib/primer/forms/text_field.rb +11 -0
- data/lib/primer/view_components/linters/close_button_component_migration_counter.rb +1 -1
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/tasks/docs.rake +5 -5
- data/lib/tasks/helpers/ast_traverser.rb +1 -1
- data/previews/primer/alpha/action_list_preview.rb +1 -1
- data/previews/primer/alpha/auto_complete_preview.rb +62 -6
- data/previews/primer/alpha/layout_preview.rb +179 -6
- data/previews/primer/{menu_component_preview → alpha/menu_preview}/default.html.erb +3 -3
- data/previews/primer/{menu_component_preview → alpha/menu_preview}/playground.html.erb +3 -3
- data/previews/primer/alpha/menu_preview.rb +14 -0
- data/previews/primer/alpha/toggle_switch_preview.rb +11 -9
- data/previews/primer/beta/auto_complete_preview/with_submit_button.html.erb +1 -1
- data/previews/primer/beta/auto_complete_preview.rb +19 -17
- data/previews/primer/beta/octicon_preview.rb +24 -0
- data/previews/primer/beta/spinner_preview.rb +22 -0
- data/previews/primer/forms/forms_preview/immediate_validation_form.html.erb +3 -0
- data/previews/primer/forms/forms_preview/multi_input_form.html.erb +12 -1
- data/previews/primer/forms/forms_preview.rb +2 -0
- data/previews/primer/url_helpers.rb +15 -0
- data/static/arguments.json +159 -159
- data/static/audited_at.json +4 -0
- data/static/constants.json +42 -34
- data/static/statuses.json +10 -6
- metadata +32 -15
- data/app/components/primer/menu_component.css.json +0 -1
- data/app/components/primer/menu_component.css.map +0 -1
- data/previews/primer/menu_component_preview.rb +0 -12
- data/previews/primer/octicon_component_preview.rb +0 -22
- data/previews/primer/spinner_component_preview.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1785857bc93df04d2b612775df1519c638efd7519c3cae153181ff65ba1f31b6
|
4
|
+
data.tar.gz: ebee215e61a5ba0bf24f8fa85418b10388889bf486a5d283bb355f06bfef34b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3c835c34e3b69517c8dea98fb63410fbc2545be8be7ac600ac136dc0d32d955f2c690670c29a2b8c6e622c057190324b1b7e82a272cc15a9176ee9e545f80c3
|
7
|
+
data.tar.gz: b60440cac8f1f1c8bb35791cf642522b9bb62f26594686be3f0c6cf7e18ec6f396f79d620b265a823e192ea27623a126cb2e2594a22a90e27fb400aac2cbd8c8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 0.0.115
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#1670](https://github.com/primer/view_components/pull/1670) [`217db072`](https://github.com/primer/view_components/commit/217db07287d7383155051eba8c496d9a9636c54c) Thanks [@simurai](https://github.com/simurai)! - Move `Layout` styles to PVC
|
8
|
+
|
9
|
+
* [#1667](https://github.com/primer/view_components/pull/1667) [`ee7f476d`](https://github.com/primer/view_components/commit/ee7f476dd13b58e1c38538950780493b97142c8b) Thanks [@camertron](https://github.com/camertron)! - Make multi input a form control
|
10
|
+
|
11
|
+
- [#1672](https://github.com/primer/view_components/pull/1672) [`1a7daddb`](https://github.com/primer/view_components/commit/1a7daddb62cfb01825f09a9edb5310c0d9e44e07) Thanks [@neall](https://github.com/neall)! - Add auto_check_src option to forms framework text fields to run server-side validation on field change
|
12
|
+
|
13
|
+
* [#1698](https://github.com/primer/view_components/pull/1698) [`29a5415e`](https://github.com/primer/view_components/commit/29a5415ecb6810d79abd135a32e9d63076c7a8c1) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::SpinnerComponent` to `Primer::Beta::Spinner`
|
14
|
+
|
15
|
+
- [#1697](https://github.com/primer/view_components/pull/1697) [`4ff75a58`](https://github.com/primer/view_components/commit/4ff75a58b5daa94c9e24fc0cf2723a5a6750f4fe) Thanks [@joelhawksley](https://github.com/joelhawksley)! - ActionList, Alpha::AutoComplete, Banner, and Alpha::Dialog use new "with\_\*" Slots API.
|
16
|
+
|
17
|
+
* [#1696](https://github.com/primer/view_components/pull/1696) [`d709bae1`](https://github.com/primer/view_components/commit/d709bae13ad0ff907b20b0471cbcb847daf3724a) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Moving `Primer::OcticonSymbolsComponent` to `Primer::Alpha::OcticonSymbols`, and deprecating the original
|
18
|
+
|
19
|
+
- [#1694](https://github.com/primer/view_components/pull/1694) [`b1fc5dfd`](https://github.com/primer/view_components/commit/b1fc5dfd591c4ebcb16469003c5aff4eb115b485) Thanks [@camertron](https://github.com/camertron)! - Fix sass variable in layout.pcss
|
20
|
+
|
21
|
+
* [#1687](https://github.com/primer/view_components/pull/1687) [`a5b6f02e`](https://github.com/primer/view_components/commit/a5b6f02e32e6fa05005a57cc82a0682b5bcd2351) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Deprecate Primer::LocalTime in favor of Primer::RelativeTime
|
22
|
+
|
23
|
+
- [#1692](https://github.com/primer/view_components/pull/1692) [`f50c77fe`](https://github.com/primer/view_components/commit/f50c77fe215240a70d9355180fdddf17a2daae24) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Deprecating Primer::TimeAgo in favor of Primer::RelativeTime, and adding a migration guide
|
24
|
+
|
25
|
+
* [#1690](https://github.com/primer/view_components/pull/1690) [`c1845c65`](https://github.com/primer/view_components/commit/c1845c65c3d7aaae3abb31f9846279783734974e) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Move `Primer::Beta::Octicon` to `Primer::Beta::Octicon` and deprecate the original
|
26
|
+
|
27
|
+
- [#1688](https://github.com/primer/view_components/pull/1688) [`988077aa`](https://github.com/primer/view_components/commit/988077aae27c11fc270e1e9302498b2d2cd1113c) Thanks [@manuelpuyol](https://github.com/manuelpuyol)! - Fix tooltips not adding aria attributes when Turbo navigating
|
28
|
+
|
29
|
+
* [#1691](https://github.com/primer/view_components/pull/1691) [`ab416be9`](https://github.com/primer/view_components/commit/ab416be957c4c48f0073c2d8a1c1218ea7f9c3d5) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Start migration to new slots API. You may see warnings for using the non-`with_` slot setter API.
|
30
|
+
|
31
|
+
- [#1682](https://github.com/primer/view_components/pull/1682) [`e5144a38`](https://github.com/primer/view_components/commit/e5144a3867ee10a37c8662a27d2cb85711aae8ad) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Moving `Primer::MenuComponent` to `Primer::Alpha::Menu` and deprecating the original
|
32
|
+
|
33
|
+
* [#1693](https://github.com/primer/view_components/pull/1693) [`219f5ef4`](https://github.com/primer/view_components/commit/219f5ef4844523f388843b612f23909484cb881a) Thanks [@camertron](https://github.com/camertron)! - Use URL helpers in previews that interact with the server-side
|
34
|
+
|
35
|
+
- [#1701](https://github.com/primer/view_components/pull/1701) [`2c73c2f7`](https://github.com/primer/view_components/commit/2c73c2f7fbfa142da67e5c1044bc1c2cdfa50891) Thanks [@camertron](https://github.com/camertron)! - Properly scope Lookbook routes
|
36
|
+
|
37
|
+
* [#1695](https://github.com/primer/view_components/pull/1695) [`7a881bf5`](https://github.com/primer/view_components/commit/7a881bf5a50720bc630c66a903256445aeb14a3e) Thanks [@simurai](https://github.com/simurai)! - Remove `forms.css` import for Lookbook
|
38
|
+
|
3
39
|
## 0.0.114
|
4
40
|
|
5
41
|
### 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,p=new WeakMap,m=new WeakMap;function b(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=m.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(p.has(e)&&t instanceof MouseEvent){const n=p.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(p.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=p.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)p.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];p.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}=m.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return E(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&&y(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}=m.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 y(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}=m.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 E(t){const{image:e}=m.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}),y(t,n,n)}function A(t){const e=t.currentTarget;e instanceof ImageCropElement&&(p.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}=m.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(m.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&&(m.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,E(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}=m.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 x(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 L(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 k={"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"]},S={start:["end","center"],end:["start","center"],center:["end","start"]};function C(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=$(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=k[o];let f=0;if(r){let t=o;for(;f<r.length&&F(t,u,c,n);){const o=r[f++];t=o,u=$(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const p=S[s];let m=0;if(p){let t=s;for(;m<p.length&&P(t,u,c,n);){const o=p[m++];t=o,u=$(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 $(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 F(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 P(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 N(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?q:W,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 W(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 q(t,e=!1){return W(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 X=[];let j;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=N(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&&q(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=N(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=N(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(j){const t=j;j.container.setAttribute("data-focus-trap","suspended"),j.controller.abort(),X.push(t)}c.signal.addEventListener("abort",(()=>{j=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=X.findIndex((e=>e.container===t));n>=0&&X.splice(n,1),function(){const t=X.pop();t&&K(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),j={container:t,controller:c,initialFocus:e,originalSignal:o};const u=X.findIndex((e=>e.container===t));if(u>=0&&X.splice(u,1),!n)return i}var z,U,V,Z;function G(t){document.activeElement!==t&&(null==t||t.focus())}const _=[];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=_[_.length-1];if(!o)return;const s=!e.closest(`#${o.getAttribute("id")}`);n?(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(_.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(_.pop(),o.close(!0))):s&&(_.pop(),o.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),z.add(this),U.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=x(this,z,"a",V))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",x(this,U,"f").signal.aborted&&L(this,U,new AbortController,"f"),K(this,void 0,x(this,U,"f").signal),_.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=x(this,z,"a",V))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",x(this,U,"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"));G(t?N(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=>x(this,z,"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}}U=new WeakMap,z=new WeakSet,V=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=pt(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:()=>[...pt(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 pt(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 mt(t,e){pt(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){pt(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,yt;M([mt],wt.prototype,"list",void 0),M([mt],wt.prototype,"showMoreItem",void 0),M([bt],wt.prototype,"focusMarkers",void 0),wt=M([gt],wt);let Et=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),vt.add(this)}connectedCallback(){x(this,vt,"m",yt).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,yt=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},M([bt],Et.prototype,"items",void 0),Et=M([gt],Et),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Et,window.customElements.define("segmented-control",Et));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,xt,Lt,kt,St,Ct,It;M([mt],Tt.prototype,"switch",void 0),M([mt],Tt.prototype,"loadingSpinner",void 0),M([mt],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 Dt="tooltip-open",Ht="sr-only",Rt=["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),xt.set(this,void 0),Lt.set(this,"center"),kt.set(this,"outside-bottom"),St.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(Ht,t),this.isConnected&&x(this,Mt,"m",Ct).call(this)}get hiddenFromView(){return this.classList.contains(Ht)}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hiddenFromView=!0,L(this,St,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=x(this,xt,"f"))||void 0===t||t.abort(),L(this,xt,new AbortController,"f");const{signal:e}=x(this,xt,"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}),x(this,Mt,"m",Ct).call(this)}disconnectedCallback(){var t;null===(t=x(this,xt,"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){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;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)}}else if("data-direction"===t){this.classList.remove(...Rt);const t=this.direction;"n"===t?(L(this,Lt,"center","f"),L(this,kt,"outside-top","f")):"ne"===t?(L(this,Lt,"start","f"),L(this,kt,"outside-top","f")):"e"===t?(L(this,Lt,"center","f"),L(this,kt,"outside-right","f")):"se"===t?(L(this,Lt,"start","f"),L(this,kt,"outside-bottom","f")):"s"===t?(L(this,Lt,"center","f"),L(this,kt,"outside-bottom","f")):"sw"===t?(L(this,Lt,"end","f"),L(this,kt,"outside-bottom","f")):"w"===t?(L(this,Lt,"center","f"),L(this,kt,"outside-left","f")):"nw"===t&&(L(this,Lt,"end","f"),L(this,kt,"outside-top","f"))}}}xt=new WeakMap,Lt=new WeakMap,kt=new WeakMap,St=new WeakMap,Mt=new WeakSet,Ct=function(){if(this.hiddenFromView)this.classList.remove(Dt,...Rt);else{this.classList.add(Dt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);x(this,Mt,"m",It).call(this)}},It=function(){if(!this.control)return;if(!x(this,St,"f")||this.hiddenFromView)return;this.style.left="0px";const t=C(this,this.control,{side:x(this,kt,"f"),align:x(this,Lt,"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 Ot=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([mt],Ot.prototype,"titleText",void 0),Ot=M([gt],Ot),window.customElements.get("x-banner")||(window.XBannerElement=Ot,window.customElements.define("x-banner",Ot));const $t=!!navigator.userAgent.match(/Macintosh/);class Ft{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",Pt)}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",Pt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Nt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Nt),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"),Wt(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 Pt(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 Nt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Wt(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 qt=window.testScreenReaderDelay||100;class Bt{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new Ft(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)}),qt)}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 Yt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Xt=new WeakMap;function jt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Xt.get(t);n&&n.abort();Xt.set(t,e);const i=()=>Xt.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 Kt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=jt}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");Kt.set(this,new Bt(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=Kt.get(this);t&&(t.destroy(),Kt.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=Kt.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 Yt("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function zt(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 Ut(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),zt(n),e.removeChild(n),Promise.resolve()}function Vt(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Ut(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?Ut(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Ut(o.href):zt(o)).then(i)}var o}function Zt(t){const e=t.currentTarget;e instanceof HTMLElement&&Vt(e)}function Gt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Vt(e))}}function _t(t){t.currentTarget.addEventListener("keydown",Gt)}function Jt(t){t.currentTarget.removeEventListener("keydown",Gt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Zt),this.addEventListener("focus",_t),this.addEventListener("blur",Jt)}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 Qt(t){t.style.display="inline-block"}function te(t){t.style.display="none"}const ee=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ee.get(t);e?(clearTimeout(e),ee.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(te(e),Qt(n))}(t),ee.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Qt(e),te(n))}(t),ee.delete(t)}),2e3))}));const ne=["second","minute","hour","day","month","year"];const ie=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;class oe{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 oe(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(ie))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new oe(...o):new oe}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a}=t;return new oe(e,n,i,o,s,r,a)}throw new RangeError("invalid duration")}}function se(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,oe.from(n).abs());return!i||Math.abs(Number(i)-Number(t))>Math.abs(Number(t)-Number(e))}var re,ae,le,ce,ue,de,he,fe=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)},pe=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 me=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null;class be 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 ge(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 we=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=ge(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,ge(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends me{constructor(){super(...arguments),re.add(this),ae.set(this,!1),le.set(this,!1),ue.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,ie.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 ne.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(){we.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&pe(this,ae,null!==n&&fe(this,re,"m",de).call(this)!==n,"f"),fe(this,le,"f")||"title"===t&&fe(this,ae,"f")||pe(this,le,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=fe(this,ue,"f").textContent||"",e=this.getAttribute("title")||"";let n=e,i=t;const o=new Date;fe(this,ae,"f")||(n=fe(this,re,"m",de).call(this)||"",n&&this.setAttribute("title",n)),i=fe(this,re,"m",he).call(this,o)||"",i?fe(this,ue,"f").textContent=i:this.shadowRoot===fe(this,ue,"f")&&this.textContent&&(fe(this,ue,"f").textContent=this.textContent),i===t&&n===e||this.dispatchEvent(new be(t,i,e,n));const s=this.date,r=this.format,a=("auto"===r||"micro"===r)&&s&&se(o,s,this.threshold);"elapsed"===r||a?we.observe(this):we.unobserve(this),pe(this,le,!1,"f")}}ae=new WeakMap,le=new WeakMap,ue=new WeakMap,re=new WeakSet,ce=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"},de=function(){const t=this.date;if(t&&"undefined"!=typeof Intl&&Intl.DateTimeFormat)return new Intl.DateTimeFormat(fe(this,re,"a",ce),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},he=function(t=new Date){const e=this.date;if(!e)return;const n=this.format;if("elapsed"===n){const t=ne.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=>ne.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=se(t,e,this.threshold),a=fe(this,re,"a",ce);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 ve="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),ve.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(ve.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function ye(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=ye(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=ye(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 ye(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=ye(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))}();
|
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)}();
|
2
2
|
//# sourceMappingURL=primer_view_components.js.map
|