avo 2.5.2.pre.5 → 2.5.2.pre.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of avo might be problematic. Click here for more details.

@@ -38,14 +38,15 @@ class Avo::ButtonComponent < ViewComponent::Base
38
38
  end
39
39
 
40
40
  def button_classes
41
- classes = "button-component inline-flex flex-grow-0 items-center text-sm font-semibold leading-6 fill-current whitespace-nowrap transition duration-100 transform transition duration-100 cursor-pointer disabled:cursor-not-allowed disabled:opacity-70 border justify-center active:outline active:outline-1 #{@class}"
41
+ classes = "button-component inline-flex flex-grow-0 items-center font-semibold leading-6 fill-current whitespace-nowrap transition duration-100 transform transition duration-100 cursor-pointer disabled:cursor-not-allowed disabled:opacity-70 border justify-center active:outline active:outline-1 #{@class}"
42
42
 
43
43
  classes += " rounded" if @rounded.present?
44
44
 
45
45
  classes += style_classes
46
46
 
47
- classes += @compact ? " px-1" : " px-4" # Same horizontal padding on all sizes
47
+ classes += padding_classes
48
48
  classes += spacing_classes
49
+ classes += text_size_classes
49
50
 
50
51
  classes
51
52
  end
@@ -57,10 +58,14 @@ class Avo::ButtonComponent < ViewComponent::Base
57
58
  def full_content
58
59
  result = ""
59
60
  icon_classes = @icon_class
60
- icon_classes += full_content_icon_classes
61
+ # space out the icon from the text if text is present
62
+ icon_classes += " mr-1" if content.present?
63
+ # add the icon height
64
+ icon_classes += icon_size_classes
61
65
 
66
+ # Add the icon
62
67
  result += helpers.svg(@icon, class: icon_classes) if @icon.present?
63
- result += "<span class='w-0 m-0'>&nbsp;</span>"
68
+
64
69
  if content.present?
65
70
  result += "<span>#{content}</span>"
66
71
  end
@@ -103,14 +108,44 @@ class Avo::ButtonComponent < ViewComponent::Base
103
108
  when :sm
104
109
  " py-1"
105
110
  when :md
106
- " py-2"
111
+ " py-1.5"
107
112
  when :lg
113
+ " py-2"
114
+ when :xl
108
115
  " py-3"
109
116
  else
110
117
  ""
111
118
  end
112
119
  end
113
120
 
121
+ def padding_classes
122
+ return " px-1" if @compact
123
+
124
+ case @size.to_sym
125
+ when :xs
126
+ " px-2"
127
+ when :sm
128
+ " px-3"
129
+ when :md
130
+ " px-3"
131
+ when :lg
132
+ " px-5"
133
+ when :xl
134
+ " px-6"
135
+ else
136
+ "px-4"
137
+ end
138
+ end
139
+
140
+ def text_size_classes
141
+ case @size.to_sym
142
+ when :xs
143
+ " text-xs"
144
+ else
145
+ " text-sm"
146
+ end
147
+ end
148
+
114
149
  def style_classes
115
150
  case @style
116
151
  when :primary
@@ -118,13 +153,13 @@ class Avo::ButtonComponent < ViewComponent::Base
118
153
  when :outline
119
154
  " bg-white text-#{@color}-500 border-#{@color}-500 hover:bg-#{@color}-100 active:bg-#{@color}-100 active:border-#{@color}-500 active:outline-#{@color}-500"
120
155
  when :text
121
- " text-#{@color}-500 active:outline-#{@color}-500 border-none hover:bg-gray-100"
156
+ " text-#{@color}-500 active:outline-#{@color}-500 hover:bg-gray-100 border-transparent"
122
157
  else
123
158
  ""
124
159
  end
125
160
  end
126
161
 
127
- def full_content_icon_classes
162
+ def icon_size_classes
128
163
  icon_classes = ""
129
164
 
130
165
  case @size
@@ -137,10 +172,12 @@ class Avo::ButtonComponent < ViewComponent::Base
137
172
  # When icon is solo we need to add an offset
138
173
  icon_classes += " my-1" if content.blank?
139
174
  when :md
140
- icon_classes += " h-5"
175
+ icon_classes += " h-4 my-1.5"
141
176
  # When icon is solo we need to add an offset
142
177
  icon_classes += " my-0.5" if content.blank?
143
178
  when :lg
179
+ icon_classes += " h-5 my-2"
180
+ when :xl
144
181
  icon_classes += " h-6"
145
182
  end
146
183
 
@@ -8,18 +8,18 @@
8
8
  >
9
9
  <% if item.name.present? %>
10
10
  <div
11
- class="flex justify-between px-10 pt-2 pb-0 text-gray-400"
11
+ class="flex justify-between px-10 pr-2 pt-2 pb-0 text-gray-400"
12
12
  >
13
13
  <div class="flex items-center text-xs uppercase font-semibold leading-none">
14
14
  <%= item.name %>
15
15
  </div>
16
16
  <% if collapsable %>
17
- <div class="cursor-pointer <%= 'rotate-180' if collapsed %>"
17
+ <div class="cursor-pointer <%= 'rotate-90' if collapsed %>"
18
18
  data-action="click->menu#triggerCollapse"
19
19
  data-menu-target="svg"
20
20
  data-menu-key-param="<%= key %>"
21
21
  >
22
- <%= helpers.svg 'heroicons/outline/chevron-down', class: "h-4"%>
22
+ <%= helpers.svg 'heroicons/outline/chevron-down', class: "h-4 mr-0.5"%>
23
23
  </div>
24
24
  <% end %>
25
25
  </div>
@@ -1,9 +1,9 @@
1
- <div class="flex justify-between px-6 py-2 text-gray-500">
1
+ <div class="flex justify-between px-4 pr-2 py-1 text-gray-500">
2
2
  <div class="flex items-center text-sm uppercase font-semibold leading-none space-x-1">
3
3
  <span class="min-w-[20px]"><%= icon %></span> <span><%= label %></span>
4
4
  </div>
5
5
  <% if collapsable %>
6
- <div class="cursor-pointer <%= 'rotate-180' if collapsed %>"
6
+ <div class="cursor-pointer <%= 'rotate-90' if collapsed %>"
7
7
  data-action="click->menu#triggerCollapse"
8
8
  data-menu-key-param="<%= key %>"
9
9
  data-menu-target="svg"
@@ -2,7 +2,7 @@
2
2
  <%= send link_method, path, class: classes, active: active, target: target do %>
3
3
  <%= label %>
4
4
  <% if target == :_blank %>
5
- <%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3') %>
5
+ <%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3 mr-2') %>
6
6
  <% end %>
7
7
  <% end %>
8
8
  <% else %>
@@ -23,6 +23,6 @@ class Avo::Sidebar::LinkComponent < ViewComponent::Base
23
23
  end
24
24
 
25
25
  def classes
26
- "px-4 flex-1 flex mx-6 leading-none py-2 text-black rounded font-medium hover:bg-gray-100"
26
+ "px-4 pr-0 flex-1 flex mx-6 leading-none py-2 text-black rounded font-medium hover:bg-gray-100"
27
27
  end
28
28
  end
@@ -59,14 +59,14 @@
59
59
  <% c.bare_content do %>
60
60
  <% if view_type.to_sym == :table %>
61
61
  <% if @models.present? %>
62
- <div class="mt-8">
62
+ <div class="mt-4">
63
63
  <%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model %>
64
64
  </div>
65
65
  <% end %>
66
66
  <% end %>
67
67
  <% if view_type.to_sym == :grid %>
68
68
  <%= render Avo::Index::ResourceGridComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model) %>
69
- <div class="mt-14">
69
+ <div class="mt-6">
70
70
  <%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model %>
71
71
  </div>
72
72
  <% end %>
@@ -1,7 +1,7 @@
1
1
  <div data-model-id="<%= @resource.model.id %>"
2
2
  data-selected-resources-name="<%= @resource.model_key %>"
3
3
  data-selected-resources='["<%= @resource.model.id %>"]'
4
- class="space-y-8"
4
+ class="space-y-12"
5
5
  >
6
6
  <% @resource.panels.each_with_index do |resource_panel, index| %>
7
7
  <%= render Avo::PanelComponent.new(title: title, description: @resource.resource_description, display_breadcrumbs: @reflection.blank?, index: index) do |c| %>
@@ -3,6 +3,7 @@ require_dependency "avo/application_controller"
3
3
  module Avo
4
4
  class PrivateController < ApplicationController
5
5
  def design
6
+ @page_title = "Design [Private]"
6
7
  end
7
8
  end
8
9
  end
@@ -54,12 +54,12 @@ export default class extends Controller {
54
54
  }
55
55
 
56
56
  markCollapsed() {
57
- this.svgTarget.classList.add('rotate-180')
57
+ this.svgTarget.classList.add('rotate-90')
58
58
  this.itemsTarget.classList.add('hidden')
59
59
  }
60
60
 
61
61
  markExpanded() {
62
- this.svgTarget.classList.remove('rotate-180')
62
+ this.svgTarget.classList.remove('rotate-90')
63
63
  this.itemsTarget.classList.remove('hidden')
64
64
  }
65
65
  }
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  entities = [:button, :link]
3
- sizes = [:lg, :md, :sm, :xs]
3
+ sizes = [:xl, :lg, :md, :sm, :xs].reverse
4
4
  styles = [:primary, :outline, :text]
5
5
  colors = [:primary, :gray, :red, :orange, :green]
6
6
  states = [:regular, :hover, :disabled, :active]
@@ -25,7 +25,7 @@
25
25
  <div class="flex-1 flex pt-16 relative">
26
26
  <%= render Avo::SidebarComponent.new %>
27
27
  <div class="lg:pl-64 flex-1 flex flex-col min-h-full max-w-full">
28
- <div class="content py-4 lg:p-4 px-4 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
28
+ <div class="content p-4 lg:p-6 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
29
29
  <%= render partial: "avo/partials/custom_tools_alert" if @custom_tools_alert_visible %>
30
30
  <div class="flex flex-1 flex-col justify-between items-stretch space-y-8">
31
31
  <%= yield %>
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.5.2.pre.5" unless const_defined?(:VERSION)
2
+ VERSION = "2.5.2.pre.6" unless const_defined?(:VERSION)
3
3
  end
@@ -6323,6 +6323,11 @@ progress[value]::-moz-progress-bar{
6323
6323
  margin-bottom:0.25rem
6324
6324
  }
6325
6325
 
6326
+ .my-1\.5{
6327
+ margin-top:0.375rem;
6328
+ margin-bottom:0.375rem
6329
+ }
6330
+
6326
6331
  .my-0\.5{
6327
6332
  margin-top:0.125rem;
6328
6333
  margin-bottom:0.125rem
@@ -6333,6 +6338,11 @@ progress[value]::-moz-progress-bar{
6333
6338
  margin-bottom:0px
6334
6339
  }
6335
6340
 
6341
+ .my-2{
6342
+ margin-top:0.5rem;
6343
+ margin-bottom:0.5rem
6344
+ }
6345
+
6336
6346
  .mx-6{
6337
6347
  margin-left:1.5rem;
6338
6348
  margin-right:1.5rem
@@ -6443,6 +6453,14 @@ progress[value]::-moz-progress-bar{
6443
6453
  margin-left:50%
6444
6454
  }
6445
6455
 
6456
+ .mr-0\.5{
6457
+ margin-right:0.125rem
6458
+ }
6459
+
6460
+ .mr-0{
6461
+ margin-right:0px
6462
+ }
6463
+
6446
6464
  .ml-auto{
6447
6465
  margin-left:auto
6448
6466
  }
@@ -6455,10 +6473,6 @@ progress[value]::-moz-progress-bar{
6455
6473
  margin-top:0px
6456
6474
  }
6457
6475
 
6458
- .mt-14{
6459
- margin-top:3.5rem
6460
- }
6461
-
6462
6476
  .mr-px{
6463
6477
  margin-right:1px
6464
6478
  }
@@ -6739,11 +6753,6 @@ progress[value]::-moz-progress-bar{
6739
6753
  transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
6740
6754
  }
6741
6755
 
6742
- .rotate-180{
6743
- --tw-rotate:180deg;
6744
- transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
6745
- }
6746
-
6747
6756
  .transform{
6748
6757
  transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))
6749
6758
  }
@@ -7208,6 +7217,10 @@ progress[value]::-moz-progress-bar{
7208
7217
  border-color:rgb(6 107 178 / var(--tw-border-opacity))
7209
7218
  }
7210
7219
 
7220
+ .border-transparent{
7221
+ border-color:transparent
7222
+ }
7223
+
7211
7224
  .border-slate-300{
7212
7225
  --tw-border-opacity:1;
7213
7226
  border-color:rgb(203 213 225 / var(--tw-border-opacity))
@@ -7439,6 +7452,16 @@ progress[value]::-moz-progress-bar{
7439
7452
  padding-bottom:1rem
7440
7453
  }
7441
7454
 
7455
+ .py-1\.5{
7456
+ padding-top:0.375rem;
7457
+ padding-bottom:0.375rem
7458
+ }
7459
+
7460
+ .px-5{
7461
+ padding-left:1.25rem;
7462
+ padding-right:1.25rem
7463
+ }
7464
+
7442
7465
  .py-24{
7443
7466
  padding-top:6rem;
7444
7467
  padding-bottom:6rem
@@ -7494,10 +7517,18 @@ progress[value]::-moz-progress-bar{
7494
7517
  padding-bottom:75%
7495
7518
  }
7496
7519
 
7520
+ .pr-2{
7521
+ padding-right:0.5rem
7522
+ }
7523
+
7497
7524
  .pt-2{
7498
7525
  padding-top:0.5rem
7499
7526
  }
7500
7527
 
7528
+ .pr-0{
7529
+ padding-right:0px
7530
+ }
7531
+
7501
7532
  .text-left{
7502
7533
  text-align:left
7503
7534
  }
@@ -8858,8 +8889,8 @@ trix-editor {
8858
8889
  background-color:transparent
8859
8890
  }
8860
8891
 
8861
- .lg\:p-4{
8862
- padding:1rem
8892
+ .lg\:p-6{
8893
+ padding:1.5rem
8863
8894
  }
8864
8895
 
8865
8896
  .lg\:px-8{
@@ -91,7 +91,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
91
91
  />`}setOptions(){let r;try{r=JSON.parse(this.controllerTarget.dataset.options)}catch(e){r={}}this.options=Mc(Fs({},r),{inputClasses:this.controllerTarget.dataset.inputClasses,editable:Kn(this.controllerTarget.dataset.editable)})}};ft(yw,"targets",["input","controller","rows"])});var oI,_te=te(()=>{gr();oI=class extends ht{constructor(){super(...arguments);ft(this,"spinnerMarkup",`<div class="button-spinner">
92
92
  <div class="double-bounce1"></div>
93
93
  <div class="double-bounce2"></div>
94
- </div>`);ft(this,"confirmed",!1)}connect(){this.context.scope.element.addEventListener("click",r=>{this.confirmationMessage?this.confirmed||(r.preventDefault(),window.confirm(this.confirmationMessage)&&this.applyLoader()):this.applyLoader()})}get button(){return this.context.scope.element}get confirmationMessage(){return this.context.scope.element.getAttribute("data-avo-confirm")}applyLoader(){let{button:r}=this;r.style.width=`${r.getBoundingClientRect().width}px`,r.style.height=`${r.getBoundingClientRect().height}px`,r.innerHTML=this.spinnerMarkup,r.classList.add("justify-center"),setTimeout(()=>{this.markConfirmed(),r.click(),r.setAttribute("disabled","disabled")},1)}markConfirmed(){this.confirmed=!0}markUnconfirmed(){this.confirmed=!1}}});var bw,Ste=te(()=>{gr();bw=class extends ht{constructor(){super(...arguments);ft(this,"collapsed",!0)}get key(){return this.selfTarget.getAttribute("data-menu-key-param")}get defaultState(){return this.selfTarget.getAttribute("data-menu-default-collapsed-state")}get userState(){return window.localStorage.getItem(this.key)}set userState(r){window.localStorage.setItem(this.key,r)}get initiallyCollapsed(){return this.userState==="collapsed"||this.defaultState==="collapsed"?!0:(this.userState==="expanded"||this.defaultState==="expanded",!1)}connect(){this.initiallyCollapsed?(this.collapsed=!0,this.markCollapsed()):(this.collapsed=!1,this.markExpanded())}triggerCollapse(){this.collapsed=!this.collapsed,this.userState=this.collapsed?"collapsed":"expanded",this.updateDom()}updateDom(){this.collapsed?this.markCollapsed():this.markExpanded()}markCollapsed(){this.svgTarget.classList.add("rotate-180"),this.itemsTarget.classList.add("hidden")}markExpanded(){this.svgTarget.classList.remove("rotate-180"),this.itemsTarget.classList.remove("hidden")}};ft(bw,"targets",["svg","items","self"])});var xw,kte=te(()=>{gr();xw=class extends ht{toggleSidebar(){this.sidebarTarget.classList.toggle("hidden")}};ft(xw,"targets",["sidebar"])});var ww,Ete=te(()=>{gr();ww=class extends ht{close(){this.modalTarget.remove(),document.dispatchEvent(new Event("actions-modal:close"))}delayedClose(){let r=this;setTimeout(()=>{r.modalTarget.remove(),document.dispatchEvent(new Event("actions-modal:close"))},500)}};ft(ww,"targets",["modal"])});var _w,Cte=te(()=>{bd();_w=class extends Yi{getFilterValue(){let r=Array.from(this.selectorTarget.selectedOptions).map(({value:e})=>e);return r.length===0?null:r}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};ft(_w,"targets",["selector"])});var Sw,Ate=te(()=>{gr();Sw=class extends ht{get turboFrame(){return this.selectorTarget.dataset.turboFrame}reload(){document.querySelector(`[data-per-page-option="${this.selectorTarget.value}"][data-turbo-frame="${this.turboFrame}"]`).click()}};ft(Sw,"targets",["selector"])});function wg(r){return{current:r}}var Tte=te(()=>{});function aI(r,e){var t=void 0;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];t&&clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,i)},e)}}var Dte=te(()=>{});function kw(){return"autocomplete-".concat(oVe++)}var oVe,Ote=te(()=>{oVe=0});function Pd(r,e){return e.reduce(function(t,n){return t&&t[n]},r)}var Mte=te(()=>{});function Al(r){return r.collections.length===0?0:r.collections.reduce(function(e,t){return e+t.items.length},0)}var Ite=te(()=>{});var Pte=te(()=>{});var Lte=te(()=>{});var qte=te(()=>{});var Rte=te(()=>{});var Xu=te(()=>{Tte();Dte();Ote();Mte();Ite();Pte();Lte();qte();Rte()});function Fte(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function aVe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fte(Object(t),!0).forEach(function(n){sVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fte(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function sVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nte(r,e,t){var n=e.initialState;return{getState:function(){return n},dispatch:function(o,a){var s=aVe({},n);n=r(n,{type:o,props:e,payload:a}),t({state:n,prevState:s})}}}var Bte=te(()=>{});var jte=te(()=>{});function Ld(r){return r.reduce(function(e,t){return e.concat(t)},[])}var zte=te(()=>{});function sI(r,e,t,n){if(r<0&&(e===null||n!==null&&e===0))return t+r;var i=(e===null?-1:e)+r;return i<=-1||i>=t?n===null?null:0:i}var Hte=te(()=>{});var Wte,lI=te(()=>{Wte=function(){}});function Ute(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function lVe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ute(Object(t),!0).forEach(function(n){uVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ute(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function uVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ew(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ew=function(t){return typeof t}:Ew=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ew(r)}function Vte(r,e){var t=[];return Promise.resolve(r(e)).then(function(n){return Array.isArray(n),"The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(Ew(n)),`:
94
+ </div>`);ft(this,"confirmed",!1)}connect(){this.context.scope.element.addEventListener("click",r=>{this.confirmationMessage?this.confirmed||(r.preventDefault(),window.confirm(this.confirmationMessage)&&this.applyLoader()):this.applyLoader()})}get button(){return this.context.scope.element}get confirmationMessage(){return this.context.scope.element.getAttribute("data-avo-confirm")}applyLoader(){let{button:r}=this;r.style.width=`${r.getBoundingClientRect().width}px`,r.style.height=`${r.getBoundingClientRect().height}px`,r.innerHTML=this.spinnerMarkup,r.classList.add("justify-center"),setTimeout(()=>{this.markConfirmed(),r.click(),r.setAttribute("disabled","disabled")},1)}markConfirmed(){this.confirmed=!0}markUnconfirmed(){this.confirmed=!1}}});var bw,Ste=te(()=>{gr();bw=class extends ht{constructor(){super(...arguments);ft(this,"collapsed",!0)}get key(){return this.selfTarget.getAttribute("data-menu-key-param")}get defaultState(){return this.selfTarget.getAttribute("data-menu-default-collapsed-state")}get userState(){return window.localStorage.getItem(this.key)}set userState(r){window.localStorage.setItem(this.key,r)}get initiallyCollapsed(){return this.userState==="collapsed"||this.defaultState==="collapsed"?!0:(this.userState==="expanded"||this.defaultState==="expanded",!1)}connect(){this.initiallyCollapsed?(this.collapsed=!0,this.markCollapsed()):(this.collapsed=!1,this.markExpanded())}triggerCollapse(){this.collapsed=!this.collapsed,this.userState=this.collapsed?"collapsed":"expanded",this.updateDom()}updateDom(){this.collapsed?this.markCollapsed():this.markExpanded()}markCollapsed(){this.svgTarget.classList.add("rotate-90"),this.itemsTarget.classList.add("hidden")}markExpanded(){this.svgTarget.classList.remove("rotate-90"),this.itemsTarget.classList.remove("hidden")}};ft(bw,"targets",["svg","items","self"])});var xw,kte=te(()=>{gr();xw=class extends ht{toggleSidebar(){this.sidebarTarget.classList.toggle("hidden")}};ft(xw,"targets",["sidebar"])});var ww,Ete=te(()=>{gr();ww=class extends ht{close(){this.modalTarget.remove(),document.dispatchEvent(new Event("actions-modal:close"))}delayedClose(){let r=this;setTimeout(()=>{r.modalTarget.remove(),document.dispatchEvent(new Event("actions-modal:close"))},500)}};ft(ww,"targets",["modal"])});var _w,Cte=te(()=>{bd();_w=class extends Yi{getFilterValue(){let r=Array.from(this.selectorTarget.selectedOptions).map(({value:e})=>e);return r.length===0?null:r}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};ft(_w,"targets",["selector"])});var Sw,Ate=te(()=>{gr();Sw=class extends ht{get turboFrame(){return this.selectorTarget.dataset.turboFrame}reload(){document.querySelector(`[data-per-page-option="${this.selectorTarget.value}"][data-turbo-frame="${this.turboFrame}"]`).click()}};ft(Sw,"targets",["selector"])});function wg(r){return{current:r}}var Tte=te(()=>{});function aI(r,e){var t=void 0;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];t&&clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,i)},e)}}var Dte=te(()=>{});function kw(){return"autocomplete-".concat(oVe++)}var oVe,Ote=te(()=>{oVe=0});function Pd(r,e){return e.reduce(function(t,n){return t&&t[n]},r)}var Mte=te(()=>{});function Al(r){return r.collections.length===0?0:r.collections.reduce(function(e,t){return e+t.items.length},0)}var Ite=te(()=>{});var Pte=te(()=>{});var Lte=te(()=>{});var qte=te(()=>{});var Rte=te(()=>{});var Xu=te(()=>{Tte();Dte();Ote();Mte();Ite();Pte();Lte();qte();Rte()});function Fte(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function aVe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fte(Object(t),!0).forEach(function(n){sVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fte(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function sVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Nte(r,e,t){var n=e.initialState;return{getState:function(){return n},dispatch:function(o,a){var s=aVe({},n);n=r(n,{type:o,props:e,payload:a}),t({state:n,prevState:s})}}}var Bte=te(()=>{});var jte=te(()=>{});function Ld(r){return r.reduce(function(e,t){return e.concat(t)},[])}var zte=te(()=>{});function sI(r,e,t,n){if(r<0&&(e===null||n!==null&&e===0))return t+r;var i=(e===null?-1:e)+r;return i<=-1||i>=t?n===null?null:0:i}var Hte=te(()=>{});var Wte,lI=te(()=>{Wte=function(){}});function Ute(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function lVe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Ute(Object(t),!0).forEach(function(n){uVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Ute(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function uVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ew(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ew=function(t){return typeof t}:Ew=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ew(r)}function Vte(r,e){var t=[];return Promise.resolve(r(e)).then(function(n){return Array.isArray(n),"The `getSources` function must return an array of sources but returned type ".concat(JSON.stringify(Ew(n)),`:
95
95
 
96
96
  `).concat(JSON.stringify(n,null,2)),Promise.all(n.filter(function(i){return Boolean(i)}).map(function(i){if(i.sourceId,t.includes(i.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(i.sourceId)," is not unique."));t.push(i.sourceId);var o=lVe({getItemInputValue:function(s){var u=s.state;return u.query},getItemUrl:function(){},onSelect:function(s){var u=s.setIsOpen;u(!1)},onActive:Wte},i);return Promise.resolve(o)}))})}var $te=te(()=>{lI()});function cVe(r){var e=r.collections.map(function(n){return n.items.length}).reduce(function(n,i,o){var a=n[o-1]||0,s=a+i;return n.push(s),n},[]),t=e.reduce(function(n,i){return i<=r.activeItemId?n+1:n},0);return r.collections[t]}function fVe(r){for(var e=r.state,t=r.collection,n=!1,i=0,o=0;n===!1;){var a=e.collections[i];if(a===t){n=!0;break}o+=a.items.length,i++}return e.activeItemId-o}function Oa(r){var e=cVe(r);if(!e)return null;var t=e.items[fVe({state:r,collection:e})],n=e.source,i=n.getItemInputValue({item:t,state:r}),o=n.getItemUrl({item:t,state:r});return{item:t,itemInputValue:i,itemUrl:o,source:n}}var Yte=te(()=>{});function uI(r,e){return r===e||r.contains(e)}var Kte=te(()=>{});function Gte(r){return{results:r,hits:r.map(function(e){return e.hits}).filter(Boolean),facetHits:r.map(function(e){var t;return(t=e.facetHits)===null||t===void 0?void 0:t.map(function(n){return{label:n.value,count:n.count,_highlightResult:{label:{value:n.highlighted}}}})}).filter(Boolean)}}var Xte=te(()=>{});var ws=te(()=>{jte();zte();Hte();$te();Yte();Kte();Xte();lI()});function Qte(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Cw(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qte(Object(t),!0).forEach(function(n){dVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Qte(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zte(r){var e=r.store,t=function(f){e.dispatch("setActiveItemId",f)},n=function(f){e.dispatch("setQuery",f)},i=function(f){var c=0,h=f.map(function(p){return Cw(Cw({},p),{},{items:Ld(p.items).map(function(m){return Cw(Cw({},m),{},{__autocomplete_id:c++})})})});e.dispatch("setCollections",h)},o=function(f){e.dispatch("setIsOpen",f)},a=function(f){e.dispatch("setStatus",f)},s=function(f){e.dispatch("setContext",f)};return{setActiveItemId:t,setQuery:n,setCollections:i,setIsOpen:o,setStatus:a,setContext:s}}var Jte=te(()=>{ws()});function hVe(r){return vVe(r)||gVe(r)||mVe(r)||pVe()}function pVe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
97
97
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mVe(r,e){if(!!r){if(typeof r=="string")return cI(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return cI(r,e)}}function gVe(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function vVe(r){if(Array.isArray(r))return cI(r)}function cI(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function ere(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qd(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ere(Object(t),!0).forEach(function(n){yVe(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):ere(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function yVe(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function tre(r,e){var t,n=typeof window<"u"?window:{},i=r.plugins||[];return qd(qd({debug:!1,openOnFocus:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,environment:n,shouldPanelOpen:function(a){var s=a.state;return Al(s)>0}},r),{},{id:(t=r.id)!==null&&t!==void 0?t:kw(),plugins:i,initialState:qd({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},r.initialState),onStateChange:function(a){var s;(s=r.onStateChange)===null||s===void 0||s.call(r,a),i.forEach(function(u){var f;return(f=u.onStateChange)===null||f===void 0?void 0:f.call(u,a)})},onSubmit:function(a){var s;(s=r.onSubmit)===null||s===void 0||s.call(r,a),i.forEach(function(u){var f;return(f=u.onSubmit)===null||f===void 0?void 0:f.call(u,a)})},onReset:function(a){var s;(s=r.onReset)===null||s===void 0||s.call(r,a),i.forEach(function(u){var f;return(f=u.onReset)===null||f===void 0?void 0:f.call(u,a)})},getSources:function(a){return Promise.all([].concat(hVe(i.map(function(s){return s.getSources})),[r.getSources]).filter(Boolean).map(function(s){return Vte(s,a)})).then(function(s){return Ld(s)}).then(function(s){return s.map(function(u){return qd(qd({},u),{},{onSelect:function(c){u.onSelect(c),e.forEach(function(h){var p;return(p=h.onSelect)===null||p===void 0?void 0:p.call(h,c)})},onActive:function(c){u.onActive(c),e.forEach(function(h){var p;return(p=h.onActive)===null||p===void 0?void 0:p.call(h,c)})}})})})},navigator:qd({navigate:function(a){var s=a.itemUrl;n.location.assign(s)},navigateNewTab:function(a){var s=a.itemUrl,u=n.open(s,"_blank","noopener");u?.focus()},navigateNewWindow:function(a){var s=a.itemUrl;n.open(s,"_blank","noopener")}},r.navigator)})}var fI=te(()=>{Xu();ws()});function Tw(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Tw=function(t){return typeof t}:Tw=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tw(r)}function bVe(r){return SVe(r)||_Ve(r)||wVe(r)||xVe()}function xVe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.