primer_view_components 0.0.102 → 0.0.103

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/modal_dialog.d.ts +1 -1
  8. data/app/components/primer/alpha/modal_dialog.js +48 -40
  9. data/app/components/primer/alpha/modal_dialog.ts +55 -47
  10. data/app/components/primer/alpha/nav_list.js +3 -3
  11. data/app/components/primer/alpha/nav_list.ts +3 -3
  12. data/app/components/primer/beta/button.html.erb +1 -1
  13. data/app/forms/after_content_form/after_content.html.erb +1 -0
  14. data/app/forms/after_content_form.rb +13 -0
  15. data/app/forms/application_form.rb +5 -0
  16. data/app/forms/array_check_box_group_form/places_lopez_caption.html.erb +1 -0
  17. data/app/forms/array_check_box_group_form.rb +15 -0
  18. data/app/forms/both_types_of_caption_form/first_name_caption.html.erb +1 -0
  19. data/app/forms/both_types_of_caption_form.rb +13 -0
  20. data/app/forms/caption_template_form/age_middle_aged_caption.html.erb +1 -0
  21. data/app/forms/caption_template_form/age_young_caption.html.erb +1 -0
  22. data/app/forms/caption_template_form/cool_caption.html.erb +1 -0
  23. data/app/forms/caption_template_form/first_name_caption.html.erb +1 -0
  24. data/app/forms/caption_template_form.rb +22 -0
  25. data/app/forms/check_box_group_form.rb +28 -0
  26. data/app/forms/composed_form.rb +14 -0
  27. data/app/forms/first_name_form.rb +13 -0
  28. data/app/forms/horizontal_form.rb +34 -0
  29. data/app/forms/invalid_form.rb +21 -0
  30. data/app/forms/last_name_form.rb +13 -0
  31. data/app/forms/multi_input_form.rb +25 -0
  32. data/app/forms/multi_text_field_form.rb +27 -0
  33. data/app/forms/radio_button_group_form.rb +12 -0
  34. data/app/forms/radio_button_with_nested_form.rb +39 -0
  35. data/app/forms/select_list_form.rb +12 -0
  36. data/app/forms/single_text_field_form.rb +13 -0
  37. data/app/forms/submit_button_form.rb +20 -0
  38. data/app/forms/text_field_and_checkbox_form.rb +19 -0
  39. data/lib/primer/deprecations.rb +0 -4
  40. data/lib/primer/view_components/engine.rb +1 -0
  41. data/lib/primer/view_components/linters/close_button_component_migration_counter.rb +1 -1
  42. data/lib/primer/view_components/version.rb +1 -1
  43. data/lib/tasks/docs.rake +1 -1
  44. data/lib/tasks/test.rake +14 -12
  45. data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +14 -0
  46. data/previews/primer/alpha/dialog_preview.rb +15 -0
  47. data/static/audited_at.json +0 -4
  48. data/static/constants.json +0 -8
  49. data/static/statuses.json +0 -4
  50. metadata +34 -15
  51. data/app/components/primer/alpha/tool-tip-element.d.ts +0 -23
  52. data/app/components/primer/alpha/tool-tip-element.js +0 -352
  53. data/app/components/primer/clipboard_copy_component.d.ts +0 -1
  54. data/app/components/primer/clipboard_copy_component.js +0 -43
  55. data/app/components/primer/close_button.rb +0 -7
  56. data/app/components/primer/details_component.rb +0 -7
  57. data/app/components/primer/heading_component.rb +0 -7
  58. data/app/components/primer/hidden_text_expander.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f27e3a4f85d45b88c5c3ce82b5e0afaa1803af624281fb383452b7c7520cce1e
4
- data.tar.gz: 88e68e81b1b8bed97be9a5053fcab55ae14713af2a2887186170827cb87e1104
3
+ metadata.gz: d23491c7ef0dc8a01b4679c68eac52297290581d1096db81e14ede3170b4a50e
4
+ data.tar.gz: 74000e82e9fcb1dbff9c3a5a630f2542efe667ea5d87698d348b673a1f2b737e
5
5
  SHA512:
6
- metadata.gz: 49ac0e15e841790e5622d3a29da54c83374a531c8ae5a9398db05242ef2b49d10356ee0484ca6d0d32f2a4e17ff31b988b04caecf0ddc774b6b22af315e8a244
7
- data.tar.gz: 18343a04980da7c1ff7841e3cf19d5b380f128781c1478637043bcb7e0a501f64570f72d07cdea1d6be7314ea113df72a2e8c333d7c67bf3788af1dfd297f6b9
6
+ metadata.gz: b6aa3e70da7613f92c0f813215f8fe8b164b07c78beee1bfe9f69ce1447534524441f14b1a629bee6c7c8d1a0abb58f4e4ac3a5c7f468ca454fa4e7a9cc10c6a
7
+ data.tar.gz: e7d180b721156b3bea27c4271ccde3de14e6d7e9d233c4a07d95eab566348f1269b53db119747f922961dc59752c19062c7e030badc75a1bd8b7083df9b03d3c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.103
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1457](https://github.com/primer/view_components/pull/1457) [`7fa6d221`](https://github.com/primer/view_components/commit/7fa6d221f4e2196d3421592d89f48a4abe7b8373) Thanks [@orhantoy](https://github.com/orhantoy)! - Remove dead Flex and FlexItem links from nav
8
+
9
+ * [#1469](https://github.com/primer/view_components/pull/1469) [`a3442456`](https://github.com/primer/view_components/commit/a3442456c5230918ff3cedb7293d4799b963599d) Thanks [@jonrohan](https://github.com/jonrohan)! - Removing the deprecated Primer::HeadingComponent component.
10
+
11
+ - [#1480](https://github.com/primer/view_components/pull/1480) [`c764cee6`](https://github.com/primer/view_components/commit/c764cee6744c91671db729bd7ac60dc532398820) Thanks [@koddsson](https://github.com/koddsson)! - Fix nested dialogs
12
+
13
+ * [#1466](https://github.com/primer/view_components/pull/1466) [`9b5cff15`](https://github.com/primer/view_components/commit/9b5cff1513ca24f85906fd8ed54d34d056504535) Thanks [@jonrohan](https://github.com/jonrohan)! - Removing the deprecated Primer::HiddenTextExpander component.
14
+
15
+ - [#1471](https://github.com/primer/view_components/pull/1471) [`5687bebe`](https://github.com/primer/view_components/commit/5687bebebb3c0fa58bf63d2a1ff09602b9f3987d) Thanks [@koddsson](https://github.com/koddsson)! - Make sure nested dialogs behave correctly
16
+
17
+ * [#1479](https://github.com/primer/view_components/pull/1479) [`b0281033`](https://github.com/primer/view_components/commit/b028103397ac94375035d38c5ca85e85aeffde08) Thanks [@khiga8](https://github.com/khiga8)! - move tooltip to be adjacent to button
18
+
19
+ - [#1468](https://github.com/primer/view_components/pull/1468) [`ae99c2ed`](https://github.com/primer/view_components/commit/ae99c2ed9e9b937d79443cbc393bddd6f02a2112) Thanks [@jonrohan](https://github.com/jonrohan)! - Removing the deprecated Primer::CloseButton component.
20
+
21
+ * [#1476](https://github.com/primer/view_components/pull/1476) [`f174b31c`](https://github.com/primer/view_components/commit/f174b31c7bf59d08402d03c35a2bc52fc34bc687) Thanks [@camertron](https://github.com/camertron)! - Bump view_component to 2.74.1 to fix deadlock issues in Lookbook
22
+
23
+ - [#1452](https://github.com/primer/view_components/pull/1452) [`9252a124`](https://github.com/primer/view_components/commit/9252a12435d9bb5a3bd2610a72e12358c1ca2c2b) Thanks [@steves](https://github.com/steves)! - Move sample forms out of test folder
24
+
25
+ * [#1467](https://github.com/primer/view_components/pull/1467) [`a3b562ca`](https://github.com/primer/view_components/commit/a3b562cae569902c0ce3131599654b8a00720095) Thanks [@jonrohan](https://github.com/jonrohan)! - Removing the deprecated Primer::DetailsComponent component.
26
+
3
27
  ## 0.0.102
4
28
 
5
29
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- !function(){"use strict";function t(t,e,n,o){var i,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(s<3?i(r):s>3?i(e,n,r):i(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function e(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function n(t,e,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,n):i?i.value=n:e.set(t,n),n}const o={"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"]},i={start:["end","center"],end:["start","center"],center:["end","start"]};function s(t,e,n={}){const s=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),m=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,o=n.getBoundingClientRect(),i=getComputedStyle(n),[s,r,a,c]=[i.borderTopWidth,i.borderLeftWidth,i.borderRightWidth,i.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:o.top+s,left:o.left+r,width:o.width-a-r,height:Math.max(o.height-s-c,n===document.body?window.innerHeight:-1/0)}}(s),p=getComputedStyle(s),b=s.getBoundingClientRect(),[g,w]=[p.borderTopWidth,p.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,s,{side:r,align:a,allowOutOfBounds:c,anchorOffset:l,alignmentOffset:u}){const m={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let p=d(n,s,r,a,l,u),b=r,g=a;if(p.top-=e.top,p.left-=e.left,!c){const c=o[r];let w=0;if(c){let t=r;for(;w<c.length&&h(t,p,m,n);){const o=c[w++];t=o,p=d(n,s,o,a,l,u),p.top-=e.top,p.left-=e.left,b=o}}const v=i[a];let E=0;if(v){let t=a;for(;E<v.length&&f(t,p,m,n);){const o=v[E++];t=o,p=d(n,s,b,o,l,u),p.top-=e.top,p.left-=e.left,g=o}}p.top<m.top&&(p.top=m.top),p.left<m.left&&(p.left=m.left),p.left+n.width>t.width+m.left&&(p.left=t.width+m.left-n.width),c&&w<c.length&&p.top+n.height>t.height+m.top&&(p.top=t.height+m.top-n.height)}return Object.assign(Object.assign({},p),{anchorSide:b,anchorAlign:g})}(m,{top:b.top+g,left:b.left+w},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,o,i,s;const d=null!==(e=t.side)&&void 0!==e?e:r,h=null!==(n=t.align)&&void 0!==n?n:a;return{side:d,align:h,anchorOffset:null!==(o=t.anchorOffset)&&void 0!==o?o:"inside-center"===d?0:c,alignmentOffset:null!==(i=t.alignmentOffset)&&void 0!==i?i:"center"!==h&&d.startsWith("inside")?l:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:u}}(n))}const r="outside-bottom",a="start",c=4,l=4,u=!1;function d(t,e,n,o,i,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-i-t.height:"outside-bottom"===n?c=a+i:"outside-left"===n?l=e.left-i-t.width:"outside-right"===n&&(l=r+i),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+i:"inside-bottom"===n?c=a-i-t.height:"inside-left"===n?l=e.left+i:"inside-right"===n?l=r-i-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+i),"inside-top"===n||"inside-bottom"===n?l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function h(t,e,n,o){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+o.height>n.height+n.top:e.left<n.left||e.left+o.width>n.width+n.left}function f(t,e,n,o){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+o.width>n.left+n.width||e.left<n.left:void 0}function m(t,e=!1){return function*(t,e={}){var n,o;const i=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(o=e.onlyTabbable)&&void 0!==o&&o?b:p,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,i)&&(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,i)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function p(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,o=t.hidden,i=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||o||i||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),o=0===t.getClientRects().length;if(e||n||o)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function b(t,e=!1){return p(t,e)&&"-1"!==t.getAttribute("tabindex")}let g=!1;function w(){}try{const t=Object.create({},{signal:{get(){g=!0}}});window.addEventListener("test",w,t),window.removeEventListener("test",w,t)}catch(t){}g||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,o){return"object"==typeof o&&"signal"in o&&o.signal instanceof AbortSignal&&t.call(o.signal,"abort",(()=>{this.removeEventListener(e,n,o)})),t.call(this,e,n,o)}}(),g=!0);const v=[];let E;function y(t,e,n){const o=new AbortController,i=null!=n?n:o.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=m(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function c(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&b(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=m(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=m(t);null==e||e.focus()},t.prepend(s),t.append(r);const l=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(i);if(E){const t=E;E.container.setAttribute("data-focus-trap","suspended"),E.controller.abort(),v.push(t)}l.signal.addEventListener("abort",(()=>{E=void 0})),i.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=v.findIndex((e=>e.container===t));n>=0&&v.splice(n,1),function(){const t=v.pop();t&&y(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:l.signal,capture:!0}),c(document.activeElement),E={container:t,controller:l,initialFocus:e,originalSignal:i};const u=v.findIndex((e=>e.container===t));if(u>=0&&v.splice(u,1),!n)return o}var A,T,M,k,L,x,S;function C(t){document.activeElement!==t&&(null==t||t.focus())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),A.add(this),T.set(this,new AbortController),M.set(this,null),k.set(this,void 0),L.set(this,!0)}get open(){return this.hasAttribute("open")}set open(t){var o,i,s,r;if(t){if(this.open)return;this.setAttribute("open",""),null===(o=e(this,A,"a",x))||void 0===o||o.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",e(this,T,"f").signal.aborted&&n(this,T,new AbortController,"f"),y(this,void 0,e(this,T,"f").signal)}else{if(!this.open)return;this.removeAttribute("open"),null===(i=e(this,A,"a",x))||void 0===i||i.classList.add("Overlay--hidden"),document.body.style.overflow="initial",e(this,T,"f").abort();const t=(null===(s=e(this,k,"f"))||void 0===s?void 0:s.closest("details"))||(null===(r=e(this,k,"f"))||void 0===r?void 0:r.closest("action-menu"));C(t?m(t):e(this,k,"f")),n(this,k,void 0,"f")}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog");const{signal:t}=n(this,M,new AbortController,"f");this.ownerDocument.addEventListener("click",(t=>{const e=t.target,o=e.closest(this.tagName)!==this,i=null==e?void 0:e.closest("button");if(!i)return void(o&&this.close());let s=i.getAttribute("data-close-dialog-id");s===this.id&&this.close(),s=i.getAttribute("data-submit-dialog-id"),s===this.id&&this.close(!0),s=i.getAttribute("data-show-dialog-id"),s===this.id&&(t.stopPropagation(),n(this,k,i,"f"),this.show())}),{signal:t}),this.addEventListener("keydown",(t=>e(this,A,"m",S).call(this,t)))}disconnectedCallback(){var t;null===(t=e(this,M,"f"))||void 0===t||t.abort()}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}}T=new WeakMap,M=new WeakMap,k=new WeakMap,L=new WeakMap,A=new WeakSet,x=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},S=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 I=new WeakSet;function D(t){$(t),R(t)}const H=new WeakMap;function R(t=document){if(H.has(t))return H.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)P(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&$(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const o={get closed(){return e},unsubscribe(){e=!0,H.delete(t),n.disconnect()}};return H.set(t,o),o}function $(t){for(const e of t.querySelectorAll("[data-action]"))P(e);t instanceof Element&&t.hasAttribute("data-action")&&P(t)}function F(t){const e=t.currentTarget;for(const n of O(e))if(t.type===n.type){const o=e.closest(n.tag);I.has(o)&&"function"==typeof o[n.method]&&o[n.method](t);const i=e.getRootNode();if(i instanceof ShadowRoot&&I.has(i.host)&&i.host.matches(n.tag)){const e=i.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*O(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 P(t){for(const e of O(t))t.addEventListener(e.type,F)}const q=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),W=(t,e="property")=>{const n=q(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const N="attr",B=new WeakSet;function Y(t,e){if(B.has(t))return;B.add(t);const n=Object.getPrototypeOf(t),o=n?.constructor?.attrPrefix??"data-";e||(e=j(n,N));for(const n of e){const e=t[n],i=W(`${o}${n}`);let s={configurable:!0,get(){return this.getAttribute(i)||""},set(t){this.setAttribute(i,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(i)||0)},set(t){this.setAttribute(i,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(i)},set(t){this.toggleAttribute(i,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(i)&&s.set.call(t,e)}}const U=Symbol.for("catalyst");class X{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const o=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,o)};const i=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,o){e.attributeChangedCallback(this,t,n,o,i)};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-",o=t=>W(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...j(t.prototype,N)].map(o).concat(e),set(t){e=t}})}(t),function(t){const e=q(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),Y(t),function(t){I.add(t),t.shadowRoot&&D(t.shadowRoot),$(t),R(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&D(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,o,i){Y(t),"data-catalyst"!==e&&i&&i.call(t,e,n,o)}}function j(t,e){if(!Object.prototype.hasOwnProperty.call(t,U)){const e=t[U],n=t[U]=new Map;if(e)for(const[t,o]of e)n.set(t,new Set(o))}const n=t[U];return n.has(e)||n.set(e,new Set),n.get(e)}function K(t,e){j(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 o of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!o.closest(n))return o;for(const o of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(o.closest(n)===t)return o}(this,e)}})}function z(t){new X(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},o=()=>e.abort();document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),document.addEventListener("keydown",o,n),document.addEventListener("pointerdown",o,n)}));let V=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 o;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;o=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=this.parseHTML(document,o);null===(e=null==i?void 0:i.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(i,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)}};function Z(t,e=0,{start:n=!1,middle:o=!1,once:i=!1}={}){return function(t,e=0,{start:n=!0,middle:o=!0,once:i=!1}={}){let s,r=0,a=!1;function c(...l){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,l),i&&c.cancel()):(o&&u<e||!o)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,l),i&&c.cancel()}),o?e-u:e))}return c.cancel=()=>{clearTimeout(s),a=!0},c}(t,e,{start:n,middle:o,once:i})}t([K],V.prototype,"list",void 0),t([K],V.prototype,"showMoreItem",void 0),t([function(t,e){j(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),o=[];if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)||o.push(i);for(const i of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)===t&&o.push(i);return o}(this,e)}})}],V.prototype,"focusMarkers",void 0),V=t([z],V);let _=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.isRemote()?(this.setLoadingState(),this.check()):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 check(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0");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 J,G,Q,tt,et,nt,ot;t([K],_.prototype,"switch",void 0),t([K],_.prototype,"loadingSpinner",void 0),t([K],_.prototype,"errorIcon",void 0),t([function(t=0,e={}){return(n,o,i)=>{if(!i||"function"!=typeof i.value)throw new Error("debounce can only decorate functions");const s=i.value;i.value=Z(s,t,e),Object.defineProperty(n,o,i)}}(300)],_.prototype,"check",null),_=t([z],_),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=_,window.customElements.define("toggle-switch",_));const it="tooltip-open",st="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),J.add(this),G.set(this,void 0),Q.set(this,"center"),tt.set(this,"outside-bottom"),et.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(st,t),this.isConnected&&e(this,J,"m",nt).call(this)}get hiddenFromView(){return this.classList.contains(st)}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,n(this,et,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=e(this,G,"f"))||void 0===t||t.abort(),n(this,G,new AbortController,"f");const{signal:o}=e(this,G,"f");this.addEventListener("mouseleave",this,{signal:o}),this.control.addEventListener("mouseenter",this,{signal:o}),this.control.addEventListener("mouseleave",this,{signal:o}),this.control.addEventListener("focus",this,{signal:o}),this.control.addEventListener("blur",this,{signal:o}),this.ownerDocument.addEventListener("keydown",this,{signal:o}),e(this,J,"m",nt).call(this)}disconnectedCallback(){var t;null===(t=e(this,G,"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?(n(this,Q,"center","f"),n(this,tt,"outside-top","f")):"ne"===t?(n(this,Q,"start","f"),n(this,tt,"outside-top","f")):"e"===t?(n(this,Q,"center","f"),n(this,tt,"outside-right","f")):"se"===t?(n(this,Q,"start","f"),n(this,tt,"outside-bottom","f")):"s"===t?(n(this,Q,"center","f"),n(this,tt,"outside-bottom","f")):"sw"===t?(n(this,Q,"end","f"),n(this,tt,"outside-bottom","f")):"w"===t?(n(this,Q,"center","f"),n(this,tt,"outside-left","f")):"nw"===t&&(n(this,Q,"end","f"),n(this,tt,"outside-top","f"))}}}G=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,J=new WeakSet,nt=function(){if(this.hiddenFromView)this.classList.remove(it,...rt);else{this.classList.add(it);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);e(this,J,"m",ot).call(this)}},ot=function(){if(!this.control)return;if(!e(this,et,"f")||this.hiddenFromView)return;this.style.left="0px";const t=s(this,this.control,{side:e(this,tt,"f"),align:e(this,Q,"f"),anchorOffset:10}),n=t.anchorSide,o=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===n?"w":"outside-right"===n?"e":"outside-top"===n?"center"===o?"n":"start"===o?"ne":"nw":"center"===o?"s":"start"===o?"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));const at=!!navigator.userAgent.match(/Macintosh/);class ct{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(!at&&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":at&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":at&&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",lt)}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",lt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(ut)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(ut),o=n.indexOf(e);if(o===n.length-1&&1===t||0===o&&-1===t)return this.clearSelection(),void this.input.focus();let i=1===t?0:n.length-1;if(e&&o>=0){const e=o+t;e>=0&&e<n.length&&(i=e)}const s=n[i];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),dt(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 lt(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 ut(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function dt(t,e){(function(t,e){const n=t.scrollTop,o=n+t.clientHeight,i=e.offsetTop,s=i+e.clientHeight;return i>=n&&s<=o})(t,e)||(t.scrollTop=e.offsetTop)}const ht=window.testScreenReaderDelay||100;class ft{constructor(t,e,n,o=!1){var i;if(this.container=t,this.input=e,this.results=n,this.combobox=new ct(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,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(...o){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...o)}),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===(i=this.clearButton)||void 0===i||i.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)}),ht)}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),o=new URLSearchParams(n.search.slice(1));o.append("q",t),n.search=o.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,o=e.length,[i]=e,s=null==i?void 0:i.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${o} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${o||"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 mt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const pt=new WeakMap;function bt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=pt.get(t);n&&n.abort();pt.set(t,e);const o=()=>pt.delete(t),i=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 i.then(o,o),i}(t,n)}const gt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=bt}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 o="true"===this.getAttribute("data-autoselect");gt.set(this,new ft(this,e,n,o)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=gt.get(this);t&&(t.destroy(),gt.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 o=gt.get(this);if(o)switch(t){case"open":null===n?o.close():o.open();break;case"value":null!==n&&(o.input.value=n),this.dispatchEvent(new mt("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}function wt(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 vt(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),wt(n),e.removeChild(n),Promise.resolve()}function Et(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function o(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)vt(n).then(o);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&&(i=s,i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement?vt(i.value):i instanceof HTMLAnchorElement&&i.hasAttribute("href")?vt(i.href):wt(i)).then(o)}var i}function yt(t){const e=t.currentTarget;e instanceof HTMLElement&&Et(e)}function At(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Et(e))}}function Tt(t){t.currentTarget.addEventListener("keydown",At)}function Mt(t){t.currentTarget.removeEventListener("keydown",At)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",yt),this.addEventListener("focus",Tt),this.addEventListener("blur",Mt)}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 kt(t){t.style.display="inline-block"}function Lt(t){t.style.display="none"}const xt=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=xt.get(t);e?(clearTimeout(e),xt.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Lt(e),kt(n))}(t),xt.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(kt(e),Lt(n))}(t),xt.delete(t)}),2e3))}));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 t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[It(t,"compositionstart",(t=>Nt(this,t))),It(t,"compositionend",(t=>Nt(this,t))),It(t,"click",(e=>Ot(t,e))),It(t,"change",(e=>Ot(t,e))),It(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const o=St.get(e);if(!o||o.isComposing)return;const i=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(Wt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=$t(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=$t(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(Ft&&n.ctrlKey){const e=$t(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(Ft&&n.ctrlKey){const e=$t(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&qt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),It(t,"toggle",(()=>Dt(t,this)),{once:!0}),It(t,"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")}}(t))),this.preload?It(t,"mouseover",(()=>Dt(t,this)),{once:!0}):Ct,...Ht(t)];St.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=St.get(this);if(t){St.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const St=new WeakMap,Ct={unsubscribe(){}};function It(t,e,n,o=!1){return t.addEventListener(e,n,o),{unsubscribe:()=>{t.removeEventListener(e,n,o)}}}function Dt(t,e){const n=e.getAttribute("src");if(!n)return;const o=St.get(e);if(!o)return;if(o.loaded)return;o.loaded=!0;const i=e.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",(()=>Rt(t))),i.setAttribute("src",n))}function Ht(t){let e=!1;return[It(t,"mousedown",(()=>e=!0)),It(t,"keydown",(()=>e=!1)),It(t,"toggle",(()=>{t.hasAttribute("open")&&(Rt(t)||e||function(t){const e=document.activeElement;if(e&&qt(e)&&t.contains(e))return;const n=$t(t,!0);n&&n.focus()}(t))}))]}function Rt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function $t(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),o=document.activeElement,i=o instanceof HTMLElement?n.indexOf(o):-1,s=e?n[i+1]:n[i-1],r=e?n[0]:n[n.length-1];return s||r}const Ft=navigator.userAgent.match(/Macintosh/);function Ot(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 o=e.querySelector("input");if("LABEL"===e.tagName&&n===o)return;"LABEL"===e.tagName&&o&&!o.checked||Pt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Pt(e,t)}}function Pt(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 o=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(o)n.textContent=o;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 o=(n===t).toString();e instanceof HTMLInputElement&&(o=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",o)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Wt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function qt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Wt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Nt(t,e){const n=St.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Bt=new WeakMap,Yt=new WeakMap,Ut=new WeakMap;function Xt(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:o}=Ut.get(e)||{};if(!n||!o)return;let i=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?i=-1:"ArrowRight"===t.key&&(i=1);else if(Yt.has(e)&&t instanceof MouseEvent){const n=Yt.get(e);i=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Yt.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Yt.get(e);i=n-r,s=o-a}if(0!==i||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+i),o.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),o.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,Jt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)Yt.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0];Yt.set(e,{dragStartX:n,dragStartY:o})}}function jt(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=Kt(e);if(!(n instanceof ImageCropElement))return;const{box:o}=Ut.get(n)||{};if(!o)return;const i=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return Zt(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=o.offsetWidth+a,r=o.offsetHeight+a,Bt.set(n,{startX:o.offsetLeft,startY:o.offsetTop})}else if(t instanceof MouseEvent){const e=Bt.get(n);if(!e)return;s=t.pageX-e.startX-i.left-window.pageXOffset,r=t.pageY-e.startY-i.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=Bt.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-i.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-i.top-window.pageYOffset}s&&r&&Vt(n,s,r,!(t instanceof KeyboardEvent))}function Kt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function zt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=Kt(e);if(!(n instanceof ImageCropElement))return;const{box:o}=Ut.get(n)||{};if(!o)return;const i=t.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const e=i.getAttribute("data-direction")||"";n.addEventListener("mousemove",jt),n.addEventListener("touchmove",jt,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Bt.set(n,{startX:o.offsetLeft+(["se","ne"].indexOf(e)>=0?0:o.offsetWidth),startY:o.offsetTop+(["se","sw"].indexOf(e)>=0?0:o.offsetHeight)}),jt(t)}else n.addEventListener("mousemove",Xt),n.addEventListener("touchmove",Xt,{passive:!0})}function Vt(t,e,n,o=!0){let i=Math.max(Math.abs(e),Math.abs(n),10);const s=Bt.get(t);if(!s)return;const{box:r,image:a}=Ut.get(t)||{};if(!r||!a)return;i=Math.min(i,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=o?Math.round(Math.max(0,e>0?s.startX:s.startX-i)):r.offsetLeft,l=o?Math.round(Math.max(0,n>0?s.startY:s.startY-i)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${i}px`,r.style.height=`${i}px`,Jt(t,{x:c,y:l,width:i,height:i})}function Zt(t){const{image:e}=Ut.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Bt.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),Vt(t,n,n)}function _t(t){const e=t.currentTarget;e instanceof ImageCropElement&&(Yt.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",jt),e.removeEventListener("mousemove",Xt),e.removeEventListener("touchmove",jt),e.removeEventListener("touchmove",Xt))}function Jt(t,e){const{image:n}=Ut.get(t)||{};if(!n)return;const o=n.naturalWidth/n.width;for(const n in e){const i=Math.round(e[n]*o);e[n]=i;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=i.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(Ut.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&&(Ut.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,Zt(this)})),this.addEventListener("mouseleave",_t),this.addEventListener("touchend",_t),this.addEventListener("mouseup",_t),e.addEventListener("mousedown",zt),e.addEventListener("touchstart",zt,{passive:!0}),this.addEventListener("keydown",Xt),this.addEventListener("keydown",jt),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:o}=Ut.get(this)||{};"src"===t&&(this.loaded=!1,o&&(o.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Gt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Qt=["January","February","March","April","May","June","July","August","September","October","November","December"];function te(t){return`0${t}`.slice(-2)}function ee(t,e){const n=t.getDay(),o=t.getDate(),i=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return Gt[n].slice(0,3);case"A":return Gt[n];case"b":return Qt[i].slice(0,3);case"B":return Qt[i];case"c":return t.toString();case"d":return te(o);case"e":return String(o);case"H":return te(r);case"I":return te(ee(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return te(i+1);case"M":return te(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return te(c);case"w":return String(n);case"y":return te(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function ne(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let oe=null;const ie=ne({day:"numeric",month:"short"});function se(){if(null!==oe)return oe;const t=ie();if(t){const e=t.format(new Date(0));return oe=!!e.match(/^\d/),oe}return!1}let re=null;const ae=ne({day:"numeric",month:"short",year:"numeric"});function ce(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const le=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const o=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?le.delete(this):le.set(this,new Date(t))}const i=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!i||s&&s!==o||this.setAttribute("title",i);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return le.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=ue();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const ue=ne({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),de=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||de.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let o=se()?"weekday day month year":"weekday month day, year";for(const e in n){const i=n[e][t.getAttribute(e)||""];o=o.replace(e,i||"")}return o=o.replace(/(\s,)|(,\s$)/,""),ee(e,o).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},o=t.getAttribute("hour");"numeric"!==o&&"2-digit"!==o||(n.hour=o);const i=t.getAttribute("minute");"numeric"!==i&&"2-digit"!==i||(n.minute=i);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=de.get(t);a||(a=ne(n),de.set(t,a));const c=a();if(c)return c.format(e);return ee(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class he{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return t<0||e<10?fe(this.locale,0,"second"):e<45?fe(this.locale,-e,"second"):e<90||n<45?fe(this.locale,-n,"minute"):n<90||o<24?fe(this.locale,-o,"hour"):o<36||i<30?fe(this.locale,-i,"day"):s<18?fe(this.locale,-s,"month"):fe(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:o<24?`${o}h`:i<365?`${i}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return s>=18||s>=12?fe(this.locale,r,"year"):i>=45||i>=30?fe(this.locale,s,"month"):o>=36||o>=24?fe(this.locale,i,"day"):n>=90||n>=45?fe(this.locale,o,"hour"):e>=90||e>=45?fe(this.locale,n,"minute"):fe(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return i>=365?`${r}y`:o>=24?`${i}d`:n>=60?`${o}h`:n>1?`${n}m`:"1m"}formatDate(){let t=se()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==re)return re;const t=ae();if(t){const e=t.format(new Date(0));return re=!!e.match(/\d,/),re}return!0}()?", %Y":" %Y"),ee(this.date,t)}formatTime(){const t=me();return t?t.format(this.date):ee(this.date,"%l:%M%P")}}function fe(t,e,n){const o=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return o?o.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const me=ne({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new he(t,ce(this)).toString()}connectedCallback(){pe.push(this),be||(ge(),be=window.setInterval(ge,6e4)),super.connectedCallback()}disconnectedCallback(){const t=pe.indexOf(this);-1!==t&&pe.splice(t,1),pe.length||be&&(clearInterval(be),be=null)}}const pe=[];let be;function ge(){let t,e,n;for(e=0,n=pe.length;e<n;e++)t=pe[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new he(e,ce(this)).microTimeAgo():new he(e,ce(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new he(e,ce(this)).microTimeUntil():new he(e,ce(this)).timeUntil()}}function we(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement));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=we(this),o=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=o+1;t>=n.length&&(t=0),ve(this,t)}else if("ArrowLeft"===t.code){let t=o-1;t<0&&(t=n.length-1),ve(this,t)}else"Home"===t.code?(ve(this,0),t.preventDefault()):"End"===t.code&&(ve(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=we(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;ve(this,e.indexOf(n))}))}connectedCallback(){for(const t of we(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"))}}function ve(t,e){const n=we(t),o=Array.from(t.querySelectorAll('[role="tabpanel"]')).filter((e=>e.closest(t.tagName)===t)),i=n[e],s=o[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of o)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(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement))}();
1
+ !function(){"use strict";function t(t,e,n,o){var i,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(s<3?i(r):s>3?i(e,n,r):i(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function e(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function n(t,e,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,n):i?i.value=n:e.set(t,n),n}const o={"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"]},i={start:["end","center"],end:["start","center"],center:["end","start"]};function s(t,e,n={}){const s=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),m=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,o=n.getBoundingClientRect(),i=getComputedStyle(n),[s,r,a,c]=[i.borderTopWidth,i.borderLeftWidth,i.borderRightWidth,i.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:o.top+s,left:o.left+r,width:o.width-a-r,height:Math.max(o.height-s-c,n===document.body?window.innerHeight:-1/0)}}(s),p=getComputedStyle(s),b=s.getBoundingClientRect(),[g,w]=[p.borderTopWidth,p.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,s,{side:r,align:a,allowOutOfBounds:c,anchorOffset:l,alignmentOffset:u}){const m={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let p=d(n,s,r,a,l,u),b=r,g=a;if(p.top-=e.top,p.left-=e.left,!c){const c=o[r];let w=0;if(c){let t=r;for(;w<c.length&&h(t,p,m,n);){const o=c[w++];t=o,p=d(n,s,o,a,l,u),p.top-=e.top,p.left-=e.left,b=o}}const v=i[a];let E=0;if(v){let t=a;for(;E<v.length&&f(t,p,m,n);){const o=v[E++];t=o,p=d(n,s,b,o,l,u),p.top-=e.top,p.left-=e.left,g=o}}p.top<m.top&&(p.top=m.top),p.left<m.left&&(p.left=m.left),p.left+n.width>t.width+m.left&&(p.left=t.width+m.left-n.width),c&&w<c.length&&p.top+n.height>t.height+m.top&&(p.top=t.height+m.top-n.height)}return Object.assign(Object.assign({},p),{anchorSide:b,anchorAlign:g})}(m,{top:b.top+g,left:b.left+w},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,o,i,s;const d=null!==(e=t.side)&&void 0!==e?e:r,h=null!==(n=t.align)&&void 0!==n?n:a;return{side:d,align:h,anchorOffset:null!==(o=t.anchorOffset)&&void 0!==o?o:"inside-center"===d?0:c,alignmentOffset:null!==(i=t.alignmentOffset)&&void 0!==i?i:"center"!==h&&d.startsWith("inside")?l:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:u}}(n))}const r="outside-bottom",a="start",c=4,l=4,u=!1;function d(t,e,n,o,i,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-i-t.height:"outside-bottom"===n?c=a+i:"outside-left"===n?l=e.left-i-t.width:"outside-right"===n&&(l=r+i),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+i:"inside-bottom"===n?c=a-i-t.height:"inside-left"===n?l=e.left+i:"inside-right"===n?l=r-i-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+i),"inside-top"===n||"inside-bottom"===n?l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function h(t,e,n,o){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+o.height>n.height+n.top:e.left<n.left||e.left+o.width>n.width+n.left}function f(t,e,n,o){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+o.width>n.left+n.width||e.left<n.left:void 0}function m(t,e=!1){return function*(t,e={}){var n,o;const i=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(o=e.onlyTabbable)&&void 0!==o&&o?b:p,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,i)&&(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,i)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function p(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,o=t.hidden,i=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||o||i||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),o=0===t.getClientRects().length;if(e||n||o)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function b(t,e=!1){return p(t,e)&&"-1"!==t.getAttribute("tabindex")}let g=!1;function w(){}try{const t=Object.create({},{signal:{get(){g=!0}}});window.addEventListener("test",w,t),window.removeEventListener("test",w,t)}catch(t){}g||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,o){return"object"==typeof o&&"signal"in o&&o.signal instanceof AbortSignal&&t.call(o.signal,"abort",(()=>{this.removeEventListener(e,n,o)})),t.call(this,e,n,o)}}(),g=!0);const v=[];let E;function y(t,e,n){const o=new AbortController,i=null!=n?n:o.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=m(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function c(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&b(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=m(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=m(t);null==e||e.focus()},t.prepend(s),t.append(r);const l=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(i);if(E){const t=E;E.container.setAttribute("data-focus-trap","suspended"),E.controller.abort(),v.push(t)}l.signal.addEventListener("abort",(()=>{E=void 0})),i.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=v.findIndex((e=>e.container===t));n>=0&&v.splice(n,1),function(){const t=v.pop();t&&y(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:l.signal,capture:!0}),c(document.activeElement),E={container:t,controller:l,initialFocus:e,originalSignal:i};const u=v.findIndex((e=>e.container===t));if(u>=0&&v.splice(u,1),!n)return o}var A,T,M,L;function k(t){document.activeElement!==t&&(null==t||t.focus())}const x=[];function S(t){const e=t.target,n=null==e?void 0:e.closest("button");let o=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&o){t.stopPropagation();const e=document.getElementById(o);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const i=x[x.length-1];if(!i)return;const s=!e.closest(`#${i.getAttribute("id")}`);n?(o=n.getAttribute("data-close-dialog-id"),o===i.id&&(x.pop(),i.close()),o=n.getAttribute("data-submit-dialog-id"),o===i.id&&(x.pop(),i.close(!0))):s&&(x.pop(),i.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),A.add(this),T.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var o,i,s,r;if(t){if(this.open)return;this.setAttribute("open",""),null===(o=e(this,A,"a",M))||void 0===o||o.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",e(this,T,"f").signal.aborted&&n(this,T,new AbortController,"f"),y(this,void 0,e(this,T,"f").signal),x.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(i=e(this,A,"a",M))||void 0===i||i.classList.add("Overlay--hidden"),document.body.style.overflow="initial",e(this,T,"f").abort();const t=(null===(s=this.openButton)||void 0===s?void 0:s.closest("details"))||(null===(r=this.openButton)||void 0===r?void 0:r.closest("action-menu"));k(t?m(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",S),this.addEventListener("keydown",(t=>e(this,A,"m",L).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}}T=new WeakMap,A=new WeakSet,M=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},L=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 C=new WeakSet;function I(t){R(t),H(t)}const D=new WeakMap;function H(t=document){if(D.has(t))return D.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)O(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&R(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const o={get closed(){return e},unsubscribe(){e=!0,D.delete(t),n.disconnect()}};return D.set(t,o),o}function R(t){for(const e of t.querySelectorAll("[data-action]"))O(e);t instanceof Element&&t.hasAttribute("data-action")&&O(t)}function $(t){const e=t.currentTarget;for(const n of F(e))if(t.type===n.type){const o=e.closest(n.tag);C.has(o)&&"function"==typeof o[n.method]&&o[n.method](t);const i=e.getRootNode();if(i instanceof ShadowRoot&&C.has(i.host)&&i.host.matches(n.tag)){const e=i.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*F(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 O(t){for(const e of F(t))t.addEventListener(e.type,$)}const P=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),q=(t,e="property")=>{const n=P(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const W="attr",N=new WeakSet;function B(t,e){if(N.has(t))return;N.add(t);const n=Object.getPrototypeOf(t),o=n?.constructor?.attrPrefix??"data-";e||(e=X(n,W));for(const n of e){const e=t[n],i=q(`${o}${n}`);let s={configurable:!0,get(){return this.getAttribute(i)||""},set(t){this.setAttribute(i,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(i)||0)},set(t){this.setAttribute(i,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(i)},set(t){this.toggleAttribute(i,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(i)&&s.set.call(t,e)}}const Y=Symbol.for("catalyst");class U{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const o=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,o)};const i=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,o){e.attributeChangedCallback(this,t,n,o,i)};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-",o=t=>q(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...X(t.prototype,W)].map(o).concat(e),set(t){e=t}})}(t),function(t){const e=P(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),B(t),function(t){C.add(t),t.shadowRoot&&I(t.shadowRoot),R(t),H(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&I(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,o,i){B(t),"data-catalyst"!==e&&i&&i.call(t,e,n,o)}}function X(t,e){if(!Object.prototype.hasOwnProperty.call(t,Y)){const e=t[Y],n=t[Y]=new Map;if(e)for(const[t,o]of e)n.set(t,new Set(o))}const n=t[Y];return n.has(e)||n.set(e,new Set),n.get(e)}function j(t,e){X(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 o of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!o.closest(n))return o;for(const o of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(o.closest(n)===t)return o}(this,e)}})}function K(t){new U(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},o=()=>e.abort();document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),document.addEventListener("keydown",o,n),document.addEventListener("pointerdown",o,n)}));let z=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 o;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;o=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=this.parseHTML(document,o);null===(e=null==i?void 0:i.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(i,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)}};function V(t,e=0,{start:n=!1,middle:o=!1,once:i=!1}={}){return function(t,e=0,{start:n=!0,middle:o=!0,once:i=!1}={}){let s,r=0,a=!1;function c(...l){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,l),i&&c.cancel()):(o&&u<e||!o)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,l),i&&c.cancel()}),o?e-u:e))}return c.cancel=()=>{clearTimeout(s),a=!0},c}(t,e,{start:n,middle:o,once:i})}t([j],z.prototype,"list",void 0),t([j],z.prototype,"showMoreItem",void 0),t([function(t,e){X(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),o=[];if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)||o.push(i);for(const i of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)===t&&o.push(i);return o}(this,e)}})}],z.prototype,"focusMarkers",void 0),z=t([K],z);let Z=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.isRemote()?(this.setLoadingState(),this.check()):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 check(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0");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 _,J,G,Q,tt,et,nt;t([j],Z.prototype,"switch",void 0),t([j],Z.prototype,"loadingSpinner",void 0),t([j],Z.prototype,"errorIcon",void 0),t([function(t=0,e={}){return(n,o,i)=>{if(!i||"function"!=typeof i.value)throw new Error("debounce can only decorate functions");const s=i.value;i.value=V(s,t,e),Object.defineProperty(n,o,i)}}(300)],Z.prototype,"check",null),Z=t([K],Z),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Z,window.customElements.define("toggle-switch",Z));const ot="tooltip-open",it="sr-only",st=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),_.add(this),J.set(this,void 0),G.set(this,"center"),Q.set(this,"outside-bottom"),tt.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(it,t),this.isConnected&&e(this,_,"m",et).call(this)}get hiddenFromView(){return this.classList.contains(it)}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,n(this,tt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=e(this,J,"f"))||void 0===t||t.abort(),n(this,J,new AbortController,"f");const{signal:o}=e(this,J,"f");this.addEventListener("mouseleave",this,{signal:o}),this.control.addEventListener("mouseenter",this,{signal:o}),this.control.addEventListener("mouseleave",this,{signal:o}),this.control.addEventListener("focus",this,{signal:o}),this.control.addEventListener("blur",this,{signal:o}),this.ownerDocument.addEventListener("keydown",this,{signal:o}),e(this,_,"m",et).call(this)}disconnectedCallback(){var t;null===(t=e(this,J,"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(...st);const t=this.direction;"n"===t?(n(this,G,"center","f"),n(this,Q,"outside-top","f")):"ne"===t?(n(this,G,"start","f"),n(this,Q,"outside-top","f")):"e"===t?(n(this,G,"center","f"),n(this,Q,"outside-right","f")):"se"===t?(n(this,G,"start","f"),n(this,Q,"outside-bottom","f")):"s"===t?(n(this,G,"center","f"),n(this,Q,"outside-bottom","f")):"sw"===t?(n(this,G,"end","f"),n(this,Q,"outside-bottom","f")):"w"===t?(n(this,G,"center","f"),n(this,Q,"outside-left","f")):"nw"===t&&(n(this,G,"end","f"),n(this,Q,"outside-top","f"))}}}J=new WeakMap,G=new WeakMap,Q=new WeakMap,tt=new WeakMap,_=new WeakSet,et=function(){if(this.hiddenFromView)this.classList.remove(ot,...st);else{this.classList.add(ot);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);e(this,_,"m",nt).call(this)}},nt=function(){if(!this.control)return;if(!e(this,tt,"f")||this.hiddenFromView)return;this.style.left="0px";const t=s(this,this.control,{side:e(this,Q,"f"),align:e(this,G,"f"),anchorOffset:10}),n=t.anchorSide,o=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===n?"w":"outside-right"===n?"e":"outside-top"===n?"center"===o?"n":"start"===o?"ne":"nw":"center"===o?"s":"start"===o?"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));const rt=!!navigator.userAgent.match(/Macintosh/);class at{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(!rt&&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":rt&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":rt&&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",ct)}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",ct)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(lt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(lt),o=n.indexOf(e);if(o===n.length-1&&1===t||0===o&&-1===t)return this.clearSelection(),void this.input.focus();let i=1===t?0:n.length-1;if(e&&o>=0){const e=o+t;e>=0&&e<n.length&&(i=e)}const s=n[i];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),ut(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 ct(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 lt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function ut(t,e){(function(t,e){const n=t.scrollTop,o=n+t.clientHeight,i=e.offsetTop,s=i+e.clientHeight;return i>=n&&s<=o})(t,e)||(t.scrollTop=e.offsetTop)}const dt=window.testScreenReaderDelay||100;class ht{constructor(t,e,n,o=!1){var i;if(this.container=t,this.input=e,this.results=n,this.combobox=new at(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,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(...o){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...o)}),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===(i=this.clearButton)||void 0===i||i.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)}),dt)}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),o=new URLSearchParams(n.search.slice(1));o.append("q",t),n.search=o.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,o=e.length,[i]=e,s=null==i?void 0:i.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${o} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${o||"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 ft extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const mt=new WeakMap;function pt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=mt.get(t);n&&n.abort();mt.set(t,e);const o=()=>mt.delete(t),i=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 i.then(o,o),i}(t,n)}const bt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=pt}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 o="true"===this.getAttribute("data-autoselect");bt.set(this,new ht(this,e,n,o)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=bt.get(this);t&&(t.destroy(),bt.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 o=bt.get(this);if(o)switch(t){case"open":null===n?o.close():o.open();break;case"value":null!==n&&(o.input.value=n),this.dispatchEvent(new ft("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}function gt(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 wt(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),gt(n),e.removeChild(n),Promise.resolve()}function vt(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function o(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)wt(n).then(o);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&&(i=s,i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement?wt(i.value):i instanceof HTMLAnchorElement&&i.hasAttribute("href")?wt(i.href):gt(i)).then(o)}var i}function Et(t){const e=t.currentTarget;e instanceof HTMLElement&&vt(e)}function yt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),vt(e))}}function At(t){t.currentTarget.addEventListener("keydown",yt)}function Tt(t){t.currentTarget.removeEventListener("keydown",yt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Et),this.addEventListener("focus",At),this.addEventListener("blur",Tt)}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 Mt(t){t.style.display="inline-block"}function Lt(t){t.style.display="none"}const kt=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=kt.get(t);e?(clearTimeout(e),kt.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Lt(e),Mt(n))}(t),kt.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Mt(e),Lt(n))}(t),kt.delete(t)}),2e3))}));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 t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[Ct(t,"compositionstart",(t=>Wt(this,t))),Ct(t,"compositionend",(t=>Wt(this,t))),Ct(t,"click",(e=>Ft(t,e))),Ct(t,"change",(e=>Ft(t,e))),Ct(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const o=xt.get(e);if(!o||o.isComposing)return;const i=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(qt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Rt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Rt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if($t&&n.ctrlKey){const e=Rt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if($t&&n.ctrlKey){const e=Rt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Pt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),Ct(t,"toggle",(()=>It(t,this)),{once:!0}),Ct(t,"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")}}(t))),this.preload?Ct(t,"mouseover",(()=>It(t,this)),{once:!0}):St,...Dt(t)];xt.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=xt.get(this);if(t){xt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const xt=new WeakMap,St={unsubscribe(){}};function Ct(t,e,n,o=!1){return t.addEventListener(e,n,o),{unsubscribe:()=>{t.removeEventListener(e,n,o)}}}function It(t,e){const n=e.getAttribute("src");if(!n)return;const o=xt.get(e);if(!o)return;if(o.loaded)return;o.loaded=!0;const i=e.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",(()=>Ht(t))),i.setAttribute("src",n))}function Dt(t){let e=!1;return[Ct(t,"mousedown",(()=>e=!0)),Ct(t,"keydown",(()=>e=!1)),Ct(t,"toggle",(()=>{t.hasAttribute("open")&&(Ht(t)||e||function(t){const e=document.activeElement;if(e&&Pt(e)&&t.contains(e))return;const n=Rt(t,!0);n&&n.focus()}(t))}))]}function Ht(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Rt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),o=document.activeElement,i=o instanceof HTMLElement?n.indexOf(o):-1,s=e?n[i+1]:n[i-1],r=e?n[0]:n[n.length-1];return s||r}const $t=navigator.userAgent.match(/Macintosh/);function Ft(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 o=e.querySelector("input");if("LABEL"===e.tagName&&n===o)return;"LABEL"===e.tagName&&o&&!o.checked||Ot(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Ot(e,t)}}function Ot(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 o=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(o)n.textContent=o;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 o=(n===t).toString();e instanceof HTMLInputElement&&(o=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",o)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&qt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Pt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function qt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Wt(t,e){const n=xt.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const Nt=new WeakMap,Bt=new WeakMap,Yt=new WeakMap;function Ut(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:o}=Yt.get(e)||{};if(!n||!o)return;let i=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?i=-1:"ArrowRight"===t.key&&(i=1);else if(Bt.has(e)&&t instanceof MouseEvent){const n=Bt.get(e);i=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(Bt.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=Bt.get(e);i=n-r,s=o-a}if(0!==i||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+i),o.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),o.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)Bt.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0];Bt.set(e,{dragStartX:n,dragStartY:o})}}function Xt(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=jt(e);if(!(n instanceof ImageCropElement))return;const{box:o}=Yt.get(n)||{};if(!o)return;const i=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return Vt(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=o.offsetWidth+a,r=o.offsetHeight+a,Nt.set(n,{startX:o.offsetLeft,startY:o.offsetTop})}else if(t instanceof MouseEvent){const e=Nt.get(n);if(!e)return;s=t.pageX-e.startX-i.left-window.pageXOffset,r=t.pageY-e.startY-i.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=Nt.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-i.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-i.top-window.pageYOffset}s&&r&&zt(n,s,r,!(t instanceof KeyboardEvent))}function jt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function Kt(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=jt(e);if(!(n instanceof ImageCropElement))return;const{box:o}=Yt.get(n)||{};if(!o)return;const i=t.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const e=i.getAttribute("data-direction")||"";n.addEventListener("mousemove",Xt),n.addEventListener("touchmove",Xt,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Nt.set(n,{startX:o.offsetLeft+(["se","ne"].indexOf(e)>=0?0:o.offsetWidth),startY:o.offsetTop+(["se","sw"].indexOf(e)>=0?0:o.offsetHeight)}),Xt(t)}else n.addEventListener("mousemove",Ut),n.addEventListener("touchmove",Ut,{passive:!0})}function zt(t,e,n,o=!0){let i=Math.max(Math.abs(e),Math.abs(n),10);const s=Nt.get(t);if(!s)return;const{box:r,image:a}=Yt.get(t)||{};if(!r||!a)return;i=Math.min(i,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=o?Math.round(Math.max(0,e>0?s.startX:s.startX-i)):r.offsetLeft,l=o?Math.round(Math.max(0,n>0?s.startY:s.startY-i)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${i}px`,r.style.height=`${i}px`,_t(t,{x:c,y:l,width:i,height:i})}function Vt(t){const{image:e}=Yt.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Nt.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),zt(t,n,n)}function Zt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(Bt.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",Xt),e.removeEventListener("mousemove",Ut),e.removeEventListener("touchmove",Xt),e.removeEventListener("touchmove",Ut))}function _t(t,e){const{image:n}=Yt.get(t)||{};if(!n)return;const o=n.naturalWidth/n.width;for(const n in e){const i=Math.round(e[n]*o);e[n]=i;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=i.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(Yt.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&&(Yt.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,Vt(this)})),this.addEventListener("mouseleave",Zt),this.addEventListener("touchend",Zt),this.addEventListener("mouseup",Zt),e.addEventListener("mousedown",Kt),e.addEventListener("touchstart",Kt,{passive:!0}),this.addEventListener("keydown",Ut),this.addEventListener("keydown",Xt),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:o}=Yt.get(this)||{};"src"===t&&(this.loaded=!1,o&&(o.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Jt=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Gt=["January","February","March","April","May","June","July","August","September","October","November","December"];function Qt(t){return`0${t}`.slice(-2)}function te(t,e){const n=t.getDay(),o=t.getDate(),i=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return Jt[n].slice(0,3);case"A":return Jt[n];case"b":return Gt[i].slice(0,3);case"B":return Gt[i];case"c":return t.toString();case"d":return Qt(o);case"e":return String(o);case"H":return Qt(r);case"I":return Qt(te(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return Qt(i+1);case"M":return Qt(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return Qt(c);case"w":return String(n);case"y":return Qt(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function ee(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let ne=null;const oe=ee({day:"numeric",month:"short"});function ie(){if(null!==ne)return ne;const t=oe();if(t){const e=t.format(new Date(0));return ne=!!e.match(/^\d/),ne}return!1}let se=null;const re=ee({day:"numeric",month:"short",year:"numeric"});function ae(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const ce=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const o=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?ce.delete(this):ce.set(this,new Date(t))}const i=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!i||s&&s!==o||this.setAttribute("title",i);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return ce.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=le();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const le=ee({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),ue=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||ue.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let o=ie()?"weekday day month year":"weekday month day, year";for(const e in n){const i=n[e][t.getAttribute(e)||""];o=o.replace(e,i||"")}return o=o.replace(/(\s,)|(,\s$)/,""),te(e,o).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},o=t.getAttribute("hour");"numeric"!==o&&"2-digit"!==o||(n.hour=o);const i=t.getAttribute("minute");"numeric"!==i&&"2-digit"!==i||(n.minute=i);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=ue.get(t);a||(a=ee(n),ue.set(t,a));const c=a();if(c)return c.format(e);return te(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class de{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return t<0||e<10?he(this.locale,0,"second"):e<45?he(this.locale,-e,"second"):e<90||n<45?he(this.locale,-n,"minute"):n<90||o<24?he(this.locale,-o,"hour"):o<36||i<30?he(this.locale,-i,"day"):s<18?he(this.locale,-s,"month"):he(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:o<24?`${o}h`:i<365?`${i}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return s>=18||s>=12?he(this.locale,r,"year"):i>=45||i>=30?he(this.locale,s,"month"):o>=36||o>=24?he(this.locale,i,"day"):n>=90||n>=45?he(this.locale,o,"hour"):e>=90||e>=45?he(this.locale,n,"minute"):he(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return i>=365?`${r}y`:o>=24?`${i}d`:n>=60?`${o}h`:n>1?`${n}m`:"1m"}formatDate(){let t=ie()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==se)return se;const t=re();if(t){const e=t.format(new Date(0));return se=!!e.match(/\d,/),se}return!0}()?", %Y":" %Y"),te(this.date,t)}formatTime(){const t=fe();return t?t.format(this.date):te(this.date,"%l:%M%P")}}function he(t,e,n){const o=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return o?o.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const fe=ee({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new de(t,ae(this)).toString()}connectedCallback(){me.push(this),pe||(be(),pe=window.setInterval(be,6e4)),super.connectedCallback()}disconnectedCallback(){const t=me.indexOf(this);-1!==t&&me.splice(t,1),me.length||pe&&(clearInterval(pe),pe=null)}}const me=[];let pe;function be(){let t,e,n;for(e=0,n=me.length;e<n;e++)t=me[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new de(e,ae(this)).microTimeAgo():new de(e,ae(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new de(e,ae(this)).microTimeUntil():new de(e,ae(this)).timeUntil()}}function ge(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement));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=ge(this),o=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=o+1;t>=n.length&&(t=0),we(this,t)}else if("ArrowLeft"===t.code){let t=o-1;t<0&&(t=n.length-1),we(this,t)}else"Home"===t.code?(we(this,0),t.preventDefault()):"End"===t.code&&(we(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=ge(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;we(this,e.indexOf(n))}))}connectedCallback(){for(const t of ge(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"))}}function we(t,e){const n=ge(t),o=Array.from(t.querySelectorAll('[role="tabpanel"]')).filter((e=>e.closest(t.tagName)===t)),i=n[e],s=o[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of o)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(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map