primer_view_components 0.0.83 → 0.0.86

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +50 -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/components/primer/alpha/auto_complete/auto_complete.html.erb +24 -0
  6. data/app/components/primer/alpha/auto_complete/item.rb +46 -0
  7. data/app/components/primer/alpha/auto_complete.rb +158 -0
  8. data/app/components/primer/alpha/button_marketing.rb +1 -1
  9. data/app/components/primer/alpha/text_field.rb +105 -0
  10. data/app/components/primer/alpha/tool-tip-element.d.ts +3 -1
  11. data/app/components/primer/alpha/tool-tip-element.js +20 -13
  12. data/app/components/primer/alpha/tool-tip-element.ts +23 -14
  13. data/app/components/primer/alpha/tooltip.rb +1 -1
  14. data/app/components/primer/beta/auto_complete/auto_complete.html.erb +21 -17
  15. data/app/components/primer/beta/auto_complete/item.html.erb +21 -0
  16. data/app/components/primer/beta/auto_complete/item.rb +42 -6
  17. data/app/components/primer/beta/auto_complete.rb +93 -55
  18. data/app/components/primer/beta/base_button.rb +47 -0
  19. data/app/components/primer/{alpha → beta}/border_box/header.html.erb +0 -0
  20. data/app/components/primer/{alpha → beta}/border_box/header.rb +6 -6
  21. data/app/components/primer/{border_box_component.html.erb → beta/border_box.html.erb} +0 -0
  22. data/app/components/primer/beta/border_box.rb +147 -0
  23. data/app/components/primer/blankslate_component.rb +2 -150
  24. data/app/components/primer/border_box_component.rb +2 -140
  25. data/app/components/primer/button_component.html.erb +12 -4
  26. data/app/components/primer/button_component.rb +2 -2
  27. data/app/components/primer/clipboard_copy.rb +6 -2
  28. data/app/components/primer/close_button.rb +1 -1
  29. data/app/components/primer/conditional_wrapper.rb +36 -0
  30. data/app/components/primer/hellip_button.rb +1 -1
  31. data/app/components/primer/icon_button.html.erb +6 -0
  32. data/app/components/primer/icon_button.rb +46 -10
  33. data/app/components/primer/link_component.html.erb +12 -0
  34. data/app/components/primer/link_component.rb +2 -9
  35. data/app/lib/primer/join_style_arguments_helper.rb +1 -1
  36. data/lib/primer/classify/utilities.rb +3 -6
  37. data/lib/primer/form_components.rb +36 -0
  38. data/lib/primer/forms/acts_as_component.rb +118 -0
  39. data/lib/primer/forms/base.html.erb +8 -0
  40. data/lib/primer/forms/base.rb +137 -0
  41. data/lib/primer/forms/base_component.rb +58 -0
  42. data/lib/primer/forms/buffer_rewriter.rb +50 -0
  43. data/lib/primer/forms/caption.html.erb +10 -0
  44. data/lib/primer/forms/caption.rb +29 -0
  45. data/lib/primer/forms/check_box.html.erb +9 -0
  46. data/lib/primer/forms/check_box.rb +16 -0
  47. data/lib/primer/forms/check_box_group.html.erb +12 -0
  48. data/lib/primer/forms/check_box_group.rb +14 -0
  49. data/lib/primer/forms/dsl/check_box_group_input.rb +41 -0
  50. data/lib/primer/forms/dsl/check_box_input.rb +27 -0
  51. data/lib/primer/forms/dsl/form_object.rb +25 -0
  52. data/lib/primer/forms/dsl/form_reference_input.rb +36 -0
  53. data/lib/primer/forms/dsl/hidden_input.rb +29 -0
  54. data/lib/primer/forms/dsl/input.rb +259 -0
  55. data/lib/primer/forms/dsl/input_group.rb +41 -0
  56. data/lib/primer/forms/dsl/input_methods.rb +86 -0
  57. data/lib/primer/forms/dsl/multi_input.rb +58 -0
  58. data/lib/primer/forms/dsl/radio_button_group_input.rb +38 -0
  59. data/lib/primer/forms/dsl/radio_button_input.rb +37 -0
  60. data/lib/primer/forms/dsl/select_list_input.rb +53 -0
  61. data/lib/primer/forms/dsl/submit_button_input.rb +28 -0
  62. data/lib/primer/forms/dsl/text_area_input.rb +33 -0
  63. data/lib/primer/forms/dsl/text_field_input.rb +65 -0
  64. data/lib/primer/forms/form_control.html.erb +18 -0
  65. data/lib/primer/forms/form_control.rb +23 -0
  66. data/lib/primer/forms/form_list.html.erb +5 -0
  67. data/lib/primer/forms/form_list.rb +21 -0
  68. data/lib/primer/forms/form_reference.html.erb +3 -0
  69. data/lib/primer/forms/form_reference.rb +14 -0
  70. data/lib/primer/forms/group.html.erb +5 -0
  71. data/lib/primer/forms/group.rb +27 -0
  72. data/lib/primer/forms/hidden_field.html.erb +1 -0
  73. data/lib/primer/forms/hidden_field.rb +15 -0
  74. data/lib/primer/forms/multi.html.erb +3 -0
  75. data/lib/primer/forms/multi.rb +14 -0
  76. data/lib/primer/forms/radio_button.html.erb +14 -0
  77. data/lib/primer/forms/radio_button.rb +29 -0
  78. data/lib/primer/forms/radio_button_group.html.erb +12 -0
  79. data/lib/primer/forms/radio_button_group.rb +14 -0
  80. data/lib/primer/forms/select_list.html.erb +5 -0
  81. data/lib/primer/forms/select_list.rb +26 -0
  82. data/lib/primer/forms/separator.html.erb +1 -0
  83. data/lib/primer/forms/separator.rb +8 -0
  84. data/lib/primer/forms/spacing_wrapper.html.erb +3 -0
  85. data/lib/primer/forms/spacing_wrapper.rb +8 -0
  86. data/lib/primer/forms/submit_button.html.erb +4 -0
  87. data/lib/primer/forms/submit_button.rb +50 -0
  88. data/lib/primer/forms/text_area.html.erb +5 -0
  89. data/lib/primer/forms/text_area.rb +16 -0
  90. data/lib/primer/forms/text_field.html.erb +19 -0
  91. data/lib/primer/forms/text_field.rb +14 -0
  92. data/lib/primer/view_components/engine.rb +23 -0
  93. data/lib/primer/view_components/linters/argument_mappers/button.rb +2 -2
  94. data/lib/primer/view_components/linters/button_component_migration_counter.rb +1 -1
  95. data/lib/primer/view_components/linters/helpers/deprecated_components_helpers.rb +4 -8
  96. data/lib/primer/view_components/version.rb +1 -1
  97. data/lib/rubocop/cop/primer/component_name_migration.rb +3 -0
  98. data/lib/tasks/deprecated.rake +22 -0
  99. data/lib/tasks/docs.rake +8 -6
  100. data/static/arguments.yml +188 -52
  101. data/static/audited_at.json +7 -2
  102. data/static/classes.yml +25 -8
  103. data/static/constants.json +66 -39
  104. data/static/statuses.json +8 -3
  105. metadata +71 -7
  106. data/app/components/primer/base_button.rb +0 -43
  107. data/app/components/primer/blankslate_component.html.erb +0 -30
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f590f1c0d966e26b387252db1b83998d5acfb5aacd2d5e4fd5171b52557ecce0
4
- data.tar.gz: 85257456daac921ff79dbaf22340b2ce1bad6a5faefc59d275294c339bbfd38b
3
+ metadata.gz: f85b7d98dc85b59a5312ea5c3c5cfe35c966a1ad495263837032249bc7782d89
4
+ data.tar.gz: d4829969cc3672f7e3e492e3179d48f75fe9cd2299fa03b2153b5d2892ed04b4
5
5
  SHA512:
6
- metadata.gz: 351d15d09d3eca4e61a736d392a38bc0d611909f05b5edd26dcbd6edf4aff4619bfcf827cfd9a2489a3e6e63bef28375826b3757ede4e20f26ae7081a565bab3
7
- data.tar.gz: 247c094bd647052cf34a8d9c90994ca8e60ae983d3addb9540a78a1aa38b8fc3ee5ca3c7cbd6e493fda071c133b43f4de177827edb7eaaeac971aa3c59811c0e
6
+ metadata.gz: 7270b517ed8032991f97b9369975704fb8596efaf5867f73987b8a0993ef9809df91a4e3673ceb17e29699cb975143ce5644c677ac68149b54e28ada734d2df8
7
+ data.tar.gz: e512281e87914e23b3dd7b24c1bd5b1bd89d531e97f733687f872dc8d2bff56079810f5017686af4b84ee7cd05e56e1231d56058a67ccbaca1b0b0ea0c210928
data/CHANGELOG.md CHANGED
@@ -1,5 +1,55 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.86
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1247](https://github.com/primer/view_components/pull/1247) [`dbe606b7`](https://github.com/primer/view_components/commit/dbe606b7f38ba52f24edeae2f02f390ad13133ab) Thanks [@khiga8](https://github.com/khiga8)! - Set `aria-hidden="true"` when type is label
8
+
9
+ * [#1262](https://github.com/primer/view_components/pull/1262) [`4a347b69`](https://github.com/primer/view_components/commit/4a347b6965990c1d73296d297367cb72b36539d2) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - updating the component migrator to support `--status stable`
10
+
11
+ - [#1244](https://github.com/primer/view_components/pull/1244) [`91a6d2df`](https://github.com/primer/view_components/commit/91a6d2df032fbb21ccaf3edc07b86f3c97b1add0) Thanks [@neall](https://github.com/neall)! - Stop requiring aria-label on ClipboardCopy with other content.
12
+
13
+ * [#1256](https://github.com/primer/view_components/pull/1256) [`544dd564`](https://github.com/primer/view_components/commit/544dd5647da64c06020d3ae7719f9b6ad32bee55) Thanks [@khiga8](https://github.com/khiga8)! - Use `visibility: 'hidden'` instead of `hidden` attribute to hide tooltip
14
+
15
+ - [#1238](https://github.com/primer/view_components/pull/1238) [`204a8e4e`](https://github.com/primer/view_components/commit/204a8e4e11931061f7a855b79f90c7aaa2e51945) Thanks [@camertron](https://github.com/camertron)! - Merge primer/rails_forms into primer/view_components
16
+
17
+ * [#1265](https://github.com/primer/view_components/pull/1265) [`61a78c4f`](https://github.com/primer/view_components/commit/61a78c4f3362fc532149ddf5090252dd3af9122d) Thanks [@jonrohan](https://github.com/jonrohan)! - Update IconButton and Button tooltips to be sibling instead of child
18
+
19
+ - [#1255](https://github.com/primer/view_components/pull/1255) [`3729a9bf`](https://github.com/primer/view_components/commit/3729a9bfed5d1dbe40510b6a783212453fcc08d3) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - migrating `Primer::BorderBoxComponent` to `Primer::Beta::BorderBox`
20
+
21
+ * [#1241](https://github.com/primer/view_components/pull/1241) [`918cfe3f`](https://github.com/primer/view_components/commit/918cfe3f143e5fe30dfb4db1dd46449bc54a0a87) Thanks [@jonrohan](https://github.com/jonrohan)! - Deprecating the `Primer::Alpha::Autocomplete` component
22
+
23
+ - [#1062](https://github.com/primer/view_components/pull/1062) [`4b673a6c`](https://github.com/primer/view_components/commit/4b673a6c1ec9f0bc0710128fc365448e94d7b387) Thanks [@hectahertz](https://github.com/hectahertz)! - Add `Tooltip` support to `IconButton`
24
+
25
+ * [#1261](https://github.com/primer/view_components/pull/1261) [`8191b80d`](https://github.com/primer/view_components/commit/8191b80de219f100c07cea9d9fdabfa9f50f6e1e) Thanks [@camertron](https://github.com/camertron)! - Make all subdirs of docs/static in prepare script
26
+
27
+ - [#1260](https://github.com/primer/view_components/pull/1260) [`1a6562fe`](https://github.com/primer/view_components/commit/1a6562fe46503e21aade77df1f6ae542cbc2ddd6) Thanks [@khiga8](https://github.com/khiga8)! - Move tooltip to be sibling of link
28
+
29
+ * [#1258](https://github.com/primer/view_components/pull/1258) [`d3880f74`](https://github.com/primer/view_components/commit/d3880f74d4fe20ad1a81c9b40af10c67dda52369) Thanks [@camertron](https://github.com/camertron)! - Replace YAML load with YAML safe load with allowed classes list
30
+
31
+ - [#1254](https://github.com/primer/view_components/pull/1254) [`fc2fbace`](https://github.com/primer/view_components/commit/fc2fbace9c4728dea582df40efde118cfe8ac6a8) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - cleaning up the BlankSlate component to ensure it follows current standards for beta components
32
+
33
+ ## 0.0.85
34
+
35
+ ### Patch Changes
36
+
37
+ - [#1239](https://github.com/primer/view_components/pull/1239) [`bc9e8385`](https://github.com/primer/view_components/commit/bc9e8385894b708929d0e58a63681572493f090e) Thanks [@langermank](https://github.com/langermank)! - Remove deprecated params added for autocomplete beta
38
+
39
+ ## 0.0.84
40
+
41
+ ### Patch Changes
42
+
43
+ - [#1189](https://github.com/primer/view_components/pull/1189) [`ec3af746`](https://github.com/primer/view_components/commit/ec3af746dceb8e4a0c967fe270f149d48e81489b) Thanks [@langermank](https://github.com/langermank)! - Autocomplete design updates
44
+
45
+ * [#1229](https://github.com/primer/view_components/pull/1229) [`5631d286`](https://github.com/primer/view_components/commit/5631d286c559cf4bbb96b85c0bb41dbeda5953d4) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - component generator: correcting template and thor tasks to account for component status
46
+
47
+ - [#1232](https://github.com/primer/view_components/pull/1232) [`3a154bf4`](https://github.com/primer/view_components/commit/3a154bf4452f5ed8f7694eb917c13258d34ff6c0) Thanks [@jonrohan](https://github.com/jonrohan)! - Consolidating view_components previews into test/previews/ folder
48
+
49
+ * [#1224](https://github.com/primer/view_components/pull/1224) [`2fc38746`](https://github.com/primer/view_components/commit/2fc387460e5f185463cbca8ffe0f098a06e2dec8) Thanks [@camertron](https://github.com/camertron)! - Add the ConditionalWrapper for conditionally wrapping content
50
+
51
+ - [#1234](https://github.com/primer/view_components/pull/1234) [`ee04a4a9`](https://github.com/primer/view_components/commit/ee04a4a937c56156b3232552c7d10b0ec0336ab7) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - updating links in the contributing docs to point to correct locations
52
+
3
53
  ## 0.0.83
4
54
 
5
55
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.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",n)}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",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(i)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(i),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),o(this.list,a)):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 n(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 i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function o(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const s=window.testScreenReaderDelay||100;class r{constructor(t,n,i,o=!1){var s;if(this.container=t,this.input=n,this.results=i,this.combobox=new e(n,i),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.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)}),s)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class a extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const c=new WeakMap;function l(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=c.get(t);n&&n.abort();c.set(t,e);const i=()=>c.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const u=new WeakMap;class d extends HTMLElement{constructor(){super(...arguments),this.fetchResult=l}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");u.set(this,new r(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=u.get(this);t&&(t.destroy(),u.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=u.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new a("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function h(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 f(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),h(n),e.removeChild(n),Promise.resolve()}function m(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)f(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?f(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?f(o.href):h(o)).then(i)}var o}function p(t){const e=t.currentTarget;e instanceof HTMLElement&&m(e)}function b(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),m(e))}}function g(t){t.currentTarget.addEventListener("keydown",b)}function w(t){t.currentTarget.removeEventListener("keydown",b)}window.customElements.get("auto-complete")||(window.AutocompleteElement=d,window.customElements.define("auto-complete",d));class v extends HTMLElement{constructor(){super(),this.addEventListener("click",p),this.addEventListener("focus",g),this.addEventListener("blur",w)}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=v,window.customElements.define("clipboard-copy",v));function y(t){t.style.display="inline-block"}function E(t){t.style.display="none"}const A=new WeakMap;function x(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=A.get(t);e?(clearTimeout(e),A.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(E(e),y(n))}(t),A.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),E(n))}(t),A.delete(t)}),2e3))}));class k 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=x(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),M(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),M(this,t)}else"Home"===t.code?(M(this,0),t.preventDefault()):"End"===t.code&&(M(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=x(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;M(this,e.indexOf(n))}))}connectedCallback(){for(const t of x(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 M(t,e){const n=x(t),i=Array.from(t.querySelectorAll('[role="tabpanel"]')).filter((e=>e.closest(t.tagName)===t)),o=n[e],s=i[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 i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=k,window.customElements.define("tab-container",k));const T=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],L=["January","February","March","April","May","June","July","August","September","October","November","December"];function C(t){return`0${t}`.slice(-2)}function S(t,e){const n=t.getDay(),i=t.getDate(),o=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 T[n].slice(0,3);case"A":return T[n];case"b":return L[o].slice(0,3);case"B":return L[o];case"c":return t.toString();case"d":return C(i);case"e":return String(i);case"H":return C(r);case"I":return C(S(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return C(o+1);case"M":return C(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return C(c);case"w":return String(n);case"y":return C(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 H(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 D=null;const $=H({day:"numeric",month:"short"});function R(){if(null!==D)return D;const t=$();if(t){const e=t.format(new Date(0));return D=!!e.match(/^\d/),D}return!1}let F=null;const I=H({day:"numeric",month:"short",year:"numeric"});function q(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const W=new WeakMap;class B 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 i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?W.delete(this):W.set(this,new Date(t))}const o=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!o||s&&s!==i||this.setAttribute("title",o);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return W.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=O();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const O=H({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),Y=new WeakMap;class X extends B{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||Y.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 i=R()?"weekday day month year":"weekday month day, year";for(const e in n){const o=n[e][t.getAttribute(e)||""];i=i.replace(e,o||"")}return i=i.replace(/(\s,)|(,\s$)/,""),S(e,i).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const o=t.getAttribute("minute");"numeric"!==o&&"2-digit"!==o||(n.minute=o);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=Y.get(t);a||(a=H(n),Y.set(t,a));const c=a();if(c)return c.format(e);return S(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=X,window.customElements.define("local-time",X));class N{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),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return t<0||e<10?K(this.locale,0,"second"):e<45?K(this.locale,-e,"second"):e<90||n<45?K(this.locale,-n,"minute"):n<90||i<24?K(this.locale,-i,"hour"):i<36||o<30?K(this.locale,-o,"day"):s<18?K(this.locale,-s,"month"):K(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:i<24?`${i}h`:o<365?`${o}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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return s>=18||s>=12?K(this.locale,r,"year"):o>=45||o>=30?K(this.locale,s,"month"):i>=36||i>=24?K(this.locale,o,"day"):n>=90||n>=45?K(this.locale,i,"hour"):e>=90||e>=45?K(this.locale,n,"minute"):K(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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return o>=365?`${r}y`:i>=24?`${o}d`:n>=60?`${i}h`:n>1?`${n}m`:"1m"}formatDate(){let t=R()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==F)return F;const t=I();if(t){const e=t.format(new Date(0));return F=!!e.match(/\d,/),F}return!0}()?", %Y":" %Y"),S(this.date,t)}formatTime(){const t=P();return t?t.format(this.date):S(this.date,"%l:%M%P")}}function K(t,e,n){const i=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 i?i.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 P=H({hour:"numeric",minute:"2-digit"});class U extends B{getFormattedDate(){const t=this.date;if(t)return new N(t,q(this)).toString()}connectedCallback(){z.push(this),j||(Z(),j=window.setInterval(Z,6e4)),super.connectedCallback()}disconnectedCallback(){const t=z.indexOf(this);-1!==t&&z.splice(t,1),z.length||j&&(clearInterval(j),j=null)}}const z=[];let j;function Z(){let t,e,n;for(e=0,n=z.length;e<n;e++)t=z[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=U,window.customElements.define("relative-time",U));class J extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new N(e,q(this)).microTimeAgo():new N(e,q(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=J,window.customElements.define("time-ago",J));class G extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new N(e,q(this)).microTimeUntil():new N(e,q(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=G,window.customElements.define("time-until",G));const Q=new WeakMap,V=new WeakMap,_=new WeakMap;function tt(t){const e=t.currentTarget;if(!(e instanceof ct))return;const{box:n,image:i}=_.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(V.has(e)&&t instanceof MouseEvent){const n=V.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(V.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=V.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,at(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)V.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];V.set(e,{dragStartX:n,dragStartY:i})}}function et(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=nt(e);if(!(n instanceof ct))return;const{box:i}=_.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return st(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Q.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Q.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=Q.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&ot(n,s,r,!(t instanceof KeyboardEvent))}function nt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function it(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=nt(e);if(!(n instanceof ct))return;const{box:i}=_.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",et),n.addEventListener("touchmove",et,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Q.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),et(t)}else n.addEventListener("mousemove",tt),n.addEventListener("touchmove",tt,{passive:!0})}function ot(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Q.get(t);if(!s)return;const{box:r,image:a}=_.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,l=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,at(t,{x:c,y:l,width:o,height:o})}function st(t){const{image:e}=_.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Q.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),ot(t,n,n)}function rt(t){const e=t.currentTarget;e instanceof ct&&(V.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",et),e.removeEventListener("mousemove",tt),e.removeEventListener("touchmove",et),e.removeEventListener("touchmove",tt))}function at(t,e){const{image:n}=_.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ct extends HTMLElement{connectedCallback(){if(_.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&&(_.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,st(this)})),this.addEventListener("mouseleave",rt),this.addEventListener("touchend",rt),this.addEventListener("mouseup",rt),e.addEventListener("mousedown",it),e.addEventListener("touchstart",it,{passive:!0}),this.addEventListener("keydown",tt),this.addEventListener("keydown",et),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=_.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ct,window.customElements.define("image-crop",ct));class lt 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=[ht(t,"compositionstart",(t=>At(this,t))),ht(t,"compositionend",(t=>At(this,t))),ht(t,"click",(e=>wt(t,e))),ht(t,"change",(e=>wt(t,e))),ht(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=ut.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(Et(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=bt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=bt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(gt&&n.ctrlKey){const e=bt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(gt&&n.ctrlKey){const e=bt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&yt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),ht(t,"toggle",(()=>ft(t,this)),{once:!0}),ht(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?ht(t,"mouseover",(()=>ft(t,this)),{once:!0}):dt,...mt(t)];ut.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=ut.get(this);if(t){ut.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const ut=new WeakMap,dt={unsubscribe(){}};function ht(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function ft(t,e){const n=e.getAttribute("src");if(!n)return;const i=ut.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>pt(t))),o.setAttribute("src",n))}function mt(t){let e=!1;return[ht(t,"mousedown",(()=>e=!0)),ht(t,"keydown",(()=>e=!1)),ht(t,"toggle",(()=>{t.hasAttribute("open")&&(pt(t)||e||function(t){const e=document.activeElement;if(e&&yt(e)&&t.contains(e))return;const n=bt(t,!0);n&&n.focus()}(t))}))]}function pt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function bt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const gt=navigator.userAgent.match(/Macintosh/);function wt(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||vt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&vt(e,t)}}function vt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Et(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function yt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Et(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function At(t,e){const n=ut.get(t);n&&(n.isComposing="compositionstart"===e.type)}function xt(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function kt(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=lt,window.customElements.define("details-menu",lt));const Mt={"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"]},Tt={start:["end","center"],end:["start","center"],center:["end","start"]};function Lt(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,c]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-c,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=Rt(n,i,o,s,a,c),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=Mt[o];let f=0;if(r){let t=o;for(;f<r.length&&Ft(t,u,l,n);){const o=r[f++];t=o,u=Rt(n,i,o,s,a,c),u.top-=e.top,u.left-=e.left,d=o}}const m=Tt[s];let p=0;if(m){let t=s;for(;p<m.length&&It(t,u,l,n);){const o=m[p++];t=o,u=Rt(n,i,d,o,a,c),u.top-=e.top,u.left-=e.left,h=o}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&f<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+c},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:Ct,a=null!==(n=t.align)&&void 0!==n?n:St;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:Ht,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?Dt:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:$t}}(n))}const Ct="outside-bottom",St="start",Ht=4,Dt=4,$t=!1;function Rt(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-o-t.height:"outside-bottom"===n?c=a+o:"outside-left"===n?l=e.left-o-t.width:"outside-right"===n&&(l=r+o),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+o:"inside-bottom"===n?c=a-o-t.height:"inside-left"===n?l=e.left+o:"inside-right"===n?l=r-o-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?l="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function Ft(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function It(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}var qt,Wt,Bt,Ot,Yt,Xt,Nt;const Kt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class Pt extends HTMLElement{constructor(){super(...arguments),qt.add(this),Wt.set(this,void 0),Bt.set(this,"center"),Ot.set(this,"outside-bottom"),Yt.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)}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hidden=!0,kt(this,Yt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=xt(this,Wt,"f"))||void 0===t||t.abort(),kt(this,Wt,new AbortController,"f");const{signal:e}=xt(this,Wt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),xt(this,qt,"m",Xt).call(this)}disconnectedCallback(){var t;null===(t=xt(this,Wt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hidden?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:"keydown"!==t.type||"Escape"!==t.key||this.hidden||(this.hidden=!0):this.hidden=!1)}attributeChangedCallback(t){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;if("label"===this.type)this.control.setAttribute("aria-labelledby",this.id);else{let t=this.control.getAttribute("aria-describedby");t=t?`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}}else if(this.isConnected&&"hidden"===t)xt(this,qt,"m",Xt).call(this);else if("data-direction"===t){this.classList.remove(...Kt);const t=this.direction;"n"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-top","f")):"ne"===t?(kt(this,Bt,"start","f"),kt(this,Ot,"outside-top","f")):"e"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-right","f")):"se"===t?(kt(this,Bt,"start","f"),kt(this,Ot,"outside-bottom","f")):"s"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-bottom","f")):"sw"===t?(kt(this,Bt,"end","f"),kt(this,Ot,"outside-bottom","f")):"w"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-left","f")):"nw"===t&&(kt(this,Bt,"end","f"),kt(this,Ot,"outside-top","f"))}}}Wt=new WeakMap,Bt=new WeakMap,Ot=new WeakMap,Yt=new WeakMap,qt=new WeakSet,Xt=function(){if(this.hidden)this.classList.remove("tooltip-open",...Kt);else{this.classList.add("tooltip-open");for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hidden=!0);xt(this,qt,"m",Nt).call(this)}},Nt=function(){if(!this.control)return;if(!xt(this,Yt,"f")||this.hidden)return;this.style.left="0px";const t=Lt(this,this.control,{side:xt(this,Ot,"f"),align:xt(this,Bt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},Pt.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("tool-tip")||(window.ToolTipElement=Pt,window.customElements.define("tool-tip",Pt));
1
+ const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.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",n)}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",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(i)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(i),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),o(this.list,a)):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 n(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 i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function o(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const s=window.testScreenReaderDelay||100;class r{constructor(t,n,i,o=!1){var s;if(this.container=t,this.input=n,this.results=i,this.combobox=new e(n,i),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=i.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(s=this.clearButton)||void 0===s||s.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)}),s)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class a extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const c=new WeakMap;function l(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=c.get(t);n&&n.abort();c.set(t,e);const i=()=>c.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const u=new WeakMap;class d extends HTMLElement{constructor(){super(...arguments),this.fetchResult=l}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");u.set(this,new r(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=u.get(this);t&&(t.destroy(),u.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=u.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new a("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function h(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 f(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),h(n),e.removeChild(n),Promise.resolve()}function m(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)f(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?f(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?f(o.href):h(o)).then(i)}var o}function p(t){const e=t.currentTarget;e instanceof HTMLElement&&m(e)}function b(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),m(e))}}function g(t){t.currentTarget.addEventListener("keydown",b)}function w(t){t.currentTarget.removeEventListener("keydown",b)}window.customElements.get("auto-complete")||(window.AutocompleteElement=d,window.customElements.define("auto-complete",d));class v extends HTMLElement{constructor(){super(),this.addEventListener("click",p),this.addEventListener("focus",g),this.addEventListener("blur",w)}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=v,window.customElements.define("clipboard-copy",v));function y(t){t.style.display="inline-block"}function E(t){t.style.display="none"}const A=new WeakMap;function x(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=A.get(t);e?(clearTimeout(e),A.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(E(e),y(n))}(t),A.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),E(n))}(t),A.delete(t)}),2e3))}));class k 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=x(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),M(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),M(this,t)}else"Home"===t.code?(M(this,0),t.preventDefault()):"End"===t.code&&(M(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=x(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;M(this,e.indexOf(n))}))}connectedCallback(){for(const t of x(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 M(t,e){const n=x(t),i=Array.from(t.querySelectorAll('[role="tabpanel"]')).filter((e=>e.closest(t.tagName)===t)),o=n[e],s=i[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 i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=k,window.customElements.define("tab-container",k));const T=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],L=["January","February","March","April","May","June","July","August","September","October","November","December"];function C(t){return`0${t}`.slice(-2)}function S(t,e){const n=t.getDay(),i=t.getDate(),o=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 T[n].slice(0,3);case"A":return T[n];case"b":return L[o].slice(0,3);case"B":return L[o];case"c":return t.toString();case"d":return C(i);case"e":return String(i);case"H":return C(r);case"I":return C(S(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return C(o+1);case"M":return C(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return C(c);case"w":return String(n);case"y":return C(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 H(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 D=null;const $=H({day:"numeric",month:"short"});function R(){if(null!==D)return D;const t=$();if(t){const e=t.format(new Date(0));return D=!!e.match(/^\d/),D}return!1}let F=null;const I=H({day:"numeric",month:"short",year:"numeric"});function q(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const W=new WeakMap;class B 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 i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?W.delete(this):W.set(this,new Date(t))}const o=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!o||s&&s!==i||this.setAttribute("title",o);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return W.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=O();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const O=H({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),Y=new WeakMap;class X extends B{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||Y.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 i=R()?"weekday day month year":"weekday month day, year";for(const e in n){const o=n[e][t.getAttribute(e)||""];i=i.replace(e,o||"")}return i=i.replace(/(\s,)|(,\s$)/,""),S(e,i).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const o=t.getAttribute("minute");"numeric"!==o&&"2-digit"!==o||(n.minute=o);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=Y.get(t);a||(a=H(n),Y.set(t,a));const c=a();if(c)return c.format(e);return S(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=X,window.customElements.define("local-time",X));class N{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),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return t<0||e<10?K(this.locale,0,"second"):e<45?K(this.locale,-e,"second"):e<90||n<45?K(this.locale,-n,"minute"):n<90||i<24?K(this.locale,-i,"hour"):i<36||o<30?K(this.locale,-o,"day"):s<18?K(this.locale,-s,"month"):K(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:i<24?`${i}h`:o<365?`${o}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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return s>=18||s>=12?K(this.locale,r,"year"):o>=45||o>=30?K(this.locale,s,"month"):i>=36||i>=24?K(this.locale,o,"day"):n>=90||n>=45?K(this.locale,i,"hour"):e>=90||e>=45?K(this.locale,n,"minute"):K(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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return o>=365?`${r}y`:i>=24?`${o}d`:n>=60?`${i}h`:n>1?`${n}m`:"1m"}formatDate(){let t=R()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==F)return F;const t=I();if(t){const e=t.format(new Date(0));return F=!!e.match(/\d,/),F}return!0}()?", %Y":" %Y"),S(this.date,t)}formatTime(){const t=P();return t?t.format(this.date):S(this.date,"%l:%M%P")}}function K(t,e,n){const i=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 i?i.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 P=H({hour:"numeric",minute:"2-digit"});class U extends B{getFormattedDate(){const t=this.date;if(t)return new N(t,q(this)).toString()}connectedCallback(){z.push(this),j||(Z(),j=window.setInterval(Z,6e4)),super.connectedCallback()}disconnectedCallback(){const t=z.indexOf(this);-1!==t&&z.splice(t,1),z.length||j&&(clearInterval(j),j=null)}}const z=[];let j;function Z(){let t,e,n;for(e=0,n=z.length;e<n;e++)t=z[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=U,window.customElements.define("relative-time",U));class J extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new N(e,q(this)).microTimeAgo():new N(e,q(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=J,window.customElements.define("time-ago",J));class G extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new N(e,q(this)).microTimeUntil():new N(e,q(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=G,window.customElements.define("time-until",G));const Q=new WeakMap,V=new WeakMap,_=new WeakMap;function tt(t){const e=t.currentTarget;if(!(e instanceof ct))return;const{box:n,image:i}=_.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(V.has(e)&&t instanceof MouseEvent){const n=V.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(V.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=V.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,at(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)V.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];V.set(e,{dragStartX:n,dragStartY:i})}}function et(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=nt(e);if(!(n instanceof ct))return;const{box:i}=_.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return st(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Q.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Q.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=Q.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&ot(n,s,r,!(t instanceof KeyboardEvent))}function nt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function it(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=nt(e);if(!(n instanceof ct))return;const{box:i}=_.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",et),n.addEventListener("touchmove",et,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Q.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),et(t)}else n.addEventListener("mousemove",tt),n.addEventListener("touchmove",tt,{passive:!0})}function ot(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Q.get(t);if(!s)return;const{box:r,image:a}=_.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,l=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,at(t,{x:c,y:l,width:o,height:o})}function st(t){const{image:e}=_.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Q.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),ot(t,n,n)}function rt(t){const e=t.currentTarget;e instanceof ct&&(V.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",et),e.removeEventListener("mousemove",tt),e.removeEventListener("touchmove",et),e.removeEventListener("touchmove",tt))}function at(t,e){const{image:n}=_.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ct extends HTMLElement{connectedCallback(){if(_.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&&(_.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,st(this)})),this.addEventListener("mouseleave",rt),this.addEventListener("touchend",rt),this.addEventListener("mouseup",rt),e.addEventListener("mousedown",it),e.addEventListener("touchstart",it,{passive:!0}),this.addEventListener("keydown",tt),this.addEventListener("keydown",et),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=_.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ct,window.customElements.define("image-crop",ct));class lt 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=[ht(t,"compositionstart",(t=>At(this,t))),ht(t,"compositionend",(t=>At(this,t))),ht(t,"click",(e=>wt(t,e))),ht(t,"change",(e=>wt(t,e))),ht(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=ut.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(Et(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=bt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=bt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(gt&&n.ctrlKey){const e=bt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(gt&&n.ctrlKey){const e=bt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&yt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),ht(t,"toggle",(()=>ft(t,this)),{once:!0}),ht(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?ht(t,"mouseover",(()=>ft(t,this)),{once:!0}):dt,...mt(t)];ut.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=ut.get(this);if(t){ut.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const ut=new WeakMap,dt={unsubscribe(){}};function ht(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function ft(t,e){const n=e.getAttribute("src");if(!n)return;const i=ut.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>pt(t))),o.setAttribute("src",n))}function mt(t){let e=!1;return[ht(t,"mousedown",(()=>e=!0)),ht(t,"keydown",(()=>e=!1)),ht(t,"toggle",(()=>{t.hasAttribute("open")&&(pt(t)||e||function(t){const e=document.activeElement;if(e&&yt(e)&&t.contains(e))return;const n=bt(t,!0);n&&n.focus()}(t))}))]}function pt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function bt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const gt=navigator.userAgent.match(/Macintosh/);function wt(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||vt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&vt(e,t)}}function vt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&Et(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function yt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function Et(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function At(t,e){const n=ut.get(t);n&&(n.isComposing="compositionstart"===e.type)}function xt(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function kt(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("details-menu")||(window.DetailsMenuElement=lt,window.customElements.define("details-menu",lt));const Mt={"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"]},Tt={start:["end","center"],end:["start","center"],center:["end","start"]};function Lt(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,c]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-c,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=Rt(n,i,o,s,a,c),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=Mt[o];let f=0;if(r){let t=o;for(;f<r.length&&Ft(t,u,l,n);){const o=r[f++];t=o,u=Rt(n,i,o,s,a,c),u.top-=e.top,u.left-=e.left,d=o}}const m=Tt[s];let p=0;if(m){let t=s;for(;p<m.length&&It(t,u,l,n);){const o=m[p++];t=o,u=Rt(n,i,d,o,a,c),u.top-=e.top,u.left-=e.left,h=o}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&f<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+c},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:Ct,a=null!==(n=t.align)&&void 0!==n?n:St;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:Ht,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?Dt:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:$t}}(n))}const Ct="outside-bottom",St="start",Ht=4,Dt=4,$t=!1;function Rt(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-o-t.height:"outside-bottom"===n?c=a+o:"outside-left"===n?l=e.left-o-t.width:"outside-right"===n&&(l=r+o),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+o:"inside-bottom"===n?c=a-o-t.height:"inside-left"===n?l=e.left+o:"inside-right"===n?l=r-o-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?l="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function Ft(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function It(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}var qt,Wt,Bt,Ot,Yt,Xt,Nt;const Kt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class Pt extends HTMLElement{constructor(){super(...arguments),qt.add(this),Wt.set(this,void 0),Bt.set(this,"center"),Ot.set(this,"outside-bottom"),Yt.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 visibilityHidden(t){this.style.visibility=t?"hidden":""}get visibilityHidden(){return"hidden"===this.style.visibility}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.visibilityHidden=!0,kt(this,Yt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=xt(this,Wt,"f"))||void 0===t||t.abort(),kt(this,Wt,new AbortController,"f");const{signal:e}=xt(this,Wt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),xt(this,qt,"m",Xt).call(this)}disconnectedCallback(){var t;null===(t=xt(this,Wt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.visibilityHidden?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.visibilityHidden=!0:"keydown"!==t.type||"Escape"!==t.key||this.visibilityHidden||(this.visibilityHidden=!0):this.visibilityHidden=!1)}attributeChangedCallback(t,e,n){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;if("label"===this.type)this.control.setAttribute("aria-labelledby",this.id),this.setAttribute("aria-hidden","true");else{let t=this.control.getAttribute("aria-describedby");t=t?`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}}else if(this.isConnected&&"style"===t&&e&&e.includes("visibility")||n&&n.includes("visibility"))xt(this,qt,"m",Xt).call(this);else if("data-direction"===t){this.classList.remove(...Kt);const t=this.direction;"n"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-top","f")):"ne"===t?(kt(this,Bt,"start","f"),kt(this,Ot,"outside-top","f")):"e"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-right","f")):"se"===t?(kt(this,Bt,"start","f"),kt(this,Ot,"outside-bottom","f")):"s"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-bottom","f")):"sw"===t?(kt(this,Bt,"end","f"),kt(this,Ot,"outside-bottom","f")):"w"===t?(kt(this,Bt,"center","f"),kt(this,Ot,"outside-left","f")):"nw"===t&&(kt(this,Bt,"end","f"),kt(this,Ot,"outside-top","f"))}}}Wt=new WeakMap,Bt=new WeakMap,Ot=new WeakMap,Yt=new WeakMap,qt=new WeakSet,Xt=function(){if(this.visibilityHidden)this.classList.remove("tooltip-open",...Kt);else{this.classList.add("tooltip-open");for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.visibilityHidden=!0);xt(this,qt,"m",Nt).call(this)}},Nt=function(){if(!this.control)return;if(!xt(this,Yt,"f")||this.visibilityHidden)return;this.style.left="0px";const t=Lt(this,this.control,{side:xt(this,Ot,"f"),align:xt(this,Bt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},Pt.observedAttributes=["data-type","data-direction","id","style"],window.customElements.get("tool-tip")||(window.ToolTipElement=Pt,window.customElements.define("tool-tip",Pt));
2
2
  //# sourceMappingURL=primer_view_components.js.map